@actioneer/ads 0.6.0 → 0.8.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 (123) hide show
  1. package/DESIGN.md +597 -0
  2. package/components/ai-elements/agent-trace.d.ts +2 -2
  3. package/components/ai-elements/agent-trace.js +164 -105
  4. package/components/ai-elements/chain-of-thought.d.ts +2 -2
  5. package/components/ai-elements/chain-of-thought.js +1 -1
  6. package/components/ai-elements/index.d.ts +0 -5
  7. package/components/ai-elements/inline-citation.js +1 -1
  8. package/components/alert.d.ts +6 -6
  9. package/components/alert.js +89 -53
  10. package/components/answer-sources.d.ts +2 -6
  11. package/components/answer-sources.js +58 -60
  12. package/components/answer.d.ts +5 -0
  13. package/components/answer.js +311 -271
  14. package/components/assistant-ui/action-bar.js +1 -1
  15. package/components/assistant-ui/attachment.js +11 -11
  16. package/components/assistant-ui/badge.js +18 -18
  17. package/components/assistant-ui/composer-harness.js +15 -20
  18. package/components/assistant-ui/composer-trigger-popover.js +9 -9
  19. package/components/assistant-ui/composer.d.ts +3 -1
  20. package/components/assistant-ui/composer.js +148 -144
  21. package/components/assistant-ui/image.js +61 -61
  22. package/components/assistant-ui/index.d.ts +0 -3
  23. package/components/assistant-ui/message-timing.js +1 -1
  24. package/components/assistant-ui/selection-toolbar.js +7 -7
  25. package/components/assistant-ui/thread-context.d.ts +3 -1
  26. package/components/assistant-ui/thread.js +50 -42
  27. package/components/avatar.js +42 -42
  28. package/components/badge.d.ts +5 -6
  29. package/components/badge.js +13 -76
  30. package/components/body-page-header.d.ts +15 -0
  31. package/components/body-page-header.js +24 -0
  32. package/components/brand-loader.d.ts +0 -3
  33. package/components/brand-loader.js +10 -32
  34. package/components/breadcrumbs.d.ts +0 -7
  35. package/components/breadcrumbs.js +54 -71
  36. package/components/button.d.ts +1 -1
  37. package/components/button.js +55 -49
  38. package/components/chart.js +298 -296
  39. package/components/chip.d.ts +13 -1
  40. package/components/chip.js +93 -80
  41. package/components/collection-header.d.ts +17 -0
  42. package/components/collection-header.js +31 -0
  43. package/components/connector-card.d.ts +6 -6
  44. package/components/connector-card.js +31 -32
  45. package/components/date-range-picker.d.ts +2 -1
  46. package/components/date-range-picker.js +158 -122
  47. package/components/divider.js +25 -25
  48. package/components/drawer.d.ts +6 -2
  49. package/components/drawer.js +61 -58
  50. package/components/dropdown.d.ts +1 -2
  51. package/components/dropdown.js +88 -89
  52. package/components/field.js +41 -36
  53. package/components/file-dropzone.js +1 -1
  54. package/components/index.d.ts +4 -4
  55. package/components/index.js +501 -549
  56. package/components/infinite-canvas.js +24 -24
  57. package/components/input-field.d.ts +18 -3
  58. package/components/input-field.js +88 -72
  59. package/components/input.js +32 -29
  60. package/components/modal.d.ts +31 -3
  61. package/components/modal.js +244 -170
  62. package/components/number-field.js +45 -42
  63. package/components/page-body.d.ts +12 -0
  64. package/components/page-body.js +18 -0
  65. package/components/pagination.js +36 -36
  66. package/components/pixel-blast-svg.js +71 -73
  67. package/components/select.d.ts +21 -0
  68. package/components/select.js +189 -148
  69. package/components/setting-row.d.ts +6 -5
  70. package/components/setting-row.js +33 -32
  71. package/components/sidebar.d.ts +2 -0
  72. package/components/sidebar.js +151 -141
  73. package/components/skeleton.js +8 -7
  74. package/components/slider.js +1 -1
  75. package/components/surface-loader.d.ts +11 -0
  76. package/components/surface-loader.js +35 -0
  77. package/components/table.d.ts +16 -10
  78. package/components/table.js +427 -412
  79. package/components/tabs.d.ts +2 -0
  80. package/components/tabs.js +160 -295
  81. package/components/textarea.js +9 -9
  82. package/components/toast.d.ts +1 -1
  83. package/components/toast.js +181 -118
  84. package/components/tree.d.ts +5 -1
  85. package/components/tree.js +54 -49
  86. package/components/typography.d.ts +4 -4
  87. package/components/typography.js +13 -13
  88. package/components/ui/button.d.ts +1 -1
  89. package/components/ui/button.js +4 -4
  90. package/components/ui/dialog.js +25 -25
  91. package/demo/components/add-to-artifact.js +6 -10
  92. package/lib/cn.js +11 -4
  93. package/lib/icons.d.ts +4 -0
  94. package/lib/icons.js +103 -102
  95. package/lib/interactive.d.ts +1 -1
  96. package/llms.txt +132 -188
  97. package/manifest.json +1719 -2831
  98. package/package.json +2 -2
  99. package/styles.css +362 -233
  100. package/theme.css +312 -177
  101. package/components/agent-icon.d.ts +0 -76
  102. package/components/agent-icon.js +0 -265
  103. package/components/ai-elements/queue.d.ts +0 -60
  104. package/components/ai-elements/queue.js +0 -193
  105. package/components/ai-elements/speech-input.d.ts +0 -16
  106. package/components/ai-elements/speech-input.js +0 -151
  107. package/components/ai-elements/task-progress.d.ts +0 -41
  108. package/components/ai-elements/task-progress.js +0 -224
  109. package/components/ai-elements/task.d.ts +0 -39
  110. package/components/ai-elements/task.js +0 -105
  111. package/components/ai-elements/voice.d.ts +0 -90
  112. package/components/ai-elements/voice.js +0 -496
  113. package/components/assistant-ui/follow-up-suggestions.d.ts +0 -11
  114. package/components/assistant-ui/follow-up-suggestions.js +0 -72
  115. package/components/assistant-ui/suggestions.d.ts +0 -7
  116. package/components/assistant-ui/suggestions.js +0 -19
  117. package/components/assistant-ui/voice.d.ts +0 -18
  118. package/components/link.d.ts +0 -14
  119. package/components/link.js +0 -72
  120. package/components/navbar.d.ts +0 -15
  121. package/components/navbar.js +0 -68
  122. package/components/pixel-icon.d.ts +0 -37
  123. package/components/pixel-icon.js +0 -859
