@foundrykit/primitives 2.0.9 → 2.1.1

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 (146) hide show
  1. package/dist/{chunk-HS46TIMU.js → chunk-2UG6OCGA.js} +1 -1
  2. package/dist/chunk-3NQR7JZR.js +128 -0
  3. package/dist/{chunk-XCPGTXEJ.js → chunk-5RFGKG4K.js} +1 -1
  4. package/dist/chunk-B5YCE3UP.js +57 -0
  5. package/dist/chunk-F2TEA6ER.js +138 -0
  6. package/dist/{chunk-46UI3AUE.js → chunk-SEDTBIZW.js} +3 -3
  7. package/dist/chunk-SIQHWNPH.js +45 -0
  8. package/dist/chunk-STRBREHN.js +17 -0
  9. package/dist/components/button/index.cjs +3 -3
  10. package/dist/components/button/index.js +1 -1
  11. package/dist/components/card/index.cjs +1 -1
  12. package/dist/components/card/index.js +1 -1
  13. package/dist/components/dialog/index.cjs +182 -0
  14. package/dist/components/dialog/index.d.cts +38 -0
  15. package/dist/components/dialog/index.d.ts +38 -0
  16. package/dist/components/dialog/index.js +25 -0
  17. package/dist/components/input/index.cjs +1 -1
  18. package/dist/components/input/index.js +1 -1
  19. package/dist/components/input-group/index.cjs +270 -0
  20. package/dist/components/input-group/index.d.cts +44 -0
  21. package/dist/components/input-group/index.d.ts +44 -0
  22. package/dist/components/input-group/index.js +153 -0
  23. package/dist/components/section/index.cjs +41 -0
  24. package/dist/components/section/index.d.cts +27 -0
  25. package/dist/components/section/index.d.ts +27 -0
  26. package/dist/components/section/index.js +6 -0
  27. package/dist/components/sheet/index.cjs +170 -0
  28. package/dist/components/sheet/index.d.cts +31 -0
  29. package/dist/components/sheet/index.d.ts +31 -0
  30. package/dist/components/sheet/index.js +21 -0
  31. package/dist/components/toggle/index.cjs +81 -0
  32. package/dist/components/toggle/index.d.cts +26 -0
  33. package/dist/components/toggle/index.d.ts +26 -0
  34. package/dist/components/toggle/index.js +9 -0
  35. package/dist/components/tooltip/index.cjs +95 -0
  36. package/dist/components/tooltip/index.d.cts +25 -0
  37. package/dist/components/tooltip/index.d.ts +25 -0
  38. package/dist/components/tooltip/index.js +13 -0
  39. package/dist/index.cjs +112 -96
  40. package/dist/index.d.cts +12 -105
  41. package/dist/index.d.ts +12 -105
  42. package/dist/index.js +104 -406
  43. package/package.json +206 -10
  44. package/CHANGELOG.md +0 -230
  45. package/postcss.config.mjs +0 -6
  46. package/registry.json +0 -64
  47. package/src/components/accordion/config.ts +0 -28
  48. package/src/components/accordion/index.tsx +0 -80
  49. package/src/components/alert/config.ts +0 -40
  50. package/src/components/alert/index.tsx +0 -80
  51. package/src/components/alert-dialog/config.ts +0 -28
  52. package/src/components/alert-dialog/index.tsx +0 -188
  53. package/src/components/aspect-ratio/config.ts +0 -27
  54. package/src/components/aspect-ratio/index.tsx +0 -24
  55. package/src/components/avatar/config.ts +0 -46
  56. package/src/components/avatar/index.tsx +0 -67
  57. package/src/components/badge/config.ts +0 -56
  58. package/src/components/badge/index.tsx +0 -56
  59. package/src/components/breadcrumb/config.ts +0 -121
  60. package/src/components/breadcrumb/index.tsx +0 -127
  61. package/src/components/button/config.ts +0 -97
  62. package/src/components/button/index.tsx +0 -86
  63. package/src/components/button-group/config.ts +0 -39
  64. package/src/components/button-group/index.tsx +0 -99
  65. package/src/components/card/config.ts +0 -89
  66. package/src/components/card/index.tsx +0 -90
  67. package/src/components/checkbox/config.ts +0 -46
  68. package/src/components/checkbox/index.tsx +0 -41
  69. package/src/components/collapsible/config.ts +0 -27
  70. package/src/components/collapsible/index.tsx +0 -47
  71. package/src/components/context-menu/config.ts +0 -28
  72. package/src/components/context-menu/index.tsx +0 -271
  73. package/src/components/dialog/config.ts +0 -582
  74. package/src/components/dialog/index.tsx +0 -162
  75. package/src/components/direction/config.ts +0 -28
  76. package/src/components/direction/index.tsx +0 -27
  77. package/src/components/drawer/config.ts +0 -28
  78. package/src/components/drawer/index.tsx +0 -153
  79. package/src/components/dropdown/config.ts +0 -262
  80. package/src/components/dropdown/index.tsx +0 -280
  81. package/src/components/empty/config.ts +0 -38
  82. package/src/components/empty/index.tsx +0 -127
  83. package/src/components/field/config.ts +0 -40
  84. package/src/components/field/index.tsx +0 -252
  85. package/src/components/hover-card/config.ts +0 -27
  86. package/src/components/hover-card/index.tsx +0 -56
  87. package/src/components/input/config.ts +0 -64
  88. package/src/components/input/index.tsx +0 -32
  89. package/src/components/input-group/config.ts +0 -209
  90. package/src/components/input-group/index.tsx +0 -177
  91. package/src/components/item/config.ts +0 -52
  92. package/src/components/item/index.tsx +0 -215
  93. package/src/components/kbd/config.ts +0 -38
  94. package/src/components/kbd/index.tsx +0 -40
  95. package/src/components/label/config.ts +0 -72
  96. package/src/components/label/index.tsx +0 -32
  97. package/src/components/menubar/config.ts +0 -28
  98. package/src/components/menubar/index.tsx +0 -295
  99. package/src/components/native-select/config.ts +0 -40
  100. package/src/components/native-select/index.tsx +0 -40
  101. package/src/components/navigation-menu/config.ts +0 -32
  102. package/src/components/navigation-menu/index.tsx +0 -188
  103. package/src/components/popover/config.ts +0 -222
  104. package/src/components/popover/index.tsx +0 -60
  105. package/src/components/progress/config.ts +0 -42
  106. package/src/components/progress/index.tsx +0 -39
  107. package/src/components/radio-group/config.ts +0 -303
  108. package/src/components/radio-group/index.tsx +0 -58
  109. package/src/components/resizable/config.ts +0 -28
  110. package/src/components/resizable/index.tsx +0 -67
  111. package/src/components/scroll-area/config.ts +0 -17
  112. package/src/components/scroll-area/index.tsx +0 -70
  113. package/src/components/select/config.ts +0 -277
  114. package/src/components/select/index.tsx +0 -202
  115. package/src/components/separator/config.ts +0 -63
  116. package/src/components/separator/index.tsx +0 -38
  117. package/src/components/sheet/config.ts +0 -16
  118. package/src/components/sheet/index.tsx +0 -153
  119. package/src/components/skeleton/config.ts +0 -77
  120. package/src/components/skeleton/index.tsx +0 -22
  121. package/src/components/slider/config.ts +0 -46
  122. package/src/components/slider/index.tsx +0 -76
  123. package/src/components/sonner/config.ts +0 -27
  124. package/src/components/sonner/index.tsx +0 -37
  125. package/src/components/spinner/config.ts +0 -40
  126. package/src/components/spinner/index.tsx +0 -30
  127. package/src/components/switch/config.ts +0 -171
  128. package/src/components/switch/index.tsx +0 -40
  129. package/src/components/table/config.ts +0 -38
  130. package/src/components/table/index.tsx +0 -135
  131. package/src/components/tabs/config.ts +0 -335
  132. package/src/components/tabs/index.tsx +0 -82
  133. package/src/components/textarea/config.ts +0 -117
  134. package/src/components/textarea/index.tsx +0 -26
  135. package/src/components/toggle/config.ts +0 -67
  136. package/src/components/toggle/index.tsx +0 -59
  137. package/src/components/toggle-group/config.ts +0 -46
  138. package/src/components/toggle-group/index.tsx +0 -106
  139. package/src/components/tooltip/config.ts +0 -16
  140. package/src/components/tooltip/index.tsx +0 -75
  141. package/src/components/typography/config.ts +0 -38
  142. package/src/components/typography/index.tsx +0 -172
  143. package/src/index.ts +0 -291
  144. package/tsconfig.json +0 -9
  145. package/tsconfig.lint.json +0 -8
  146. package/tsup.config.ts +0 -55
