@arcadeai/design-system 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +128 -0
- package/dist/check-CxcShTlQ.js +11 -0
- package/dist/chevron-down-D_a-ccxi.js +11 -0
- package/dist/chevron-right-DriXIqe5.js +11 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +195 -0
- package/dist/components/ui/atoms/accordion.d.ts +7 -0
- package/dist/components/ui/atoms/accordion.js +289 -0
- package/dist/components/ui/atoms/alert.d.ts +9 -0
- package/dist/components/ui/atoms/alert.js +66 -0
- package/dist/components/ui/atoms/avatar.d.ts +6 -0
- package/dist/components/ui/atoms/avatar.js +130 -0
- package/dist/components/ui/atoms/badge.d.ts +9 -0
- package/dist/components/ui/atoms/badge.js +41 -0
- package/dist/components/ui/atoms/breadcrumb.d.ts +11 -0
- package/dist/components/ui/atoms/breadcrumb.js +115 -0
- package/dist/components/ui/atoms/button.d.ts +10 -0
- package/dist/components/ui/atoms/button.js +51 -0
- package/dist/components/ui/atoms/card.d.ts +9 -0
- package/dist/components/ui/atoms/card.js +90 -0
- package/dist/components/ui/atoms/chart.d.ts +68 -0
- package/dist/components/ui/atoms/chart.js +10477 -0
- package/dist/components/ui/atoms/collapsible.d.ts +5 -0
- package/dist/components/ui/atoms/collapsible.js +34 -0
- package/dist/components/ui/atoms/command.d.ts +18 -0
- package/dist/components/ui/atoms/command.js +490 -0
- package/dist/components/ui/atoms/dialog.d.ts +15 -0
- package/dist/components/ui/atoms/dialog.js +135 -0
- package/dist/components/ui/atoms/dropdown-menu.d.ts +25 -0
- package/dist/components/ui/atoms/dropdown-menu.js +1035 -0
- package/dist/components/ui/atoms/form.d.ts +24 -0
- package/dist/components/ui/atoms/form.js +297 -0
- package/dist/components/ui/atoms/hover-card.d.ts +6 -0
- package/dist/components/ui/atoms/hover-card.js +211 -0
- package/dist/components/ui/atoms/index.d.ts +33 -0
- package/dist/components/ui/atoms/index.js +195 -0
- package/dist/components/ui/atoms/input.d.ts +3 -0
- package/dist/components/ui/atoms/input.js +21 -0
- package/dist/components/ui/atoms/label.d.ts +4 -0
- package/dist/components/ui/atoms/label.js +36 -0
- package/dist/components/ui/atoms/popover.d.ts +7 -0
- package/dist/components/ui/atoms/popover.js +266 -0
- package/dist/components/ui/atoms/progress.d.ts +4 -0
- package/dist/components/ui/atoms/progress.js +107 -0
- package/dist/components/ui/atoms/resizable.d.ts +8 -0
- package/dist/components/ui/atoms/resizable.js +1564 -0
- package/dist/components/ui/atoms/scroll-area.d.ts +5 -0
- package/dist/components/ui/atoms/scroll-area.js +580 -0
- package/dist/components/ui/atoms/select.d.ts +15 -0
- package/dist/components/ui/atoms/select.js +1000 -0
- package/dist/components/ui/atoms/separator.d.ts +4 -0
- package/dist/components/ui/atoms/separator.js +44 -0
- package/dist/components/ui/atoms/sheet.d.ts +14 -0
- package/dist/components/ui/atoms/sheet.js +127 -0
- package/dist/components/ui/atoms/sidebar.d.ts +69 -0
- package/dist/components/ui/atoms/sidebar.js +602 -0
- package/dist/components/ui/atoms/skeleton.d.ts +2 -0
- package/dist/components/ui/atoms/skeleton.js +15 -0
- package/dist/components/ui/atoms/slider.d.ts +4 -0
- package/dist/components/ui/atoms/slider.js +484 -0
- package/dist/components/ui/atoms/sonner.d.ts +3 -0
- package/dist/components/ui/atoms/sonner.js +788 -0
- package/dist/components/ui/atoms/switch.d.ts +4 -0
- package/dist/components/ui/atoms/switch.js +155 -0
- package/dist/components/ui/atoms/table.d.ts +10 -0
- package/dist/components/ui/atoms/table.js +114 -0
- package/dist/components/ui/atoms/tabs.d.ts +7 -0
- package/dist/components/ui/atoms/tabs.js +218 -0
- package/dist/components/ui/atoms/textarea.d.ts +3 -0
- package/dist/components/ui/atoms/textarea.js +18 -0
- package/dist/components/ui/atoms/toggle.d.ts +9 -0
- package/dist/components/ui/atoms/toggle.js +70 -0
- package/dist/components/ui/atoms/tooltip.d.ts +7 -0
- package/dist/components/ui/atoms/tooltip.js +376 -0
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.js +195 -0
- package/dist/createLucideIcon-B6fy1GTR.js +94 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +14 -0
- package/dist/index-BAhNQL1u.js +675 -0
- package/dist/index-BZPx6jYI.js +8 -0
- package/dist/index-ByaXH_ih.js +10 -0
- package/dist/index-C9KW2H79.js +36 -0
- package/dist/index-CB1Wkg0G.js +83 -0
- package/dist/index-CHDs-SiB.js +27 -0
- package/dist/index-CJFGOBPb.js +122 -0
- package/dist/index-CL4N9wMT.js +259 -0
- package/dist/index-CuMpq4Un.js +47 -0
- package/dist/index-CxK6rt_N.js +119 -0
- package/dist/index-D2uXV4lz.js +181 -0
- package/dist/index-DLeNytVF.js +9 -0
- package/dist/index-DYfkNB0n.js +54 -0
- package/dist/index-DdnpnyX2.js +34 -0
- package/dist/index-DuekHEmj.js +6 -0
- package/dist/index-DwYXX2sM.js +13 -0
- package/dist/index-Dy7YuPrV.js +1532 -0
- package/dist/index-QMp1pYFl.js +145 -0
- package/dist/index-UFb2E87s.js +70 -0
- package/dist/index-nluJZSbA.js +31 -0
- package/dist/index-p7nYL7BU.js +71 -0
- package/dist/index-rKs9bXHr.js +6 -0
- package/dist/index-umR1UobZ.js +13 -0
- package/dist/index.css +2 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +4 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +195 -0
- package/dist/utils-Dy2WjYNJ.js +2744 -0
- package/package.json +100 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import * as s from "react";
|
|
2
|
+
import { c as p } from "./index-DLeNytVF.js";
|
|
3
|
+
import { c as V } from "./index-CuMpq4Un.js";
|
|
4
|
+
import { u as j } from "./index-CB1Wkg0G.js";
|
|
5
|
+
import { c as z } from "./index-UFb2E87s.js";
|
|
6
|
+
import { u as q } from "./index-umR1UobZ.js";
|
|
7
|
+
import { P as G } from "./index-C9KW2H79.js";
|
|
8
|
+
import { u as J } from "./index-DwYXX2sM.js";
|
|
9
|
+
import { u as Q } from "./index-DYfkNB0n.js";
|
|
10
|
+
import { u as W } from "./index-ByaXH_ih.js";
|
|
11
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
12
|
+
var y = "rovingFocusGroup.onEntryFocus", X = { bubbles: !1, cancelable: !0 }, I = "RovingFocusGroup", [P, N, Z] = V(I), [$, Fe] = z(
|
|
13
|
+
I,
|
|
14
|
+
[Z]
|
|
15
|
+
), [ee, oe] = $(I), O = s.forwardRef(
|
|
16
|
+
(e, r) => /* @__PURE__ */ d(P.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d(P.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d(te, { ...e, ref: r }) }) })
|
|
17
|
+
);
|
|
18
|
+
O.displayName = I;
|
|
19
|
+
var te = s.forwardRef((e, r) => {
|
|
20
|
+
const {
|
|
21
|
+
__scopeRovingFocusGroup: c,
|
|
22
|
+
orientation: o,
|
|
23
|
+
loop: T = !1,
|
|
24
|
+
dir: w,
|
|
25
|
+
currentTabStopId: v,
|
|
26
|
+
defaultCurrentTabStopId: C,
|
|
27
|
+
onCurrentTabStopIdChange: S,
|
|
28
|
+
onEntryFocus: m,
|
|
29
|
+
preventScrollOnEntryFocus: a = !1,
|
|
30
|
+
...b
|
|
31
|
+
} = e, F = s.useRef(null), g = j(r, F), R = W(w), [E, t] = Q({
|
|
32
|
+
prop: v,
|
|
33
|
+
defaultProp: C ?? null,
|
|
34
|
+
onChange: S,
|
|
35
|
+
caller: I
|
|
36
|
+
}), [i, h] = s.useState(!1), u = J(m), l = N(c), A = s.useRef(!1), [L, D] = s.useState(0);
|
|
37
|
+
return s.useEffect(() => {
|
|
38
|
+
const n = F.current;
|
|
39
|
+
if (n)
|
|
40
|
+
return n.addEventListener(y, u), () => n.removeEventListener(y, u);
|
|
41
|
+
}, [u]), /* @__PURE__ */ d(
|
|
42
|
+
ee,
|
|
43
|
+
{
|
|
44
|
+
scope: c,
|
|
45
|
+
orientation: o,
|
|
46
|
+
dir: R,
|
|
47
|
+
loop: T,
|
|
48
|
+
currentTabStopId: E,
|
|
49
|
+
onItemFocus: s.useCallback(
|
|
50
|
+
(n) => t(n),
|
|
51
|
+
[t]
|
|
52
|
+
),
|
|
53
|
+
onItemShiftTab: s.useCallback(() => h(!0), []),
|
|
54
|
+
onFocusableItemAdd: s.useCallback(
|
|
55
|
+
() => D((n) => n + 1),
|
|
56
|
+
[]
|
|
57
|
+
),
|
|
58
|
+
onFocusableItemRemove: s.useCallback(
|
|
59
|
+
() => D((n) => n - 1),
|
|
60
|
+
[]
|
|
61
|
+
),
|
|
62
|
+
children: /* @__PURE__ */ d(
|
|
63
|
+
G.div,
|
|
64
|
+
{
|
|
65
|
+
tabIndex: i || L === 0 ? -1 : 0,
|
|
66
|
+
"data-orientation": o,
|
|
67
|
+
...b,
|
|
68
|
+
ref: g,
|
|
69
|
+
style: { outline: "none", ...e.style },
|
|
70
|
+
onMouseDown: p(e.onMouseDown, () => {
|
|
71
|
+
A.current = !0;
|
|
72
|
+
}),
|
|
73
|
+
onFocus: p(e.onFocus, (n) => {
|
|
74
|
+
const U = !A.current;
|
|
75
|
+
if (n.target === n.currentTarget && U && !i) {
|
|
76
|
+
const x = new CustomEvent(y, X);
|
|
77
|
+
if (n.currentTarget.dispatchEvent(x), !x.defaultPrevented) {
|
|
78
|
+
const _ = l().filter((f) => f.focusable), B = _.find((f) => f.active), Y = _.find((f) => f.id === E), H = [B, Y, ..._].filter(
|
|
79
|
+
Boolean
|
|
80
|
+
).map((f) => f.ref.current);
|
|
81
|
+
k(H, a);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
A.current = !1;
|
|
85
|
+
}),
|
|
86
|
+
onBlur: p(e.onBlur, () => h(!1))
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
}), K = "RovingFocusGroupItem", M = s.forwardRef(
|
|
92
|
+
(e, r) => {
|
|
93
|
+
const {
|
|
94
|
+
__scopeRovingFocusGroup: c,
|
|
95
|
+
focusable: o = !0,
|
|
96
|
+
active: T = !1,
|
|
97
|
+
tabStopId: w,
|
|
98
|
+
children: v,
|
|
99
|
+
...C
|
|
100
|
+
} = e, S = q(), m = w || S, a = oe(K, c), b = a.currentTabStopId === m, F = N(c), { onFocusableItemAdd: g, onFocusableItemRemove: R, currentTabStopId: E } = a;
|
|
101
|
+
return s.useEffect(() => {
|
|
102
|
+
if (o)
|
|
103
|
+
return g(), () => R();
|
|
104
|
+
}, [o, g, R]), /* @__PURE__ */ d(
|
|
105
|
+
P.ItemSlot,
|
|
106
|
+
{
|
|
107
|
+
scope: c,
|
|
108
|
+
id: m,
|
|
109
|
+
focusable: o,
|
|
110
|
+
active: T,
|
|
111
|
+
children: /* @__PURE__ */ d(
|
|
112
|
+
G.span,
|
|
113
|
+
{
|
|
114
|
+
tabIndex: b ? 0 : -1,
|
|
115
|
+
"data-orientation": a.orientation,
|
|
116
|
+
...C,
|
|
117
|
+
ref: r,
|
|
118
|
+
onMouseDown: p(e.onMouseDown, (t) => {
|
|
119
|
+
o ? a.onItemFocus(m) : t.preventDefault();
|
|
120
|
+
}),
|
|
121
|
+
onFocus: p(e.onFocus, () => a.onItemFocus(m)),
|
|
122
|
+
onKeyDown: p(e.onKeyDown, (t) => {
|
|
123
|
+
if (t.key === "Tab" && t.shiftKey) {
|
|
124
|
+
a.onItemShiftTab();
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
if (t.target !== t.currentTarget) return;
|
|
128
|
+
const i = se(t, a.orientation, a.dir);
|
|
129
|
+
if (i !== void 0) {
|
|
130
|
+
if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey) return;
|
|
131
|
+
t.preventDefault();
|
|
132
|
+
let u = F().filter((l) => l.focusable).map((l) => l.ref.current);
|
|
133
|
+
if (i === "last") u.reverse();
|
|
134
|
+
else if (i === "prev" || i === "next") {
|
|
135
|
+
i === "prev" && u.reverse();
|
|
136
|
+
const l = u.indexOf(t.currentTarget);
|
|
137
|
+
u = a.loop ? ce(u, l + 1) : u.slice(l + 1);
|
|
138
|
+
}
|
|
139
|
+
setTimeout(() => k(u));
|
|
140
|
+
}
|
|
141
|
+
}),
|
|
142
|
+
children: typeof v == "function" ? v({ isCurrentTabStop: b, hasTabStop: E != null }) : v
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
);
|
|
149
|
+
M.displayName = K;
|
|
150
|
+
var re = {
|
|
151
|
+
ArrowLeft: "prev",
|
|
152
|
+
ArrowUp: "prev",
|
|
153
|
+
ArrowRight: "next",
|
|
154
|
+
ArrowDown: "next",
|
|
155
|
+
PageUp: "first",
|
|
156
|
+
Home: "first",
|
|
157
|
+
PageDown: "last",
|
|
158
|
+
End: "last"
|
|
159
|
+
};
|
|
160
|
+
function ne(e, r) {
|
|
161
|
+
return r !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
|
|
162
|
+
}
|
|
163
|
+
function se(e, r, c) {
|
|
164
|
+
const o = ne(e.key, c);
|
|
165
|
+
if (!(r === "vertical" && ["ArrowLeft", "ArrowRight"].includes(o)) && !(r === "horizontal" && ["ArrowUp", "ArrowDown"].includes(o)))
|
|
166
|
+
return re[o];
|
|
167
|
+
}
|
|
168
|
+
function k(e, r = !1) {
|
|
169
|
+
const c = document.activeElement;
|
|
170
|
+
for (const o of e)
|
|
171
|
+
if (o === c || (o.focus({ preventScroll: r }), document.activeElement !== c)) return;
|
|
172
|
+
}
|
|
173
|
+
function ce(e, r) {
|
|
174
|
+
return e.map((c, o) => e[(r + o) % e.length]);
|
|
175
|
+
}
|
|
176
|
+
var ge = O, Re = M;
|
|
177
|
+
export {
|
|
178
|
+
Re as I,
|
|
179
|
+
ge as R,
|
|
180
|
+
Fe as c
|
|
181
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as n from "react";
|
|
2
|
+
import { u as v } from "./index-DuekHEmj.js";
|
|
3
|
+
var E = n[" useInsertionEffect ".trim().toString()] || v;
|
|
4
|
+
function $({
|
|
5
|
+
prop: t,
|
|
6
|
+
defaultProp: u,
|
|
7
|
+
onChange: o = () => {
|
|
8
|
+
},
|
|
9
|
+
caller: i
|
|
10
|
+
}) {
|
|
11
|
+
const [l, e, r] = w({
|
|
12
|
+
defaultProp: u,
|
|
13
|
+
onChange: o
|
|
14
|
+
}), c = t !== void 0, a = c ? t : l;
|
|
15
|
+
{
|
|
16
|
+
const s = n.useRef(t !== void 0);
|
|
17
|
+
n.useEffect(() => {
|
|
18
|
+
const f = s.current;
|
|
19
|
+
f !== c && console.warn(
|
|
20
|
+
`${i} is changing from ${f ? "controlled" : "uncontrolled"} to ${c ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
|
|
21
|
+
), s.current = c;
|
|
22
|
+
}, [c, i]);
|
|
23
|
+
}
|
|
24
|
+
const m = n.useCallback(
|
|
25
|
+
(s) => {
|
|
26
|
+
var f;
|
|
27
|
+
if (c) {
|
|
28
|
+
const d = R(s) ? s(t) : s;
|
|
29
|
+
d !== t && ((f = r.current) == null || f.call(r, d));
|
|
30
|
+
} else
|
|
31
|
+
e(s);
|
|
32
|
+
},
|
|
33
|
+
[c, t, e, r]
|
|
34
|
+
);
|
|
35
|
+
return [a, m];
|
|
36
|
+
}
|
|
37
|
+
function w({
|
|
38
|
+
defaultProp: t,
|
|
39
|
+
onChange: u
|
|
40
|
+
}) {
|
|
41
|
+
const [o, i] = n.useState(t), l = n.useRef(o), e = n.useRef(u);
|
|
42
|
+
return E(() => {
|
|
43
|
+
e.current = u;
|
|
44
|
+
}, [u]), n.useEffect(() => {
|
|
45
|
+
var r;
|
|
46
|
+
l.current !== o && ((r = e.current) == null || r.call(e, o), l.current = o);
|
|
47
|
+
}, [o, l]), [o, i, e];
|
|
48
|
+
}
|
|
49
|
+
function R(t) {
|
|
50
|
+
return typeof t == "function";
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
$ as u
|
|
54
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { a as O } from "./utils-Dy2WjYNJ.js";
|
|
2
|
+
const m = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, y = O, j = (e, l) => (n) => {
|
|
3
|
+
var u;
|
|
4
|
+
if ((l == null ? void 0 : l.variants) == null) return y(e, n == null ? void 0 : n.class, n == null ? void 0 : n.className);
|
|
5
|
+
const { variants: r, defaultVariants: d } = l, V = Object.keys(r).map((t) => {
|
|
6
|
+
const a = n == null ? void 0 : n[t], s = d == null ? void 0 : d[t];
|
|
7
|
+
if (a === null) return null;
|
|
8
|
+
const i = m(a) || m(s);
|
|
9
|
+
return r[t][i];
|
|
10
|
+
}), v = n && Object.entries(n).reduce((t, a) => {
|
|
11
|
+
let [s, i] = a;
|
|
12
|
+
return i === void 0 || (t[s] = i), t;
|
|
13
|
+
}, {}), N = l == null || (u = l.compoundVariants) === null || u === void 0 ? void 0 : u.reduce((t, a) => {
|
|
14
|
+
let { class: s, className: i, ...f } = a;
|
|
15
|
+
return Object.entries(f).every((C) => {
|
|
16
|
+
let [c, o] = C;
|
|
17
|
+
return Array.isArray(o) ? o.includes({
|
|
18
|
+
...d,
|
|
19
|
+
...v
|
|
20
|
+
}[c]) : {
|
|
21
|
+
...d,
|
|
22
|
+
...v
|
|
23
|
+
}[c] === o;
|
|
24
|
+
}) ? [
|
|
25
|
+
...t,
|
|
26
|
+
s,
|
|
27
|
+
i
|
|
28
|
+
] : t;
|
|
29
|
+
}, []);
|
|
30
|
+
return y(e, V, N, n == null ? void 0 : n.class, n == null ? void 0 : n.className);
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
j as c
|
|
34
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as r from "react";
|
|
2
|
+
function n(t) {
|
|
3
|
+
const e = r.useRef(t);
|
|
4
|
+
return r.useEffect(() => {
|
|
5
|
+
e.current = t;
|
|
6
|
+
}), r.useMemo(() => (...s) => {
|
|
7
|
+
var u;
|
|
8
|
+
return (u = e.current) == null ? void 0 : u.call(e, ...s);
|
|
9
|
+
}, []);
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
n as u
|
|
13
|
+
};
|