@questpie/admin 3.2.3 → 3.2.5

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 (244) 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 +106 -220
  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 +107 -313
  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 -182
  47. package/dist/client/components/fields/rich-text-editor/image-popover.mjs +8 -19
  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 +196 -530
  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 +39 -74
  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 +306 -611
  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 +177 -494
  68. package/dist/client/components/preview/live-preview-mode.mjs +240 -438
  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 +200 -559
  77. package/dist/client/components/primitives/select-single.mjs +165 -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.d.mts +4 -0
  123. package/dist/client/contexts/focus-context.mjs +87 -150
  124. package/dist/client/hooks/typed-hooks.mjs +241 -701
  125. package/dist/client/hooks/use-action.mjs +62 -198
  126. package/dist/client/hooks/use-admin-config.mjs +5 -35
  127. package/dist/client/hooks/use-admin-preferences.mjs +16 -88
  128. package/dist/client/hooks/use-admin-routes.mjs +22 -56
  129. package/dist/client/hooks/use-audit-history.mjs +21 -69
  130. package/dist/client/hooks/use-brand.mjs +1 -9
  131. package/dist/client/hooks/use-collection-fields.mjs +17 -57
  132. package/dist/client/hooks/use-collection-meta.mjs +12 -44
  133. package/dist/client/hooks/use-collection-schema.mjs +10 -33
  134. package/dist/client/hooks/use-collection-validation.mjs +23 -53
  135. package/dist/client/hooks/use-collection.mjs +194 -614
  136. package/dist/client/hooks/use-current-user.mjs +0 -1
  137. package/dist/client/hooks/use-field-hooks.mjs +10 -10
  138. package/dist/client/hooks/use-field-options.mjs +61 -202
  139. package/dist/client/hooks/use-global-fields.mjs +14 -46
  140. package/dist/client/hooks/use-global-meta.mjs +9 -30
  141. package/dist/client/hooks/use-global-schema.mjs +9 -30
  142. package/dist/client/hooks/use-global.mjs +63 -219
  143. package/dist/client/hooks/use-locks.mjs +117 -325
  144. package/dist/client/hooks/use-media-query.mjs +16 -36
  145. package/dist/client/hooks/use-prefill-params.mjs +0 -1
  146. package/dist/client/hooks/use-questpie-query-options.mjs +12 -29
  147. package/dist/client/hooks/use-reactive-fields.mjs +1 -1
  148. package/dist/client/hooks/use-reactive-prop.mjs +65 -223
  149. package/dist/client/hooks/use-realtime-highlight.mjs +51 -114
  150. package/dist/client/hooks/use-saved-views.mjs +22 -103
  151. package/dist/client/hooks/use-search-param-toggle.mjs +28 -79
  152. package/dist/client/hooks/use-search.mjs +31 -143
  153. package/dist/client/hooks/use-server-actions.mjs +18 -50
  154. package/dist/client/hooks/use-server-validation.mjs +72 -166
  155. package/dist/client/hooks/use-server-widget-data.mjs +7 -33
  156. package/dist/client/hooks/use-setup-status.mjs +12 -25
  157. package/dist/client/hooks/use-sidebar-search-param.mjs +33 -78
  158. package/dist/client/hooks/use-transition-stage.mjs +8 -38
  159. package/dist/client/hooks/use-upload.mjs +54 -152
  160. package/dist/client/hooks/use-validation-error-map.mjs +6 -26
  161. package/dist/client/hooks/use-view-state.mjs +187 -437
  162. package/dist/client/i18n/hooks.mjs +65 -197
  163. package/dist/client/lib/render-profiler.mjs +14 -41
  164. package/dist/client/preview/block-scope-context.d.mts +2 -2
  165. package/dist/client/preview/block-scope-context.mjs +14 -36
  166. package/dist/client/preview/diff.mjs +110 -0
  167. package/dist/client/preview/preview-banner.mjs +42 -108
  168. package/dist/client/preview/preview-field.d.mts +4 -4
  169. package/dist/client/preview/preview-field.mjs +166 -409
  170. package/dist/client/preview/use-collection-preview.mjs +135 -201
  171. package/dist/client/runtime/content-locales-provider.mjs +31 -83
  172. package/dist/client/runtime/locale-scope.mjs +22 -63
  173. package/dist/client/runtime/provider.mjs +100 -255
  174. package/dist/client/runtime/translations-provider.mjs +41 -107
  175. package/dist/client/scope/picker.d.mts +2 -2
  176. package/dist/client/scope/picker.mjs +86 -321
  177. package/dist/client/scope/provider.d.mts +2 -2
  178. package/dist/client/scope/provider.mjs +8 -17
  179. package/dist/client/views/auth/accept-invite-form.d.mts +2 -2
  180. package/dist/client/views/auth/accept-invite-form.mjs +121 -412
  181. package/dist/client/views/auth/auth-layout.d.mts +3 -3
  182. package/dist/client/views/auth/auth-layout.mjs +104 -284
  183. package/dist/client/views/auth/forgot-password-form.d.mts +2 -2
  184. package/dist/client/views/auth/forgot-password-form.mjs +94 -325
  185. package/dist/client/views/auth/invite-form.mjs +107 -442
  186. package/dist/client/views/auth/login-form.d.mts +2 -2
  187. package/dist/client/views/auth/login-form.mjs +116 -337
  188. package/dist/client/views/auth/reset-password-form.mjs +128 -453
  189. package/dist/client/views/auth/setup-form.mjs +140 -478
  190. package/dist/client/views/collection/auto-form-fields.mjs +243 -615
  191. package/dist/client/views/collection/bulk-action-toolbar.mjs +212 -400
  192. package/dist/client/views/collection/cells/complex-cells.mjs +183 -611
  193. package/dist/client/views/collection/cells/primitive-cells.mjs +109 -363
  194. package/dist/client/views/collection/cells/relation-cells.mjs +86 -233
  195. package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +142 -371
  196. package/dist/client/views/collection/cells/shared/relation-chip.mjs +35 -131
  197. package/dist/client/views/collection/cells/upload-cells.mjs +60 -177
  198. package/dist/client/views/collection/columns/build-columns.mjs +8 -48
  199. package/dist/client/views/collection/field-renderer.mjs +11 -24
  200. package/dist/client/views/collection/form-view.mjs +288 -560
  201. package/dist/client/views/collection/table-view.mjs +239 -469
  202. package/dist/client/views/collection/view-skeletons.mjs +112 -237
  203. package/dist/client/views/common/global-search.mjs +241 -543
  204. package/dist/client/views/dashboard/dashboard-grid.mjs +256 -775
  205. package/dist/client/views/dashboard/dashboard-widget.mjs +38 -126
  206. package/dist/client/views/dashboard/widget-card.mjs +61 -269
  207. package/dist/client/views/globals/global-form-view.mjs +478 -1298
  208. package/dist/client/views/layout/admin-layout-provider.mjs +28 -88
  209. package/dist/client/views/layout/admin-layout.mjs +83 -246
  210. package/dist/client/views/layout/admin-router.mjs +457 -1289
  211. package/dist/client/views/layout/admin-sidebar.mjs +510 -1292
  212. package/dist/client/views/layout/admin-theme.mjs +30 -64
  213. package/dist/client/views/layout/admin-view-layout.mjs +40 -144
  214. package/dist/client/views/pages/accept-invite-page.mjs +95 -290
  215. package/dist/client/views/pages/dashboard-page.mjs +11 -57
  216. package/dist/client/views/pages/forgot-password-page.mjs +31 -83
  217. package/dist/client/views/pages/invite-page.mjs +35 -90
  218. package/dist/client/views/pages/login-page.mjs +41 -121
  219. package/dist/client/views/pages/reset-password-page.d.mts +2 -2
  220. package/dist/client/views/pages/reset-password-page.mjs +46 -173
  221. package/dist/client/views/pages/setup-page.d.mts +2 -2
  222. package/dist/client/views/pages/setup-page.mjs +33 -95
  223. package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
  224. package/dist/components/rich-text/rich-text-renderer.mjs +9 -33
  225. package/dist/server/modules/admin/collections/account.d.mts +50 -50
  226. package/dist/server/modules/admin/collections/admin-locks.d.mts +54 -54
  227. package/dist/server/modules/admin/collections/admin-preferences.d.mts +39 -39
  228. package/dist/server/modules/admin/collections/admin-saved-views.d.mts +47 -47
  229. package/dist/server/modules/admin/collections/apikey.d.mts +68 -68
  230. package/dist/server/modules/admin/collections/assets.d.mts +34 -34
  231. package/dist/server/modules/admin/collections/session.d.mts +42 -42
  232. package/dist/server/modules/admin/collections/user.d.mts +53 -53
  233. package/dist/server/modules/admin/collections/verification.d.mts +36 -36
  234. package/dist/server/modules/admin/index.d.mts +21 -20
  235. package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
  236. package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
  237. package/dist/server/modules/admin/routes/locales.d.mts +2 -2
  238. package/dist/server/modules/admin/routes/preview.d.mts +11 -11
  239. package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
  240. package/dist/server/modules/admin/routes/setup.d.mts +7 -7
  241. package/dist/server/modules/admin/routes/translations.d.mts +4 -4
  242. package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
  243. package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +27 -27
  244. package/package.json +3 -5
