-
Notifications
You must be signed in to change notification settings - Fork 11
feat(components): add size prop to Input #1953
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
base: main
Are you sure you want to change the base?
Changes from 10 commits
5c61d40
fc211fa
e2deefb
5e4c9be
4fa3732
6e5d1d8
a0662ff
cb5e785
b4228c0
6f2ff99
b5dbec3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@launchpad-ui/components': minor | ||
| --- | ||
|
|
||
| Add a `size` prop to `Input` with `small` (24px tall) and `medium` (32px tall, the default) variants, matching the corresponding `Button` sizes so inputs and buttons align when placed side by side. `small` uses 11px text to match `Button`'s small height. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| .area { | ||
| flex: unset; | ||
| /* +1 to align with input elements who are granted a 1px useragent buffer */ | ||
| padding-block: calc(var(--lp-size-4) + var(--lp-size-1)); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this about?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This replaces the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. context: this Multi Line story regressed due to the |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| import type { Meta, StoryObj } from '@storybook/react-vite'; | ||
|
|
||
| import { Input } from '../src/Input'; | ||
|
|
||
| const meta: Meta<typeof Input> = { | ||
| title: 'Components/Forms/Input', | ||
| component: Input, | ||
| parameters: { | ||
| figma: { | ||
| design: | ||
| 'https://www.figma.com/design/98HKKXL2dTle29ikJ3tzk7/%F0%9F%9A%80-LaunchPad?node-id=1-34456&m=dev', | ||
| }, | ||
| docs: { | ||
| description: { | ||
| component: ` | ||
| An input allows a user to input text. | ||
|
|
||
| Usually composed within a [TextField](/docs/components-forms-textfield--docs) alongside a [Label](/docs/components-content-label--docs) for an accessible field. | ||
| `, | ||
| }, | ||
| }, | ||
| }, | ||
| }; | ||
|
|
||
| export default meta; | ||
|
|
||
| type Story = StoryObj<typeof Input>; | ||
|
|
||
| export const Default: Story = { | ||
| args: { | ||
| 'aria-label': 'Example', | ||
| defaultValue: 'Value', | ||
| }, | ||
| }; | ||
|
|
||
| /** | ||
| * Use the `size` prop to match the height of adjacent controls such as [Button](/docs/components-buttons-button--docs). | ||
| */ | ||
| export const Sizes: Story = { | ||
| render: () => ( | ||
| <div style={{ display: 'flex', flexDirection: 'column', gap: '1rem' }}> | ||
| <Input aria-label="Small" size="small" defaultValue="Small" /> | ||
| <Input aria-label="Medium" size="medium" defaultValue="Medium" /> | ||
| </div> | ||
| ), | ||
| }; | ||
|
|
||
| /** | ||
| * The `minimal` variant removes the resting border for use in denser or inline layouts. | ||
| */ | ||
| export const Variants: Story = { | ||
| render: () => ( | ||
| <div style={{ display: 'flex', flexDirection: 'column', gap: '1rem' }}> | ||
| <Input aria-label="Default" variant="default" defaultValue="Default" /> | ||
| <Input aria-label="Minimal" variant="minimal" defaultValue="Minimal" /> | ||
| </div> | ||
| ), | ||
| }; |

Uh oh!
There was an error while loading. Please reload this page.