@questpie/admin 3.2.4 → 3.2.6

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 (255) hide show
  1. package/dist/client/blocks/block-renderer.d.mts +2 -2
  2. package/dist/client/blocks/block-renderer.mjs +164 -339
  3. package/dist/client/components/actions/action-button.mjs +9 -9
  4. package/dist/client/components/actions/action-dialog.mjs +195 -493
  5. package/dist/client/components/actions/confirmation-dialog.mjs +44 -159
  6. package/dist/client/components/actions/header-actions.mjs +73 -165
  7. package/dist/client/components/admin-link.d.mts +2 -2
  8. package/dist/client/components/admin-link.mjs +40 -126
  9. package/dist/client/components/auth/auth-loading.mjs +9 -44
  10. package/dist/client/components/blocks/block-canvas.mjs +31 -95
  11. package/dist/client/components/blocks/block-editor-context.mjs +13 -57
  12. package/dist/client/components/blocks/block-editor-layout.mjs +72 -166
  13. package/dist/client/components/blocks/block-editor-provider.mjs +184 -245
  14. package/dist/client/components/blocks/block-fields-renderer.mjs +54 -229
  15. package/dist/client/components/blocks/block-insert-button.mjs +49 -165
  16. package/dist/client/components/blocks/block-item-menu.mjs +102 -301
  17. package/dist/client/components/blocks/block-item.mjs +136 -370
  18. package/dist/client/components/blocks/block-library-sidebar.mjs +103 -230
  19. package/dist/client/components/blocks/block-tree.mjs +12 -68
  20. package/dist/client/components/blocks/block-type-icon.mjs +14 -56
  21. package/dist/client/components/brand-logo.mjs +35 -149
  22. package/dist/client/components/component-renderer.mjs +42 -118
  23. package/dist/client/components/error-boundary.mjs +14 -58
  24. package/dist/client/components/fields/array-field.mjs +209 -521
  25. package/dist/client/components/fields/asset-preview-field.mjs +41 -141
  26. package/dist/client/components/fields/blocks-field/blocks-field.mjs +60 -156
  27. package/dist/client/components/fields/boolean-field.mjs +29 -59
  28. package/dist/client/components/fields/date-field.mjs +7 -37
  29. package/dist/client/components/fields/datetime-field.mjs +7 -38
  30. package/dist/client/components/fields/email-field.mjs +25 -54
  31. package/dist/client/components/fields/field-wrapper.mjs +30 -105
  32. package/dist/client/components/fields/json-field.mjs +94 -296
  33. package/dist/client/components/fields/locale-badge.mjs +6 -15
  34. package/dist/client/components/fields/number-field.mjs +27 -60
  35. package/dist/client/components/fields/object-array-field.mjs +283 -659
  36. package/dist/client/components/fields/object-field.mjs +165 -633
  37. package/dist/client/components/fields/relation/displays/cards-display.mjs +106 -220
  38. package/dist/client/components/fields/relation/displays/chips-display.mjs +78 -150
  39. package/dist/client/components/fields/relation/displays/grid-display.mjs +92 -186
  40. package/dist/client/components/fields/relation/displays/list-display.mjs +122 -239
  41. package/dist/client/components/fields/relation/displays/table-display.mjs +70 -244
  42. package/dist/client/components/fields/relation/relation-items-display.mjs +30 -126
  43. package/dist/client/components/fields/relation-field.mjs +10 -66
  44. package/dist/client/components/fields/relation-picker.mjs +18 -18
  45. package/dist/client/components/fields/relation-select.mjs +12 -12
  46. package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +80 -180
  47. package/dist/client/components/fields/rich-text-editor/image-popover.mjs +2 -2
  48. package/dist/client/components/fields/rich-text-editor/image-upload.mjs +13 -29
  49. package/dist/client/components/fields/rich-text-editor/index.mjs +195 -513
  50. package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +61 -111
  51. package/dist/client/components/fields/rich-text-editor/table-controls.mjs +105 -415
  52. package/dist/client/components/fields/rich-text-editor/toolbar.mjs +256 -511
  53. package/dist/client/components/fields/rich-text-field.mjs +14 -53
  54. package/dist/client/components/fields/select-field.mjs +61 -72
  55. package/dist/client/components/fields/text-field.mjs +26 -59
  56. package/dist/client/components/fields/textarea-field.mjs +26 -58
  57. package/dist/client/components/fields/time-field.mjs +7 -35
  58. package/dist/client/components/fields/upload-field.mjs +47 -165
  59. package/dist/client/components/filter-builder/columns-tab.mjs +80 -280
  60. package/dist/client/components/filter-builder/filter-builder-sheet.mjs +197 -540
  61. package/dist/client/components/filter-builder/filters-tab.mjs +96 -386
  62. package/dist/client/components/filter-builder/saved-views-tab.mjs +133 -351
  63. package/dist/client/components/history-sidebar.mjs +285 -605
  64. package/dist/client/components/layout/field-layout-renderer.mjs +106 -254
  65. package/dist/client/components/locale-switcher.mjs +106 -228
  66. package/dist/client/components/media/media-grid.mjs +84 -273
  67. package/dist/client/components/media/media-picker-dialog.mjs +176 -476
  68. package/dist/client/components/preview/live-preview-mode.mjs +233 -458
  69. package/dist/client/components/preview/preview-pane.mjs +22 -22
  70. package/dist/client/components/primitives/asset-preview.mjs +290 -666
  71. package/dist/client/components/primitives/checkbox-input.mjs +9 -35
  72. package/dist/client/components/primitives/date-input.mjs +109 -327
  73. package/dist/client/components/primitives/dropzone.mjs +209 -336
  74. package/dist/client/components/primitives/field-select-control.mjs +12 -80
  75. package/dist/client/components/primitives/number-input.mjs +4 -4
  76. package/dist/client/components/primitives/select-multi.mjs +229 -572
  77. package/dist/client/components/primitives/select-single.mjs +179 -499
  78. package/dist/client/components/primitives/time-input.mjs +43 -117
  79. package/dist/client/components/primitives/toggle-input.mjs +9 -29
  80. package/dist/client/components/sheets/resource-sheet.mjs +61 -70
  81. package/dist/client/components/ui/accordion.mjs +35 -155
  82. package/dist/client/components/ui/alert.mjs +13 -68
  83. package/dist/client/components/ui/badge.mjs +9 -51
  84. package/dist/client/components/ui/button.mjs +8 -54
  85. package/dist/client/components/ui/card.mjs +37 -193
  86. package/dist/client/components/ui/checkbox.mjs +12 -68
  87. package/dist/client/components/ui/command.mjs +48 -219
  88. package/dist/client/components/ui/dialog.mjs +50 -262
  89. package/dist/client/components/ui/drawer.mjs +55 -259
  90. package/dist/client/components/ui/dropdown-menu.mjs +86 -427
  91. package/dist/client/components/ui/empty-state.mjs +28 -98
  92. package/dist/client/components/ui/field.mjs +73 -309
  93. package/dist/client/components/ui/input-group.mjs +42 -167
  94. package/dist/client/components/ui/input.mjs +7 -37
  95. package/dist/client/components/ui/kbd.mjs +6 -36
  96. package/dist/client/components/ui/label.mjs +7 -37
  97. package/dist/client/components/ui/popover.mjs +34 -169
  98. package/dist/client/components/ui/responsive-dialog.mjs +67 -273
  99. package/dist/client/components/ui/scroll-fade.mjs +63 -158
  100. package/dist/client/components/ui/search-input.mjs +33 -100
  101. package/dist/client/components/ui/select.mjs +72 -393
  102. package/dist/client/components/ui/separator.mjs +7 -38
  103. package/dist/client/components/ui/sheet.mjs +49 -269
  104. package/dist/client/components/ui/sidebar.mjs +171 -690
  105. package/dist/client/components/ui/skeleton.mjs +7 -38
  106. package/dist/client/components/ui/sonner.mjs +11 -42
  107. package/dist/client/components/ui/switch.mjs +9 -45
  108. package/dist/client/components/ui/table.mjs +48 -266
  109. package/dist/client/components/ui/tabs.mjs +26 -139
  110. package/dist/client/components/ui/textarea.mjs +6 -32
  111. package/dist/client/components/ui/tooltip.mjs +27 -129
  112. package/dist/client/components/widgets/chart-widget.mjs +174 -522
  113. package/dist/client/components/widgets/progress-widget.mjs +66 -172
  114. package/dist/client/components/widgets/quick-actions-widget.mjs +102 -261
  115. package/dist/client/components/widgets/recent-items-widget.mjs +69 -195
  116. package/dist/client/components/widgets/stats-widget.mjs +41 -175
  117. package/dist/client/components/widgets/table-widget.mjs +9 -9
  118. package/dist/client/components/widgets/timeline-widget.mjs +86 -226
  119. package/dist/client/components/widgets/value-widget.mjs +74 -381
  120. package/dist/client/components/widgets/widget-empty-state.mjs +26 -76
  121. package/dist/client/components/widgets/widget-skeletons.mjs +138 -421
  122. package/dist/client/contexts/focus-context.mjs +63 -146
  123. package/dist/client/hooks/typed-hooks.mjs +241 -701
  124. package/dist/client/hooks/use-action.mjs +62 -198
  125. package/dist/client/hooks/use-admin-config.mjs +5 -35
  126. package/dist/client/hooks/use-admin-preferences.mjs +16 -88
  127. package/dist/client/hooks/use-admin-routes.mjs +22 -56
  128. package/dist/client/hooks/use-audit-history.mjs +21 -69
  129. package/dist/client/hooks/use-brand.mjs +1 -9
  130. package/dist/client/hooks/use-collection-fields.mjs +17 -57
  131. package/dist/client/hooks/use-collection-meta.mjs +12 -44
  132. package/dist/client/hooks/use-collection-schema.mjs +10 -33
  133. package/dist/client/hooks/use-collection-validation.mjs +23 -53
  134. package/dist/client/hooks/use-collection.mjs +194 -614
  135. package/dist/client/hooks/use-current-user.mjs +0 -1
  136. package/dist/client/hooks/use-field-hooks.mjs +10 -10
  137. package/dist/client/hooks/use-field-options.mjs +61 -202
  138. package/dist/client/hooks/use-global-fields.mjs +14 -46
  139. package/dist/client/hooks/use-global-meta.mjs +9 -30
  140. package/dist/client/hooks/use-global-schema.mjs +9 -30
  141. package/dist/client/hooks/use-global.mjs +63 -219
  142. package/dist/client/hooks/use-locks.mjs +117 -325
  143. package/dist/client/hooks/use-media-query.mjs +16 -36
  144. package/dist/client/hooks/use-prefill-params.mjs +0 -1
  145. package/dist/client/hooks/use-questpie-query-options.mjs +12 -29
  146. package/dist/client/hooks/use-reactive-fields.mjs +1 -1
  147. package/dist/client/hooks/use-reactive-prop.mjs +65 -223
  148. package/dist/client/hooks/use-realtime-highlight.mjs +51 -114
  149. package/dist/client/hooks/use-saved-views.mjs +22 -103
  150. package/dist/client/hooks/use-search-param-toggle.mjs +28 -79
  151. package/dist/client/hooks/use-search.mjs +31 -143
  152. package/dist/client/hooks/use-server-actions.mjs +18 -50
  153. package/dist/client/hooks/use-server-validation.mjs +72 -166
  154. package/dist/client/hooks/use-server-widget-data.mjs +7 -33
  155. package/dist/client/hooks/use-setup-status.mjs +12 -25
  156. package/dist/client/hooks/use-sidebar-search-param.mjs +33 -78
  157. package/dist/client/hooks/use-transition-stage.mjs +8 -38
  158. package/dist/client/hooks/use-upload.mjs +54 -152
  159. package/dist/client/hooks/use-validation-error-map.mjs +6 -26
  160. package/dist/client/hooks/use-view-state.mjs +187 -437
  161. package/dist/client/i18n/hooks.mjs +65 -197
  162. package/dist/client/lib/render-profiler.mjs +14 -41
  163. package/dist/client/preview/block-scope-context.mjs +14 -36
  164. package/dist/client/preview/preview-banner.d.mts +2 -2
  165. package/dist/client/preview/preview-banner.mjs +42 -108
  166. package/dist/client/preview/preview-field.d.mts +4 -4
  167. package/dist/client/preview/preview-field.mjs +167 -348
  168. package/dist/client/preview/use-collection-preview.mjs +121 -215
  169. package/dist/client/runtime/content-locales-provider.mjs +31 -83
  170. package/dist/client/runtime/locale-scope.mjs +22 -63
  171. package/dist/client/runtime/provider.mjs +100 -255
  172. package/dist/client/runtime/translations-provider.mjs +41 -107
  173. package/dist/client/scope/picker.mjs +86 -321
  174. package/dist/client/scope/provider.mjs +8 -17
  175. package/dist/client/utils/build-field-definitions-from-schema.mjs +4 -2
  176. package/dist/client/views/auth/accept-invite-form.d.mts +2 -2
  177. package/dist/client/views/auth/accept-invite-form.mjs +121 -412
  178. package/dist/client/views/auth/auth-layout.d.mts +3 -3
  179. package/dist/client/views/auth/auth-layout.mjs +104 -284
  180. package/dist/client/views/auth/forgot-password-form.d.mts +2 -2
  181. package/dist/client/views/auth/forgot-password-form.mjs +94 -325
  182. package/dist/client/views/auth/invite-form.mjs +107 -442
  183. package/dist/client/views/auth/login-form.d.mts +2 -2
  184. package/dist/client/views/auth/login-form.mjs +116 -337
  185. package/dist/client/views/auth/reset-password-form.d.mts +2 -2
  186. package/dist/client/views/auth/reset-password-form.mjs +128 -453
  187. package/dist/client/views/auth/setup-form.d.mts +2 -2
  188. package/dist/client/views/auth/setup-form.mjs +140 -478
  189. package/dist/client/views/collection/auto-form-fields.mjs +243 -615
  190. package/dist/client/views/collection/bulk-action-toolbar.mjs +212 -379
  191. package/dist/client/views/collection/cells/complex-cells.mjs +183 -611
  192. package/dist/client/views/collection/cells/primitive-cells.mjs +116 -356
  193. package/dist/client/views/collection/cells/relation-cells.mjs +86 -233
  194. package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +142 -371
  195. package/dist/client/views/collection/cells/shared/relation-chip.mjs +35 -131
  196. package/dist/client/views/collection/cells/upload-cells.mjs +60 -177
  197. package/dist/client/views/collection/columns/build-columns.mjs +8 -48
  198. package/dist/client/views/collection/field-renderer.mjs +58 -182
  199. package/dist/client/views/collection/form-view.mjs +284 -518
  200. package/dist/client/views/collection/table-view.mjs +231 -463
  201. package/dist/client/views/collection/view-skeletons.mjs +112 -237
  202. package/dist/client/views/common/global-search.mjs +241 -560
  203. package/dist/client/views/dashboard/dashboard-grid.mjs +256 -775
  204. package/dist/client/views/dashboard/dashboard-widget.mjs +38 -126
  205. package/dist/client/views/dashboard/widget-card.mjs +61 -269
  206. package/dist/client/views/globals/global-form-view.mjs +477 -1301
  207. package/dist/client/views/layout/admin-layout-provider.mjs +28 -88
  208. package/dist/client/views/layout/admin-layout.mjs +83 -246
  209. package/dist/client/views/layout/admin-router.mjs +458 -1274
  210. package/dist/client/views/layout/admin-sidebar.mjs +510 -1292
  211. package/dist/client/views/layout/admin-theme.mjs +30 -64
  212. package/dist/client/views/layout/admin-view-layout.mjs +40 -144
  213. package/dist/client/views/pages/accept-invite-page.d.mts +2 -2
  214. package/dist/client/views/pages/accept-invite-page.mjs +95 -290
  215. package/dist/client/views/pages/dashboard-page.d.mts +2 -2
  216. package/dist/client/views/pages/dashboard-page.mjs +11 -57
  217. package/dist/client/views/pages/forgot-password-page.d.mts +2 -2
  218. package/dist/client/views/pages/forgot-password-page.mjs +31 -83
  219. package/dist/client/views/pages/invite-page.d.mts +2 -2
  220. package/dist/client/views/pages/invite-page.mjs +35 -90
  221. package/dist/client/views/pages/login-page.d.mts +2 -2
  222. package/dist/client/views/pages/login-page.mjs +41 -121
  223. package/dist/client/views/pages/reset-password-page.d.mts +2 -2
  224. package/dist/client/views/pages/reset-password-page.mjs +46 -173
  225. package/dist/client/views/pages/setup-page.d.mts +2 -2
  226. package/dist/client/views/pages/setup-page.mjs +33 -95
  227. package/dist/components/rich-text/rich-text-renderer.mjs +9 -33
  228. package/dist/server/adapters/index.d.mts +2 -0
  229. package/dist/server/adapters/nextjs.d.mts +1 -0
  230. package/dist/server/auth-helpers.d.mts +1 -0
  231. package/dist/server/modules/admin/.generated/module.d.mts +1 -0
  232. package/dist/server/modules/admin/collections/account.d.mts +46 -46
  233. package/dist/server/modules/admin/collections/admin-locks.d.mts +50 -50
  234. package/dist/server/modules/admin/collections/admin-preferences.d.mts +39 -39
  235. package/dist/server/modules/admin/collections/admin-saved-views.d.mts +47 -47
  236. package/dist/server/modules/admin/collections/apikey.d.mts +68 -68
  237. package/dist/server/modules/admin/collections/assets.d.mts +39 -39
  238. package/dist/server/modules/admin/collections/session.d.mts +42 -42
  239. package/dist/server/modules/admin/collections/user.d.mts +62 -62
  240. package/dist/server/modules/admin/collections/verification.d.mts +23 -23
  241. package/dist/server/modules/admin/index.d.mts +20 -19
  242. package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
  243. package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
  244. package/dist/server/modules/admin/routes/locales.d.mts +2 -2
  245. package/dist/server/modules/admin/routes/preview.d.mts +11 -11
  246. package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
  247. package/dist/server/modules/admin/routes/setup.d.mts +7 -7
  248. package/dist/server/modules/admin/routes/translations.d.mts +4 -4
  249. package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
  250. package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +45 -45
  251. package/dist/server/modules/audit/.generated/module.d.mts +6 -6
  252. package/dist/server/modules/audit/collections/audit-log.d.mts +78 -78
  253. package/dist/server/modules/audit/jobs/audit-cleanup.d.mts +2 -2
  254. package/dist/server.d.mts +2 -0
  255. package/package.json +3 -5
