@ubie/vitals-ui-consumer 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/main.ts +14 -0
- package/.storybook/preview.tsx +25 -0
- package/.storybook/vitest.setup.ts +7 -0
- package/dist/chunk-DKo7XVKm.mjs +33 -0
- package/dist/index.d.mts +1720 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +10594 -0
- package/dist/index.mjs.map +1 -0
- package/dist/style.css +2299 -0
- package/package.json +47 -0
- package/src/components/Accordion/Accordion.module.css +75 -0
- package/src/components/Accordion/Accordion.spec.tsx +18 -0
- package/src/components/Accordion/Accordion.stories.tsx +61 -0
- package/src/components/Accordion/Accordion.tsx +89 -0
- package/src/components/ActionHalfModal/ActionHalfModal.module.css +180 -0
- package/src/components/ActionHalfModal/ActionHalfModal.spec.tsx +57 -0
- package/src/components/ActionHalfModal/ActionHalfModal.stories.tsx +469 -0
- package/src/components/ActionHalfModal/ActionHalfModal.tsx +269 -0
- package/src/components/ActionModal/ActionModal.module.css +145 -0
- package/src/components/ActionModal/ActionModal.spec.tsx +57 -0
- package/src/components/ActionModal/ActionModal.stories.tsx +302 -0
- package/src/components/ActionModal/ActionModal.tsx +232 -0
- package/src/components/Bold/Bold.module.css +4 -0
- package/src/components/Bold/Bold.spec.tsx +24 -0
- package/src/components/Bold/Bold.stories.tsx +54 -0
- package/src/components/Bold/Bold.tsx +31 -0
- package/src/components/Box/Box.module.css +46 -0
- package/src/components/Box/Box.spec.tsx +188 -0
- package/src/components/Box/Box.tsx +242 -0
- package/src/components/Button/Button.module.css +261 -0
- package/src/components/Button/Button.spec.tsx +82 -0
- package/src/components/Button/Button.tsx +99 -0
- package/src/components/Button/ButtonTypes.ts +107 -0
- package/src/components/Button/LinkButton.spec.tsx +86 -0
- package/src/components/Button/LinkButton.tsx +80 -0
- package/src/components/Button/VariantIcon.tsx +20 -0
- package/src/components/Button/useIcon.tsx +16 -0
- package/src/components/ButtonCard/ButtonCard.module.css +35 -0
- package/src/components/ButtonCard/ButtonCard.spec.tsx +18 -0
- package/src/components/ButtonCard/ButtonCard.stories.tsx +54 -0
- package/src/components/ButtonCard/ButtonCard.tsx +18 -0
- package/src/components/Center/Center.module.css +19 -0
- package/src/components/Center/Center.spec.tsx +143 -0
- package/src/components/Center/Center.tsx +108 -0
- package/src/components/Checkbox/Checkbox.module.css +124 -0
- package/src/components/Checkbox/Checkbox.spec.tsx +17 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +213 -0
- package/src/components/Checkbox/Checkbox.tsx +50 -0
- package/src/components/CheckboxCard/CheckboxCard.module.css +102 -0
- package/src/components/CheckboxCard/CheckboxCard.spec.tsx +16 -0
- package/src/components/CheckboxCard/CheckboxCard.stories.tsx +205 -0
- package/src/components/CheckboxCard/CheckboxCard.tsx +53 -0
- package/src/components/CheckboxGroup/CheckboxGroup.module.css +16 -0
- package/src/components/CheckboxGroup/CheckboxGroup.spec.tsx +17 -0
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +64 -0
- package/src/components/Color/Color.module.css +3 -0
- package/src/components/Color/Color.spec.tsx +24 -0
- package/src/components/Color/Color.stories.tsx +71 -0
- package/src/components/Color/Color.tsx +28 -0
- package/src/components/Divider/Divider.module.css +9 -0
- package/src/components/Divider/Divider.spec.tsx +42 -0
- package/src/components/Divider/Divider.stories.tsx +77 -0
- package/src/components/Divider/Divider.tsx +49 -0
- package/src/components/ErrorMessage/ErrorMessage.module.css +8 -0
- package/src/components/ErrorMessage/ErrorMessage.spec.tsx +12 -0
- package/src/components/ErrorMessage/ErrorMessage.tsx +20 -0
- package/src/components/Flex/Flex.module.css +24 -0
- package/src/components/Flex/Flex.spec.tsx +188 -0
- package/src/components/Flex/Flex.tsx +173 -0
- package/src/components/FlexItem/FlexItem.module.css +14 -0
- package/src/components/FlexItem/FlexItem.spec.tsx +84 -0
- package/src/components/FlexItem/FlexItem.tsx +106 -0
- package/src/components/Heading/Heading.module.css +131 -0
- package/src/components/Heading/Heading.tsx +86 -0
- package/src/components/HelperMessage/HelperMessage.module.css +8 -0
- package/src/components/HelperMessage/HelperMessage.tsx +15 -0
- package/src/components/Icon/Icon.module.css +6 -0
- package/src/components/Icon/Icon.spec.tsx +24 -0
- package/src/components/Icon/Icon.stories.tsx +100 -0
- package/src/components/Icon/Icon.tsx +101 -0
- package/src/components/Input/Input.module.css +51 -0
- package/src/components/Input/Input.spec.tsx +14 -0
- package/src/components/Input/Input.tsx +27 -0
- package/src/components/Label/Label.module.css +14 -0
- package/src/components/Label/Label.tsx +39 -0
- package/src/components/LinkCard/LinkCard.module.css +72 -0
- package/src/components/LinkCard/LinkCard.tsx +96 -0
- package/src/components/MessageHalfModal/MessageHalfModal.module.css +181 -0
- package/src/components/MessageHalfModal/MessageHalfModal.spec.tsx +73 -0
- package/src/components/MessageHalfModal/MessageHalfModal.stories.tsx +242 -0
- package/src/components/MessageHalfModal/MessageHalfModal.tsx +194 -0
- package/src/components/MessageModal/MessageModal.module.css +149 -0
- package/src/components/MessageModal/MessageModal.spec.tsx +57 -0
- package/src/components/MessageModal/MessageModal.stories.tsx +223 -0
- package/src/components/MessageModal/MessageModal.tsx +178 -0
- package/src/components/Pre/Pre.module.css +8 -0
- package/src/components/Pre/Pre.spec.tsx +11 -0
- package/src/components/Pre/Pre.stories.tsx +76 -0
- package/src/components/Pre/Pre.tsx +40 -0
- package/src/components/RadioButton/RadioButton.module.css +92 -0
- package/src/components/RadioButton/RadioButton.spec.tsx +25 -0
- package/src/components/RadioButton/RadioButton.tsx +55 -0
- package/src/components/RadioCard/RadioCard.module.css +109 -0
- package/src/components/RadioCard/RadioCard.tsx +61 -0
- package/src/components/RadioGroup/RadioGroup.module.css +16 -0
- package/src/components/RadioGroup/RadioGroup.spec.tsx +17 -0
- package/src/components/RadioGroup/RadioGroup.tsx +60 -0
- package/src/components/Select/Select.module.css +70 -0
- package/src/components/Select/Select.spec.tsx +12 -0
- package/src/components/Select/Select.tsx +56 -0
- package/src/components/Stack/Stack.module.css +10 -0
- package/src/components/Stack/Stack.spec.tsx +177 -0
- package/src/components/Stack/Stack.tsx +151 -0
- package/src/components/Stepper/Stepper.module.css +137 -0
- package/src/components/Stepper/Stepper.spec.tsx +198 -0
- package/src/components/Stepper/Stepper.stories.tsx +192 -0
- package/src/components/Stepper/Stepper.tsx +70 -0
- package/src/components/Stepper/StepperItem.tsx +113 -0
- package/src/components/Text/Text.module.css +168 -0
- package/src/components/Text/Text.tsx +192 -0
- package/src/components/TextArea/TextArea.module.css +46 -0
- package/src/components/TextArea/TextArea.spec.tsx +13 -0
- package/src/components/TextArea/TextArea.tsx +29 -0
- package/src/components/Toggle/Toggle.module.css +71 -0
- package/src/components/Toggle/Toggle.spec.tsx +21 -0
- package/src/components/Toggle/Toggle.tsx +56 -0
- package/src/font.ts +2 -0
- package/src/hooks/useScrollable.ts +58 -0
- package/src/icons/AppleIcon.tsx +14 -0
- package/src/icons/GoogleIcon.tsx +27 -0
- package/src/icons/LINEIcon.tsx +16 -0
- package/src/index.ts +35 -0
- package/src/sharedComponents/RequiredLabel/RequiredLabel.module.css +10 -0
- package/src/sharedComponents/RequiredLabel/RequiredLabel.tsx +8 -0
- package/src/sharedComponents/VisuallyHidden/VisuallyHidden.module.css +15 -0
- package/src/sharedComponents/VisuallyHidden/VisuallyHidden.tsx +22 -0
- package/src/stories/Accordion.stories.portable.ts +4 -0
- package/src/stories/Box.stories.tsx +474 -0
- package/src/stories/Button.stories.tsx +262 -0
- package/src/stories/Center.stories.tsx +126 -0
- package/src/stories/ErrorMessage.stories.tsx +19 -0
- package/src/stories/Flex.stories.tsx +345 -0
- package/src/stories/Form.stories.tsx +83 -0
- package/src/stories/Heading.stories.tsx +263 -0
- package/src/stories/HelperMessage.stories.tsx +22 -0
- package/src/stories/Input.stories.tsx +145 -0
- package/src/stories/Label.stories.tsx +32 -0
- package/src/stories/LinkButton.stories.tsx +207 -0
- package/src/stories/LinkCard.stories.tsx +90 -0
- package/src/stories/RadioButton.stories.tsx +168 -0
- package/src/stories/RadioCard.stories.tsx +236 -0
- package/src/stories/Select.stories.tsx +97 -0
- package/src/stories/Stack.stories.tsx +167 -0
- package/src/stories/Text.stories.tsx +396 -0
- package/src/stories/TextArea.stories.tsx +49 -0
- package/src/stories/Toggle.stories.tsx +30 -0
- package/src/test/vitest-jest-dom.d.ts +12 -0
- package/src/types/attributes.ts +6 -0
- package/src/types/global.d.ts +11 -0
- package/src/types/icon.ts +3 -0
- package/src/types/style.ts +254 -0
- package/src/utils/component.ts +8 -0
- package/src/utils/style.spec.ts +57 -0
- package/src/utils/style.ts +387 -0
- package/src/utils/types.ts +8 -0
- package/tsconfig.json +18 -0
- package/tsconfig.spec-lint.tsbuildinfo +1 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/vite.config.ts +50 -0
- package/vitest.shims.d.ts +1 -0
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { BlankLinkIcon, TrashIcon } from "@ubie/vitals-icon";
|
|
3
|
+
import { ComponentProps } from "react";
|
|
4
|
+
import { Button, Icon, Stack } from "../";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Button/Button",
|
|
8
|
+
component: Button,
|
|
9
|
+
} satisfies Meta<typeof Button>;
|
|
10
|
+
|
|
11
|
+
type Story = StoryObj<typeof Button>;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Using Story's args, a non-existent prop is treated as having a value if its type is required.
|
|
15
|
+
*/
|
|
16
|
+
const defaultArgs = {
|
|
17
|
+
children: "ボタン",
|
|
18
|
+
disabled: false,
|
|
19
|
+
} satisfies Partial<ComponentProps<typeof Button>>;
|
|
20
|
+
|
|
21
|
+
export const Default: Story = {
|
|
22
|
+
render: () => (
|
|
23
|
+
<div style={{ display: "flex", flexDirection: "row", alignItems: "flex-start", gap: "32px" }}>
|
|
24
|
+
<Button {...defaultArgs} />
|
|
25
|
+
<Button {...defaultArgs} variant="secondary" />
|
|
26
|
+
<Button {...defaultArgs} variant="alert" />
|
|
27
|
+
<Button {...defaultArgs} variant="text" />
|
|
28
|
+
<Button {...defaultArgs} variant="textAlert" />
|
|
29
|
+
</div>
|
|
30
|
+
),
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const Size: Story = {
|
|
34
|
+
render: () => (
|
|
35
|
+
<div style={{ display: "flex", flexDirection: "row", alignItems: "flex-start", gap: "32px" }}>
|
|
36
|
+
<Button {...defaultArgs} size="small">
|
|
37
|
+
Small
|
|
38
|
+
</Button>
|
|
39
|
+
|
|
40
|
+
<Button {...defaultArgs} size="medium">
|
|
41
|
+
Medium
|
|
42
|
+
</Button>
|
|
43
|
+
|
|
44
|
+
<Button {...defaultArgs}>Large</Button>
|
|
45
|
+
</div>
|
|
46
|
+
),
|
|
47
|
+
args: defaultArgs,
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const WithIcon: Story = {
|
|
51
|
+
render: () => (
|
|
52
|
+
<Stack spacing="lg">
|
|
53
|
+
<Stack spacing="lg" as="dl">
|
|
54
|
+
<dt style={{ fontWeight: "bold" }}>Position Prefix</dt>
|
|
55
|
+
<dd style={{ margin: 0 }}>
|
|
56
|
+
<div
|
|
57
|
+
style={{ display: "flex", flexDirection: "row", alignItems: "flex-start", gap: "32px" }}
|
|
58
|
+
>
|
|
59
|
+
<Button prefixIcon={<Icon icon="UbieIcon" />} {...defaultArgs} />
|
|
60
|
+
<Button prefixIcon={<Icon icon="UbieIcon" />} {...defaultArgs} variant="secondary" />
|
|
61
|
+
<Button prefixIcon={<Icon icon="UbieIcon" />} {...defaultArgs} variant="alert" />
|
|
62
|
+
<Button prefixIcon={<Icon icon="UbieIcon" />} {...defaultArgs} variant="text" />
|
|
63
|
+
<Button prefixIcon={<Icon icon="TrashIcon" />} {...defaultArgs} variant="textAlert" />
|
|
64
|
+
</div>
|
|
65
|
+
</dd>
|
|
66
|
+
</Stack>
|
|
67
|
+
|
|
68
|
+
<Stack spacing="lg" as="dl">
|
|
69
|
+
<dt style={{ fontWeight: "bold" }}>Position Suffix</dt>
|
|
70
|
+
<dd style={{ margin: 0 }}>
|
|
71
|
+
<div
|
|
72
|
+
style={{ display: "flex", flexDirection: "row", alignItems: "flex-start", gap: "32px" }}
|
|
73
|
+
>
|
|
74
|
+
<Button suffixIcon={<BlankLinkIcon />} {...defaultArgs} />
|
|
75
|
+
<Button suffixIcon={<BlankLinkIcon />} {...defaultArgs} variant="secondary" />
|
|
76
|
+
<Button suffixIcon={<BlankLinkIcon />} {...defaultArgs} variant="alert" />
|
|
77
|
+
<Button suffixIcon={<BlankLinkIcon />} {...defaultArgs} variant="text" />
|
|
78
|
+
<Button suffixIcon={<TrashIcon />} {...defaultArgs} variant="textAlert" />
|
|
79
|
+
</div>
|
|
80
|
+
</dd>
|
|
81
|
+
</Stack>
|
|
82
|
+
|
|
83
|
+
<Stack spacing="lg" as="dl">
|
|
84
|
+
<dt style={{ fontWeight: "bold" }}>Position Fixed</dt>
|
|
85
|
+
<dd style={{ margin: 0 }}>
|
|
86
|
+
<div
|
|
87
|
+
style={{ display: "flex", flexDirection: "row", alignItems: "flex-start", gap: "32px" }}
|
|
88
|
+
>
|
|
89
|
+
<Button fixedIcon={<BlankLinkIcon />} {...defaultArgs} />
|
|
90
|
+
<Button fixedIcon={<BlankLinkIcon />} {...defaultArgs} variant="secondary" />
|
|
91
|
+
<Button fixedIcon={<BlankLinkIcon />} {...defaultArgs} variant="alert" />
|
|
92
|
+
<Button fixedIcon={<BlankLinkIcon />} {...defaultArgs} variant="text" />
|
|
93
|
+
<Button fixedIcon={<TrashIcon />} {...defaultArgs} variant="textAlert" />
|
|
94
|
+
</div>
|
|
95
|
+
</dd>
|
|
96
|
+
</Stack>
|
|
97
|
+
|
|
98
|
+
<Stack spacing="lg" as="dl">
|
|
99
|
+
<dt style={{ fontWeight: "bold" }}>Name specification</dt>
|
|
100
|
+
<dd style={{ margin: 0 }}>
|
|
101
|
+
<div
|
|
102
|
+
style={{ display: "flex", flexDirection: "row", alignItems: "flex-start", gap: "32px" }}
|
|
103
|
+
>
|
|
104
|
+
<Button icon="BlankLinkIcon" {...defaultArgs}>
|
|
105
|
+
Icon
|
|
106
|
+
</Button>
|
|
107
|
+
<Button suffixIcon="BlankLinkIcon" {...defaultArgs}>
|
|
108
|
+
Suffix Icon
|
|
109
|
+
</Button>
|
|
110
|
+
<Button fixedIcon="BlankLinkIcon" {...defaultArgs}>
|
|
111
|
+
Fixed Icon
|
|
112
|
+
</Button>
|
|
113
|
+
</div>
|
|
114
|
+
</dd>
|
|
115
|
+
</Stack>
|
|
116
|
+
|
|
117
|
+
<Stack spacing="lg" as="dl">
|
|
118
|
+
<dt style={{ fontWeight: "bold" }}>Auth Icon</dt>
|
|
119
|
+
<dd style={{ margin: 0 }}>
|
|
120
|
+
<div
|
|
121
|
+
style={{ display: "flex", flexDirection: "row", alignItems: "flex-start", gap: "32px" }}
|
|
122
|
+
>
|
|
123
|
+
<Button variant="authGoogle" icon="default" {...defaultArgs}>
|
|
124
|
+
Icon
|
|
125
|
+
</Button>
|
|
126
|
+
<Button variant="authGoogle" suffixIcon="default" {...defaultArgs}>
|
|
127
|
+
Suffix Icon
|
|
128
|
+
</Button>
|
|
129
|
+
<Button variant="authGoogle" fixedIcon="default" {...defaultArgs}>
|
|
130
|
+
Fixed Icon
|
|
131
|
+
</Button>
|
|
132
|
+
</div>
|
|
133
|
+
</dd>
|
|
134
|
+
</Stack>
|
|
135
|
+
|
|
136
|
+
<Stack spacing="lg" as="dl">
|
|
137
|
+
<dt style={{ fontWeight: "bold" }}>icon prop(deprecated)</dt>
|
|
138
|
+
<dd style={{ margin: 0 }}>
|
|
139
|
+
<div
|
|
140
|
+
style={{ display: "flex", flexDirection: "row", alignItems: "flex-start", gap: "32px" }}
|
|
141
|
+
>
|
|
142
|
+
<Button icon={<Icon icon="UbieIcon" />} {...defaultArgs} />
|
|
143
|
+
<Button icon={<Icon icon="UbieIcon" />} {...defaultArgs} variant="secondary" />
|
|
144
|
+
<Button icon={<Icon icon="UbieIcon" />} {...defaultArgs} variant="alert" />
|
|
145
|
+
<Button icon={<Icon icon="UbieIcon" />} {...defaultArgs} variant="text" />
|
|
146
|
+
<Button icon={<Icon icon="TrashIcon" />} {...defaultArgs} variant="textAlert" />
|
|
147
|
+
</div>
|
|
148
|
+
</dd>
|
|
149
|
+
</Stack>
|
|
150
|
+
</Stack>
|
|
151
|
+
),
|
|
152
|
+
args: defaultArgs,
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export const Block: Story = {
|
|
156
|
+
render: (args) => (
|
|
157
|
+
<div style={{ display: "flex", flexDirection: "column", gap: "32px" }}>
|
|
158
|
+
<div>
|
|
159
|
+
<Button {...args} size="small" variant="secondary" />
|
|
160
|
+
</div>
|
|
161
|
+
<div>
|
|
162
|
+
<Button {...args} size="medium" variant="secondary" />
|
|
163
|
+
</div>
|
|
164
|
+
<div>
|
|
165
|
+
<Button {...args} size="large" variant="secondary" />
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
),
|
|
169
|
+
args: {
|
|
170
|
+
...defaultArgs,
|
|
171
|
+
block: true,
|
|
172
|
+
},
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
export const Disabled: Story = {
|
|
176
|
+
render: () => (
|
|
177
|
+
<div style={{ display: "flex", flexDirection: "row", alignItems: "flex-start", gap: "32px" }}>
|
|
178
|
+
<Button {...defaultArgs} prefixIcon="UbieIcon" disabled />
|
|
179
|
+
<Button {...defaultArgs} variant="secondary" disabled />
|
|
180
|
+
<Button {...defaultArgs} variant="alert" disabled />
|
|
181
|
+
<Button {...defaultArgs} variant="text" disabled />
|
|
182
|
+
<Button {...defaultArgs} variant="textAlert" disabled />
|
|
183
|
+
</div>
|
|
184
|
+
),
|
|
185
|
+
args: defaultArgs,
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
export const Loading: Story = {
|
|
189
|
+
args: {
|
|
190
|
+
...defaultArgs,
|
|
191
|
+
children: "OK",
|
|
192
|
+
loading: true,
|
|
193
|
+
},
|
|
194
|
+
render: (args) => (
|
|
195
|
+
<Stack spacing="md">
|
|
196
|
+
<div style={{ display: "flex", flexDirection: "row", alignItems: "flex-start", gap: "32px" }}>
|
|
197
|
+
<Button {...args} />
|
|
198
|
+
<Button {...args} variant="secondary" />
|
|
199
|
+
<Button {...args} variant="alert" />
|
|
200
|
+
<Button {...args} variant="text" />
|
|
201
|
+
<Button {...args} variant="textAlert" />
|
|
202
|
+
</div>
|
|
203
|
+
|
|
204
|
+
<div style={{ display: "flex", flexDirection: "row", alignItems: "flex-start", gap: "32px" }}>
|
|
205
|
+
<Button {...args} size="medium" />
|
|
206
|
+
<Button {...args} variant="secondary" size="medium" />
|
|
207
|
+
<Button {...args} variant="alert" size="medium" />
|
|
208
|
+
<Button {...args} variant="text" size="medium" />
|
|
209
|
+
<Button {...args} variant="textAlert" size="medium" />
|
|
210
|
+
</div>
|
|
211
|
+
|
|
212
|
+
<div style={{ display: "flex", flexDirection: "row", alignItems: "flex-start", gap: "32px" }}>
|
|
213
|
+
<Button {...args} size="small" />
|
|
214
|
+
<Button {...args} variant="secondary" size="small" />
|
|
215
|
+
<Button {...args} variant="alert" size="small" />
|
|
216
|
+
<Button {...args} variant="text" size="small" />
|
|
217
|
+
<Button {...args} variant="textAlert" size="small" />
|
|
218
|
+
</div>
|
|
219
|
+
|
|
220
|
+
<div style={{ display: "flex", flexDirection: "row", alignItems: "flex-start", gap: "32px" }}>
|
|
221
|
+
<Button icon={<Icon icon="UbieIcon" />} size="medium" loading loadingLabel="ラベル変更">
|
|
222
|
+
次のページへ
|
|
223
|
+
</Button>
|
|
224
|
+
<Button {...args} variant="secondary" size="medium" disabled />
|
|
225
|
+
</div>
|
|
226
|
+
</Stack>
|
|
227
|
+
),
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
export const Margin: Story = {
|
|
231
|
+
render: () => (
|
|
232
|
+
<div
|
|
233
|
+
style={{
|
|
234
|
+
backgroundColor: "var(--color-outline-variant)",
|
|
235
|
+
width: "fit-content",
|
|
236
|
+
overflow: "hidden",
|
|
237
|
+
}}
|
|
238
|
+
>
|
|
239
|
+
<Button {...defaultArgs} mt="lg" mr="lg" mb="lg" ml="lg" />
|
|
240
|
+
</div>
|
|
241
|
+
),
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
export const CustomDataAttribute: Story = {
|
|
245
|
+
render: (args) => <Button {...args} />,
|
|
246
|
+
args: {
|
|
247
|
+
["data-test-id"]: "some-test",
|
|
248
|
+
...defaultArgs,
|
|
249
|
+
},
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
export const TextWrap: Story = {
|
|
253
|
+
render: (args) => {
|
|
254
|
+
return <Button {...args} />;
|
|
255
|
+
},
|
|
256
|
+
args: {
|
|
257
|
+
...defaultArgs,
|
|
258
|
+
children: "[抽選で謝礼あり]\nアンケートにご協力ください",
|
|
259
|
+
whiteSpace: "pre-wrap",
|
|
260
|
+
block: true,
|
|
261
|
+
},
|
|
262
|
+
};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Center, Box } from "..";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
component: Center,
|
|
6
|
+
} satisfies Meta<typeof Center>;
|
|
7
|
+
|
|
8
|
+
type Story = StoryObj<typeof Center>;
|
|
9
|
+
|
|
10
|
+
export const Default: Story = {
|
|
11
|
+
render: () => (
|
|
12
|
+
<Center maxWidth="400px">
|
|
13
|
+
<Box border="black" pt="md" pr="md" pb="md" pl="md">
|
|
14
|
+
Rendered as a centered container.
|
|
15
|
+
</Box>
|
|
16
|
+
</Center>
|
|
17
|
+
),
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const PaddingOutside: Story = {
|
|
21
|
+
render: () => (
|
|
22
|
+
<Center maxWidth="400px" pt="md" pl="xl" pb="md" pr="xl">
|
|
23
|
+
<Box border="black" pt="md" pr="md" pb="md" pl="md">
|
|
24
|
+
Narrow the screen.
|
|
25
|
+
<br />
|
|
26
|
+
There will be a gap on both sides of the box.
|
|
27
|
+
</Box>
|
|
28
|
+
</Center>
|
|
29
|
+
),
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const TextCenter: Story = {
|
|
33
|
+
render: () => (
|
|
34
|
+
<Center maxWidth="400px" textCenter>
|
|
35
|
+
<Box border="black" pt="md" pr="md" pb="md" pl="md">
|
|
36
|
+
Center
|
|
37
|
+
</Box>
|
|
38
|
+
</Center>
|
|
39
|
+
),
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const ChildrenCenter: Story = {
|
|
43
|
+
render: () => (
|
|
44
|
+
<Center maxWidth="400px" childrenCenter>
|
|
45
|
+
<Box border="black" pt="md" pr="md" pb="md" pl="md">
|
|
46
|
+
Centered Child
|
|
47
|
+
</Box>
|
|
48
|
+
</Center>
|
|
49
|
+
),
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const AsSection: Story = {
|
|
53
|
+
render: () => (
|
|
54
|
+
<Center as="section" maxWidth="400px">
|
|
55
|
+
<h2>Heading</h2>
|
|
56
|
+
|
|
57
|
+
<p>body</p>
|
|
58
|
+
</Center>
|
|
59
|
+
),
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const MarginAndPadding: Story = {
|
|
63
|
+
render: () => (
|
|
64
|
+
<div style={{ backgroundColor: "var(--color-ubie-blue-100)", overflow: "hidden" }}>
|
|
65
|
+
<div>prev element</div>
|
|
66
|
+
|
|
67
|
+
<Center mt="lg" mb="lg" pt="xxl" pr="xxl" pb="xxl" pl="xxl" maxWidth="400px">
|
|
68
|
+
<div
|
|
69
|
+
style={{
|
|
70
|
+
width: "100%",
|
|
71
|
+
backgroundColor: "var(--color-ubie-pink-200)",
|
|
72
|
+
overflow: "hidden",
|
|
73
|
+
}}
|
|
74
|
+
>
|
|
75
|
+
<h2>Heading</h2>
|
|
76
|
+
<p>body</p>
|
|
77
|
+
</div>
|
|
78
|
+
</Center>
|
|
79
|
+
|
|
80
|
+
<div>next element</div>
|
|
81
|
+
</div>
|
|
82
|
+
),
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const AsBox: Story = {
|
|
86
|
+
render: () => (
|
|
87
|
+
<Center
|
|
88
|
+
maxWidth="320px"
|
|
89
|
+
pr="sm"
|
|
90
|
+
pl="sm"
|
|
91
|
+
as={<Box radius="md" backgroundColor="blue" pt="lg" pr="lg" pb="lg" pl="lg" />}
|
|
92
|
+
>
|
|
93
|
+
<div>Center</div>
|
|
94
|
+
</Center>
|
|
95
|
+
),
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export const CustomDataAttribute: Story = {
|
|
99
|
+
render: () => (
|
|
100
|
+
<Center maxWidth="400px" data-test-id="some-id">
|
|
101
|
+
Center
|
|
102
|
+
</Center>
|
|
103
|
+
),
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export const Width: Story = {
|
|
107
|
+
render: () => (
|
|
108
|
+
<>
|
|
109
|
+
<Center maxWidth="100%" textCenter>
|
|
110
|
+
<p>width: 100%</p>
|
|
111
|
+
</Center>
|
|
112
|
+
|
|
113
|
+
<br />
|
|
114
|
+
|
|
115
|
+
<Center maxWidth="500px" textCenter>
|
|
116
|
+
<p>max-width: 500px</p>
|
|
117
|
+
</Center>
|
|
118
|
+
|
|
119
|
+
<br />
|
|
120
|
+
|
|
121
|
+
<Center minWidth="500px" textCenter>
|
|
122
|
+
<p>min-width: 500px</p>
|
|
123
|
+
</Center>
|
|
124
|
+
</>
|
|
125
|
+
),
|
|
126
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { ErrorMessage } from "..";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: "Form/ErrorMessage",
|
|
6
|
+
component: ErrorMessage,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type Story = StoryObj<typeof ErrorMessage>;
|
|
10
|
+
|
|
11
|
+
export const Default: Story = {
|
|
12
|
+
render: () => <ErrorMessage>全角カタカナでご入力ください</ErrorMessage>,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const CustomDataAttribute: Story = {
|
|
16
|
+
render: () => (
|
|
17
|
+
<ErrorMessage data-test-id="error-message-custom">全角カタカナでご入力ください</ErrorMessage>
|
|
18
|
+
),
|
|
19
|
+
};
|