@reni-corp/reni-2c-ui 0.4.8 → 0.4.10
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/dist/components/elements/Button.vue.d.ts.map +1 -1
- package/dist/components/elements/Pagination.vue.d.ts +20 -0
- package/dist/components/elements/Pagination.vue.d.ts.map +1 -0
- package/dist/components/features/VariationSelector.vue.d.ts +38 -0
- package/dist/components/features/VariationSelector.vue.d.ts.map +1 -0
- package/dist/components/interactive/Tabs.vue.d.ts.map +1 -1
- package/dist/components/navigation/Drawer.vue.d.ts +3 -0
- package/dist/components/navigation/Drawer.vue.d.ts.map +1 -1
- package/dist/components/renderless/ItemFilter.vue.d.ts +49 -0
- package/dist/components/renderless/ItemFilter.vue.d.ts.map +1 -0
- package/dist/composable/usePagination.d.ts +31 -0
- package/dist/composable/usePagination.d.ts.map +1 -0
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +4638 -4369
- package/dist/mockServiceWorker.js +349 -0
- package/dist/mocks/handlers/index.d.ts +2 -0
- package/dist/mocks/handlers/index.d.ts.map +1 -0
- package/dist/mocks/handlers/products.d.ts +2 -0
- package/dist/mocks/handlers/products.d.ts.map +1 -0
- package/dist/script.es.js +5904 -5635
- package/dist/script.umd.js +28 -28
- package/dist/style.css +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/package.json +8 -1
- package/src/stories/DataProvider.stories.ts +182 -0
- package/src/stories/ItemFilter.stories.ts +283 -0
- package/src/stories/Pagination.stories.ts +133 -0
- package/src/stories/VariationSelector.stories.ts +241 -0
- package/dist/components/renderless/OptionGroupSwitchController.vue.d.ts +0 -41
- package/dist/components/renderless/OptionGroupSwitchController.vue.d.ts.map +0 -1
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { ref } from 'vue'
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/vue3-vite'
|
|
3
|
+
import VariationSelector, {
|
|
4
|
+
type VariationSelectorProps,
|
|
5
|
+
} from '@/components/features/VariationSelector.vue'
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof VariationSelector> = {
|
|
8
|
+
title: 'Features/VariationSelector',
|
|
9
|
+
component: VariationSelector,
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
parameters: {
|
|
12
|
+
docs: {
|
|
13
|
+
description: {
|
|
14
|
+
component:
|
|
15
|
+
'バリエーション選択用コンポーネント。フラットモード(単純な選択肢)とグループモード(カテゴリ→商品名のようなカスケード選択)に対応。chip(横並びボタン)と list(縦リスト)の2つの表示バリアントをサポート。',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
argTypes: {
|
|
20
|
+
variant: {
|
|
21
|
+
control: 'select',
|
|
22
|
+
options: ['chip', 'list'],
|
|
23
|
+
description: 'アイテムの表示バリアント',
|
|
24
|
+
},
|
|
25
|
+
groupVariant: {
|
|
26
|
+
control: 'select',
|
|
27
|
+
options: ['chip', 'list'],
|
|
28
|
+
description: 'グループの表示バリアント',
|
|
29
|
+
},
|
|
30
|
+
color: {
|
|
31
|
+
control: 'select',
|
|
32
|
+
options: [
|
|
33
|
+
'primary',
|
|
34
|
+
'secondary',
|
|
35
|
+
'warning',
|
|
36
|
+
'danger',
|
|
37
|
+
'success',
|
|
38
|
+
'info',
|
|
39
|
+
'default',
|
|
40
|
+
'subtle',
|
|
41
|
+
'muted',
|
|
42
|
+
'light',
|
|
43
|
+
],
|
|
44
|
+
description: '選択状態のアクセントカラー',
|
|
45
|
+
},
|
|
46
|
+
label: {
|
|
47
|
+
control: 'text',
|
|
48
|
+
description: 'アイテム側のラベル',
|
|
49
|
+
},
|
|
50
|
+
groupLabel: {
|
|
51
|
+
control: 'text',
|
|
52
|
+
description: 'グループ側のラベル',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
args: {
|
|
56
|
+
variant: 'chip',
|
|
57
|
+
color: 'default',
|
|
58
|
+
},
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export default meta
|
|
62
|
+
type Story = StoryObj<VariationSelectorProps>
|
|
63
|
+
|
|
64
|
+
const sizeItems = [
|
|
65
|
+
{ label: 'S', value: 's' },
|
|
66
|
+
{ label: 'M', value: 'm' },
|
|
67
|
+
{ label: 'L', value: 'l' },
|
|
68
|
+
{ label: 'XL', value: 'xl' },
|
|
69
|
+
]
|
|
70
|
+
|
|
71
|
+
export const 基本: Story = {
|
|
72
|
+
args: {
|
|
73
|
+
label: 'サイズ',
|
|
74
|
+
items: sizeItems,
|
|
75
|
+
variant: 'chip',
|
|
76
|
+
},
|
|
77
|
+
render: (args) => ({
|
|
78
|
+
components: { 'rn-variation-selector': VariationSelector },
|
|
79
|
+
setup() {
|
|
80
|
+
const selectedValue = ref('')
|
|
81
|
+
return { args, selectedValue }
|
|
82
|
+
},
|
|
83
|
+
template: /* html */ `
|
|
84
|
+
<div class="sb-canvas" style="max-width: 480px;">
|
|
85
|
+
<rn-variation-selector v-bind="args" v-model="selectedValue" />
|
|
86
|
+
<p style="margin-top: 16px; font-size: 13px; color: #666;">
|
|
87
|
+
選択中: {{ selectedValue || '未選択' }}
|
|
88
|
+
</p>
|
|
89
|
+
</div>
|
|
90
|
+
`,
|
|
91
|
+
}),
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export const リストバリアント: Story = {
|
|
95
|
+
args: {
|
|
96
|
+
label: '商品名',
|
|
97
|
+
items: [
|
|
98
|
+
{ label: '白上フブキ', value: 'fubuki' },
|
|
99
|
+
{ label: '百鬼あやめ', value: 'ayame' },
|
|
100
|
+
{ label: '癒月ちょこ', value: 'choco' },
|
|
101
|
+
{ label: '猫又おかゆ', value: 'okayu' },
|
|
102
|
+
{ label: '兎田ぺこら', value: 'pekora' },
|
|
103
|
+
],
|
|
104
|
+
variant: 'list',
|
|
105
|
+
},
|
|
106
|
+
render: (args) => ({
|
|
107
|
+
components: { 'rn-variation-selector': VariationSelector },
|
|
108
|
+
setup() {
|
|
109
|
+
const selectedValue = ref('')
|
|
110
|
+
return { args, selectedValue }
|
|
111
|
+
},
|
|
112
|
+
template: /* html */ `
|
|
113
|
+
<div class="sb-canvas" style="max-width: 480px;">
|
|
114
|
+
<rn-variation-selector v-bind="args" v-model="selectedValue" />
|
|
115
|
+
<p style="margin-top: 16px; font-size: 13px; color: #666;">
|
|
116
|
+
選択中: {{ selectedValue || '未選択' }}
|
|
117
|
+
</p>
|
|
118
|
+
</div>
|
|
119
|
+
`,
|
|
120
|
+
}),
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export const グループモード: Story = {
|
|
124
|
+
render: () => ({
|
|
125
|
+
components: { 'rn-variation-selector': VariationSelector },
|
|
126
|
+
setup() {
|
|
127
|
+
const categories = [
|
|
128
|
+
{ label: '7th fes. STAGE1', value: 'stage1' },
|
|
129
|
+
{ label: '7th fes. STAGE2', value: 'stage2' },
|
|
130
|
+
{ label: '7th fes. STAGE3', value: 'stage3' },
|
|
131
|
+
{ label: '7th fes. STAGE4', value: 'stage4' },
|
|
132
|
+
]
|
|
133
|
+
const products = [
|
|
134
|
+
{ label: '白上フブキ', value: 'fubuki', stageId: 'stage1' },
|
|
135
|
+
{ label: '百鬼あやめ', value: 'ayame', stageId: 'stage1' },
|
|
136
|
+
{ label: '癒月ちょこ', value: 'choco', stageId: 'stage1' },
|
|
137
|
+
{ label: '猫又おかゆ', value: 'okayu', stageId: 'stage2' },
|
|
138
|
+
{ label: '兎田ぺこら', value: 'pekora', stageId: 'stage2' },
|
|
139
|
+
{ label: '不知火フレア', value: 'flare', stageId: 'stage2' },
|
|
140
|
+
{ label: '角巻わため', value: 'watame', stageId: 'stage3' },
|
|
141
|
+
{ label: '雪花ラミィ', value: 'lamy', stageId: 'stage3' },
|
|
142
|
+
{ label: '尾丸ポルカ', value: 'polka', stageId: 'stage4' },
|
|
143
|
+
{ label: '鷹嶺ルイ', value: 'lui', stageId: 'stage4' },
|
|
144
|
+
]
|
|
145
|
+
|
|
146
|
+
const selectedCategory = ref('stage1')
|
|
147
|
+
const selectedProduct = ref('')
|
|
148
|
+
|
|
149
|
+
return { categories, products, selectedCategory, selectedProduct }
|
|
150
|
+
},
|
|
151
|
+
template: /* html */ `
|
|
152
|
+
<div class="sb-canvas" style="max-width: 480px;">
|
|
153
|
+
<rn-variation-selector
|
|
154
|
+
group-label="商品カテゴリ"
|
|
155
|
+
label="商品名"
|
|
156
|
+
:groups="categories"
|
|
157
|
+
:items="products"
|
|
158
|
+
item-group="stageId"
|
|
159
|
+
group-variant="chip"
|
|
160
|
+
variant="list"
|
|
161
|
+
v-model:group="selectedCategory"
|
|
162
|
+
v-model="selectedProduct"
|
|
163
|
+
/>
|
|
164
|
+
<div style="margin-top: 16px; font-size: 13px; color: #666;">
|
|
165
|
+
<p>カテゴリ: {{ selectedCategory || '未選択' }}</p>
|
|
166
|
+
<p>商品: {{ selectedProduct || '未選択' }}</p>
|
|
167
|
+
</div>
|
|
168
|
+
</div>
|
|
169
|
+
`,
|
|
170
|
+
}),
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export const 無効化オプション: Story = {
|
|
174
|
+
args: {
|
|
175
|
+
label: 'サイズ',
|
|
176
|
+
items: [
|
|
177
|
+
{ label: 'S', value: 's' },
|
|
178
|
+
{ label: 'M', value: 'm' },
|
|
179
|
+
{ label: 'L', value: 'l', disabled: true },
|
|
180
|
+
{ label: 'XL', value: 'xl', disabled: true },
|
|
181
|
+
],
|
|
182
|
+
variant: 'chip',
|
|
183
|
+
},
|
|
184
|
+
render: (args) => ({
|
|
185
|
+
components: { 'rn-variation-selector': VariationSelector },
|
|
186
|
+
setup() {
|
|
187
|
+
const selectedValue = ref('')
|
|
188
|
+
return { args, selectedValue }
|
|
189
|
+
},
|
|
190
|
+
template: /* html */ `
|
|
191
|
+
<div class="sb-canvas" style="max-width: 480px;">
|
|
192
|
+
<rn-variation-selector v-bind="args" v-model="selectedValue" />
|
|
193
|
+
<p style="margin-top: 16px; font-size: 13px; color: #666;">
|
|
194
|
+
選択中: {{ selectedValue || '未選択' }}
|
|
195
|
+
</p>
|
|
196
|
+
</div>
|
|
197
|
+
`,
|
|
198
|
+
}),
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export const Shopify商品バリアント: Story = {
|
|
202
|
+
render: () => ({
|
|
203
|
+
components: { 'rn-variation-selector': VariationSelector },
|
|
204
|
+
setup() {
|
|
205
|
+
const selectedColor = ref('')
|
|
206
|
+
const selectedSize = ref('')
|
|
207
|
+
return { selectedColor, selectedSize }
|
|
208
|
+
},
|
|
209
|
+
template: /* html */ `
|
|
210
|
+
<div class="sb-canvas" style="max-width: 480px; display: flex; flex-direction: column; gap: 24px;">
|
|
211
|
+
<rn-variation-selector
|
|
212
|
+
label="カラー"
|
|
213
|
+
:items="[
|
|
214
|
+
{ label: 'ホワイト', value: 'white' },
|
|
215
|
+
{ label: 'ブラック', value: 'black' },
|
|
216
|
+
{ label: 'ネイビー', value: 'navy' },
|
|
217
|
+
]"
|
|
218
|
+
variant="chip"
|
|
219
|
+
v-model="selectedColor"
|
|
220
|
+
/>
|
|
221
|
+
<rn-variation-selector
|
|
222
|
+
label="サイズ"
|
|
223
|
+
:items="[
|
|
224
|
+
{ label: 'S', value: 's' },
|
|
225
|
+
{ label: 'M', value: 'm' },
|
|
226
|
+
{ label: 'L', value: 'l' },
|
|
227
|
+
{ label: 'XL', value: 'xl', disabled: true },
|
|
228
|
+
]"
|
|
229
|
+
variant="chip"
|
|
230
|
+
v-model="selectedSize"
|
|
231
|
+
/>
|
|
232
|
+
<div style="padding: 16px; background: var(--rn-bg-muted); border-radius: 8px;">
|
|
233
|
+
<p style="margin: 0; font-size: 14px; font-weight: 600;">選択中のバリアント</p>
|
|
234
|
+
<p style="margin: 8px 0 0; font-size: 13px; color: #666;">
|
|
235
|
+
カラー: {{ selectedColor || '未選択' }} / サイズ: {{ selectedSize || '未選択' }}
|
|
236
|
+
</p>
|
|
237
|
+
</div>
|
|
238
|
+
</div>
|
|
239
|
+
`,
|
|
240
|
+
}),
|
|
241
|
+
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
export type OptionGroupSwitchControllerProps = {
|
|
2
|
-
itemMapKey: string;
|
|
3
|
-
groupMapKey: string;
|
|
4
|
-
groups: any[];
|
|
5
|
-
items: any[];
|
|
6
|
-
defaultActiveValue: string;
|
|
7
|
-
};
|
|
8
|
-
declare function __VLS_template(): {
|
|
9
|
-
attrs: Partial<{}>;
|
|
10
|
-
slots: {
|
|
11
|
-
default?(_: {
|
|
12
|
-
optionGroups: any[];
|
|
13
|
-
optionGroupByContents: {
|
|
14
|
-
isActive: boolean;
|
|
15
|
-
mapKey: any;
|
|
16
|
-
group: any;
|
|
17
|
-
items: any[];
|
|
18
|
-
}[];
|
|
19
|
-
activeValue: string;
|
|
20
|
-
updateActiveValue: (value: string) => void;
|
|
21
|
-
}): any;
|
|
22
|
-
};
|
|
23
|
-
refs: {};
|
|
24
|
-
rootEl: any;
|
|
25
|
-
};
|
|
26
|
-
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
27
|
-
declare const __VLS_component: import('vue').DefineComponent<OptionGroupSwitchControllerProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<OptionGroupSwitchControllerProps> & Readonly<{}>, {
|
|
28
|
-
items: any[];
|
|
29
|
-
itemMapKey: string;
|
|
30
|
-
groupMapKey: string;
|
|
31
|
-
groups: any[];
|
|
32
|
-
defaultActiveValue: string;
|
|
33
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
34
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
35
|
-
export default _default;
|
|
36
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
37
|
-
new (): {
|
|
38
|
-
$slots: S;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
//# sourceMappingURL=OptionGroupSwitchController.vue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OptionGroupSwitchController.vue.d.ts","sourceRoot":"","sources":["../../../src/components/renderless/OptionGroupSwitchController.vue"],"names":[],"mappings":"AAQA;AAkEA,MAAM,MAAM,gCAAgC,GAAG;IAC7C,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,GAAG,EAAE,CAAA;IACb,KAAK,EAAE,GAAG,EAAE,CAAA;IACZ,kBAAkB,EAAE,MAAM,CAAA;CAC3B,CAAA;AAwDD,iBAAS,cAAc;WAwBT,OAAO,IAA6B;;;;;;;;;;;uCA/ChB,MAAM;YAqCX,GAAG;;;;EAe/B;AAaD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;WArGZ,GAAG,EAAE;gBAHA,MAAM;iBACL,MAAM;YACX,GAAG,EAAE;wBAEO,MAAM;6EA2G1B,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|