@actioneer/ads 0.5.6 → 0.5.8
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/bin/ads-init.mjs +6 -0
- package/components/accordion.js +50 -48
- package/components/agent-icon.d.ts +12 -0
- package/components/agent-icon.js +135 -121
- package/components/ai-elements/chain-of-thought-icon.d.ts +10 -12
- package/components/ai-elements/chain-of-thought-icon.js +341 -201
- package/components/ai-elements/chain-of-thought.d.ts +2 -2
- package/components/ai-elements/chain-of-thought.js +108 -108
- package/components/ai-elements/chart.js +16 -14
- package/components/ai-elements/inline-citation.js +41 -41
- package/components/ai-elements/message.js +4 -4
- package/components/ai-elements/queue.js +7 -7
- package/components/ai-elements/research-activity.js +114 -114
- package/components/ai-elements/shimmer.d.ts +2 -2
- package/components/ai-elements/speech-input.js +28 -28
- package/components/ai-elements/task-progress.js +26 -16
- package/components/ai-elements/task.js +17 -17
- package/components/ai-elements/tool.js +6 -6
- package/components/ai-elements/transcript.js +6 -5
- package/components/ai-elements/voice.js +1 -1
- package/components/alert.js +10 -10
- package/components/answer-sources.d.ts +42 -0
- package/components/answer-sources.js +111 -0
- package/components/answer.js +115 -114
- package/components/assistant-ui/action-bar.js +94 -48
- package/components/assistant-ui/attachment.js +131 -103
- package/components/assistant-ui/badge.d.ts +1 -1
- package/components/assistant-ui/badge.js +17 -17
- package/components/assistant-ui/chain-of-thought.d.ts +1 -1
- package/components/assistant-ui/composer-add-context.js +9 -9
- package/components/assistant-ui/composer-deep-research.js +5 -5
- package/components/assistant-ui/composer-harness.js +12 -9
- package/components/assistant-ui/composer-trigger-popover.js +45 -34
- package/components/assistant-ui/composer.js +59 -59
- package/components/assistant-ui/error.js +14 -14
- package/components/assistant-ui/file.d.ts +1 -1
- package/components/assistant-ui/image.d.ts +1 -1
- package/components/assistant-ui/image.js +113 -103
- package/components/assistant-ui/markdown-text.js +18 -18
- package/components/assistant-ui/message.js +46 -45
- package/components/assistant-ui/quote.js +1 -1
- package/components/assistant-ui/reasoning.d.ts +1 -1
- package/components/assistant-ui/reasoning.js +66 -77
- package/components/assistant-ui/suggestions.js +4 -4
- package/components/assistant-ui/thread-context.d.ts +2 -0
- package/components/assistant-ui/thread.js +41 -40
- package/components/assistant-ui/tool-fallback.js +60 -63
- package/components/assistant-ui/tool-group.d.ts +1 -1
- package/components/assistant-ui/tool-group.js +36 -42
- package/components/audio-waveform.js +25 -24
- package/components/autocomplete.d.ts +1 -0
- package/components/autocomplete.js +45 -43
- package/components/avatar.js +30 -30
- package/components/badge.d.ts +1 -1
- package/components/breadcrumbs.js +2 -2
- package/components/button.d.ts +2 -2
- package/components/button.js +22 -20
- package/components/card.js +8 -8
- package/components/carousel.js +105 -104
- package/components/chart.js +9 -7
- package/components/checkbox.js +74 -38
- package/components/chip.d.ts +1 -1
- package/components/code-block.js +3 -3
- package/components/collapsible.js +67 -23
- package/components/connector-card.js +6 -6
- package/components/drawer.d.ts +15 -10
- package/components/drawer.js +78 -77
- package/components/dropdown.d.ts +3 -1
- package/components/dropdown.js +88 -79
- package/components/empty-state.d.ts +4 -4
- package/components/empty-state.js +7 -7
- package/components/field.d.ts +4 -0
- package/components/field.js +45 -34
- package/components/file-dropzone.js +12 -12
- package/components/index.d.ts +4 -0
- package/components/index.js +584 -553
- package/components/infinite-canvas.js +1 -1
- package/components/input-field.js +51 -46
- package/components/input.js +20 -20
- package/components/link.js +9 -9
- package/components/modal.js +105 -73
- package/components/navbar.d.ts +1 -1
- package/components/navbar.js +1 -1
- package/components/number-field.js +38 -29
- package/components/page-header.js +12 -12
- package/components/pagination.js +19 -19
- package/components/panel.js +2 -2
- package/components/pixel-blast-svg.js +3 -3
- package/components/pixel-icon.d.ts +3 -1
- package/components/pixel-icon.js +294 -215
- package/components/popover.d.ts +1 -1
- package/components/popover.js +66 -64
- package/components/progress-circle.js +36 -32
- package/components/progress.js +28 -24
- package/components/radio.js +59 -49
- package/components/resizable-panel.js +1 -1
- package/components/reveal.d.ts +2 -2
- package/components/ripple.d.ts +3 -3
- package/components/scroll-area.js +17 -16
- package/components/segmented.d.ts +4 -1
- package/components/segmented.js +26 -25
- package/components/select.d.ts +2 -0
- package/components/select.js +61 -57
- package/components/setting-row.js +45 -42
- package/components/sidebar.d.ts +2 -2
- package/components/sidebar.js +131 -127
- package/components/skeleton.js +5 -5
- package/components/spinner.d.ts +13 -4
- package/components/spinner.js +42 -42
- package/components/stepper.js +21 -21
- package/components/switch.js +52 -32
- package/components/table.d.ts +24 -7
- package/components/table.js +457 -220
- package/components/tabs.js +149 -137
- package/components/textarea.js +1 -2
- package/components/toast.js +66 -66
- package/components/tooltip.js +2 -2
- package/components/tree.js +62 -51
- package/components/typography.d.ts +2 -1
- package/components/typography.js +33 -32
- package/components/ui/button.d.ts +2 -2
- package/components/ui/button.js +19 -19
- package/components/ui/collapsible.d.ts +1 -5
- package/components/ui/dialog.d.ts +3 -3
- package/components/ui/dialog.js +95 -58
- package/components/ui/tooltip.d.ts +2 -2
- package/components/ui/tooltip.js +67 -33
- package/components/viz-charts.js +95 -95
- package/demo/components/add-to-artifact.js +341 -0
- package/demo/lib/artifact-library.js +134 -0
- package/fonts/aribau-grotesk-medium.woff2 +0 -0
- package/fonts/aribau-grotesk-regular.woff2 +0 -0
- package/fonts.css +11 -11
- package/hooks/agents-ui/use-agent-audio-visualizer-aura.js +17 -16
- package/hooks/agents-ui/use-agent-audio-visualizer-wave.js +21 -20
- package/lib/icons.d.ts +12 -0
- package/lib/icons.js +107 -104
- package/lib/motion.d.ts +42 -39
- package/lib/motion.js +112 -52
- package/lib/spinner-mark.d.ts +9 -0
- package/lib/spinner-mark.js +98 -0
- package/llms.txt +69 -26
- package/manifest.json +344 -42
- package/package.json +1 -1
- package/styles.css +175 -161
- package/theme.css +104 -128
- package/components/ui/collapsible.js +0 -35
- package/fonts/aribau-grotesk-500.otf +0 -0
- package/fonts/aribau-grotesk-600.woff2 +0 -0
|
@@ -4,8 +4,11 @@ declare const segmentedListVariants: (props?: ({
|
|
|
4
4
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
5
5
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
6
|
export interface SegmentedOption {
|
|
7
|
-
|
|
7
|
+
/** Visible option content — text or an icon element. */
|
|
8
|
+
label: React.ReactNode;
|
|
8
9
|
value: string;
|
|
10
|
+
/** Accessible name; required when `label` is icon-only. */
|
|
11
|
+
ariaLabel?: string;
|
|
9
12
|
}
|
|
10
13
|
export interface SegmentedControlProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange" | "role">, VariantProps<typeof segmentedListVariants> {
|
|
11
14
|
options: SegmentedOption[];
|
package/components/segmented.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as n, jsxs as
|
|
3
|
-
import * as
|
|
2
|
+
import { jsx as n, jsxs as x } from "react/jsx-runtime";
|
|
3
|
+
import * as d from "react";
|
|
4
4
|
import { MotionConfig as h, motion as v } from "motion/react";
|
|
5
|
-
import { cva as
|
|
5
|
+
import { cva as l } from "class-variance-authority";
|
|
6
6
|
import { cn as c } from "../lib/cn.js";
|
|
7
|
-
import {
|
|
8
|
-
const y =
|
|
7
|
+
import { springControl as w } from "../lib/motion.js";
|
|
8
|
+
const y = l(
|
|
9
9
|
// Borderless recessed track on ink-200 (bg-surface) — matches the Tabs
|
|
10
|
-
// primary track (the
|
|
10
|
+
// primary track (the selected segment provides the definition; a stroke around the
|
|
11
11
|
// track read as a second, heavier control).
|
|
12
|
-
"inline-flex items-center gap-1
|
|
12
|
+
"inline-flex items-center gap-1 bg-surface p-1",
|
|
13
13
|
{
|
|
14
14
|
variants: {
|
|
15
15
|
size: {
|
|
16
|
-
sm: "text-xs",
|
|
17
|
-
md: "text-xs",
|
|
18
|
-
lg: "text-base"
|
|
16
|
+
sm: "rounded-sm text-xs",
|
|
17
|
+
md: "rounded-md text-xs",
|
|
18
|
+
lg: "rounded-md text-base"
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
defaultVariants: { size: "md" }
|
|
22
22
|
}
|
|
23
|
-
), D =
|
|
23
|
+
), D = l(
|
|
24
24
|
c(
|
|
25
|
-
// The active
|
|
25
|
+
// The active segment is a shared motion thumb that SLIDES between options
|
|
26
26
|
// (layoutId), so the option itself only carries text color.
|
|
27
|
-
"relative inline-flex items-center justify-center whitespace-nowrap
|
|
28
|
-
"transition-colors duration-
|
|
27
|
+
"relative inline-flex items-center justify-center whitespace-nowrap font-normal select-none",
|
|
28
|
+
"transition-colors duration-150 cursor-pointer",
|
|
29
29
|
"outline-none focus-visible:ring-3 focus-visible:ring-ring",
|
|
30
30
|
"disabled:pointer-events-none disabled:opacity-50"
|
|
31
31
|
),
|
|
32
32
|
{
|
|
33
33
|
variants: {
|
|
34
34
|
size: {
|
|
35
|
-
sm: "h-6 px-2.5",
|
|
36
|
-
md: "h-8 px-3",
|
|
37
|
-
lg: "h-9 px-4"
|
|
35
|
+
sm: "h-6 rounded-sm px-2.5",
|
|
36
|
+
md: "h-8 rounded-md px-3",
|
|
37
|
+
lg: "h-9 rounded-md px-4"
|
|
38
38
|
},
|
|
39
39
|
selected: {
|
|
40
40
|
true: "text-foreground",
|
|
@@ -43,9 +43,9 @@ const y = d(
|
|
|
43
43
|
},
|
|
44
44
|
defaultVariants: { size: "md", selected: !1 }
|
|
45
45
|
}
|
|
46
|
-
), k =
|
|
47
|
-
const p =
|
|
48
|
-
const t = r.findIndex((
|
|
46
|
+
), k = d.forwardRef(({ options: r, value: a, onChange: o, size: s, className: m, ...u }, f) => {
|
|
47
|
+
const p = d.useId(), i = (e) => {
|
|
48
|
+
const t = r.findIndex((b) => b.value === a), g = ((t < 0 ? 0 : t) + e + r.length) % r.length;
|
|
49
49
|
o(r[g].value);
|
|
50
50
|
};
|
|
51
51
|
return /* @__PURE__ */ n(
|
|
@@ -65,16 +65,17 @@ const y = d(
|
|
|
65
65
|
break;
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
|
-
className: c(y({ size: s }),
|
|
69
|
-
...
|
|
68
|
+
className: c(y({ size: s }), m),
|
|
69
|
+
...u,
|
|
70
70
|
children: /* @__PURE__ */ n(h, { reducedMotion: "user", children: r.map((e) => {
|
|
71
71
|
const t = e.value === a;
|
|
72
|
-
return /* @__PURE__ */
|
|
72
|
+
return /* @__PURE__ */ x(
|
|
73
73
|
"button",
|
|
74
74
|
{
|
|
75
75
|
type: "button",
|
|
76
76
|
role: "radio",
|
|
77
77
|
"aria-checked": t,
|
|
78
|
+
"aria-label": e.ariaLabel,
|
|
78
79
|
tabIndex: t ? 0 : -1,
|
|
79
80
|
onClick: () => o(e.value),
|
|
80
81
|
className: D({ size: s, selected: t }),
|
|
@@ -85,8 +86,8 @@ const y = d(
|
|
|
85
86
|
layoutId: p,
|
|
86
87
|
"aria-hidden": !0,
|
|
87
88
|
layoutDependency: a,
|
|
88
|
-
transition:
|
|
89
|
-
className: "absolute inset-0 rounded-
|
|
89
|
+
transition: w,
|
|
90
|
+
className: "absolute inset-0 rounded-[inherit] bg-elevated shadow-elevation"
|
|
90
91
|
}
|
|
91
92
|
),
|
|
92
93
|
/* @__PURE__ */ n("span", { className: "relative", children: e.label })
|
package/components/select.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ export interface SelectProps extends VariantProps<typeof selectTriggerVariants>
|
|
|
17
17
|
isInvalid?: boolean;
|
|
18
18
|
className?: string;
|
|
19
19
|
id?: string;
|
|
20
|
+
"aria-label"?: string;
|
|
21
|
+
"aria-describedby"?: string;
|
|
20
22
|
/**
|
|
21
23
|
* Which side the listbox opens toward. Use `"top"` when the trigger sits
|
|
22
24
|
* at the bottom of a clipped container (e.g. a table footer inside an
|
package/components/select.js
CHANGED
|
@@ -1,107 +1,111 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import * as
|
|
4
|
-
import { cva as
|
|
5
|
-
import { MotionConfig as
|
|
6
|
-
import { ChevronDown as
|
|
2
|
+
import { jsxs as b, jsx as i } from "react/jsx-runtime";
|
|
3
|
+
import * as a from "react";
|
|
4
|
+
import { cva as V } from "class-variance-authority";
|
|
5
|
+
import { MotionConfig as $, AnimatePresence as C, motion as K } from "motion/react";
|
|
6
|
+
import { ChevronDown as L, Check as O } from "../lib/icons.js";
|
|
7
7
|
import { cn as d } from "../lib/cn.js";
|
|
8
|
-
import { inputBaseClass as
|
|
9
|
-
import { floatVariants as
|
|
10
|
-
import { Ripple as
|
|
11
|
-
const
|
|
8
|
+
import { inputBaseClass as P } from "./field.js";
|
|
9
|
+
import { floatVariants as T } from "../lib/motion.js";
|
|
10
|
+
import { Ripple as _ } from "./ripple.js";
|
|
11
|
+
const B = V(
|
|
12
12
|
d(
|
|
13
|
-
|
|
13
|
+
P,
|
|
14
14
|
"items-center justify-between gap-2 text-left cursor-pointer",
|
|
15
15
|
"[&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
16
16
|
),
|
|
17
17
|
{
|
|
18
18
|
variants: {
|
|
19
19
|
size: {
|
|
20
|
-
sm: "h-8 text-xs",
|
|
21
|
-
md: "h-10 text-xs",
|
|
22
|
-
lg: "h-11 text-base"
|
|
20
|
+
sm: "h-8 rounded-sm text-xs",
|
|
21
|
+
md: "h-10 rounded-md text-xs",
|
|
22
|
+
lg: "h-11 rounded-md text-base"
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
defaultVariants: { size: "md" }
|
|
26
26
|
}
|
|
27
|
-
),
|
|
27
|
+
), U = a.forwardRef(
|
|
28
28
|
({
|
|
29
|
-
items:
|
|
29
|
+
items: o,
|
|
30
30
|
value: c,
|
|
31
|
-
onChange:
|
|
31
|
+
onChange: m,
|
|
32
32
|
placeholder: I = "Select…",
|
|
33
33
|
size: N,
|
|
34
34
|
disabled: w,
|
|
35
35
|
isInvalid: E,
|
|
36
36
|
className: R,
|
|
37
37
|
id: A,
|
|
38
|
-
placement: v = "bottom"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
placement: v = "bottom",
|
|
39
|
+
"aria-label": S,
|
|
40
|
+
"aria-describedby": z
|
|
41
|
+
}, j) => {
|
|
42
|
+
const [r, l] = a.useState(!1), [s, x] = a.useState(-1), g = a.useRef(null), k = a.useRef(null), u = a.useId(), h = o.find((e) => e.value === c), M = a.useCallback(() => {
|
|
43
|
+
const e = o.findIndex((t) => t.value === c);
|
|
44
|
+
return e >= 0 && !o[e].disabled ? e : o.findIndex((t) => !t.disabled);
|
|
45
|
+
}, [o, c]);
|
|
46
|
+
a.useEffect(() => {
|
|
47
|
+
if (!r) return;
|
|
46
48
|
const e = (t) => {
|
|
47
49
|
var n;
|
|
48
50
|
(n = g.current) != null && n.contains(t.target) || l(!1);
|
|
49
51
|
};
|
|
50
52
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
51
|
-
}, [
|
|
53
|
+
}, [r]), a.useEffect(() => {
|
|
52
54
|
var t;
|
|
53
|
-
if (!
|
|
54
|
-
const e = (t = k.current) == null ? void 0 : t.children[
|
|
55
|
+
if (!r || s < 0) return;
|
|
56
|
+
const e = (t = k.current) == null ? void 0 : t.children[s];
|
|
55
57
|
e == null || e.scrollIntoView({ block: "nearest" });
|
|
56
|
-
}, [
|
|
58
|
+
}, [r, s]);
|
|
57
59
|
const f = () => {
|
|
58
|
-
w || (x(
|
|
60
|
+
w || (x(M()), l(!0));
|
|
59
61
|
}, y = (e) => {
|
|
60
62
|
x((t) => {
|
|
61
63
|
let n = t;
|
|
62
|
-
for (let p = 0; p <
|
|
63
|
-
if (n = (n + e +
|
|
64
|
+
for (let p = 0; p < o.length; p++)
|
|
65
|
+
if (n = (n + e + o.length) % o.length, !o[n].disabled) return n;
|
|
64
66
|
return t;
|
|
65
67
|
});
|
|
66
68
|
}, D = (e) => {
|
|
67
|
-
const t =
|
|
68
|
-
!t || t.disabled || (
|
|
69
|
+
const t = o[e];
|
|
70
|
+
!t || t.disabled || (m == null || m(t.value), l(!1));
|
|
69
71
|
};
|
|
70
|
-
return /* @__PURE__ */
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
+
return /* @__PURE__ */ b("div", { ref: g, className: "relative", children: [
|
|
73
|
+
/* @__PURE__ */ b(
|
|
72
74
|
"button",
|
|
73
75
|
{
|
|
74
|
-
ref:
|
|
76
|
+
ref: j,
|
|
75
77
|
id: A,
|
|
76
78
|
type: "button",
|
|
77
79
|
role: "combobox",
|
|
78
80
|
"aria-haspopup": "listbox",
|
|
79
|
-
"aria-expanded":
|
|
81
|
+
"aria-expanded": r,
|
|
80
82
|
"aria-controls": u,
|
|
81
83
|
"aria-invalid": E || void 0,
|
|
84
|
+
"aria-label": S,
|
|
85
|
+
"aria-describedby": z,
|
|
82
86
|
disabled: w,
|
|
83
|
-
onClick: () =>
|
|
87
|
+
onClick: () => r ? l(!1) : f(),
|
|
84
88
|
onKeyDown: (e) => {
|
|
85
89
|
switch (e.key) {
|
|
86
90
|
case "ArrowDown":
|
|
87
|
-
e.preventDefault(),
|
|
91
|
+
e.preventDefault(), r ? y(1) : f();
|
|
88
92
|
break;
|
|
89
93
|
case "ArrowUp":
|
|
90
|
-
e.preventDefault(),
|
|
94
|
+
e.preventDefault(), r ? y(-1) : f();
|
|
91
95
|
break;
|
|
92
96
|
case "Enter":
|
|
93
97
|
case " ":
|
|
94
|
-
e.preventDefault(),
|
|
98
|
+
e.preventDefault(), r ? D(s) : f();
|
|
95
99
|
break;
|
|
96
100
|
case "Escape":
|
|
97
|
-
|
|
101
|
+
r && (e.preventDefault(), l(!1));
|
|
98
102
|
break;
|
|
99
103
|
case "Tab":
|
|
100
104
|
l(!1);
|
|
101
105
|
break;
|
|
102
106
|
}
|
|
103
107
|
},
|
|
104
|
-
className: d(
|
|
108
|
+
className: d(B({ size: N }), R),
|
|
105
109
|
children: [
|
|
106
110
|
/* @__PURE__ */ i(
|
|
107
111
|
"span",
|
|
@@ -114,11 +118,11 @@ const T = j(
|
|
|
114
118
|
}
|
|
115
119
|
),
|
|
116
120
|
/* @__PURE__ */ i(
|
|
117
|
-
|
|
121
|
+
L,
|
|
118
122
|
{
|
|
119
123
|
className: d(
|
|
120
|
-
"size-4 text-muted-foreground transition-transform duration-
|
|
121
|
-
|
|
124
|
+
"size-4 text-muted-foreground transition-transform duration-150 ease-out motion-reduce:transition-none",
|
|
125
|
+
r && "rotate-180"
|
|
122
126
|
),
|
|
123
127
|
"aria-hidden": !0
|
|
124
128
|
}
|
|
@@ -126,14 +130,14 @@ const T = j(
|
|
|
126
130
|
]
|
|
127
131
|
}
|
|
128
132
|
),
|
|
129
|
-
/* @__PURE__ */ i(
|
|
130
|
-
|
|
133
|
+
/* @__PURE__ */ i($, { reducedMotion: "user", children: /* @__PURE__ */ i(C, { children: r && /* @__PURE__ */ b(
|
|
134
|
+
K.ul,
|
|
131
135
|
{
|
|
132
136
|
ref: k,
|
|
133
137
|
id: u,
|
|
134
138
|
role: "listbox",
|
|
135
|
-
"aria-activedescendant":
|
|
136
|
-
variants:
|
|
139
|
+
"aria-activedescendant": s >= 0 ? `${u}-opt-${s}` : void 0,
|
|
140
|
+
variants: T,
|
|
137
141
|
initial: "hidden",
|
|
138
142
|
animate: "visible",
|
|
139
143
|
exit: "hidden",
|
|
@@ -146,10 +150,10 @@ const T = j(
|
|
|
146
150
|
v === "top" ? "bottom-full mb-1.5" : "top-full mt-1.5"
|
|
147
151
|
),
|
|
148
152
|
children: [
|
|
149
|
-
/* @__PURE__ */ i(
|
|
150
|
-
|
|
151
|
-
const n = e.value === c, p = t ===
|
|
152
|
-
return /* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ i(_, { origin: v === "top" ? "bottom" : "top" }),
|
|
154
|
+
o.map((e, t) => {
|
|
155
|
+
const n = e.value === c, p = t === s;
|
|
156
|
+
return /* @__PURE__ */ b(
|
|
153
157
|
"li",
|
|
154
158
|
{
|
|
155
159
|
id: `${u}-opt-${t}`,
|
|
@@ -166,7 +170,7 @@ const T = j(
|
|
|
166
170
|
),
|
|
167
171
|
children: [
|
|
168
172
|
/* @__PURE__ */ i("span", { className: "truncate", children: e.label }),
|
|
169
|
-
n && /* @__PURE__ */ i(
|
|
173
|
+
n && /* @__PURE__ */ i(O, { className: "size-4 shrink-0", "aria-hidden": !0 })
|
|
170
174
|
]
|
|
171
175
|
},
|
|
172
176
|
e.value
|
|
@@ -178,7 +182,7 @@ const T = j(
|
|
|
178
182
|
] });
|
|
179
183
|
}
|
|
180
184
|
);
|
|
181
|
-
|
|
185
|
+
U.displayName = "Select";
|
|
182
186
|
export {
|
|
183
|
-
|
|
187
|
+
U as Select
|
|
184
188
|
};
|
|
@@ -1,61 +1,64 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as c, jsx as
|
|
3
|
-
import * as
|
|
2
|
+
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import * as d from "react";
|
|
4
4
|
import { cva as g } from "class-variance-authority";
|
|
5
|
-
import { cn as
|
|
6
|
-
const
|
|
5
|
+
import { cn as a } from "../lib/cn.js";
|
|
6
|
+
const p = g(
|
|
7
7
|
"flex w-full items-center gap-3 rounded-lg bg-card px-4 py-3 text-left",
|
|
8
8
|
{
|
|
9
9
|
variants: {
|
|
10
10
|
isPressable: {
|
|
11
|
-
true:
|
|
12
|
-
"cursor-pointer outline-none",
|
|
13
|
-
"transition-[background-color,transform] duration-(--duration-fast) ease-out",
|
|
14
|
-
"hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring",
|
|
15
|
-
"active:scale-(--scale-press) motion-reduce:transition-none"
|
|
16
|
-
),
|
|
11
|
+
true: "relative",
|
|
17
12
|
false: ""
|
|
18
13
|
}
|
|
19
14
|
},
|
|
20
15
|
defaultVariants: { isPressable: !1 }
|
|
21
16
|
}
|
|
22
|
-
),
|
|
23
|
-
({ className:
|
|
24
|
-
const
|
|
17
|
+
), x = d.forwardRef(
|
|
18
|
+
({ className: i, icon: s, label: t, description: n, action: r, onSelect: o, ...f }, m) => {
|
|
19
|
+
const l = !!o;
|
|
25
20
|
return /* @__PURE__ */ c(
|
|
26
21
|
"div",
|
|
27
22
|
{
|
|
28
|
-
ref:
|
|
23
|
+
ref: m,
|
|
29
24
|
"data-slot": "setting-row",
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
onClick: e,
|
|
33
|
-
onKeyDown: a ? (t) => {
|
|
34
|
-
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), e == null || e());
|
|
35
|
-
} : void 0,
|
|
36
|
-
className: o(x({ isPressable: a }), r),
|
|
37
|
-
...m,
|
|
25
|
+
className: a(p({ isPressable: l }), i),
|
|
26
|
+
...f,
|
|
38
27
|
children: [
|
|
39
|
-
|
|
28
|
+
l && /* @__PURE__ */ e(
|
|
29
|
+
"button",
|
|
30
|
+
{
|
|
31
|
+
type: "button",
|
|
32
|
+
"aria-label": typeof t == "string" ? t : "Open setting",
|
|
33
|
+
onClick: o,
|
|
34
|
+
className: a(
|
|
35
|
+
"absolute inset-0 rounded-lg outline-none",
|
|
36
|
+
"transition-[background-color,transform] duration-150 ease-out",
|
|
37
|
+
"hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring",
|
|
38
|
+
"active:scale-[0.97] motion-reduce:transition-none"
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
s && /* @__PURE__ */ e(
|
|
40
43
|
"span",
|
|
41
44
|
{
|
|
42
45
|
"aria-hidden": !0,
|
|
43
|
-
className: "flex size-5 shrink-0 items-center justify-center text-tertiary [&>svg]:size-4.5",
|
|
44
|
-
children:
|
|
46
|
+
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
|
|
45
48
|
}
|
|
46
49
|
),
|
|
47
|
-
/* @__PURE__ */ c("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
|
|
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 }),
|
|
52
|
+
n && /* @__PURE__ */ e("div", { className: "min-w-0 text-xs text-tertiary", children: n })
|
|
50
53
|
] }),
|
|
51
|
-
|
|
54
|
+
r && // The trailing control owns its own click — a pressable row must not
|
|
52
55
|
// also fire when the reader aims at the button inside it.
|
|
53
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ e(
|
|
54
57
|
"span",
|
|
55
58
|
{
|
|
56
|
-
className: "shrink-0",
|
|
57
|
-
onClick: (
|
|
58
|
-
children:
|
|
59
|
+
className: "relative z-20 shrink-0",
|
|
60
|
+
onClick: (u) => u.stopPropagation(),
|
|
61
|
+
children: r
|
|
59
62
|
}
|
|
60
63
|
)
|
|
61
64
|
]
|
|
@@ -63,24 +66,24 @@ const x = g(
|
|
|
63
66
|
);
|
|
64
67
|
}
|
|
65
68
|
);
|
|
66
|
-
|
|
67
|
-
const v =
|
|
68
|
-
({ className:
|
|
69
|
+
x.displayName = "SettingRow";
|
|
70
|
+
const v = d.forwardRef(
|
|
71
|
+
({ className: i, ...s }, t) => /* @__PURE__ */ e(
|
|
69
72
|
"div",
|
|
70
73
|
{
|
|
71
|
-
ref:
|
|
74
|
+
ref: t,
|
|
72
75
|
"data-slot": "setting-list",
|
|
73
|
-
className:
|
|
76
|
+
className: a(
|
|
74
77
|
"flex w-full flex-col gap-0.5 rounded-xl bg-surface p-1",
|
|
75
|
-
|
|
78
|
+
i
|
|
76
79
|
),
|
|
77
|
-
...
|
|
80
|
+
...s
|
|
78
81
|
}
|
|
79
82
|
)
|
|
80
83
|
);
|
|
81
84
|
v.displayName = "SettingList";
|
|
82
85
|
export {
|
|
83
86
|
v as SettingList,
|
|
84
|
-
|
|
85
|
-
|
|
87
|
+
x as SettingRow,
|
|
88
|
+
p as settingRowVariants
|
|
86
89
|
};
|
package/components/sidebar.d.ts
CHANGED
|
@@ -79,8 +79,8 @@ export interface SidebarActionProps extends React.ButtonHTMLAttributes<HTMLButto
|
|
|
79
79
|
icon?: React.ReactNode;
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
82
|
-
* Primary action for the rail (e.g. "Ask …").
|
|
83
|
-
*
|
|
82
|
+
* Primary action for the rail (e.g. "Ask …"). It shares the quiet navigation
|
|
83
|
+
* treatment at rest and collapses to a centered square icon button.
|
|
84
84
|
*/
|
|
85
85
|
export declare const SidebarAction: React.ForwardRefExoticComponent<SidebarActionProps & React.RefAttributes<HTMLButtonElement>>;
|
|
86
86
|
export interface SidebarHistoryProps extends React.HTMLAttributes<HTMLDivElement> {
|