@actioneer/ads 0.5.9 → 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.
- package/components/ai-elements/agent-trace.d.ts +2 -2
- package/components/ai-elements/agent-trace.js +163 -104
- package/components/ai-elements/chain-of-thought.d.ts +2 -2
- package/components/ai-elements/chain-of-thought.js +1 -1
- package/components/ai-elements/index.d.ts +0 -5
- package/components/ai-elements/inline-citation.js +1 -1
- package/components/alert.d.ts +6 -6
- package/components/alert.js +89 -53
- package/components/answer-sources.d.ts +2 -6
- package/components/answer-sources.js +58 -60
- package/components/answer.d.ts +5 -0
- package/components/answer.js +311 -271
- package/components/assistant-ui/composer-harness.js +11 -14
- package/components/assistant-ui/composer.d.ts +3 -1
- package/components/assistant-ui/composer.js +148 -144
- package/components/assistant-ui/index.d.ts +0 -3
- package/components/assistant-ui/thread-context.d.ts +3 -1
- package/components/assistant-ui/thread.js +50 -42
- package/components/avatar.js +42 -42
- package/components/badge.d.ts +5 -6
- package/components/badge.js +13 -76
- package/components/body-page-header.d.ts +15 -0
- package/components/body-page-header.js +24 -0
- package/components/brand-loader.d.ts +0 -3
- package/components/brand-loader.js +10 -32
- package/components/breadcrumbs.d.ts +1 -8
- package/components/breadcrumbs.js +65 -78
- package/components/button.d.ts +1 -1
- package/components/button.js +55 -49
- package/components/card.js +19 -18
- package/components/chart.js +526 -503
- package/components/chip.d.ts +13 -1
- package/components/chip.js +93 -80
- package/components/collection-header.d.ts +17 -0
- package/components/collection-header.js +31 -0
- package/components/connector-card.d.ts +6 -6
- package/components/connector-card.js +31 -32
- package/components/date-range-picker.d.ts +26 -0
- package/components/date-range-picker.js +223 -0
- package/components/drawer.d.ts +19 -3
- package/components/drawer.js +143 -116
- package/components/dropdown.d.ts +1 -2
- package/components/dropdown.js +88 -89
- package/components/field.js +39 -34
- package/components/file-dropzone.js +1 -1
- package/components/index.d.ts +5 -4
- package/components/index.js +501 -546
- package/components/infinite-canvas.js +24 -24
- package/components/input-field.d.ts +18 -3
- package/components/input-field.js +88 -72
- package/components/input.js +16 -15
- package/components/modal.d.ts +31 -3
- package/components/modal.js +243 -169
- package/components/number-field.js +45 -42
- package/components/page-body.d.ts +12 -0
- package/components/page-body.js +18 -0
- package/components/pagination.js +36 -36
- package/components/panel.js +31 -28
- package/components/select.d.ts +21 -0
- package/components/select.js +189 -148
- package/components/setting-row.d.ts +6 -5
- package/components/setting-row.js +33 -32
- package/components/sidebar.d.ts +2 -0
- package/components/sidebar.js +165 -155
- package/components/skeleton.js +8 -7
- package/components/slider.js +1 -1
- package/components/surface-loader.d.ts +11 -0
- package/components/surface-loader.js +35 -0
- package/components/table.d.ts +16 -10
- package/components/table.js +426 -410
- package/components/tabs.d.ts +2 -0
- package/components/tabs.js +159 -294
- package/components/textarea.js +9 -9
- package/components/toast.d.ts +1 -1
- package/components/toast.js +181 -118
- package/components/tree.d.ts +5 -1
- package/components/tree.js +96 -63
- package/components/typography.d.ts +4 -4
- package/components/typography.js +13 -13
- package/components/ui/button.d.ts +1 -1
- package/components/ui/dialog.js +33 -33
- package/components/viz-charts.js +186 -183
- package/demo/components/add-to-artifact.js +8 -10
- package/fonts.css +2 -0
- package/lib/cn.js +11 -4
- package/lib/icons.d.ts +4 -0
- package/lib/icons.js +107 -106
- package/lib/interactive.d.ts +1 -1
- package/llms.txt +115 -152
- package/manifest.json +13730 -1084
- package/package.json +4 -2
- package/styles.css +365 -225
- package/theme.css +315 -176
- package/components/agent-icon.d.ts +0 -76
- package/components/agent-icon.js +0 -265
- package/components/ai-elements/queue.d.ts +0 -60
- package/components/ai-elements/queue.js +0 -193
- package/components/ai-elements/speech-input.d.ts +0 -16
- package/components/ai-elements/speech-input.js +0 -151
- package/components/ai-elements/task-progress.d.ts +0 -41
- package/components/ai-elements/task-progress.js +0 -224
- package/components/ai-elements/task.d.ts +0 -39
- package/components/ai-elements/task.js +0 -105
- package/components/ai-elements/voice.d.ts +0 -90
- package/components/ai-elements/voice.js +0 -496
- package/components/assistant-ui/follow-up-suggestions.d.ts +0 -11
- package/components/assistant-ui/follow-up-suggestions.js +0 -72
- package/components/assistant-ui/suggestions.d.ts +0 -7
- package/components/assistant-ui/suggestions.js +0 -19
- package/components/assistant-ui/voice.d.ts +0 -18
- package/components/link.d.ts +0 -14
- package/components/link.js +0 -72
- package/components/navbar.d.ts +0 -15
- package/components/navbar.js +0 -68
- package/components/pixel-icon.d.ts +0 -37
- package/components/pixel-icon.js +0 -859
package/components/select.js
CHANGED
|
@@ -1,73 +1,147 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import * as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { cva as
|
|
6
|
-
import {
|
|
7
|
-
import { Check as
|
|
8
|
-
import { cn as
|
|
9
|
-
import { inputBaseClass as
|
|
10
|
-
import { floatVariants as
|
|
11
|
-
import { Ripple as
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
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
|
|
22
|
-
md: "h-
|
|
23
|
-
lg: "h-11 rounded-md
|
|
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
|
-
),
|
|
29
|
+
), K = n.forwardRef(
|
|
29
30
|
({
|
|
30
31
|
items: o,
|
|
31
|
-
value:
|
|
32
|
-
|
|
32
|
+
value: w,
|
|
33
|
+
values: y = [],
|
|
33
34
|
multiple: d = !1,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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,
|
|
51
|
-
|
|
124
|
+
}, [o, d, w, i]);
|
|
125
|
+
n.useEffect(() => {
|
|
52
126
|
if (!r) return;
|
|
53
127
|
const e = (t) => {
|
|
54
|
-
var
|
|
55
|
-
const
|
|
56
|
-
(
|
|
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]),
|
|
60
|
-
if (!r || !
|
|
61
|
-
|
|
133
|
+
}, [r]), n.useLayoutEffect(() => {
|
|
134
|
+
if (!r || !m) {
|
|
135
|
+
H(null);
|
|
62
136
|
return;
|
|
63
137
|
}
|
|
64
138
|
const e = () => {
|
|
65
|
-
var
|
|
66
|
-
const t = (
|
|
139
|
+
var u, N;
|
|
140
|
+
const t = (u = O.current) == null ? void 0 : u.getBoundingClientRect();
|
|
67
141
|
if (!t) return;
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
top:
|
|
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,
|
|
152
|
+
}, [r, x, m]), n.useEffect(() => {
|
|
79
153
|
var t;
|
|
80
|
-
if (!r ||
|
|
81
|
-
const e = (t =
|
|
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,
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
let
|
|
89
|
-
for (let
|
|
90
|
-
if (
|
|
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
|
-
},
|
|
167
|
+
}, T = (e) => {
|
|
94
168
|
const t = o[e];
|
|
95
169
|
if (!(!t || t.disabled)) {
|
|
96
170
|
if (d) {
|
|
97
|
-
|
|
98
|
-
|
|
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
|
-
|
|
176
|
+
y == null || y(t.value), c(!1);
|
|
103
177
|
}
|
|
104
|
-
},
|
|
178
|
+
}, q = (e) => {
|
|
105
179
|
switch (e.key) {
|
|
106
180
|
case "ArrowDown":
|
|
107
|
-
e.preventDefault(), r ?
|
|
181
|
+
e.preventDefault(), r ? P(1) : I();
|
|
108
182
|
break;
|
|
109
183
|
case "ArrowUp":
|
|
110
|
-
e.preventDefault(), r ?
|
|
184
|
+
e.preventDefault(), r ? P(-1) : I();
|
|
111
185
|
break;
|
|
112
186
|
case "Enter":
|
|
113
187
|
case " ":
|
|
114
|
-
e.preventDefault(), r ?
|
|
188
|
+
e.preventDefault(), r ? T(k) : I();
|
|
115
189
|
break;
|
|
116
190
|
case "Escape":
|
|
117
|
-
r && (e.preventDefault(), e.stopPropagation(),
|
|
191
|
+
r && (e.preventDefault(), e.stopPropagation(), c(!1));
|
|
118
192
|
break;
|
|
119
193
|
case "Tab":
|
|
120
|
-
|
|
194
|
+
c(!1);
|
|
121
195
|
break;
|
|
122
196
|
}
|
|
123
|
-
},
|
|
124
|
-
|
|
197
|
+
}, _ = /* @__PURE__ */ f(Q, { reducedMotion: "user", children: /* @__PURE__ */ f(W, { children: r && /* @__PURE__ */ f(
|
|
198
|
+
K,
|
|
125
199
|
{
|
|
126
|
-
ref:
|
|
127
|
-
id:
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
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
|
-
|
|
137
|
-
...p ? {
|
|
212
|
+
...m ? {
|
|
138
213
|
position: "fixed",
|
|
139
|
-
top: (
|
|
140
|
-
left: (
|
|
141
|
-
width: (
|
|
142
|
-
visibility:
|
|
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:
|
|
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
|
-
|
|
224
|
+
m ? "fixed" : b(
|
|
150
225
|
"absolute z-50 w-full",
|
|
151
|
-
|
|
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__ */
|
|
185
|
-
/* @__PURE__ */
|
|
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:
|
|
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":
|
|
195
|
-
"aria-invalid":
|
|
196
|
-
"aria-label":
|
|
197
|
-
"aria-describedby":
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
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__ */
|
|
204
|
-
|
|
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:
|
|
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
|
-
|
|
266
|
+
m && typeof document < "u" ? F(_, document.body) : _
|
|
227
267
|
] });
|
|
228
268
|
}
|
|
229
269
|
);
|
|
230
|
-
|
|
270
|
+
re.displayName = "Select";
|
|
231
271
|
export {
|
|
232
|
-
|
|
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
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* A row
|
|
10
|
-
*
|
|
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
|
-
/**
|
|
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
|
|
3
|
-
import * as
|
|
4
|
-
import { cva as
|
|
5
|
-
import { cn as
|
|
6
|
-
const
|
|
7
|
-
|
|
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: "
|
|
15
|
+
true: "",
|
|
12
16
|
false: ""
|
|
13
17
|
}
|
|
14
18
|
},
|
|
15
19
|
defaultVariants: { isPressable: !1 }
|
|
16
20
|
}
|
|
17
|
-
),
|
|
18
|
-
({ className:
|
|
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__ */
|
|
24
|
+
return /* @__PURE__ */ d(
|
|
21
25
|
"div",
|
|
22
26
|
{
|
|
23
27
|
ref: m,
|
|
24
28
|
"data-slot": "setting-row",
|
|
25
|
-
className:
|
|
26
|
-
...
|
|
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:
|
|
35
|
-
"absolute inset-0 rounded-
|
|
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
|
-
|
|
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:
|
|
51
|
+
children: r
|
|
48
52
|
}
|
|
49
53
|
),
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
/* @__PURE__ */ e("div", { className: "min-w-0
|
|
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
|
-
|
|
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:
|
|
65
|
+
children: i
|
|
62
66
|
}
|
|
63
67
|
)
|
|
64
68
|
]
|
|
@@ -66,24 +70,21 @@ const p = g(
|
|
|
66
70
|
);
|
|
67
71
|
}
|
|
68
72
|
);
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
({ className:
|
|
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
|
-
|
|
78
|
-
i
|
|
79
|
-
),
|
|
80
|
-
...s
|
|
80
|
+
className: s("flex w-full flex-col", a),
|
|
81
|
+
...r
|
|
81
82
|
}
|
|
82
83
|
)
|
|
83
84
|
);
|
|
84
|
-
|
|
85
|
+
x.displayName = "SettingList";
|
|
85
86
|
export {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
x as SettingList,
|
|
88
|
+
v as SettingRow,
|
|
89
|
+
g as settingRowVariants
|
|
89
90
|
};
|
package/components/sidebar.d.ts
CHANGED
|
@@ -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
|
}
|