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

ui-core : add narrow style for select component #923

Merged
merged 2 commits into from
Feb 24, 2025
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
2 changes: 2 additions & 0 deletions ui-core/src/components/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const Select = <T,>({
statusWithMessage,
required,
disabled,
narrow,
readOnly,
small,
getOptionLabel,
Expand Down Expand Up @@ -58,6 +59,7 @@ const Select = <T,>({
required={required}
disabled={disabled}
small={small}
narrow={narrow}
>
<select
id={id}
Expand Down
13 changes: 13 additions & 0 deletions ui-core/src/stories/DatePicker.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,19 @@ export const Single: Story = {
},
};

export const Narrow: Story = {
args: {
isRangeMode: false,
value: now,
inputProps: {
id: 'date-picker-narrow',
label: 'Select a date',
narrow: true,
inputFieldWrapperClassname: 'date-picker-input-wrapper',
},
},
};

export const Range: Story = {
args: {
isRangeMode: true,
Expand Down
8 changes: 8 additions & 0 deletions ui-core/src/stories/Select.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ export const Default: StoryType = {
},
};

export const Narrow: StoryType = {
args: {
id: 'Narrow',
value: undefined,
narrow: true,
},
};

export const LongText: StoryType = {
args: {
id: 'LongText',
Expand Down
14 changes: 14 additions & 0 deletions ui-core/src/stories/TimePicker.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,20 @@ export const Default: Story = {
],
};

export const Narrow: Story = {
args: {
label: 'Time',
narrow: true,
},
decorators: [
(Story) => (
<div style={{ maxWidth: '6.7rem', minHeight: '500px' }}>
<Story />
</div>
),
],
};

export const DisabledTimePicker: Story = {
args: {
disabled: true,
Expand Down
7 changes: 7 additions & 0 deletions ui-core/src/stories/TolerancePicker.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ export const Default: Story = {
},
};

export const Narrow: Story = {
args: {
label: 'Tolerance',
narrow: true,
},
};

export const DisabledTolerancePicker: Story = {
args: {
disabled: true,
Expand Down