@btst/plugin-cms 0.0.0-stage → 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 (204) hide show
  1. package/LICENSE.md +17 -0
  2. package/dist/api/getters.cjs +328 -0
  3. package/dist/api/getters.mjs +314 -0
  4. package/dist/api/index.cjs +29 -0
  5. package/dist/api/index.d.cts +209 -0
  6. package/dist/api/index.d.mts +209 -0
  7. package/dist/api/index.d.ts +209 -0
  8. package/dist/api/index.mjs +7 -0
  9. package/dist/api/lifecycle-migrations.cjs +13 -0
  10. package/dist/api/lifecycle-migrations.mjs +11 -0
  11. package/dist/api/mutations.cjs +59 -0
  12. package/dist/api/mutations.mjs +57 -0
  13. package/dist/api/operations.cjs +1769 -0
  14. package/dist/api/operations.mjs +1762 -0
  15. package/dist/api/plugin.cjs +337 -0
  16. package/dist/api/plugin.mjs +331 -0
  17. package/dist/api/query-key-defs.cjs +44 -0
  18. package/dist/api/query-key-defs.mjs +39 -0
  19. package/dist/api/relations.cjs +76 -0
  20. package/dist/api/relations.mjs +70 -0
  21. package/dist/client/components/forms/content-form.cjs +286 -0
  22. package/dist/client/components/forms/content-form.mjs +284 -0
  23. package/dist/client/components/forms/file-upload.cjs +160 -0
  24. package/dist/client/components/forms/file-upload.mjs +158 -0
  25. package/dist/client/components/forms/relation-field.cjs +237 -0
  26. package/dist/client/components/forms/relation-field.mjs +235 -0
  27. package/dist/client/components/index.cjs +14 -0
  28. package/dist/client/components/index.d.cts +20 -0
  29. package/dist/client/components/index.d.mts +20 -0
  30. package/dist/client/components/index.d.ts +20 -0
  31. package/dist/client/components/index.mjs +10 -0
  32. package/dist/client/components/inverse-relations-panel.cjs +272 -0
  33. package/dist/client/components/inverse-relations-panel.mjs +270 -0
  34. package/dist/client/components/loading/dashboard-skeleton.cjs +18 -0
  35. package/dist/client/components/loading/dashboard-skeleton.mjs +16 -0
  36. package/dist/client/components/loading/editor-skeleton.cjs +32 -0
  37. package/dist/client/components/loading/editor-skeleton.mjs +30 -0
  38. package/dist/client/components/loading/list-skeleton.cjs +32 -0
  39. package/dist/client/components/loading/list-skeleton.mjs +30 -0
  40. package/dist/client/components/pages/404-page.cjs +26 -0
  41. package/dist/client/components/pages/404-page.mjs +24 -0
  42. package/dist/client/components/pages/content-editor-page.cjs +84 -0
  43. package/dist/client/components/pages/content-editor-page.internal.cjs +170 -0
  44. package/dist/client/components/pages/content-editor-page.internal.mjs +168 -0
  45. package/dist/client/components/pages/content-editor-page.mjs +82 -0
  46. package/dist/client/components/pages/content-list-page.cjs +49 -0
  47. package/dist/client/components/pages/content-list-page.internal.cjs +334 -0
  48. package/dist/client/components/pages/content-list-page.internal.mjs +332 -0
  49. package/dist/client/components/pages/content-list-page.mjs +47 -0
  50. package/dist/client/components/pages/dashboard-page.cjs +42 -0
  51. package/dist/client/components/pages/dashboard-page.internal.cjs +102 -0
  52. package/dist/client/components/pages/dashboard-page.internal.mjs +100 -0
  53. package/dist/client/components/pages/dashboard-page.mjs +40 -0
  54. package/dist/client/components/shared/default-error.cjs +17 -0
  55. package/dist/client/components/shared/default-error.mjs +15 -0
  56. package/dist/client/components/shared/empty-state.cjs +16 -0
  57. package/dist/client/components/shared/empty-state.mjs +14 -0
  58. package/dist/client/components/shared/page-wrapper.cjs +29 -0
  59. package/dist/client/components/shared/page-wrapper.mjs +27 -0
  60. package/dist/client/constants.cjs +5 -0
  61. package/dist/client/constants.mjs +3 -0
  62. package/dist/client/hooks/cms-hooks.cjs +300 -0
  63. package/dist/client/hooks/cms-hooks.mjs +280 -0
  64. package/dist/client/hooks/cms-resource.cjs +13 -0
  65. package/dist/client/hooks/cms-resource.mjs +11 -0
  66. package/dist/client/hooks/index.cjs +25 -0
  67. package/dist/client/hooks/index.d.cts +693 -0
  68. package/dist/client/hooks/index.d.mts +693 -0
  69. package/dist/client/hooks/index.d.ts +693 -0
  70. package/dist/client/hooks/index.mjs +1 -0
  71. package/dist/client/index.cjs +15 -0
  72. package/dist/client/index.d.cts +654 -0
  73. package/dist/client/index.d.mts +654 -0
  74. package/dist/client/index.d.ts +654 -0
  75. package/dist/client/index.mjs +3 -0
  76. package/dist/client/overrides.cjs +26 -0
  77. package/dist/client/overrides.mjs +24 -0
  78. package/dist/client/plugin.cjs +316 -0
  79. package/dist/client/plugin.mjs +314 -0
  80. package/dist/client.css +3 -0
  81. package/dist/db.cjs +118 -0
  82. package/dist/db.mjs +116 -0
  83. package/dist/permissions.cjs +46 -0
  84. package/dist/permissions.d.cts +42 -0
  85. package/dist/permissions.d.mts +42 -0
  86. package/dist/permissions.d.ts +42 -0
  87. package/dist/permissions.mjs +44 -0
  88. package/dist/query-keys.cjs +229 -0
  89. package/dist/query-keys.d.cts +8 -0
  90. package/dist/query-keys.d.mts +8 -0
  91. package/dist/query-keys.d.ts +8 -0
  92. package/dist/query-keys.mjs +225 -0
  93. package/dist/schemas.cjs +81 -0
  94. package/dist/schemas.mjs +72 -0
  95. package/dist/shared/plugin-cms.BBshPRkb.d.cts +6 -0
  96. package/dist/shared/plugin-cms.BBshPRkb.d.mts +6 -0
  97. package/dist/shared/plugin-cms.BBshPRkb.d.ts +6 -0
  98. package/dist/shared/plugin-cms.DQLAoogy.d.ts +1749 -0
  99. package/dist/shared/plugin-cms.W4Le8D91.d.mts +1749 -0
  100. package/dist/shared/plugin-cms.c-GeWvTf.d.cts +1749 -0
  101. package/dist/style.css +6 -0
  102. package/dist/types.cjs +2 -0
  103. package/dist/types.d.cts +406 -0
  104. package/dist/types.d.mts +406 -0
  105. package/dist/types.d.ts +406 -0
  106. package/dist/types.mjs +1 -0
  107. package/dist/ui/src/components/accordion.cjs +81 -0
  108. package/dist/ui/src/components/accordion.mjs +62 -0
  109. package/dist/ui/src/components/alert-dialog.cjs +157 -0
  110. package/dist/ui/src/components/alert-dialog.mjs +132 -0
  111. package/dist/ui/src/components/auto-form/common/label.cjs +18 -0
  112. package/dist/ui/src/components/auto-form/common/label.mjs +16 -0
  113. package/dist/ui/src/components/auto-form/common/tooltip.cjs +9 -0
  114. package/dist/ui/src/components/auto-form/common/tooltip.mjs +7 -0
  115. package/dist/ui/src/components/auto-form/config.cjs +40 -0
  116. package/dist/ui/src/components/auto-form/config.mjs +37 -0
  117. package/dist/ui/src/components/auto-form/dependencies.cjs +48 -0
  118. package/dist/ui/src/components/auto-form/dependencies.mjs +46 -0
  119. package/dist/ui/src/components/auto-form/fields/array.cjs +266 -0
  120. package/dist/ui/src/components/auto-form/fields/array.mjs +264 -0
  121. package/dist/ui/src/components/auto-form/fields/checkbox.cjs +38 -0
  122. package/dist/ui/src/components/auto-form/fields/checkbox.mjs +36 -0
  123. package/dist/ui/src/components/auto-form/fields/date.cjs +67 -0
  124. package/dist/ui/src/components/auto-form/fields/date.mjs +65 -0
  125. package/dist/ui/src/components/auto-form/fields/enum.cjs +73 -0
  126. package/dist/ui/src/components/auto-form/fields/enum.mjs +71 -0
  127. package/dist/ui/src/components/auto-form/fields/input.cjs +32 -0
  128. package/dist/ui/src/components/auto-form/fields/input.mjs +30 -0
  129. package/dist/ui/src/components/auto-form/fields/number.cjs +31 -0
  130. package/dist/ui/src/components/auto-form/fields/number.mjs +29 -0
  131. package/dist/ui/src/components/auto-form/fields/object.cjs +233 -0
  132. package/dist/ui/src/components/auto-form/fields/object.mjs +217 -0
  133. package/dist/ui/src/components/auto-form/fields/radio-group.cjs +67 -0
  134. package/dist/ui/src/components/auto-form/fields/radio-group.mjs +65 -0
  135. package/dist/ui/src/components/auto-form/fields/switch.cjs +38 -0
  136. package/dist/ui/src/components/auto-form/fields/switch.mjs +36 -0
  137. package/dist/ui/src/components/auto-form/fields/textarea.cjs +31 -0
  138. package/dist/ui/src/components/auto-form/fields/textarea.mjs +29 -0
  139. package/dist/ui/src/components/auto-form/helpers.cjs +270 -0
  140. package/dist/ui/src/components/auto-form/helpers.mjs +259 -0
  141. package/dist/ui/src/components/auto-form/index.cjs +92 -0
  142. package/dist/ui/src/components/auto-form/index.mjs +86 -0
  143. package/dist/ui/src/components/auto-form/stepped-auto-form.cjs +374 -0
  144. package/dist/ui/src/components/auto-form/stepped-auto-form.mjs +368 -0
  145. package/dist/ui/src/components/auto-form/types.cjs +11 -0
  146. package/dist/ui/src/components/auto-form/types.mjs +9 -0
  147. package/dist/ui/src/components/badge.cjs +42 -0
  148. package/dist/ui/src/components/badge.mjs +39 -0
  149. package/dist/ui/src/components/button.cjs +56 -0
  150. package/dist/ui/src/components/button.mjs +53 -0
  151. package/dist/ui/src/components/calendar.cjs +207 -0
  152. package/dist/ui/src/components/calendar.mjs +190 -0
  153. package/dist/ui/src/components/card.cjs +56 -0
  154. package/dist/ui/src/components/card.mjs +51 -0
  155. package/dist/ui/src/components/checkbox.cjs +48 -0
  156. package/dist/ui/src/components/checkbox.mjs +32 -0
  157. package/dist/ui/src/components/command.cjs +78 -0
  158. package/dist/ui/src/components/command.mjs +73 -0
  159. package/dist/ui/src/components/date-picker.cjs +41 -0
  160. package/dist/ui/src/components/date-picker.mjs +39 -0
  161. package/dist/ui/src/components/dialog.cjs +119 -0
  162. package/dist/ui/src/components/dialog.mjs +97 -0
  163. package/dist/ui/src/components/form.cjs +120 -0
  164. package/dist/ui/src/components/form.mjs +98 -0
  165. package/dist/ui/src/components/input.cjs +23 -0
  166. package/dist/ui/src/components/input.mjs +21 -0
  167. package/dist/ui/src/components/label.cjs +39 -0
  168. package/dist/ui/src/components/label.mjs +23 -0
  169. package/dist/ui/src/components/multi-select.cjs +555 -0
  170. package/dist/ui/src/components/multi-select.mjs +540 -0
  171. package/dist/ui/src/components/page-layout.cjs +25 -0
  172. package/dist/ui/src/components/page-layout.mjs +23 -0
  173. package/dist/ui/src/components/page-wrapper.cjs +20 -0
  174. package/dist/ui/src/components/page-wrapper.mjs +18 -0
  175. package/dist/ui/src/components/popover.cjs +60 -0
  176. package/dist/ui/src/components/popover.mjs +42 -0
  177. package/dist/ui/src/components/radio-group.cjs +62 -0
  178. package/dist/ui/src/components/radio-group.mjs +45 -0
  179. package/dist/ui/src/components/select.cjs +161 -0
  180. package/dist/ui/src/components/select.mjs +139 -0
  181. package/dist/ui/src/components/separator.cjs +43 -0
  182. package/dist/ui/src/components/separator.mjs +27 -0
  183. package/dist/ui/src/components/skeleton.cjs +17 -0
  184. package/dist/ui/src/components/skeleton.mjs +15 -0
  185. package/dist/ui/src/components/stack-attribution.cjs +24 -0
  186. package/dist/ui/src/components/stack-attribution.mjs +22 -0
  187. package/dist/ui/src/components/switch.cjs +48 -0
  188. package/dist/ui/src/components/switch.mjs +32 -0
  189. package/dist/ui/src/components/table.cjs +89 -0
  190. package/dist/ui/src/components/table.mjs +82 -0
  191. package/dist/ui/src/components/textarea.cjs +20 -0
  192. package/dist/ui/src/components/textarea.mjs +18 -0
  193. package/dist/ui/src/hooks/use-debounce.cjs +16 -0
  194. package/dist/ui/src/hooks/use-debounce.mjs +14 -0
  195. package/dist/ui/src/hooks/use-route-lifecycle.cjs +31 -0
  196. package/dist/ui/src/hooks/use-route-lifecycle.mjs +29 -0
  197. package/dist/ui/src/lib/schema-converter.cjs +133 -0
  198. package/dist/ui/src/lib/schema-converter.mjs +127 -0
  199. package/dist/ui/src/lib/utils.cjs +10 -0
  200. package/dist/ui/src/lib/utils.mjs +8 -0
  201. package/dist/utils.cjs +19 -0
  202. package/dist/utils.mjs +12 -0
  203. package/package.json +170 -3
  204. package/README.md +0 -3
