@questpie/admin 0.0.1 → 1.0.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 (250) hide show
  1. package/README.md +439 -424
  2. package/dist/auth-layout-M8K8_q5R.mjs +181 -0
  3. package/dist/auth-layout-M8K8_q5R.mjs.map +1 -0
  4. package/dist/bulk-upload-dialog-h7zXD78Y.mjs +274 -0
  5. package/dist/bulk-upload-dialog-h7zXD78Y.mjs.map +1 -0
  6. package/dist/{components/ui/card.mjs → card-BKHjBQfw.mjs} +8 -8
  7. package/dist/card-BKHjBQfw.mjs.map +1 -0
  8. package/dist/client/styles/index.css +434 -0
  9. package/dist/client-BCGpkAz6.mjs +22635 -0
  10. package/dist/client-BCGpkAz6.mjs.map +1 -0
  11. package/dist/client-CcWZbkBP.d.mts +13585 -0
  12. package/dist/client-CcWZbkBP.d.mts.map +1 -0
  13. package/dist/client.d.mts +3 -0
  14. package/dist/client.mjs +14 -0
  15. package/dist/content-locales-provider-BXvuIgfg.mjs +1650 -0
  16. package/dist/content-locales-provider-BXvuIgfg.mjs.map +1 -0
  17. package/dist/dashboard-page-B4PGEdc2.mjs +2500 -0
  18. package/dist/dashboard-page-B4PGEdc2.mjs.map +1 -0
  19. package/dist/dashboard-page-CVlyR40m.mjs +6 -0
  20. package/dist/dropzone-Do3awXKd.mjs +634 -0
  21. package/dist/dropzone-Do3awXKd.mjs.map +1 -0
  22. package/dist/{views/auth/forgot-password-form.mjs → forgot-password-page-Bcp-An4Y.mjs} +87 -14
  23. package/dist/forgot-password-page-Bcp-An4Y.mjs.map +1 -0
  24. package/dist/forgot-password-page-CIILVhfo.mjs +7 -0
  25. package/dist/index-B9Xwk4hi.d.mts +2753 -0
  26. package/dist/index-B9Xwk4hi.d.mts.map +1 -0
  27. package/dist/index.d.mts +3 -0
  28. package/dist/index.mjs +14 -0
  29. package/dist/login-page-8K7fo0qK.mjs +7 -0
  30. package/dist/login-page-CP4gA-dl.mjs +298 -0
  31. package/dist/login-page-CP4gA-dl.mjs.map +1 -0
  32. package/dist/preview-utils-BKQ9-TMa.mjs +65 -0
  33. package/dist/preview-utils-BKQ9-TMa.mjs.map +1 -0
  34. package/dist/{views/auth/reset-password-form.mjs → reset-password-page-BqfDmLxA.mjs} +111 -14
  35. package/dist/reset-password-page-BqfDmLxA.mjs.map +1 -0
  36. package/dist/reset-password-page-DLATv0xQ.mjs +7 -0
  37. package/dist/runtime-6VZM878K.mjs +69 -0
  38. package/dist/runtime-6VZM878K.mjs.map +1 -0
  39. package/dist/saved-views.types-BMsz5mCy.d.mts +42 -0
  40. package/dist/saved-views.types-BMsz5mCy.d.mts.map +1 -0
  41. package/dist/server.d.mts +250 -0
  42. package/dist/server.d.mts.map +1 -0
  43. package/dist/server.mjs +832 -0
  44. package/dist/server.mjs.map +1 -0
  45. package/dist/setup-page-CMZ5P_OE.mjs +6 -0
  46. package/dist/setup-page-YAP_fzqh.mjs +264 -0
  47. package/dist/setup-page-YAP_fzqh.mjs.map +1 -0
  48. package/dist/shared.d.mts +57 -0
  49. package/dist/shared.d.mts.map +1 -0
  50. package/dist/shared.mjs +3 -0
  51. package/dist/{hooks/use-auth.mjs → use-auth-BoLmWtmU.mjs} +42 -30
  52. package/dist/use-auth-BoLmWtmU.mjs.map +1 -0
  53. package/package.json +48 -197
  54. package/.turbo/turbo-build.log +0 -108
  55. package/CHANGELOG.md +0 -10
  56. package/STATUS.md +0 -917
  57. package/VALIDATION.md +0 -602
  58. package/components.json +0 -24
  59. package/dist/__tests__/setup.mjs +0 -38
  60. package/dist/__tests__/test-utils.mjs +0 -45
  61. package/dist/__tests__/vitest.d.mjs +0 -3
  62. package/dist/components/admin-app.mjs +0 -69
  63. package/dist/components/fields/array-field.mjs +0 -190
  64. package/dist/components/fields/checkbox-field.mjs +0 -34
  65. package/dist/components/fields/custom-field.mjs +0 -32
  66. package/dist/components/fields/date-field.mjs +0 -41
  67. package/dist/components/fields/datetime-field.mjs +0 -42
  68. package/dist/components/fields/email-field.mjs +0 -37
  69. package/dist/components/fields/embedded-collection.mjs +0 -253
  70. package/dist/components/fields/field-types.mjs +0 -1
  71. package/dist/components/fields/field-utils.mjs +0 -10
  72. package/dist/components/fields/field-wrapper.mjs +0 -34
  73. package/dist/components/fields/index.mjs +0 -23
  74. package/dist/components/fields/json-field.mjs +0 -243
  75. package/dist/components/fields/locale-badge.mjs +0 -16
  76. package/dist/components/fields/number-field.mjs +0 -39
  77. package/dist/components/fields/password-field.mjs +0 -37
  78. package/dist/components/fields/relation-field.mjs +0 -104
  79. package/dist/components/fields/relation-picker.mjs +0 -229
  80. package/dist/components/fields/relation-select.mjs +0 -188
  81. package/dist/components/fields/rich-text-editor/index.mjs +0 -897
  82. package/dist/components/fields/select-field.mjs +0 -41
  83. package/dist/components/fields/switch-field.mjs +0 -34
  84. package/dist/components/fields/text-field.mjs +0 -38
  85. package/dist/components/fields/textarea-field.mjs +0 -38
  86. package/dist/components/index.mjs +0 -59
  87. package/dist/components/primitives/checkbox-input.mjs +0 -127
  88. package/dist/components/primitives/date-input.mjs +0 -303
  89. package/dist/components/primitives/index.mjs +0 -12
  90. package/dist/components/primitives/number-input.mjs +0 -104
  91. package/dist/components/primitives/select-input.mjs +0 -177
  92. package/dist/components/primitives/tag-input.mjs +0 -135
  93. package/dist/components/primitives/text-input.mjs +0 -39
  94. package/dist/components/primitives/textarea-input.mjs +0 -37
  95. package/dist/components/primitives/toggle-input.mjs +0 -31
  96. package/dist/components/primitives/types.mjs +0 -12
  97. package/dist/components/ui/accordion.mjs +0 -55
  98. package/dist/components/ui/avatar.mjs +0 -54
  99. package/dist/components/ui/badge.mjs +0 -34
  100. package/dist/components/ui/button.mjs +0 -48
  101. package/dist/components/ui/checkbox.mjs +0 -21
  102. package/dist/components/ui/combobox.mjs +0 -163
  103. package/dist/components/ui/dialog.mjs +0 -95
  104. package/dist/components/ui/dropdown-menu.mjs +0 -138
  105. package/dist/components/ui/field.mjs +0 -113
  106. package/dist/components/ui/input-group.mjs +0 -82
  107. package/dist/components/ui/input.mjs +0 -17
  108. package/dist/components/ui/label.mjs +0 -15
  109. package/dist/components/ui/popover.mjs +0 -56
  110. package/dist/components/ui/scroll-area.mjs +0 -38
  111. package/dist/components/ui/select.mjs +0 -100
  112. package/dist/components/ui/separator.mjs +0 -16
  113. package/dist/components/ui/sheet.mjs +0 -90
  114. package/dist/components/ui/sidebar.mjs +0 -387
  115. package/dist/components/ui/skeleton.mjs +0 -14
  116. package/dist/components/ui/spinner.mjs +0 -16
  117. package/dist/components/ui/switch.mjs +0 -22
  118. package/dist/components/ui/table.mjs +0 -68
  119. package/dist/components/ui/tabs.mjs +0 -48
  120. package/dist/components/ui/textarea.mjs +0 -15
  121. package/dist/components/ui/tooltip.mjs +0 -44
  122. package/dist/config/component-registry.mjs +0 -38
  123. package/dist/config/index.mjs +0 -129
  124. package/dist/hooks/admin-provider.mjs +0 -70
  125. package/dist/hooks/index.mjs +0 -7
  126. package/dist/hooks/store.mjs +0 -178
  127. package/dist/hooks/use-collection-db.mjs +0 -146
  128. package/dist/hooks/use-collection.mjs +0 -112
  129. package/dist/hooks/use-global.mjs +0 -46
  130. package/dist/hooks/use-mobile.mjs +0 -20
  131. package/dist/lib/utils.mjs +0 -10
  132. package/dist/styles/index.css +0 -336
  133. package/dist/styles/index.mjs +0 -1
  134. package/dist/utils/index.mjs +0 -9
  135. package/dist/views/auth/auth-layout.mjs +0 -52
  136. package/dist/views/auth/index.mjs +0 -6
  137. package/dist/views/auth/login-form.mjs +0 -156
  138. package/dist/views/collection/auto-form-fields.mjs +0 -525
  139. package/dist/views/collection/collection-form.mjs +0 -91
  140. package/dist/views/collection/collection-list.mjs +0 -76
  141. package/dist/views/collection/form-field.mjs +0 -42
  142. package/dist/views/collection/index.mjs +0 -6
  143. package/dist/views/common/index.mjs +0 -4
  144. package/dist/views/common/locale-switcher.mjs +0 -39
  145. package/dist/views/common/version-history.mjs +0 -272
  146. package/dist/views/index.mjs +0 -9
  147. package/dist/views/layout/admin-layout.mjs +0 -40
  148. package/dist/views/layout/admin-router.mjs +0 -95
  149. package/dist/views/layout/admin-sidebar.mjs +0 -63
  150. package/dist/views/layout/index.mjs +0 -5
  151. package/src/__tests__/setup.ts +0 -44
  152. package/src/__tests__/test-utils.tsx +0 -49
  153. package/src/__tests__/vitest.d.ts +0 -9
  154. package/src/components/admin-app.tsx +0 -221
  155. package/src/components/fields/array-field.tsx +0 -237
  156. package/src/components/fields/checkbox-field.tsx +0 -47
  157. package/src/components/fields/custom-field.tsx +0 -50
  158. package/src/components/fields/date-field.tsx +0 -65
  159. package/src/components/fields/datetime-field.tsx +0 -67
  160. package/src/components/fields/email-field.tsx +0 -51
  161. package/src/components/fields/embedded-collection.tsx +0 -315
  162. package/src/components/fields/field-types.ts +0 -162
  163. package/src/components/fields/field-utils.ts +0 -6
  164. package/src/components/fields/field-wrapper.tsx +0 -52
  165. package/src/components/fields/index.ts +0 -66
  166. package/src/components/fields/json-field.tsx +0 -440
  167. package/src/components/fields/locale-badge.tsx +0 -15
  168. package/src/components/fields/number-field.tsx +0 -57
  169. package/src/components/fields/password-field.tsx +0 -51
  170. package/src/components/fields/relation-field.tsx +0 -243
  171. package/src/components/fields/relation-picker.tsx +0 -402
  172. package/src/components/fields/relation-select.tsx +0 -327
  173. package/src/components/fields/rich-text-editor/index.tsx +0 -1337
  174. package/src/components/fields/select-field.tsx +0 -61
  175. package/src/components/fields/switch-field.tsx +0 -47
  176. package/src/components/fields/text-field.tsx +0 -55
  177. package/src/components/fields/textarea-field.tsx +0 -55
  178. package/src/components/index.ts +0 -40
  179. package/src/components/primitives/checkbox-input.tsx +0 -193
  180. package/src/components/primitives/date-input.tsx +0 -401
  181. package/src/components/primitives/index.ts +0 -24
  182. package/src/components/primitives/number-input.tsx +0 -132
  183. package/src/components/primitives/select-input.tsx +0 -296
  184. package/src/components/primitives/tag-input.tsx +0 -200
  185. package/src/components/primitives/text-input.tsx +0 -49
  186. package/src/components/primitives/textarea-input.tsx +0 -46
  187. package/src/components/primitives/toggle-input.tsx +0 -36
  188. package/src/components/primitives/types.ts +0 -235
  189. package/src/components/ui/accordion.tsx +0 -72
  190. package/src/components/ui/avatar.tsx +0 -106
  191. package/src/components/ui/badge.tsx +0 -48
  192. package/src/components/ui/button.tsx +0 -53
  193. package/src/components/ui/card.tsx +0 -94
  194. package/src/components/ui/checkbox.tsx +0 -27
  195. package/src/components/ui/combobox.tsx +0 -290
  196. package/src/components/ui/dialog.tsx +0 -151
  197. package/src/components/ui/dropdown-menu.tsx +0 -254
  198. package/src/components/ui/field.tsx +0 -227
  199. package/src/components/ui/input-group.tsx +0 -149
  200. package/src/components/ui/input.tsx +0 -20
  201. package/src/components/ui/label.tsx +0 -18
  202. package/src/components/ui/popover.tsx +0 -88
  203. package/src/components/ui/scroll-area.tsx +0 -53
  204. package/src/components/ui/select.tsx +0 -192
  205. package/src/components/ui/separator.tsx +0 -23
  206. package/src/components/ui/sheet.tsx +0 -127
  207. package/src/components/ui/sidebar.tsx +0 -723
  208. package/src/components/ui/skeleton.tsx +0 -13
  209. package/src/components/ui/spinner.tsx +0 -10
  210. package/src/components/ui/switch.tsx +0 -32
  211. package/src/components/ui/table.tsx +0 -99
  212. package/src/components/ui/tabs.tsx +0 -82
  213. package/src/components/ui/textarea.tsx +0 -18
  214. package/src/components/ui/tooltip.tsx +0 -70
  215. package/src/config/component-registry.ts +0 -190
  216. package/src/config/index.ts +0 -1099
  217. package/src/hooks/README.md +0 -269
  218. package/src/hooks/admin-provider.tsx +0 -110
  219. package/src/hooks/index.ts +0 -41
  220. package/src/hooks/store.ts +0 -248
  221. package/src/hooks/use-auth.ts +0 -168
  222. package/src/hooks/use-collection-db.ts +0 -209
  223. package/src/hooks/use-collection.ts +0 -156
  224. package/src/hooks/use-global.ts +0 -69
  225. package/src/hooks/use-mobile.ts +0 -21
  226. package/src/lib/utils.ts +0 -6
  227. package/src/styles/index.css +0 -340
  228. package/src/utils/index.ts +0 -6
  229. package/src/views/auth/auth-layout.tsx +0 -77
  230. package/src/views/auth/forgot-password-form.tsx +0 -192
  231. package/src/views/auth/index.ts +0 -21
  232. package/src/views/auth/login-form.tsx +0 -229
  233. package/src/views/auth/reset-password-form.tsx +0 -232
  234. package/src/views/collection/auto-form-fields.tsx +0 -982
  235. package/src/views/collection/collection-form.tsx +0 -186
  236. package/src/views/collection/collection-list.tsx +0 -223
  237. package/src/views/collection/form-field.tsx +0 -52
  238. package/src/views/collection/index.ts +0 -15
  239. package/src/views/common/index.ts +0 -8
  240. package/src/views/common/locale-switcher.tsx +0 -45
  241. package/src/views/common/version-history.tsx +0 -406
  242. package/src/views/index.ts +0 -25
  243. package/src/views/layout/admin-layout.tsx +0 -117
  244. package/src/views/layout/admin-router.tsx +0 -206
  245. package/src/views/layout/admin-sidebar.tsx +0 -185
  246. package/src/views/layout/index.ts +0 -12
  247. package/tsconfig.json +0 -13
  248. package/tsconfig.tsbuildinfo +0 -1
  249. package/tsdown.config.ts +0 -13
  250. package/vitest.config.ts +0 -29
