@reni-corp/reni-2c-ui 0.3.27 → 0.3.29
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/README.md +139 -16
- package/dist/components/elements/Alert.vue.d.ts +21 -3
- package/dist/components/elements/Alert.vue.d.ts.map +1 -1
- package/dist/components/elements/CheckBox.vue.d.ts +42 -2
- package/dist/components/elements/CheckBox.vue.d.ts.map +1 -1
- package/dist/components/elements/ComboBox.vue.d.ts +153 -0
- package/dist/components/elements/ComboBox.vue.d.ts.map +1 -0
- package/dist/components/elements/Icon.vue.d.ts.map +1 -1
- package/dist/components/elements/PasswordField.vue.d.ts +75 -25
- package/dist/components/elements/PasswordField.vue.d.ts.map +1 -1
- package/dist/components/elements/Progress.vue.d.ts +45 -0
- package/dist/components/elements/Progress.vue.d.ts.map +1 -0
- package/dist/components/elements/SelectBox.vue.d.ts +30 -10
- package/dist/components/elements/SelectBox.vue.d.ts.map +1 -1
- package/dist/components/elements/SkeletonLoader.vue.d.ts +30 -0
- package/dist/components/elements/SkeletonLoader.vue.d.ts.map +1 -0
- package/dist/components/elements/SpinButton.vue.d.ts +4 -2
- package/dist/components/elements/SpinButton.vue.d.ts.map +1 -1
- package/dist/components/elements/TextField.vue.d.ts +21 -6
- package/dist/components/elements/TextField.vue.d.ts.map +1 -1
- package/dist/components/features/ProductList.vue.d.ts +4 -0
- package/dist/components/features/ProductList.vue.d.ts.map +1 -1
- package/dist/components/features/ProductListItem.vue.d.ts +4 -0
- package/dist/components/features/ProductListItem.vue.d.ts.map +1 -1
- package/dist/components/features/ProductPurchase.vue.d.ts +102 -0
- package/dist/components/features/ProductPurchase.vue.d.ts.map +1 -0
- package/dist/components/foundation/AppBar.vue.d.ts +28 -3
- package/dist/components/foundation/AppBar.vue.d.ts.map +1 -1
- package/dist/components/foundation/AppFooter.vue.d.ts +51 -1
- package/dist/components/foundation/AppFooter.vue.d.ts.map +1 -1
- package/dist/components/interactive/Disclosure.vue.d.ts +54 -0
- package/dist/components/interactive/Disclosure.vue.d.ts.map +1 -0
- package/dist/components/layouts/Page.vue.d.ts +2 -0
- package/dist/components/layouts/Page.vue.d.ts.map +1 -1
- package/dist/components/renderless/Form.vue.d.ts +27 -1
- package/dist/components/renderless/Form.vue.d.ts.map +1 -1
- package/dist/index.d.ts +11 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +7442 -6048
- package/dist/script.es.js +8881 -7489
- package/dist/script.umd.js +26 -26
- package/dist/style.css +1 -1
- package/dist/types.d.ts +7 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/package.json +22 -13
- package/src/stories/Alert.stories.ts +260 -0
- package/src/stories/AnnounceBar.stories.ts +138 -0
- package/src/stories/AppBar.stories.ts +277 -0
- package/src/stories/AppFooter.stories.ts +274 -0
- package/src/stories/AppFrame.stories.ts +46 -0
- package/src/stories/AppLayout.stories.ts +870 -0
- package/src/stories/Button.stories.ts +101 -0
- package/src/stories/Card.stories.ts +152 -0
- package/src/stories/Carousel.stories.ts +62 -0
- package/src/stories/CarouselBanner.stories.ts +103 -0
- package/src/stories/CheckBox.stories.ts +76 -0
- package/src/stories/ComboBox.stories.ts +524 -0
- package/src/stories/Dialog.stories.ts +174 -0
- package/src/stories/Disclosure.stories.ts +217 -0
- package/src/stories/Divider.stories.ts +68 -0
- package/src/stories/Drawer.stories.ts +135 -0
- package/src/stories/DropDown.stories.ts +195 -0
- package/src/stories/FloatingBanner.stories.ts +79 -0
- package/src/stories/Form.stories.ts +704 -0
- package/src/stories/Gallery.stories.ts +78 -0
- package/src/stories/Grid.stories.ts +357 -0
- package/src/stories/Hero.stories.ts +52 -0
- package/src/stories/Html.stories.ts +178 -0
- package/src/stories/Icon.stories.ts +176 -0
- package/src/stories/Image.stories.ts +613 -0
- package/src/stories/Label.stories.ts +54 -0
- package/src/stories/List.stories.ts +112 -0
- package/src/stories/Modal.stories.ts +123 -0
- package/src/stories/Notification.stories.ts +82 -0
- package/src/stories/Page.stories.ts +414 -0
- package/src/stories/PasswordField.stories.ts +304 -0
- package/src/stories/ProductLabels.stories.ts +65 -0
- package/src/stories/ProductList.stories.ts +679 -0
- package/src/stories/ProductPurchase.stories.ts +807 -0
- package/src/stories/Progress.stories.ts +192 -0
- package/src/stories/Radio.stories.ts +81 -0
- package/src/stories/Section.stories.ts +244 -0
- package/src/stories/SelectBox.stories.ts +377 -0
- package/src/stories/SkeletonLoader.stories.ts +170 -0
- package/src/stories/Slider.stories.ts +79 -0
- package/src/stories/SnsLink.stories.ts +259 -0
- package/src/stories/SoldStacker.stories.ts +68 -0
- package/src/stories/SpinButton.stories.ts +134 -0
- package/src/stories/Spinner.stories.ts +58 -0
- package/src/stories/Stack.stories.ts +104 -0
- package/src/stories/Switch.stories.ts +68 -0
- package/src/stories/Tab.stories.ts +52 -0
- package/src/stories/TabPanels.stories.ts +67 -0
- package/src/stories/Tabs.stories.ts +68 -0
- package/src/stories/Text.stories.ts +69 -0
- package/src/stories/TextArea.stories.ts +78 -0
- package/src/stories/TextField.stories.ts +97 -0
- package/src/stories/ToolChip.stories.ts +125 -0
- package/dist/components/elements/SkeltonLoader.vue.d.ts +0 -7
- package/dist/components/elements/SkeltonLoader.vue.d.ts.map +0 -1
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import SnsLink, { SnsLinkProps } from '@/components/features/SnsLink.vue'
|
|
3
|
+
import { ColorOptions, SNSOptions } from '@/constants'
|
|
4
|
+
import { Color } from '@/types'
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof SnsLink> = {
|
|
7
|
+
title: 'Features/SnsLink',
|
|
8
|
+
component: SnsLink,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: {
|
|
11
|
+
type: {
|
|
12
|
+
control: 'select',
|
|
13
|
+
options: Object.keys(SNSOptions),
|
|
14
|
+
},
|
|
15
|
+
href: {
|
|
16
|
+
control: 'text',
|
|
17
|
+
},
|
|
18
|
+
color: {
|
|
19
|
+
control: 'select',
|
|
20
|
+
options: Object.keys(ColorOptions) as Color[],
|
|
21
|
+
},
|
|
22
|
+
size: {
|
|
23
|
+
control: 'select',
|
|
24
|
+
options: ['xs', 'sm', 'md', 'lg', 'xl'],
|
|
25
|
+
},
|
|
26
|
+
target: {
|
|
27
|
+
control: 'select',
|
|
28
|
+
options: ['_blank', '_self'],
|
|
29
|
+
},
|
|
30
|
+
variant: {
|
|
31
|
+
control: 'select',
|
|
32
|
+
options: ['icon', 'label'],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
args: {
|
|
36
|
+
type: 'x-twitter',
|
|
37
|
+
href: '#',
|
|
38
|
+
color: 'default',
|
|
39
|
+
size: 'md',
|
|
40
|
+
target: '_blank',
|
|
41
|
+
variant: 'icon',
|
|
42
|
+
},
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default meta
|
|
46
|
+
type StoryArgs = SnsLinkProps
|
|
47
|
+
type Story = StoryObj<StoryArgs>
|
|
48
|
+
type OverridesStory = Omit<Story, 'argTypes'> & {
|
|
49
|
+
argTypes?: Record<string, any>
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const 基本: OverridesStory = {
|
|
53
|
+
args: {},
|
|
54
|
+
argTypes: {
|
|
55
|
+
default: { table: { disable: true } },
|
|
56
|
+
},
|
|
57
|
+
render: (args: StoryArgs) => ({
|
|
58
|
+
components: { 'rn-sns-link': SnsLink },
|
|
59
|
+
setup() {
|
|
60
|
+
return { args }
|
|
61
|
+
},
|
|
62
|
+
template: /* html */ `
|
|
63
|
+
<div class='sb-canvas'>
|
|
64
|
+
<rn-sns-link
|
|
65
|
+
:type="args.type"
|
|
66
|
+
:href="args.href"
|
|
67
|
+
:color="args.color"
|
|
68
|
+
:size="args.size"
|
|
69
|
+
:target="args.target"
|
|
70
|
+
:variant="args.variant"
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
73
|
+
`,
|
|
74
|
+
}),
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export const アイコン一覧: OverridesStory = {
|
|
78
|
+
args: {
|
|
79
|
+
variant: 'icon',
|
|
80
|
+
size: 'lg',
|
|
81
|
+
},
|
|
82
|
+
argTypes: {
|
|
83
|
+
default: { table: { disable: true } },
|
|
84
|
+
},
|
|
85
|
+
render: (args: StoryArgs) => ({
|
|
86
|
+
components: { 'rn-sns-link': SnsLink },
|
|
87
|
+
setup() {
|
|
88
|
+
return { args }
|
|
89
|
+
},
|
|
90
|
+
template: /* html */ `
|
|
91
|
+
<div class='sb-canvas' style='display: flex; gap: 16px; align-items: center;'>
|
|
92
|
+
<rn-sns-link
|
|
93
|
+
type="x-twitter"
|
|
94
|
+
href="#"
|
|
95
|
+
:size="args.size"
|
|
96
|
+
:variant="args.variant"
|
|
97
|
+
/>
|
|
98
|
+
<rn-sns-link
|
|
99
|
+
type="youtube"
|
|
100
|
+
href="#"
|
|
101
|
+
:size="args.size"
|
|
102
|
+
:variant="args.variant"
|
|
103
|
+
/>
|
|
104
|
+
<rn-sns-link
|
|
105
|
+
type="instagram"
|
|
106
|
+
href="#"
|
|
107
|
+
:size="args.size"
|
|
108
|
+
:variant="args.variant"
|
|
109
|
+
/>
|
|
110
|
+
<rn-sns-link
|
|
111
|
+
type="tiktok"
|
|
112
|
+
href="#"
|
|
113
|
+
:size="args.size"
|
|
114
|
+
:variant="args.variant"
|
|
115
|
+
/>
|
|
116
|
+
<rn-sns-link
|
|
117
|
+
type="facebook"
|
|
118
|
+
href="#"
|
|
119
|
+
:size="args.size"
|
|
120
|
+
:variant="args.variant"
|
|
121
|
+
/>
|
|
122
|
+
<rn-sns-link
|
|
123
|
+
type="line"
|
|
124
|
+
href="#"
|
|
125
|
+
:size="args.size"
|
|
126
|
+
:variant="args.variant"
|
|
127
|
+
/>
|
|
128
|
+
<rn-sns-link
|
|
129
|
+
type="pixiv"
|
|
130
|
+
href="#"
|
|
131
|
+
:size="args.size"
|
|
132
|
+
:variant="args.variant"
|
|
133
|
+
/>
|
|
134
|
+
<rn-sns-link
|
|
135
|
+
type="twitch"
|
|
136
|
+
href="#"
|
|
137
|
+
:size="args.size"
|
|
138
|
+
:variant="args.variant"
|
|
139
|
+
/>
|
|
140
|
+
<rn-sns-link
|
|
141
|
+
type="spotify"
|
|
142
|
+
href="#"
|
|
143
|
+
:size="args.size"
|
|
144
|
+
:variant="args.variant"
|
|
145
|
+
/>
|
|
146
|
+
<rn-sns-link
|
|
147
|
+
type="nicovideo"
|
|
148
|
+
href="#"
|
|
149
|
+
:size="args.size"
|
|
150
|
+
:variant="args.variant"
|
|
151
|
+
/>
|
|
152
|
+
<rn-sns-link
|
|
153
|
+
type="music_line"
|
|
154
|
+
href="#"
|
|
155
|
+
:size="args.size"
|
|
156
|
+
:variant="args.variant"
|
|
157
|
+
/>
|
|
158
|
+
<rn-sns-link
|
|
159
|
+
type="music_apple"
|
|
160
|
+
href="#"
|
|
161
|
+
:size="args.size"
|
|
162
|
+
:variant="args.variant"
|
|
163
|
+
/>
|
|
164
|
+
</div>
|
|
165
|
+
`,
|
|
166
|
+
}),
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export const ラベル付き: OverridesStory = {
|
|
170
|
+
args: {
|
|
171
|
+
variant: 'label',
|
|
172
|
+
size: 'md',
|
|
173
|
+
},
|
|
174
|
+
argTypes: {
|
|
175
|
+
default: { table: { disable: true } },
|
|
176
|
+
},
|
|
177
|
+
render: (args: StoryArgs) => ({
|
|
178
|
+
components: { 'rn-sns-link': SnsLink },
|
|
179
|
+
setup() {
|
|
180
|
+
return { args }
|
|
181
|
+
},
|
|
182
|
+
template: /* html */ `
|
|
183
|
+
<div class='sb-canvas' style='display: flex; flex-direction: column; gap: 12px;'>
|
|
184
|
+
<rn-sns-link
|
|
185
|
+
type="x-twitter"
|
|
186
|
+
href="#"
|
|
187
|
+
:size="args.size"
|
|
188
|
+
:variant="args.variant"
|
|
189
|
+
/>
|
|
190
|
+
<rn-sns-link
|
|
191
|
+
type="youtube"
|
|
192
|
+
href="#"
|
|
193
|
+
:size="args.size"
|
|
194
|
+
:variant="args.variant"
|
|
195
|
+
/>
|
|
196
|
+
<rn-sns-link
|
|
197
|
+
type="instagram"
|
|
198
|
+
href="#"
|
|
199
|
+
:size="args.size"
|
|
200
|
+
:variant="args.variant"
|
|
201
|
+
/>
|
|
202
|
+
<rn-sns-link
|
|
203
|
+
type="tiktok"
|
|
204
|
+
href="#"
|
|
205
|
+
:size="args.size"
|
|
206
|
+
:variant="args.variant"
|
|
207
|
+
/>
|
|
208
|
+
<rn-sns-link
|
|
209
|
+
type="facebook"
|
|
210
|
+
href="#"
|
|
211
|
+
:size="args.size"
|
|
212
|
+
:variant="args.variant"
|
|
213
|
+
/>
|
|
214
|
+
<rn-sns-link
|
|
215
|
+
type="line"
|
|
216
|
+
href="#"
|
|
217
|
+
:size="args.size"
|
|
218
|
+
:variant="args.variant"
|
|
219
|
+
/>
|
|
220
|
+
<rn-sns-link
|
|
221
|
+
type="pixiv"
|
|
222
|
+
href="#"
|
|
223
|
+
:size="args.size"
|
|
224
|
+
:variant="args.variant"
|
|
225
|
+
/>
|
|
226
|
+
<rn-sns-link
|
|
227
|
+
type="twitch"
|
|
228
|
+
href="#"
|
|
229
|
+
:size="args.size"
|
|
230
|
+
:variant="args.variant"
|
|
231
|
+
/>
|
|
232
|
+
<rn-sns-link
|
|
233
|
+
type="spotify"
|
|
234
|
+
href="#"
|
|
235
|
+
:size="args.size"
|
|
236
|
+
:variant="args.variant"
|
|
237
|
+
/>
|
|
238
|
+
<rn-sns-link
|
|
239
|
+
type="nicovideo"
|
|
240
|
+
href="#"
|
|
241
|
+
:size="args.size"
|
|
242
|
+
:variant="args.variant"
|
|
243
|
+
/>
|
|
244
|
+
<rn-sns-link
|
|
245
|
+
type="music_line"
|
|
246
|
+
href="#"
|
|
247
|
+
:size="args.size"
|
|
248
|
+
:variant="args.variant"
|
|
249
|
+
/>
|
|
250
|
+
<rn-sns-link
|
|
251
|
+
type="music_apple"
|
|
252
|
+
href="#"
|
|
253
|
+
:size="args.size"
|
|
254
|
+
:variant="args.variant"
|
|
255
|
+
/>
|
|
256
|
+
</div>
|
|
257
|
+
`,
|
|
258
|
+
}),
|
|
259
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import SoldStacker, {
|
|
3
|
+
type SoldStackerProps,
|
|
4
|
+
} from '@/components/features/SoldStacker.vue'
|
|
5
|
+
import { StatusColorOptions } from '@/constants'
|
|
6
|
+
import { StatusColor } from '@/types'
|
|
7
|
+
|
|
8
|
+
const meta: Meta<typeof SoldStacker> = {
|
|
9
|
+
title: 'Features/SoldStacker',
|
|
10
|
+
component: SoldStacker,
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
parameters: {
|
|
13
|
+
docs: {
|
|
14
|
+
description: {
|
|
15
|
+
component: 'SoldStackerコンポーネント',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
argTypes: {
|
|
20
|
+
color: {
|
|
21
|
+
control: 'select',
|
|
22
|
+
options: Object.keys(StatusColorOptions) as StatusColor[],
|
|
23
|
+
},
|
|
24
|
+
title: {
|
|
25
|
+
control: 'text',
|
|
26
|
+
},
|
|
27
|
+
variant: {
|
|
28
|
+
control: 'select',
|
|
29
|
+
options: ['label', 'overlay'],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
args: {
|
|
33
|
+
color: 'default',
|
|
34
|
+
title: 'title',
|
|
35
|
+
variant: 'label',
|
|
36
|
+
},
|
|
37
|
+
render: (args) => ({
|
|
38
|
+
components: { 'rn-sold-stacker': SoldStacker },
|
|
39
|
+
setup() {
|
|
40
|
+
return { args }
|
|
41
|
+
},
|
|
42
|
+
template: /* html */ `
|
|
43
|
+
<div class='sb-canvas'>
|
|
44
|
+
<div style='width: 100px; height: 100px; background: #999; position: relative;'>
|
|
45
|
+
<rn-sold-stacker
|
|
46
|
+
:color=args.color
|
|
47
|
+
:title=args.title
|
|
48
|
+
:variant=args.variant
|
|
49
|
+
/>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
`,
|
|
53
|
+
}),
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export default meta
|
|
57
|
+
type StoryArgs = SoldStackerProps
|
|
58
|
+
type Story = StoryObj<StoryArgs>
|
|
59
|
+
type OverridesStory = Omit<Story, 'argTypes'> & {
|
|
60
|
+
argTypes?: Record<string, any>
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export const 基本: OverridesStory = {
|
|
64
|
+
args: {},
|
|
65
|
+
argTypes: {
|
|
66
|
+
default: { table: { disable: true } },
|
|
67
|
+
},
|
|
68
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import SpinButton, {
|
|
3
|
+
type SpinButtonProps,
|
|
4
|
+
} from '@/components/elements/SpinButton.vue'
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof SpinButton> = {
|
|
7
|
+
title: 'Elements/SpinButton',
|
|
8
|
+
component: SpinButton,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: {
|
|
11
|
+
size: {
|
|
12
|
+
control: 'select',
|
|
13
|
+
options: ['md', 'lg'],
|
|
14
|
+
},
|
|
15
|
+
min: {
|
|
16
|
+
control: 'number',
|
|
17
|
+
},
|
|
18
|
+
max: {
|
|
19
|
+
control: 'number',
|
|
20
|
+
},
|
|
21
|
+
disabled: {
|
|
22
|
+
control: 'boolean',
|
|
23
|
+
},
|
|
24
|
+
showDeleteAtMin: {
|
|
25
|
+
control: 'boolean',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
args: {
|
|
29
|
+
size: 'md',
|
|
30
|
+
min: 0,
|
|
31
|
+
max: 10,
|
|
32
|
+
disabled: false,
|
|
33
|
+
showDeleteAtMin: false,
|
|
34
|
+
},
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export default meta
|
|
38
|
+
type StoryArgs = SpinButtonProps
|
|
39
|
+
type Story = StoryObj<StoryArgs>
|
|
40
|
+
type OverridesStory = Omit<Story, 'argTypes'> & {
|
|
41
|
+
argTypes?: Record<string, any>
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const 基本: OverridesStory = {
|
|
45
|
+
args: {
|
|
46
|
+
modelValue: 1,
|
|
47
|
+
},
|
|
48
|
+
argTypes: {
|
|
49
|
+
default: { table: { disable: true } },
|
|
50
|
+
},
|
|
51
|
+
render: (args: StoryArgs & { modelValue: number }) => ({
|
|
52
|
+
components: { 'rn-spinButton': SpinButton },
|
|
53
|
+
setup() {
|
|
54
|
+
return { args }
|
|
55
|
+
},
|
|
56
|
+
template: /* html */ `
|
|
57
|
+
<div class='sb-canvas'>
|
|
58
|
+
<rn-spinButton
|
|
59
|
+
v-model=args.modelValue
|
|
60
|
+
:size=args.size
|
|
61
|
+
:min=args.min
|
|
62
|
+
:max=args.max
|
|
63
|
+
:disabled=args.disabled
|
|
64
|
+
:showDeleteAtMin=args.showDeleteAtMin
|
|
65
|
+
@increment="() => console.log('increment')"
|
|
66
|
+
@decrement="() => console.log('decrement')"
|
|
67
|
+
@delete="() => console.log('delete')"
|
|
68
|
+
@input-change="(value) => console.log('input-change:', value)"
|
|
69
|
+
>
|
|
70
|
+
</rn-spinButton>
|
|
71
|
+
</div>
|
|
72
|
+
`,
|
|
73
|
+
}),
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export const サイズバリエーション: OverridesStory = {
|
|
77
|
+
args: {
|
|
78
|
+
modelValue: 5,
|
|
79
|
+
},
|
|
80
|
+
render: (args: StoryArgs & { modelValue: number }) => ({
|
|
81
|
+
components: { 'rn-spinButton': SpinButton },
|
|
82
|
+
setup() {
|
|
83
|
+
return { args }
|
|
84
|
+
},
|
|
85
|
+
template: /* html */ `
|
|
86
|
+
<div class='sb-canvas' style="display: flex; gap: 20px; align-items: center;">
|
|
87
|
+
<div>
|
|
88
|
+
<p>Medium サイズ</p>
|
|
89
|
+
<rn-spinButton
|
|
90
|
+
v-model=args.modelValue
|
|
91
|
+
size="md"
|
|
92
|
+
:min=args.min
|
|
93
|
+
:max=args.max
|
|
94
|
+
/>
|
|
95
|
+
</div>
|
|
96
|
+
<div>
|
|
97
|
+
<p>Large サイズ</p>
|
|
98
|
+
<rn-spinButton
|
|
99
|
+
v-model=args.modelValue
|
|
100
|
+
size="lg"
|
|
101
|
+
:min=args.min
|
|
102
|
+
:max=args.max
|
|
103
|
+
/>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
`,
|
|
107
|
+
}),
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export const 削除機能付き: OverridesStory = {
|
|
111
|
+
args: {
|
|
112
|
+
modelValue: 0,
|
|
113
|
+
showDeleteAtMin: true,
|
|
114
|
+
},
|
|
115
|
+
render: (args: StoryArgs & { modelValue: number }) => ({
|
|
116
|
+
components: { 'rn-spinButton': SpinButton },
|
|
117
|
+
setup() {
|
|
118
|
+
return { args }
|
|
119
|
+
},
|
|
120
|
+
template: /* html */ `
|
|
121
|
+
<div class='sb-canvas'>
|
|
122
|
+
<p>最小値 (0) の時にマイナスボタンがゴミ箱アイコンになります</p>
|
|
123
|
+
<rn-spinButton
|
|
124
|
+
v-model=args.modelValue
|
|
125
|
+
:size=args.size
|
|
126
|
+
:min=args.min
|
|
127
|
+
:max=args.max
|
|
128
|
+
:showDeleteAtMin=args.showDeleteAtMin
|
|
129
|
+
@delete="() => console.log('削除されました')"
|
|
130
|
+
/>
|
|
131
|
+
</div>
|
|
132
|
+
`,
|
|
133
|
+
}),
|
|
134
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import Spinner, { SpinnerProps } from '@/components/elements/Spinner.vue'
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Spinner> = {
|
|
5
|
+
title: 'Elements/Spinner',
|
|
6
|
+
component: Spinner,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
argTypes: {
|
|
9
|
+
size: { control: 'select', options: ['xs', 'sm', 'md', 'lg', 'xl'] },
|
|
10
|
+
color: {
|
|
11
|
+
control: 'select',
|
|
12
|
+
options: [
|
|
13
|
+
'primary',
|
|
14
|
+
'secondary',
|
|
15
|
+
'warning',
|
|
16
|
+
'danger',
|
|
17
|
+
'success',
|
|
18
|
+
'info',
|
|
19
|
+
'default',
|
|
20
|
+
'subtle',
|
|
21
|
+
'muted',
|
|
22
|
+
'light',
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
args: {
|
|
27
|
+
size: 'md',
|
|
28
|
+
color: 'default',
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export default meta
|
|
33
|
+
type StoryArgs = SpinnerProps
|
|
34
|
+
type Story = StoryObj<StoryArgs>
|
|
35
|
+
type OverridesStory = Omit<Story, 'argTypes'> & {
|
|
36
|
+
argTypes?: Record<string, any>
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const 基本: OverridesStory = {
|
|
40
|
+
args: {},
|
|
41
|
+
argTypes: {
|
|
42
|
+
default: { table: { disable: true } },
|
|
43
|
+
},
|
|
44
|
+
render: (args: StoryArgs) => ({
|
|
45
|
+
components: { 'rn-spinner': Spinner },
|
|
46
|
+
setup() {
|
|
47
|
+
return { args }
|
|
48
|
+
},
|
|
49
|
+
template: /* html */ `
|
|
50
|
+
<div class='sb-canvas'>
|
|
51
|
+
<rn-spinner
|
|
52
|
+
:size=args.size
|
|
53
|
+
:color=args.color
|
|
54
|
+
/>
|
|
55
|
+
</div>
|
|
56
|
+
`,
|
|
57
|
+
}),
|
|
58
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import Stack from '@/components/layouts/Stack.vue'
|
|
3
|
+
import './assets/css/style.css'
|
|
4
|
+
const meta: Meta<typeof Stack> = {
|
|
5
|
+
title: 'Layouts/Stack',
|
|
6
|
+
component: Stack,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
argTypes: {
|
|
9
|
+
direction: { control: 'select', options: ['horizontal', 'vertical'] },
|
|
10
|
+
horizontalReSize: { control: 'select', options: ['hug', 'fill'] },
|
|
11
|
+
verticalReSize: { control: 'select', options: ['hug', 'fill'] },
|
|
12
|
+
horizontalAlign: {
|
|
13
|
+
control: 'select',
|
|
14
|
+
options: ['start', 'center', 'end', 'between'],
|
|
15
|
+
},
|
|
16
|
+
verticalAlign: {
|
|
17
|
+
control: 'select',
|
|
18
|
+
options: ['start', 'center', 'end', 'between'],
|
|
19
|
+
},
|
|
20
|
+
gap: {
|
|
21
|
+
control: 'select',
|
|
22
|
+
options: ['xs', 'sm', 'md', 'lg', 'xl'],
|
|
23
|
+
},
|
|
24
|
+
columns: { control: 'number' },
|
|
25
|
+
},
|
|
26
|
+
args: {
|
|
27
|
+
direction: 'horizontal',
|
|
28
|
+
horizontalReSize: 'hug',
|
|
29
|
+
verticalReSize: 'hug',
|
|
30
|
+
horizontalAlign: 'start',
|
|
31
|
+
verticalAlign: 'start',
|
|
32
|
+
gap: 'md',
|
|
33
|
+
columns: 1,
|
|
34
|
+
},
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export default meta
|
|
38
|
+
type Story = StoryObj<typeof Stack>
|
|
39
|
+
|
|
40
|
+
export const 基本: Story = {
|
|
41
|
+
args: {},
|
|
42
|
+
argTypes: {
|
|
43
|
+
default: { table: { disable: true } },
|
|
44
|
+
},
|
|
45
|
+
render: (args) => ({
|
|
46
|
+
components: { 'rn-stack': Stack },
|
|
47
|
+
setup() {
|
|
48
|
+
return { args }
|
|
49
|
+
},
|
|
50
|
+
template: /* html */ `
|
|
51
|
+
<div style="height:560px" class='sb-canvas'>
|
|
52
|
+
<rn-stack
|
|
53
|
+
:direction=args.direction
|
|
54
|
+
:horizontal-re-size=args.horizontalReSize
|
|
55
|
+
:vertical-re-size=args.verticalReSize
|
|
56
|
+
:horizontal-align=args.horizontalAlign
|
|
57
|
+
:vertical-align=args.verticalAlign
|
|
58
|
+
:gap=args.gap
|
|
59
|
+
:columns=args.columns>
|
|
60
|
+
<rn-stack><div class="sb-dummy-element" /></rn-stack>
|
|
61
|
+
<rn-stack><div class="sb-dummy-element" /></rn-stack>
|
|
62
|
+
<rn-stack><div class="sb-dummy-element" /></rn-stack>
|
|
63
|
+
</rn-stack>
|
|
64
|
+
</div>
|
|
65
|
+
`,
|
|
66
|
+
}),
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export const 応用: Story = {
|
|
70
|
+
args: {},
|
|
71
|
+
argTypes: {
|
|
72
|
+
direction: { table: { disable: true } },
|
|
73
|
+
horizontalReSize: { table: { disable: true } },
|
|
74
|
+
verticalReSize: { table: { disable: true } },
|
|
75
|
+
horizontalAlign: { table: { disable: true } },
|
|
76
|
+
verticalAlign: { table: { disable: true } },
|
|
77
|
+
gap: { table: { disable: true } },
|
|
78
|
+
columns: { table: { disable: true } },
|
|
79
|
+
default: { table: { disable: true } },
|
|
80
|
+
},
|
|
81
|
+
render: (args) => ({
|
|
82
|
+
components: { 'rn-stack': Stack },
|
|
83
|
+
setup() {
|
|
84
|
+
return { args }
|
|
85
|
+
},
|
|
86
|
+
template: /* html */ `
|
|
87
|
+
<div style="height:560px" class='sb-canvas'>
|
|
88
|
+
<rn-stack horizontal-re-size="fill" vertical-re-size="fill" direction="vertical">
|
|
89
|
+
一部の要素を横幅いっぱいにする
|
|
90
|
+
<rn-stack horizontal-re-size="fill">
|
|
91
|
+
<rn-stack><div class="sb-dummy-element" /></rn-stack>
|
|
92
|
+
<rn-stack horizontal-re-size="fill"><div class="sb-dummy-element" /></rn-stack>
|
|
93
|
+
</rn-stack>
|
|
94
|
+
一部の要素を縦幅いっぱいにする
|
|
95
|
+
<rn-stack direction="vertical" horizontal-re-size="fill" vertical-re-size="fill">
|
|
96
|
+
<rn-stack><div class="sb-dummy-element" /></rn-stack>
|
|
97
|
+
<rn-stack vertical-re-size="fill"><div class="sb-dummy-element" /></rn-stack>
|
|
98
|
+
<rn-stack><div class="sb-dummy-element" /></rn-stack>
|
|
99
|
+
</rn-stack>
|
|
100
|
+
</rn-stack>
|
|
101
|
+
</div>
|
|
102
|
+
`,
|
|
103
|
+
}),
|
|
104
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { ref } from 'vue'
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
3
|
+
import Switch, { type SwitchProps } from '@/components/elements/Switch.vue'
|
|
4
|
+
import { StatusColor } from '@/types'
|
|
5
|
+
import { StatusColorOptions } from '@/constants'
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof Switch> = {
|
|
8
|
+
title: 'Elements/Switch',
|
|
9
|
+
component: Switch,
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
parameters: {
|
|
12
|
+
docs: {
|
|
13
|
+
description: {
|
|
14
|
+
component: 'スイッチ用コンポーネント',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
argTypes: {
|
|
19
|
+
color: {
|
|
20
|
+
control: 'select',
|
|
21
|
+
options: Object.keys(StatusColorOptions) as StatusColor[],
|
|
22
|
+
},
|
|
23
|
+
label: {
|
|
24
|
+
control: {
|
|
25
|
+
type: 'text',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
disabled: {
|
|
29
|
+
control: 'boolean',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
args: {
|
|
33
|
+
label: 'isChecked',
|
|
34
|
+
disabled: false,
|
|
35
|
+
},
|
|
36
|
+
render: (args) => ({
|
|
37
|
+
components: { 'rn-switch': Switch },
|
|
38
|
+
setup() {
|
|
39
|
+
const checkedValue = ref('')
|
|
40
|
+
return { args, checkedValue }
|
|
41
|
+
},
|
|
42
|
+
template: /* html */ `
|
|
43
|
+
<div class='sb-canvas'>
|
|
44
|
+
<rn-switch
|
|
45
|
+
:color=args.color
|
|
46
|
+
:label=args.label
|
|
47
|
+
:disabled=args.disabled
|
|
48
|
+
v-model=checkedValue
|
|
49
|
+
/>
|
|
50
|
+
<p style='margin-top: 24px;'>
|
|
51
|
+
選択中:{{ checkedValue }}
|
|
52
|
+
</p>
|
|
53
|
+
</div>
|
|
54
|
+
`,
|
|
55
|
+
}),
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export default meta
|
|
59
|
+
type StoryArgs = SwitchProps
|
|
60
|
+
type Story = StoryObj<StoryArgs>
|
|
61
|
+
type OverridesStory = Omit<Story, 'argTypes'> & {
|
|
62
|
+
argTypes?: Record<string, SwitchProps>
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export const 基本: OverridesStory = {
|
|
66
|
+
args: {},
|
|
67
|
+
argTypes: {},
|
|
68
|
+
}
|