@windstream/react-shared-components 0.0.9 → 0.0.11

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 (103) hide show
  1. package/README.md +623 -623
  2. package/dist/contentful/index.d.ts +10 -6
  3. package/dist/contentful/index.esm.js +1 -1
  4. package/dist/contentful/index.esm.js.map +1 -1
  5. package/dist/contentful/index.js +1 -1
  6. package/dist/contentful/index.js.map +1 -1
  7. package/dist/core.d.ts +3 -3
  8. package/dist/index.d.ts +4 -4
  9. package/dist/index.js.map +1 -1
  10. package/dist/styles.css +1 -1
  11. package/package.json +159 -159
  12. package/src/components/accordion/Accordion.stories.tsx +225 -225
  13. package/src/components/accordion/index.tsx +36 -36
  14. package/src/components/accordion/types.ts +9 -9
  15. package/src/components/alert-card/types.ts +9 -9
  16. package/src/components/brand-button/BrandButton.stories.tsx +221 -221
  17. package/src/components/brand-button/helpers.ts +35 -35
  18. package/src/components/brand-button/index.tsx +90 -90
  19. package/src/components/brand-button/types.ts +26 -26
  20. package/src/components/button/Button.stories.tsx +108 -108
  21. package/src/components/button/index.tsx +23 -23
  22. package/src/components/button/types.ts +14 -14
  23. package/src/components/call-button/CallButton.stories.tsx +324 -324
  24. package/src/components/call-button/index.tsx +80 -80
  25. package/src/components/call-button/types.ts +9 -9
  26. package/src/components/checkbox/Checkbox.stories.tsx +248 -248
  27. package/src/components/checkbox/types.ts +23 -23
  28. package/src/components/checklist/Checklist.stories.tsx +151 -151
  29. package/src/components/checklist/index.tsx +33 -33
  30. package/src/components/checklist/types.ts +5 -5
  31. package/src/components/collapse/Collapse.stories.tsx +256 -256
  32. package/src/components/collapse/index.tsx +44 -44
  33. package/src/components/collapse/types.ts +5 -5
  34. package/src/components/divider/Divider.stories.tsx +206 -206
  35. package/src/components/divider/index.tsx +23 -23
  36. package/src/components/divider/type.ts +2 -2
  37. package/src/components/input/Input.stories.tsx +358 -358
  38. package/src/components/input/index.tsx +174 -174
  39. package/src/components/input/types.ts +36 -36
  40. package/src/components/link/Link.stories.tsx +163 -163
  41. package/src/components/link/index.tsx +96 -96
  42. package/src/components/link/types.ts +25 -25
  43. package/src/components/list/List.stories.tsx +272 -272
  44. package/src/components/list/index.tsx +86 -86
  45. package/src/components/list/list-item/index.tsx +36 -36
  46. package/src/components/list/list-item/types.ts +13 -13
  47. package/src/components/list/types.ts +29 -29
  48. package/src/components/material-icon/MaterialIcon.stories.tsx +330 -330
  49. package/src/components/material-icon/constants.ts +95 -95
  50. package/src/components/material-icon/index.tsx +44 -44
  51. package/src/components/material-icon/types.ts +31 -31
  52. package/src/components/modal/Modal.stories.tsx +171 -171
  53. package/src/components/modal/index.tsx +168 -168
  54. package/src/components/modal/types.ts +23 -23
  55. package/src/components/radio-button/index.tsx +73 -73
  56. package/src/components/radio-button/types.ts +21 -21
  57. package/src/components/see-more/SeeMore.stories.tsx +182 -182
  58. package/src/components/see-more/index.tsx +38 -38
  59. package/src/components/see-more/types.ts +3 -3
  60. package/src/components/select/Select.stories.tsx +410 -410
  61. package/src/components/select/index.tsx +150 -150
  62. package/src/components/select/types.ts +34 -34
  63. package/src/components/select-plan-button/SelectPlanButton.stories.tsx +160 -160
  64. package/src/components/select-plan-button/index.tsx +20 -20
  65. package/src/components/select-plan-button/types.ts +3 -3
  66. package/src/components/skeleton/Skeleton.stories.tsx +180 -180
  67. package/src/components/skeleton/index.tsx +61 -61
  68. package/src/components/skeleton/types.ts +3 -3
  69. package/src/components/spinner/Spinner.stories.tsx +335 -335
  70. package/src/components/spinner/index.tsx +44 -44
  71. package/src/components/spinner/types.ts +4 -4
  72. package/src/components/text/Text.stories.tsx +302 -302
  73. package/src/components/text/index.tsx +26 -26
  74. package/src/components/text/types.ts +45 -45
  75. package/src/components/tooltip/Tooltip.stories.tsx +220 -220
  76. package/src/components/tooltip/index.tsx +78 -78
  77. package/src/components/tooltip/types.ts +6 -6
  78. package/src/components/view-cart-button/ViewCartButton.stories.tsx +241 -241
  79. package/src/components/view-cart-button/index.tsx +38 -38
  80. package/src/components/view-cart-button/types.ts +4 -4
  81. package/src/contentful/blocks/accordion/index.tsx +7 -7
  82. package/src/contentful/blocks/button/index.tsx +5 -5
  83. package/src/contentful/blocks/callout/index.tsx +7 -7
  84. package/src/contentful/blocks/cards/index.tsx +7 -7
  85. package/src/contentful/blocks/carousel/index.tsx +7 -7
  86. package/src/contentful/blocks/cta-callout/index.tsx +6 -0
  87. package/src/contentful/blocks/cta-callout/types.ts +1 -0
  88. package/src/contentful/blocks/floating-banner/index.tsx +7 -7
  89. package/src/contentful/blocks/footer/index.tsx +7 -7
  90. package/src/contentful/blocks/image-promo-bar/index.tsx +7 -7
  91. package/src/contentful/blocks/modal/index.tsx +5 -5
  92. package/src/contentful/blocks/navigation/index.tsx +7 -7
  93. package/src/contentful/blocks/primary-hero/index.tsx +7 -7
  94. package/src/contentful/blocks/shape-background-wrapper/index.tsx +123 -101
  95. package/src/contentful/blocks/shape-background-wrapper/types.ts +35 -29
  96. package/src/contentful/blocks/text/index.tsx +6 -6
  97. package/src/contentful/index.ts +4 -1
  98. package/src/hooks/use-body-scroll-lock.ts +31 -31
  99. package/src/index.ts +81 -81
  100. package/src/setupTests.ts +46 -46
  101. package/src/styles/globals.css +275 -269
  102. package/src/types/global.d.ts +9 -9
  103. package/src/utils/index.ts +49 -49
