@questpie/admin 3.0.3 → 3.0.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 (253) hide show
  1. package/README.md +34 -5
  2. package/dist/client/blocks/block-renderer.d.mts +2 -2
  3. package/dist/client/blocks/block-renderer.mjs +4 -1
  4. package/dist/client/builder/types/action-types.d.mts +31 -3
  5. package/dist/client/builder/types/collection-types.d.mts +140 -0
  6. package/dist/client/builder/types/ui-config.d.mts +16 -2
  7. package/dist/client/builder/types/views.d.mts +57 -0
  8. package/dist/client/builder/types/widget-types.d.mts +5 -0
  9. package/dist/client/components/actions/action-button.mjs +137 -199
  10. package/dist/client/components/actions/action-dialog.mjs +198 -156
  11. package/dist/client/components/actions/confirmation-dialog.mjs +2 -2
  12. package/dist/client/components/actions/header-actions.mjs +52 -53
  13. package/dist/client/components/admin-link.d.mts +2 -2
  14. package/dist/client/components/auth/auth-loading.mjs +41 -18
  15. package/dist/client/components/blocks/block-editor-layout.mjs +2 -2
  16. package/dist/client/components/blocks/block-fields-renderer.mjs +64 -28
  17. package/dist/client/components/blocks/block-insert-button.mjs +4 -4
  18. package/dist/client/components/blocks/block-item.mjs +2 -2
  19. package/dist/client/components/blocks/block-library-sidebar.mjs +91 -63
  20. package/dist/client/components/component-renderer.mjs +1 -1
  21. package/dist/client/components/fields/array-field.mjs +14 -14
  22. package/dist/client/components/fields/asset-preview-field.mjs +1 -1
  23. package/dist/client/components/fields/blocks-field/blocks-field.mjs +84 -104
  24. package/dist/client/components/fields/json-field.mjs +2 -2
  25. package/dist/client/components/fields/object-array-field.mjs +22 -22
  26. package/dist/client/components/fields/object-field.mjs +5 -5
  27. package/dist/client/components/fields/relation/displays/cards-display.mjs +16 -9
  28. package/dist/client/components/fields/relation/displays/chips-display.mjs +15 -12
  29. package/dist/client/components/fields/relation/displays/grid-display.mjs +15 -11
  30. package/dist/client/components/fields/relation/displays/list-display.mjs +33 -20
  31. package/dist/client/components/fields/relation/displays/table-display.mjs +62 -93
  32. package/dist/client/components/fields/relation/relation-items-display.mjs +1 -1
  33. package/dist/client/components/fields/relation-picker.mjs +7 -6
  34. package/dist/client/components/fields/relation-select.mjs +71 -47
  35. package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +392 -82
  36. package/dist/client/components/fields/rich-text-editor/extensions.mjs +54 -23
  37. package/dist/client/components/fields/rich-text-editor/image-popover.mjs +24 -50
  38. package/dist/client/components/fields/rich-text-editor/image-upload.mjs +66 -0
  39. package/dist/client/components/fields/rich-text-editor/index.d.mts +38 -0
  40. package/dist/client/components/fields/rich-text-editor/index.mjs +637 -376
  41. package/dist/client/components/fields/rich-text-editor/link-utils.mjs +26 -0
  42. package/dist/client/components/fields/rich-text-editor/presets.d.mts +10 -0
  43. package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +27 -6
  44. package/dist/client/components/fields/rich-text-editor/toolbar.mjs +464 -346
  45. package/dist/client/components/fields/rich-text-editor/types.d.mts +77 -0
  46. package/dist/client/components/fields/upload-field.mjs +45 -49
  47. package/dist/client/components/filter-builder/columns-tab.mjs +69 -62
  48. package/dist/client/components/filter-builder/filter-builder-sheet.mjs +473 -308
  49. package/dist/client/components/filter-builder/filters-tab.mjs +109 -82
  50. package/dist/client/components/filter-builder/saved-views-tab.mjs +300 -198
  51. package/dist/client/components/history-sidebar.mjs +850 -340
  52. package/dist/client/components/layout/field-layout-renderer.mjs +6 -5
  53. package/dist/client/components/locale-switcher.mjs +8 -8
  54. package/dist/client/components/media/media-grid.mjs +106 -86
  55. package/dist/client/components/media/media-picker-dialog.mjs +242 -230
  56. package/dist/client/components/preview/live-preview-mode.mjs +1 -1
  57. package/dist/client/components/primitives/asset-preview.mjs +37 -22
  58. package/dist/client/components/primitives/date-input.mjs +212 -249
  59. package/dist/client/components/primitives/dropzone.mjs +192 -159
  60. package/dist/client/components/primitives/field-select-control.mjs +93 -0
  61. package/dist/client/components/primitives/select-multi.mjs +406 -365
  62. package/dist/client/components/primitives/select-single.mjs +391 -323
  63. package/dist/client/components/primitives/time-input.mjs +2 -2
  64. package/dist/client/components/sheets/resource-sheet.mjs +2 -0
  65. package/dist/client/components/ui/accordion.mjs +4 -4
  66. package/dist/client/components/ui/alert.mjs +3 -3
  67. package/dist/client/components/ui/badge.mjs +4 -4
  68. package/dist/client/components/ui/button.mjs +47 -37
  69. package/dist/client/components/ui/card.mjs +2 -2
  70. package/dist/client/components/ui/checkbox.mjs +1 -1
  71. package/dist/client/components/ui/command.mjs +5 -5
  72. package/dist/client/components/ui/dialog.mjs +3 -3
  73. package/dist/client/components/ui/drawer.mjs +1 -1
  74. package/dist/client/components/ui/dropdown-menu.mjs +157 -15
  75. package/dist/client/components/ui/empty-state.mjs +88 -59
  76. package/dist/client/components/ui/field.mjs +2 -2
  77. package/dist/client/components/ui/input-group.mjs +3 -3
  78. package/dist/client/components/ui/input.mjs +1 -1
  79. package/dist/client/components/ui/kbd.mjs +1 -1
  80. package/dist/client/components/ui/label.mjs +1 -1
  81. package/dist/client/components/ui/popover.mjs +19 -11
  82. package/dist/client/components/ui/scroll-fade.mjs +170 -0
  83. package/dist/client/components/ui/search-input.mjs +1 -1
  84. package/dist/client/components/ui/select.mjs +129 -27
  85. package/dist/client/components/ui/sheet.mjs +54 -34
  86. package/dist/client/components/ui/sidebar.mjs +15 -14
  87. package/dist/client/components/ui/skeleton.mjs +28 -12
  88. package/dist/client/components/ui/switch.mjs +2 -2
  89. package/dist/client/components/ui/table.mjs +82 -74
  90. package/dist/client/components/ui/tabs.mjs +26 -31
  91. package/dist/client/components/ui/textarea.mjs +1 -1
  92. package/dist/client/components/ui/tooltip.mjs +1 -1
  93. package/dist/client/components/widgets/chart-widget.mjs +154 -100
  94. package/dist/client/components/widgets/progress-widget.mjs +63 -36
  95. package/dist/client/components/widgets/quick-actions-widget.mjs +207 -115
  96. package/dist/client/components/widgets/recent-items-widget.mjs +147 -103
  97. package/dist/client/components/widgets/stats-widget.mjs +91 -72
  98. package/dist/client/components/widgets/table-widget.mjs +161 -247
  99. package/dist/client/components/widgets/timeline-widget.mjs +119 -78
  100. package/dist/client/components/widgets/value-widget.mjs +286 -157
  101. package/dist/client/components/widgets/widget-empty-state.mjs +88 -0
  102. package/dist/client/components/widgets/widget-skeletons.mjs +53 -20
  103. package/dist/client/contexts/focus-context.d.mts +2 -2
  104. package/dist/client/hooks/use-action.mjs +63 -55
  105. package/dist/client/hooks/use-audit-history.mjs +1 -65
  106. package/dist/client/hooks/use-collection-validation.mjs +36 -23
  107. package/dist/client/hooks/use-collection.mjs +96 -1
  108. package/dist/client/hooks/use-saved-views.mjs +70 -49
  109. package/dist/client/hooks/use-server-actions.mjs +70 -46
  110. package/dist/client/hooks/use-server-validation.mjs +156 -41
  111. package/dist/client/hooks/use-server-widget-data.mjs +1 -1
  112. package/dist/client/hooks/use-setup-status.d.mts +3 -3
  113. package/dist/client/hooks/use-setup-status.mjs +2 -2
  114. package/dist/client/hooks/use-transition-stage.mjs +2 -10
  115. package/dist/client/hooks/use-validation-error-map.mjs +31 -13
  116. package/dist/client/hooks/use-view-state.mjs +238 -174
  117. package/dist/client/i18n/date-locale.mjs +33 -0
  118. package/dist/client/i18n/hooks.mjs +17 -1
  119. package/dist/client/lib/utils.mjs +3 -2
  120. package/dist/client/preview/block-scope-context.d.mts +2 -2
  121. package/dist/client/preview/preview-banner.d.mts +2 -2
  122. package/dist/client/preview/preview-banner.mjs +75 -46
  123. package/dist/client/preview/preview-field.d.mts +4 -4
  124. package/dist/client/preview/preview-field.mjs +2 -2
  125. package/dist/client/runtime/provider.mjs +8 -1
  126. package/dist/client/runtime/translations-provider.mjs +1 -1
  127. package/dist/client/scope/picker.d.mts +2 -2
  128. package/dist/client/scope/provider.d.mts +2 -2
  129. package/dist/client/styles/base.css +1022 -0
  130. package/dist/client/styles/index.css +3 -589
  131. package/dist/client/utils/auto-expand-fields.mjs +4 -2
  132. package/dist/client/utils/keyboard-shortcuts.mjs +26 -0
  133. package/dist/client/utils/use-lazy-component.mjs +80 -0
  134. package/dist/client/views/auth/accept-invite-form.d.mts +2 -2
  135. package/dist/client/views/auth/auth-layout.d.mts +17 -10
  136. package/dist/client/views/auth/auth-layout.mjs +291 -80
  137. package/dist/client/views/auth/forgot-password-form.d.mts +2 -2
  138. package/dist/client/views/auth/forgot-password-form.mjs +2 -2
  139. package/dist/client/views/auth/login-form.d.mts +2 -2
  140. package/dist/client/views/auth/login-form.mjs +1 -1
  141. package/dist/client/views/auth/reset-password-form.d.mts +2 -2
  142. package/dist/client/views/auth/reset-password-form.mjs +2 -2
  143. package/dist/client/views/auth/setup-form.d.mts +2 -2
  144. package/dist/client/views/collection/auto-form-fields.mjs +11 -9
  145. package/dist/client/views/collection/bulk-action-toolbar.mjs +173 -138
  146. package/dist/client/views/collection/cells/complex-cells.mjs +22 -22
  147. package/dist/client/views/collection/cells/primitive-cells.mjs +1 -1
  148. package/dist/client/views/collection/cells/relation-cells.mjs +147 -129
  149. package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +224 -278
  150. package/dist/client/views/collection/cells/shared/relation-chip.mjs +64 -36
  151. package/dist/client/views/collection/cells/upload-cells.mjs +199 -9
  152. package/dist/client/views/collection/columns/build-columns.mjs +29 -9
  153. package/dist/client/views/collection/columns/column-defaults.mjs +2 -2
  154. package/dist/client/views/collection/field-renderer.mjs +50 -89
  155. package/dist/client/views/collection/form-view.mjs +237 -227
  156. package/dist/client/views/collection/table-view.mjs +1167 -234
  157. package/dist/client/views/collection/view-skeletons.mjs +222 -79
  158. package/dist/client/views/common/global-search.mjs +29 -18
  159. package/dist/client/views/dashboard/dashboard-grid.mjs +678 -501
  160. package/dist/client/views/dashboard/dashboard-widget.mjs +6 -3
  161. package/dist/client/views/dashboard/widget-card.mjs +23 -14
  162. package/dist/client/views/globals/global-form-view.mjs +634 -589
  163. package/dist/client/views/layout/admin-layout-provider.mjs +67 -70
  164. package/dist/client/views/layout/admin-layout.d.mts +3 -6
  165. package/dist/client/views/layout/admin-layout.mjs +152 -155
  166. package/dist/client/views/layout/admin-router.mjs +936 -616
  167. package/dist/client/views/layout/admin-sidebar.d.mts +38 -1
  168. package/dist/client/views/layout/admin-sidebar.mjs +762 -592
  169. package/dist/client/views/layout/admin-theme.d.mts +10 -0
  170. package/dist/client/views/layout/admin-theme.mjs +84 -0
  171. package/dist/client/views/layout/admin-view-layout.mjs +161 -0
  172. package/dist/client/views/pages/accept-invite-page.d.mts +2 -2
  173. package/dist/client/views/pages/accept-invite-page.mjs +49 -26
  174. package/dist/client/views/pages/dashboard-page.d.mts +2 -2
  175. package/dist/client/views/pages/forgot-password-page.d.mts +2 -2
  176. package/dist/client/views/pages/forgot-password-page.mjs +2 -19
  177. package/dist/client/views/pages/invite-page.d.mts +2 -2
  178. package/dist/client/views/pages/invite-page.mjs +2 -19
  179. package/dist/client/views/pages/login-page.d.mts +3 -3
  180. package/dist/client/views/pages/login-page.mjs +4 -21
  181. package/dist/client/views/pages/reset-password-page.d.mts +2 -2
  182. package/dist/client/views/pages/reset-password-page.mjs +3 -20
  183. package/dist/client/views/pages/setup-page.d.mts +2 -2
  184. package/dist/client/views/pages/setup-page.mjs +70 -71
  185. package/dist/client.d.mts +6 -2
  186. package/dist/client.mjs +2 -1
  187. package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
  188. package/dist/index.d.mts +6 -2
  189. package/dist/index.mjs +2 -1
  190. package/dist/server/augmentation/dashboard.d.mts +67 -3
  191. package/dist/server/augmentation/form-layout.d.mts +21 -0
  192. package/dist/server/augmentation/index.d.mts +1 -1
  193. package/dist/server/codegen/admin-client-template.mjs +4 -0
  194. package/dist/server/fields/blocks.d.mts +1 -1
  195. package/dist/server/fields/blocks.mjs +12 -0
  196. package/dist/server/fields/rich-text.d.mts +1 -1
  197. package/dist/server/fields/rich-text.mjs +8 -0
  198. package/dist/server/i18n/index.mjs +29 -7
  199. package/dist/server/i18n/messages/cs.mjs +414 -1
  200. package/dist/server/i18n/messages/de.mjs +412 -1
  201. package/dist/server/i18n/messages/en.mjs +166 -1
  202. package/dist/server/i18n/messages/es.mjs +412 -1
  203. package/dist/server/i18n/messages/fr.mjs +412 -1
  204. package/dist/server/i18n/messages/pl.mjs +416 -1
  205. package/dist/server/i18n/messages/pt.mjs +409 -1
  206. package/dist/server/i18n/messages/sk.mjs +216 -2
  207. package/dist/server/modules/admin/block/introspection.mjs +4 -1
  208. package/dist/server/modules/admin/block/prefetch.mjs +12 -2
  209. package/dist/server/modules/admin/collections/account.d.mts +2 -2
  210. package/dist/server/modules/admin/collections/admin-locks.d.mts +2 -2
  211. package/dist/server/modules/admin/collections/admin-preferences.d.mts +39 -39
  212. package/dist/server/modules/admin/collections/admin-saved-views.d.mts +47 -47
  213. package/dist/server/modules/admin/collections/apikey.d.mts +42 -42
  214. package/dist/server/modules/admin/collections/assets.d.mts +20 -20
  215. package/dist/server/modules/admin/collections/assets.mjs +0 -1
  216. package/dist/server/modules/admin/collections/session.d.mts +42 -42
  217. package/dist/server/modules/admin/collections/user.d.mts +40 -28
  218. package/dist/server/modules/admin/collections/user.mjs +40 -9
  219. package/dist/server/modules/admin/collections/verification.d.mts +36 -36
  220. package/dist/server/modules/admin/dto/admin-config.dto.mjs +2 -0
  221. package/dist/server/modules/admin/factories.mjs +7 -18
  222. package/dist/server/modules/admin/index.d.mts +1 -1
  223. package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
  224. package/dist/server/modules/admin/routes/admin-config.mjs +34 -16
  225. package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
  226. package/dist/server/modules/admin/routes/execute-action.mjs +67 -28
  227. package/dist/server/modules/admin/routes/i18n-helpers.mjs +34 -0
  228. package/dist/server/modules/admin/routes/locales.d.mts +2 -2
  229. package/dist/server/modules/admin/routes/preview.mjs +25 -17
  230. package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
  231. package/dist/server/modules/admin/routes/route-helpers.mjs +1 -1
  232. package/dist/server/modules/admin/routes/setup.d.mts +10 -10
  233. package/dist/server/modules/admin/routes/setup.mjs +16 -13
  234. package/dist/server/modules/admin/routes/translations.d.mts +4 -4
  235. package/dist/server/modules/admin/routes/translations.mjs +5 -1
  236. package/dist/server/modules/admin-preferences/collections/admin-preferences.mjs +1 -1
  237. package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +2 -2
  238. package/dist/server/modules/audit/.generated/module.d.mts +1 -1
  239. package/dist/server/modules/audit/.generated/module.mjs +1 -1
  240. package/dist/server/modules/audit/collections/audit-log.d.mts +2 -2
  241. package/dist/server/modules/audit/collections/audit-log.mjs +1 -1
  242. package/dist/server/modules/audit/config/app.mjs +99 -42
  243. package/dist/server/modules/audit/jobs/audit-cleanup.mjs +1 -1
  244. package/dist/server/plugin.mjs +4 -2
  245. package/dist/server/proxy-factories.d.mts +4 -3
  246. package/dist/server/proxy-factories.mjs +34 -8
  247. package/dist/shared/types/saved-views.types.d.mts +2 -0
  248. package/package.json +6 -4
  249. package/dist/client/components/fields/rich-text-editor/link-popover.mjs +0 -85
  250. package/dist/client/components/ui/spinner.mjs +0 -52
  251. package/dist/client/components/ui/toolbar.mjs +0 -136
  252. package/dist/client/contexts/breadcrumb-context.mjs +0 -60
  253. package/dist/client/views/layout/admin-topbar.mjs +0 -236
