@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.
Files changed (109) hide show
  1. package/README.md +128 -0
  2. package/dist/check-CxcShTlQ.js +11 -0
  3. package/dist/chevron-down-D_a-ccxi.js +11 -0
  4. package/dist/chevron-right-DriXIqe5.js +11 -0
  5. package/dist/components/index.d.ts +1 -0
  6. package/dist/components/index.js +195 -0
  7. package/dist/components/ui/atoms/accordion.d.ts +7 -0
  8. package/dist/components/ui/atoms/accordion.js +289 -0
  9. package/dist/components/ui/atoms/alert.d.ts +9 -0
  10. package/dist/components/ui/atoms/alert.js +66 -0
  11. package/dist/components/ui/atoms/avatar.d.ts +6 -0
  12. package/dist/components/ui/atoms/avatar.js +130 -0
  13. package/dist/components/ui/atoms/badge.d.ts +9 -0
  14. package/dist/components/ui/atoms/badge.js +41 -0
  15. package/dist/components/ui/atoms/breadcrumb.d.ts +11 -0
  16. package/dist/components/ui/atoms/breadcrumb.js +115 -0
  17. package/dist/components/ui/atoms/button.d.ts +10 -0
  18. package/dist/components/ui/atoms/button.js +51 -0
  19. package/dist/components/ui/atoms/card.d.ts +9 -0
  20. package/dist/components/ui/atoms/card.js +90 -0
  21. package/dist/components/ui/atoms/chart.d.ts +68 -0
  22. package/dist/components/ui/atoms/chart.js +10477 -0
  23. package/dist/components/ui/atoms/collapsible.d.ts +5 -0
  24. package/dist/components/ui/atoms/collapsible.js +34 -0
  25. package/dist/components/ui/atoms/command.d.ts +18 -0
  26. package/dist/components/ui/atoms/command.js +490 -0
  27. package/dist/components/ui/atoms/dialog.d.ts +15 -0
  28. package/dist/components/ui/atoms/dialog.js +135 -0
  29. package/dist/components/ui/atoms/dropdown-menu.d.ts +25 -0
  30. package/dist/components/ui/atoms/dropdown-menu.js +1035 -0
  31. package/dist/components/ui/atoms/form.d.ts +24 -0
  32. package/dist/components/ui/atoms/form.js +297 -0
  33. package/dist/components/ui/atoms/hover-card.d.ts +6 -0
  34. package/dist/components/ui/atoms/hover-card.js +211 -0
  35. package/dist/components/ui/atoms/index.d.ts +33 -0
  36. package/dist/components/ui/atoms/index.js +195 -0
  37. package/dist/components/ui/atoms/input.d.ts +3 -0
  38. package/dist/components/ui/atoms/input.js +21 -0
  39. package/dist/components/ui/atoms/label.d.ts +4 -0
  40. package/dist/components/ui/atoms/label.js +36 -0
  41. package/dist/components/ui/atoms/popover.d.ts +7 -0
  42. package/dist/components/ui/atoms/popover.js +266 -0
  43. package/dist/components/ui/atoms/progress.d.ts +4 -0
  44. package/dist/components/ui/atoms/progress.js +107 -0
  45. package/dist/components/ui/atoms/resizable.d.ts +8 -0
  46. package/dist/components/ui/atoms/resizable.js +1564 -0
  47. package/dist/components/ui/atoms/scroll-area.d.ts +5 -0
  48. package/dist/components/ui/atoms/scroll-area.js +580 -0
  49. package/dist/components/ui/atoms/select.d.ts +15 -0
  50. package/dist/components/ui/atoms/select.js +1000 -0
  51. package/dist/components/ui/atoms/separator.d.ts +4 -0
  52. package/dist/components/ui/atoms/separator.js +44 -0
  53. package/dist/components/ui/atoms/sheet.d.ts +14 -0
  54. package/dist/components/ui/atoms/sheet.js +127 -0
  55. package/dist/components/ui/atoms/sidebar.d.ts +69 -0
  56. package/dist/components/ui/atoms/sidebar.js +602 -0
  57. package/dist/components/ui/atoms/skeleton.d.ts +2 -0
  58. package/dist/components/ui/atoms/skeleton.js +15 -0
  59. package/dist/components/ui/atoms/slider.d.ts +4 -0
  60. package/dist/components/ui/atoms/slider.js +484 -0
  61. package/dist/components/ui/atoms/sonner.d.ts +3 -0
  62. package/dist/components/ui/atoms/sonner.js +788 -0
  63. package/dist/components/ui/atoms/switch.d.ts +4 -0
  64. package/dist/components/ui/atoms/switch.js +155 -0
  65. package/dist/components/ui/atoms/table.d.ts +10 -0
  66. package/dist/components/ui/atoms/table.js +114 -0
  67. package/dist/components/ui/atoms/tabs.d.ts +7 -0
  68. package/dist/components/ui/atoms/tabs.js +218 -0
  69. package/dist/components/ui/atoms/textarea.d.ts +3 -0
  70. package/dist/components/ui/atoms/textarea.js +18 -0
  71. package/dist/components/ui/atoms/toggle.d.ts +9 -0
  72. package/dist/components/ui/atoms/toggle.js +70 -0
  73. package/dist/components/ui/atoms/tooltip.d.ts +7 -0
  74. package/dist/components/ui/atoms/tooltip.js +376 -0
  75. package/dist/components/ui/index.d.ts +1 -0
  76. package/dist/components/ui/index.js +195 -0
  77. package/dist/createLucideIcon-B6fy1GTR.js +94 -0
  78. package/dist/hooks/use-mobile.d.ts +1 -0
  79. package/dist/hooks/use-mobile.js +14 -0
  80. package/dist/index-BAhNQL1u.js +675 -0
  81. package/dist/index-BZPx6jYI.js +8 -0
  82. package/dist/index-ByaXH_ih.js +10 -0
  83. package/dist/index-C9KW2H79.js +36 -0
  84. package/dist/index-CB1Wkg0G.js +83 -0
  85. package/dist/index-CHDs-SiB.js +27 -0
  86. package/dist/index-CJFGOBPb.js +122 -0
  87. package/dist/index-CL4N9wMT.js +259 -0
  88. package/dist/index-CuMpq4Un.js +47 -0
  89. package/dist/index-CxK6rt_N.js +119 -0
  90. package/dist/index-D2uXV4lz.js +181 -0
  91. package/dist/index-DLeNytVF.js +9 -0
  92. package/dist/index-DYfkNB0n.js +54 -0
  93. package/dist/index-DdnpnyX2.js +34 -0
  94. package/dist/index-DuekHEmj.js +6 -0
  95. package/dist/index-DwYXX2sM.js +13 -0
  96. package/dist/index-Dy7YuPrV.js +1532 -0
  97. package/dist/index-QMp1pYFl.js +145 -0
  98. package/dist/index-UFb2E87s.js +70 -0
  99. package/dist/index-nluJZSbA.js +31 -0
  100. package/dist/index-p7nYL7BU.js +71 -0
  101. package/dist/index-rKs9bXHr.js +6 -0
  102. package/dist/index-umR1UobZ.js +13 -0
  103. package/dist/index.css +2 -0
  104. package/dist/lib/utils.d.ts +2 -0
  105. package/dist/lib/utils.js +4 -0
  106. package/dist/main.d.ts +1 -0
  107. package/dist/main.js +195 -0
  108. package/dist/utils-Dy2WjYNJ.js +2744 -0
  109. 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,9 @@
1
+ function h(f, c, { checkForDefaultPrevented: p = !0 } = {}) {
2
+ return function(s) {
3
+ if (f == null || f(s), p === !1 || !s.defaultPrevented)
4
+ return c == null ? void 0 : c(s);
5
+ };
6
+ }
7
+ export {
8
+ h as c
9
+ };
@@ -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,6 @@
1
+ import * as t from "react";
2
+ var a = globalThis != null && globalThis.document ? t.useLayoutEffect : () => {
3
+ };
4
+ export {
5
+ a as u
6
+ };
@@ -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
+ };