@actioneer/ads 0.6.0 → 0.7.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 (112) hide show
  1. package/components/ai-elements/agent-trace.d.ts +2 -2
  2. package/components/ai-elements/agent-trace.js +163 -104
  3. package/components/ai-elements/chain-of-thought.d.ts +2 -2
  4. package/components/ai-elements/chain-of-thought.js +1 -1
  5. package/components/ai-elements/index.d.ts +0 -5
  6. package/components/ai-elements/inline-citation.js +1 -1
  7. package/components/alert.d.ts +6 -6
  8. package/components/alert.js +89 -53
  9. package/components/answer-sources.d.ts +2 -6
  10. package/components/answer-sources.js +58 -60
  11. package/components/answer.d.ts +5 -0
  12. package/components/answer.js +311 -271
  13. package/components/assistant-ui/composer-harness.js +15 -20
  14. package/components/assistant-ui/composer.d.ts +3 -1
  15. package/components/assistant-ui/composer.js +148 -144
  16. package/components/assistant-ui/index.d.ts +0 -3
  17. package/components/assistant-ui/thread-context.d.ts +3 -1
  18. package/components/assistant-ui/thread.js +50 -42
  19. package/components/avatar.js +42 -42
  20. package/components/badge.d.ts +5 -6
  21. package/components/badge.js +13 -76
  22. package/components/body-page-header.d.ts +15 -0
  23. package/components/body-page-header.js +24 -0
  24. package/components/brand-loader.d.ts +0 -3
  25. package/components/brand-loader.js +10 -32
  26. package/components/breadcrumbs.d.ts +0 -7
  27. package/components/breadcrumbs.js +54 -71
  28. package/components/button.d.ts +1 -1
  29. package/components/button.js +55 -49
  30. package/components/chart.js +298 -296
  31. package/components/chip.d.ts +13 -1
  32. package/components/chip.js +93 -80
  33. package/components/collection-header.d.ts +17 -0
  34. package/components/collection-header.js +31 -0
  35. package/components/connector-card.d.ts +6 -6
  36. package/components/connector-card.js +31 -32
  37. package/components/date-range-picker.d.ts +2 -1
  38. package/components/date-range-picker.js +158 -122
  39. package/components/drawer.d.ts +19 -3
  40. package/components/drawer.js +109 -100
  41. package/components/dropdown.d.ts +1 -2
  42. package/components/dropdown.js +88 -89
  43. package/components/field.js +39 -34
  44. package/components/file-dropzone.js +1 -1
  45. package/components/index.d.ts +4 -4
  46. package/components/index.js +499 -546
  47. package/components/infinite-canvas.js +24 -24
  48. package/components/input-field.d.ts +18 -3
  49. package/components/input-field.js +88 -72
  50. package/components/input.js +16 -15
  51. package/components/modal.d.ts +31 -3
  52. package/components/modal.js +243 -169
  53. package/components/number-field.js +45 -42
  54. package/components/page-body.d.ts +12 -0
  55. package/components/page-body.js +18 -0
  56. package/components/pagination.js +36 -36
  57. package/components/select.d.ts +21 -0
  58. package/components/select.js +189 -148
  59. package/components/setting-row.d.ts +6 -5
  60. package/components/setting-row.js +33 -32
  61. package/components/sidebar.d.ts +2 -0
  62. package/components/sidebar.js +165 -155
  63. package/components/skeleton.js +8 -7
  64. package/components/slider.js +1 -1
  65. package/components/surface-loader.d.ts +11 -0
  66. package/components/surface-loader.js +35 -0
  67. package/components/table.d.ts +16 -10
  68. package/components/table.js +426 -410
  69. package/components/tabs.d.ts +2 -0
  70. package/components/tabs.js +159 -294
  71. package/components/textarea.js +9 -9
  72. package/components/toast.d.ts +1 -1
  73. package/components/toast.js +181 -118
  74. package/components/tree.d.ts +5 -1
  75. package/components/tree.js +54 -49
  76. package/components/typography.d.ts +4 -4
  77. package/components/typography.js +13 -13
  78. package/components/ui/button.d.ts +1 -1
  79. package/components/ui/dialog.js +33 -33
  80. package/demo/components/add-to-artifact.js +6 -10
  81. package/lib/cn.js +11 -4
  82. package/lib/icons.d.ts +4 -0
  83. package/lib/icons.js +107 -106
  84. package/lib/interactive.d.ts +1 -1
  85. package/llms.txt +95 -152
  86. package/manifest.json +1628 -2729
  87. package/package.json +1 -2
  88. package/styles.css +347 -223
  89. package/theme.css +303 -177
  90. package/components/agent-icon.d.ts +0 -76
  91. package/components/agent-icon.js +0 -265
  92. package/components/ai-elements/queue.d.ts +0 -60
  93. package/components/ai-elements/queue.js +0 -193
  94. package/components/ai-elements/speech-input.d.ts +0 -16
  95. package/components/ai-elements/speech-input.js +0 -151
  96. package/components/ai-elements/task-progress.d.ts +0 -41
  97. package/components/ai-elements/task-progress.js +0 -224
  98. package/components/ai-elements/task.d.ts +0 -39
  99. package/components/ai-elements/task.js +0 -105
  100. package/components/ai-elements/voice.d.ts +0 -90
  101. package/components/ai-elements/voice.js +0 -496
  102. package/components/assistant-ui/follow-up-suggestions.d.ts +0 -11
  103. package/components/assistant-ui/follow-up-suggestions.js +0 -72
  104. package/components/assistant-ui/suggestions.d.ts +0 -7
  105. package/components/assistant-ui/suggestions.js +0 -19
  106. package/components/assistant-ui/voice.d.ts +0 -18
  107. package/components/link.d.ts +0 -14
  108. package/components/link.js +0 -72
  109. package/components/navbar.d.ts +0 -15
  110. package/components/navbar.js +0 -68
  111. package/components/pixel-icon.d.ts +0 -37
  112. package/components/pixel-icon.js +0 -859
