@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,217 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
import Disclosure, {
|
|
4
|
+
DisclosureProps,
|
|
5
|
+
} from '@/components/interactive/Disclosure.vue'
|
|
6
|
+
import Stack from '@/components/layouts/Stack.vue'
|
|
7
|
+
import Text from '@/components/elements/Text.vue'
|
|
8
|
+
import Button from '@/components/elements/Button.vue'
|
|
9
|
+
import './assets/css/style.css'
|
|
10
|
+
|
|
11
|
+
const meta: Meta<typeof Disclosure> = {
|
|
12
|
+
title: 'Interactive/Disclosure',
|
|
13
|
+
component: Disclosure,
|
|
14
|
+
tags: ['autodocs'],
|
|
15
|
+
argTypes: {
|
|
16
|
+
title: { control: 'text', description: 'トリガーのタイトル' },
|
|
17
|
+
open: { control: 'boolean', description: '初期状態(開/閉)' },
|
|
18
|
+
},
|
|
19
|
+
args: {
|
|
20
|
+
title: 'セクションタイトル',
|
|
21
|
+
open: false,
|
|
22
|
+
},
|
|
23
|
+
parameters: {
|
|
24
|
+
docs: {
|
|
25
|
+
description: {
|
|
26
|
+
component: `
|
|
27
|
+
インライン展開/収縮コンポーネント。アコーディオン的な開閉UIを提供します。
|
|
28
|
+
|
|
29
|
+
## 用途
|
|
30
|
+
- SPフッターのメニューセクション
|
|
31
|
+
- SPドロワー内のサブメニュー
|
|
32
|
+
- FAQ / ヘルプセクション
|
|
33
|
+
- フィルター系UI
|
|
34
|
+
|
|
35
|
+
## Slot
|
|
36
|
+
- \`default\`: 展開時に表示されるコンテンツ
|
|
37
|
+
- \`trigger\`: トリガー部分のカスタマイズ(オプション)
|
|
38
|
+
`,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default meta
|
|
45
|
+
type Story = StoryObj<DisclosureProps>
|
|
46
|
+
|
|
47
|
+
export const Default: Story = {
|
|
48
|
+
args: {
|
|
49
|
+
title: 'サポート',
|
|
50
|
+
},
|
|
51
|
+
render: (args) => ({
|
|
52
|
+
components: {
|
|
53
|
+
'rn-disclosure': Disclosure,
|
|
54
|
+
'rn-stack': Stack,
|
|
55
|
+
'rn-text': Text,
|
|
56
|
+
},
|
|
57
|
+
setup() {
|
|
58
|
+
return { args }
|
|
59
|
+
},
|
|
60
|
+
template: /* html */ `
|
|
61
|
+
<div class="sb-canvas" style="max-width: 400px;">
|
|
62
|
+
<rn-disclosure v-bind="args">
|
|
63
|
+
<rn-stack direction="vertical" gap="sm" style="padding: 8px 0;">
|
|
64
|
+
<a href="/faq">FAQ</a>
|
|
65
|
+
<a href="/contact">お問い合わせ</a>
|
|
66
|
+
<a href="/shipping">配送について</a>
|
|
67
|
+
</rn-stack>
|
|
68
|
+
</rn-disclosure>
|
|
69
|
+
</div>
|
|
70
|
+
`,
|
|
71
|
+
}),
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export const 初期状態オープン: Story = {
|
|
75
|
+
args: {
|
|
76
|
+
title: '規約・免責',
|
|
77
|
+
open: true,
|
|
78
|
+
},
|
|
79
|
+
render: (args) => ({
|
|
80
|
+
components: {
|
|
81
|
+
'rn-disclosure': Disclosure,
|
|
82
|
+
'rn-stack': Stack,
|
|
83
|
+
},
|
|
84
|
+
setup() {
|
|
85
|
+
return { args }
|
|
86
|
+
},
|
|
87
|
+
template: /* html */ `
|
|
88
|
+
<div class="sb-canvas" style="max-width: 400px;">
|
|
89
|
+
<rn-disclosure v-bind="args">
|
|
90
|
+
<rn-stack direction="vertical" gap="sm" style="padding: 8px 0;">
|
|
91
|
+
<a href="/terms">利用規約</a>
|
|
92
|
+
<a href="/privacy">プライバシーポリシー</a>
|
|
93
|
+
<a href="/legal">特定商取引法に基づく表記</a>
|
|
94
|
+
</rn-stack>
|
|
95
|
+
</rn-disclosure>
|
|
96
|
+
</div>
|
|
97
|
+
`,
|
|
98
|
+
}),
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export const 複数並べた場合: Story = {
|
|
102
|
+
render: () => ({
|
|
103
|
+
components: {
|
|
104
|
+
'rn-disclosure': Disclosure,
|
|
105
|
+
'rn-stack': Stack,
|
|
106
|
+
},
|
|
107
|
+
template: /* html */ `
|
|
108
|
+
<div class="sb-canvas" style="max-width: 400px;">
|
|
109
|
+
<rn-disclosure title="サポート">
|
|
110
|
+
<rn-stack direction="vertical" gap="sm" style="padding: 8px 0;">
|
|
111
|
+
<a href="/faq">FAQ</a>
|
|
112
|
+
<a href="/contact">お問い合わせ</a>
|
|
113
|
+
<a href="/shipping">配送について</a>
|
|
114
|
+
</rn-stack>
|
|
115
|
+
</rn-disclosure>
|
|
116
|
+
|
|
117
|
+
<rn-disclosure title="規約・免責">
|
|
118
|
+
<rn-stack direction="vertical" gap="sm" style="padding: 8px 0;">
|
|
119
|
+
<a href="/terms">利用規約</a>
|
|
120
|
+
<a href="/privacy">プライバシーポリシー</a>
|
|
121
|
+
<a href="/legal">特定商取引法に基づく表記</a>
|
|
122
|
+
</rn-stack>
|
|
123
|
+
</rn-disclosure>
|
|
124
|
+
|
|
125
|
+
<rn-disclosure title="アカウント">
|
|
126
|
+
<rn-stack direction="vertical" gap="sm" style="padding: 8px 0;">
|
|
127
|
+
<a href="/signup">サインアップ</a>
|
|
128
|
+
<a href="/login">ログイン</a>
|
|
129
|
+
</rn-stack>
|
|
130
|
+
</rn-disclosure>
|
|
131
|
+
</div>
|
|
132
|
+
`,
|
|
133
|
+
}),
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export const SPフッター想定: Story = {
|
|
137
|
+
parameters: {
|
|
138
|
+
viewport: {
|
|
139
|
+
defaultViewport: 'mobile1',
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
render: () => ({
|
|
143
|
+
components: {
|
|
144
|
+
'rn-disclosure': Disclosure,
|
|
145
|
+
'rn-stack': Stack,
|
|
146
|
+
'rn-text': Text,
|
|
147
|
+
},
|
|
148
|
+
template: /* html */ `
|
|
149
|
+
<div class="sb-canvas">
|
|
150
|
+
<rn-stack direction="vertical" gap="md" style="padding: 16px;">
|
|
151
|
+
<!-- ロゴ・SNS部分 -->
|
|
152
|
+
<rn-stack direction="vertical" align="center" gap="md" style="padding: 16px 0;">
|
|
153
|
+
<div style="border: 1px solid #ccc; padding: 16px 32px;">FooterLogo</div>
|
|
154
|
+
<div style="border: 1px solid #ccc; padding: 8px 16px;">SNS Links</div>
|
|
155
|
+
</rn-stack>
|
|
156
|
+
|
|
157
|
+
<!-- メニュー部分(子供あり→Disclosure) -->
|
|
158
|
+
<rn-disclosure title="サポート">
|
|
159
|
+
<rn-stack direction="vertical" gap="sm" style="padding: 8px 0;">
|
|
160
|
+
<a href="/faq">FAQ</a>
|
|
161
|
+
<a href="/contact">お問い合わせ</a>
|
|
162
|
+
<a href="/shipping">配送について</a>
|
|
163
|
+
</rn-stack>
|
|
164
|
+
</rn-disclosure>
|
|
165
|
+
|
|
166
|
+
<rn-disclosure title="規約・免責">
|
|
167
|
+
<rn-stack direction="vertical" gap="sm" style="padding: 8px 0;">
|
|
168
|
+
<a href="/terms">利用規約</a>
|
|
169
|
+
<a href="/privacy">プライバシーポリシー</a>
|
|
170
|
+
</rn-stack>
|
|
171
|
+
</rn-disclosure>
|
|
172
|
+
|
|
173
|
+
<!-- Copyright -->
|
|
174
|
+
<rn-stack direction="vertical" align="center" style="padding: 24px 0;">
|
|
175
|
+
<rn-text size="caption">copyright XXXXXXXXXX</rn-text>
|
|
176
|
+
</rn-stack>
|
|
177
|
+
</rn-stack>
|
|
178
|
+
</div>
|
|
179
|
+
`,
|
|
180
|
+
}),
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export const 外部から制御: Story = {
|
|
184
|
+
args: {
|
|
185
|
+
title: 'v-modelで制御',
|
|
186
|
+
},
|
|
187
|
+
render: (args) => ({
|
|
188
|
+
components: {
|
|
189
|
+
'rn-disclosure': Disclosure,
|
|
190
|
+
'rn-stack': Stack,
|
|
191
|
+
'rn-button': Button,
|
|
192
|
+
},
|
|
193
|
+
setup() {
|
|
194
|
+
const isOpen = ref(false)
|
|
195
|
+
const toggleFromOutside = () => {
|
|
196
|
+
isOpen.value = !isOpen.value
|
|
197
|
+
}
|
|
198
|
+
return { args, isOpen, toggleFromOutside }
|
|
199
|
+
},
|
|
200
|
+
template: /* html */ `
|
|
201
|
+
<div class="sb-canvas" style="max-width: 400px;">
|
|
202
|
+
<rn-stack direction="vertical" gap="md">
|
|
203
|
+
<rn-button @click="toggleFromOutside">
|
|
204
|
+
外部から{{ isOpen ? '閉じる' : '開く' }}
|
|
205
|
+
</rn-button>
|
|
206
|
+
<p>現在の状態: {{ isOpen ? '開いている' : '閉じている' }}</p>
|
|
207
|
+
<rn-disclosure v-bind="args" v-model:open="isOpen">
|
|
208
|
+
<rn-stack direction="vertical" gap="sm" style="padding: 8px 0;">
|
|
209
|
+
<p>v-model:openで外部から開閉状態を制御できます。</p>
|
|
210
|
+
<p>内部のトリガークリックでも状態が同期されます。</p>
|
|
211
|
+
</rn-stack>
|
|
212
|
+
</rn-disclosure>
|
|
213
|
+
</rn-stack>
|
|
214
|
+
</div>
|
|
215
|
+
`,
|
|
216
|
+
}),
|
|
217
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import Divider, { DividerProps } from '@/components/elements/Divider.vue'
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Divider> = {
|
|
5
|
+
title: 'Elements/Divider',
|
|
6
|
+
component: Divider,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
argTypes: {
|
|
9
|
+
color: {
|
|
10
|
+
control: 'select',
|
|
11
|
+
options: [
|
|
12
|
+
'primary',
|
|
13
|
+
'secondary',
|
|
14
|
+
'warning',
|
|
15
|
+
'danger',
|
|
16
|
+
'success',
|
|
17
|
+
'info',
|
|
18
|
+
'default',
|
|
19
|
+
'subtle',
|
|
20
|
+
'muted',
|
|
21
|
+
'light',
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
direction: {
|
|
25
|
+
control: 'select',
|
|
26
|
+
options: ['horizontal', 'vertical'],
|
|
27
|
+
},
|
|
28
|
+
weight: {
|
|
29
|
+
control: 'select',
|
|
30
|
+
options: ['thin', 'thick', 'normal'],
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
args: {
|
|
34
|
+
color: 'default',
|
|
35
|
+
direction: 'horizontal',
|
|
36
|
+
weight: 'normal',
|
|
37
|
+
},
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export default meta
|
|
41
|
+
type StoryArgs = DividerProps & { slotText: string }
|
|
42
|
+
type Story = StoryObj<StoryArgs>
|
|
43
|
+
type OverridesStory = Omit<Story, 'argTypes'> & {
|
|
44
|
+
argTypes?: Record<string, any>
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const 基本: OverridesStory = {
|
|
48
|
+
args: {},
|
|
49
|
+
argTypes: {
|
|
50
|
+
default: { table: { disable: true } },
|
|
51
|
+
},
|
|
52
|
+
render: (args: StoryArgs) => ({
|
|
53
|
+
components: { 'rn-divider': Divider },
|
|
54
|
+
setup() {
|
|
55
|
+
return { args }
|
|
56
|
+
},
|
|
57
|
+
template: /* html */ `
|
|
58
|
+
<div class='sb-canvas' style='height: 100px;'>
|
|
59
|
+
<rn-divider
|
|
60
|
+
:color=args.color
|
|
61
|
+
:direction=args.direction
|
|
62
|
+
:weight=args.weight
|
|
63
|
+
>
|
|
64
|
+
</rn-divider>
|
|
65
|
+
</div>
|
|
66
|
+
`,
|
|
67
|
+
}),
|
|
68
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import Drawer, { DrawerProps } from '@/components/navigation/Drawer.vue'
|
|
3
|
+
import Button from '@/components/elements/Button.vue'
|
|
4
|
+
import Icon from '@/components/elements/Icon.vue'
|
|
5
|
+
import './assets/css/style.css'
|
|
6
|
+
import { ref } from 'vue'
|
|
7
|
+
const meta: Meta<typeof Drawer> = {
|
|
8
|
+
title: 'Navigation/Drawer',
|
|
9
|
+
component: Drawer,
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
argTypes: {
|
|
12
|
+
visible: { control: 'boolean' },
|
|
13
|
+
title: { control: 'text' },
|
|
14
|
+
},
|
|
15
|
+
args: {
|
|
16
|
+
visible: false,
|
|
17
|
+
title: 'ドロワータイトル',
|
|
18
|
+
},
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default meta
|
|
22
|
+
type StoryArgs = DrawerProps & {}
|
|
23
|
+
type Story = StoryObj<StoryArgs>
|
|
24
|
+
type OverridesStory = Omit<Story, 'argTypes'> & {
|
|
25
|
+
argTypes?: Record<string, any>
|
|
26
|
+
}
|
|
27
|
+
export const 基本: OverridesStory = {
|
|
28
|
+
args: {},
|
|
29
|
+
argTypes: {
|
|
30
|
+
visible: { control: { disable: true } },
|
|
31
|
+
header: { table: { disable: true } },
|
|
32
|
+
headerRightItem: { table: { disable: true } },
|
|
33
|
+
headerLeftItem: { table: { disable: true } },
|
|
34
|
+
body: { table: { disable: true } },
|
|
35
|
+
footer: { table: { disable: true } },
|
|
36
|
+
},
|
|
37
|
+
render: (args, {}) => ({
|
|
38
|
+
components: { 'rn-drawer': Drawer, 'rn-button': Button },
|
|
39
|
+
setup() {
|
|
40
|
+
const visible = ref(true)
|
|
41
|
+
const handleVisible = () => {
|
|
42
|
+
visible.value = !visible.value
|
|
43
|
+
}
|
|
44
|
+
return { args, visible, handleVisible }
|
|
45
|
+
},
|
|
46
|
+
template: /* html */ `
|
|
47
|
+
<div style="height:560px" class='sb-canvas'>
|
|
48
|
+
<rn-button @click="handleVisible">ドロワーを開く</rn-button>
|
|
49
|
+
<rn-drawer
|
|
50
|
+
v-model:visible="visible"
|
|
51
|
+
:title=args.title
|
|
52
|
+
>
|
|
53
|
+
<template #body>
|
|
54
|
+
<div class="RN-al-vertical RN-al-fill-width RN-al-gap-md">
|
|
55
|
+
<div class="RN-al-vertical RN-al-gap-xs RN-al-fill-width">
|
|
56
|
+
<span class="RN-text--size-body">
|
|
57
|
+
- 基本的な利用方法です。template #body中で自由にレイアウトができます。<br />
|
|
58
|
+
<br />
|
|
59
|
+
- オーバーレイとクローズアイコンをクリックすると閉じます。<br />
|
|
60
|
+
</span>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</template>
|
|
64
|
+
</rn-drawer>
|
|
65
|
+
</div>
|
|
66
|
+
`,
|
|
67
|
+
}),
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const 応用1: OverridesStory = {
|
|
71
|
+
args: {
|
|
72
|
+
title: '各スロットを利用したドロワー',
|
|
73
|
+
},
|
|
74
|
+
argTypes: {
|
|
75
|
+
title: { control: { disable: true } },
|
|
76
|
+
visible: { control: { disable: true } },
|
|
77
|
+
header: { table: { disable: true } },
|
|
78
|
+
headerRightItem: { table: { disable: true } },
|
|
79
|
+
headerLeftItem: { table: { disable: true } },
|
|
80
|
+
body: { table: { disable: true } },
|
|
81
|
+
footer: { table: { disable: true } },
|
|
82
|
+
},
|
|
83
|
+
render: (args, {}) => ({
|
|
84
|
+
components: { 'rn-drawer': Drawer, 'rn-button': Button, 'rn-icon': Icon },
|
|
85
|
+
setup() {
|
|
86
|
+
const visible = ref(true)
|
|
87
|
+
const handleVisible = () => {
|
|
88
|
+
visible.value = !visible.value
|
|
89
|
+
}
|
|
90
|
+
return { args, visible, handleVisible }
|
|
91
|
+
},
|
|
92
|
+
template: /* html */ `
|
|
93
|
+
<div class='sb-canvas'>
|
|
94
|
+
<rn-button @click="handleVisible">ドロワーを開く</rn-button>
|
|
95
|
+
<rn-drawer
|
|
96
|
+
v-model:visible="visible"
|
|
97
|
+
:title=args.title
|
|
98
|
+
>
|
|
99
|
+
<template #header>
|
|
100
|
+
<div class="RN-al-horizontal RN-al-gap-md RN-al-fill-width RN-al-width-align-between">
|
|
101
|
+
<div class="RN-al-horizontal RN-al-gap-md">
|
|
102
|
+
<rn-icon color="subtle" size="xl" icon="circle-user" />
|
|
103
|
+
<div class="RN-al-vertical">
|
|
104
|
+
<div><span class="RN-text--weight-bold">User Name</span></div>
|
|
105
|
+
<div>
|
|
106
|
+
<span class="RN-text--size-caption RN-text--color-subtle"
|
|
107
|
+
>username@reni.co.jp</span
|
|
108
|
+
>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
<div class="RN-al-horizontal RN-al-gap-md">
|
|
113
|
+
<rn-icon icon="ellipsis" />
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
</template>
|
|
117
|
+
<template #body>
|
|
118
|
+
<div class="RN-al-vertical RN-al-fill-width RN-al-gap-md">
|
|
119
|
+
<div class="RN-al-vertical RN-al-gap-xs RN-al-fill-width">
|
|
120
|
+
<span class="RN-text--size-body">
|
|
121
|
+
- 各種スロット例です。#header / #footer を利用した例です。<br />
|
|
122
|
+
</span>
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
</template>
|
|
126
|
+
<template #footer>
|
|
127
|
+
<div class="RN-al-vertical RN-al-fill-width RN-al-gap-md">
|
|
128
|
+
<rn-button @click="handleVisible" class="RN-al-fill-width">ドロワーを閉じる</rn-button>
|
|
129
|
+
</div>
|
|
130
|
+
</template>
|
|
131
|
+
</rn-drawer>
|
|
132
|
+
</div>
|
|
133
|
+
`,
|
|
134
|
+
}),
|
|
135
|
+
}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { ref } from 'vue'
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
3
|
+
import DropDown, {
|
|
4
|
+
type DropdownProps,
|
|
5
|
+
} from '@/components/interactive/DropDown.vue'
|
|
6
|
+
import Button from '@/components/elements/Button.vue'
|
|
7
|
+
|
|
8
|
+
const meta: Meta<typeof DropDown> = {
|
|
9
|
+
title: 'Interactive/DropDown',
|
|
10
|
+
component: DropDown,
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
parameters: {
|
|
13
|
+
docs: {
|
|
14
|
+
description: {
|
|
15
|
+
component:
|
|
16
|
+
'DropDownコンポーネントです。ドロップダウンメニューを表示するためのコンポーネントで、カスタムトリガーやメニューコンテンツをサポート。',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
argTypes: {
|
|
21
|
+
items: {
|
|
22
|
+
control: 'object',
|
|
23
|
+
},
|
|
24
|
+
disabled: {
|
|
25
|
+
control: 'boolean',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
args: {
|
|
29
|
+
items: [
|
|
30
|
+
{
|
|
31
|
+
title: 'オプション1',
|
|
32
|
+
action: () => alert('オプション1が選択されました'),
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
title: 'オプション2',
|
|
36
|
+
action: () => alert('オプション2が選択されました'),
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
title: 'オプション3',
|
|
40
|
+
action: () => alert('オプション3が選択されました'),
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
disabled: false,
|
|
44
|
+
},
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export default meta
|
|
48
|
+
type StoryArgs = DropdownProps
|
|
49
|
+
type Story = StoryObj<StoryArgs>
|
|
50
|
+
type OverridesStory = Omit<Story, 'argTypes'> & {
|
|
51
|
+
argTypes?: Record<string, any>
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export const 基本: OverridesStory = {
|
|
55
|
+
args: {},
|
|
56
|
+
argTypes: {},
|
|
57
|
+
render: (args) => ({
|
|
58
|
+
components: { 'rn-dropdown': DropDown },
|
|
59
|
+
setup() {
|
|
60
|
+
return { args }
|
|
61
|
+
},
|
|
62
|
+
template: /* html */ `
|
|
63
|
+
<div class='sb-canvas'>
|
|
64
|
+
<div style='height: 200px; padding: 20px;'>
|
|
65
|
+
<rn-dropdown
|
|
66
|
+
:items="args.items"
|
|
67
|
+
:disabled="args.disabled"
|
|
68
|
+
>
|
|
69
|
+
<template #trigger="{ toggle }">
|
|
70
|
+
<rn-button variant="text" @click="toggle">メニューを開く</rn-button>
|
|
71
|
+
</template>
|
|
72
|
+
</rn-dropdown>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
`,
|
|
76
|
+
}),
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export const 応用1: OverridesStory = {
|
|
80
|
+
args: {},
|
|
81
|
+
argTypes: {},
|
|
82
|
+
parameters: {
|
|
83
|
+
docs: {
|
|
84
|
+
description: {
|
|
85
|
+
story: 'カスタムトリガーボタンを使用したドロップダウン',
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
render: (args) => ({
|
|
90
|
+
components: { 'rn-dropdown': DropDown, 'rn-button': Button },
|
|
91
|
+
setup() {
|
|
92
|
+
return { args }
|
|
93
|
+
},
|
|
94
|
+
template: /* html */ `
|
|
95
|
+
<div class='sb-canvas'>
|
|
96
|
+
<div style='height: 200px; padding: 20px;'>
|
|
97
|
+
<rn-dropdown
|
|
98
|
+
:items="args.items"
|
|
99
|
+
:disabled="args.disabled"
|
|
100
|
+
>
|
|
101
|
+
<template #trigger="{ toggle }">
|
|
102
|
+
<rn-button @click="toggle">メニューを開く</rn-button>
|
|
103
|
+
</template>
|
|
104
|
+
</rn-dropdown>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
`,
|
|
108
|
+
}),
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export const 応用2: OverridesStory = {
|
|
112
|
+
args: {},
|
|
113
|
+
argTypes: {},
|
|
114
|
+
parameters: {
|
|
115
|
+
docs: {
|
|
116
|
+
description: {
|
|
117
|
+
story: 'カスタムメニューコンテンツを使用したドロップダウン',
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
render: (args) => ({
|
|
122
|
+
components: { 'rn-dropdown': DropDown, 'rn-button': Button },
|
|
123
|
+
setup() {
|
|
124
|
+
const customItems = [
|
|
125
|
+
{ title: '🏠 ホーム', action: () => alert('ホームに移動') },
|
|
126
|
+
{ title: '👤 プロフィール', action: () => alert('プロフィールを表示') },
|
|
127
|
+
{ title: '⚙️ 設定', action: () => alert('設定を開く') },
|
|
128
|
+
{ title: '🚪 ログアウト', action: () => alert('ログアウトしました') },
|
|
129
|
+
]
|
|
130
|
+
return { args, customItems }
|
|
131
|
+
},
|
|
132
|
+
template: /* html */ `
|
|
133
|
+
<div class='sb-canvas'>
|
|
134
|
+
<div style='height: 250px; padding: 20px;'>
|
|
135
|
+
<rn-dropdown
|
|
136
|
+
:items="customItems"
|
|
137
|
+
:disabled="args.disabled"
|
|
138
|
+
>
|
|
139
|
+
<template #trigger="{ toggle }">
|
|
140
|
+
<rn-button @click="toggle">ユーザーメニュー</rn-button>
|
|
141
|
+
</template>
|
|
142
|
+
<template #default="{ items, select }">
|
|
143
|
+
<div style="min-width: 200px; background: white; border: 1px solid #ddd; border-radius: 8px; padding: 8px;">
|
|
144
|
+
<div
|
|
145
|
+
v-for="item in items"
|
|
146
|
+
:key="item.title"
|
|
147
|
+
@click="select(item)"
|
|
148
|
+
style="padding: 12px 16px; cursor: pointer; border-radius: 4px; display: flex; align-items: center; gap: 8px;"
|
|
149
|
+
onmouseover="this.style.backgroundColor='#f5f5f5'"
|
|
150
|
+
onmouseout="this.style.backgroundColor='transparent'"
|
|
151
|
+
>
|
|
152
|
+
{{ item.title }}
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
</template>
|
|
156
|
+
</rn-dropdown>
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
`,
|
|
160
|
+
}),
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export const 無効化: OverridesStory = {
|
|
164
|
+
args: {
|
|
165
|
+
disabled: true,
|
|
166
|
+
},
|
|
167
|
+
argTypes: {},
|
|
168
|
+
parameters: {
|
|
169
|
+
docs: {
|
|
170
|
+
description: {
|
|
171
|
+
story: '無効化されたドロップダウン',
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
render: (args) => ({
|
|
176
|
+
components: { 'rn-dropdown': DropDown, 'rn-button': Button },
|
|
177
|
+
setup() {
|
|
178
|
+
return { args }
|
|
179
|
+
},
|
|
180
|
+
template: /* html */ `
|
|
181
|
+
<div class='sb-canvas'>
|
|
182
|
+
<div style='height: 200px; padding: 20px;'>
|
|
183
|
+
<rn-dropdown
|
|
184
|
+
:items="args.items"
|
|
185
|
+
:disabled="args.disabled"
|
|
186
|
+
>
|
|
187
|
+
<template #trigger="{ toggle }">
|
|
188
|
+
<rn-button @click="toggle" :disabled="args.disabled">無効化されたメニュー</rn-button>
|
|
189
|
+
</template>
|
|
190
|
+
</rn-dropdown>
|
|
191
|
+
</div>
|
|
192
|
+
</div>
|
|
193
|
+
`,
|
|
194
|
+
}),
|
|
195
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import FloatingBanner, {
|
|
3
|
+
type FloatingBannerProps,
|
|
4
|
+
} from '@/components/features/FloatingBanner.vue'
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof FloatingBanner> = {
|
|
7
|
+
title: 'Features/FloatingBanner',
|
|
8
|
+
component: FloatingBanner,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
parameters: {
|
|
11
|
+
docs: {
|
|
12
|
+
description: {
|
|
13
|
+
component: 'フローティングバナー用コンポーネント',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
argTypes: {
|
|
18
|
+
imageUrl: {
|
|
19
|
+
control: 'text',
|
|
20
|
+
},
|
|
21
|
+
persistentHiddenKey: {
|
|
22
|
+
control: 'text',
|
|
23
|
+
},
|
|
24
|
+
url: {
|
|
25
|
+
control: 'text',
|
|
26
|
+
},
|
|
27
|
+
offset: {
|
|
28
|
+
control: 'number',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
args: {
|
|
32
|
+
imageUrl:
|
|
33
|
+
'https://reni-ec-pro.s3-ap-northeast-1.amazonaws.com/banner/63/d1270251298665d51cf9f298a3343257dd4559e4_sp.jpg',
|
|
34
|
+
persistentHiddenKey: '',
|
|
35
|
+
url: '',
|
|
36
|
+
offset: 10,
|
|
37
|
+
},
|
|
38
|
+
render: (args) => ({
|
|
39
|
+
components: { 'rn-floating-banner': FloatingBanner },
|
|
40
|
+
setup() {
|
|
41
|
+
return { args }
|
|
42
|
+
},
|
|
43
|
+
template: /* html */ `
|
|
44
|
+
<div class='sb-canvas'>
|
|
45
|
+
<div style="height: 300px;">
|
|
46
|
+
<rn-floating-banner
|
|
47
|
+
:imageUrl=args.imageUrl
|
|
48
|
+
:persistentHiddenKey=args.persistentHiddenKey
|
|
49
|
+
:url=args.url
|
|
50
|
+
:offset=args.offset
|
|
51
|
+
/>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
`,
|
|
55
|
+
}),
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export default meta
|
|
59
|
+
type StoryArgs = FloatingBannerProps
|
|
60
|
+
type Story = StoryObj<StoryArgs>
|
|
61
|
+
type OverridesStory = Omit<Story, 'argTypes'> & {
|
|
62
|
+
argTypes?: Record<string, any>
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export const 基本: OverridesStory = {
|
|
66
|
+
args: {},
|
|
67
|
+
argTypes: {
|
|
68
|
+
default: { table: { disable: true } },
|
|
69
|
+
},
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export const 応用1: OverridesStory = {
|
|
73
|
+
args: {
|
|
74
|
+
persistentHiddenKey: '1',
|
|
75
|
+
},
|
|
76
|
+
argTypes: {
|
|
77
|
+
default: { table: { disable: true } },
|
|
78
|
+
},
|
|
79
|
+
}
|