themelia-ui 3.1.0 → 3.2.0

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 (178) hide show
  1. package/.agents/skills/themelia-ui/SKILL.md +38 -9
  2. package/.agents/skills/themelia-ui/manifest.json +23 -0
  3. package/.agents/skills/themelia-ui/references/api-compatibility.md +3 -2
  4. package/.agents/skills/themelia-ui/references/blocks.md +123 -0
  5. package/.agents/skills/themelia-ui/references/composition-ladder.md +8 -8
  6. package/.agents/skills/themelia-ui/references/composition.md +98 -1
  7. package/.agents/skills/themelia-ui/references/forms.md +23 -3
  8. package/.agents/skills/themelia-ui/references/framework-wiring.md +34 -6
  9. package/.agents/skills/themelia-ui/references/i18n.md +4 -2
  10. package/.agents/skills/themelia-ui/references/imports.md +1 -1
  11. package/.agents/skills/themelia-ui/references/installation.md +5 -4
  12. package/.agents/skills/themelia-ui/references/migration.md +22 -2
  13. package/.agents/skills/themelia-ui/references/provider-and-scoping.md +27 -9
  14. package/.agents/skills/themelia-ui/references/reference-workflows.md +43 -0
  15. package/.agents/skills/themelia-ui/references/structure-and-spacing.md +147 -0
  16. package/.agents/skills/themelia-ui/references/theming.md +6 -2
  17. package/.agents/skills/themelia-ui/references/troubleshooting.md +28 -5
  18. package/.agents/skills/themelia-ui/references/verification.md +58 -2
  19. package/CHANGELOG.md +25 -0
  20. package/README.md +3 -0
  21. package/dist/{alert-dialog-Bmo1YrTm.js → alert-dialog-Cg2HhuBe.js} +1 -1
  22. package/dist/base/alert-dialog.js +1 -1
  23. package/dist/base/cards.js +1 -1
  24. package/dist/base/choice-inputs.js +1 -1
  25. package/dist/base/combobox.js +1 -1
  26. package/dist/base/command.js +1 -1
  27. package/dist/base/date-pickers.js +1 -1
  28. package/dist/base/dialog.js +1 -1
  29. package/dist/base/display.js +1 -1
  30. package/dist/base/forms-numeric.js +1 -1
  31. package/dist/base/forms.js +1 -1
  32. package/dist/base/item.js +1 -1
  33. package/dist/base/navigation.js +1 -1
  34. package/dist/base/otp-input.js +1 -1
  35. package/dist/base/overlay.js +1 -1
  36. package/dist/base/popover-menu.js +1 -1
  37. package/dist/base/repeaters.js +1 -1
  38. package/dist/base/sheet.js +1 -1
  39. package/dist/base/sidebar.js +1 -1
  40. package/dist/base/skeleton.js +1 -1
  41. package/dist/base/structure.js +1 -1
  42. package/dist/base/timeline.js +1 -1
  43. package/dist/base/upload.js +1 -1
  44. package/dist/base/value-inputs.js +1 -1
  45. package/dist/blocks/admin/access.js +2 -2
  46. package/dist/blocks/admin/commerce.js +9 -9
  47. package/dist/blocks/analytics.js +3 -3
  48. package/dist/blocks/onboarding.js +1 -1
  49. package/dist/blocks/timelines.js +1 -1
  50. package/dist/{cards-DdiICdMM.js → cards-Ddhz43Bz.js} +2 -2
  51. package/dist/{choice-inputs-CCw-0gD6.js → choice-inputs-NwRxvmZN.js} +2 -2
  52. package/dist/combobox-519ubijc.js +292 -0
  53. package/dist/{command-CnB_IZSo.js → command-JjApYFds.js} +2 -2
  54. package/dist/{comments-C6Y_ddMt.js → comments-CCQ2QRaU.js} +4 -4
  55. package/dist/components/base/display/icon-badge.d.ts +2 -2
  56. package/dist/components/base/forms/form-field.d.ts +2 -2
  57. package/dist/components/base/structure/bleed.d.ts +1 -0
  58. package/dist/components/base/structure/grid.d.ts +8 -2
  59. package/dist/components/base/structure/split.d.ts +1 -0
  60. package/dist/components/features/combobox/fetching-combobox.d.ts +2 -1
  61. package/dist/components/features/combobox/resource-combobox.d.ts +3 -0
  62. package/dist/components/features/combobox/use-suggestions.d.ts +7 -0
  63. package/dist/css/structure.css +1 -1
  64. package/dist/{date-pickers-C2HgjpFU.js → date-pickers-BwCwKIVM.js} +1 -1
  65. package/dist/{dialog-0nRFg5Zs.js → dialog-CAnwRNrm.js} +1 -1
  66. package/dist/{display-BGN834xV.js → display-a7AoX_u7.js} +1 -1
  67. package/dist/features/actions.js +1 -1
  68. package/dist/features/activities.js +3 -3
  69. package/dist/features/ai-chat.js +2 -2
  70. package/dist/features/combobox.js +285 -273
  71. package/dist/features/comments.js +1 -1
  72. package/dist/features/data-view.js +5 -5
  73. package/dist/features/event-calendar.js +3 -3
  74. package/dist/features/filters.js +1 -1
  75. package/dist/features/global-search.js +4 -4
  76. package/dist/features/map.js +2 -2
  77. package/dist/features/media-library.js +8 -8
  78. package/dist/features/mentions.js +1 -1
  79. package/dist/features/overlays.js +1 -1
  80. package/dist/features/products.js +9 -9
  81. package/dist/features/resource-assignment.js +3 -3
  82. package/dist/features/resource.js +3 -3
  83. package/dist/features/schema-form.js +6 -6
  84. package/dist/features/sync.js +2 -2
  85. package/dist/features/table.js +1 -1
  86. package/dist/features/theme-tweaker.js +10 -10
  87. package/dist/{filters-geLuSlFL.js → filters-BhsTkWpZ.js} +9 -9
  88. package/dist/{forms-NxbJK4Mh.js → forms-C0WeNPFF.js} +1 -1
  89. package/dist/{forms-numeric-C6NMdj6G.js → forms-numeric-IwQ1ltNf.js} +1 -1
  90. package/dist/hooks/use-native-dialog.d.ts +1 -1
  91. package/dist/{item-CuUJyETl.js → item-M2pmpWXh.js} +1 -1
  92. package/dist/layout/app-shell.js +1 -1
  93. package/dist/layout/auth.js +1 -1
  94. package/dist/layout/header.js +3 -3
  95. package/dist/layout/navigation.js +1 -1
  96. package/dist/layout/page.js +2 -2
  97. package/dist/layout/settings.js +2 -2
  98. package/dist/layout/sidebar.js +10 -6
  99. package/dist/layout/workspace.js +3 -3
  100. package/dist/lib/ui-provider/ui-scope.d.ts +1 -1
  101. package/dist/{mentions-oeYNv_j1.js → mentions-BOxbigwp.js} +2 -2
  102. package/dist/{navigation-BTX5Ti0Z.js → navigation-Bgu7Vc0M.js} +2 -2
  103. package/dist/{navigation-WYKjDhZq.js → navigation-DiYACqpE.js} +2 -2
  104. package/dist/{overlay-C8RAgi2_.js → overlay-BuQOl8aP.js} +5 -5
  105. package/dist/{overlays-9BxwFTou.js → overlays-1sULyytH.js} +5 -5
  106. package/dist/{popover-menu-DcLeiw9r.js → popover-menu-QXgQeWeG.js} +1 -1
  107. package/dist/{repeaters-DfptvbGA.js → repeaters-CeH20dvr.js} +4 -4
  108. package/dist/{sheet-D-DVZH_b.js → sheet-CJ1-OAla.js} +1 -1
  109. package/dist/{sidebar-DXQOy_Cb.js → sidebar-D8uGqxio.js} +4 -4
  110. package/dist/{skeleton-CubvHel9.js → skeleton-BTKNKTdj.js} +1 -1
  111. package/dist/{structure-B9Y5NkP_.js → structure-CynEZ-OY.js} +1 -2
  112. package/dist/style.css +1 -1
  113. package/dist/styles/TOKENS.md +4 -3
  114. package/dist/{table-DT_20ity.js → table-B7dtIFUx.js} +4 -4
  115. package/dist/{timeline-BRZbSdhf.js → timeline-BR_jNgvz.js} +1 -1
  116. package/dist/{timelines-DczZKW5p.js → timelines-DXG1BfIN.js} +1 -1
  117. package/dist/{upload-C_6mlbfl.js → upload-CYuoJykZ.js} +1 -1
  118. package/dist/{value-inputs-CnO6RZeT.js → value-inputs-ng8aVJJZ.js} +4 -4
  119. package/docs/README.md +11 -1
  120. package/docs/build/browser-composition-fixture.ts +28 -0
  121. package/docs/build/recipes.md +398 -1
  122. package/docs/generated/component-index.json +1993 -862
  123. package/docs/generated/components/base--display.md +2 -2
  124. package/docs/generated/components/base--forms.md +72 -1
  125. package/docs/generated/components/base--structure.md +56 -5
  126. package/docs/generated/components/base--typography.md +38 -0
  127. package/docs/generated/components/blocks--admin--access.md +10 -0
  128. package/docs/generated/components/blocks--analytics.md +44 -0
  129. package/docs/generated/components/features--combobox.md +67 -0
  130. package/docs/generated/components/features--data-view.md +59 -3
  131. package/docs/generated/components/features--filters.md +10 -0
  132. package/docs/generated/components/features--media-library.md +68 -0
  133. package/docs/generated/components/features--overlays.md +54 -0
  134. package/docs/generated/components/features--rich-text-editor.md +38 -0
  135. package/docs/generated/components/layout--app-shell.md +31 -0
  136. package/docs/generated/components/layout--containers.md +40 -0
  137. package/docs/generated/components/layout--page.md +30 -1
  138. package/docs/generated/components/layout--sidebar.md +41 -0
  139. package/docs/generated/components/ui-provider.md +1 -1
  140. package/docs/generated/composition-ladder.md +8 -8
  141. package/docs/generated/consumer-contract.json +5736 -0
  142. package/docs/generated/imports.md +1 -1
  143. package/docs/generated/recipes.json +171 -1
  144. package/docs/generated/workflows/communications-overview/analytics/communications-reference.tsx +19 -0
  145. package/docs/generated/workflows/index.json +691 -0
  146. package/docs/generated/workflows/media-picking/media-library/media-picking-reference.tsx +63 -0
  147. package/docs/generated/workflows/media-picking/media-library/reference-data.ts +3 -0
  148. package/docs/generated/workflows/multi-section-form/form-workflow/multi-section-reference.tsx +46 -0
  149. package/docs/generated/workflows/nested-action-flow/action-overlays/nested-action-reference.tsx +39 -0
  150. package/docs/generated/workflows/record-detail/page-layout/record-detail-reference.tsx +24 -0
  151. package/docs/generated/workflows/resource-index/data-view/resource-index-reference.tsx +51 -0
  152. package/docs/generated/workflows/scoped-resource-selection/combobox/scoped-resource-reference.tsx +50 -0
  153. package/docs/generated/workflows/website-content-editor/media-library/reference-data.ts +3 -0
  154. package/docs/generated/workflows/website-content-editor/rich-text-editor/website-content-reference.tsx +33 -0
  155. package/docs/generated/workflows/workspace-navigation/app-shell/workspace-navigation-reference.tsx +26 -0
  156. package/docs/learn/api-compatibility.md +3 -2
  157. package/docs/learn/blocks.md +123 -0
  158. package/docs/learn/composition.md +98 -1
  159. package/docs/learn/forms.md +23 -3
  160. package/docs/learn/framework-wiring.md +34 -6
  161. package/docs/learn/i18n.md +4 -2
  162. package/docs/learn/installation.md +5 -4
  163. package/docs/learn/migration.md +22 -2
  164. package/docs/learn/provider-and-scoping.md +27 -9
  165. package/docs/learn/reference-workflows.md +43 -0
  166. package/docs/learn/structure-and-spacing.md +147 -0
  167. package/docs/learn/theming.md +6 -2
  168. package/docs/learn/troubleshooting.md +28 -5
  169. package/docs/learn/verification.md +58 -2
  170. package/package.json +4 -1
  171. package/scripts/consumer/codemod.mjs +3 -24
  172. package/scripts/consumer/contract-reader.mjs +42 -0
  173. package/scripts/consumer/css-scan.mjs +51 -0
  174. package/scripts/consumer/diagnose.mjs +136 -0
  175. package/scripts/consumer/find-component.mjs +28 -13
  176. package/scripts/consumer/install-skill.mjs +93 -11
  177. package/src/styles/TOKENS.md +4 -3
  178. package/dist/combobox-Byu8N-Oe.js +0 -274
