@actioneer/ads 0.5.7 → 0.5.9
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 +133 -120
- package/components/ai-elements/chain-of-thought.d.ts +1 -1
- 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.js +1 -1
- package/components/answer.js +115 -114
- package/components/assistant-ui/action-bar.js +94 -48
- package/components/assistant-ui/attachment.js +103 -75
- 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 +11 -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.js +22 -22
- 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.d.ts +1 -0
- package/components/avatar.js +27 -26
- package/components/badge.d.ts +1 -1
- package/components/breadcrumbs.d.ts +2 -0
- package/components/breadcrumbs.js +52 -50
- 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.d.ts +6 -0
- package/components/chart.js +743 -672
- 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 +18 -11
- package/components/drawer.js +81 -78
- package/components/dropdown.d.ts +2 -0
- package/components/dropdown.js +88 -79
- package/components/empty-state.d.ts +1 -1
- 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 +3 -0
- package/components/index.js +584 -558
- package/components/input-field.js +51 -46
- package/components/input.js +20 -20
- package/components/link.js +9 -9
- package/components/modal.d.ts +5 -1
- package/components/modal.js +121 -76
- 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 +4 -0
- package/components/pixel-icon.js +210 -164
- 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 +1 -0
- package/components/segmented.js +39 -36
- package/components/select.d.ts +7 -0
- package/components/select.js +186 -137
- package/components/setting-row.js +45 -42
- 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 +41 -39
- package/components/table.d.ts +16 -0
- package/components/table.js +393 -260
- package/components/tabs.js +149 -137
- 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 +363 -0
- package/demo/lib/artifact-library.js +142 -0
- package/demo/lib/artifact-pin-guard.js +12 -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 +24 -0
- package/lib/icons.js +114 -108
- 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 +53 -19
- package/manifest.json +258 -36
- package/package.json +1 -1
- package/styles.css +143 -124
- package/theme.css +90 -93
- package/components/ui/collapsible.js +0 -35
- package/fonts/aribau-grotesk-500.otf +0 -0
- package/fonts/aribau-grotesk-600.woff2 +0 -0
|
@@ -14,6 +14,7 @@ export interface SegmentedControlProps extends Omit<React.HTMLAttributes<HTMLDiv
|
|
|
14
14
|
options: SegmentedOption[];
|
|
15
15
|
value: string;
|
|
16
16
|
onChange: (value: string) => void;
|
|
17
|
+
elevated?: boolean;
|
|
17
18
|
}
|
|
18
19
|
export declare const SegmentedControl: React.ForwardRefExoticComponent<SegmentedControlProps & React.RefAttributes<HTMLDivElement>>;
|
|
19
20
|
export {};
|
package/components/segmented.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as n, jsxs as
|
|
2
|
+
import { jsx as n, jsxs as h } from "react/jsx-runtime";
|
|
3
3
|
import * as l from "react";
|
|
4
|
-
import { MotionConfig as
|
|
5
|
-
import { cva as
|
|
6
|
-
import { cn as
|
|
7
|
-
import {
|
|
8
|
-
const
|
|
4
|
+
import { MotionConfig as v, motion as w } from "motion/react";
|
|
5
|
+
import { cva as c } from "class-variance-authority";
|
|
6
|
+
import { cn as o } from "../lib/cn.js";
|
|
7
|
+
import { springControl as y } from "../lib/motion.js";
|
|
8
|
+
const D = c(
|
|
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
|
-
),
|
|
24
|
-
|
|
25
|
-
// The active
|
|
23
|
+
), k = c(
|
|
24
|
+
o(
|
|
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,33 +43,33 @@ const y = d(
|
|
|
43
43
|
},
|
|
44
44
|
defaultVariants: { size: "md", selected: !1 }
|
|
45
45
|
}
|
|
46
|
-
),
|
|
47
|
-
const
|
|
48
|
-
const t = r.findIndex((
|
|
46
|
+
), I = l.forwardRef(({ options: r, value: a, onChange: s, size: i, className: u, elevated: m = !0, ...f }, p) => {
|
|
47
|
+
const g = l.useId(), d = (e) => {
|
|
48
|
+
const t = r.findIndex((x) => x.value === a), b = ((t < 0 ? 0 : t) + e + r.length) % r.length;
|
|
49
49
|
s(r[b].value);
|
|
50
50
|
};
|
|
51
51
|
return /* @__PURE__ */ n(
|
|
52
52
|
"div",
|
|
53
53
|
{
|
|
54
|
-
ref:
|
|
54
|
+
ref: p,
|
|
55
55
|
role: "radiogroup",
|
|
56
56
|
onKeyDown: (e) => {
|
|
57
57
|
switch (e.key) {
|
|
58
58
|
case "ArrowRight":
|
|
59
59
|
case "ArrowDown":
|
|
60
|
-
e.preventDefault(),
|
|
60
|
+
e.preventDefault(), d(1);
|
|
61
61
|
break;
|
|
62
62
|
case "ArrowLeft":
|
|
63
63
|
case "ArrowUp":
|
|
64
|
-
e.preventDefault(),
|
|
64
|
+
e.preventDefault(), d(-1);
|
|
65
65
|
break;
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
|
-
className:
|
|
69
|
-
...
|
|
70
|
-
children: /* @__PURE__ */ n(
|
|
68
|
+
className: o(D({ size: i }), u),
|
|
69
|
+
...f,
|
|
70
|
+
children: /* @__PURE__ */ n(v, { reducedMotion: "user", children: r.map((e) => {
|
|
71
71
|
const t = e.value === a;
|
|
72
|
-
return /* @__PURE__ */
|
|
72
|
+
return /* @__PURE__ */ h(
|
|
73
73
|
"button",
|
|
74
74
|
{
|
|
75
75
|
type: "button",
|
|
@@ -78,16 +78,19 @@ const y = d(
|
|
|
78
78
|
"aria-label": e.ariaLabel,
|
|
79
79
|
tabIndex: t ? 0 : -1,
|
|
80
80
|
onClick: () => s(e.value),
|
|
81
|
-
className:
|
|
81
|
+
className: k({ size: i, selected: t }),
|
|
82
82
|
children: [
|
|
83
83
|
t && /* @__PURE__ */ n(
|
|
84
|
-
|
|
84
|
+
w.span,
|
|
85
85
|
{
|
|
86
|
-
layoutId:
|
|
86
|
+
layoutId: g,
|
|
87
87
|
"aria-hidden": !0,
|
|
88
88
|
layoutDependency: a,
|
|
89
|
-
transition:
|
|
90
|
-
className:
|
|
89
|
+
transition: y,
|
|
90
|
+
className: o(
|
|
91
|
+
"absolute inset-0 rounded-[inherit] bg-elevated",
|
|
92
|
+
m && "shadow-elevation"
|
|
93
|
+
)
|
|
91
94
|
}
|
|
92
95
|
),
|
|
93
96
|
/* @__PURE__ */ n("span", { className: "relative", children: e.label })
|
|
@@ -99,7 +102,7 @@ const y = d(
|
|
|
99
102
|
}
|
|
100
103
|
);
|
|
101
104
|
});
|
|
102
|
-
|
|
105
|
+
I.displayName = "SegmentedControl";
|
|
103
106
|
export {
|
|
104
|
-
|
|
107
|
+
I as SegmentedControl
|
|
105
108
|
};
|
package/components/select.d.ts
CHANGED
|
@@ -12,17 +12,24 @@ export interface SelectProps extends VariantProps<typeof selectTriggerVariants>
|
|
|
12
12
|
items: SelectItem[];
|
|
13
13
|
value?: string;
|
|
14
14
|
onChange?: (value: string) => void;
|
|
15
|
+
multiple?: boolean;
|
|
16
|
+
values?: string[];
|
|
17
|
+
onValuesChange?: (values: string[]) => void;
|
|
15
18
|
placeholder?: string;
|
|
16
19
|
disabled?: boolean;
|
|
17
20
|
isInvalid?: boolean;
|
|
18
21
|
className?: string;
|
|
19
22
|
id?: string;
|
|
23
|
+
"aria-label"?: string;
|
|
24
|
+
"aria-describedby"?: string;
|
|
20
25
|
/**
|
|
21
26
|
* Which side the listbox opens toward. Use `"top"` when the trigger sits
|
|
22
27
|
* at the bottom of a clipped container (e.g. a table footer inside an
|
|
23
28
|
* `overflow-clip` shell) so the menu isn't cut off. Defaults to `"bottom"`.
|
|
24
29
|
*/
|
|
25
30
|
placement?: "top" | "bottom";
|
|
31
|
+
/** Render the listbox at the document root so overflow containers cannot clip it. */
|
|
32
|
+
portal?: boolean;
|
|
26
33
|
}
|
|
27
34
|
export declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLButtonElement>>;
|
|
28
35
|
export {};
|
package/components/select.js
CHANGED
|
@@ -1,124 +1,221 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsx as u, jsxs as k } from "react/jsx-runtime";
|
|
3
3
|
import * as s from "react";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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,
|
|
14
15
|
"items-center justify-between gap-2 text-left cursor-pointer",
|
|
15
16
|
"[&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
16
17
|
),
|
|
17
18
|
{
|
|
18
19
|
variants: {
|
|
19
20
|
size: {
|
|
20
|
-
sm: "h-8 text-xs",
|
|
21
|
-
md: "h-10 text-xs",
|
|
22
|
-
lg: "h-11 text-base"
|
|
21
|
+
sm: "h-8 rounded-sm text-xs",
|
|
22
|
+
md: "h-10 rounded-md text-xs",
|
|
23
|
+
lg: "h-11 rounded-md text-base"
|
|
23
24
|
}
|
|
24
25
|
},
|
|
25
26
|
defaultVariants: { size: "md" }
|
|
26
27
|
}
|
|
27
|
-
),
|
|
28
|
+
), ee = s.forwardRef(
|
|
28
29
|
({
|
|
29
|
-
items:
|
|
30
|
-
value:
|
|
31
|
-
onChange:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
30
|
+
items: o,
|
|
31
|
+
value: h,
|
|
32
|
+
onChange: E,
|
|
33
|
+
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);
|
|
49
|
+
return e >= 0 && !o[e].disabled ? e : o.findIndex((t) => !t.disabled);
|
|
50
|
+
}, [o, d, h, l]);
|
|
44
51
|
s.useEffect(() => {
|
|
45
|
-
if (!
|
|
52
|
+
if (!r) return;
|
|
46
53
|
const e = (t) => {
|
|
47
|
-
var
|
|
48
|
-
|
|
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);
|
|
49
57
|
};
|
|
50
58
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
51
|
-
}, [
|
|
59
|
+
}, [r]), s.useLayoutEffect(() => {
|
|
60
|
+
if (!r || !p) {
|
|
61
|
+
S(null);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const e = () => {
|
|
65
|
+
var a, x;
|
|
66
|
+
const t = (a = z.current) == null ? void 0 : a.getBoundingClientRect();
|
|
67
|
+
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,
|
|
71
|
+
left: t.left,
|
|
72
|
+
width: t.width
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
return e(), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
|
|
76
|
+
window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
|
|
77
|
+
};
|
|
78
|
+
}, [r, m, p]), s.useEffect(() => {
|
|
52
79
|
var t;
|
|
53
|
-
if (!
|
|
54
|
-
const e = (t =
|
|
80
|
+
if (!r || c < 0) return;
|
|
81
|
+
const e = (t = w.current) == null ? void 0 : t.children[c];
|
|
55
82
|
e == null || e.scrollIntoView({ block: "nearest" });
|
|
56
|
-
}, [
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
},
|
|
60
|
-
|
|
83
|
+
}, [r, c]);
|
|
84
|
+
const y = () => {
|
|
85
|
+
L || (N(K()), b(!0));
|
|
86
|
+
}, A = (e) => {
|
|
87
|
+
N((t) => {
|
|
61
88
|
let n = t;
|
|
62
|
-
for (let
|
|
63
|
-
if (n = (n + e +
|
|
89
|
+
for (let a = 0; a < o.length; a++)
|
|
90
|
+
if (n = (n + e + o.length) % o.length, !o[n].disabled) return n;
|
|
64
91
|
return t;
|
|
65
92
|
});
|
|
66
|
-
},
|
|
67
|
-
const t =
|
|
68
|
-
!t || t.disabled
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
93
|
+
}, $ = (e) => {
|
|
94
|
+
const t = o[e];
|
|
95
|
+
if (!(!t || t.disabled)) {
|
|
96
|
+
if (d) {
|
|
97
|
+
I == null || I(
|
|
98
|
+
l.includes(t.value) ? l.filter((n) => n !== t.value) : [...l, t.value]
|
|
99
|
+
);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
E == null || E(t.value), b(!1);
|
|
103
|
+
}
|
|
104
|
+
}, U = (e) => {
|
|
105
|
+
switch (e.key) {
|
|
106
|
+
case "ArrowDown":
|
|
107
|
+
e.preventDefault(), r ? A(1) : y();
|
|
108
|
+
break;
|
|
109
|
+
case "ArrowUp":
|
|
110
|
+
e.preventDefault(), r ? A(-1) : y();
|
|
111
|
+
break;
|
|
112
|
+
case "Enter":
|
|
113
|
+
case " ":
|
|
114
|
+
e.preventDefault(), r ? $(c) : y();
|
|
115
|
+
break;
|
|
116
|
+
case "Escape":
|
|
117
|
+
r && (e.preventDefault(), e.stopPropagation(), b(!1));
|
|
118
|
+
break;
|
|
119
|
+
case "Tab":
|
|
120
|
+
b(!1);
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
}, j = /* @__PURE__ */ u(F, { reducedMotion: "user", children: /* @__PURE__ */ u(G, { children: r && /* @__PURE__ */ k(
|
|
124
|
+
J.ul,
|
|
125
|
+
{
|
|
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",
|
|
135
|
+
style: {
|
|
136
|
+
transformOrigin: m === "top" ? "bottom" : "top",
|
|
137
|
+
...p ? {
|
|
138
|
+
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",
|
|
143
|
+
zIndex: 60
|
|
144
|
+
} : {}
|
|
145
|
+
},
|
|
146
|
+
className: f(
|
|
147
|
+
"max-h-60 overflow-auto p-1",
|
|
148
|
+
"rounded-md border border-border bg-elevated shadow-elevation",
|
|
149
|
+
p ? "fixed" : f(
|
|
150
|
+
"absolute z-50 w-full",
|
|
151
|
+
m === "top" ? "bottom-full mb-1.5" : "top-full mt-1.5"
|
|
152
|
+
)
|
|
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
|
+
]
|
|
182
|
+
}
|
|
183
|
+
) }) });
|
|
184
|
+
return /* @__PURE__ */ k("div", { ref: z, className: "relative", children: [
|
|
185
|
+
/* @__PURE__ */ k(
|
|
72
186
|
"button",
|
|
73
187
|
{
|
|
74
|
-
ref:
|
|
75
|
-
id:
|
|
188
|
+
ref: _,
|
|
189
|
+
id: O,
|
|
76
190
|
type: "button",
|
|
77
191
|
role: "combobox",
|
|
78
192
|
"aria-haspopup": "listbox",
|
|
79
|
-
"aria-expanded":
|
|
80
|
-
"aria-controls":
|
|
81
|
-
"aria-invalid":
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
break;
|
|
89
|
-
case "ArrowUp":
|
|
90
|
-
e.preventDefault(), o ? y(-1) : f();
|
|
91
|
-
break;
|
|
92
|
-
case "Enter":
|
|
93
|
-
case " ":
|
|
94
|
-
e.preventDefault(), o ? D(a) : f();
|
|
95
|
-
break;
|
|
96
|
-
case "Escape":
|
|
97
|
-
o && (e.preventDefault(), l(!1));
|
|
98
|
-
break;
|
|
99
|
-
case "Tab":
|
|
100
|
-
l(!1);
|
|
101
|
-
break;
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
className: d(T({ size: N }), R),
|
|
193
|
+
"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),
|
|
105
202
|
children: [
|
|
106
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ u(
|
|
107
204
|
"span",
|
|
108
205
|
{
|
|
109
|
-
className:
|
|
206
|
+
className: f(
|
|
110
207
|
"truncate",
|
|
111
|
-
!
|
|
208
|
+
d ? v.length === 0 && "text-muted-foreground" : !D && "text-muted-foreground"
|
|
112
209
|
),
|
|
113
|
-
children:
|
|
210
|
+
children: d ? v.length === 0 ? R : v.length === 1 ? v[0].label : `${v.length} selected` : D ? D.label : R
|
|
114
211
|
}
|
|
115
212
|
),
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
|
|
213
|
+
/* @__PURE__ */ u(
|
|
214
|
+
V,
|
|
118
215
|
{
|
|
119
|
-
className:
|
|
120
|
-
"size-4 text-muted-foreground transition-transform duration-
|
|
121
|
-
|
|
216
|
+
className: f(
|
|
217
|
+
"size-4 text-muted-foreground transition-transform duration-150 ease-out motion-reduce:transition-none",
|
|
218
|
+
r && "rotate-180"
|
|
122
219
|
),
|
|
123
220
|
"aria-hidden": !0
|
|
124
221
|
}
|
|
@@ -126,59 +223,11 @@ const T = j(
|
|
|
126
223
|
]
|
|
127
224
|
}
|
|
128
225
|
),
|
|
129
|
-
|
|
130
|
-
$.ul,
|
|
131
|
-
{
|
|
132
|
-
ref: k,
|
|
133
|
-
id: u,
|
|
134
|
-
role: "listbox",
|
|
135
|
-
"aria-activedescendant": a >= 0 ? `${u}-opt-${a}` : void 0,
|
|
136
|
-
variants: O,
|
|
137
|
-
initial: "hidden",
|
|
138
|
-
animate: "visible",
|
|
139
|
-
exit: "hidden",
|
|
140
|
-
style: {
|
|
141
|
-
transformOrigin: v === "top" ? "bottom" : "top"
|
|
142
|
-
},
|
|
143
|
-
className: d(
|
|
144
|
-
"absolute z-50 max-h-60 w-full overflow-auto p-1",
|
|
145
|
-
"rounded-md border border-border bg-elevated shadow-elevation",
|
|
146
|
-
v === "top" ? "bottom-full mb-1.5" : "top-full mt-1.5"
|
|
147
|
-
),
|
|
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
|
-
]
|
|
176
|
-
}
|
|
177
|
-
) }) })
|
|
226
|
+
p && typeof document < "u" ? q(j, document.body) : j
|
|
178
227
|
] });
|
|
179
228
|
}
|
|
180
229
|
);
|
|
181
|
-
|
|
230
|
+
ee.displayName = "Select";
|
|
182
231
|
export {
|
|
183
|
-
|
|
232
|
+
ee as Select
|
|
184
233
|
};
|