@chameleon-ds/timezone

2.0.1 • Public • Published

Chameleon Timezone

import { html } from "@open-wc/demoing-storybook";
import { withKnobs, text, boolean } from "@open-wc/demoing-storybook";
import "./chameleon-timezone.js";

export default {
  title: "Components|Form Elements/Timezone",
  component: "chameleon-timezone",
  decorators: [withKnobs],
  options: { selectedPanel: "storybookjs/docs/panel" },
};

Properties

Property Name Type(s) Default Value Description
required Boolean false A Boolean which, if true, indicates that the timezone must have a value before the form can be submitted
invalid Boolean false Invalid boolean to allow validity access from higher level form errors
readonly Boolean false A Boolean attribute which, if true, indicates that the timezone cannot be edited
disabled Boolean false A Boolean attribute which is present if the timezone should be disabled
name String "cha-timezone" The timezone's form name
timezoneLabel String "" The timezone's label
timezoneSubLabel String "" The timezone's sub label
errors Array [] The skeleton's circle height

Examples

Default

export const Default = () => {
  const timezoneLabel = text("Label", "Please select your Timezone");
  const timezoneSubLabel = text("Sub Label", "");
  const readonly = boolean("Read Only", false);
  const invalid = boolean("Invalid", false);
  const required = boolean("Required", false);
  const disabled = boolean("Disabled", false);

  return html`
    <chameleon-timezone
      .timezoneLabel="${timezoneLabel}"
      .timezoneSubLabel="${timezoneSubLabel}"
      ?readonly="${readonly}"
      ?required="${required}"
      ?disabled="${disabled}"
      ?invalid="${invalid}"
    ></chameleon-timezone>
  `;
};

Error State

export const ErrorState = () => html`
  <chameleon-timezone
    timezoneLabel="Please select your Timezone"
    ?invalid="${true}"
    .errors="${["Field cannot be left blank"]}"
  ></chameleon-timezone>
`;

Readme

Keywords

none

Package Sidebar

Install

npm i @chameleon-ds/timezone

Weekly Downloads

1

Version

2.0.1

License

MIT

Unpacked Size

37.7 kB

Total Files

8

Last publish

Collaborators

  • chuckhousley
  • zemptime
  • mandymichel
  • olerk16
  • tfreiner
  • kewalter
  • ryuhhnn