@alfadocs/ui-kit-debug 1.25.0 → 1.25.1-calendar.7
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.
- package/dist/_chunks/{address-fields-CZ0pEdEI.js → address-fields-jFfjxOQR.js} +3 -3
- package/dist/_chunks/{address-fields-CZ0pEdEI.js.map → address-fields-jFfjxOQR.js.map} +1 -1
- package/dist/_chunks/{appointment-card-Dzr3GeVz.js → appointment-card-CvUFFEdS.js} +8 -6
- package/dist/_chunks/appointment-card-CvUFFEdS.js.map +1 -0
- package/dist/_chunks/{appointment-timeline-DhHwmHo1.js → appointment-timeline-DsMZY7U9.js} +2 -2
- package/dist/_chunks/{appointment-timeline-DhHwmHo1.js.map → appointment-timeline-DsMZY7U9.js.map} +1 -1
- package/dist/_chunks/{appointment-tray-4FUu_5NX.js → appointment-tray-Z2GaOIYQ.js} +2 -2
- package/dist/_chunks/{appointment-tray-4FUu_5NX.js.map → appointment-tray-Z2GaOIYQ.js.map} +1 -1
- package/dist/_chunks/{booking-WXKbA69C.js → booking-B8C7jMrn.js} +2 -2
- package/dist/_chunks/{booking-WXKbA69C.js.map → booking-B8C7jMrn.js.map} +1 -1
- package/dist/_chunks/{calendar-CI9MINcR.js → calendar-CBqU-UIR.js} +4 -2
- package/dist/_chunks/calendar-CBqU-UIR.js.map +1 -0
- package/dist/_chunks/calendar-workspace-CDhW8tPy.js +7881 -0
- package/dist/_chunks/calendar-workspace-CDhW8tPy.js.map +1 -0
- package/dist/_chunks/{color-picker-CU303VjY.js → color-picker-Bl5f0iK1.js} +28 -25
- package/dist/_chunks/color-picker-Bl5f0iK1.js.map +1 -0
- package/dist/_chunks/{combobox-D7_NLE2Z.js → combobox-DnSdYssy.js} +216 -215
- package/dist/_chunks/combobox-DnSdYssy.js.map +1 -0
- package/dist/_chunks/{country-select-DzbPFktV.js → country-select-CfDNFG5c.js} +2 -2
- package/dist/_chunks/{country-select-DzbPFktV.js.map → country-select-CfDNFG5c.js.map} +1 -1
- package/dist/_chunks/{face-scheme-DA2vjqaM.js → face-scheme-l-CQyLs-.js} +2 -2
- package/dist/_chunks/{face-scheme-DA2vjqaM.js.map → face-scheme-l-CQyLs-.js.map} +1 -1
- package/dist/_chunks/{notes-panel-CTNpsByN.js → notes-panel-D4S2VwDx.js} +2 -2
- package/dist/_chunks/{notes-panel-CTNpsByN.js.map → notes-panel-D4S2VwDx.js.map} +1 -1
- package/dist/_chunks/{patient-details-DYAmq76G.js → patient-details-CdfursHt.js} +3 -3
- package/dist/_chunks/{patient-details-DYAmq76G.js.map → patient-details-CdfursHt.js.map} +1 -1
- package/dist/_chunks/{province-select-BBc7s7vR.js → province-select-BaUnkg4S.js} +2 -2
- package/dist/_chunks/{province-select-BBc7s7vR.js.map → province-select-BaUnkg4S.js.map} +1 -1
- package/dist/_chunks/{rich-text-editor-lSCiE0Zz.js → rich-text-editor-VJATL1Tk.js} +2 -2
- package/dist/_chunks/{rich-text-editor-lSCiE0Zz.js.map → rich-text-editor-VJATL1Tk.js.map} +1 -1
- package/dist/agent-catalog.json +6 -3
- package/dist/agent-i18n/en.json +2 -2
- package/dist/components/address-fields/index.js +1 -1
- package/dist/components/appointment-card/appointment-card.d.ts.map +1 -1
- package/dist/components/appointment-card/index.js +2 -2
- package/dist/components/appointment-timeline/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/calendar/calendar.d.ts.map +1 -1
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/color-picker/color-utils.d.ts.map +1 -1
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/combobox/combobox.d.ts +5 -0
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/country-select/index.js +1 -1
- package/dist/components/face-scheme/index.js +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/province-select/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/index.js +15 -15
- package/dist/patterns/calendar/calendar-editor-hydration.d.ts +36 -0
- package/dist/patterns/calendar/calendar-editor-hydration.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar-patient-picker.d.ts +11 -0
- package/dist/patterns/calendar/calendar-patient-picker.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar-workspace.d.ts +21 -1
- package/dist/patterns/calendar/calendar-workspace.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar-workspace.model.d.ts +1 -3
- package/dist/patterns/calendar/calendar-workspace.model.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.data.d.ts +17 -0
- package/dist/patterns/calendar/calendar.data.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.journey.d.ts +3 -1
- package/dist/patterns/calendar/calendar.journey.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.model.d.ts +9 -0
- package/dist/patterns/calendar/calendar.model.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.sheets.d.ts +12 -4
- package/dist/patterns/calendar/calendar.sheets.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.surface.d.ts +3 -1
- package/dist/patterns/calendar/calendar.surface.d.ts.map +1 -1
- package/dist/patterns/calendar/index.d.ts +3 -2
- package/dist/patterns/calendar/index.d.ts.map +1 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/package.json +3 -2
- package/dist/_chunks/appointment-card-Dzr3GeVz.js.map +0 -1
- package/dist/_chunks/calendar-CI9MINcR.js.map +0 -1
- package/dist/_chunks/calendar-workspace-Dy4ZKtW0.js +0 -7506
- package/dist/_chunks/calendar-workspace-Dy4ZKtW0.js.map +0 -1
- package/dist/_chunks/color-picker-CU303VjY.js.map +0 -1
- package/dist/_chunks/combobox-D7_NLE2Z.js.map +0 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import * as
|
|
4
|
-
import { R as
|
|
5
|
-
import { c as
|
|
6
|
-
import { useTranslation as
|
|
7
|
-
import { u as
|
|
8
|
-
import { c as
|
|
9
|
-
import { n as
|
|
10
|
-
import { g as
|
|
11
|
-
import { u as
|
|
12
|
-
import { u as
|
|
13
|
-
import { I as
|
|
14
|
-
import { u as
|
|
15
|
-
import { X as
|
|
16
|
-
import { C as
|
|
17
|
-
const
|
|
1
|
+
import { jsx as t, jsxs as R } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Ke, useContext as Oe, useMemo as U, useState as re, useRef as g, useEffect as F, useCallback as Te } from "react";
|
|
3
|
+
import * as E from "@radix-ui/react-popover";
|
|
4
|
+
import { R as $e, _ as u, P as Be } from "./index-4xgbg-sn.js";
|
|
5
|
+
import { c as V } from "./index-D2ZczOXr.js";
|
|
6
|
+
import { useTranslation as Ue } from "react-i18next";
|
|
7
|
+
import { u as He, F as Ge } from "./form-field-context-B3APVHKx.js";
|
|
8
|
+
import { c as Me } from "./compose-refs-C0k0tdqF.js";
|
|
9
|
+
import { n as H } from "./normalize-diacritics-BNGbFNlJ.js";
|
|
10
|
+
import { g as Le } from "./group-options-BvKhQ3xb.js";
|
|
11
|
+
import { u as Xe } from "./use-controllable-state-BiY4xTzM.js";
|
|
12
|
+
import { u as We } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
|
|
13
|
+
import { I as Je, a as G, d as M, c as Ye } from "./input-surface-xyERuLU_.js";
|
|
14
|
+
import { u as Ze } from "./registry-DvAUVLHh.js";
|
|
15
|
+
import { X as Qe } from "./x-B5YnXwCz.js";
|
|
16
|
+
import { C as et } from "./check-DrFSN__t.js";
|
|
17
|
+
const tt = {
|
|
18
18
|
id: "combobox",
|
|
19
19
|
// Persisted single choice (value state + set_value) → select_single + set_value,
|
|
20
20
|
// plus type-to-filter and open/close of the option list.
|
|
@@ -58,8 +58,8 @@ const et = {
|
|
|
58
58
|
descriptionKey: "ui.agent.combobox.actions.setValue",
|
|
59
59
|
description: "Set the selected value programmatically.",
|
|
60
60
|
examples: [{ args: { value: "it" }, note: 'Select the "it" option.' }],
|
|
61
|
-
invoke: (s,
|
|
62
|
-
s.setValue(
|
|
61
|
+
invoke: (s, n) => {
|
|
62
|
+
s.setValue(n.value);
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
apply_filter: {
|
|
@@ -76,8 +76,8 @@ const et = {
|
|
|
76
76
|
idempotent: !0,
|
|
77
77
|
descriptionKey: "ui.agent.combobox.actions.applyFilter",
|
|
78
78
|
description: "Set the filter query for the option list.",
|
|
79
|
-
invoke: (s,
|
|
80
|
-
s.setQuery(
|
|
79
|
+
invoke: (s, n) => {
|
|
80
|
+
s.setQuery(n.query);
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
83
|
clear_selection: {
|
|
@@ -121,7 +121,7 @@ const et = {
|
|
|
121
121
|
description: "Each option emits its value as data-option-id."
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
},
|
|
124
|
+
}, st = V(
|
|
125
125
|
[
|
|
126
126
|
"ds:peer ds:w-full ds:bg-transparent ds:text-foreground ds:placeholder:text-muted-foreground",
|
|
127
127
|
"ds:outline-none ds:border-0",
|
|
@@ -139,26 +139,26 @@ const et = {
|
|
|
139
139
|
size: "md"
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
),
|
|
142
|
+
), ot = V(
|
|
143
143
|
[
|
|
144
144
|
"ds:group ds:relative ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)] ds:w-full",
|
|
145
|
-
|
|
145
|
+
Ye
|
|
146
146
|
].join(" "),
|
|
147
147
|
{
|
|
148
148
|
variants: {
|
|
149
149
|
size: {
|
|
150
|
-
sm: `${
|
|
151
|
-
md: `${
|
|
152
|
-
lg: `${
|
|
150
|
+
sm: `${G.sm} ${M.sm}`,
|
|
151
|
+
md: `${G.md} ${M.md}`,
|
|
152
|
+
lg: `${G.lg} ${M.lg}`
|
|
153
153
|
},
|
|
154
|
-
tone:
|
|
154
|
+
tone: Je
|
|
155
155
|
},
|
|
156
156
|
defaultVariants: {
|
|
157
157
|
size: "md",
|
|
158
158
|
tone: "default"
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
|
-
),
|
|
161
|
+
), rt = V(
|
|
162
162
|
[
|
|
163
163
|
"ds:z-[var(--z-popover)] ds:overflow-hidden ds:w-[var(--radix-popover-trigger-width)]",
|
|
164
164
|
"ds:rounded-[var(--radius-md)] ds:border ds:border-border ds:bg-background ds:text-foreground",
|
|
@@ -170,7 +170,7 @@ const et = {
|
|
|
170
170
|
"ds:data-[side=top]:slide-in-from-bottom-2",
|
|
171
171
|
"ds:motion-reduce:animate-none"
|
|
172
172
|
].join(" ")
|
|
173
|
-
),
|
|
173
|
+
), ie = V(
|
|
174
174
|
[
|
|
175
175
|
"ds:relative ds:flex ds:cursor-pointer ds:items-center ds:gap-[var(--spacing-sm)]",
|
|
176
176
|
"ds:rounded-[var(--radius-sm)]",
|
|
@@ -192,211 +192,212 @@ const et = {
|
|
|
192
192
|
size: "md"
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
-
),
|
|
195
|
+
), it = [
|
|
196
196
|
"ds:ps-3 ds:pe-3 ds:py-1.5",
|
|
197
197
|
"type-eyebrow ds:text-muted-foreground"
|
|
198
|
-
].join(" "),
|
|
198
|
+
].join(" "), at = "ds:max-h-[18rem] ds:overflow-y-auto ds:p-[var(--spacing-xs)]", nt = "ds:ps-3 ds:pe-3 ds:py-2 type-body-sm ds:text-muted-foreground", dt = {
|
|
199
199
|
sm: "ds:size-3.5",
|
|
200
200
|
md: "ds:size-4",
|
|
201
201
|
lg: "ds:size-5"
|
|
202
202
|
};
|
|
203
|
-
function
|
|
203
|
+
function lt({
|
|
204
204
|
search: s,
|
|
205
|
-
label:
|
|
206
|
-
iconClass:
|
|
207
|
-
size:
|
|
208
|
-
onSelect:
|
|
205
|
+
label: n,
|
|
206
|
+
iconClass: C,
|
|
207
|
+
size: j,
|
|
208
|
+
onSelect: A
|
|
209
209
|
}) {
|
|
210
|
-
return
|
|
211
|
-
|
|
210
|
+
return Be((q) => q.filtered.count) > 0 ? null : /* @__PURE__ */ R(
|
|
211
|
+
u.Item,
|
|
212
212
|
{
|
|
213
213
|
value: `__combobox-create__${s}`,
|
|
214
214
|
keywords: [],
|
|
215
215
|
forceMount: !0,
|
|
216
|
-
onSelect: () =>
|
|
217
|
-
className:
|
|
216
|
+
onSelect: () => A(s),
|
|
217
|
+
className: ie({ size: j }),
|
|
218
218
|
children: [
|
|
219
219
|
/* @__PURE__ */ t(
|
|
220
220
|
"span",
|
|
221
221
|
{
|
|
222
222
|
"aria-hidden": "true",
|
|
223
|
-
className: `ds:inline-flex ds:items-center ds:justify-center ${
|
|
223
|
+
className: `ds:inline-flex ds:items-center ds:justify-center ${C}`
|
|
224
224
|
}
|
|
225
225
|
),
|
|
226
|
-
/* @__PURE__ */ t("span", { className: "ds:flex-1 ds:truncate", children:
|
|
226
|
+
/* @__PURE__ */ t("span", { className: "ds:flex-1 ds:truncate", children: n })
|
|
227
227
|
]
|
|
228
228
|
}
|
|
229
229
|
);
|
|
230
230
|
}
|
|
231
|
-
const
|
|
231
|
+
const ae = Ke(
|
|
232
232
|
function({
|
|
233
|
-
options:
|
|
234
|
-
value:
|
|
235
|
-
defaultValue:
|
|
236
|
-
onValueChange:
|
|
237
|
-
placeholder:
|
|
233
|
+
options: n,
|
|
234
|
+
value: C,
|
|
235
|
+
defaultValue: j,
|
|
236
|
+
onValueChange: A,
|
|
237
|
+
placeholder: L,
|
|
238
238
|
clearable: q = !1,
|
|
239
|
-
disabled:
|
|
240
|
-
readOnly:
|
|
241
|
-
required:
|
|
242
|
-
name:
|
|
243
|
-
id:
|
|
244
|
-
size:
|
|
245
|
-
tone:
|
|
246
|
-
filter:
|
|
247
|
-
allowCreate:
|
|
248
|
-
onCreate:
|
|
249
|
-
open:
|
|
250
|
-
onOpenChange:
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
"aria-
|
|
255
|
-
"aria-
|
|
239
|
+
disabled: ne,
|
|
240
|
+
readOnly: de,
|
|
241
|
+
required: le,
|
|
242
|
+
name: ce,
|
|
243
|
+
id: D,
|
|
244
|
+
size: x = "md",
|
|
245
|
+
tone: ue = "default",
|
|
246
|
+
filter: P,
|
|
247
|
+
allowCreate: me = !1,
|
|
248
|
+
onCreate: k,
|
|
249
|
+
open: X,
|
|
250
|
+
onOpenChange: m,
|
|
251
|
+
onQueryChange: r,
|
|
252
|
+
emptyMessage: pe,
|
|
253
|
+
className: fe,
|
|
254
|
+
"aria-label": W,
|
|
255
|
+
"aria-invalid": be,
|
|
256
|
+
"aria-describedby": ve,
|
|
256
257
|
autoComplete: he
|
|
257
258
|
}, ge) {
|
|
258
|
-
const { t: y } =
|
|
259
|
-
value:
|
|
260
|
-
defaultValue:
|
|
261
|
-
onChange:
|
|
262
|
-
}),
|
|
263
|
-
() =>
|
|
264
|
-
[
|
|
265
|
-
),
|
|
266
|
-
|
|
259
|
+
const { t: y } = Ue(), v = He(), S = Oe(Ge) !== null, [xe, w] = Xe({
|
|
260
|
+
value: C,
|
|
261
|
+
defaultValue: j ?? "",
|
|
262
|
+
onChange: A
|
|
263
|
+
}), p = xe ?? "", K = U(
|
|
264
|
+
() => n.find((e) => e.value === p),
|
|
265
|
+
[n, p]
|
|
266
|
+
), N = (K == null ? void 0 : K.label) ?? "", [f, d] = re(N), [ye, J] = re(!1), I = X !== void 0, l = I ? X : ye, z = g(!1), _ = g(null), Y = g(null);
|
|
267
|
+
We(() => {
|
|
267
268
|
var e;
|
|
268
|
-
(e =
|
|
269
|
-
}),
|
|
270
|
-
|
|
271
|
-
}, [
|
|
272
|
-
const
|
|
273
|
-
() => (e, o,
|
|
274
|
-
if (
|
|
275
|
-
const
|
|
276
|
-
return
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
269
|
+
(e = _.current) == null || e.setAttribute("aria-expanded", String(l));
|
|
270
|
+
}), F(() => {
|
|
271
|
+
l || d(N);
|
|
272
|
+
}, [N, l]);
|
|
273
|
+
const Se = D ?? (S ? v.id : void 0), O = (S ? v.disabled : !1) || !!ne, h = !!de, Ne = (S ? v.required : !1) || !!le, Z = S ? v.invalid : !!be, ze = Z ? "error" : ue, Re = S && v.describedBy ? v.describedBy : ve, Q = L ?? y("inputs.combobox.placeholder", "Search…"), we = U(
|
|
274
|
+
() => (e, o, a) => {
|
|
275
|
+
if (z.current) return 1;
|
|
276
|
+
const b = H(e), i = H(o), B = a == null ? void 0 : a.map(H);
|
|
277
|
+
return P ? P(b, i) : $e(
|
|
278
|
+
b,
|
|
279
|
+
i,
|
|
280
|
+
B
|
|
280
281
|
);
|
|
281
282
|
},
|
|
282
|
-
[
|
|
283
|
-
),
|
|
284
|
-
|
|
285
|
-
},
|
|
286
|
-
|
|
287
|
-
}, Re = (e) => {
|
|
288
|
-
const o = a.find((r) => r.value === e);
|
|
289
|
-
Z(e), i((o == null ? void 0 : o.label) ?? ""), l(!1);
|
|
290
|
-
}, we = (e) => {
|
|
291
|
-
P == null || P(e), l(!1);
|
|
283
|
+
[P]
|
|
284
|
+
), ee = (e) => {
|
|
285
|
+
w(e);
|
|
286
|
+
}, c = (e) => {
|
|
287
|
+
I || J(e), m == null || m(e);
|
|
292
288
|
}, Ie = (e) => {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
289
|
+
const o = n.find((a) => a.value === e);
|
|
290
|
+
ee(e), d((o == null ? void 0 : o.label) ?? ""), c(!1);
|
|
291
|
+
}, _e = (e) => {
|
|
292
|
+
k == null || k(e), c(!1);
|
|
293
|
+
}, Fe = (e) => {
|
|
294
|
+
h || (d(e), z.current || r == null || r(e), !l && e.length > 0 && !z.current && c(!0));
|
|
298
295
|
}, Ee = () => {
|
|
296
|
+
!O && !h && c(!0);
|
|
297
|
+
}, Ve = () => {
|
|
298
|
+
z.current = !0;
|
|
299
|
+
}, Ce = () => {
|
|
299
300
|
var o;
|
|
300
|
-
if (
|
|
301
|
-
const e = ((o =
|
|
302
|
-
|
|
303
|
-
}, Ve = (e) => {
|
|
304
|
-
e.nativeEvent.isComposing || e.key === "Escape" && d && (e.preventDefault(), l(!1), i(C));
|
|
301
|
+
if (z.current = !1, h) return;
|
|
302
|
+
const e = ((o = _.current) == null ? void 0 : o.value) ?? "";
|
|
303
|
+
d(e), r == null || r(e), e.length > 0 && c(!0);
|
|
305
304
|
}, je = (e) => {
|
|
305
|
+
e.nativeEvent.isComposing || e.key === "Escape" && l && (e.preventDefault(), c(!1), d(N));
|
|
306
|
+
}, Ae = (e) => {
|
|
306
307
|
var o;
|
|
307
|
-
e.preventDefault(), e.stopPropagation(),
|
|
308
|
+
e.preventDefault(), e.stopPropagation(), ee(""), d(""), r == null || r(""), c(!0), (o = _.current) == null || o.focus();
|
|
308
309
|
}, qe = (e) => {
|
|
309
|
-
h && e || (
|
|
310
|
-
},
|
|
311
|
-
|
|
312
|
-
ee.current = m;
|
|
313
|
-
}, [m]);
|
|
314
|
-
const te = g(p);
|
|
315
|
-
I(() => {
|
|
310
|
+
h && e || (c(e), e || d(N));
|
|
311
|
+
}, te = g(p);
|
|
312
|
+
F(() => {
|
|
316
313
|
te.current = p;
|
|
317
314
|
}, [p]);
|
|
318
|
-
const se = g(
|
|
319
|
-
|
|
320
|
-
se.current =
|
|
321
|
-
}, [
|
|
322
|
-
const
|
|
315
|
+
const se = g(f);
|
|
316
|
+
F(() => {
|
|
317
|
+
se.current = f;
|
|
318
|
+
}, [f]);
|
|
319
|
+
const oe = g(l);
|
|
320
|
+
F(() => {
|
|
321
|
+
oe.current = l;
|
|
322
|
+
}, [l]);
|
|
323
|
+
const T = Te(
|
|
323
324
|
(e) => {
|
|
324
|
-
|
|
325
|
+
I || J(e), m == null || m(e);
|
|
325
326
|
},
|
|
326
|
-
[
|
|
327
|
-
),
|
|
327
|
+
[I, m]
|
|
328
|
+
), De = U(
|
|
328
329
|
() => ({
|
|
329
|
-
getValue: () =>
|
|
330
|
-
getQuery: () =>
|
|
331
|
-
getIsOpen: () =>
|
|
330
|
+
getValue: () => te.current || null,
|
|
331
|
+
getQuery: () => se.current,
|
|
332
|
+
getIsOpen: () => oe.current,
|
|
332
333
|
setValue: (e) => {
|
|
333
334
|
const o = e ?? "";
|
|
334
|
-
|
|
335
|
-
const
|
|
336
|
-
|
|
335
|
+
w(o);
|
|
336
|
+
const a = n.find((b) => b.value === o);
|
|
337
|
+
d((a == null ? void 0 : a.label) ?? "");
|
|
337
338
|
},
|
|
338
339
|
setQuery: (e) => {
|
|
339
|
-
|
|
340
|
+
d(e), r == null || r(e);
|
|
340
341
|
},
|
|
341
342
|
clear: () => {
|
|
342
|
-
|
|
343
|
+
w(""), d(""), r == null || r("");
|
|
343
344
|
},
|
|
344
|
-
open: () =>
|
|
345
|
-
close: () =>
|
|
345
|
+
open: () => T(!0),
|
|
346
|
+
close: () => T(!1)
|
|
346
347
|
}),
|
|
347
|
-
[
|
|
348
|
+
[w, n, T, r]
|
|
348
349
|
);
|
|
349
|
-
|
|
350
|
-
const
|
|
351
|
-
return /* @__PURE__ */ t(
|
|
352
|
-
|
|
350
|
+
Ze(tt, De, D);
|
|
351
|
+
const Pe = q && !!p && !O && !h, ke = Le(n), $ = dt[x];
|
|
352
|
+
return /* @__PURE__ */ t(E.Root, { open: l, onOpenChange: qe, children: /* @__PURE__ */ R(
|
|
353
|
+
u,
|
|
353
354
|
{
|
|
354
|
-
filter:
|
|
355
|
+
filter: we,
|
|
355
356
|
shouldFilter: !0,
|
|
356
357
|
loop: !0,
|
|
357
|
-
label:
|
|
358
|
+
label: W ?? Q,
|
|
358
359
|
className: "ds:w-full",
|
|
359
360
|
children: [
|
|
360
|
-
/* @__PURE__ */ t(
|
|
361
|
+
/* @__PURE__ */ t(E.Anchor, { asChild: !0, children: /* @__PURE__ */ R(
|
|
361
362
|
"div",
|
|
362
363
|
{
|
|
363
|
-
ref:
|
|
364
|
-
className:
|
|
365
|
-
size:
|
|
366
|
-
tone:
|
|
367
|
-
className:
|
|
364
|
+
ref: Y,
|
|
365
|
+
className: ot({
|
|
366
|
+
size: x,
|
|
367
|
+
tone: ze,
|
|
368
|
+
className: fe
|
|
368
369
|
}),
|
|
369
370
|
"data-component": "combobox",
|
|
370
|
-
"data-component-id":
|
|
371
|
+
"data-component-id": D,
|
|
371
372
|
children: [
|
|
372
373
|
/* @__PURE__ */ t(
|
|
373
|
-
|
|
374
|
+
u.Input,
|
|
374
375
|
{
|
|
375
|
-
ref:
|
|
376
|
-
value:
|
|
377
|
-
onValueChange:
|
|
378
|
-
id:
|
|
379
|
-
name:
|
|
380
|
-
placeholder:
|
|
381
|
-
disabled:
|
|
376
|
+
ref: Me(ge, _),
|
|
377
|
+
value: f,
|
|
378
|
+
onValueChange: Fe,
|
|
379
|
+
id: Se,
|
|
380
|
+
name: ce,
|
|
381
|
+
placeholder: Q,
|
|
382
|
+
disabled: O,
|
|
382
383
|
readOnly: h,
|
|
383
|
-
required:
|
|
384
|
+
required: Ne,
|
|
384
385
|
autoComplete: he,
|
|
385
|
-
"aria-describedby":
|
|
386
|
-
"aria-invalid":
|
|
387
|
-
onFocus:
|
|
388
|
-
onKeyDown:
|
|
389
|
-
onCompositionStart:
|
|
390
|
-
onCompositionEnd:
|
|
391
|
-
className:
|
|
386
|
+
"aria-describedby": Re,
|
|
387
|
+
"aria-invalid": Z || void 0,
|
|
388
|
+
onFocus: Ee,
|
|
389
|
+
onKeyDown: je,
|
|
390
|
+
onCompositionStart: Ve,
|
|
391
|
+
onCompositionEnd: Ce,
|
|
392
|
+
className: st({ size: x })
|
|
392
393
|
}
|
|
393
394
|
),
|
|
394
|
-
|
|
395
|
+
Pe ? /* @__PURE__ */ t(
|
|
395
396
|
"button",
|
|
396
397
|
{
|
|
397
398
|
type: "button",
|
|
398
399
|
"aria-label": y("inputs.combobox.clear", "Clear selection"),
|
|
399
|
-
onClick:
|
|
400
|
+
onClick: Ae,
|
|
400
401
|
onPointerDown: (e) => e.stopPropagation(),
|
|
401
402
|
className: [
|
|
402
403
|
"ds:inline-flex ds:items-center ds:justify-center ds:rounded-[var(--radius-sm)]",
|
|
@@ -406,52 +407,52 @@ const re = ke(
|
|
|
406
407
|
"ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
407
408
|
"ds:size-4"
|
|
408
409
|
].join(" "),
|
|
409
|
-
children: /* @__PURE__ */ t(
|
|
410
|
+
children: /* @__PURE__ */ t(Qe, { "aria-hidden": "true", className: "ds:size-3.5" })
|
|
410
411
|
}
|
|
411
412
|
) : null
|
|
412
413
|
]
|
|
413
414
|
}
|
|
414
415
|
) }),
|
|
415
|
-
/* @__PURE__ */ t(
|
|
416
|
-
|
|
416
|
+
/* @__PURE__ */ t(E.Portal, { forceMount: !0, children: /* @__PURE__ */ t(
|
|
417
|
+
E.Content,
|
|
417
418
|
{
|
|
418
419
|
forceMount: !0,
|
|
419
|
-
hidden: !
|
|
420
|
-
"aria-label":
|
|
420
|
+
hidden: !l,
|
|
421
|
+
"aria-label": W ?? y("inputs.combobox.popupLabel", "Options"),
|
|
421
422
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
422
423
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
423
424
|
onInteractOutside: (e) => {
|
|
424
|
-
var
|
|
425
|
+
var a;
|
|
425
426
|
const o = e.target;
|
|
426
|
-
o && ((
|
|
427
|
+
o && ((a = Y.current) != null && a.contains(o)) && e.preventDefault();
|
|
427
428
|
},
|
|
428
429
|
sideOffset: 4,
|
|
429
430
|
align: "start",
|
|
430
|
-
className:
|
|
431
|
-
children: /* @__PURE__ */
|
|
432
|
-
/* @__PURE__ */ t(
|
|
433
|
-
|
|
434
|
-
const
|
|
435
|
-
const
|
|
436
|
-
return /* @__PURE__ */
|
|
437
|
-
|
|
431
|
+
className: rt(),
|
|
432
|
+
children: /* @__PURE__ */ R(u.List, { className: at, children: [
|
|
433
|
+
/* @__PURE__ */ t(u.Empty, { className: nt, children: /* @__PURE__ */ t("div", { role: "option", "aria-selected": !1, "aria-disabled": "true", children: pe ?? y("inputs.combobox.empty", "No results found") }) }),
|
|
434
|
+
ke.map(({ group: e, items: o }, a) => {
|
|
435
|
+
const b = o.map((i) => {
|
|
436
|
+
const B = i.value === p;
|
|
437
|
+
return /* @__PURE__ */ R(
|
|
438
|
+
u.Item,
|
|
438
439
|
{
|
|
439
|
-
value:
|
|
440
|
-
"data-option-id":
|
|
441
|
-
keywords: [
|
|
442
|
-
disabled:
|
|
443
|
-
onSelect:
|
|
444
|
-
className:
|
|
440
|
+
value: i.value,
|
|
441
|
+
"data-option-id": i.value,
|
|
442
|
+
keywords: [i.label],
|
|
443
|
+
disabled: i.disabled,
|
|
444
|
+
onSelect: Ie,
|
|
445
|
+
className: ie({ size: x }),
|
|
445
446
|
children: [
|
|
446
447
|
/* @__PURE__ */ t(
|
|
447
448
|
"span",
|
|
448
449
|
{
|
|
449
450
|
"aria-hidden": "true",
|
|
450
|
-
className: `ds:inline-flex ds:items-center ds:justify-center ${
|
|
451
|
-
children:
|
|
451
|
+
className: `ds:inline-flex ds:items-center ds:justify-center ${$}`,
|
|
452
|
+
children: B ? /* @__PURE__ */ t(et, { className: $ }) : null
|
|
452
453
|
}
|
|
453
454
|
),
|
|
454
|
-
|
|
455
|
+
i.startAdornment ? (
|
|
455
456
|
// Decorative by contract — the option's accessible
|
|
456
457
|
// name comes from its label. Hide so a text-bearing
|
|
457
458
|
// adornment can't leak into the computed name.
|
|
@@ -460,44 +461,44 @@ const re = ke(
|
|
|
460
461
|
{
|
|
461
462
|
"aria-hidden": "true",
|
|
462
463
|
className: "ds:inline-flex ds:items-center ds:shrink-0",
|
|
463
|
-
children:
|
|
464
|
+
children: i.startAdornment
|
|
464
465
|
}
|
|
465
466
|
)
|
|
466
467
|
) : null,
|
|
467
|
-
/* @__PURE__ */ t("span", { className: "ds:flex-1 ds:truncate", children:
|
|
468
|
-
|
|
469
|
-
|
|
468
|
+
/* @__PURE__ */ t("span", { className: "ds:flex-1 ds:truncate", children: i.label }),
|
|
469
|
+
i.description ? /* @__PURE__ */ t("span", { className: "type-meta ds:text-muted-foreground", children: i.description }) : null,
|
|
470
|
+
i.endContent ? (
|
|
470
471
|
// Deliberately NOT aria-hidden — unlike
|
|
471
472
|
// `startAdornment`, this slot carries meaning
|
|
472
473
|
// (a price, a count) and must reach the
|
|
473
474
|
// option's accessible name. `ms-auto` pins it
|
|
474
475
|
// to the inline-end and flips under RTL.
|
|
475
|
-
/* @__PURE__ */ t("span", { className: "ds:inline-flex ds:items-center ds:ms-auto ds:shrink-0", children:
|
|
476
|
+
/* @__PURE__ */ t("span", { className: "ds:inline-flex ds:items-center ds:ms-auto ds:shrink-0", children: i.endContent })
|
|
476
477
|
) : null
|
|
477
478
|
]
|
|
478
479
|
},
|
|
479
|
-
|
|
480
|
+
i.value
|
|
480
481
|
);
|
|
481
482
|
});
|
|
482
483
|
return e ? /* @__PURE__ */ t(
|
|
483
|
-
|
|
484
|
+
u.Group,
|
|
484
485
|
{
|
|
485
|
-
heading: /* @__PURE__ */ t("span", { className:
|
|
486
|
-
children:
|
|
486
|
+
heading: /* @__PURE__ */ t("span", { className: it, children: e }),
|
|
487
|
+
children: b
|
|
487
488
|
},
|
|
488
489
|
`group-${e}`
|
|
489
|
-
) : /* @__PURE__ */ t(
|
|
490
|
+
) : /* @__PURE__ */ t(u.Group, { children: b }, `group-${a}`);
|
|
490
491
|
}),
|
|
491
|
-
|
|
492
|
-
|
|
492
|
+
me && f.length > 0 ? /* @__PURE__ */ t(
|
|
493
|
+
lt,
|
|
493
494
|
{
|
|
494
|
-
search:
|
|
495
|
+
search: f,
|
|
495
496
|
label: y("inputs.combobox.create", 'Create "{{value}}"', {
|
|
496
|
-
value:
|
|
497
|
+
value: f
|
|
497
498
|
}),
|
|
498
|
-
iconClass:
|
|
499
|
-
size:
|
|
500
|
-
onSelect:
|
|
499
|
+
iconClass: $,
|
|
500
|
+
size: x,
|
|
501
|
+
onSelect: _e
|
|
501
502
|
}
|
|
502
503
|
) : null
|
|
503
504
|
] })
|
|
@@ -508,14 +509,14 @@ const re = ke(
|
|
|
508
509
|
) });
|
|
509
510
|
}
|
|
510
511
|
);
|
|
511
|
-
|
|
512
|
-
const
|
|
512
|
+
ae.displayName = "Combobox";
|
|
513
|
+
const wt = ae;
|
|
513
514
|
export {
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
515
|
+
wt as C,
|
|
516
|
+
rt as a,
|
|
517
|
+
st as b,
|
|
518
|
+
tt as c,
|
|
519
|
+
ie as d,
|
|
520
|
+
ot as e
|
|
520
521
|
};
|
|
521
|
-
//# sourceMappingURL=combobox-
|
|
522
|
+
//# sourceMappingURL=combobox-DnSdYssy.js.map
|