@alea-design/ui 0.5.0 → 0.6.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 (100) hide show
  1. package/dist/components/button/Button.d.ts +3 -1
  2. package/dist/components/button/Button.js +64 -63
  3. package/dist/components/card/Card.d.ts +6 -2
  4. package/dist/components/card/Card.js +20 -20
  5. package/dist/components/combobox/Autocomplete.d.ts +4 -0
  6. package/dist/components/combobox/Autocomplete.js +89 -87
  7. package/dist/components/command/CommandPalette.d.ts +10 -0
  8. package/dist/components/command/CommandPalette.js +76 -52
  9. package/dist/components/data/Data.d.ts +6 -4
  10. package/dist/components/data/Data.js +66 -56
  11. package/dist/components/date/Date.d.ts +16 -2
  12. package/dist/components/date/Date.js +80 -69
  13. package/dist/components/display/Display.d.ts +3 -1
  14. package/dist/components/display/Display.js +27 -27
  15. package/dist/components/display/Display2.d.ts +2 -2
  16. package/dist/components/display/Display2.js +28 -27
  17. package/dist/components/feedback/Feedback.d.ts +3 -1
  18. package/dist/components/feedback/Feedback.js +102 -102
  19. package/dist/components/feedback/PageSkeleton.d.ts +19 -0
  20. package/dist/components/feedback/PageSkeleton.js +58 -0
  21. package/dist/components/field/Field.d.ts +3 -1
  22. package/dist/components/field/Field.js +82 -82
  23. package/dist/components/filter/FilterBar.d.ts +5 -2
  24. package/dist/components/filter/FilterBar.js +97 -66
  25. package/dist/components/form/Form.d.ts +8 -2
  26. package/dist/components/form/Form.js +53 -40
  27. package/dist/components/icon/icon-names.d.ts +2 -2
  28. package/dist/components/icon/icon-names.js +4 -2
  29. package/dist/components/list/List.d.ts +6 -2
  30. package/dist/components/list/List.js +65 -62
  31. package/dist/components/list/Lists2.d.ts +4 -0
  32. package/dist/components/list/Lists2.js +35 -35
  33. package/dist/components/media/Media.js +27 -27
  34. package/dist/components/more/More.d.ts +2 -2
  35. package/dist/components/more/More.js +46 -45
  36. package/dist/components/navigation/Navigation.d.ts +7 -5
  37. package/dist/components/navigation/Navigation.js +91 -74
  38. package/dist/components/navigation/Navigation2.d.ts +9 -3
  39. package/dist/components/navigation/Navigation2.js +209 -195
  40. package/dist/components/notification/NotificationCenter.js +70 -70
  41. package/dist/components/overlay/Drawer.d.ts +6 -1
  42. package/dist/components/overlay/Drawer.js +27 -25
  43. package/dist/components/overlay/Modal.d.ts +5 -0
  44. package/dist/components/overlay/Modal.js +16 -15
  45. package/dist/components/overlay/Overlay.d.ts +10 -1
  46. package/dist/components/overlay/Overlay.js +54 -52
  47. package/dist/components/overlay/Sheet.d.ts +2 -0
  48. package/dist/components/overlay/Sheet.js +30 -30
  49. package/dist/components/page/PageParts.js +20 -20
  50. package/dist/components/select/Select.js +75 -70
  51. package/dist/components/settings/Settings.d.ts +29 -0
  52. package/dist/components/settings/Settings.js +31 -0
  53. package/dist/components/shell/AccountMenu.d.ts +20 -0
  54. package/dist/components/shell/AccountMenu.js +32 -0
  55. package/dist/components/shell/AppShell.d.ts +9 -2
  56. package/dist/components/shell/AppShell.js +37 -37
  57. package/dist/components/shell/AppSidebar.d.ts +9 -3
  58. package/dist/components/shell/AppSidebar.js +45 -39
  59. package/dist/components/table/Table.d.ts +18 -4
  60. package/dist/components/table/Table.js +70 -46
  61. package/dist/components/tabs/Tabs.js +105 -94
  62. package/dist/components/theme/Theme.d.ts +7 -4
  63. package/dist/components/theme/Theme.js +127 -130
  64. package/dist/components/upload/Upload.js +62 -54
  65. package/dist/css/base.css +1 -1
  66. package/dist/css/button.css +1 -1
  67. package/dist/css/card.css +1 -1
  68. package/dist/css/command.css +1 -1
  69. package/dist/css/date.css +1 -1
  70. package/dist/css/display.css +1 -1
  71. package/dist/css/feedback.css +1 -1
  72. package/dist/css/field.css +1 -1
  73. package/dist/css/form.css +1 -1
  74. package/dist/css/groups.json +393 -21
  75. package/dist/css/list.css +1 -1
  76. package/dist/css/menu.css +1 -1
  77. package/dist/css/navigation.css +1 -1
  78. package/dist/css/notification.css +1 -1
  79. package/dist/css/overlay.css +1 -1
  80. package/dist/css/page.css +1 -1
  81. package/dist/css/select.css +1 -1
  82. package/dist/css/settings.css +1 -0
  83. package/dist/css/shell.css +1 -1
  84. package/dist/css/table.css +1 -1
  85. package/dist/css/tabs.css +1 -1
  86. package/dist/css/upload.css +1 -1
  87. package/dist/i18n/strings.d.ts +8 -0
  88. package/dist/i18n/strings.js +16 -0
  89. package/dist/index.d.ts +4 -0
  90. package/dist/index.js +318 -306
  91. package/dist/styles.css +1 -1
  92. package/dist/utils/animateRows.d.ts +11 -0
  93. package/dist/utils/animateRows.js +23 -0
  94. package/dist/utils/decimal.d.ts +12 -0
  95. package/dist/utils/decimal.js +48 -0
  96. package/dist/utils/initialFocus.d.ts +6 -0
  97. package/dist/utils/initialFocus.js +24 -0
  98. package/dist/utils/refs.d.ts +2 -0
  99. package/dist/utils/refs.js +14 -6
  100. package/package.json +3 -3