@@ -4,15 +4,15 @@ import { s as e } from "../typography-DmeR05Er.js";
4
4
  import { t } from "../cx--CBrhWH0.js";
5
5
  import { c as n } from "../buttons-BX2JfL5X.js";
6
6
  import { t as r } from "../feedback-D4qVsKlD.js";
7
- import { m as i } from "../display-BGN834xV.js";
8
- import { C as a, E as o, _ as s, a as c, b as l, c as u, d, g as f, i as p, m, o as h, p as g, u as _, x as v, y } from "../combobox-Byu8N-Oe.js";
7
+ import { m as i } from "../display-a7AoX_u7.js";
8
+ import { C as a, E as o, _ as s, a as c, b as l, c as u, d, g as f, i as p, m, o as h, p as g, u as _, x as v, y } from "../combobox-519ubijc.js";
9
9
  import { t as b } from "../use-debounced-callback-BcKYwxqp.js";
10
10
  import { t as x } from "../spinner-Tc1QCnxM.js";
11
11
  import { PlusIcon as S } from "lucide-react";
12
- import { useCallback as C, useEffect as w, useId as T, useMemo as E, useRef as D, useState as O } from "react";
13
- import { Fragment as k, jsx as A, jsxs as j } from "react/jsx-runtime";
12
+ import { useCallback as C, useEffect as w, useId as T, useLayoutEffect as E, useMemo as D, useRef as O, useState as k } from "react";
13
+ import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
14
14
  import "#css/combobox.css";
