Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sbb-autocomplete): introduce size s #3020

Merged
merged 6 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,16 @@ const borderless: InputType = {
},
};

const size: InputType = {
control: {
type: 'inline-radio',
},
options: ['m', 's'],
table: {
category: 'Form field',
},
};

const floatingLabel: InputType = {
control: {
type: 'boolean',
Expand Down Expand Up @@ -190,6 +200,7 @@ const defaultArgTypes: ArgTypes = {
// Form field args
negative,
borderless,
size,
floatingLabel,

// Input args
Expand Down Expand Up @@ -218,6 +229,7 @@ const defaultArgs: Args = {
// Form field args
negative: false,
borderless: false,
size: size.options![0],
floatingLabel: false,

// Input args
Expand Down Expand Up @@ -304,6 +316,7 @@ const Template = (args: Args): TemplateResult => html`
<sbb-form-field
?negative=${args.negative}
?borderless=${args.borderless}
size=${args.size}
?floating-label=${args.floatingLabel}
data-testid="form-field"
>
Expand Down Expand Up @@ -337,6 +350,7 @@ const OptionGroupTemplate = (args: Args): TemplateResult => html`
?negative=${args.negative}
?borderless=${args.borderless}
?floating-label=${args.floatingLabel}
size=${args.size}
data-testid="form-field"
>
<label>Label</label>
Expand Down Expand Up @@ -386,6 +400,13 @@ export const Negative: StoryObj = {
play: isChromatic() ? playStory : undefined,
};

export const BasicSizeS: StoryObj = {
render: Template,
argTypes: defaultArgTypes,
args: { ...defaultArgs, size: size.options![1] },
play: isChromatic() ? playStory : undefined,
};

export const Disabled: StoryObj = {
render: Template,
argTypes: defaultArgTypes,
Expand Down Expand Up @@ -426,6 +447,27 @@ export const BorderlessNegative: StoryObj = {
play: isChromatic() ? playStory : undefined,
};

export const BorderlessSizeS: StoryObj = {
render: Template,
argTypes: defaultArgTypes,
args: { ...defaultArgs, borderless: true, size: size.options![1] },
play: isChromatic() ? playStory : undefined,
};

export const FloatingLabel: StoryObj = {
render: Template,
argTypes: defaultArgTypes,
args: { ...defaultArgs, floatingLabel: true },
play: isChromatic() ? playStory : undefined,
};

export const FloatingLabelSizeS: StoryObj = {
render: Template,
argTypes: defaultArgTypes,
args: { ...defaultArgs, floatingLabel: true, size: size.options![1] },
play: isChromatic() ? playStory : undefined,
};

export const BasicOpenAbove: StoryObj = {
render: Template,
argTypes: defaultArgTypes,
Expand Down Expand Up @@ -463,6 +505,13 @@ export const WithOptionGroup: StoryObj = {
play: isChromatic() ? playStory : undefined,
};

export const WithOptionGroupSizeS: StoryObj = {
render: OptionGroupTemplate,
argTypes: withGroupsArgTypes,
args: { ...withGroupsDefaultArgs, size: size.options![1] },
play: isChromatic() ? playStory : undefined,
};

export const WithOptionGroupNegative: StoryObj = {
render: OptionGroupTemplate,
argTypes: withGroupsArgTypes,
Expand Down
Loading
Loading