@@ -1,48 +0,0 @@
1
- "use client";
2
-
3
- import { jsx } from "react/jsx-runtime";
4
- import { cn } from "../../lib/utils";
5
- import { cva } from "class-variance-authority";
6
- import { Button as Button$1 } from "@base-ui/react/button";
7
-
8
- //#region src/components/ui/button.tsx
9
- const buttonVariants = cva("focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border border-transparent bg-clip-padding text-xs/relaxed font-medium focus-visible:ring-[2px] aria-invalid:ring-[2px] [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none", {
10
- variants: {
11
- variant: {
12
- default: "bg-primary text-primary-foreground hover:bg-primary/80",
13
- outline: "border-border dark:bg-input/30 hover:bg-input/50 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground",
14
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
15
- ghost: "hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",
16
- destructive: "bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",
17
- link: "text-primary underline-offset-4 hover:underline"
18
- },
19
- size: {
20
- default: "h-7 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
21
- xs: "h-5 gap-1 rounded-sm px-2 text-[0.625rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-2.5",
22
- sm: "h-6 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
23
- lg: "h-8 gap-1 px-2.5 text-xs/relaxed has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-4",
24
- icon: "size-7 [&_svg:not([class*='size-'])]:size-3.5",
25
- "icon-xs": "size-5 rounded-sm [&_svg:not([class*='size-'])]:size-2.5",
26
- "icon-sm": "size-6 [&_svg:not([class*='size-'])]:size-3",
27
- "icon-lg": "size-8 [&_svg:not([class*='size-'])]:size-4"
28
- }
29
- },
30
- defaultVariants: {
31
- variant: "default",
32
- size: "default"
33
- }
34
- });
35
- function Button({ className, variant = "default", size = "default", ...props }) {
36
- return /* @__PURE__ */ jsx(Button$1, {
37
- "data-slot": "button",
38
- className: cn(buttonVariants({
39
- variant,
40
- size,
41
- className
42
- })),
43
- ...props
44
- });
45
- }
46
-
47
- //#endregion
48
- export { Button, buttonVariants };
@@ -1,21 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { cn } from "../../lib/utils";
3
- import { CheckIcon } from "@phosphor-icons/react";
4
- import { Checkbox as Checkbox$1 } from "@base-ui/react/checkbox";
5
-
6
- //#region src/components/ui/checkbox.tsx
7
- function Checkbox({ className, ...props }) {
8
- return /* @__PURE__ */ jsx(Checkbox$1.Root, {
9
- "data-slot": "checkbox",
10
- className: cn("border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 flex size-4 items-center justify-center rounded-[4px] border transition-shadow group-has-disabled/field:opacity-50 focus-visible:ring-[2px] aria-invalid:ring-[2px] peer relative shrink-0 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50", className),
11
- ...props,
12
- children: /* @__PURE__ */ jsx(Checkbox$1.Indicator, {
13
- "data-slot": "checkbox-indicator",
14
- className: "[&>svg]:size-3.5 grid place-content-center text-current transition-none",
15
- children: /* @__PURE__ */ jsx(CheckIcon, {})
16
- })
17
- });
18
- }
19
-
20
- //#endregion
21
- export { Checkbox };
@@ -1,163 +0,0 @@
1
- import * as React$1 from "react";
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
- import { Button } from "./button";
4
- import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "./input-group";
5
- import { cn } from "../../lib/utils";
6
- import { CaretDownIcon, CheckIcon, XIcon } from "@phosphor-icons/react";
7
- import { Combobox as Combobox$1 } from "@base-ui/react";
8
-
9
- //#region src/components/ui/combobox.tsx
10
- const Combobox = Combobox$1.Root;
11
- function ComboboxValue({ ...props }) {
12
- return /* @__PURE__ */ jsx(Combobox$1.Value, {
13
- "data-slot": "combobox-value",
14
- ...props
15
- });
16
- }
17
- function ComboboxTrigger({ className, children, ...props }) {
18
- return /* @__PURE__ */ jsxs(Combobox$1.Trigger, {
19
- "data-slot": "combobox-trigger",
20
- className: cn("[&_svg:not([class*='size-'])]:size-3.5", className),
21
- ...props,
22
- children: [children, /* @__PURE__ */ jsx(CaretDownIcon, { className: "text-muted-foreground size-3.5 pointer-events-none" })]
23
- });
24
- }
25
- function ComboboxClear({ className, ...props }) {
26
- return /* @__PURE__ */ jsx(Combobox$1.Clear, {
27
- "data-slot": "combobox-clear",
28
- render: /* @__PURE__ */ jsx(InputGroupButton, {
29
- variant: "ghost",
30
- size: "icon-xs"
31
- }),
32
- className: cn(className),
33
- ...props,
34
- children: /* @__PURE__ */ jsx(XIcon, { className: "pointer-events-none" })
35
- });
36
- }
37
- function ComboboxInput({ className, children, disabled = false, showTrigger = true, showClear = false, ...props }) {
38
- return /* @__PURE__ */ jsxs(InputGroup, {
39
- className: cn("w-auto", className),
40
- children: [
41
- /* @__PURE__ */ jsx(Combobox$1.Input, {
42
- render: /* @__PURE__ */ jsx(InputGroupInput, { disabled }),
43
- ...props
44
- }),
45
- /* @__PURE__ */ jsxs(InputGroupAddon, {
46
- align: "inline-end",
47
- children: [showTrigger && /* @__PURE__ */ jsx(InputGroupButton, {
48
- size: "icon-xs",
49
- variant: "ghost",
50
- render: /* @__PURE__ */ jsx(ComboboxTrigger, {}),
51
- "data-slot": "input-group-button",
52
- className: "group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent",
53
- disabled
54
- }), showClear && /* @__PURE__ */ jsx(ComboboxClear, { disabled })]
55
- }),
56
- children
57
- ]
58
- });
59
- }
60
- function ComboboxContent({ className, side = "bottom", sideOffset = 6, align = "start", alignOffset = 0, anchor, ...props }) {
61
- return /* @__PURE__ */ jsx(Combobox$1.Portal, { children: /* @__PURE__ */ jsx(Combobox$1.Positioner, {
62
- side,
63
- sideOffset,
64
- align,
65
- alignOffset,
66
- anchor,
67
- className: "isolate z-50",
68
- children: /* @__PURE__ */ jsx(Combobox$1.Popup, {
69
- "data-slot": "combobox-content",
70
- "data-chips": !!anchor,
71
- className: cn("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 *:data-[slot=input-group]:bg-input/20 dark:bg-popover max-h-72 min-w-32 overflow-hidden rounded-lg shadow-md ring-1 duration-100 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-7 *:data-[slot=input-group]:border-none *:data-[slot=input-group]:shadow-none group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) data-[chips=true]:min-w-(--anchor-width)", className),
72
- ...props
73
- })
74
- }) });
75
- }
76
- function ComboboxList({ className, ...props }) {
77
- return /* @__PURE__ */ jsx(Combobox$1.List, {
78
- "data-slot": "combobox-list",
79
- className: cn("no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto p-1 data-empty:p-0 overflow-y-auto overscroll-contain", className),
80
- ...props
81
- });
82
- }
83
- function ComboboxItem({ className, children, ...props }) {
84
- return /* @__PURE__ */ jsxs(Combobox$1.Item, {
85
- "data-slot": "combobox-item",
86
- className: cn("data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", className),
87
- ...props,
88
- children: [children, /* @__PURE__ */ jsx(Combobox$1.ItemIndicator, {
89
- render: /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute right-2 flex items-center justify-center" }),
90
- children: /* @__PURE__ */ jsx(CheckIcon, { className: "pointer-events-none" })
91
- })]
92
- });
93
- }
94
- function ComboboxGroup({ className, ...props }) {
95
- return /* @__PURE__ */ jsx(Combobox$1.Group, {
96
- "data-slot": "combobox-group",
97
- className: cn(className),
98
- ...props
99
- });
100
- }
101
- function ComboboxLabel({ className, ...props }) {
102
- return /* @__PURE__ */ jsx(Combobox$1.GroupLabel, {
103
- "data-slot": "combobox-label",
104
- className: cn("text-muted-foreground px-2 py-1.5 text-xs", className),
105
- ...props
106
- });
107
- }
108
- function ComboboxCollection({ ...props }) {
109
- return /* @__PURE__ */ jsx(Combobox$1.Collection, {
110
- "data-slot": "combobox-collection",
111
- ...props
112
- });
113
- }
114
- function ComboboxEmpty({ className, ...props }) {
115
- return /* @__PURE__ */ jsx(Combobox$1.Empty, {
116
- "data-slot": "combobox-empty",
117
- className: cn("text-muted-foreground hidden w-full justify-center py-2 text-center text-xs/relaxed group-data-empty/combobox-content:flex", className),
118
- ...props
119
- });
120
- }
121
- function ComboboxSeparator({ className, ...props }) {
122
- return /* @__PURE__ */ jsx(Combobox$1.Separator, {
123
- "data-slot": "combobox-separator",
124
- className: cn("bg-border/50 -mx-1 my-1 h-px", className),
125
- ...props
126
- });
127
- }
128
- function ComboboxChips({ className, ...props }) {
129
- return /* @__PURE__ */ jsx(Combobox$1.Chips, {
130
- "data-slot": "combobox-chips",
131
- className: cn("bg-input/20 dark:bg-input/30 border-input focus-within:border-ring focus-within:ring-ring/30 has-aria-invalid:ring-destructive/20 dark:has-aria-invalid:ring-destructive/40 has-aria-invalid:border-destructive dark:has-aria-invalid:border-destructive/50 flex min-h-7 flex-wrap items-center gap-1 rounded-md border bg-clip-padding px-2 py-0.5 text-xs/relaxed transition-colors focus-within:ring-[2px] has-aria-invalid:ring-[2px] has-data-[slot=combobox-chip]:px-1", className),
132
- ...props
133
- });
134
- }
135
- function ComboboxChip({ className, children, showRemove = true, ...props }) {
136
- return /* @__PURE__ */ jsxs(Combobox$1.Chip, {
137
- "data-slot": "combobox-chip",
138
- className: cn("bg-muted-foreground/10 text-foreground flex h-[calc(--spacing(4.75))] w-fit items-center justify-center gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1.5 text-xs/relaxed font-medium whitespace-nowrap has-data-[slot=combobox-chip-remove]:pr-0 has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50", className),
139
- ...props,
140
- children: [children, showRemove && /* @__PURE__ */ jsx(Combobox$1.ChipRemove, {
141
- render: /* @__PURE__ */ jsx(Button, {
142
- variant: "ghost",
143
- size: "icon-xs"
144
- }),
145
- className: "-ml-1 opacity-50 hover:opacity-100",
146
- "data-slot": "combobox-chip-remove",
147
- children: /* @__PURE__ */ jsx(XIcon, { className: "pointer-events-none" })
148
- })]
149
- });
150
- }
151
- function ComboboxChipsInput({ className, ...props }) {
152
- return /* @__PURE__ */ jsx(Combobox$1.Input, {
153
- "data-slot": "combobox-chip-input",
154
- className: cn("min-w-16 flex-1 outline-none", className),
155
- ...props
156
- });
157
- }
158
- function useComboboxAnchor() {
159
- return React$1.useRef(null);
160
- }
161
-
162
- //#endregion
163
- export { Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, useComboboxAnchor };
@@ -1,95 +0,0 @@
1
- "use client";
2
-
3
- import "react";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
- import { Button } from "./button";
6
- import { cn } from "../../lib/utils";
7
- import { XIcon } from "@phosphor-icons/react";
8
- import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
9
-
10
- //#region src/components/ui/dialog.tsx
11
- function Dialog({ ...props }) {
12
- return /* @__PURE__ */ jsx(Dialog$1.Root, {
13
- "data-slot": "dialog",
14
- ...props
15
- });
16
- }
17
- function DialogTrigger({ ...props }) {
18
- return /* @__PURE__ */ jsx(Dialog$1.Trigger, {
19
- "data-slot": "dialog-trigger",
20
- ...props
21
- });
22
- }
23
- function DialogPortal({ ...props }) {
24
- return /* @__PURE__ */ jsx(Dialog$1.Portal, {
25
- "data-slot": "dialog-portal",
26
- ...props
27
- });
28
- }
29
- function DialogClose({ ...props }) {
30
- return /* @__PURE__ */ jsx(Dialog$1.Close, {
31
- "data-slot": "dialog-close",
32
- ...props
33
- });
34
- }
35
- function DialogOverlay({ className, ...props }) {
36
- return /* @__PURE__ */ jsx(Dialog$1.Backdrop, {
37
- "data-slot": "dialog-overlay",
38
- className: cn("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50", className),
39
- ...props
40
- });
41
- }
42
- function DialogContent({ className, children, showCloseButton = true, ...props }) {
43
- return /* @__PURE__ */ jsxs(DialogPortal, { children: [/* @__PURE__ */ jsx(DialogOverlay, {}), /* @__PURE__ */ jsxs(Dialog$1.Popup, {
44
- "data-slot": "dialog-content",
45
- className: cn("bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-xs/relaxed ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none", className),
46
- ...props,
47
- children: [children, showCloseButton && /* @__PURE__ */ jsxs(Dialog$1.Close, {
48
- "data-slot": "dialog-close",
49
- render: /* @__PURE__ */ jsx(Button, {
50
- variant: "ghost",
51
- className: "absolute top-2 right-2",
52
- size: "icon-sm"
53
- }),
54
- children: [/* @__PURE__ */ jsx(XIcon, {}), /* @__PURE__ */ jsx("span", {
55
- className: "sr-only",
56
- children: "Close"
57
- })]
58
- })]
59
- })] });
60
- }
61
- function DialogHeader({ className, ...props }) {
62
- return /* @__PURE__ */ jsx("div", {
63
- "data-slot": "dialog-header",
64
- className: cn("gap-1 flex flex-col", className),
65
- ...props
66
- });
67
- }
68
- function DialogFooter({ className, showCloseButton = false, children, ...props }) {
69
- return /* @__PURE__ */ jsxs("div", {
70
- "data-slot": "dialog-footer",
71
- className: cn("gap-2 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className),
72
- ...props,
73
- children: [children, showCloseButton && /* @__PURE__ */ jsx(Dialog$1.Close, {
74
- render: /* @__PURE__ */ jsx(Button, { variant: "outline" }),
75
- children: "Close"
76
- })]
77
- });
78
- }
79
- function DialogTitle({ className, ...props }) {
80
- return /* @__PURE__ */ jsx(Dialog$1.Title, {
81
- "data-slot": "dialog-title",
82
- className: cn("text-sm font-medium", className),
83
- ...props
84
- });
85
- }
86
- function DialogDescription({ className, ...props }) {
87
- return /* @__PURE__ */ jsx(Dialog$1.Description, {
88
- "data-slot": "dialog-description",
89
- className: cn("text-muted-foreground *:[a]:hover:text-foreground text-xs/relaxed *:[a]:underline *:[a]:underline-offset-3", className),
90
- ...props
91
- });
92
- }
93
-
94
- //#endregion
95
- export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
@@ -1,138 +0,0 @@
1
- "use client";
2
-
3
- import "react";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
- import { cn } from "../../lib/utils";
6
- import { CaretRightIcon, CheckIcon } from "@phosphor-icons/react";
7
- import { Menu } from "@base-ui/react/menu";
8
-
9
- //#region src/components/ui/dropdown-menu.tsx
10
- function DropdownMenu({ ...props }) {
11
- return /* @__PURE__ */ jsx(Menu.Root, {
12
- "data-slot": "dropdown-menu",
13
- ...props
14
- });
15
- }
16
- function DropdownMenuPortal({ ...props }) {
17
- return /* @__PURE__ */ jsx(Menu.Portal, {
18
- "data-slot": "dropdown-menu-portal",
19
- ...props
20
- });
21
- }
22
- function DropdownMenuTrigger({ ...props }) {
23
- return /* @__PURE__ */ jsx(Menu.Trigger, {
24
- "data-slot": "dropdown-menu-trigger",
25
- ...props
26
- });
27
- }
28
- function DropdownMenuContent({ align = "start", alignOffset = 0, side = "bottom", sideOffset = 4, className, ...props }) {
29
- return /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, {
30
- className: "isolate z-50 outline-none",
31
- align,
32
- alignOffset,
33
- side,
34
- sideOffset,
35
- children: /* @__PURE__ */ jsx(Menu.Popup, {
36
- "data-slot": "dropdown-menu-content",
37
- className: cn("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto outline-none data-closed:overflow-hidden", className),
38
- ...props
39
- })
40
- }) });
41
- }
42
- function DropdownMenuGroup({ ...props }) {
43
- return /* @__PURE__ */ jsx(Menu.Group, {
44
- "data-slot": "dropdown-menu-group",
45
- ...props
46
- });
47
- }
48
- function DropdownMenuLabel({ className, inset, ...props }) {
49
- return /* @__PURE__ */ jsx(Menu.GroupLabel, {
50
- "data-slot": "dropdown-menu-label",
51
- "data-inset": inset,
52
- className: cn("text-muted-foreground px-2 py-1.5 text-xs data-[inset]:pl-8", className),
53
- ...props
54
- });
55
- }
56
- function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
57
- return /* @__PURE__ */ jsx(Menu.Item, {
58
- "data-slot": "dropdown-menu-item",
59
- "data-inset": inset,
60
- "data-variant": variant,
61
- className: cn("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 not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0", className),
62
- ...props
63
- });
64
- }
65
- function DropdownMenuSub({ ...props }) {
66
- return /* @__PURE__ */ jsx(Menu.SubmenuRoot, {
67
- "data-slot": "dropdown-menu-sub",
68
- ...props
69
- });
70
- }
71
- function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
72
- return /* @__PURE__ */ jsxs(Menu.SubmenuTrigger, {
73
- "data-slot": "dropdown-menu-sub-trigger",
74
- "data-inset": inset,
75
- className: cn("focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs [&_svg:not([class*='size-'])]:size-3.5 flex cursor-default items-center outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0", className),
76
- ...props,
77
- children: [children, /* @__PURE__ */ jsx(CaretRightIcon, { className: "ml-auto" })]
78
- });
79
- }
80
- function DropdownMenuSubContent({ align = "start", alignOffset = -3, side = "right", sideOffset = 0, className, ...props }) {
81
- return /* @__PURE__ */ jsx(DropdownMenuContent, {
82
- "data-slot": "dropdown-menu-sub-content",
83
- className: cn("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 w-auto", className),
84
- align,
85
- alignOffset,
86
- side,
87
- sideOffset,
88
- ...props
89
- });
90
- }
91
- function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
92
- return /* @__PURE__ */ jsxs(Menu.CheckboxItem, {
93
- "data-slot": "dropdown-menu-checkbox-item",
94
- className: cn("focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground min-h-7 gap-2 rounded-md py-1.5 pr-8 pl-2 text-xs [&_svg:not([class*='size-'])]:size-3.5 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", className),
95
- checked,
96
- ...props,
97
- children: [/* @__PURE__ */ jsx("span", {
98
- className: "pointer-events-none absolute right-2 flex items-center justify-center pointer-events-none",
99
- "data-slot": "dropdown-menu-checkbox-item-indicator",
100
- children: /* @__PURE__ */ jsx(Menu.CheckboxItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) })
101
- }), children]
102
- });
103
- }
104
- function DropdownMenuRadioGroup({ ...props }) {
105
- return /* @__PURE__ */ jsx(Menu.RadioGroup, {
106
- "data-slot": "dropdown-menu-radio-group",
107
- ...props
108
- });
109
- }
110
- function DropdownMenuRadioItem({ className, children, ...props }) {
111
- return /* @__PURE__ */ jsxs(Menu.RadioItem, {
112
- "data-slot": "dropdown-menu-radio-item",
113
- className: cn("focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground min-h-7 gap-2 rounded-md py-1.5 pr-8 pl-2 text-xs [&_svg:not([class*='size-'])]:size-3.5 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", className),
114
- ...props,
115
- children: [/* @__PURE__ */ jsx("span", {
116
- className: "pointer-events-none absolute right-2 flex items-center justify-center pointer-events-none",
117
- "data-slot": "dropdown-menu-radio-item-indicator",
118
- children: /* @__PURE__ */ jsx(Menu.RadioItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) })
119
- }), children]
120
- });
121
- }
122
- function DropdownMenuSeparator({ className, ...props }) {
123
- return /* @__PURE__ */ jsx(Menu.Separator, {
124
- "data-slot": "dropdown-menu-separator",
125
- className: cn("bg-border/50 -mx-1 my-1 h-px", className),
126
- ...props
127
- });
128
- }
129
- function DropdownMenuShortcut({ className, ...props }) {
130
- return /* @__PURE__ */ jsx("span", {
131
- "data-slot": "dropdown-menu-shortcut",
132
- className: cn("text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground ml-auto text-[0.625rem] tracking-widest", className),
133
- ...props
134
- });
135
- }
136
-
137
- //#endregion
138
- export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
@@ -1,113 +0,0 @@
1
- "use client";
2
-
3
- import { useMemo } from "react";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
- import { Label } from "./label";
6
- import { Separator } from "./separator";
7
- import { cn } from "../../lib/utils";
8
- import { cva } from "class-variance-authority";
9
-
10
- //#region src/components/ui/field.tsx
11
- function FieldSet({ className, ...props }) {
12
- return /* @__PURE__ */ jsx("fieldset", {
13
- "data-slot": "field-set",
14
- className: cn("gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3 flex flex-col", className),
15
- ...props
16
- });
17
- }
18
- function FieldLegend({ className, variant = "legend", ...props }) {
19
- return /* @__PURE__ */ jsx("legend", {
20
- "data-slot": "field-legend",
21
- "data-variant": variant,
22
- className: cn("mb-2 font-medium data-[variant=label]:text-xs/relaxed data-[variant=legend]:text-sm", className),
23
- ...props
24
- });
25
- }
26
- function FieldGroup({ className, ...props }) {
27
- return /* @__PURE__ */ jsx("div", {
28
- "data-slot": "field-group",
29
- className: cn("gap-4 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4 group/field-group @container/field-group flex w-full flex-col", className),
30
- ...props
31
- });
32
- }
33
- const fieldVariants = cva("data-[invalid=true]:text-destructive gap-2 group/field flex w-full", {
34
- variants: { orientation: {
35
- vertical: "flex-col [&>*]:w-full [&>.sr-only]:w-auto",
36
- horizontal: "flex-row items-center [&>[data-slot=field-label]]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
37
- responsive: "flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto @md/field-group:[&>[data-slot=field-label]]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
38
- } },
39
- defaultVariants: { orientation: "vertical" }
40
- });
41
- function Field({ className, orientation = "vertical", ...props }) {
42
- return /* @__PURE__ */ jsx("div", {
43
- role: "group",
44
- "data-slot": "field",
45
- "data-orientation": orientation,
46
- className: cn(fieldVariants({ orientation }), className),
47
- ...props
48
- });
49
- }
50
- function FieldContent({ className, ...props }) {
51
- return /* @__PURE__ */ jsx("div", {
52
- "data-slot": "field-content",
53
- className: cn("gap-0.5 group/field-content flex flex-1 flex-col leading-snug", className),
54
- ...props
55
- });
56
- }
57
- function FieldLabel({ className, ...props }) {
58
- return /* @__PURE__ */ jsx(Label, {
59
- "data-slot": "field-label",
60
- className: cn("has-data-checked:bg-primary/5 dark:has-data-checked:bg-primary/10 gap-2 group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-2 group/field-label peer/field-label flex w-fit leading-snug", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col", className),
61
- ...props
62
- });
63
- }
64
- function FieldTitle({ className, ...props }) {
65
- return /* @__PURE__ */ jsx("div", {
66
- "data-slot": "field-label",
67
- className: cn("gap-2 text-xs/relaxed font-medium group-data-[disabled=true]/field:opacity-50 flex w-fit items-center leading-snug", className),
68
- ...props
69
- });
70
- }
71
- function FieldDescription({ className, ...props }) {
72
- return /* @__PURE__ */ jsx("p", {
73
- "data-slot": "field-description",
74
- className: cn("text-muted-foreground text-left text-xs/relaxed [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance", "last:mt-0 nth-last-2:-mt-1", "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4", className),
75
- ...props
76
- });
77
- }
78
- function FieldSeparator({ children, className, ...props }) {
79
- return /* @__PURE__ */ jsxs("div", {
80
- "data-slot": "field-separator",
81
- "data-content": !!children,
82
- className: cn("-my-2 h-5 text-xs/relaxed group-data-[variant=outline]/field-group:-mb-2 relative", className),
83
- ...props,
84
- children: [/* @__PURE__ */ jsx(Separator, { className: "absolute inset-0 top-1/2" }), children && /* @__PURE__ */ jsx("span", {
85
- className: "text-muted-foreground px-2 bg-background relative mx-auto block w-fit",
86
- "data-slot": "field-separator-content",
87
- children
88
- })]
89
- });
90
- }
91
- function FieldError({ className, children, errors, ...props }) {
92
- const content = useMemo(() => {
93
- if (children) return children;
94
- if (!errors?.length) return null;
95
- const uniqueErrors = [...new Map(errors.map((error) => [error?.message, error])).values()];
96
- if (uniqueErrors?.length == 1) return uniqueErrors[0]?.message;
97
- return /* @__PURE__ */ jsx("ul", {
98
- className: "ml-4 flex list-disc flex-col gap-1",
99
- children: uniqueErrors.map((error, index) => error?.message && /* @__PURE__ */ jsx("li", { children: error.message }, index))
100
- });
101
- }, [children, errors]);
102
- if (!content) return null;
103
- return /* @__PURE__ */ jsx("div", {
104
- role: "alert",
105
- "data-slot": "field-error",
106
- className: cn("text-destructive text-xs/relaxed font-normal", className),
107
- ...props,
108
- children: content
109
- });
110
- }
111
-
112
- //#endregion
113
- export { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle };