@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,345 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Flex, Box, FlexItem } from "..";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
component: Flex,
|
|
6
|
+
} satisfies Meta<typeof Flex>;
|
|
7
|
+
|
|
8
|
+
type Story = StoryObj<typeof Flex>;
|
|
9
|
+
|
|
10
|
+
export const Spacing: Story = {
|
|
11
|
+
render: () => (
|
|
12
|
+
<div>
|
|
13
|
+
<Flex>
|
|
14
|
+
<div>none</div>
|
|
15
|
+
<div>none</div>
|
|
16
|
+
<div>none</div>
|
|
17
|
+
</Flex>
|
|
18
|
+
|
|
19
|
+
<Flex spacing="xxs">
|
|
20
|
+
<div>xxs</div>
|
|
21
|
+
<div>xxs</div>
|
|
22
|
+
<div>xxs</div>
|
|
23
|
+
</Flex>
|
|
24
|
+
|
|
25
|
+
<Flex spacing="xs">
|
|
26
|
+
<div>xs</div>
|
|
27
|
+
<div>xs</div>
|
|
28
|
+
<div>xs</div>
|
|
29
|
+
</Flex>
|
|
30
|
+
|
|
31
|
+
<Flex spacing="sm">
|
|
32
|
+
<div>sm</div>
|
|
33
|
+
<div>sm</div>
|
|
34
|
+
<div>sm</div>
|
|
35
|
+
</Flex>
|
|
36
|
+
|
|
37
|
+
<Flex spacing="md">
|
|
38
|
+
<div>md</div>
|
|
39
|
+
<div>md</div>
|
|
40
|
+
<div>md</div>
|
|
41
|
+
</Flex>
|
|
42
|
+
|
|
43
|
+
<Flex spacing="lg">
|
|
44
|
+
<div>lg</div>
|
|
45
|
+
<div>lg</div>
|
|
46
|
+
<div>lg</div>
|
|
47
|
+
</Flex>
|
|
48
|
+
|
|
49
|
+
<Flex spacing="xl">
|
|
50
|
+
<div>xl</div>
|
|
51
|
+
<div>xl</div>
|
|
52
|
+
<div>xl</div>
|
|
53
|
+
</Flex>
|
|
54
|
+
|
|
55
|
+
<Flex spacing="xxl">
|
|
56
|
+
<div>xxl</div>
|
|
57
|
+
<div>xxl</div>
|
|
58
|
+
<div>xxl</div>
|
|
59
|
+
</Flex>
|
|
60
|
+
</div>
|
|
61
|
+
),
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const Gap: Story = {
|
|
65
|
+
render: () => (
|
|
66
|
+
<Flex gap="xl">
|
|
67
|
+
<div>xxl</div>
|
|
68
|
+
<div>xxl</div>
|
|
69
|
+
<div>xxl</div>
|
|
70
|
+
</Flex>
|
|
71
|
+
),
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export const Vertical: Story = {
|
|
75
|
+
render: () => (
|
|
76
|
+
<div>
|
|
77
|
+
<Flex direction="column" spacing="md">
|
|
78
|
+
<p>Item</p>
|
|
79
|
+
<p>Item</p>
|
|
80
|
+
<p>Item</p>
|
|
81
|
+
<p>Item</p>
|
|
82
|
+
</Flex>
|
|
83
|
+
|
|
84
|
+
<p>※特別な理由がなければStackをつかってください</p>
|
|
85
|
+
</div>
|
|
86
|
+
),
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export const StretchedChildren: Story = {
|
|
90
|
+
render: () => (
|
|
91
|
+
<div style={{ height: 500 }}>
|
|
92
|
+
<Flex spacing="lg" alignItems="stretch" height="full">
|
|
93
|
+
<p style={{ margin: 0, background: "#DDD" }}>Stretched</p>
|
|
94
|
+
<p style={{ margin: 0, background: "#DDD" }}>Stretched</p>
|
|
95
|
+
</Flex>
|
|
96
|
+
</div>
|
|
97
|
+
),
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export const SpaceBetween: Story = {
|
|
101
|
+
render: () => (
|
|
102
|
+
<>
|
|
103
|
+
<Flex justifyContent="space-between">
|
|
104
|
+
<p>Item</p>
|
|
105
|
+
<p>Item</p>
|
|
106
|
+
<p>Item</p>
|
|
107
|
+
<p>Item</p>
|
|
108
|
+
</Flex>
|
|
109
|
+
|
|
110
|
+
<Flex justifyContent="space-between">
|
|
111
|
+
<p>Item</p>
|
|
112
|
+
<p>Item</p>
|
|
113
|
+
</Flex>
|
|
114
|
+
</>
|
|
115
|
+
),
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export const Centralized: Story = {
|
|
119
|
+
render: () => (
|
|
120
|
+
<Flex direction="row" justifyContent="center" alignItems="center" spacing="sm">
|
|
121
|
+
<span>
|
|
122
|
+
Words
|
|
123
|
+
<br />
|
|
124
|
+
crowded
|
|
125
|
+
</span>
|
|
126
|
+
<span>in</span>
|
|
127
|
+
<span>
|
|
128
|
+
simply
|
|
129
|
+
<br />
|
|
130
|
+
dummy
|
|
131
|
+
<br />
|
|
132
|
+
text
|
|
133
|
+
</span>
|
|
134
|
+
</Flex>
|
|
135
|
+
),
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
export const Wrap: Story = {
|
|
139
|
+
render: () => (
|
|
140
|
+
<div style={{ width: 500 }}>
|
|
141
|
+
<Flex direction="row" alignItems="center" spacing="lg" wrap>
|
|
142
|
+
<span>Item</span>
|
|
143
|
+
<span>Item</span>
|
|
144
|
+
<span>Item</span>
|
|
145
|
+
<span>Item</span>
|
|
146
|
+
<span>Item</span>
|
|
147
|
+
<span>Item</span>
|
|
148
|
+
<span>Item</span>
|
|
149
|
+
<span>Item</span>
|
|
150
|
+
<span>Item</span>
|
|
151
|
+
<span>Item</span>
|
|
152
|
+
<span>Item</span>
|
|
153
|
+
<span>Item</span>
|
|
154
|
+
<span>Item</span>
|
|
155
|
+
<span>Item</span>
|
|
156
|
+
<span>Item</span>
|
|
157
|
+
<span>Item</span>
|
|
158
|
+
<span>Item</span>
|
|
159
|
+
<span>Item</span>
|
|
160
|
+
<span>Item</span>
|
|
161
|
+
<span>Item</span>
|
|
162
|
+
<span>Item</span>
|
|
163
|
+
<span>Item</span>
|
|
164
|
+
<span>Item</span>
|
|
165
|
+
<span>Item</span>
|
|
166
|
+
<span>Item</span>
|
|
167
|
+
<span>Item</span>
|
|
168
|
+
</Flex>
|
|
169
|
+
</div>
|
|
170
|
+
),
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export const AsSection: Story = {
|
|
174
|
+
render: () => (
|
|
175
|
+
<Flex as="section" spacing="md" alignItems="center">
|
|
176
|
+
<h1>Heading</h1>
|
|
177
|
+
<p>text</p>
|
|
178
|
+
<p>text</p>
|
|
179
|
+
<p>text</p>
|
|
180
|
+
</Flex>
|
|
181
|
+
),
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
export const MarginAndPadding: Story = {
|
|
185
|
+
render: () => (
|
|
186
|
+
<Flex
|
|
187
|
+
spacing="md"
|
|
188
|
+
alignItems="center"
|
|
189
|
+
mt="lg"
|
|
190
|
+
mr="lg"
|
|
191
|
+
mb="lg"
|
|
192
|
+
ml="lg"
|
|
193
|
+
pt="xxl"
|
|
194
|
+
pr="xxl"
|
|
195
|
+
pb="xxl"
|
|
196
|
+
pl="xxl"
|
|
197
|
+
>
|
|
198
|
+
<h1>Heading</h1>
|
|
199
|
+
<p>Section</p>
|
|
200
|
+
<p>Section</p>
|
|
201
|
+
<p>Section</p>
|
|
202
|
+
</Flex>
|
|
203
|
+
),
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
export const AsBox: Story = {
|
|
207
|
+
render: () => (
|
|
208
|
+
<Flex
|
|
209
|
+
spacing="md"
|
|
210
|
+
as={<Box radius="md" backgroundColor="blue" pt="lg" pr="lg" pb="lg" pl="lg" />}
|
|
211
|
+
>
|
|
212
|
+
<div>item</div>
|
|
213
|
+
<div>item</div>
|
|
214
|
+
<div>item</div>
|
|
215
|
+
</Flex>
|
|
216
|
+
),
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
export const CustomDataAttribute: Story = {
|
|
220
|
+
render: () => (
|
|
221
|
+
<Flex data-test-id="flex-custom-attribute" spacing="md" alignItems="center">
|
|
222
|
+
<div>Flex component with custom data attribute</div>
|
|
223
|
+
</Flex>
|
|
224
|
+
),
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
export const WithFlexItem: Story = {
|
|
228
|
+
render: () => (
|
|
229
|
+
<div style={{ height: 500 }}>
|
|
230
|
+
<Flex spacing="lg" alignItems="stretch" height="full">
|
|
231
|
+
<p style={{ margin: 0, background: "#DDD" }}>
|
|
232
|
+
column
|
|
233
|
+
<br />
|
|
234
|
+
Stretched
|
|
235
|
+
</p>
|
|
236
|
+
<FlexItem>
|
|
237
|
+
<p style={{ margin: 0, background: "#DDD" }}>
|
|
238
|
+
column
|
|
239
|
+
<br />
|
|
240
|
+
not
|
|
241
|
+
<br />
|
|
242
|
+
stretched
|
|
243
|
+
</p>
|
|
244
|
+
</FlexItem>
|
|
245
|
+
<FlexItem flex={{ grow: 1 }}>
|
|
246
|
+
<p style={{ margin: 0, background: "#DDD" }}>row grow</p>
|
|
247
|
+
</FlexItem>
|
|
248
|
+
</Flex>
|
|
249
|
+
</div>
|
|
250
|
+
),
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
export const Width: Story = {
|
|
254
|
+
render: () => (
|
|
255
|
+
<div>
|
|
256
|
+
<Flex direction="row" alignItems="center" spacing="lg" wrap width="100%">
|
|
257
|
+
<span>Item</span>
|
|
258
|
+
<span>Item</span>
|
|
259
|
+
<span>Item</span>
|
|
260
|
+
<span>Item</span>
|
|
261
|
+
<span>Item</span>
|
|
262
|
+
<span>Item</span>
|
|
263
|
+
<span>Item</span>
|
|
264
|
+
<span>Item</span>
|
|
265
|
+
<span>Item</span>
|
|
266
|
+
<span>Item</span>
|
|
267
|
+
<span>Item</span>
|
|
268
|
+
<span>Item</span>
|
|
269
|
+
<span>Item</span>
|
|
270
|
+
<span>Item</span>
|
|
271
|
+
<span>Item</span>
|
|
272
|
+
<span>Item</span>
|
|
273
|
+
<span>Item</span>
|
|
274
|
+
<span>Item</span>
|
|
275
|
+
<span>Item</span>
|
|
276
|
+
</Flex>
|
|
277
|
+
|
|
278
|
+
<br />
|
|
279
|
+
|
|
280
|
+
<Flex direction="row" alignItems="center" spacing="lg" wrap maxWidth="500px">
|
|
281
|
+
<span>Item</span>
|
|
282
|
+
<span>Item</span>
|
|
283
|
+
<span>Item</span>
|
|
284
|
+
<span>Item</span>
|
|
285
|
+
<span>Item</span>
|
|
286
|
+
<span>Item</span>
|
|
287
|
+
<span>Item</span>
|
|
288
|
+
<span>Item</span>
|
|
289
|
+
<span>Item</span>
|
|
290
|
+
<span>Item</span>
|
|
291
|
+
<span>Item</span>
|
|
292
|
+
<span>Item</span>
|
|
293
|
+
<span>Item</span>
|
|
294
|
+
<span>Item</span>
|
|
295
|
+
<span>Item</span>
|
|
296
|
+
<span>Item</span>
|
|
297
|
+
<span>Item</span>
|
|
298
|
+
<span>Item</span>
|
|
299
|
+
<span>Item</span>
|
|
300
|
+
</Flex>
|
|
301
|
+
|
|
302
|
+
<Flex direction="row" alignItems="center" spacing="lg" wrap minWidth="500px">
|
|
303
|
+
<span>Item</span>
|
|
304
|
+
<span>Item</span>
|
|
305
|
+
<span>Item</span>
|
|
306
|
+
<span>Item</span>
|
|
307
|
+
<span>Item</span>
|
|
308
|
+
<span>Item</span>
|
|
309
|
+
<span>Item</span>
|
|
310
|
+
<span>Item</span>
|
|
311
|
+
<span>Item</span>
|
|
312
|
+
<span>Item</span>
|
|
313
|
+
<span>Item</span>
|
|
314
|
+
<span>Item</span>
|
|
315
|
+
<span>Item</span>
|
|
316
|
+
<span>Item</span>
|
|
317
|
+
<span>Item</span>
|
|
318
|
+
<span>Item</span>
|
|
319
|
+
<span>Item</span>
|
|
320
|
+
<span>Item</span>
|
|
321
|
+
<span>Item</span>
|
|
322
|
+
</Flex>
|
|
323
|
+
</div>
|
|
324
|
+
),
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
export const Inline: Story = {
|
|
328
|
+
render: () => (
|
|
329
|
+
<p>
|
|
330
|
+
文章文章文章文章文章文章
|
|
331
|
+
<Flex as="span" spacing="md" inline>
|
|
332
|
+
<Box as="span" inline backgroundColor="blue" p="xs" radius="md">
|
|
333
|
+
Item
|
|
334
|
+
</Box>
|
|
335
|
+
<Box as="span" inline backgroundColor="blue" p="xs" radius="md">
|
|
336
|
+
Item
|
|
337
|
+
</Box>
|
|
338
|
+
<Box as="span" inline backgroundColor="blue" p="xs" radius="md">
|
|
339
|
+
Item
|
|
340
|
+
</Box>
|
|
341
|
+
</Flex>
|
|
342
|
+
文章
|
|
343
|
+
</p>
|
|
344
|
+
),
|
|
345
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { useCallback, useState } from "react";
|
|
3
|
+
import { Stack, Label, Input, HelperMessage, ErrorMessage, RadioButton, RadioGroup } from "..";
|
|
4
|
+
import type { ChangeEventHandler } from "react";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Form/Form",
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const Default: StoryObj = {
|
|
11
|
+
render: () => {
|
|
12
|
+
const [value, setValue] = useState("");
|
|
13
|
+
const onChange = useCallback<ChangeEventHandler<HTMLInputElement>>((e) => {
|
|
14
|
+
setValue(e.target.value);
|
|
15
|
+
}, []);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<Stack spacing="xs">
|
|
19
|
+
<Label htmlFor="field" showRequiredLabel>
|
|
20
|
+
項目
|
|
21
|
+
</Label>
|
|
22
|
+
<Input id="field" value={value} onChange={onChange} />
|
|
23
|
+
<HelperMessage>説明文です</HelperMessage>
|
|
24
|
+
<HelperMessage>説明文です</HelperMessage>
|
|
25
|
+
</Stack>
|
|
26
|
+
);
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const Error: StoryObj = {
|
|
31
|
+
render: () => {
|
|
32
|
+
const [value, setValue] = useState("");
|
|
33
|
+
const onChange = useCallback<ChangeEventHandler<HTMLInputElement>>((e) => {
|
|
34
|
+
setValue(e.target.value);
|
|
35
|
+
}, []);
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<Stack spacing="xs">
|
|
39
|
+
<Label htmlFor="error-field">項目</Label>
|
|
40
|
+
<Input value={value} id="error-field" onChange={onChange} isInvalid />
|
|
41
|
+
<ErrorMessage>全角カタカナでご入力ください</ErrorMessage>
|
|
42
|
+
<ErrorMessage>全角カタカナでご入力ください</ErrorMessage>
|
|
43
|
+
<HelperMessage>説明文です</HelperMessage>
|
|
44
|
+
</Stack>
|
|
45
|
+
);
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const RadioButtons: StoryObj = {
|
|
50
|
+
render: () => {
|
|
51
|
+
const options = ["項目1", "項目2", "項目3"];
|
|
52
|
+
const [selectedItem, setSelectedItem] = useState<string>(options[0]);
|
|
53
|
+
|
|
54
|
+
const onChange: ChangeEventHandler<HTMLInputElement> = useCallback((event) => {
|
|
55
|
+
setSelectedItem(event.target.value);
|
|
56
|
+
}, []);
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<Stack spacing="md" alignItems="normal">
|
|
60
|
+
<RadioGroup label="通院状況" showRequiredLabel>
|
|
61
|
+
{options.map((option) => (
|
|
62
|
+
<RadioButton
|
|
63
|
+
name="commuting"
|
|
64
|
+
value={option}
|
|
65
|
+
onChange={onChange}
|
|
66
|
+
checked={selectedItem.includes(option)}
|
|
67
|
+
key={option}
|
|
68
|
+
>
|
|
69
|
+
{option}
|
|
70
|
+
</RadioButton>
|
|
71
|
+
))}
|
|
72
|
+
</RadioGroup>
|
|
73
|
+
|
|
74
|
+
<Stack spacing="xs">
|
|
75
|
+
<ErrorMessage>何かしらのエラーメッセージ</ErrorMessage>
|
|
76
|
+
<ErrorMessage>何かしらのエラーメッセージ</ErrorMessage>
|
|
77
|
+
<HelperMessage>説明文です</HelperMessage>
|
|
78
|
+
<HelperMessage>説明文です</HelperMessage>
|
|
79
|
+
</Stack>
|
|
80
|
+
</Stack>
|
|
81
|
+
);
|
|
82
|
+
},
|
|
83
|
+
};
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Box, Heading, Stack } from "../";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: "Typography/Heading",
|
|
6
|
+
component: Heading,
|
|
7
|
+
} as Meta<typeof Heading>;
|
|
8
|
+
|
|
9
|
+
type Story = StoryObj<typeof Heading>;
|
|
10
|
+
|
|
11
|
+
export const Default: Story = {
|
|
12
|
+
render: () => (
|
|
13
|
+
<Stack spacing="md">
|
|
14
|
+
<Heading size="xxs">xxs: スマートフォン問診</Heading>
|
|
15
|
+
<Heading size="xxs">
|
|
16
|
+
xxs: スマートフォン問診を利用できる
|
|
17
|
+
<br />
|
|
18
|
+
近くの医療機関から調べる
|
|
19
|
+
</Heading>
|
|
20
|
+
<Heading size="xs">xs: スマートフォン問診</Heading>
|
|
21
|
+
<Heading size="xs">
|
|
22
|
+
xs: スマートフォン問診を利用できる
|
|
23
|
+
<br />
|
|
24
|
+
近くの医療機関から調べる
|
|
25
|
+
</Heading>
|
|
26
|
+
<Heading size="sm">sm: スマートフォン問診</Heading>
|
|
27
|
+
<Heading size="sm">
|
|
28
|
+
sm: スマートフォン問診を利用できる
|
|
29
|
+
<br />
|
|
30
|
+
近くの医療機関から調べる
|
|
31
|
+
</Heading>
|
|
32
|
+
<Heading size="md">md: スマートフォン問診</Heading>
|
|
33
|
+
<Heading size="md">
|
|
34
|
+
md: スマートフォン問診を利用できる
|
|
35
|
+
<br />
|
|
36
|
+
近くの医療機関から調べる
|
|
37
|
+
</Heading>
|
|
38
|
+
<Heading size="lg">lg: スマートフォン問診</Heading>
|
|
39
|
+
<Heading size="lg">
|
|
40
|
+
lg: スマートフォン問診を利用できる
|
|
41
|
+
<br />
|
|
42
|
+
近くの医療機関から調べる
|
|
43
|
+
</Heading>
|
|
44
|
+
<Heading size="xl">xl: スマートフォン問診</Heading>
|
|
45
|
+
<Heading size="xl">
|
|
46
|
+
xl: スマートフォン問診を利用できる
|
|
47
|
+
<br />
|
|
48
|
+
近くの医療機関から調べる
|
|
49
|
+
</Heading>
|
|
50
|
+
</Stack>
|
|
51
|
+
),
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const Element: Story = {
|
|
55
|
+
render: () => (
|
|
56
|
+
<Stack spacing="md">
|
|
57
|
+
<Heading as="p" color="main" size="md">
|
|
58
|
+
p
|
|
59
|
+
</Heading>
|
|
60
|
+
<Heading as="h1" color="main" size="md" id="test-id">
|
|
61
|
+
h1 with id attribute
|
|
62
|
+
</Heading>
|
|
63
|
+
<Heading as="h2" color="main" size="md">
|
|
64
|
+
h2
|
|
65
|
+
</Heading>
|
|
66
|
+
<Heading as="h3" color="main" size="md">
|
|
67
|
+
h3
|
|
68
|
+
</Heading>
|
|
69
|
+
<Heading as="h4" color="main" size="md">
|
|
70
|
+
h4
|
|
71
|
+
</Heading>
|
|
72
|
+
<Heading as="h5" color="main" size="md">
|
|
73
|
+
h5
|
|
74
|
+
</Heading>
|
|
75
|
+
<Heading as="h6" color="main" size="md">
|
|
76
|
+
h6
|
|
77
|
+
</Heading>
|
|
78
|
+
{/* markuplint-disable-next-line */}
|
|
79
|
+
<Heading as="label" color="main" size="md" htmlFor="some-input-id">
|
|
80
|
+
label
|
|
81
|
+
</Heading>
|
|
82
|
+
</Stack>
|
|
83
|
+
),
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const Colors: Story = {
|
|
87
|
+
render: () => (
|
|
88
|
+
<Stack spacing="md">
|
|
89
|
+
<Heading as="p" color="main" size="md">
|
|
90
|
+
スマートフォン問診(main)
|
|
91
|
+
</Heading>
|
|
92
|
+
|
|
93
|
+
<div style={{ backgroundColor: "var(--color-blue-600)", padding: "var(--size-spacing-xs)" }}>
|
|
94
|
+
<Heading as="p" color="white" size="md">
|
|
95
|
+
スマートフォン問診(white)
|
|
96
|
+
</Heading>
|
|
97
|
+
</div>
|
|
98
|
+
</Stack>
|
|
99
|
+
),
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const HasLink: Story = {
|
|
103
|
+
render: () => (
|
|
104
|
+
<Stack spacing="md">
|
|
105
|
+
<Heading as="p" color="main" size="md">
|
|
106
|
+
<a href="https://vitals.ubie.life/">Vitals</a> スマートフォン問診(main)
|
|
107
|
+
</Heading>
|
|
108
|
+
|
|
109
|
+
<div style={{ backgroundColor: "var(--color-blue-600)", padding: "var(--size-spacing-xs)" }}>
|
|
110
|
+
<Heading as="p" color="white" size="md">
|
|
111
|
+
<a href="https://vitals.ubie.life/">Vitals</a> スマートフォン問診(white)
|
|
112
|
+
</Heading>
|
|
113
|
+
</div>
|
|
114
|
+
</Stack>
|
|
115
|
+
),
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export const LeadingBorder: Story = {
|
|
119
|
+
render: () => (
|
|
120
|
+
<Stack spacing="md">
|
|
121
|
+
<Heading as="p" leadingBorder size="xxs">
|
|
122
|
+
スマートフォン問診
|
|
123
|
+
</Heading>
|
|
124
|
+
<Heading as="p" leadingBorder size="xxs">
|
|
125
|
+
スマートフォン問診を利用できる
|
|
126
|
+
<br />
|
|
127
|
+
近くの医療機関から調べる
|
|
128
|
+
</Heading>
|
|
129
|
+
<Heading as="p" leadingBorder size="xs">
|
|
130
|
+
スマートフォン問診
|
|
131
|
+
</Heading>
|
|
132
|
+
<Heading as="p" leadingBorder size="xs">
|
|
133
|
+
スマートフォン問診を利用できる
|
|
134
|
+
<br />
|
|
135
|
+
近くの医療機関から調べる
|
|
136
|
+
</Heading>
|
|
137
|
+
<Heading as="p" leadingBorder size="sm">
|
|
138
|
+
スマートフォン問診
|
|
139
|
+
</Heading>
|
|
140
|
+
<Heading as="p" leadingBorder size="sm">
|
|
141
|
+
スマートフォン問診を利用できる
|
|
142
|
+
<br />
|
|
143
|
+
近くの医療機関から調べる
|
|
144
|
+
</Heading>
|
|
145
|
+
<Heading as="p" leadingBorder size="md">
|
|
146
|
+
スマートフォン問診
|
|
147
|
+
</Heading>
|
|
148
|
+
<Heading as="p" leadingBorder size="md">
|
|
149
|
+
スマートフォン問診を利用できる
|
|
150
|
+
<br />
|
|
151
|
+
近くの医療機関から調べる
|
|
152
|
+
</Heading>
|
|
153
|
+
<Heading as="p" leadingBorder size="lg">
|
|
154
|
+
スマートフォン問診
|
|
155
|
+
</Heading>
|
|
156
|
+
<Heading as="p" leadingBorder size="lg">
|
|
157
|
+
スマートフォン問診を利用できる
|
|
158
|
+
<br />
|
|
159
|
+
近くの医療機関から調べる
|
|
160
|
+
</Heading>
|
|
161
|
+
<Heading as="p" leadingBorder size="xl">
|
|
162
|
+
スマートフォン問診
|
|
163
|
+
</Heading>
|
|
164
|
+
<Heading as="p" leadingBorder size="xl">
|
|
165
|
+
スマートフォン問診を利用できる
|
|
166
|
+
<br />
|
|
167
|
+
近くの医療機関から調べる
|
|
168
|
+
</Heading>
|
|
169
|
+
</Stack>
|
|
170
|
+
),
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export const TextAlign: Story = {
|
|
174
|
+
render: () => (
|
|
175
|
+
<Stack spacing="md" alignItems="normal">
|
|
176
|
+
<div style={{ textAlign: "center" }}>
|
|
177
|
+
<Heading as="p" size="md">
|
|
178
|
+
スマートフォン問診(inherit)
|
|
179
|
+
</Heading>
|
|
180
|
+
</div>
|
|
181
|
+
|
|
182
|
+
<Heading as="p" size="md" textAlign="left">
|
|
183
|
+
スマートフォン問診(left)
|
|
184
|
+
</Heading>
|
|
185
|
+
<Heading as="p" size="md" textAlign="center">
|
|
186
|
+
スマートフォン問診(center)
|
|
187
|
+
</Heading>
|
|
188
|
+
<Heading as="p" size="md" textAlign="right">
|
|
189
|
+
スマートフォン問診(right)
|
|
190
|
+
</Heading>
|
|
191
|
+
</Stack>
|
|
192
|
+
),
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
export const Bold: Story = {
|
|
196
|
+
render: () => (
|
|
197
|
+
<Stack spacing="md">
|
|
198
|
+
<Heading as="h1" color="main" size="md">
|
|
199
|
+
h1 bold
|
|
200
|
+
</Heading>
|
|
201
|
+
<Heading as="h1" color="main" size="md" bold={false}>
|
|
202
|
+
h1 normal
|
|
203
|
+
</Heading>
|
|
204
|
+
</Stack>
|
|
205
|
+
),
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
export const CustomDataAttribute: Story = {
|
|
209
|
+
render: (args) => <Heading {...args}>Heading with Custom Data Attribute</Heading>,
|
|
210
|
+
args: {
|
|
211
|
+
[`data-test-id`]: "heading-custom-attribute",
|
|
212
|
+
},
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
export const TextWrap: Story = {
|
|
216
|
+
render: () => (
|
|
217
|
+
<div style={{ width: "300px" }}>
|
|
218
|
+
<Stack spacing="md">
|
|
219
|
+
<Box border="black">
|
|
220
|
+
<Heading>
|
|
221
|
+
私はすべてぼんやりその批評痛というのの中を押しだなけれ。現に十月の仕事方ももしこのお尋ねましたまでをふりまいとならませには刺戟待ったたて、とてもにはなろべきませたです。https://vitals.ubie.life/?hoge=1111111111111111111111111111111111111111111111111111
|
|
222
|
+
</Heading>
|
|
223
|
+
</Box>
|
|
224
|
+
|
|
225
|
+
<div lang="en">
|
|
226
|
+
<Box border="black">
|
|
227
|
+
<Heading>
|
|
228
|
+
industry. Lorem Ipsum has been the industry's standard dummy text ever since the
|
|
229
|
+
1500s, when an unknown printer took a galley of type and scrambled it to make a type
|
|
230
|
+
specimen booooooooooooooooooooooooooooooooooooooooooooook.
|
|
231
|
+
</Heading>
|
|
232
|
+
</Box>
|
|
233
|
+
</div>
|
|
234
|
+
|
|
235
|
+
<div>
|
|
236
|
+
<p>
|
|
237
|
+
<code>noWrap</code>
|
|
238
|
+
</p>
|
|
239
|
+
|
|
240
|
+
<Box border="black">
|
|
241
|
+
<Heading noWrap>
|
|
242
|
+
私はすべてぼんやりその批評痛というのの中を押しだなけれ。現に十月の仕事方ももしこのお尋ねましたまでをふりまいとならませには刺戟待ったたて、とてもにはなろべきませたです。https://vitals.ubie.life/?hoge=1111111111111111111111111111111111111111111111111111
|
|
243
|
+
</Heading>
|
|
244
|
+
</Box>
|
|
245
|
+
</div>
|
|
246
|
+
|
|
247
|
+
<div>
|
|
248
|
+
<p>
|
|
249
|
+
<code>noWrap</code>
|
|
250
|
+
</p>
|
|
251
|
+
|
|
252
|
+
<Box border="black">
|
|
253
|
+
<Heading noWrap>
|
|
254
|
+
industry. Lorem Ipsum has been the industry's standard dummy text ever since the
|
|
255
|
+
1500s, when an unknown printer took a galley of type and scrambled it to make a type
|
|
256
|
+
specimen book.
|
|
257
|
+
</Heading>
|
|
258
|
+
</Box>
|
|
259
|
+
</div>
|
|
260
|
+
</Stack>
|
|
261
|
+
</div>
|
|
262
|
+
),
|
|
263
|
+
};
|