@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
@@ -8,7 +8,6 @@ import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "..
8
8
  import { Tabs, TabsContent, TabsList, TabsTrigger } from "../../components/ui/tabs.mjs";
9
9
  import { AdminViewHeader } from "../layout/admin-view-layout.mjs";
10
10
  import { DashboardWidget } from "./dashboard-widget.mjs";
11
- import { c } from "react/compiler-runtime";
12
11
  import { Icon } from "@iconify/react";
13
12
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
14
13
 
@@ -163,49 +162,35 @@ function getLayoutItemKey(item, index) {
163
162
  }
164
163
  return `item-${index}`;
165
164
  }
166
- function DashboardHeader(t0) {
167
- const $ = c(18);
168
- const { title, description, actions, navigate, resolveText } = t0;
165
+ function DashboardHeader({ title, description, actions, navigate, resolveText }) {
169
166
  if (!title && !description && !actions?.length) return null;
170
- let t1;
171
- if ($[0] !== navigate) {
172
- t1 = (action) => {
173
- if (action.onClick) action.onClick();
174
- else if (action.href && navigate) navigate(action.href);
175
- };
176
- $[0] = navigate;
177
- $[1] = t1;
178
- } else t1 = $[1];
179
- const handleActionClick = t1;
180
- let T0;
181
- let t2;
182
- let t3;
183
- let t4;
184
- let t5;
185
- if ($[2] !== actions || $[3] !== description || $[4] !== handleActionClick || $[5] !== resolveText || $[6] !== title) {
186
- const primaryAction = actions?.find(_temp) || actions?.[0];
187
- const secondaryActions = actions?.filter((a_0) => a_0 !== primaryAction) || [];
188
- T0 = AdminViewHeader;
189
- t2 = "qa-dashboard__header mb-4";
190
- t3 = title;
191
- t4 = description;
192
- t5 = actions && actions.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
167
+ const handleActionClick = (action) => {
168
+ if (action.onClick) action.onClick();
169
+ else if (action.href && navigate) navigate(action.href);
170
+ };
171
+ const primaryAction = actions?.find((a) => a.variant === "primary") || actions?.[0];
172
+ const secondaryActions = actions?.filter((a) => a !== primaryAction) || [];
173
+ return /* @__PURE__ */ jsx(AdminViewHeader, {
174
+ className: "qa-dashboard__header mb-4",
175
+ title,
176
+ description,
177
+ actions: actions && actions.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
193
178
  primaryAction && /* @__PURE__ */ jsxs(Button, {
194
179
  variant: primaryAction.variant === "primary" ? "default" : primaryAction.variant || "default",
195
180
  size: "sm",
196
181
  onClick: () => handleActionClick(primaryAction),
197
182
  children: [resolveIconElement(primaryAction.icon, { "data-icon": "inline-start" }), resolveText(primaryAction.label)]
198
183
  }, primaryAction.id),
199
- secondaryActions.map((action_0) => {
200
- const iconElement = resolveIconElement(action_0.icon, { "data-icon": "inline-start" });
201
- const variant = action_0.variant || "default";
184
+ secondaryActions.map((action) => {
185
+ const iconElement = resolveIconElement(action.icon, { "data-icon": "inline-start" });
186
+ const variant = action.variant || "default";
202
187
  return /* @__PURE__ */ jsxs(Button, {
203
188
  variant: variant === "primary" ? "default" : variant,
204
189
  size: "sm",
205
- onClick: () => handleActionClick(action_0),
190
+ onClick: () => handleActionClick(action),
206
191
  className: "hidden md:inline-flex",
207
- children: [iconElement, resolveText(action_0.label)]
208
- }, action_0.id);
192
+ children: [iconElement, resolveText(action.label)]
193
+ }, action.id);
209
194
  }),
210
195
  secondaryActions.length > 0 && /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, { render: /* @__PURE__ */ jsx(Button, {
211
196
  variant: "outline",
@@ -217,314 +202,140 @@ function DashboardHeader(t0) {
217
202
  })
218
203
  }) }), /* @__PURE__ */ jsx(DropdownMenuContent, {
219
204
  align: "end",
220
- children: secondaryActions.map((action_1) => /* @__PURE__ */ jsxs(DropdownMenuItem, {
221
- onClick: () => handleActionClick(action_1),
222
- children: [resolveIconElement(action_1.icon, { className: "size-4 mr-2" }), resolveText(action_1.label)]
223
- }, action_1.id))
205
+ children: secondaryActions.map((action) => /* @__PURE__ */ jsxs(DropdownMenuItem, {
206
+ onClick: () => handleActionClick(action),
207
+ children: [resolveIconElement(action.icon, { className: "size-4 mr-2" }), resolveText(action.label)]
208
+ }, action.id))
224
209
  })] })
225
- ] }) : void 0;
226
- $[2] = actions;
227
- $[3] = description;
228
- $[4] = handleActionClick;
229
- $[5] = resolveText;
230
- $[6] = title;
231
- $[7] = T0;
232
- $[8] = t2;
233
- $[9] = t3;
234
- $[10] = t4;
235
- $[11] = t5;
236
- } else {
237
- T0 = $[7];
238
- t2 = $[8];
239
- t3 = $[9];
240
- t4 = $[10];
241
- t5 = $[11];
242
- }
243
- let t6;
244
- if ($[12] !== T0 || $[13] !== t2 || $[14] !== t3 || $[15] !== t4 || $[16] !== t5) {
245
- t6 = /* @__PURE__ */ jsx(T0, {
246
- className: t2,
247
- title: t3,
248
- description: t4,
249
- actions: t5
250
- });
251
- $[12] = T0;
252
- $[13] = t2;
253
- $[14] = t3;
254
- $[15] = t4;
255
- $[16] = t5;
256
- $[17] = t6;
257
- } else t6 = $[17];
258
- return t6;
259
- }
260
- function _temp(a) {
261
- return a.variant === "primary";
210
+ ] }) : void 0
211
+ });
262
212
  }
