@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/sidebar.js
CHANGED
|
@@ -1,119 +1,123 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import * as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
2
|
+
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
3
|
+
import * as o from "react";
|
|
4
|
+
import { MotionConfig as R, motion as _ } from "motion/react";
|
|
5
|
+
import { User as j, PanelLeft as H } from "../lib/icons.js";
|
|
6
|
+
import { cn as n } from "../lib/cn.js";
|
|
7
|
+
import { springSidebar as E } from "../lib/motion.js";
|
|
8
|
+
import { Tooltip as I } from "./tooltip.js";
|
|
9
|
+
import { Avatar as L } from "./avatar.js";
|
|
10
|
+
const k = o.createContext({
|
|
9
11
|
collapsed: !1,
|
|
10
12
|
toggle: () => {
|
|
11
13
|
},
|
|
12
14
|
setCollapsed: () => {
|
|
13
15
|
}
|
|
14
16
|
});
|
|
15
|
-
function
|
|
16
|
-
return
|
|
17
|
+
function M() {
|
|
18
|
+
return o.useContext(k);
|
|
17
19
|
}
|
|
18
|
-
const
|
|
20
|
+
const K = o.forwardRef(
|
|
19
21
|
({
|
|
20
22
|
className: t,
|
|
21
|
-
collapsed:
|
|
23
|
+
collapsed: r,
|
|
22
24
|
defaultCollapsed: i = !1,
|
|
23
25
|
onCollapsedChange: a,
|
|
24
26
|
keyboardToggle: s = !0,
|
|
25
27
|
...d
|
|
26
28
|
}, l) => {
|
|
27
|
-
const [
|
|
29
|
+
const [m, x] = o.useState(i), f = r !== void 0, u = f ? r : m, h = o.useCallback(
|
|
28
30
|
(p) => {
|
|
29
31
|
f || x(p), a == null || a(p);
|
|
30
32
|
},
|
|
31
33
|
[f, a]
|
|
32
|
-
), g =
|
|
34
|
+
), g = o.useCallback(
|
|
33
35
|
() => h(!u),
|
|
34
36
|
[u, h]
|
|
35
37
|
);
|
|
36
|
-
|
|
38
|
+
o.useEffect(() => {
|
|
37
39
|
if (!s) return;
|
|
38
|
-
const p = (
|
|
39
|
-
(
|
|
40
|
+
const p = (b) => {
|
|
41
|
+
(b.metaKey || b.ctrlKey) && b.key.toLowerCase() === "b" && (b.preventDefault(), g());
|
|
40
42
|
};
|
|
41
43
|
return document.addEventListener("keydown", p), () => document.removeEventListener("keydown", p);
|
|
42
44
|
}, [s, g]);
|
|
43
|
-
const v =
|
|
45
|
+
const v = o.useMemo(
|
|
44
46
|
() => ({ collapsed: u, toggle: g, setCollapsed: h }),
|
|
45
47
|
[u, g, h]
|
|
46
48
|
);
|
|
47
|
-
return /* @__PURE__ */
|
|
48
|
-
|
|
49
|
+
return /* @__PURE__ */ e(k.Provider, { value: v, children: /* @__PURE__ */ e(R, { reducedMotion: "user", children: /* @__PURE__ */ e(
|
|
50
|
+
_.aside,
|
|
49
51
|
{
|
|
50
52
|
ref: l,
|
|
51
53
|
"data-collapsed": u ? "true" : "false",
|
|
52
|
-
|
|
54
|
+
initial: !1,
|
|
55
|
+
animate: { width: u ? 56 : 240 },
|
|
56
|
+
transition: E,
|
|
57
|
+
className: n(
|
|
53
58
|
"group/sidebar flex h-full shrink-0 flex-col bg-transparent",
|
|
54
|
-
u ? "w-(--sidebar-width-sm)" : "w-(--sidebar-width)",
|
|
55
59
|
t
|
|
56
60
|
),
|
|
57
61
|
...d
|
|
58
62
|
}
|
|
59
|
-
) });
|
|
63
|
+
) }) });
|
|
60
64
|
}
|
|
61
65
|
);
|
|
62
|
-
|
|
63
|
-
function
|
|
64
|
-
return /* @__PURE__ */
|
|
66
|
+
K.displayName = "Sidebar";
|
|
67
|
+
function w({ children: t }) {
|
|
68
|
+
return /* @__PURE__ */ e("kbd", { className: "inline-flex h-4 min-w-4 items-center justify-center rounded bg-background/20 px-1 text-xs leading-none", children: t });
|
|
65
69
|
}
|
|
66
70
|
function z({
|
|
67
71
|
className: t,
|
|
68
|
-
onClick:
|
|
72
|
+
onClick: r,
|
|
69
73
|
tooltipSide: i = "right",
|
|
70
74
|
...a
|
|
71
75
|
}) {
|
|
72
|
-
const { collapsed: s, toggle: d } =
|
|
73
|
-
return /* @__PURE__ */
|
|
74
|
-
|
|
76
|
+
const { collapsed: s, toggle: d } = M();
|
|
77
|
+
return /* @__PURE__ */ e(
|
|
78
|
+
I,
|
|
75
79
|
{
|
|
76
80
|
side: i,
|
|
77
81
|
content: /* @__PURE__ */ c("span", { className: "flex items-center gap-1.5", children: [
|
|
78
82
|
s ? "Expand" : "Collapse",
|
|
79
83
|
/* @__PURE__ */ c("span", { className: "flex items-center gap-0.5", children: [
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ e(w, { children: "⌘" }),
|
|
85
|
+
/* @__PURE__ */ e(w, { children: "B" })
|
|
82
86
|
] })
|
|
83
87
|
] }),
|
|
84
|
-
children: /* @__PURE__ */
|
|
88
|
+
children: /* @__PURE__ */ e(
|
|
85
89
|
"button",
|
|
86
90
|
{
|
|
87
91
|
type: "button",
|
|
88
92
|
"aria-label": s ? "Expand sidebar" : "Collapse sidebar",
|
|
89
93
|
"aria-pressed": s,
|
|
90
94
|
onClick: (l) => {
|
|
91
|
-
|
|
95
|
+
r == null || r(l), d();
|
|
92
96
|
},
|
|
93
|
-
className:
|
|
94
|
-
"inline-flex size-(--sidebar-item) shrink-0 items-center justify-center rounded-
|
|
97
|
+
className: n(
|
|
98
|
+
"inline-flex size-(--sidebar-item) shrink-0 items-center justify-center rounded-sm border border-transparent text-muted-foreground",
|
|
95
99
|
"transition-colors hover:border-border hover:bg-elevated hover:text-foreground",
|
|
96
100
|
"outline-none focus-visible:ring-3 focus-visible:ring-ring",
|
|
97
101
|
"[&_svg]:size-4.5",
|
|
98
102
|
t
|
|
99
103
|
),
|
|
100
104
|
...a,
|
|
101
|
-
children: /* @__PURE__ */
|
|
105
|
+
children: /* @__PURE__ */ e(H, {})
|
|
102
106
|
}
|
|
103
107
|
)
|
|
104
108
|
}
|
|
105
109
|
);
|
|
106
110
|
}
|
|
107
|
-
function
|
|
111
|
+
function Y({
|
|
108
112
|
logo: t,
|
|
109
|
-
href:
|
|
113
|
+
href: r,
|
|
110
114
|
label: i = "Home",
|
|
111
115
|
showTrigger: a = !0,
|
|
112
116
|
children: s,
|
|
113
117
|
className: d,
|
|
114
118
|
...l
|
|
115
119
|
}) {
|
|
116
|
-
const
|
|
120
|
+
const m = n(
|
|
117
121
|
// 20px mark centered in a 32px square — the same box as every other rail icon.
|
|
118
122
|
// group/brand lets a BrandMark logo play its blip loop on hover.
|
|
119
123
|
"group/brand flex size-(--sidebar-item) items-center justify-center",
|
|
@@ -126,57 +130,57 @@ function G({
|
|
|
126
130
|
return /* @__PURE__ */ c(
|
|
127
131
|
"div",
|
|
128
132
|
{
|
|
129
|
-
className:
|
|
133
|
+
className: n(
|
|
130
134
|
"flex h-(--sidebar-header) shrink-0 items-center justify-between gap-2 px-3",
|
|
131
135
|
"group-data-[collapsed=true]/sidebar:justify-center group-data-[collapsed=true]/sidebar:px-2",
|
|
132
136
|
d
|
|
133
137
|
),
|
|
134
138
|
...l,
|
|
135
139
|
children: [
|
|
136
|
-
|
|
137
|
-
a && /* @__PURE__ */
|
|
140
|
+
r ? /* @__PURE__ */ e("a", { href: r, "aria-label": i, className: m, children: t }) : /* @__PURE__ */ e("span", { className: m, children: t }),
|
|
141
|
+
a && /* @__PURE__ */ e("div", { className: "hidden group-data-[collapsed=true]/sidebar:group-hover/sidebar:flex group-data-[collapsed=true]/sidebar:group-focus-within/sidebar:flex", children: /* @__PURE__ */ e(z, { tooltipSide: "right" }) }),
|
|
138
142
|
/* @__PURE__ */ c("div", { className: "flex items-center gap-1 group-data-[collapsed=true]/sidebar:hidden", children: [
|
|
139
|
-
a && /* @__PURE__ */
|
|
143
|
+
a && /* @__PURE__ */ e(z, { tooltipSide: "bottom" }),
|
|
140
144
|
s
|
|
141
145
|
] })
|
|
142
146
|
]
|
|
143
147
|
}
|
|
144
148
|
);
|
|
145
149
|
}
|
|
146
|
-
const
|
|
147
|
-
({ className: t, ...
|
|
150
|
+
const A = o.forwardRef(
|
|
151
|
+
({ className: t, ...r }, i) => /* @__PURE__ */ e(
|
|
148
152
|
"div",
|
|
149
153
|
{
|
|
150
154
|
ref: i,
|
|
151
|
-
className:
|
|
155
|
+
className: n(
|
|
152
156
|
"flex h-(--sidebar-header) shrink-0 items-center justify-between gap-2 px-3",
|
|
153
157
|
"group-data-[collapsed=true]/sidebar:justify-center group-data-[collapsed=true]/sidebar:px-2",
|
|
154
158
|
t
|
|
155
159
|
),
|
|
156
|
-
...
|
|
160
|
+
...r
|
|
157
161
|
}
|
|
158
162
|
)
|
|
159
163
|
);
|
|
160
|
-
|
|
161
|
-
const
|
|
162
|
-
({ className: t, ...
|
|
164
|
+
A.displayName = "SidebarHeader";
|
|
165
|
+
const q = o.forwardRef(
|
|
166
|
+
({ className: t, ...r }, i) => /* @__PURE__ */ e("nav", { ref: i, className: n("min-h-0 flex-1 space-y-5 overflow-y-auto p-3", t), ...r })
|
|
163
167
|
);
|
|
164
|
-
|
|
165
|
-
const
|
|
166
|
-
({ className: t, label:
|
|
167
|
-
|
|
168
|
-
/* @__PURE__ */
|
|
168
|
+
q.displayName = "SidebarNav";
|
|
169
|
+
const B = o.forwardRef(
|
|
170
|
+
({ className: t, label: r, children: i, ...a }, s) => /* @__PURE__ */ c("div", { ref: s, className: t, ...a, children: [
|
|
171
|
+
r && /* @__PURE__ */ e("div", { className: "mb-1.5 px-3 text-[length:var(--sidebar-section-label-size)] leading-[var(--text-xs--line-height)] font-normal text-secondary group-data-[collapsed=true]/sidebar:hidden", children: r }),
|
|
172
|
+
/* @__PURE__ */ e("div", { className: "flex flex-col gap-0.5", children: i })
|
|
169
173
|
] })
|
|
170
174
|
);
|
|
171
|
-
|
|
172
|
-
const
|
|
173
|
-
({ className: t, icon:
|
|
175
|
+
B.displayName = "SidebarSection";
|
|
176
|
+
const D = o.forwardRef(
|
|
177
|
+
({ className: t, icon: r, isActive: i, endContent: a, children: s, title: d, ...l }, m) => /* @__PURE__ */ c(
|
|
174
178
|
"a",
|
|
175
179
|
{
|
|
176
|
-
ref:
|
|
180
|
+
ref: m,
|
|
177
181
|
"aria-current": i ? "page" : void 0,
|
|
178
182
|
title: d ?? (typeof s == "string" ? s : void 0),
|
|
179
|
-
className:
|
|
183
|
+
className: n(
|
|
180
184
|
"flex h-9 items-center gap-2.5 rounded-md px-3 text-[length:var(--sidebar-navigation-text-size)] leading-[var(--text-xs--line-height)] transition-colors",
|
|
181
185
|
"outline-none focus-visible:ring-3 focus-visible:ring-ring",
|
|
182
186
|
"[&_svg]:size-4 [&_svg]:shrink-0",
|
|
@@ -187,37 +191,37 @@ const M = n.forwardRef(
|
|
|
187
191
|
),
|
|
188
192
|
...l,
|
|
189
193
|
children: [
|
|
190
|
-
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
-
a && /* @__PURE__ */
|
|
194
|
+
r,
|
|
195
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate group-data-[collapsed=true]/sidebar:hidden", children: s }),
|
|
196
|
+
a && /* @__PURE__ */ e("span", { className: "shrink-0 group-data-[collapsed=true]/sidebar:hidden", children: a })
|
|
193
197
|
]
|
|
194
198
|
}
|
|
195
199
|
)
|
|
196
200
|
);
|
|
197
|
-
|
|
198
|
-
const
|
|
199
|
-
({ className: t, ...
|
|
201
|
+
D.displayName = "SidebarItem";
|
|
202
|
+
const F = o.forwardRef(
|
|
203
|
+
({ className: t, ...r }, i) => /* @__PURE__ */ e(
|
|
200
204
|
"div",
|
|
201
205
|
{
|
|
202
206
|
ref: i,
|
|
203
|
-
className:
|
|
204
|
-
...
|
|
207
|
+
className: n("shrink-0 p-3 group-data-[collapsed=true]/sidebar:px-2", t),
|
|
208
|
+
...r
|
|
205
209
|
}
|
|
206
210
|
)
|
|
207
211
|
);
|
|
208
|
-
|
|
209
|
-
const
|
|
210
|
-
({ className: t, icon:
|
|
212
|
+
F.displayName = "SidebarFooter";
|
|
213
|
+
const W = o.forwardRef(
|
|
214
|
+
({ className: t, icon: r, children: i, ...a }, s) => /* @__PURE__ */ e("div", { className: "px-3 pb-0.5 group-data-[collapsed=true]/sidebar:px-2", children: /* @__PURE__ */ c(
|
|
211
215
|
"button",
|
|
212
216
|
{
|
|
213
217
|
ref: s,
|
|
214
218
|
type: "button",
|
|
215
|
-
className:
|
|
219
|
+
className: n(
|
|
216
220
|
"flex h-9 w-full items-center justify-start gap-2 rounded-md px-3",
|
|
217
221
|
"text-[length:var(--sidebar-navigation-text-size)] leading-[var(--text-xs--line-height)] font-normal text-primary",
|
|
218
222
|
// Reads as a normal nav item: transparent at rest, the shared grey
|
|
219
223
|
// hover wash on hover (no fill-at-rest, no elevation).
|
|
220
|
-
"transition-colors duration-
|
|
224
|
+
"transition-colors duration-150 ease-out motion-reduce:transition-none",
|
|
221
225
|
"hover:bg-sidebar-accent/60 hover:text-foreground",
|
|
222
226
|
"outline-none focus-visible:ring-3 focus-visible:ring-ring",
|
|
223
227
|
"[&_svg]:size-4 [&_svg]:shrink-0",
|
|
@@ -226,51 +230,51 @@ const B = n.forwardRef(
|
|
|
226
230
|
),
|
|
227
231
|
...a,
|
|
228
232
|
children: [
|
|
229
|
-
|
|
230
|
-
/* @__PURE__ */
|
|
233
|
+
r,
|
|
234
|
+
/* @__PURE__ */ e("span", { className: "truncate group-data-[collapsed=true]/sidebar:hidden", children: i })
|
|
231
235
|
]
|
|
232
236
|
}
|
|
233
237
|
) })
|
|
234
238
|
);
|
|
235
|
-
|
|
236
|
-
const
|
|
237
|
-
({ className: t, label:
|
|
239
|
+
W.displayName = "SidebarAction";
|
|
240
|
+
const $ = o.forwardRef(
|
|
241
|
+
({ className: t, label: r, children: i, ...a }, s) => /* @__PURE__ */ c(
|
|
238
242
|
"div",
|
|
239
243
|
{
|
|
240
244
|
ref: s,
|
|
241
|
-
className:
|
|
245
|
+
className: n("group-data-[collapsed=true]/sidebar:hidden", t),
|
|
242
246
|
...a,
|
|
243
247
|
children: [
|
|
244
|
-
|
|
245
|
-
/* @__PURE__ */
|
|
248
|
+
r && /* @__PURE__ */ e("div", { className: "mb-1.5 px-3 text-[length:var(--sidebar-section-label-size)] leading-[var(--text-xs--line-height)] font-normal text-secondary", children: r }),
|
|
249
|
+
/* @__PURE__ */ e("div", { className: "flex flex-col gap-0.5", children: i })
|
|
246
250
|
]
|
|
247
251
|
}
|
|
248
252
|
)
|
|
249
253
|
);
|
|
250
|
-
|
|
251
|
-
const
|
|
252
|
-
const x =
|
|
253
|
-
|
|
254
|
-
const p = x.current,
|
|
255
|
-
if (!p || !
|
|
254
|
+
$.displayName = "SidebarHistory";
|
|
255
|
+
const O = o.forwardRef(({ className: t, children: r, title: i, action: a, isActive: s, icon: d, ...l }, m) => {
|
|
256
|
+
const x = o.useRef(null), f = o.useRef(null), [u, h] = o.useState(0);
|
|
257
|
+
o.useLayoutEffect(() => {
|
|
258
|
+
const p = x.current, b = f.current;
|
|
259
|
+
if (!p || !b) return;
|
|
256
260
|
const N = () => {
|
|
257
|
-
const
|
|
258
|
-
h(
|
|
261
|
+
const S = b.scrollWidth - p.clientWidth;
|
|
262
|
+
h(S > 0 ? S + (a ? 32 : 0) : 0);
|
|
259
263
|
};
|
|
260
264
|
N();
|
|
261
265
|
const y = new ResizeObserver(N);
|
|
262
|
-
return y.observe(p), y.observe(
|
|
263
|
-
}, [
|
|
266
|
+
return y.observe(p), y.observe(b), () => y.disconnect();
|
|
267
|
+
}, [r, a]);
|
|
264
268
|
const g = u > 0, v = Math.max(500, Math.round(u * 18));
|
|
265
269
|
return /* @__PURE__ */ c(
|
|
266
270
|
"div",
|
|
267
271
|
{
|
|
268
|
-
className:
|
|
272
|
+
className: n(
|
|
269
273
|
"group/hist relative flex items-center rounded-md transition-colors",
|
|
270
274
|
s ? "bg-sidebar-accent/60 text-foreground" : "text-muted-foreground hover:bg-sidebar-accent/60 hover:text-foreground"
|
|
271
275
|
),
|
|
272
276
|
children: [
|
|
273
|
-
d && /* @__PURE__ */
|
|
277
|
+
d && /* @__PURE__ */ e(
|
|
274
278
|
"span",
|
|
275
279
|
{
|
|
276
280
|
"aria-hidden": !0,
|
|
@@ -278,12 +282,12 @@ const F = n.forwardRef(({ className: t, children: e, title: i, action: a, isActi
|
|
|
278
282
|
children: d
|
|
279
283
|
}
|
|
280
284
|
),
|
|
281
|
-
/* @__PURE__ */
|
|
285
|
+
/* @__PURE__ */ e(
|
|
282
286
|
"a",
|
|
283
287
|
{
|
|
284
|
-
ref:
|
|
285
|
-
title: i ?? (typeof
|
|
286
|
-
className:
|
|
288
|
+
ref: m,
|
|
289
|
+
title: i ?? (typeof r == "string" ? r : void 0),
|
|
290
|
+
className: n(
|
|
287
291
|
// Left pad matches a SidebarItem's text column (px-3 + icon size-4 +
|
|
288
292
|
// gap-2.5 = 2.375rem) so history titles line up under the nav labels.
|
|
289
293
|
"block min-w-0 flex-1 rounded-md py-1.5 pr-3 ps-(--sidebar-text-indent) text-[length:var(--sidebar-navigation-text-size)] leading-[var(--text-xs--line-height)]",
|
|
@@ -291,11 +295,11 @@ const F = n.forwardRef(({ className: t, children: e, title: i, action: a, isActi
|
|
|
291
295
|
t
|
|
292
296
|
),
|
|
293
297
|
...l,
|
|
294
|
-
children: /* @__PURE__ */
|
|
298
|
+
children: /* @__PURE__ */ e(
|
|
295
299
|
"span",
|
|
296
300
|
{
|
|
297
301
|
ref: x,
|
|
298
|
-
className:
|
|
302
|
+
className: n(
|
|
299
303
|
"block overflow-hidden",
|
|
300
304
|
// Rest: fade the right edge (no ellipsis). Hover: the title scrolls,
|
|
301
305
|
// so fade the LEFT edge where it exits; the action backdrop (or the
|
|
@@ -303,11 +307,11 @@ const F = n.forwardRef(({ className: t, children: e, title: i, action: a, isActi
|
|
|
303
307
|
g && "[mask-image:linear-gradient(to_right,#000_calc(100%-1.5rem),transparent)]",
|
|
304
308
|
g && "group-hover/hist:[mask-image:linear-gradient(to_right,transparent,#000_1.25rem,#000_100%)]"
|
|
305
309
|
),
|
|
306
|
-
children: /* @__PURE__ */
|
|
310
|
+
children: /* @__PURE__ */ e(
|
|
307
311
|
"span",
|
|
308
312
|
{
|
|
309
313
|
ref: f,
|
|
310
|
-
className:
|
|
314
|
+
className: n(
|
|
311
315
|
"block w-max whitespace-nowrap transition-transform ease-linear",
|
|
312
316
|
g && "group-hover/hist:[transform:translateX(var(--mq-x))]",
|
|
313
317
|
"motion-reduce:transition-none motion-reduce:group-hover/hist:[transform:none]"
|
|
@@ -316,22 +320,22 @@ const F = n.forwardRef(({ className: t, children: e, title: i, action: a, isActi
|
|
|
316
320
|
"--mq-x": `-${u}px`,
|
|
317
321
|
transitionDuration: `${v}ms`
|
|
318
322
|
},
|
|
319
|
-
children:
|
|
323
|
+
children: r
|
|
320
324
|
}
|
|
321
325
|
)
|
|
322
326
|
}
|
|
323
327
|
)
|
|
324
328
|
}
|
|
325
329
|
),
|
|
326
|
-
a && /* @__PURE__ */
|
|
330
|
+
a && /* @__PURE__ */ e(
|
|
327
331
|
"span",
|
|
328
332
|
{
|
|
329
|
-
className:
|
|
333
|
+
className: n(
|
|
330
334
|
// Rounded end matches the row's radius so the backdrop doesn't
|
|
331
335
|
// square off the highlight's right corners.
|
|
332
336
|
"absolute inset-y-0 right-0 flex items-center rounded-e-md pl-8 pr-1",
|
|
333
337
|
"bg-gradient-to-l from-fill from-45% to-transparent",
|
|
334
|
-
"opacity-0 transition-opacity duration-
|
|
338
|
+
"opacity-0 transition-opacity duration-150 group-hover/hist:opacity-100",
|
|
335
339
|
"pointer-events-none group-hover/hist:pointer-events-auto",
|
|
336
340
|
"focus-within:pointer-events-auto focus-within:opacity-100"
|
|
337
341
|
),
|
|
@@ -342,13 +346,13 @@ const F = n.forwardRef(({ className: t, children: e, title: i, action: a, isActi
|
|
|
342
346
|
}
|
|
343
347
|
);
|
|
344
348
|
});
|
|
345
|
-
|
|
346
|
-
const
|
|
347
|
-
({ className: t, name:
|
|
349
|
+
O.displayName = "SidebarHistoryItem";
|
|
350
|
+
const P = o.forwardRef(
|
|
351
|
+
({ className: t, name: r, role: i, src: a, hideAvatar: s, ...d }, l) => /* @__PURE__ */ c(
|
|
348
352
|
"a",
|
|
349
353
|
{
|
|
350
354
|
ref: l,
|
|
351
|
-
className:
|
|
355
|
+
className: n(
|
|
352
356
|
"flex items-center gap-2.5 rounded-md p-2 transition-colors hover:bg-sidebar-accent/60",
|
|
353
357
|
"outline-none focus-visible:ring-3 focus-visible:ring-ring",
|
|
354
358
|
"group-data-[collapsed=true]/sidebar:mx-auto group-data-[collapsed=true]/sidebar:size-(--sidebar-item) group-data-[collapsed=true]/sidebar:justify-center group-data-[collapsed=true]/sidebar:p-0",
|
|
@@ -356,35 +360,35 @@ const W = n.forwardRef(
|
|
|
356
360
|
),
|
|
357
361
|
...d,
|
|
358
362
|
children: [
|
|
359
|
-
!s && /* @__PURE__ */
|
|
360
|
-
s && /* @__PURE__ */
|
|
361
|
-
|
|
363
|
+
!s && /* @__PURE__ */ e(L, { size: "sm", name: r, src: a }),
|
|
364
|
+
s && /* @__PURE__ */ e(
|
|
365
|
+
j,
|
|
362
366
|
{
|
|
363
367
|
"aria-hidden": !0,
|
|
364
368
|
className: "hidden size-4 shrink-0 text-muted-foreground group-data-[collapsed=true]/sidebar:block"
|
|
365
369
|
}
|
|
366
370
|
),
|
|
367
371
|
/* @__PURE__ */ c("div", { className: "min-w-0 leading-tight group-data-[collapsed=true]/sidebar:hidden", children: [
|
|
368
|
-
/* @__PURE__ */
|
|
369
|
-
i && /* @__PURE__ */
|
|
372
|
+
/* @__PURE__ */ e("div", { className: "truncate text-base leading-[var(--text-base--line-height)] font-normal text-foreground", children: r }),
|
|
373
|
+
i && /* @__PURE__ */ e("div", { className: "truncate text-xs leading-[var(--text-xs--line-height)] text-tertiary", children: i })
|
|
370
374
|
] })
|
|
371
375
|
]
|
|
372
376
|
}
|
|
373
377
|
)
|
|
374
378
|
);
|
|
375
|
-
|
|
379
|
+
P.displayName = "SidebarAccount";
|
|
376
380
|
export {
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
381
|
+
K as Sidebar,
|
|
382
|
+
P as SidebarAccount,
|
|
383
|
+
W as SidebarAction,
|
|
384
|
+
Y as SidebarBrand,
|
|
385
|
+
F as SidebarFooter,
|
|
386
|
+
A as SidebarHeader,
|
|
387
|
+
$ as SidebarHistory,
|
|
388
|
+
O as SidebarHistoryItem,
|
|
389
|
+
D as SidebarItem,
|
|
390
|
+
q as SidebarNav,
|
|
391
|
+
B as SidebarSection,
|
|
388
392
|
z as SidebarTrigger,
|
|
389
|
-
|
|
393
|
+
M as useSidebar
|
|
390
394
|
};
|
package/components/skeleton.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as o } from "react/jsx-runtime";
|
|
3
|
-
import * as
|
|
4
|
-
import { cn as
|
|
5
|
-
const i =
|
|
3
|
+
import * as f from "react";
|
|
4
|
+
import { cn as n } from "../lib/cn.js";
|
|
5
|
+
const i = f.forwardRef(
|
|
6
6
|
({ className: e, circle: r = !1, ...t }, a) => /* @__PURE__ */ o(
|
|
7
7
|
"div",
|
|
8
8
|
{
|
|
9
9
|
ref: a,
|
|
10
10
|
"aria-hidden": !0,
|
|
11
|
-
className:
|
|
11
|
+
className: n(
|
|
12
12
|
"relative overflow-hidden bg-muted",
|
|
13
13
|
r ? "rounded-full" : "rounded-md",
|
|
14
14
|
"after:absolute after:inset-0 after:-translate-x-full",
|
|
15
15
|
"after:bg-gradient-to-r after:from-transparent after:via-foreground/10 after:to-transparent",
|
|
16
|
-
"after:animate-[ads-
|
|
16
|
+
"after:animate-[ads-shimmer_1.5s_infinite]",
|
|
17
17
|
e
|
|
18
18
|
),
|
|
19
19
|
...t
|
package/components/spinner.d.ts
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { SPINNER_VARIANTS, SpinnerVariant } from '../lib/spinner-mark';
|
|
2
3
|
import * as React from "react";
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
export { SPINNER_VARIANTS, type SpinnerVariant };
|
|
5
|
+
declare const spinnerStyles: (props?: ({
|
|
6
|
+
size?: "xs" | "sm" | "md" | "lg" | null | undefined;
|
|
5
7
|
color?: "current" | "primary" | "muted" | null | undefined;
|
|
6
8
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
-
export interface SpinnerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "color">, VariantProps<typeof
|
|
9
|
+
export interface SpinnerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "color">, VariantProps<typeof spinnerStyles> {
|
|
10
|
+
/** The work scope determines the grid choreography. Defaults to action. */
|
|
11
|
+
variant?: SpinnerVariant;
|
|
12
|
+
/** Accessible status text. Defaults to “Loading”. */
|
|
8
13
|
label?: string;
|
|
9
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* A bold 3×3 loading indicator that stays legible in a native 16 px slot.
|
|
17
|
+
* Every variant uses exactly nine squircles and inherits currentColor. Under
|
|
18
|
+
* reduced motion, the grid holds a representative frame instead of moving.
|
|
19
|
+
*/
|
|
10
20
|
export declare const Spinner: React.ForwardRefExoticComponent<SpinnerProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
-
export {};
|