@@ -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 };
@@ -1,29 +1,33 @@
1
1
  "use client";
2
- import { jsxs as c, jsx as e } from "react/jsx-runtime";
3
- import * as d from "react";
4
- import { cva as g } from "class-variance-authority";
5
- import { cn as a } from "../lib/cn.js";
6
- const p = g(
7
- "flex w-full items-center gap-3 rounded-lg bg-card px-4 py-3 text-left",
2
+ import { jsxs as d, jsx as e } from "react/jsx-runtime";
3
+ import * as f from "react";
4
+ import { cva as p } from "class-variance-authority";
5
+ import { cn as s } from "../lib/cn.js";
6
+ const g = p(
7
+ [
8
+ "relative flex w-full items-center gap-3 rounded-md bg-transparent px-4 py-3 text-left",
9
+ "after:pointer-events-none after:absolute after:inset-x-4 after:bottom-0 after:z-20",
10
+ "after:border-b after:border-border after:content-[''] last:after:hidden"
11
+ ].join(" "),
8
12
  {
9
13
  variants: {
10
14
  isPressable: {
11
- true: "relative",
15
+ true: "",
12
16
  false: ""
13
17
  }
14
18
  },
15
19
  defaultVariants: { isPressable: !1 }
16
20
  }
17
- ), x = d.forwardRef(
18
- ({ className: i, icon: s, label: t, description: n, action: r, onSelect: o, ...f }, m) => {
21
+ ), v = f.forwardRef(
22
+ ({ className: a, icon: r, label: t, description: n, action: i, onSelect: o, ...c }, m) => {
19
23
  const l = !!o;
20
- return /* @__PURE__ */ c(
24
+ return /* @__PURE__ */ d(
21
25
  "div",
22
26
  {
23
27
  ref: m,
24
28
  "data-slot": "setting-row",
25
- className: a(p({ isPressable: l }), i),
26
- ...f,
29
+ className: s(g({ isPressable: l }), a),
30
+ ...c,
27
31
  children: [
28
32
  l && /* @__PURE__ */ e(
29
33
  "button",
@@ -31,34 +35,34 @@ const p = g(
31
35
  type: "button",
32
36
  "aria-label": typeof t == "string" ? t : "Open setting",
33
37
  onClick: o,
34
- className: a(
35
- "absolute inset-0 rounded-lg outline-none",
38
+ className: s(
39
+ "absolute inset-0 rounded-md outline-none",
36
40
  "transition-[background-color,transform] duration-150 ease-out",
37
41
  "hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring",
38
42
  "active:scale-[0.97] motion-reduce:transition-none"
39
43
  )
40
44
  }
41
45
  ),
42
- s && /* @__PURE__ */ e(
46
+ r && /* @__PURE__ */ e(
43
47
  "span",
44
48
  {
45
49
  "aria-hidden": !0,
46
50
  className: "relative z-10 flex size-5 shrink-0 items-center justify-center text-tertiary pointer-events-none [&>svg]:size-4.5",
47
- children: s
51
+ children: r
48
52
  }
49
53
  ),
50
- /* @__PURE__ */ c("div", { className: "relative z-10 flex min-w-0 flex-1 flex-col gap-0.5 pointer-events-none", children: [
51
- /* @__PURE__ */ e("div", { className: "min-w-0 truncate text-base text-foreground", children: t }),
54
+ /* @__PURE__ */ d("div", { className: "relative z-10 flex min-w-0 flex-1 flex-col gap-0.5 pointer-events-none", children: [
55
+ /* @__PURE__ */ e("div", { className: "min-w-0 text-base text-foreground wrap-break-word", children: t }),
52
56
  n && /* @__PURE__ */ e("div", { className: "min-w-0 text-xs text-tertiary", children: n })
53
57
  ] }),
54
- r && // The trailing control owns its own click — a pressable row must not
58
+ i && // The trailing control owns its own click — a pressable row must not
55
59
  // also fire when the reader aims at the button inside it.
56
60
  /* @__PURE__ */ e(
57
61
  "span",
58
62
  {
59
63
  className: "relative z-20 shrink-0",
60
64
  onClick: (u) => u.stopPropagation(),
61
- children: r
65
+ children: i
62
66
  }
63
67
  )
64
68
  ]
@@ -66,24 +70,21 @@ const p = g(
66
70
  );
67
71
  }
68
72
  );
69
- x.displayName = "SettingRow";
70
- const v = d.forwardRef(
71
- ({ className: i, ...s }, t) => /* @__PURE__ */ e(
73
+ v.displayName = "SettingRow";
74
+ const x = f.forwardRef(
75
+ ({ className: a, ...r }, t) => /* @__PURE__ */ e(
72
76
  "div",
73
77
  {
74
78
  ref: t,
75
79
  "data-slot": "setting-list",
76
- className: a(
77
- "flex w-full flex-col gap-0.5 rounded-xl bg-surface p-1",
78
- i
79
- ),
80
- ...s
80
+ className: s("flex w-full flex-col", a),
81
+ ...r
81
82
  }
82
83
  )
83
84
  );
84
- v.displayName = "SettingList";
85
+ x.displayName = "SettingList";
85
86
  export {
86
- v as SettingList,
87
- x as SettingRow,
88
- p as settingRowVariants
87
+ x as SettingList,
88
+ v as SettingRow,
89
+ g as settingRowVariants
89
90
  };
@@ -28,6 +28,8 @@ export interface SidebarProps extends React.HTMLAttributes<HTMLElement> {
28
28
  /** Uncontrolled initial collapsed state. */
29
29
  defaultCollapsed?: boolean;
30
30
  onCollapsedChange?: (collapsed: boolean) => void;
31
+ /** Slide the complete rail in from the left on its first mount. */
32
+ animateOnMount?: boolean;
31
33
  /** Bind ⌘B / Ctrl-B to toggle collapse. Default true. */
32
34
  keyboardToggle?: boolean;
33
35
  }