@@ -1,48 +1,48 @@
1
1
  "use client";
2
2
  import { jsxs as u, jsx as l } from "react/jsx-runtime";
3
3
  import * as j from "react";
4
- import { ChevronLeft as k, MoreHorizontal as L, ChevronRight as G } from "../lib/icons.js";
4
+ import { ChevronLeft as L, MoreHorizontal as k, ChevronRight as G } from "../lib/icons.js";
5
5
  import { cn as o } from "../lib/cn.js";
6
6
  import { Select as M } from "./select.js";
7
- function p(e, r) {
8
- const t = [];
9
- for (let i = e; i <= r; i += 1) t.push(i);
10
- return t;
7
+ function p(t, s) {
8
+ const e = [];
9
+ for (let r = t; r <= s; r += 1) e.push(r);
10
+ return e;
11
11
  }
12
- function E(e, r, t) {
13
- if (t * 2 + 5 >= e)
14
- return p(1, e);
15
- const m = Math.max(r - t, 1), s = Math.min(r + t, e), d = m > 2, a = s < e - 1;
12
+ function E(t, s, e) {
13
+ if (e * 2 + 5 >= t)
14
+ return p(1, t);
15
+ const m = Math.max(s - e, 1), i = Math.min(s + e, t), d = m > 2, a = i < t - 1;
16
16
  if (!d && a) {
17
- const c = t * 2 + 3;
18
- return [...p(1, c), "end-ellipsis", e];
17
+ const c = e * 2 + 3;
18
+ return [...p(1, c), "end-ellipsis", t];
19
19
  }
20
20
  if (d && !a) {
21
- const c = t * 2 + 3;
22
- return [1, "start-ellipsis", ...p(e - c + 1, e)];
21
+ const c = e * 2 + 3;
22
+ return [1, "start-ellipsis", ...p(t - c + 1, t)];
23
23
  }
24
24
  return [
25
25
  1,
26
26
  "start-ellipsis",
27
- ...p(m, s),
27
+ ...p(m, i),
28
28
  "end-ellipsis",
29
- e
29
+ t
30
30
  ];
31
31
  }
32
- const A = (e) => o(
32
+ const A = () => o(
33
33
  "inline-flex items-center justify-center rounded-md font-normal",
34
34
  "outline-none focus-visible:ring-3 focus-visible:ring-ring",
35
35
  "transition active:scale-[0.97] motion-reduce:transition-none motion-reduce:active:scale-100",
36
36
  "disabled:pointer-events-none disabled:opacity-40",
37
- e === "sm" ? "size-7 text-xs" : "size-9 text-xs"
38
- ), N = (e) => e === "sm" ? "w-auto gap-1.5 px-2" : "w-auto gap-1.5 px-2.5", F = j.forwardRef(
37
+ "size-6 text-xs"
38
+ ), N = (t) => t === "sm" ? "w-auto gap-1.5 px-2" : "w-auto gap-1.5 px-2.5", F = j.forwardRef(
39
39
  ({
40
- className: e,
41
- total: r,
42
- page: t,
43
- onChange: i,
40
+ className: t,
41
+ total: s,
42
+ page: e,
43
+ onChange: r,
44
44
  siblings: m = 1,
45
- size: s = "md",
45
+ size: i = "md",
46
46
  summary: d,
47
47
  labels: a = !1,
48
48
  pageSize: c,
@@ -50,8 +50,8 @@ const A = (e) => o(
50
50
  onPageSizeChange: g,
51
51
  ...C
52
52
  }, y) => {
53
- if (r <= 0) return null;
54
- const P = E(r, t, m), R = t <= 1, S = t >= r, f = A(s), x = s === "sm" ? "size-3.5" : "size-4", h = c != null && !!g, b = d != null || h;
53
+ if (s <= 0) return null;
54
+ const P = E(s, e, m), R = e <= 1, S = e >= s, f = A(), x = i === "sm" ? "size-3.5" : "size-4", h = c != null && !!g, b = d != null || h;
55
55
  return /* @__PURE__ */ u(
56
56
  "nav",
57
57
  {
@@ -60,7 +60,7 @@ const A = (e) => o(
60
60
  className: o(
61
61
  "flex items-center",
62
62
  b ? "w-full justify-between gap-4" : "gap-1",
63
- e
63
+ t
64
64
  ),
65
65
  ...C,
66
66
  children: [
@@ -88,7 +88,7 @@ const A = (e) => o(
88
88
  M,
89
89
  {
90
90
  size: "sm",
91
- className: "w-18",
91
+ className: "w-18 text-s font-normal",
92
92
  placement: "top",
93
93
  items: (w ?? [8, 16, 32]).map((n) => ({
94
94
  label: String(n),
@@ -108,14 +108,14 @@ const A = (e) => o(
108
108
  type: "button",
109
109
  "aria-label": "Go to previous page",
110
110
  disabled: R,
111
- onClick: () => i(t - 1),
111
+ onClick: () => r(e - 1),
112
112
  className: o(
113
113
  f,
114
114
  "text-foreground hover:bg-muted",
115
- a && N(s)
115
+ a && N(i)
116
116
  ),
117
117
  children: [
118
- /* @__PURE__ */ l(k, { className: x, "aria-hidden": !0 }),
118
+ /* @__PURE__ */ l(L, { className: x, "aria-hidden": !0 }),
119
119
  a && "Prev"
120
120
  ]
121
121
  }
@@ -127,21 +127,21 @@ const A = (e) => o(
127
127
  {
128
128
  "aria-hidden": !0,
129
129
  className: o(f, "text-muted-foreground"),
130
- children: /* @__PURE__ */ l(L, { className: x })
130
+ children: /* @__PURE__ */ l(k, { className: x })
131
131
  },
132
132
  n
133
133
  );
134
- const v = n === t;
134
+ const v = n === e;
135
135
  return /* @__PURE__ */ l(
136
136
  "button",
137
137
  {
138
138
  type: "button",
139
139
  "aria-label": `Go to page ${n}`,
140
140
  "aria-current": v ? "page" : void 0,
141
- onClick: () => i(n),
141
+ onClick: () => r(n),
142
142
  className: o(
143
143
  f,
144
- v ? "bg-foreground text-background" : "text-foreground hover:bg-muted"
144
+ v ? "bg-ng10 text-white" : "text-foreground hover:bg-muted"
145
145
  ),
146
146
  children: n
147
147
  },
@@ -154,11 +154,11 @@ const A = (e) => o(
154
154
  type: "button",
155
155
  "aria-label": "Go to next page",
156
156
  disabled: S,
157
- onClick: () => i(t + 1),
157
+ onClick: () => r(e + 1),
158
158
  className: o(
159
159
  f,
160
160
  "text-foreground hover:bg-muted",
161
- a && N(s)
161
+ a && N(i)
162
162
  ),
163
163
  children: [
164
164
  a && "Next",
@@ -8,6 +8,26 @@ export interface SelectItem {
8
8
  value: string;
9
9
  disabled?: boolean;
10
10
  }
11
+ export interface DropdownOptionsProps {
12
+ items: SelectItem[];
13
+ value?: string;
14
+ values?: string[];
15
+ multiple?: boolean;
16
+ activeIndex?: number;
17
+ onActiveIndexChange?: (index: number) => void;
18
+ onItemSelect?: (index: number) => void;
19
+ placement?: "top" | "bottom";
20
+ id?: string;
21
+ className?: string;
22
+ style?: React.CSSProperties;
23
+ "aria-label"?: string;
24
+ }
25
+ /**
26
+ * DropdownOptions — the reusable options surface composed by Select.
27
+ * It owns listbox semantics and the brand-green option interaction treatment;
28
+ * positioning and open/closed state stay with the parent Select.
29
+ */
30
+ export declare const DropdownOptions: React.ForwardRefExoticComponent<DropdownOptionsProps & React.RefAttributes<HTMLUListElement>>;
11
31
  export interface SelectProps extends VariantProps<typeof selectTriggerVariants> {
12
32
  items: SelectItem[];
13
33
  value?: string;
@@ -15,6 +35,7 @@ export interface SelectProps extends VariantProps<typeof selectTriggerVariants>
15
35
  multiple?: boolean;
16
36
  values?: string[];
17
37
  onValuesChange?: (values: string[]) => void;
38
+ /** Empty-state trigger copy. Defaults to "Select" and inherits tertiary text. */
18
39
  placeholder?: string;
19
40
  disabled?: boolean;
20
41
  isInvalid?: boolean;
@@ -1,73 +1,147 @@
1
1
  "use client";
2
- import { jsx as u, jsxs as k } from "react/jsx-runtime";
3
- import * as s from "react";
4
- import { createPortal as q } from "react-dom";
5
- import { cva as C } from "class-variance-authority";
6
- import { MotionConfig as F, AnimatePresence as G, motion as J } from "motion/react";
7
- import { Check as Q, ChevronDown as V } from "../lib/icons.js";
8
- import { cn as f } from "../lib/cn.js";
9
- import { inputBaseClass as W } from "./field.js";
10
- import { floatVariants as X } from "../lib/motion.js";
11
- import { Ripple as Y } from "./ripple.js";
12
- const Z = C(
13
- f(
14
- W,
15
- "items-center justify-between gap-2 text-left cursor-pointer",
2
+ import { jsxs as S, jsx as f } from "react/jsx-runtime";
3
+ import * as n from "react";
4
+ import { createPortal as F } from "react-dom";
5
+ import { cva as G } from "class-variance-authority";
6
+ import { motion as J, MotionConfig as Q, AnimatePresence as W } from "motion/react";
7
+ import { Check as X, ChevronDown as Y } from "../lib/icons.js";
8
+ import { cn as b } from "../lib/cn.js";
9
+ import { inputBaseClass as Z } from "./field.js";
10
+ import { floatVariants as C } from "../lib/motion.js";
11
+ import { Ripple as ee } from "./ripple.js";
12
+ const te = G(
13
+ b(
14
+ Z,
15
+ "group/select items-center justify-between gap-2 text-left leading-none cursor-pointer",
16
+ "data-[value-set]:text-on-white-primary!",
16
17
  "[&_svg]:pointer-events-none [&_svg]:shrink-0"
17
18
  ),
18
19
  {
19
20
  variants: {
20
21
  size: {
21
- sm: "h-8 rounded-sm text-xs",
22
- md: "h-10 rounded-md text-xs",
23
- lg: "h-11 rounded-md text-base"
22
+ sm: "h-8 rounded-sm",
23
+ md: "h-8 rounded-md",
24
+ lg: "h-11 rounded-md"
24
25
  }
25
26
  },
26
27
  defaultVariants: { size: "md" }
27
28
  }
28
- ), ee = s.forwardRef(
29
+ ), K = n.forwardRef(
29
30
  ({
30
31
  items: o,
31
- value: h,
32
- onChange: E,
32
+ value: w,
33
+ values: y = [],
33
34
  multiple: d = !1,
34
- values: l = [],
35
- onValuesChange: I,
36
- placeholder: R = "Select…",
37
- size: M,
38
- disabled: L,
39
- isInvalid: B,
40
- className: H,
41
- id: O,
42
- placement: m = "bottom",
43
- portal: p = !1,
44
- "aria-label": P,
45
- "aria-describedby": T
46
- }, _) => {
47
- const [r, b] = s.useState(!1), [c, N] = s.useState(-1), z = s.useRef(null), w = s.useRef(null), g = s.useId(), [i, S] = s.useState(null), D = o.find((e) => e.value === h), v = d ? o.filter((e) => l.includes(e.value)) : [], K = s.useCallback(() => {
48
- const e = d ? o.findIndex((t) => l.includes(t.value)) : o.findIndex((t) => t.value === h);
35
+ activeIndex: i = -1,
36
+ onActiveIndexChange: p,
37
+ onItemSelect: h,
38
+ placement: D = "bottom",
39
+ id: z,
40
+ className: $,
41
+ style: L,
42
+ "aria-label": j
43
+ }, x) => {
44
+ const m = n.useId(), v = z ?? m;
45
+ return /* @__PURE__ */ S(
46
+ J.ul,
47
+ {
48
+ ref: x,
49
+ id: v,
50
+ role: "listbox",
51
+ "aria-label": j,
52
+ "aria-multiselectable": d || void 0,
53
+ "aria-activedescendant": i >= 0 ? `${v}-opt-${i}` : void 0,
54
+ variants: C,
55
+ initial: "hidden",
56
+ animate: "visible",
57
+ exit: "hidden",
58
+ style: {
59
+ transformOrigin: D === "top" ? "bottom" : "top",
60
+ ...L
61
+ },
62
+ className: b(
63
+ "pointer-events-auto min-w-[280px] max-h-60 overflow-auto p-1",
64
+ "rounded-md border border-input bg-elevated shadow-elevation",
65
+ $
66
+ ),
67
+ children: [
68
+ /* @__PURE__ */ f(ee, { origin: D === "top" ? "bottom" : "top" }),
69
+ o.map((s, g) => {
70
+ const r = d ? y.includes(s.value) : s.value === w, c = g === i;
71
+ return /* @__PURE__ */ S(
72
+ "li",
73
+ {
74
+ id: `${v}-opt-${g}`,
75
+ role: "option",
76
+ "aria-selected": r,
77
+ "aria-disabled": s.disabled || void 0,
78
+ onMouseEnter: () => !s.disabled && (p == null ? void 0 : p(g)),
79
+ onClick: () => !s.disabled && (h == null ? void 0 : h(g)),
80
+ className: b(
81
+ "flex cursor-pointer items-center justify-between gap-2",
82
+ "rounded-sm px-2 py-1.5 text-m font-medium text-foreground select-none",
83
+ !s.disabled && "hover:bg-action-primary-soft hover:text-action-primary-text",
84
+ c && !s.disabled && "bg-action-primary-soft text-action-primary-text",
85
+ r && "text-action-primary-text",
86
+ s.disabled && "pointer-events-none opacity-50"
87
+ ),
88
+ children: [
89
+ /* @__PURE__ */ f("span", { className: "truncate", children: s.label }),
90
+ r && /* @__PURE__ */ f(X, { className: "size-4 shrink-0", "aria-hidden": !0 })
91
+ ]
92
+ },
93
+ s.value
94
+ );
95
+ })
96
+ ]
97
+ }
98
+ );
99
+ }
100
+ );
101
+ K.displayName = "DropdownOptions";
102
+ const re = n.forwardRef(
103
+ ({
104
+ items: o,
105
+ value: w,
106
+ onChange: y,
107
+ multiple: d = !1,
108
+ values: i = [],
109
+ onValuesChange: p,
110
+ placeholder: h = "Select",
111
+ size: D,
112
+ disabled: z,
113
+ isInvalid: $,
114
+ className: L,
115
+ id: j,
116
+ placement: x = "bottom",
117
+ portal: m = !1,
118
+ "aria-label": v,
119
+ "aria-describedby": s
120
+ }, g) => {
121
+ const [r, c] = n.useState(!1), [k, M] = n.useState(-1), O = n.useRef(null), R = n.useRef(null), B = n.useId(), [l, H] = n.useState(null), A = o.find((e) => e.value === w), E = d ? o.filter((e) => i.includes(e.value)) : [], U = d ? E.length > 0 : !!A, V = n.useCallback(() => {
122
+ const e = d ? o.findIndex((t) => i.includes(t.value)) : o.findIndex((t) => t.value === w);
49
123
  return e >= 0 && !o[e].disabled ? e : o.findIndex((t) => !t.disabled);
50
- }, [o, d, h, l]);
51
- s.useEffect(() => {
124
+ }, [o, d, w, i]);
125
+ n.useEffect(() => {
52
126
  if (!r) return;
53
127
  const e = (t) => {
54
- var a, x;
55
- const n = t.target;
56
- (a = z.current) != null && a.contains(n) || (x = w.current) != null && x.contains(n) || b(!1);
128
+ var u, N;
129
+ const a = t.target;
130
+ (u = O.current) != null && u.contains(a) || (N = R.current) != null && N.contains(a) || c(!1);
57
131
  };
58
132
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
59
- }, [r]), s.useLayoutEffect(() => {
60
- if (!r || !p) {
61
- S(null);
133
+ }, [r]), n.useLayoutEffect(() => {
134
+ if (!r || !m) {
135
+ H(null);
62
136
  return;
63
137
  }
64
138
  const e = () => {
65
- var a, x;
66
- const t = (a = z.current) == null ? void 0 : a.getBoundingClientRect();
139
+ var u, N;
140
+ const t = (u = O.current) == null ? void 0 : u.getBoundingClientRect();
67
141
  if (!t) return;
68
- const n = ((x = w.current) == null ? void 0 : x.offsetHeight) ?? 0;
69
- S({
70
- top: m === "top" ? t.top - n - 6 : t.bottom + 6,
142
+ const a = ((N = R.current) == null ? void 0 : N.offsetHeight) ?? 0;
143
+ H({
144
+ top: x === "top" ? t.top - a - 6 : t.bottom + 6,
71
145
  left: t.left,
72
146
  width: t.width
73
147
  });
@@ -75,146 +149,112 @@ const Z = C(
75
149
  return e(), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
76
150
  window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
77
151
  };
78
- }, [r, m, p]), s.useEffect(() => {
152
+ }, [r, x, m]), n.useEffect(() => {
79
153
  var t;
80
- if (!r || c < 0) return;
81
- const e = (t = w.current) == null ? void 0 : t.children[c];
154
+ if (!r || k < 0) return;
155
+ const e = (t = R.current) == null ? void 0 : t.children[k];
82
156
  e == null || e.scrollIntoView({ block: "nearest" });
83
- }, [r, c]);
84
- const y = () => {
85
- L || (N(K()), b(!0));
86
- }, A = (e) => {
87
- N((t) => {
88
- let n = t;
89
- for (let a = 0; a < o.length; a++)
90
- if (n = (n + e + o.length) % o.length, !o[n].disabled) return n;
157
+ }, [r, k]);
158
+ const I = () => {
159
+ z || (M(V()), c(!0));
160
+ }, P = (e) => {
161
+ M((t) => {
162
+ let a = t;
163
+ for (let u = 0; u < o.length; u++)
164
+ if (a = (a + e + o.length) % o.length, !o[a].disabled) return a;
91
165
  return t;
92
166
  });
93
- }, $ = (e) => {
167
+ }, T = (e) => {
94
168
  const t = o[e];
95
169
  if (!(!t || t.disabled)) {
96
170
  if (d) {
97
- I == null || I(
98
- l.includes(t.value) ? l.filter((n) => n !== t.value) : [...l, t.value]
171
+ p == null || p(
172
+ i.includes(t.value) ? i.filter((a) => a !== t.value) : [...i, t.value]
99
173
  );
100
174
  return;
101
175
  }
102
- E == null || E(t.value), b(!1);
176
+ y == null || y(t.value), c(!1);
103
177
  }
104
- }, U = (e) => {
178
+ }, q = (e) => {
105
179
  switch (e.key) {
106
180
  case "ArrowDown":
107
- e.preventDefault(), r ? A(1) : y();
181
+ e.preventDefault(), r ? P(1) : I();
108
182
  break;
109
183
  case "ArrowUp":
110
- e.preventDefault(), r ? A(-1) : y();
184
+ e.preventDefault(), r ? P(-1) : I();
111
185
  break;
112
186
  case "Enter":
113
187
  case " ":
114
- e.preventDefault(), r ? $(c) : y();
188
+ e.preventDefault(), r ? T(k) : I();
115
189
  break;
116
190
  case "Escape":
117
- r && (e.preventDefault(), e.stopPropagation(), b(!1));
191
+ r && (e.preventDefault(), e.stopPropagation(), c(!1));
118
192
  break;
119
193
  case "Tab":
120
- b(!1);
194
+ c(!1);
121
195
  break;
122
196
  }
123
- }, j = /* @__PURE__ */ u(F, { reducedMotion: "user", children: /* @__PURE__ */ u(G, { children: r && /* @__PURE__ */ k(
124
- J.ul,
197
+ }, _ = /* @__PURE__ */ f(Q, { reducedMotion: "user", children: /* @__PURE__ */ f(W, { children: r && /* @__PURE__ */ f(
198
+ K,
125
199
  {
126
- ref: w,
127
- id: g,
128
- role: "listbox",
129
- "aria-multiselectable": d || void 0,
130
- "aria-activedescendant": c >= 0 ? `${g}-opt-${c}` : void 0,
131
- variants: X,
132
- initial: "hidden",
133
- animate: "visible",
134
- exit: "hidden",
200
+ ref: R,
201
+ id: B,
202
+ "aria-label": v ? `${v} options` : "Select options",
203
+ items: o,
204
+ value: w,
205
+ values: i,
206
+ multiple: d,
207
+ activeIndex: k,
208
+ onActiveIndexChange: M,
209
+ onItemSelect: T,
210
+ placement: x,
135
211
  style: {
136
- transformOrigin: m === "top" ? "bottom" : "top",
137
- ...p ? {
212
+ ...m ? {
138
213
  position: "fixed",
139
- top: (i == null ? void 0 : i.top) ?? 0,
140
- left: (i == null ? void 0 : i.left) ?? 0,
141
- width: (i == null ? void 0 : i.width) ?? 0,
142
- visibility: i ? "visible" : "hidden",
214
+ top: (l == null ? void 0 : l.top) ?? 0,
215
+ left: (l == null ? void 0 : l.left) ?? 0,
216
+ width: (l == null ? void 0 : l.width) ?? 0,
217
+ visibility: l ? "visible" : "hidden",
143
218
  zIndex: 60
144
219
  } : {}
145
220
  },
146
- className: f(
147
- "max-h-60 overflow-auto p-1",
221
+ className: b(
222
+ "pointer-events-auto max-h-60 overflow-auto p-1",
148
223
  "rounded-md border border-border bg-elevated shadow-elevation",
149
- p ? "fixed" : f(
224
+ m ? "fixed" : b(
150
225
  "absolute z-50 w-full",
151
- m === "top" ? "bottom-full mb-1.5" : "top-full mt-1.5"
226
+ x === "top" ? "bottom-full mb-1.5" : "top-full mt-1.5"
152
227
  )
153
- ),
154
- children: [
155
- /* @__PURE__ */ u(Y, { origin: m === "top" ? "bottom" : "top" }),
156
- o.map((e, t) => {
157
- const n = d ? l.includes(e.value) : e.value === h, a = t === c;
158
- return /* @__PURE__ */ k(
159
- "li",
160
- {
161
- id: `${g}-opt-${t}`,
162
- role: "option",
163
- "aria-selected": n,
164
- "aria-disabled": e.disabled || void 0,
165
- onMouseEnter: () => !e.disabled && N(t),
166
- onClick: () => $(t),
167
- className: f(
168
- "flex cursor-pointer items-center justify-between gap-2",
169
- "rounded-sm px-2 py-1.5 text-xs text-foreground select-none",
170
- a && !e.disabled && "bg-muted",
171
- e.disabled && "pointer-events-none opacity-50"
172
- ),
173
- children: [
174
- /* @__PURE__ */ u("span", { className: "truncate", children: e.label }),
175
- n && /* @__PURE__ */ u(Q, { className: "size-4 shrink-0", "aria-hidden": !0 })
176
- ]
177
- },
178
- e.value
179
- );
180
- })
181
- ]
228
+ )
182
229
  }
183
230
  ) }) });
184
- return /* @__PURE__ */ k("div", { ref: z, className: "relative", children: [
185
- /* @__PURE__ */ k(
231
+ return /* @__PURE__ */ S("div", { ref: O, className: b("relative", r && "z-[70]"), children: [
232
+ /* @__PURE__ */ S(
186
233
  "button",
187
234
  {
188
- ref: _,
189
- id: O,
235
+ ref: g,
236
+ id: j,
190
237
  type: "button",
191
238
  role: "combobox",
192
239
  "aria-haspopup": "listbox",
193
240
  "aria-expanded": r,
194
- "aria-controls": g,
195
- "aria-invalid": B || void 0,
196
- "aria-label": P,
197
- "aria-describedby": T,
198
- disabled: L,
199
- onClick: () => r ? b(!1) : y(),
200
- onKeyDown: U,
201
- className: f(Z({ size: M }), H),
241
+ "aria-controls": B,
242
+ "aria-invalid": $ || void 0,
243
+ "aria-label": v,
244
+ "aria-describedby": s,
245
+ "data-value-set": U || void 0,
246
+ disabled: z,
247
+ onClick: () => r ? c(!1) : I(),
248
+ onKeyDown: q,
249
+ className: b(te({ size: D }), L),
202
250
  children: [
203
- /* @__PURE__ */ u(
204
- "span",
205
- {
206
- className: f(
207
- "truncate",
208
- d ? v.length === 0 && "text-muted-foreground" : !D && "text-muted-foreground"
209
- ),
210
- children: d ? v.length === 0 ? R : v.length === 1 ? v[0].label : `${v.length} selected` : D ? D.label : R
211
- }
212
- ),
213
- /* @__PURE__ */ u(
214
- V,
251
+ /* @__PURE__ */ f("span", { className: "truncate", children: d ? E.length === 0 ? h : E.length === 1 ? E[0].label : `${E.length} selected` : A ? A.label : h }),
252
+ /* @__PURE__ */ f(
253
+ Y,
215
254
  {
216
- className: f(
217
- "size-4 text-muted-foreground transition-transform duration-150 ease-out motion-reduce:transition-none",
255
+ className: b(
256
+ "size-4 text-muted-foreground transition-[color,transform] duration-150 ease-out motion-reduce:transition-none",
257
+ "group-hover/select:text-foreground group-focus/select:text-g12!",
218
258
  r && "rotate-180"
219
259
  ),
220
260
  "aria-hidden": !0
@@ -223,11 +263,12 @@ const Z = C(
223
263
  ]
224
264
  }
225
265
  ),
226
- p && typeof document < "u" ? q(j, document.body) : j
266
+ m && typeof document < "u" ? F(_, document.body) : _
227
267
  ] });
228
268
  }
229
269
  );
230
- ee.displayName = "Select";
270
+ re.displayName = "Select";
231
271
  export {
232
- ee as Select
272
+ K as DropdownOptions,
273
+ re as Select
233
274
  };
@@ -4,10 +4,11 @@ import * as React from "react";
4
4
  * SettingList / SettingRow — the grouped settings stack: one row per setting,
5
5
  * each reading leading glyph → what it is → the control that changes it.
6
6
  *
7
- * The rows are separate `bg-card` blocks on a recessed `bg-surface` track, so
8
- * the group reads by fill and spacing rather than by hairlines (principle 1).
9
- * A row is a static surface — it stays flat unless `onSelect` makes the whole
10
- * row actionable, at which point it earns hover and press feedback.
7
+ * Rows sit directly on their parent surface and separate with inset hairlines.
8
+ * This keeps a white Card/Panel from alternating white → grey → white again.
9
+ * A row receives a neutral wash only as interaction feedback when `onSelect`
10
+ * makes the whole row actionable (principle 1: panels establish hierarchy;
11
+ * items express state).
11
12
  *
12
13
  * The trailing slot takes whatever changes the setting: a `Button`, a
13
14
  * `Switch`, a `Badge`, or nothing. The leading slot takes the label — pass a
@@ -30,6 +31,6 @@ export interface SettingRowProps extends Omit<React.HTMLAttributes<HTMLDivElemen
30
31
  }
31
32
  export declare const SettingRow: React.ForwardRefExoticComponent<SettingRowProps & React.RefAttributes<HTMLDivElement>>;
32
33
  export type SettingListProps = React.HTMLAttributes<HTMLDivElement>;
33
- /** The recessed track the rows sit on; the gap between them is the divider. */
34
+ /** A surface-neutral row group; each row owns its inset divider. */
34
35
  export declare const SettingList: React.ForwardRefExoticComponent<SettingListProps & React.RefAttributes<HTMLDivElement>>;
35
36
  export { settingRowVariants };