@actioneer/ads 1.0.6 → 1.0.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/DESIGN.md +80 -86
- package/README.md +6 -0
- package/components/ai-elements/chart.js +20 -20
- package/components/ai-elements/inline-citation.js +50 -50
- package/components/ai-elements/message.js +1 -1
- package/components/ai-elements/tool.js +5 -5
- package/components/alert.d.ts +5 -4
- package/components/alert.js +91 -79
- package/components/answer.js +1 -1
- package/components/assistant-ui/action-bar.js +1 -1
- package/components/assistant-ui/attachment.js +68 -49
- package/components/assistant-ui/composer-add-context.js +1 -1
- package/components/assistant-ui/composer-trigger-popover.js +1 -1
- package/components/assistant-ui/composer.js +13 -13
- package/components/assistant-ui/message-timing.js +6 -6
- package/components/assistant-ui/selection-toolbar.js +5 -5
- package/components/assistant-ui/sources.js +15 -15
- package/components/assistant-ui/tooltip-icon-button.js +18 -14
- package/components/audio-waveform.d.ts +21 -8
- package/components/audio-waveform.js +371 -94
- package/components/autocomplete.js +9 -9
- package/components/breadcrumbs.js +32 -38
- package/components/button.js +83 -73
- package/components/card.js +1 -1
- package/components/chart.js +732 -673
- package/components/chip.js +37 -35
- package/components/command-palette.js +12 -12
- package/components/connector-card.d.ts +1 -2
- package/components/connector-card.js +17 -17
- package/components/date-range-picker.js +1 -2
- package/components/drawer.js +9 -10
- package/components/dropdown.js +1 -1
- package/components/empty-state.d.ts +2 -0
- package/components/empty-state.js +17 -15
- package/components/field.js +9 -10
- package/components/file-dropzone.d.ts +6 -3
- package/components/file-dropzone.js +72 -60
- package/components/infinite-canvas.js +9 -9
- package/components/modal.js +1 -1
- package/components/page-body.js +8 -8
- package/components/popover.js +11 -11
- package/components/progress-circle.d.ts +1 -1
- package/components/progress-circle.js +57 -48
- package/components/radio.d.ts +1 -1
- package/components/radio.js +53 -53
- package/components/segmented.d.ts +1 -0
- package/components/segmented.js +34 -36
- package/components/select.js +2 -2
- package/components/selection-action-bar.js +32 -31
- package/components/setting-row.js +10 -10
- package/components/sidebar.js +74 -73
- package/components/slider.js +5 -5
- package/components/stepper.d.ts +1 -1
- package/components/stepper.js +1 -1
- package/components/switch.js +10 -10
- package/components/table.d.ts +17 -5
- package/components/table.js +559 -405
- package/components/tabs.js +41 -35
- package/components/timeline.js +3 -3
- package/components/toast.js +53 -56
- package/components/ui/button.js +4 -4
- package/components/ui/dialog.js +1 -1
- package/components/viz-charts.js +263 -221
- package/examples/README.md +30 -0
- package/examples/agents-screen.tsx +477 -0
- package/examples/settings-screen.tsx +90 -0
- package/examples/workspace-header.tsx +71 -0
- package/lib/icons.d.ts +8 -0
- package/lib/icons.js +171 -118
- package/llms.txt +16 -16
- package/manifest.json +178 -54
- package/package.json +1 -1
- package/styles.css +60 -72
- package/theme.css +55 -63
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import * as
|
|
4
|
-
import { cva as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { Button as
|
|
7
|
-
import { FileText as
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
"flex w-full cursor-pointer
|
|
11
|
-
"border border-dashed border-border-strong bg-surface outline-none",
|
|
2
|
+
import { jsxs as t, jsx as r, Fragment as m } from "react/jsx-runtime";
|
|
3
|
+
import * as s from "react";
|
|
4
|
+
import { cva as R } from "class-variance-authority";
|
|
5
|
+
import { cn as p } from "../lib/cn.js";
|
|
6
|
+
import { Button as v } from "./button.js";
|
|
7
|
+
import { FileText as j, Upload as B } from "../lib/icons.js";
|
|
8
|
+
const C = R(
|
|
9
|
+
p(
|
|
10
|
+
"flex w-full cursor-pointer rounded-lg border bg-card outline-none",
|
|
12
11
|
"transition-[background-color,border-color,transform] duration-150 ease-out",
|
|
13
|
-
"
|
|
14
|
-
"active:scale-[0.97] motion-reduce:transition-none"
|
|
12
|
+
"focus-visible:ring-3 focus-visible:ring-ring motion-reduce:transition-none"
|
|
15
13
|
),
|
|
16
14
|
{
|
|
17
15
|
variants: {
|
|
16
|
+
hasFiles: {
|
|
17
|
+
true: "flex-row items-center justify-between gap-4 border-solid border-border p-3 text-left",
|
|
18
|
+
false: "flex-col items-center justify-center gap-3 border-dashed border-border-strong px-6 py-7 text-center hover:bg-wg1 active:scale-[0.99] motion-reduce:active:scale-100"
|
|
19
|
+
},
|
|
18
20
|
isDragging: {
|
|
19
|
-
true: "border-
|
|
21
|
+
true: "border-dashed border-field-focus bg-t1 hover:bg-t1",
|
|
20
22
|
false: ""
|
|
21
23
|
},
|
|
22
24
|
isDisabled: {
|
|
@@ -24,33 +26,33 @@ const T = C(
|
|
|
24
26
|
false: ""
|
|
25
27
|
}
|
|
26
28
|
},
|
|
27
|
-
defaultVariants: { isDragging: !1, isDisabled: !1 }
|
|
29
|
+
defaultVariants: { hasFiles: !1, isDragging: !1, isDisabled: !1 }
|
|
28
30
|
}
|
|
29
|
-
),
|
|
31
|
+
), N = "inline-flex size-9 shrink-0 items-center justify-center rounded-md border border-border bg-card text-muted-foreground [&>svg]:size-4.5", F = (a) => a < 1024 ? `${a} B` : a < 1024 * 1024 ? `${Math.round(a / 1024)} KB` : `${(a / (1024 * 1024)).toFixed(1)} MB`, T = s.forwardRef(
|
|
30
32
|
({
|
|
31
|
-
className:
|
|
32
|
-
accept:
|
|
33
|
+
className: a,
|
|
34
|
+
accept: y,
|
|
33
35
|
multiple: c = !1,
|
|
34
36
|
disabled: n = !1,
|
|
35
37
|
onFiles: l,
|
|
36
|
-
files:
|
|
38
|
+
files: i,
|
|
37
39
|
onClear: g,
|
|
38
|
-
label:
|
|
39
|
-
hint:
|
|
40
|
-
...
|
|
41
|
-
},
|
|
42
|
-
const
|
|
40
|
+
label: w,
|
|
41
|
+
hint: h,
|
|
42
|
+
...z
|
|
43
|
+
}, k) => {
|
|
44
|
+
const x = s.useRef(null), [d, f] = s.useState(!1), o = s.useRef(0), b = (e) => {
|
|
43
45
|
e != null && e.length && (l == null || l(c ? Array.from(e) : [e[0]]));
|
|
44
46
|
}, u = () => {
|
|
45
47
|
var e;
|
|
46
|
-
return (e =
|
|
47
|
-
},
|
|
48
|
-
return /* @__PURE__ */
|
|
48
|
+
return (e = x.current) == null ? void 0 : e.click();
|
|
49
|
+
}, D = !!(i != null && i.length);
|
|
50
|
+
return /* @__PURE__ */ t(
|
|
49
51
|
"div",
|
|
50
52
|
{
|
|
51
|
-
ref:
|
|
53
|
+
ref: k,
|
|
52
54
|
"data-slot": "file-dropzone",
|
|
53
|
-
"data-dragging":
|
|
55
|
+
"data-dragging": d || void 0,
|
|
54
56
|
role: "button",
|
|
55
57
|
tabIndex: n ? -1 : 0,
|
|
56
58
|
"aria-disabled": n || void 0,
|
|
@@ -59,51 +61,52 @@ const T = C(
|
|
|
59
61
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), u());
|
|
60
62
|
},
|
|
61
63
|
onDragEnter: (e) => {
|
|
62
|
-
e.preventDefault(), o.current += 1,
|
|
64
|
+
e.preventDefault(), o.current += 1, f(!0);
|
|
63
65
|
},
|
|
64
66
|
onDragOver: (e) => e.preventDefault(),
|
|
65
67
|
onDragLeave: () => {
|
|
66
|
-
o.current -= 1, o.current <= 0 && (o.current = 0,
|
|
68
|
+
o.current -= 1, o.current <= 0 && (o.current = 0, f(!1));
|
|
67
69
|
},
|
|
68
70
|
onDrop: (e) => {
|
|
69
|
-
e.preventDefault(), o.current = 0,
|
|
71
|
+
e.preventDefault(), o.current = 0, f(!1), n || b(e.dataTransfer.files);
|
|
70
72
|
},
|
|
71
|
-
className:
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
className: p(
|
|
74
|
+
C({ hasFiles: D, isDragging: d, isDisabled: n }),
|
|
75
|
+
a
|
|
74
76
|
),
|
|
75
|
-
...
|
|
77
|
+
...z,
|
|
76
78
|
children: [
|
|
77
79
|
/* @__PURE__ */ r(
|
|
78
80
|
"input",
|
|
79
81
|
{
|
|
80
|
-
ref:
|
|
82
|
+
ref: x,
|
|
81
83
|
hidden: !0,
|
|
82
84
|
type: "file",
|
|
83
|
-
accept:
|
|
85
|
+
accept: y,
|
|
84
86
|
multiple: c,
|
|
85
87
|
disabled: n,
|
|
86
88
|
onChange: (e) => {
|
|
87
|
-
|
|
89
|
+
b(e.currentTarget.files), e.currentTarget.value = "";
|
|
88
90
|
}
|
|
89
91
|
}
|
|
90
92
|
),
|
|
91
|
-
|
|
92
|
-
/* @__PURE__ */ r("
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
D ? /* @__PURE__ */ t(m, { children: [
|
|
94
|
+
/* @__PURE__ */ r("div", { className: "flex min-w-0 flex-1 flex-col gap-2.5", children: i.map((e) => /* @__PURE__ */ t("span", { className: "flex min-w-0 items-center gap-3", children: [
|
|
95
|
+
/* @__PURE__ */ r("span", { "aria-hidden": !0, className: N, children: /* @__PURE__ */ r(j, {}) }),
|
|
96
|
+
/* @__PURE__ */ t("span", { className: "flex min-w-0 flex-col", children: [
|
|
97
|
+
/* @__PURE__ */ r("span", { className: "truncate text-m font-medium text-foreground", children: e.name }),
|
|
98
|
+
/* @__PURE__ */ r("span", { className: "text-s text-tertiary tabular-nums", children: F(e.size) })
|
|
99
|
+
] })
|
|
96
100
|
] }, e.name)) }),
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
/* @__PURE__ */ r(
|
|
101
|
+
/* @__PURE__ */ t("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
102
|
+
/* @__PURE__ */ r(v, { size: "sm", variant: "outline", onClick: (e) => {
|
|
99
103
|
e.stopPropagation(), u();
|
|
100
104
|
}, children: "Replace" }),
|
|
101
105
|
g && /* @__PURE__ */ r(
|
|
102
|
-
|
|
106
|
+
v,
|
|
103
107
|
{
|
|
104
108
|
size: "sm",
|
|
105
109
|
variant: "ghost",
|
|
106
|
-
startContent: /* @__PURE__ */ r(B, {}),
|
|
107
110
|
onClick: (e) => {
|
|
108
111
|
e.stopPropagation(), g();
|
|
109
112
|
},
|
|
@@ -111,24 +114,33 @@ const T = C(
|
|
|
111
114
|
}
|
|
112
115
|
)
|
|
113
116
|
] })
|
|
114
|
-
] }) : /* @__PURE__ */
|
|
115
|
-
/* @__PURE__ */ r(
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
117
|
+
] }) : /* @__PURE__ */ t(m, { children: [
|
|
118
|
+
/* @__PURE__ */ r(
|
|
119
|
+
"span",
|
|
120
|
+
{
|
|
121
|
+
"aria-hidden": !0,
|
|
122
|
+
className: p(N, d && "text-action-primary"),
|
|
123
|
+
children: /* @__PURE__ */ r(B, {})
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
/* @__PURE__ */ t("span", { className: "flex flex-col items-center gap-0.5", children: [
|
|
127
|
+
/* @__PURE__ */ r("span", { className: "text-m font-medium text-foreground", children: w ?? /* @__PURE__ */ t(m, { children: [
|
|
128
|
+
"Drop ",
|
|
129
|
+
c ? "files" : "a file",
|
|
130
|
+
" here, or",
|
|
131
|
+
" ",
|
|
132
|
+
/* @__PURE__ */ r("span", { className: "text-action-primary-text", children: "browse" })
|
|
133
|
+
] }) }),
|
|
134
|
+
h && /* @__PURE__ */ r("span", { className: "text-s text-tertiary", children: h })
|
|
135
|
+
] })
|
|
124
136
|
] })
|
|
125
137
|
]
|
|
126
138
|
}
|
|
127
139
|
);
|
|
128
140
|
}
|
|
129
141
|
);
|
|
130
|
-
|
|
142
|
+
T.displayName = "FileDropzone";
|
|
131
143
|
export {
|
|
132
|
-
|
|
133
|
-
|
|
144
|
+
T as FileDropzone,
|
|
145
|
+
C as fileDropzoneVariants
|
|
134
146
|
};
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
import { jsx as e, jsxs as b } from "react/jsx-runtime";
|
|
3
3
|
import * as n from "react";
|
|
4
4
|
import { MarkerType as U, ReactFlow as Z, Background as j, BackgroundVariant as H, Panel as h, useReactFlow as K, useStore as V } from "@xyflow/react";
|
|
5
|
-
import { BaseEdge as he, EdgeLabelRenderer as xe, Handle as Ee, MarkerType as ye, Position as De, ReactFlowProvider as ke, addEdge as _e, getBezierPath as
|
|
5
|
+
import { BaseEdge as he, EdgeLabelRenderer as xe, Handle as Ee, MarkerType as ye, Position as De, ReactFlowProvider as ke, addEdge as _e, getBezierPath as Ie, getSmoothStepPath as we, getStraightPath as Re, useEdgesState as Se, useNodesState as Ae, useReactFlow as Ce } from "@xyflow/react";
|
|
6
6
|
import "@xyflow/react/dist/style.css";
|
|
7
7
|
import { cn as W } from "../lib/cn.js";
|
|
8
8
|
import { Minus as q, Plus as J, Maximize as Q, Magnet as X } from "../lib/icons.js";
|
|
9
9
|
import { Button as a } from "./button.js";
|
|
10
|
-
const x = 16, Y = 1.2, $ = [x, x], ee = 1.4,
|
|
10
|
+
const x = 16, Y = 1.2, $ = [x, x], ee = 1.4, I = 18, oe = 2, te = [8, 4], re = "var(--text-xs)", w = 150, ae = 200, ne = 0.28, R = "var(--canvas-edge)";
|
|
11
11
|
function v(o) {
|
|
12
12
|
return typeof window > "u" || !window.matchMedia ? o : window.matchMedia("(prefers-reduced-motion: reduce)").matches ? 0 : o;
|
|
13
13
|
}
|
|
14
14
|
const le = {
|
|
15
15
|
markerEnd: {
|
|
16
16
|
type: U.ArrowClosed,
|
|
17
|
-
width:
|
|
18
|
-
height:
|
|
17
|
+
width: I,
|
|
18
|
+
height: I,
|
|
19
19
|
color: R
|
|
20
20
|
},
|
|
21
21
|
style: { stroke: R, strokeWidth: ee },
|
|
@@ -49,7 +49,7 @@ function S({
|
|
|
49
49
|
h,
|
|
50
50
|
{
|
|
51
51
|
position: "bottom-right",
|
|
52
|
-
className: "m-3 flex items-center gap-0.5 rounded-lg border border-border bg-elevated p-1
|
|
52
|
+
className: "m-3 flex items-center gap-0.5 rounded-lg border border-border bg-elevated p-1",
|
|
53
53
|
children: [
|
|
54
54
|
/* @__PURE__ */ e(
|
|
55
55
|
a,
|
|
@@ -58,7 +58,7 @@ function S({
|
|
|
58
58
|
size: "icon-xs",
|
|
59
59
|
variant: "ghost",
|
|
60
60
|
"aria-label": "Zoom out",
|
|
61
|
-
onClick: () => void c({ duration: v(
|
|
61
|
+
onClick: () => void c({ duration: v(w) }),
|
|
62
62
|
children: /* @__PURE__ */ e(q, {})
|
|
63
63
|
}
|
|
64
64
|
),
|
|
@@ -80,7 +80,7 @@ function S({
|
|
|
80
80
|
size: "icon-xs",
|
|
81
81
|
variant: "ghost",
|
|
82
82
|
"aria-label": "Zoom in",
|
|
83
|
-
onClick: () => void s({ duration: v(
|
|
83
|
+
onClick: () => void s({ duration: v(w) }),
|
|
84
84
|
children: /* @__PURE__ */ e(J, {})
|
|
85
85
|
}
|
|
86
86
|
),
|
|
@@ -206,8 +206,8 @@ export {
|
|
|
206
206
|
De as Position,
|
|
207
207
|
ke as ReactFlowProvider,
|
|
208
208
|
_e as addEdge,
|
|
209
|
-
|
|
210
|
-
|
|
209
|
+
Ie as getBezierPath,
|
|
210
|
+
we as getSmoothStepPath,
|
|
211
211
|
Re as getStraightPath,
|
|
212
212
|
Se as useEdgesState,
|
|
213
213
|
Ae as useNodesState,
|
package/components/modal.js
CHANGED
|
@@ -11,7 +11,7 @@ const A = H(
|
|
|
11
11
|
[
|
|
12
12
|
"pointer-events-auto relative flex w-full min-w-0 flex-col overflow-hidden",
|
|
13
13
|
"max-h-[calc(100dvh-2rem)] bg-elevated text-foreground outline-none",
|
|
14
|
-
"rounded-xl shadow-
|
|
14
|
+
"rounded-xl shadow-overlay",
|
|
15
15
|
"max-sm:max-h-[calc(100dvh-1rem)] max-sm:rounded-lg"
|
|
16
16
|
],
|
|
17
17
|
{
|
package/components/page-body.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as e from "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
const
|
|
5
|
-
({ as: a = "main", className: o, ...l },
|
|
6
|
-
ref:
|
|
3
|
+
import { cn as t } from "../lib/cn.js";
|
|
4
|
+
const m = e.forwardRef(
|
|
5
|
+
({ as: a = "main", className: o, ...l }, r) => e.createElement(a, {
|
|
6
|
+
ref: r,
|
|
7
7
|
"data-slot": "page-body",
|
|
8
|
-
className:
|
|
9
|
-
"relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-card
|
|
8
|
+
className: t(
|
|
9
|
+
"relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-card",
|
|
10
10
|
o
|
|
11
11
|
),
|
|
12
12
|
...l
|
|
13
13
|
})
|
|
14
14
|
);
|
|
15
|
-
|
|
15
|
+
m.displayName = "PageBody";
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
m as PageBody
|
|
18
18
|
};
|
package/components/popover.js
CHANGED
|
@@ -18,13 +18,13 @@ function E(i) {
|
|
|
18
18
|
return e;
|
|
19
19
|
}
|
|
20
20
|
function W({ children: i, defaultOpen: e = !1 }) {
|
|
21
|
-
const [c,
|
|
22
|
-
return /* @__PURE__ */ g(P.Provider, { value: { open: c, setOpen:
|
|
21
|
+
const [c, a] = n.useState(e), d = n.useRef(null);
|
|
22
|
+
return /* @__PURE__ */ g(P.Provider, { value: { open: c, setOpen: a, triggerRef: d }, children: i });
|
|
23
23
|
}
|
|
24
24
|
function K({ children: i }) {
|
|
25
|
-
const { open: e, setOpen: c, triggerRef:
|
|
25
|
+
const { open: e, setOpen: c, triggerRef: a } = E("PopoverTrigger"), d = i;
|
|
26
26
|
return n.cloneElement(d, {
|
|
27
|
-
ref:
|
|
27
|
+
ref: a,
|
|
28
28
|
"aria-expanded": e,
|
|
29
29
|
"aria-haspopup": !0,
|
|
30
30
|
onClick: (w) => {
|
|
@@ -37,7 +37,7 @@ function N({
|
|
|
37
37
|
className: i,
|
|
38
38
|
align: e = "start",
|
|
39
39
|
sideOffset: c = 8,
|
|
40
|
-
children:
|
|
40
|
+
children: a,
|
|
41
41
|
"aria-label": d = "Popover",
|
|
42
42
|
...w
|
|
43
43
|
}) {
|
|
@@ -49,8 +49,8 @@ function N({
|
|
|
49
49
|
const o = () => {
|
|
50
50
|
var m;
|
|
51
51
|
const t = f.getBoundingClientRect(), p = ((m = h.current) == null ? void 0 : m.offsetWidth) ?? 0;
|
|
52
|
-
let
|
|
53
|
-
e === "center" ?
|
|
52
|
+
let l = t.left;
|
|
53
|
+
e === "center" ? l = t.left + t.width / 2 - p / 2 : e === "end" && (l = t.right - p), b({ top: t.bottom + c, left: l });
|
|
54
54
|
};
|
|
55
55
|
return o(), window.addEventListener("resize", o), window.addEventListener("scroll", o, !0), () => {
|
|
56
56
|
window.removeEventListener("resize", o), window.removeEventListener("scroll", o, !0);
|
|
@@ -60,9 +60,9 @@ function N({
|
|
|
60
60
|
const f = (t) => {
|
|
61
61
|
t.key === "Escape" && u(!1);
|
|
62
62
|
}, o = (t) => {
|
|
63
|
-
var
|
|
63
|
+
var l, m;
|
|
64
64
|
const p = t.target;
|
|
65
|
-
(
|
|
65
|
+
(l = h.current) != null && l.contains(p) || (m = v.current) != null && m.contains(p) || u(!1);
|
|
66
66
|
};
|
|
67
67
|
return document.addEventListener("keydown", f), document.addEventListener("pointerdown", o), () => {
|
|
68
68
|
document.removeEventListener("keydown", f), document.removeEventListener("pointerdown", o);
|
|
@@ -87,13 +87,13 @@ function N({
|
|
|
87
87
|
},
|
|
88
88
|
className: z(
|
|
89
89
|
"relative z-50 min-w-44 rounded-lg border border-border bg-elevated p-3",
|
|
90
|
-
"text-xs text-foreground
|
|
90
|
+
"text-xs text-foreground",
|
|
91
91
|
i
|
|
92
92
|
),
|
|
93
93
|
...w,
|
|
94
94
|
children: [
|
|
95
95
|
/* @__PURE__ */ g(j, { origin: x[e] }),
|
|
96
|
-
|
|
96
|
+
a
|
|
97
97
|
]
|
|
98
98
|
}
|
|
99
99
|
) }) }),
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
export interface ProgressCircleProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
3
|
value?: number;
|
|
4
4
|
max?: number;
|
|
5
|
-
/**
|
|
5
|
+
/** Outer width/height in pixels. */
|
|
6
6
|
size?: number;
|
|
7
7
|
strokeWidth?: number;
|
|
8
8
|
isIndeterminate?: boolean;
|
|
@@ -1,69 +1,78 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import * as
|
|
4
|
-
import { MotionConfig as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { springProgress as
|
|
7
|
-
const
|
|
2
|
+
import { jsx as i, jsxs as x } from "react/jsx-runtime";
|
|
3
|
+
import * as p from "react";
|
|
4
|
+
import { MotionConfig as L, motion as N } from "motion/react";
|
|
5
|
+
import { cn as u } from "../lib/cn.js";
|
|
6
|
+
import { springProgress as b } from "../lib/motion.js";
|
|
7
|
+
const M = 4, g = 96;
|
|
8
|
+
function w(s, e) {
|
|
9
|
+
const t = [];
|
|
10
|
+
for (let o = 0; o <= g; o++) {
|
|
11
|
+
const n = -Math.PI / 2 + o / g * Math.PI * 2, a = Math.cos(n), r = Math.sin(n), c = s + e * Math.sign(a) * Math.abs(a) ** (2 / M), l = s + e * Math.sign(r) * Math.abs(r) ** (2 / M);
|
|
12
|
+
t.push(`${c.toFixed(2)},${l.toFixed(2)}`);
|
|
13
|
+
}
|
|
14
|
+
return `M${t.join(" L")} Z`;
|
|
15
|
+
}
|
|
16
|
+
const j = p.forwardRef(
|
|
8
17
|
({
|
|
9
|
-
className:
|
|
10
|
-
value:
|
|
11
|
-
max:
|
|
12
|
-
size:
|
|
13
|
-
strokeWidth:
|
|
14
|
-
isIndeterminate:
|
|
15
|
-
label:
|
|
16
|
-
...
|
|
17
|
-
},
|
|
18
|
-
const
|
|
19
|
-
return /* @__PURE__ */
|
|
18
|
+
className: s,
|
|
19
|
+
value: e = 0,
|
|
20
|
+
max: t = 100,
|
|
21
|
+
size: o = 40,
|
|
22
|
+
strokeWidth: n = 4,
|
|
23
|
+
isIndeterminate: a = !1,
|
|
24
|
+
label: r,
|
|
25
|
+
...c
|
|
26
|
+
}, l) => {
|
|
27
|
+
const h = Math.min(Math.max(e, 0), t), v = t > 0 ? h / t : 0, m = o / 2, d = (o - n) / 2, f = p.useMemo(() => w(m, d), [m, d]), P = a ? 75 : 100 - v * 100;
|
|
28
|
+
return /* @__PURE__ */ i(
|
|
20
29
|
"div",
|
|
21
30
|
{
|
|
22
|
-
ref:
|
|
31
|
+
ref: l,
|
|
23
32
|
role: "progressbar",
|
|
24
|
-
"aria-label":
|
|
33
|
+
"aria-label": r,
|
|
25
34
|
"aria-valuemin": 0,
|
|
26
|
-
"aria-valuemax":
|
|
27
|
-
"aria-valuenow":
|
|
28
|
-
className:
|
|
29
|
-
style: { width:
|
|
30
|
-
...
|
|
31
|
-
children: /* @__PURE__ */
|
|
35
|
+
"aria-valuemax": t,
|
|
36
|
+
"aria-valuenow": a ? void 0 : h,
|
|
37
|
+
className: u("inline-flex", s),
|
|
38
|
+
style: { width: o, height: o },
|
|
39
|
+
...c,
|
|
40
|
+
children: /* @__PURE__ */ x(
|
|
32
41
|
"svg",
|
|
33
42
|
{
|
|
34
|
-
width:
|
|
35
|
-
height:
|
|
36
|
-
viewBox: `0 0 ${
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
width: o,
|
|
44
|
+
height: o,
|
|
45
|
+
viewBox: `0 0 ${o} ${o}`,
|
|
46
|
+
"aria-hidden": "true",
|
|
47
|
+
className: u(
|
|
48
|
+
"overflow-visible",
|
|
49
|
+
a && "animate-[ads-spin_800ms_linear_infinite] motion-reduce:animate-none"
|
|
40
50
|
),
|
|
41
51
|
children: [
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
"
|
|
52
|
+
/* @__PURE__ */ i(
|
|
53
|
+
"path",
|
|
44
54
|
{
|
|
45
55
|
className: "stroke-muted",
|
|
46
56
|
fill: "none",
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
strokeWidth: i
|
|
57
|
+
d: f,
|
|
58
|
+
strokeWidth: n,
|
|
59
|
+
strokeLinejoin: "round"
|
|
51
60
|
}
|
|
52
61
|
),
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
|
|
62
|
+
/* @__PURE__ */ i(L, { reducedMotion: "user", children: /* @__PURE__ */ i(
|
|
63
|
+
N.path,
|
|
55
64
|
{
|
|
56
65
|
className: "stroke-brand",
|
|
57
66
|
fill: "none",
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
strokeWidth: i,
|
|
67
|
+
d: f,
|
|
68
|
+
pathLength: 100,
|
|
69
|
+
strokeWidth: n,
|
|
62
70
|
strokeLinecap: "round",
|
|
63
|
-
|
|
71
|
+
strokeLinejoin: "round",
|
|
72
|
+
strokeDasharray: "100 100",
|
|
64
73
|
initial: !1,
|
|
65
|
-
animate: { strokeDashoffset:
|
|
66
|
-
transition:
|
|
74
|
+
animate: { strokeDashoffset: P },
|
|
75
|
+
transition: b
|
|
67
76
|
}
|
|
68
77
|
) })
|
|
69
78
|
]
|
|
@@ -73,7 +82,7 @@ const N = x.forwardRef(
|
|
|
73
82
|
);
|
|
74
83
|
}
|
|
75
84
|
);
|
|
76
|
-
|
|
85
|
+
j.displayName = "ProgressCircle";
|
|
77
86
|
export {
|
|
78
|
-
|
|
87
|
+
j as ProgressCircle
|
|
79
88
|
};
|
package/components/radio.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface RadioGroupProps extends Omit<React.HTMLAttributes<HTMLDivElemen
|
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
}
|
|
12
12
|
export declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
-
export interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "value"
|
|
13
|
+
export interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "value"> {
|
|
14
14
|
value: string;
|
|
15
15
|
}
|
|
16
16
|
export declare const Radio: React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<HTMLInputElement>>;
|