-
-
Notifications
You must be signed in to change notification settings - Fork 2
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 #28 from xyhomi3/add-storybook
Storybook: Optimise config
- Loading branch information
Showing
10 changed files
with
359 additions
and
67 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@omi3/ui': patch | ||
'@omi3/site': patch | ||
--- | ||
|
||
optimize storybook configs |
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 |
---|---|---|
|
@@ -38,3 +38,4 @@ yarn-error.log* | |
*.pem | ||
*storybook.log | ||
storybook-static | ||
test-results |
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 |
---|---|---|
@@ -1 +1 @@ | ||
public-hoist-pattern=* | ||
public-hoist-pattern=* |
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,6 @@ | ||
import { addons } from '@storybook/manager-api'; | ||
import theme from './theme'; | ||
|
||
addons.setConfig({ | ||
theme, | ||
}); |
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,6 @@ | ||
import { create } from '@storybook/theming'; | ||
|
||
export default create({ | ||
brandTitle: 'Omi3 UI', | ||
brandTarget: '_self', | ||
}); |
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 |
---|---|---|
@@ -1,21 +1,60 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
|
||
import { Input } from '.'; | ||
import { Input } from "."; | ||
import { action } from '@storybook/addon-actions'; | ||
|
||
const meta = { | ||
const meta: Meta<typeof Input> = { | ||
title: "UI/Input", | ||
component: Input, | ||
parameters: { | ||
layout: "centered", | ||
docs: { | ||
description: { | ||
component: "The Input component is a fundamental UI element used to trigger actions or events in a user interface. It is a clickable button that can be customized with various styles and functionalities to enhance user experience.", | ||
component: | ||
"The Input component is a fundamental UI element used for text or data input. It can be customized with various styles and functionalities to enhance user experience.", | ||
}, | ||
}, | ||
}, | ||
} satisfies Meta<typeof Input>; | ||
argTypes: { | ||
|
||
disabled: { control: "boolean", description: "The disabled state of the input" }, | ||
placeholder: { control: "text", description: "The placeholder text of the input" }, | ||
onChange: { action: 'changed' }, | ||
onFocus: { action: 'focused' }, | ||
onBlur: { action: 'blurred' }, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof Input>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
placeholder: "Enter text", | ||
onChange: action('onChange'), | ||
}, | ||
}; | ||
|
||
type Story = StoryObj<typeof meta>; | ||
export const Password: Story = { | ||
args: { | ||
type: "password", | ||
placeholder: "Password", | ||
onChange: action('onChange'), | ||
}, | ||
}; | ||
|
||
export const Email: Story = { | ||
args: { | ||
type: "email", | ||
placeholder: "Email", | ||
onChange: action('onChange'), | ||
}, | ||
}; | ||
|
||
export const Default: Story = {}; | ||
export const Disabled: Story = { | ||
args: { | ||
disabled: true, | ||
placeholder: "Disabled", | ||
onChange: action('onChange'), | ||
}, | ||
}; |
Oops, something went wrong.