@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,21 +1,220 @@
1
1
  "use client";
2
- import {
3
- DropdownMenu,
4
- DropdownMenuCheckboxItem,
5
- DropdownMenuContent,
6
- DropdownMenuGroup,
7
- DropdownMenuItem,
8
- DropdownMenuLabel,
9
- DropdownMenuPortal,
10
- DropdownMenuRadioGroup,
11
- DropdownMenuRadioItem,
12
- DropdownMenuSeparator,
13
- DropdownMenuShortcut,
14
- DropdownMenuSub,
15
- DropdownMenuSubContent,
16
- DropdownMenuSubTrigger,
17
- DropdownMenuTrigger
18
- } from "../../chunk-2SBGU5XA.js";
2
+
3
+ // src/components/dropdown/index.tsx
4
+ import { cn } from "@foundrykit/utils";
5
+ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
6
+ import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ function DropdownMenu({
9
+ ...props
10
+ }) {
11
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
12
+ }
13
+ function DropdownMenuPortal({
14
+ ...props
15
+ }) {
16
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", ...props });
17
+ }
18
+ function DropdownMenuTrigger({
19
+ ...props
20
+ }) {
21
+ return /* @__PURE__ */ jsx(
22
+ DropdownMenuPrimitive.Trigger,
23
+ {
24
+ "data-slot": "dropdown-menu-trigger",
25
+ ...props
26
+ }
27
+ );
28
+ }
29
+ function DropdownMenuContent({
30
+ className,
31
+ sideOffset = 4,
32
+ ...props
33
+ }) {
34
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
35
+ DropdownMenuPrimitive.Content,
36
+ {
37
+ "data-slot": "dropdown-menu-content",
38
+ sideOffset,
39
+ className: cn(
40
+ "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-97 motion-safe:data-[state=open]:zoom-in-97 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",
41
+ className
42
+ ),
43
+ ...props
44
+ }
45
+ ) });
46
+ }
47
+ function DropdownMenuGroup({
48
+ ...props
49
+ }) {
50
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
51
+ }
52
+ function DropdownMenuItem({
53
+ className,
54
+ inset,
55
+ variant = "default",
56
+ ...props
57
+ }) {
58
+ return /* @__PURE__ */ jsx(
59
+ DropdownMenuPrimitive.Item,
60
+ {
61
+ "data-slot": "dropdown-menu-item",
62
+ "data-inset": inset,
63
+ "data-variant": variant,
64
+ className: cn(
65
+ "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",
66
+ className
67
+ ),
68
+ ...props
69
+ }
70
+ );
71
+ }
72
+ function DropdownMenuCheckboxItem({
73
+ className,
74
+ children,
75
+ checked,
76
+ ...props
77
+ }) {
78
+ return /* @__PURE__ */ jsxs(
79
+ DropdownMenuPrimitive.CheckboxItem,
80
+ {
81
+ "data-slot": "dropdown-menu-checkbox-item",
82
+ className: cn(
83
+ "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",
84
+ className
85
+ ),
86
+ checked,
87
+ ...props,
88
+ children: [
89
+ /* @__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" }) }) }),
90
+ children
91
+ ]
92
+ }
93
+ );
94
+ }
95
+ function DropdownMenuRadioGroup({
96
+ ...props
97
+ }) {
98
+ return /* @__PURE__ */ jsx(
99
+ DropdownMenuPrimitive.RadioGroup,
100
+ {
101
+ "data-slot": "dropdown-menu-radio-group",
102
+ ...props
103
+ }
104
+ );
105
+ }
106
+ function DropdownMenuRadioItem({
107
+ className,
108
+ children,
109
+ ...props
110
+ }) {
111
+ return /* @__PURE__ */ jsxs(
112
+ DropdownMenuPrimitive.RadioItem,
113
+ {
114
+ "data-slot": "dropdown-menu-radio-item",
115
+ className: cn(
116
+ "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",
117
+ className
118
+ ),
119
+ ...props,
120
+ children: [
121
+ /* @__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" }) }) }),
122
+ children
123
+ ]
124
+ }
125
+ );
126
+ }
127
+ function DropdownMenuLabel({
128
+ className,
129
+ inset,
130
+ ...props
131
+ }) {
132
+ return /* @__PURE__ */ jsx(
133
+ DropdownMenuPrimitive.Label,
134
+ {
135
+ "data-slot": "dropdown-menu-label",
136
+ "data-inset": inset,
137
+ className: cn(
138
+ "px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
139
+ className
140
+ ),
141
+ ...props
142
+ }
143
+ );
144
+ }
145
+ function DropdownMenuSeparator({
146
+ className,
147
+ ...props
148
+ }) {
149
+ return /* @__PURE__ */ jsx(
150
+ DropdownMenuPrimitive.Separator,
151
+ {
152
+ "data-slot": "dropdown-menu-separator",
153
+ className: cn("bg-border -mx-1 my-1 h-px", className),
154
+ ...props
155
+ }
156
+ );
157
+ }
158
+ function DropdownMenuShortcut({
159
+ className,
160
+ ...props
161
+ }) {
162
+ return /* @__PURE__ */ jsx(
163
+ "span",
164
+ {
165
+ "data-slot": "dropdown-menu-shortcut",
166
+ className: cn(
167
+ "text-muted-foreground ml-auto text-xs tracking-widest",
168
+ className
169
+ ),
170
+ ...props
171
+ }
172
+ );
173
+ }
174
+ function DropdownMenuSub({
175
+ ...props
176
+ }) {
177
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
178
+ }
179
+ function DropdownMenuSubTrigger({
180
+ className,
181
+ inset,
182
+ children,
183
+ ...props
184
+ }) {
185
+ return /* @__PURE__ */ jsxs(
186
+ DropdownMenuPrimitive.SubTrigger,
187
+ {
188
+ "data-slot": "dropdown-menu-sub-trigger",
189
+ "data-inset": inset,
190
+ className: cn(
191
+ "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",
192
+ className
193
+ ),
194
+ ...props,
195
+ children: [
196
+ children,
197
+ /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto size-4" })
198
+ ]
199
+ }
200
+ );
201
+ }
202
+ function DropdownMenuSubContent({
203
+ className,
204
+ ...props
205
+ }) {
206
+ return /* @__PURE__ */ jsx(
207
+ DropdownMenuPrimitive.SubContent,
208
+ {
209
+ "data-slot": "dropdown-menu-sub-content",
210
+ className: cn(
211
+ "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-97 motion-safe:data-[state=open]:zoom-in-97 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",
212
+ className
213
+ ),
214
+ ...props
215
+ }
216
+ );
217
+ }
19
218
  export {
20
219
  DropdownMenu,
21
220
  DropdownMenuCheckboxItem,
@@ -1,12 +1,98 @@
1
- import {
2
- Empty,
3
- EmptyContent,
4
- EmptyDescription,
5
- EmptyHeader,
6
- EmptyMedia,
7
- EmptyTitle,
8
- emptyMediaVariants
9
- } from "../../chunk-44I6VK3H.js";
1
+ // src/components/empty/index.tsx
2
+ import { cn } from "@foundrykit/utils";
3
+ import { cva } from "class-variance-authority";
4
+ import { jsx } from "react/jsx-runtime";
5
+ function Empty({ className, ...props }) {
6
+ return /* @__PURE__ */ jsx(
7
+ "div",
8
+ {
9
+ "data-slot": "empty",
10
+ className: cn(
11
+ "flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12",
12
+ className
13
+ ),
14
+ ...props
15
+ }
16
+ );
17
+ }
18
+ function EmptyHeader({ className, ...props }) {
19
+ return /* @__PURE__ */ jsx(
20
+ "div",
21
+ {
22
+ "data-slot": "empty-header",
23
+ className: cn(
24
+ "flex max-w-sm flex-col items-center gap-2 text-center",
25
+ className
26
+ ),
27
+ ...props
28
+ }
29
+ );
30
+ }
31
+ var emptyMediaVariants = cva(
32
+ "mb-2 flex shrink-0 items-center justify-center [&_svg:not([class*=size-])]:size-6",
33
+ {
34
+ variants: {
35
+ variant: {
36
+ default: "bg-transparent",
37
+ icon: "bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*=size-])]:size-6"
38
+ }
39
+ },
40
+ defaultVariants: {
41
+ variant: "default"
42
+ }
43
+ }
44
+ );
45
+ function EmptyMedia({
46
+ className,
47
+ variant,
48
+ ...props
49
+ }) {
50
+ return /* @__PURE__ */ jsx(
51
+ "div",
52
+ {
53
+ "data-slot": "empty-media",
54
+ "data-variant": variant,
55
+ className: cn(emptyMediaVariants({ variant }), className),
56
+ ...props
57
+ }
58
+ );
59
+ }
60
+ function EmptyTitle({ className, ...props }) {
61
+ return /* @__PURE__ */ jsx(
62
+ "div",
63
+ {
64
+ "data-slot": "empty-title",
65
+ className: cn("text-lg font-medium tracking-tight", className),
66
+ ...props
67
+ }
68
+ );
69
+ }
70
+ function EmptyDescription({ className, ...props }) {
71
+ return /* @__PURE__ */ jsx(
72
+ "p",
73
+ {
74
+ "data-slot": "empty-description",
75
+ className: cn(
76
+ "text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",
77
+ className
78
+ ),
79
+ ...props
80
+ }
81
+ );
82
+ }
83
+ function EmptyContent({ className, ...props }) {
84
+ return /* @__PURE__ */ jsx(
85
+ "div",
86
+ {
87
+ "data-slot": "empty-content",
88
+ className: cn(
89
+ "flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance",
90
+ className
91
+ ),
92
+ ...props
93
+ }
94
+ );
95
+ }
10
96
  export {
11
97
  Empty,
12
98
  EmptyContent,
@@ -1,17 +1,215 @@
1
1
  "use client";
2
- import {
3
- Field,
4
- FieldContent,
5
- FieldDescription,
6
- FieldError,
7
- FieldGroup,
8
- FieldLabel,
9
- FieldLegend,
10
- FieldSeparator,
11
- FieldSet,
12
- FieldTitle,
13
- fieldVariants
14
- } from "../../chunk-TRXU4SOJ.js";
2
+
3
+ // src/components/field/index.tsx
4
+ import { cn } from "@foundrykit/utils";
5
+ import * as LabelPrimitive from "@radix-ui/react-label";
6
+ import { cva } from "class-variance-authority";
7
+ import * as React from "react";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ var fieldVariants = cva(
10
+ "group/field data-[invalid=true]:text-destructive flex w-full gap-3",
11
+ {
12
+ variants: {
13
+ orientation: {
14
+ vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
15
+ horizontal: [
16
+ "flex-row items-center",
17
+ "[&>[data-slot=field-label]]:flex-auto",
18
+ "has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox]]:mt-px has-[>[data-slot=field-content]]:[&>[role=radio]]:mt-px"
19
+ ],
20
+ responsive: [
21
+ "flex-col @md/field-group:flex-row @md/field-group:items-center [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto",
22
+ "@md/field-group:[&>[data-slot=field-label]]:flex-auto",
23
+ "@md/field-group:has-[>[data-slot=field-content]]:items-start"
24
+ ]
25
+ }
26
+ },
27
+ defaultVariants: {
28
+ orientation: "vertical"
29
+ }
30
+ }
31
+ );
32
+ function Field({
33
+ className,
34
+ orientation = "vertical",
35
+ ...props
36
+ }) {
37
+ return /* @__PURE__ */ jsx(
38
+ "div",
39
+ {
40
+ role: "group",
41
+ "data-slot": "field",
42
+ "data-orientation": orientation,
43
+ className: cn(fieldVariants({ orientation }), className),
44
+ ...props
45
+ }
46
+ );
47
+ }
48
+ function FieldSet({ className, ...props }) {
49
+ return /* @__PURE__ */ jsx(
50
+ "fieldset",
51
+ {
52
+ "data-slot": "field-set",
53
+ className: cn(
54
+ "flex flex-col gap-6",
55
+ "has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",
56
+ className
57
+ ),
58
+ ...props
59
+ }
60
+ );
61
+ }
62
+ function FieldLegend({
63
+ className,
64
+ variant = "legend",
65
+ ...props
66
+ }) {
67
+ return /* @__PURE__ */ jsx(
68
+ "legend",
69
+ {
70
+ "data-slot": "field-legend",
71
+ "data-variant": variant,
72
+ className: cn(
73
+ "mb-3 font-medium",
74
+ "data-[variant=legend]:text-base",
75
+ "data-[variant=label]:text-sm",
76
+ className
77
+ ),
78
+ ...props
79
+ }
80
+ );
81
+ }
82
+ function FieldGroup({ className, ...props }) {
83
+ return /* @__PURE__ */ jsx(
84
+ "div",
85
+ {
86
+ "data-slot": "field-group",
87
+ className: cn(
88
+ "group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",
89
+ className
90
+ ),
91
+ ...props
92
+ }
93
+ );
94
+ }
95
+ function FieldContent({ className, ...props }) {
96
+ return /* @__PURE__ */ jsx(
97
+ "div",
98
+ {
99
+ "data-slot": "field-content",
100
+ className: cn(
101
+ "group/field-content flex flex-1 flex-col gap-1.5 leading-snug",
102
+ className
103
+ ),
104
+ ...props
105
+ }
106
+ );
107
+ }
108
+ function FieldLabel({
109
+ className,
110
+ ...props
111
+ }) {
112
+ return /* @__PURE__ */ jsx(
113
+ LabelPrimitive.Root,
114
+ {
115
+ "data-slot": "field-label",
116
+ className: cn(
117
+ "group/field-label peer/field-label flex w-fit gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50",
118
+ "has-[[data-slot=field]]:w-full has-[[data-slot=field]]:flex-col has-[[data-slot=field]]:rounded-md has-[[data-slot=field]]:border",
119
+ className
120
+ ),
121
+ ...props
122
+ }
123
+ );
124
+ }
125
+ function FieldTitle({ className, ...props }) {
126
+ return /* @__PURE__ */ jsx(
127
+ "div",
128
+ {
129
+ "data-slot": "field-title",
130
+ className: cn(
131
+ "flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50",
132
+ className
133
+ ),
134
+ ...props
135
+ }
136
+ );
137
+ }
138
+ function FieldDescription({ className, ...props }) {
139
+ return /* @__PURE__ */ jsx(
140
+ "p",
141
+ {
142
+ "data-slot": "field-description",
143
+ className: cn(
144
+ "text-muted-foreground text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance",
145
+ "last:mt-0 [[data-variant=legend]+&]:-mt-1.5",
146
+ "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
147
+ className
148
+ ),
149
+ ...props
150
+ }
151
+ );
152
+ }
153
+ function FieldSeparator({
154
+ children,
155
+ className,
156
+ ...props
157
+ }) {
158
+ return /* @__PURE__ */ jsxs(
159
+ "div",
160
+ {
161
+ "data-slot": "field-separator",
162
+ "data-content": !!children,
163
+ className: cn("relative -my-2 h-5 text-sm", className),
164
+ ...props,
165
+ children: [
166
+ /* @__PURE__ */ jsx("div", { className: "bg-border absolute inset-0 top-1/2 h-px" }),
167
+ children && /* @__PURE__ */ jsx(
168
+ "span",
169
+ {
170
+ className: "bg-background text-muted-foreground relative mx-auto block w-fit px-2",
171
+ "data-slot": "field-separator-content",
172
+ children
173
+ }
174
+ )
175
+ ]
176
+ }
177
+ );
178
+ }
179
+ function FieldError({
180
+ className,
181
+ children,
182
+ errors,
183
+ ...props
184
+ }) {
185
+ const content = React.useMemo(() => {
186
+ if (children) {
187
+ return children;
188
+ }
189
+ if (!errors) {
190
+ return null;
191
+ }
192
+ if (errors.length === 1 && errors[0]?.message) {
193
+ return errors[0].message;
194
+ }
195
+ return /* @__PURE__ */ jsx("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: errors.map(
196
+ (error, index) => error?.message && /* @__PURE__ */ jsx("li", { children: error.message }, index)
197
+ ) });
198
+ }, [children, errors]);
199
+ if (!content) {
200
+ return null;
201
+ }
202
+ return /* @__PURE__ */ jsx(
203
+ "div",
204
+ {
205
+ role: "alert",
206
+ "data-slot": "field-error",
207
+ className: cn("text-destructive text-sm font-normal", className),
208
+ ...props,
209
+ children: content
210
+ }
211
+ );
212
+ }
15
213
  export {
16
214
  Field,
17
215
  FieldContent,
@@ -1,9 +1,39 @@
1
1
  "use client";
2
- import {
3
- HoverCard,
4
- HoverCardContent,
5
- HoverCardTrigger
6
- } from "../../chunk-W4XY3SNY.js";
2
+
3
+ // src/components/hover-card/index.tsx
4
+ import { cn } from "@foundrykit/utils";
5
+ import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
6
+ import { jsx } from "react/jsx-runtime";
7
+ function HoverCard({
8
+ ...props
9
+ }) {
10
+ return /* @__PURE__ */ jsx(HoverCardPrimitive.Root, { "data-slot": "hover-card", ...props });
11
+ }
12
+ function HoverCardTrigger({
13
+ ...props
14
+ }) {
15
+ return /* @__PURE__ */ jsx(HoverCardPrimitive.Trigger, { "data-slot": "hover-card-trigger", ...props });
16
+ }
17
+ function HoverCardContent({
18
+ className,
19
+ align = "center",
20
+ sideOffset = 4,
21
+ ...props
22
+ }) {
23
+ return /* @__PURE__ */ jsx(HoverCardPrimitive.Portal, { "data-slot": "hover-card-portal", children: /* @__PURE__ */ jsx(
24
+ HoverCardPrimitive.Content,
25
+ {
26
+ "data-slot": "hover-card-content",
27
+ align,
28
+ sideOffset,
29
+ className: cn(
30
+ "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-97 motion-safe:data-[state=open]:zoom-in-97 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 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
31
+ className
32
+ ),
33
+ ...props
34
+ }
35
+ ) });
36
+ }
7
37
  export {
8
38
  HoverCard,
9
39
  HoverCardContent,
@@ -30,7 +30,7 @@ declare const inputGroupAddonVariants: (props?: ({
30
30
  */
31
31
  declare function InputGroupAddon({ className, align, ...props }: React.ComponentProps<'div'> & VariantProps<typeof inputGroupAddonVariants>): react_jsx_runtime.JSX.Element;
32
32
  declare const inputGroupButtonVariants: (props?: ({
33
- size?: "xs" | "sm" | "icon-xs" | "icon-sm" | null | undefined;
33
+ size?: "sm" | "xs" | "icon-xs" | "icon-sm" | null | undefined;
34
34
  } & class_variance_authority_types.ClassProp) | undefined) => string;
35
35
  /**
36
36
  * {@link Button} preset for use inside an addon: defaults to `type="button"`,
@@ -7,7 +7,7 @@ import {
7
7
  } from "../../chunk-5RFGKG4K.js";
8
8
  import {
9
9
  Button
10
- } from "../../chunk-SEDTBIZW.js";
10
+ } from "../../chunk-OMPTY5WQ.js";
11
11
 
12
12
  // src/components/input-group/index.tsx
13
13
  import { cn } from "@foundrykit/utils";