@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
|
@@ -1,67 +1,76 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as k, jsx as
|
|
2
|
+
import { jsxs as k, jsx as s } from "react/jsx-runtime";
|
|
3
3
|
import * as M from "react";
|
|
4
4
|
import { Minus as _, Plus as j } from "../lib/icons.js";
|
|
5
|
-
import { cn as
|
|
5
|
+
import { cn as a } from "../lib/cn.js";
|
|
6
6
|
import { inputBaseClass as h } from "./field.js";
|
|
7
7
|
const D = {
|
|
8
|
-
sm: {
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
sm: {
|
|
9
|
+
field: "h-8 rounded-sm text-xs",
|
|
10
|
+
btn: "size-8 rounded-sm [&_svg]:size-3.5"
|
|
11
|
+
},
|
|
12
|
+
md: {
|
|
13
|
+
field: "h-10 rounded-md text-xs",
|
|
14
|
+
btn: "size-10 rounded-md [&_svg]:size-4"
|
|
15
|
+
},
|
|
16
|
+
lg: {
|
|
17
|
+
field: "h-11 rounded-md text-base",
|
|
18
|
+
btn: "size-11 rounded-md [&_svg]:size-4"
|
|
19
|
+
}
|
|
11
20
|
}, F = M.forwardRef(
|
|
12
21
|
({
|
|
13
22
|
className: v,
|
|
14
|
-
value:
|
|
23
|
+
value: c,
|
|
15
24
|
onChange: t,
|
|
16
25
|
min: i,
|
|
17
|
-
max:
|
|
18
|
-
step:
|
|
26
|
+
max: n,
|
|
27
|
+
step: l = 1,
|
|
19
28
|
size: x = "md",
|
|
20
29
|
isInvalid: N,
|
|
21
30
|
disabled: o,
|
|
22
31
|
...z
|
|
23
32
|
}, w) => {
|
|
24
|
-
const u = D[x], b = (
|
|
25
|
-
let e =
|
|
26
|
-
return i !== void 0 && (e = Math.max(i, e)),
|
|
27
|
-
},
|
|
33
|
+
const u = D[x], b = (r) => {
|
|
34
|
+
let e = r;
|
|
35
|
+
return i !== void 0 && (e = Math.max(i, e)), n !== void 0 && (e = Math.min(n, e)), e;
|
|
36
|
+
}, d = c ?? 0, y = !o && (i === void 0 || d > i), g = !o && (n === void 0 || d < n), m = (r) => t == null ? void 0 : t(b(d + r * l)), p = a(
|
|
28
37
|
"inline-flex items-center justify-center rounded-md border border-input bg-elevated text-foreground",
|
|
29
|
-
"transition-[background,box-shadow] duration-
|
|
38
|
+
"transition-[background,box-shadow] duration-150 hover:bg-muted",
|
|
30
39
|
"outline-none focus-visible:ring-3 focus-visible:ring-ring",
|
|
31
40
|
"disabled:pointer-events-none disabled:opacity-50",
|
|
32
41
|
u.btn
|
|
33
42
|
);
|
|
34
|
-
return /* @__PURE__ */ k("div", { className:
|
|
35
|
-
/* @__PURE__ */
|
|
43
|
+
return /* @__PURE__ */ k("div", { className: a("inline-flex items-center gap-1.5", v), children: [
|
|
44
|
+
/* @__PURE__ */ s(
|
|
36
45
|
"button",
|
|
37
46
|
{
|
|
38
47
|
type: "button",
|
|
39
48
|
"aria-label": "Decrease",
|
|
40
49
|
disabled: !y,
|
|
41
|
-
onClick: () =>
|
|
42
|
-
className:
|
|
43
|
-
children: /* @__PURE__ */
|
|
50
|
+
onClick: () => m(-1),
|
|
51
|
+
className: p,
|
|
52
|
+
children: /* @__PURE__ */ s(_, {})
|
|
44
53
|
}
|
|
45
54
|
),
|
|
46
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ s(
|
|
47
56
|
"input",
|
|
48
57
|
{
|
|
49
58
|
ref: w,
|
|
50
59
|
type: "number",
|
|
51
60
|
inputMode: "numeric",
|
|
52
|
-
value:
|
|
61
|
+
value: c ?? "",
|
|
53
62
|
min: i,
|
|
54
|
-
max:
|
|
55
|
-
step:
|
|
63
|
+
max: n,
|
|
64
|
+
step: l,
|
|
56
65
|
disabled: o,
|
|
57
66
|
"aria-invalid": N || void 0,
|
|
58
|
-
onChange: (
|
|
59
|
-
const e =
|
|
67
|
+
onChange: (r) => {
|
|
68
|
+
const e = r.target.value;
|
|
60
69
|
if (e === "") return;
|
|
61
70
|
const f = Number(e);
|
|
62
71
|
Number.isNaN(f) || t == null || t(b(f));
|
|
63
72
|
},
|
|
64
|
-
className:
|
|
73
|
+
className: a(
|
|
65
74
|
h,
|
|
66
75
|
"w-20 text-center [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
|
|
67
76
|
u.field
|
|
@@ -69,15 +78,15 @@ const D = {
|
|
|
69
78
|
...z
|
|
70
79
|
}
|
|
71
80
|
),
|
|
72
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ s(
|
|
73
82
|
"button",
|
|
74
83
|
{
|
|
75
84
|
type: "button",
|
|
76
85
|
"aria-label": "Increase",
|
|
77
86
|
disabled: !g,
|
|
78
|
-
onClick: () =>
|
|
79
|
-
className:
|
|
80
|
-
children: /* @__PURE__ */
|
|
87
|
+
onClick: () => m(1),
|
|
88
|
+
className: p,
|
|
89
|
+
children: /* @__PURE__ */ s(j, {})
|
|
81
90
|
}
|
|
82
91
|
)
|
|
83
92
|
] });
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
3
|
-
import * as
|
|
3
|
+
import * as o from "react";
|
|
4
4
|
import { ArrowLeft as d } from "../lib/icons.js";
|
|
5
5
|
import { cn as f } from "../lib/cn.js";
|
|
6
6
|
import { Button as h } from "./button.js";
|
|
7
|
-
const x =
|
|
7
|
+
const x = o.forwardRef(
|
|
8
8
|
({
|
|
9
|
-
className:
|
|
10
|
-
title:
|
|
9
|
+
className: m,
|
|
10
|
+
title: s,
|
|
11
11
|
description: r,
|
|
12
12
|
onBack: a,
|
|
13
|
-
backLabel:
|
|
13
|
+
backLabel: n = "Back",
|
|
14
14
|
actions: i,
|
|
15
|
-
...
|
|
16
|
-
},
|
|
15
|
+
...l
|
|
16
|
+
}, c) => /* @__PURE__ */ t(
|
|
17
17
|
"header",
|
|
18
18
|
{
|
|
19
|
-
ref:
|
|
19
|
+
ref: c,
|
|
20
20
|
className: f(
|
|
21
21
|
"flex min-w-0 items-start justify-between gap-4",
|
|
22
|
-
|
|
22
|
+
m
|
|
23
23
|
),
|
|
24
|
-
...
|
|
24
|
+
...l,
|
|
25
25
|
children: [
|
|
26
26
|
/* @__PURE__ */ t("div", { className: "flex min-w-0 items-start gap-2", children: [
|
|
27
27
|
a && /* @__PURE__ */ e(
|
|
@@ -30,14 +30,14 @@ const x = c.forwardRef(
|
|
|
30
30
|
type: "button",
|
|
31
31
|
size: "icon-sm",
|
|
32
32
|
variant: "ghost",
|
|
33
|
-
"aria-label":
|
|
33
|
+
"aria-label": n,
|
|
34
34
|
className: "shrink-0",
|
|
35
35
|
onClick: a,
|
|
36
36
|
children: /* @__PURE__ */ e(d, { "aria-hidden": !0 })
|
|
37
37
|
}
|
|
38
38
|
),
|
|
39
39
|
/* @__PURE__ */ t("div", { className: "min-w-0", children: [
|
|
40
|
-
/* @__PURE__ */ e("h1", { className: "flex min-h-8 items-center text-xl font-
|
|
40
|
+
/* @__PURE__ */ e("h1", { className: "flex min-h-8 items-center text-xl font-medium tracking-tight text-foreground", children: s }),
|
|
41
41
|
r && /* @__PURE__ */ e("p", { className: "mt-1 max-w-2xl text-xs text-muted-foreground", children: r })
|
|
42
42
|
] })
|
|
43
43
|
] }),
|
package/components/pagination.js
CHANGED
|
@@ -12,7 +12,7 @@ function p(e, r) {
|
|
|
12
12
|
function E(e, r, t) {
|
|
13
13
|
if (t * 2 + 5 >= e)
|
|
14
14
|
return p(1, e);
|
|
15
|
-
const m = Math.max(r - t, 1),
|
|
15
|
+
const m = Math.max(r - t, 1), s = Math.min(r + t, e), d = m > 2, a = s < e - 1;
|
|
16
16
|
if (!d && a) {
|
|
17
17
|
const c = t * 2 + 3;
|
|
18
18
|
return [...p(1, c), "end-ellipsis", e];
|
|
@@ -24,7 +24,7 @@ function E(e, r, t) {
|
|
|
24
24
|
return [
|
|
25
25
|
1,
|
|
26
26
|
"start-ellipsis",
|
|
27
|
-
...p(m,
|
|
27
|
+
...p(m, s),
|
|
28
28
|
"end-ellipsis",
|
|
29
29
|
e
|
|
30
30
|
];
|
|
@@ -32,7 +32,7 @@ function E(e, r, t) {
|
|
|
32
32
|
const A = (e) => 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
|
-
"transition active:scale-
|
|
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
37
|
e === "sm" ? "size-7 text-xs" : "size-9 text-xs"
|
|
38
38
|
), N = (e) => e === "sm" ? "w-auto gap-1.5 px-2" : "w-auto gap-1.5 px-2.5", F = j.forwardRef(
|
|
@@ -42,7 +42,7 @@ const A = (e) => o(
|
|
|
42
42
|
page: t,
|
|
43
43
|
onChange: i,
|
|
44
44
|
siblings: m = 1,
|
|
45
|
-
size:
|
|
45
|
+
size: s = "md",
|
|
46
46
|
summary: d,
|
|
47
47
|
labels: a = !1,
|
|
48
48
|
pageSize: c,
|
|
@@ -51,7 +51,7 @@ const A = (e) => o(
|
|
|
51
51
|
...C
|
|
52
52
|
}, y) => {
|
|
53
53
|
if (r <= 0) return null;
|
|
54
|
-
const P = E(r, t, m), R = t <= 1, S = t >= r, f = A(
|
|
54
|
+
const P = E(r, t, m), R = t <= 1, S = t >= r, f = A(s), x = s === "sm" ? "size-3.5" : "size-4", h = c != null && !!g, b = d != null || h;
|
|
55
55
|
return /* @__PURE__ */ u(
|
|
56
56
|
"nav",
|
|
57
57
|
{
|
|
@@ -90,12 +90,12 @@ const A = (e) => o(
|
|
|
90
90
|
size: "sm",
|
|
91
91
|
className: "w-18",
|
|
92
92
|
placement: "top",
|
|
93
|
-
items: (w ?? [8, 16, 32]).map((
|
|
94
|
-
label: String(
|
|
95
|
-
value: String(
|
|
93
|
+
items: (w ?? [8, 16, 32]).map((n) => ({
|
|
94
|
+
label: String(n),
|
|
95
|
+
value: String(n)
|
|
96
96
|
})),
|
|
97
97
|
value: String(c),
|
|
98
|
-
onChange: (
|
|
98
|
+
onChange: (n) => g(Number(n))
|
|
99
99
|
}
|
|
100
100
|
)
|
|
101
101
|
]
|
|
@@ -112,7 +112,7 @@ const A = (e) => o(
|
|
|
112
112
|
className: o(
|
|
113
113
|
f,
|
|
114
114
|
"text-foreground hover:bg-muted",
|
|
115
|
-
a && N(
|
|
115
|
+
a && N(s)
|
|
116
116
|
),
|
|
117
117
|
children: [
|
|
118
118
|
/* @__PURE__ */ l(k, { className: x, "aria-hidden": !0 }),
|
|
@@ -120,8 +120,8 @@ const A = (e) => o(
|
|
|
120
120
|
]
|
|
121
121
|
}
|
|
122
122
|
),
|
|
123
|
-
P.map((
|
|
124
|
-
if (
|
|
123
|
+
P.map((n) => {
|
|
124
|
+
if (n === "start-ellipsis" || n === "end-ellipsis")
|
|
125
125
|
return /* @__PURE__ */ l(
|
|
126
126
|
"span",
|
|
127
127
|
{
|
|
@@ -129,23 +129,23 @@ const A = (e) => o(
|
|
|
129
129
|
className: o(f, "text-muted-foreground"),
|
|
130
130
|
children: /* @__PURE__ */ l(L, { className: x })
|
|
131
131
|
},
|
|
132
|
-
|
|
132
|
+
n
|
|
133
133
|
);
|
|
134
|
-
const v =
|
|
134
|
+
const v = n === t;
|
|
135
135
|
return /* @__PURE__ */ l(
|
|
136
136
|
"button",
|
|
137
137
|
{
|
|
138
138
|
type: "button",
|
|
139
|
-
"aria-label": `Go to page ${
|
|
139
|
+
"aria-label": `Go to page ${n}`,
|
|
140
140
|
"aria-current": v ? "page" : void 0,
|
|
141
|
-
onClick: () => i(
|
|
141
|
+
onClick: () => i(n),
|
|
142
142
|
className: o(
|
|
143
143
|
f,
|
|
144
144
|
v ? "bg-foreground text-background" : "text-foreground hover:bg-muted"
|
|
145
145
|
),
|
|
146
|
-
children:
|
|
146
|
+
children: n
|
|
147
147
|
},
|
|
148
|
-
|
|
148
|
+
n
|
|
149
149
|
);
|
|
150
150
|
}),
|
|
151
151
|
/* @__PURE__ */ u(
|
|
@@ -158,7 +158,7 @@ const A = (e) => o(
|
|
|
158
158
|
className: o(
|
|
159
159
|
f,
|
|
160
160
|
"text-foreground hover:bg-muted",
|
|
161
|
-
a && N(
|
|
161
|
+
a && N(s)
|
|
162
162
|
),
|
|
163
163
|
children: [
|
|
164
164
|
a && "Next",
|
package/components/panel.js
CHANGED
|
@@ -37,7 +37,7 @@ const d = l.forwardRef(({ className: e, ...a }, r) => /* @__PURE__ */ o(
|
|
|
37
37
|
"h2",
|
|
38
38
|
{
|
|
39
39
|
ref: r,
|
|
40
|
-
className: n("flex min-w-0 items-center gap-2 truncate text-xs font-
|
|
40
|
+
className: n("flex min-w-0 items-center gap-2 truncate text-xs font-medium text-foreground", e),
|
|
41
41
|
...a
|
|
42
42
|
}
|
|
43
43
|
));
|
|
@@ -47,7 +47,7 @@ const i = l.forwardRef(
|
|
|
47
47
|
);
|
|
48
48
|
i.displayName = "PanelToolbar";
|
|
49
49
|
const f = l.forwardRef(
|
|
50
|
-
({ className: e, ...a }, r) => /* @__PURE__ */ o("div", { ref: r, className: n("min-h-0 flex-1 overflow-auto p-4", e), ...a })
|
|
50
|
+
({ className: e, ...a }, r) => /* @__PURE__ */ o("div", { ref: r, tabIndex: 0, className: n("min-h-0 flex-1 overflow-auto p-4", e), ...a })
|
|
51
51
|
);
|
|
52
52
|
f.displayName = "PanelBody";
|
|
53
53
|
const m = l.forwardRef(
|
|
@@ -13,7 +13,7 @@ const z = {
|
|
|
13
13
|
preserveDrawingBuffer: !1
|
|
14
14
|
}, O = 1e6, B = `uniform float u_type;
|
|
15
15
|
uniform float u_patternDensity;
|
|
16
|
-
uniform float u_pixelSizeJitter;`, k = " float res = step(.5, shape + dithering);",
|
|
16
|
+
uniform float u_pixelSizeJitter;`, k = " float res = step(.5, shape + dithering);", G = ` vec2 triangleUV = fract(pxSizeUV);
|
|
17
17
|
vec2 triangleCell = floor(pxSizeUV);
|
|
18
18
|
float triangleFlip = mod(triangleCell.x + triangleCell.y, 2.0);
|
|
19
19
|
triangleUV.x = mix(triangleUV.x, 1.0 - triangleUV.x, triangleFlip);
|
|
@@ -31,7 +31,7 @@ uniform float u_pixelSizeJitter;`, k = " float res = step(.5, shape + dithering
|
|
|
31
31
|
float res = step(densityThreshold, shape + dithering) * triangleMask;`;
|
|
32
32
|
if (!g.includes("uniform float u_type;") || !g.includes(k))
|
|
33
33
|
throw new Error("The Paper dithering shader no longer exposes the expected cell output.");
|
|
34
|
-
const
|
|
34
|
+
const b = g.replace("uniform float u_type;", B).replace(k, G), d = (e) => Math.max(0, Math.min(1, e)), J = "#202020", W = "#ffffff";
|
|
35
35
|
function X(e, t) {
|
|
36
36
|
if (typeof document > "u") return t;
|
|
37
37
|
const r = (o, i = 0) => {
|
|
@@ -132,7 +132,7 @@ const $ = c.forwardRef(
|
|
|
132
132
|
className: "size-full",
|
|
133
133
|
width: "100%",
|
|
134
134
|
height: "100%",
|
|
135
|
-
fragmentShader:
|
|
135
|
+
fragmentShader: b,
|
|
136
136
|
uniforms: A,
|
|
137
137
|
speed: x || S ? 0 : o,
|
|
138
138
|
minPixelRatio: 1,
|
package/components/pixel-icon.js
CHANGED
package/components/popover.d.ts
CHANGED
|
@@ -17,4 +17,4 @@ export interface PopoverContentProps extends React.HTMLAttributes<HTMLDivElement
|
|
|
17
17
|
align?: "start" | "center" | "end";
|
|
18
18
|
sideOffset?: number;
|
|
19
19
|
}
|
|
20
|
-
export declare function PopoverContent({ className, align, sideOffset, children, ...props }: PopoverContentProps): React.ReactPortal;
|
|
20
|
+
export declare function PopoverContent({ className, align, sideOffset, children, "aria-label": ariaLabel, ...props }: PopoverContentProps): React.ReactPortal;
|
package/components/popover.js
CHANGED
|
@@ -1,97 +1,99 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as g, jsxs as
|
|
2
|
+
import { jsx as g, jsxs as C } from "react/jsx-runtime";
|
|
3
3
|
import * as n from "react";
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { MotionConfig as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { floatVariants as
|
|
8
|
-
import { Ripple as
|
|
9
|
-
const
|
|
4
|
+
import { createPortal as y } from "react-dom";
|
|
5
|
+
import { MotionConfig as L, AnimatePresence as R, motion as k } from "motion/react";
|
|
6
|
+
import { cn as z } from "../lib/cn.js";
|
|
7
|
+
import { floatVariants as O } from "../lib/motion.js";
|
|
8
|
+
import { Ripple as j } from "./ripple.js";
|
|
9
|
+
const x = {
|
|
10
10
|
start: "top left",
|
|
11
11
|
center: "top",
|
|
12
12
|
end: "top right"
|
|
13
|
-
},
|
|
14
|
-
function E(
|
|
15
|
-
const e = n.useContext(
|
|
13
|
+
}, P = n.createContext(null);
|
|
14
|
+
function E(i) {
|
|
15
|
+
const e = n.useContext(P);
|
|
16
16
|
if (!e)
|
|
17
|
-
throw new Error(`${
|
|
17
|
+
throw new Error(`${i} must be used within a <Popover>.`);
|
|
18
18
|
return e;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
const [
|
|
22
|
-
return /* @__PURE__ */ g(
|
|
20
|
+
function W({ children: i, defaultOpen: e = !1 }) {
|
|
21
|
+
const [c, l] = n.useState(e), d = n.useRef(null);
|
|
22
|
+
return /* @__PURE__ */ g(P.Provider, { value: { open: c, setOpen: l, triggerRef: d }, children: i });
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
const { open: e, setOpen:
|
|
26
|
-
return n.cloneElement(
|
|
27
|
-
ref:
|
|
24
|
+
function K({ children: i }) {
|
|
25
|
+
const { open: e, setOpen: c, triggerRef: l } = E("PopoverTrigger"), d = i;
|
|
26
|
+
return n.cloneElement(d, {
|
|
27
|
+
ref: l,
|
|
28
28
|
"aria-expanded": e,
|
|
29
29
|
"aria-haspopup": !0,
|
|
30
|
-
onClick: (
|
|
31
|
-
var
|
|
32
|
-
(
|
|
30
|
+
onClick: (w) => {
|
|
31
|
+
var r, u;
|
|
32
|
+
(u = (r = d.props).onClick) == null || u.call(r, w), c(!e);
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
className:
|
|
36
|
+
function N({
|
|
37
|
+
className: i,
|
|
38
38
|
align: e = "start",
|
|
39
|
-
sideOffset:
|
|
40
|
-
children:
|
|
41
|
-
|
|
39
|
+
sideOffset: c = 8,
|
|
40
|
+
children: l,
|
|
41
|
+
"aria-label": d = "Popover",
|
|
42
|
+
...w
|
|
42
43
|
}) {
|
|
43
|
-
const { open:
|
|
44
|
+
const { open: r, setOpen: u, triggerRef: v } = E("PopoverContent"), h = n.useRef(null), [s, b] = n.useState(null);
|
|
44
45
|
return n.useLayoutEffect(() => {
|
|
45
|
-
if (!
|
|
46
|
-
const
|
|
47
|
-
if (!
|
|
48
|
-
const
|
|
49
|
-
var
|
|
50
|
-
const t =
|
|
51
|
-
let
|
|
52
|
-
e === "center" ?
|
|
46
|
+
if (!r) return;
|
|
47
|
+
const f = v.current;
|
|
48
|
+
if (!f) return;
|
|
49
|
+
const o = () => {
|
|
50
|
+
var m;
|
|
51
|
+
const t = f.getBoundingClientRect(), p = ((m = h.current) == null ? void 0 : m.offsetWidth) ?? 0;
|
|
52
|
+
let a = t.left;
|
|
53
|
+
e === "center" ? a = t.left + t.width / 2 - p / 2 : e === "end" && (a = t.right - p), b({ top: t.bottom + c, left: a });
|
|
53
54
|
};
|
|
54
|
-
return
|
|
55
|
-
window.removeEventListener("resize",
|
|
55
|
+
return o(), window.addEventListener("resize", o), window.addEventListener("scroll", o, !0), () => {
|
|
56
|
+
window.removeEventListener("resize", o), window.removeEventListener("scroll", o, !0);
|
|
56
57
|
};
|
|
57
|
-
}, [
|
|
58
|
-
if (!
|
|
59
|
-
const
|
|
60
|
-
t.key === "Escape" &&
|
|
61
|
-
},
|
|
62
|
-
var
|
|
63
|
-
const
|
|
64
|
-
(
|
|
58
|
+
}, [r, e, c, v]), n.useEffect(() => {
|
|
59
|
+
if (!r) return;
|
|
60
|
+
const f = (t) => {
|
|
61
|
+
t.key === "Escape" && u(!1);
|
|
62
|
+
}, o = (t) => {
|
|
63
|
+
var a, m;
|
|
64
|
+
const p = t.target;
|
|
65
|
+
(a = h.current) != null && a.contains(p) || (m = v.current) != null && m.contains(p) || u(!1);
|
|
65
66
|
};
|
|
66
|
-
return document.addEventListener("keydown",
|
|
67
|
-
document.removeEventListener("keydown",
|
|
67
|
+
return document.addEventListener("keydown", f), document.addEventListener("pointerdown", o), () => {
|
|
68
|
+
document.removeEventListener("keydown", f), document.removeEventListener("pointerdown", o);
|
|
68
69
|
};
|
|
69
|
-
}, [
|
|
70
|
-
/* @__PURE__ */ g(
|
|
71
|
-
|
|
70
|
+
}, [r, u, v]), y(
|
|
71
|
+
/* @__PURE__ */ g(L, { reducedMotion: "user", children: /* @__PURE__ */ g(R, { children: r && /* @__PURE__ */ C(
|
|
72
|
+
k.div,
|
|
72
73
|
{
|
|
73
|
-
ref:
|
|
74
|
+
ref: h,
|
|
74
75
|
role: "dialog",
|
|
75
|
-
|
|
76
|
+
"aria-label": d,
|
|
77
|
+
variants: O,
|
|
76
78
|
initial: "hidden",
|
|
77
79
|
animate: "visible",
|
|
78
80
|
exit: "hidden",
|
|
79
81
|
style: {
|
|
80
82
|
position: "fixed",
|
|
81
|
-
top: (
|
|
82
|
-
left: (
|
|
83
|
-
visibility:
|
|
84
|
-
transformOrigin:
|
|
83
|
+
top: (s == null ? void 0 : s.top) ?? 0,
|
|
84
|
+
left: (s == null ? void 0 : s.left) ?? 0,
|
|
85
|
+
visibility: s ? "visible" : "hidden",
|
|
86
|
+
transformOrigin: x[e]
|
|
85
87
|
},
|
|
86
|
-
className:
|
|
88
|
+
className: z(
|
|
87
89
|
"relative z-50 min-w-44 rounded-lg border border-border bg-elevated p-3",
|
|
88
90
|
"text-xs text-foreground shadow-elevation",
|
|
89
|
-
|
|
91
|
+
i
|
|
90
92
|
),
|
|
91
|
-
...
|
|
93
|
+
...w,
|
|
92
94
|
children: [
|
|
93
|
-
/* @__PURE__ */ g(
|
|
94
|
-
|
|
95
|
+
/* @__PURE__ */ g(j, { origin: x[e] }),
|
|
96
|
+
l
|
|
95
97
|
]
|
|
96
98
|
}
|
|
97
99
|
) }) }),
|
|
@@ -99,7 +101,7 @@ function K({
|
|
|
99
101
|
);
|
|
100
102
|
}
|
|
101
103
|
export {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
104
|
+
W as Popover,
|
|
105
|
+
N as PopoverContent,
|
|
106
|
+
K as PopoverTrigger
|
|
105
107
|
};
|
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as o, jsxs as v } from "react/jsx-runtime";
|
|
3
3
|
import * as x from "react";
|
|
4
|
+
import { MotionConfig as w, motion as y } from "motion/react";
|
|
4
5
|
import { cn as l } from "../lib/cn.js";
|
|
5
|
-
|
|
6
|
+
import { springProgress as M } from "../lib/motion.js";
|
|
7
|
+
const N = x.forwardRef(
|
|
6
8
|
({
|
|
7
|
-
className:
|
|
8
|
-
value:
|
|
9
|
-
max:
|
|
9
|
+
className: m,
|
|
10
|
+
value: f = 0,
|
|
11
|
+
max: e = 100,
|
|
10
12
|
size: r = 40,
|
|
11
|
-
strokeWidth:
|
|
13
|
+
strokeWidth: i = 4,
|
|
12
14
|
isIndeterminate: n = !1,
|
|
13
15
|
label: d,
|
|
14
|
-
...
|
|
16
|
+
...p
|
|
15
17
|
}, h) => {
|
|
16
|
-
const
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
+
const c = Math.min(Math.max(f, 0), e), u = e > 0 ? c / e : 0, s = (r - i) / 2, t = 2 * Math.PI * s, g = n ? t * 0.75 : t * (1 - u), a = r / 2;
|
|
19
|
+
return /* @__PURE__ */ o(
|
|
18
20
|
"div",
|
|
19
21
|
{
|
|
20
22
|
ref: h,
|
|
21
23
|
role: "progressbar",
|
|
22
24
|
"aria-label": d,
|
|
23
25
|
"aria-valuemin": 0,
|
|
24
|
-
"aria-valuemax":
|
|
25
|
-
"aria-valuenow": n ? void 0 :
|
|
26
|
-
className: l("inline-flex",
|
|
26
|
+
"aria-valuemax": e,
|
|
27
|
+
"aria-valuenow": n ? void 0 : c,
|
|
28
|
+
className: l("inline-flex", m),
|
|
27
29
|
style: { width: r, height: r },
|
|
28
|
-
...
|
|
29
|
-
children: /* @__PURE__ */
|
|
30
|
+
...p,
|
|
31
|
+
children: /* @__PURE__ */ v(
|
|
30
32
|
"svg",
|
|
31
33
|
{
|
|
32
34
|
width: r,
|
|
@@ -34,34 +36,36 @@ const w = x.forwardRef(
|
|
|
34
36
|
viewBox: `0 0 ${r} ${r}`,
|
|
35
37
|
className: l(
|
|
36
38
|
"-rotate-90",
|
|
37
|
-
n && "animate-[ads-
|
|
39
|
+
n && "animate-[ads-spin_800ms_linear_infinite]"
|
|
38
40
|
),
|
|
39
41
|
children: [
|
|
40
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ o(
|
|
41
43
|
"circle",
|
|
42
44
|
{
|
|
43
45
|
className: "stroke-muted",
|
|
44
46
|
fill: "none",
|
|
45
|
-
cx:
|
|
46
|
-
cy:
|
|
47
|
-
r:
|
|
48
|
-
strokeWidth:
|
|
47
|
+
cx: a,
|
|
48
|
+
cy: a,
|
|
49
|
+
r: s,
|
|
50
|
+
strokeWidth: i
|
|
49
51
|
}
|
|
50
52
|
),
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
|
|
53
|
+
/* @__PURE__ */ o(w, { reducedMotion: "user", children: /* @__PURE__ */ o(
|
|
54
|
+
y.circle,
|
|
53
55
|
{
|
|
54
|
-
className: "stroke-brand
|
|
56
|
+
className: "stroke-brand",
|
|
55
57
|
fill: "none",
|
|
56
|
-
cx:
|
|
57
|
-
cy:
|
|
58
|
-
r:
|
|
59
|
-
strokeWidth:
|
|
58
|
+
cx: a,
|
|
59
|
+
cy: a,
|
|
60
|
+
r: s,
|
|
61
|
+
strokeWidth: i,
|
|
60
62
|
strokeLinecap: "round",
|
|
61
|
-
strokeDasharray:
|
|
62
|
-
|
|
63
|
+
strokeDasharray: t,
|
|
64
|
+
initial: !1,
|
|
65
|
+
animate: { strokeDashoffset: g },
|
|
66
|
+
transition: M
|
|
63
67
|
}
|
|
64
|
-
)
|
|
68
|
+
) })
|
|
65
69
|
]
|
|
66
70
|
}
|
|
67
71
|
)
|
|
@@ -69,7 +73,7 @@ const w = x.forwardRef(
|
|
|
69
73
|
);
|
|
70
74
|
}
|
|
71
75
|
);
|
|
72
|
-
|
|
76
|
+
N.displayName = "ProgressCircle";
|
|
73
77
|
export {
|
|
74
|
-
|
|
78
|
+
N as ProgressCircle
|
|
75
79
|
};
|