srcdev-nuxt-components 9.6.8 → 9.6.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/.claude/skills/component-compliance-checklist.md +28 -1
- package/.claude/skills/component-inline-action-button.md +1 -1
- package/.claude/skills/component-local-style-override.md +1 -1
- package/.claude/skills/component-naming.md +17 -12
- package/.claude/skills/components/container-glow.md +2 -2
- package/.claude/skills/components/form-field.md +2 -2
- package/.claude/skills/components/form-wrapper.md +1 -1
- package/.claude/skills/components/glowing-border.md +1 -1
- package/.claude/skills/components/input-description.md +7 -7
- package/.claude/skills/components/input-error.md +3 -3
- package/.claude/skills/components/input-label.md +7 -8
- package/.claude/skills/components/input-number.md +17 -17
- package/.claude/skills/components/input-select.md +153 -0
- package/.claude/skills/components/input-text.md +220 -0
- package/.claude/skills/components/input-textarea.md +147 -0
- package/.claude/skills/components/select-menu.md +4 -4
- package/.claude/skills/components/toggle-switch.md +143 -0
- package/.claude/skills/composable-zod-validation.md +1 -1
- package/.claude/skills/css-nesting-conventions.md +22 -1
- package/.claude/skills/icon-sets.md +1 -1
- package/.claude/skills/icon-sizing.md +1 -1
- package/.claude/skills/index.md +5 -5
- package/.claude/skills/storybook-add-story.md +1 -1
- package/.claude/skills/theming-component-token-pattern.md +8 -8
- package/.claude/skills/theming-form-geometry-tokens.md +1 -1
- package/.vscode/srcdev-component-input-select.code-snippets +20 -14
- package/.vscode/srcdev-component-input-text.code-snippets +46 -40
- package/.vscode/srcdev-component-input-textarea.code-snippets +19 -14
- package/.vscode/srcdev-component-toggle-switch.code-snippets +19 -29
- package/app/assets/styles/setup/04.elements/forms/00.element-defaults.css +2 -2
- package/app/assets/styles/setup/04.elements/forms/06.button-geometry.css +1 -1
- package/app/components/01.atoms/animations/glowing-border/CONSUMER-STYLING.md +2 -2
- package/app/components/01.atoms/animations/glowing-border/stories/GlowingBorder.stories.ts +4 -4
- package/app/components/02.molecules/progress-tracker/stories/ProgressTracker.stories.ts +4 -4
- package/app/components/05.forms/form-errors/CONSUMER-STYLING.md +1 -1
- package/app/components/05.forms/form-field/CONSUMER-STYLING.md +2 -2
- package/app/components/05.forms/input-button/stories/InputButton.stories.ts +3 -3
- package/app/components/05.forms/input-description/CONSUMER-STYLING.md +6 -6
- package/app/components/05.forms/input-label/CONSUMER-STYLING.md +7 -7
- package/app/components/05.forms/input-number/CONSUMER-STYLING.md +9 -5
- package/app/components/05.forms/input-number/InputNumber.vue +2 -2
- package/app/components/05.forms/input-select/CONSUMER-STYLING.md +80 -10
- package/app/components/05.forms/input-select/InputSelect.vue +198 -0
- package/app/components/05.forms/input-select/InputSelectField.vue +130 -0
- package/app/components/05.forms/input-select/stories/InputSelect.stories.ts +184 -0
- package/app/components/05.forms/input-select/stories/InputSelectField.stories.ts +187 -0
- package/app/components/05.forms/input-select/tests/{InputSelectCore.spec.ts → InputSelect.spec.ts} +75 -12
- package/app/components/05.forms/input-select/tests/InputSelectField.spec.ts +121 -0
- package/app/components/05.forms/input-text/CONSUMER-STYLING.md +85 -15
- package/app/components/05.forms/input-text/{InputPasswordWithLabel.vue → InputPasswordField.vue} +16 -19
- package/app/components/05.forms/input-text/{InputTextCore.vue → InputText.vue} +42 -78
- package/app/components/05.forms/input-text/{InputTextAsNumberWithLabel.vue → InputTextAsNumberField.vue} +66 -62
- package/app/components/05.forms/input-text/InputTextField.vue +168 -0
- package/app/components/05.forms/input-text/stories/InputPasswordField.stories.ts +163 -0
- package/app/components/05.forms/input-text/stories/InputText.stories.ts +194 -0
- package/app/components/05.forms/input-text/stories/InputTextAsNumberField.stories.ts +182 -0
- package/app/components/05.forms/input-text/stories/InputTextField.stories.ts +206 -0
- package/app/components/05.forms/input-text/tests/{InputPasswordWithLabel.spec.ts → InputPasswordField.spec.ts} +42 -3
- package/app/components/05.forms/input-text/tests/InputText.spec.ts +166 -0
- package/app/components/05.forms/input-text/tests/InputTextAsNumberField.spec.ts +135 -0
- package/app/components/05.forms/input-text/tests/InputTextField.spec.ts +130 -0
- package/app/components/05.forms/input-textarea/CONSUMER-STYLING.md +94 -12
- package/app/components/05.forms/input-textarea/InputTextarea.vue +165 -0
- package/app/components/05.forms/input-textarea/InputTextareaField.vue +159 -0
- package/app/components/05.forms/input-textarea/stories/InputTextarea.stories.ts +198 -0
- package/app/components/05.forms/input-textarea/stories/InputTextareaField.stories.ts +161 -0
- package/app/components/05.forms/input-textarea/tests/InputTextarea.spec.ts +149 -0
- package/app/components/05.forms/input-textarea/tests/InputTextareaField.spec.ts +122 -0
- package/app/components/05.forms/patterns/stories/ContactForm.stories.ts +13 -13
- package/app/components/05.forms/patterns/stories/LoginForm.stories.ts +6 -6
- package/app/components/05.forms/patterns/stories/MigratedFieldsForm.stories.ts +30 -32
- package/app/components/05.forms/toggle-switch/CONSUMER-STYLING.md +71 -50
- package/app/components/05.forms/toggle-switch/{ToggleSwitchCore.vue → ToggleSwitch.vue} +58 -73
- package/app/components/05.forms/toggle-switch/{ToggleSwitchWithLabel.vue → ToggleSwitchField.vue} +65 -19
- package/app/components/05.forms/toggle-switch/stories/ToggleSwitch.stories.ts +148 -0
- package/app/components/05.forms/toggle-switch/stories/ToggleSwitchField.stories.ts +176 -0
- package/app/components/05.forms/toggle-switch/tests/ToggleSwitch.spec.ts +145 -0
- package/app/components/05.forms/toggle-switch/tests/ToggleSwitchField.spec.ts +155 -0
- package/package.json +1 -1
- package/.claude/skills/components/input-select-core.md +0 -151
- package/.claude/skills/components/input-text-core.md +0 -204
- package/.claude/skills/components/input-textarea-core.md +0 -154
- package/.claude/skills/components/toggle-switch-core.md +0 -169
- package/app/components/05.forms/input-select/InputSelectCore.vue +0 -188
- package/app/components/05.forms/input-select/InputSelectWithLabel.vue +0 -118
- package/app/components/05.forms/input-select/stories/InputSelectCore.stories.ts +0 -69
- package/app/components/05.forms/input-select/stories/InputSelectWithLabel.stories.ts +0 -115
- package/app/components/05.forms/input-select/tests/InputSelectWithLabel.spec.ts +0 -87
- package/app/components/05.forms/input-text/InputTextWithLabel.vue +0 -154
- package/app/components/05.forms/input-text/stories/InputPasswordWithLabel.stories.ts +0 -368
- package/app/components/05.forms/input-text/stories/InputTextAsNumberWithLabel.stories.ts +0 -480
- package/app/components/05.forms/input-text/stories/InputTextCore.stories.ts +0 -267
- package/app/components/05.forms/input-text/stories/InputTextWithLabel.stories.ts +0 -319
- package/app/components/05.forms/input-text/tests/InputTextAsNumberWithLabel.spec.ts +0 -75
- package/app/components/05.forms/input-text/tests/InputTextCore.spec.ts +0 -60
- package/app/components/05.forms/input-text/tests/InputTextWithLabel.spec.ts +0 -71
- package/app/components/05.forms/input-textarea/InputTextareaCore.vue +0 -159
- package/app/components/05.forms/input-textarea/InputTextareaWithLabel.vue +0 -136
- package/app/components/05.forms/input-textarea/stories/InputTextareaCore.stories.ts +0 -247
- package/app/components/05.forms/input-textarea/stories/InputTextareaWithLabel.stories.ts +0 -458
- package/app/components/05.forms/input-textarea/tests/InputTextareaCore.spec.ts +0 -119
- package/app/components/05.forms/input-textarea/tests/InputTextareaWithLabel.spec.ts +0 -93
- package/app/components/05.forms/toggle-switch/ToggleSwitchWithLabelInline.vue +0 -81
- package/app/components/05.forms/toggle-switch/stories/ToggleSwitchCore.stories.ts +0 -251
- package/app/components/05.forms/toggle-switch/stories/ToggleSwitchWithLabel.stories.ts +0 -251
- package/app/components/05.forms/toggle-switch/stories/ToggleSwitchWithLabelInline.stories.ts +0 -283
- package/app/components/05.forms/toggle-switch/tests/ToggleSwitchCore.spec.ts +0 -101
- package/app/components/05.forms/toggle-switch/tests/ToggleSwitchWithLabel.spec.ts +0 -133
- package/app/components/05.forms/toggle-switch/tests/ToggleSwitchWithLabelInline.spec.ts +0 -66
|
@@ -1,480 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryFn } from "@nuxtjs/storybook";
|
|
2
|
-
import { computed } from "vue";
|
|
3
|
-
import StorybookComponent from "../InputTextAsNumberWithLabel.vue";
|
|
4
|
-
import type { FormUiTheme, InputUiVariant } from "~/types/forms/types.forms.d";
|
|
5
|
-
|
|
6
|
-
interface InputTextAsNumberWithLabelStoryArgs {
|
|
7
|
-
modelValue: number | undefined;
|
|
8
|
-
maxlength: number;
|
|
9
|
-
name: string;
|
|
10
|
-
placeholder: string;
|
|
11
|
-
label: string;
|
|
12
|
-
errorMessage: string;
|
|
13
|
-
fieldHasError: boolean;
|
|
14
|
-
required: boolean;
|
|
15
|
-
theme: FormUiTheme;
|
|
16
|
-
inputVariant: InputUiVariant;
|
|
17
|
-
min: number;
|
|
18
|
-
max: number;
|
|
19
|
-
step: number;
|
|
20
|
-
styleClassPassthrough: string[];
|
|
21
|
-
useDescriptionSlot: boolean;
|
|
22
|
-
descriptionContent: string;
|
|
23
|
-
useLeftSlot: boolean;
|
|
24
|
-
useRightSlot: boolean;
|
|
25
|
-
leftSlotContent: string;
|
|
26
|
-
rightSlotContent: string;
|
|
27
|
-
stepDownText: string;
|
|
28
|
-
stepUpText: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export default {
|
|
32
|
-
title: "Components/Forms/Input Text/InputTextAsNumberWithLabel",
|
|
33
|
-
component: StorybookComponent,
|
|
34
|
-
argTypes: {
|
|
35
|
-
// Model
|
|
36
|
-
modelValue: {
|
|
37
|
-
control: { type: "number" },
|
|
38
|
-
description: "The numeric value",
|
|
39
|
-
table: {
|
|
40
|
-
category: "Model",
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
// Basic Configuration
|
|
45
|
-
maxlength: {
|
|
46
|
-
control: { type: "number", min: 1, max: 1000 },
|
|
47
|
-
description: "Maximum length of input",
|
|
48
|
-
table: {
|
|
49
|
-
category: "Basic",
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
name: {
|
|
53
|
-
control: "text",
|
|
54
|
-
description: "Input name attribute",
|
|
55
|
-
table: {
|
|
56
|
-
category: "Basic",
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
placeholder: {
|
|
60
|
-
control: "text",
|
|
61
|
-
description: "Placeholder text",
|
|
62
|
-
table: {
|
|
63
|
-
category: "Basic",
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
label: {
|
|
67
|
-
control: "text",
|
|
68
|
-
description: "Input label",
|
|
69
|
-
table: {
|
|
70
|
-
category: "Basic",
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
// Number Configuration
|
|
75
|
-
min: {
|
|
76
|
-
control: { type: "number" },
|
|
77
|
-
description: "Minimum allowed value",
|
|
78
|
-
table: {
|
|
79
|
-
category: "Number",
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
max: {
|
|
83
|
-
control: { type: "number" },
|
|
84
|
-
description: "Maximum allowed value",
|
|
85
|
-
table: {
|
|
86
|
-
category: "Number",
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
step: {
|
|
90
|
-
control: { type: "number", min: 0.1, step: 0.1 },
|
|
91
|
-
description: "Step increment/decrement value",
|
|
92
|
-
table: {
|
|
93
|
-
category: "Number",
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
// Validation
|
|
98
|
-
errorMessage: {
|
|
99
|
-
control: "text",
|
|
100
|
-
description: "Error message to display",
|
|
101
|
-
table: {
|
|
102
|
-
category: "Validation",
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
fieldHasError: {
|
|
106
|
-
control: "boolean",
|
|
107
|
-
description: "Whether field has validation error",
|
|
108
|
-
table: {
|
|
109
|
-
category: "Validation",
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
required: {
|
|
113
|
-
control: "boolean",
|
|
114
|
-
description: "Whether field is required",
|
|
115
|
-
table: {
|
|
116
|
-
category: "Validation",
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
|
|
120
|
-
// Styling
|
|
121
|
-
theme: {
|
|
122
|
-
control: { type: "select" },
|
|
123
|
-
options: ["primary", "secondary", "tertiary", "ghost", "error", "success", "warning"],
|
|
124
|
-
description: "Theme for styling",
|
|
125
|
-
table: {
|
|
126
|
-
category: "Styling",
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
inputVariant: {
|
|
130
|
-
control: { type: "select" },
|
|
131
|
-
options: ["normal", "outlined", "underlined"],
|
|
132
|
-
description: "Input variant style",
|
|
133
|
-
table: {
|
|
134
|
-
category: "Styling",
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
styleClassPassthrough: {
|
|
138
|
-
control: "object",
|
|
139
|
-
description: "Additional CSS classes",
|
|
140
|
-
table: {
|
|
141
|
-
category: "Styling",
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
|
|
145
|
-
// Slots
|
|
146
|
-
useDescriptionSlot: {
|
|
147
|
-
control: "boolean",
|
|
148
|
-
description: "Use description slot",
|
|
149
|
-
table: {
|
|
150
|
-
category: "Slots",
|
|
151
|
-
},
|
|
152
|
-
},
|
|
153
|
-
descriptionContent: {
|
|
154
|
-
control: "text",
|
|
155
|
-
description: "Content for description slot",
|
|
156
|
-
table: {
|
|
157
|
-
category: "Slots",
|
|
158
|
-
},
|
|
159
|
-
},
|
|
160
|
-
useLeftSlot: {
|
|
161
|
-
control: "boolean",
|
|
162
|
-
description: "Use left slot (decrement button)",
|
|
163
|
-
table: {
|
|
164
|
-
category: "Slots",
|
|
165
|
-
},
|
|
166
|
-
},
|
|
167
|
-
useRightSlot: {
|
|
168
|
-
control: "boolean",
|
|
169
|
-
description: "Use right slot (increment button)",
|
|
170
|
-
table: {
|
|
171
|
-
category: "Slots",
|
|
172
|
-
},
|
|
173
|
-
},
|
|
174
|
-
leftSlotContent: {
|
|
175
|
-
control: "text",
|
|
176
|
-
description: "Content for left slot (decrement icon)",
|
|
177
|
-
table: {
|
|
178
|
-
category: "Slots",
|
|
179
|
-
},
|
|
180
|
-
},
|
|
181
|
-
rightSlotContent: {
|
|
182
|
-
control: "text",
|
|
183
|
-
description: "Content for right slot (increment icon)",
|
|
184
|
-
table: {
|
|
185
|
-
category: "Slots",
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
|
|
189
|
-
// Localisation
|
|
190
|
-
stepDownText: {
|
|
191
|
-
control: "text",
|
|
192
|
-
description: "Accessible name for the decrement button",
|
|
193
|
-
table: {
|
|
194
|
-
category: "Localisation",
|
|
195
|
-
},
|
|
196
|
-
},
|
|
197
|
-
stepUpText: {
|
|
198
|
-
control: "text",
|
|
199
|
-
description: "Accessible name for the increment button",
|
|
200
|
-
table: {
|
|
201
|
-
category: "Localisation",
|
|
202
|
-
},
|
|
203
|
-
},
|
|
204
|
-
},
|
|
205
|
-
args: {
|
|
206
|
-
modelValue: undefined,
|
|
207
|
-
maxlength: 255,
|
|
208
|
-
name: "number-input",
|
|
209
|
-
placeholder: "Enter number...",
|
|
210
|
-
label: "Number Input",
|
|
211
|
-
errorMessage: "",
|
|
212
|
-
fieldHasError: false,
|
|
213
|
-
required: false,
|
|
214
|
-
theme: "default",
|
|
215
|
-
inputVariant: "normal",
|
|
216
|
-
min: 0,
|
|
217
|
-
max: 100,
|
|
218
|
-
step: 1,
|
|
219
|
-
styleClassPassthrough: [],
|
|
220
|
-
useDescriptionSlot: false,
|
|
221
|
-
descriptionContent: "Use the buttons to increment or decrement the value",
|
|
222
|
-
useLeftSlot: true,
|
|
223
|
-
useRightSlot: true,
|
|
224
|
-
leftSlotContent: "−",
|
|
225
|
-
rightSlotContent: "+",
|
|
226
|
-
stepDownText: "Step down",
|
|
227
|
-
stepUpText: "Step up",
|
|
228
|
-
},
|
|
229
|
-
} as Meta<typeof StorybookComponent>;
|
|
230
|
-
|
|
231
|
-
// `args` is Storybook's own reactive object — bind to it directly (`args.x`) rather than
|
|
232
|
-
// destructuring it into local variables/refs, which would snapshot the values once at setup()
|
|
233
|
-
// and stop reflecting later Controls-panel changes. `componentArgs` strips the non-prop
|
|
234
|
-
// slot-toggle args so they don't leak onto the component as unknown attributes.
|
|
235
|
-
const Template: StoryFn<InputTextAsNumberWithLabelStoryArgs> = (args) => ({
|
|
236
|
-
components: { StorybookComponent },
|
|
237
|
-
setup() {
|
|
238
|
-
const componentArgs = computed(() => {
|
|
239
|
-
const { useDescriptionSlot, descriptionContent, useLeftSlot, useRightSlot, leftSlotContent, rightSlotContent, ...rest } =
|
|
240
|
-
args;
|
|
241
|
-
return rest;
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
return { args, componentArgs };
|
|
245
|
-
},
|
|
246
|
-
template: `
|
|
247
|
-
<StorybookComponent
|
|
248
|
-
v-model="args.modelValue"
|
|
249
|
-
v-bind="componentArgs"
|
|
250
|
-
>
|
|
251
|
-
<template v-if="args.useDescriptionSlot" #description>{{ args.descriptionContent }}</template>
|
|
252
|
-
<template v-if="args.useLeftSlot" #left>{{ args.leftSlotContent }}</template>
|
|
253
|
-
<template v-if="args.useRightSlot" #right>{{ args.rightSlotContent }}</template>
|
|
254
|
-
</StorybookComponent>
|
|
255
|
-
<div class="mt-4 text-sm text-gray-600">
|
|
256
|
-
Current value: {{ args.modelValue ?? 'undefined' }}
|
|
257
|
-
</div>
|
|
258
|
-
`,
|
|
259
|
-
});
|
|
260
|
-
|
|
261
|
-
export const Default = Template.bind({});
|
|
262
|
-
Default.args = {
|
|
263
|
-
modelValue: 50,
|
|
264
|
-
};
|
|
265
|
-
|
|
266
|
-
export const WithDescription = Template.bind({});
|
|
267
|
-
WithDescription.args = {
|
|
268
|
-
modelValue: 25,
|
|
269
|
-
useDescriptionSlot: true,
|
|
270
|
-
label: "Quantity",
|
|
271
|
-
placeholder: "Select quantity",
|
|
272
|
-
min: 1,
|
|
273
|
-
max: 99,
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
export const Currency = Template.bind({});
|
|
277
|
-
Currency.args = {
|
|
278
|
-
modelValue: 100,
|
|
279
|
-
label: "Price ($)",
|
|
280
|
-
placeholder: "0.00",
|
|
281
|
-
min: 0,
|
|
282
|
-
max: 10000,
|
|
283
|
-
step: 0.01,
|
|
284
|
-
leftSlotContent: "−",
|
|
285
|
-
rightSlotContent: "+",
|
|
286
|
-
};
|
|
287
|
-
|
|
288
|
-
export const Percentage = Template.bind({});
|
|
289
|
-
Percentage.args = {
|
|
290
|
-
modelValue: 50,
|
|
291
|
-
label: "Percentage (%)",
|
|
292
|
-
placeholder: "Enter percentage",
|
|
293
|
-
min: 0,
|
|
294
|
-
max: 100,
|
|
295
|
-
step: 5,
|
|
296
|
-
leftSlotContent: "−",
|
|
297
|
-
rightSlotContent: "+",
|
|
298
|
-
};
|
|
299
|
-
|
|
300
|
-
export const SmallRange = Template.bind({});
|
|
301
|
-
SmallRange.args = {
|
|
302
|
-
modelValue: 3,
|
|
303
|
-
label: "Rating (1-5)",
|
|
304
|
-
placeholder: "Rate from 1 to 5",
|
|
305
|
-
min: 1,
|
|
306
|
-
max: 5,
|
|
307
|
-
step: 1,
|
|
308
|
-
leftSlotContent: "−",
|
|
309
|
-
rightSlotContent: "+",
|
|
310
|
-
};
|
|
311
|
-
|
|
312
|
-
export const LargeNumbers = Template.bind({});
|
|
313
|
-
LargeNumbers.args = {
|
|
314
|
-
modelValue: 5000,
|
|
315
|
-
label: "Budget",
|
|
316
|
-
placeholder: "Enter budget amount",
|
|
317
|
-
min: 1000,
|
|
318
|
-
max: 100000,
|
|
319
|
-
step: 1000,
|
|
320
|
-
leftSlotContent: "−",
|
|
321
|
-
rightSlotContent: "+",
|
|
322
|
-
};
|
|
323
|
-
|
|
324
|
-
export const WithError = Template.bind({});
|
|
325
|
-
WithError.args = {
|
|
326
|
-
modelValue: 150,
|
|
327
|
-
fieldHasError: true,
|
|
328
|
-
errorMessage: "Value must be between 0 and 100",
|
|
329
|
-
theme: "error",
|
|
330
|
-
label: "Invalid Number",
|
|
331
|
-
min: 0,
|
|
332
|
-
max: 100,
|
|
333
|
-
leftSlotContent: "−",
|
|
334
|
-
rightSlotContent: "+",
|
|
335
|
-
};
|
|
336
|
-
|
|
337
|
-
export const Required = Template.bind({});
|
|
338
|
-
Required.args = {
|
|
339
|
-
required: true,
|
|
340
|
-
label: "Required Number",
|
|
341
|
-
placeholder: "This field is required",
|
|
342
|
-
min: 1,
|
|
343
|
-
max: 1000,
|
|
344
|
-
useDescriptionSlot: true,
|
|
345
|
-
descriptionContent: "This field is required",
|
|
346
|
-
leftSlotContent: "−",
|
|
347
|
-
rightSlotContent: "+",
|
|
348
|
-
};
|
|
349
|
-
|
|
350
|
-
export const Outlined = Template.bind({});
|
|
351
|
-
Outlined.args = {
|
|
352
|
-
modelValue: 42,
|
|
353
|
-
inputVariant: "outlined",
|
|
354
|
-
label: "Temperature (°C)",
|
|
355
|
-
placeholder: "Enter temperature",
|
|
356
|
-
min: -50,
|
|
357
|
-
max: 50,
|
|
358
|
-
step: 0.5,
|
|
359
|
-
leftSlotContent: "−",
|
|
360
|
-
rightSlotContent: "+",
|
|
361
|
-
};
|
|
362
|
-
|
|
363
|
-
export const Underlined = Template.bind({});
|
|
364
|
-
Underlined.args = {
|
|
365
|
-
modelValue: 10,
|
|
366
|
-
inputVariant: "underlined",
|
|
367
|
-
label: "Items Count",
|
|
368
|
-
placeholder: "Number of items",
|
|
369
|
-
min: 0,
|
|
370
|
-
max: 999,
|
|
371
|
-
leftSlotContent: "−",
|
|
372
|
-
rightSlotContent: "+",
|
|
373
|
-
};
|
|
374
|
-
|
|
375
|
-
export const WithCustomIcons = Template.bind({});
|
|
376
|
-
WithCustomIcons.args = {
|
|
377
|
-
modelValue: 15,
|
|
378
|
-
label: "Volume Level",
|
|
379
|
-
placeholder: "Set volume",
|
|
380
|
-
min: 0,
|
|
381
|
-
max: 100,
|
|
382
|
-
step: 5,
|
|
383
|
-
leftSlotContent: "🔉",
|
|
384
|
-
rightSlotContent: "🔊",
|
|
385
|
-
};
|
|
386
|
-
|
|
387
|
-
export const InteractiveDemo = Template.bind({});
|
|
388
|
-
InteractiveDemo.storyName = "Interactive Demo";
|
|
389
|
-
InteractiveDemo.render = (args) => ({
|
|
390
|
-
components: { StorybookComponent },
|
|
391
|
-
setup() {
|
|
392
|
-
const demoValues = reactive({
|
|
393
|
-
quantity: 1,
|
|
394
|
-
price: 25.99,
|
|
395
|
-
percentage: 75,
|
|
396
|
-
rating: 4,
|
|
397
|
-
});
|
|
398
|
-
|
|
399
|
-
const total = computed(() => (demoValues.quantity * demoValues.price).toFixed(2));
|
|
400
|
-
|
|
401
|
-
return {
|
|
402
|
-
demoValues,
|
|
403
|
-
total,
|
|
404
|
-
args,
|
|
405
|
-
};
|
|
406
|
-
},
|
|
407
|
-
template:
|
|
408
|
-
`<div class="space-y-6 p-4 border rounded-lg">
|
|
409
|
-
<h2 class="text-xl font-bold">Shopping Cart Demo</h2>
|
|
410
|
-
|
|
411
|
-
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
412
|
-
<StorybookComponent
|
|
413
|
-
v-model="demoValues.quantity"
|
|
414
|
-
:min="1"
|
|
415
|
-
:max="99"
|
|
416
|
-
:step="1"
|
|
417
|
-
label="Quantity"
|
|
418
|
-
name="quantity"
|
|
419
|
-
placeholder="Select quantity"
|
|
420
|
-
>
|
|
421
|
-
<template #left>−</template>
|
|
422
|
-
<template #right>+</template>
|
|
423
|
-
</StorybookComponent>
|
|
424
|
-
|
|
425
|
-
<StorybookComponent
|
|
426
|
-
v-model="demoValues.price"
|
|
427
|
-
:min="0"
|
|
428
|
-
:max="999.99"
|
|
429
|
-
:step="0.01"
|
|
430
|
-
label="Price (` +
|
|
431
|
-
"$" +
|
|
432
|
-
`)"
|
|
433
|
-
name="price"
|
|
434
|
-
placeholder="0.00"
|
|
435
|
-
>
|
|
436
|
-
<template #left>−</template>
|
|
437
|
-
<template #right>+</template>
|
|
438
|
-
</StorybookComponent>
|
|
439
|
-
|
|
440
|
-
<StorybookComponent
|
|
441
|
-
v-model="demoValues.percentage"
|
|
442
|
-
:min="0"
|
|
443
|
-
:max="100"
|
|
444
|
-
:step="5"
|
|
445
|
-
label="Discount (%)"
|
|
446
|
-
name="percentage"
|
|
447
|
-
placeholder="Enter discount"
|
|
448
|
-
>
|
|
449
|
-
<template #left>−</template>
|
|
450
|
-
<template #right>+</template>
|
|
451
|
-
</StorybookComponent>
|
|
452
|
-
|
|
453
|
-
<StorybookComponent
|
|
454
|
-
v-model="demoValues.rating"
|
|
455
|
-
:min="1"
|
|
456
|
-
:max="5"
|
|
457
|
-
:step="1"
|
|
458
|
-
label="Rating (1-5 stars)"
|
|
459
|
-
name="rating"
|
|
460
|
-
placeholder="Rate product"
|
|
461
|
-
>
|
|
462
|
-
<template #left>⭐</template>
|
|
463
|
-
<template #right>⭐</template>
|
|
464
|
-
</StorybookComponent>
|
|
465
|
-
</div>
|
|
466
|
-
|
|
467
|
-
<div class="p-4 bg-gray-100 rounded">
|
|
468
|
-
<h3 class="font-semibold">Order Summary:</h3>
|
|
469
|
-
<p>Quantity: {{ demoValues.quantity }}</p>
|
|
470
|
-
<p>Price: ` +
|
|
471
|
-
"$" +
|
|
472
|
-
`{{ demoValues.price }}</p>
|
|
473
|
-
<p>Discount: {{ demoValues.percentage }}%</p>
|
|
474
|
-
<p>Rating: {{ demoValues.rating }}/5</p>
|
|
475
|
-
<p class="font-bold text-lg">Total: ` +
|
|
476
|
-
"$" +
|
|
477
|
-
`{{ total }}</p>
|
|
478
|
-
</div>
|
|
479
|
-
</div>`,
|
|
480
|
-
});
|