@foundrykit/primitives 2.1.3 → 2.3.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 (196) hide show
  1. package/README.md +11 -0
  2. package/dist/{chunk-SEDTBIZW.js → chunk-OMPTY5WQ.js} +1 -1
  3. package/dist/components/accordion/index.js +60 -6
  4. package/dist/components/alert/index.js +62 -6
  5. package/dist/components/alert-dialog/index.js +142 -13
  6. package/dist/components/aspect-ratio/index.js +9 -3
  7. package/dist/components/avatar/index.js +50 -5
  8. package/dist/components/badge/index.js +37 -4
  9. package/dist/components/breadcrumb/index.js +95 -9
  10. package/dist/components/button/index.js +1 -1
  11. package/dist/components/button-group/index.js +74 -6
  12. package/dist/components/card/index.js +66 -8
  13. package/dist/components/checkbox/index.js +30 -3
  14. package/dist/components/collapsible/index.js +33 -7
  15. package/dist/components/context-menu/index.js +208 -17
  16. package/dist/components/dialog/index.js +126 -12
  17. package/dist/components/direction/index.js +10 -2
  18. package/dist/components/drawer/index.js +118 -12
  19. package/dist/components/dropdown/index.js +216 -17
  20. package/dist/components/empty/index.js +95 -9
  21. package/dist/components/field/index.js +211 -13
  22. package/dist/components/hover-card/index.js +35 -5
  23. package/dist/components/input-group/index.d.ts +1 -1
  24. package/dist/components/input-group/index.js +1 -1
  25. package/dist/components/item/index.js +178 -14
  26. package/dist/components/kbd/index.js +27 -4
  27. package/dist/components/label/index.js +21 -3
  28. package/dist/components/menubar/index.js +235 -18
  29. package/dist/components/native-select/index.js +25 -3
  30. package/dist/components/navigation-menu/index.js +161 -11
  31. package/dist/components/popover/index.js +40 -6
  32. package/dist/components/progress/index.js +30 -3
  33. package/dist/components/radio-group/index.js +43 -4
  34. package/dist/components/resizable/index.js +43 -5
  35. package/dist/components/scroll-area/index.js +58 -4
  36. package/dist/components/section/index.js +13 -3
  37. package/dist/components/select/index.js +159 -12
  38. package/dist/components/sheet/index.js +118 -10
  39. package/dist/components/skeleton/index.js +13 -3
  40. package/dist/components/slider/index.js +64 -3
  41. package/dist/components/sonner/index.js +21 -4
  42. package/dist/components/spinner/index.js +19 -3
  43. package/dist/components/switch/index.js +30 -3
  44. package/dist/components/table/index.js +105 -10
  45. package/dist/components/tabs/index.js +63 -6
  46. package/dist/components/toggle/index.js +41 -4
  47. package/dist/components/toggle-group/index.js +80 -4
  48. package/dist/components/tooltip/index.js +51 -6
  49. package/dist/components/typography/index.js +147 -14
  50. package/dist/index.d.ts +1 -0
  51. package/dist/index.js +221 -254
  52. package/package.json +3 -3
  53. package/dist/chunk-25N35Z5M.js +0 -42
  54. package/dist/chunk-2JOT4DV4.js +0 -66
  55. package/dist/chunk-2SBGU5XA.js +0 -233
  56. package/dist/chunk-2UG6OCGA.js +0 -75
  57. package/dist/chunk-3BAO7TAS.js +0 -105
  58. package/dist/chunk-3NQR7JZR.js +0 -128
  59. package/dist/chunk-3QUMCM5K.js +0 -225
  60. package/dist/chunk-3TZXV53R.js +0 -55
  61. package/dist/chunk-3UKWAM5M.js +0 -33
  62. package/dist/chunk-44I6VK3H.js +0 -105
  63. package/dist/chunk-67UXTT4O.js +0 -116
  64. package/dist/chunk-727ACUWN.js +0 -82
  65. package/dist/chunk-76APYFRN.js +0 -29
  66. package/dist/chunk-AJAAMJYH.js +0 -12
  67. package/dist/chunk-B5YCE3UP.js +0 -57
  68. package/dist/chunk-BIFBYERK.js +0 -69
  69. package/dist/chunk-DXZ4GUQO.js +0 -33
  70. package/dist/chunk-ED6T7ZZN.js +0 -130
  71. package/dist/chunk-EEAK2RWF.js +0 -23
  72. package/dist/chunk-F2TEA6ER.js +0 -138
  73. package/dist/chunk-FF5D53KL.js +0 -69
  74. package/dist/chunk-FRIOQFPE.js +0 -171
  75. package/dist/chunk-G2YBCHWR.js +0 -46
  76. package/dist/chunk-GKCBSG2W.js +0 -67
  77. package/dist/chunk-GPEL656S.js +0 -84
  78. package/dist/chunk-JKKCRFYB.js +0 -36
  79. package/dist/chunk-JTSIBZS4.js +0 -194
  80. package/dist/chunk-MCXSVXO4.js +0 -24
  81. package/dist/chunk-MMZJQ7RW.js +0 -33
  82. package/dist/chunk-MYIUX3DT.js +0 -62
  83. package/dist/chunk-P5KEJOBH.js +0 -155
  84. package/dist/chunk-PAO3DSEF.js +0 -48
  85. package/dist/chunk-PLLG76QJ.js +0 -32
  86. package/dist/chunk-SDYKJVXX.js +0 -253
  87. package/dist/chunk-SIQHWNPH.js +0 -45
  88. package/dist/chunk-SKR3J46C.js +0 -17
  89. package/dist/chunk-STRBREHN.js +0 -17
  90. package/dist/chunk-SUEPE6OX.js +0 -47
  91. package/dist/chunk-TA23RNS4.js +0 -162
  92. package/dist/chunk-TRXU4SOJ.js +0 -224
  93. package/dist/chunk-U7JIOR7A.js +0 -172
  94. package/dist/chunk-VPBVKBZ7.js +0 -25
  95. package/dist/chunk-W4XY3SNY.js +0 -40
  96. package/dist/chunk-YT2ZIMZI.js +0 -16
  97. package/dist/components/accordion/index.cjs +0 -104
  98. package/dist/components/accordion/index.d.cts +0 -25
  99. package/dist/components/alert/index.cjs +0 -96
  100. package/dist/components/alert/index.d.cts +0 -28
  101. package/dist/components/alert-dialog/index.cjs +0 -200
  102. package/dist/components/alert-dialog/index.d.cts +0 -42
  103. package/dist/components/aspect-ratio/index.cjs +0 -47
  104. package/dist/components/aspect-ratio/index.d.cts +0 -19
  105. package/dist/components/avatar/index.cjs +0 -92
  106. package/dist/components/avatar/index.d.cts +0 -24
  107. package/dist/components/badge/index.cjs +0 -67
  108. package/dist/components/badge/index.d.cts +0 -24
  109. package/dist/components/breadcrumb/index.cjs +0 -135
  110. package/dist/components/breadcrumb/index.d.cts +0 -33
  111. package/dist/components/button/index.cjs +0 -87
  112. package/dist/components/button/index.d.cts +0 -28
  113. package/dist/components/button-group/index.cjs +0 -142
  114. package/dist/components/button-group/index.d.cts +0 -33
  115. package/dist/components/card/index.cjs +0 -104
  116. package/dist/components/card/index.d.cts +0 -27
  117. package/dist/components/checkbox/index.cjs +0 -68
  118. package/dist/components/checkbox/index.d.cts +0 -17
  119. package/dist/components/collapsible/index.cjs +0 -73
  120. package/dist/components/collapsible/index.d.cts +0 -22
  121. package/dist/components/context-menu/index.cjs +0 -274
  122. package/dist/components/context-menu/index.d.cts +0 -48
  123. package/dist/components/dialog/index.cjs +0 -182
  124. package/dist/components/dialog/index.d.cts +0 -38
  125. package/dist/components/direction/index.cjs +0 -39
  126. package/dist/components/direction/index.d.cts +0 -20
  127. package/dist/components/drawer/index.cjs +0 -164
  128. package/dist/components/drawer/index.d.cts +0 -35
  129. package/dist/components/dropdown/index.cjs +0 -282
  130. package/dist/components/dropdown/index.d.cts +0 -52
  131. package/dist/components/empty/index.cjs +0 -135
  132. package/dist/components/empty/index.d.cts +0 -38
  133. package/dist/components/field/index.cjs +0 -269
  134. package/dist/components/field/index.d.cts +0 -42
  135. package/dist/components/hover-card/index.cjs +0 -77
  136. package/dist/components/hover-card/index.d.cts +0 -22
  137. package/dist/components/input/index.cjs +0 -47
  138. package/dist/components/input/index.d.cts +0 -17
  139. package/dist/components/input-group/index.cjs +0 -270
  140. package/dist/components/input-group/index.d.cts +0 -44
  141. package/dist/components/item/index.cjs +0 -262
  142. package/dist/components/item/index.d.cts +0 -47
  143. package/dist/components/kbd/index.cjs +0 -57
  144. package/dist/components/kbd/index.d.cts +0 -19
  145. package/dist/components/label/index.cjs +0 -59
  146. package/dist/components/label/index.d.cts +0 -16
  147. package/dist/components/menubar/index.cjs +0 -303
  148. package/dist/components/menubar/index.d.cts +0 -49
  149. package/dist/components/native-select/index.cjs +0 -53
  150. package/dist/components/native-select/index.d.cts +0 -19
  151. package/dist/components/navigation-menu/index.cjs +0 -215
  152. package/dist/components/navigation-menu/index.d.cts +0 -37
  153. package/dist/components/popover/index.cjs +0 -84
  154. package/dist/components/popover/index.d.cts +0 -23
  155. package/dist/components/progress/index.cjs +0 -68
  156. package/dist/components/progress/index.d.cts +0 -16
  157. package/dist/components/radio-group/index.cjs +0 -83
  158. package/dist/components/radio-group/index.d.cts +0 -22
  159. package/dist/components/resizable/index.cjs +0 -75
  160. package/dist/components/resizable/index.d.cts +0 -25
  161. package/dist/components/scroll-area/index.cjs +0 -98
  162. package/dist/components/scroll-area/index.d.cts +0 -21
  163. package/dist/components/section/index.cjs +0 -41
  164. package/dist/components/section/index.d.cts +0 -27
  165. package/dist/components/select/index.cjs +0 -215
  166. package/dist/components/select/index.d.cts +0 -36
  167. package/dist/components/separator/index.cjs +0 -63
  168. package/dist/components/separator/index.d.cts +0 -18
  169. package/dist/components/sheet/index.cjs +0 -170
  170. package/dist/components/sheet/index.d.cts +0 -31
  171. package/dist/components/skeleton/index.cjs +0 -41
  172. package/dist/components/skeleton/index.d.cts +0 -14
  173. package/dist/components/slider/index.cjs +0 -102
  174. package/dist/components/slider/index.d.cts +0 -19
  175. package/dist/components/sonner/index.cjs +0 -51
  176. package/dist/components/sonner/index.d.cts +0 -18
  177. package/dist/components/spinner/index.cjs +0 -47
  178. package/dist/components/spinner/index.d.cts +0 -17
  179. package/dist/components/switch/index.cjs +0 -68
  180. package/dist/components/switch/index.d.cts +0 -17
  181. package/dist/components/table/index.cjs +0 -147
  182. package/dist/components/table/index.d.cts +0 -35
  183. package/dist/components/tabs/index.cjs +0 -107
  184. package/dist/components/tabs/index.d.cts +0 -27
  185. package/dist/components/textarea/index.cjs +0 -44
  186. package/dist/components/textarea/index.d.cts +0 -15
  187. package/dist/components/toggle/index.cjs +0 -81
  188. package/dist/components/toggle/index.d.cts +0 -26
  189. package/dist/components/toggle-group/index.cjs +0 -120
  190. package/dist/components/toggle-group/index.d.cts +0 -27
  191. package/dist/components/tooltip/index.cjs +0 -95
  192. package/dist/components/tooltip/index.d.cts +0 -25
  193. package/dist/components/typography/index.cjs +0 -197
  194. package/dist/components/typography/index.d.cts +0 -28
  195. package/dist/index.cjs +0 -4094
  196. package/dist/index.d.cts +0 -83