@@ -1,58 +0,0 @@
1
- 'use client';
2
-
3
- import { cn } from '@foundrykit/utils';
4
- import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
5
- import { CircleIcon } from 'lucide-react';
6
- import type * as React from 'react';
7
-
8
- /**
9
- * Group of mutually exclusive radio options built on Radix `RadioGroup.Root`,
10
- * laid out as a grid. Compose with {@link RadioGroupItem} for each option and
11
- * manage selection via the underlying Radix `value`/`onValueChange` props.
12
- *
13
- * @example
14
- * ```tsx
15
- * <RadioGroup value={plan} onValueChange={setPlan}>
16
- * <RadioGroupItem value="free" />
17
- * <RadioGroupItem value="pro" />
18
- * </RadioGroup>
19
- * ```
20
- */
21
- function RadioGroup({
22
- className,
23
- ...props
24
- }: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {
25
- return (
26
- <RadioGroupPrimitive.Root
27
- data-slot='radio-group'
28
- className={cn('grid gap-3', className)}
29
- {...props}
30
- />
31
- );
32
- }
33
-
34
- /** Single radio option (Radix `RadioGroup.Item`) showing a filled dot when selected. */
35
- function RadioGroupItem({
36
- className,
37
- ...props
38
- }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {
39
- return (
40
- <RadioGroupPrimitive.Item
41
- data-slot='radio-group-item'
42
- className={cn(
43
- '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 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50',
44
- className
45
- )}
46
- {...props}
47
- >
48
- <RadioGroupPrimitive.Indicator
49
- data-slot='radio-group-indicator'
50
- className='relative flex items-center justify-center'
51
- >
52
- <CircleIcon className='fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2' />
53
- </RadioGroupPrimitive.Indicator>
54
- </RadioGroupPrimitive.Item>
55
- );
56
- }
57
-
58
- export { RadioGroup, RadioGroupItem };
@@ -1,28 +0,0 @@
1
- import type { ComponentConfig } from '@foundrykit/types';
2
-
3
- export const ResizableConfig: ComponentConfig = {
4
- name: 'Resizable',
5
- description:
6
- 'Accessible resizable panel groups and layouts with keyboard support.',
7
- category: 'primitives',
8
- tags: ['resizable', 'panel', 'layout', 'split'],
9
- preview: {
10
- type: 'static',
11
- html: '<div class="flex h-12 w-full items-stretch overflow-hidden rounded-md border border-gray-300 bg-gray-50"><div class="flex-1 bg-white"></div><div class="w-px bg-gray-400"></div><div class="flex-1 bg-white"></div></div>',
12
- },
13
- variants: [
14
- {
15
- name: 'Default',
16
- description: 'Default resizable panel group',
17
- code: '<ResizablePanelGroup orientation="horizontal"><ResizablePanel /><ResizableHandle /><ResizablePanel /></ResizablePanelGroup>',
18
- preview: {
19
- type: 'component',
20
- component: 'ResizablePanelGroup',
21
- props: {},
22
- },
23
- },
24
- ],
25
- dependencies: ['utils'],
26
- packageDependencies: ['react-resizable-panels', 'lucide-react'],
27
- files: ['components/primitives/resizable/index.tsx'],
28
- };
@@ -1,67 +0,0 @@
1
- 'use client';
2
-
3
- import { cn } from '@foundrykit/utils';
4
- import { GripVerticalIcon } from 'lucide-react';
5
- import type * as React from 'react';
6
- import { Group, Panel, Separator } from 'react-resizable-panels';
7
-
8
- /**
9
- * Resizable split-pane layout built on `react-resizable-panels`. Wrap
10
- * {@link ResizablePanel} children in a {@link ResizablePanelGroup} and place a
11
- * {@link ResizableHandle} between them to let users drag the divider.
12
- *
13
- * @example
14
- * ```tsx
15
- * <ResizablePanelGroup orientation="horizontal">
16
- * <ResizablePanel defaultSize={50}>One</ResizablePanel>
17
- * <ResizableHandle withHandle />
18
- * <ResizablePanel defaultSize={50}>Two</ResizablePanel>
19
- * </ResizablePanelGroup>
20
- * ```
21
- */
22
- function ResizablePanelGroup({
23
- className,
24
- ...props
25
- }: React.ComponentProps<typeof Group>) {
26
- return (
27
- <Group
28
- data-slot='resizable-panel-group'
29
- className={cn(
30
- 'flex h-full w-full aria-[orientation=vertical]:flex-col',
31
- className
32
- )}
33
- {...props}
34
- />
35
- );
36
- }
37
-
38
- function ResizablePanel({ ...props }: React.ComponentProps<typeof Panel>) {
39
- return <Panel data-slot='resizable-panel' {...props} />;
40
- }
41
-
42
- function ResizableHandle({
43
- withHandle,
44
- className,
45
- ...props
46
- }: React.ComponentProps<typeof Separator> & {
47
- withHandle?: boolean;
48
- }) {
49
- return (
50
- <Separator
51
- data-slot='resizable-handle'
52
- className={cn(
53
- 'bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:outline-hidden aria-[orientation=vertical]:h-px aria-[orientation=vertical]:w-full aria-[orientation=vertical]:after:left-0 aria-[orientation=vertical]:after:h-1 aria-[orientation=vertical]:after:w-full aria-[orientation=vertical]:after:translate-x-0 aria-[orientation=vertical]:after:-translate-y-1/2',
54
- className
55
- )}
56
- {...props}
57
- >
58
- {withHandle && (
59
- <div className='bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border'>
60
- <GripVerticalIcon className='size-2.5' />
61
- </div>
62
- )}
63
- </Separator>
64
- );
65
- }
66
-
67
- export { ResizableHandle, ResizablePanel, ResizablePanelGroup };
@@ -1,17 +0,0 @@
1
- import type { ComponentConfig } from '@foundrykit/types';
2
-
3
- export const scrollAreaConfig: ComponentConfig = {
4
- name: 'Scroll Area',
5
- description:
6
- 'ScrollArea component for displaying content in a scrollable area',
7
- category: 'primitives',
8
- tags: ['layout', 'ui'],
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="h-8 w-20 rounded bg-gray-400 flex items-center justify-center text-xs text-white">ScrollArea</div></div>',
12
- },
13
- variants: [],
14
- dependencies: ['utils'],
15
- packageDependencies: ['@radix-ui/react-scroll-area'],
16
- files: ['components/primitives/scroll-area/index.tsx'],
17
- };
@@ -1,70 +0,0 @@
1
- 'use client';
2
-
3
- import { cn } from '@foundrykit/utils';
4
- import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
5
- import type * as React from 'react';
6
-
7
- /**
8
- * Scrollable region with custom cross-browser scrollbars, built on Radix
9
- * `ScrollArea.Root`. Wraps children in a viewport and renders a {@link ScrollBar}
10
- * (vertical by default) plus a corner.
11
- *
12
- * @example
13
- * ```tsx
14
- * <ScrollArea className="h-72">
15
- * {items.map((i) => <div key={i}>{i}</div>)}
16
- * </ScrollArea>
17
- * ```
18
- */
19
- function ScrollArea({
20
- className,
21
- children,
22
- ...props
23
- }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) {
24
- return (
25
- <ScrollAreaPrimitive.Root
26
- data-slot='scroll-area'
27
- className={cn('relative', className)}
28
- {...props}
29
- >
30
- <ScrollAreaPrimitive.Viewport
31
- data-slot='scroll-area-viewport'
32
- className='focus-visible:ring-ring/50 size-full h-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1'
33
- >
34
- {children}
35
- </ScrollAreaPrimitive.Viewport>
36
- <ScrollBar />
37
- <ScrollAreaPrimitive.Corner />
38
- </ScrollAreaPrimitive.Root>
39
- );
40
- }
41
-
42
- /** Custom scrollbar for a {@link ScrollArea}; `orientation` may be `vertical` or `horizontal`. */
43
- function ScrollBar({
44
- className,
45
- orientation = 'vertical',
46
- ...props
47
- }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {
48
- return (
49
- <ScrollAreaPrimitive.ScrollAreaScrollbar
50
- data-slot='scroll-area-scrollbar'
51
- orientation={orientation}
52
- className={cn(
53
- 'flex touch-none p-px transition-colors select-none',
54
- orientation === 'vertical' &&
55
- 'h-full w-2.5 border-l border-l-transparent',
56
- orientation === 'horizontal' &&
57
- 'h-2.5 flex-col border-t border-t-transparent',
58
- className
59
- )}
60
- {...props}
61
- >
62
- <ScrollAreaPrimitive.ScrollAreaThumb
63
- data-slot='scroll-area-thumb'
64
- className='bg-border relative flex-1 rounded-full'
65
- />
66
- </ScrollAreaPrimitive.ScrollAreaScrollbar>
67
- );
68
- }
69
-
70
- export { ScrollArea, ScrollBar };
@@ -1,277 +0,0 @@
1
- import type { 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
- };