@foundrykit/primitives 0.1.0

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 (134) hide show
  1. package/components.json +20 -0
  2. package/dist/chunk-A3U73FA7.js +33 -0
  3. package/dist/chunk-AADRFFPH.js +171 -0
  4. package/dist/chunk-FUWID6MC.js +42 -0
  5. package/dist/chunk-FYCANIVJ.js +69 -0
  6. package/dist/chunk-I44GXEPN.js +20 -0
  7. package/dist/chunk-J4CRGO2P.js +46 -0
  8. package/dist/chunk-J57CV3VT.js +28 -0
  9. package/dist/chunk-KZMSLRLW.js +25 -0
  10. package/dist/chunk-PHMEWMFS.js +233 -0
  11. package/dist/chunk-QL4XJD7Y.js +24 -0
  12. package/dist/chunk-SKR3J46C.js +17 -0
  13. package/dist/chunk-U2EIVYWP.js +33 -0
  14. package/dist/chunk-UZIMC7AQ.js +63 -0
  15. package/dist/chunk-VSXKLSEP.js +105 -0
  16. package/dist/chunk-VVNIYCKH.js +55 -0
  17. package/dist/chunk-XQAJQKO7.js +47 -0
  18. package/dist/chunk-YTUI6MCB.js +52 -0
  19. package/dist/components/avatar/index.cjs +92 -0
  20. package/dist/components/avatar/index.d.cts +9 -0
  21. package/dist/components/avatar/index.d.ts +9 -0
  22. package/dist/components/avatar/index.js +11 -0
  23. package/dist/components/badge/index.cjs +67 -0
  24. package/dist/components/badge/index.d.cts +13 -0
  25. package/dist/components/badge/index.d.ts +13 -0
  26. package/dist/components/badge/index.js +8 -0
  27. package/dist/components/breadcrumb/index.cjs +135 -0
  28. package/dist/components/breadcrumb/index.d.cts +14 -0
  29. package/dist/components/breadcrumb/index.d.ts +14 -0
  30. package/dist/components/breadcrumb/index.js +18 -0
  31. package/dist/components/button/index.cjs +77 -0
  32. package/dist/components/button/index.d.cts +15 -0
  33. package/dist/components/button/index.d.ts +15 -0
  34. package/dist/components/button/index.js +8 -0
  35. package/dist/components/card/index.cjs +102 -0
  36. package/dist/components/card/index.d.cts +10 -0
  37. package/dist/components/card/index.d.ts +10 -0
  38. package/dist/components/card/index.js +16 -0
  39. package/dist/components/checkbox/index.cjs +68 -0
  40. package/dist/components/checkbox/index.d.cts +7 -0
  41. package/dist/components/checkbox/index.d.ts +7 -0
  42. package/dist/components/checkbox/index.js +7 -0
  43. package/dist/components/dropdown/index.cjs +282 -0
  44. package/dist/components/dropdown/index.d.cts +28 -0
  45. package/dist/components/dropdown/index.d.ts +28 -0
  46. package/dist/components/dropdown/index.js +35 -0
  47. package/dist/components/input/index.cjs +59 -0
  48. package/dist/components/input/index.d.cts +7 -0
  49. package/dist/components/input/index.d.ts +7 -0
  50. package/dist/components/input/index.js +6 -0
  51. package/dist/components/label/index.cjs +59 -0
  52. package/dist/components/label/index.d.cts +7 -0
  53. package/dist/components/label/index.d.ts +7 -0
  54. package/dist/components/label/index.js +7 -0
  55. package/dist/components/popover/index.cjs +84 -0
  56. package/dist/components/popover/index.d.cts +10 -0
  57. package/dist/components/popover/index.d.ts +10 -0
  58. package/dist/components/popover/index.js +13 -0
  59. package/dist/components/radio-group/index.cjs +83 -0
  60. package/dist/components/radio-group/index.d.cts +8 -0
  61. package/dist/components/radio-group/index.d.ts +8 -0
  62. package/dist/components/radio-group/index.js +9 -0
  63. package/dist/components/select/index.cjs +215 -0
  64. package/dist/components/select/index.d.cts +18 -0
  65. package/dist/components/select/index.d.ts +18 -0
  66. package/dist/components/select/index.js +25 -0
  67. package/dist/components/separator/index.cjs +63 -0
  68. package/dist/components/separator/index.d.cts +7 -0
  69. package/dist/components/separator/index.d.ts +7 -0
  70. package/dist/components/separator/index.js +7 -0
  71. package/dist/components/skeleton/index.cjs +41 -0
  72. package/dist/components/skeleton/index.d.cts +5 -0
  73. package/dist/components/skeleton/index.d.ts +5 -0
  74. package/dist/components/skeleton/index.js +6 -0
  75. package/dist/components/switch/index.cjs +68 -0
  76. package/dist/components/switch/index.d.cts +7 -0
  77. package/dist/components/switch/index.d.ts +7 -0
  78. package/dist/components/switch/index.js +7 -0
  79. package/dist/components/tabs/index.cjs +107 -0
  80. package/dist/components/tabs/index.d.cts +10 -0
  81. package/dist/components/tabs/index.d.ts +10 -0
  82. package/dist/components/tabs/index.js +13 -0
  83. package/dist/components/textarea/index.cjs +44 -0
  84. package/dist/components/textarea/index.d.cts +6 -0
  85. package/dist/components/textarea/index.d.ts +6 -0
  86. package/dist/components/textarea/index.js +6 -0
  87. package/dist/index.cjs +1275 -0
  88. package/dist/index.d.cts +46 -0
  89. package/dist/index.d.ts +46 -0
  90. package/dist/index.js +298 -0
  91. package/eslint.config.js +4 -0
  92. package/package.json +67 -0
  93. package/postcss.config.mjs +6 -0
  94. package/registry.json +51 -0
  95. package/src/components/avatar/config.ts +46 -0
  96. package/src/components/avatar/index.tsx +53 -0
  97. package/src/components/badge/config.ts +56 -0
  98. package/src/components/badge/index.tsx +46 -0
  99. package/src/components/breadcrumb/config.ts +121 -0
  100. package/src/components/breadcrumb/index.tsx +109 -0
  101. package/src/components/button/config.ts +76 -0
  102. package/src/components/button/index.tsx +62 -0
  103. package/src/components/card/config.ts +89 -0
  104. package/src/components/card/index.tsx +83 -0
  105. package/src/components/checkbox/config.ts +46 -0
  106. package/src/components/checkbox/index.tsx +32 -0
  107. package/src/components/dialog/config.ts +582 -0
  108. package/src/components/dialog/index.tsx +143 -0
  109. package/src/components/dropdown/config.ts +262 -0
  110. package/src/components/dropdown/index.tsx +257 -0
  111. package/src/components/input/config.ts +64 -0
  112. package/src/components/input/index.tsx +25 -0
  113. package/src/components/label/config.ts +72 -0
  114. package/src/components/label/index.tsx +24 -0
  115. package/src/components/popover/config.ts +219 -0
  116. package/src/components/popover/index.tsx +48 -0
  117. package/src/components/radio-group/config.ts +303 -0
  118. package/src/components/radio-group/index.tsx +45 -0
  119. package/src/components/select/config.ts +277 -0
  120. package/src/components/select/index.tsx +185 -0
  121. package/src/components/separator/config.ts +63 -0
  122. package/src/components/separator/index.tsx +28 -0
  123. package/src/components/skeleton/config.ts +77 -0
  124. package/src/components/skeleton/index.tsx +13 -0
  125. package/src/components/switch/config.ts +165 -0
  126. package/src/components/switch/index.tsx +31 -0
  127. package/src/components/tabs/config.ts +335 -0
  128. package/src/components/tabs/index.tsx +66 -0
  129. package/src/components/textarea/config.ts +117 -0
  130. package/src/components/textarea/index.tsx +18 -0
  131. package/src/index.ts +87 -0
  132. package/tsconfig.json +9 -0
  133. package/tsconfig.lint.json +8 -0
  134. package/tsup.config.ts +29 -0