@@ -2,7 +2,6 @@
2
2
 
3
3
  import { useResolveText } from "../../i18n/hooks.mjs";
4
4
  import { cn } from "../../lib/utils.mjs";
5
- import { c } from "react/compiler-runtime";
6
5
  import { Icon } from "@iconify/react";
7
6
  import { jsx, jsxs } from "react/jsx-runtime";
8
7
 
@@ -22,123 +21,50 @@ import { jsx, jsxs } from "react/jsx-runtime";
22
21
  * />
23
22
  * ```
24
23
  */
25
- function TimeInput(t0) {
26
- const $ = c(29);
27
- const { value, onChange, precision: t1, placeholder: t2, disabled, className, id, "aria-invalid": ariaInvalid } = t0;
28
- const precision = t1 === void 0 ? "minute" : t1;
29
- const placeholder = t2 === void 0 ? "Select time" : t2;
24
+ function TimeInput({ value, onChange, precision = "minute", placeholder = "Select time", disabled, className, id, "aria-invalid": ariaInvalid }) {
30
25
  const resolveText = useResolveText();
31
- let t3;
32
- if ($[0] !== onChange) {
33
- t3 = (e) => {
34
- const timeValue = e.target.value;
35
- onChange(timeValue || null);
36
- };
37
- $[0] = onChange;
38
- $[1] = t3;
39
- } else t3 = $[1];
40
- const handleChange = t3;
41
- let t4;
42
- if ($[2] !== onChange) {
43
- t4 = (e_0) => {
44
- e_0.preventDefault();
45
- e_0.stopPropagation();
46
- onChange(null);
47
- };
48
- $[2] = onChange;
49
- $[3] = t4;
50
- } else t4 = $[3];
51
- const handleClear = t4;
52
- const t5 = disabled && "cursor-not-allowed opacity-50";
53
- const t6 = ariaInvalid && "border-border-strong";
54
- let t7;
55
- if ($[4] !== className || $[5] !== t5 || $[6] !== t6) {
56
- t7 = cn("control-surface font-chrome flex w-full items-center gap-2 px-3 py-2 text-sm", "focus-within:border-border-strong focus-within:ring-ring/20 focus-within:ring-3", t5, t6, className);
57
- $[4] = className;
58
- $[5] = t5;
59
- $[6] = t6;
60
- $[7] = t7;
61
- } else t7 = $[7];
62
- let t8;
63
- if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
64
- t8 = /* @__PURE__ */ jsx(Icon, {
65
- icon: "ph:clock",
66
- className: "text-muted-foreground size-4"
67
- });
68
- $[8] = t8;
69
- } else t8 = $[8];
70
- const t9 = value ?? "";
71
- const t10 = precision === "second" ? 1 : 60;
72
- let t11;
73
- if ($[9] !== placeholder || $[10] !== resolveText) {
74
- t11 = resolveText(placeholder);
75
- $[9] = placeholder;
76
- $[10] = resolveText;
77
- $[11] = t11;
78
- } else t11 = $[11];
79
- let t12;
80
- if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
81
- t12 = cn("flex-1 bg-transparent outline-none", "placeholder:text-muted-foreground", "disabled:cursor-not-allowed", "[&::-webkit-calendar-picker-indicator]:hidden");
82
- $[12] = t12;
83
- } else t12 = $[12];
84
- let t13;
85
- if ($[13] !== ariaInvalid || $[14] !== disabled || $[15] !== handleChange || $[16] !== id || $[17] !== t10 || $[18] !== t11 || $[19] !== t9) {
86
- t13 = /* @__PURE__ */ jsx("input", {
87
- type: "time",
88
- id,
89
- value: t9,
90
- onChange: handleChange,
91
- step: t10,
92
- disabled,
93
- "aria-invalid": ariaInvalid,
94
- placeholder: t11,
95
- className: t12
96
- });
97
- $[13] = ariaInvalid;
98
- $[14] = disabled;
99
- $[15] = handleChange;
100
- $[16] = id;
101
- $[17] = t10;
102
- $[18] = t11;
103
- $[19] = t9;
104
- $[20] = t13;
105
- } else t13 = $[20];
106
- let t14;
107
- if ($[21] !== disabled || $[22] !== handleClear || $[23] !== value) {
108
- t14 = value && !disabled && /* @__PURE__ */ jsx("button", {
109
- type: "button",
110
- onClick: handleClear,
111
- className: "text-muted-foreground hover:text-foreground",
112
- tabIndex: -1,
113
- children: /* @__PURE__ */ jsx(Icon, {
114
- icon: "ph:x",
115
- className: "size-4"
116
- })
117
- });
118
- $[21] = disabled;
119
- $[22] = handleClear;
120
- $[23] = value;
121
- $[24] = t14;
122
- } else t14 = $[24];
123
- let t15;
124
- if ($[25] !== t13 || $[26] !== t14 || $[27] !== t7) {
125
- t15 = /* @__PURE__ */ jsx("div", {
126
- className: "qa-time-input relative",
127
- children: /* @__PURE__ */ jsxs("div", {
128
- className: t7,
129
- children: [
130
- t8,
131
- t13,
132
- t14
133
- ]
134
- })
135
- });
136
- $[25] = t13;
137
- $[26] = t14;
138
- $[27] = t7;
139
- $[28] = t15;
140
- } else t15 = $[28];
141
- return t15;
26
+ const handleChange = (e) => {
27
+ const timeValue = e.target.value;
28
+ onChange(timeValue || null);
29
+ };
30
+ const handleClear = (e) => {
31
+ e.preventDefault();
32
+ e.stopPropagation();
33
+ onChange(null);
34
+ };
35
+ return /* @__PURE__ */ jsx("div", {
36
+ className: "qa-time-input relative",
37
+ children: /* @__PURE__ */ jsxs("div", {
38
+ className: cn("control-surface font-chrome flex w-full items-center gap-2 px-3 py-2 text-sm", "focus-within:border-border-strong focus-within:ring-ring/20 focus-within:ring-3", disabled && "cursor-not-allowed opacity-50", ariaInvalid && "border-border-strong", className),
39
+ children: [
40
+ /* @__PURE__ */ jsx(Icon, {
41
+ icon: "ph:clock",
42
+ className: "text-muted-foreground size-4"
43
+ }),
44
+ /* @__PURE__ */ jsx("input", {
45
+ type: "time",
46
+ id,
47
+ value: value ?? "",
48
+ onChange: handleChange,
49
+ step: precision === "second" ? 1 : 60,
50
+ disabled,
51
+ "aria-invalid": ariaInvalid,
52
+ placeholder: resolveText(placeholder),
53
+ className: cn("flex-1 bg-transparent outline-none", "placeholder:text-muted-foreground", "disabled:cursor-not-allowed", "[&::-webkit-calendar-picker-indicator]:hidden")
54
+ }),
55
+ value && !disabled && /* @__PURE__ */ jsx("button", {
56
+ type: "button",
57
+ onClick: handleClear,
58
+ className: "text-muted-foreground hover:text-foreground",
59
+ tabIndex: -1,
60
+ children: /* @__PURE__ */ jsx(Icon, {
61
+ icon: "ph:x",
62
+ className: "size-4"
63
+ })
64
+ })
65
+ ]
66
+ })
67
+ });
142
68
  }
143
69
 
144
70
  //#endregion
@@ -1,6 +1,5 @@
1
1
  import { cn } from "../../lib/utils.mjs";
2
2
  import { Switch } from "../ui/switch.mjs";
3
- import { c } from "react/compiler-runtime";
4
3
  import { jsx } from "react/jsx-runtime";
5
4
 
6
5
  //#region src/client/components/primitives/toggle-input.tsx
@@ -17,34 +16,15 @@ import { jsx } from "react/jsx-runtime";
17
16
  * />
18
17
  * ```
