@actioneer/ads 0.5.3 → 0.5.5
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/accordion.js +15 -15
- package/components/agent-icon.d.ts +64 -0
- package/components/agent-icon.js +251 -0
- package/components/ai-elements/agent-trace.d.ts +8 -1
- package/components/ai-elements/agent-trace.js +164 -129
- package/components/ai-elements/chain-of-thought-icon.d.ts +42 -0
- package/components/ai-elements/chain-of-thought-icon.js +283 -0
- package/components/ai-elements/chain-of-thought.js +7 -7
- package/components/ai-elements/chart.js +38 -35
- package/components/ai-elements/index.d.ts +1 -0
- package/components/ai-elements/inline-citation.js +40 -40
- package/components/ai-elements/message.js +5 -5
- package/components/ai-elements/queue.js +1 -1
- package/components/ai-elements/research-activity.d.ts +2 -0
- package/components/ai-elements/research-activity.js +79 -81
- package/components/ai-elements/task-progress.js +2 -2
- package/components/ai-elements/tool.d.ts +4 -2
- package/components/ai-elements/tool.js +74 -54
- package/components/ai-elements/transcript.js +1 -1
- package/components/alert.js +1 -1
- package/components/answer.d.ts +2643 -311
- package/components/answer.js +1836 -425
- package/components/assistant-ui/answer-tool-ui.js +23 -28
- package/components/assistant-ui/chain-of-thought.d.ts +7 -2
- package/components/assistant-ui/composer-harness.js +20 -16
- package/components/assistant-ui/reasoning.js +35 -31
- package/components/assistant-ui/tool-fallback.js +125 -122
- package/components/assistant-ui/tool-group.d.ts +3 -1
- package/components/assistant-ui/tool-group.js +48 -43
- package/components/audio-waveform.js +14 -14
- package/components/autocomplete.js +52 -48
- package/components/avatar.js +58 -44
- package/components/badge.js +3 -3
- package/components/brand-texture.js +1 -1
- package/components/breadcrumbs.d.ts +27 -1
- package/components/breadcrumbs.js +94 -42
- package/components/button.js +15 -15
- package/components/carousel.js +10 -10
- package/components/chart.d.ts +14 -0
- package/components/chart.js +747 -614
- package/components/chip.js +3 -3
- package/components/code-block.d.ts +39 -17
- package/components/code-block.js +153 -104
- package/components/command-palette.js +27 -25
- package/components/connector-card.js +2 -2
- package/components/dropdown.js +65 -61
- package/components/empty-state.js +15 -15
- package/components/field.js +23 -23
- package/components/index.d.ts +5 -0
- package/components/index.js +523 -470
- package/components/infinite-canvas.js +60 -60
- package/components/kbd.js +6 -6
- package/components/link.js +6 -6
- package/components/modal.js +22 -20
- package/components/page-header.js +1 -1
- package/components/pagination.js +22 -22
- package/components/pixel-blast-svg.js +1 -1
- package/components/pixel-icon.d.ts +31 -0
- package/components/pixel-icon.js +733 -0
- package/components/popover.js +46 -42
- package/components/ripple.d.ts +29 -0
- package/components/ripple.js +17 -0
- package/components/segmented.js +24 -23
- package/components/select.js +71 -67
- package/components/selection-action-bar.js +22 -22
- package/components/sidebar.d.ts +11 -3
- package/components/sidebar.js +161 -148
- package/components/stepper.d.ts +2 -0
- package/components/stepper.js +80 -43
- package/components/table.d.ts +7 -0
- package/components/table.js +223 -155
- package/components/tabs.d.ts +3 -1
- package/components/tabs.js +165 -144
- package/components/textarea.js +10 -8
- package/components/toast.js +48 -46
- package/components/tooltip.js +61 -59
- package/components/tree.js +44 -41
- package/components/typography.d.ts +1 -1
- package/components/typography.js +25 -25
- package/components/viz-charts.d.ts +62 -0
- package/components/viz-charts.js +408 -0
- package/fonts/aribau-grotesk-500.otf +0 -0
- package/fonts/aribau-grotesk-600.woff2 +0 -0
- package/fonts.css +6 -4
- package/lib/icons.d.ts +411 -402
- package/lib/icons.js +109 -107
- package/lib/viz-format.d.ts +25 -0
- package/lib/viz-format.js +40 -0
- package/llms.txt +111 -8
- package/manifest.json +1096 -58
- package/package.json +5 -5
- package/styles.css +226 -96
- package/theme.css +220 -92
- package/fonts/aribau-grotesk-400.otf +0 -0
- package/fonts/aribau-grotesk-700.otf +0 -0
package/components/popover.js
CHANGED
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as g } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as g, jsxs as b } from "react/jsx-runtime";
|
|
3
3
|
import * as n from "react";
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { MotionConfig as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { floatVariants as
|
|
8
|
-
|
|
4
|
+
import { createPortal as C } from "react-dom";
|
|
5
|
+
import { MotionConfig as y, AnimatePresence as L, motion as R } from "motion/react";
|
|
6
|
+
import { cn as k } from "../lib/cn.js";
|
|
7
|
+
import { floatVariants as z } from "../lib/motion.js";
|
|
8
|
+
import { Ripple as O } from "./ripple.js";
|
|
9
|
+
const h = {
|
|
9
10
|
start: "top left",
|
|
10
11
|
center: "top",
|
|
11
12
|
end: "top right"
|
|
12
|
-
},
|
|
13
|
-
function
|
|
14
|
-
const e = n.useContext(
|
|
13
|
+
}, x = n.createContext(null);
|
|
14
|
+
function E(o) {
|
|
15
|
+
const e = n.useContext(x);
|
|
15
16
|
if (!e)
|
|
16
|
-
throw new Error(`${
|
|
17
|
+
throw new Error(`${o} must be used within a <Popover>.`);
|
|
17
18
|
return e;
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
-
const [d,
|
|
21
|
-
return /* @__PURE__ */ g(
|
|
20
|
+
function T({ children: o, defaultOpen: e = !1 }) {
|
|
21
|
+
const [d, a] = n.useState(e), u = n.useRef(null);
|
|
22
|
+
return /* @__PURE__ */ g(x.Provider, { value: { open: d, setOpen: a, triggerRef: u }, children: o });
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
-
const { open: e, setOpen: d, triggerRef:
|
|
24
|
+
function W({ children: o }) {
|
|
25
|
+
const { open: e, setOpen: d, triggerRef: a } = E("PopoverTrigger"), u = o;
|
|
25
26
|
return n.cloneElement(u, {
|
|
26
|
-
ref:
|
|
27
|
+
ref: a,
|
|
27
28
|
"aria-expanded": e,
|
|
28
29
|
"aria-haspopup": !0,
|
|
29
30
|
onClick: (i) => {
|
|
@@ -32,46 +33,46 @@ function S({ children: r }) {
|
|
|
32
33
|
}
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
-
className:
|
|
36
|
+
function K({
|
|
37
|
+
className: o,
|
|
37
38
|
align: e = "start",
|
|
38
39
|
sideOffset: d = 8,
|
|
39
|
-
children:
|
|
40
|
+
children: a,
|
|
40
41
|
...u
|
|
41
42
|
}) {
|
|
42
|
-
const { open: i, setOpen: f, triggerRef: s } =
|
|
43
|
+
const { open: i, setOpen: f, triggerRef: s } = E("PopoverContent"), w = n.useRef(null), [c, P] = n.useState(null);
|
|
43
44
|
return n.useLayoutEffect(() => {
|
|
44
45
|
if (!i) return;
|
|
45
46
|
const p = s.current;
|
|
46
47
|
if (!p) return;
|
|
47
|
-
const
|
|
48
|
+
const r = () => {
|
|
48
49
|
var v;
|
|
49
50
|
const t = p.getBoundingClientRect(), m = ((v = w.current) == null ? void 0 : v.offsetWidth) ?? 0;
|
|
50
|
-
let
|
|
51
|
-
e === "center" ?
|
|
51
|
+
let l = t.left;
|
|
52
|
+
e === "center" ? l = t.left + t.width / 2 - m / 2 : e === "end" && (l = t.right - m), P({ top: t.bottom + d, left: l });
|
|
52
53
|
};
|
|
53
|
-
return
|
|
54
|
-
window.removeEventListener("resize",
|
|
54
|
+
return r(), window.addEventListener("resize", r), window.addEventListener("scroll", r, !0), () => {
|
|
55
|
+
window.removeEventListener("resize", r), window.removeEventListener("scroll", r, !0);
|
|
55
56
|
};
|
|
56
57
|
}, [i, e, d, s]), n.useEffect(() => {
|
|
57
58
|
if (!i) return;
|
|
58
59
|
const p = (t) => {
|
|
59
60
|
t.key === "Escape" && f(!1);
|
|
60
|
-
},
|
|
61
|
-
var
|
|
61
|
+
}, r = (t) => {
|
|
62
|
+
var l, v;
|
|
62
63
|
const m = t.target;
|
|
63
|
-
(
|
|
64
|
+
(l = w.current) != null && l.contains(m) || (v = s.current) != null && v.contains(m) || f(!1);
|
|
64
65
|
};
|
|
65
|
-
return document.addEventListener("keydown", p), document.addEventListener("pointerdown",
|
|
66
|
-
document.removeEventListener("keydown", p), document.removeEventListener("pointerdown",
|
|
66
|
+
return document.addEventListener("keydown", p), document.addEventListener("pointerdown", r), () => {
|
|
67
|
+
document.removeEventListener("keydown", p), document.removeEventListener("pointerdown", r);
|
|
67
68
|
};
|
|
68
|
-
}, [i, f, s]),
|
|
69
|
-
/* @__PURE__ */ g(
|
|
70
|
-
|
|
69
|
+
}, [i, f, s]), C(
|
|
70
|
+
/* @__PURE__ */ g(y, { reducedMotion: "user", children: /* @__PURE__ */ g(L, { children: i && /* @__PURE__ */ b(
|
|
71
|
+
R.div,
|
|
71
72
|
{
|
|
72
73
|
ref: w,
|
|
73
74
|
role: "dialog",
|
|
74
|
-
variants:
|
|
75
|
+
variants: z,
|
|
75
76
|
initial: "hidden",
|
|
76
77
|
animate: "visible",
|
|
77
78
|
exit: "hidden",
|
|
@@ -80,22 +81,25 @@ function T({
|
|
|
80
81
|
top: (c == null ? void 0 : c.top) ?? 0,
|
|
81
82
|
left: (c == null ? void 0 : c.left) ?? 0,
|
|
82
83
|
visibility: c ? "visible" : "hidden",
|
|
83
|
-
transformOrigin:
|
|
84
|
+
transformOrigin: h[e]
|
|
84
85
|
},
|
|
85
|
-
className:
|
|
86
|
-
"z-50 min-w-44 rounded-lg border border-border bg-elevated p-3",
|
|
86
|
+
className: k(
|
|
87
|
+
"relative z-50 min-w-44 rounded-lg border border-border bg-elevated p-3",
|
|
87
88
|
"text-xs text-foreground shadow-elevation",
|
|
88
|
-
|
|
89
|
+
o
|
|
89
90
|
),
|
|
90
91
|
...u,
|
|
91
|
-
children:
|
|
92
|
+
children: [
|
|
93
|
+
/* @__PURE__ */ g(O, { origin: h[e] }),
|
|
94
|
+
a
|
|
95
|
+
]
|
|
92
96
|
}
|
|
93
97
|
) }) }),
|
|
94
98
|
document.body
|
|
95
99
|
);
|
|
96
100
|
}
|
|
97
101
|
export {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
102
|
+
T as Popover,
|
|
103
|
+
K as PopoverContent,
|
|
104
|
+
W as PopoverTrigger
|
|
101
105
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ripple — the appearance wash for floating surfaces (principle 3). Drop it as
|
|
3
|
+
* the FIRST child of a `relative` panel and a soft brand tint radiates from the
|
|
4
|
+
* panel's origin corner and fades, once, as the surface mounts — the same
|
|
5
|
+
* origin the panel scales from, so the ripple reads as the surface arriving.
|
|
6
|
+
*
|
|
7
|
+
* <motion.div className="relative …" style={{ transformOrigin: origin }}>
|
|
8
|
+
* <Ripple origin={origin} />
|
|
9
|
+
* {children}
|
|
10
|
+
* </motion.div>
|
|
11
|
+
*
|
|
12
|
+
* It is an absolute, `pointer-events-none`, `z-0` layer clipped to the panel
|
|
13
|
+
* radius (`rounded-[inherit]`), so it sits under the content and never
|
|
14
|
+
* intercepts input. All timing/curve/tint come from tokens (`--ripple-*`,
|
|
15
|
+
* `--ease-out`); reduced-motion drops it entirely. Remount it (via `key`) to
|
|
16
|
+
* replay on each open.
|
|
17
|
+
*/
|
|
18
|
+
export interface RippleProps {
|
|
19
|
+
/**
|
|
20
|
+
* CSS position keywords the wash emanates from — pass the panel's own
|
|
21
|
+
* `transformOrigin` (e.g. "top left", "bottom right", "center").
|
|
22
|
+
*/
|
|
23
|
+
origin?: string;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function Ripple({ origin, className }: RippleProps): import("react").JSX.Element;
|
|
27
|
+
export declare namespace Ripple {
|
|
28
|
+
var displayName: string;
|
|
29
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
3
|
+
import { cn as r } from "../lib/cn.js";
|
|
4
|
+
function n({ origin: e = "center", className: i }) {
|
|
5
|
+
return /* @__PURE__ */ p(
|
|
6
|
+
"span",
|
|
7
|
+
{
|
|
8
|
+
"aria-hidden": "true",
|
|
9
|
+
className: r("ads-ripple", i),
|
|
10
|
+
style: { "--ripple-origin": e }
|
|
11
|
+
}
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
n.displayName = "Ripple";
|
|
15
|
+
export {
|
|
16
|
+
n as Ripple
|
|
17
|
+
};
|
package/components/segmented.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as n, jsxs as b } from "react/jsx-runtime";
|
|
3
|
-
import * as
|
|
4
|
-
import { MotionConfig as
|
|
5
|
-
import { cva as
|
|
3
|
+
import * as l from "react";
|
|
4
|
+
import { MotionConfig as h, motion as v } from "motion/react";
|
|
5
|
+
import { cva as d } from "class-variance-authority";
|
|
6
6
|
import { cn as c } from "../lib/cn.js";
|
|
7
7
|
import { EASE_OUT as w } from "../lib/motion.js";
|
|
8
|
-
const y =
|
|
9
|
-
// Borderless
|
|
10
|
-
// provides the definition; a stroke around the
|
|
11
|
-
// heavier control).
|
|
12
|
-
"inline-flex items-center gap-1 rounded-
|
|
8
|
+
const y = d(
|
|
9
|
+
// Borderless recessed track on ink-200 (bg-surface) — matches the Tabs
|
|
10
|
+
// primary track (the pill provides the definition; a stroke around the
|
|
11
|
+
// track read as a second, heavier control).
|
|
12
|
+
"inline-flex items-center gap-1 rounded-full bg-surface p-1",
|
|
13
13
|
{
|
|
14
14
|
variants: {
|
|
15
15
|
size: {
|
|
@@ -20,11 +20,11 @@ const y = l(
|
|
|
20
20
|
},
|
|
21
21
|
defaultVariants: { size: "md" }
|
|
22
22
|
}
|
|
23
|
-
),
|
|
23
|
+
), D = d(
|
|
24
24
|
c(
|
|
25
25
|
// The active pill 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 rounded-
|
|
27
|
+
"relative inline-flex items-center justify-center whitespace-nowrap rounded-full font-normal select-none",
|
|
28
28
|
"transition-colors duration-(--duration-fast) cursor-pointer",
|
|
29
29
|
"outline-none focus-visible:ring-3 focus-visible:ring-ring",
|
|
30
30
|
"disabled:pointer-events-none disabled:opacity-50"
|
|
@@ -43,10 +43,10 @@ const y = l(
|
|
|
43
43
|
},
|
|
44
44
|
defaultVariants: { size: "md", selected: !1 }
|
|
45
45
|
}
|
|
46
|
-
),
|
|
47
|
-
const
|
|
48
|
-
const t = r.findIndex((x) => x.value === a),
|
|
49
|
-
|
|
46
|
+
), k = l.forwardRef(({ options: r, value: a, onChange: o, size: s, className: u, ...m }, f) => {
|
|
47
|
+
const p = l.useId(), i = (e) => {
|
|
48
|
+
const t = r.findIndex((x) => x.value === a), g = ((t < 0 ? 0 : t) + e + r.length) % r.length;
|
|
49
|
+
o(r[g].value);
|
|
50
50
|
};
|
|
51
51
|
return /* @__PURE__ */ n(
|
|
52
52
|
"div",
|
|
@@ -65,9 +65,9 @@ const y = l(
|
|
|
65
65
|
break;
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
|
-
className: c(y({ size:
|
|
68
|
+
className: c(y({ size: s }), u),
|
|
69
69
|
...m,
|
|
70
|
-
children: /* @__PURE__ */ n(
|
|
70
|
+
children: /* @__PURE__ */ n(h, { reducedMotion: "user", children: r.map((e) => {
|
|
71
71
|
const t = e.value === a;
|
|
72
72
|
return /* @__PURE__ */ b(
|
|
73
73
|
"button",
|
|
@@ -76,16 +76,17 @@ const y = l(
|
|
|
76
76
|
role: "radio",
|
|
77
77
|
"aria-checked": t,
|
|
78
78
|
tabIndex: t ? 0 : -1,
|
|
79
|
-
onClick: () =>
|
|
80
|
-
className:
|
|
79
|
+
onClick: () => o(e.value),
|
|
80
|
+
className: D({ size: s, selected: t }),
|
|
81
81
|
children: [
|
|
82
82
|
t && /* @__PURE__ */ n(
|
|
83
|
-
|
|
83
|
+
v.span,
|
|
84
84
|
{
|
|
85
|
-
layoutId:
|
|
85
|
+
layoutId: p,
|
|
86
86
|
"aria-hidden": !0,
|
|
87
|
+
layoutDependency: a,
|
|
87
88
|
transition: { duration: 0.2, ease: w },
|
|
88
|
-
className: "absolute inset-0 rounded-
|
|
89
|
+
className: "absolute inset-0 rounded-full bg-elevated shadow-elevation"
|
|
89
90
|
}
|
|
90
91
|
),
|
|
91
92
|
/* @__PURE__ */ n("span", { className: "relative", children: e.label })
|
|
@@ -97,7 +98,7 @@ const y = l(
|
|
|
97
98
|
}
|
|
98
99
|
);
|
|
99
100
|
});
|
|
100
|
-
|
|
101
|
+
k.displayName = "SegmentedControl";
|
|
101
102
|
export {
|
|
102
|
-
|
|
103
|
+
k as SegmentedControl
|
|
103
104
|
};
|
package/components/select.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as m, jsx as i } from "react/jsx-runtime";
|
|
3
3
|
import * as s from "react";
|
|
4
4
|
import { cva as j } from "class-variance-authority";
|
|
5
5
|
import { MotionConfig as M, AnimatePresence as V, motion as $ } from "motion/react";
|
|
@@ -7,7 +7,8 @@ import { ChevronDown as C, Check as K } from "../lib/icons.js";
|
|
|
7
7
|
import { cn as d } from "../lib/cn.js";
|
|
8
8
|
import { inputBaseClass as L } from "./field.js";
|
|
9
9
|
import { floatVariants as O } from "../lib/motion.js";
|
|
10
|
-
|
|
10
|
+
import { Ripple as P } from "./ripple.js";
|
|
11
|
+
const T = j(
|
|
11
12
|
d(
|
|
12
13
|
L,
|
|
13
14
|
"items-center justify-between gap-2 text-left cursor-pointer",
|
|
@@ -23,93 +24,93 @@ const P = j(
|
|
|
23
24
|
},
|
|
24
25
|
defaultVariants: { size: "md" }
|
|
25
26
|
}
|
|
26
|
-
),
|
|
27
|
+
), _ = s.forwardRef(
|
|
27
28
|
({
|
|
28
|
-
items:
|
|
29
|
+
items: r,
|
|
29
30
|
value: c,
|
|
30
|
-
onChange:
|
|
31
|
+
onChange: b,
|
|
31
32
|
placeholder: I = "Select…",
|
|
32
33
|
size: N,
|
|
33
|
-
disabled:
|
|
34
|
+
disabled: w,
|
|
34
35
|
isInvalid: E,
|
|
35
|
-
className:
|
|
36
|
-
id:
|
|
37
|
-
placement:
|
|
36
|
+
className: R,
|
|
37
|
+
id: A,
|
|
38
|
+
placement: v = "bottom"
|
|
38
39
|
}, S) => {
|
|
39
|
-
const [
|
|
40
|
-
const e =
|
|
41
|
-
return e >= 0 && !
|
|
42
|
-
}, [
|
|
40
|
+
const [o, l] = s.useState(!1), [a, x] = s.useState(-1), g = s.useRef(null), k = s.useRef(null), u = s.useId(), h = r.find((e) => e.value === c), z = s.useCallback(() => {
|
|
41
|
+
const e = r.findIndex((t) => t.value === c);
|
|
42
|
+
return e >= 0 && !r[e].disabled ? e : r.findIndex((t) => !t.disabled);
|
|
43
|
+
}, [r, c]);
|
|
43
44
|
s.useEffect(() => {
|
|
44
|
-
if (!
|
|
45
|
+
if (!o) return;
|
|
45
46
|
const e = (t) => {
|
|
46
47
|
var n;
|
|
47
48
|
(n = g.current) != null && n.contains(t.target) || l(!1);
|
|
48
49
|
};
|
|
49
50
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
50
|
-
}, [
|
|
51
|
+
}, [o]), s.useEffect(() => {
|
|
51
52
|
var t;
|
|
52
|
-
if (!
|
|
53
|
+
if (!o || a < 0) return;
|
|
53
54
|
const e = (t = k.current) == null ? void 0 : t.children[a];
|
|
54
55
|
e == null || e.scrollIntoView({ block: "nearest" });
|
|
55
|
-
}, [
|
|
56
|
+
}, [o, a]);
|
|
56
57
|
const f = () => {
|
|
57
|
-
|
|
58
|
+
w || (x(z()), l(!0));
|
|
58
59
|
}, y = (e) => {
|
|
59
|
-
|
|
60
|
+
x((t) => {
|
|
60
61
|
let n = t;
|
|
61
|
-
for (let p = 0; p <
|
|
62
|
-
if (n = (n + e +
|
|
62
|
+
for (let p = 0; p < r.length; p++)
|
|
63
|
+
if (n = (n + e + r.length) % r.length, !r[n].disabled) return n;
|
|
63
64
|
return t;
|
|
64
65
|
});
|
|
65
66
|
}, D = (e) => {
|
|
66
|
-
const t =
|
|
67
|
-
!t || t.disabled || (
|
|
67
|
+
const t = r[e];
|
|
68
|
+
!t || t.disabled || (b == null || b(t.value), l(!1));
|
|
68
69
|
};
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
-
/* @__PURE__ */
|
|
70
|
+
return /* @__PURE__ */ m("div", { ref: g, className: "relative", children: [
|
|
71
|
+
/* @__PURE__ */ m(
|
|
71
72
|
"button",
|
|
72
73
|
{
|
|
73
74
|
ref: S,
|
|
74
|
-
id:
|
|
75
|
+
id: A,
|
|
75
76
|
type: "button",
|
|
76
77
|
role: "combobox",
|
|
77
78
|
"aria-haspopup": "listbox",
|
|
78
|
-
"aria-expanded":
|
|
79
|
+
"aria-expanded": o,
|
|
79
80
|
"aria-controls": u,
|
|
80
81
|
"aria-invalid": E || void 0,
|
|
81
|
-
disabled:
|
|
82
|
-
onClick: () =>
|
|
82
|
+
disabled: w,
|
|
83
|
+
onClick: () => o ? l(!1) : f(),
|
|
83
84
|
onKeyDown: (e) => {
|
|
84
85
|
switch (e.key) {
|
|
85
86
|
case "ArrowDown":
|
|
86
|
-
e.preventDefault(),
|
|
87
|
+
e.preventDefault(), o ? y(1) : f();
|
|
87
88
|
break;
|
|
88
89
|
case "ArrowUp":
|
|
89
|
-
e.preventDefault(),
|
|
90
|
+
e.preventDefault(), o ? y(-1) : f();
|
|
90
91
|
break;
|
|
91
92
|
case "Enter":
|
|
92
93
|
case " ":
|
|
93
|
-
e.preventDefault(),
|
|
94
|
+
e.preventDefault(), o ? D(a) : f();
|
|
94
95
|
break;
|
|
95
96
|
case "Escape":
|
|
96
|
-
|
|
97
|
+
o && (e.preventDefault(), l(!1));
|
|
97
98
|
break;
|
|
98
99
|
case "Tab":
|
|
99
100
|
l(!1);
|
|
100
101
|
break;
|
|
101
102
|
}
|
|
102
103
|
},
|
|
103
|
-
className: d(
|
|
104
|
+
className: d(T({ size: N }), R),
|
|
104
105
|
children: [
|
|
105
106
|
/* @__PURE__ */ i(
|
|
106
107
|
"span",
|
|
107
108
|
{
|
|
108
109
|
className: d(
|
|
109
110
|
"truncate",
|
|
110
|
-
!
|
|
111
|
+
!h && "text-muted-foreground"
|
|
111
112
|
),
|
|
112
|
-
children:
|
|
113
|
+
children: h ? h.label : I
|
|
113
114
|
}
|
|
114
115
|
),
|
|
115
116
|
/* @__PURE__ */ i(
|
|
@@ -117,7 +118,7 @@ const P = j(
|
|
|
117
118
|
{
|
|
118
119
|
className: d(
|
|
119
120
|
"size-4 text-muted-foreground transition-transform duration-(--duration-fast) ease-out motion-reduce:transition-none",
|
|
120
|
-
|
|
121
|
+
o && "rotate-180"
|
|
121
122
|
),
|
|
122
123
|
"aria-hidden": !0
|
|
123
124
|
}
|
|
@@ -125,7 +126,7 @@ const P = j(
|
|
|
125
126
|
]
|
|
126
127
|
}
|
|
127
128
|
),
|
|
128
|
-
/* @__PURE__ */ i(M, { reducedMotion: "user", children: /* @__PURE__ */ i(V, { children:
|
|
129
|
+
/* @__PURE__ */ i(M, { reducedMotion: "user", children: /* @__PURE__ */ i(V, { children: o && /* @__PURE__ */ m(
|
|
129
130
|
$.ul,
|
|
130
131
|
{
|
|
131
132
|
ref: k,
|
|
@@ -137,44 +138,47 @@ const P = j(
|
|
|
137
138
|
animate: "visible",
|
|
138
139
|
exit: "hidden",
|
|
139
140
|
style: {
|
|
140
|
-
transformOrigin:
|
|
141
|
+
transformOrigin: v === "top" ? "bottom" : "top"
|
|
141
142
|
},
|
|
142
143
|
className: d(
|
|
143
144
|
"absolute z-50 max-h-60 w-full overflow-auto p-1",
|
|
144
145
|
"rounded-md border border-border bg-elevated shadow-elevation",
|
|
145
|
-
|
|
146
|
+
v === "top" ? "bottom-full mb-1.5" : "top-full mt-1.5"
|
|
146
147
|
),
|
|
147
|
-
children:
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
148
|
+
children: [
|
|
149
|
+
/* @__PURE__ */ i(P, { origin: v === "top" ? "bottom" : "top" }),
|
|
150
|
+
r.map((e, t) => {
|
|
151
|
+
const n = e.value === c, p = t === a;
|
|
152
|
+
return /* @__PURE__ */ m(
|
|
153
|
+
"li",
|
|
154
|
+
{
|
|
155
|
+
id: `${u}-opt-${t}`,
|
|
156
|
+
role: "option",
|
|
157
|
+
"aria-selected": n,
|
|
158
|
+
"aria-disabled": e.disabled || void 0,
|
|
159
|
+
onMouseEnter: () => !e.disabled && x(t),
|
|
160
|
+
onClick: () => D(t),
|
|
161
|
+
className: d(
|
|
162
|
+
"flex cursor-pointer items-center justify-between gap-2",
|
|
163
|
+
"rounded-sm px-2 py-1.5 text-xs text-foreground select-none",
|
|
164
|
+
p && !e.disabled && "bg-muted",
|
|
165
|
+
e.disabled && "pointer-events-none opacity-50"
|
|
166
|
+
),
|
|
167
|
+
children: [
|
|
168
|
+
/* @__PURE__ */ i("span", { className: "truncate", children: e.label }),
|
|
169
|
+
n && /* @__PURE__ */ i(K, { className: "size-4 shrink-0", "aria-hidden": !0 })
|
|
170
|
+
]
|
|
171
|
+
},
|
|
172
|
+
e.value
|
|
173
|
+
);
|
|
174
|
+
})
|
|
175
|
+
]
|
|
172
176
|
}
|
|
173
177
|
) }) })
|
|
174
178
|
] });
|
|
175
179
|
}
|
|
176
180
|
);
|
|
177
|
-
|
|
181
|
+
_.displayName = "Select";
|
|
178
182
|
export {
|
|
179
|
-
|
|
183
|
+
_ as Select
|
|
180
184
|
};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import * as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { Button as
|
|
6
|
-
const
|
|
2
|
+
import { jsxs as c, jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import * as i from "react";
|
|
4
|
+
import { cn as s } from "../lib/cn.js";
|
|
5
|
+
import { Button as g } from "./button.js";
|
|
6
|
+
const u = i.forwardRef(
|
|
7
7
|
({
|
|
8
8
|
className: r,
|
|
9
9
|
selectedCount: o,
|
|
10
|
-
selectedLabel:
|
|
11
|
-
actions:
|
|
10
|
+
selectedLabel: n,
|
|
11
|
+
actions: t,
|
|
12
12
|
onClear: e,
|
|
13
13
|
clearLabel: l = "Clear",
|
|
14
14
|
...m
|
|
15
|
-
}, f) => /* @__PURE__ */
|
|
15
|
+
}, f) => /* @__PURE__ */ c(
|
|
16
16
|
"div",
|
|
17
17
|
{
|
|
18
18
|
ref: f,
|
|
19
|
-
className:
|
|
19
|
+
className: s(
|
|
20
20
|
"flex items-center gap-3 rounded-lg bg-brand px-3 py-2 text-xs text-brand-foreground",
|
|
21
21
|
r
|
|
22
22
|
),
|
|
23
23
|
...m,
|
|
24
24
|
children: [
|
|
25
|
-
/* @__PURE__ */ a("span", { className: "font-
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
|
|
25
|
+
/* @__PURE__ */ a("span", { className: "font-normal tabular-nums", children: n ?? `${o} selected` }),
|
|
26
|
+
/* @__PURE__ */ c("div", { className: "ml-auto flex items-center gap-1", children: [
|
|
27
|
+
t,
|
|
28
28
|
e && /* @__PURE__ */ a(
|
|
29
|
-
|
|
29
|
+
d,
|
|
30
30
|
{
|
|
31
31
|
onClick: e,
|
|
32
32
|
className: "text-brand-foreground/70 hover:text-brand-foreground",
|
|
@@ -38,22 +38,22 @@ const g = c.forwardRef(
|
|
|
38
38
|
}
|
|
39
39
|
)
|
|
40
40
|
);
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
41
|
+
u.displayName = "SelectionActionBar";
|
|
42
|
+
const d = i.forwardRef(({ className: r, variant: o = "ghost", size: n = "xs", ...t }, e) => /* @__PURE__ */ a(
|
|
43
|
+
g,
|
|
44
44
|
{
|
|
45
45
|
ref: e,
|
|
46
46
|
variant: o,
|
|
47
|
-
size:
|
|
48
|
-
className:
|
|
47
|
+
size: n,
|
|
48
|
+
className: s(
|
|
49
49
|
"text-brand-foreground hover:bg-brand-foreground/10 hover:text-brand-foreground focus-visible:ring-brand-foreground",
|
|
50
50
|
r
|
|
51
51
|
),
|
|
52
|
-
...
|
|
52
|
+
...t
|
|
53
53
|
}
|
|
54
54
|
));
|
|
55
|
-
|
|
55
|
+
d.displayName = "SelectionActionBarAction";
|
|
56
56
|
export {
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
u as SelectionActionBar,
|
|
58
|
+
d as SelectionActionBarAction
|
|
59
59
|
};
|
package/components/sidebar.d.ts
CHANGED
|
@@ -36,7 +36,10 @@ export declare const Sidebar: React.ForwardRefExoticComponent<SidebarProps & Rea
|
|
|
36
36
|
* Collapse toggle. Place inside SidebarHeader. Shows a tooltip with the ⌘B
|
|
37
37
|
* shortcut, and lifts to a white chip on hover.
|
|
38
38
|
*/
|
|
39
|
-
export declare function SidebarTrigger({ className, onClick, ...props }: React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
39
|
+
export declare function SidebarTrigger({ className, onClick, tooltipSide, ...props }: React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
40
|
+
/** Which side the Collapse/Expand tooltip opens on. Default `right`. */
|
|
41
|
+
tooltipSide?: "top" | "right" | "bottom" | "left";
|
|
42
|
+
}): React.JSX.Element;
|
|
40
43
|
export interface SidebarBrandProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
41
44
|
/** The brand mark (img/svg) — `--sidebar-logo` (20px) centered in a `--sidebar-item` (32px) square, same box as every other rail icon. */
|
|
42
45
|
logo: React.ReactNode;
|
|
@@ -44,10 +47,11 @@ export interface SidebarBrandProps extends React.HTMLAttributes<HTMLDivElement>
|
|
|
44
47
|
href?: string;
|
|
45
48
|
/** Accessible label for the logo link. */
|
|
46
49
|
label?: string;
|
|
47
|
-
/**
|
|
50
|
+
/** Render the collapse/expand trigger: next to the actions when expanded, in
|
|
51
|
+
* the logo slot when collapsed. Default true. */
|
|
48
52
|
showTrigger?: boolean;
|
|
49
53
|
/** Persistent header actions (e.g. a global-search button), right-aligned
|
|
50
|
-
* next to the
|
|
54
|
+
* next to the collapse trigger. Hidden while collapsed. */
|
|
51
55
|
children?: React.ReactNode;
|
|
52
56
|
}
|
|
53
57
|
/**
|
|
@@ -112,6 +116,10 @@ export interface SidebarAccountProps extends Omit<React.AnchorHTMLAttributes<HTM
|
|
|
112
116
|
role?: React.ReactNode;
|
|
113
117
|
/** Avatar image; falls back to initials from `name`. */
|
|
114
118
|
src?: string;
|
|
119
|
+
/** Hide the leading avatar, showing the name/role only. The collapsed rail
|
|
120
|
+
* still shows a person glyph so the account entry never becomes an empty
|
|
121
|
+
* square. */
|
|
122
|
+
hideAvatar?: boolean;
|
|
115
123
|
}
|
|
116
124
|
/**
|
|
117
125
|
* Account block for the rail footer — avatar + name/role. Collapses to just the
|