@@ -4,7 +4,6 @@ import { cn } from "../../lib/utils.mjs";
4
4
  import { DialogContent, DialogFooter, DialogHeader } from "./dialog.mjs";
5
5
  import { useIsMobile } from "../../hooks/use-media-query.mjs";
6
6
  import { Drawer, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle } from "./drawer.mjs";
7
- import { c } from "react/compiler-runtime";
8
7
  import * as React from "react";
9
8
  import { jsx } from "react/jsx-runtime";
10
9
  import { Dialog } from "@base-ui/react/dialog";
@@ -16,292 +15,87 @@ function useResponsiveDialog() {
16
15
  if (!context) throw new Error("ResponsiveDialog components must be used within ResponsiveDialog");
17
16
  return context;
18
17
  }
19
- function ResponsiveDialog(t0) {
20
- const $ = c(16);
21
- const { children, open, onOpenChange } = t0;
18
+ function ResponsiveDialog({ children, open, onOpenChange }) {
22
19
  const isMobile = useIsMobile();
23
- let t1;
24
- if ($[0] !== isMobile) {
25
- t1 = { isMobile };
26
- $[0] = isMobile;
27
- $[1] = t1;
28
- } else t1 = $[1];
29
- const contextValue = t1;
30
- if (isMobile) {
31
- let t2$1;
32
- if ($[2] !== children || $[3] !== onOpenChange || $[4] !== open) {
33
- t2$1 = /* @__PURE__ */ jsx(Drawer, {
34
- open,
35
- onOpenChange,
36
- children
37
- });
38
- $[2] = children;
39
- $[3] = onOpenChange;
40
- $[4] = open;
41
- $[5] = t2$1;
42
- } else t2$1 = $[5];
43
- let t3$1;
44
- if ($[6] !== contextValue || $[7] !== t2$1) {
45
- t3$1 = /* @__PURE__ */ jsx(ResponsiveDialogContext.Provider, {
46
- value: contextValue,
47
- children: t2$1
48
- });
49
- $[6] = contextValue;
50
- $[7] = t2$1;
51
- $[8] = t3$1;
52
- } else t3$1 = $[8];
53
- return t3$1;
54
- }
55
- let t2;
56
- if ($[9] !== children || $[10] !== onOpenChange || $[11] !== open) {
57
- t2 = /* @__PURE__ */ jsx(Dialog.Root, {
20
+ const contextValue = React.useMemo(() => ({ isMobile }), [isMobile]);
21
+ if (isMobile) return /* @__PURE__ */ jsx(ResponsiveDialogContext.Provider, {
22
+ value: contextValue,
23
+ children: /* @__PURE__ */ jsx(Drawer, {
58
24
  open,
59
25
  onOpenChange,
60
26
  children
61
- });
62
- $[9] = children;
63
- $[10] = onOpenChange;
64
- $[11] = open;
65
- $[12] = t2;
66
- } else t2 = $[12];
67
- let t3;
68
- if ($[13] !== contextValue || $[14] !== t2) {
69
- t3 = /* @__PURE__ */ jsx(ResponsiveDialogContext.Provider, {
70
- value: contextValue,
71
- children: t2
72
- });
73
- $[13] = contextValue;
74
- $[14] = t2;
75
- $[15] = t3;
76
- } else t3 = $[15];
77
- return t3;
27
+ })
28
+ });
29
+ return /* @__PURE__ */ jsx(ResponsiveDialogContext.Provider, {
30
+ value: contextValue,
31
+ children: /* @__PURE__ */ jsx(Dialog.Root, {
32
+ open,
33
+ onOpenChange,
34
+ children
35
+ })
36
+ });
78
37
  }
79
- function ResponsiveDialogContent(t0) {
80
- const $ = c(11);
81
- const { children, className, showCloseButton } = t0;
38
+ function ResponsiveDialogContent({ children, className, showCloseButton }) {
82
39
  const { isMobile } = useResponsiveDialog();
83
- if (isMobile) {
84
- let t1$1;
85
- if ($[0] !== className) {
86
- t1$1 = cn("max-h-[96vh]", className);
87
- $[0] = className;
88
- $[1] = t1$1;
89
- } else t1$1 = $[1];
90
- let t2$1;
91
- if ($[2] !== children || $[3] !== t1$1) {
92
- t2$1 = /* @__PURE__ */ jsx(DrawerContent, {
93
- className: t1$1,
94
- children
95
- });
96
- $[2] = children;
97
- $[3] = t1$1;
98
- $[4] = t2$1;
99
- } else t2$1 = $[4];
100
- return t2$1;
101
- }
102
- let t1;
103
- if ($[5] !== className) {
104
- t1 = cn("qa-responsive-dialog__content", className);
105
- $[5] = className;
106
- $[6] = t1;
107
- } else t1 = $[6];
108
- let t2;
109
- if ($[7] !== children || $[8] !== showCloseButton || $[9] !== t1) {
110
- t2 = /* @__PURE__ */ jsx(DialogContent, {
111
- showCloseButton,
112
- className: t1,
113
- children
114
- });
115
- $[7] = children;
116
- $[8] = showCloseButton;
117
- $[9] = t1;
118
- $[10] = t2;
119
- } else t2 = $[10];
120
- return t2;
40
+ if (isMobile) return /* @__PURE__ */ jsx(DrawerContent, {
41
+ className: cn("max-h-[96vh]", className),
42
+ children
43
+ });
44
+ return /* @__PURE__ */ jsx(DialogContent, {
45
+ showCloseButton,
46
+ className: cn("qa-responsive-dialog__content", className),
47
+ children
48
+ });
121
49
  }
122
- function ResponsiveDialogHeader(t0) {
123
- const $ = c(9);
124
- let className;
125
- let props;
126
- if ($[0] !== t0) {
127
- ({className, ...props} = t0);
128
- $[0] = t0;
129
- $[1] = className;
130
- $[2] = props;
131
- } else {
132
- className = $[1];
133
- props = $[2];
134
- }
50
+ function ResponsiveDialogHeader({ className, ...props }) {
135
51
  const { isMobile } = useResponsiveDialog();
136
- if (isMobile) {
137
- let t1$1;
138
- if ($[3] !== className || $[4] !== props) {
139
- t1$1 = /* @__PURE__ */ jsx(DrawerHeader, {
140
- className,
141
- ...props
142
- });
143
- $[3] = className;
144
- $[4] = props;
145
- $[5] = t1$1;
146
- } else t1$1 = $[5];
147
- return t1$1;
148
- }
149
- let t1;
150
- if ($[6] !== className || $[7] !== props) {
151
- t1 = /* @__PURE__ */ jsx(DialogHeader, {
152
- className,
153
- ...props
154
- });
155
- $[6] = className;
156
- $[7] = props;
157
- $[8] = t1;
158
- } else t1 = $[8];
159
- return t1;
52
+ if (isMobile) return /* @__PURE__ */ jsx(DrawerHeader, {
53
+ className,
54
+ ...props
55
+ });
56
+ return /* @__PURE__ */ jsx(DialogHeader, {
57
+ className,
58
+ ...props
59
+ });
160
60
  }
161
- function ResponsiveDialogTitle(t0) {
162
- const $ = c(14);
163
- let children;
164
- let className;
165
- let props;
166
- if ($[0] !== t0) {
167
- ({className, children, ...props} = t0);
168
- $[0] = t0;
169
- $[1] = children;
170
- $[2] = className;
171
- $[3] = props;
172
- } else {
173
- children = $[1];
174
- className = $[2];
175
- props = $[3];
176
- }
61
+ function ResponsiveDialogTitle({ className, children, ...props }) {
177
62
  const { isMobile } = useResponsiveDialog();
178
- if (isMobile) {
179
- let t1$1;
180
- if ($[4] !== children || $[5] !== className || $[6] !== props) {
181
- t1$1 = /* @__PURE__ */ jsx(DrawerTitle, {
182
- className,
183
- ...props,
184
- children
185
- });
186
- $[4] = children;
187
- $[5] = className;
188
- $[6] = props;
189
- $[7] = t1$1;
190
- } else t1$1 = $[7];
191
- return t1$1;
192
- }
193
- let t1;
194
- if ($[8] !== className) {
195
- t1 = cn("qa-responsive-dialog__title text-sm font-medium", className);
196
- $[8] = className;
197
- $[9] = t1;
198
- } else t1 = $[9];
199
- let t2;
200
- if ($[10] !== children || $[11] !== props || $[12] !== t1) {
201
- t2 = /* @__PURE__ */ jsx(Dialog.Title, {
202
- "data-slot": "responsive-dialog-title",
203
- className: t1,
204
- ...props,
205
- children
206
- });
207
- $[10] = children;
208
- $[11] = props;
209
- $[12] = t1;
210
- $[13] = t2;
211
- } else t2 = $[13];
212
- return t2;
63
+ if (isMobile) return /* @__PURE__ */ jsx(DrawerTitle, {
64
+ className,
65
+ ...props,
66
+ children
67
+ });
68
+ return /* @__PURE__ */ jsx(Dialog.Title, {
69
+ "data-slot": "responsive-dialog-title",
70
+ className: cn("qa-responsive-dialog__title text-sm font-medium", className),
71
+ ...props,
72
+ children
73
+ });
213
74
  }
214
- function ResponsiveDialogDescription(t0) {
215
- const $ = c(14);
216
- let children;
217
- let className;
218
- let props;
219
- if ($[0] !== t0) {
220
- ({className, children, ...props} = t0);
221
- $[0] = t0;
222
- $[1] = children;
223
- $[2] = className;
224
- $[3] = props;
225
- } else {
226
- children = $[1];
227
- className = $[2];
228
- props = $[3];
229
- }
75
+ function ResponsiveDialogDescription({ className, children, ...props }) {
230
76
  const { isMobile } = useResponsiveDialog();
231
- if (isMobile) {
232
- let t1$1;
233
- if ($[4] !== children || $[5] !== className || $[6] !== props) {
234
- t1$1 = /* @__PURE__ */ jsx(DrawerDescription, {
235
- className,
236
- ...props,
237
- children
238
- });
239
- $[4] = children;
240
- $[5] = className;
241
- $[6] = props;
242
- $[7] = t1$1;
243
- } else t1$1 = $[7];
244
- return t1$1;
245
- }
246
- let t1;
247
- if ($[8] !== className) {
248
- t1 = cn("text-muted-foreground text-xs/relaxed", className);
249
- $[8] = className;
250
- $[9] = t1;
251
- } else t1 = $[9];
252
- let t2;
253
- if ($[10] !== children || $[11] !== props || $[12] !== t1) {
254
- t2 = /* @__PURE__ */ jsx(Dialog.Description, {
255
- "data-slot": "responsive-dialog-description",
256
- className: t1,
257
- ...props,
258
- children
259
- });
260
- $[10] = children;
261
- $[11] = props;
262
- $[12] = t1;
263
- $[13] = t2;
264
- } else t2 = $[13];
265
- return t2;
77
+ if (isMobile) return /* @__PURE__ */ jsx(DrawerDescription, {
78
+ className,
79
+ ...props,
80
+ children
81
+ });
82
+ return /* @__PURE__ */ jsx(Dialog.Description, {
83
+ "data-slot": "responsive-dialog-description",
84
+ className: cn("text-muted-foreground text-xs/relaxed", className),
85
+ ...props,
86
+ children
87
+ });
266
88
  }
267
- function ResponsiveDialogFooter(t0) {
268
- const $ = c(9);
269
- let className;
270
- let props;
271
- if ($[0] !== t0) {
272
- ({className, ...props} = t0);
273
- $[0] = t0;
274
- $[1] = className;
275
- $[2] = props;
276
- } else {
277
- className = $[1];
278
- props = $[2];
279
- }
89
+ function ResponsiveDialogFooter({ className, ...props }) {
280
90
  const { isMobile } = useResponsiveDialog();
281
- if (isMobile) {
282
- let t1$1;
283
- if ($[3] !== className || $[4] !== props) {
284
- t1$1 = /* @__PURE__ */ jsx(DrawerFooter, {
285
- className,
286
- ...props
287
- });
288
- $[3] = className;
289
- $[4] = props;
290
- $[5] = t1$1;
291
- } else t1$1 = $[5];
292
- return t1$1;
293
- }
294
- let t1;
295
- if ($[6] !== className || $[7] !== props) {
296
- t1 = /* @__PURE__ */ jsx(DialogFooter, {
297
- className,
298
- ...props
299
- });
300
- $[6] = className;
301
- $[7] = props;
302
- $[8] = t1;
303
- } else t1 = $[8];
304
- return t1;
91
+ if (isMobile) return /* @__PURE__ */ jsx(DrawerFooter, {
92
+ className,
93
+ ...props
94
+ });
95
+ return /* @__PURE__ */ jsx(DialogFooter, {
96
+ className,
97
+ ...props
98
+ });
305
99
  }
306
100
 
307
101
  //#endregion
@@ -1,169 +1,74 @@
1
1
  import { cn } from "../../lib/utils.mjs";
2
- import { c } from "react/compiler-runtime";
3
2
  import * as React from "react";
4
3
  import { jsx, jsxs } from "react/jsx-runtime";
5
4
 
6
5
  //#region src/client/components/ui/scroll-fade.tsx
7
- function ScrollFade(t0) {
8
- const $ = c(38);
9
- let children;
10
- let className;
11
- let props;
12
- let t1;
13
- let t2;
14
- let t3;
15
- if ($[0] !== t0) {
16
- ({orientation: t1, fadeSize: t2, leftInset: t3, children, className, ...props} = t0);
17
- $[0] = t0;
18
- $[1] = children;
19
- $[2] = className;
20
- $[3] = props;
21
- $[4] = t1;
22
- $[5] = t2;
23
- $[6] = t3;
24
- } else {
25
- children = $[1];
26
- className = $[2];
27
- props = $[3];
28
- t1 = $[4];
29
- t2 = $[5];
30
- t3 = $[6];
31
- }
32
- const orientation = t1 === void 0 ? "horizontal" : t1;
33
- const fadeSize = t2 === void 0 ? 20 : t2;
34
- const leftInset = t3 === void 0 ? 0 : t3;
6
+ function ScrollFade({ orientation = "horizontal", fadeSize = 20, leftInset = 0, children, className, ...props }) {
35
7
  const wrapperRef = React.useRef(null);
36
- let t4;
37
- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
38
- t4 = {
39
- left: false,
40
- right: false,
41
- top: false,
42
- bottom: false
8
+ const [overflow, setOverflow] = React.useState({
9
+ left: false,
10
+ right: false,
11
+ top: false,
12
+ bottom: false
13
+ });
14
+ React.useEffect(() => {
15
+ const wrapper = wrapperRef.current;
16
+ if (!wrapper) return;
17
+ const scrollable = wrapper.querySelector("[data-scroll-fade-target]") ?? wrapper.querySelector(".overflow-x-auto, .overflow-y-auto, .overflow-auto") ?? wrapper;
18
+ const update = () => {
19
+ const el = scrollable;
20
+ const h$1 = orientation !== "vertical";
21
+ const v$1 = orientation !== "horizontal";
22
+ setOverflow({
23
+ left: h$1 && el.scrollLeft > 1,
24
+ right: h$1 && el.scrollLeft + el.clientWidth < el.scrollWidth - 1,
25
+ top: v$1 && el.scrollTop > 1,
26
+ bottom: v$1 && el.scrollTop + el.clientHeight < el.scrollHeight - 1
27
+ });
43
28
  };
44
- $[7] = t4;
45
- } else t4 = $[7];
46
- const [overflow, setOverflow] = React.useState(t4);
47
- let t5;
48
- let t6;
49
- if ($[8] !== orientation) {
50
- t5 = () => {
51
- const wrapper = wrapperRef.current;
52
- if (!wrapper) return;
53
- const scrollable = wrapper.querySelector("[data-scroll-fade-target]") ?? wrapper.querySelector(".overflow-x-auto, .overflow-y-auto, .overflow-auto") ?? wrapper;
54
- const update = () => {
55
- const el = scrollable;
56
- const h = orientation !== "vertical";
57
- const v = orientation !== "horizontal";
58
- setOverflow({
59
- left: h && el.scrollLeft > 1,
60
- right: h && el.scrollLeft + el.clientWidth < el.scrollWidth - 1,
61
- top: v && el.scrollTop > 1,
62
- bottom: v && el.scrollTop + el.clientHeight < el.scrollHeight - 1
63
- });
64
- };
65
- update();
66
- scrollable.addEventListener("scroll", update, { passive: true });
67
- const observer = new ResizeObserver(update);
68
- observer.observe(scrollable);
69
- return () => {
70
- scrollable.removeEventListener("scroll", update);
71
- observer.disconnect();
72
- };
29
+ update();
30
+ scrollable.addEventListener("scroll", update, { passive: true });
31
+ const observer = new ResizeObserver(update);
32
+ observer.observe(scrollable);
33
+ return () => {
34
+ scrollable.removeEventListener("scroll", update);
35
+ observer.disconnect();
73
36
  };
74
- t6 = [orientation];
75
- $[8] = orientation;
76
- $[9] = t5;
77
- $[10] = t6;
78
- } else {
79
- t5 = $[9];
80
- t6 = $[10];
81
- }
82
- React.useEffect(t5, t6);
83
- const h_0 = orientation !== "vertical";
84
- const v_0 = orientation !== "horizontal";
85
- let t7;
86
- if ($[11] !== className) {
87
- t7 = cn("relative", className);
88
- $[11] = className;
89
- $[12] = t7;
90
- } else t7 = $[12];
91
- let t8;
92
- if ($[13] !== fadeSize || $[14] !== h_0 || $[15] !== leftInset || $[16] !== overflow) {
93
- t8 = h_0 && /* @__PURE__ */ jsx("div", {
94
- className: cn("pointer-events-none absolute z-30 transition-opacity duration-200", "inset-y-0 bg-gradient-to-r from-background to-transparent", overflow.left ? "opacity-100" : "opacity-0"),
95
- style: {
96
- left: leftInset,
97
- width: fadeSize
98
- },
99
- "aria-hidden": true
100
- });
101
- $[13] = fadeSize;
102
- $[14] = h_0;
103
- $[15] = leftInset;
104
- $[16] = overflow;
105
- $[17] = t8;
106
- } else t8 = $[17];
107
- let t9;
108
- if ($[18] !== fadeSize || $[19] !== h_0 || $[20] !== overflow) {
109
- t9 = h_0 && /* @__PURE__ */ jsx("div", {
110
- className: cn("pointer-events-none absolute z-30 transition-opacity duration-200", "inset-y-0 right-0 bg-gradient-to-l from-background to-transparent", overflow.right ? "opacity-100" : "opacity-0"),
111
- style: { width: fadeSize },
112
- "aria-hidden": true
113
- });
114
- $[18] = fadeSize;
115
- $[19] = h_0;
116
- $[20] = overflow;
117
- $[21] = t9;
118
- } else t9 = $[21];
119
- let t10;
120
- if ($[22] !== fadeSize || $[23] !== overflow || $[24] !== v_0) {
121
- t10 = v_0 && /* @__PURE__ */ jsx("div", {
122
- className: cn("pointer-events-none absolute z-30 transition-opacity duration-200", "inset-x-0 top-0 bg-gradient-to-b from-background to-transparent", overflow.top ? "opacity-100" : "opacity-0"),
123
- style: { height: fadeSize },
124
- "aria-hidden": true
125
- });
126
- $[22] = fadeSize;
127
- $[23] = overflow;
128
- $[24] = v_0;
129
- $[25] = t10;
130
- } else t10 = $[25];
131
- let t11;
132
- if ($[26] !== fadeSize || $[27] !== overflow || $[28] !== v_0) {
133
- t11 = v_0 && /* @__PURE__ */ jsx("div", {
134
- className: cn("pointer-events-none absolute z-30 transition-opacity duration-200", "inset-x-0 bottom-0 bg-gradient-to-t from-background to-transparent", overflow.bottom ? "opacity-100" : "opacity-0"),
135
- style: { height: fadeSize },
136
- "aria-hidden": true
137
- });
138
- $[26] = fadeSize;
139
- $[27] = overflow;
140
- $[28] = v_0;
141
- $[29] = t11;
142
- } else t11 = $[29];
143
- let t12;
144
- if ($[30] !== children || $[31] !== props || $[32] !== t10 || $[33] !== t11 || $[34] !== t7 || $[35] !== t8 || $[36] !== t9) {
145
- t12 = /* @__PURE__ */ jsxs("div", {
146
- ref: wrapperRef,
147
- className: t7,
148
- ...props,
149
- children: [
150
- children,
151
- t8,
152
- t9,
153
- t10,
154
- t11
155
- ]
156
- });
157
- $[30] = children;
158
- $[31] = props;
159
- $[32] = t10;
160
- $[33] = t11;
161
- $[34] = t7;
162
- $[35] = t8;
163
- $[36] = t9;
164
- $[37] = t12;
165
- } else t12 = $[37];
166
- return t12;
37
+ }, [orientation]);
38
+ const h = orientation !== "vertical";
39
+ const v = orientation !== "horizontal";
40
+ const fade = "pointer-events-none absolute z-30 transition-opacity duration-200";
41
+ return /* @__PURE__ */ jsxs("div", {
42
+ ref: wrapperRef,
43
+ className: cn("relative", className),
44
+ ...props,
45
+ children: [
46
+ children,
47
+ h && /* @__PURE__ */ jsx("div", {
48
+ className: cn(fade, "inset-y-0 bg-gradient-to-r from-background to-transparent", overflow.left ? "opacity-100" : "opacity-0"),
49
+ style: {
50
+ left: leftInset,
51
+ width: fadeSize
52
+ },
53
+ "aria-hidden": true
54
+ }),
55
+ h && /* @__PURE__ */ jsx("div", {
56
+ className: cn(fade, "inset-y-0 right-0 bg-gradient-to-l from-background to-transparent", overflow.right ? "opacity-100" : "opacity-0"),
57
+ style: { width: fadeSize },
58
+ "aria-hidden": true
59
+ }),
60
+ v && /* @__PURE__ */ jsx("div", {
61
+ className: cn(fade, "inset-x-0 top-0 bg-gradient-to-b from-background to-transparent", overflow.top ? "opacity-100" : "opacity-0"),
62
+ style: { height: fadeSize },
63
+ "aria-hidden": true
64
+ }),
65
+ v && /* @__PURE__ */ jsx("div", {
66
+ className: cn(fade, "inset-x-0 bottom-0 bg-gradient-to-t from-background to-transparent", overflow.bottom ? "opacity-100" : "opacity-0"),
67
+ style: { height: fadeSize },
68
+ "aria-hidden": true
69
+ })
70
+ ]
71
+ });
167
72
  }
168
73
 
169
74
  //#endregion