@arcadeai/design-system 0.4.0 → 0.5.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.
@@ -1,5 +1,7 @@
1
1
  import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
2
2
  import type * as React from 'react';
3
- declare function ScrollArea({ className, children, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
3
+ declare function ScrollArea({ className, children, viewPortClassName, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.Root> & {
4
+ viewPortClassName?: string;
5
+ }): import("react/jsx-runtime").JSX.Element;
4
6
  declare function ScrollBar({ className, orientation, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>): import("react/jsx-runtime").JSX.Element;
5
7
  export { ScrollArea, ScrollBar };
@@ -1,4 +1,4 @@
1
- import { jsx as b, jsxs as $, Fragment as se } from "react/jsx-runtime";
1
+ import { jsx as b, jsxs as j, Fragment as se } from "react/jsx-runtime";
2
2
  import * as c from "react";
3
3
  import { P as L } from "../../../index-C9KW2H79.js";
4
4
  import { P as I } from "../../../index-p7nYL7BU.js";
@@ -9,11 +9,11 @@ import { u as ie } from "../../../index-ByaXH_ih.js";
9
9
  import { u as de } from "../../../index-DuekHEmj.js";
10
10
  import { c as ue } from "../../../index-rKs9bXHr.js";
11
11
  import { c as R } from "../../../index-DLeNytVF.js";
12
- import { c as j } from "../../../utils-Dy2WjYNJ.js";
12
+ import { c as V } from "../../../utils-Dy2WjYNJ.js";
13
13
  function fe(e, o) {
14
14
  return c.useReducer((r, l) => o[r][l] ?? r, e);
15
15
  }
16
- var V = "ScrollArea", [q, Ye] = ae(V), [he, v] = q(V), G = c.forwardRef(
16
+ var B = "ScrollArea", [q, Ye] = ae(B), [he, v] = q(B), G = c.forwardRef(
17
17
  (e, o) => {
18
18
  const {
19
19
  __scopeScrollArea: r,
@@ -63,11 +63,11 @@ var V = "ScrollArea", [q, Ye] = ae(V), [he, v] = q(V), G = c.forwardRef(
63
63
  );
64
64
  }
65
65
  );
66
- G.displayName = V;
66
+ G.displayName = B;
67
67
  var J = "ScrollAreaViewport", K = c.forwardRef(
68
68
  (e, o) => {
69
69
  const { __scopeScrollArea: r, children: l, nonce: t, ...n } = e, s = v(J, r), a = c.useRef(null), i = T(o, a, s.onViewportChange);
70
- return /* @__PURE__ */ $(se, { children: [
70
+ return /* @__PURE__ */ j(se, { children: [
71
71
  /* @__PURE__ */ b(
72
72
  "style",
73
73
  {
@@ -111,7 +111,7 @@ var g = "ScrollAreaScrollbar", Q = c.forwardRef(
111
111
  const { forceMount: r, ...l } = e, t = v(g, e.__scopeScrollArea), { onScrollbarXEnabledChange: n, onScrollbarYEnabledChange: s } = t, a = e.orientation === "horizontal";
112
112
  return c.useEffect(() => (a ? n(!0) : s(!0), () => {
113
113
  a ? n(!1) : s(!1);
114
- }), [a, n, s]), t.type === "hover" ? /* @__PURE__ */ b(be, { ...l, ref: o, forceMount: r }) : t.type === "scroll" ? /* @__PURE__ */ b(me, { ...l, ref: o, forceMount: r }) : t.type === "auto" ? /* @__PURE__ */ b(Z, { ...l, ref: o, forceMount: r }) : t.type === "always" ? /* @__PURE__ */ b(B, { ...l, ref: o }) : null;
114
+ }), [a, n, s]), t.type === "hover" ? /* @__PURE__ */ b(be, { ...l, ref: o, forceMount: r }) : t.type === "scroll" ? /* @__PURE__ */ b(me, { ...l, ref: o, forceMount: r }) : t.type === "auto" ? /* @__PURE__ */ b(Z, { ...l, ref: o, forceMount: r }) : t.type === "always" ? /* @__PURE__ */ b(k, { ...l, ref: o }) : null;
115
115
  }
116
116
  );
117
117
  Q.displayName = g;
@@ -173,7 +173,7 @@ var be = c.forwardRef((e, o) => {
173
173
  return f.addEventListener("scroll", u), () => f.removeEventListener("scroll", u);
174
174
  }
175
175
  }, [t.viewport, n, i, s]), /* @__PURE__ */ b(I, { present: r || a !== "hidden", children: /* @__PURE__ */ b(
176
- B,
176
+ k,
177
177
  {
178
178
  "data-state": a === "hidden" ? "hidden" : "visible",
179
179
  ...l,
@@ -190,14 +190,14 @@ var be = c.forwardRef((e, o) => {
190
190
  }
191
191
  }, 10);
192
192
  return A(r.viewport, i), A(r.content, i), /* @__PURE__ */ b(I, { present: l || n, children: /* @__PURE__ */ b(
193
- B,
193
+ k,
194
194
  {
195
195
  "data-state": n ? "visible" : "hidden",
196
196
  ...t,
197
197
  ref: o
198
198
  }
199
199
  ) });
200
- }), B = c.forwardRef((e, o) => {
200
+ }), k = c.forwardRef((e, o) => {
201
201
  const { orientation: r = "vertical", ...l } = e, t = v(g, e.__scopeScrollArea), n = c.useRef(null), s = c.useRef(0), [a, i] = c.useState({
202
202
  content: 0,
203
203
  viewport: 0,
@@ -221,7 +221,7 @@ var be = c.forwardRef((e, o) => {
221
221
  ref: o,
222
222
  onThumbPositionChange: () => {
223
223
  if (t.viewport && n.current) {
224
- const u = t.viewport.scrollLeft, m = F(u, a, t.dir);
224
+ const u = t.viewport.scrollLeft, m = $(u, a, t.dir);
225
225
  n.current.style.transform = `translate3d(${m}px, 0, 0)`;
226
226
  }
227
227
  },
@@ -239,7 +239,7 @@ var be = c.forwardRef((e, o) => {
239
239
  ref: o,
240
240
  onThumbPositionChange: () => {
241
241
  if (t.viewport && n.current) {
242
- const u = t.viewport.scrollTop, m = F(u, a);
242
+ const u = t.viewport.scrollTop, m = $(u, a);
243
243
  n.current.style.transform = `translate3d(0, ${m}px, 0)`;
244
244
  }
245
245
  },
@@ -429,15 +429,15 @@ var be = c.forwardRef((e, o) => {
429
429
  }
430
430
  );
431
431
  oe.displayName = z;
432
- var k = "ScrollAreaCorner", te = c.forwardRef(
432
+ var F = "ScrollAreaCorner", te = c.forwardRef(
433
433
  (e, o) => {
434
- const r = v(k, e.__scopeScrollArea), l = !!(r.scrollbarX && r.scrollbarY);
434
+ const r = v(F, e.__scopeScrollArea), l = !!(r.scrollbarX && r.scrollbarY);
435
435
  return r.type !== "scroll" && l ? /* @__PURE__ */ b(ge, { ...e, ref: o }) : null;
436
436
  }
437
437
  );
438
- te.displayName = k;
438
+ te.displayName = F;
439
439
  var ge = c.forwardRef((e, o) => {
440
- const { __scopeScrollArea: r, ...l } = e, t = v(k, r), [n, s] = c.useState(0), [a, i] = c.useState(0), f = !!(n && a);
440
+ const { __scopeScrollArea: r, ...l } = e, t = v(F, r), [n, s] = c.useState(0), [a, i] = c.useState(0), f = !!(n && a);
441
441
  return A(t.scrollbarX, () => {
442
442
  var h;
443
443
  const d = ((h = t.scrollbarX) == null ? void 0 : h.offsetHeight) || 0;
@@ -478,7 +478,7 @@ function Pe(e, o, r, l = "ltr") {
478
478
  const t = X(r), n = t / 2, s = o || n, a = t - s, i = r.scrollbar.paddingStart + s, f = r.scrollbar.size - r.scrollbar.paddingEnd - a, d = r.content - r.viewport, h = l === "ltr" ? [0, d] : [d * -1, 0];
479
479
  return le([i, f], h)(e);
480
480
  }
481
- function F(e, o, r = "ltr") {
481
+ function $(e, o, r = "ltr") {
482
482
  const l = X(o), t = o.scrollbar.paddingStart + o.scrollbar.paddingEnd, n = o.scrollbar.size - t, s = o.content - o.viewport, a = n - l, i = r === "ltr" ? [0, s] : [s * -1, 0], f = ue(e, i);
483
483
  return le([0, s], [0, a])(f);
484
484
  }
@@ -524,19 +524,23 @@ var Re = G, Ee = K, Ae = te;
524
524
  function Me({
525
525
  className: e,
526
526
  children: o,
527
- ...r
527
+ viewPortClassName: r,
528
+ ...l
528
529
  }) {
529
- return /* @__PURE__ */ $(
530
+ return /* @__PURE__ */ j(
530
531
  Re,
531
532
  {
532
- className: j("relative", e),
533
+ className: V("relative", e),
533
534
  "data-slot": "scroll-area",
534
- ...r,
535
+ ...l,
535
536
  children: [
536
537
  /* @__PURE__ */ b(
537
538
  Ee,
538
539
  {
539
- className: "size-full rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:outline-1 focus-visible:ring-[3px] focus-visible:ring-ring/50",
540
+ className: V(
541
+ "size-full rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:outline-1 focus-visible:ring-[3px] focus-visible:ring-ring/50",
542
+ r
543
+ ),
540
544
  "data-slot": "scroll-area-viewport",
541
545
  children: o
542
546
  }
@@ -555,7 +559,7 @@ function Te({
555
559
  return /* @__PURE__ */ b(
556
560
  Q,
557
561
  {
558
- className: j(
562
+ className: V(
559
563
  "flex touch-none select-none p-px transition-colors",
560
564
  o === "vertical" && "h-full w-2.5 border-l border-l-transparent",
561
565
  o === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
@@ -1,5 +1,5 @@
1
- import type * as React from 'react';
2
- declare function Table({ className, ...props }: React.ComponentProps<'table'>): import("react/jsx-runtime").JSX.Element;
1
+ import * as React from 'react';
2
+ declare const Table: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableElement> & React.RefAttributes<HTMLTableElement>>;
3
3
  declare function TableHeader({ className, ...props }: React.ComponentProps<'thead'>): import("react/jsx-runtime").JSX.Element;
4
4
  declare function TableBody({ className, ...props }: React.ComponentProps<'tbody'>): import("react/jsx-runtime").JSX.Element;
5
5
  declare function TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>): import("react/jsx-runtime").JSX.Element;
@@ -1,23 +1,20 @@
1
- import { jsx as a } from "react/jsx-runtime";
1
+ import { jsxs as l, jsx as a } from "react/jsx-runtime";
2
+ import * as s from "react";
2
3
  import { c as o } from "../../../utils-Dy2WjYNJ.js";
3
- function n({ className: t, ...e }) {
4
- return /* @__PURE__ */ a(
5
- "div",
4
+ import { ScrollArea as n, ScrollBar as c } from "./scroll-area.js";
5
+ const d = s.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ l(n, { className: "relative w-full", viewPortClassName: "px-0", children: [
6
+ /* @__PURE__ */ a(
7
+ "table",
6
8
  {
7
- className: "relative w-full overflow-x-auto",
8
- "data-slot": "table-container",
9
- children: /* @__PURE__ */ a(
10
- "table",
11
- {
12
- className: o("w-full caption-bottom text-sm", t),
13
- "data-slot": "table",
14
- ...e
15
- }
16
- )
9
+ className: o("w-full caption-bottom text-sm", t),
10
+ ref: r,
11
+ ...e
17
12
  }
18
- );
19
- }
20
- function s({ className: t, ...e }) {
13
+ ),
14
+ /* @__PURE__ */ a(c, { orientation: "horizontal" })
15
+ ] }));
16
+ d.displayName = "Table";
17
+ function u({ className: t, ...e }) {
21
18
  return /* @__PURE__ */ a(
22
19
  "thead",
23
20
  {
@@ -27,7 +24,7 @@ function s({ className: t, ...e }) {
27
24
  }
28
25
  );
29
26
  }
30
- function d({ className: t, ...e }) {
27
+ function f({ className: t, ...e }) {
31
28
  return /* @__PURE__ */ a(
32
29
  "tbody",
33
30
  {
@@ -37,7 +34,7 @@ function d({ className: t, ...e }) {
37
34
  }
38
35
  );
39
36
  }
40
- function c({ className: t, ...e }) {
37
+ function p({ className: t, ...e }) {
41
38
  return /* @__PURE__ */ a(
42
39
  "tfoot",
43
40
  {
@@ -50,7 +47,7 @@ function c({ className: t, ...e }) {
50
47
  }
51
48
  );
52
49
  }
53
- function b({ className: t, ...e }) {
50
+ function h({ className: t, ...e }) {
54
51
  return /* @__PURE__ */ a(
55
52
  "tr",
56
53
  {
@@ -63,12 +60,12 @@ function b({ className: t, ...e }) {
63
60
  }
64
61
  );
65
62
  }
66
- function i({ className: t, ...e }) {
63
+ function x({ className: t, ...e }) {
67
64
  return /* @__PURE__ */ a(
68
65
  "th",
69
66
  {
70
67
  className: o(
71
- "h-10 whitespace-nowrap px-2 text-left align-middle font-medium text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
68
+ "h-10 whitespace-nowrap px-4 text-left align-middle font-medium text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
72
69
  t
73
70
  ),
74
71
  "data-slot": "table-head",
@@ -76,12 +73,12 @@ function i({ className: t, ...e }) {
76
73
  }
77
74
  );
78
75
  }
79
- function m({ className: t, ...e }) {
76
+ function N({ className: t, ...e }) {
80
77
  return /* @__PURE__ */ a(
81
78
  "td",
82
79
  {
83
80
  className: o(
84
- "whitespace-nowrap p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
81
+ "whitespace-nowrap px-4 py-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
85
82
  t
86
83
  ),
87
84
  "data-slot": "table-cell",
@@ -89,7 +86,7 @@ function m({ className: t, ...e }) {
89
86
  }
90
87
  );
91
88
  }
92
- function u({
89
+ function w({
93
90
  className: t,
94
91
  ...e
95
92
  }) {
@@ -103,12 +100,12 @@ function u({
103
100
  );
104
101
  }
105
102
  export {
106
- n as Table,
107
- d as TableBody,
108
- u as TableCaption,
109
- m as TableCell,
110
- c as TableFooter,
111
- i as TableHead,
112
- s as TableHeader,
113
- b as TableRow
103
+ d as Table,
104
+ f as TableBody,
105
+ w as TableCaption,
106
+ N as TableCell,
107
+ p as TableFooter,
108
+ x as TableHead,
109
+ u as TableHeader,
110
+ h as TableRow
114
111
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arcadeai/design-system",
3
3
  "private": false,
4
- "version": "0.4.0",
4
+ "version": "0.5.0",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
7
7
  "types": "dist/main.d.ts",