@@ -0,0 +1,303 @@
1
+ import { ComponentConfig } from '@foundrykit/types';
2
+
3
+ export const radioGroupConfig: ComponentConfig = {
4
+ name: 'Radio Group',
5
+ description:
6
+ 'Radio group component for single selection from multiple options',
7
+ category: 'primitives',
8
+ tags: ['form', 'input', 'interactive'],
9
+ preview: {
10
+ type: 'static',
11
+ html: '<div class="flex h-12 w-full items-center justify-center rounded-md bg-gray-200"><div class="flex flex-col gap-2"><div class="flex items-center gap-2"><div class="h-4 w-4 rounded-full border border-gray-400 bg-white flex items-center justify-center"><div class="h-2 w-2 rounded-full bg-blue-500"></div></div><span class="text-xs">Option 1</span></div><div class="flex items-center gap-2"><div class="h-4 w-4 rounded-full border border-gray-400 bg-white flex items-center justify-center"></div><span class="text-xs">Option 2</span></div></div></div>',
12
+ },
13
+ variants: [
14
+ {
15
+ name: 'Default',
16
+ description: 'Basic radio group with default styling',
17
+ code: `<RadioGroup defaultValue="option-one">
18
+ <div class="flex items-center space-x-2">
19
+ <RadioGroupItem value="option-one" id="option-one" />
20
+ <Label htmlFor="option-one">Option One</Label>
21
+ </div>
22
+ <div class="flex items-center space-x-2">
23
+ <RadioGroupItem value="option-two" id="option-two" />
24
+ <Label htmlFor="option-two">Option Two</Label>
25
+ </div>
26
+ </RadioGroup>`,
27
+ preview: {
28
+ type: 'component',
29
+ component: 'RadioGroup',
30
+ props: {
31
+ defaultValue: 'option-one',
32
+ children: [
33
+ {
34
+ type: 'div',
35
+ props: {
36
+ className: 'flex items-center space-x-2',
37
+ children: [
38
+ {
39
+ type: 'RadioGroupItem',
40
+ props: { value: 'option-one', id: 'option-one' },
41
+ },
42
+ {
43
+ type: 'Label',
44
+ props: { htmlFor: 'option-one', children: 'Option One' },
45
+ },
46
+ ],
47
+ },
48
+ },
49
+ {
50
+ type: 'div',
51
+ props: {
52
+ className: 'flex items-center space-x-2',
53
+ children: [
54
+ {
55
+ type: 'RadioGroupItem',
56
+ props: { value: 'option-two', id: 'option-two' },
57
+ },
58
+ {
59
+ type: 'Label',
60
+ props: { htmlFor: 'option-two', children: 'Option Two' },
61
+ },
62
+ ],
63
+ },
64
+ },
65
+ ],
66
+ },
67
+ },
68
+ },
69
+ {
70
+ name: 'Horizontal',
71
+ description: 'Radio group with horizontal layout',
72
+ code: `<RadioGroup defaultValue="comfortable" className="flex flex-row space-x-4">
73
+ <div class="flex items-center space-x-2">
74
+ <RadioGroupItem value="default" id="r1" />
75
+ <Label htmlFor="r1">Default</Label>
76
+ </div>
77
+ <div class="flex items-center space-x-2">
78
+ <RadioGroupItem value="comfortable" id="r2" />
79
+ <Label htmlFor="r2">Comfortable</Label>
80
+ </div>
81
+ <div class="flex items-center space-x-2">
82
+ <RadioGroupItem value="compact" id="r3" />
83
+ <Label htmlFor="r3">Compact</Label>
84
+ </div>
85
+ </RadioGroup>`,
86
+ preview: {
87
+ type: 'component',
88
+ component: 'RadioGroup',
89
+ props: {
90
+ defaultValue: 'comfortable',
91
+ className: 'flex flex-row space-x-4',
92
+ children: [
93
+ {
94
+ type: 'div',
95
+ props: {
96
+ className: 'flex items-center space-x-2',
97
+ children: [
98
+ {
99
+ type: 'RadioGroupItem',
100
+ props: { value: 'default', id: 'r1' },
101
+ },
102
+ {
103
+ type: 'Label',
104
+ props: { htmlFor: 'r1', children: 'Default' },
105
+ },
106
+ ],
107
+ },
108
+ },
109
+ {
110
+ type: 'div',
111
+ props: {
112
+ className: 'flex items-center space-x-2',
113
+ children: [
114
+ {
115
+ type: 'RadioGroupItem',
116
+ props: { value: 'comfortable', id: 'r2' },
117
+ },
118
+ {
119
+ type: 'Label',
120
+ props: { htmlFor: 'r2', children: 'Comfortable' },
121
+ },
122
+ ],
123
+ },
124
+ },
125
+ {
126
+ type: 'div',
127
+ props: {
128
+ className: 'flex items-center space-x-2',
129
+ children: [
130
+ {
131
+ type: 'RadioGroupItem',
132
+ props: { value: 'compact', id: 'r3' },
133
+ },
134
+ {
135
+ type: 'Label',
136
+ props: { htmlFor: 'r3', children: 'Compact' },
137
+ },
138
+ ],
139
+ },
140
+ },
141
+ ],
142
+ },
143
+ },
144
+ },
145
+ {
146
+ name: 'Disabled',
147
+ description: 'Radio group with disabled options',
148
+ code: `<RadioGroup defaultValue="option-one">
149
+ <div class="flex items-center space-x-2">
150
+ <RadioGroupItem value="option-one" id="option-one" />
151
+ <Label htmlFor="option-one">Option One</Label>
152
+ </div>
153
+ <div class="flex items-center space-x-2">
154
+ <RadioGroupItem value="option-two" id="option-two" disabled />
155
+ <Label htmlFor="option-two" className="text-muted-foreground">Option Two (Disabled)</Label>
156
+ </div>
157
+ </RadioGroup>`,
158
+ preview: {
159
+ type: 'component',
160
+ component: 'RadioGroup',
161
+ props: {
162
+ defaultValue: 'option-one',
163
+ children: [
164
+ {
165
+ type: 'div',
166
+ props: {
167
+ className: 'flex items-center space-x-2',
168
+ children: [
169
+ {
170
+ type: 'RadioGroupItem',
171
+ props: { value: 'option-one', id: 'option-one' },
172
+ },
173
+ {
174
+ type: 'Label',
175
+ props: { htmlFor: 'option-one', children: 'Option One' },
176
+ },
177
+ ],
178
+ },
179
+ },
180
+ {
181
+ type: 'div',
182
+ props: {
183
+ className: 'flex items-center space-x-2',
184
+ children: [
185
+ {
186
+ type: 'RadioGroupItem',
187
+ props: {
188
+ value: 'option-two',
189
+ id: 'option-two',
190
+ disabled: true,
191
+ },
192
+ },
193
+ {
194
+ type: 'Label',
195
+ props: {
196
+ htmlFor: 'option-two',
197
+ className: 'text-muted-foreground',
198
+ children: 'Option Two (Disabled)',
199
+ },
200
+ },
201
+ ],
202
+ },
203
+ },
204
+ ],
205
+ },
206
+ },
207
+ },
208
+ {
209
+ name: 'With Description',
210
+ description: 'Radio group with descriptive text for each option',
211
+ code: `<RadioGroup defaultValue="card">
212
+ <div class="flex items-center space-x-2">
213
+ <RadioGroupItem value="card" id="card" />
214
+ <div class="grid gap-1.5 leading-none">
215
+ <Label htmlFor="card">Credit Card</Label>
216
+ <p class="text-sm text-muted-foreground">Save your credit card information for faster checkout.</p>
217
+ </div>
218
+ </div>
219
+ <div class="flex items-center space-x-2">
220
+ <RadioGroupItem value="paypal" id="paypal" />
221
+ <div class="grid gap-1.5 leading-none">
222
+ <Label htmlFor="paypal">PayPal</Label>
223
+ <p class="text-sm text-muted-foreground">Pay with your PayPal account.</p>
224
+ </div>
225
+ </div>
226
+ </RadioGroup>`,
227
+ preview: {
228
+ type: 'component',
229
+ component: 'RadioGroup',
230
+ props: {
231
+ defaultValue: 'card',
232
+ children: [
233
+ {
234
+ type: 'div',
235
+ props: {
236
+ className: 'flex items-center space-x-2',
237
+ children: [
238
+ {
239
+ type: 'RadioGroupItem',
240
+ props: { value: 'card', id: 'card' },
241
+ },
242
+ {
243
+ type: 'div',
244
+ props: {
245
+ className: 'grid gap-1.5 leading-none',
246
+ children: [
247
+ {
248
+ type: 'Label',
249
+ props: { htmlFor: 'card', children: 'Credit Card' },
250
+ },
251
+ {
252
+ type: 'p',
253
+ props: {
254
+ className: 'text-sm text-muted-foreground',
255
+ children:
256
+ 'Save your credit card information for faster checkout.',
257
+ },
258
+ },
259
+ ],
260
+ },
261
+ },
262
+ ],
263
+ },
264
+ },
265
+ {
266
+ type: 'div',
267
+ props: {
268
+ className: 'flex items-center space-x-2',
269
+ children: [
270
+ {
271
+ type: 'RadioGroupItem',
272
+ props: { value: 'paypal', id: 'paypal' },
273
+ },
274
+ {
275
+ type: 'div',
276
+ props: {
277
+ className: 'grid gap-1.5 leading-none',
278
+ children: [
279
+ {
280
+ type: 'Label',
281
+ props: { htmlFor: 'paypal', children: 'PayPal' },
282
+ },
283
+ {
284
+ type: 'p',
285
+ props: {
286
+ className: 'text-sm text-muted-foreground',
287
+ children: 'Pay with your PayPal account.',
288
+ },
289
+ },
290
+ ],
291
+ },
292
+ },
293
+ ],
294
+ },
295
+ },
296
+ ],
297
+ },
298
+ },
299
+ },
300
+ ],
301
+ dependencies: ['utils', 'label'],
302
+ files: ['components/primitives/radio-group/index.tsx'],
303
+ };
@@ -0,0 +1,45 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
5
+ import { CircleIcon } from 'lucide-react';
6
+
7
+ import { cn } from '@foundrykit/utils';
8
+
9
+ function RadioGroup({
10
+ className,
11
+ ...props
12
+ }: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {
13
+ return (
14
+ <RadioGroupPrimitive.Root
15
+ data-slot='radio-group'
16
+ className={cn('grid gap-3', className)}
17
+ {...props}
18
+ />
19
+ );
20
+ }
21
+
22
+ function RadioGroupItem({
23
+ className,
24
+ ...props
25
+ }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {
26
+ return (
27
+ <RadioGroupPrimitive.Item
28
+ data-slot='radio-group-item'
29
+ className={cn(
30
+ 'border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 shadow-xs aspect-square size-4 shrink-0 rounded-full border outline-none transition-[color,box-shadow] focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50',
31
+ className
32
+ )}
33
+ {...props}
34
+ >
35
+ <RadioGroupPrimitive.Indicator
36
+ data-slot='radio-group-indicator'
37
+ className='relative flex items-center justify-center'
38
+ >
39
+ <CircleIcon className='fill-primary absolute left-1/2 top-1/2 size-2 -translate-x-1/2 -translate-y-1/2' />
40
+ </RadioGroupPrimitive.Indicator>
41
+ </RadioGroupPrimitive.Item>
42
+ );
43
+ }
44
+
45
+ export { RadioGroup, RadioGroupItem };
@@ -0,0 +1,277 @@
1
+ import { ComponentConfig } from '@foundrykit/types';
2
+
3
+ export const selectConfig: ComponentConfig = {
4
+ name: 'Select',
5
+ description: 'Select component for choosing from a list of options',
6
+ category: 'primitives',
7
+ tags: ['form', 'input', 'interactive'],
8
+ preview: {
9
+ type: 'static',
10
+ html: '<div class="flex h-12 w-full items-center justify-center rounded-md bg-gray-200"><div class="relative w-32"><div class="flex h-9 w-full items-center justify-between rounded-md border border-gray-300 bg-white px-3 py-2 text-sm"><span>Select option</span><div class="h-4 w-4 rotate-90 border border-gray-400"></div></div></div></div>',
11
+ },
12
+ variants: [
13
+ {
14
+ name: 'Default',
15
+ description: 'Basic select with default styling',
16
+ code: `<Select>
17
+ <SelectTrigger className="w-[180px]">
18
+ <SelectValue placeholder="Select a fruit" />
19
+ </SelectTrigger>
20
+ <SelectContent>
21
+ <SelectItem value="apple">Apple</SelectItem>
22
+ <SelectItem value="banana">Banana</SelectItem>
23
+ <SelectItem value="blueberry">Blueberry</SelectItem>
24
+ <SelectItem value="grapes">Grapes</SelectItem>
25
+ <SelectItem value="pineapple">Pineapple</SelectItem>
26
+ </SelectContent>
27
+ </Select>`,
28
+ preview: {
29
+ type: 'component',
30
+ component: 'Select',
31
+ props: {
32
+ children: [
33
+ {
34
+ type: 'SelectTrigger',
35
+ props: {
36
+ className: 'w-[180px]',
37
+ children: {
38
+ type: 'SelectValue',
39
+ props: { placeholder: 'Select a fruit' },
40
+ },
41
+ },
42
+ },
43
+ {
44
+ type: 'SelectContent',
45
+ props: {
46
+ children: [
47
+ {
48
+ type: 'SelectItem',
49
+ props: { value: 'apple', children: 'Apple' },
50
+ },
51
+ {
52
+ type: 'SelectItem',
53
+ props: { value: 'banana', children: 'Banana' },
54
+ },
55
+ {
56
+ type: 'SelectItem',
57
+ props: { value: 'blueberry', children: 'Blueberry' },
58
+ },
59
+ {
60
+ type: 'SelectItem',
61
+ props: { value: 'grapes', children: 'Grapes' },
62
+ },
63
+ {
64
+ type: 'SelectItem',
65
+ props: { value: 'pineapple', children: 'Pineapple' },
66
+ },
67
+ ],
68
+ },
69
+ },
70
+ ],
71
+ },
72
+ },
73
+ },
74
+ {
75
+ name: 'With Groups',
76
+ description: 'Select with grouped options',
77
+ code: `<Select>
78
+ <SelectTrigger className="w-[280px]">
79
+ <SelectValue placeholder="Select a country" />
80
+ </SelectTrigger>
81
+ <SelectContent>
82
+ <SelectGroup>
83
+ <SelectLabel>North America</SelectLabel>
84
+ <SelectItem value="us">United States</SelectItem>
85
+ <SelectItem value="ca">Canada</SelectItem>
86
+ <SelectItem value="mx">Mexico</SelectItem>
87
+ </SelectGroup>
88
+ <SelectSeparator />
89
+ <SelectGroup>
90
+ <SelectLabel>Europe</SelectLabel>
91
+ <SelectItem value="uk">United Kingdom</SelectItem>
92
+ <SelectItem value="fr">France</SelectItem>
93
+ <SelectItem value="de">Germany</SelectItem>
94
+ </SelectGroup>
95
+ </SelectContent>
96
+ </Select>`,
97
+ preview: {
98
+ type: 'component',
99
+ component: 'Select',
100
+ props: {
101
+ children: [
102
+ {
103
+ type: 'SelectTrigger',
104
+ props: {
105
+ className: 'w-[280px]',
106
+ children: {
107
+ type: 'SelectValue',
108
+ props: { placeholder: 'Select a country' },
109
+ },
110
+ },
111
+ },
112
+ {
113
+ type: 'SelectContent',
114
+ props: {
115
+ children: [
116
+ {
117
+ type: 'SelectGroup',
118
+ props: {
119
+ children: [
120
+ {
121
+ type: 'SelectLabel',
122
+ props: { children: 'North America' },
123
+ },
124
+ {
125
+ type: 'SelectItem',
126
+ props: { value: 'us', children: 'United States' },
127
+ },
128
+ {
129
+ type: 'SelectItem',
130
+ props: { value: 'ca', children: 'Canada' },
131
+ },
132
+ {
133
+ type: 'SelectItem',
134
+ props: { value: 'mx', children: 'Mexico' },
135
+ },
136
+ ],
137
+ },
138
+ },
139
+ { type: 'SelectSeparator', props: {} },
140
+ {
141
+ type: 'SelectGroup',
142
+ props: {
143
+ children: [
144
+ { type: 'SelectLabel', props: { children: 'Europe' } },
145
+ {
146
+ type: 'SelectItem',
147
+ props: { value: 'uk', children: 'United Kingdom' },
148
+ },
149
+ {
150
+ type: 'SelectItem',
151
+ props: { value: 'fr', children: 'France' },
152
+ },
153
+ {
154
+ type: 'SelectItem',
155
+ props: { value: 'de', children: 'Germany' },
156
+ },
157
+ ],
158
+ },
159
+ },
160
+ ],
161
+ },
162
+ },
163
+ ],
164
+ },
165
+ },
166
+ },
167
+ {
168
+ name: 'Disabled',
169
+ description: 'Select component in disabled state',
170
+ code: `<Select disabled>
171
+ <SelectTrigger className="w-[180px]">
172
+ <SelectValue placeholder="Disabled select" />
173
+ </SelectTrigger>
174
+ <SelectContent>
175
+ <SelectItem value="option1">Option 1</SelectItem>
176
+ <SelectItem value="option2">Option 2</SelectItem>
177
+ </SelectContent>
178
+ </Select>`,
179
+ preview: {
180
+ type: 'component',
181
+ component: 'Select',
182
+ props: {
183
+ disabled: true,
184
+ children: [
185
+ {
186
+ type: 'SelectTrigger',
187
+ props: {
188
+ className: 'w-[180px]',
189
+ children: {
190
+ type: 'SelectValue',
191
+ props: { placeholder: 'Disabled select' },
192
+ },
193
+ },
194
+ },
195
+ {
196
+ type: 'SelectContent',
197
+ props: {
198
+ children: [
199
+ {
200
+ type: 'SelectItem',
201
+ props: { value: 'option1', children: 'Option 1' },
202
+ },
203
+ {
204
+ type: 'SelectItem',
205
+ props: { value: 'option2', children: 'Option 2' },
206
+ },
207
+ ],
208
+ },
209
+ },
210
+ ],
211
+ },
212
+ },
213
+ },
214
+ {
215
+ name: 'With Icons',
216
+ description: 'Select with icons in trigger and items',
217
+ code: `<Select>
218
+ <SelectTrigger className="w-[180px]">
219
+ <SelectValue placeholder="Select theme" />
220
+ </SelectTrigger>
221
+ <SelectContent>
222
+ <SelectItem value="light">
223
+ <SunIcon className="mr-2 h-4 w-4" />
224
+ Light
225
+ </SelectItem>
226
+ <SelectItem value="dark">
227
+ <MoonIcon className="mr-2 h-4 w-4" />
228
+ Dark
229
+ </SelectItem>
230
+ <SelectItem value="system">
231
+ <MonitorIcon className="mr-2 h-4 w-4" />
232
+ System
233
+ </SelectItem>
234
+ </SelectContent>
235
+ </Select>`,
236
+ preview: {
237
+ type: 'component',
238
+ component: 'Select',
239
+ props: {
240
+ children: [
241
+ {
242
+ type: 'SelectTrigger',
243
+ props: {
244
+ className: 'w-[180px]',
245
+ children: {
246
+ type: 'SelectValue',
247
+ props: { placeholder: 'Select theme' },
248
+ },
249
+ },
250
+ },
251
+ {
252
+ type: 'SelectContent',
253
+ props: {
254
+ children: [
255
+ {
256
+ type: 'SelectItem',
257
+ props: { value: 'light', children: ['Light'] },
258
+ },
259
+ {
260
+ type: 'SelectItem',
261
+ props: { value: 'dark', children: ['Dark'] },
262
+ },
263
+ {
264
+ type: 'SelectItem',
265
+ props: { value: 'system', children: ['System'] },
266
+ },
267
+ ],
268
+ },
269
+ },
270
+ ],
271
+ },
272
+ },
273
+ },
274
+ ],
275
+ dependencies: ['utils'],
276
+ files: ['components/primitives/select/index.tsx'],
277
+ };