@@ -1,7 +1,8 @@
1
- import { useResolveText } from "../../i18n/hooks.mjs";
1
+ import { useResolveText, useTranslation } from "../../i18n/hooks.mjs";
2
2
  import { cn, formatLabel } from "../../lib/utils.mjs";
3
3
  import { resolveIconElement } from "../component-renderer.mjs";
4
4
  import { WidgetCard } from "../../views/dashboard/widget-card.mjs";
5
+ import { WidgetEmptyState } from "./widget-empty-state.mjs";
5
6
  import { c } from "react/compiler-runtime";
6
7
  import { Icon } from "@iconify/react";
7
8
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -20,189 +21,280 @@ import { jsx, jsxs } from "react/jsx-runtime";
20
21
  * of other dashboard widgets like recent-items.
21
22
  */
22
23
  function QuickActionsWidget(t0) {
23
- const $ = c(29);
24
+ const $ = c(66);
24
25
  const { config, basePath: t1, navigate } = t0;
25
26
  const basePath = t1 === void 0 ? "/admin" : t1;
26
27
  const resolveText = useResolveText();
27
- const { quickActions, layout: t2 } = config;
28
+ const { t } = useTranslation();
29
+ const { layout: t2 } = config;
28
30
  const layout = t2 === void 0 ? "list" : t2;
29
- let t3;
30
- if ($[0] !== config.title || $[1] !== resolveText) {
31
- t3 = config.title ? resolveText(config.title) : "Quick Actions";
32
- $[0] = config.title;
33
- $[1] = resolveText;
34
- $[2] = t3;
35
- } else t3 = $[2];
36
- const title = t3;
37
31
  let T0;
32
+ let t3;
38
33
  let t4;
39
34
  let t5;
40
35
  let t6;
41
36
  let t7;
42
- if ($[3] !== basePath || $[4] !== layout || $[5] !== navigate || $[6] !== quickActions || $[7] !== resolveText || $[8] !== title) {
43
- t7 = Symbol.for("react.early_return_sentinel");
37
+ let t8;
38
+ let t9;
39
+ if ($[0] !== basePath || $[1] !== config.actions || $[2] !== config.cardVariant || $[3] !== config.className || $[4] !== config.description || $[5] !== config.label || $[6] !== config.quickActions || $[7] !== config.title || $[8] !== layout || $[9] !== navigate || $[10] !== resolveText || $[11] !== t) {
40
+ t9 = Symbol.for("react.early_return_sentinel");
44
41
  bb0: {
45
- let t8$1;
46
- if ($[14] !== basePath || $[15] !== resolveText) {
47
- t8$1 = (action, index) => {
48
- if (typeof action === "string") {
49
- const [collection, actionType] = action.split(".");
42
+ const quickActions = config.quickActions ?? config.actions ?? [];
43
+ let t10$1;
44
+ if ($[20] !== config.label || $[21] !== config.title || $[22] !== resolveText || $[23] !== t) {
45
+ t10$1 = config.title ? resolveText(config.title) : config.label ? resolveText(config.label) : t("dashboard.quickActions");
46
+ $[20] = config.label;
47
+ $[21] = config.title;
48
+ $[22] = resolveText;
49
+ $[23] = t;
50
+ $[24] = t10$1;
51
+ } else t10$1 = $[24];
52
+ const title = t10$1;
53
+ let t11$1;
54
+ if ($[25] !== basePath) {
55
+ t11$1 = (action, fallback) => {
56
+ if (!action) return fallback;
57
+ if (action.type === "create") return `${basePath}/collections/${action.collection}/create`;
58
+ if (action.type === "page") return `${basePath}/${action.pageId}`;
59
+ return action.href;
60
+ };
61
+ $[25] = basePath;
62
+ $[26] = t11$1;
63
+ } else t11$1 = $[26];
64
+ const resolveActionHref = t11$1;
65
+ let t12;
66
+ if ($[27] !== basePath || $[28] !== resolveActionHref || $[29] !== resolveText || $[30] !== t) {
67
+ t12 = (action_0, index) => {
68
+ if (typeof action_0 === "string") {
69
+ const [collection, actionType] = action_0.split(".");
50
70
  return {
51
- id: `${action}-${index}`,
52
- label: `${actionType === "create" ? "New" : actionType} ${formatLabel(collection)}`,
71
+ id: `${action_0}-${index}`,
72
+ label: actionType === "create" ? t("collection.new", { name: formatLabel(collection) }) : `${actionType} ${formatLabel(collection)}`,
53
73
  href: `${basePath}/collections/${collection}/${actionType === "create" ? "create" : ""}`,
54
74
  icon: void 0,
55
75
  variant: "default"
56
76
  };
57
77
  }
78
+ const serverAction = "action" in action_0 ? action_0.action : void 0;
58
79
  return {
59
80
  id: `action-${index}`,
60
- label: resolveText(action.label),
61
- href: action.href,
62
- onClick: action.onClick,
63
- icon: action.icon,
64
- variant: action.variant || "default"
81
+ label: resolveText(action_0.label),
82
+ href: resolveActionHref(serverAction, action_0.href),
83
+ external: serverAction?.type === "link" ? serverAction.external : false,
84
+ onClick: action_0.onClick,
85
+ icon: action_0.icon,
86
+ variant: action_0.variant || "default"
65
87
  };
66
88
  };
67
- $[14] = basePath;
68
- $[15] = resolveText;
69
- $[16] = t8$1;
70
- } else t8$1 = $[16];
71
- const parsedActions = quickActions.map(t8$1);
72
- let t9$1;
73
- if ($[17] !== navigate) {
74
- t9$1 = (action_0) => {
75
- if (action_0.onClick) action_0.onClick();
76
- else if (action_0.href && navigate) navigate(action_0.href);
89
+ $[27] = basePath;
90
+ $[28] = resolveActionHref;
91
+ $[29] = resolveText;
92
+ $[30] = t;
93
+ $[31] = t12;
94
+ } else t12 = $[31];
95
+ const parsedActions = quickActions.map(t12);
96
+ let t13;
97
+ if ($[32] !== navigate) {
98
+ t13 = (action_1) => {
99
+ if (action_1.onClick) action_1.onClick();
100
+ else if (action_1.href && action_1.external) window.open(action_1.href, "_blank", "noopener,noreferrer");
101
+ else if (action_1.href && navigate) navigate(action_1.href);
77
102
  };
78
- $[17] = navigate;
79
- $[18] = t9$1;
80
- } else t9$1 = $[18];
81
- const handleClick = t9$1;
103
+ $[32] = navigate;
104
+ $[33] = t13;
105
+ } else t13 = $[33];
106
+ const handleClick = t13;
82
107
  const variantStyles = {
83
- default: "hover:bg-muted cursor-pointer",
84
- primary: "bg-primary/5 hover:bg-primary/10 border-primary/20 text-primary [&_svg]:text-primary cursor-pointer",
85
- secondary: "hover:bg-secondary cursor-pointer",
86
- outline: "border border-border hover:bg-muted cursor-pointer"
108
+ default: "border-border-subtle bg-surface-low/60 hover:border-border hover:bg-surface-high cursor-pointer",
109
+ primary: "border-primary/30 bg-primary/10 text-foreground hover:border-primary/45 hover:bg-primary/15 [&_svg]:text-primary cursor-pointer",
110
+ secondary: "border-border-subtle bg-secondary/60 hover:bg-secondary cursor-pointer",
111
+ outline: "border-border bg-background hover:bg-muted cursor-pointer"
87
112
  };
88
113
  const iconVariantStyles = {
89
114
  default: "bg-muted text-muted-foreground",
90
- primary: "bg-primary/10 text-primary",
115
+ primary: "bg-primary/15 text-primary",
91
116
  secondary: "bg-secondary text-secondary-foreground",
92
117
  outline: "bg-background text-muted-foreground"
93
118
  };
94
119
  if (parsedActions.length === 0) {
95
- let t10;
96
- if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
97
- t10 = /* @__PURE__ */ jsx("p", {
98
- className: "text-muted-foreground text-sm",
99
- children: "No actions configured"
120
+ let t14;
121
+ if ($[34] !== config.description || $[35] !== resolveText) {
122
+ t14 = config.description ? resolveText(config.description) : void 0;
123
+ $[34] = config.description;
124
+ $[35] = resolveText;
125
+ $[36] = t14;
126
+ } else t14 = $[36];
127
+ const t15 = config.cardVariant;
128
+ const t16 = config.className;
129
+ let t17;
130
+ if ($[37] !== t) {
131
+ t17 = t("widget.quickActions.emptyTitle");
132
+ $[37] = t;
133
+ $[38] = t17;
134
+ } else t17 = $[38];
135
+ let t18;
136
+ if ($[39] !== t) {
137
+ t18 = t("widget.quickActions.emptyDescription");
138
+ $[39] = t;
139
+ $[40] = t18;
140
+ } else t18 = $[40];
141
+ let t19;
142
+ if ($[41] !== t17 || $[42] !== t18) {
143
+ t19 = /* @__PURE__ */ jsx(WidgetEmptyState, {
144
+ iconName: "ph:lightning",
145
+ title: t17,
146
+ description: t18
100
147
  });
101
- $[19] = t10;
102
- } else t10 = $[19];
103
- let t11;
104
- if ($[20] !== title) {
105
- t11 = /* @__PURE__ */ jsx(WidgetCard, {
148
+ $[41] = t17;
149
+ $[42] = t18;
150
+ $[43] = t19;
151
+ } else t19 = $[43];
152
+ let t20;
153
+ if ($[44] !== config.cardVariant || $[45] !== config.className || $[46] !== t14 || $[47] !== t19 || $[48] !== title) {
154
+ t20 = /* @__PURE__ */ jsx(WidgetCard, {
106
155
  title,
107
- children: t10
156
+ description: t14,
157
+ variant: t15,
158
+ className: t16,
159
+ children: t19
108
160
  });
109
- $[20] = title;
110
- $[21] = t11;
111
- } else t11 = $[21];
112
- t7 = t11;
161
+ $[44] = config.cardVariant;
162
+ $[45] = config.className;
163
+ $[46] = t14;
164
+ $[47] = t19;
165
+ $[48] = title;
166
+ $[49] = t20;
167
+ } else t20 = $[49];
168
+ t9 = t20;
113
169
  break bb0;
114
170
  }
115
171
  if (layout === "grid") {
116
- t7 = /* @__PURE__ */ jsx(WidgetCard, {
172
+ let t14;
173
+ if ($[50] !== config.description || $[51] !== resolveText) {
174
+ t14 = config.description ? resolveText(config.description) : void 0;
175
+ $[50] = config.description;
176
+ $[51] = resolveText;
177
+ $[52] = t14;
178
+ } else t14 = $[52];
179
+ t9 = /* @__PURE__ */ jsx(WidgetCard, {
117
180
  title,
181
+ description: t14,
182
+ variant: config.cardVariant,
183
+ className: config.className,
118
184
  children: /* @__PURE__ */ jsx("div", {
119
- className: "grid grid-cols-2 gap-2",
120
- children: parsedActions.map((action_1) => {
121
- const iconElement = resolveIconElement(action_1.icon, { className: "h-4 w-4" });
185
+ className: "grid h-full grid-cols-2 gap-3",
186
+ children: parsedActions.map((action_2) => {
187
+ const iconElement = resolveIconElement(action_2.icon, { className: "h-4 w-4" });
122
188
  return /* @__PURE__ */ jsxs("button", {
123
189
  type: "button",
124
- onClick: () => handleClick(action_1),
125
- className: cn("flex flex-col items-center justify-center gap-2 p-3 text-center transition-colors", variantStyles[action_1.variant]),
190
+ onClick: () => handleClick(action_2),
191
+ className: cn("flex min-h-24 flex-col items-center justify-center gap-2 rounded-md border p-3 text-center", "transition-[background-color,border-color,transform] active:scale-[0.96]", variantStyles[action_2.variant]),
126
192
  children: [iconElement && /* @__PURE__ */ jsx("div", {
127
- className: cn("flex h-9 w-9 items-center justify-center", iconVariantStyles[action_1.variant]),
193
+ className: cn("flex h-9 w-9 items-center justify-center rounded-md", iconVariantStyles[action_2.variant]),
128
194
  children: iconElement
129
195
  }), /* @__PURE__ */ jsx("span", {
130
- className: "text-xs font-medium",
131
- children: action_1.label
196
+ className: "text-xs leading-tight font-medium text-balance",
197
+ children: action_2.label
132
198
  })]
133
- }, action_1.id);
199
+ }, action_2.id);
134
200
  })
135
201
  })
136
202
  });
137
203
  break bb0;
138
204
  }
139
205
  T0 = WidgetCard;
140
- t6 = title;
141
- t4 = "-mx-1 space-y-1";
142
- t5 = parsedActions.map((action_2) => {
143
- const iconElement_0 = resolveIconElement(action_2.icon, { className: "h-4 w-4" });
206
+ t5 = title;
207
+ if ($[53] !== config.description || $[54] !== resolveText) {
208
+ t6 = config.description ? resolveText(config.description) : void 0;
209
+ $[53] = config.description;
210
+ $[54] = resolveText;
211
+ $[55] = t6;
212
+ } else t6 = $[55];
213
+ t7 = config.cardVariant;
214
+ t8 = config.className;
215
+ t3 = "-mx-1 space-y-1";
216
+ t4 = parsedActions.map((action_3) => {
217
+ const iconElement_0 = resolveIconElement(action_3.icon, { className: "h-4 w-4" });
144
218
  return /* @__PURE__ */ jsxs("button", {
145
219
  type: "button",
146
- onClick: () => handleClick(action_2),
147
- className: cn("flex w-full items-center gap-3 px-2 py-2 text-left transition-colors", variantStyles[action_2.variant]),
220
+ onClick: () => handleClick(action_3),
221
+ className: cn("group flex min-h-10 w-full items-center gap-3 rounded-md px-2 py-2 text-left transition-[background-color,transform] active:scale-[0.96]", variantStyles[action_3.variant]),
148
222
  children: [
149
223
  iconElement_0 && /* @__PURE__ */ jsx("div", {
150
- className: cn("flex h-8 w-8 shrink-0 items-center justify-center", iconVariantStyles[action_2.variant]),
224
+ className: cn("flex h-8 w-8 shrink-0 items-center justify-center rounded-md", iconVariantStyles[action_3.variant]),
151
225
  children: iconElement_0
152
226
  }),
153
227
  /* @__PURE__ */ jsx("span", {
154
228
  className: "flex-1 truncate text-sm font-medium",
155
- children: action_2.label
229
+ children: action_3.label
156
230
  }),
157
231
  /* @__PURE__ */ jsx(Icon, {
158
232
  icon: "ph:arrow-right",
159
233
  className: "text-muted-foreground h-4 w-4 opacity-0 transition-opacity group-hover:opacity-100"
160
234
  })
161
235
  ]
162
- }, action_2.id);
236
+ }, action_3.id);
163
237
  });
164
238
  }
165
- $[3] = basePath;
166
- $[4] = layout;
167
- $[5] = navigate;
168
- $[6] = quickActions;
169
- $[7] = resolveText;
170
- $[8] = title;
171
- $[9] = T0;
172
- $[10] = t4;
173
- $[11] = t5;
174
- $[12] = t6;
175
- $[13] = t7;
239
+ $[0] = basePath;
240
+ $[1] = config.actions;
241
+ $[2] = config.cardVariant;
242
+ $[3] = config.className;
243
+ $[4] = config.description;
244
+ $[5] = config.label;
245
+ $[6] = config.quickActions;
246
+ $[7] = config.title;
247
+ $[8] = layout;
248
+ $[9] = navigate;
249
+ $[10] = resolveText;
250
+ $[11] = t;
251
+ $[12] = T0;
252
+ $[13] = t3;
253
+ $[14] = t4;
254
+ $[15] = t5;
255
+ $[16] = t6;
256
+ $[17] = t7;
257
+ $[18] = t8;
258
+ $[19] = t9;
176
259
  } else {
177
- T0 = $[9];
178
- t4 = $[10];
179
- t5 = $[11];
180
- t6 = $[12];
181
- t7 = $[13];
260
+ T0 = $[12];
261
+ t3 = $[13];
262
+ t4 = $[14];
263
+ t5 = $[15];
264
+ t6 = $[16];
265
+ t7 = $[17];
266
+ t8 = $[18];
267
+ t9 = $[19];
182
268
  }
183
- if (t7 !== Symbol.for("react.early_return_sentinel")) return t7;
184
- let t8;
185
- if ($[22] !== t4 || $[23] !== t5) {
186
- t8 = /* @__PURE__ */ jsx("div", {
187
- className: t4,
188
- children: t5
269
+ if (t9 !== Symbol.for("react.early_return_sentinel")) return t9;
270
+ let t10;
271
+ if ($[56] !== t3 || $[57] !== t4) {
272
+ t10 = /* @__PURE__ */ jsx("div", {
273
+ className: t3,
274
+ children: t4
189
275
  });
190
- $[22] = t4;
191
- $[23] = t5;
192
- $[24] = t8;
193
- } else t8 = $[24];
194
- let t9;
195
- if ($[25] !== T0 || $[26] !== t6 || $[27] !== t8) {
196
- t9 = /* @__PURE__ */ jsx(T0, {
197
- title: t6,
198
- children: t8
276
+ $[56] = t3;
277
+ $[57] = t4;
278
+ $[58] = t10;
279
+ } else t10 = $[58];
280
+ let t11;
281
+ if ($[59] !== T0 || $[60] !== t10 || $[61] !== t5 || $[62] !== t6 || $[63] !== t7 || $[64] !== t8) {
282
+ t11 = /* @__PURE__ */ jsx(T0, {
283
+ title: t5,
284
+ description: t6,
285
+ variant: t7,
286
+ className: t8,
287
+ children: t10
199
288
  });
200
- $[25] = T0;
201
- $[26] = t6;
202
- $[27] = t8;
203
- $[28] = t9;
204
- } else t9 = $[28];
205
- return t9;
289
+ $[59] = T0;
290
+ $[60] = t10;
291
+ $[61] = t5;
292
+ $[62] = t6;
293
+ $[63] = t7;
294
+ $[64] = t8;
295
+ $[65] = t11;
296
+ } else t11 = $[65];
297
+ return t11;
206
298
  }
207
299
 
208
300
  //#endregion