@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
@@ -1,7 +1,6 @@
1
1
  import { cn } from "../../lib/utils.mjs";
2
2
  import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "./input-group.mjs";
3
3
  import { Kbd } from "./kbd.mjs";
4
- import { c } from "react/compiler-runtime";
5
4
  import { Icon } from "@iconify/react";
6
5
  import { jsx, jsxs } from "react/jsx-runtime";
7
6
 
@@ -30,109 +29,43 @@ import { jsx, jsxs } from "react/jsx-runtime";
30
29
  * <SearchInput isLoading={isSearching} ... />
31
30
  * ```
32
31
  */
33
- function SearchInput(t0) {
34
- const $ = c(26);
35
- let className;
36
- let containerClassName;
37
- let onClear;
38
- let props;
39
- let shortcut;
40
- let t1;
41
- let value;
42
- if ($[0] !== t0) {
43
- ({shortcut, onClear, isLoading: t1, containerClassName, className, value, ...props} = t0);
44
- $[0] = t0;
45
- $[1] = className;
46
- $[2] = containerClassName;
47
- $[3] = onClear;
48
- $[4] = props;
49
- $[5] = shortcut;
50
- $[6] = t1;
51
- $[7] = value;
52
- } else {
53
- className = $[1];
54
- containerClassName = $[2];
55
- onClear = $[3];
56
- props = $[4];
57
- shortcut = $[5];
58
- t1 = $[6];
59
- value = $[7];
60
- }
61
- const isLoading = t1 === void 0 ? false : t1;
32
+ function SearchInput({ shortcut, onClear, isLoading = false, containerClassName, className, value, ...props }) {
62
33
  const hasValue = value !== void 0 && value !== "";
63
34
  const showClearButton = hasValue && onClear;
64
35
  const showShortcut = shortcut && !hasValue;
65
- let t2;
66
- if ($[8] !== containerClassName) {
67
- t2 = cn("qa-search-input border-border-subtle bg-card hover:bg-surface-low focus-within:border-border-strong focus-within:bg-card", containerClassName);
68
- $[8] = containerClassName;
69
- $[9] = t2;
70
- } else t2 = $[9];
71
- let t3;
72
- if ($[10] !== isLoading) {
73
- t3 = /* @__PURE__ */ jsx(InputGroupAddon, {
74
- align: "inline-start",
75
- children: isLoading ? /* @__PURE__ */ jsx(Icon, {
76
- icon: "ph:spinner-gap",
77
- className: "text-muted-foreground size-4 animate-spin"
78
- }) : /* @__PURE__ */ jsx(Icon, {
79
- icon: "ph:magnifying-glass",
80
- className: "text-muted-foreground size-4"
81
- })
82
- });
83
- $[10] = isLoading;
84
- $[11] = t3;
85
- } else t3 = $[11];
86
- let t4;
87
- if ($[12] !== className || $[13] !== props || $[14] !== value) {
88
- t4 = /* @__PURE__ */ jsx(InputGroupInput, {
89
- placeholder: "Search...",
90
- value,
91
- className,
92
- ...props
93
- });
94
- $[12] = className;
95
- $[13] = props;
96
- $[14] = value;
97
- $[15] = t4;
98
- } else t4 = $[15];
99
- let t5;
100
- if ($[16] !== onClear || $[17] !== shortcut || $[18] !== showClearButton || $[19] !== showShortcut) {
101
- t5 = (showClearButton || showShortcut) && /* @__PURE__ */ jsxs(InputGroupAddon, {
102
- align: "inline-end",
103
- children: [showClearButton && /* @__PURE__ */ jsx(InputGroupButton, {
104
- onClick: onClear,
105
- size: "icon-xs",
106
- className: "text-muted-foreground hover:text-foreground",
107
- children: /* @__PURE__ */ jsx(Icon, {
108
- icon: "ph:x",
109
- className: "size-3"
36
+ return /* @__PURE__ */ jsxs(InputGroup, {
37
+ className: cn("qa-search-input border-border-subtle bg-card hover:bg-surface-low focus-within:border-border-strong focus-within:bg-card", containerClassName),
38
+ children: [
39
+ /* @__PURE__ */ jsx(InputGroupAddon, {
40
+ align: "inline-start",
41
+ children: isLoading ? /* @__PURE__ */ jsx(Icon, {
42
+ icon: "ph:spinner-gap",
43
+ className: "text-muted-foreground size-4 animate-spin"
44
+ }) : /* @__PURE__ */ jsx(Icon, {
45
+ icon: "ph:magnifying-glass",
46
+ className: "text-muted-foreground size-4"
110
47
  })
111
- }), showShortcut && /* @__PURE__ */ jsx(Kbd, { children: shortcut })]
112
- });
113
- $[16] = onClear;
114
- $[17] = shortcut;
115
- $[18] = showClearButton;
116
- $[19] = showShortcut;
117
- $[20] = t5;
118
- } else t5 = $[20];
119
- let t6;
120
- if ($[21] !== t2 || $[22] !== t3 || $[23] !== t4 || $[24] !== t5) {
121
- t6 = /* @__PURE__ */ jsxs(InputGroup, {
122
- className: t2,
123
- children: [
124
- t3,
125
- t4,
126
- t5
127
- ]
128
- });
129
- $[21] = t2;
130
- $[22] = t3;
131
- $[23] = t4;
132
- $[24] = t5;
133
- $[25] = t6;
134
- } else t6 = $[25];
135
- return t6;
48
+ }),
49
+ /* @__PURE__ */ jsx(InputGroupInput, {
50
+ placeholder: "Search...",
51
+ value,
52
+ className,
53
+ ...props
54
+ }),
55
+ (showClearButton || showShortcut) && /* @__PURE__ */ jsxs(InputGroupAddon, {
56
+ align: "inline-end",
57
+ children: [showClearButton && /* @__PURE__ */ jsx(InputGroupButton, {
58
+ onClick: onClear,
59
+ size: "icon-xs",
60
+ className: "text-muted-foreground hover:text-foreground",
61
+ children: /* @__PURE__ */ jsx(Icon, {
62
+ icon: "ph:x",
63
+ className: "size-3"
64
+ })
65
+ }), showShortcut && /* @__PURE__ */ jsx(Kbd, { children: shortcut })]
66
+ })
67
+ ]
68
+ });
136
69
  }
137
70
 
138
71
  //#endregion
@@ -1,426 +1,105 @@
1
1
  "use client";
2
2
 
3
3
  import { cn } from "../../lib/utils.mjs";
4
- import { c } from "react/compiler-runtime";
5
4
  import { Icon } from "@iconify/react";
6
5
  import { jsx, jsxs } from "react/jsx-runtime";
7
6
  import { Select } from "@base-ui/react/select";
8
7
 
9
8
  //#region src/client/components/ui/select.tsx
10
9
  const Select$1 = Select.Root;
11
- function SelectGroup(t0) {
12
- const $ = c(8);
13
- let className;
14
- let props;
15
- if ($[0] !== t0) {
16
- ({className, ...props} = t0);
17
- $[0] = t0;
18
- $[1] = className;
19
- $[2] = props;
20
- } else {
21
- className = $[1];
22
- props = $[2];
23
- }
24
- let t1;
25
- if ($[3] !== className) {
26
- t1 = cn("qa-select__group scroll-my-1 p-1", className);
27
- $[3] = className;
28
- $[4] = t1;
29
- } else t1 = $[4];
30
- let t2;
31
- if ($[5] !== props || $[6] !== t1) {
32
- t2 = /* @__PURE__ */ jsx(Select.Group, {
33
- "data-slot": "select-group",
34
- className: t1,
35
- ...props
36
- });
37
- $[5] = props;
38
- $[6] = t1;
39
- $[7] = t2;
40
- } else t2 = $[7];
41
- return t2;
10
+ function SelectGroup({ className, ...props }) {
11
+ return /* @__PURE__ */ jsx(Select.Group, {
12
+ "data-slot": "select-group",
13
+ className: cn("qa-select__group scroll-my-1 p-1", className),
14
+ ...props
15
+ });
42
16
  }
43
- function SelectValue(t0) {
44
- const $ = c(8);
45
- let className;
46
- let props;
47
- if ($[0] !== t0) {
48
- ({className, ...props} = t0);
49
- $[0] = t0;
50
- $[1] = className;
51
- $[2] = props;
52
- } else {
53
- className = $[1];
54
- props = $[2];
55
- }
56
- let t1;
57
- if ($[3] !== className) {
58
- t1 = cn("qa-select__value flex flex-1 text-left", className);
59
- $[3] = className;
60
- $[4] = t1;
61
- } else t1 = $[4];
62
- let t2;
63
- if ($[5] !== props || $[6] !== t1) {
64
- t2 = /* @__PURE__ */ jsx(Select.Value, {
65
- "data-slot": "select-value",
66
- className: t1,
67
- ...props
68
- });
69
- $[5] = props;
70
- $[6] = t1;
71
- $[7] = t2;
72
- } else t2 = $[7];
73
- return t2;
17
+ function SelectValue({ className, ...props }) {
18
+ return /* @__PURE__ */ jsx(Select.Value, {
19
+ "data-slot": "select-value",
20
+ className: cn("qa-select__value flex flex-1 text-left", className),
21
+ ...props
22
+ });
74
23
  }
75
- function SelectTrigger(t0) {
76
- const $ = c(15);
77
- let children;
78
- let className;
79
- let props;
80
- let t1;
81
- let t2;
82
- if ($[0] !== t0) {
83
- ({className, size: t1, children, type: t2, ...props} = t0);
84
- $[0] = t0;
85
- $[1] = children;
86
- $[2] = className;
87
- $[3] = props;
88
- $[4] = t1;
89
- $[5] = t2;
90
- } else {
91
- children = $[1];
92
- className = $[2];
93
- props = $[3];
94
- t1 = $[4];
95
- t2 = $[5];
96
- }
97
- const size = t1 === void 0 ? "default" : t1;
98
- const type = t2 === void 0 ? "button" : t2;
99
- let t3;
100
- if ($[6] !== className) {
101
- t3 = cn("qa-select__trigger control-surface font-chrome data-[placeholder]:text-muted-foreground focus-visible:border-border-strong focus-visible:ring-ring/20 aria-expanded:border-border-strong aria-expanded:ring-ring/20 aria-invalid:border-border-strong aria-invalid:ring-ring/20 flex w-fit items-center justify-between gap-2 px-3 py-2 text-sm whitespace-nowrap outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 aria-expanded:ring-[3px] aria-invalid:ring-[3px] data-[size=sm]:h-8 data-[size=sm]:px-2.5 data-[size=sm]:text-xs *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className);
102
- $[6] = className;
103
- $[7] = t3;
104
- } else t3 = $[7];
105
- let t4;
106
- if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
107
- t4 = /* @__PURE__ */ jsx(Select.Icon, { render: /* @__PURE__ */ jsx(Icon, {
24
+ function SelectTrigger({ className, size = "default", children, type = "button", ...props }) {
25
+ return /* @__PURE__ */ jsxs(Select.Trigger, {
26
+ "data-slot": "select-trigger",
27
+ "data-size": size,
28
+ type,
29
+ className: cn("qa-select__trigger control-surface font-chrome data-[placeholder]:text-muted-foreground focus-visible:border-border-strong focus-visible:ring-ring/20 aria-expanded:border-border-strong aria-expanded:ring-ring/20 aria-invalid:border-border-strong aria-invalid:ring-ring/20 flex w-fit items-center justify-between gap-2 px-3 py-2 text-sm whitespace-nowrap outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 aria-expanded:ring-[3px] aria-invalid:ring-[3px] data-[size=sm]:h-8 data-[size=sm]:px-2.5 data-[size=sm]:text-xs *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
30
+ ...props,
31
+ children: [children, /* @__PURE__ */ jsx(Select.Icon, { render: /* @__PURE__ */ jsx(Icon, {
108
32
  icon: "ph:caret-down",
109
33
  className: "text-muted-foreground pointer-events-none size-4"
110
- }) });
111
- $[8] = t4;
112
- } else t4 = $[8];
113
- let t5;
114
- if ($[9] !== children || $[10] !== props || $[11] !== size || $[12] !== t3 || $[13] !== type) {
115
- t5 = /* @__PURE__ */ jsxs(Select.Trigger, {
116
- "data-slot": "select-trigger",
117
- "data-size": size,
118
- type,
119
- className: t3,
120
- ...props,
121
- children: [children, t4]
122
- });
123
- $[9] = children;
124
- $[10] = props;
125
- $[11] = size;
126
- $[12] = t3;
127
- $[13] = type;
128
- $[14] = t5;
129
- } else t5 = $[14];
130
- return t5;
34
+ }) })]
35
+ });
131
36
  }
132
- function SelectContent(t0) {
133
- const $ = c(26);
134
- let children;
135
- let className;
136
- let props;
137
- let t1;
138
- let t2;
139
- let t3;
140
- let t4;
141
- let t5;
142
- if ($[0] !== t0) {
143
- ({className, children, side: t1, sideOffset: t2, align: t3, alignOffset: t4, alignItemWithTrigger: t5, ...props} = t0);
144
- $[0] = t0;
145
- $[1] = children;
146
- $[2] = className;
147
- $[3] = props;
148
- $[4] = t1;
149
- $[5] = t2;
150
- $[6] = t3;
151
- $[7] = t4;
152
- $[8] = t5;
153
- } else {
154
- children = $[1];
155
- className = $[2];
156
- props = $[3];
157
- t1 = $[4];
158
- t2 = $[5];
159
- t3 = $[6];
160
- t4 = $[7];
161
- t5 = $[8];
162
- }
163
- const side = t1 === void 0 ? "bottom" : t1;
164
- const sideOffset = t2 === void 0 ? 4 : t2;
165
- const align = t3 === void 0 ? "center" : t3;
166
- const alignOffset = t4 === void 0 ? 0 : t4;
167
- const alignItemWithTrigger = t5 === void 0 ? true : t5;
168
- let t6;
169
- if ($[9] !== className) {
170
- t6 = cn("qa-select__content floating-surface motion-floating text-popover-foreground relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto data-ending-style:scale-[var(--motion-scale-enter)] data-ending-style:opacity-0 data-starting-style:scale-[var(--motion-scale-enter)] data-starting-style:opacity-0", className);
171
- $[9] = className;
172
- $[10] = t6;
173
- } else t6 = $[10];
174
- let t7;
175
- if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
176
- t7 = /* @__PURE__ */ jsx(SelectScrollUpButton, {});
177
- $[11] = t7;
178
- } else t7 = $[11];
179
- let t8;
180
- if ($[12] !== children) {
181
- t8 = /* @__PURE__ */ jsx(Select.List, { children });
182
- $[12] = children;
183
- $[13] = t8;
184
- } else t8 = $[13];
185
- let t9;
186
- if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
187
- t9 = /* @__PURE__ */ jsx(SelectScrollDownButton, {});
188
- $[14] = t9;
189
- } else t9 = $[14];
190
- let t10;
191
- if ($[15] !== props || $[16] !== t6 || $[17] !== t8) {
192
- t10 = /* @__PURE__ */ jsxs(Select.Popup, {
37
+ function SelectContent({ className, children, side = "bottom", sideOffset = 4, align = "center", alignOffset = 0, alignItemWithTrigger = true, ...props }) {
38
+ return /* @__PURE__ */ jsx(Select.Portal, { children: /* @__PURE__ */ jsx(Select.Positioner, {
39
+ side,
40
+ sideOffset,
41
+ align,
42
+ alignOffset,
43
+ alignItemWithTrigger,
44
+ className: "isolate z-50",
45
+ children: /* @__PURE__ */ jsxs(Select.Popup, {
193
46
  "data-slot": "select-content",
194
- className: t6,
47
+ className: cn("qa-select__content floating-surface motion-floating text-popover-foreground relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto data-ending-style:scale-[var(--motion-scale-enter)] data-ending-style:opacity-0 data-starting-style:scale-[var(--motion-scale-enter)] data-starting-style:opacity-0", className),
195
48
  ...props,
196
49
  children: [
197
- t7,
198
- t8,
199
- t9
50
+ /* @__PURE__ */ jsx(SelectScrollUpButton, {}),
51
+ /* @__PURE__ */ jsx(Select.List, { children }),
52
+ /* @__PURE__ */ jsx(SelectScrollDownButton, {})
200
53
  ]
201
- });
202
- $[15] = props;
203
- $[16] = t6;
204
- $[17] = t8;
205
- $[18] = t10;
206
- } else t10 = $[18];
207
- let t11;
208
- if ($[19] !== align || $[20] !== alignItemWithTrigger || $[21] !== alignOffset || $[22] !== side || $[23] !== sideOffset || $[24] !== t10) {
209
- t11 = /* @__PURE__ */ jsx(Select.Portal, { children: /* @__PURE__ */ jsx(Select.Positioner, {
210
- side,
211
- sideOffset,
212
- align,
213
- alignOffset,
214
- alignItemWithTrigger,
215
- className: "isolate z-50",
216
- children: t10
217
- }) });
218
- $[19] = align;
219
- $[20] = alignItemWithTrigger;
220
- $[21] = alignOffset;
221
- $[22] = side;
222
- $[23] = sideOffset;
223
- $[24] = t10;
224
- $[25] = t11;
225
- } else t11 = $[25];
226
- return t11;
54
+ })
55
+ }) });
227
56
  }
228
- function SelectLabel(t0) {
229
- const $ = c(8);
230
- let className;
231
- let props;
232
- if ($[0] !== t0) {
233
- ({className, ...props} = t0);
234
- $[0] = t0;
235
- $[1] = className;
236
- $[2] = props;
237
- } else {
238
- className = $[1];
239
- props = $[2];
240
- }
241
- let t1;
242
- if ($[3] !== className) {
243
- t1 = cn("qa-select__label text-muted-foreground px-2 py-1.5 text-xs", className);
244
- $[3] = className;
245
- $[4] = t1;
246
- } else t1 = $[4];
247
- let t2;
248
- if ($[5] !== props || $[6] !== t1) {
249
- t2 = /* @__PURE__ */ jsx(Select.GroupLabel, {
250
- "data-slot": "select-label",
251
- className: t1,
252
- ...props
253
- });
254
- $[5] = props;
255
- $[6] = t1;
256
- $[7] = t2;
257
- } else t2 = $[7];
258
- return t2;
57
+ function SelectLabel({ className, ...props }) {
58
+ return /* @__PURE__ */ jsx(Select.GroupLabel, {
59
+ "data-slot": "select-label",
60
+ className: cn("qa-select__label text-muted-foreground px-2 py-1.5 text-xs", className),
61
+ ...props
62
+ });
259
63
  }
260
- function SelectItem(t0) {
261
- const $ = c(13);
262
- let children;
263
- let className;
264
- let props;
265
- if ($[0] !== t0) {
266
- ({className, children, ...props} = t0);
267
- $[0] = t0;
268
- $[1] = children;
269
- $[2] = className;
270
- $[3] = props;
271
- } else {
272
- children = $[1];
273
- className = $[2];
274
- props = $[3];
275
- }
276
- let t1;
277
- if ($[4] !== className) {
278
- t1 = cn("qa-select__item item-surface focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground relative flex min-h-9 w-full cursor-default items-center gap-2 px-3 py-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className);
279
- $[4] = className;
280
- $[5] = t1;
281
- } else t1 = $[5];
282
- let t2;
283
- if ($[6] !== children) {
284
- t2 = /* @__PURE__ */ jsx(Select.ItemText, {
64
+ function SelectItem({ className, children, ...props }) {
65
+ return /* @__PURE__ */ jsxs(Select.Item, {
66
+ "data-slot": "select-item",
67
+ className: cn("qa-select__item item-surface focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground relative flex min-h-9 w-full cursor-default items-center gap-2 px-3 py-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
68
+ ...props,
69
+ children: [/* @__PURE__ */ jsx(Select.ItemText, {
285
70
  className: "flex flex-1 shrink-0 gap-2 whitespace-nowrap",
286
71
  children
287
- });
288
- $[6] = children;
289
- $[7] = t2;
290
- } else t2 = $[7];
291
- let t3;
292
- if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
293
- t3 = /* @__PURE__ */ jsx(Select.ItemIndicator, {
72
+ }), /* @__PURE__ */ jsx(Select.ItemIndicator, {
294
73
  render: /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute right-3 flex items-center justify-center" }),
295
74
  children: /* @__PURE__ */ jsx(Icon, {
296
75
  icon: "ph:check",
297
76
  className: "pointer-events-none"
298
77
  })
299
- });
300
- $[8] = t3;
301
- } else t3 = $[8];
302
- let t4;
303
- if ($[9] !== props || $[10] !== t1 || $[11] !== t2) {
304
- t4 = /* @__PURE__ */ jsxs(Select.Item, {
305
- "data-slot": "select-item",
306
- className: t1,
307
- ...props,
308
- children: [t2, t3]
309
- });
310
- $[9] = props;
311
- $[10] = t1;
312
- $[11] = t2;
313
- $[12] = t4;
314
- } else t4 = $[12];
315
- return t4;
78
+ })]
79
+ });
316
80
  }
317
- function SelectSeparator(t0) {
318
- const $ = c(8);
319
- let className;
320
- let props;
321
- if ($[0] !== t0) {
322
- ({className, ...props} = t0);
323
- $[0] = t0;
324
- $[1] = className;
325
- $[2] = props;
326
- } else {
327
- className = $[1];
328
- props = $[2];
329
- }
330
- let t1;
331
- if ($[3] !== className) {
332
- t1 = cn("bg-border pointer-events-none -mx-1 my-1 h-px", className);
333
- $[3] = className;
334
- $[4] = t1;
335
- } else t1 = $[4];
336
- let t2;
337
- if ($[5] !== props || $[6] !== t1) {
338
- t2 = /* @__PURE__ */ jsx(Select.Separator, {
339
- "data-slot": "select-separator",
340
- className: t1,
341
- ...props
342
- });
343
- $[5] = props;
344
- $[6] = t1;
345
- $[7] = t2;
346
- } else t2 = $[7];
347
- return t2;
81
+ function SelectSeparator({ className, ...props }) {
82
+ return /* @__PURE__ */ jsx(Select.Separator, {
83
+ "data-slot": "select-separator",
84
+ className: cn("bg-border pointer-events-none -mx-1 my-1 h-px", className),
85
+ ...props
86
+ });
348
87
  }
349
- function SelectScrollUpButton(t0) {
350
- const $ = c(9);
351
- let className;
352
- let props;
353
- if ($[0] !== t0) {
354
- ({className, ...props} = t0);
355
- $[0] = t0;
356
- $[1] = className;
357
- $[2] = props;
358
- } else {
359
- className = $[1];
360
- props = $[2];
361
- }
362
- let t1;
363
- if ($[3] !== className) {
364
- t1 = cn("qa-select__separator bg-border pointer-events-none -mx-1 my-1 h-px", className);
365
- $[3] = className;
366
- $[4] = t1;
367
- } else t1 = $[4];
368
- let t2;
369
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
370
- t2 = /* @__PURE__ */ jsx(Icon, { icon: "ph:caret-up" });
371
- $[5] = t2;
372
- } else t2 = $[5];
373
- let t3;
374
- if ($[6] !== props || $[7] !== t1) {
375
- t3 = /* @__PURE__ */ jsx(Select.ScrollUpArrow, {
376
- "data-slot": "select-scroll-up-button",
377
- className: t1,
378
- ...props,
379
- children: t2
380
- });
381
- $[6] = props;
382
- $[7] = t1;
383
- $[8] = t3;
384
- } else t3 = $[8];
385
- return t3;
88
+ function SelectScrollUpButton({ className, ...props }) {
89
+ return /* @__PURE__ */ jsx(Select.ScrollUpArrow, {
90
+ "data-slot": "select-scroll-up-button",
91
+ className: cn("qa-select__separator bg-border pointer-events-none -mx-1 my-1 h-px", className),
92
+ ...props,
93
+ children: /* @__PURE__ */ jsx(Icon, { icon: "ph:caret-up" })
94
+ });
386
95
  }
387
- function SelectScrollDownButton(t0) {
388
- const $ = c(9);
389
- let className;
390
- let props;
391
- if ($[0] !== t0) {
392
- ({className, ...props} = t0);
393
- $[0] = t0;
394
- $[1] = className;
395
- $[2] = props;
396
- } else {
397
- className = $[1];
398
- props = $[2];
399
- }
400
- let t1;
401
- if ($[3] !== className) {
402
- t1 = cn("bg-popover bottom-0 z-10 flex w-full cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5", className);
403
- $[3] = className;
404
- $[4] = t1;
405
- } else t1 = $[4];
406
- let t2;
407
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
408
- t2 = /* @__PURE__ */ jsx(Icon, { icon: "ph:caret-down" });
409
- $[5] = t2;
410
- } else t2 = $[5];
411
- let t3;
412
- if ($[6] !== props || $[7] !== t1) {
413
- t3 = /* @__PURE__ */ jsx(Select.ScrollDownArrow, {
414
- "data-slot": "select-scroll-down-button",
415
- className: t1,
416
- ...props,
417
- children: t2
418
- });
419
- $[6] = props;
420
- $[7] = t1;
421
- $[8] = t3;
422
- } else t3 = $[8];
423
- return t3;
96
+ function SelectScrollDownButton({ className, ...props }) {
97
+ return /* @__PURE__ */ jsx(Select.ScrollDownArrow, {
98
+ "data-slot": "select-scroll-down-button",
99
+ className: cn("bg-popover bottom-0 z-10 flex w-full cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5", className),
100
+ ...props,
101
+ children: /* @__PURE__ */ jsx(Icon, { icon: "ph:caret-down" })
102
+ });
424
103
  }
425
104
 
426
105
  //#endregion