19
18
  */
20
- function ToggleInput(t0) {
21
- const $ = c(9);
22
- const { value, onChange, disabled, className, id, "aria-invalid": ariaInvalid } = t0;
23
- let t1;
24
- if ($[0] !== className) {
25
- t1 = cn("qa-toggle-input", className);
26
- $[0] = className;
27
- $[1] = t1;
28
- } else t1 = $[1];
29
- let t2;
30
- if ($[2] !== ariaInvalid || $[3] !== disabled || $[4] !== id || $[5] !== onChange || $[6] !== t1 || $[7] !== value) {
31
- t2 = /* @__PURE__ */ jsx(Switch, {
32
- id,
33
- checked: value,
34
- onCheckedChange: onChange,
35
- disabled,
36
- "aria-invalid": ariaInvalid,
37
- className: t1
38
- });
39
- $[2] = ariaInvalid;
40
- $[3] = disabled;
41
- $[4] = id;
42
- $[5] = onChange;
43
- $[6] = t1;
44
- $[7] = value;
45
- $[8] = t2;
46
- } else t2 = $[8];
47
- return t2;
19
+ function ToggleInput({ value, onChange, disabled, className, id, "aria-invalid": ariaInvalid }) {
20
+ return /* @__PURE__ */ jsx(Switch, {
21
+ id,
22
+ checked: value,
23
+ onCheckedChange: onChange,
24
+ disabled,
25
+ "aria-invalid": ariaInvalid,
26
+ className: cn("qa-toggle-input", className)
27
+ });
48
28
  }
49
29
 
50
30
  //#endregion
@@ -3,85 +3,76 @@ import { LocaleScopeProvider } from "../../runtime/locale-scope.mjs";
3
3
  import { Sheet, SheetContent } from "../ui/sheet.mjs";
4
4
  import FormView from "../../views/collection/form-view.mjs";
5
5
  import GlobalFormView from "../../views/globals/global-form-view.mjs";
6
- import { c } from "react/compiler-runtime";
7
- import "react";
6
+ import * as React from "react";
8
7
  import { jsx } from "react/jsx-runtime";
9
8
 
10
9
  //#region src/client/components/sheets/resource-sheet.tsx
10
+ /**
11
+ * ResourceSheet Component
12
+ *
13
+ * Universal sheet component for viewing/editing collections and globals.
14
+ * Uses FormView/GlobalFormView internally for consistent UI and behavior.
15
+ * Container queries provide automatic responsive layout.
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * // Collection usage
20
+ * <ResourceSheet
21
+ * type="collection"
22
+ * collection="posts"
23
+ * itemId="123"
24
+ * open={isOpen}
25
+ * onOpenChange={setIsOpen}
26
+ * onSave={(data) => console.log('Saved:', data)}
27
+ * />
28
+ *
29
+ * // Global usage
30
+ * <ResourceSheet
31
+ * type="global"
32
+ * global="siteSettings"
33
+ * open={isOpen}
34
+ * onOpenChange={setIsOpen}
35
+ * onSave={(data) => console.log('Saved:', data)}
36
+ * />
37
+ * ```
38
+ */
11
39
  function ResourceSheet(props) {
12
- const $ = c(19);
13
- const { open, onOpenChange, onSave, side: t0 } = props;
14
- const side = t0 === void 0 ? "right" : t0;
40
+ const { open, onOpenChange, onSave, side = "right" } = props;
15
41
  const navigate = useAdminStore(selectNavigate);
16
42
  const basePath = useAdminStore(selectBasePath);
17
- let t1;
18
- if ($[0] !== onOpenChange || $[1] !== onSave) {
19
- t1 = (data) => {
20
- onSave?.(data);
21
- onOpenChange(false);
22
- };
23
- $[0] = onOpenChange;
24
- $[1] = onSave;
25
- $[2] = t1;
26
- } else t1 = $[2];
27
- const handleSuccess = t1;
28
- let t2;
29
- if ($[3] !== basePath || $[4] !== handleSuccess || $[5] !== navigate || $[6] !== props.collection || $[7] !== props.defaultValues || $[8] !== props.global || $[9] !== props.itemId || $[10] !== props.type) {
30
- t2 = /* @__PURE__ */ jsx(LocaleScopeProvider, { children: props.type === "collection" ? /* @__PURE__ */ jsx(FormView, {
31
- collection: props.collection,
32
- id: props.itemId,
33
- defaultValues: props.defaultValues,
34
- config: void 0,
35
- allCollectionsConfig: void 0,
36
- navigate,
37
- basePath,
38
- onSuccess: handleSuccess,
39
- showMeta: false
40
- }) : /* @__PURE__ */ jsx(GlobalFormView, {
41
- global: props.global,
42
- config: void 0,
43
- allGlobalsConfig: void 0,
44
- navigate,
45
- basePath,
46
- onSuccess: handleSuccess,
47
- showMeta: false
48
- }) });
49
- $[3] = basePath;
50
- $[4] = handleSuccess;
51
- $[5] = navigate;
52
- $[6] = props.collection;
53
- $[7] = props.defaultValues;
54
- $[8] = props.global;
55
- $[9] = props.itemId;
56
- $[10] = props.type;
57
- $[11] = t2;
58
- } else t2 = $[11];
59
- let t3;
60
- if ($[12] !== side || $[13] !== t2) {
61
- t3 = /* @__PURE__ */ jsx(SheetContent, {
43
+ const handleSuccess = React.useCallback((data) => {
44
+ onSave?.(data);
45
+ onOpenChange(false);
46
+ }, [onSave, onOpenChange]);
47
+ return /* @__PURE__ */ jsx(Sheet, {
48
+ open,
49
+ onOpenChange,
50
+ modal: false,
51
+ children: /* @__PURE__ */ jsx(SheetContent, {
62
52
  side,
63
53
  showOverlay: false,
64
54
  className: "qa-resource-sheet overflow-y-auto p-6 pt-12",
65
- children: t2
66
- });
67
- $[12] = side;
68
- $[13] = t2;
69
- $[14] = t3;
70
- } else t3 = $[14];
71
- let t4;
72
- if ($[15] !== onOpenChange || $[16] !== open || $[17] !== t3) {
73
- t4 = /* @__PURE__ */ jsx(Sheet, {
74
- open,
75
- onOpenChange,
76
- modal: false,
77
- children: t3
78
- });
79
- $[15] = onOpenChange;
80
- $[16] = open;
81
- $[17] = t3;
82
- $[18] = t4;
83
- } else t4 = $[18];
84
- return t4;
55
+ children: /* @__PURE__ */ jsx(LocaleScopeProvider, { children: props.type === "collection" ? /* @__PURE__ */ jsx(FormView, {
56
+ collection: props.collection,
57
+ id: props.itemId,
58
+ defaultValues: props.defaultValues,
59
+ config: void 0,
60
+ allCollectionsConfig: void 0,
61
+ navigate,
62
+ basePath,
63
+ onSuccess: handleSuccess,
64
+ showMeta: false
65
+ }) : /* @__PURE__ */ jsx(GlobalFormView, {
66
+ global: props.global,
67
+ config: void 0,
68
+ allGlobalsConfig: void 0,
69
+ navigate,
70
+ basePath,
71
+ onSuccess: handleSuccess,
72
+ showMeta: false
73
+ }) })
74
+ })
75
+ });
85
76
  }
86
77
 
87
78
  //#endregion
@@ -1,168 +1,48 @@
1
1
  import { cn } from "../../lib/utils.mjs";
2
- import { c } from "react/compiler-runtime";
3
2
  import { Icon } from "@iconify/react";
4
3
  import { jsx, jsxs } from "react/jsx-runtime";
5
4
  import { Accordion } from "@base-ui/react/accordion";
6
5
 
7
6
  //#region src/client/components/ui/accordion.tsx
8
- function Accordion$1(t0) {
9
- const $ = c(8);
10
- let className;
11
- let props;
12
- if ($[0] !== t0) {
13
- ({className, ...props} = t0);
14
- $[0] = t0;
15
- $[1] = className;
16
- $[2] = props;
17
- } else {
18
- className = $[1];
19
- props = $[2];
20
- }
21
- let t1;
22
- if ($[3] !== className) {
23
- t1 = cn("qa-accordion border-border bg-card flex w-full flex-col overflow-hidden border", className);
24
- $[3] = className;
25
- $[4] = t1;
26
- } else t1 = $[4];
27
- let t2;
28
- if ($[5] !== props || $[6] !== t1) {
29
- t2 = /* @__PURE__ */ jsx(Accordion.Root, {
30
- "data-slot": "accordion",
31
- className: t1,
32
- ...props
33
- });
34
- $[5] = props;
35
- $[6] = t1;
36
- $[7] = t2;
37
- } else t2 = $[7];
38
- return t2;
7
+ function Accordion$1({ className, ...props }) {
8
+ return /* @__PURE__ */ jsx(Accordion.Root, {
9
+ "data-slot": "accordion",
10
+ className: cn("qa-accordion border-border bg-card flex w-full flex-col overflow-hidden border", className),
11
+ ...props
12
+ });
39
13
  }
40
- function AccordionItem(t0) {
41
- const $ = c(8);
42
- let className;
43
- let props;
44
- if ($[0] !== t0) {
45
- ({className, ...props} = t0);
46
- $[0] = t0;
47
- $[1] = className;
48
- $[2] = props;
49
- } else {
50
- className = $[1];
51
- props = $[2];
52
- }
53
- let t1;
54
- if ($[3] !== className) {
55
- t1 = cn("qa-accordion__item data-open:bg-muted border-border transition-colors not-last:border-b", className);
56
- $[3] = className;
57
- $[4] = t1;
58
- } else t1 = $[4];
59
- let t2;
60
- if ($[5] !== props || $[6] !== t1) {
61
- t2 = /* @__PURE__ */ jsx(Accordion.Item, {
62
- "data-slot": "accordion-item",
63
- className: t1,
64
- ...props
65
- });
66
- $[5] = props;
67
- $[6] = t1;
68
- $[7] = t2;
69
- } else t2 = $[7];
70
- return t2;
14
+ function AccordionItem({ className, ...props }) {
15
+ return /* @__PURE__ */ jsx(Accordion.Item, {
16
+ "data-slot": "accordion-item",
17
+ className: cn("qa-accordion__item data-open:bg-muted border-border transition-colors not-last:border-b", className),
18
+ ...props
19
+ });
71
20
  }
72
- function AccordionTrigger(t0) {
73
- const $ = c(11);
74
- let children;
75
- let className;
76
- let props;
77
- if ($[0] !== t0) {
78
- ({className, children, ...props} = t0);
79
- $[0] = t0;
80
- $[1] = children;
81
- $[2] = className;
82
- $[3] = props;
83
- } else {
84
- children = $[1];
85
- className = $[2];
86
- props = $[3];
87
- }
88
- let t1;
89
- if ($[4] !== className) {
90
- t1 = cn("qa-accordion__trigger **:data-[slot=accordion-trigger-icon]:text-muted-foreground hover:bg-muted group/accordion-trigger relative flex min-h-10 flex-1 items-center justify-between gap-4 px-4 py-3 text-left text-sm font-medium transition-[background-color,color,transform] duration-[var(--motion-duration-base)] ease-[var(--motion-ease-standard)] outline-none active:scale-[0.96] disabled:pointer-events-none disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 motion-reduce:transition-none motion-reduce:active:scale-100", className);
91
- $[4] = className;
92
- $[5] = t1;
93
- } else t1 = $[5];
94
- let t2;
95
- if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
96
- t2 = /* @__PURE__ */ jsx(Icon, {
97
- icon: "ph:caret-down",
98
- "data-slot": "accordion-trigger-icon",
99
- className: "pointer-events-none shrink-0 transition-transform duration-[var(--motion-duration-base)] ease-[var(--motion-ease-standard)] group-aria-expanded/accordion-trigger:rotate-180 motion-reduce:transition-none"
100
- });
101
- $[6] = t2;
102
- } else t2 = $[6];
103
- let t3;
104
- if ($[7] !== children || $[8] !== props || $[9] !== t1) {
105
- t3 = /* @__PURE__ */ jsx(Accordion.Header, {
106
- className: "flex",
107
- children: /* @__PURE__ */ jsxs(Accordion.Trigger, {
108
- "data-slot": "accordion-trigger",
109
- className: t1,
110
- ...props,
111
- children: [children, t2]
112
- })
113
- });
114
- $[7] = children;
115
- $[8] = props;
116
- $[9] = t1;
117
- $[10] = t3;
118
- } else t3 = $[10];
119
- return t3;
21
+ function AccordionTrigger({ className, children, ...props }) {
22
+ return /* @__PURE__ */ jsx(Accordion.Header, {
23
+ className: "flex",
24
+ children: /* @__PURE__ */ jsxs(Accordion.Trigger, {
25
+ "data-slot": "accordion-trigger",
26
+ className: cn("qa-accordion__trigger **:data-[slot=accordion-trigger-icon]:text-muted-foreground hover:bg-muted group/accordion-trigger relative flex min-h-10 flex-1 items-center justify-between gap-4 px-4 py-3 text-left text-sm font-medium transition-[background-color,color,transform] duration-[var(--motion-duration-base)] ease-[var(--motion-ease-standard)] outline-none active:scale-[0.96] disabled:pointer-events-none disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 motion-reduce:transition-none motion-reduce:active:scale-100", className),
27
+ ...props,
28
+ children: [children, /* @__PURE__ */ jsx(Icon, {
29
+ icon: "ph:caret-down",
30
+ "data-slot": "accordion-trigger-icon",
31
+ className: "pointer-events-none shrink-0 transition-transform duration-[var(--motion-duration-base)] ease-[var(--motion-ease-standard)] group-aria-expanded/accordion-trigger:rotate-180 motion-reduce:transition-none"
32
+ })]
33
+ })
34
+ });
120
35
  }
121
- function AccordionContent(t0) {
122
- const $ = c(12);
123
- let children;
124
- let className;
125
- let props;
126
- if ($[0] !== t0) {
127
- ({className, children, ...props} = t0);
128
- $[0] = t0;
129
- $[1] = children;
130
- $[2] = className;
131
- $[3] = props;
132
- } else {
133
- children = $[1];
134
- className = $[2];
135
- props = $[3];
136
- }
137
- let t1;
138
- if ($[4] !== className) {
139
- t1 = cn("[&_a]:hover:text-foreground h-(--accordion-panel-height) px-4 pt-0 pb-4 text-sm opacity-100 transition-[height,opacity] duration-[var(--motion-duration-slow)] ease-[var(--motion-ease-enter)] data-ending-style:h-0 data-ending-style:opacity-0 data-starting-style:h-0 data-starting-style:opacity-0 motion-reduce:transition-none [&_a]:underline [&_a]:underline-offset-3 [&_p:not(:last-child)]:mb-4", className);
140
- $[4] = className;
141
- $[5] = t1;
142
- } else t1 = $[5];
143
- let t2;
144
- if ($[6] !== children || $[7] !== t1) {
145
- t2 = /* @__PURE__ */ jsx("div", {
146
- className: t1,
36
+ function AccordionContent({ className, children, ...props }) {
37
+ return /* @__PURE__ */ jsx(Accordion.Panel, {
38
+ "data-slot": "accordion-content",
39
+ className: "qa-accordion__content overflow-hidden",
40
+ ...props,
41
+ children: /* @__PURE__ */ jsx("div", {
42
+ className: cn("[&_a]:hover:text-foreground h-(--accordion-panel-height) px-4 pt-0 pb-4 text-sm opacity-100 transition-[height,opacity] duration-[var(--motion-duration-slow)] ease-[var(--motion-ease-enter)] data-ending-style:h-0 data-ending-style:opacity-0 data-starting-style:h-0 data-starting-style:opacity-0 motion-reduce:transition-none [&_a]:underline [&_a]:underline-offset-3 [&_p:not(:last-child)]:mb-4", className),
147
43
  children
148
- });
149
- $[6] = children;
150
- $[7] = t1;
151
- $[8] = t2;
152
- } else t2 = $[8];
153
- let t3;
154
- if ($[9] !== props || $[10] !== t2) {
155
- t3 = /* @__PURE__ */ jsx(Accordion.Panel, {
156
- "data-slot": "accordion-content",
157
- className: "qa-accordion__content overflow-hidden",
158
- ...props,
159
- children: t2
160
- });
161
- $[9] = props;
162
- $[10] = t2;
163
- $[11] = t3;
164
- } else t3 = $[11];
165
- return t3;
44
+ })
45
+ });
166
46
  }
167
47
 
168
48
  //#endregion
@@ -1,5 +1,4 @@
1
1
  import { cn } from "../../lib/utils.mjs";
2
- import { c } from "react/compiler-runtime";
3
2
  import { jsx } from "react/jsx-runtime";
4
3
  import { cva } from "class-variance-authority";
5
4
 
@@ -11,74 +10,20 @@ const alertVariants = cva("qa-alert group/alert border-border-subtle bg-card tex
11
10
  } },
12
11
  defaultVariants: { variant: "default" }
13
12
  });
14
- function Alert(t0) {
15
- const $ = c(10);
16
- let className;
17
- let props;
18
- let variant;
19
- if ($[0] !== t0) {
20
- ({className, variant, ...props} = t0);
21
- $[0] = t0;
22
- $[1] = className;
23
- $[2] = props;
24
- $[3] = variant;
25
- } else {
26
- className = $[1];
27
- props = $[2];
28
- variant = $[3];
29
- }
30
- let t1;
31
- if ($[4] !== className || $[5] !== variant) {
32
- t1 = cn(alertVariants({ variant }), className);
33
- $[4] = className;
34
- $[5] = variant;
35
- $[6] = t1;
36
- } else t1 = $[6];
37
- let t2;
38
- if ($[7] !== props || $[8] !== t1) {
39
- t2 = /* @__PURE__ */ jsx("div", {
40
- "data-slot": "alert",
41
- role: "alert",
42
- className: t1,
43
- ...props
44
- });
45
- $[7] = props;
46
- $[8] = t1;
47
- $[9] = t2;
48
- } else t2 = $[9];
49
- return t2;
13
+ function Alert({ className, variant, ...props }) {
14
+ return /* @__PURE__ */ jsx("div", {
15
+ "data-slot": "alert",
16
+ role: "alert",
17
+ className: cn(alertVariants({ variant }), className),
18
+ ...props
19
+ });
50
20
  }
51
- function AlertDescription(t0) {
52
- const $ = c(8);
53
- let className;
54
- let props;
55
- if ($[0] !== t0) {
56
- ({className, ...props} = t0);
57
- $[0] = t0;
58
- $[1] = className;
59
- $[2] = props;
60
- } else {
61
- className = $[1];
62
- props = $[2];
63
- }
64
- let t1;
65
- if ($[3] !== className) {
66
- t1 = cn("qa-alert__description text-muted-foreground [&_a]:hover:text-foreground text-xs/relaxed text-balance md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_p:not(:last-child)]:mb-4", className);
67
- $[3] = className;
68
- $[4] = t1;
69
- } else t1 = $[4];
70
- let t2;
71
- if ($[5] !== props || $[6] !== t1) {
72
- t2 = /* @__PURE__ */ jsx("div", {
73
- "data-slot": "alert-description",
74
- className: t1,
75
- ...props
76
- });
77
- $[5] = props;
78
- $[6] = t1;
79
- $[7] = t2;
80
- } else t2 = $[7];
81
- return t2;
21
+ function AlertDescription({ className, ...props }) {
22
+ return /* @__PURE__ */ jsx("div", {
23
+ "data-slot": "alert-description",
24
+ className: cn("qa-alert__description text-muted-foreground [&_a]:hover:text-foreground text-xs/relaxed text-balance md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_p:not(:last-child)]:mb-4", className),
25
+ ...props
26
+ });
82
27
  }
83
28
 
84
29
  //#endregion