@@ -1,233 +0,0 @@
1
- // src/components/dropdown/index.tsx
2
- import { cn } from "@foundrykit/utils";
3
- import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
4
- import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
5
- import { jsx, jsxs } from "react/jsx-runtime";
6
- function DropdownMenu({
7
- ...props
8
- }) {
9
- return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
10
- }
11
- function DropdownMenuPortal({
12
- ...props
13
- }) {
14
- return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", ...props });
15
- }
16
- function DropdownMenuTrigger({
17
- ...props
18
- }) {
19
- return /* @__PURE__ */ jsx(
20
- DropdownMenuPrimitive.Trigger,
21
- {
22
- "data-slot": "dropdown-menu-trigger",
23
- ...props
24
- }
25
- );
26
- }
27
- function DropdownMenuContent({
28
- className,
29
- sideOffset = 4,
30
- ...props
31
- }) {
32
- return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
33
- DropdownMenuPrimitive.Content,
34
- {
35
- "data-slot": "dropdown-menu-content",
36
- sideOffset,
37
- className: cn(
38
- "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:zoom-in-95 motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
39
- className
40
- ),
41
- ...props
42
- }
43
- ) });
44
- }
45
- function DropdownMenuGroup({
46
- ...props
47
- }) {
48
- return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
49
- }
50
- function DropdownMenuItem({
51
- className,
52
- inset,
53
- variant = "default",
54
- ...props
55
- }) {
56
- return /* @__PURE__ */ jsx(
57
- DropdownMenuPrimitive.Item,
58
- {
59
- "data-slot": "dropdown-menu-item",
60
- "data-inset": inset,
61
- "data-variant": variant,
62
- className: cn(
63
- "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
64
- className
65
- ),
66
- ...props
67
- }
68
- );
69
- }
70
- function DropdownMenuCheckboxItem({
71
- className,
72
- children,
73
- checked,
74
- ...props
75
- }) {
76
- return /* @__PURE__ */ jsxs(
77
- DropdownMenuPrimitive.CheckboxItem,
78
- {
79
- "data-slot": "dropdown-menu-checkbox-item",
80
- className: cn(
81
- "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
82
- className
83
- ),
84
- checked,
85
- ...props,
86
- children: [
87
- /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) }) }),
88
- children
89
- ]
90
- }
91
- );
92
- }
93
- function DropdownMenuRadioGroup({
94
- ...props
95
- }) {
96
- return /* @__PURE__ */ jsx(
97
- DropdownMenuPrimitive.RadioGroup,
98
- {
99
- "data-slot": "dropdown-menu-radio-group",
100
- ...props
101
- }
102
- );
103
- }
104
- function DropdownMenuRadioItem({
105
- className,
106
- children,
107
- ...props
108
- }) {
109
- return /* @__PURE__ */ jsxs(
110
- DropdownMenuPrimitive.RadioItem,
111
- {
112
- "data-slot": "dropdown-menu-radio-item",
113
- className: cn(
114
- "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
115
- className
116
- ),
117
- ...props,
118
- children: [
119
- /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CircleIcon, { className: "size-2 fill-current" }) }) }),
120
- children
121
- ]
122
- }
123
- );
124
- }
125
- function DropdownMenuLabel({
126
- className,
127
- inset,
128
- ...props
129
- }) {
130
- return /* @__PURE__ */ jsx(
131
- DropdownMenuPrimitive.Label,
132
- {
133
- "data-slot": "dropdown-menu-label",
134
- "data-inset": inset,
135
- className: cn(
136
- "px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
137
- className
138
- ),
139
- ...props
140
- }
141
- );
142
- }
143
- function DropdownMenuSeparator({
144
- className,
145
- ...props
146
- }) {
147
- return /* @__PURE__ */ jsx(
148
- DropdownMenuPrimitive.Separator,
149
- {
150
- "data-slot": "dropdown-menu-separator",
151
- className: cn("bg-border -mx-1 my-1 h-px", className),
152
- ...props
153
- }
154
- );
155
- }
156
- function DropdownMenuShortcut({
157
- className,
158
- ...props
159
- }) {
160
- return /* @__PURE__ */ jsx(
161
- "span",
162
- {
163
- "data-slot": "dropdown-menu-shortcut",
164
- className: cn(
165
- "text-muted-foreground ml-auto text-xs tracking-widest",
166
- className
167
- ),
168
- ...props
169
- }
170
- );
171
- }
172
- function DropdownMenuSub({
173
- ...props
174
- }) {
175
- return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
176
- }
177
- function DropdownMenuSubTrigger({
178
- className,
179
- inset,
180
- children,
181
- ...props
182
- }) {
183
- return /* @__PURE__ */ jsxs(
184
- DropdownMenuPrimitive.SubTrigger,
185
- {
186
- "data-slot": "dropdown-menu-sub-trigger",
187
- "data-inset": inset,
188
- className: cn(
189
- "focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",
190
- className
191
- ),
192
- ...props,
193
- children: [
194
- children,
195
- /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto size-4" })
196
- ]
197
- }
198
- );
199
- }
200
- function DropdownMenuSubContent({
201
- className,
202
- ...props
203
- }) {
204
- return /* @__PURE__ */ jsx(
205
- DropdownMenuPrimitive.SubContent,
206
- {
207
- "data-slot": "dropdown-menu-sub-content",
208
- className: cn(
209
- "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:zoom-in-95 motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
210
- className
211
- ),
212
- ...props
213
- }
214
- );
215
- }
216
-
217
- export {
218
- DropdownMenu,
219
- DropdownMenuPortal,
220
- DropdownMenuTrigger,
221
- DropdownMenuContent,
222
- DropdownMenuGroup,
223
- DropdownMenuItem,
224
- DropdownMenuCheckboxItem,
225
- DropdownMenuRadioGroup,
226
- DropdownMenuRadioItem,
227
- DropdownMenuLabel,
228
- DropdownMenuSeparator,
229
- DropdownMenuShortcut,
230
- DropdownMenuSub,
231
- DropdownMenuSubTrigger,
232
- DropdownMenuSubContent
233
- };
@@ -1,75 +0,0 @@
1
- // src/components/card/index.tsx
2
- import { cn } from "@foundrykit/utils";
3
- import { jsx } from "react/jsx-runtime";
4
- function Card({ className, ...props }) {
5
- return /* @__PURE__ */ jsx(
6
- "div",
7
- {
8
- "data-slot": "card",
9
- className: cn(
10
- "bg-card text-card-foreground rounded-[var(--card-radius,calc(var(--radius)+4px))] border shadow",
11
- className
12
- ),
13
- ...props
14
- }
15
- );
16
- }
17
- function CardHeader({ className, ...props }) {
18
- return /* @__PURE__ */ jsx(
19
- "div",
20
- {
21
- "data-slot": "card-header",
22
- className: cn("flex flex-col space-y-1.5 p-6", className),
23
- ...props
24
- }
25
- );
26
- }
27
- function CardTitle({ className, ...props }) {
28
- return /* @__PURE__ */ jsx(
29
- "h3",
30
- {
31
- "data-slot": "card-title",
32
- className: cn("leading-none font-semibold tracking-tight", className),
33
- ...props
34
- }
35
- );
36
- }
37
- function CardDescription({ className, ...props }) {
38
- return /* @__PURE__ */ jsx(
39
- "p",
40
- {
41
- "data-slot": "card-description",
42
- className: cn("text-muted-foreground text-sm", className),
43
- ...props
44
- }
45
- );
46
- }
47
- function CardContent({ className, ...props }) {
48
- return /* @__PURE__ */ jsx(
49
- "div",
50
- {
51
- "data-slot": "card-content",
52
- className: cn("p-6 pt-0", className),
53
- ...props
54
- }
55
- );
56
- }
57
- function CardFooter({ className, ...props }) {
58
- return /* @__PURE__ */ jsx(
59
- "div",
60
- {
61
- "data-slot": "card-footer",
62
- className: cn("flex items-center p-6 pt-0", className),
63
- ...props
64
- }
65
- );
66
- }
67
-
68
- export {
69
- Card,
70
- CardHeader,
71
- CardTitle,
72
- CardDescription,
73
- CardContent,
74
- CardFooter
75
- };
@@ -1,105 +0,0 @@
1
- // src/components/breadcrumb/index.tsx
2
- import { cn } from "@foundrykit/utils";
3
- import { Slot } from "@radix-ui/react-slot";
4
- import { ChevronRight, MoreHorizontal } from "lucide-react";
5
- import { jsx, jsxs } from "react/jsx-runtime";
6
- function Breadcrumb({ ...props }) {
7
- return /* @__PURE__ */ jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...props });
8
- }
9
- function BreadcrumbList({ className, ...props }) {
10
- return /* @__PURE__ */ jsx(
11
- "ol",
12
- {
13
- "data-slot": "breadcrumb-list",
14
- className: cn(
15
- "text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",
16
- className
17
- ),
18
- ...props
19
- }
20
- );
21
- }
22
- function BreadcrumbItem({ className, ...props }) {
23
- return /* @__PURE__ */ jsx(
24
- "li",
25
- {
26
- "data-slot": "breadcrumb-item",
27
- className: cn("inline-flex items-center gap-1.5", className),
28
- ...props
29
- }
30
- );
31
- }
32
- function BreadcrumbLink({
33
- asChild,
34
- className,
35
- ...props
36
- }) {
37
- const Comp = asChild ? Slot : "a";
38
- return /* @__PURE__ */ jsx(
39
- Comp,
40
- {
41
- "data-slot": "breadcrumb-link",
42
- className: cn("hover:text-foreground transition-colors", className),
43
- ...props
44
- }
45
- );
46
- }
47
- function BreadcrumbPage({ className, ...props }) {
48
- return /* @__PURE__ */ jsx(
49
- "span",
50
- {
51
- "data-slot": "breadcrumb-page",
52
- role: "link",
53
- "aria-disabled": "true",
54
- "aria-current": "page",
55
- className: cn("text-foreground font-normal", className),
56
- ...props
57
- }
58
- );
59
- }
60
- function BreadcrumbSeparator({
61
- children,
62
- className,
63
- ...props
64
- }) {
65
- return /* @__PURE__ */ jsx(
66
- "li",
67
- {
68
- "data-slot": "breadcrumb-separator",
69
- role: "presentation",
70
- "aria-hidden": "true",
71
- className: cn("[&>svg]:size-3.5", className),
72
- ...props,
73
- children: children ?? /* @__PURE__ */ jsx(ChevronRight, {})
74
- }
75
- );
76
- }
77
- function BreadcrumbEllipsis({
78
- className,
79
- ...props
80
- }) {
81
- return /* @__PURE__ */ jsxs(
82
- "span",
83
- {
84
- "data-slot": "breadcrumb-ellipsis",
85
- role: "presentation",
86
- "aria-hidden": "true",
87
- className: cn("flex size-9 items-center justify-center", className),
88
- ...props,
89
- children: [
90
- /* @__PURE__ */ jsx(MoreHorizontal, { className: "size-4" }),
91
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "More" })
92
- ]
93
- }
94
- );
95
- }
96
-
97
- export {
98
- Breadcrumb,
99
- BreadcrumbList,
100
- BreadcrumbItem,
101
- BreadcrumbLink,
102
- BreadcrumbPage,
103
- BreadcrumbSeparator,
104
- BreadcrumbEllipsis
105
- };
@@ -1,128 +0,0 @@
1
- // src/components/sheet/index.tsx
2
- import { cn } from "@foundrykit/utils";
3
- import * as SheetPrimitive from "@radix-ui/react-dialog";
4
- import { XIcon } from "lucide-react";
5
- import { jsx, jsxs } from "react/jsx-runtime";
6
- function Sheet({ ...props }) {
7
- return /* @__PURE__ */ jsx(SheetPrimitive.Root, { "data-slot": "sheet", ...props });
8
- }
9
- function SheetTrigger({
10
- ...props
11
- }) {
12
- return /* @__PURE__ */ jsx(SheetPrimitive.Trigger, { "data-slot": "sheet-trigger", ...props });
13
- }
14
- function SheetClose({
15
- ...props
16
- }) {
17
- return /* @__PURE__ */ jsx(SheetPrimitive.Close, { "data-slot": "sheet-close", ...props });
18
- }
19
- function SheetPortal({
20
- ...props
21
- }) {
22
- return /* @__PURE__ */ jsx(SheetPrimitive.Portal, { "data-slot": "sheet-portal", ...props });
23
- }
24
- function SheetOverlay({
25
- className,
26
- ...props
27
- }) {
28
- return /* @__PURE__ */ jsx(
29
- SheetPrimitive.Overlay,
30
- {
31
- "data-slot": "sheet-overlay",
32
- className: cn(
33
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
34
- className
35
- ),
36
- ...props
37
- }
38
- );
39
- }
40
- function SheetContent({
41
- className,
42
- children,
43
- side = "right",
44
- ...props
45
- }) {
46
- return /* @__PURE__ */ jsxs(SheetPortal, { children: [
47
- /* @__PURE__ */ jsx(SheetOverlay, {}),
48
- /* @__PURE__ */ jsxs(
49
- SheetPrimitive.Content,
50
- {
51
- "data-slot": "sheet-content",
52
- className: cn(
53
- "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
54
- side === "right" && "motion-safe:data-[state=closed]:slide-out-to-right motion-safe:data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
55
- side === "left" && "motion-safe:data-[state=closed]:slide-out-to-left motion-safe:data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
56
- side === "top" && "motion-safe:data-[state=closed]:slide-out-to-top motion-safe:data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
57
- side === "bottom" && "motion-safe:data-[state=closed]:slide-out-to-bottom motion-safe:data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
58
- className
59
- ),
60
- ...props,
61
- children: [
62
- children,
63
- /* @__PURE__ */ jsxs(SheetPrimitive.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [
64
- /* @__PURE__ */ jsx(XIcon, { className: "size-4" }),
65
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
66
- ] })
67
- ]
68
- }
69
- )
70
- ] });
71
- }
72
- function SheetHeader({ className, ...props }) {
73
- return /* @__PURE__ */ jsx(
74
- "div",
75
- {
76
- "data-slot": "sheet-header",
77
- className: cn("flex flex-col gap-1.5 p-4", className),
78
- ...props
79
- }
80
- );
81
- }
82
- function SheetFooter({ className, ...props }) {
83
- return /* @__PURE__ */ jsx(
84
- "div",
85
- {
86
- "data-slot": "sheet-footer",
87
- className: cn("mt-auto flex flex-col gap-2 p-4", className),
88
- ...props
89
- }
90
- );
91
- }
92
- function SheetTitle({
93
- className,
94
- ...props
95
- }) {
96
- return /* @__PURE__ */ jsx(
97
- SheetPrimitive.Title,
98
- {
99
- "data-slot": "sheet-title",
100
- className: cn("text-foreground font-semibold", className),
101
- ...props
102
- }
103
- );
104
- }
105
- function SheetDescription({
106
- className,
107
- ...props
108
- }) {
109
- return /* @__PURE__ */ jsx(
110
- SheetPrimitive.Description,
111
- {
112
- "data-slot": "sheet-description",
113
- className: cn("text-muted-foreground text-sm", className),
114
- ...props
115
- }
116
- );
117
- }
118
-
119
- export {
120
- Sheet,
121
- SheetTrigger,
122
- SheetClose,
123
- SheetContent,
124
- SheetHeader,
125
- SheetFooter,
126
- SheetTitle,
127
- SheetDescription
128
- };