@alfadocs/ui-kit 0.17.0 → 0.17.2
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/{accordion-DOmxGEWU.js → accordion-CNcodXuO.js} +6 -6
- package/dist/_chunks/{ai-prompt-input-DEiQwIMn.js → ai-prompt-input-B-w5Rx3V.js} +184 -181
- package/dist/_chunks/{alert-pgdXrEO5.js → alert-DBnawbmf.js} +64 -59
- package/dist/_chunks/{audio-recorder-CRh4uyFL.js → audio-recorder-DNkQLW1G.js} +3 -3
- package/dist/_chunks/{autocomplete-mOg7WLOh.js → autocomplete-BxfabhZ8.js} +167 -164
- package/dist/_chunks/{balance-cell-renderer-DWWtX-VM.js → balance-cell-renderer-DJB6WDPe.js} +2 -2
- package/dist/_chunks/{carousel.agent-OTn-kMQg.js → carousel.agent-Xuw9LPZN.js} +14 -7
- package/dist/_chunks/{chat-input-UK-bXU7u.js → chat-input-B3XmFGDw.js} +123 -122
- package/dist/_chunks/checkbox-group-Bwmt1ovQ.js +213 -0
- package/dist/_chunks/{checkbox-D5EHnB14.js → checkbox-mwbrPZDY.js} +75 -70
- package/dist/_chunks/{collapsible-CuxUBoHJ.js → collapsible-hHiyZp0b.js} +61 -63
- package/dist/_chunks/{color-picker-BPfcByHH.js → color-picker-Bm-gzpsh.js} +2 -2
- package/dist/_chunks/{combobox-D5tWe0t_.js → combobox-Da9eq00i.js} +214 -211
- package/dist/_chunks/{copy-field-BCHAZ8QV.js → copy-field-BAF4mt9h.js} +95 -132
- package/dist/_chunks/{date-picker-BlhtBhPo.js → date-picker-BIoSLRly.js} +222 -219
- package/dist/_chunks/{date-range-picker-C2hRu_Ke.js → date-range-picker-9gANFNG9.js} +81 -78
- package/dist/_chunks/{date-time-picker-B67mPZmP.js → date-time-picker-DG7BiGdb.js} +98 -95
- package/dist/_chunks/{dialog-DRp6Dejy.js → dialog-DUomPCRS.js} +69 -71
- package/dist/_chunks/{dropdown-menu-dyV7gHh_.js → dropdown-menu-DZxwF23X.js} +108 -110
- package/dist/_chunks/{freemium-paywall-BTEiVkes.js → freemium-paywall-DXc7XlGE.js} +98 -97
- package/dist/_chunks/{leo-sidebar-D3TuyH5_.js → leo-sidebar-DIsiTju3.js} +2 -2
- package/dist/_chunks/{list-DcjV0m5B.js → list-BdvDctBz.js} +184 -180
- package/dist/_chunks/{message-tray-Fsend-du.js → message-tray-BNAS8al4.js} +111 -111
- package/dist/_chunks/{multi-select-DooDzQIp.js → multi-select-CyspR5ZF.js} +157 -154
- package/dist/_chunks/{navigation-menu-DdufF-_4.js → navigation-menu-CyS1fBJ7.js} +85 -87
- package/dist/_chunks/{notification-tray-C3dYdLAF.js → notification-tray-D_69dXFY.js} +114 -114
- package/dist/_chunks/{number-input-DH00o0DN.js → number-input-BZXu6bPY.js} +92 -89
- package/dist/_chunks/{otp-input-BBXYvLx5.js → otp-input-BDF_iNpa.js} +92 -93
- package/dist/_chunks/{pagination-F1ei4khE.js → pagination-BWaXF7W0.js} +194 -211
- package/dist/_chunks/{patient-shell-BE0CdPOJ.js → patient-shell-BOOaWZA9.js} +3 -3
- package/dist/_chunks/{payment-form-CI77oIx1.js → payment-form-BjkuQeqR.js} +2 -2
- package/dist/_chunks/{pdf-viewer-CnEJvmXC.js → pdf-viewer-BG_nsFT5.js} +2 -2
- package/dist/_chunks/{public-header.agent-sDi9N9su.js → public-header.agent-BIBQzkeV.js} +7 -12
- package/dist/_chunks/{radio-group-Cz1a4QCA.js → radio-group-BHZOxrIK.js} +4 -4
- package/dist/_chunks/{select-Ca6ibiDL.js → select-C92AT_OZ.js} +7 -7
- package/dist/_chunks/{sidebar-D8Lq065m.js → sidebar-BqzlRBvC.js} +271 -291
- package/dist/_chunks/{slider-CkR6CLun.js → slider-CfEzeseL.js} +4 -4
- package/dist/_chunks/{tabs-CRCyPpJo.js → tabs-aEQfQV3x.js} +8 -8
- package/dist/_chunks/{theme-toggle-B3meAb3y.js → theme-toggle-BswYl0Yp.js} +2 -2
- package/dist/_chunks/use-controllable-state-BiY4xTzM.js +23 -0
- package/dist/_chunks/use-copy-to-clipboard-Cyfc_dlv.js +43 -0
- package/dist/_chunks/use-persistent-state-i23OWy6G.js +24 -0
- package/dist/_chunks/{warning-stack-CeRihME9.js → warning-stack-CDH9TudY.js} +2 -2
- package/dist/_chunks/{workflow-map-D3MvrsZV.js → workflow-map-BeKe23uw.js} +3 -3
- package/dist/agent-catalog.json +1 -1
- package/dist/components/_shared/use-debounced-callback.d.ts +1 -5
- package/dist/components/_shared/use-direction.d.ts +1 -18
- package/dist/components/_shared/use-focus-trap.d.ts +1 -31
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/alert/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/autocomplete/index.js +1 -1
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/chat-input/index.js +1 -1
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/checkbox-group/index.js +1 -1
- package/dist/components/collapsible/index.js +1 -1
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/command-palette/command-palette.d.ts +1 -1
- package/dist/components/copy-field/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/date-time-picker/index.js +1 -1
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dropdown-menu/index.js +1 -1
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/icon-button-group/icon-button-group.d.ts +14 -14
- package/dist/components/list/index.js +1 -1
- package/dist/components/message-tray/index.js +1 -1
- package/dist/components/multi-select/index.js +1 -1
- package/dist/components/navigation-menu/index.js +1 -1
- package/dist/components/notification-tray/index.js +1 -1
- package/dist/components/number-input/index.js +1 -1
- package/dist/components/otp-input/index.js +1 -1
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/payment-form/index.js +1 -1
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/public-header/index.js +1 -1
- package/dist/components/public-header/public-header.d.ts +1 -1
- package/dist/components/radio-group/index.js +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/sidebar/index.js +8 -7
- package/dist/components/sidebar/sidebar.d.ts +1 -1
- package/dist/components/slider/index.js +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/theme-toggle/index.js +1 -1
- package/dist/components/warning-stack/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/hooks/index.d.ts +8 -0
- package/dist/hooks/index.js +98 -15
- package/dist/hooks/use-debounced-callback.d.ts +19 -0
- package/dist/hooks/use-debounced-value.d.ts +16 -0
- package/dist/hooks/use-direction.d.ts +19 -0
- package/dist/hooks/use-focus-trap.d.ts +32 -0
- package/dist/hooks/use-isomorphic-layout-effect.d.ts +13 -0
- package/dist/hooks/use-persistent-state.d.ts +16 -0
- package/dist/index.js +493 -492
- package/dist/patterns/leo-assistant/index.js +1 -1
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +4 -2
- package/dist/_chunks/checkbox-group-Qkm3Rg1S.js +0 -208
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as X,
|
|
1
|
+
import { jsx as n, jsxs as W, Fragment as $ } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as X, useMemo as D, useState as V, useRef as J, useCallback as p, useImperativeHandle as C, useContext as ee, useLayoutEffect as te, Children as se, isValidElement as ie, createContext as re } from "react";
|
|
3
3
|
import { c as Y } from "./index-D2ZczOXr.js";
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { u as
|
|
6
|
-
|
|
4
|
+
import { useTranslation as ne } from "react-i18next";
|
|
5
|
+
import { u as ae } from "./use-controllable-state-BiY4xTzM.js";
|
|
6
|
+
import { u as oe } from "./registry-C9nwlNyL.js";
|
|
7
|
+
const de = {
|
|
7
8
|
id: "list",
|
|
8
9
|
capabilities: ["select_single", "select_multiple"],
|
|
9
10
|
state: {
|
|
@@ -20,8 +21,8 @@ const oe = {
|
|
|
20
21
|
argsType: "{ ids: string[] }",
|
|
21
22
|
descriptionKey: "ui.agent.list.actions.setSelection",
|
|
22
23
|
description: "Replace the current selection with the given item ids. No-op on presentational lists.",
|
|
23
|
-
invoke: (t,
|
|
24
|
-
t.setSelection(
|
|
24
|
+
invoke: (t, v) => {
|
|
25
|
+
t.setSelection(v.ids);
|
|
25
26
|
}
|
|
26
27
|
},
|
|
27
28
|
clear_selection: {
|
|
@@ -49,7 +50,7 @@ const oe = {
|
|
|
49
50
|
description: "Opaque item id; sourced from each ListItem `value` prop. Emitted only when `value` is set."
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
|
-
}, q =
|
|
53
|
+
}, q = re({
|
|
53
54
|
selection: "none",
|
|
54
55
|
selectedValues: /* @__PURE__ */ new Set(),
|
|
55
56
|
focusedValue: null,
|
|
@@ -64,7 +65,7 @@ const oe = {
|
|
|
64
65
|
registerItemRef: () => {
|
|
65
66
|
},
|
|
66
67
|
divider: "spaced"
|
|
67
|
-
}),
|
|
68
|
+
}), le = Y("ds:flex ds:flex-col ds:p-0 ds:m-0", {
|
|
68
69
|
variants: {
|
|
69
70
|
divider: {
|
|
70
71
|
spaced: "",
|
|
@@ -86,7 +87,7 @@ const oe = {
|
|
|
86
87
|
density: "default",
|
|
87
88
|
ordered: !1
|
|
88
89
|
}
|
|
89
|
-
}),
|
|
90
|
+
}), ce = Y(
|
|
90
91
|
"ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:py-[var(--spacing-xs)]",
|
|
91
92
|
{
|
|
92
93
|
variants: {
|
|
@@ -143,292 +144,295 @@ const oe = {
|
|
|
143
144
|
}
|
|
144
145
|
}
|
|
145
146
|
);
|
|
146
|
-
function
|
|
147
|
-
const
|
|
148
|
-
return
|
|
149
|
-
if (!
|
|
150
|
-
const
|
|
151
|
-
typeof
|
|
152
|
-
}),
|
|
147
|
+
function fe(t) {
|
|
148
|
+
const v = [];
|
|
149
|
+
return se.forEach(t, (x) => {
|
|
150
|
+
if (!ie(x)) return;
|
|
151
|
+
const y = x.props;
|
|
152
|
+
typeof y.value == "string" && v.push({ value: y.value, disabled: !!y.disabled });
|
|
153
|
+
}), v;
|
|
153
154
|
}
|
|
154
|
-
const
|
|
155
|
+
const Q = X(
|
|
155
156
|
({
|
|
156
157
|
as: t = "ul",
|
|
157
|
-
start:
|
|
158
|
-
divider:
|
|
159
|
-
density:
|
|
158
|
+
start: v,
|
|
159
|
+
divider: x = "spaced",
|
|
160
|
+
density: y = "default",
|
|
160
161
|
selection: w = "none",
|
|
161
|
-
value:
|
|
162
|
+
value: f,
|
|
162
163
|
defaultValue: S,
|
|
163
|
-
onValueChange:
|
|
164
|
-
disabled:
|
|
164
|
+
onValueChange: b,
|
|
165
|
+
disabled: a = !1,
|
|
165
166
|
className: N,
|
|
166
|
-
children:
|
|
167
|
+
children: m,
|
|
167
168
|
"aria-label": P,
|
|
168
|
-
...
|
|
169
|
+
...r
|
|
169
170
|
}, B) => {
|
|
170
|
-
const { t: T } =
|
|
171
|
-
if (
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
() =>
|
|
178
|
-
[
|
|
179
|
-
),
|
|
180
|
-
(e
|
|
181
|
-
|
|
171
|
+
const { t: T } = ne(), o = w !== "none", g = w === "multiple", U = D(() => {
|
|
172
|
+
if (f !== void 0)
|
|
173
|
+
return Array.isArray(f) ? f : [f];
|
|
174
|
+
}, [f]), K = D(() => S === void 0 ? [] : Array.isArray(S) ? S : [S], []), [E, _] = ae({
|
|
175
|
+
value: U,
|
|
176
|
+
defaultValue: K
|
|
177
|
+
}), u = D(
|
|
178
|
+
() => new Set(E ?? []),
|
|
179
|
+
[E]
|
|
180
|
+
), H = D(() => fe(m), [m]), i = D(
|
|
181
|
+
() => H.filter((e) => !e.disabled && !a).map((e) => e.value),
|
|
182
|
+
[H, a]
|
|
183
|
+
), [h, j] = V(null), F = J(/* @__PURE__ */ new Map()), G = p(
|
|
184
|
+
(e, l) => {
|
|
185
|
+
l ? F.current.set(e, l) : F.current.delete(e);
|
|
182
186
|
},
|
|
183
187
|
[]
|
|
184
|
-
), I =
|
|
185
|
-
|
|
186
|
-
var
|
|
187
|
-
(
|
|
188
|
+
), I = p((e) => {
|
|
189
|
+
j(e), requestAnimationFrame(() => {
|
|
190
|
+
var l;
|
|
191
|
+
(l = F.current.get(e)) == null || l.focus();
|
|
188
192
|
});
|
|
189
|
-
}, []),
|
|
193
|
+
}, []), d = p(
|
|
190
194
|
(e) => {
|
|
191
|
-
|
|
195
|
+
_(e), g ? b == null || b(e) : b == null || b(e[0] ?? "");
|
|
192
196
|
},
|
|
193
|
-
[
|
|
194
|
-
),
|
|
197
|
+
[_, g, b]
|
|
198
|
+
), k = p(
|
|
195
199
|
(e) => {
|
|
196
|
-
if (!
|
|
197
|
-
if (
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
+
if (!a && o)
|
|
201
|
+
if (g) {
|
|
202
|
+
const l = [...u];
|
|
203
|
+
u.has(e) ? d(l.filter((O) => O !== e)) : d([...l, e]);
|
|
200
204
|
} else
|
|
201
|
-
|
|
205
|
+
u.has(e) ? d([]) : d([e]);
|
|
202
206
|
},
|
|
203
|
-
[
|
|
204
|
-
),
|
|
205
|
-
|
|
206
|
-
}, []),
|
|
207
|
-
(e,
|
|
208
|
-
if (!
|
|
209
|
-
const
|
|
207
|
+
[a, o, g, u, d]
|
|
208
|
+
), M = p((e) => {
|
|
209
|
+
j(e);
|
|
210
|
+
}, []), z = p(
|
|
211
|
+
(e, l) => {
|
|
212
|
+
if (!o) return;
|
|
213
|
+
const O = i.indexOf(l);
|
|
210
214
|
switch (e.key) {
|
|
211
215
|
case "ArrowDown": {
|
|
212
216
|
e.preventDefault();
|
|
213
|
-
const
|
|
214
|
-
|
|
217
|
+
const c = i[O + 1];
|
|
218
|
+
c !== void 0 && I(c);
|
|
215
219
|
break;
|
|
216
220
|
}
|
|
217
221
|
case "ArrowUp": {
|
|
218
222
|
e.preventDefault();
|
|
219
|
-
const
|
|
220
|
-
|
|
223
|
+
const c = i[O - 1];
|
|
224
|
+
c !== void 0 && I(c);
|
|
221
225
|
break;
|
|
222
226
|
}
|
|
223
227
|
case "Home": {
|
|
224
228
|
e.preventDefault();
|
|
225
|
-
const
|
|
226
|
-
|
|
229
|
+
const c = i[0];
|
|
230
|
+
c !== void 0 && I(c);
|
|
227
231
|
break;
|
|
228
232
|
}
|
|
229
233
|
case "End": {
|
|
230
234
|
e.preventDefault();
|
|
231
|
-
const
|
|
232
|
-
|
|
235
|
+
const c = i[i.length - 1];
|
|
236
|
+
c !== void 0 && I(c);
|
|
233
237
|
break;
|
|
234
238
|
}
|
|
235
239
|
case " ":
|
|
236
240
|
case "Enter": {
|
|
237
|
-
e.preventDefault(),
|
|
241
|
+
e.preventDefault(), k(l);
|
|
238
242
|
break;
|
|
239
243
|
}
|
|
240
244
|
}
|
|
241
245
|
},
|
|
242
|
-
[
|
|
246
|
+
[o, i, I, k]
|
|
243
247
|
), A = {
|
|
244
248
|
selection: w,
|
|
245
|
-
selectedValues:
|
|
246
|
-
focusedValue:
|
|
247
|
-
disabled:
|
|
248
|
-
enabledItemValues:
|
|
249
|
-
onItemSelect:
|
|
250
|
-
onItemFocus:
|
|
251
|
-
onItemKeyDown:
|
|
252
|
-
registerItemRef:
|
|
253
|
-
divider:
|
|
254
|
-
},
|
|
255
|
-
divider:
|
|
256
|
-
density:
|
|
249
|
+
selectedValues: u,
|
|
250
|
+
focusedValue: h,
|
|
251
|
+
disabled: a,
|
|
252
|
+
enabledItemValues: i,
|
|
253
|
+
onItemSelect: k,
|
|
254
|
+
onItemFocus: M,
|
|
255
|
+
onItemKeyDown: z,
|
|
256
|
+
registerItemRef: G,
|
|
257
|
+
divider: x
|
|
258
|
+
}, R = le({
|
|
259
|
+
divider: x,
|
|
260
|
+
density: y,
|
|
257
261
|
ordered: t === "ol",
|
|
258
262
|
className: N
|
|
259
|
-
}),
|
|
263
|
+
}), L = J(null), s = D(
|
|
260
264
|
() => ({
|
|
261
|
-
getSelection: () => Array.from(
|
|
265
|
+
getSelection: () => Array.from(u),
|
|
262
266
|
setSelection: (e) => {
|
|
263
|
-
|
|
267
|
+
o && d(g ? e : e.slice(0, 1));
|
|
264
268
|
},
|
|
265
269
|
clearSelection: () => {
|
|
266
|
-
|
|
270
|
+
o && d([]);
|
|
267
271
|
}
|
|
268
272
|
}),
|
|
269
|
-
[
|
|
273
|
+
[u, o, g, d]
|
|
270
274
|
);
|
|
271
|
-
if (
|
|
275
|
+
if (C(B, () => s, [s]), oe(de, s, r.id), o) {
|
|
272
276
|
const e = P ?? T("list.label", "List");
|
|
273
|
-
return /* @__PURE__ */
|
|
277
|
+
return /* @__PURE__ */ n(q.Provider, { value: A, children: /* @__PURE__ */ n(
|
|
274
278
|
"div",
|
|
275
279
|
{
|
|
276
|
-
ref:
|
|
280
|
+
ref: L,
|
|
277
281
|
role: "listbox",
|
|
278
282
|
"aria-label": e,
|
|
279
|
-
"aria-multiselectable":
|
|
280
|
-
"aria-disabled":
|
|
281
|
-
className:
|
|
283
|
+
"aria-multiselectable": g ? !0 : void 0,
|
|
284
|
+
"aria-disabled": a ? !0 : void 0,
|
|
285
|
+
className: R,
|
|
282
286
|
"data-component": "list",
|
|
283
|
-
"data-component-id":
|
|
284
|
-
...
|
|
285
|
-
children:
|
|
287
|
+
"data-component-id": r.id,
|
|
288
|
+
...r,
|
|
289
|
+
children: m
|
|
286
290
|
}
|
|
287
291
|
) });
|
|
288
292
|
}
|
|
289
|
-
return t === "ol" ? /* @__PURE__ */
|
|
293
|
+
return t === "ol" ? /* @__PURE__ */ n(q.Provider, { value: A, children: /* @__PURE__ */ n(
|
|
290
294
|
"ol",
|
|
291
295
|
{
|
|
292
|
-
ref:
|
|
293
|
-
start:
|
|
296
|
+
ref: L,
|
|
297
|
+
start: v,
|
|
294
298
|
role: "list",
|
|
295
|
-
className:
|
|
299
|
+
className: R,
|
|
296
300
|
"data-component": "list",
|
|
297
|
-
"data-component-id":
|
|
298
|
-
...
|
|
299
|
-
children:
|
|
301
|
+
"data-component-id": r.id,
|
|
302
|
+
...r,
|
|
303
|
+
children: m
|
|
300
304
|
}
|
|
301
|
-
) }) : /* @__PURE__ */
|
|
305
|
+
) }) : /* @__PURE__ */ n(q.Provider, { value: A, children: /* @__PURE__ */ n(
|
|
302
306
|
"ul",
|
|
303
307
|
{
|
|
304
|
-
ref:
|
|
308
|
+
ref: L,
|
|
305
309
|
role: "list",
|
|
306
|
-
className:
|
|
310
|
+
className: R,
|
|
307
311
|
"data-component": "list",
|
|
308
|
-
"data-component-id":
|
|
309
|
-
...
|
|
310
|
-
children:
|
|
312
|
+
"data-component-id": r.id,
|
|
313
|
+
...r,
|
|
314
|
+
children: m
|
|
311
315
|
}
|
|
312
316
|
) });
|
|
313
317
|
}
|
|
314
318
|
);
|
|
315
|
-
|
|
319
|
+
Q.displayName = "List";
|
|
316
320
|
const Z = X(
|
|
317
321
|
({
|
|
318
322
|
value: t,
|
|
319
|
-
leading:
|
|
320
|
-
title:
|
|
321
|
-
description:
|
|
323
|
+
leading: v,
|
|
324
|
+
title: x,
|
|
325
|
+
description: y,
|
|
322
326
|
trailing: w,
|
|
323
|
-
lineClamp:
|
|
327
|
+
lineClamp: f,
|
|
324
328
|
disabled: S = !1,
|
|
325
|
-
className:
|
|
326
|
-
onClick:
|
|
329
|
+
className: b,
|
|
330
|
+
onClick: a,
|
|
327
331
|
onFocus: N,
|
|
328
|
-
onKeyDown:
|
|
332
|
+
onKeyDown: m,
|
|
329
333
|
...P
|
|
330
|
-
},
|
|
334
|
+
}, r) => {
|
|
331
335
|
const {
|
|
332
336
|
selection: B,
|
|
333
337
|
selectedValues: T,
|
|
334
|
-
focusedValue:
|
|
335
|
-
disabled:
|
|
336
|
-
enabledItemValues:
|
|
337
|
-
onItemSelect:
|
|
338
|
-
onItemFocus:
|
|
339
|
-
onItemKeyDown:
|
|
340
|
-
registerItemRef:
|
|
341
|
-
divider:
|
|
342
|
-
} =
|
|
343
|
-
|
|
344
|
-
const
|
|
345
|
-
|
|
346
|
-
}, [
|
|
347
|
-
const
|
|
348
|
-
(
|
|
349
|
-
t &&
|
|
338
|
+
focusedValue: o,
|
|
339
|
+
disabled: g,
|
|
340
|
+
enabledItemValues: U,
|
|
341
|
+
onItemSelect: K,
|
|
342
|
+
onItemFocus: E,
|
|
343
|
+
onItemKeyDown: _,
|
|
344
|
+
registerItemRef: u,
|
|
345
|
+
divider: H
|
|
346
|
+
} = ee(q), i = B !== "none", h = g || S, j = t !== void 0 ? T.has(t) : !1, F = t !== void 0 && o === t, G = t !== void 0 && U[0] === t, I = i ? o !== null ? F && !h ? 0 : -1 : G && !h ? 0 : -1 : void 0, d = J(null);
|
|
347
|
+
te(() => {
|
|
348
|
+
const s = d.current;
|
|
349
|
+
s && (f != null ? s.style.setProperty("--list-item-clamp", String(f)) : s.style.removeProperty("--list-item-clamp"));
|
|
350
|
+
}, [f]);
|
|
351
|
+
const k = p(
|
|
352
|
+
(s) => {
|
|
353
|
+
t && u(t, s), typeof r == "function" ? r(s) : r && (r.current = s);
|
|
350
354
|
},
|
|
351
|
-
[t,
|
|
352
|
-
), M =
|
|
353
|
-
(
|
|
354
|
-
|
|
355
|
+
[t, u, r]
|
|
356
|
+
), M = p(
|
|
357
|
+
(s) => {
|
|
358
|
+
i && t && !h && K(t), a == null || a(s);
|
|
355
359
|
},
|
|
356
|
-
[
|
|
357
|
-
),
|
|
358
|
-
(
|
|
359
|
-
t &&
|
|
360
|
+
[i, t, h, K, a]
|
|
361
|
+
), z = p(
|
|
362
|
+
(s) => {
|
|
363
|
+
t && E(t), N == null || N(s);
|
|
360
364
|
},
|
|
361
|
-
[t,
|
|
362
|
-
),
|
|
363
|
-
(
|
|
364
|
-
t &&
|
|
365
|
+
[t, E, N]
|
|
366
|
+
), A = p(
|
|
367
|
+
(s) => {
|
|
368
|
+
t && _(s, t), m == null || m(s);
|
|
365
369
|
},
|
|
366
|
-
[t,
|
|
367
|
-
),
|
|
368
|
-
divider:
|
|
369
|
-
interactive:
|
|
370
|
-
selected:
|
|
371
|
-
disabled:
|
|
372
|
-
className:
|
|
373
|
-
}),
|
|
374
|
-
|
|
375
|
-
/* @__PURE__ */
|
|
376
|
-
/* @__PURE__ */
|
|
377
|
-
|
|
370
|
+
[t, _, m]
|
|
371
|
+
), R = ce({
|
|
372
|
+
divider: H,
|
|
373
|
+
interactive: i,
|
|
374
|
+
selected: j,
|
|
375
|
+
disabled: h,
|
|
376
|
+
className: b
|
|
377
|
+
}), L = /* @__PURE__ */ W($, { children: [
|
|
378
|
+
v && /* @__PURE__ */ n("span", { className: "ds:shrink-0 ds:flex ds:items-center ds:justify-center", children: v }),
|
|
379
|
+
/* @__PURE__ */ W("div", { className: "ds:flex-1 ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:min-w-0", children: [
|
|
380
|
+
/* @__PURE__ */ n("span", { className: "ds:text-[color:var(--foreground)] ds:text-[length:var(--font-size-sm)] ds:font-medium ds:leading-[var(--line-height-base)] ds:[overflow-wrap:anywhere]", children: x }),
|
|
381
|
+
y && /* @__PURE__ */ n(
|
|
378
382
|
"span",
|
|
379
383
|
{
|
|
380
|
-
ref:
|
|
384
|
+
ref: d,
|
|
381
385
|
className: [
|
|
382
386
|
"ds:text-[color:var(--muted-foreground)] ds:text-[length:var(--font-size-xs)] ds:leading-[var(--line-height-base)]",
|
|
383
|
-
|
|
387
|
+
f != null ? "ds:[overflow:hidden] ds:[display:-webkit-box] ds:[-webkit-box-orient:vertical] ds:[-webkit-line-clamp:var(--list-item-clamp)]" : ""
|
|
384
388
|
].filter(Boolean).join(" "),
|
|
385
|
-
children:
|
|
389
|
+
children: y
|
|
386
390
|
}
|
|
387
391
|
)
|
|
388
392
|
] }),
|
|
389
|
-
w && /* @__PURE__ */
|
|
393
|
+
w && /* @__PURE__ */ n("span", { className: "ds:shrink-0 ds:flex ds:items-center ds:justify-center", children: w })
|
|
390
394
|
] });
|
|
391
|
-
return
|
|
395
|
+
return i ? /* @__PURE__ */ n(
|
|
392
396
|
"div",
|
|
393
397
|
{
|
|
394
|
-
ref:
|
|
398
|
+
ref: k,
|
|
395
399
|
role: "option",
|
|
396
|
-
"aria-selected":
|
|
397
|
-
"aria-disabled":
|
|
398
|
-
tabIndex:
|
|
400
|
+
"aria-selected": j,
|
|
401
|
+
"aria-disabled": h ? !0 : void 0,
|
|
402
|
+
tabIndex: I,
|
|
399
403
|
onClick: M,
|
|
400
|
-
onFocus:
|
|
401
|
-
onKeyDown:
|
|
402
|
-
className:
|
|
404
|
+
onFocus: z,
|
|
405
|
+
onKeyDown: A,
|
|
406
|
+
className: R,
|
|
403
407
|
"data-item-id": t,
|
|
404
408
|
...P,
|
|
405
|
-
children:
|
|
409
|
+
children: L
|
|
406
410
|
}
|
|
407
411
|
) : (
|
|
408
412
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions -- non-interactive list items still surface click/keyboard handlers when selection mode is enabled (handlers no-op when selection==='none')
|
|
409
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ n(
|
|
410
414
|
"li",
|
|
411
415
|
{
|
|
412
|
-
ref:
|
|
416
|
+
ref: k,
|
|
413
417
|
onClick: M,
|
|
414
|
-
onFocus:
|
|
415
|
-
onKeyDown:
|
|
416
|
-
className:
|
|
418
|
+
onFocus: z,
|
|
419
|
+
onKeyDown: A,
|
|
420
|
+
className: R,
|
|
417
421
|
"data-item-id": t,
|
|
418
422
|
...P,
|
|
419
|
-
children: /* @__PURE__ */
|
|
423
|
+
children: /* @__PURE__ */ n("div", { className: "ds:flex ds:items-center ds:gap-x-[var(--spacing-sm)]", children: L })
|
|
420
424
|
}
|
|
421
425
|
)
|
|
422
426
|
);
|
|
423
427
|
}
|
|
424
428
|
);
|
|
425
429
|
Z.displayName = "List.Item";
|
|
426
|
-
const
|
|
427
|
-
Root:
|
|
430
|
+
const ye = Object.assign(Q, {
|
|
431
|
+
Root: Q,
|
|
428
432
|
Item: Z
|
|
429
433
|
});
|
|
430
434
|
export {
|
|
431
|
-
|
|
432
|
-
|
|
435
|
+
ye as L,
|
|
436
|
+
de as l
|
|
433
437
|
};
|
|
434
|
-
//# sourceMappingURL=list-
|
|
438
|
+
//# sourceMappingURL=list-BdvDctBz.js.map
|