@@ -0,0 +1,73 @@
1
+ 'use client';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { Command as Command$1 } from 'cmdk';
4
+ import 'lucide-react';
5
+ import { cn } from '../lib/utils.mjs';
6
+ import '@radix-ui/react-dialog';
7
+
8
+ function Command({
9
+ className,
10
+ ...props
11
+ }) {
12
+ return /* @__PURE__ */ jsx(
13
+ Command$1,
14
+ {
15
+ "data-slot": "command",
16
+ className: cn(
17
+ "bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",
18
+ className
19
+ ),
20
+ ...props
21
+ }
22
+ );
23
+ }
24
+ function CommandList({
25
+ className,
26
+ ...props
27
+ }) {
28
+ return /* @__PURE__ */ jsx(
29
+ Command$1.List,
30
+ {
31
+ "data-slot": "command-list",
32
+ className: cn(
33
+ "max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
34
+ className
35
+ ),
36
+ ...props
37
+ }
38
+ );
39
+ }
40
+ function CommandGroup({
41
+ className,
42
+ ...props
43
+ }) {
44
+ return /* @__PURE__ */ jsx(
45
+ Command$1.Group,
46
+ {
47
+ "data-slot": "command-group",
48
+ className: cn(
49
+ "text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",
50
+ className
51
+ ),
52
+ ...props
53
+ }
54
+ );
55
+ }
56
+ function CommandItem({
57
+ className,
58
+ ...props
59
+ }) {
60
+ return /* @__PURE__ */ jsx(
61
+ Command$1.Item,
62
+ {
63
+ "data-slot": "command-item",
64
+ className: cn(
65
+ "data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground pointer-events-auto relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled='true']:pointer-events-none data-[disabled='true']:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
66
+ className
67
+ ),
68
+ ...props
69
+ }
70
+ );
71
+ }
72
+
73
+ export { Command, CommandGroup, CommandItem, CommandList };
@@ -0,0 +1,41 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ const jsxRuntime = require('react/jsx-runtime');
5
+ const dateFns = require('date-fns');
6
+ const lucideReact = require('lucide-react');
7
+ const utils = require('../lib/utils.cjs');
8
+ const button = require('./button.cjs');
9
+ const calendar = require('./calendar.cjs');
10
+ const popover = require('./popover.cjs');
11
+ const React = require('react');
12
+
13
+ const DatePicker = React.forwardRef(function DatePickerCmp({ date, setDate }, ref) {
14
+ return /* @__PURE__ */ jsxRuntime.jsxs(popover.Popover, { children: [
15
+ /* @__PURE__ */ jsxRuntime.jsx(popover.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
16
+ button.Button,
17
+ {
18
+ variant: "outline",
19
+ className: utils.cn(
20
+ "w-full justify-start text-left font-normal",
21
+ !date && "text-muted-foreground"
22
+ ),
23
+ children: [
24
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Calendar, { className: "mr-2 h-4 w-4" }),
25
+ date ? dateFns.format(date, "PPP") : /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Pick a date" })
26
+ ]
27
+ }
28
+ ) }),
29
+ /* @__PURE__ */ jsxRuntime.jsx(popover.PopoverContent, { className: "w-auto p-0", ref, children: /* @__PURE__ */ jsxRuntime.jsx(
30
+ calendar.Calendar,
31
+ {
32
+ mode: "single",
33
+ selected: date,
34
+ onSelect: setDate,
35
+ autoFocus: true
36
+ }
37
+ ) })
38
+ ] });
39
+ });
40
+
41
+ exports.DatePicker = DatePicker;
@@ -0,0 +1,39 @@
1
+ 'use client';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { format } from 'date-fns';
4
+ import { Calendar } from 'lucide-react';
5
+ import { cn } from '../lib/utils.mjs';
6
+ import { Button } from './button.mjs';
7
+ import { Calendar as Calendar$1 } from './calendar.mjs';
8
+ import { Popover, PopoverTrigger, PopoverContent } from './popover.mjs';
9
+ import { forwardRef } from 'react';
10
+
11
+ const DatePicker = forwardRef(function DatePickerCmp({ date, setDate }, ref) {
12
+ return /* @__PURE__ */ jsxs(Popover, { children: [
13
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
14
+ Button,
15
+ {
16
+ variant: "outline",
17
+ className: cn(
18
+ "w-full justify-start text-left font-normal",
19
+ !date && "text-muted-foreground"
20
+ ),
21
+ children: [
22
+ /* @__PURE__ */ jsx(Calendar, { className: "mr-2 h-4 w-4" }),
23
+ date ? format(date, "PPP") : /* @__PURE__ */ jsx("span", { children: "Pick a date" })
24
+ ]
25
+ }
26
+ ) }),
27
+ /* @__PURE__ */ jsx(PopoverContent, { className: "w-auto p-0", ref, children: /* @__PURE__ */ jsx(
28
+ Calendar$1,
29
+ {
30
+ mode: "single",
31
+ selected: date,
32
+ onSelect: setDate,
33
+ autoFocus: true
34
+ }
35
+ ) })
36
+ ] });
37
+ });
38
+
39
+ export { DatePicker };
@@ -0,0 +1,119 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ const jsxRuntime = require('react/jsx-runtime');
5
+ const DialogPrimitive = require('@radix-ui/react-dialog');
6
+ const lucideReact = require('lucide-react');
7
+ const utils = require('../lib/utils.cjs');
8
+
9
+ function _interopNamespaceCompat(e) {
10
+ if (e && typeof e === 'object' && 'default' in e) return e;
11
+ const n = Object.create(null);
12
+ if (e) {
13
+ for (const k in e) {
14
+ n[k] = e[k];
15
+ }
16
+ }
17
+ n.default = e;
18
+ return n;
19
+ }
20
+
21
+ const DialogPrimitive__namespace = /*#__PURE__*/_interopNamespaceCompat(DialogPrimitive);
22
+
23
+ function Dialog({
24
+ ...props
25
+ }) {
26
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { "data-slot": "dialog", ...props });
27
+ }
28
+ function DialogTrigger({
29
+ ...props
30
+ }) {
31
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Trigger, { "data-slot": "dialog-trigger", ...props });
32
+ }
33
+ function DialogPortal({
34
+ ...props
35
+ }) {
36
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Portal, { "data-slot": "dialog-portal", ...props });
37
+ }
38
+ function DialogOverlay({
39
+ className,
40
+ ...props
41
+ }) {
42
+ return /* @__PURE__ */ jsxRuntime.jsx(
43
+ DialogPrimitive__namespace.Overlay,
44
+ {
45
+ "data-slot": "dialog-overlay",
46
+ className: utils.cn(
47
+ "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",
48
+ className
49
+ ),
50
+ ...props
51
+ }
52
+ );
53
+ }
54
+ function DialogContent({
55
+ className,
56
+ children,
57
+ showCloseButton = true,
58
+ ...props
59
+ }) {
60
+ return /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [
61
+ /* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
62
+ /* @__PURE__ */ jsxRuntime.jsxs(
63
+ DialogPrimitive__namespace.Content,
64
+ {
65
+ "data-slot": "dialog-content",
66
+ className: utils.cn(
67
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",
68
+ className
69
+ ),
70
+ ...props,
71
+ children: [
72
+ children,
73
+ showCloseButton && /* @__PURE__ */ jsxRuntime.jsxs(
74
+ DialogPrimitive__namespace.Close,
75
+ {
76
+ "data-slot": "dialog-close",
77
+ className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground 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 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
78
+ children: [
79
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, {}),
80
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
81
+ ]
82
+ }
83
+ )
84
+ ]
85
+ }
86
+ )
87
+ ] });
88
+ }
89
+ function DialogHeader({ className, ...props }) {
90
+ return /* @__PURE__ */ jsxRuntime.jsx(
91
+ "div",
92
+ {
93
+ "data-slot": "dialog-header",
94
+ className: utils.cn("flex flex-col gap-2 text-center sm:text-left", className),
95
+ ...props
96
+ }
97
+ );
98
+ }
99
+ function DialogTitle({
100
+ className,
101
+ ...props
102
+ }) {
103
+ return /* @__PURE__ */ jsxRuntime.jsx(
104
+ DialogPrimitive__namespace.Title,
105
+ {
106
+ "data-slot": "dialog-title",
107
+ className: utils.cn("text-lg leading-none font-semibold", className),
108
+ ...props
109
+ }
110
+ );
111
+ }
112
+
113
+ exports.Dialog = Dialog;
114
+ exports.DialogContent = DialogContent;
115
+ exports.DialogHeader = DialogHeader;
116
+ exports.DialogOverlay = DialogOverlay;
117
+ exports.DialogPortal = DialogPortal;
118
+ exports.DialogTitle = DialogTitle;
119
+ exports.DialogTrigger = DialogTrigger;
@@ -0,0 +1,97 @@
1
+ 'use client';
2
+ import { jsx, jsxs } from 'react/jsx-runtime';
3
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
4
+ import { XIcon } from 'lucide-react';
5
+ import { cn } from '../lib/utils.mjs';
6
+
7
+ function Dialog({
8
+ ...props
9
+ }) {
10
+ return /* @__PURE__ */ jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
11
+ }
12
+ function DialogTrigger({
13
+ ...props
14
+ }) {
15
+ return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
16
+ }
17
+ function DialogPortal({
18
+ ...props
19
+ }) {
20
+ return /* @__PURE__ */ jsx(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
21
+ }
22
+ function DialogOverlay({
23
+ className,
24
+ ...props
25
+ }) {
26
+ return /* @__PURE__ */ jsx(
27
+ DialogPrimitive.Overlay,
28
+ {
29
+ "data-slot": "dialog-overlay",
30
+ className: cn(
31
+ "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",
32
+ className
33
+ ),
34
+ ...props
35
+ }
36
+ );
37
+ }
38
+ function DialogContent({
39
+ className,
40
+ children,
41
+ showCloseButton = true,
42
+ ...props
43
+ }) {
44
+ return /* @__PURE__ */ jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [
45
+ /* @__PURE__ */ jsx(DialogOverlay, {}),
46
+ /* @__PURE__ */ jsxs(
47
+ DialogPrimitive.Content,
48
+ {
49
+ "data-slot": "dialog-content",
50
+ className: cn(
51
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",
52
+ className
53
+ ),
54
+ ...props,
55
+ children: [
56
+ children,
57
+ showCloseButton && /* @__PURE__ */ jsxs(
58
+ DialogPrimitive.Close,
59
+ {
60
+ "data-slot": "dialog-close",
61
+ className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground 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 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
62
+ children: [
63
+ /* @__PURE__ */ jsx(XIcon, {}),
64
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
65
+ ]
66
+ }
67
+ )
68
+ ]
69
+ }
70
+ )
71
+ ] });
72
+ }
73
+ function DialogHeader({ className, ...props }) {
74
+ return /* @__PURE__ */ jsx(
75
+ "div",
76
+ {
77
+ "data-slot": "dialog-header",
78
+ className: cn("flex flex-col gap-2 text-center sm:text-left", className),
79
+ ...props
80
+ }
81
+ );
82
+ }
83
+ function DialogTitle({
84
+ className,
85
+ ...props
86
+ }) {
87
+ return /* @__PURE__ */ jsx(
88
+ DialogPrimitive.Title,
89
+ {
90
+ "data-slot": "dialog-title",
91
+ className: cn("text-lg leading-none font-semibold", className),
92
+ ...props
93
+ }
94
+ );
95
+ }
96
+
97
+ export { Dialog, DialogContent, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
@@ -0,0 +1,120 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ const jsxRuntime = require('react/jsx-runtime');
5
+ const React = require('react');
6
+ const reactSlot = require('@radix-ui/react-slot');
7
+ const reactHookForm = require('react-hook-form');
8
+ const utils = require('../lib/utils.cjs');
9
+ const label = require('./label.cjs');
10
+
11
+ function _interopNamespaceCompat(e) {
12
+ if (e && typeof e === 'object' && 'default' in e) return e;
13
+ const n = Object.create(null);
14
+ if (e) {
15
+ for (const k in e) {
16
+ n[k] = e[k];
17
+ }
18
+ }
19
+ n.default = e;
20
+ return n;
21
+ }
22
+
23
+ const React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);
24
+
25
+ const Form = reactHookForm.FormProvider;
26
+ const FormFieldContext = React__namespace.createContext(
27
+ {}
28
+ );
29
+ const FormField = ({
30
+ ...props
31
+ }) => {
32
+ return /* @__PURE__ */ jsxRuntime.jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsxRuntime.jsx(reactHookForm.Controller, { ...props }) });
33
+ };
34
+ const useFormField = () => {
35
+ const fieldContext = React__namespace.useContext(FormFieldContext);
36
+ const itemContext = React__namespace.useContext(FormItemContext);
37
+ const { getFieldState } = reactHookForm.useFormContext();
38
+ const formState = reactHookForm.useFormState({ name: fieldContext.name });
39
+ const fieldState = getFieldState(fieldContext.name, formState);
40
+ if (!fieldContext) {
41
+ throw new Error("useFormField should be used within <FormField>");
42
+ }
43
+ const { id } = itemContext;
44
+ return {
45
+ id,
46
+ name: fieldContext.name,
47
+ formItemId: `${id}-form-item`,
48
+ formDescriptionId: `${id}-form-item-description`,
49
+ formMessageId: `${id}-form-item-message`,
50
+ ...fieldState
51
+ };
52
+ };
53
+ const FormItemContext = React__namespace.createContext(
54
+ {}
55
+ );
56
+ function FormItem({ className, ...props }) {
57
+ const id = React__namespace.useId();
58
+ return /* @__PURE__ */ jsxRuntime.jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsxRuntime.jsx(
59
+ "div",
60
+ {
61
+ "data-slot": "form-item",
62
+ className: utils.cn("grid gap-2", className),
63
+ ...props
64
+ }
65
+ ) });
66
+ }
67
+ function FormLabel({
68
+ className,
69
+ ...props
70
+ }) {
71
+ const { error, formItemId } = useFormField();
72
+ return /* @__PURE__ */ jsxRuntime.jsx(
73
+ label.Label,
74
+ {
75
+ "data-slot": "form-label",
76
+ "data-error": !!error,
77
+ className: utils.cn("data-[error=true]:text-destructive", className),
78
+ htmlFor: formItemId,
79
+ ...props
80
+ }
81
+ );
82
+ }
83
+ function FormControl({ ...props }) {
84
+ const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
85
+ return /* @__PURE__ */ jsxRuntime.jsx(
86
+ reactSlot.Slot,
87
+ {
88
+ "data-slot": "form-control",
89
+ id: formItemId,
90
+ "aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
91
+ "aria-invalid": !!error,
92
+ ...props
93
+ }
94
+ );
95
+ }
96
+ function FormMessage({ className, ...props }) {
97
+ const { error, formMessageId } = useFormField();
98
+ const body = error ? String(error?.message ?? "") : props.children;
99
+ if (!body) {
100
+ return null;
101
+ }
102
+ return /* @__PURE__ */ jsxRuntime.jsx(
103
+ "p",
104
+ {
105
+ "data-slot": "form-message",
106
+ id: formMessageId,
107
+ className: utils.cn("text-destructive text-sm", className),
108
+ ...props,
109
+ children: body
110
+ }
111
+ );
112
+ }
113
+
114
+ exports.Form = Form;
115
+ exports.FormControl = FormControl;
116
+ exports.FormField = FormField;
117
+ exports.FormItem = FormItem;
118
+ exports.FormLabel = FormLabel;
119
+ exports.FormMessage = FormMessage;
120
+ exports.useFormField = useFormField;
@@ -0,0 +1,98 @@
1
+ 'use client';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import * as React from 'react';
4
+ import { Slot } from '@radix-ui/react-slot';
5
+ import { useFormContext, useFormState, FormProvider, Controller } from 'react-hook-form';
6
+ import { cn } from '../lib/utils.mjs';
7
+ import { Label } from './label.mjs';
8
+
9
+ const Form = FormProvider;
10
+ const FormFieldContext = React.createContext(
11
+ {}
12
+ );
13
+ const FormField = ({
14
+ ...props
15
+ }) => {
16
+ return /* @__PURE__ */ jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx(Controller, { ...props }) });
17
+ };
18
+ const useFormField = () => {
19
+ const fieldContext = React.useContext(FormFieldContext);
20
+ const itemContext = React.useContext(FormItemContext);
21
+ const { getFieldState } = useFormContext();
22
+ const formState = useFormState({ name: fieldContext.name });
23
+ const fieldState = getFieldState(fieldContext.name, formState);
24
+ if (!fieldContext) {
25
+ throw new Error("useFormField should be used within <FormField>");
26
+ }
27
+ const { id } = itemContext;
28
+ return {
29
+ id,
30
+ name: fieldContext.name,
31
+ formItemId: `${id}-form-item`,
32
+ formDescriptionId: `${id}-form-item-description`,
33
+ formMessageId: `${id}-form-item-message`,
34
+ ...fieldState
35
+ };
36
+ };
37
+ const FormItemContext = React.createContext(
38
+ {}
39
+ );
40
+ function FormItem({ className, ...props }) {
41
+ const id = React.useId();
42
+ return /* @__PURE__ */ jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx(
43
+ "div",
44
+ {
45
+ "data-slot": "form-item",
46
+ className: cn("grid gap-2", className),
47
+ ...props
48
+ }
49
+ ) });
50
+ }
51
+ function FormLabel({
52
+ className,
53
+ ...props
54
+ }) {
55
+ const { error, formItemId } = useFormField();
56
+ return /* @__PURE__ */ jsx(
57
+ Label,
58
+ {
59
+ "data-slot": "form-label",
60
+ "data-error": !!error,
61
+ className: cn("data-[error=true]:text-destructive", className),
62
+ htmlFor: formItemId,
63
+ ...props
64
+ }
65
+ );
66
+ }
67
+ function FormControl({ ...props }) {
68
+ const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
69
+ return /* @__PURE__ */ jsx(
70
+ Slot,
71
+ {
72
+ "data-slot": "form-control",
73
+ id: formItemId,
74
+ "aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
75
+ "aria-invalid": !!error,
76
+ ...props
77
+ }
78
+ );
79
+ }
80
+ function FormMessage({ className, ...props }) {
81
+ const { error, formMessageId } = useFormField();
82
+ const body = error ? String(error?.message ?? "") : props.children;
83
+ if (!body) {
84
+ return null;
85
+ }
86
+ return /* @__PURE__ */ jsx(
87
+ "p",
88
+ {
89
+ "data-slot": "form-message",
90
+ id: formMessageId,
91
+ className: cn("text-destructive text-sm", className),
92
+ ...props,
93
+ children: body
94
+ }
95
+ );
96
+ }
97
+
98
+ export { Form, FormControl, FormField, FormItem, FormLabel, FormMessage, useFormField };
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+
3
+ const jsxRuntime = require('react/jsx-runtime');
4
+ const utils = require('../lib/utils.cjs');
5
+
6
+ function Input({ className, type, ...props }) {
7
+ return /* @__PURE__ */ jsxRuntime.jsx(
8
+ "input",
9
+ {
10
+ type,
11
+ "data-slot": "input",
12
+ className: utils.cn(
13
+ "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
14
+ "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
15
+ "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
16
+ className
17
+ ),
18
+ ...props
19
+ }
20
+ );
21
+ }
22
+
23
+ exports.Input = Input;
@@ -0,0 +1,21 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { cn } from '../lib/utils.mjs';
3
+
4
+ function Input({ className, type, ...props }) {
5
+ return /* @__PURE__ */ jsx(
6
+ "input",
7
+ {
8
+ type,
9
+ "data-slot": "input",
10
+ className: cn(
11
+ "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
12
+ "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
13
+ "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
14
+ className
15
+ ),
16
+ ...props
17
+ }
18
+ );
19
+ }
20
+
21
+ export { Input };
@@ -0,0 +1,39 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ const jsxRuntime = require('react/jsx-runtime');
5
+ const LabelPrimitive = require('@radix-ui/react-label');
6
+ const utils = require('../lib/utils.cjs');
7
+
8
+ function _interopNamespaceCompat(e) {
9
+ if (e && typeof e === 'object' && 'default' in e) return e;
10
+ const n = Object.create(null);
11
+ if (e) {
12
+ for (const k in e) {
13
+ n[k] = e[k];
14
+ }
15
+ }
16
+ n.default = e;
17
+ return n;
18
+ }
19
+
20
+ const LabelPrimitive__namespace = /*#__PURE__*/_interopNamespaceCompat(LabelPrimitive);
21
+
22
+ function Label({
23
+ className,
24
+ ...props
25
+ }) {
26
+ return /* @__PURE__ */ jsxRuntime.jsx(
27
+ LabelPrimitive__namespace.Root,
28
+ {
29
+ "data-slot": "label",
30
+ className: utils.cn(
31
+ "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
32
+ className
33
+ ),
34
+ ...props
35
+ }
36
+ );
37
+ }
38
+
39
+ exports.Label = Label;