15
- var M = {
15
+ var N = {
16
16
  root: "combobox__root___FdCB-",
17
17
  error: "combobox__error___2R4DY",
18
18
  errorState: "combobox__errorState___0HPSR",
@@ -30,66 +30,66 @@ var M = {
30
30
  };
31
31
  //#endregion
32
32
  //#region src/components/features/combobox/combobox-dropdown.tsx
33
- function N({ loading: t, trimmedSearch: n, minSearchLength: r, strings: i }) {
34
- return t ? /* @__PURE__ */ A(x, { label: i.searching }) : n === "" ? /* @__PURE__ */ A(e, {
33
+ function P({ loading: t, trimmedSearch: n, minSearchLength: r, strings: i }) {
34
+ return t ? /* @__PURE__ */ j(x, { label: i.searching }) : n === "" ? /* @__PURE__ */ j(e, {
35
35
  size: "xs",
36
36
  type: "secondary",
37
37
  children: i.formatTypeToSearch(r)
38
- }) : n.length < r ? /* @__PURE__ */ A(e, {
38
+ }) : n.length < r ? /* @__PURE__ */ j(e, {
39
39
  size: "xs",
40
40
  type: "secondary",
41
41
  children: i.formatTypeMore(r - n.length)
42
42
  }) : null;
43
43
  }
44
- function P({ loading: t, showStatus: r, showEmpty: o, trimmedSearch: c, minSearchLength: p, items: h, groupedItems: g, createOptionItem: v, renderItemContent: b, getItemReactKey: S, getItemDisabled: C, renderGroupLabel: w, loadingMore: T, strings: E, portalContainer: D, listRef: O, anchor: P, applyFooter: F, errorSlot: I }) {
45
- let L = !!I || r || o || h.length > 0 || !!T || !!F, R = (e) => /* @__PURE__ */ A(m, {
44
+ function F({ loading: t, showStatus: r, showEmpty: o, trimmedSearch: c, minSearchLength: p, items: h, groupedItems: g, createOptionItem: v, renderItemContent: b, getItemReactKey: S, getItemDisabled: C, renderGroupLabel: w, loadingMore: T, strings: E, portalContainer: D, listRef: O, anchor: k, applyFooter: F, errorSlot: I }) {
45
+ let L = !!I || r || o || h.length > 0 || !!T || !!F, R = (e) => /* @__PURE__ */ j(m, {
46
46
  value: e,
47
47
  disabled: C?.(e),
48
48
  children: b(e)
49
- }, S(e)), z = /* @__PURE__ */ A(l, {
50
- anchor: P,
51
- className: D ? M.positioner : void 0,
52
- children: /* @__PURE__ */ A(s, {
49
+ }, S(e)), z = /* @__PURE__ */ j(l, {
50
+ anchor: k,
51
+ className: D ? N.positioner : void 0,
52
+ children: /* @__PURE__ */ j(s, {
53
53
  "aria-busy": t || void 0,
54
54
  "data-empty": !L || void 0,
55
- className: M.popup,
56
- children: I ?? /* @__PURE__ */ j(k, { children: [
57
- r && /* @__PURE__ */ A(a, {
58
- className: M.status,
59
- children: /* @__PURE__ */ A(N, {
55
+ className: N.popup,
56
+ children: I ?? /* @__PURE__ */ M(A, { children: [
57
+ r && /* @__PURE__ */ j(a, {
58
+ className: N.status,
59
+ children: /* @__PURE__ */ j(P, {
60
60
  loading: t,
61
61
  trimmedSearch: c,
62
62
  minSearchLength: p,
63
63
  strings: E
64
64
  })
65
65
  }),
66
- o && /* @__PURE__ */ A(a, {
67
- className: M.empty,
68
- children: /* @__PURE__ */ A(e, {
66
+ o && /* @__PURE__ */ j(a, {
67
+ className: N.empty,
68
+ children: /* @__PURE__ */ j(e, {
69
69
  type: "secondary",
70
70
  children: E.noResults
71
71
  })
72
72
  }),
73
- /* @__PURE__ */ A(i, {
73
+ /* @__PURE__ */ j(i, {
74
74
  ref: O,
75
- className: M.scroller,
76
- children: /* @__PURE__ */ A(f, {
77
- className: M.list,
78
- children: g ? /* @__PURE__ */ j(k, { children: [Array.from(g.entries()).map(([e, t]) => /* @__PURE__ */ j(_, {
75
+ className: N.scroller,
76
+ children: /* @__PURE__ */ j(f, {
77
+ className: N.list,
78
+ children: g ? /* @__PURE__ */ M(A, { children: [Array.from(g.entries()).map(([e, t]) => /* @__PURE__ */ M(_, {
79
79
  items: t,
80
- children: [/* @__PURE__ */ A(d, { children: w ? w(e) : e }), /* @__PURE__ */ A(u, { children: R })]
81
- }, e)), v !== null && R(v)] }) : /* @__PURE__ */ A(u, { children: R })
80
+ children: [/* @__PURE__ */ j(d, { children: w ? w(e) : e }), /* @__PURE__ */ j(u, { children: R })]
81
+ }, e)), v !== null && R(v)] }) : /* @__PURE__ */ j(u, { children: R })
82
82
  })
83
83
  }),
84
- !!T && /* @__PURE__ */ A("div", {
84
+ !!T && /* @__PURE__ */ j("div", {
85
85
  role: "status",
86
86
  "aria-live": "polite",
87
- className: M.loadingMore,
88
- children: /* @__PURE__ */ A(x, { label: E.loadingMore })
87
+ className: N.loadingMore,
88
+ children: /* @__PURE__ */ j(x, { label: E.loadingMore })
89
89
  }),
90
- !!F && /* @__PURE__ */ j("div", {
91
- className: M.footer,
92
- children: [/* @__PURE__ */ A(n, {
90
+ !!F && /* @__PURE__ */ M("div", {
91
+ className: N.footer,
92
+ children: [/* @__PURE__ */ j(n, {
93
93
  type: "button",
94
94
  tone: "neutral",
95
95
  appearance: "ghost",
@@ -97,7 +97,7 @@ function P({ loading: t, showStatus: r, showEmpty: o, trimmedSearch: c, minSearc
97
97
  e.preventDefault(), e.stopPropagation(), F.onCancel();
98
98
  },
99
99
  children: F.cancelLabel
100
- }), /* @__PURE__ */ A(n, {
100
+ }), /* @__PURE__ */ j(n, {
101
101
  type: "button",
102
102
  onClick: (e) => {
103
103
  e.preventDefault(), e.stopPropagation(), F.onApply();
@@ -108,14 +108,14 @@ function P({ loading: t, showStatus: r, showEmpty: o, trimmedSearch: c, minSearc
108
108
  ] })
109
109
  })
110
110
  });
111
- return /* @__PURE__ */ A(y, {
111
+ return /* @__PURE__ */ j(y, {
112
112
  container: D,
113
113
  children: z
114
114
  });
115
115
  }
116
116
  //#endregion
117
117
  //#region src/components/features/combobox/combobox.strings.ts
118
- var F = {
118
+ var I = {
119
119
  placeholder: "Search…",
120
120
  clear: "Clear selection",
121
121
  toggle: "Show options",
@@ -130,22 +130,22 @@ var F = {
130
130
  errorTitle: "Could not load results",
131
131
  retry: "Retry",
132
132
  removeChip: (e) => `Remove ${e}`
133
- }, I = {
133
+ }, L = {
134
134
  placeholder: "Search…",
135
135
  emptyMessage: "No results found.",
136
136
  loadingMessage: "Searching…",
137
137
  startTypingMessage: "Type to search.",
138
- formatTypeMore: F.formatTypeMore,
138
+ formatTypeMore: I.formatTypeMore,
139
139
  errorMessage: "Could not load suggestions.",
140
140
  retry: "Retry"
141
141
  };
142
142
  //#endregion
143
143
  //#region src/components/features/combobox/highlighted-text.tsx
144
- function L(e) {
144
+ function R(e) {
145
145
  return e.replace(/[$()*+.?[\\\]^{|}]/g, "\\$&");
146
146
  }
147
- function R({ text: t, highlight: n }) {
148
- if (!n.trim()) return /* @__PURE__ */ A(e, {
147
+ function z({ text: t, highlight: n }) {
148
+ if (!n.trim()) return /* @__PURE__ */ j(e, {
149
149
  tag: "span",
150
150
  size: "inherit",
151
151
  type: "inherit",
@@ -153,8 +153,8 @@ function R({ text: t, highlight: n }) {
153
153
  className: "highlighted-text--component",
154
154
  children: t
155
155
  });
156
- let r = t.split(RegExp(`(${L(n)})`, "gi")), i = r.reduce((e, t, n) => [...e, (e[n] ?? 0) + t.length], [0]);
157
- return /* @__PURE__ */ A(e, {
156
+ let r = t.split(RegExp(`(${R(n)})`, "gi")), i = r.reduce((e, t, n) => [...e, (e[n] ?? 0) + t.length], [0]);
157
+ return /* @__PURE__ */ j(e, {
158
158
  tag: "span",
159
159
  size: "inherit",
160
160
  type: "inherit",
@@ -164,24 +164,24 @@ function R({ text: t, highlight: n }) {
164
164
  let n = t % 2 == 1;
165
165
  if (!n && e === "") return null;
166
166
  let r = `${i[t]}:${n ? "match" : "text"}`;
167
- return A(n ? "mark" : "span", { children: e }, r);
167
+ return j(n ? "mark" : "span", { children: e }, r);
168
168
  })
169
169
  });
170
170
  }
171
171
  //#endregion
172
172
  //#region src/components/features/combobox/use-combobox-core.tsx
173
- var z = 3, B = .8, V = 100, H = 500, U = Symbol("combobox-create-option");
174
- function W(e) {
175
- return typeof e == "object" && !!e && U in e;
176
- }
173
+ var B = 3, V = .8, H = 100, U = 500, W = Symbol("combobox-create-option");
177
174
  function G(e) {
178
- if (!W(e)) throw Error("That item is not a create option.");
179
- return e[U];
175
+ return typeof e == "object" && !!e && W in e;
180
176
  }
181
177
  function K(e) {
182
- return { [U]: e };
178
+ if (!G(e)) throw Error("That item is not a create option.");
179
+ return e[W];
180
+ }
181
+ function q(e) {
182
+ return { [W]: e };
183
183
  }
184
- function q({ searchValue: e, onSearch: t, debounceMs: n = 300, minSearchLength: r = 3 }) {
184
+ function J({ searchValue: e, onSearch: t, debounceMs: n = 300, minSearchLength: r = 3 }) {
185
185
  let i = b((e) => t?.(e), n);
186
186
  w(() => {
187
187
  let t = e.trim();
@@ -192,18 +192,18 @@ function q({ searchValue: e, onSearch: t, debounceMs: n = 300, minSearchLength:
192
192
  e
193
193
  ]);
194
194
  }
195
- function J({ hasMore: e, onLoadMore: t, loadingMore: n }) {
196
- let r = D(!1), i = D(null), a = b(() => {
195
+ function ee({ hasMore: e, onLoadMore: t, loadingMore: n }) {
196
+ let r = O(!1), i = O(null), a = b(() => {
197
197
  r.current = !0, t?.(), i.current && clearTimeout(i.current), i.current = setTimeout(() => {
198
198
  r.current = !1, i.current = null;
199
- }, H);
200
- }, V);
199
+ }, U);
200
+ }, H);
201
201
  return w(() => () => {
202
202
  i.current && clearTimeout(i.current);
203
203
  }, []), { handleScroll: C((i) => {
204
204
  if (!e || !t || n || r.current) return;
205
205
  let { scrollHeight: o, scrollTop: s, clientHeight: c } = i.target;
206
- (s + c) / o >= B && a();
206
+ (s + c) / o >= V && a();
207
207
  }, [
208
208
  e,
209
209
  n,
@@ -213,32 +213,32 @@ function J({ hasMore: e, onLoadMore: t, loadingMore: n }) {
213
213
  }
214
214
  function Y({ items: t, searchValue: n, getItemLabel: r, getItemKey: i, loading: a = !1, showListContent: o = !0, minSearchLength: s = 3, strings: c, renderItem: l, onSearch: u, debounceMs: d = 300, creatable: f, onCreate: p, getItemGroup: m, hasMore: h, onLoadMore: g, loadingMore: _, highlightMatch: v, ensuredItems: y = [] }) {
215
215
  let b = {
216
- ...F,
216
+ ...I,
217
217
  ...c
218
- }, { formatCreate: x } = b, T = i ?? r, O = D(null), k = n.trim(), N = o && (a || k.length < s);
219
- q({
218
+ }, { formatCreate: x } = b, T = i ?? r, E = O(null), k = n.trim(), A = o && (a || k.length < s);
219
+ J({
220
220
  searchValue: n,
221
221
  onSearch: u,
222
222
  debounceMs: d,
223
223
  minSearchLength: s
224
224
  });
225
- let { handleScroll: P } = J({
226
- hasMore: o && !N ? h : !1,
225
+ let { handleScroll: P } = ee({
226
+ hasMore: o && !A ? h : !1,
227
227
  onLoadMore: g,
228
228
  loadingMore: _
229
229
  });
230
230
  w(() => {
231
- let e = O.current;
232
- if (!(!o || N || !e || !h || !g)) return e.addEventListener("scroll", P), () => e.removeEventListener("scroll", P);
231
+ let e = E.current;
232
+ if (!(!o || A || !e || !h || !g)) return e.addEventListener("scroll", P), () => e.removeEventListener("scroll", P);
233
233
  }, [
234
234
  P,
235
235
  h,
236
236
  g,
237
237
  o,
238
- N
238
+ A
239
239
  ]);
240
- let I = E(() => {
241
- if (!o || N) return [];
240
+ let F = D(() => {
241
+ if (!o || A) return [];
242
242
  if (y.length === 0) return t;
243
243
  let e = [...y];
244
244
  for (let n of t) y.some((e) => T(e) === T(n)) || e.push(n);
@@ -248,59 +248,59 @@ function Y({ items: t, searchValue: n, getItemLabel: r, getItemKey: i, loading:
248
248
  T,
249
249
  t,
250
250
  o,
251
- N
252
- ]), L = E(() => {
251
+ A
252
+ ]), L = D(() => {
253
253
  if (!m) return null;
254
254
  let e = /* @__PURE__ */ new Map();
255
- for (let t of I) {
255
+ for (let t of F) {
256
256
  let n = m(t), r = e.get(n);
257
257
  r ? r.push(t) : e.set(n, [t]);
258
258
  }
259
259
  return e;
260
- }, [I, m]), z = E(() => {
261
- if (!o || N || !f || !p || k === "" || k.length < s) return !1;
260
+ }, [F, m]), R = D(() => {
261
+ if (!o || A || !f || !p || k === "" || k.length < s) return !1;
262
262
  let e = k.toLowerCase();
263
- return !I.some((t) => r(t).toLowerCase() === e);
263
+ return !F.some((t) => r(t).toLowerCase() === e);
264
264
  }, [
265
- I,
265
+ F,
266
266
  f,
267
267
  r,
268
268
  s,
269
269
  p,
270
270
  o,
271
- N,
271
+ A,
272
272
  k
273
- ]), B = E(() => z ? K(k) : null, [z, k]);
273
+ ]), B = D(() => R ? q(k) : null, [R, k]);
274
274
  return {
275
275
  strings: b,
276
276
  getKey: T,
277
277
  trimmedSearch: k,
278
- listRef: O,
279
- baseItems: I,
280
- allItems: E(() => B ? [...I, B] : I, [I, B]),
278
+ listRef: E,
279
+ baseItems: F,
280
+ allItems: D(() => B ? [...F, B] : F, [F, B]),
281
281
  groupedItems: L,
282
282
  createOptionItem: B,
283
- showStatus: N,
284
- showEmpty: o && !a && k.length >= s && t.length === 0 && !z,
285
- showCreateOption: z,
283
+ showStatus: A,
284
+ showEmpty: o && !a && k.length >= s && t.length === 0 && !R,
285
+ showCreateOption: R,
286
286
  renderItemContent: C((t) => {
287
- if (W(t)) return /* @__PURE__ */ j("span", {
288
- className: M.createRow,
289
- children: [/* @__PURE__ */ A(S, { "aria-hidden": !0 }), /* @__PURE__ */ A(e, {
287
+ if (G(t)) return /* @__PURE__ */ M("span", {
288
+ className: N.createRow,
289
+ children: [/* @__PURE__ */ j(S, { "aria-hidden": !0 }), /* @__PURE__ */ j(e, {
290
290
  tag: "span",
291
291
  size: "inherit",
292
292
  type: "inherit",
293
293
  weight: "medium",
294
294
  lineHeight: "tight",
295
- children: x(G(t))
295
+ children: x(K(t))
296
296
  })]
297
297
  });
298
298
  if (l) return l(t);
299
299
  let n = r(t);
300
- return v && k ? /* @__PURE__ */ A(R, {
300
+ return v && k ? /* @__PURE__ */ j(z, {
301
301
  text: n,
302
302
  highlight: k
303
- }) : /* @__PURE__ */ A(e, {
303
+ }) : /* @__PURE__ */ j(e, {
304
304
  tag: "span",
305
305
  size: "inherit",
306
306
  type: "inherit",
@@ -314,22 +314,22 @@ function Y({ items: t, searchValue: n, getItemLabel: r, getItemKey: i, loading:
314
314
  l,
315
315
  k
316
316
  ]),
317
- itemToStringLabel: C((e) => W(e) ? G(e) : r(e), [r]),
318
- getItemReactKey: C((e) => W(e) ? `__create__:${G(e)}` : String(T(e)), [T]),
317
+ itemToStringLabel: C((e) => G(e) ? K(e) : r(e), [r]),
318
+ getItemReactKey: C((e) => G(e) ? `__create__:${K(e)}` : String(T(e)), [T]),
319
319
  handleScroll: P
320
320
  };
321
321
  }
322
322
  //#endregion
323
323
  //#region src/components/features/combobox/async-combobox.tsx
324
324
  function X({ error: t, id: n }) {
325
- return t ? /* @__PURE__ */ A(e, {
325
+ return t ? /* @__PURE__ */ j(e, {
326
326
  id: n,
327
327
  tag: "p",
328
328
  size: "xs",
329
329
  type: "error",
330
330
  role: "alert",
331
331
  "aria-live": "polite",
332
- className: M.error,
332
+ className: N.error,
333
333
  children: t
334
334
  }) : null;
335
335
  }
@@ -375,41 +375,41 @@ function Z(e, t) {
375
375
  describedBy: d ? g : void 0
376
376
  };
377
377
  }
378
- function Q({ selectedValue: e, onSelectedValueChange: n, clearSearchOnClose: r = !0, minSearchLength: i = 3, loading: a = !1, showListContent: o = !0, disabled: s = !1, clearable: c = !0, ...l }) {
379
- let { id: u, searchValue: d, onSearchValueChange: f, className: p, error: m, required: h, onBlur: _, onCreate: y, open: b, onOpenChange: x } = l, S = E(() => e ? [e] : [], [e]), { core: w, dropdown: T, root: D, invalid: k, errorId: N, describedBy: F } = Z({
378
+ function te({ selectedValue: e, onSelectedValueChange: n, clearSearchOnClose: r = !0, minSearchLength: i = 3, loading: a = !1, showListContent: o = !0, disabled: s = !1, clearable: c = !0, ...l }) {
379
+ let { id: u, searchValue: d, onSearchValueChange: f, className: p, error: m, required: h, onBlur: _, onCreate: y, open: b, onOpenChange: x } = l, S = D(() => e ? [e] : [], [e]), { core: w, dropdown: T, root: E, invalid: O, errorId: A, describedBy: P } = Z({
380
380
  ...l,
381
381
  minSearchLength: i,
382
382
  loading: a,
383
383
  showListContent: o,
384
384
  disabled: s
385
- }, S), [I, L] = O(!1), R = C((e) => {
385
+ }, S), [I, L] = k(!1), R = C((e) => {
386
386
  L(e), !e && r && f(""), x?.(e);
387
387
  }, [
388
388
  r,
389
389
  x,
390
390
  f
391
391
  ]), z = b ?? I ? d : e ? w.itemToStringLabel(e) : "", B = C((e) => {
392
- if (e && W(e)) {
393
- y?.(G(e));
392
+ if (e && G(e)) {
393
+ y?.(K(e));
394
394
  return;
395
395
  }
396
396
  n(e);
397
397
  }, [y, n]);
398
- return /* @__PURE__ */ j("div", {
399
- className: t("async-combobox--component", M.root),
400
- children: [/* @__PURE__ */ j(v, {
401
- ...D,
398
+ return /* @__PURE__ */ M("div", {
399
+ className: t("async-combobox--component", N.root),
400
+ children: [/* @__PURE__ */ M(v, {
401
+ ...E,
402
402
  value: e,
403
403
  onValueChange: B,
404
404
  inputValue: z,
405
405
  open: b,
406
406
  onOpenChange: R,
407
- children: [/* @__PURE__ */ A(g, {
407
+ children: [/* @__PURE__ */ j(g, {
408
408
  id: u,
409
409
  placeholder: w.strings.placeholder,
410
410
  showClear: c,
411
- invalid: k,
412
- "aria-describedby": F,
411
+ invalid: O,
412
+ "aria-describedby": P,
413
413
  "aria-required": h,
414
414
  disabled: s,
415
415
  onBlur: _,
@@ -418,19 +418,19 @@ function Q({ selectedValue: e, onSelectedValueChange: n, clearSearchOnClose: r =
418
418
  clear: w.strings.clear,
419
419
  toggle: w.strings.toggle
420
420
  }
421
- }), /* @__PURE__ */ A(P, { ...T })]
422
- }), /* @__PURE__ */ A(X, {
421
+ }), /* @__PURE__ */ j(F, { ...T })]
422
+ }), /* @__PURE__ */ j(X, {
423
423
  error: m,
424
- id: N
424
+ id: A
425
425
  })]
426
426
  });
427
427
  }
428
- function ee({ selectedValues: e, onSelectedValuesChange: n, minSearchLength: r = 3, loading: i = !1, showListContent: a = !0, disabled: s = !1, closeOnSelect: l = !1, applyButton: u = !1, onApply: d, onCancel: f, open: m, onOpenChange: g, ..._ }) {
429
- let { id: y, searchValue: b, className: x, error: S, required: w, onBlur: T, onCreate: E } = _, k = D(null), [N, F] = O(e), [I, L] = O(!1), R = m !== void 0, z = R ? m : I, [B, V] = O(e);
430
- u && e !== B && (V(e), F(e));
431
- let [H, U] = O(z);
432
- H !== z && (U(z), !z && u && F(e));
433
- let K = u ? N : e, { core: q, dropdown: J, root: Y, invalid: Q, errorId: ee, describedBy: te } = Z({
428
+ function ne({ selectedValues: e, onSelectedValuesChange: n, minSearchLength: r = 3, loading: i = !1, showListContent: a = !0, disabled: s = !1, closeOnSelect: l = !1, applyButton: u = !1, onApply: d, onCancel: f, open: m, onOpenChange: g, ..._ }) {
429
+ let { id: y, searchValue: b, className: x, error: S, required: w, onBlur: T, onCreate: E } = _, D = O(null), [A, P] = k(e), [I, L] = k(!1), R = m !== void 0, z = R ? m : I, [B, V] = k(e);
430
+ u && e !== B && (V(e), P(e));
431
+ let [H, U] = k(z);
432
+ H !== z && (U(z), !z && u && P(e));
433
+ let W = u ? A : e, { core: q, dropdown: J, root: ee, invalid: Y, errorId: te, describedBy: ne } = Z({
434
434
  ..._,
435
435
  open: m,
436
436
  onOpenChange: g,
@@ -438,83 +438,83 @@ function ee({ selectedValues: e, onSelectedValuesChange: n, minSearchLength: r =
438
438
  loading: i,
439
439
  showListContent: a,
440
440
  disabled: s
441
- }, K), ne = q.strings.removeChip ?? o.removeChip, $ = C((e) => {
441
+ }, W), re = q.strings.removeChip ?? o.removeChip, Q = C((e) => {
442
442
  R || L(e), g?.(e);
443
- }, [R, g]), re = C((e) => {
443
+ }, [R, g]), ie = C((e) => {
444
444
  let t = [], r = null;
445
- for (let n of e) W(n) ? r = G(n) : t.push(n);
446
- r === null ? u ? F(t) : n(t) : E?.(r), l && !u && $(!1);
445
+ for (let n of e) G(n) ? r = K(n) : t.push(n);
446
+ r === null ? u ? P(t) : n(t) : E?.(r), l && !u && Q(!1);
447
447
  }, [
448
448
  u,
449
449
  l,
450
450
  E,
451
451
  n,
452
- $
453
- ]), ie = C(() => {
454
- u && n(N), d?.(), $(!1);
452
+ Q
453
+ ]), ae = C(() => {
454
+ u && n(A), d?.(), Q(!1);
455
455
  }, [
456
456
  u,
457
- N,
457
+ A,
458
458
  d,
459
459
  n,
460
- $
461
- ]), ae = C(() => {
462
- u && F(e), f?.(), $(!1);
460
+ Q
461
+ ]), oe = C(() => {
462
+ u && P(e), f?.(), Q(!1);
463
463
  }, [
464
464
  u,
465
465
  f,
466
466
  e,
467
- $
467
+ Q
468
468
  ]);
469
- return /* @__PURE__ */ j("div", {
470
- className: t("async-multi-combobox--component", M.root),
471
- children: [/* @__PURE__ */ j(v, {
472
- ...Y,
469
+ return /* @__PURE__ */ M("div", {
470
+ className: t("async-multi-combobox--component", N.root),
471
+ children: [/* @__PURE__ */ M(v, {
472
+ ...ee,
473
473
  multiple: !0,
474
- value: K,
475
- onValueChange: re,
474
+ value: W,
475
+ onValueChange: ie,
476
476
  inputValue: b,
477
477
  open: z,
478
478
  onOpenChange: (t) => {
479
- !t && u && F(e), $(t);
479
+ !t && u && P(e), Q(t);
480
480
  },
481
- children: [/* @__PURE__ */ j(c, {
482
- ref: k,
483
- invalid: Q,
481
+ children: [/* @__PURE__ */ M(c, {
482
+ ref: D,
483
+ invalid: Y,
484
484
  className: x,
485
- children: [K.map((e) => /* @__PURE__ */ A(p, {
486
- strings: { removeChip: ne },
485
+ children: [W.map((e) => /* @__PURE__ */ j(p, {
486
+ strings: { removeChip: re },
487
487
  children: q.itemToStringLabel(e)
488
- }, q.getKey(e))), /* @__PURE__ */ A(h, {
488
+ }, q.getKey(e))), /* @__PURE__ */ j(h, {
489
489
  id: y,
490
- placeholder: K.length > 0 ? void 0 : q.strings.placeholder,
491
- "aria-invalid": Q || void 0,
492
- "aria-describedby": te,
490
+ placeholder: W.length > 0 ? void 0 : q.strings.placeholder,
491
+ "aria-invalid": Y || void 0,
492
+ "aria-describedby": ne,
493
493
  "aria-required": w,
494
494
  onBlur: T
495
495
  })]
496
- }), /* @__PURE__ */ A(P, {
496
+ }), /* @__PURE__ */ j(F, {
497
497
  ...J,
498
- anchor: k,
498
+ anchor: D,
499
499
  applyFooter: a && u ? {
500
500
  applyLabel: q.strings.apply,
501
501
  cancelLabel: q.strings.cancel,
502
- onApply: ie,
503
- onCancel: ae
502
+ onApply: ae,
503
+ onCancel: oe
504
504
  } : void 0
505
505
  })]
506
- }), /* @__PURE__ */ A(X, {
506
+ }), /* @__PURE__ */ j(X, {
507
507
  error: S,
508
- id: ee
508
+ id: te
509
509
  })]
510
510
  });
511
511
  }
512
512
  //#endregion
513
513
  //#region src/components/features/combobox/use-suggestions.ts
514
- function te(e) {
514
+ function re(e) {
515
515
  return !!(e && e.name === "AbortError");
516
516
  }
517
- function ne(e, t) {
517
+ function Q(e, t) {
518
518
  return new Promise((n, r) => {
519
519
  if (t.aborted) {
520
520
  r(new DOMException("Aborted", "AbortError"));
@@ -526,77 +526,88 @@ function ne(e, t) {
526
526
  });
527
527
  });
528
528
  }
529
- var $ = [];
530
- function re(e) {
531
- let { fetchData: t, minQueryLength: n = 1, debounceMs: r = 300, requestDelay: i = 0, preload: a = !1, query: o, defaultQuery: s = "", onQueryChange: c, value: l, defaultValue: u = null, onValueChange: d, open: f, defaultOpen: p = !1, onOpenChange: m, onError: h } = e, [g, _] = O(null), [v, y] = O(null), [x, S] = O(!1), [T, E] = O(s), [k, A] = O(u), [j, M] = O(p), [N, P] = O(0), F = D(!1), I = D(t), L = D(h);
529
+ var ie = [];
530
+ function ae(e) {
531
+ let { fetchData: t, scopeKey: n, minQueryLength: r = 1, debounceMs: i = 300, requestDelay: a = 0, preload: o = !1, query: s, defaultQuery: c = "", onQueryChange: l, value: u, defaultValue: d = null, onValueChange: f, open: p, defaultOpen: m = !1, onOpenChange: h, onError: g } = e, [_, v] = k({ key: n });
532
+ Object.is(_.key, n) || v({ key: n });
533
+ let [y, x] = k(null), [S, T] = k(null), [D, A] = k(null), j = O(_), M = O(null);
534
+ E(() => () => {
535
+ M.current?.abort();
536
+ }, [_]);
537
+ let [N, P] = k(c), [F, I] = k(d), [L, R] = k(m), [z, B] = k(0), V = O(!1), H = O(t), U = O(g);
532
538
  w(() => {
533
- I.current = t, L.current = h;
539
+ H.current = t, U.current = g;
534
540
  });
535
- let R = o ?? T, z = l === void 0 ? k : l, B = f ?? j, V = C((e) => {
536
- o === void 0 && E(e), c?.(e);
537
- }, [o, c]), H = C((e) => {
538
- l === void 0 && A(e), d?.(e);
539
- }, [l, d]), U = C((e) => {
540
- f === void 0 && M(e), m?.(e);
541
- }, [f, m]), W = C(() => {
542
- F.current = !0, P((e) => e + 1);
543
- }, []), G = R.trim().length, K = G >= n || a && G === 0, q = g?.query === R || v?.query === R, J = K && g ? g.items : $, Y = K && (x || !q), X = K && v?.query === R ? v.error : null, Z = b((e, t, n) => {
541
+ let W = s ?? N, G = u === void 0 ? F : u, K = p ?? L, q = C((e) => {
542
+ s === void 0 && P(e), l?.(e);
543
+ }, [s, l]), J = C((e) => {
544
+ u === void 0 && I(e), f?.(e);
545
+ }, [u, f]), ee = C((e) => {
546
+ p === void 0 && R(e), h?.(e);
547
+ }, [p, h]), Y = C(() => {
548
+ V.current = !0, B((e) => e + 1);
549
+ }, []), X = W.trim().length, Z = X >= r || o && X === 0, te = y?.scope === _ && y.query === W || S?.scope === _ && S.query === W, ne = Z && y?.scope === _ ? y.items : ie, ae = Z && (D === _ || !te), oe = Z && S?.scope === _ && S.query === W ? S.error : null, $ = b((e, t, n, r) => {
544
550
  (async () => {
545
- S(!0), y(null);
551
+ A(r), T(null);
546
552
  try {
547
- if (t > 0 && await ne(t, n), n.aborted) return;
548
- let r = await I.current(e, { signal: n });
549
- n.aborted || _({
553
+ if (t > 0 && await Q(t, n), n.aborted) return;
554
+ let i = await H.current(e, { signal: n });
555
+ n.aborted || x({
556
+ scope: r,
550
557
  query: e,
551
- items: Array.isArray(r) ? r : []
558
+ items: Array.isArray(i) ? i : []
552
559
  });
553
560
  } catch (t) {
554
- if (n.aborted || te(t)) return;
555
- _({
561
+ if (n.aborted || re(t)) return;
562
+ x({
563
+ scope: r,
556
564
  query: e,
557
565
  items: []
558
- }), y({
566
+ }), T({
567
+ scope: r,
559
568
  query: e,
560
569
  error: t
561
- }), L.current?.(t, e);
570
+ }), U.current?.(t, e);
562
571
  } finally {
563
- n.aborted || S(!1);
572
+ n.aborted || A(null);
564
573
  }
565
574
  })();
566
- }, r);
575
+ }, i);
567
576
  return w(() => {
568
- if (!K) return;
569
- let e = new AbortController();
570
- return Z(R, i, e.signal), (F.current || R.trim() === "") && Z.flush(), F.current = !1, () => {
571
- Z.cancel(), e.abort();
577
+ let e = j.current !== _;
578
+ if (j.current = _, !Z) return;
579
+ let t = new AbortController();
580
+ return M.current = t, $(W, a, t.signal, _), (e || V.current || W.trim() === "") && $.flush(), V.current = !1, () => {
581
+ $.cancel(), t.abort();
572
582
  };
573
583
  }, [
574
- R,
575
- i,
576
- N,
584
+ W,
585
+ a,
586
+ z,
587
+ $,
577
588
  Z,
578
- K
589
+ _
579
590
  ]), {
580
- items: J,
581
- isLoading: Y,
582
- error: X,
583
- isError: X !== null,
584
- retry: W,
585
- query: R,
586
- setQuery: V,
587
- value: z,
588
- setValue: H,
589
- open: B,
590
- setOpen: U
591
+ items: ne,
592
+ isLoading: ae,
593
+ error: oe,
594
+ isError: oe !== null,
595
+ retry: Y,
596
+ query: W,
597
+ setQuery: q,
598
+ value: G,
599
+ setValue: J,
600
+ open: K,
601
+ setOpen: ee
591
602
  };
592
603
  }
593
604
  //#endregion
594
605
  //#region src/components/features/combobox/fetching-combobox.tsx
595
- function ie(e) {
606
+ function oe(e) {
596
607
  return typeof e == "string" || typeof e == "number";
597
608
  }
598
- function ae({ children: t }) {
599
- return ie(t) ? /* @__PURE__ */ A(e, {
609
+ function $({ children: t }) {
610
+ return oe(t) ? /* @__PURE__ */ j(e, {
600
611
  tag: "span",
601
612
  size: "xs",
602
613
  type: "secondary",
@@ -604,110 +615,111 @@ function ae({ children: t }) {
604
615
  children: t
605
616
  }) : t;
606
617
  }
607
- function oe({ hook: n, slot: i, fetchData: a, onError: o, preload: s, requestDelay: c, minSearchLength: l = 0, debounceMs: u, searchValue: d, defaultSearchValue: f, onSearchValueChange: p, value: m, defaultValue: h, onValueChange: g, open: _, defaultOpen: v, onOpenChange: y, clearSearchOnClose: b = !1, getItemLabel: x, getItemKey: S, getDescription: w, getMeta: T, renderOption: E, highlightMatch: D, errorTitle: O, renderError: k, strings: N, disabled: P = !1, className: I, ...L }) {
608
- let z = {
609
- ...F,
610
- ...N
611
- }, B = S ?? x, V = re({
618
+ function se({ hook: n, slot: i, fetchData: a, onError: o, preload: s, scopeKey: c, requestDelay: l, minSearchLength: u = 0, debounceMs: d, searchValue: f, defaultSearchValue: p, onSearchValueChange: m, value: h, defaultValue: g, onValueChange: _, open: v, defaultOpen: y, onOpenChange: b, clearSearchOnClose: x = !1, getItemLabel: S, getItemKey: w, getDescription: T, getMeta: E, renderOption: D, highlightMatch: O, errorTitle: k, renderError: A, strings: P, disabled: F = !1, className: L, ...R }) {
619
+ let B = {
620
+ ...I,
621
+ ...P
622
+ }, V = w ?? S, H = ae({
623
+ scopeKey: c,
612
624
  fetchData: (e, t) => a(e.trim(), t ?? {}),
613
625
  onError: (e, t) => o?.(e, t.trim()),
614
- minQueryLength: P ? Infinity : Math.max(1, l),
615
- preload: s && !P,
616
- debounceMs: u,
617
- requestDelay: c,
618
- query: d,
619
- defaultQuery: f,
620
- onQueryChange: p,
621
- value: m,
622
- defaultValue: h,
623
- onValueChange: g,
624
- open: _,
625
- defaultOpen: v,
626
- onOpenChange: y
627
- }), H = V.query.trim(), U = V.isError, { setOpen: W, setQuery: G, retry: K } = V, q = H === "" ? s && !P ? 0 : Math.max(1, l) : l, J = C((e) => {
628
- W(e), !e && b && !U && G("");
626
+ minQueryLength: F ? Infinity : Math.max(1, u),
627
+ preload: s && !F,
628
+ debounceMs: d,
629
+ requestDelay: l,
630
+ query: f,
631
+ defaultQuery: p,
632
+ onQueryChange: m,
633
+ value: h,
634
+ defaultValue: g,
635
+ onValueChange: _,
636
+ open: v,
637
+ defaultOpen: y,
638
+ onOpenChange: b
639
+ }), U = H.query.trim(), W = H.isError, { setOpen: G, setQuery: K, retry: q } = H, J = U === "" ? s && !F ? 0 : Math.max(1, u) : u, ee = C((e) => {
640
+ G(e), !e && x && !W && K("");
629
641
  }, [
630
- b,
631
- U,
642
+ x,
632
643
  W,
633
- G
634
- ]), Y = V.value ? B(V.value) : null, X = C((t) => {
635
- if (E) return E(t, {
636
- query: H,
637
- isSelected: Y !== null && B(t) === Y
644
+ G,
645
+ K
646
+ ]), Y = H.value ? V(H.value) : null, X = C((t) => {
647
+ if (D) return D(t, {
648
+ query: U,
649
+ isSelected: Y !== null && V(t) === Y
638
650
  });
639
- let n = x(t), r = w?.(t), i = T?.(t), a = !!r || !!i;
640
- return /* @__PURE__ */ j("span", {
641
- className: M.option,
642
- children: [/* @__PURE__ */ A(e, {
651
+ let n = S(t), r = T?.(t), i = E?.(t), a = !!r || !!i;
652
+ return /* @__PURE__ */ M("span", {
653
+ className: N.option,
654
+ children: [/* @__PURE__ */ j(e, {
643
655
  tag: "span",
644
656
  size: "inherit",
645
657
  type: "inherit",
646
658
  weight: a ? "medium" : void 0,
647
659
  lineHeight: "tight",
648
660
  truncate: !0,
649
- children: D && H ? /* @__PURE__ */ A(R, {
661
+ children: O && U ? /* @__PURE__ */ j(z, {
650
662
  text: n,
651
- highlight: H
663
+ highlight: U
652
664
  }) : n
653
- }), a && /* @__PURE__ */ j("span", {
654
- className: M.optionMeta,
655
- children: [!!r && /* @__PURE__ */ A(ae, { children: r }), !!i && /* @__PURE__ */ A(ae, { children: i })]
665
+ }), a && /* @__PURE__ */ M("span", {
666
+ className: N.optionMeta,
667
+ children: [!!r && /* @__PURE__ */ j($, { children: r }), !!i && /* @__PURE__ */ j($, { children: i })]
656
668
  })]
657
669
  });
658
670
  }, [
659
- w,
660
- x,
661
- B,
662
671
  T,
663
- D,
664
- H,
672
+ S,
673
+ V,
665
674
  E,
675
+ O,
676
+ U,
677
+ D,
666
678
  Y
667
- ]), Z = U ? k?.({
668
- error: V.error,
669
- query: H,
670
- retry: K
671
- }) ?? /* @__PURE__ */ A(r, {
672
- title: O ?? z.errorTitle,
673
- onRetry: K,
674
- strings: { retry: z.retry },
675
- className: M.errorState
679
+ ]), Z = W ? A?.({
680
+ error: H.error,
681
+ query: U,
682
+ retry: q
683
+ }) ?? /* @__PURE__ */ j(r, {
684
+ title: k ?? B.errorTitle,
685
+ onRetry: q,
686
+ strings: { retry: B.retry },
687
+ className: N.errorState
676
688
  }) : null;
677
- return /* @__PURE__ */ j("div", {
689
+ return /* @__PURE__ */ M("div", {
678
690
  "data-slot": i,
679
- className: t(n, I),
680
- children: [/* @__PURE__ */ A(Q, {
681
- ...L,
682
- disabled: P,
683
- items: V.items,
684
- selectedValue: V.value,
685
- onSelectedValueChange: V.setValue,
691
+ className: t(n, L),
692
+ children: [/* @__PURE__ */ j(te, {
693
+ ...R,
694
+ disabled: F,
695
+ items: H.items,
696
+ selectedValue: H.value,
697
+ onSelectedValueChange: H.setValue,
686
698
  clearSearchOnClose: !1,
687
- searchValue: V.query,
688
- onSearchValueChange: G,
689
- getItemLabel: x,
690
- getItemKey: S,
691
- loading: !U && V.isLoading,
692
- showListContent: !U,
693
- minSearchLength: q,
694
- debounceMs: u,
695
- strings: N,
699
+ searchValue: H.query,
700
+ onSearchValueChange: K,
701
+ getItemLabel: S,
702
+ getItemKey: w,
703
+ loading: !W && H.isLoading,
704
+ showListContent: !W,
705
+ minSearchLength: J,
706
+ debounceMs: d,
707
+ strings: P,
696
708
  renderItem: X,
697
- open: V.open,
698
- onOpenChange: J
709
+ open: H.open,
710
+ onOpenChange: ee
699
711
  }), Z]
700
712
  });
701
713
  }
702
714
  //#endregion
703
715
  //#region src/components/features/combobox/resource-combobox.tsx
704
- function se({ fetcher: e, onAfterFetch: t, onError: n, getKey: r, getLabel: i, limit: a = 10, debounceMs: o = 300, preload: s = !0, minSearchLength: c = 0, defaultValue: l = null, errorMessage: u, ...d }) {
716
+ function ce({ fetcher: e, onAfterFetch: t, onError: n, getKey: r, getLabel: i, limit: a = 10, debounceMs: o = 300, preload: s = !0, minSearchLength: c = 0, defaultValue: l = null, errorMessage: u, ...d }) {
705
717
  let f = (e, t) => ({
706
718
  query: e,
707
719
  limit: a,
708
720
  signal: t
709
721
  });
710
- return /* @__PURE__ */ A(oe, {
722
+ return /* @__PURE__ */ j(se, {
711
723
  ...d,
712
724
  hook: "resource-combobox--component",
713
725
  slot: "resource-combobox",
@@ -727,12 +739,12 @@ function se({ fetcher: e, onAfterFetch: t, onError: n, getKey: r, getLabel: i, l
727
739
  }
728
740
  //#endregion
729
741
  //#region src/components/features/combobox/suggestions-combobox.tsx
730
- function ce({ fetchData: e, itemKey: t, itemText: n, renderItem: r, minQueryLength: i = 1, preload: a = !1, query: o, defaultQuery: s, onQueryChange: c, allowClear: l = !0, clearInputOnClose: u = !1, disabled: d = !1, strings: f, ...p }) {
742
+ function le({ fetchData: e, itemKey: t, itemText: n, renderItem: r, minQueryLength: i = 1, preload: a = !1, query: o, defaultQuery: s, onQueryChange: c, allowClear: l = !0, clearInputOnClose: u = !1, disabled: d = !1, strings: f, ...p }) {
731
743
  let m = {
732
- ...I,
744
+ ...L,
733
745
  ...f
734
- }, h = f?.formatTypeMore ?? (f?.startTypingMessage === void 0 ? F.formatTypeMore : () => m.startTypingMessage);
735
- return /* @__PURE__ */ A(oe, {
746
+ }, h = f?.formatTypeMore ?? (f?.startTypingMessage === void 0 ? I.formatTypeMore : () => m.startTypingMessage);
747
+ return /* @__PURE__ */ j(se, {
736
748
  ...p,
737
749
  hook: "suggestions-combobox--component",
738
750
  slot: "suggestions",
@@ -760,4 +772,4 @@ function ce({ fetchData: e, itemKey: t, itemText: n, renderItem: r, minQueryLeng
760
772
  });
761
773
  }
762
774
  //#endregion
763
- export { Q as AsyncCombobox, ee as AsyncMultiCombobox, P as ComboboxDropdown, z as DEFAULT_MIN_SEARCH_LENGTH, R as HighlightedText, se as ResourceCombobox, ce as SuggestionsCombobox, F as defaultAsyncComboboxStrings, I as defaultSuggestionsStrings, Y as useComboboxCore, re as useSuggestions };
775
+ export { te as AsyncCombobox, ne as AsyncMultiCombobox, F as ComboboxDropdown, B as DEFAULT_MIN_SEARCH_LENGTH, z as HighlightedText, ce as ResourceCombobox, le as SuggestionsCombobox, I as defaultAsyncComboboxStrings, L as defaultSuggestionsStrings, Y as useComboboxCore, ae as useSuggestions };