263
- function LayoutItemRenderer(t0) {
264
- const $ = c(32);
265
- const { item, rowHeight, gap, basePath, navigate, widgetRegistry, resolveText, dashboardRealtime } = t0;
213
+ function LayoutItemRenderer({ item, columns, rowHeight, gap, basePath, navigate, widgetRegistry, resolveText, dashboardRealtime }) {
266
214
  if (isWidgetConfig(item)) {
267
- let t1;
268
- let t2;
269
- let widgetConfig;
270
- if ($[0] !== dashboardRealtime || $[1] !== item) {
271
- const spanClass = getSpanClass(getWidgetSpan(item));
272
- const rowSpan = getWidgetRowSpan(item);
273
- widgetConfig = dashboardRealtime !== void 0 && item.realtime === void 0 ? {
274
- ...item,
275
- realtime: dashboardRealtime
276
- } : item;
277
- t1 = cn("qa-dashboard__tile h-full min-h-0 min-w-0", spanClass, item.className);
278
- t2 = getWidgetStyle(rowSpan);
279
- $[0] = dashboardRealtime;
280
- $[1] = item;
281
- $[2] = t1;
282
- $[3] = t2;
283
- $[4] = widgetConfig;
284
- } else {
285
- t1 = $[2];
286
- t2 = $[3];
287
- widgetConfig = $[4];
288
- }
289
- let t3;
290
- if ($[5] !== basePath || $[6] !== navigate || $[7] !== widgetConfig || $[8] !== widgetRegistry) {
291
- t3 = /* @__PURE__ */ jsx(DashboardWidget, {
215
+ const spanClass = getSpanClass(getWidgetSpan(item));
216
+ const rowSpan = getWidgetRowSpan(item);
217
+ const widgetConfig = dashboardRealtime !== void 0 && item.realtime === void 0 ? {
218
+ ...item,
219
+ realtime: dashboardRealtime
220
+ } : item;
221
+ return /* @__PURE__ */ jsx("div", {
222
+ className: cn("qa-dashboard__tile h-full min-h-0 min-w-0", spanClass, item.className),
223
+ style: getWidgetStyle(rowSpan),
224
+ children: /* @__PURE__ */ jsx(DashboardWidget, {
292
225
  config: widgetConfig,
293
226
  basePath,
294
227
  navigate,
295
228
  widgetRegistry
296
- });
297
- $[5] = basePath;
298
- $[6] = navigate;
299
- $[7] = widgetConfig;
300
- $[8] = widgetRegistry;
301
- $[9] = t3;
302
- } else t3 = $[9];
303
- let t4;
304
- if ($[10] !== t1 || $[11] !== t2 || $[12] !== t3) {
305
- t4 = /* @__PURE__ */ jsx("div", {
306
- className: t1,
307
- style: t2,
308
- children: t3
309
- });
310
- $[10] = t1;
311
- $[11] = t2;
312
- $[12] = t3;
313
- $[13] = t4;
314
- } else t4 = $[13];
315
- return t4;
316
- }
317
- if (isSectionConfig(item)) {
318
- let t1;
319
- if ($[14] !== basePath || $[15] !== dashboardRealtime || $[16] !== gap || $[17] !== item || $[18] !== navigate || $[19] !== resolveText || $[20] !== rowHeight || $[21] !== widgetRegistry) {
320
- t1 = /* @__PURE__ */ jsx(SectionRenderer, {
321
- section: item,
322
- basePath,
323
- navigate,
324
- widgetRegistry,
325
- resolveText,
326
- dashboardRealtime,
327
- rowHeight,
328
- gap
329
- });
330
- $[14] = basePath;
331
- $[15] = dashboardRealtime;
332
- $[16] = gap;
333
- $[17] = item;
334
- $[18] = navigate;
335
- $[19] = resolveText;
336
- $[20] = rowHeight;
337
- $[21] = widgetRegistry;
338
- $[22] = t1;
339
- } else t1 = $[22];
340
- return t1;
341
- }
342
- if (isTabsConfig(item)) {
343
- let t1;
344
- if ($[23] !== basePath || $[24] !== dashboardRealtime || $[25] !== gap || $[26] !== item || $[27] !== navigate || $[28] !== resolveText || $[29] !== rowHeight || $[30] !== widgetRegistry) {
345
- t1 = /* @__PURE__ */ jsx(TabsRenderer, {
346
- tabs: item,
347
- basePath,
348
- navigate,
349
- widgetRegistry,
350
- resolveText,
351
- dashboardRealtime,
352
- rowHeight,
353
- gap
354
- });
355
- $[23] = basePath;
356
- $[24] = dashboardRealtime;
357
- $[25] = gap;
358
- $[26] = item;
359
- $[27] = navigate;
360
- $[28] = resolveText;
361
- $[29] = rowHeight;
362
- $[30] = widgetRegistry;
363
- $[31] = t1;
364
- } else t1 = $[31];
365
- return t1;
229
+ })
230
+ });
366
231
  }
232
+ if (isSectionConfig(item)) return /* @__PURE__ */ jsx(SectionRenderer, {
233
+ section: item,
234
+ basePath,
235
+ navigate,
236
+ widgetRegistry,
237
+ resolveText,
238
+ dashboardRealtime,
239
+ rowHeight,
240
+ gap
241
+ });
242
+ if (isTabsConfig(item)) return /* @__PURE__ */ jsx(TabsRenderer, {
243
+ tabs: item,
244
+ basePath,
245
+ navigate,
246
+ widgetRegistry,
247
+ resolveText,
248
+ dashboardRealtime,
249
+ rowHeight,
250
+ gap
251
+ });
367
252
  return null;
368
253
  }
369
- function WidgetGridGroup(t0) {
370
- const $ = c(28);
371
- const { items, columns, rowHeight, gap, basePath, navigate, widgetRegistry, resolveText, dashboardRealtime } = t0;
372
- let t1;
373
- if ($[0] !== columns) {
374
- t1 = cn("@container grid items-stretch gap-4", getGridClass(columns));
375
- $[0] = columns;
376
- $[1] = t1;
377
- } else t1 = $[1];
378
- let t2;
379
- if ($[2] !== gap || $[3] !== rowHeight) {
380
- t2 = getGridStyle(rowHeight, gap);
381
- $[2] = gap;
382
- $[3] = rowHeight;
383
- $[4] = t2;
384
- } else t2 = $[4];
385
- let t3;
386
- if ($[5] !== basePath || $[6] !== columns || $[7] !== dashboardRealtime || $[8] !== gap || $[9] !== items || $[10] !== navigate || $[11] !== resolveText || $[12] !== rowHeight || $[13] !== widgetRegistry) {
387
- let t4$1;
388
- if ($[15] !== basePath || $[16] !== columns || $[17] !== dashboardRealtime || $[18] !== gap || $[19] !== navigate || $[20] !== resolveText || $[21] !== rowHeight || $[22] !== widgetRegistry) {
389
- t4$1 = (item, index) => /* @__PURE__ */ jsx(LayoutItemRenderer, {
390
- item,
391
- index,
392
- columns,
393
- basePath,
394
- navigate,
395
- widgetRegistry,
396
- resolveText,
397
- dashboardRealtime,
398
- rowHeight,
399
- gap
400
- }, getLayoutItemKey(item, index));
401
- $[15] = basePath;
402
- $[16] = columns;
403
- $[17] = dashboardRealtime;
404
- $[18] = gap;
405
- $[19] = navigate;
406
- $[20] = resolveText;
407
- $[21] = rowHeight;
408
- $[22] = widgetRegistry;
409
- $[23] = t4$1;
410
- } else t4$1 = $[23];
411
- t3 = items.map(t4$1);
412
- $[5] = basePath;
413
- $[6] = columns;
414
- $[7] = dashboardRealtime;
415
- $[8] = gap;
416
- $[9] = items;
417
- $[10] = navigate;
418
- $[11] = resolveText;
419
- $[12] = rowHeight;
420
- $[13] = widgetRegistry;
421
- $[14] = t3;
422
- } else t3 = $[14];
423
- let t4;
424
- if ($[24] !== t1 || $[25] !== t2 || $[26] !== t3) {
425
- t4 = /* @__PURE__ */ jsx("div", {
426
- className: t1,
427
- style: t2,
428
- children: t3
429
- });
430
- $[24] = t1;
431
- $[25] = t2;
432
- $[26] = t3;
433
- $[27] = t4;
434
- } else t4 = $[27];
435
- return t4;
254
+ function WidgetGridGroup({ items, columns, rowHeight, gap, basePath, navigate, widgetRegistry, resolveText, dashboardRealtime }) {
255
+ return /* @__PURE__ */ jsx("div", {
256
+ className: cn("@container grid items-stretch gap-4", getGridClass(columns)),
257
+ style: getGridStyle(rowHeight, gap),
258
+ children: items.map((item, index) => /* @__PURE__ */ jsx(LayoutItemRenderer, {
259
+ item,
260
+ index,
261
+ columns,
262
+ basePath,
263
+ navigate,
264
+ widgetRegistry,
265
+ resolveText,
266
+ dashboardRealtime,
267
+ rowHeight,
268
+ gap
269
+ }, getLayoutItemKey(item, index)))
270
+ });
436
271
  }
437
- function LayoutItemsRenderer(t0) {
438
- const $ = c(10);
439
- const { items, columns, rowHeight, gap, basePath, navigate, widgetRegistry, resolveText, dashboardRealtime } = t0;
440
- let t1;
441
- if ($[0] !== basePath || $[1] !== columns || $[2] !== dashboardRealtime || $[3] !== gap || $[4] !== items || $[5] !== navigate || $[6] !== resolveText || $[7] !== rowHeight || $[8] !== widgetRegistry) {
442
- const blocks = [];
443
- let widgetGroup = [];
444
- let widgetGroupStart = 0;
445
- const flushWidgetGroup = () => {
446
- if (widgetGroup.length === 0) return;
447
- blocks.push(/* @__PURE__ */ jsx(WidgetGridGroup, {
448
- items: widgetGroup,
449
- columns,
450
- rowHeight,
451
- gap,
452
- basePath,
453
- navigate,
454
- widgetRegistry,
455
- resolveText,
456
- dashboardRealtime
457
- }, `widgets-${widgetGroupStart}`));
458
- widgetGroup = [];
459
- };
460
- items.forEach((item, index) => {
461
- if (isWidgetConfig(item)) {
462
- if (widgetGroup.length === 0) widgetGroupStart = index;
463
- widgetGroup.push(item);
464
- return;
465
- }
466
- flushWidgetGroup();
467
- blocks.push(/* @__PURE__ */ jsx(LayoutItemRenderer, {
468
- item,
469
- index,
470
- columns,
471
- basePath,
472
- navigate,
473
- widgetRegistry,
474
- resolveText,
475
- dashboardRealtime,
476
- rowHeight,
477
- gap
478
- }, getLayoutItemKey(item, index)));
479
- });
272
+ function LayoutItemsRenderer({ items, columns, rowHeight, gap, basePath, navigate, widgetRegistry, resolveText, dashboardRealtime }) {
273
+ const blocks = [];
274
+ let widgetGroup = [];
275
+ let widgetGroupStart = 0;
276
+ const flushWidgetGroup = () => {
277
+ if (widgetGroup.length === 0) return;
278
+ blocks.push(/* @__PURE__ */ jsx(WidgetGridGroup, {
279
+ items: widgetGroup,
280
+ columns,
281
+ rowHeight,
282
+ gap,
283
+ basePath,
284
+ navigate,
285
+ widgetRegistry,
286
+ resolveText,
287
+ dashboardRealtime
288
+ }, `widgets-${widgetGroupStart}`));
289
+ widgetGroup = [];
290
+ };
291
+ items.forEach((item, index) => {
292
+ if (isWidgetConfig(item)) {
293
+ if (widgetGroup.length === 0) widgetGroupStart = index;
294
+ widgetGroup.push(item);
295
+ return;
296
+ }
480
297
  flushWidgetGroup();
481
- t1 = /* @__PURE__ */ jsx("div", {
482
- className: "qa-dashboard__stack flex flex-col gap-7",
483
- children: blocks
484
- });
485
- $[0] = basePath;
486
- $[1] = columns;
487
- $[2] = dashboardRealtime;
488
- $[3] = gap;
489
- $[4] = items;
490
- $[5] = navigate;
491
- $[6] = resolveText;
492
- $[7] = rowHeight;
493
- $[8] = widgetRegistry;
494
- $[9] = t1;
495
- } else t1 = $[9];
496
- return t1;
298
+ blocks.push(/* @__PURE__ */ jsx(LayoutItemRenderer, {
299
+ item,
300
+ index,
301
+ columns,
302
+ basePath,
303
+ navigate,
304
+ widgetRegistry,
305
+ resolveText,
306
+ dashboardRealtime,
307
+ rowHeight,
308
+ gap
309
+ }, getLayoutItemKey(item, index)));
310
+ });
311
+ flushWidgetGroup();
312
+ return /* @__PURE__ */ jsx("div", {
313
+ className: "qa-dashboard__stack flex flex-col gap-7",
314
+ children: blocks
315
+ });
497
316
  }
498
- function SectionRenderer(t0) {
499
- const $ = c(57);
500
- const { section, basePath, navigate, widgetRegistry, resolveText, dashboardRealtime, rowHeight: inheritedRowHeight, gap: inheritedGap } = t0;
501
- const { label, description, wrapper: t1, defaultCollapsed: t2, layout: t3, columns: t4, gap: sectionGap, rowHeight: sectionRowHeight, items, className } = section;
502
- const wrapper = t1 === void 0 ? "flat" : t1;
503
- const defaultCollapsed = t2 === void 0 ? false : t2;
504
- const layout = t3 === void 0 ? "grid" : t3;
505
- const columns = t4 === void 0 ? 4 : t4;
317
+ function SectionRenderer({ section, basePath, navigate, widgetRegistry, resolveText, dashboardRealtime, rowHeight: inheritedRowHeight, gap: inheritedGap }) {
318
+ const { label, description, wrapper = "flat", defaultCollapsed = false, layout = "grid", columns = 4, gap: sectionGap, rowHeight: sectionRowHeight, items, className } = section;
506
319
  const rowHeight = sectionRowHeight ?? inheritedRowHeight;
507
320
  const gap = sectionGap ?? inheritedGap;
508
- let t5;
509
- if ($[0] !== label || $[1] !== resolveText) {
510
- t5 = label ? resolveText(label) : void 0;
511
- $[0] = label;
512
- $[1] = resolveText;
513
- $[2] = t5;
514
- } else t5 = $[2];
515
- const sectionLabel = t5;
516
- let t6;
517
- if ($[3] !== description || $[4] !== resolveText) {
518
- t6 = description ? resolveText(description) : void 0;
519
- $[3] = description;
520
- $[4] = resolveText;
521
- $[5] = t6;
522
- } else t6 = $[5];
523
- const sectionDescription = t6;
524
- let t7;
525
- if ($[6] !== basePath || $[7] !== columns || $[8] !== dashboardRealtime || $[9] !== gap || $[10] !== items || $[11] !== layout || $[12] !== navigate || $[13] !== resolveText || $[14] !== rowHeight || $[15] !== widgetRegistry) {
526
- t7 = layout === "grid" ? /* @__PURE__ */ jsx(LayoutItemsRenderer, {
527
- items,
321
+ const sectionLabel = label ? resolveText(label) : void 0;
322
+ const sectionDescription = description ? resolveText(description) : void 0;
323
+ const itemsContent = layout === "grid" ? /* @__PURE__ */ jsx(LayoutItemsRenderer, {
324
+ items,
325
+ columns,
326
+ basePath,
327
+ navigate,
328
+ widgetRegistry,
329
+ resolveText,
330
+ dashboardRealtime,
331
+ rowHeight,
332
+ gap
333
+ }) : /* @__PURE__ */ jsx("div", {
334
+ className: "@container flex flex-col gap-4",
335
+ style: getStackStyle(gap),
336
+ children: items.map((item, index) => /* @__PURE__ */ jsx(LayoutItemRenderer, {
337
+ item,
338
+ index,
528
339
  columns,
529
340
  basePath,
530
341
  navigate,
@@ -533,322 +344,112 @@ function SectionRenderer(t0) {
533
344
  dashboardRealtime,
534
345
  rowHeight,
535
346
  gap
536
- }) : /* @__PURE__ */ jsx("div", {
537
- className: "@container flex flex-col gap-4",
538
- style: getStackStyle(gap),
539
- children: items.map((item, index) => /* @__PURE__ */ jsx(LayoutItemRenderer, {
540
- item,
541
- index,
542
- columns,
543
- basePath,
544
- navigate,
545
- widgetRegistry,
546
- resolveText,
547
- dashboardRealtime,
548
- rowHeight,
549
- gap
550
- }, getLayoutItemKey(item, index)))
551
- });
552
- $[6] = basePath;
553
- $[7] = columns;
554
- $[8] = dashboardRealtime;
555
- $[9] = gap;
556
- $[10] = items;
557
- $[11] = layout;
558
- $[12] = navigate;
559
- $[13] = resolveText;
560
- $[14] = rowHeight;
561
- $[15] = widgetRegistry;
562
- $[16] = t7;
563
- } else t7 = $[16];
564
- const itemsContent = t7;
565
- if (wrapper === "flat") {
566
- let t8;
567
- if ($[17] !== className) {
568
- t8 = cn("min-w-0", className);
569
- $[17] = className;
570
- $[18] = t8;
571
- } else t8 = $[18];
572
- let t9;
573
- if ($[19] !== sectionDescription || $[20] !== sectionLabel) {
574
- t9 = (sectionLabel || sectionDescription) && /* @__PURE__ */ jsxs("div", {
575
- className: "mb-4",
576
- children: [sectionLabel && /* @__PURE__ */ jsx("h2", {
577
- className: "text-base font-semibold text-balance",
578
- children: sectionLabel
579
- }), sectionDescription && /* @__PURE__ */ jsx("p", {
580
- className: "text-muted-foreground mt-1 text-sm text-pretty",
581
- children: sectionDescription
582
- })]
583
- });
584
- $[19] = sectionDescription;
585
- $[20] = sectionLabel;
586
- $[21] = t9;
587
- } else t9 = $[21];
588
- let t10;
589
- if ($[22] !== itemsContent || $[23] !== t8 || $[24] !== t9) {
590
- t10 = /* @__PURE__ */ jsxs("section", {
591
- className: t8,
592
- children: [t9, itemsContent]
593
- });
594
- $[22] = itemsContent;
595
- $[23] = t8;
596
- $[24] = t9;
597
- $[25] = t10;
598
- } else t10 = $[25];
599
- return t10;
600
- }
601
- if (wrapper === "card") {
602
- let t8;
603
- if ($[26] !== className) {
604
- t8 = cn("min-w-0", className);
605
- $[26] = className;
606
- $[27] = t8;
607
- } else t8 = $[27];
608
- let t9;
609
- if ($[28] !== sectionDescription || $[29] !== sectionLabel) {
610
- t9 = (sectionLabel || sectionDescription) && /* @__PURE__ */ jsxs(CardHeader, { children: [sectionLabel && /* @__PURE__ */ jsx(CardTitle, { children: sectionLabel }), sectionDescription && /* @__PURE__ */ jsx("p", {
611
- className: "text-muted-foreground text-sm",
612
- children: sectionDescription
613
- })] });
614
- $[28] = sectionDescription;
615
- $[29] = sectionLabel;
616
- $[30] = t9;
617
- } else t9 = $[30];
618
- let t10;
619
- if ($[31] !== itemsContent) {
620
- t10 = /* @__PURE__ */ jsx(CardContent, {
621
- className: "min-w-0",
622
- children: itemsContent
623
- });
624
- $[31] = itemsContent;
625
- $[32] = t10;
626
- } else t10 = $[32];
627
- let t11;
628
- if ($[33] !== t10 || $[34] !== t8 || $[35] !== t9) {
629
- t11 = /* @__PURE__ */ jsxs(Card, {
630
- className: t8,
631
- children: [t9, t10]
632
- });
633
- $[33] = t10;
634
- $[34] = t8;
635
- $[35] = t9;
636
- $[36] = t11;
637
- } else t11 = $[36];
638
- return t11;
639
- }
640
- if (wrapper === "collapsible") {
641
- let t8;
642
- if ($[37] !== defaultCollapsed) {
643
- t8 = defaultCollapsed ? [] : [0];
644
- $[37] = defaultCollapsed;
645
- $[38] = t8;
646
- } else t8 = $[38];
647
- let t9;
648
- if ($[39] !== className) {
649
- t9 = cn("min-w-0", className);
650
- $[39] = className;
651
- $[40] = t9;
652
- } else t9 = $[40];
653
- let t10;
654
- if ($[41] !== sectionLabel) {
655
- t10 = sectionLabel && /* @__PURE__ */ jsx("span", {
656
- className: "text-lg font-semibold",
347
+ }, getLayoutItemKey(item, index)))
348
+ });
349
+ if (wrapper === "flat") return /* @__PURE__ */ jsxs("section", {
350
+ className: cn("min-w-0", className),
351
+ children: [(sectionLabel || sectionDescription) && /* @__PURE__ */ jsxs("div", {
352
+ className: "mb-4",
353
+ children: [sectionLabel && /* @__PURE__ */ jsx("h2", {
354
+ className: "text-base font-semibold text-balance",
657
355
  children: sectionLabel
658
- });
659
- $[41] = sectionLabel;
660
- $[42] = t10;
661
- } else t10 = $[42];
662
- let t11;
663
- if ($[43] !== sectionDescription) {
664
- t11 = sectionDescription && /* @__PURE__ */ jsx("p", {
665
- className: "text-muted-foreground text-sm font-normal",
356
+ }), sectionDescription && /* @__PURE__ */ jsx("p", {
357
+ className: "text-muted-foreground mt-1 text-sm text-pretty",
666
358
  children: sectionDescription
667
- });
668
- $[43] = sectionDescription;
669
- $[44] = t11;
670
- } else t11 = $[44];
671
- let t12;
672
- if ($[45] !== t10 || $[46] !== t11) {
673
- t12 = /* @__PURE__ */ jsx(AccordionTrigger, {
359
+ })]
360
+ }), itemsContent]
361
+ });
362
+ if (wrapper === "card") return /* @__PURE__ */ jsxs(Card, {
363
+ className: cn("min-w-0", className),
364
+ children: [(sectionLabel || sectionDescription) && /* @__PURE__ */ jsxs(CardHeader, { children: [sectionLabel && /* @__PURE__ */ jsx(CardTitle, { children: sectionLabel }), sectionDescription && /* @__PURE__ */ jsx("p", {
365
+ className: "text-muted-foreground text-sm",
366
+ children: sectionDescription
367
+ })] }), /* @__PURE__ */ jsx(CardContent, {
368
+ className: "min-w-0",
369
+ children: itemsContent
370
+ })]
371
+ });
372
+ if (wrapper === "collapsible") return /* @__PURE__ */ jsx(Accordion, {
373
+ defaultValue: defaultCollapsed ? [] : [0],
374
+ className: cn("min-w-0", className),
375
+ children: /* @__PURE__ */ jsxs(AccordionItem, {
376
+ className: "border-none",
377
+ children: [/* @__PURE__ */ jsx(AccordionTrigger, {
674
378
  className: "py-2 hover:no-underline",
675
379
  children: /* @__PURE__ */ jsxs("div", {
676
380
  className: "text-left",
677
- children: [t10, t11]
381
+ children: [sectionLabel && /* @__PURE__ */ jsx("span", {
382
+ className: "text-lg font-semibold",
383
+ children: sectionLabel
384
+ }), sectionDescription && /* @__PURE__ */ jsx("p", {
385
+ className: "text-muted-foreground text-sm font-normal",
386
+ children: sectionDescription
387
+ })]
678
388
  })
679
- });
680
- $[45] = t10;
681
- $[46] = t11;
682
- $[47] = t12;
683
- } else t12 = $[47];
684
- let t13;
685
- if ($[48] !== itemsContent) {
686
- t13 = /* @__PURE__ */ jsx(AccordionContent, {
389
+ }), /* @__PURE__ */ jsx(AccordionContent, {
687
390
  className: "pt-4",
688
391
  children: itemsContent
689
- });
690
- $[48] = itemsContent;
691
- $[49] = t13;
692
- } else t13 = $[49];
693
- let t14;
694
- if ($[50] !== t12 || $[51] !== t13) {
695
- t14 = /* @__PURE__ */ jsxs(AccordionItem, {
696
- className: "border-none",
697
- children: [t12, t13]
698
- });
699
- $[50] = t12;
700
- $[51] = t13;
701
- $[52] = t14;
702
- } else t14 = $[52];
703
- let t15;
704
- if ($[53] !== t14 || $[54] !== t8 || $[55] !== t9) {
705
- t15 = /* @__PURE__ */ jsx(Accordion, {
706
- defaultValue: t8,
707
- className: t9,
708
- children: t14
709
- });
710
- $[53] = t14;
711
- $[54] = t8;
712
- $[55] = t9;
713
- $[56] = t15;
714
- } else t15 = $[56];
715
- return t15;
716
- }
392
+ })]
393
+ })
394
+ });
717
395
  return itemsContent;
718
396
  }
719
- function TabsRenderer(t0) {
720
- const $ = c(26);
721
- const { tabs, basePath, navigate, widgetRegistry, resolveText, dashboardRealtime, columns: t1, rowHeight, gap } = t0;
722
- const columns = t1 === void 0 ? 4 : t1;
397
+ function TabsRenderer({ tabs, basePath, navigate, widgetRegistry, resolveText, dashboardRealtime, columns = 4, rowHeight, gap }) {
723
398
  const { tabs: tabConfigs, defaultTab } = tabs;
724
- let t2;
725
- let t3;
726
- if ($[0] !== basePath || $[1] !== columns || $[2] !== dashboardRealtime || $[3] !== defaultTab || $[4] !== gap || $[5] !== navigate || $[6] !== resolveText || $[7] !== rowHeight || $[8] !== tabConfigs || $[9] !== tabs.className || $[10] !== widgetRegistry) {
727
- t3 = Symbol.for("react.early_return_sentinel");
728
- bb0: {
729
- const visibleTabs = tabConfigs.filter(_temp2);
730
- if (visibleTabs.length === 0) {
731
- t3 = null;
732
- break bb0;
733
- }
734
- const defaultValue = visibleTabs.some((tab_0) => tab_0.id === defaultTab) ? defaultTab : visibleTabs[0]?.id;
735
- let t4;
736
- if ($[13] !== tabs.className) {
737
- t4 = cn("min-w-0", tabs.className);
738
- $[13] = tabs.className;
739
- $[14] = t4;
740
- } else t4 = $[14];
741
- let t5;
742
- if ($[15] !== resolveText) {
743
- t5 = (tab_1) => /* @__PURE__ */ jsxs(TabsTrigger, {
744
- value: tab_1.id,
399
+ const visibleTabs = tabConfigs.filter((tab) => tab.items.length > 0);
400
+ if (visibleTabs.length === 0) return null;
401
+ return /* @__PURE__ */ jsxs(Tabs, {
402
+ defaultValue: visibleTabs.some((tab) => tab.id === defaultTab) ? defaultTab : visibleTabs[0]?.id,
403
+ className: cn("min-w-0", tabs.className),
404
+ children: [/* @__PURE__ */ jsx("div", {
405
+ className: "mb-4 max-w-full overflow-x-auto",
406
+ children: /* @__PURE__ */ jsx(TabsList, {
407
+ className: "w-full min-w-max",
408
+ children: visibleTabs.map((tab) => /* @__PURE__ */ jsxs(TabsTrigger, {
409
+ value: tab.id,
745
410
  className: "flex-1",
746
411
  children: [
747
- resolveIconElement(tab_1.icon, { className: "size-3.5" }),
748
- resolveText(tab_1.label),
749
- tab_1.badge !== void 0 && /* @__PURE__ */ jsx("span", {
412
+ resolveIconElement(tab.icon, { className: "size-3.5" }),
413
+ resolveText(tab.label),
414
+ tab.badge !== void 0 && /* @__PURE__ */ jsx("span", {
750
415
  className: "bg-foreground text-background ml-1.5 rounded-full px-1.5 py-0.5 text-xs tabular-nums",
751
- children: tab_1.badge
416
+ children: tab.badge
752
417
  })
753
418
  ]
754
- }, tab_1.id);
755
- $[15] = resolveText;
756
- $[16] = t5;
757
- } else t5 = $[16];
758
- let t6;
759
- if ($[17] !== basePath || $[18] !== columns || $[19] !== dashboardRealtime || $[20] !== gap || $[21] !== navigate || $[22] !== resolveText || $[23] !== rowHeight || $[24] !== widgetRegistry) {
760
- t6 = (tab_2) => /* @__PURE__ */ jsx(TabsContent, {
761
- value: tab_2.id,
762
- className: "min-w-0",
763
- children: /* @__PURE__ */ jsx(TabContentRenderer, {
764
- tab: tab_2,
765
- columns,
766
- basePath,
767
- navigate,
768
- widgetRegistry,
769
- resolveText,
770
- dashboardRealtime,
771
- rowHeight,
772
- gap
773
- })
774
- }, tab_2.id);
775
- $[17] = basePath;
776
- $[18] = columns;
777
- $[19] = dashboardRealtime;
778
- $[20] = gap;
779
- $[21] = navigate;
780
- $[22] = resolveText;
781
- $[23] = rowHeight;
782
- $[24] = widgetRegistry;
783
- $[25] = t6;
784
- } else t6 = $[25];
785
- t2 = /* @__PURE__ */ jsxs(Tabs, {
786
- defaultValue,
787
- className: t4,
788
- children: [/* @__PURE__ */ jsx("div", {
789
- className: "mb-4 max-w-full overflow-x-auto",
790
- children: /* @__PURE__ */ jsx(TabsList, {
791
- className: "w-full min-w-max",
792
- children: visibleTabs.map(t5)
793
- })
794
- }), visibleTabs.map(t6)]
795
- });
796
- }
797
- $[0] = basePath;
798
- $[1] = columns;
799
- $[2] = dashboardRealtime;
800
- $[3] = defaultTab;
801
- $[4] = gap;
802
- $[5] = navigate;
803
- $[6] = resolveText;
804
- $[7] = rowHeight;
805
- $[8] = tabConfigs;
806
- $[9] = tabs.className;
807
- $[10] = widgetRegistry;
808
- $[11] = t2;
809
- $[12] = t3;
810
- } else {
811
- t2 = $[11];
812
- t3 = $[12];
813
- }
814
- if (t3 !== Symbol.for("react.early_return_sentinel")) return t3;
815
- return t2;
816
- }
817
- function _temp2(tab) {
818
- return tab.items.length > 0;
419
+ }, tab.id))
420
+ })
421
+ }), visibleTabs.map((tab) => /* @__PURE__ */ jsx(TabsContent, {
422
+ value: tab.id,
423
+ className: "min-w-0",
424
+ children: /* @__PURE__ */ jsx(TabContentRenderer, {
425
+ tab,
426
+ columns,
427
+ basePath,
428
+ navigate,
429
+ widgetRegistry,
430
+ resolveText,
431
+ dashboardRealtime,
432
+ rowHeight,
433
+ gap
434
+ })
435
+ }, tab.id))]
436
+ });
819
437
  }
820
- function TabContentRenderer(t0) {
821
- const $ = c(10);
822
- const { tab, columns: t1, basePath, navigate, widgetRegistry, resolveText, dashboardRealtime, rowHeight: inheritedRowHeight, gap: inheritedGap } = t0;
823
- const inheritedColumns = t1 === void 0 ? 4 : t1;
438
+ function TabContentRenderer({ tab, columns: inheritedColumns = 4, basePath, navigate, widgetRegistry, resolveText, dashboardRealtime, rowHeight: inheritedRowHeight, gap: inheritedGap }) {
824
439
  const columns = tab.columns ?? inheritedColumns;
825
440
  const rowHeight = tab.rowHeight ?? inheritedRowHeight;
826
441
  const gap = tab.gap ?? inheritedGap;
827
- let t2;
828
- if ($[0] !== basePath || $[1] !== columns || $[2] !== dashboardRealtime || $[3] !== gap || $[4] !== navigate || $[5] !== resolveText || $[6] !== rowHeight || $[7] !== tab.items || $[8] !== widgetRegistry) {
829
- t2 = /* @__PURE__ */ jsx(LayoutItemsRenderer, {
830
- items: tab.items,
831
- columns,
832
- basePath,
833
- navigate,
834
- widgetRegistry,
835
- resolveText,
836
- dashboardRealtime,
837
- rowHeight,
838
- gap
839
- });
840
- $[0] = basePath;
841
- $[1] = columns;
842
- $[2] = dashboardRealtime;
843
- $[3] = gap;
844
- $[4] = navigate;
845
- $[5] = resolveText;
846
- $[6] = rowHeight;
847
- $[7] = tab.items;
848
- $[8] = widgetRegistry;
849
- $[9] = t2;
850
- } else t2 = $[9];
851
- return t2;
442
+ return /* @__PURE__ */ jsx(LayoutItemsRenderer, {
443
+ items: tab.items,
444
+ columns,
445
+ basePath,
446
+ navigate,
447
+ widgetRegistry,
448
+ resolveText,
449
+ dashboardRealtime,
450
+ rowHeight,
451
+ gap
452
+ });
852
453
  }
853
454
  /**
854
455
  * DashboardGrid - Renders a configurable grid of dashboard widgets
@@ -883,142 +484,44 @@ function TabContentRenderer(t0) {
883
484
  * <DashboardGrid config={dashboardConfig} basePath="/admin" navigate={navigate} />
884
485
  * ```
885
486
  */
886
- function DashboardGrid(t0) {
887
- const $ = c(54);
888
- const { config, basePath: t1, navigate, widgetRegistry, className } = t0;
889
- const basePath = t1 === void 0 ? "/admin" : t1;
487
+ function DashboardGrid({ config, basePath = "/admin", navigate, widgetRegistry, className }) {
890
488
  const resolveText = useResolveText();
891
489
  const { t } = useTranslation();
892
- const { title, description, columns: t2, rowHeight, gap, realtime: dashboardRealtime } = config;
893
- const columns = t2 === void 0 ? 4 : t2;
894
- let t3;
895
- if ($[0] !== config.items || $[1] !== config.widgets) {
896
- t3 = config.items || config.widgets || [];
897
- $[0] = config.items;
898
- $[1] = config.widgets;
899
- $[2] = t3;
900
- } else t3 = $[2];
901
- const layoutItems = t3;
902
- let t4;
903
- if ($[3] !== resolveText || $[4] !== title) {
904
- t4 = title ? resolveText(title) : void 0;
905
- $[3] = resolveText;
906
- $[4] = title;
907
- $[5] = t4;
908
- } else t4 = $[5];
909
- const resolvedTitle = t4;
910
- let t5;
911
- if ($[6] !== description || $[7] !== resolveText) {
912
- t5 = description ? resolveText(description) : void 0;
913
- $[6] = description;
914
- $[7] = resolveText;
915
- $[8] = t5;
916
- } else t5 = $[8];
917
- const resolvedDescription = t5;
918
- if (layoutItems.length === 0) {
919
- let t6$1;
920
- if ($[9] !== className) {
921
- t6$1 = cn("qa-dashboard @container", className);
922
- $[9] = className;
923
- $[10] = t6$1;
924
- } else t6$1 = $[10];
925
- let t7$1;
926
- if ($[11] !== config.actions || $[12] !== navigate || $[13] !== resolveText || $[14] !== resolvedDescription || $[15] !== resolvedTitle) {
927
- t7$1 = /* @__PURE__ */ jsx(DashboardHeader, {
928
- title: resolvedTitle,
929
- description: resolvedDescription,
930
- actions: config.actions,
931
- navigate,
932
- resolveText
933
- });
934
- $[11] = config.actions;
935
- $[12] = navigate;
936
- $[13] = resolveText;
937
- $[14] = resolvedDescription;
938
- $[15] = resolvedTitle;
939
- $[16] = t7$1;
940
- } else t7$1 = $[16];
941
- let t8$1;
942
- if ($[17] !== t) {
943
- t8$1 = t("dashboard.noWidgets");
944
- $[17] = t;
945
- $[18] = t8$1;
946
- } else t8$1 = $[18];
947
- let t9$1;
948
- if ($[19] !== t8$1) {
949
- t9$1 = /* @__PURE__ */ jsx("p", {
950
- className: "text-muted-foreground font-medium",
951
- children: t8$1
952
- });
953
- $[19] = t8$1;
954
- $[20] = t9$1;
955
- } else t9$1 = $[20];
956
- let t10;
957
- if ($[21] !== t) {
958
- t10 = t("dashboard.noWidgetsDescription");
959
- $[21] = t;
960
- $[22] = t10;
961
- } else t10 = $[22];
962
- let t11;
963
- if ($[23] !== t10) {
964
- t11 = /* @__PURE__ */ jsx("p", {
965
- className: "text-muted-foreground mt-1 text-sm",
966
- children: t10
967
- });
968
- $[23] = t10;
969
- $[24] = t11;
970
- } else t11 = $[24];
971
- let t12;
972
- if ($[25] !== t11 || $[26] !== t9$1) {
973
- t12 = /* @__PURE__ */ jsx("div", {
974
- className: "flex h-48 items-center justify-center",
975
- children: /* @__PURE__ */ jsxs("div", {
976
- className: "text-center",
977
- children: [t9$1, t11]
978
- })
979
- });
980
- $[25] = t11;
981
- $[26] = t9$1;
982
- $[27] = t12;
983
- } else t12 = $[27];
984
- let t13;
985
- if ($[28] !== t12 || $[29] !== t6$1 || $[30] !== t7$1) {
986
- t13 = /* @__PURE__ */ jsxs("div", {
987
- className: t6$1,
988
- children: [t7$1, t12]
989
- });
990
- $[28] = t12;
991
- $[29] = t6$1;
992
- $[30] = t7$1;
993
- $[31] = t13;
994
- } else t13 = $[31];
995
- return t13;
996
- }
997
- let t6;
998
- if ($[32] !== className) {
999
- t6 = cn("qa-dashboard @container", className);
1000
- $[32] = className;
1001
- $[33] = t6;
1002
- } else t6 = $[33];
1003
- let t7;
1004
- if ($[34] !== config.actions || $[35] !== navigate || $[36] !== resolveText || $[37] !== resolvedDescription || $[38] !== resolvedTitle) {
1005
- t7 = /* @__PURE__ */ jsx(DashboardHeader, {
490
+ const { title, description, columns = 4, rowHeight, gap, realtime: dashboardRealtime } = config;
491
+ const layoutItems = config.items || config.widgets || [];
492
+ const resolvedTitle = title ? resolveText(title) : void 0;
493
+ const resolvedDescription = description ? resolveText(description) : void 0;
494
+ if (layoutItems.length === 0) return /* @__PURE__ */ jsxs("div", {
495
+ className: cn("qa-dashboard @container", className),
496
+ children: [/* @__PURE__ */ jsx(DashboardHeader, {
1006
497
  title: resolvedTitle,
1007
498
  description: resolvedDescription,
1008
499
  actions: config.actions,
1009
500
  navigate,
1010
501
  resolveText
1011
- });
1012
- $[34] = config.actions;
1013
- $[35] = navigate;
1014
- $[36] = resolveText;
1015
- $[37] = resolvedDescription;
1016
- $[38] = resolvedTitle;
1017
- $[39] = t7;
1018
- } else t7 = $[39];
1019
- let t8;
1020
- if ($[40] !== basePath || $[41] !== columns || $[42] !== dashboardRealtime || $[43] !== gap || $[44] !== layoutItems || $[45] !== navigate || $[46] !== resolveText || $[47] !== rowHeight || $[48] !== widgetRegistry) {
1021
- t8 = /* @__PURE__ */ jsx(LayoutItemsRenderer, {
502
+ }), /* @__PURE__ */ jsx("div", {
503
+ className: "flex h-48 items-center justify-center",
504
+ children: /* @__PURE__ */ jsxs("div", {
505
+ className: "text-center",
506
+ children: [/* @__PURE__ */ jsx("p", {
507
+ className: "text-muted-foreground font-medium",
508
+ children: t("dashboard.noWidgets")
509
+ }), /* @__PURE__ */ jsx("p", {
510
+ className: "text-muted-foreground mt-1 text-sm",
511
+ children: t("dashboard.noWidgetsDescription")
512
+ })]
513
+ })
514
+ })]
515
+ });
516
+ return /* @__PURE__ */ jsxs("div", {
517
+ className: cn("qa-dashboard @container", className),
518
+ children: [/* @__PURE__ */ jsx(DashboardHeader, {
519
+ title: resolvedTitle,
520
+ description: resolvedDescription,
521
+ actions: config.actions,
522
+ navigate,
523
+ resolveText
524
+ }), /* @__PURE__ */ jsx(LayoutItemsRenderer, {
1022
525
  items: layoutItems,
1023
526
  columns,
1024
527
  rowHeight,
@@ -1028,30 +531,8 @@ function DashboardGrid(t0) {
1028
531
  widgetRegistry,
1029
532
  resolveText,
1030
533
  dashboardRealtime
1031
- });
1032
- $[40] = basePath;
1033
- $[41] = columns;
1034
- $[42] = dashboardRealtime;
1035
- $[43] = gap;
1036
- $[44] = layoutItems;
1037
- $[45] = navigate;
1038
- $[46] = resolveText;
1039
- $[47] = rowHeight;
1040
- $[48] = widgetRegistry;
1041
- $[49] = t8;
1042
- } else t8 = $[49];
1043
- let t9;
1044
- if ($[50] !== t6 || $[51] !== t7 || $[52] !== t8) {
1045
- t9 = /* @__PURE__ */ jsxs("div", {
1046
- className: t6,
1047
- children: [t7, t8]
1048
- });
1049
- $[50] = t6;
1050
- $[51] = t7;
1051
- $[52] = t8;
1052
- $[53] = t9;
1053
- } else t9 = $[53];
1054
- return t9;
534
+ })]
535
+ });
1055
536
  }
1056
537
 
1057
538
  //#endregion