@actioneer/ads 0.6.0 → 0.8.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/DESIGN.md +597 -0
- package/components/ai-elements/agent-trace.d.ts +2 -2
- package/components/ai-elements/agent-trace.js +164 -105
- 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/action-bar.js +1 -1
- package/components/assistant-ui/attachment.js +11 -11
- package/components/assistant-ui/badge.js +18 -18
- package/components/assistant-ui/composer-harness.js +15 -20
- package/components/assistant-ui/composer-trigger-popover.js +9 -9
- package/components/assistant-ui/composer.d.ts +3 -1
- package/components/assistant-ui/composer.js +148 -144
- package/components/assistant-ui/image.js +61 -61
- package/components/assistant-ui/index.d.ts +0 -3
- package/components/assistant-ui/message-timing.js +1 -1
- package/components/assistant-ui/selection-toolbar.js +7 -7
- 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/divider.js +25 -25
- package/components/drawer.d.ts +6 -2
- package/components/drawer.js +61 -58
- package/components/dropdown.d.ts +1 -2
- package/components/dropdown.js +88 -89
- package/components/field.js +41 -36
- package/components/file-dropzone.js +1 -1
- package/components/index.d.ts +4 -4
- package/components/index.js +501 -549
- 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 +32 -29
- package/components/modal.d.ts +31 -3
- package/components/modal.js +244 -170
- 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/pixel-blast-svg.js +71 -73
- 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 +151 -141
- 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 +427 -412
- package/components/tabs.d.ts +2 -0
- package/components/tabs.js +160 -295
- 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/button.js +4 -4
- package/components/ui/dialog.js +25 -25
- 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 +103 -102
- package/lib/interactive.d.ts +1 -1
- package/llms.txt +132 -188
- package/manifest.json +1719 -2831
- package/package.json +2 -2
- package/styles.css +362 -233
- package/theme.css +312 -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/drawer.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as i, jsxs as
|
|
2
|
+
import { jsx as i, jsxs as y } from "react/jsx-runtime";
|
|
3
3
|
import * as a from "react";
|
|
4
4
|
import { createPortal as E } from "react-dom";
|
|
5
|
-
import { MotionConfig as
|
|
5
|
+
import { MotionConfig as z, AnimatePresence as N, motion as w } from "motion/react";
|
|
6
6
|
import { Close as R } from "../lib/icons.js";
|
|
7
7
|
import { cva as j } from "class-variance-authority";
|
|
8
8
|
import { cn as n } from "../lib/cn.js";
|
|
9
9
|
import { springSheet as l, drawerOffset as h, drawerBackdropVariants as F } from "../lib/motion.js";
|
|
10
|
-
const
|
|
10
|
+
const k = j(
|
|
11
11
|
[
|
|
12
12
|
"relative flex flex-col",
|
|
13
13
|
"bg-elevated text-foreground",
|
|
@@ -53,7 +53,7 @@ const N = j(
|
|
|
53
53
|
lg: "50%",
|
|
54
54
|
xl: "66.666667%"
|
|
55
55
|
};
|
|
56
|
-
function
|
|
56
|
+
function D({
|
|
57
57
|
onClick: t,
|
|
58
58
|
className: e
|
|
59
59
|
}) {
|
|
@@ -79,32 +79,32 @@ function k({
|
|
|
79
79
|
function G({
|
|
80
80
|
open: t,
|
|
81
81
|
onOpenChange: e,
|
|
82
|
-
side:
|
|
83
|
-
size:
|
|
84
|
-
className:
|
|
82
|
+
side: r,
|
|
83
|
+
size: v,
|
|
84
|
+
className: c,
|
|
85
85
|
children: x,
|
|
86
86
|
"aria-label": g
|
|
87
87
|
}) {
|
|
88
|
-
const
|
|
88
|
+
const d = r ?? "right", m = a.useRef(null), s = a.useRef(null);
|
|
89
89
|
return a.useEffect(() => {
|
|
90
90
|
if (!t) return;
|
|
91
|
-
|
|
92
|
-
const
|
|
91
|
+
s.current = document.activeElement;
|
|
92
|
+
const p = document.body.style.overflow;
|
|
93
93
|
document.body.style.overflow = "hidden";
|
|
94
|
-
const
|
|
94
|
+
const f = (o) => {
|
|
95
95
|
o.key === "Escape" && (o.stopPropagation(), e(!1));
|
|
96
96
|
};
|
|
97
|
-
document.addEventListener("keydown",
|
|
98
|
-
const
|
|
97
|
+
document.addEventListener("keydown", f);
|
|
98
|
+
const u = requestAnimationFrame(() => {
|
|
99
99
|
var o;
|
|
100
|
-
(o =
|
|
100
|
+
(o = m.current) == null || o.focus();
|
|
101
101
|
});
|
|
102
102
|
return () => {
|
|
103
|
-
var o,
|
|
104
|
-
document.removeEventListener("keydown",
|
|
103
|
+
var o, b;
|
|
104
|
+
document.removeEventListener("keydown", f), document.body.style.overflow = p, cancelAnimationFrame(u), (b = (o = s.current) == null ? void 0 : o.focus) == null || b.call(o);
|
|
105
105
|
};
|
|
106
106
|
}, [t, e]), E(
|
|
107
|
-
/* @__PURE__ */ i(
|
|
107
|
+
/* @__PURE__ */ i(z, { reducedMotion: "user", children: /* @__PURE__ */ i(N, { children: t && /* @__PURE__ */ y("div", { className: n("fixed inset-0 z-50 flex", A[d]), children: [
|
|
108
108
|
/* @__PURE__ */ i(
|
|
109
109
|
w.div,
|
|
110
110
|
{
|
|
@@ -118,21 +118,21 @@ function G({
|
|
|
118
118
|
},
|
|
119
119
|
"backdrop"
|
|
120
120
|
),
|
|
121
|
-
/* @__PURE__ */
|
|
121
|
+
/* @__PURE__ */ y(
|
|
122
122
|
w.div,
|
|
123
123
|
{
|
|
124
|
-
ref:
|
|
125
|
-
initial: h[
|
|
124
|
+
ref: m,
|
|
125
|
+
initial: h[d],
|
|
126
126
|
animate: { transform: "translate3d(0, 0, 0)", opacity: 1, transition: l },
|
|
127
|
-
exit: { ...h[
|
|
127
|
+
exit: { ...h[d], pointerEvents: "none", transition: l },
|
|
128
128
|
role: "dialog",
|
|
129
129
|
"aria-modal": "true",
|
|
130
130
|
"aria-label": g,
|
|
131
131
|
tabIndex: -1,
|
|
132
|
-
className: n(
|
|
132
|
+
className: n(k({ side: d, size: v }), "relative outline-none", c),
|
|
133
133
|
children: [
|
|
134
134
|
/* @__PURE__ */ i(
|
|
135
|
-
|
|
135
|
+
D,
|
|
136
136
|
{
|
|
137
137
|
onClick: () => e(!1),
|
|
138
138
|
className: "right-4 top-4"
|
|
@@ -150,53 +150,56 @@ function G({
|
|
|
150
150
|
function L({
|
|
151
151
|
open: t,
|
|
152
152
|
onOpenChange: e,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
153
|
+
dismissible: r = !0,
|
|
154
|
+
side: v,
|
|
155
|
+
size: c,
|
|
156
|
+
containerClassName: x,
|
|
157
|
+
className: g,
|
|
158
|
+
children: d,
|
|
159
|
+
"aria-label": m
|
|
158
160
|
}) {
|
|
159
|
-
const
|
|
161
|
+
const s = v ?? "right", p = c ?? "md", f = a.useRef(null);
|
|
160
162
|
return a.useEffect(() => {
|
|
161
|
-
if (!t) return;
|
|
162
|
-
const
|
|
163
|
-
|
|
163
|
+
if (!t || !r) return;
|
|
164
|
+
const u = (o) => {
|
|
165
|
+
o.key === "Escape" && e(!1);
|
|
164
166
|
};
|
|
165
|
-
return document.addEventListener("keydown",
|
|
166
|
-
}, [t, e]), /* @__PURE__ */ i(
|
|
167
|
+
return document.addEventListener("keydown", u), () => document.removeEventListener("keydown", u);
|
|
168
|
+
}, [t, e, r]), /* @__PURE__ */ i(z, { reducedMotion: "user", children: /* @__PURE__ */ i(N, { initial: !1, children: t && /* @__PURE__ */ i(
|
|
167
169
|
w.div,
|
|
168
170
|
{
|
|
169
|
-
initial:
|
|
170
|
-
animate:
|
|
171
|
-
exit:
|
|
171
|
+
initial: s === "bottom" ? { height: "0%" } : { width: 0 },
|
|
172
|
+
animate: s === "bottom" ? { height: B[p], transition: l } : { width: "auto", transition: l },
|
|
173
|
+
exit: s === "bottom" ? { height: "0%", pointerEvents: "none", transition: l } : { width: 0, pointerEvents: "none", transition: l },
|
|
172
174
|
className: n(
|
|
173
175
|
"shrink-0 overflow-hidden",
|
|
174
|
-
|
|
176
|
+
s === "bottom" ? "w-full" : "h-full",
|
|
177
|
+
x
|
|
175
178
|
),
|
|
176
|
-
children: /* @__PURE__ */
|
|
179
|
+
children: /* @__PURE__ */ y(
|
|
177
180
|
w.aside,
|
|
178
181
|
{
|
|
179
|
-
ref:
|
|
180
|
-
initial: h[
|
|
182
|
+
ref: f,
|
|
183
|
+
initial: h[s],
|
|
181
184
|
animate: { transform: "translate3d(0, 0, 0)", opacity: 1, transition: l },
|
|
182
|
-
exit: { ...h[
|
|
185
|
+
exit: { ...h[s], pointerEvents: "none", transition: l },
|
|
183
186
|
role: "complementary",
|
|
184
|
-
"aria-label":
|
|
187
|
+
"aria-label": m,
|
|
185
188
|
className: n(
|
|
186
|
-
|
|
187
|
-
"relative shrink-0 overflow-hidden rounded-lg bg-card shadow-none outline-none",
|
|
188
|
-
|
|
189
|
-
|
|
189
|
+
k({ side: s, size: c }),
|
|
190
|
+
"relative shrink-0 overflow-hidden rounded-lg border-0 bg-card shadow-none outline-none",
|
|
191
|
+
s === "bottom" && "h-full",
|
|
192
|
+
g
|
|
190
193
|
),
|
|
191
194
|
children: [
|
|
192
|
-
/* @__PURE__ */ i(
|
|
193
|
-
|
|
195
|
+
r && /* @__PURE__ */ i(
|
|
196
|
+
D,
|
|
194
197
|
{
|
|
195
198
|
onClick: () => e(!1),
|
|
196
199
|
className: "right-2 top-1"
|
|
197
200
|
}
|
|
198
201
|
),
|
|
199
|
-
|
|
202
|
+
d
|
|
200
203
|
]
|
|
201
204
|
}
|
|
202
205
|
)
|
|
@@ -204,38 +207,38 @@ function L({
|
|
|
204
207
|
"inline-drawer-slot"
|
|
205
208
|
) }) });
|
|
206
209
|
}
|
|
207
|
-
const J = L, M = a.forwardRef(({ className: t, ...e },
|
|
210
|
+
const J = L, M = a.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i(
|
|
208
211
|
"div",
|
|
209
212
|
{
|
|
210
|
-
ref:
|
|
213
|
+
ref: r,
|
|
211
214
|
className: n("flex flex-col gap-1 px-6 py-4 pr-14", t),
|
|
212
215
|
...e
|
|
213
216
|
}
|
|
214
217
|
));
|
|
215
218
|
M.displayName = "DrawerHeader";
|
|
216
|
-
const V = a.forwardRef(({ className: t, ...e },
|
|
219
|
+
const V = a.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i(
|
|
217
220
|
"h2",
|
|
218
221
|
{
|
|
219
|
-
ref:
|
|
222
|
+
ref: r,
|
|
220
223
|
className: n("text-lg font-medium text-foreground", t),
|
|
221
224
|
...e
|
|
222
225
|
}
|
|
223
226
|
));
|
|
224
227
|
V.displayName = "DrawerTitle";
|
|
225
|
-
const I = a.forwardRef(({ className: t, ...e },
|
|
228
|
+
const I = a.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i(
|
|
226
229
|
"div",
|
|
227
230
|
{
|
|
228
|
-
ref:
|
|
231
|
+
ref: r,
|
|
229
232
|
tabIndex: 0,
|
|
230
233
|
className: n("flex-1 overflow-y-auto px-6 py-4 text-xs text-foreground", t),
|
|
231
234
|
...e
|
|
232
235
|
}
|
|
233
236
|
));
|
|
234
237
|
I.displayName = "DrawerBody";
|
|
235
|
-
const P = a.forwardRef(({ className: t, ...e },
|
|
238
|
+
const P = a.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i(
|
|
236
239
|
"div",
|
|
237
240
|
{
|
|
238
|
-
ref:
|
|
241
|
+
ref: r,
|
|
239
242
|
className: n(
|
|
240
243
|
"flex items-center justify-end gap-2 px-6 py-4",
|
|
241
244
|
t
|
package/components/dropdown.d.ts
CHANGED
|
@@ -17,11 +17,10 @@ export interface DropdownContentProps extends React.HTMLAttributes<HTMLDivElemen
|
|
|
17
17
|
align?: "start" | "end";
|
|
18
18
|
/** Which side of the trigger the menu opens on. Default below. */
|
|
19
19
|
side?: "top" | "bottom";
|
|
20
|
-
sideOffset?: number;
|
|
21
20
|
/** Opt in to focusing the first item when the menu opens. */
|
|
22
21
|
autoFocusFirstItem?: boolean;
|
|
23
22
|
}
|
|
24
|
-
export declare function DropdownContent({ className, align, side,
|
|
23
|
+
export declare function DropdownContent({ className, align, side, autoFocusFirstItem, children, ...props }: DropdownContentProps): React.ReactPortal;
|
|
25
24
|
export interface DropdownItemProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onSelect"> {
|
|
26
25
|
startContent?: React.ReactNode;
|
|
27
26
|
danger?: boolean;
|
package/components/dropdown.js
CHANGED
|
@@ -1,82 +1,81 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as N, jsx as h } from "react/jsx-runtime";
|
|
3
3
|
import * as s from "react";
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { MotionConfig as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { menuVariants as
|
|
8
|
-
import { Ripple as
|
|
9
|
-
const C = (r, t) => `${r === "top" ? "bottom" : "top"} ${t === "start" ? "left" : "right"}`,
|
|
4
|
+
import { createPortal as A } from "react-dom";
|
|
5
|
+
import { MotionConfig as I, AnimatePresence as P, motion as z } from "motion/react";
|
|
6
|
+
import { cn as R } from "../lib/cn.js";
|
|
7
|
+
import { menuVariants as S } from "../lib/motion.js";
|
|
8
|
+
import { Ripple as _ } from "./ripple.js";
|
|
9
|
+
const C = 6, L = (r, t) => `${r === "top" ? "bottom" : "top"} ${t === "start" ? "left" : "right"}`, O = s.createContext(null);
|
|
10
10
|
function k(r) {
|
|
11
|
-
const t = s.useContext(
|
|
11
|
+
const t = s.useContext(O);
|
|
12
12
|
if (!t)
|
|
13
13
|
throw new Error(`${r} must be used within a <Dropdown>.`);
|
|
14
14
|
return t;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
const [n,
|
|
18
|
-
return /* @__PURE__ */
|
|
16
|
+
function B({ children: r, defaultOpen: t = !1 }) {
|
|
17
|
+
const [n, f] = s.useState(t), p = s.useRef(null), d = s.useRef(null);
|
|
18
|
+
return /* @__PURE__ */ h(O.Provider, { value: { open: n, setOpen: f, triggerRef: p, contentRef: d }, children: r });
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
const { open: t, setOpen: n, triggerRef:
|
|
22
|
-
return s.cloneElement(
|
|
23
|
-
ref:
|
|
20
|
+
function U({ children: r }) {
|
|
21
|
+
const { open: t, setOpen: n, triggerRef: f } = k("DropdownTrigger"), p = r;
|
|
22
|
+
return s.cloneElement(p, {
|
|
23
|
+
ref: f,
|
|
24
24
|
"aria-expanded": t,
|
|
25
25
|
"aria-haspopup": "menu",
|
|
26
|
-
onClick: (
|
|
27
|
-
var
|
|
28
|
-
(
|
|
26
|
+
onClick: (d) => {
|
|
27
|
+
var a, m;
|
|
28
|
+
(m = (a = p.props).onClick) == null || m.call(a, d), n(!t);
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function V({
|
|
33
33
|
className: r,
|
|
34
34
|
align: t = "start",
|
|
35
35
|
side: n = "bottom",
|
|
36
|
-
|
|
37
|
-
autoFocusFirstItem: l = !1,
|
|
36
|
+
autoFocusFirstItem: f = !1,
|
|
38
37
|
children: p,
|
|
39
|
-
...
|
|
38
|
+
...d
|
|
40
39
|
}) {
|
|
41
|
-
const { open: a, setOpen:
|
|
40
|
+
const { open: a, setOpen: m, triggerRef: w, contentRef: c } = k("DropdownContent"), [l, D] = s.useState(null);
|
|
42
41
|
s.useLayoutEffect(() => {
|
|
43
42
|
if (!a) return;
|
|
44
|
-
const i =
|
|
43
|
+
const i = w.current;
|
|
45
44
|
if (!i) return;
|
|
46
45
|
const e = () => {
|
|
47
|
-
var x,
|
|
48
|
-
const o = i.getBoundingClientRect(),
|
|
49
|
-
|
|
46
|
+
var x, b;
|
|
47
|
+
const o = i.getBoundingClientRect(), u = ((x = c.current) == null ? void 0 : x.offsetWidth) ?? 0, v = ((b = c.current) == null ? void 0 : b.offsetHeight) ?? 0, y = t === "end" ? o.right - u : o.left, E = n === "top" ? o.top - v - C : o.bottom + C;
|
|
48
|
+
D({ top: E, left: y });
|
|
50
49
|
};
|
|
51
50
|
return e(), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
|
|
52
51
|
window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
|
|
53
52
|
};
|
|
54
|
-
}, [a, t, n,
|
|
53
|
+
}, [a, t, n, w, c]), s.useEffect(() => {
|
|
55
54
|
if (!a) return;
|
|
56
55
|
const i = requestAnimationFrame(() => {
|
|
57
56
|
var e, o;
|
|
58
|
-
if (
|
|
59
|
-
const
|
|
57
|
+
if (f) {
|
|
58
|
+
const u = (e = c.current) == null ? void 0 : e.querySelector(
|
|
60
59
|
'[role="menuitem"]:not([aria-disabled="true"])'
|
|
61
60
|
);
|
|
62
|
-
|
|
61
|
+
u == null || u.focus();
|
|
63
62
|
} else
|
|
64
63
|
(o = c.current) == null || o.focus();
|
|
65
64
|
});
|
|
66
65
|
return () => cancelAnimationFrame(i);
|
|
67
|
-
}, [a,
|
|
66
|
+
}, [a, f, c]), s.useEffect(() => {
|
|
68
67
|
if (!a) return;
|
|
69
68
|
const i = (e) => {
|
|
70
|
-
var
|
|
69
|
+
var u, v;
|
|
71
70
|
const o = e.target;
|
|
72
|
-
(
|
|
71
|
+
(u = c.current) != null && u.contains(o) || (v = w.current) != null && v.contains(o) || m(!1);
|
|
73
72
|
};
|
|
74
73
|
return document.addEventListener("pointerdown", i), () => document.removeEventListener("pointerdown", i);
|
|
75
|
-
}, [a,
|
|
76
|
-
const
|
|
77
|
-
var
|
|
74
|
+
}, [a, m, w, c]);
|
|
75
|
+
const g = (i) => {
|
|
76
|
+
var u, v, y, E, x, b;
|
|
78
77
|
const e = Array.from(
|
|
79
|
-
((
|
|
78
|
+
((u = c.current) == null ? void 0 : u.querySelectorAll(
|
|
80
79
|
'[role="menuitem"]:not([aria-disabled="true"])'
|
|
81
80
|
)) ?? []
|
|
82
81
|
);
|
|
@@ -84,49 +83,49 @@ function W({
|
|
|
84
83
|
const o = e.indexOf(document.activeElement);
|
|
85
84
|
switch (i.key) {
|
|
86
85
|
case "Escape":
|
|
87
|
-
i.preventDefault(),
|
|
86
|
+
i.preventDefault(), m(!1), (v = w.current) == null || v.focus();
|
|
88
87
|
break;
|
|
89
88
|
case "ArrowDown":
|
|
90
|
-
i.preventDefault(), (
|
|
89
|
+
i.preventDefault(), (y = e[o < 0 ? 0 : (o + 1) % e.length]) == null || y.focus();
|
|
91
90
|
break;
|
|
92
91
|
case "ArrowUp":
|
|
93
|
-
i.preventDefault(), (
|
|
92
|
+
i.preventDefault(), (E = e[o < 0 ? e.length - 1 : (o - 1 + e.length) % e.length]) == null || E.focus();
|
|
94
93
|
break;
|
|
95
94
|
case "Home":
|
|
96
95
|
i.preventDefault(), (x = e[0]) == null || x.focus();
|
|
97
96
|
break;
|
|
98
97
|
case "End":
|
|
99
|
-
i.preventDefault(), (
|
|
98
|
+
i.preventDefault(), (b = e[e.length - 1]) == null || b.focus();
|
|
100
99
|
break;
|
|
101
100
|
}
|
|
102
101
|
};
|
|
103
|
-
return
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
-
|
|
102
|
+
return A(
|
|
103
|
+
/* @__PURE__ */ h(I, { reducedMotion: "user", children: /* @__PURE__ */ h(P, { children: a && /* @__PURE__ */ N(
|
|
104
|
+
z.div,
|
|
106
105
|
{
|
|
107
106
|
ref: c,
|
|
108
107
|
role: "menu",
|
|
109
108
|
tabIndex: -1,
|
|
110
|
-
onKeyDown:
|
|
111
|
-
variants:
|
|
109
|
+
onKeyDown: g,
|
|
110
|
+
variants: S,
|
|
112
111
|
initial: "hidden",
|
|
113
112
|
animate: "visible",
|
|
114
113
|
exit: "hidden",
|
|
115
114
|
style: {
|
|
116
115
|
position: "fixed",
|
|
117
|
-
top: (
|
|
118
|
-
left: (
|
|
119
|
-
visibility:
|
|
120
|
-
transformOrigin:
|
|
116
|
+
top: (l == null ? void 0 : l.top) ?? 0,
|
|
117
|
+
left: (l == null ? void 0 : l.left) ?? 0,
|
|
118
|
+
visibility: l ? "visible" : "hidden",
|
|
119
|
+
transformOrigin: L(n, t)
|
|
121
120
|
},
|
|
122
|
-
className:
|
|
123
|
-
"relative z-50 min-w-44 rounded-lg border border-
|
|
121
|
+
className: R(
|
|
122
|
+
"relative z-50 min-w-44 rounded-lg border border-menu-stroke bg-elevated p-1",
|
|
124
123
|
"text-foreground shadow-elevation outline-none",
|
|
125
124
|
r
|
|
126
125
|
),
|
|
127
|
-
...
|
|
126
|
+
...d,
|
|
128
127
|
children: [
|
|
129
|
-
/* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */ h(_, { origin: L(n, t) }),
|
|
130
129
|
p
|
|
131
130
|
]
|
|
132
131
|
}
|
|
@@ -134,78 +133,78 @@ function W({
|
|
|
134
133
|
document.body
|
|
135
134
|
);
|
|
136
135
|
}
|
|
137
|
-
const
|
|
136
|
+
const q = s.forwardRef(
|
|
138
137
|
({
|
|
139
138
|
className: r,
|
|
140
139
|
startContent: t,
|
|
141
140
|
danger: n,
|
|
142
|
-
disabled:
|
|
143
|
-
restoreFocus:
|
|
144
|
-
onSelect:
|
|
145
|
-
children:
|
|
146
|
-
...
|
|
147
|
-
},
|
|
148
|
-
const { setOpen:
|
|
149
|
-
var
|
|
150
|
-
|
|
141
|
+
disabled: f,
|
|
142
|
+
restoreFocus: p = !0,
|
|
143
|
+
onSelect: d,
|
|
144
|
+
children: a,
|
|
145
|
+
...m
|
|
146
|
+
}, w) => {
|
|
147
|
+
const { setOpen: c, triggerRef: l } = k("DropdownItem"), D = () => {
|
|
148
|
+
var g;
|
|
149
|
+
f || (d == null || d(), c(!1), p && ((g = l.current) == null || g.focus()));
|
|
151
150
|
};
|
|
152
|
-
return /* @__PURE__ */
|
|
151
|
+
return /* @__PURE__ */ N(
|
|
153
152
|
"div",
|
|
154
153
|
{
|
|
155
|
-
ref:
|
|
154
|
+
ref: w,
|
|
156
155
|
role: "menuitem",
|
|
157
156
|
tabIndex: -1,
|
|
158
|
-
"aria-disabled":
|
|
159
|
-
onClick:
|
|
160
|
-
onKeyDown: (
|
|
161
|
-
(
|
|
157
|
+
"aria-disabled": f || void 0,
|
|
158
|
+
onClick: D,
|
|
159
|
+
onKeyDown: (g) => {
|
|
160
|
+
(g.key === "Enter" || g.key === " ") && (g.preventDefault(), D());
|
|
162
161
|
},
|
|
163
|
-
className:
|
|
164
|
-
"flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-
|
|
162
|
+
className: R(
|
|
163
|
+
"flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-m font-medium",
|
|
165
164
|
"outline-none transition-colors duration-150",
|
|
166
165
|
"focus-visible:ring-3 focus-visible:ring-ring",
|
|
167
166
|
n ? "text-danger" : "text-foreground",
|
|
168
|
-
|
|
167
|
+
f ? "pointer-events-none opacity-50" : n ? "hover:bg-danger/10 focus:bg-danger/10" : "hover:bg-action-primary-soft hover:text-action-primary-text focus:bg-action-primary-soft focus:text-action-primary-text",
|
|
169
168
|
"[&_svg]:size-4 [&_svg]:shrink-0",
|
|
170
169
|
r
|
|
171
170
|
),
|
|
172
|
-
...
|
|
171
|
+
...m,
|
|
173
172
|
children: [
|
|
174
173
|
t,
|
|
175
|
-
/* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */ h("span", { className: "flex-1", children: a })
|
|
176
175
|
]
|
|
177
176
|
}
|
|
178
177
|
);
|
|
179
178
|
}
|
|
180
179
|
);
|
|
181
|
-
|
|
182
|
-
const
|
|
180
|
+
q.displayName = "DropdownItem";
|
|
181
|
+
const F = s.forwardRef(({ className: r, ...t }, n) => /* @__PURE__ */ h(
|
|
183
182
|
"div",
|
|
184
183
|
{
|
|
185
184
|
ref: n,
|
|
186
185
|
role: "separator",
|
|
187
|
-
className:
|
|
186
|
+
className: R("my-1 h-px bg-menu-stroke", r),
|
|
188
187
|
...t
|
|
189
188
|
}
|
|
190
189
|
));
|
|
191
|
-
|
|
192
|
-
const
|
|
190
|
+
F.displayName = "DropdownSeparator";
|
|
191
|
+
const T = s.forwardRef(({ className: r, ...t }, n) => /* @__PURE__ */ h(
|
|
193
192
|
"div",
|
|
194
193
|
{
|
|
195
194
|
ref: n,
|
|
196
|
-
className:
|
|
195
|
+
className: R(
|
|
197
196
|
"px-2 py-1.5 text-xs font-normal text-muted-foreground select-none",
|
|
198
197
|
r
|
|
199
198
|
),
|
|
200
199
|
...t
|
|
201
200
|
}
|
|
202
201
|
));
|
|
203
|
-
|
|
202
|
+
T.displayName = "DropdownLabel";
|
|
204
203
|
export {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
204
|
+
B as Dropdown,
|
|
205
|
+
V as DropdownContent,
|
|
206
|
+
q as DropdownItem,
|
|
207
|
+
T as DropdownLabel,
|
|
208
|
+
F as DropdownSeparator,
|
|
209
|
+
U as DropdownTrigger
|
|
211
210
|
};
|