-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from jtiala/form-components
New components: Button, Input, Textarea
- Loading branch information
Showing
44 changed files
with
3,086 additions
and
1,628 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import type { Decorator, Meta, StoryObj } from "@storybook/react"; | ||
import { Button, Input, Stack } from "@themeless-ui/react"; | ||
|
||
const meta = { | ||
title: "Form/Input", | ||
component: Input, | ||
tags: ["autodocs"], | ||
} satisfies Meta<typeof Input>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
const labelDecorator: Decorator = (Story) => ( | ||
<Stack> | ||
<label htmlFor="input">Label</label> | ||
<Story /> | ||
</Stack> | ||
); | ||
|
||
export const Primary: Story = { | ||
args: { | ||
id: "input", | ||
}, | ||
decorators: [labelDecorator], | ||
}; | ||
|
||
export const Disabled: Story = { | ||
args: { | ||
id: "input", | ||
value: "Input", | ||
disabled: true, | ||
}, | ||
decorators: [labelDecorator], | ||
}; | ||
|
||
export const ReadOnly: Story = { | ||
args: { | ||
id: "input", | ||
value: "Input", | ||
readOnly: true, | ||
}, | ||
decorators: [labelDecorator], | ||
}; | ||
|
||
export const Placeholder: Story = { | ||
args: { | ||
id: "input", | ||
placeholder: "Input", | ||
}, | ||
decorators: [labelDecorator], | ||
}; | ||
|
||
export const UsingWithButton = { | ||
render: () => ( | ||
<Stack direction="horizontal"> | ||
<Stack> | ||
<label htmlFor="input">Label</label> | ||
<Input id="input" placeholder="Enter keyword..." /> | ||
</Stack> | ||
<Button type="submit">Search</Button> | ||
</Stack> | ||
), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import type { Decorator, Meta, StoryObj } from "@storybook/react"; | ||
import { Button, Stack, Textarea } from "@themeless-ui/react"; | ||
|
||
const meta = { | ||
title: "Form/Textarea", | ||
component: Textarea, | ||
tags: ["autodocs"], | ||
} satisfies Meta<typeof Textarea>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
const labelDecorator: Decorator = (Story) => ( | ||
<Stack> | ||
<label htmlFor="textarea">Label</label> | ||
<Story /> | ||
</Stack> | ||
); | ||
|
||
export const Primary: Story = { | ||
args: { | ||
id: "textarea", | ||
}, | ||
decorators: [labelDecorator], | ||
}; | ||
|
||
export const Disabled: Story = { | ||
args: { | ||
id: "textarea", | ||
value: "Textarea", | ||
disabled: true, | ||
}, | ||
decorators: [labelDecorator], | ||
}; | ||
|
||
export const ReadOnly: Story = { | ||
args: { | ||
id: "textarea", | ||
value: "Textarea", | ||
readOnly: true, | ||
}, | ||
decorators: [labelDecorator], | ||
}; | ||
|
||
export const Placeholder: Story = { | ||
args: { | ||
id: "textarea", | ||
placeholder: "Textarea", | ||
}, | ||
decorators: [labelDecorator], | ||
}; | ||
|
||
export const UsingWithButton = { | ||
render: () => ( | ||
<Stack> | ||
<Stack> | ||
<label htmlFor="textarea">Label</label> | ||
<Textarea id="textarea" placeholder="Write your comment here..." /> | ||
</Stack> | ||
<Button type="submit">Send</Button> | ||
</Stack> | ||
), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.