@@ -26,6 +26,8 @@ export interface ButtonProps extends Omit<RACButtonProps, 'isPending'> {
26
26
  loadingPosition?: 'center' | 'start' | 'end';
27
27
  /** Stretches to the width of its container. Can change per breakpoint: { base: true, md: false } is full width on phones only. */
28
28
  fullWidth?: Responsive<boolean>;
29
+ /** Lets a long label break onto several lines (the button grows, keeping its minimum height) instead of staying on one line with an ellipsis. For narrow screens and large text. */
30
+ wrap?: boolean;
29
31
  /** How the content sits in a wide button: center (default), start, or between (label left, end icon right). */
30
32
  justify?: 'center' | 'start' | 'between';
31
33
  /** A keyboard shortcut shown at the end, like ⌘S (also set as aria-keyshortcuts when it is text). */
@@ -45,7 +47,7 @@ export interface ButtonProps extends Omit<RACButtonProps, 'isPending'> {
45
47
  }
46
48
  /** The action button: eight looks, six tones, five sizes, three shapes, icons, a shortcut, loading and success states, and links that look like buttons. */
47
49
  export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
48
- export interface IconButtonProps extends Omit<ButtonProps, 'iconStart' | 'iconEnd' | 'children' | 'fullWidth' | 'shape' | 'loadingLabel' | 'loadingPosition' | 'justify' | 'shortcut'> {
50
+ export interface IconButtonProps extends Omit<ButtonProps, 'iconStart' | 'iconEnd' | 'children' | 'fullWidth' | 'shape' | 'loadingLabel' | 'loadingPosition' | 'justify' | 'wrap' | 'shortcut'> {
49
51
  /** What the button does, for screen readers (the icon has no text). */
50
52
  'aria-label': string;
51
53
  /** The icon. */
@@ -1,62 +1,63 @@
1
1
  "use client";
2
2
  import { jsx as e, jsxs as p, Fragment as Y } from "react/jsx-runtime";
3
- import { forwardRef as G, useRef as A, useEffect as I, useState as Z } from "react";
4
- import { useRipple as _ } from "@alea-design/motion";
5
- import { Link as C, Button as V, composeRenderProps as ee, ToggleButtonGroup as ne, ToggleButton as W, SelectionIndicator as te } from "react-aria-components";
3
+ import { forwardRef as G, useRef as A, useEffect as I, useState as _ } from "react";
4
+ import { useRipple as C } from "@alea-design/motion";
5
+ import { Link as V, Button as ee, composeRenderProps as te, ToggleButtonGroup as ne, ToggleButton as W, SelectionIndicator as ae } from "react-aria-components";
6
6
  import { withBase as b } from "../../utils/cx.js";
7
- import { useMergedRef as ae } from "../../utils/refs.js";
7
+ import { useMergedRef as oe } from "../../utils/refs.js";
8
8
  import { Spinner as P } from "../feedback/Spinner.js";
9
9
  import { useStrings as q } from "../../i18n/strings.js";
10
10
  import { responsiveAttrs as X } from "../../utils/responsive.js";
11
- import { TooltipTrigger as oe, Tooltip as re } from "../overlay/Overlay.js";
11
+ import { TooltipTrigger as re, Tooltip as le } from "../overlay/Overlay.js";
12
12
  import { buttonIcon as M } from "../icon/icon-contexts.js";
13
- const J = G(function({ variant: a = "primary", tone: t, size: c, shape: m, iconStart: d, iconEnd: i, isLoading: o, loadingLabel: r, loadingPosition: f = "center", fullWidth: N, justify: v, shortcut: u, href: g, target: k, rel: L, isSuccess: R, successLabel: y, ripple: w, className: j, children: x, ...S }, O) {
13
+ const J = G(function({ variant: a = "primary", tone: n, size: c, shape: u, iconStart: d, iconEnd: i, isLoading: o, loadingLabel: r, loadingPosition: m = "center", fullWidth: N, justify: v, wrap: g, shortcut: f, href: y, target: L, rel: O, isSuccess: R, successLabel: B, ripple: k, className: j, children: x, ...S }, Q) {
14
14
  const T = q();
15
- y ?? (y = T.done);
16
- const E = A(null), D = ae(O, E), { onPointerDown: $ } = _();
15
+ B ?? (B = T.done);
16
+ const E = A(null), D = oe(Q, E), { onPointerDown: $ } = C();
17
17
  I(() => {
18
- const n = E.current;
19
- if (!w || !n) return;
20
- const s = (B) => $({ currentTarget: n, clientX: B.clientX, clientY: B.clientY });
21
- return n.addEventListener("pointerdown", s), () => n.removeEventListener("pointerdown", s);
22
- }, [w, $]);
23
- const h = o && (r != null || f !== "center"), H = /* @__PURE__ */ e("span", { className: "alea-button-icon alea-button-inline-spinner", children: /* @__PURE__ */ e(P, { size: "sm", "aria-label": T.loading }) }), F = (n, s) => /* @__PURE__ */ p(Y, { children: [
18
+ const t = E.current;
19
+ if (!k || !t) return;
20
+ const s = (w) => $({ currentTarget: t, clientX: w.clientX, clientY: w.clientY });
21
+ return t.addEventListener("pointerdown", s), () => t.removeEventListener("pointerdown", s);
22
+ }, [k, $]);
23
+ const h = o && (r != null || m !== "center"), H = /* @__PURE__ */ e("span", { className: "alea-button-icon alea-button-inline-spinner", children: /* @__PURE__ */ e(P, { size: "sm", "aria-label": T.loading }) }), F = (t, s) => /* @__PURE__ */ p(Y, { children: [
24
24
  s && !h && /* @__PURE__ */ e("span", { className: "alea-button-spinner", children: /* @__PURE__ */ e(P, { size: "sm", "aria-label": T.loading }) }),
25
25
  R && !s ? /* @__PURE__ */ p("span", { className: "alea-button-content alea-success-in", "aria-live": "polite", children: [
26
26
  /* @__PURE__ */ e("span", { className: "alea-button-icon", "aria-hidden": "true", children: /* @__PURE__ */ e("svg", { className: "alea-success-check", viewBox: "0 0 24 24", width: "1em", height: "1em", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("path", { d: "M5 12.5l4.5 4.5L19 7.5" }) }) }),
27
- y != null && y !== !1 && /* @__PURE__ */ e("span", { className: "alea-button-label", children: y })
27
+ B != null && B !== !1 && /* @__PURE__ */ e("span", { className: "alea-button-label", children: B })
28
28
  ] }) : /* @__PURE__ */ p("span", { className: "alea-button-content", "data-hidden": s && !h || void 0, children: [
29
- h && f !== "end" ? H : d && /* @__PURE__ */ e("span", { className: "alea-button-icon", "aria-hidden": "true", ...M(a, t), children: d }),
30
- (h && r != null ? r : n) != null && n !== !1 && /* @__PURE__ */ e("span", { className: "alea-button-label", children: h && r != null ? r : n }),
31
- h && f === "end" ? H : i && /* @__PURE__ */ e("span", { className: "alea-button-icon", "aria-hidden": "true", ...M(a, t), children: i }),
32
- u && /* @__PURE__ */ e("kbd", { className: "alea-button-kbd", "aria-hidden": "true", children: u })
29
+ h && m !== "end" ? H : d && /* @__PURE__ */ e("span", { className: "alea-button-icon", "aria-hidden": "true", ...M(a, n), children: d }),
30
+ (h && r != null ? r : t) != null && t !== !1 && /* @__PURE__ */ e("span", { className: "alea-button-label", children: h && r != null ? r : t }),
31
+ h && m === "end" ? H : i && /* @__PURE__ */ e("span", { className: "alea-button-icon", "aria-hidden": "true", ...M(a, n), children: i }),
32
+ f && /* @__PURE__ */ e("kbd", { className: "alea-button-kbd", "aria-hidden": "true", children: f })
33
33
  ] })
34
34
  ] }), K = {
35
35
  "data-success": R || void 0,
36
- "data-ripple": w || void 0,
36
+ "data-ripple": k || void 0,
37
37
  "data-variant": a,
38
- "data-tone": t,
38
+ "data-tone": n,
39
39
  ...X("size", c, "md"),
40
40
  ...X("full-width", N),
41
- "data-shape": m,
42
- "data-justify": v
43
- }, z = typeof u == "string" ? u.replace("⌘", "Meta+").replace("⇧", "Shift+").replace("⌥", "Alt+").replace("⌃", "Control+") : void 0;
41
+ "data-shape": u,
42
+ "data-justify": v,
43
+ "data-wrap": g || void 0
44
+ }, z = typeof f == "string" ? f.replace("⌘", "Meta+").replace("⇧", "Shift+").replace("⌥", "Alt+").replace("⌃", "Control+") : void 0;
44
45
  if (I(() => {
45
- const n = E.current;
46
- n && (z ? n.setAttribute("aria-keyshortcuts", z) : n.removeAttribute("aria-keyshortcuts"));
47
- }, [z]), g) {
48
- const { onPress: n, isDisabled: s, autoFocus: B, id: Q, style: U } = S;
46
+ const t = E.current;
47
+ t && (z ? t.setAttribute("aria-keyshortcuts", z) : t.removeAttribute("aria-keyshortcuts"));
48
+ }, [z]), y) {
49
+ const { onPress: t, isDisabled: s, autoFocus: w, id: U, style: Z } = S;
49
50
  return /* @__PURE__ */ e(
50
- C,
51
+ V,
51
52
  {
52
- href: g,
53
- target: k,
54
- rel: L,
55
- onPress: n,
53
+ href: y,
54
+ target: L,
55
+ rel: O,
56
+ onPress: t,
56
57
  isDisabled: s,
57
- autoFocus: B,
58
- id: Q,
59
- style: U,
58
+ autoFocus: w,
59
+ id: U,
60
+ style: Z,
60
61
  ref: D,
61
62
  ...K,
62
63
  "aria-label": S["aria-label"],
@@ -65,15 +66,15 @@ const J = G(function({ variant: a = "primary", tone: t, size: c, shape: m, iconS
65
66
  }
66
67
  );
67
68
  }
68
- return /* @__PURE__ */ e(V, { ...S, ...K, ref: D, isPending: o, className: b("alea-button alea-focus-ring", j), children: ee(x, (n, { isPending: s }) => F(n, s)) });
69
- }), ge = G(function({ shape: a = "circle", variant: t = "ghost", tooltip: c, children: m, className: d, ...i }, o) {
70
- const r = /* @__PURE__ */ e(J, { ...i, ref: o, variant: t, "data-icon-shape": a, "data-icon-only": !0, className: b("alea-icon-button", d), children: /* @__PURE__ */ e("span", { className: "alea-button-icon", "aria-hidden": "true", ...M(t, i.tone), children: m }) });
71
- return c ? /* @__PURE__ */ p(oe, { delay: 400, children: [
69
+ return /* @__PURE__ */ e(ee, { ...S, ...K, ref: D, isPending: o, className: b("alea-button alea-focus-ring", j), children: te(x, (t, { isPending: s }) => F(t, s)) });
70
+ }), Ne = G(function({ shape: a = "circle", variant: n = "ghost", tooltip: c, children: u, className: d, ...i }, o) {
71
+ const r = /* @__PURE__ */ e(J, { ...i, ref: o, variant: n, "data-icon-shape": a, "data-icon-only": !0, className: b("alea-icon-button", d), children: /* @__PURE__ */ e("span", { className: "alea-button-icon", "aria-hidden": "true", ...M(n, i.tone), children: u }) });
72
+ return c ? /* @__PURE__ */ p(re, { delay: 400, children: [
72
73
  r,
73
- /* @__PURE__ */ e(re, { children: i["aria-label"] })
74
+ /* @__PURE__ */ e(le, { children: i["aria-label"] })
74
75
  ] }) : r;
75
76
  });
76
- function Ne({ items: l, value: a, defaultValue: t, onChange: c, size: m = "md", className: d, ...i }) {
77
+ function ve({ items: l, value: a, defaultValue: n, onChange: c, size: u = "md", className: d, ...i }) {
77
78
  return /* @__PURE__ */ e(
78
79
  ne,
79
80
  {
@@ -81,34 +82,34 @@ function Ne({ items: l, value: a, defaultValue: t, onChange: c, size: m = "md",
81
82
  selectionMode: "single",
82
83
  disallowEmptySelection: !0,
83
84
  selectedKeys: a !== void 0 ? [a] : void 0,
84
- defaultSelectedKeys: t !== void 0 ? [t] : a === void 0 && l[0] ? [l[0].id] : void 0,
85
+ defaultSelectedKeys: n !== void 0 ? [n] : a === void 0 && l[0] ? [l[0].id] : void 0,
85
86
  onSelectionChange: (o) => {
86
87
  const r = [...o][0];
87
88
  r !== void 0 && (c == null || c(r));
88
89
  },
89
- "data-size": m,
90
+ "data-size": u,
90
91
  className: b("alea-segmented", d),
91
92
  children: l.map((o) => /* @__PURE__ */ p(W, { id: o.id, isDisabled: o.isDisabled, className: "alea-segmented-item alea-focus-ring", children: [
92
93
  /* @__PURE__ */ e("span", { className: "alea-segmented-label", children: o.label }),
93
- /* @__PURE__ */ e(te, { className: "alea-sel-indicator" })
94
+ /* @__PURE__ */ e(ae, { className: "alea-sel-indicator" })
94
95
  ] }, String(o.id)))
95
96
  }
96
97
  );
97
98
  }
98
- function ve({ size: l = "md", className: a, ...t }) {
99
- return /* @__PURE__ */ e(W, { ...t, "data-size": l, className: b("alea-toggle-button alea-focus-ring", a) });
99
+ function ye({ size: l = "md", className: a, ...n }) {
100
+ return /* @__PURE__ */ e(W, { ...n, "data-size": l, className: b("alea-toggle-button alea-focus-ring", a) });
100
101
  }
101
- function ye({ onConfirm: l, duration: a = 1200, hint: t, variant: c = "danger", className: m, children: d, ...i }) {
102
+ function Be({ onConfirm: l, duration: a = 1200, hint: n, variant: c = "danger", className: u, children: d, ...i }) {
102
103
  const o = q();
103
- t ?? (t = o.pressAndHold);
104
- const [r, f] = Z(!1), N = A(null), v = A(`alea-hold-${Math.random().toString(36).slice(2, 8)}`).current;
104
+ n ?? (n = o.pressAndHold);
105
+ const [r, m] = _(!1), N = A(null), v = A(`alea-hold-${Math.random().toString(36).slice(2, 8)}`).current;
105
106
  return I(() => {
106
- const u = N.current;
107
- if (!u) return;
108
- const g = (k) => {
109
- k.animationName === "alea-hold" && (f(!1), l());
107
+ const g = N.current;
108
+ if (!g) return;
109
+ const f = (y) => {
110
+ y.animationName === "alea-hold" && (m(!1), l());
110
111
  };
111
- return u.addEventListener("animationend", g), () => u.removeEventListener("animationend", g);
112
+ return g.addEventListener("animationend", f), () => g.removeEventListener("animationend", f);
112
113
  }, [l]), /* @__PURE__ */ p(Y, { children: [
113
114
  /* @__PURE__ */ e(
114
115
  J,
@@ -118,20 +119,20 @@ function ye({ onConfirm: l, duration: a = 1200, hint: t, variant: c = "danger",
118
119
  variant: c,
119
120
  "data-holding": r || void 0,
120
121
  "aria-describedby": v,
121
- onPressStart: () => f(!0),
122
- onPressEnd: () => f(!1),
123
- className: b("alea-hold", m),
122
+ onPressStart: () => m(!0),
123
+ onPressEnd: () => m(!1),
124
+ className: b("alea-hold", u),
124
125
  style: { "--alea-hold-duration": `${a}ms` },
125
126
  children: d
126
127
  }
127
128
  ),
128
- /* @__PURE__ */ e("span", { id: v, className: "alea-visually-hidden", children: t })
129
+ /* @__PURE__ */ e("span", { id: v, className: "alea-visually-hidden", children: n })
129
130
  ] });
130
131
  }
131
132
  export {
132
133
  J as Button,
133
- ye as HoldButton,
134
- ge as IconButton,
135
- Ne as SegmentedControl,
136
- ve as ToggleButton
134
+ Be as HoldButton,
135
+ Ne as IconButton,
136
+ ve as SegmentedControl,
137
+ ye as ToggleButton
137
138
  };
@@ -20,9 +20,11 @@ export declare function Card({ variant, padding, interactive, as, orientation, i
20
20
  export interface CardTitleProps extends HTMLAttributes<HTMLHeadingElement> {
21
21
  /** The heading element. Default h3; match the page outline. */
22
22
  as?: ElementType;
23
+ /** md (default): the large display title. sm: the compact title of a card header (16 px, semibold), for cards in a settings page or a dense layout. */
24
+ size?: 'sm' | 'md';
23
25
  }
24
26
  /** Card title in Crimson Pro. */
25
- export declare function CardTitle({ as, className, ...props }: CardTitleProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
27
+ export declare function CardTitle({ as, size, className, ...props }: CardTitleProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
26
28
  /** Card body text, muted. */
27
29
  export declare function CardDescription({ className, ...props }: HTMLAttributes<HTMLParagraphElement>): import("react").JSX.Element;
28
30
  /** Makes the whole card clickable through one real link (keeps one tab stop and the link text as the name). */
@@ -38,10 +40,12 @@ export interface CardHeaderProps {
38
40
  actions?: ReactNode;
39
41
  /** Heading level of the title. Default 3. */
40
42
  headingLevel?: 2 | 3 | 4 | 5;
43
+ /** Size of the title: sm (14 px), md (16 px, default) or lg (20 px). All semibold. */
44
+ titleSize?: 'sm' | 'md' | 'lg';
41
45
  className?: string;
42
46
  }
43
47
  /** The top of a card: media, title, subtitle and actions. */
44
- export declare function CardHeader({ title, subtitle, media, actions, headingLevel, className }: CardHeaderProps): import("react").JSX.Element;
48
+ export declare function CardHeader({ title, subtitle, media, actions, headingLevel, titleSize, className }: CardHeaderProps): import("react").JSX.Element;
45
49
  export interface CardMediaProps {
46
50
  /** The image URL, or your own media as children. */
47
51
  src?: string;
@@ -1,40 +1,40 @@
1
1
  "use client";
2
- import { jsx as r, jsxs as c } from "react/jsx-runtime";
3
- import { createElement as n } from "react";
4
- import { cx as d } from "../../utils/cx.js";
2
+ import { jsx as r, jsxs as n } from "react/jsx-runtime";
3
+ import { createElement as o } from "react";
4
+ import { cx as s } from "../../utils/cx.js";
5
5
  import { surfaceAttrs as f } from "../surface/Surface.js";
6
- function g({ variant: e = "default", padding: a = "normal", interactive: t, as: i = "div", orientation: l, isLoading: s, surface: o, radius: m, className: h, children: u, ...p }) {
7
- const N = s ? /* @__PURE__ */ c("div", { className: "alea-card-loading", "aria-hidden": "true", children: [
6
+ function g({ variant: e = "default", padding: a = "normal", interactive: d, as: t = "div", orientation: c, isLoading: i, surface: l, radius: m, className: h, children: u, ...p }) {
7
+ const N = i ? /* @__PURE__ */ n("div", { className: "alea-card-loading", "aria-hidden": "true", children: [
8
8
  /* @__PURE__ */ r("span", { className: "alea-skeleton", "data-shape": "rect", style: { height: 120 } }),
9
9
  /* @__PURE__ */ r("span", { className: "alea-skeleton", "data-shape": "text", style: { width: "70%" } }),
10
10
  /* @__PURE__ */ r("span", { className: "alea-skeleton", "data-shape": "text", style: { width: "45%" } })
11
11
  ] }) : u;
12
- return n(i, { ...p, "aria-busy": s || void 0, className: d("alea-card", h), "data-variant": e, "data-padding": a, "data-interactive": t || void 0, "data-orientation": l, ...f({ surface: o, radius: m }) }, N);
12
+ return o(t, { ...p, "aria-busy": i || void 0, className: s("alea-card", h), "data-variant": e, "data-padding": a, "data-interactive": d || void 0, "data-orientation": c, ...f({ surface: l, radius: m }) }, N);
13
13
  }
14
- function k({ as: e = "h3", className: a, ...t }) {
15
- return n(e, { ...t, className: d("alea-card-title", a) });
14
+ function k({ as: e = "h3", size: a, className: d, ...t }) {
15
+ return o(e, { ...t, className: s("alea-card-title", d), "data-size": a === "sm" ? "sm" : void 0 });
16
16
  }
17
17
  function j({ className: e, ...a }) {
18
- return /* @__PURE__ */ r("p", { ...a, className: d("alea-card-description", e) });
18
+ return /* @__PURE__ */ r("p", { ...a, className: s("alea-card-description", e) });
19
19
  }
20
20
  function w({ className: e, ...a }) {
21
- return /* @__PURE__ */ r("a", { ...a, className: d("alea-card-link alea-focus-ring", e) });
21
+ return /* @__PURE__ */ r("a", { ...a, className: s("alea-card-link alea-focus-ring", e) });
22
22
  }
23
- function b({ title: e, subtitle: a, media: t, actions: i, headingLevel: l = 3, className: s }) {
24
- return /* @__PURE__ */ c("div", { className: d("alea-card-header", s), children: [
25
- t && /* @__PURE__ */ r("span", { className: "alea-card-header-media", children: t }),
26
- /* @__PURE__ */ c("div", { className: "alea-card-header-text", children: [
27
- n(`h${l}`, { className: "alea-card-title" }, e),
23
+ function b({ title: e, subtitle: a, media: d, actions: t, headingLevel: c = 3, titleSize: i, className: l }) {
24
+ return /* @__PURE__ */ n("div", { className: s("alea-card-header", l), children: [
25
+ d && /* @__PURE__ */ r("span", { className: "alea-card-header-media", children: d }),
26
+ /* @__PURE__ */ n("div", { className: "alea-card-header-text", children: [
27
+ o(`h${c}`, { className: "alea-card-title", "data-size": i && i !== "md" ? i : void 0 }, e),
28
28
  a && /* @__PURE__ */ r("p", { className: "alea-card-description", children: a })
29
29
  ] }),
30
- i && /* @__PURE__ */ r("div", { className: "alea-card-header-actions", children: i })
30
+ t && /* @__PURE__ */ r("div", { className: "alea-card-header-actions", children: t })
31
31
  ] });
32
32
  }
33
- function z({ src: e, alt: a = "", ratio: t = 16 / 9, children: i, className: l }) {
34
- return /* @__PURE__ */ r("div", { className: d("alea-card-media", l), style: { aspectRatio: String(t) }, children: i ?? /* @__PURE__ */ r("img", { src: e, alt: a, loading: "lazy" }) });
33
+ function z({ src: e, alt: a = "", ratio: d = 16 / 9, children: t, className: c }) {
34
+ return /* @__PURE__ */ r("div", { className: s("alea-card-media", c), style: { aspectRatio: String(d) }, children: t ?? /* @__PURE__ */ r("img", { src: e, alt: a, loading: "lazy" }) });
35
35
  }
36
- function A({ children: e, className: a, divider: t = !0 }) {
37
- return /* @__PURE__ */ r("div", { className: d("alea-card-footer", a), "data-divider": t || void 0, children: e });
36
+ function A({ children: e, className: a, divider: d = !0 }) {
37
+ return /* @__PURE__ */ r("div", { className: s("alea-card-footer", a), "data-divider": d || void 0, children: e });
38
38
  }
39
39
  export {
40
40
  g as Card,
@@ -69,6 +69,10 @@ export interface MultiSelectProps extends Omit<HTMLAttributes<HTMLDivElement>, '
69
69
  showActions?: boolean;
70
70
  /** Disables every part of it. */
71
71
  isDisabled?: boolean;
72
+ /** Marks the field invalid: the trigger gets aria-invalid and the error text is its description. */
73
+ isInvalid?: boolean;
74
+ /** The error text, shown under the field while isInvalid. */
75
+ errorMessage?: ReactNode;
72
76
  /** How the popup enters and leaves: a preset (fade, scale, pop, slide-down, blur...), false for none, or options. */
73
77
  motion?: MotionProp;
74
78
  }
@@ -1,85 +1,86 @@
1
1
  "use client";
2
- import { jsxs as n, jsx as e, Fragment as X } from "react/jsx-runtime";
3
- import { useState as S, useRef as G, useEffect as J, useMemo as j, forwardRef as U, useId as Y } from "react";
4
- import { useFilter as O, ComboBox as Z, Input as _, Button as P, ListBox as R, ListBoxSection as ee, Header as ae, Collection as te, ListBoxItem as I, DialogTrigger as le, Dialog as se } from "react-aria-components";
2
+ import { jsxs as i, jsx as a, Fragment as X } from "react/jsx-runtime";
3
+ import { useState as k, useRef as G, useEffect as J, useMemo as V, forwardRef as U, useId as Y } from "react";
4
+ import { useFilter as K, ComboBox as Z, Input as _, Button as O, ListBox as P, ListBoxSection as ee, Header as ae, Collection as te, ListBoxItem as q, DialogTrigger as le, Dialog as se } from "react-aria-components";
5
5
  import { Search as ie, X as ne, Clock as oe, ChevronDown as re, Check as ce } from "lucide-react";
6
- import { cx as q } from "../../utils/cx.js";
7
- import { Label as de, Description as pe, SearchField as me } from "../field/Field.js";
8
- import { Popover as H } from "../overlay/Overlay.js";
9
- import { Spinner as ue } from "../feedback/Spinner.js";
10
- import { loadingAttrs as he } from "../field/FieldLoading.js";
6
+ import { cx as H } from "../../utils/cx.js";
7
+ import { useAriaInvalid as de } from "../../utils/refs.js";
8
+ import { Label as pe, Description as me, SearchField as ue } from "../field/Field.js";
9
+ import { Popover as I } from "../overlay/Overlay.js";
10
+ import { Spinner as he } from "../feedback/Spinner.js";
11
+ import { loadingAttrs as fe } from "../field/FieldLoading.js";
11
12
  import { useStrings as Q } from "../../i18n/strings.js";
12
- import { OptionMatchContext as fe, MatchedText as K } from "./Highlight.js";
13
- import { Highlight as Fe, getMatchRanges as Le } from "./Highlight.js";
14
- function Ae({ motion: D, label: T, description: o, placeholder: b, items: h, loadItems: m, debounce: B = 250, recent: c, isLoading: F, highlightMatch: L = !0, matchStyle: E, onSelect: f, onSubmit: v, minChars: y = 1, className: V }) {
15
- const s = Q();
16
- b ?? (b = s.search);
17
- const [i, x] = S(""), [w, g] = S([]), [$, C] = S(!1), d = $ || !!F, { contains: k } = O({ sensitivity: "base" }), r = G(null);
13
+ import { OptionMatchContext as ge, MatchedText as D } from "./Highlight.js";
14
+ import { Highlight as Me, getMatchRanges as Ee } from "./Highlight.js";
15
+ function $e({ motion: j, label: A, description: o, placeholder: x, items: N, loadItems: h, debounce: z = 250, recent: p, isLoading: S, highlightMatch: T = !0, matchStyle: $, onSelect: b, onSubmit: m, minChars: f = 1, className: M }) {
16
+ const r = Q();
17
+ x ?? (x = r.search);
18
+ const [l, s] = k(""), [E, B] = k([]), [w, g] = k(!1), v = w || !!S, { contains: F } = K({ sensitivity: "base" }), y = G(null);
18
19
  J(() => {
19
- if (!m) return;
20
- if (i.trim().length < y) {
21
- g([]), C(!1);
20
+ if (!h) return;
21
+ if (l.trim().length < f) {
22
+ B([]), g(!1);
22
23
  return;
23
24
  }
24
- C(!0);
25
- const a = setTimeout(async () => {
26
- var z;
27
- (z = r.current) == null || z.abort();
28
- const l = new AbortController();
29
- r.current = l;
25
+ g(!0);
26
+ const t = setTimeout(async () => {
27
+ var d;
28
+ (d = y.current) == null || d.abort();
29
+ const e = new AbortController();
30
+ y.current = e;
30
31
  try {
31
- const A = await m(i, l.signal);
32
- l.signal.aborted || g(A);
32
+ const C = await h(l, e.signal);
33
+ e.signal.aborted || B(C);
33
34
  } catch {
34
35
  } finally {
35
- l.signal.aborted || C(!1);
36
+ e.signal.aborted || g(!1);
36
37
  }
37
- }, B);
38
- return () => clearTimeout(a);
39
- }, [i, m, B, y]);
40
- const p = !i && (c == null ? void 0 : c.length), u = p ? c : m ? w : i.trim().length < y ? [] : (h || []).filter((a) => k(a.label, i) || a.description && k(a.description, i)), N = j(() => {
41
- const a = [];
42
- for (const l of u) {
43
- const z = p ? s.recent : l.group || "";
44
- let A = a.find((W) => W.id === z);
45
- A || a.push(A = { id: z, items: [] }), A.items.push(l);
38
+ }, z);
39
+ return () => clearTimeout(t);
40
+ }, [l, h, z, f]);
41
+ const c = !l && (p == null ? void 0 : p.length), n = c ? p : h ? E : l.trim().length < f ? [] : (N || []).filter((t) => F(t.label, l) || t.description && F(t.description, l)), R = V(() => {
42
+ const t = [];
43
+ for (const e of n) {
44
+ const d = c ? r.recent : e.group || "";
45
+ let C = t.find((W) => W.id === d);
46
+ C || t.push(C = { id: d, items: [] }), C.items.push(e);
46
47
  }
47
- return a;
48
- }, [u, p]), t = j(() => new Map(u.map((a) => [a.id, a])), [u]), M = j(() => ({ query: p ? "" : i, style: E ?? "tint", match: "words" }), [i, E, p]);
49
- return /* @__PURE__ */ n(
48
+ return t;
49
+ }, [n, c]), L = V(() => new Map(n.map((t) => [t.id, t])), [n]), u = V(() => ({ query: c ? "" : l, style: $ ?? "tint", match: "words" }), [l, $, c]);
50
+ return /* @__PURE__ */ i(
50
51
  Z,
51
52
  {
52
- className: q("alea-field alea-autocomplete", V),
53
- ...he(d),
54
- items: N,
55
- inputValue: i,
56
- onInputChange: x,
53
+ className: H("alea-field alea-autocomplete", M),
54
+ ...fe(v),
55
+ items: R,
56
+ inputValue: l,
57
+ onInputChange: s,
57
58
  selectedKey: null,
58
59
  allowsCustomValue: !0,
59
60
  allowsEmptyCollection: !0,
60
61
  menuTrigger: "focus",
61
- onSelectionChange: (a) => {
62
- const l = a != null ? t.get(a) : void 0;
63
- l && (x(l.label), f == null || f(l));
62
+ onSelectionChange: (t) => {
63
+ const e = t != null ? L.get(t) : void 0;
64
+ e && (s(e.label), b == null || b(e));
64
65
  },
65
- onKeyDown: (a) => {
66
- a.key === "Enter" && !a.target.getAttribute("aria-activedescendant") && (v == null || v(i));
66
+ onKeyDown: (t) => {
67
+ t.key === "Enter" && !t.target.getAttribute("aria-activedescendant") && (m == null || m(l));
67
68
  },
68
69
  children: [
69
- T && /* @__PURE__ */ e(de, { children: T }),
70
- /* @__PURE__ */ n("div", { className: "alea-input-wrap", children: [
71
- /* @__PURE__ */ e("span", { className: "alea-input-affix", "data-side": "start", "aria-hidden": "true", children: /* @__PURE__ */ e(ie, { size: 16 }) }),
72
- /* @__PURE__ */ e(_, { className: "alea-input", placeholder: b, "aria-busy": d || void 0 }),
73
- d ? /* @__PURE__ */ e("span", { className: "alea-autocomplete-spin", children: /* @__PURE__ */ e(ue, { size: "sm", "aria-label": s.loadingSuggestions }) }) : i ? /* @__PURE__ */ e(P, { className: "alea-input-clear alea-focus-ring", "aria-label": s.clear, onPress: () => x(""), children: /* @__PURE__ */ e(ne, { size: 14 }) }) : null
70
+ A && /* @__PURE__ */ a(pe, { children: A }),
71
+ /* @__PURE__ */ i("div", { className: "alea-input-wrap", children: [
72
+ /* @__PURE__ */ a("span", { className: "alea-input-affix", "data-side": "start", "aria-hidden": "true", children: /* @__PURE__ */ a(ie, { size: 16 }) }),
73
+ /* @__PURE__ */ a(_, { className: "alea-input", placeholder: x, "aria-busy": v || void 0 }),
74
+ v ? /* @__PURE__ */ a("span", { className: "alea-autocomplete-spin", children: /* @__PURE__ */ a(he, { size: "sm", "aria-label": r.loadingSuggestions }) }) : l ? /* @__PURE__ */ a(O, { className: "alea-input-clear alea-focus-ring", "aria-label": r.clear, onPress: () => s(""), children: /* @__PURE__ */ a(ne, { size: 14 }) }) : null
74
75
  ] }),
75
- o && /* @__PURE__ */ e(pe, { children: o }),
76
- /* @__PURE__ */ e(H, { className: "alea-popover alea-select-popover", motion: D, children: /* @__PURE__ */ e(fe.Provider, { value: M, children: /* @__PURE__ */ e(R, { className: "alea-listbox", renderEmptyState: () => /* @__PURE__ */ e("p", { className: "alea-listbox-empty", children: d ? s.searching : i ? s.nothingFor(i) : s.startTyping }), children: (a) => /* @__PURE__ */ n(ee, { id: a.id, className: "alea-option-section", children: [
77
- a.id && /* @__PURE__ */ e(ae, { className: "alea-option-header", children: a.id }),
78
- /* @__PURE__ */ e(te, { items: a.items, children: (l) => /* @__PURE__ */ n(I, { id: l.id, textValue: l.label, className: "alea-option", children: [
79
- p ? /* @__PURE__ */ e(oe, { size: 16, className: "alea-option-icon", "aria-hidden": "true" }) : l.icon && /* @__PURE__ */ e("span", { className: "alea-option-icon", "aria-hidden": "true", children: l.icon }),
80
- /* @__PURE__ */ n("span", { className: "alea-option-text", children: [
81
- /* @__PURE__ */ e("span", { children: L ? /* @__PURE__ */ e(K, { text: l.label }) : l.label }),
82
- l.description && /* @__PURE__ */ e("span", { className: "alea-option-desc", children: L ? /* @__PURE__ */ e(K, { text: l.description }) : l.description })
76
+ o && /* @__PURE__ */ a(me, { children: o }),
77
+ /* @__PURE__ */ a(I, { className: "alea-popover alea-select-popover", motion: j, children: /* @__PURE__ */ a(ge.Provider, { value: u, children: /* @__PURE__ */ a(P, { className: "alea-listbox", renderEmptyState: () => /* @__PURE__ */ a("p", { className: "alea-listbox-empty", children: v ? r.searching : l ? r.nothingFor(l) : r.startTyping }), children: (t) => /* @__PURE__ */ i(ee, { id: t.id, className: "alea-option-section", children: [
78
+ t.id && /* @__PURE__ */ a(ae, { className: "alea-option-header", children: t.id }),
79
+ /* @__PURE__ */ a(te, { items: t.items, children: (e) => /* @__PURE__ */ i(q, { id: e.id, textValue: e.label, className: "alea-option", children: [
80
+ c ? /* @__PURE__ */ a(oe, { size: 16, className: "alea-option-icon", "aria-hidden": "true" }) : e.icon && /* @__PURE__ */ a("span", { className: "alea-option-icon", "aria-hidden": "true", children: e.icon }),
81
+ /* @__PURE__ */ i("span", { className: "alea-option-text", children: [
82
+ /* @__PURE__ */ a("span", { children: T ? /* @__PURE__ */ a(D, { text: e.label }) : e.label }),
83
+ e.description && /* @__PURE__ */ a("span", { className: "alea-option-desc", children: T ? /* @__PURE__ */ a(D, { text: e.description }) : e.description })
83
84
  ] })
84
85
  ] }) })
85
86
  ] }) }) }) })
@@ -87,40 +88,41 @@ function Ae({ motion: D, label: T, description: o, placeholder: b, items: h, loa
87
88
  }
88
89
  );
89
90
  }
90
- const Se = U(function({ motion: T, label: o, description: b, items: h, value: m, defaultValue: B = [], onChange: c, placeholder: F, searchable: L, showActions: E = !0, isDisabled: f, className: v, ...y }, V) {
91
+ const Be = U(function({ motion: A, label: o, description: x, items: N, value: h, defaultValue: z = [], onChange: p, placeholder: S, searchable: T, showActions: $ = !0, isDisabled: b, isInvalid: m, errorMessage: f, className: M, ...r }, l) {
91
92
  const s = Q();
92
- F ?? (F = s.selectPlaceholder);
93
- const [i, x] = S(B), w = m ?? i, [g, $] = S(""), { contains: C } = O({ sensitivity: "base" }), d = (t) => {
94
- m === void 0 && x(t), c == null || c(t);
95
- }, k = h.filter((t) => C(t.label, g)), r = h.filter((t) => w.includes(t.id)).map((t) => t.label), p = r.length ? r.length <= 2 ? r.join(", ") : `${r.slice(0, 2).join(", ")} +${r.length - 2}` : F, u = L ?? h.length > 8, N = "alea-ms" + Y().replace(/:/g, "");
96
- return /* @__PURE__ */ n("div", { ref: V, ...y, className: q("alea-field alea-multiselect", v), "data-disabled": f || void 0, children: [
97
- o && /* @__PURE__ */ e("span", { className: "alea-label", id: N, children: o }),
98
- /* @__PURE__ */ n(le, { children: [
99
- /* @__PURE__ */ n(P, { className: "alea-select-trigger alea-focus-ring", "aria-labelledby": o ? `${N} ${N}-v` : void 0, isDisabled: f, children: [
100
- /* @__PURE__ */ e("span", { id: `${N}-v`, className: "alea-select-value", "data-placeholder": !r.length || void 0, children: p }),
101
- /* @__PURE__ */ e(re, { size: 16, "aria-hidden": "true", className: "alea-select-chevron" })
93
+ S ?? (S = s.selectPlaceholder);
94
+ const [E, B] = k(z), w = h ?? E, [g, v] = k(""), { contains: F } = K({ sensitivity: "base" }), y = (e) => {
95
+ h === void 0 && B(e), p == null || p(e);
96
+ }, c = N.filter((e) => F(e.label, g)), n = N.filter((e) => w.includes(e.id)).map((e) => e.label), R = n.length ? n.length <= 2 ? n.join(", ") : `${n.slice(0, 2).join(", ")} +${n.length - 2}` : S, L = T ?? N.length > 8, u = "alea-ms" + Y().replace(/:/g, ""), t = de(!!m);
97
+ return /* @__PURE__ */ i("div", { ref: l, ...r, className: H("alea-field alea-multiselect", M), "data-disabled": b || void 0, "data-invalid": m || void 0, children: [
98
+ o && /* @__PURE__ */ a("span", { className: "alea-label", id: u, children: o }),
99
+ /* @__PURE__ */ i(le, { children: [
100
+ /* @__PURE__ */ i(O, { ref: t, className: "alea-select-trigger alea-focus-ring", "aria-labelledby": o ? `${u} ${u}-v` : void 0, "aria-describedby": m && f ? `${u}-err` : void 0, isDisabled: b, children: [
101
+ /* @__PURE__ */ a("span", { id: `${u}-v`, className: "alea-select-value", "data-placeholder": !n.length || void 0, children: R }),
102
+ /* @__PURE__ */ a(re, { size: 16, "aria-hidden": "true", className: "alea-select-chevron" })
102
103
  ] }),
103
- /* @__PURE__ */ e(H, { className: "alea-popover alea-select-popover", placement: "bottom start", motion: T, children: /* @__PURE__ */ n(se, { "aria-label": typeof o == "string" ? o : s.options, className: "alea-multiselect-dialog", children: [
104
- u && /* @__PURE__ */ e(me, { "aria-label": s.filterOptions, size: "sm", value: g, onChange: $, autoFocus: !0 }),
105
- E && /* @__PURE__ */ n("div", { className: "alea-multiselect-actions", children: [
106
- /* @__PURE__ */ e("button", { type: "button", className: "alea-link alea-focus-ring", "data-variant": "standalone", onClick: () => d(Array.from(/* @__PURE__ */ new Set([...w, ...k.map((t) => t.id)]))), children: g ? s.selectAllShown : s.selectAll }),
107
- /* @__PURE__ */ e("button", { type: "button", className: "alea-link alea-focus-ring", "data-variant": "muted", onClick: () => d([]), children: s.clear })
104
+ /* @__PURE__ */ a(I, { className: "alea-popover alea-select-popover", placement: "bottom start", motion: A, children: /* @__PURE__ */ i(se, { "aria-label": typeof o == "string" ? o : s.options, className: "alea-multiselect-dialog", children: [
105
+ L && /* @__PURE__ */ a(ue, { "aria-label": s.filterOptions, size: "sm", value: g, onChange: v, autoFocus: !0 }),
106
+ $ && /* @__PURE__ */ i("div", { className: "alea-multiselect-actions", children: [
107
+ /* @__PURE__ */ a("button", { type: "button", className: "alea-link alea-focus-ring", "data-variant": "standalone", onClick: () => y(Array.from(/* @__PURE__ */ new Set([...w, ...c.map((e) => e.id)]))), children: g ? s.selectAllShown : s.selectAll }),
108
+ /* @__PURE__ */ a("button", { type: "button", className: "alea-link alea-focus-ring", "data-variant": "muted", onClick: () => y([]), children: s.clear })
108
109
  ] }),
109
- /* @__PURE__ */ e(R, { "aria-label": typeof o == "string" ? o : s.options, escapeKeyBehavior: "none", items: k, selectionMode: "multiple", selectedKeys: w, onSelectionChange: (t) => d(t === "all" ? h.map((M) => M.id) : [...t]), className: "alea-listbox alea-multiselect-list", autoFocus: !u, renderEmptyState: () => /* @__PURE__ */ e("p", { className: "alea-listbox-empty", children: s.noMatches }), children: (t) => /* @__PURE__ */ e(I, { id: t.id, textValue: t.label, className: "alea-option", children: ({ isSelected: M }) => /* @__PURE__ */ n(X, { children: [
110
- /* @__PURE__ */ e("span", { className: "alea-check-box alea-ms-box", "data-on": M || void 0, "aria-hidden": "true", children: /* @__PURE__ */ e(ce, { size: 12, strokeWidth: 3 }) }),
111
- /* @__PURE__ */ n("span", { className: "alea-option-text", children: [
112
- /* @__PURE__ */ e("span", { children: t.label }),
113
- t.description && /* @__PURE__ */ e("span", { className: "alea-option-desc", children: t.description })
110
+ /* @__PURE__ */ a(P, { "aria-label": typeof o == "string" ? o : s.options, escapeKeyBehavior: "none", items: c, selectionMode: "multiple", selectedKeys: w, onSelectionChange: (e) => y(e === "all" ? N.map((d) => d.id) : [...e]), className: "alea-listbox alea-multiselect-list", autoFocus: !L, renderEmptyState: () => /* @__PURE__ */ a("p", { className: "alea-listbox-empty", children: s.noMatches }), children: (e) => /* @__PURE__ */ a(q, { id: e.id, textValue: e.label, className: "alea-option", children: ({ isSelected: d }) => /* @__PURE__ */ i(X, { children: [
111
+ /* @__PURE__ */ a("span", { className: "alea-check-box alea-ms-box", "data-on": d || void 0, "aria-hidden": "true", children: /* @__PURE__ */ a(ce, { size: 12, strokeWidth: 3 }) }),
112
+ /* @__PURE__ */ i("span", { className: "alea-option-text", children: [
113
+ /* @__PURE__ */ a("span", { children: e.label }),
114
+ e.description && /* @__PURE__ */ a("span", { className: "alea-option-desc", children: e.description })
114
115
  ] })
115
116
  ] }) }) })
116
117
  ] }) })
117
118
  ] }),
118
- b && /* @__PURE__ */ e("span", { className: "alea-description", children: b })
119
+ x && /* @__PURE__ */ a("span", { className: "alea-description", children: x }),
120
+ m && f && /* @__PURE__ */ a("span", { id: `${u}-err`, className: "alea-field-error", children: f })
119
121
  ] });
120
122
  });
121
123
  export {
122
- Ae as Autocomplete,
123
- Fe as Highlight,
124
- Se as MultiSelect,
125
- Le as getMatchRanges
124
+ $e as Autocomplete,
125
+ Me as Highlight,
126
+ Be as MultiSelect,
127
+ Ee as getMatchRanges
126
128
  };
@@ -27,6 +27,16 @@ export interface CommandPaletteProps extends SurfaceProps {
27
27
  onOpenChange?: (open: boolean) => void;
28
28
  /** Opens with ⌘K / Ctrl+K anywhere. Default true. */
29
29
  hotkey?: boolean;
30
+ /** Also opens with the "/" key, unless the person is typing in a field. Default false. */
31
+ slashHotkey?: boolean;
32
+ /** Called with the text in the search field on every change (and with "" when the palette closes). Use it to search a server: update `commands` with the results, show `isLoading` meanwhile and set `filter={false}`. */
33
+ onQueryChange?: (query: string) => void;
34
+ /** Your own match for the typed text. Default: the label and keywords contain the text, ignoring case and accents ("operacion" finds "Operación"). `false` shows every command as given, for results that are already filtered. */
35
+ filter?: ((command: Command, query: string) => boolean) | false;
36
+ /** Shows a loading line in the list (and marks it busy for screen readers) while results are on their way. */
37
+ isLoading?: boolean;
38
+ /** Shows at most this many commands per group, followed by a "Show N more" row that opens the rest of that group. */
39
+ maxPerGroup?: number;
30
40
  /** Shown in the search field. Default "Type a command or search…". */
31
41
  placeholder?: string;
32
42
  /** Shown when nothing matches. */