convex-cms 0.0.3 → 0.0.5-alpha.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 (142) hide show
  1. package/README.md +109 -13
  2. package/admin-dist/nitro.json +1 -1
  3. package/admin-dist/public/assets/{CmsEmptyState-CRswfTzk.js → CmsEmptyState-CiMQwSQV.js} +2 -2
  4. package/admin-dist/public/assets/{CmsPageHeader-CirpXndm.js → CmsPageHeader-ohOq0luT.js} +1 -1
  5. package/admin-dist/public/assets/{CmsStatusBadge-CbEUpQu-.js → CmsStatusBadge-BdNf0V9v.js} +1 -1
  6. package/admin-dist/public/assets/CmsSurface-CWup6Jh7.js +1 -0
  7. package/admin-dist/public/assets/{CmsToolbar-BI2nZOXp.js → CmsToolbar-cEBlCHa3.js} +1 -1
  8. package/admin-dist/public/assets/{ContentEntryEditor-CBeCyK_m.js → ContentEntryEditor-BY5ypfUs.js} +1 -1
  9. package/admin-dist/public/assets/{ErrorState-BIVaWmom.js → ErrorState-C4nJ-ml4.js} +1 -1
  10. package/admin-dist/public/assets/{TaxonomyFilter-ChaY6Y_x.js → TaxonomyFilter-BgE_SR_O.js} +1 -1
  11. package/admin-dist/public/assets/{_contentTypeId-DQ8k_Rvw.js → _contentTypeId-DtZectcC.js} +1 -1
  12. package/admin-dist/public/assets/{_entryId-CKU_glsK.js → _entryId-BpSmrfAm.js} +1 -1
  13. package/admin-dist/public/assets/alert-Bf2l8kxw.js +1 -0
  14. package/admin-dist/public/assets/{badge-hvUOzpVZ.js → badge-qPrc4AUM.js} +1 -1
  15. package/admin-dist/public/assets/{circle-check-big-CF_pR17r.js → circle-check-big-Dgozy3vV.js} +1 -1
  16. package/admin-dist/public/assets/{command-DU82cJlt.js → command-QOmNhlb0.js} +1 -1
  17. package/admin-dist/public/assets/content-OEBGlxg1.js +1 -0
  18. package/admin-dist/public/assets/content-types-CjQliqVV.js +2 -0
  19. package/admin-dist/public/assets/{globals-CS6BZ0zp.css → globals-hAmgC66w.css} +1 -1
  20. package/admin-dist/public/assets/index-BH_ECMhv.js +1 -0
  21. package/admin-dist/public/assets/{label-KNtpL71g.js → label-DCsUdvFh.js} +1 -1
  22. package/admin-dist/public/assets/{link-2-Bw2aI4V4.js → link-2-Czw1N61H.js} +1 -1
  23. package/admin-dist/public/assets/{list-sYepHjt_.js → list-DtCsXj8-.js} +1 -1
  24. package/admin-dist/public/assets/{main-CKj5yfEi.js → main-CXgkZMhe.js} +3 -3
  25. package/admin-dist/public/assets/{media-Bkrkffm7.js → media-DTJ3-ViE.js} +1 -1
  26. package/admin-dist/public/assets/{new._contentTypeId-C3LstjNs.js → new._contentTypeId-CoTDxKzf.js} +1 -1
  27. package/admin-dist/public/assets/{plus-DUn8v_Xf.js → plus-xCFJK0RC.js} +1 -1
  28. package/admin-dist/public/assets/{rotate-ccw-DJEoHcRI.js → rotate-ccw-DIqK63wY.js} +1 -1
  29. package/admin-dist/public/assets/scroll-area-B-yrE66a.js +1 -0
  30. package/admin-dist/public/assets/{search-MuAUDJKR.js → search-CbCbboeU.js} +1 -1
  31. package/admin-dist/public/assets/select-Co3TZFJb.js +1 -0
  32. package/admin-dist/public/assets/settings-BspTTv_o.js +1 -0
  33. package/admin-dist/public/assets/switch-CfavASmR.js +1 -0
  34. package/admin-dist/public/assets/tabs-CN5s5u2W.js +1 -0
  35. package/admin-dist/public/assets/tanstack-adapter-npeE3RdY.js +1 -0
  36. package/admin-dist/public/assets/taxonomies-CgG46fIF.js +1 -0
  37. package/admin-dist/public/assets/{textarea-BTy7nwzR.js → textarea-BJ0XFZpT.js} +1 -1
  38. package/admin-dist/public/assets/trash-B3daldm5.js +1 -0
  39. package/admin-dist/public/assets/{triangle-alert-E52Vfeuh.js → triangle-alert-BZRcqsUg.js} +1 -1
  40. package/admin-dist/public/assets/useBreadcrumbLabel-DwZlwvFF.js +1 -0
  41. package/admin-dist/public/assets/{usePermissions-Basjs9BT.js → usePermissions-C1JQhfqb.js} +1 -1
  42. package/admin-dist/server/_chunks/_libs/@tanstack/react-router.mjs +7 -0
  43. package/admin-dist/server/_ssr/{badge-6BsP37vG.mjs → CmsButton-B45JAKR1.mjs} +33 -33
  44. package/admin-dist/server/_ssr/{CmsEmptyState-DU7-7-mV.mjs → CmsEmptyState-D_BQFAVR.mjs} +2 -2
  45. package/admin-dist/server/_ssr/{CmsPageHeader-CseW0AHm.mjs → CmsPageHeader-CrUZA59A.mjs} +1 -1
  46. package/admin-dist/server/_ssr/{CmsStatusBadge-B_pi4KCp.mjs → CmsStatusBadge-B-sj6yaj.mjs} +2 -2
  47. package/admin-dist/server/_ssr/CmsSurface-DKJZhpjk.mjs +44 -0
  48. package/admin-dist/server/_ssr/{CmsToolbar-X75ex6ek.mjs → CmsToolbar-ByaW5iXf.mjs} +2 -2
  49. package/admin-dist/server/_ssr/{ContentEntryEditor-CepusRsA.mjs → ContentEntryEditor-D3_Jb1dq.mjs} +11 -11
  50. package/admin-dist/server/_ssr/{TaxonomyFilter-Bwrq0-cz.mjs → TaxonomyFilter-BRJkuCtA.mjs} +4 -4
  51. package/admin-dist/server/_ssr/{_contentTypeId-BqYKEcLr.mjs → _contentTypeId-B9kA6CaM.mjs} +11 -11
  52. package/admin-dist/server/_ssr/{_entryId-CRfnqeDf.mjs → _entryId-BddcMkZN.mjs} +14 -14
  53. package/admin-dist/server/_ssr/_tanstack-start-manifest_v-Dd7AmelK.mjs +4 -0
  54. package/admin-dist/server/_ssr/{command-fy8epIKf.mjs → command-CGtVr8Gb.mjs} +1 -1
  55. package/admin-dist/server/_ssr/{content-B5RhL7uW.mjs → content-D1tbeOd0.mjs} +201 -86
  56. package/admin-dist/server/_ssr/{content-types-BIOqCQYN.mjs → content-types-BZqY_BER.mjs} +279 -103
  57. package/admin-dist/server/_ssr/{index-DHSHDPt1.mjs → index-BIdq4xaC.mjs} +88 -17
  58. package/admin-dist/server/_ssr/index.mjs +2 -2
  59. package/admin-dist/server/_ssr/{label-C8Dko1j7.mjs → label-T-QNKAr6.mjs} +1 -1
  60. package/admin-dist/server/_ssr/{media-CSx3XttC.mjs → media-C-xqjBrl.mjs} +40 -40
  61. package/admin-dist/server/_ssr/{new._contentTypeId-DzanEZQM.mjs → new._contentTypeId-DWic9cRq.mjs} +13 -13
  62. package/admin-dist/server/_ssr/{router-DDWcF-kt.mjs → router-D1BMAMJT.mjs} +11 -11
  63. package/admin-dist/server/_ssr/{scroll-area-bjPYwhXN.mjs → scroll-area-C0pic_WA.mjs} +1 -1
  64. package/admin-dist/server/_ssr/{select-BUhDDf4T.mjs → select-CqmuN2F6.mjs} +1 -1
  65. package/admin-dist/server/_ssr/{settings-DAsxnw2q.mjs → settings-CAkncGGV.mjs} +211 -129
  66. package/admin-dist/server/_ssr/{switch-BgyRtQ1Z.mjs → switch-CgmuJkT9.mjs} +1 -1
  67. package/admin-dist/server/_ssr/{tabs-DzMdRB1A.mjs → tabs-CnMj0aRy.mjs} +5 -3
  68. package/admin-dist/server/_ssr/tanstack-adapter-BXZrMauE.mjs +119 -0
  69. package/admin-dist/server/_ssr/{taxonomies-C8j8g5Q5.mjs → taxonomies-thl3BfVm.mjs} +168 -68
  70. package/admin-dist/server/_ssr/{textarea-9jNeYJSc.mjs → textarea-4K5OJgeh.mjs} +1 -1
  71. package/admin-dist/server/_ssr/{trash-DYMxwhZB.mjs → trash-B40Gx5zP.mjs} +206 -86
  72. package/admin-dist/server/_ssr/{useBreadcrumbLabel-FNSAr2Ha.mjs → useBreadcrumbLabel-rn-fL4zV.mjs} +1 -1
  73. package/admin-dist/server/_ssr/{usePermissions-BJGGahrJ.mjs → usePermissions-CKeM6_Vw.mjs} +1 -1
  74. package/admin-dist/server/index.mjs +194 -180
  75. package/dist/cli/commands/init.d.ts +6 -0
  76. package/dist/cli/commands/init.d.ts.map +1 -0
  77. package/dist/cli/commands/init.js +156 -0
  78. package/dist/cli/commands/init.js.map +1 -0
  79. package/dist/cli/index.js +6 -0
  80. package/dist/cli/index.js.map +1 -1
  81. package/dist/client/admin-config.d.ts +2 -2
  82. package/dist/client/admin-config.js +2 -2
  83. package/dist/client/adminApi.d.ts +1877 -1851
  84. package/dist/client/adminApi.d.ts.map +1 -1
  85. package/dist/client/adminApi.js +649 -629
  86. package/dist/client/adminApi.js.map +1 -1
  87. package/dist/client/agentTools.d.ts +7 -17
  88. package/dist/client/agentTools.d.ts.map +1 -1
  89. package/dist/client/agentTools.js +4 -4
  90. package/dist/client/index.d.ts +4 -4
  91. package/dist/client/index.d.ts.map +1 -1
  92. package/dist/client/index.js +4 -4
  93. package/dist/client/index.js.map +1 -1
  94. package/dist/client/schema/codegen.d.ts +2 -2
  95. package/dist/client/schema/codegen.d.ts.map +1 -1
  96. package/dist/client/schema/codegen.js +3 -3
  97. package/dist/client/schema/codegen.js.map +1 -1
  98. package/dist/client/schema/defineContentType.d.ts +3 -3
  99. package/dist/client/schema/defineContentType.js +3 -3
  100. package/dist/client/schema/index.d.ts +7 -7
  101. package/dist/client/schema/index.d.ts.map +1 -1
  102. package/dist/client/schema/index.js +5 -5
  103. package/dist/client/schema/index.js.map +1 -1
  104. package/dist/client/schema/schemaDrift.d.ts +1 -1
  105. package/dist/client/schema/schemaDrift.js +1 -1
  106. package/dist/client/schema/typedClient.d.ts +2 -2
  107. package/dist/client/schema/typedClient.js +2 -2
  108. package/dist/client/schema/types.d.ts +1 -1
  109. package/dist/client/schema/types.js +1 -1
  110. package/dist/client/wrapper.d.ts +108 -65
  111. package/dist/client/wrapper.d.ts.map +1 -1
  112. package/dist/client/wrapper.js +22 -22
  113. package/dist/client/wrapper.js.map +1 -1
  114. package/dist/component/convex.config.d.ts +2 -2
  115. package/dist/component/convex.config.js +2 -2
  116. package/dist/component/index.d.ts +1 -1
  117. package/dist/component/index.js +1 -1
  118. package/dist/component/lib/ragContentChunker.d.ts +1 -1
  119. package/dist/component/lib/ragContentChunker.js +1 -1
  120. package/dist/component/roles.d.ts +1 -1
  121. package/dist/component/roles.js +1 -1
  122. package/dist/react/index.d.ts +2 -2
  123. package/dist/react/index.d.ts.map +1 -1
  124. package/dist/react/index.js +13 -7
  125. package/dist/react/index.js.map +1 -1
  126. package/dist/test.d.ts +2 -2
  127. package/dist/test.js +2 -2
  128. package/package.json +31 -11
  129. package/admin-dist/public/assets/alert-BXjTqrwQ.js +0 -1
  130. package/admin-dist/public/assets/content-_LXl3pp7.js +0 -1
  131. package/admin-dist/public/assets/content-types-KjxaXGxY.js +0 -2
  132. package/admin-dist/public/assets/index-DNGIZHL-.js +0 -1
  133. package/admin-dist/public/assets/scroll-area-DfIlT0in.js +0 -1
  134. package/admin-dist/public/assets/select-BD29IXCI.js +0 -1
  135. package/admin-dist/public/assets/settings-DmMyn_6A.js +0 -1
  136. package/admin-dist/public/assets/switch-h3Rrnl5i.js +0 -1
  137. package/admin-dist/public/assets/tabs-imc8h-Dp.js +0 -1
  138. package/admin-dist/public/assets/taxonomies-dAsrT65H.js +0 -1
  139. package/admin-dist/public/assets/trash-SAWKZZHv.js +0 -1
  140. package/admin-dist/public/assets/useBreadcrumbLabel-BECBMCzM.js +0 -1
  141. package/admin-dist/server/_ssr/_tanstack-start-manifest_v-BwDlABVk.mjs +0 -4
  142. package/admin-dist/server/_ssr/alert-CVt45UUP.mjs +0 -92
