@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,469 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { ComponentProps, useCallback, useState } from "react";
|
|
3
|
+
import { ActionHalfModal } from "./ActionHalfModal";
|
|
4
|
+
import { Box } from "../Box/Box";
|
|
5
|
+
import { Button } from "../Button/Button";
|
|
6
|
+
import { Flex } from "../Flex/Flex";
|
|
7
|
+
import { Text } from "../Text/Text";
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: "Modal/ActionHalfModal",
|
|
11
|
+
component: ActionHalfModal,
|
|
12
|
+
} satisfies Meta<typeof ActionHalfModal>;
|
|
13
|
+
|
|
14
|
+
type Story = StoryObj<typeof ActionHalfModal>;
|
|
15
|
+
|
|
16
|
+
const LongBody = () => (
|
|
17
|
+
<>
|
|
18
|
+
<p>
|
|
19
|
+
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has
|
|
20
|
+
been the industry's standard dummy text ever since the 1500s, when an unknown printer
|
|
21
|
+
took a galley of type and scrambled it to make a type specimen book. It has survived not only
|
|
22
|
+
five centuries, but also the leap into electronic typesetting, remaining essentially
|
|
23
|
+
unchanged. It was popularised in the 1960s with the release of Letraset sheets containing
|
|
24
|
+
Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker
|
|
25
|
+
including versions of Lorem Ipsum.
|
|
26
|
+
</p>
|
|
27
|
+
<p>
|
|
28
|
+
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of
|
|
29
|
+
classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a
|
|
30
|
+
Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin
|
|
31
|
+
words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in
|
|
32
|
+
classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections
|
|
33
|
+
1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and
|
|
34
|
+
Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very
|
|
35
|
+
popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit
|
|
36
|
+
amet..", comes from a line in section 1.10.32.
|
|
37
|
+
</p>
|
|
38
|
+
</>
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
const defaultArgs = {
|
|
42
|
+
header: "モーダル",
|
|
43
|
+
children: <LongBody />,
|
|
44
|
+
stickyHeader: false,
|
|
45
|
+
stickyFooter: false,
|
|
46
|
+
} as const satisfies Partial<ComponentProps<typeof ActionHalfModal>>;
|
|
47
|
+
|
|
48
|
+
export const Default: Story = {
|
|
49
|
+
render: (args) => {
|
|
50
|
+
const [open, setOpen] = useState(true);
|
|
51
|
+
|
|
52
|
+
const onClose = useCallback(() => {
|
|
53
|
+
setOpen(false);
|
|
54
|
+
}, []);
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<>
|
|
58
|
+
<button type="button" onClick={() => setOpen(true)}>
|
|
59
|
+
Open Modal
|
|
60
|
+
</button>
|
|
61
|
+
<ActionHalfModal
|
|
62
|
+
primaryActionLabel="アクション"
|
|
63
|
+
onPrimaryAction={onClose}
|
|
64
|
+
{...args}
|
|
65
|
+
open={open}
|
|
66
|
+
onClose={onClose}
|
|
67
|
+
/>
|
|
68
|
+
</>
|
|
69
|
+
);
|
|
70
|
+
},
|
|
71
|
+
args: defaultArgs,
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export const Secondary: Story = {
|
|
75
|
+
render: (args) => {
|
|
76
|
+
const [open, setOpen] = useState(false);
|
|
77
|
+
|
|
78
|
+
const onClose = useCallback(() => {
|
|
79
|
+
setOpen(false);
|
|
80
|
+
}, []);
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<>
|
|
84
|
+
<button type="button" onClick={() => setOpen(true)}>
|
|
85
|
+
Open Modal
|
|
86
|
+
</button>
|
|
87
|
+
<ActionHalfModal
|
|
88
|
+
primaryActionLabel="アクション1"
|
|
89
|
+
onPrimaryAction={onClose}
|
|
90
|
+
secondaryActionLabel="アクション2"
|
|
91
|
+
onSecondaryAction={onClose}
|
|
92
|
+
{...args}
|
|
93
|
+
open={open}
|
|
94
|
+
onClose={onClose}
|
|
95
|
+
/>
|
|
96
|
+
</>
|
|
97
|
+
);
|
|
98
|
+
},
|
|
99
|
+
args: defaultArgs,
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const Fullscreen: Story = {
|
|
103
|
+
render: (args) => {
|
|
104
|
+
const [open, setOpen] = useState(false);
|
|
105
|
+
|
|
106
|
+
const onClose = useCallback(() => {
|
|
107
|
+
setOpen(false);
|
|
108
|
+
}, []);
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<>
|
|
112
|
+
<button type="button" onClick={() => setOpen(true)}>
|
|
113
|
+
Open Modal
|
|
114
|
+
</button>
|
|
115
|
+
<ActionHalfModal {...args} open={open} onClose={onClose} fullscreen />
|
|
116
|
+
</>
|
|
117
|
+
);
|
|
118
|
+
},
|
|
119
|
+
args: defaultArgs,
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export const NoCloseButton: Story = {
|
|
123
|
+
render: (args) => {
|
|
124
|
+
const [open, setOpen] = useState(false);
|
|
125
|
+
|
|
126
|
+
const onClose = useCallback(() => {
|
|
127
|
+
setOpen(false);
|
|
128
|
+
}, []);
|
|
129
|
+
|
|
130
|
+
return (
|
|
131
|
+
<>
|
|
132
|
+
<button type="button" onClick={() => setOpen(true)}>
|
|
133
|
+
Open Modal
|
|
134
|
+
</button>
|
|
135
|
+
<ActionHalfModal
|
|
136
|
+
onPrimaryAction={onClose}
|
|
137
|
+
primaryActionLabel="確認"
|
|
138
|
+
showClose={false}
|
|
139
|
+
{...args}
|
|
140
|
+
open={open}
|
|
141
|
+
onClose={onClose}
|
|
142
|
+
/>
|
|
143
|
+
</>
|
|
144
|
+
);
|
|
145
|
+
},
|
|
146
|
+
args: {
|
|
147
|
+
...defaultArgs,
|
|
148
|
+
[`data-test-id`]: "some-id",
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
export const Customized: Story = {
|
|
153
|
+
render: (args) => {
|
|
154
|
+
const [open, setOpen] = useState(false);
|
|
155
|
+
|
|
156
|
+
const onClose = useCallback(() => {
|
|
157
|
+
setOpen(false);
|
|
158
|
+
}, []);
|
|
159
|
+
|
|
160
|
+
return (
|
|
161
|
+
<>
|
|
162
|
+
<button type="button" onClick={() => setOpen(true)}>
|
|
163
|
+
Open Modal
|
|
164
|
+
</button>
|
|
165
|
+
<ActionHalfModal
|
|
166
|
+
header="削除します"
|
|
167
|
+
primaryActionColor="alert"
|
|
168
|
+
primaryActionLabel="削除"
|
|
169
|
+
onPrimaryAction={onClose}
|
|
170
|
+
overlayOpacity="darker"
|
|
171
|
+
closeLabel="キャンセル"
|
|
172
|
+
{...args}
|
|
173
|
+
open={open}
|
|
174
|
+
onClose={onClose}
|
|
175
|
+
/>
|
|
176
|
+
</>
|
|
177
|
+
);
|
|
178
|
+
},
|
|
179
|
+
args: defaultArgs,
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
export const WithId: Story = {
|
|
183
|
+
render: (args) => {
|
|
184
|
+
const [open, setOpen] = useState(false);
|
|
185
|
+
const onClose = useCallback(() => {
|
|
186
|
+
setOpen(false);
|
|
187
|
+
}, []);
|
|
188
|
+
return (
|
|
189
|
+
<>
|
|
190
|
+
<button type="button" onClick={() => setOpen(true)}>
|
|
191
|
+
Open Modal
|
|
192
|
+
</button>
|
|
193
|
+
<ActionHalfModal
|
|
194
|
+
{...args}
|
|
195
|
+
data-test-id="some-id"
|
|
196
|
+
primaryActionLabel="アクション"
|
|
197
|
+
onPrimaryAction={onClose}
|
|
198
|
+
open={open}
|
|
199
|
+
onClose={onClose}
|
|
200
|
+
/>
|
|
201
|
+
</>
|
|
202
|
+
);
|
|
203
|
+
},
|
|
204
|
+
args: {
|
|
205
|
+
...defaultArgs,
|
|
206
|
+
id: "dialog-id",
|
|
207
|
+
},
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
export const CustomHeader: Story = {
|
|
211
|
+
render: (args) => {
|
|
212
|
+
const [open, setOpen] = useState(false);
|
|
213
|
+
const onClose = useCallback(() => {
|
|
214
|
+
setOpen(false);
|
|
215
|
+
}, []);
|
|
216
|
+
|
|
217
|
+
const headerId = "header-id";
|
|
218
|
+
|
|
219
|
+
return (
|
|
220
|
+
<>
|
|
221
|
+
<button type="button" onClick={() => setOpen(true)}>
|
|
222
|
+
Open Modal
|
|
223
|
+
</button>
|
|
224
|
+
<ActionHalfModal
|
|
225
|
+
ariaLabelledby={headerId}
|
|
226
|
+
primaryActionLabel="Action"
|
|
227
|
+
onPrimaryAction={onClose}
|
|
228
|
+
{...args}
|
|
229
|
+
open={open}
|
|
230
|
+
onClose={onClose}
|
|
231
|
+
>
|
|
232
|
+
<h2 id={headerId}>Header</h2>
|
|
233
|
+
<LongBody />
|
|
234
|
+
</ActionHalfModal>
|
|
235
|
+
</>
|
|
236
|
+
);
|
|
237
|
+
},
|
|
238
|
+
args: {
|
|
239
|
+
...defaultArgs,
|
|
240
|
+
header: undefined,
|
|
241
|
+
},
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
export const WithHero: Story = {
|
|
245
|
+
render: (args) => {
|
|
246
|
+
const [open, setOpen] = useState(false);
|
|
247
|
+
const onClose = useCallback(() => {
|
|
248
|
+
setOpen(false);
|
|
249
|
+
}, []);
|
|
250
|
+
|
|
251
|
+
return (
|
|
252
|
+
<>
|
|
253
|
+
<button type="button" onClick={() => setOpen(true)}>
|
|
254
|
+
Open Modal
|
|
255
|
+
</button>
|
|
256
|
+
<ActionHalfModal
|
|
257
|
+
hero={
|
|
258
|
+
<img
|
|
259
|
+
src="/images/placeholder.svg"
|
|
260
|
+
alt="Illustration: Modal"
|
|
261
|
+
style={{ width: "100%", height: "auto", verticalAlign: "bottom" }}
|
|
262
|
+
width={560}
|
|
263
|
+
height={315}
|
|
264
|
+
/>
|
|
265
|
+
}
|
|
266
|
+
primaryActionLabel="Action"
|
|
267
|
+
onPrimaryAction={onClose}
|
|
268
|
+
{...args}
|
|
269
|
+
open={open}
|
|
270
|
+
onClose={onClose}
|
|
271
|
+
>
|
|
272
|
+
<p>Content</p>
|
|
273
|
+
</ActionHalfModal>
|
|
274
|
+
</>
|
|
275
|
+
);
|
|
276
|
+
},
|
|
277
|
+
args: {
|
|
278
|
+
...defaultArgs,
|
|
279
|
+
},
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
export const WithHeroAndFullScreen: Story = {
|
|
283
|
+
render: (args) => {
|
|
284
|
+
const [open, setOpen] = useState(false);
|
|
285
|
+
const onClose = useCallback(() => {
|
|
286
|
+
setOpen(false);
|
|
287
|
+
}, []);
|
|
288
|
+
|
|
289
|
+
return (
|
|
290
|
+
<>
|
|
291
|
+
<button type="button" onClick={() => setOpen(true)}>
|
|
292
|
+
Open Modal
|
|
293
|
+
</button>
|
|
294
|
+
<ActionHalfModal
|
|
295
|
+
primaryActionLabel="Action"
|
|
296
|
+
onPrimaryAction={onClose}
|
|
297
|
+
{...args}
|
|
298
|
+
open={open}
|
|
299
|
+
onClose={onClose}
|
|
300
|
+
>
|
|
301
|
+
<p>Content</p>
|
|
302
|
+
</ActionHalfModal>
|
|
303
|
+
</>
|
|
304
|
+
);
|
|
305
|
+
},
|
|
306
|
+
args: {
|
|
307
|
+
...defaultArgs,
|
|
308
|
+
fullscreen: true,
|
|
309
|
+
hero: (
|
|
310
|
+
<img
|
|
311
|
+
src="/images/placeholder.svg"
|
|
312
|
+
alt="Illustration: Modal"
|
|
313
|
+
style={{ width: "100%", height: "auto", verticalAlign: "bottom" }}
|
|
314
|
+
width={560}
|
|
315
|
+
height={315}
|
|
316
|
+
/>
|
|
317
|
+
),
|
|
318
|
+
},
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
export const StickyHeaderAndFooter: Story = {
|
|
322
|
+
render: (args) => {
|
|
323
|
+
const [open, setOpen] = useState(true);
|
|
324
|
+
|
|
325
|
+
const onClose = useCallback(() => {
|
|
326
|
+
setOpen(false);
|
|
327
|
+
}, []);
|
|
328
|
+
|
|
329
|
+
return (
|
|
330
|
+
<>
|
|
331
|
+
<button type="button" onClick={() => setOpen(true)}>
|
|
332
|
+
Open Modal
|
|
333
|
+
</button>
|
|
334
|
+
<ActionHalfModal
|
|
335
|
+
primaryActionLabel="アクション"
|
|
336
|
+
onPrimaryAction={onClose}
|
|
337
|
+
{...args}
|
|
338
|
+
open={open}
|
|
339
|
+
onClose={onClose}
|
|
340
|
+
/>
|
|
341
|
+
</>
|
|
342
|
+
);
|
|
343
|
+
},
|
|
344
|
+
args: {
|
|
345
|
+
...defaultArgs,
|
|
346
|
+
stickyHeader: true,
|
|
347
|
+
stickyFooter: true,
|
|
348
|
+
},
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
export const ReactNodeHeader: Story = {
|
|
352
|
+
render: (args) => {
|
|
353
|
+
const [open, setOpen] = useState(true);
|
|
354
|
+
|
|
355
|
+
const onClose = useCallback(() => {
|
|
356
|
+
setOpen(false);
|
|
357
|
+
}, []);
|
|
358
|
+
|
|
359
|
+
return (
|
|
360
|
+
<>
|
|
361
|
+
<button type="button" onClick={() => setOpen(true)}>
|
|
362
|
+
Open Modal
|
|
363
|
+
</button>
|
|
364
|
+
<ActionHalfModal
|
|
365
|
+
primaryActionLabel="アクション"
|
|
366
|
+
onPrimaryAction={onClose}
|
|
367
|
+
{...args}
|
|
368
|
+
open={open}
|
|
369
|
+
onClose={onClose}
|
|
370
|
+
/>
|
|
371
|
+
</>
|
|
372
|
+
);
|
|
373
|
+
},
|
|
374
|
+
args: {
|
|
375
|
+
...defaultArgs,
|
|
376
|
+
header: (
|
|
377
|
+
<Box>
|
|
378
|
+
<Flex gap="xs" alignItems="center" justifyContent="space-between">
|
|
379
|
+
<Text size="lg" color="main">
|
|
380
|
+
カスタムヘッダー
|
|
381
|
+
</Text>
|
|
382
|
+
<Button variant="text" size="small">
|
|
383
|
+
設定
|
|
384
|
+
</Button>
|
|
385
|
+
</Flex>
|
|
386
|
+
</Box>
|
|
387
|
+
),
|
|
388
|
+
stickyHeader: true,
|
|
389
|
+
},
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
export const ReactNodeHeaderWithHero: Story = {
|
|
393
|
+
render: (args) => {
|
|
394
|
+
const [open, setOpen] = useState(true);
|
|
395
|
+
|
|
396
|
+
const onClose = useCallback(() => {
|
|
397
|
+
setOpen(false);
|
|
398
|
+
}, []);
|
|
399
|
+
|
|
400
|
+
return (
|
|
401
|
+
<>
|
|
402
|
+
<button type="button" onClick={() => setOpen(true)}>
|
|
403
|
+
Open Modal
|
|
404
|
+
</button>
|
|
405
|
+
<ActionHalfModal
|
|
406
|
+
primaryActionLabel="アクション"
|
|
407
|
+
onPrimaryAction={onClose}
|
|
408
|
+
{...args}
|
|
409
|
+
open={open}
|
|
410
|
+
onClose={onClose}
|
|
411
|
+
/>
|
|
412
|
+
</>
|
|
413
|
+
);
|
|
414
|
+
},
|
|
415
|
+
args: {
|
|
416
|
+
...defaultArgs,
|
|
417
|
+
header: (
|
|
418
|
+
<Box>
|
|
419
|
+
<Flex gap="xs" alignItems="center" justifyContent="space-between">
|
|
420
|
+
<Text size="lg" color="main">
|
|
421
|
+
Hero付きカスタムヘッダー
|
|
422
|
+
</Text>
|
|
423
|
+
<Button variant="text" size="small">
|
|
424
|
+
メニュー
|
|
425
|
+
</Button>
|
|
426
|
+
</Flex>
|
|
427
|
+
</Box>
|
|
428
|
+
),
|
|
429
|
+
hero: (
|
|
430
|
+
<img
|
|
431
|
+
src="/images/placeholder.svg"
|
|
432
|
+
alt="Illustration: Modal"
|
|
433
|
+
style={{ width: "100%", height: "auto", verticalAlign: "bottom" }}
|
|
434
|
+
width={560}
|
|
435
|
+
height={315}
|
|
436
|
+
/>
|
|
437
|
+
),
|
|
438
|
+
stickyHeader: true,
|
|
439
|
+
},
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
export const CustomMaxHeight: Story = {
|
|
443
|
+
render: (args) => {
|
|
444
|
+
const [open, setOpen] = useState(false);
|
|
445
|
+
|
|
446
|
+
const onClose = useCallback(() => {
|
|
447
|
+
setOpen(false);
|
|
448
|
+
}, []);
|
|
449
|
+
|
|
450
|
+
return (
|
|
451
|
+
<>
|
|
452
|
+
<button type="button" onClick={() => setOpen(true)}>
|
|
453
|
+
Open Modal
|
|
454
|
+
</button>
|
|
455
|
+
<ActionHalfModal
|
|
456
|
+
primaryActionLabel="アクション"
|
|
457
|
+
onPrimaryAction={onClose}
|
|
458
|
+
{...args}
|
|
459
|
+
open={open}
|
|
460
|
+
onClose={onClose}
|
|
461
|
+
/>
|
|
462
|
+
</>
|
|
463
|
+
);
|
|
464
|
+
},
|
|
465
|
+
args: {
|
|
466
|
+
...defaultArgs,
|
|
467
|
+
maxHeight: "80vh",
|
|
468
|
+
},
|
|
469
|
+
};
|