2.0.1 • Published 4 years ago

@chameleon-ds/timezone v2.0.1

Weekly downloads
9
License
MIT
Repository
github
Last release
4 years ago

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 NameType(s)Default ValueDescription
requiredBooleanfalseA Boolean which, if true, indicates that the timezone must have a value before the form can be submitted
invalidBooleanfalseInvalid boolean to allow validity access from higher level form errors
readonlyBooleanfalseA Boolean attribute which, if true, indicates that the timezone cannot be edited
disabledBooleanfalseA Boolean attribute which is present if the timezone should be disabled
nameString"cha-timezone"The timezone's form name
timezoneLabelString""The timezone's label
timezoneSubLabelString""The timezone's sub label
errorsArray[]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>
`;
2.0.1

4 years ago

2.0.0

4 years ago

1.0.3

4 years ago

0.3.0

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago