@actioneer/ads 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ai-elements/agent-trace.d.ts +2 -2
- package/components/ai-elements/agent-trace.js +163 -104
- package/components/ai-elements/chain-of-thought.d.ts +2 -2
- package/components/ai-elements/chain-of-thought.js +1 -1
- package/components/ai-elements/index.d.ts +0 -5
- package/components/ai-elements/inline-citation.js +1 -1
- package/components/alert.d.ts +6 -6
- package/components/alert.js +89 -53
- package/components/answer-sources.d.ts +2 -6
- package/components/answer-sources.js +58 -60
- package/components/answer.d.ts +5 -0
- package/components/answer.js +311 -271
- package/components/assistant-ui/composer-harness.js +15 -20
- package/components/assistant-ui/composer.d.ts +3 -1
- package/components/assistant-ui/composer.js +148 -144
- package/components/assistant-ui/index.d.ts +0 -3
- package/components/assistant-ui/thread-context.d.ts +3 -1
- package/components/assistant-ui/thread.js +50 -42
- package/components/avatar.js +42 -42
- package/components/badge.d.ts +5 -6
- package/components/badge.js +13 -76
- package/components/body-page-header.d.ts +15 -0
- package/components/body-page-header.js +24 -0
- package/components/brand-loader.d.ts +0 -3
- package/components/brand-loader.js +10 -32
- package/components/breadcrumbs.d.ts +0 -7
- package/components/breadcrumbs.js +54 -71
- package/components/button.d.ts +1 -1
- package/components/button.js +55 -49
- package/components/chart.js +298 -296
- package/components/chip.d.ts +13 -1
- package/components/chip.js +93 -80
- package/components/collection-header.d.ts +17 -0
- package/components/collection-header.js +31 -0
- package/components/connector-card.d.ts +6 -6
- package/components/connector-card.js +31 -32
- package/components/date-range-picker.d.ts +2 -1
- package/components/date-range-picker.js +158 -122
- package/components/drawer.d.ts +19 -3
- package/components/drawer.js +109 -100
- package/components/dropdown.d.ts +1 -2
- package/components/dropdown.js +88 -89
- package/components/field.js +39 -34
- package/components/file-dropzone.js +1 -1
- package/components/index.d.ts +4 -4
- package/components/index.js +499 -546
- package/components/infinite-canvas.js +24 -24
- package/components/input-field.d.ts +18 -3
- package/components/input-field.js +88 -72
- package/components/input.js +16 -15
- package/components/modal.d.ts +31 -3
- package/components/modal.js +243 -169
- package/components/number-field.js +45 -42
- package/components/page-body.d.ts +12 -0
- package/components/page-body.js +18 -0
- package/components/pagination.js +36 -36
- package/components/select.d.ts +21 -0
- package/components/select.js +189 -148
- package/components/setting-row.d.ts +6 -5
- package/components/setting-row.js +33 -32
- package/components/sidebar.d.ts +2 -0
- package/components/sidebar.js +165 -155
- package/components/skeleton.js +8 -7
- package/components/slider.js +1 -1
- package/components/surface-loader.d.ts +11 -0
- package/components/surface-loader.js +35 -0
- package/components/table.d.ts +16 -10
- package/components/table.js +426 -410
- package/components/tabs.d.ts +2 -0
- package/components/tabs.js +159 -294
- package/components/textarea.js +9 -9
- package/components/toast.d.ts +1 -1
- package/components/toast.js +181 -118
- package/components/tree.d.ts +5 -1
- package/components/tree.js +54 -49
- package/components/typography.d.ts +4 -4
- package/components/typography.js +13 -13
- package/components/ui/button.d.ts +1 -1
- package/components/ui/dialog.js +33 -33
- package/demo/components/add-to-artifact.js +6 -10
- package/lib/cn.js +11 -4
- package/lib/icons.d.ts +4 -0
- package/lib/icons.js +107 -106
- package/lib/interactive.d.ts +1 -1
- package/llms.txt +95 -152
- package/manifest.json +1628 -2729
- package/package.json +1 -2
- package/styles.css +347 -223
- package/theme.css +303 -177
- package/components/agent-icon.d.ts +0 -76
- package/components/agent-icon.js +0 -265
- package/components/ai-elements/queue.d.ts +0 -60
- package/components/ai-elements/queue.js +0 -193
- package/components/ai-elements/speech-input.d.ts +0 -16
- package/components/ai-elements/speech-input.js +0 -151
- package/components/ai-elements/task-progress.d.ts +0 -41
- package/components/ai-elements/task-progress.js +0 -224
- package/components/ai-elements/task.d.ts +0 -39
- package/components/ai-elements/task.js +0 -105
- package/components/ai-elements/voice.d.ts +0 -90
- package/components/ai-elements/voice.js +0 -496
- package/components/assistant-ui/follow-up-suggestions.d.ts +0 -11
- package/components/assistant-ui/follow-up-suggestions.js +0 -72
- package/components/assistant-ui/suggestions.d.ts +0 -7
- package/components/assistant-ui/suggestions.js +0 -19
- package/components/assistant-ui/voice.d.ts +0 -18
- package/components/link.d.ts +0 -14
- package/components/link.js +0 -72
- package/components/navbar.d.ts +0 -15
- package/components/navbar.js +0 -68
- package/components/pixel-icon.d.ts +0 -37
- package/components/pixel-icon.js +0 -859
package/components/pagination.js
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as u, jsx as l } from "react/jsx-runtime";
|
|
3
3
|
import * as j from "react";
|
|
4
|
-
import { ChevronLeft as
|
|
4
|
+
import { ChevronLeft as L, MoreHorizontal as k, ChevronRight as G } from "../lib/icons.js";
|
|
5
5
|
import { cn as o } from "../lib/cn.js";
|
|
6
6
|
import { Select as M } from "./select.js";
|
|
7
|
-
function p(
|
|
8
|
-
const
|
|
9
|
-
for (let
|
|
10
|
-
return
|
|
7
|
+
function p(t, s) {
|
|
8
|
+
const e = [];
|
|
9
|
+
for (let r = t; r <= s; r += 1) e.push(r);
|
|
10
|
+
return e;
|
|
11
11
|
}
|
|
12
|
-
function E(
|
|
13
|
-
if (
|
|
14
|
-
return p(1,
|
|
15
|
-
const m = Math.max(
|
|
12
|
+
function E(t, s, e) {
|
|
13
|
+
if (e * 2 + 5 >= t)
|
|
14
|
+
return p(1, t);
|
|
15
|
+
const m = Math.max(s - e, 1), i = Math.min(s + e, t), d = m > 2, a = i < t - 1;
|
|
16
16
|
if (!d && a) {
|
|
17
|
-
const c =
|
|
18
|
-
return [...p(1, c), "end-ellipsis",
|
|
17
|
+
const c = e * 2 + 3;
|
|
18
|
+
return [...p(1, c), "end-ellipsis", t];
|
|
19
19
|
}
|
|
20
20
|
if (d && !a) {
|
|
21
|
-
const c =
|
|
22
|
-
return [1, "start-ellipsis", ...p(
|
|
21
|
+
const c = e * 2 + 3;
|
|
22
|
+
return [1, "start-ellipsis", ...p(t - c + 1, t)];
|
|
23
23
|
}
|
|
24
24
|
return [
|
|
25
25
|
1,
|
|
26
26
|
"start-ellipsis",
|
|
27
|
-
...p(m,
|
|
27
|
+
...p(m, i),
|
|
28
28
|
"end-ellipsis",
|
|
29
|
-
|
|
29
|
+
t
|
|
30
30
|
];
|
|
31
31
|
}
|
|
32
|
-
const A = (
|
|
32
|
+
const A = () => o(
|
|
33
33
|
"inline-flex items-center justify-center rounded-md font-normal",
|
|
34
34
|
"outline-none focus-visible:ring-3 focus-visible:ring-ring",
|
|
35
35
|
"transition active:scale-[0.97] motion-reduce:transition-none motion-reduce:active:scale-100",
|
|
36
36
|
"disabled:pointer-events-none disabled:opacity-40",
|
|
37
|
-
|
|
38
|
-
), N = (
|
|
37
|
+
"size-6 text-xs"
|
|
38
|
+
), N = (t) => t === "sm" ? "w-auto gap-1.5 px-2" : "w-auto gap-1.5 px-2.5", F = j.forwardRef(
|
|
39
39
|
({
|
|
40
|
-
className:
|
|
41
|
-
total:
|
|
42
|
-
page:
|
|
43
|
-
onChange:
|
|
40
|
+
className: t,
|
|
41
|
+
total: s,
|
|
42
|
+
page: e,
|
|
43
|
+
onChange: r,
|
|
44
44
|
siblings: m = 1,
|
|
45
|
-
size:
|
|
45
|
+
size: i = "md",
|
|
46
46
|
summary: d,
|
|
47
47
|
labels: a = !1,
|
|
48
48
|
pageSize: c,
|
|
@@ -50,8 +50,8 @@ const A = (e) => o(
|
|
|
50
50
|
onPageSizeChange: g,
|
|
51
51
|
...C
|
|
52
52
|
}, y) => {
|
|
53
|
-
if (
|
|
54
|
-
const P = E(
|
|
53
|
+
if (s <= 0) return null;
|
|
54
|
+
const P = E(s, e, m), R = e <= 1, S = e >= s, f = A(), x = i === "sm" ? "size-3.5" : "size-4", h = c != null && !!g, b = d != null || h;
|
|
55
55
|
return /* @__PURE__ */ u(
|
|
56
56
|
"nav",
|
|
57
57
|
{
|
|
@@ -60,7 +60,7 @@ const A = (e) => o(
|
|
|
60
60
|
className: o(
|
|
61
61
|
"flex items-center",
|
|
62
62
|
b ? "w-full justify-between gap-4" : "gap-1",
|
|
63
|
-
|
|
63
|
+
t
|
|
64
64
|
),
|
|
65
65
|
...C,
|
|
66
66
|
children: [
|
|
@@ -88,7 +88,7 @@ const A = (e) => o(
|
|
|
88
88
|
M,
|
|
89
89
|
{
|
|
90
90
|
size: "sm",
|
|
91
|
-
className: "w-18",
|
|
91
|
+
className: "w-18 text-s font-normal",
|
|
92
92
|
placement: "top",
|
|
93
93
|
items: (w ?? [8, 16, 32]).map((n) => ({
|
|
94
94
|
label: String(n),
|
|
@@ -108,14 +108,14 @@ const A = (e) => o(
|
|
|
108
108
|
type: "button",
|
|
109
109
|
"aria-label": "Go to previous page",
|
|
110
110
|
disabled: R,
|
|
111
|
-
onClick: () =>
|
|
111
|
+
onClick: () => r(e - 1),
|
|
112
112
|
className: o(
|
|
113
113
|
f,
|
|
114
114
|
"text-foreground hover:bg-muted",
|
|
115
|
-
a && N(
|
|
115
|
+
a && N(i)
|
|
116
116
|
),
|
|
117
117
|
children: [
|
|
118
|
-
/* @__PURE__ */ l(
|
|
118
|
+
/* @__PURE__ */ l(L, { className: x, "aria-hidden": !0 }),
|
|
119
119
|
a && "Prev"
|
|
120
120
|
]
|
|
121
121
|
}
|
|
@@ -127,21 +127,21 @@ const A = (e) => o(
|
|
|
127
127
|
{
|
|
128
128
|
"aria-hidden": !0,
|
|
129
129
|
className: o(f, "text-muted-foreground"),
|
|
130
|
-
children: /* @__PURE__ */ l(
|
|
130
|
+
children: /* @__PURE__ */ l(k, { className: x })
|
|
131
131
|
},
|
|
132
132
|
n
|
|
133
133
|
);
|
|
134
|
-
const v = n ===
|
|
134
|
+
const v = n === e;
|
|
135
135
|
return /* @__PURE__ */ l(
|
|
136
136
|
"button",
|
|
137
137
|
{
|
|
138
138
|
type: "button",
|
|
139
139
|
"aria-label": `Go to page ${n}`,
|
|
140
140
|
"aria-current": v ? "page" : void 0,
|
|
141
|
-
onClick: () =>
|
|
141
|
+
onClick: () => r(n),
|
|
142
142
|
className: o(
|
|
143
143
|
f,
|
|
144
|
-
v ? "bg-
|
|
144
|
+
v ? "bg-ng10 text-white" : "text-foreground hover:bg-muted"
|
|
145
145
|
),
|
|
146
146
|
children: n
|
|
147
147
|
},
|
|
@@ -154,11 +154,11 @@ const A = (e) => o(
|
|
|
154
154
|
type: "button",
|
|
155
155
|
"aria-label": "Go to next page",
|
|
156
156
|
disabled: S,
|
|
157
|
-
onClick: () =>
|
|
157
|
+
onClick: () => r(e + 1),
|
|
158
158
|
className: o(
|
|
159
159
|
f,
|
|
160
160
|
"text-foreground hover:bg-muted",
|
|
161
|
-
a && N(
|
|
161
|
+
a && N(i)
|
|
162
162
|
),
|
|
163
163
|
children: [
|
|
164
164
|
a && "Next",
|
package/components/select.d.ts
CHANGED
|
@@ -8,6 +8,26 @@ export interface SelectItem {
|
|
|
8
8
|
value: string;
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
}
|
|
11
|
+
export interface DropdownOptionsProps {
|
|
12
|
+
items: SelectItem[];
|
|
13
|
+
value?: string;
|
|
14
|
+
values?: string[];
|
|
15
|
+
multiple?: boolean;
|
|
16
|
+
activeIndex?: number;
|
|
17
|
+
onActiveIndexChange?: (index: number) => void;
|
|
18
|
+
onItemSelect?: (index: number) => void;
|
|
19
|
+
placement?: "top" | "bottom";
|
|
20
|
+
id?: string;
|
|
21
|
+
className?: string;
|
|
22
|
+
style?: React.CSSProperties;
|
|
23
|
+
"aria-label"?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* DropdownOptions — the reusable options surface composed by Select.
|
|
27
|
+
* It owns listbox semantics and the brand-green option interaction treatment;
|
|
28
|
+
* positioning and open/closed state stay with the parent Select.
|
|
29
|
+
*/
|
|
30
|
+
export declare const DropdownOptions: React.ForwardRefExoticComponent<DropdownOptionsProps & React.RefAttributes<HTMLUListElement>>;
|
|
11
31
|
export interface SelectProps extends VariantProps<typeof selectTriggerVariants> {
|
|
12
32
|
items: SelectItem[];
|
|
13
33
|
value?: string;
|
|
@@ -15,6 +35,7 @@ export interface SelectProps extends VariantProps<typeof selectTriggerVariants>
|
|
|
15
35
|
multiple?: boolean;
|
|
16
36
|
values?: string[];
|
|
17
37
|
onValuesChange?: (values: string[]) => void;
|
|
38
|
+
/** Empty-state trigger copy. Defaults to "Select" and inherits tertiary text. */
|
|
18
39
|
placeholder?: string;
|
|
19
40
|
disabled?: boolean;
|
|
20
41
|
isInvalid?: boolean;
|
package/components/select.js
CHANGED
|
@@ -1,73 +1,147 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import * as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { cva as
|
|
6
|
-
import {
|
|
7
|
-
import { Check as
|
|
8
|
-
import { cn as
|
|
9
|
-
import { inputBaseClass as
|
|
10
|
-
import { floatVariants as
|
|
11
|
-
import { Ripple as
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"items-center justify-between gap-2 text-left cursor-pointer",
|
|
2
|
+
import { jsxs as S, jsx as f } from "react/jsx-runtime";
|
|
3
|
+
import * as n from "react";
|
|
4
|
+
import { createPortal as F } from "react-dom";
|
|
5
|
+
import { cva as G } from "class-variance-authority";
|
|
6
|
+
import { motion as J, MotionConfig as Q, AnimatePresence as W } from "motion/react";
|
|
7
|
+
import { Check as X, ChevronDown as Y } from "../lib/icons.js";
|
|
8
|
+
import { cn as b } from "../lib/cn.js";
|
|
9
|
+
import { inputBaseClass as Z } from "./field.js";
|
|
10
|
+
import { floatVariants as C } from "../lib/motion.js";
|
|
11
|
+
import { Ripple as ee } from "./ripple.js";
|
|
12
|
+
const te = G(
|
|
13
|
+
b(
|
|
14
|
+
Z,
|
|
15
|
+
"group/select items-center justify-between gap-2 text-left leading-none cursor-pointer",
|
|
16
|
+
"data-[value-set]:text-on-white-primary!",
|
|
16
17
|
"[&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
17
18
|
),
|
|
18
19
|
{
|
|
19
20
|
variants: {
|
|
20
21
|
size: {
|
|
21
|
-
sm: "h-8 rounded-sm
|
|
22
|
-
md: "h-
|
|
23
|
-
lg: "h-11 rounded-md
|
|
22
|
+
sm: "h-8 rounded-sm",
|
|
23
|
+
md: "h-8 rounded-md",
|
|
24
|
+
lg: "h-11 rounded-md"
|
|
24
25
|
}
|
|
25
26
|
},
|
|
26
27
|
defaultVariants: { size: "md" }
|
|
27
28
|
}
|
|
28
|
-
),
|
|
29
|
+
), K = n.forwardRef(
|
|
29
30
|
({
|
|
30
31
|
items: o,
|
|
31
|
-
value:
|
|
32
|
-
|
|
32
|
+
value: w,
|
|
33
|
+
values: y = [],
|
|
33
34
|
multiple: d = !1,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
35
|
+
activeIndex: i = -1,
|
|
36
|
+
onActiveIndexChange: p,
|
|
37
|
+
onItemSelect: h,
|
|
38
|
+
placement: D = "bottom",
|
|
39
|
+
id: z,
|
|
40
|
+
className: $,
|
|
41
|
+
style: L,
|
|
42
|
+
"aria-label": j
|
|
43
|
+
}, x) => {
|
|
44
|
+
const m = n.useId(), v = z ?? m;
|
|
45
|
+
return /* @__PURE__ */ S(
|
|
46
|
+
J.ul,
|
|
47
|
+
{
|
|
48
|
+
ref: x,
|
|
49
|
+
id: v,
|
|
50
|
+
role: "listbox",
|
|
51
|
+
"aria-label": j,
|
|
52
|
+
"aria-multiselectable": d || void 0,
|
|
53
|
+
"aria-activedescendant": i >= 0 ? `${v}-opt-${i}` : void 0,
|
|
54
|
+
variants: C,
|
|
55
|
+
initial: "hidden",
|
|
56
|
+
animate: "visible",
|
|
57
|
+
exit: "hidden",
|
|
58
|
+
style: {
|
|
59
|
+
transformOrigin: D === "top" ? "bottom" : "top",
|
|
60
|
+
...L
|
|
61
|
+
},
|
|
62
|
+
className: b(
|
|
63
|
+
"pointer-events-auto min-w-[280px] max-h-60 overflow-auto p-1",
|
|
64
|
+
"rounded-md border border-input bg-elevated shadow-elevation",
|
|
65
|
+
$
|
|
66
|
+
),
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ f(ee, { origin: D === "top" ? "bottom" : "top" }),
|
|
69
|
+
o.map((s, g) => {
|
|
70
|
+
const r = d ? y.includes(s.value) : s.value === w, c = g === i;
|
|
71
|
+
return /* @__PURE__ */ S(
|
|
72
|
+
"li",
|
|
73
|
+
{
|
|
74
|
+
id: `${v}-opt-${g}`,
|
|
75
|
+
role: "option",
|
|
76
|
+
"aria-selected": r,
|
|
77
|
+
"aria-disabled": s.disabled || void 0,
|
|
78
|
+
onMouseEnter: () => !s.disabled && (p == null ? void 0 : p(g)),
|
|
79
|
+
onClick: () => !s.disabled && (h == null ? void 0 : h(g)),
|
|
80
|
+
className: b(
|
|
81
|
+
"flex cursor-pointer items-center justify-between gap-2",
|
|
82
|
+
"rounded-sm px-2 py-1.5 text-m font-medium text-foreground select-none",
|
|
83
|
+
!s.disabled && "hover:bg-action-primary-soft hover:text-action-primary-text",
|
|
84
|
+
c && !s.disabled && "bg-action-primary-soft text-action-primary-text",
|
|
85
|
+
r && "text-action-primary-text",
|
|
86
|
+
s.disabled && "pointer-events-none opacity-50"
|
|
87
|
+
),
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ f("span", { className: "truncate", children: s.label }),
|
|
90
|
+
r && /* @__PURE__ */ f(X, { className: "size-4 shrink-0", "aria-hidden": !0 })
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
s.value
|
|
94
|
+
);
|
|
95
|
+
})
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
K.displayName = "DropdownOptions";
|
|
102
|
+
const re = n.forwardRef(
|
|
103
|
+
({
|
|
104
|
+
items: o,
|
|
105
|
+
value: w,
|
|
106
|
+
onChange: y,
|
|
107
|
+
multiple: d = !1,
|
|
108
|
+
values: i = [],
|
|
109
|
+
onValuesChange: p,
|
|
110
|
+
placeholder: h = "Select",
|
|
111
|
+
size: D,
|
|
112
|
+
disabled: z,
|
|
113
|
+
isInvalid: $,
|
|
114
|
+
className: L,
|
|
115
|
+
id: j,
|
|
116
|
+
placement: x = "bottom",
|
|
117
|
+
portal: m = !1,
|
|
118
|
+
"aria-label": v,
|
|
119
|
+
"aria-describedby": s
|
|
120
|
+
}, g) => {
|
|
121
|
+
const [r, c] = n.useState(!1), [k, M] = n.useState(-1), O = n.useRef(null), R = n.useRef(null), B = n.useId(), [l, H] = n.useState(null), A = o.find((e) => e.value === w), E = d ? o.filter((e) => i.includes(e.value)) : [], U = d ? E.length > 0 : !!A, V = n.useCallback(() => {
|
|
122
|
+
const e = d ? o.findIndex((t) => i.includes(t.value)) : o.findIndex((t) => t.value === w);
|
|
49
123
|
return e >= 0 && !o[e].disabled ? e : o.findIndex((t) => !t.disabled);
|
|
50
|
-
}, [o, d,
|
|
51
|
-
|
|
124
|
+
}, [o, d, w, i]);
|
|
125
|
+
n.useEffect(() => {
|
|
52
126
|
if (!r) return;
|
|
53
127
|
const e = (t) => {
|
|
54
|
-
var
|
|
55
|
-
const
|
|
56
|
-
(
|
|
128
|
+
var u, N;
|
|
129
|
+
const a = t.target;
|
|
130
|
+
(u = O.current) != null && u.contains(a) || (N = R.current) != null && N.contains(a) || c(!1);
|
|
57
131
|
};
|
|
58
132
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
59
|
-
}, [r]),
|
|
60
|
-
if (!r || !
|
|
61
|
-
|
|
133
|
+
}, [r]), n.useLayoutEffect(() => {
|
|
134
|
+
if (!r || !m) {
|
|
135
|
+
H(null);
|
|
62
136
|
return;
|
|
63
137
|
}
|
|
64
138
|
const e = () => {
|
|
65
|
-
var
|
|
66
|
-
const t = (
|
|
139
|
+
var u, N;
|
|
140
|
+
const t = (u = O.current) == null ? void 0 : u.getBoundingClientRect();
|
|
67
141
|
if (!t) return;
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
top:
|
|
142
|
+
const a = ((N = R.current) == null ? void 0 : N.offsetHeight) ?? 0;
|
|
143
|
+
H({
|
|
144
|
+
top: x === "top" ? t.top - a - 6 : t.bottom + 6,
|
|
71
145
|
left: t.left,
|
|
72
146
|
width: t.width
|
|
73
147
|
});
|
|
@@ -75,146 +149,112 @@ const Z = C(
|
|
|
75
149
|
return e(), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
|
|
76
150
|
window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
|
|
77
151
|
};
|
|
78
|
-
}, [r,
|
|
152
|
+
}, [r, x, m]), n.useEffect(() => {
|
|
79
153
|
var t;
|
|
80
|
-
if (!r ||
|
|
81
|
-
const e = (t =
|
|
154
|
+
if (!r || k < 0) return;
|
|
155
|
+
const e = (t = R.current) == null ? void 0 : t.children[k];
|
|
82
156
|
e == null || e.scrollIntoView({ block: "nearest" });
|
|
83
|
-
}, [r,
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
let
|
|
89
|
-
for (let
|
|
90
|
-
if (
|
|
157
|
+
}, [r, k]);
|
|
158
|
+
const I = () => {
|
|
159
|
+
z || (M(V()), c(!0));
|
|
160
|
+
}, P = (e) => {
|
|
161
|
+
M((t) => {
|
|
162
|
+
let a = t;
|
|
163
|
+
for (let u = 0; u < o.length; u++)
|
|
164
|
+
if (a = (a + e + o.length) % o.length, !o[a].disabled) return a;
|
|
91
165
|
return t;
|
|
92
166
|
});
|
|
93
|
-
},
|
|
167
|
+
}, T = (e) => {
|
|
94
168
|
const t = o[e];
|
|
95
169
|
if (!(!t || t.disabled)) {
|
|
96
170
|
if (d) {
|
|
97
|
-
|
|
98
|
-
|
|
171
|
+
p == null || p(
|
|
172
|
+
i.includes(t.value) ? i.filter((a) => a !== t.value) : [...i, t.value]
|
|
99
173
|
);
|
|
100
174
|
return;
|
|
101
175
|
}
|
|
102
|
-
|
|
176
|
+
y == null || y(t.value), c(!1);
|
|
103
177
|
}
|
|
104
|
-
},
|
|
178
|
+
}, q = (e) => {
|
|
105
179
|
switch (e.key) {
|
|
106
180
|
case "ArrowDown":
|
|
107
|
-
e.preventDefault(), r ?
|
|
181
|
+
e.preventDefault(), r ? P(1) : I();
|
|
108
182
|
break;
|
|
109
183
|
case "ArrowUp":
|
|
110
|
-
e.preventDefault(), r ?
|
|
184
|
+
e.preventDefault(), r ? P(-1) : I();
|
|
111
185
|
break;
|
|
112
186
|
case "Enter":
|
|
113
187
|
case " ":
|
|
114
|
-
e.preventDefault(), r ?
|
|
188
|
+
e.preventDefault(), r ? T(k) : I();
|
|
115
189
|
break;
|
|
116
190
|
case "Escape":
|
|
117
|
-
r && (e.preventDefault(), e.stopPropagation(),
|
|
191
|
+
r && (e.preventDefault(), e.stopPropagation(), c(!1));
|
|
118
192
|
break;
|
|
119
193
|
case "Tab":
|
|
120
|
-
|
|
194
|
+
c(!1);
|
|
121
195
|
break;
|
|
122
196
|
}
|
|
123
|
-
},
|
|
124
|
-
|
|
197
|
+
}, _ = /* @__PURE__ */ f(Q, { reducedMotion: "user", children: /* @__PURE__ */ f(W, { children: r && /* @__PURE__ */ f(
|
|
198
|
+
K,
|
|
125
199
|
{
|
|
126
|
-
ref:
|
|
127
|
-
id:
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
200
|
+
ref: R,
|
|
201
|
+
id: B,
|
|
202
|
+
"aria-label": v ? `${v} options` : "Select options",
|
|
203
|
+
items: o,
|
|
204
|
+
value: w,
|
|
205
|
+
values: i,
|
|
206
|
+
multiple: d,
|
|
207
|
+
activeIndex: k,
|
|
208
|
+
onActiveIndexChange: M,
|
|
209
|
+
onItemSelect: T,
|
|
210
|
+
placement: x,
|
|
135
211
|
style: {
|
|
136
|
-
|
|
137
|
-
...p ? {
|
|
212
|
+
...m ? {
|
|
138
213
|
position: "fixed",
|
|
139
|
-
top: (
|
|
140
|
-
left: (
|
|
141
|
-
width: (
|
|
142
|
-
visibility:
|
|
214
|
+
top: (l == null ? void 0 : l.top) ?? 0,
|
|
215
|
+
left: (l == null ? void 0 : l.left) ?? 0,
|
|
216
|
+
width: (l == null ? void 0 : l.width) ?? 0,
|
|
217
|
+
visibility: l ? "visible" : "hidden",
|
|
143
218
|
zIndex: 60
|
|
144
219
|
} : {}
|
|
145
220
|
},
|
|
146
|
-
className:
|
|
147
|
-
"max-h-60 overflow-auto p-1",
|
|
221
|
+
className: b(
|
|
222
|
+
"pointer-events-auto max-h-60 overflow-auto p-1",
|
|
148
223
|
"rounded-md border border-border bg-elevated shadow-elevation",
|
|
149
|
-
|
|
224
|
+
m ? "fixed" : b(
|
|
150
225
|
"absolute z-50 w-full",
|
|
151
|
-
|
|
226
|
+
x === "top" ? "bottom-full mb-1.5" : "top-full mt-1.5"
|
|
152
227
|
)
|
|
153
|
-
)
|
|
154
|
-
children: [
|
|
155
|
-
/* @__PURE__ */ u(Y, { origin: m === "top" ? "bottom" : "top" }),
|
|
156
|
-
o.map((e, t) => {
|
|
157
|
-
const n = d ? l.includes(e.value) : e.value === h, a = t === c;
|
|
158
|
-
return /* @__PURE__ */ k(
|
|
159
|
-
"li",
|
|
160
|
-
{
|
|
161
|
-
id: `${g}-opt-${t}`,
|
|
162
|
-
role: "option",
|
|
163
|
-
"aria-selected": n,
|
|
164
|
-
"aria-disabled": e.disabled || void 0,
|
|
165
|
-
onMouseEnter: () => !e.disabled && N(t),
|
|
166
|
-
onClick: () => $(t),
|
|
167
|
-
className: f(
|
|
168
|
-
"flex cursor-pointer items-center justify-between gap-2",
|
|
169
|
-
"rounded-sm px-2 py-1.5 text-xs text-foreground select-none",
|
|
170
|
-
a && !e.disabled && "bg-muted",
|
|
171
|
-
e.disabled && "pointer-events-none opacity-50"
|
|
172
|
-
),
|
|
173
|
-
children: [
|
|
174
|
-
/* @__PURE__ */ u("span", { className: "truncate", children: e.label }),
|
|
175
|
-
n && /* @__PURE__ */ u(Q, { className: "size-4 shrink-0", "aria-hidden": !0 })
|
|
176
|
-
]
|
|
177
|
-
},
|
|
178
|
-
e.value
|
|
179
|
-
);
|
|
180
|
-
})
|
|
181
|
-
]
|
|
228
|
+
)
|
|
182
229
|
}
|
|
183
230
|
) }) });
|
|
184
|
-
return /* @__PURE__ */
|
|
185
|
-
/* @__PURE__ */
|
|
231
|
+
return /* @__PURE__ */ S("div", { ref: O, className: b("relative", r && "z-[70]"), children: [
|
|
232
|
+
/* @__PURE__ */ S(
|
|
186
233
|
"button",
|
|
187
234
|
{
|
|
188
|
-
ref:
|
|
189
|
-
id:
|
|
235
|
+
ref: g,
|
|
236
|
+
id: j,
|
|
190
237
|
type: "button",
|
|
191
238
|
role: "combobox",
|
|
192
239
|
"aria-haspopup": "listbox",
|
|
193
240
|
"aria-expanded": r,
|
|
194
|
-
"aria-controls":
|
|
195
|
-
"aria-invalid":
|
|
196
|
-
"aria-label":
|
|
197
|
-
"aria-describedby":
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
241
|
+
"aria-controls": B,
|
|
242
|
+
"aria-invalid": $ || void 0,
|
|
243
|
+
"aria-label": v,
|
|
244
|
+
"aria-describedby": s,
|
|
245
|
+
"data-value-set": U || void 0,
|
|
246
|
+
disabled: z,
|
|
247
|
+
onClick: () => r ? c(!1) : I(),
|
|
248
|
+
onKeyDown: q,
|
|
249
|
+
className: b(te({ size: D }), L),
|
|
202
250
|
children: [
|
|
203
|
-
/* @__PURE__ */
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
className: f(
|
|
207
|
-
"truncate",
|
|
208
|
-
d ? v.length === 0 && "text-muted-foreground" : !D && "text-muted-foreground"
|
|
209
|
-
),
|
|
210
|
-
children: d ? v.length === 0 ? R : v.length === 1 ? v[0].label : `${v.length} selected` : D ? D.label : R
|
|
211
|
-
}
|
|
212
|
-
),
|
|
213
|
-
/* @__PURE__ */ u(
|
|
214
|
-
V,
|
|
251
|
+
/* @__PURE__ */ f("span", { className: "truncate", children: d ? E.length === 0 ? h : E.length === 1 ? E[0].label : `${E.length} selected` : A ? A.label : h }),
|
|
252
|
+
/* @__PURE__ */ f(
|
|
253
|
+
Y,
|
|
215
254
|
{
|
|
216
|
-
className:
|
|
217
|
-
"size-4 text-muted-foreground transition-transform duration-150 ease-out motion-reduce:transition-none",
|
|
255
|
+
className: b(
|
|
256
|
+
"size-4 text-muted-foreground transition-[color,transform] duration-150 ease-out motion-reduce:transition-none",
|
|
257
|
+
"group-hover/select:text-foreground group-focus/select:text-g12!",
|
|
218
258
|
r && "rotate-180"
|
|
219
259
|
),
|
|
220
260
|
"aria-hidden": !0
|
|
@@ -223,11 +263,12 @@ const Z = C(
|
|
|
223
263
|
]
|
|
224
264
|
}
|
|
225
265
|
),
|
|
226
|
-
|
|
266
|
+
m && typeof document < "u" ? F(_, document.body) : _
|
|
227
267
|
] });
|
|
228
268
|
}
|
|
229
269
|
);
|
|
230
|
-
|
|
270
|
+
re.displayName = "Select";
|
|
231
271
|
export {
|
|
232
|
-
|
|
272
|
+
K as DropdownOptions,
|
|
273
|
+
re as Select
|
|
233
274
|
};
|
|
@@ -4,10 +4,11 @@ import * as React from "react";
|
|
|
4
4
|
* SettingList / SettingRow — the grouped settings stack: one row per setting,
|
|
5
5
|
* each reading leading glyph → what it is → the control that changes it.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* A row
|
|
10
|
-
*
|
|
7
|
+
* Rows sit directly on their parent surface and separate with inset hairlines.
|
|
8
|
+
* This keeps a white Card/Panel from alternating white → grey → white again.
|
|
9
|
+
* A row receives a neutral wash only as interaction feedback when `onSelect`
|
|
10
|
+
* makes the whole row actionable (principle 1: panels establish hierarchy;
|
|
11
|
+
* items express state).
|
|
11
12
|
*
|
|
12
13
|
* The trailing slot takes whatever changes the setting: a `Button`, a
|
|
13
14
|
* `Switch`, a `Badge`, or nothing. The leading slot takes the label — pass a
|
|
@@ -30,6 +31,6 @@ export interface SettingRowProps extends Omit<React.HTMLAttributes<HTMLDivElemen
|
|
|
30
31
|
}
|
|
31
32
|
export declare const SettingRow: React.ForwardRefExoticComponent<SettingRowProps & React.RefAttributes<HTMLDivElement>>;
|
|
32
33
|
export type SettingListProps = React.HTMLAttributes<HTMLDivElement>;
|
|
33
|
-
/**
|
|
34
|
+
/** A surface-neutral row group; each row owns its inset divider. */
|
|
34
35
|
export declare const SettingList: React.ForwardRefExoticComponent<SettingListProps & React.RefAttributes<HTMLDivElement>>;
|
|
35
36
|
export { settingRowVariants };
|