@actioneer/ads 0.5.7 → 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 +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.js +24 -24
- 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 +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.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.js +0 -1
- 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.js +26 -26
- package/components/select.d.ts +2 -0
- package/components/select.js +61 -57
- 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 +9 -0
- package/components/table.js +370 -247
- 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 +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 +4 -0
- package/lib/icons.js +103 -102
- 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 +52 -18
- package/manifest.json +240 -31
- 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
package/components/progress.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as r } from "react/jsx-runtime";
|
|
3
3
|
import * as g from "react";
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { MotionConfig as p, motion as b } from "motion/react";
|
|
5
|
+
import { cn as i } from "../lib/cn.js";
|
|
6
|
+
import { springProgress as v } from "../lib/motion.js";
|
|
7
|
+
const h = {
|
|
6
8
|
sm: "h-1.5",
|
|
7
9
|
md: "h-2"
|
|
8
10
|
}, s = {
|
|
@@ -11,18 +13,18 @@ const p = {
|
|
|
11
13
|
warning: "bg-warning",
|
|
12
14
|
danger: "bg-danger",
|
|
13
15
|
info: "bg-info"
|
|
14
|
-
},
|
|
16
|
+
}, w = g.forwardRef(
|
|
15
17
|
({
|
|
16
18
|
className: l,
|
|
17
19
|
value: t = 0,
|
|
18
20
|
max: e = 100,
|
|
19
|
-
isIndeterminate:
|
|
21
|
+
isIndeterminate: a = !1,
|
|
20
22
|
size: d = "md",
|
|
21
|
-
color:
|
|
23
|
+
color: n = "primary",
|
|
22
24
|
label: m,
|
|
23
|
-
...
|
|
25
|
+
...f
|
|
24
26
|
}, c) => {
|
|
25
|
-
const o = Math.min(Math.max(t, 0), e),
|
|
27
|
+
const o = Math.min(Math.max(t, 0), e), u = e > 0 ? o / e * 100 : 0;
|
|
26
28
|
return /* @__PURE__ */ r(
|
|
27
29
|
"div",
|
|
28
30
|
{
|
|
@@ -31,36 +33,38 @@ const p = {
|
|
|
31
33
|
"aria-label": m,
|
|
32
34
|
"aria-valuemin": 0,
|
|
33
35
|
"aria-valuemax": e,
|
|
34
|
-
"aria-valuenow":
|
|
35
|
-
className:
|
|
36
|
+
"aria-valuenow": a ? void 0 : o,
|
|
37
|
+
className: i(
|
|
36
38
|
"relative w-full overflow-hidden rounded-full bg-muted",
|
|
37
|
-
|
|
39
|
+
h[d],
|
|
38
40
|
l
|
|
39
41
|
),
|
|
40
|
-
...
|
|
41
|
-
children:
|
|
42
|
+
...f,
|
|
43
|
+
children: a ? /* @__PURE__ */ r(
|
|
42
44
|
"div",
|
|
43
45
|
{
|
|
44
|
-
className:
|
|
45
|
-
"absolute inset-y-0 left-0 w-2/5 rounded-full animate-[ads-
|
|
46
|
-
s[
|
|
46
|
+
className: i(
|
|
47
|
+
"absolute inset-y-0 left-0 w-2/5 rounded-full animate-[ads-indeterminate_1.5s_linear_infinite] motion-reduce:animate-none",
|
|
48
|
+
s[n]
|
|
47
49
|
)
|
|
48
50
|
}
|
|
49
|
-
) : /* @__PURE__ */ r(
|
|
50
|
-
|
|
51
|
+
) : /* @__PURE__ */ r(p, { reducedMotion: "user", children: /* @__PURE__ */ r(
|
|
52
|
+
b.div,
|
|
51
53
|
{
|
|
52
|
-
className:
|
|
53
|
-
"h-full w-full origin-left rounded-full
|
|
54
|
-
s[
|
|
54
|
+
className: i(
|
|
55
|
+
"h-full w-full origin-left rounded-full",
|
|
56
|
+
s[n]
|
|
55
57
|
),
|
|
56
|
-
|
|
58
|
+
initial: !1,
|
|
59
|
+
animate: { scaleX: u / 100 },
|
|
60
|
+
transition: v
|
|
57
61
|
}
|
|
58
|
-
)
|
|
62
|
+
) })
|
|
59
63
|
}
|
|
60
64
|
);
|
|
61
65
|
}
|
|
62
66
|
);
|
|
63
|
-
|
|
67
|
+
w.displayName = "Progress";
|
|
64
68
|
export {
|
|
65
|
-
|
|
69
|
+
w as Progress
|
|
66
70
|
};
|
package/components/radio.js
CHANGED
|
@@ -1,101 +1,111 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as r, jsxs as
|
|
2
|
+
import { jsx as r, jsxs as R } from "react/jsx-runtime";
|
|
3
3
|
import * as i from "react";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
4
|
+
import { MotionConfig as v, motion as y } from "motion/react";
|
|
5
|
+
import { cn as b } from "../lib/cn.js";
|
|
6
|
+
import { Field as N } from "./field.js";
|
|
7
|
+
import { springRadio as w } from "../lib/motion.js";
|
|
8
|
+
const x = i.createContext(null), k = i.forwardRef(
|
|
7
9
|
({
|
|
8
|
-
className:
|
|
9
|
-
name:
|
|
10
|
+
className: d,
|
|
11
|
+
name: n,
|
|
10
12
|
value: o,
|
|
11
|
-
onChange:
|
|
12
|
-
label:
|
|
13
|
-
description:
|
|
14
|
-
error:
|
|
15
|
-
orientation:
|
|
16
|
-
disabled:
|
|
17
|
-
children:
|
|
18
|
-
...
|
|
19
|
-
},
|
|
20
|
-
const
|
|
21
|
-
() => ({ name:
|
|
22
|
-
[
|
|
13
|
+
onChange: t,
|
|
14
|
+
label: a,
|
|
15
|
+
description: c,
|
|
16
|
+
error: u,
|
|
17
|
+
orientation: p = "vertical",
|
|
18
|
+
disabled: e,
|
|
19
|
+
children: s,
|
|
20
|
+
...l
|
|
21
|
+
}, f) => {
|
|
22
|
+
const m = i.useMemo(
|
|
23
|
+
() => ({ name: n, value: o, onValueChange: t, disabled: e }),
|
|
24
|
+
[n, o, t, e]
|
|
23
25
|
);
|
|
24
26
|
return /* @__PURE__ */ r(
|
|
25
|
-
|
|
27
|
+
N,
|
|
26
28
|
{
|
|
27
|
-
ref:
|
|
28
|
-
label:
|
|
29
|
-
description:
|
|
30
|
-
error:
|
|
29
|
+
ref: f,
|
|
30
|
+
label: a,
|
|
31
|
+
description: c,
|
|
32
|
+
error: u,
|
|
31
33
|
role: "radiogroup",
|
|
32
|
-
className:
|
|
33
|
-
...
|
|
34
|
-
children: /* @__PURE__ */ r(
|
|
34
|
+
className: d,
|
|
35
|
+
...l,
|
|
36
|
+
children: /* @__PURE__ */ r(x.Provider, { value: m, children: /* @__PURE__ */ r(
|
|
35
37
|
"div",
|
|
36
38
|
{
|
|
37
|
-
className:
|
|
39
|
+
className: b(
|
|
38
40
|
"flex gap-3",
|
|
39
|
-
|
|
41
|
+
p === "vertical" ? "flex-col" : "flex-row flex-wrap"
|
|
40
42
|
),
|
|
41
|
-
children:
|
|
43
|
+
children: s
|
|
42
44
|
}
|
|
43
45
|
) })
|
|
44
46
|
}
|
|
45
47
|
);
|
|
46
48
|
}
|
|
47
49
|
);
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
({ className:
|
|
51
|
-
const e = i.useContext(
|
|
52
|
-
return /* @__PURE__ */
|
|
50
|
+
k.displayName = "RadioGroup";
|
|
51
|
+
const j = i.forwardRef(
|
|
52
|
+
({ className: d, children: n, value: o, disabled: t, checked: a, defaultChecked: c, ...u }, p) => {
|
|
53
|
+
const e = i.useContext(x), s = t || (e == null ? void 0 : e.disabled), l = a !== void 0, [f, m] = i.useState(!!c), g = e ? e.value === o : l ? a : f;
|
|
54
|
+
return /* @__PURE__ */ R(
|
|
53
55
|
"label",
|
|
54
56
|
{
|
|
55
|
-
className:
|
|
57
|
+
className: b(
|
|
56
58
|
"group inline-flex items-center gap-2 text-xs text-foreground select-none",
|
|
57
59
|
s ? "cursor-not-allowed opacity-50" : "cursor-pointer",
|
|
58
|
-
|
|
60
|
+
d
|
|
59
61
|
),
|
|
60
62
|
children: [
|
|
61
63
|
/* @__PURE__ */ r(
|
|
62
64
|
"input",
|
|
63
65
|
{
|
|
64
|
-
ref:
|
|
66
|
+
ref: p,
|
|
65
67
|
type: "radio",
|
|
66
68
|
name: e == null ? void 0 : e.name,
|
|
67
69
|
value: o,
|
|
68
|
-
checked:
|
|
70
|
+
checked: g,
|
|
69
71
|
disabled: s,
|
|
70
|
-
onChange: (
|
|
71
|
-
var
|
|
72
|
-
|
|
72
|
+
onChange: (C) => {
|
|
73
|
+
var h;
|
|
74
|
+
C.target.checked && (e ? (h = e.onValueChange) == null || h.call(e, o) : l || m(!0));
|
|
73
75
|
},
|
|
74
76
|
className: "peer sr-only",
|
|
75
|
-
...
|
|
77
|
+
...u
|
|
76
78
|
}
|
|
77
79
|
),
|
|
78
80
|
/* @__PURE__ */ r(
|
|
79
81
|
"span",
|
|
80
82
|
{
|
|
81
83
|
"aria-hidden": !0,
|
|
82
|
-
className:
|
|
84
|
+
className: b(
|
|
83
85
|
"flex size-4.5 shrink-0 items-center justify-center rounded-full border border-input bg-elevated",
|
|
84
|
-
"transition-[border-color,box-shadow] duration-
|
|
86
|
+
"transition-[border-color,box-shadow] duration-150 ease-out",
|
|
85
87
|
"peer-checked:border-brand",
|
|
86
88
|
"peer-focus-visible:ring-3 peer-focus-visible:ring-ring"
|
|
87
89
|
),
|
|
88
|
-
children: /* @__PURE__ */ r(
|
|
90
|
+
children: /* @__PURE__ */ r(v, { reducedMotion: "user", children: /* @__PURE__ */ r(
|
|
91
|
+
y.span,
|
|
92
|
+
{
|
|
93
|
+
className: "size-2 rounded-full bg-brand",
|
|
94
|
+
initial: !1,
|
|
95
|
+
animate: { opacity: g ? 1 : 0, scale: g ? 1 : 0.9 },
|
|
96
|
+
transition: w
|
|
97
|
+
}
|
|
98
|
+
) })
|
|
89
99
|
}
|
|
90
100
|
),
|
|
91
|
-
|
|
101
|
+
n && /* @__PURE__ */ r("span", { children: n })
|
|
92
102
|
]
|
|
93
103
|
}
|
|
94
104
|
);
|
|
95
105
|
}
|
|
96
106
|
);
|
|
97
|
-
|
|
107
|
+
j.displayName = "Radio";
|
|
98
108
|
export {
|
|
99
|
-
|
|
100
|
-
|
|
109
|
+
j as Radio,
|
|
110
|
+
k as RadioGroup
|
|
101
111
|
};
|
|
@@ -83,7 +83,7 @@ const H = t.forwardRef(
|
|
|
83
83
|
"aria-hidden": !0,
|
|
84
84
|
className: f(
|
|
85
85
|
"my-3 w-px rounded-full bg-transparent",
|
|
86
|
-
"transition-colors duration-
|
|
86
|
+
"transition-colors duration-150 ease-out motion-reduce:transition-none",
|
|
87
87
|
"group-hover/resize:bg-border-strong group-focus-visible/resize:bg-ring",
|
|
88
88
|
c && "bg-ring"
|
|
89
89
|
)
|
package/components/reveal.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ import { ComponentProps } from 'react';
|
|
|
5
5
|
* arrives in hierarchy: shells rise, labels and values ink in, visualizations
|
|
6
6
|
* draw left to right — each slot offset by a shared stagger step.
|
|
7
7
|
*
|
|
8
|
-
* Pure CSS animations (off the main thread)
|
|
9
|
-
*
|
|
8
|
+
* Pure CSS animations (off the main thread) with a reduced-motion fallback
|
|
9
|
+
* that keeps only the fade. Durations are deliberate:
|
|
10
10
|
* data drawing is explanatory motion, so the wipe may breathe past the <300ms
|
|
11
11
|
* UI-chrome rule; interactive chrome must never use these classes.
|
|
12
12
|
*/
|
package/components/ripple.d.ts
CHANGED
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
*
|
|
12
12
|
* It is an absolute, `pointer-events-none`, `z-0` layer clipped to the panel
|
|
13
13
|
* radius (`rounded-[inherit]`), so it sits under the content and never
|
|
14
|
-
* intercepts input.
|
|
15
|
-
* `--
|
|
16
|
-
* replay on each open.
|
|
14
|
+
* intercepts input. Its one-off duration is local; the origin and tint use
|
|
15
|
+
* `--ripple-*` visual variables. Reduced motion drops it entirely. Remount it
|
|
16
|
+
* (via `key`) to replay on each open.
|
|
17
17
|
*/
|
|
18
18
|
export interface RippleProps {
|
|
19
19
|
/**
|
|
@@ -1,41 +1,42 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as m, jsx as o } from "react/jsx-runtime";
|
|
3
3
|
import * as i from "react";
|
|
4
4
|
import { ScrollArea as e } from "radix-ui";
|
|
5
|
-
import { cn as
|
|
6
|
-
const
|
|
7
|
-
({ className: a, children: l, orientation: r = "vertical", viewportClassName: t, ...n }, d) => /* @__PURE__ */
|
|
5
|
+
import { cn as c } from "../lib/cn.js";
|
|
6
|
+
const f = i.forwardRef(
|
|
7
|
+
({ className: a, children: l, orientation: r = "vertical", viewportClassName: t, ...n }, d) => /* @__PURE__ */ m(
|
|
8
8
|
e.Root,
|
|
9
9
|
{
|
|
10
10
|
ref: d,
|
|
11
11
|
"data-slot": "scroll-area",
|
|
12
|
-
className:
|
|
12
|
+
className: c("relative overflow-hidden border border-border", a),
|
|
13
13
|
...n,
|
|
14
14
|
children: [
|
|
15
15
|
/* @__PURE__ */ o(
|
|
16
16
|
e.Viewport,
|
|
17
17
|
{
|
|
18
|
-
|
|
18
|
+
tabIndex: 0,
|
|
19
|
+
className: c("size-full rounded-[inherit]", t),
|
|
19
20
|
children: l
|
|
20
21
|
}
|
|
21
22
|
),
|
|
22
|
-
(r === "vertical" || r === "both") && /* @__PURE__ */ o(
|
|
23
|
-
(r === "horizontal" || r === "both") && /* @__PURE__ */ o(
|
|
23
|
+
(r === "vertical" || r === "both") && /* @__PURE__ */ o(s, { orientation: "vertical" }),
|
|
24
|
+
(r === "horizontal" || r === "both") && /* @__PURE__ */ o(s, { orientation: "horizontal" }),
|
|
24
25
|
/* @__PURE__ */ o(e.Corner, {})
|
|
25
26
|
]
|
|
26
27
|
}
|
|
27
28
|
)
|
|
28
29
|
);
|
|
29
|
-
|
|
30
|
-
const
|
|
30
|
+
f.displayName = "ScrollArea";
|
|
31
|
+
const s = i.forwardRef(({ className: a, orientation: l = "vertical", ...r }, t) => /* @__PURE__ */ o(
|
|
31
32
|
e.ScrollAreaScrollbar,
|
|
32
33
|
{
|
|
33
34
|
ref: t,
|
|
34
35
|
orientation: l,
|
|
35
36
|
"data-slot": "scroll-bar",
|
|
36
|
-
className:
|
|
37
|
+
className: c(
|
|
37
38
|
"flex touch-none select-none p-0.5",
|
|
38
|
-
"transition-colors duration-
|
|
39
|
+
"transition-colors duration-150 ease-out motion-reduce:transition-none",
|
|
39
40
|
l === "vertical" && "h-full w-2.5",
|
|
40
41
|
l === "horizontal" && "h-2.5 flex-col",
|
|
41
42
|
a
|
|
@@ -45,13 +46,13 @@ const c = i.forwardRef(({ className: a, orientation: l = "vertical", ...r }, t)
|
|
|
45
46
|
e.ScrollAreaThumb,
|
|
46
47
|
{
|
|
47
48
|
"data-slot": "scroll-bar-thumb",
|
|
48
|
-
className: "relative flex-1 rounded-full bg-fill transition-colors duration-
|
|
49
|
+
className: "relative flex-1 rounded-full bg-fill transition-colors duration-150 ease-out hover:bg-border-strong motion-reduce:transition-none"
|
|
49
50
|
}
|
|
50
51
|
)
|
|
51
52
|
}
|
|
52
53
|
));
|
|
53
|
-
|
|
54
|
+
s.displayName = "ScrollBar";
|
|
54
55
|
export {
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
f as ScrollArea,
|
|
57
|
+
s as ScrollBar
|
|
57
58
|
};
|
package/components/segmented.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as n, jsxs as x } from "react/jsx-runtime";
|
|
3
|
-
import * as
|
|
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,10 +43,10 @@ const y = d(
|
|
|
43
43
|
},
|
|
44
44
|
defaultVariants: { size: "md", selected: !1 }
|
|
45
45
|
}
|
|
46
|
-
), k =
|
|
47
|
-
const p =
|
|
48
|
-
const t = r.findIndex((
|
|
49
|
-
|
|
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
|
+
o(r[g].value);
|
|
50
50
|
};
|
|
51
51
|
return /* @__PURE__ */ n(
|
|
52
52
|
"div",
|
|
@@ -65,8 +65,8 @@ const y = d(
|
|
|
65
65
|
break;
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
|
-
className: c(y({ size:
|
|
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
72
|
return /* @__PURE__ */ x(
|
|
@@ -77,8 +77,8 @@ const y = d(
|
|
|
77
77
|
"aria-checked": t,
|
|
78
78
|
"aria-label": e.ariaLabel,
|
|
79
79
|
tabIndex: t ? 0 : -1,
|
|
80
|
-
onClick: () =>
|
|
81
|
-
className: D({ size:
|
|
80
|
+
onClick: () => o(e.value),
|
|
81
|
+
className: D({ size: s, selected: t }),
|
|
82
82
|
children: [
|
|
83
83
|
t && /* @__PURE__ */ n(
|
|
84
84
|
v.span,
|
|
@@ -86,8 +86,8 @@ const y = d(
|
|
|
86
86
|
layoutId: p,
|
|
87
87
|
"aria-hidden": !0,
|
|
88
88
|
layoutDependency: a,
|
|
89
|
-
transition:
|
|
90
|
-
className: "absolute inset-0 rounded-
|
|
89
|
+
transition: w,
|
|
90
|
+
className: "absolute inset-0 rounded-[inherit] bg-elevated shadow-elevation"
|
|
91
91
|
}
|
|
92
92
|
),
|
|
93
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
|