@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/chip.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const chipVariants: (props?: ({
|
|
4
|
-
variant?: "soft" | "
|
|
4
|
+
variant?: "soft" | "outline" | "solid" | "dot" | null | undefined;
|
|
5
5
|
color?: "success" | "warning" | "danger" | "info" | "default" | "primary" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
export interface ChipProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "color">, VariantProps<typeof chipVariants> {
|
package/components/code-block.js
CHANGED
|
@@ -81,7 +81,7 @@ const G = _(
|
|
|
81
81
|
comment: "text-tertiary",
|
|
82
82
|
string: "text-foreground",
|
|
83
83
|
number: "text-foreground",
|
|
84
|
-
keyword: "font-
|
|
84
|
+
keyword: "font-medium text-foreground",
|
|
85
85
|
function: "font-medium text-foreground",
|
|
86
86
|
tag: "font-medium text-foreground",
|
|
87
87
|
punct: "text-tertiary"
|
|
@@ -208,7 +208,7 @@ const J = s.forwardRef(
|
|
|
208
208
|
"span",
|
|
209
209
|
{
|
|
210
210
|
className: u(
|
|
211
|
-
"absolute top-2 right-2 z-10 opacity-0 transition-opacity duration-
|
|
211
|
+
"absolute top-2 right-2 z-10 opacity-0 transition-opacity duration-150 ease-out",
|
|
212
212
|
"group-hover/code-block:opacity-100 focus-within:opacity-100",
|
|
213
213
|
"motion-reduce:transition-none"
|
|
214
214
|
),
|
|
@@ -256,7 +256,7 @@ const J = s.forwardRef(
|
|
|
256
256
|
className: u(
|
|
257
257
|
"select-none text-right text-tertiary",
|
|
258
258
|
d === "highlighted" && "text-info-700",
|
|
259
|
-
d === "added" && "font-
|
|
259
|
+
d === "added" && "font-medium text-foreground",
|
|
260
260
|
d === "removed" && "text-danger-700"
|
|
261
261
|
),
|
|
262
262
|
children: c
|
|
@@ -1,31 +1,75 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import * as
|
|
4
|
-
import { Collapsible as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
t.
|
|
2
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
3
|
+
import * as t from "react";
|
|
4
|
+
import { Collapsible as r } from "radix-ui";
|
|
5
|
+
import { MotionConfig as u, AnimatePresence as g, motion as h } from "motion/react";
|
|
6
|
+
import { springDisclosure as y } from "../lib/motion.js";
|
|
7
|
+
const C = t.createContext(!1), v = t.forwardRef(({ children: o, open: i, defaultOpen: a = !1, onOpenChange: e, ...s }, n) => {
|
|
8
|
+
const c = i !== void 0, [f, b] = t.useState(a), p = c ? i : f, m = t.useCallback(
|
|
9
|
+
(d) => {
|
|
10
|
+
c || b(d), e == null || e(d);
|
|
11
|
+
},
|
|
12
|
+
[c, e]
|
|
13
|
+
);
|
|
14
|
+
return /* @__PURE__ */ l(C.Provider, { value: p, children: /* @__PURE__ */ l(
|
|
15
|
+
r.Root,
|
|
16
|
+
{
|
|
17
|
+
ref: n,
|
|
18
|
+
"data-slot": "collapsible",
|
|
19
|
+
open: p,
|
|
20
|
+
onOpenChange: m,
|
|
21
|
+
...s,
|
|
22
|
+
children: o
|
|
23
|
+
}
|
|
24
|
+
) });
|
|
25
|
+
});
|
|
26
|
+
v.displayName = "Collapsible";
|
|
27
|
+
const x = t.forwardRef(({ children: o, ...i }, a) => /* @__PURE__ */ l(
|
|
28
|
+
r.CollapsibleTrigger,
|
|
9
29
|
{
|
|
10
30
|
ref: a,
|
|
11
31
|
"data-slot": "collapsible-trigger",
|
|
12
|
-
...
|
|
13
|
-
children:
|
|
32
|
+
...i,
|
|
33
|
+
children: o
|
|
14
34
|
}
|
|
15
35
|
));
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
t.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
36
|
+
x.displayName = "CollapsibleTrigger";
|
|
37
|
+
const R = t.forwardRef(({ children: o, asChild: i, forceMount: a, ...e }, s) => {
|
|
38
|
+
const n = t.useContext(C);
|
|
39
|
+
return i ? /* @__PURE__ */ l(
|
|
40
|
+
r.CollapsibleContent,
|
|
41
|
+
{
|
|
42
|
+
ref: s,
|
|
43
|
+
"data-slot": "collapsible-content",
|
|
44
|
+
asChild: !0,
|
|
45
|
+
forceMount: a,
|
|
46
|
+
...e,
|
|
47
|
+
children: o
|
|
48
|
+
}
|
|
49
|
+
) : /* @__PURE__ */ l(
|
|
50
|
+
r.CollapsibleContent,
|
|
51
|
+
{
|
|
52
|
+
ref: s,
|
|
53
|
+
"data-slot": "collapsible-content",
|
|
54
|
+
...e,
|
|
55
|
+
forceMount: !0,
|
|
56
|
+
children: /* @__PURE__ */ l(u, { reducedMotion: "user", children: /* @__PURE__ */ l(g, { initial: !1, children: n && /* @__PURE__ */ l(
|
|
57
|
+
h.div,
|
|
58
|
+
{
|
|
59
|
+
initial: { height: 0, opacity: 0, y: -4 },
|
|
60
|
+
animate: { height: "auto", opacity: 1, y: 0 },
|
|
61
|
+
exit: { height: 0, opacity: 0, y: -4 },
|
|
62
|
+
transition: y,
|
|
63
|
+
className: "overflow-hidden",
|
|
64
|
+
children: o
|
|
65
|
+
}
|
|
66
|
+
) }) })
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
});
|
|
70
|
+
R.displayName = "CollapsibleContent";
|
|
27
71
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
72
|
+
v as Collapsible,
|
|
73
|
+
R as CollapsibleContent,
|
|
74
|
+
x as CollapsibleTrigger
|
|
31
75
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as r, Fragment as
|
|
2
|
+
import { jsxs as r, Fragment as f, jsx as t } from "react/jsx-runtime";
|
|
3
3
|
import * as h from "react";
|
|
4
4
|
import { Database as x, ChevronRight as b } from "../lib/icons.js";
|
|
5
5
|
import { cn as o } from "../lib/cn.js";
|
|
@@ -68,7 +68,7 @@ function N({ strip: s }) {
|
|
|
68
68
|
const v = h.forwardRef(
|
|
69
69
|
({ className: s, card: e, onOpen: n, ...a }, i) => {
|
|
70
70
|
var m;
|
|
71
|
-
const c = !!n,
|
|
71
|
+
const c = !!n, g = ((m = e.action) == null ? void 0 : m.tone) === "reconnect", l = /* @__PURE__ */ r(f, { children: [
|
|
72
72
|
/* @__PURE__ */ r("div", { className: "rounded-t-xl p-[var(--card-padding)]", children: [
|
|
73
73
|
/* @__PURE__ */ r("div", { className: "mb-5 flex items-center gap-3.5", children: [
|
|
74
74
|
e.logo ? /* @__PURE__ */ t(
|
|
@@ -81,7 +81,7 @@ const v = h.forwardRef(
|
|
|
81
81
|
) : /* @__PURE__ */ t("span", { className: "grid size-10 shrink-0 place-items-center rounded-md bg-muted text-secondary", children: /* @__PURE__ */ t(x, { className: "size-5", "aria-hidden": !0 }) }),
|
|
82
82
|
/* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
|
|
83
83
|
/* @__PURE__ */ r("div", { className: "flex items-baseline justify-between gap-3", children: [
|
|
84
|
-
/* @__PURE__ */ t("div", { className: "min-w-0 truncate text-base font-
|
|
84
|
+
/* @__PURE__ */ t("div", { className: "min-w-0 truncate text-base font-medium leading-tight text-foreground", children: e.name }),
|
|
85
85
|
/* @__PURE__ */ t(
|
|
86
86
|
y,
|
|
87
87
|
{
|
|
@@ -101,7 +101,7 @@ const v = h.forwardRef(
|
|
|
101
101
|
{
|
|
102
102
|
className: o(
|
|
103
103
|
"min-w-0 truncate text-xs",
|
|
104
|
-
|
|
104
|
+
"text-secondary"
|
|
105
105
|
),
|
|
106
106
|
children: e.footer.text
|
|
107
107
|
}
|
|
@@ -111,7 +111,7 @@ const v = h.forwardRef(
|
|
|
111
111
|
{
|
|
112
112
|
className: o(
|
|
113
113
|
"inline-flex shrink-0 items-center gap-0.5 text-xs font-normal",
|
|
114
|
-
|
|
114
|
+
g ? "text-danger" : "text-foreground"
|
|
115
115
|
),
|
|
116
116
|
children: [
|
|
117
117
|
e.action.label,
|
|
@@ -127,7 +127,7 @@ const v = h.forwardRef(
|
|
|
127
127
|
// aliasing under transform is a real browser gotcha; forcing a
|
|
128
128
|
// compositor layer fixes it deterministically).
|
|
129
129
|
"rounded-xl bg-card text-card-foreground transform-gpu [will-change:transform] [backface-visibility:hidden]",
|
|
130
|
-
c && "shadow-elevation transition-[transform,box-shadow] duration-
|
|
130
|
+
c && "shadow-elevation transition-[transform,box-shadow] duration-150 ease-out motion-reduce:transition-none",
|
|
131
131
|
s
|
|
132
132
|
);
|
|
133
133
|
return c ? /* @__PURE__ */ t(
|
package/components/drawer.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const panelVariants: (props?: ({
|
|
4
|
-
side?: "
|
|
4
|
+
side?: "bottom" | "left" | "right" | null | undefined;
|
|
5
5
|
size?: "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
export interface DrawerProps extends VariantProps<typeof panelVariants> {
|
|
@@ -33,20 +33,25 @@ export declare function ModalDrawer({ open, onOpenChange, side: sideProp, size,
|
|
|
33
33
|
* Drawer in ADS. Use `ModalDrawer` when a page-blocking overlay is genuinely
|
|
34
34
|
* required.
|
|
35
35
|
*
|
|
36
|
-
* REQUIRES
|
|
37
|
-
* and no border — it separates from its neighbour purely by fill
|
|
38
|
-
* it is INVISIBLE on a white (`bg-
|
|
39
|
-
* content inside a `bg-
|
|
40
|
-
*
|
|
36
|
+
* REQUIRES THE CANVAS GROUND. The panel is flat white (`bg-card`) with no
|
|
37
|
+
* shadow and no border — it separates from its neighbour purely by fill
|
|
38
|
+
* contrast, so it is INVISIBLE on a pure-white (`bg-card`) parent. Place it
|
|
39
|
+
* and its sibling content inside a `bg-background` flex row — the SHELL
|
|
40
|
+
* CANVAS tint (ink-100), the same color as the frame around the screen. Do
|
|
41
|
+
* NOT use `bg-surface` (ink-200) for this row: it is one Radix step darker
|
|
42
|
+
* than the shell frame, so the gutter between the panels renders as a dark
|
|
43
|
+
* seam stripe instead of reading as canvas (field report 2026-08-06,
|
|
44
|
+
* Artifacts v2). The ground is the parent's job, not the panel's (the inline
|
|
45
|
+
* Drawer renders no ground of its own):
|
|
41
46
|
*
|
|
42
|
-
* <div className="flex gap-3 bg-
|
|
47
|
+
* <div className="flex gap-3 bg-background p-3">
|
|
43
48
|
* <main className="flex-1 rounded-xl bg-card">…content…</main>
|
|
44
49
|
* <Drawer open={open} onOpenChange={setOpen} aria-label="…">…</Drawer>
|
|
45
50
|
* </div>
|
|
46
51
|
*
|
|
47
|
-
* This mirrors the shell's main + chat layout — white panels on
|
|
48
|
-
*
|
|
49
|
-
*
|
|
52
|
+
* This mirrors the shell's main + chat layout — white panels on the canvas.
|
|
53
|
+
* If the panel doesn't read, fix the ground; never add a border or shadow to
|
|
54
|
+
* force it (that fights principle 1).
|
|
50
55
|
*/
|
|
51
56
|
export declare function Drawer({ open, onOpenChange, side: sideProp, size, className, children, "aria-label": ariaLabel, }: DrawerProps): React.JSX.Element;
|
|
52
57
|
/** @deprecated Alias for `Drawer` — the canonical drawer is now the inline
|
package/components/drawer.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as i, jsxs as v } from "react/jsx-runtime";
|
|
3
3
|
import * as a from "react";
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { MotionConfig as
|
|
4
|
+
import { createPortal as D } from "react-dom";
|
|
5
|
+
import { MotionConfig as p, AnimatePresence as b, motion as h } from "motion/react";
|
|
6
6
|
import { Close as R } from "../lib/icons.js";
|
|
7
|
-
import { cva as
|
|
7
|
+
import { cva as E } from "class-variance-authority";
|
|
8
8
|
import { cn as o } from "../lib/cn.js";
|
|
9
|
-
import {
|
|
10
|
-
const
|
|
9
|
+
import { springSheet as f, drawerOffset as u, drawerBackdropVariants as j } from "../lib/motion.js";
|
|
10
|
+
const z = E(
|
|
11
11
|
[
|
|
12
12
|
"relative flex flex-col",
|
|
13
13
|
"bg-elevated text-foreground",
|
|
@@ -43,16 +43,16 @@ const N = j(
|
|
|
43
43
|
],
|
|
44
44
|
defaultVariants: { side: "right", size: "md" }
|
|
45
45
|
}
|
|
46
|
-
),
|
|
46
|
+
), F = {
|
|
47
47
|
right: "justify-end items-stretch",
|
|
48
48
|
left: "justify-start items-stretch",
|
|
49
49
|
bottom: "justify-center items-end"
|
|
50
50
|
};
|
|
51
|
-
function
|
|
51
|
+
function N({
|
|
52
52
|
onClick: t,
|
|
53
53
|
className: e
|
|
54
54
|
}) {
|
|
55
|
-
return /* @__PURE__ */
|
|
55
|
+
return /* @__PURE__ */ i(
|
|
56
56
|
"button",
|
|
57
57
|
{
|
|
58
58
|
type: "button",
|
|
@@ -60,49 +60,49 @@ function k({
|
|
|
60
60
|
"aria-label": "Close",
|
|
61
61
|
className: o(
|
|
62
62
|
"absolute inline-flex size-8 items-center justify-center",
|
|
63
|
-
"rounded-
|
|
64
|
-
"transition-[background,color,transform] duration-
|
|
65
|
-
"active:scale-
|
|
63
|
+
"rounded-sm text-muted-foreground",
|
|
64
|
+
"transition-[background,color,transform] duration-150 ease-out motion-reduce:transition-none hover:bg-muted hover:text-foreground",
|
|
65
|
+
"active:scale-[0.97] motion-reduce:active:scale-100",
|
|
66
66
|
"outline-none focus-visible:ring-3 focus-visible:ring-ring",
|
|
67
67
|
"[&_svg]:size-4 [&_svg]:shrink-0",
|
|
68
68
|
e
|
|
69
69
|
),
|
|
70
|
-
children: /* @__PURE__ */
|
|
70
|
+
children: /* @__PURE__ */ i(R, { "aria-hidden": !0 })
|
|
71
71
|
}
|
|
72
72
|
);
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function q({
|
|
75
75
|
open: t,
|
|
76
76
|
onOpenChange: e,
|
|
77
|
-
side:
|
|
78
|
-
size:
|
|
79
|
-
className:
|
|
80
|
-
children:
|
|
77
|
+
side: r,
|
|
78
|
+
size: w,
|
|
79
|
+
className: x,
|
|
80
|
+
children: g
|
|
81
81
|
}) {
|
|
82
|
-
const l =
|
|
82
|
+
const l = r ?? "right", n = a.useRef(null), d = a.useRef(null);
|
|
83
83
|
return a.useEffect(() => {
|
|
84
84
|
if (!t) return;
|
|
85
85
|
d.current = document.activeElement;
|
|
86
86
|
const c = document.body.style.overflow;
|
|
87
87
|
document.body.style.overflow = "hidden";
|
|
88
|
-
const
|
|
89
|
-
|
|
88
|
+
const m = (s) => {
|
|
89
|
+
s.key === "Escape" && (s.stopPropagation(), e(!1));
|
|
90
90
|
};
|
|
91
|
-
document.addEventListener("keydown",
|
|
92
|
-
const
|
|
93
|
-
var
|
|
94
|
-
(
|
|
91
|
+
document.addEventListener("keydown", m);
|
|
92
|
+
const k = requestAnimationFrame(() => {
|
|
93
|
+
var s;
|
|
94
|
+
(s = n.current) == null || s.focus();
|
|
95
95
|
});
|
|
96
96
|
return () => {
|
|
97
|
-
var
|
|
98
|
-
document.removeEventListener("keydown",
|
|
97
|
+
var s, y;
|
|
98
|
+
document.removeEventListener("keydown", m), document.body.style.overflow = c, cancelAnimationFrame(k), (y = (s = d.current) == null ? void 0 : s.focus) == null || y.call(s);
|
|
99
99
|
};
|
|
100
|
-
}, [t, e]),
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
|
|
100
|
+
}, [t, e]), D(
|
|
101
|
+
/* @__PURE__ */ i(p, { reducedMotion: "user", children: /* @__PURE__ */ i(b, { children: t && /* @__PURE__ */ v("div", { className: o("fixed inset-0 z-50 flex", F[l]), children: [
|
|
102
|
+
/* @__PURE__ */ i(
|
|
103
|
+
h.div,
|
|
104
104
|
{
|
|
105
|
-
variants:
|
|
105
|
+
variants: j,
|
|
106
106
|
initial: "hidden",
|
|
107
107
|
animate: "visible",
|
|
108
108
|
exit: "hidden",
|
|
@@ -112,26 +112,26 @@ function G({
|
|
|
112
112
|
},
|
|
113
113
|
"backdrop"
|
|
114
114
|
),
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
|
|
115
|
+
/* @__PURE__ */ v(
|
|
116
|
+
h.div,
|
|
117
117
|
{
|
|
118
118
|
ref: n,
|
|
119
|
-
initial:
|
|
120
|
-
animate: { transform: "translate3d(0, 0, 0)", transition:
|
|
121
|
-
exit: { ...
|
|
119
|
+
initial: u[l],
|
|
120
|
+
animate: { transform: "translate3d(0, 0, 0)", opacity: 1, transition: f },
|
|
121
|
+
exit: { ...u[l], transition: f },
|
|
122
122
|
role: "dialog",
|
|
123
123
|
"aria-modal": "true",
|
|
124
124
|
tabIndex: -1,
|
|
125
|
-
className: o(
|
|
125
|
+
className: o(z({ side: l, size: w }), "relative outline-none", x),
|
|
126
126
|
children: [
|
|
127
|
-
/* @__PURE__ */
|
|
128
|
-
|
|
127
|
+
/* @__PURE__ */ i(
|
|
128
|
+
N,
|
|
129
129
|
{
|
|
130
130
|
onClick: () => e(!1),
|
|
131
131
|
className: "right-4 top-4"
|
|
132
132
|
}
|
|
133
133
|
),
|
|
134
|
-
|
|
134
|
+
g
|
|
135
135
|
]
|
|
136
136
|
},
|
|
137
137
|
"panel"
|
|
@@ -140,81 +140,82 @@ function G({
|
|
|
140
140
|
document.body
|
|
141
141
|
);
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function A({
|
|
144
144
|
open: t,
|
|
145
145
|
onOpenChange: e,
|
|
146
|
-
side:
|
|
147
|
-
size:
|
|
148
|
-
className:
|
|
149
|
-
children:
|
|
146
|
+
side: r,
|
|
147
|
+
size: w,
|
|
148
|
+
className: x,
|
|
149
|
+
children: g,
|
|
150
150
|
"aria-label": l
|
|
151
151
|
}) {
|
|
152
|
-
const n =
|
|
152
|
+
const n = r ?? "right", d = a.useRef(null);
|
|
153
153
|
return a.useEffect(() => {
|
|
154
154
|
if (!t) return;
|
|
155
|
-
const c = (
|
|
156
|
-
|
|
155
|
+
const c = (m) => {
|
|
156
|
+
m.key === "Escape" && e(!1);
|
|
157
157
|
};
|
|
158
158
|
return document.addEventListener("keydown", c), () => document.removeEventListener("keydown", c);
|
|
159
|
-
}, [t, e]), /* @__PURE__ */
|
|
160
|
-
|
|
159
|
+
}, [t, e]), /* @__PURE__ */ i(p, { reducedMotion: "user", children: /* @__PURE__ */ i(b, { initial: !1, children: t && /* @__PURE__ */ v(
|
|
160
|
+
h.aside,
|
|
161
161
|
{
|
|
162
162
|
ref: d,
|
|
163
|
-
initial:
|
|
164
|
-
animate: { transform: "translate3d(0, 0, 0)", transition:
|
|
165
|
-
exit: { ...
|
|
163
|
+
initial: u[n],
|
|
164
|
+
animate: { transform: "translate3d(0, 0, 0)", opacity: 1, transition: f },
|
|
165
|
+
exit: { ...u[n], transition: f },
|
|
166
166
|
role: "complementary",
|
|
167
167
|
"aria-label": l,
|
|
168
168
|
className: o(
|
|
169
|
-
|
|
169
|
+
z({ side: n, size: w }),
|
|
170
170
|
"relative shrink-0 overflow-hidden rounded-lg bg-card shadow-none outline-none",
|
|
171
|
-
|
|
171
|
+
x
|
|
172
172
|
),
|
|
173
173
|
children: [
|
|
174
|
-
/* @__PURE__ */
|
|
175
|
-
|
|
174
|
+
/* @__PURE__ */ i(
|
|
175
|
+
N,
|
|
176
176
|
{
|
|
177
177
|
onClick: () => e(!1),
|
|
178
178
|
className: "right-2 top-1"
|
|
179
179
|
}
|
|
180
180
|
),
|
|
181
|
-
|
|
181
|
+
g
|
|
182
182
|
]
|
|
183
183
|
},
|
|
184
184
|
"inline-drawer"
|
|
185
185
|
) }) });
|
|
186
186
|
}
|
|
187
|
-
const
|
|
187
|
+
const S = A, B = a.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i(
|
|
188
188
|
"div",
|
|
189
189
|
{
|
|
190
|
-
ref:
|
|
190
|
+
ref: r,
|
|
191
191
|
className: o("flex flex-col gap-1 px-6 py-4 pr-14", t),
|
|
192
192
|
...e
|
|
193
193
|
}
|
|
194
194
|
));
|
|
195
|
-
|
|
196
|
-
const
|
|
195
|
+
B.displayName = "DrawerHeader";
|
|
196
|
+
const L = a.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i(
|
|
197
197
|
"h2",
|
|
198
198
|
{
|
|
199
|
-
ref:
|
|
200
|
-
className: o("text-lg font-
|
|
199
|
+
ref: r,
|
|
200
|
+
className: o("text-lg font-medium text-foreground", t),
|
|
201
201
|
...e
|
|
202
202
|
}
|
|
203
203
|
));
|
|
204
|
-
|
|
205
|
-
const
|
|
204
|
+
L.displayName = "DrawerTitle";
|
|
205
|
+
const M = a.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i(
|
|
206
206
|
"div",
|
|
207
207
|
{
|
|
208
|
-
ref:
|
|
208
|
+
ref: r,
|
|
209
|
+
tabIndex: 0,
|
|
209
210
|
className: o("flex-1 overflow-y-auto px-6 py-4 text-xs text-foreground", t),
|
|
210
211
|
...e
|
|
211
212
|
}
|
|
212
213
|
));
|
|
213
|
-
|
|
214
|
-
const V = a.forwardRef(({ className: t, ...e },
|
|
214
|
+
M.displayName = "DrawerBody";
|
|
215
|
+
const V = a.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i(
|
|
215
216
|
"div",
|
|
216
217
|
{
|
|
217
|
-
ref:
|
|
218
|
+
ref: r,
|
|
218
219
|
className: o(
|
|
219
220
|
"flex items-center justify-end gap-2 px-6 py-4",
|
|
220
221
|
t
|
|
@@ -224,11 +225,11 @@ const V = a.forwardRef(({ className: t, ...e }, s) => /* @__PURE__ */ r(
|
|
|
224
225
|
));
|
|
225
226
|
V.displayName = "DrawerFooter";
|
|
226
227
|
export {
|
|
227
|
-
|
|
228
|
-
|
|
228
|
+
A as Drawer,
|
|
229
|
+
M as DrawerBody,
|
|
229
230
|
V as DrawerFooter,
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
231
|
+
B as DrawerHeader,
|
|
232
|
+
L as DrawerTitle,
|
|
233
|
+
S as InlineDrawer,
|
|
234
|
+
q as ModalDrawer
|
|
234
235
|
};
|
package/components/dropdown.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ export interface DropdownItemProps extends Omit<React.HTMLAttributes<HTMLDivElem
|
|
|
26
26
|
startContent?: React.ReactNode;
|
|
27
27
|
danger?: boolean;
|
|
28
28
|
disabled?: boolean;
|
|
29
|
+
/** Keep focus with a newly opened surface instead of returning to the menu trigger. */
|
|
30
|
+
restoreFocus?: boolean;
|
|
29
31
|
onSelect?: () => void;
|
|
30
32
|
}
|
|
31
33
|
export declare const DropdownItem: React.ForwardRefExoticComponent<DropdownItemProps & React.RefAttributes<HTMLDivElement>>;
|