package/README.md CHANGED
@@ -10,7 +10,7 @@ A developer-first headless CMS built as a [Convex Component](https://docs.convex
10
10
  - **Media management** - Upload, organize, and serve media with variants
11
11
  - **Role-based access control** - Fine-grained permissions with custom roles
12
12
  - **Multi-locale support** - Content localization with fallback chains
13
- - **Admin UI** - Ready-to-use React admin interface
13
+ - **Admin UI** - Ready-to-use React admin interface (CLI or embeddable)
14
14
 
15
15
  ## Installation
16
16
 
@@ -32,7 +32,70 @@ app.use(convexCms);
32
32
  export default app;
33
33
  ```
34
34
 
35
- ### 2. Create CMS Client
35
+ ### 2. Initialize Admin API
36
+
37
+ ```bash
38
+ npx convex-cms init
39
+ ```
40
+
41
+ This creates `convex/admin.ts` with all the admin functions the UI needs.
42
+
43
+ ### 3. Start Development
44
+
45
+ ```bash
46
+ npx convex dev
47
+ ```
48
+
49
+ ### 4. Access Admin UI
50
+
51
+ ```bash
52
+ npx convex-cms admin
53
+ ```
54
+
55
+ This opens the CMS admin interface at http://localhost:3000.
56
+
57
+ ## Admin UI Options
58
+
59
+ ### Option 1: Standalone CLI (Development)
60
+
61
+ Perfect for quick access during development:
62
+
63
+ ```bash
64
+ npx convex-cms admin
65
+ npx convex-cms admin --port 4000 # Custom port
66
+ npx convex-cms admin --demo # Demo mode with mock data
67
+ ```
68
+
69
+ ### Option 2: Embed in Your App (Production)
70
+
71
+ For production deployments, embed the admin UI in your application:
72
+
73
+ ```tsx
74
+ import { CmsAdmin } from "convex-cms-admin";
75
+
76
+ function AdminPage() {
77
+ return (
78
+ <CmsAdmin
79
+ convexUrl={process.env.VITE_CONVEX_URL}
80
+ auth={{
81
+ getUser: () => yourAuthProvider.getUser(),
82
+ getUserRole: (id) => yourAuthProvider.getRole(id),
83
+ onLogout: () => yourAuthProvider.signOut(),
84
+ }}
85
+ config={{
86
+ branding: {
87
+ appName: "My CMS",
88
+ logoUrl: "/logo.svg",
89
+ },
90
+ }}
91
+ />
92
+ );
93
+ }
94
+ ```
95
+
96
+ ## Using the CMS Client
97
+
98
+ For programmatic access in your Convex functions:
36
99
 
37
100
  ```typescript
38
101
  // convex/cms.ts
@@ -41,12 +104,13 @@ import { components } from "./_generated/api";
41
104
 
42
105
  export const cms = createCmsClient(components.convexCms, {
43
106
  defaultLocale: "en",
44
- permissiveMode: true, // For development only
107
+ features: {
108
+ versioning: true,
109
+ localization: true,
110
+ },
45
111
  });
46
112
  ```
47
113
 
48
- ### 3. Use in Your Functions
49
-
50
114
  ```typescript
51
115
  // convex/blog.ts
52
116
  import { query, mutation } from "./_generated/server";
@@ -73,6 +137,46 @@ export const createPost = mutation({
73
137
  });
74
138
  ```
75
139
 
140
+ ## Auth Integration
141
+
142
+ The admin UI is auth-agnostic - integrate with any provider:
143
+
144
+ ### Frontend Auth Config
145
+
146
+ ```typescript
147
+ <CmsAdmin
148
+ auth={{
149
+ // Return current user for display
150
+ getUser: () => ({
151
+ id: currentUser.id,
152
+ name: currentUser.name,
153
+ email: currentUser.email,
154
+ }),
155
+ // Map user ID to CMS role
156
+ getUserRole: (userId) => userRoles[userId] ?? null,
157
+ // Handle logout
158
+ onLogout: () => signOut(),
159
+ }}
160
+ />
161
+ ```
162
+
163
+ ### Backend Auth (Optional)
164
+
165
+ Add auth validation to admin operations:
166
+
167
+ ```typescript
168
+ // convex/admin.ts
169
+ export const { ... } = defineAdminAPI(components.convexCms, {
170
+ auth: async (ctx, operation) => {
171
+ const identity = await ctx.auth.getUserIdentity();
172
+ if (!identity) throw new Error("Unauthorized");
173
+
174
+ // Optionally check operation.type for fine-grained access
175
+ return identity.subject;
176
+ },
177
+ });
178
+ ```
179
+
76
180
  ## Documentation
77
181
 
78
182
  - [Getting Started Guide](./docs/guides/getting-started.md)
@@ -81,14 +185,6 @@ export const createPost = mutation({
81
185
  - [Authorization](./docs/guides/authorization.md)
82
186
  - [API Reference](./docs/api/client-api.md)
83
187
 
84
- ## Admin UI
85
-
86
- Convex CMS includes a ready-to-use admin interface:
87
-
88
- ```bash
89
- npx convex-cms admin
90
- ```
91
-
92
188
  ## Requirements
93
189
 
94
190
  - Convex ^1.17.0
@@ -1,5 +1,5 @@
1
1
  {
2
- "date": "2026-01-23T18:46:29.879Z",
2
+ "date": "2026-01-24T01:01:07.629Z",
3
3
  "preset": "node-server",
4
4
  "framework": {
5
5
  "name": "nitro",
@@ -1,5 +1,5 @@
1
- import{r as i,j as o,ad as ge,a6 as L,a8 as A,a1 as I,a0 as D,a3 as k,ae as xe,_,af as me,a2 as z,ag as he,ah as be,ai as ve,aj as Ce,ak as ye,c as b,a7 as De}from"./main-CKj5yfEi.js";import{X as je,C as T,u as ke,a as Ne}from"./badge-hvUOzpVZ.js";function Re(e){const t=_e(e),r=i.forwardRef((s,a)=>{const{children:n,...c}=s,l=i.Children.toArray(n),d=l.find(Ie);if(d){const u=d.props.children,p=l.map(f=>f===d?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:f);return o.jsx(t,{...c,ref:a,children:i.isValidElement(u)?i.cloneElement(u,void 0,p):null})}return o.jsx(t,{...c,ref:a,children:n})});return r.displayName=`${e}.Slot`,r}function _e(e){const t=i.forwardRef((r,s)=>{const{children:a,...n}=r;if(i.isValidElement(a)){const c=we(a),l=Pe(n,a.props);return a.type!==i.Fragment&&(l.ref=s?ge(s,c):c),i.cloneElement(a,l)}return i.Children.count(a)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ee=Symbol("radix.slottable");function Ie(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ee}function Pe(e,t){const r={...t};for(const s in t){const a=e[s],n=t[s];/^on[A-Z]/.test(s)?a&&n?r[s]=(...l)=>{const d=n(...l);return a(...l),d}:a&&(r[s]=a):s==="style"?r[s]={...a,...n}:s==="className"&&(r[s]=[a,n].filter(Boolean).join(" "))}return{...e,...r}}function we(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var P="Dialog",[G]=z(P),[Oe,h]=G(P),V=e=>{const{__scopeDialog:t,children:r,open:s,defaultOpen:a,onOpenChange:n,modal:c=!0}=e,l=i.useRef(null),d=i.useRef(null),[u,p]=L({prop:s,defaultProp:a??!1,onChange:n,caller:P});return o.jsx(Oe,{scope:t,triggerRef:l,contentRef:d,contentId:A(),titleId:A(),descriptionId:A(),open:u,onOpenChange:p,onOpenToggle:i.useCallback(()=>p(f=>!f),[p]),modal:c,children:r})};V.displayName=P;var H="DialogTrigger",Se=i.forwardRef((e,t)=>{const{__scopeDialog:r,...s}=e,a=h(H,r),n=_(t,a.triggerRef);return o.jsx(D.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":W(a.open),...s,ref:n,onClick:k(e.onClick,a.onOpenToggle)})});Se.displayName=H;var M="DialogPortal",[Ae,q]=G(M,{forceMount:void 0}),K=e=>{const{__scopeDialog:t,forceMount:r,children:s,container:a}=e,n=h(M,t);return o.jsx(Ae,{scope:t,forceMount:r,children:i.Children.map(s,c=>o.jsx(I,{present:r||n.open,children:o.jsx(xe,{asChild:!0,container:a,children:c})}))})};K.displayName=M;var E="DialogOverlay",U=i.forwardRef((e,t)=>{const r=q(E,e.__scopeDialog),{forceMount:s=r.forceMount,...a}=e,n=h(E,e.__scopeDialog);return n.modal?o.jsx(I,{present:s||n.open,children:o.jsx(Me,{...a,ref:t})}):null});U.displayName=E;var Te=Re("DialogOverlay.RemoveScroll"),Me=i.forwardRef((e,t)=>{const{__scopeDialog:r,...s}=e,a=h(E,r);return o.jsx(he,{as:Te,allowPinchZoom:!0,shards:[a.contentRef],children:o.jsx(D.div,{"data-state":W(a.open),...s,ref:t,style:{pointerEvents:"auto",...s.style}})})}),N="DialogContent",X=i.forwardRef((e,t)=>{const r=q(N,e.__scopeDialog),{forceMount:s=r.forceMount,...a}=e,n=h(N,e.__scopeDialog);return o.jsx(I,{present:s||n.open,children:n.modal?o.jsx(Fe,{...a,ref:t}):o.jsx(We,{...a,ref:t})})});X.displayName=N;var Fe=i.forwardRef((e,t)=>{const r=h(N,e.__scopeDialog),s=i.useRef(null),a=_(t,r.contentRef,s);return i.useEffect(()=>{const n=s.current;if(n)return me(n)},[]),o.jsx(Z,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:k(e.onCloseAutoFocus,n=>{n.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:k(e.onPointerDownOutside,n=>{const c=n.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0;(c.button===2||l)&&n.preventDefault()}),onFocusOutside:k(e.onFocusOutside,n=>n.preventDefault())})}),We=i.forwardRef((e,t)=>{const r=h(N,e.__scopeDialog),s=i.useRef(!1),a=i.useRef(!1);return o.jsx(Z,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:n=>{e.onCloseAutoFocus?.(n),n.defaultPrevented||(s.current||r.triggerRef.current?.focus(),n.preventDefault()),s.current=!1,a.current=!1},onInteractOutside:n=>{e.onInteractOutside?.(n),n.defaultPrevented||(s.current=!0,n.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const c=n.target;r.triggerRef.current?.contains(c)&&n.preventDefault(),n.detail.originalEvent.type==="focusin"&&a.current&&n.preventDefault()}})}),Z=i.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:n,...c}=e,l=h(N,r),d=i.useRef(null),u=_(t,d);return be(),o.jsxs(o.Fragment,{children:[o.jsx(ve,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:a,onUnmountAutoFocus:n,children:o.jsx(Ce,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":W(l.open),...c,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),o.jsxs(o.Fragment,{children:[o.jsx($e,{titleId:l.titleId}),o.jsx(Le,{contentRef:d,descriptionId:l.descriptionId})]})]})}),F="DialogTitle",Y=i.forwardRef((e,t)=>{const{__scopeDialog:r,...s}=e,a=h(F,r);return o.jsx(D.h2,{id:a.titleId,...s,ref:t})});Y.displayName=F;var J="DialogDescription",Q=i.forwardRef((e,t)=>{const{__scopeDialog:r,...s}=e,a=h(J,r);return o.jsx(D.p,{id:a.descriptionId,...s,ref:t})});Q.displayName=J;var ee="DialogClose",te=i.forwardRef((e,t)=>{const{__scopeDialog:r,...s}=e,a=h(ee,r);return o.jsx(D.button,{type:"button",...s,ref:t,onClick:k(e.onClick,()=>a.onOpenChange(!1))})});te.displayName=ee;function W(e){return e?"open":"closed"}var ne="DialogTitleWarning",[ut,oe]=ye(ne,{contentName:N,titleName:F,docsSlug:"dialog"}),$e=({titleId:e})=>{const t=oe(ne),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
1
+ import{r as i,j as o,af as ge,a8 as L,aa as A,a3 as I,a2 as D,a5 as k,ag as me,a0 as _,ah as xe,a4 as z,ai as he,aj as be,ak as ve,al as Ce,am as ye,c as b,a9 as De}from"./main-CXgkZMhe.js";import{X as je,C as T,u as ke,a as Ne}from"./badge-qPrc4AUM.js";function Re(e){const t=_e(e),r=i.forwardRef((s,a)=>{const{children:n,...c}=s,l=i.Children.toArray(n),d=l.find(Ie);if(d){const u=d.props.children,p=l.map(f=>f===d?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:f);return o.jsx(t,{...c,ref:a,children:i.isValidElement(u)?i.cloneElement(u,void 0,p):null})}return o.jsx(t,{...c,ref:a,children:n})});return r.displayName=`${e}.Slot`,r}function _e(e){const t=i.forwardRef((r,s)=>{const{children:a,...n}=r;if(i.isValidElement(a)){const c=we(a),l=Pe(n,a.props);return a.type!==i.Fragment&&(l.ref=s?ge(s,c):c),i.cloneElement(a,l)}return i.Children.count(a)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ee=Symbol("radix.slottable");function Ie(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ee}function Pe(e,t){const r={...t};for(const s in t){const a=e[s],n=t[s];/^on[A-Z]/.test(s)?a&&n?r[s]=(...l)=>{const d=n(...l);return a(...l),d}:a&&(r[s]=a):s==="style"?r[s]={...a,...n}:s==="className"&&(r[s]=[a,n].filter(Boolean).join(" "))}return{...e,...r}}function we(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var P="Dialog",[G]=z(P),[Oe,h]=G(P),V=e=>{const{__scopeDialog:t,children:r,open:s,defaultOpen:a,onOpenChange:n,modal:c=!0}=e,l=i.useRef(null),d=i.useRef(null),[u,p]=L({prop:s,defaultProp:a??!1,onChange:n,caller:P});return o.jsx(Oe,{scope:t,triggerRef:l,contentRef:d,contentId:A(),titleId:A(),descriptionId:A(),open:u,onOpenChange:p,onOpenToggle:i.useCallback(()=>p(f=>!f),[p]),modal:c,children:r})};V.displayName=P;var H="DialogTrigger",Se=i.forwardRef((e,t)=>{const{__scopeDialog:r,...s}=e,a=h(H,r),n=_(t,a.triggerRef);return o.jsx(D.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":W(a.open),...s,ref:n,onClick:k(e.onClick,a.onOpenToggle)})});Se.displayName=H;var M="DialogPortal",[Ae,q]=G(M,{forceMount:void 0}),K=e=>{const{__scopeDialog:t,forceMount:r,children:s,container:a}=e,n=h(M,t);return o.jsx(Ae,{scope:t,forceMount:r,children:i.Children.map(s,c=>o.jsx(I,{present:r||n.open,children:o.jsx(me,{asChild:!0,container:a,children:c})}))})};K.displayName=M;var E="DialogOverlay",U=i.forwardRef((e,t)=>{const r=q(E,e.__scopeDialog),{forceMount:s=r.forceMount,...a}=e,n=h(E,e.__scopeDialog);return n.modal?o.jsx(I,{present:s||n.open,children:o.jsx(Me,{...a,ref:t})}):null});U.displayName=E;var Te=Re("DialogOverlay.RemoveScroll"),Me=i.forwardRef((e,t)=>{const{__scopeDialog:r,...s}=e,a=h(E,r);return o.jsx(he,{as:Te,allowPinchZoom:!0,shards:[a.contentRef],children:o.jsx(D.div,{"data-state":W(a.open),...s,ref:t,style:{pointerEvents:"auto",...s.style}})})}),N="DialogContent",X=i.forwardRef((e,t)=>{const r=q(N,e.__scopeDialog),{forceMount:s=r.forceMount,...a}=e,n=h(N,e.__scopeDialog);return o.jsx(I,{present:s||n.open,children:n.modal?o.jsx(Fe,{...a,ref:t}):o.jsx(We,{...a,ref:t})})});X.displayName=N;var Fe=i.forwardRef((e,t)=>{const r=h(N,e.__scopeDialog),s=i.useRef(null),a=_(t,r.contentRef,s);return i.useEffect(()=>{const n=s.current;if(n)return xe(n)},[]),o.jsx(Z,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:k(e.onCloseAutoFocus,n=>{n.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:k(e.onPointerDownOutside,n=>{const c=n.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0;(c.button===2||l)&&n.preventDefault()}),onFocusOutside:k(e.onFocusOutside,n=>n.preventDefault())})}),We=i.forwardRef((e,t)=>{const r=h(N,e.__scopeDialog),s=i.useRef(!1),a=i.useRef(!1);return o.jsx(Z,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:n=>{e.onCloseAutoFocus?.(n),n.defaultPrevented||(s.current||r.triggerRef.current?.focus(),n.preventDefault()),s.current=!1,a.current=!1},onInteractOutside:n=>{e.onInteractOutside?.(n),n.defaultPrevented||(s.current=!0,n.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const c=n.target;r.triggerRef.current?.contains(c)&&n.preventDefault(),n.detail.originalEvent.type==="focusin"&&a.current&&n.preventDefault()}})}),Z=i.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:n,...c}=e,l=h(N,r),d=i.useRef(null),u=_(t,d);return be(),o.jsxs(o.Fragment,{children:[o.jsx(ve,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:a,onUnmountAutoFocus:n,children:o.jsx(Ce,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":W(l.open),...c,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),o.jsxs(o.Fragment,{children:[o.jsx($e,{titleId:l.titleId}),o.jsx(Le,{contentRef:d,descriptionId:l.descriptionId})]})]})}),F="DialogTitle",Y=i.forwardRef((e,t)=>{const{__scopeDialog:r,...s}=e,a=h(F,r);return o.jsx(D.h2,{id:a.titleId,...s,ref:t})});Y.displayName=F;var J="DialogDescription",Q=i.forwardRef((e,t)=>{const{__scopeDialog:r,...s}=e,a=h(J,r);return o.jsx(D.p,{id:a.descriptionId,...s,ref:t})});Q.displayName=J;var ee="DialogClose",te=i.forwardRef((e,t)=>{const{__scopeDialog:r,...s}=e,a=h(ee,r);return o.jsx(D.button,{type:"button",...s,ref:t,onClick:k(e.onClick,()=>a.onOpenChange(!1))})});te.displayName=ee;function W(e){return e?"open":"closed"}var ne="DialogTitleWarning",[ut,oe]=ye(ne,{contentName:N,titleName:F,docsSlug:"dialog"}),$e=({titleId:e})=>{const t=oe(ne),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
2
2
 
3
3
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
4
4
 
5
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return i.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},Be="DialogDescriptionWarning",Le=({contentRef:e,descriptionId:t})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${oe(Be).contentName}}.`;return i.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(s))},[s,e,t]),null},ze=V,Ge=K,Ve=U,He=X,qe=Y,Ke=Q,Ue=te;function Xe({...e}){return o.jsx(ze,{"data-slot":"dialog",...e})}function Ze({...e}){return o.jsx(Ge,{"data-slot":"dialog-portal",...e})}function Ye({className:e,...t}){return o.jsx(Ve,{"data-slot":"dialog-overlay",className:b("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",e),...t})}function Je({className:e,children:t,showCloseButton:r=!0,...s}){return o.jsxs(Ze,{"data-slot":"dialog-portal",children:[o.jsx(Ye,{}),o.jsxs(He,{"data-slot":"dialog-content",className:b("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",e),...s,children:[t,r&&o.jsxs(Ue,{"data-slot":"dialog-close",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",children:[o.jsx(je,{}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Qe({className:e,...t}){return o.jsx("div",{"data-slot":"dialog-header",className:b("flex flex-col gap-2 text-center sm:text-left",e),...t})}function et({className:e,...t}){return o.jsx("div",{"data-slot":"dialog-footer",className:b("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function tt({className:e,...t}){return o.jsx(qe,{"data-slot":"dialog-title",className:b("text-lg leading-none font-semibold",e),...t})}function nt({className:e,...t}){return o.jsx(Ke,{"data-slot":"dialog-description",className:b("text-muted-foreground text-sm",e),...t})}const ot={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl"};function rt({open:e,onOpenChange:t,title:r,description:s,children:a,footer:n,size:c="md",className:l}){return o.jsx(Xe,{open:e,onOpenChange:t,children:o.jsxs(Je,{className:b("flex max-h-[85vh] flex-col overflow-hidden",ot[c],l),children:[o.jsxs(Qe,{className:"shrink-0",children:[o.jsx(tt,{children:r}),s&&o.jsx(nt,{children:s})]}),o.jsx("div",{className:"min-h-0 flex-1 py-4 scrollbar-none",children:a}),n&&o.jsx(et,{className:"shrink-0 border-t pt-4",children:n})]})})}function ft({open:e,onOpenChange:t,title:r,description:s,confirmLabel:a="Confirm",cancelLabel:n="Cancel",onConfirm:c,onCancel:l,variant:d="default",loading:u,isLoading:p,error:f}){const x=u??p??!1,j=()=>{l?.(),t(!1)},v=()=>{c()},C=()=>d==="danger"?"danger":d==="warning"?"warning":"primary";return o.jsx(rt,{open:e,onOpenChange:t,title:r,size:"sm",footer:o.jsxs(o.Fragment,{children:[o.jsx(T,{variant:"outline",onClick:j,disabled:x,children:n}),o.jsx(T,{variant:C(),onClick:v,loading:x,children:a})]}),children:o.jsxs("div",{className:"space-y-3",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:s}),f&&o.jsx("p",{className:"text-sm text-destructive",children:f})]})})}function pt({className:e,type:t,...r}){return o.jsx("input",{type:t,"data-slot":"input",className:b("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","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}var w="Checkbox",[at]=z(w),[st,$]=at(w);function it(e){const{__scopeCheckbox:t,checked:r,children:s,defaultChecked:a,disabled:n,form:c,name:l,onCheckedChange:d,required:u,value:p="on",internal_do_not_use_render:f}=e,[x,j]=L({prop:r,defaultProp:a??!1,onChange:d,caller:w}),[v,C]=i.useState(null),[R,g]=i.useState(null),m=i.useRef(!1),O=v?!!c||!!v.closest("form"):!0,S={checked:x,disabled:n,setChecked:j,control:v,setControl:C,name:l,form:c,value:p,hasConsumerStoppedPropagationRef:m,required:u,defaultChecked:y(a)?!1:a,isFormControl:O,bubbleInput:R,setBubbleInput:g};return o.jsx(st,{scope:t,...S,children:lt(f)?f(S):s})}var re="CheckboxTrigger",ae=i.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...s},a)=>{const{control:n,value:c,disabled:l,checked:d,required:u,setControl:p,setChecked:f,hasConsumerStoppedPropagationRef:x,isFormControl:j,bubbleInput:v}=$(re,e),C=_(a,p),R=i.useRef(d);return i.useEffect(()=>{const g=n?.form;if(g){const m=()=>f(R.current);return g.addEventListener("reset",m),()=>g.removeEventListener("reset",m)}},[n,f]),o.jsx(D.button,{type:"button",role:"checkbox","aria-checked":y(d)?"mixed":d,"aria-required":u,"data-state":ue(d),"data-disabled":l?"":void 0,disabled:l,value:c,...s,ref:C,onKeyDown:k(t,g=>{g.key==="Enter"&&g.preventDefault()}),onClick:k(r,g=>{f(m=>y(m)?!0:!m),v&&j&&(x.current=g.isPropagationStopped(),x.current||g.stopPropagation())})})});ae.displayName=re;var se=i.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:s,checked:a,defaultChecked:n,required:c,disabled:l,value:d,onCheckedChange:u,form:p,...f}=e;return o.jsx(it,{__scopeCheckbox:r,checked:a,defaultChecked:n,disabled:l,required:c,onCheckedChange:u,name:s,form:p,value:d,internal_do_not_use_render:({isFormControl:x})=>o.jsxs(o.Fragment,{children:[o.jsx(ae,{...f,ref:t,__scopeCheckbox:r}),x&&o.jsx(de,{__scopeCheckbox:r})]})})});se.displayName=w;var ie="CheckboxIndicator",le=i.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:s,...a}=e,n=$(ie,r);return o.jsx(I,{present:s||y(n.checked)||n.checked===!0,children:o.jsx(D.span,{"data-state":ue(n.checked),"data-disabled":n.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});le.displayName=ie;var ce="CheckboxBubbleInput",de=i.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:s,hasConsumerStoppedPropagationRef:a,checked:n,defaultChecked:c,required:l,disabled:d,name:u,value:p,form:f,bubbleInput:x,setBubbleInput:j}=$(ce,e),v=_(r,j),C=ke(n),R=De(s);i.useEffect(()=>{const m=x;if(!m)return;const O=window.HTMLInputElement.prototype,B=Object.getOwnPropertyDescriptor(O,"checked").set,fe=!a.current;if(C!==n&&B){const pe=new Event("click",{bubbles:fe});m.indeterminate=y(n),B.call(m,y(n)?!1:n),m.dispatchEvent(pe)}},[x,C,n,a]);const g=i.useRef(y(n)?!1:n);return o.jsx(D.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??g.current,required:l,disabled:d,name:u,value:p,form:f,...t,tabIndex:-1,ref:v,style:{...t.style,...R,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});de.displayName=ce;function lt(e){return typeof e=="function"}function y(e){return e==="indeterminate"}function ue(e){return y(e)?"indeterminate":e?"checked":"unchecked"}function gt({className:e,...t}){return o.jsx(se,{"data-slot":"checkbox",className:b("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:o.jsx(le,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:o.jsx(Ne,{className:"size-3.5"})})})}function xt({icon:e,title:t,description:r,action:s,className:a,...n}){return o.jsxs("div",{className:b("flex flex-col items-center justify-center py-12 text-center",a),...n,children:[e&&o.jsx("div",{className:"mb-4 flex size-12 items-center justify-center rounded-full bg-muted text-muted-foreground",children:e}),o.jsx("h3",{className:"text-base font-semibold text-foreground",children:t}),r&&o.jsx("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:r}),s&&o.jsx(T,{variant:s.variant??"primary",onClick:s.onClick,className:"mt-4",children:s.label})]})}export{xt as C,Xe as D,pt as I,Ve as O,Ge as P,ze as R,gt as a,ft as b,rt as c,Je as d,tt as e,Qe as f,et as g,He as h};
5
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return i.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},Be="DialogDescriptionWarning",Le=({contentRef:e,descriptionId:t})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${oe(Be).contentName}}.`;return i.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(s))},[s,e,t]),null},ze=V,Ge=K,Ve=U,He=X,qe=Y,Ke=Q,Ue=te;function Xe({...e}){return o.jsx(ze,{"data-slot":"dialog",...e})}function Ze({...e}){return o.jsx(Ge,{"data-slot":"dialog-portal",...e})}function Ye({className:e,...t}){return o.jsx(Ve,{"data-slot":"dialog-overlay",className:b("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",e),...t})}function Je({className:e,children:t,showCloseButton:r=!0,...s}){return o.jsxs(Ze,{"data-slot":"dialog-portal",children:[o.jsx(Ye,{}),o.jsxs(He,{"data-slot":"dialog-content",className:b("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",e),...s,children:[t,r&&o.jsxs(Ue,{"data-slot":"dialog-close",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",children:[o.jsx(je,{}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Qe({className:e,...t}){return o.jsx("div",{"data-slot":"dialog-header",className:b("flex flex-col gap-2 text-center sm:text-left",e),...t})}function et({className:e,...t}){return o.jsx("div",{"data-slot":"dialog-footer",className:b("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function tt({className:e,...t}){return o.jsx(qe,{"data-slot":"dialog-title",className:b("text-lg leading-none font-semibold",e),...t})}function nt({className:e,...t}){return o.jsx(Ke,{"data-slot":"dialog-description",className:b("text-muted-foreground text-sm",e),...t})}const ot={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl"};function rt({open:e,onOpenChange:t,title:r,description:s,children:a,footer:n,size:c="md",className:l}){return o.jsx(Xe,{open:e,onOpenChange:t,children:o.jsxs(Je,{className:b("flex max-h-[85vh] flex-col overflow-hidden",ot[c],l),children:[o.jsxs(Qe,{className:"shrink-0",children:[o.jsx(tt,{children:r}),s&&o.jsx(nt,{children:s})]}),o.jsx("div",{className:"min-h-0 flex-1 py-4 scrollbar-none",children:a}),n&&o.jsx(et,{className:"shrink-0 border-t pt-4",children:n})]})})}function ft({open:e,onOpenChange:t,title:r,description:s,confirmLabel:a="Confirm",cancelLabel:n="Cancel",onConfirm:c,onCancel:l,variant:d="default",loading:u,isLoading:p,error:f}){const m=u??p??!1,j=()=>{l?.(),t(!1)},v=()=>{c()},C=()=>d==="danger"?"danger":d==="warning"?"warning":"primary";return o.jsx(rt,{open:e,onOpenChange:t,title:r,size:"sm",footer:o.jsxs(o.Fragment,{children:[o.jsx(T,{variant:"outline",onClick:j,disabled:m,children:n}),o.jsx(T,{variant:C(),onClick:v,loading:m,children:a})]}),children:o.jsxs("div",{className:"space-y-3",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:s}),f&&o.jsx("p",{className:"text-sm text-destructive",children:f})]})})}function pt({className:e,type:t,...r}){return o.jsx("input",{type:t,"data-slot":"input",className:b("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","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}var w="Checkbox",[at]=z(w),[st,$]=at(w);function it(e){const{__scopeCheckbox:t,checked:r,children:s,defaultChecked:a,disabled:n,form:c,name:l,onCheckedChange:d,required:u,value:p="on",internal_do_not_use_render:f}=e,[m,j]=L({prop:r,defaultProp:a??!1,onChange:d,caller:w}),[v,C]=i.useState(null),[R,g]=i.useState(null),x=i.useRef(!1),O=v?!!c||!!v.closest("form"):!0,S={checked:m,disabled:n,setChecked:j,control:v,setControl:C,name:l,form:c,value:p,hasConsumerStoppedPropagationRef:x,required:u,defaultChecked:y(a)?!1:a,isFormControl:O,bubbleInput:R,setBubbleInput:g};return o.jsx(st,{scope:t,...S,children:lt(f)?f(S):s})}var re="CheckboxTrigger",ae=i.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...s},a)=>{const{control:n,value:c,disabled:l,checked:d,required:u,setControl:p,setChecked:f,hasConsumerStoppedPropagationRef:m,isFormControl:j,bubbleInput:v}=$(re,e),C=_(a,p),R=i.useRef(d);return i.useEffect(()=>{const g=n?.form;if(g){const x=()=>f(R.current);return g.addEventListener("reset",x),()=>g.removeEventListener("reset",x)}},[n,f]),o.jsx(D.button,{type:"button",role:"checkbox","aria-checked":y(d)?"mixed":d,"aria-required":u,"data-state":ue(d),"data-disabled":l?"":void 0,disabled:l,value:c,...s,ref:C,onKeyDown:k(t,g=>{g.key==="Enter"&&g.preventDefault()}),onClick:k(r,g=>{f(x=>y(x)?!0:!x),v&&j&&(m.current=g.isPropagationStopped(),m.current||g.stopPropagation())})})});ae.displayName=re;var se=i.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:s,checked:a,defaultChecked:n,required:c,disabled:l,value:d,onCheckedChange:u,form:p,...f}=e;return o.jsx(it,{__scopeCheckbox:r,checked:a,defaultChecked:n,disabled:l,required:c,onCheckedChange:u,name:s,form:p,value:d,internal_do_not_use_render:({isFormControl:m})=>o.jsxs(o.Fragment,{children:[o.jsx(ae,{...f,ref:t,__scopeCheckbox:r}),m&&o.jsx(de,{__scopeCheckbox:r})]})})});se.displayName=w;var ie="CheckboxIndicator",le=i.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:s,...a}=e,n=$(ie,r);return o.jsx(I,{present:s||y(n.checked)||n.checked===!0,children:o.jsx(D.span,{"data-state":ue(n.checked),"data-disabled":n.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});le.displayName=ie;var ce="CheckboxBubbleInput",de=i.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:s,hasConsumerStoppedPropagationRef:a,checked:n,defaultChecked:c,required:l,disabled:d,name:u,value:p,form:f,bubbleInput:m,setBubbleInput:j}=$(ce,e),v=_(r,j),C=ke(n),R=De(s);i.useEffect(()=>{const x=m;if(!x)return;const O=window.HTMLInputElement.prototype,B=Object.getOwnPropertyDescriptor(O,"checked").set,fe=!a.current;if(C!==n&&B){const pe=new Event("click",{bubbles:fe});x.indeterminate=y(n),B.call(x,y(n)?!1:n),x.dispatchEvent(pe)}},[m,C,n,a]);const g=i.useRef(y(n)?!1:n);return o.jsx(D.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??g.current,required:l,disabled:d,name:u,value:p,form:f,...t,tabIndex:-1,ref:v,style:{...t.style,...R,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});de.displayName=ce;function lt(e){return typeof e=="function"}function y(e){return e==="indeterminate"}function ue(e){return y(e)?"indeterminate":e?"checked":"unchecked"}function gt({className:e,...t}){return o.jsx(se,{"data-slot":"checkbox",className:b("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:o.jsx(le,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:o.jsx(Ne,{className:"size-3.5"})})})}function mt({icon:e,title:t,description:r,action:s,className:a,...n}){return o.jsxs("div",{className:b("flex flex-col items-center justify-center py-12 text-center",a),...n,children:[e&&o.jsx("div",{className:"mb-4 flex size-12 items-center justify-center rounded-full bg-muted text-muted-foreground",children:e}),o.jsx("h3",{className:"text-base font-semibold text-foreground",children:t}),r&&o.jsx("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:r}),s&&o.jsx(T,{variant:s.variant??"primary",onClick:s.onClick,className:"mt-4",children:s.label})]})}export{mt as C,Xe as D,pt as I,Ve as O,Ge as P,ze as R,gt as a,ft as b,rt as c,Je as d,tt as e,Qe as f,et as g,He as h};
@@ -1 +1 @@
1
- import{j as e,c}from"./main-CKj5yfEi.js";function x({title:i,description:s,actions:t,breadcrumbs:a,className:l,...r}){return e.jsxs("div",{className:c("mb-6",l),...r,children:[a&&e.jsx("div",{className:"mb-2",children:a}),e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:i}),s&&e.jsx("p",{className:"text-sm text-muted-foreground",children:s})]}),t&&e.jsx("div",{className:"flex items-center gap-2",children:t})]})]})}export{x as C};
1
+ import{j as e,c}from"./main-CXgkZMhe.js";function x({title:i,description:s,actions:t,breadcrumbs:a,className:l,...r}){return e.jsxs("div",{className:c("mb-6",l),...r,children:[a&&e.jsx("div",{className:"mb-2",children:a}),e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:i}),s&&e.jsx("p",{className:"text-sm text-muted-foreground",children:s})]}),t&&e.jsx("div",{className:"flex items-center gap-2",children:t})]})]})}export{x as C};
@@ -1 +1 @@
1
- import{j as e,c as l}from"./main-CKj5yfEi.js";import{B as o}from"./badge-hvUOzpVZ.js";const i={draft:{label:"Draft",className:"status-draft",icon:e.jsx("svg",{className:"size-3",fill:"currentColor",viewBox:"0 0 8 8",children:e.jsx("circle",{cx:"4",cy:"4",r:"3"})})},published:{label:"Published",className:"status-published",icon:e.jsx("svg",{className:"size-3",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})},scheduled:{label:"Scheduled",className:"status-scheduled",icon:e.jsxs("svg",{className:"size-3",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{strokeLinecap:"round",d:"M12 6v6l4 2"})]})},archived:{label:"Archived",className:"status-archived",icon:e.jsx("svg",{className:"size-3",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4"})})}},c={gray:"bg-muted text-muted-foreground",yellow:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400",blue:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400",green:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400",red:"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400",purple:"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-400",orange:"bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-400"};function d(){return e.jsx("svg",{className:"size-3",fill:"currentColor",viewBox:"0 0 8 8",children:e.jsx("circle",{cx:"4",cy:"4",r:"3"})})}function g({status:n,customConfig:s,className:a,...t}){if(s)return e.jsxs(o,{variant:"secondary",className:l("gap-1.5 px-2 py-0.5 text-xs font-medium",c[s.color],a),...t,children:[d(),s.displayName]});const r=i[n];return r?e.jsxs(o,{variant:"secondary",className:l("gap-1.5 px-2 py-0.5 text-xs font-medium",r.className,a),...t,children:[r.icon,r.label]}):e.jsxs(o,{variant:"secondary",className:l("gap-1.5 px-2 py-0.5 text-xs font-medium",c.gray,a),...t,children:[d(),n]})}export{g as C};
1
+ import{j as e,c as l}from"./main-CXgkZMhe.js";import{B as o}from"./badge-qPrc4AUM.js";const i={draft:{label:"Draft",className:"status-draft",icon:e.jsx("svg",{className:"size-3",fill:"currentColor",viewBox:"0 0 8 8",children:e.jsx("circle",{cx:"4",cy:"4",r:"3"})})},published:{label:"Published",className:"status-published",icon:e.jsx("svg",{className:"size-3",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})},scheduled:{label:"Scheduled",className:"status-scheduled",icon:e.jsxs("svg",{className:"size-3",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{strokeLinecap:"round",d:"M12 6v6l4 2"})]})},archived:{label:"Archived",className:"status-archived",icon:e.jsx("svg",{className:"size-3",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4"})})}},c={gray:"bg-muted text-muted-foreground",yellow:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400",blue:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400",green:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400",red:"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400",purple:"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-400",orange:"bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-400"};function d(){return e.jsx("svg",{className:"size-3",fill:"currentColor",viewBox:"0 0 8 8",children:e.jsx("circle",{cx:"4",cy:"4",r:"3"})})}function g({status:n,customConfig:s,className:a,...t}){if(s)return e.jsxs(o,{variant:"secondary",className:l("gap-1.5 px-2 py-0.5 text-xs font-medium",c[s.color],a),...t,children:[d(),s.displayName]});const r=i[n];return r?e.jsxs(o,{variant:"secondary",className:l("gap-1.5 px-2 py-0.5 text-xs font-medium",r.className,a),...t,children:[r.icon,r.label]}):e.jsxs(o,{variant:"secondary",className:l("gap-1.5 px-2 py-0.5 text-xs font-medium",c.gray,a),...t,children:[d(),n]})}export{g as C};
@@ -0,0 +1 @@
1
+ import{j as r,c as t}from"./main-CXgkZMhe.js";const l={base:"surface-base",elevated:"surface-elevated",floating:"surface-floating"},m={none:"",sm:"p-3",md:"p-4",lg:"p-6"},u={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg"};function f({elevation:e="base",padding:s="md",rounded:n="lg",className:a,children:d,...o}){return r.jsx("div",{className:t(l[e],m[s],u[n],a),...o,children:d})}export{f as C};
@@ -1 +1 @@
1
- import{j as e,c}from"./main-CKj5yfEi.js";import{I as i}from"./CmsEmptyState-CRswfTzk.js";import{S as p}from"./search-MuAUDJKR.js";function j({left:t,right:s,search:a,filters:r,actions:l,className:m,children:n,...o}){return e.jsxs("div",{className:c("flex flex-wrap items-center justify-between gap-3 pb-4",m),...o,children:[e.jsxs("div",{className:"flex flex-1 flex-wrap items-center gap-2",children:[a&&e.jsxs("div",{className:"relative w-full max-w-xs",children:[e.jsx(p,{className:"absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(i,{type:"search",placeholder:a.placeholder??"Search...",value:a.value,onChange:x=>a.onChange(x.target.value),className:"pl-9"})]}),r,t,n]}),(s||l)&&e.jsx("div",{className:"flex items-center gap-2",children:s??l})]})}export{j as C};
1
+ import{j as e,c}from"./main-CXgkZMhe.js";import{I as i}from"./CmsEmptyState-CiMQwSQV.js";import{S as p}from"./search-CbCbboeU.js";function j({left:t,right:s,search:a,filters:r,actions:l,className:m,children:n,...o}){return e.jsxs("div",{className:c("flex flex-wrap items-center justify-between gap-3 pb-4",m),...o,children:[e.jsxs("div",{className:"flex flex-1 flex-wrap items-center gap-2",children:[a&&e.jsxs("div",{className:"relative w-full max-w-xs",children:[e.jsx(p,{className:"absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(i,{type:"search",placeholder:a.placeholder??"Search...",value:a.value,onChange:x=>a.onChange(x.target.value),className:"pl-9"})]}),r,t,n]}),(s||l)&&e.jsx("div",{className:"flex items-center gap-2",children:s??l})]})}export{j as C};