@@ -1,410 +1,410 @@
1
- import { Select } from "./index";
2
- import { DocsPage } from "@shared/stories/DocsTemplate";
3
-
4
- import type { Meta, StoryObj } from "@storybook/react";
5
-
6
- const meta: Meta<typeof Select> = {
7
- title: "Components/Select",
8
- component: Select,
9
- tags: ["autodocs"],
10
- parameters: {
11
- layout: "centered",
12
- docs: {
13
- page: DocsPage,
14
- description: {
15
- component:
16
- "A powerful select component built with react-select, featuring search/filtering, custom styling, and enhanced UX that matches the consumer app pattern.",
17
- },
18
- },
19
- },
20
- argTypes: {
21
- variant: {
22
- control: { type: "select" },
23
- options: ["default", "unstyled"],
24
- description: "Select styling variant",
25
- },
26
- size: {
27
- control: { type: "select" },
28
- options: ["sm", "md"],
29
- description: "Select size",
30
- },
31
- placeholder: {
32
- control: { type: "text" },
33
- description: "Placeholder text",
34
- },
35
- isDisabled: {
36
- control: { type: "boolean" },
37
- description: "Disable the select",
38
- },
39
- hasError: {
40
- control: { type: "boolean" },
41
- description: "Show error state",
42
- },
43
- error: {
44
- control: { type: "text" },
45
- description: "Error message text",
46
- },
47
- helperText: {
48
- control: { type: "text" },
49
- description: "Helper text",
50
- },
51
- label: {
52
- control: { type: "text" },
53
- description: "Label text",
54
- },
55
- isCustomStyle: {
56
- control: { type: "boolean" },
57
- description: "Use custom styling for dropdown indicator and values",
58
- },
59
- isSearchable: {
60
- control: { type: "boolean" },
61
- description: "Enable search/filtering functionality",
62
- },
63
- isClearable: {
64
- control: { type: "boolean" },
65
- description: "Allow clearing the selected value",
66
- },
67
- },
68
- args: {
69
- placeholder: "Select an option...",
70
- variant: "default",
71
- size: "md",
72
- isDisabled: false,
73
- hasError: false,
74
- isCustomStyle: false,
75
- isSearchable: true,
76
- isClearable: false,
77
- options: [
78
- { label: "Option 1", value: "option1" },
79
- { label: "Option 2", value: "option2" },
80
- { label: "Option 3", value: "option3" },
81
- ],
82
- },
83
- };
84
-
85
- export default meta;
86
- type Story = StoryObj<typeof meta>;
87
-
88
- // Default select
89
- export const Default: Story = {
90
- args: {},
91
- };
92
-
93
- // Select with label
94
- export const WithLabel: Story = {
95
- render: (args: any) => (
96
- <div className="space-y-2">
97
- <Select
98
- {...args}
99
- label="Choose an option"
100
- placeholder="Select an option"
101
- />
102
- </div>
103
- ),
104
- args: {
105
- label: "Choose an option",
106
- placeholder: "Select an option",
107
- },
108
- };
109
-
110
- // Error state
111
- export const Error: Story = {
112
- args: {
113
- hasError: true,
114
- error: "This field is required",
115
- placeholder: "Invalid selection",
116
- },
117
- render: (args: any) => (
118
- <div className="space-y-2">
119
- <Select {...args} />
120
- </div>
121
- ),
122
- };
123
-
124
- // With helper text
125
- export const WithHelperText: Story = {
126
- args: {
127
- helperText: "Please select the most appropriate option",
128
- placeholder: "Select an option",
129
- },
130
- };
131
-
132
- // Small select
133
- export const Small: Story = {
134
- args: {
135
- size: "sm",
136
- placeholder: "Small select",
137
- },
138
- };
139
-
140
- // Medium select
141
- export const Medium: Story = {
142
- args: {
143
- size: "md",
144
- placeholder: "Medium select",
145
- },
146
- };
147
-
148
- // Disabled select
149
- export const Disabled: Story = {
150
- args: {
151
- isDisabled: true,
152
- placeholder: "Disabled select",
153
- },
154
- };
155
-
156
- // Unstyled variant
157
- export const Unstyled: Story = {
158
- args: {
159
- variant: "unstyled",
160
- placeholder: "Unstyled select",
161
- },
162
- };
163
-
164
- // Searchable select
165
- export const Searchable: Story = {
166
- args: {
167
- isSearchable: true,
168
- placeholder: "Type to search...",
169
- options: [
170
- { label: "Apple", value: "apple" },
171
- { label: "Banana", value: "banana" },
172
- { label: "Cherry", value: "cherry" },
173
- { label: "Date", value: "date" },
174
- { label: "Elderberry", value: "elderberry" },
175
- { label: "Fig", value: "fig" },
176
- { label: "Grape", value: "grape" },
177
- ],
178
- },
179
- };
180
-
181
- // Clearable select
182
- export const Clearable: Story = {
183
- args: {
184
- isClearable: true,
185
- placeholder: "Select and clear option",
186
- value: { label: "Option 2", value: "option2" },
187
- },
188
- };
189
-
190
- // Custom style select
191
- export const CustomStyle: Story = {
192
- args: {
193
- isCustomStyle: true,
194
- placeholder: "Custom styled select",
195
- options: [
196
- { label: "Custom Option 1", value: "custom1" },
197
- { label: "Custom Option 2", value: "custom2" },
198
- { label: "Custom Option 3", value: "custom3" },
199
- ],
200
- },
201
- };
202
-
203
- // With filtering options
204
- export const WithFiltering: Story = {
205
- args: {
206
- isSearchable: true,
207
- placeholder: "Search with custom filter...",
208
- filterOptions: {
209
- ignoreCase: true,
210
- ignoreAccents: true,
211
- matchFrom: "any",
212
- },
213
- options: [
214
- { label: "São Paulo", value: "sao-paulo" },
215
- { label: "Café", value: "cafe" },
216
- { label: "Naïve", value: "naive" },
217
- { label: "Café au lait", value: "cafe-au-lait" },
218
- { label: "São José", value: "sao-jose" },
219
- ],
220
- },
221
- parameters: {
222
- docs: {
223
- description: {
224
- story: "Select with custom filtering options that ignore case and accents for better search experience.",
225
- },
226
- },
227
- },
228
- };
229
-
230
- // With many options
231
- export const ManyOptions: Story = {
232
- args: {
233
- placeholder: "Choose a country",
234
- options: [
235
- { label: "United States", value: "us" },
236
- { label: "Canada", value: "ca" },
237
- { label: "United Kingdom", value: "uk" },
238
- { label: "Germany", value: "de" },
239
- { label: "France", value: "fr" },
240
- { label: "Spain", value: "es" },
241
- { label: "Italy", value: "it" },
242
- { label: "Japan", value: "jp" },
243
- { label: "China", value: "cn" },
244
- { label: "Australia", value: "au" },
245
- { label: "Brazil", value: "br" },
246
- { label: "India", value: "in" },
247
- ],
248
- },
249
- };
250
-
251
- // With selected value
252
- export const WithSelectedValue: Story = {
253
- args: {
254
- value: { label: "Option 2", value: "option2" },
255
- placeholder: "Select an option",
256
- },
257
- };
258
-
259
- // All variants showcase
260
- export const AllVariants: Story = {
261
- render: () => (
262
- <div className="space-y-6">
263
- <div className="grid grid-cols-2 gap-4">
264
- <div>
265
- <label className="mb-1 block text-sm font-medium text-gray-700">
266
- Default
267
- </label>
268
- <Select
269
- variant="default"
270
- placeholder="Default select"
271
- options={[
272
- { label: "Option 1", value: "option1" },
273
- { label: "Option 2", value: "option2" },
274
- { label: "Option 3", value: "option3" },
275
- ]}
276
- />
277
- </div>
278
- <div>
279
- <label className="mb-1 block text-sm font-medium text-gray-700">
280
- Error
281
- </label>
282
- <Select
283
- hasError
284
- error="This field is required"
285
- placeholder="Error select"
286
- options={[
287
- { label: "Option 1", value: "option1" },
288
- { label: "Option 2", value: "option2" },
289
- { label: "Option 3", value: "option3" },
290
- ]}
291
- />
292
- </div>
293
- </div>
294
- <div className="grid grid-cols-2 gap-4">
295
- <div>
296
- <label className="mb-1 block text-sm font-medium text-gray-700">
297
- Small
298
- </label>
299
- <Select
300
- size="sm"
301
- placeholder="Small select"
302
- options={[
303
- { label: "Option 1", value: "option1" },
304
- { label: "Option 2", value: "option2" },
305
- { label: "Option 3", value: "option3" },
306
- ]}
307
- />
308
- </div>
309
- <div>
310
- <label className="mb-1 block text-sm font-medium text-gray-700">
311
- Medium
312
- </label>
313
- <Select
314
- size="md"
315
- placeholder="Medium select"
316
- options={[
317
- { label: "Option 1", value: "option1" },
318
- { label: "Option 2", value: "option2" },
319
- { label: "Option 3", value: "option3" },
320
- ]}
321
- />
322
- </div>
323
- </div>
324
- <div className="grid grid-cols-2 gap-4">
325
- <div>
326
- <label className="mb-1 block text-sm font-medium text-gray-700">
327
- Disabled
328
- </label>
329
- <Select
330
- isDisabled
331
- placeholder="Disabled select"
332
- options={[
333
- { label: "Option 1", value: "option1" },
334
- { label: "Option 2", value: "option2" },
335
- { label: "Option 3", value: "option3" },
336
- ]}
337
- />
338
- </div>
339
- <div>
340
- <label className="mb-1 block text-sm font-medium text-gray-700">
341
- With Helper Text
342
- </label>
343
- <Select
344
- helperText="Please select an option"
345
- placeholder="Select with helper"
346
- options={[
347
- { label: "Option 1", value: "option1" },
348
- { label: "Option 2", value: "option2" },
349
- { label: "Option 3", value: "option3" },
350
- ]}
351
- />
352
- </div>
353
- </div>
354
- </div>
355
- ),
356
- parameters: {
357
- docs: {
358
- description: {
359
- story: "Showcase of all select variants, sizes, and states.",
360
- },
361
- },
362
- },
363
- };
364
-
365
- // Form example
366
- export const FormExample: Story = {
367
- render: () => (
368
- <form className="space-y-4">
369
- <div>
370
- <label className="mb-1 block text-sm font-medium text-gray-700">
371
- Country *
372
- </label>
373
- <Select
374
- placeholder="Select your country"
375
- hasError
376
- error="Country is required"
377
- options={[
378
- { label: "United States", value: "us" },
379
- { label: "Canada", value: "ca" },
380
- { label: "United Kingdom", value: "uk" },
381
- { label: "Germany", value: "de" },
382
- { label: "France", value: "fr" },
383
- ]}
384
- />
385
- </div>
386
- <div>
387
- <label className="mb-1 block text-sm font-medium text-gray-700">
388
- State/Province
389
- </label>
390
- <Select
391
- placeholder="Select your state"
392
- helperText="Optional field"
393
- options={[
394
- { label: "California", value: "ca" },
395
- { label: "New York", value: "ny" },
396
- { label: "Texas", value: "tx" },
397
- { label: "Florida", value: "fl" },
398
- ]}
399
- />
400
- </div>
401
- </form>
402
- ),
403
- parameters: {
404
- docs: {
405
- description: {
406
- story: "Example of select components used in a form context.",
407
- },
408
- },
409
- },
410
- };
1
+ import { Select } from "./index";
2
+ import { DocsPage } from "@shared/stories/DocsTemplate";
3
+
4
+ import type { Meta, StoryObj } from "@storybook/react";
5
+
6
+ const meta: Meta<typeof Select> = {
7
+ title: "Components/Select",
8
+ component: Select,
9
+ tags: ["autodocs"],
10
+ parameters: {
11
+ layout: "centered",
12
+ docs: {
13
+ page: DocsPage,
14
+ description: {
15
+ component:
16
+ "A powerful select component built with react-select, featuring search/filtering, custom styling, and enhanced UX that matches the consumer app pattern.",
17
+ },
18
+ },
19
+ },
20
+ argTypes: {
21
+ variant: {
22
+ control: { type: "select" },
23
+ options: ["default", "unstyled"],
24
+ description: "Select styling variant",
25
+ },
26
+ size: {
27
+ control: { type: "select" },
28
+ options: ["sm", "md"],
29
+ description: "Select size",
30
+ },
31
+ placeholder: {
32
+ control: { type: "text" },
33
+ description: "Placeholder text",
34
+ },
35
+ isDisabled: {
36
+ control: { type: "boolean" },
37
+ description: "Disable the select",
38
+ },
39
+ hasError: {
40
+ control: { type: "boolean" },
41
+ description: "Show error state",
42
+ },
43
+ error: {
44
+ control: { type: "text" },
45
+ description: "Error message text",
46
+ },
47
+ helperText: {
48
+ control: { type: "text" },
49
+ description: "Helper text",
50
+ },
51
+ label: {
52
+ control: { type: "text" },
53
+ description: "Label text",
54
+ },
55
+ isCustomStyle: {
56
+ control: { type: "boolean" },
57
+ description: "Use custom styling for dropdown indicator and values",
58
+ },
59
+ isSearchable: {
60
+ control: { type: "boolean" },
61
+ description: "Enable search/filtering functionality",
62
+ },
63
+ isClearable: {
64
+ control: { type: "boolean" },
65
+ description: "Allow clearing the selected value",
66
+ },
67
+ },
68
+ args: {
69
+ placeholder: "Select an option...",
70
+ variant: "default",
71
+ size: "md",
72
+ isDisabled: false,
73
+ hasError: false,
74
+ isCustomStyle: false,
75
+ isSearchable: true,
76
+ isClearable: false,
77
+ options: [
78
+ { label: "Option 1", value: "option1" },
79
+ { label: "Option 2", value: "option2" },
80
+ { label: "Option 3", value: "option3" },
81
+ ],
82
+ },
83
+ };
84
+
85
+ export default meta;
86
+ type Story = StoryObj<typeof meta>;
87
+
88
+ // Default select
89
+ export const Default: Story = {
90
+ args: {},
91
+ };
92
+
93
+ // Select with label
94
+ export const WithLabel: Story = {
95
+ render: (args: any) => (
96
+ <div className="space-y-2">
97
+ <Select
98
+ {...args}
99
+ label="Choose an option"
100
+ placeholder="Select an option"
101
+ />
102
+ </div>
103
+ ),
104
+ args: {
105
+ label: "Choose an option",
106
+ placeholder: "Select an option",
107
+ },
108
+ };
109
+
110
+ // Error state
111
+ export const Error: Story = {
112
+ args: {
113
+ hasError: true,
114
+ error: "This field is required",
115
+ placeholder: "Invalid selection",
116
+ },
117
+ render: (args: any) => (
118
+ <div className="space-y-2">
119
+ <Select {...args} />
120
+ </div>
121
+ ),
122
+ };
123
+
124
+ // With helper text
125
+ export const WithHelperText: Story = {
126
+ args: {
127
+ helperText: "Please select the most appropriate option",
128
+ placeholder: "Select an option",
129
+ },
130
+ };
131
+
132
+ // Small select
133
+ export const Small: Story = {
134
+ args: {
135
+ size: "sm",
136
+ placeholder: "Small select",
137
+ },
138
+ };
139
+
140
+ // Medium select
141
+ export const Medium: Story = {
142
+ args: {
143
+ size: "md",
144
+ placeholder: "Medium select",
145
+ },
146
+ };
147
+
148
+ // Disabled select
149
+ export const Disabled: Story = {
150
+ args: {
151
+ isDisabled: true,
152
+ placeholder: "Disabled select",
153
+ },
154
+ };
155
+
156
+ // Unstyled variant
157
+ export const Unstyled: Story = {
158
+ args: {
159
+ variant: "unstyled",
160
+ placeholder: "Unstyled select",
161
+ },
162
+ };
163
+
164
+ // Searchable select
165
+ export const Searchable: Story = {
166
+ args: {
167
+ isSearchable: true,
168
+ placeholder: "Type to search...",
169
+ options: [
170
+ { label: "Apple", value: "apple" },
171
+ { label: "Banana", value: "banana" },
172
+ { label: "Cherry", value: "cherry" },
173
+ { label: "Date", value: "date" },
174
+ { label: "Elderberry", value: "elderberry" },
175
+ { label: "Fig", value: "fig" },
176
+ { label: "Grape", value: "grape" },
177
+ ],
178
+ },
179
+ };
180
+
181
+ // Clearable select
182
+ export const Clearable: Story = {
183
+ args: {
184
+ isClearable: true,
185
+ placeholder: "Select and clear option",
186
+ value: { label: "Option 2", value: "option2" },
187
+ },
188
+ };
189
+
190
+ // Custom style select
191
+ export const CustomStyle: Story = {
192
+ args: {
193
+ isCustomStyle: true,
194
+ placeholder: "Custom styled select",
195
+ options: [
196
+ { label: "Custom Option 1", value: "custom1" },
197
+ { label: "Custom Option 2", value: "custom2" },
198
+ { label: "Custom Option 3", value: "custom3" },
199
+ ],
200
+ },
201
+ };
202
+
203
+ // With filtering options
204
+ export const WithFiltering: Story = {
205
+ args: {
206
+ isSearchable: true,
207
+ placeholder: "Search with custom filter...",
208
+ filterOptions: {
209
+ ignoreCase: true,
210
+ ignoreAccents: true,
211
+ matchFrom: "any",
212
+ },
213
+ options: [
214
+ { label: "São Paulo", value: "sao-paulo" },
215
+ { label: "Café", value: "cafe" },
216
+ { label: "Naïve", value: "naive" },
217
+ { label: "Café au lait", value: "cafe-au-lait" },
218
+ { label: "São José", value: "sao-jose" },
219
+ ],
220
+ },
221
+ parameters: {
222
+ docs: {
223
+ description: {
224
+ story: "Select with custom filtering options that ignore case and accents for better search experience.",
225
+ },
226
+ },
227
+ },
228
+ };
229
+
230
+ // With many options
231
+ export const ManyOptions: Story = {
232
+ args: {
233
+ placeholder: "Choose a country",
234
+ options: [
235
+ { label: "United States", value: "us" },
236
+ { label: "Canada", value: "ca" },
237
+ { label: "United Kingdom", value: "uk" },
238
+ { label: "Germany", value: "de" },
239
+ { label: "France", value: "fr" },
240
+ { label: "Spain", value: "es" },
241
+ { label: "Italy", value: "it" },
242
+ { label: "Japan", value: "jp" },
243
+ { label: "China", value: "cn" },
244
+ { label: "Australia", value: "au" },
245
+ { label: "Brazil", value: "br" },
246
+ { label: "India", value: "in" },
247
+ ],
248
+ },
249
+ };
250
+
251
+ // With selected value
252
+ export const WithSelectedValue: Story = {
253
+ args: {
254
+ value: { label: "Option 2", value: "option2" },
255
+ placeholder: "Select an option",
256
+ },
257
+ };
258
+
259
+ // All variants showcase
260
+ export const AllVariants: Story = {
261
+ render: () => (
262
+ <div className="space-y-6">
263
+ <div className="grid grid-cols-2 gap-4">
264
+ <div>
265
+ <label className="mb-1 block text-sm font-medium text-gray-700">
266
+ Default
267
+ </label>
268
+ <Select
269
+ variant="default"
270
+ placeholder="Default select"
271
+ options={[
272
+ { label: "Option 1", value: "option1" },
273
+ { label: "Option 2", value: "option2" },
274
+ { label: "Option 3", value: "option3" },
275
+ ]}
276
+ />
277
+ </div>
278
+ <div>
279
+ <label className="mb-1 block text-sm font-medium text-gray-700">
280
+ Error
281
+ </label>
282
+ <Select
283
+ hasError
284
+ error="This field is required"
285
+ placeholder="Error select"
286
+ options={[
287
+ { label: "Option 1", value: "option1" },
288
+ { label: "Option 2", value: "option2" },
289
+ { label: "Option 3", value: "option3" },
290
+ ]}
291
+ />
292
+ </div>
293
+ </div>
294
+ <div className="grid grid-cols-2 gap-4">
295
+ <div>
296
+ <label className="mb-1 block text-sm font-medium text-gray-700">
297
+ Small
298
+ </label>
299
+ <Select
300
+ size="sm"
301
+ placeholder="Small select"
302
+ options={[
303
+ { label: "Option 1", value: "option1" },
304
+ { label: "Option 2", value: "option2" },
305
+ { label: "Option 3", value: "option3" },
306
+ ]}
307
+ />
308
+ </div>
309
+ <div>
310
+ <label className="mb-1 block text-sm font-medium text-gray-700">
311
+ Medium
312
+ </label>
313
+ <Select
314
+ size="md"
315
+ placeholder="Medium select"
316
+ options={[
317
+ { label: "Option 1", value: "option1" },
318
+ { label: "Option 2", value: "option2" },
319
+ { label: "Option 3", value: "option3" },
320
+ ]}
321
+ />
322
+ </div>
323
+ </div>
324
+ <div className="grid grid-cols-2 gap-4">
325
+ <div>
326
+ <label className="mb-1 block text-sm font-medium text-gray-700">
327
+ Disabled
328
+ </label>
329
+ <Select
330
+ isDisabled
331
+ placeholder="Disabled select"
332
+ options={[
333
+ { label: "Option 1", value: "option1" },
334
+ { label: "Option 2", value: "option2" },
335
+ { label: "Option 3", value: "option3" },
336
+ ]}
337
+ />
338
+ </div>
339
+ <div>
340
+ <label className="mb-1 block text-sm font-medium text-gray-700">
341
+ With Helper Text
342
+ </label>
343
+ <Select
344
+ helperText="Please select an option"
345
+ placeholder="Select with helper"
346
+ options={[
347
+ { label: "Option 1", value: "option1" },
348
+ { label: "Option 2", value: "option2" },
349
+ { label: "Option 3", value: "option3" },
350
+ ]}
351
+ />
352
+ </div>
353
+ </div>
354
+ </div>
355
+ ),
356
+ parameters: {
357
+ docs: {
358
+ description: {
359
+ story: "Showcase of all select variants, sizes, and states.",
360
+ },
361
+ },
362
+ },
363
+ };
364
+
365
+ // Form example
366
+ export const FormExample: Story = {
367
+ render: () => (
368
+ <form className="space-y-4">
369
+ <div>
370
+ <label className="mb-1 block text-sm font-medium text-gray-700">
371
+ Country *
372
+ </label>
373
+ <Select
374
+ placeholder="Select your country"
375
+ hasError
376
+ error="Country is required"
377
+ options={[
378
+ { label: "United States", value: "us" },
379
+ { label: "Canada", value: "ca" },
380
+ { label: "United Kingdom", value: "uk" },
381
+ { label: "Germany", value: "de" },
382
+ { label: "France", value: "fr" },
383
+ ]}
384
+ />
385
+ </div>
386
+ <div>
387
+ <label className="mb-1 block text-sm font-medium text-gray-700">
388
+ State/Province
389
+ </label>
390
+ <Select
391
+ placeholder="Select your state"
392
+ helperText="Optional field"
393
+ options={[
394
+ { label: "California", value: "ca" },
395
+ { label: "New York", value: "ny" },
396
+ { label: "Texas", value: "tx" },
397
+ { label: "Florida", value: "fl" },
398
+ ]}
399
+ />
400
+ </div>
401
+ </form>
402
+ ),
403
+ parameters: {
404
+ docs: {
405
+ description: {
406
+ story: "Example of select components used in a form context.",
407
+ },
408
+ },
409
+ },
410
+ };