srcdev-nuxt-components 9.6.7 → 9.6.9

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.
Files changed (152) hide show
  1. package/.claude/rules/consumer/ids-from-useid.md +14 -0
  2. package/.claude/skills/component-compliance-checklist.md +18 -1
  3. package/.claude/skills/component-inline-action-button.md +1 -1
  4. package/.claude/skills/component-local-style-override.md +1 -1
  5. package/.claude/skills/component-naming.md +13 -13
  6. package/.claude/skills/components/container-glow.md +2 -2
  7. package/.claude/skills/components/form-field.md +2 -2
  8. package/.claude/skills/components/form-wrapper.md +1 -1
  9. package/.claude/skills/components/glowing-border.md +1 -1
  10. package/.claude/skills/components/input-checkbox-radio.md +19 -3
  11. package/.claude/skills/components/input-checkbox.md +14 -3
  12. package/.claude/skills/components/input-description.md +7 -7
  13. package/.claude/skills/components/input-error.md +3 -3
  14. package/.claude/skills/components/input-label.md +7 -8
  15. package/.claude/skills/components/input-number.md +60 -29
  16. package/.claude/skills/components/input-radio.md +15 -1
  17. package/.claude/skills/components/{input-range-core.md → input-range.md} +53 -18
  18. package/.claude/skills/components/input-select.md +153 -0
  19. package/.claude/skills/components/input-text.md +220 -0
  20. package/.claude/skills/components/input-textarea.md +147 -0
  21. package/.claude/skills/components/select-menu.md +4 -4
  22. package/.claude/skills/components/toggle-switch.md +143 -0
  23. package/.claude/skills/composable-zod-validation.md +1 -1
  24. package/.claude/skills/icon-sets.md +1 -1
  25. package/.claude/skills/icon-sizing.md +1 -1
  26. package/.claude/skills/index.md +10 -10
  27. package/.claude/skills/storybook-add-story.md +1 -1
  28. package/.claude/skills/testing-add-unit-test.md +17 -0
  29. package/.claude/skills/theming-component-token-pattern.md +8 -8
  30. package/.claude/skills/theming-form-geometry-tokens.md +1 -1
  31. package/.vscode/srcdev-component-input-checkbox-radio.code-snippets +0 -1
  32. package/.vscode/srcdev-component-input-range.code-snippets +38 -18
  33. package/.vscode/srcdev-component-input-select.code-snippets +20 -14
  34. package/.vscode/srcdev-component-input-text.code-snippets +46 -40
  35. package/.vscode/srcdev-component-input-textarea.code-snippets +19 -14
  36. package/.vscode/srcdev-component-toggle-switch.code-snippets +19 -29
  37. package/app/assets/styles/setup/04.elements/forms/00.element-defaults.css +2 -2
  38. package/app/assets/styles/setup/04.elements/forms/06.button-geometry.css +1 -1
  39. package/app/components/01.atoms/animations/glowing-border/CONSUMER-STYLING.md +2 -2
  40. package/app/components/01.atoms/animations/glowing-border/stories/GlowingBorder.stories.ts +4 -4
  41. package/app/components/02.molecules/progress-tracker/stories/ProgressTracker.stories.ts +4 -4
  42. package/app/components/05.forms/form-errors/CONSUMER-STYLING.md +1 -1
  43. package/app/components/05.forms/form-field/CONSUMER-STYLING.md +2 -2
  44. package/app/components/05.forms/input-button/stories/InputButton.stories.ts +3 -3
  45. package/app/components/05.forms/input-checkbox/CONSUMER-STYLING.md +10 -0
  46. package/app/components/05.forms/input-checkbox/MultipleCheckboxes.vue +18 -4
  47. package/app/components/05.forms/input-checkbox/SingleCheckbox.vue +14 -2
  48. package/app/components/05.forms/input-checkbox/stories/MultipleCheckboxes.stories.ts +146 -37
  49. package/app/components/05.forms/input-checkbox/stories/SingleCheckbox.stories.ts +107 -30
  50. package/app/components/05.forms/input-checkbox/tests/MultipleCheckboxes.spec.ts +38 -4
  51. package/app/components/05.forms/input-checkbox/tests/SingleCheckbox.spec.ts +5 -0
  52. package/app/components/05.forms/input-checkbox-radio/CONSUMER-STYLING.md +10 -3
  53. package/app/components/05.forms/input-checkbox-radio/InputCheckboxRadio.vue +1 -0
  54. package/app/components/05.forms/input-checkbox-radio/InputCheckboxRadioButton.vue +11 -10
  55. package/app/components/05.forms/input-checkbox-radio/InputCheckboxRadioField.vue +3 -0
  56. package/app/components/05.forms/input-checkbox-radio/stories/InputCheckboxRadio.stories.ts +44 -17
  57. package/app/components/05.forms/input-checkbox-radio/stories/InputCheckboxRadioButton.stories.ts +164 -58
  58. package/app/components/05.forms/input-checkbox-radio/stories/InputCheckboxRadioField.stories.ts +94 -21
  59. package/app/components/05.forms/input-checkbox-radio/tests/InputCheckboxRadio.spec.ts +14 -3
  60. package/app/components/05.forms/input-checkbox-radio/tests/InputCheckboxRadioButton.spec.ts +38 -3
  61. package/app/components/05.forms/input-checkbox-radio/tests/InputCheckboxRadioField.spec.ts +14 -3
  62. package/app/components/05.forms/input-description/CONSUMER-STYLING.md +7 -7
  63. package/app/components/05.forms/input-label/CONSUMER-STYLING.md +6 -6
  64. package/app/components/05.forms/input-number/CONSUMER-STYLING.md +50 -6
  65. package/app/components/05.forms/input-number/InputNumber.vue +39 -27
  66. package/app/components/05.forms/input-number/InputNumberField.vue +29 -16
  67. package/app/components/05.forms/input-number/stories/InputNumber.stories.ts +76 -25
  68. package/app/components/05.forms/input-number/stories/InputNumberField.stories.ts +116 -50
  69. package/app/components/05.forms/input-number/tests/InputNumber.spec.ts +49 -13
  70. package/app/components/05.forms/input-number/tests/InputNumberField.spec.ts +59 -5
  71. package/app/components/05.forms/input-radio/CONSUMER-STYLING.md +11 -0
  72. package/app/components/05.forms/input-radio/MultipleRadiobuttons.vue +14 -3
  73. package/app/components/05.forms/input-radio/stories/MultipleRadiobuttons.stories.ts +138 -38
  74. package/app/components/05.forms/input-radio/tests/MultipleRadioButtons.spec.ts +50 -3
  75. package/app/components/05.forms/input-range/CONSUMER-STYLING.md +68 -26
  76. package/app/components/05.forms/input-range/InputRange.vue +247 -0
  77. package/app/components/05.forms/input-range/{InputRangeDefault.vue → InputRangeField.vue} +41 -18
  78. package/app/components/05.forms/input-range/stories/InputRange.stories.ts +187 -0
  79. package/app/components/05.forms/input-range/stories/InputRangeField.stories.ts +196 -0
  80. package/app/components/05.forms/input-range/tests/{InputRangeCore.spec.ts → InputRange.spec.ts} +39 -15
  81. package/app/components/05.forms/input-range/tests/{InputRangeDefault.spec.ts → InputRangeField.spec.ts} +71 -7
  82. package/app/components/05.forms/input-select/CONSUMER-STYLING.md +80 -10
  83. package/app/components/05.forms/input-select/InputSelect.vue +198 -0
  84. package/app/components/05.forms/input-select/InputSelectField.vue +130 -0
  85. package/app/components/05.forms/input-select/stories/InputSelect.stories.ts +184 -0
  86. package/app/components/05.forms/input-select/stories/InputSelectField.stories.ts +187 -0
  87. package/app/components/05.forms/input-select/tests/{InputSelectCore.spec.ts → InputSelect.spec.ts} +75 -12
  88. package/app/components/05.forms/input-select/tests/InputSelectField.spec.ts +121 -0
  89. package/app/components/05.forms/input-text/CONSUMER-STYLING.md +85 -15
  90. package/app/components/05.forms/input-text/{InputPasswordWithLabel.vue → InputPasswordField.vue} +16 -19
  91. package/app/components/05.forms/input-text/{InputTextCore.vue → InputText.vue} +42 -78
  92. package/app/components/05.forms/input-text/{InputTextAsNumberWithLabel.vue → InputTextAsNumberField.vue} +66 -62
  93. package/app/components/05.forms/input-text/InputTextField.vue +168 -0
  94. package/app/components/05.forms/input-text/stories/InputPasswordField.stories.ts +163 -0
  95. package/app/components/05.forms/input-text/stories/InputText.stories.ts +194 -0
  96. package/app/components/05.forms/input-text/stories/InputTextAsNumberField.stories.ts +182 -0
  97. package/app/components/05.forms/input-text/stories/InputTextField.stories.ts +206 -0
  98. package/app/components/05.forms/input-text/tests/{InputPasswordWithLabel.spec.ts → InputPasswordField.spec.ts} +42 -3
  99. package/app/components/05.forms/input-text/tests/InputText.spec.ts +166 -0
  100. package/app/components/05.forms/input-text/tests/InputTextAsNumberField.spec.ts +135 -0
  101. package/app/components/05.forms/input-text/tests/InputTextField.spec.ts +130 -0
  102. package/app/components/05.forms/input-textarea/CONSUMER-STYLING.md +94 -12
  103. package/app/components/05.forms/input-textarea/InputTextarea.vue +165 -0
  104. package/app/components/05.forms/input-textarea/InputTextareaField.vue +159 -0
  105. package/app/components/05.forms/input-textarea/stories/InputTextarea.stories.ts +198 -0
  106. package/app/components/05.forms/input-textarea/stories/InputTextareaField.stories.ts +161 -0
  107. package/app/components/05.forms/input-textarea/tests/InputTextarea.spec.ts +149 -0
  108. package/app/components/05.forms/input-textarea/tests/InputTextareaField.spec.ts +122 -0
  109. package/app/components/05.forms/patterns/stories/ContactForm.stories.ts +13 -13
  110. package/app/components/05.forms/patterns/stories/LoginForm.stories.ts +6 -6
  111. package/app/components/05.forms/patterns/stories/MigratedFieldsForm.stories.ts +34 -36
  112. package/app/components/05.forms/toggle-switch/CONSUMER-STYLING.md +71 -50
  113. package/app/components/05.forms/toggle-switch/{ToggleSwitchCore.vue → ToggleSwitch.vue} +58 -73
  114. package/app/components/05.forms/toggle-switch/{ToggleSwitchWithLabel.vue → ToggleSwitchField.vue} +65 -19
  115. package/app/components/05.forms/toggle-switch/stories/ToggleSwitch.stories.ts +148 -0
  116. package/app/components/05.forms/toggle-switch/stories/ToggleSwitchField.stories.ts +176 -0
  117. package/app/components/05.forms/toggle-switch/tests/ToggleSwitch.spec.ts +145 -0
  118. package/app/components/05.forms/toggle-switch/tests/ToggleSwitchField.spec.ts +155 -0
  119. package/package.json +1 -1
  120. package/.claude/skills/components/input-select-core.md +0 -151
  121. package/.claude/skills/components/input-text-core.md +0 -204
  122. package/.claude/skills/components/input-textarea-core.md +0 -154
  123. package/.claude/skills/components/toggle-switch-core.md +0 -169
  124. package/app/components/05.forms/input-range/InputRangeCore.vue +0 -169
  125. package/app/components/05.forms/input-range/stories/InputRangeCore.stories.ts +0 -126
  126. package/app/components/05.forms/input-range/stories/InputRangeDefault.stories.ts +0 -108
  127. package/app/components/05.forms/input-select/InputSelectCore.vue +0 -188
  128. package/app/components/05.forms/input-select/InputSelectWithLabel.vue +0 -118
  129. package/app/components/05.forms/input-select/stories/InputSelectCore.stories.ts +0 -69
  130. package/app/components/05.forms/input-select/stories/InputSelectWithLabel.stories.ts +0 -115
  131. package/app/components/05.forms/input-select/tests/InputSelectWithLabel.spec.ts +0 -87
  132. package/app/components/05.forms/input-text/InputTextWithLabel.vue +0 -154
  133. package/app/components/05.forms/input-text/stories/InputPasswordWithLabel.stories.ts +0 -368
  134. package/app/components/05.forms/input-text/stories/InputTextAsNumberWithLabel.stories.ts +0 -480
  135. package/app/components/05.forms/input-text/stories/InputTextCore.stories.ts +0 -267
  136. package/app/components/05.forms/input-text/stories/InputTextWithLabel.stories.ts +0 -319
  137. package/app/components/05.forms/input-text/tests/InputTextAsNumberWithLabel.spec.ts +0 -75
  138. package/app/components/05.forms/input-text/tests/InputTextCore.spec.ts +0 -60
  139. package/app/components/05.forms/input-text/tests/InputTextWithLabel.spec.ts +0 -71
  140. package/app/components/05.forms/input-textarea/InputTextareaCore.vue +0 -159
  141. package/app/components/05.forms/input-textarea/InputTextareaWithLabel.vue +0 -136
  142. package/app/components/05.forms/input-textarea/stories/InputTextareaCore.stories.ts +0 -247
  143. package/app/components/05.forms/input-textarea/stories/InputTextareaWithLabel.stories.ts +0 -458
  144. package/app/components/05.forms/input-textarea/tests/InputTextareaCore.spec.ts +0 -119
  145. package/app/components/05.forms/input-textarea/tests/InputTextareaWithLabel.spec.ts +0 -93
  146. package/app/components/05.forms/toggle-switch/ToggleSwitchWithLabelInline.vue +0 -81
  147. package/app/components/05.forms/toggle-switch/stories/ToggleSwitchCore.stories.ts +0 -251
  148. package/app/components/05.forms/toggle-switch/stories/ToggleSwitchWithLabel.stories.ts +0 -251
  149. package/app/components/05.forms/toggle-switch/stories/ToggleSwitchWithLabelInline.stories.ts +0 -283
  150. package/app/components/05.forms/toggle-switch/tests/ToggleSwitchCore.spec.ts +0 -101
  151. package/app/components/05.forms/toggle-switch/tests/ToggleSwitchWithLabel.spec.ts +0 -133
  152. 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
- });