laif-ds 0.1.5 → 0.1.6

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 (42) hide show
  1. package/dist/components/ui/data-table.js +122 -0
  2. package/dist/components/ui/toaster.js +26 -0
  3. package/dist/dist/_virtual/jsx-runtime.js +6 -0
  4. package/dist/dist/_virtual/jsx-runtime2.js +5 -0
  5. package/dist/dist/_virtual/react-jsx-runtime.development.js +5 -0
  6. package/dist/dist/_virtual/react-jsx-runtime.production.js +5 -0
  7. package/dist/dist/components/ui/checkbox.js +32 -0
  8. package/dist/dist/components/ui/scroll-area.js +61 -0
  9. package/dist/dist/components/ui/table.js +87 -0
  10. package/dist/dist/lib/utils.js +9 -0
  11. package/dist/dist/node_modules/@radix-ui/number/dist/index.js +7 -0
  12. package/dist/dist/node_modules/@radix-ui/primitive/dist/index.js +10 -0
  13. package/dist/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +136 -0
  14. package/dist/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +30 -0
  15. package/dist/dist/node_modules/@radix-ui/react-context/dist/index.js +56 -0
  16. package/dist/dist/node_modules/@radix-ui/react-direction/dist/index.js +10 -0
  17. package/dist/dist/node_modules/@radix-ui/react-presence/dist/index.js +72 -0
  18. package/dist/dist/node_modules/@radix-ui/react-primitive/dist/index.js +32 -0
  19. package/dist/dist/node_modules/@radix-ui/react-scroll-area/dist/index.js +534 -0
  20. package/dist/dist/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
  21. package/dist/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +14 -0
  22. package/dist/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +33 -0
  23. package/dist/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +7 -0
  24. package/dist/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +9 -0
  25. package/dist/dist/node_modules/@radix-ui/react-use-size/dist/index.js +28 -0
  26. package/dist/dist/node_modules/clsx/dist/clsx.js +18 -0
  27. package/dist/dist/node_modules/lucide-react/dist/esm/Icon.js +41 -0
  28. package/dist/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +28 -0
  29. package/dist/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +21 -0
  30. package/dist/dist/node_modules/lucide-react/dist/esm/icons/check.js +13 -0
  31. package/dist/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js +20 -0
  32. package/dist/dist/node_modules/react/cjs/react-jsx-runtime.development.js +248 -0
  33. package/dist/dist/node_modules/react/cjs/react-jsx-runtime.production.js +36 -0
  34. package/dist/dist/node_modules/react/jsx-runtime.js +11 -0
  35. package/dist/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +2732 -0
  36. package/dist/index.d.ts +23 -1
  37. package/dist/index.js +164 -162
  38. package/dist/node_modules/@tanstack/react-table/build/lib/index.js +103 -0
  39. package/dist/node_modules/@tanstack/table-core/build/lib/index.js +1896 -0
  40. package/dist/styles.css +1 -1
  41. package/package.json +9 -7
  42. package/dist/components/ui/sonner.js +0 -23
@@ -0,0 +1,122 @@
1
+ "use client";
2
+ import { j as e } from "../../_virtual/jsx-runtime.js";
3
+ import { useReactTable as $, flexRender as x } from "../../node_modules/@tanstack/react-table/build/lib/index.js";
4
+ import { Checkbox as h } from "../../dist/components/ui/checkbox.js";
5
+ import { ScrollArea as A, ScrollBar as f } from "../../dist/components/ui/scroll-area.js";
6
+ import { Table as H, TableHeader as V, TableRow as a, TableHead as I, TableBody as B, TableCell as n } from "../../dist/components/ui/table.js";
7
+ import E, { useState as c, useEffect as _ } from "react";
8
+ import { getFilteredRowModel as L, getSortedRowModel as W, getPaginationRowModel as q, getCoreRowModel as G } from "../../node_modules/@tanstack/table-core/build/lib/index.js";
9
+ function Z({
10
+ columns: o,
11
+ data: j,
12
+ loading: S = !1,
13
+ loadingComponent: d,
14
+ emptyComponent: b,
15
+ className: R,
16
+ rowSelection: w = {},
17
+ onRowSelectionChange: m,
18
+ checkable: i = !1,
19
+ onCheckedRowsChange: r,
20
+ notFoundMessage: p = "Nessun risultato trovato.",
21
+ loadingMessage: C = "Caricamento in corso..."
22
+ }) {
23
+ var u;
24
+ const [M, N] = c([]), [y, T] = c([]), [k, v] = c({}), [F, z] = c({}), g = m ? w : F, D = m || z, P = E.useMemo(() => i ? [
25
+ {
26
+ id: "select",
27
+ header: ({ table: l }) => /* @__PURE__ */ e.jsx("div", { className: "text-center", children: /* @__PURE__ */ e.jsx(
28
+ h,
29
+ {
30
+ checked: l.getIsAllPageRowsSelected(),
31
+ onCheckedChange: (t) => l.toggleAllPageRowsSelected(!!t),
32
+ "aria-label": "Seleziona tutti"
33
+ }
34
+ ) }),
35
+ cell: ({ row: l }) => /* @__PURE__ */ e.jsx("div", { className: "text-center", children: /* @__PURE__ */ e.jsx(
36
+ h,
37
+ {
38
+ checked: l.getIsSelected(),
39
+ onCheckedChange: (t) => l.toggleSelected(!!t),
40
+ "aria-label": "Seleziona riga"
41
+ }
42
+ ) }),
43
+ enableSorting: !1,
44
+ enableHiding: !1
45
+ },
46
+ ...o
47
+ ] : o, [o, i]), s = $({
48
+ data: j,
49
+ columns: P,
50
+ getCoreRowModel: G(),
51
+ getPaginationRowModel: q(),
52
+ onSortingChange: N,
53
+ getSortedRowModel: W(),
54
+ onColumnFiltersChange: T,
55
+ getFilteredRowModel: L(),
56
+ onColumnVisibilityChange: v,
57
+ onRowSelectionChange: D,
58
+ state: {
59
+ sorting: M,
60
+ columnFilters: y,
61
+ columnVisibility: k,
62
+ rowSelection: g
63
+ }
64
+ });
65
+ return _(() => {
66
+ if (r && i) {
67
+ const l = s.getFilteredSelectedRowModel().rows.map((t) => t.original);
68
+ r(l);
69
+ }
70
+ }, [s, r, i, g]), /* @__PURE__ */ e.jsx("div", { className: `w-full ${R}`, children: /* @__PURE__ */ e.jsx("div", { className: "rounded-md border", children: /* @__PURE__ */ e.jsxs(A, { className: "h-full w-full", children: [
71
+ /* @__PURE__ */ e.jsx(f, { orientation: "horizontal" }),
72
+ /* @__PURE__ */ e.jsx(f, { orientation: "vertical" }),
73
+ /* @__PURE__ */ e.jsxs(H, { children: [
74
+ /* @__PURE__ */ e.jsx(V, { children: s.getHeaderGroups().map((l) => /* @__PURE__ */ e.jsx(a, { children: l.headers.map((t) => /* @__PURE__ */ e.jsx(
75
+ I,
76
+ {
77
+ className: `${t.column.columnDef.sticky ? "sticky left-0 z-10 bg-background" : ""}`,
78
+ children: t.isPlaceholder ? null : x(
79
+ t.column.columnDef.header,
80
+ t.getContext()
81
+ )
82
+ },
83
+ t.id
84
+ )) }, l.id)) }),
85
+ /* @__PURE__ */ e.jsx(B, { children: S ? d ? /* @__PURE__ */ e.jsx(a, { children: /* @__PURE__ */ e.jsx(n, { colSpan: 1e3, className: "h-24", children: d }) }) : /* @__PURE__ */ e.jsx(a, { children: /* @__PURE__ */ e.jsx(
86
+ n,
87
+ {
88
+ colSpan: o.length,
89
+ className: "h-24 text-center",
90
+ children: C
91
+ }
92
+ ) }) : (u = s.getRowModel().rows) != null && u.length ? s.getRowModel().rows.map((l) => /* @__PURE__ */ e.jsx(
93
+ a,
94
+ {
95
+ "data-state": l.getIsSelected() && "selected",
96
+ children: l.getVisibleCells().map((t) => /* @__PURE__ */ e.jsx(
97
+ n,
98
+ {
99
+ className: `${t.column.columnDef.sticky ? "sticky left-0 z-10 bg-background" : ""}`,
100
+ children: x(
101
+ t.column.columnDef.cell,
102
+ t.getContext()
103
+ )
104
+ },
105
+ t.id
106
+ ))
107
+ },
108
+ l.id
109
+ )) : /* @__PURE__ */ e.jsx(a, { children: /* @__PURE__ */ e.jsx(
110
+ n,
111
+ {
112
+ colSpan: o.length,
113
+ className: "h-24 text-center",
114
+ children: b || p
115
+ }
116
+ ) }) })
117
+ ] })
118
+ ] }) }) });
119
+ }
120
+ export {
121
+ Z as DataTable
122
+ };
@@ -0,0 +1,26 @@
1
+ "use client";
2
+ import { j as r } from "../../_virtual/jsx-runtime.js";
3
+ import { useTheme as e } from "../../node_modules/next-themes/dist/index.js";
4
+ import { Toaster as s } from "../../node_modules/sonner/dist/index.js";
5
+ const p = ({ ...t }) => {
6
+ const { theme: o = "system" } = e();
7
+ return /* @__PURE__ */ r.jsx(
8
+ s,
9
+ {
10
+ theme: o,
11
+ className: "toaster group",
12
+ toastOptions: {
13
+ classNames: {
14
+ toast: "group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
15
+ description: "group-[.toast]:text-muted-foreground",
16
+ actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
17
+ cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"
18
+ }
19
+ },
20
+ ...t
21
+ }
22
+ );
23
+ };
24
+ export {
25
+ p as Toaster
26
+ };
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ import { __require as r } from "../node_modules/react/jsx-runtime.js";
3
+ var i = r();
4
+ export {
5
+ i as j
6
+ };
@@ -0,0 +1,5 @@
1
+ "use client";
2
+ var e = { exports: {} };
3
+ export {
4
+ e as __module
5
+ };
@@ -0,0 +1,5 @@
1
+ "use client";
2
+ var e = {};
3
+ export {
4
+ e as __exports
5
+ };
@@ -0,0 +1,5 @@
1
+ "use client";
2
+ var e = {};
3
+ export {
4
+ e as __exports
5
+ };
@@ -0,0 +1,32 @@
1
+ "use client";
2
+ import { j as r } from "../../_virtual/jsx-runtime.js";
3
+ import { Root as i, Indicator as t } from "../../node_modules/@radix-ui/react-checkbox/dist/index.js";
4
+ import { cn as s } from "../../lib/utils.js";
5
+ import o from "../../node_modules/lucide-react/dist/esm/icons/check.js";
6
+ function u({
7
+ className: e,
8
+ ...a
9
+ }) {
10
+ return /* @__PURE__ */ r.jsx(
11
+ i,
12
+ {
13
+ "data-slot": "checkbox",
14
+ className: s(
15
+ "peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
16
+ e
17
+ ),
18
+ ...a,
19
+ children: /* @__PURE__ */ r.jsx(
20
+ t,
21
+ {
22
+ "data-slot": "checkbox-indicator",
23
+ className: "flex items-center justify-center text-current transition-none",
24
+ children: /* @__PURE__ */ r.jsx(o, { className: "size-3.5" })
25
+ }
26
+ )
27
+ }
28
+ );
29
+ }
30
+ export {
31
+ u as Checkbox
32
+ };
@@ -0,0 +1,61 @@
1
+ "use client";
2
+ import { j as r } from "../../_virtual/jsx-runtime.js";
3
+ import { Root as s, Viewport as t, Corner as i, ScrollAreaScrollbar as n, ScrollAreaThumb as c } from "../../node_modules/@radix-ui/react-scroll-area/dist/index.js";
4
+ import { cn as l } from "../../lib/utils.js";
5
+ function m({
6
+ className: o,
7
+ children: e,
8
+ ...a
9
+ }) {
10
+ return /* @__PURE__ */ r.jsxs(
11
+ s,
12
+ {
13
+ "data-slot": "scroll-area",
14
+ className: l("relative", o),
15
+ ...a,
16
+ children: [
17
+ /* @__PURE__ */ r.jsx(
18
+ t,
19
+ {
20
+ "data-slot": "scroll-area-viewport",
21
+ className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",
22
+ children: e
23
+ }
24
+ ),
25
+ /* @__PURE__ */ r.jsx(u, {}),
26
+ /* @__PURE__ */ r.jsx(i, {})
27
+ ]
28
+ }
29
+ );
30
+ }
31
+ function u({
32
+ className: o,
33
+ orientation: e = "vertical",
34
+ ...a
35
+ }) {
36
+ return /* @__PURE__ */ r.jsx(
37
+ n,
38
+ {
39
+ "data-slot": "scroll-area-scrollbar",
40
+ orientation: e,
41
+ className: l(
42
+ "flex touch-none p-px transition-colors select-none",
43
+ e === "vertical" && "h-full w-2.5 border-l border-l-transparent",
44
+ e === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
45
+ o
46
+ ),
47
+ ...a,
48
+ children: /* @__PURE__ */ r.jsx(
49
+ c,
50
+ {
51
+ "data-slot": "scroll-area-thumb",
52
+ className: "bg-border relative flex-1 rounded-full"
53
+ }
54
+ )
55
+ }
56
+ );
57
+ }
58
+ export {
59
+ m as ScrollArea,
60
+ u as ScrollBar
61
+ };
@@ -0,0 +1,87 @@
1
+ "use client";
2
+ import { j as t } from "../../_virtual/jsx-runtime.js";
3
+ import { cn as s } from "../../lib/utils.js";
4
+ function r({ className: a, ...e }) {
5
+ return /* @__PURE__ */ t.jsx(
6
+ "div",
7
+ {
8
+ "data-slot": "table-container",
9
+ className: "relative w-full overflow-x-auto",
10
+ children: /* @__PURE__ */ t.jsx(
11
+ "table",
12
+ {
13
+ "data-slot": "table",
14
+ className: s("w-full caption-bottom text-sm", a),
15
+ ...e
16
+ }
17
+ )
18
+ }
19
+ );
20
+ }
21
+ function c({ className: a, ...e }) {
22
+ return /* @__PURE__ */ t.jsx(
23
+ "thead",
24
+ {
25
+ "data-slot": "table-header",
26
+ className: s("[&_tr]:border-b", a),
27
+ ...e
28
+ }
29
+ );
30
+ }
31
+ function n({ className: a, ...e }) {
32
+ return /* @__PURE__ */ t.jsx(
33
+ "tbody",
34
+ {
35
+ "data-slot": "table-body",
36
+ className: s("[&_tr:last-child]:border-0", a),
37
+ ...e
38
+ }
39
+ );
40
+ }
41
+ function d({ className: a, ...e }) {
42
+ return /* @__PURE__ */ t.jsx(
43
+ "tr",
44
+ {
45
+ "data-slot": "table-row",
46
+ className: s(
47
+ "hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",
48
+ a
49
+ ),
50
+ ...e
51
+ }
52
+ );
53
+ }
54
+ function b({ className: a, ...e }) {
55
+ return /* @__PURE__ */ t.jsx(
56
+ "th",
57
+ {
58
+ "data-slot": "table-head",
59
+ className: s(
60
+ "text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
61
+ a
62
+ ),
63
+ ...e
64
+ }
65
+ );
66
+ }
67
+ function i({ className: a, ...e }) {
68
+ return /* @__PURE__ */ t.jsx(
69
+ "td",
70
+ {
71
+ "data-slot": "table-cell",
72
+ className: s(
73
+ "p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
74
+ a
75
+ ),
76
+ ...e
77
+ }
78
+ );
79
+ }
80
+ export {
81
+ r as Table,
82
+ n as TableBody,
83
+ i as TableCell,
84
+ b as TableHead,
85
+ c as TableHeader,
86
+ d as TableRow
87
+ };
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import { clsx as e } from "../node_modules/clsx/dist/clsx.js";
3
+ import { twMerge as o } from "../node_modules/tailwind-merge/dist/bundle-mjs.js";
4
+ function i(...r) {
5
+ return o(e(r));
6
+ }
7
+ export {
8
+ i as cn
9
+ };
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ function n(t, [a, e]) {
3
+ return Math.min(e, Math.max(a, t));
4
+ }
5
+ export {
6
+ n as clamp
7
+ };
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ function u(n, t, { checkForDefaultPrevented: r = !0 } = {}) {
3
+ return function(e) {
4
+ if (n == null || n(e), r === !1 || !e.defaultPrevented)
5
+ return t == null ? void 0 : t(e);
6
+ };
7
+ }
8
+ export {
9
+ u as composeEventHandlers
10
+ };
@@ -0,0 +1,136 @@
1
+ "use client";
2
+ import * as s from "react";
3
+ import { useComposedRefs as _ } from "../../react-compose-refs/dist/index.js";
4
+ import { createContextScope as q } from "../../react-context/dist/index.js";
5
+ import { composeEventHandlers as w } from "../../primitive/dist/index.js";
6
+ import { useControllableState as L } from "../../react-use-controllable-state/dist/index.js";
7
+ import { usePrevious as z } from "../../react-use-previous/dist/index.js";
8
+ import { useSize as K } from "../../react-use-size/dist/index.js";
9
+ import { Presence as H } from "../../react-presence/dist/index.js";
10
+ import { Primitive as $ } from "../../react-primitive/dist/index.js";
11
+ import { j as l } from "../../../../_virtual/jsx-runtime.js";
12
+ var E = "Checkbox", [M, U] = q(E), [N, O] = M(E), j = s.forwardRef(
13
+ (e, f) => {
14
+ const {
15
+ __scopeCheckbox: t,
16
+ name: i,
17
+ checked: p,
18
+ defaultChecked: o,
19
+ required: m,
20
+ disabled: c,
21
+ value: h = "on",
22
+ onCheckedChange: k,
23
+ form: d,
24
+ ...v
25
+ } = e, [a, x] = s.useState(null), S = _(f, (r) => x(r)), C = s.useRef(!1), R = a ? d || !!a.closest("form") : !0, [u = !1, y] = L({
26
+ prop: p,
27
+ defaultProp: o,
28
+ onChange: k
29
+ }), D = s.useRef(u);
30
+ return s.useEffect(() => {
31
+ const r = a == null ? void 0 : a.form;
32
+ if (r) {
33
+ const b = () => y(D.current);
34
+ return r.addEventListener("reset", b), () => r.removeEventListener("reset", b);
35
+ }
36
+ }, [a, y]), /* @__PURE__ */ l.jsxs(N, { scope: t, state: u, disabled: c, children: [
37
+ /* @__PURE__ */ l.jsx(
38
+ $.button,
39
+ {
40
+ type: "button",
41
+ role: "checkbox",
42
+ "aria-checked": n(u) ? "mixed" : u,
43
+ "aria-required": m,
44
+ "data-state": I(u),
45
+ "data-disabled": c ? "" : void 0,
46
+ disabled: c,
47
+ value: h,
48
+ ...v,
49
+ ref: S,
50
+ onKeyDown: w(e.onKeyDown, (r) => {
51
+ r.key === "Enter" && r.preventDefault();
52
+ }),
53
+ onClick: w(e.onClick, (r) => {
54
+ y((b) => n(b) ? !0 : !b), R && (C.current = r.isPropagationStopped(), C.current || r.stopPropagation());
55
+ })
56
+ }
57
+ ),
58
+ R && /* @__PURE__ */ l.jsx(
59
+ T,
60
+ {
61
+ control: a,
62
+ bubbles: !C.current,
63
+ name: i,
64
+ value: h,
65
+ checked: u,
66
+ required: m,
67
+ disabled: c,
68
+ form: d,
69
+ style: { transform: "translateX(-100%)" },
70
+ defaultChecked: n(o) ? !1 : o
71
+ }
72
+ )
73
+ ] });
74
+ }
75
+ );
76
+ j.displayName = E;
77
+ var P = "CheckboxIndicator", g = s.forwardRef(
78
+ (e, f) => {
79
+ const { __scopeCheckbox: t, forceMount: i, ...p } = e, o = O(P, t);
80
+ return /* @__PURE__ */ l.jsx(H, { present: i || n(o.state) || o.state === !0, children: /* @__PURE__ */ l.jsx(
81
+ $.span,
82
+ {
83
+ "data-state": I(o.state),
84
+ "data-disabled": o.disabled ? "" : void 0,
85
+ ...p,
86
+ ref: f,
87
+ style: { pointerEvents: "none", ...e.style }
88
+ }
89
+ ) });
90
+ }
91
+ );
92
+ g.displayName = P;
93
+ var T = (e) => {
94
+ const { control: f, checked: t, bubbles: i = !0, defaultChecked: p, ...o } = e, m = s.useRef(null), c = z(t), h = K(f);
95
+ s.useEffect(() => {
96
+ const d = m.current, v = window.HTMLInputElement.prototype, a = Object.getOwnPropertyDescriptor(v, "checked").set;
97
+ if (c !== t && a) {
98
+ const x = new Event("click", { bubbles: i });
99
+ d.indeterminate = n(t), a.call(d, n(t) ? !1 : t), d.dispatchEvent(x);
100
+ }
101
+ }, [c, t, i]);
102
+ const k = s.useRef(n(t) ? !1 : t);
103
+ return /* @__PURE__ */ l.jsx(
104
+ "input",
105
+ {
106
+ type: "checkbox",
107
+ "aria-hidden": !0,
108
+ defaultChecked: p ?? k.current,
109
+ ...o,
110
+ tabIndex: -1,
111
+ ref: m,
112
+ style: {
113
+ ...e.style,
114
+ ...h,
115
+ position: "absolute",
116
+ pointerEvents: "none",
117
+ opacity: 0,
118
+ margin: 0
119
+ }
120
+ }
121
+ );
122
+ };
123
+ function n(e) {
124
+ return e === "indeterminate";
125
+ }
126
+ function I(e) {
127
+ return n(e) ? "indeterminate" : e ? "checked" : "unchecked";
128
+ }
129
+ var V = j, W = g;
130
+ export {
131
+ j as Checkbox,
132
+ g as CheckboxIndicator,
133
+ W as Indicator,
134
+ V as Root,
135
+ U as createCheckboxScope
136
+ };
@@ -0,0 +1,30 @@
1
+ "use client";
2
+ import * as c from "react";
3
+ function r(t, o) {
4
+ if (typeof t == "function")
5
+ return t(o);
6
+ t != null && (t.current = o);
7
+ }
8
+ function s(...t) {
9
+ return (o) => {
10
+ let u = !1;
11
+ const f = t.map((e) => {
12
+ const n = r(e, o);
13
+ return !u && typeof n == "function" && (u = !0), n;
14
+ });
15
+ if (u)
16
+ return () => {
17
+ for (let e = 0; e < f.length; e++) {
18
+ const n = f[e];
19
+ typeof n == "function" ? n() : r(t[e], null);
20
+ }
21
+ };
22
+ };
23
+ }
24
+ function l(...t) {
25
+ return c.useCallback(s(...t), t);
26
+ }
27
+ export {
28
+ s as composeRefs,
29
+ l as useComposedRefs
30
+ };
@@ -0,0 +1,56 @@
1
+ "use client";
2
+ import * as s from "react";
3
+ import { j as C } from "../../../../_virtual/jsx-runtime.js";
4
+ function w(o, u = []) {
5
+ let t = [];
6
+ function d(r, e) {
7
+ const c = s.createContext(e), l = t.length;
8
+ t = [...t, e];
9
+ const m = (v) => {
10
+ var i;
11
+ const { scope: a, children: f, ...p } = v, h = ((i = a == null ? void 0 : a[o]) == null ? void 0 : i[l]) || c, x = s.useMemo(() => p, Object.values(p));
12
+ return /* @__PURE__ */ C.jsx(h.Provider, { value: x, children: f });
13
+ };
14
+ m.displayName = r + "Provider";
15
+ function N(v, i) {
16
+ var a;
17
+ const f = ((a = i == null ? void 0 : i[o]) == null ? void 0 : a[l]) || c, p = s.useContext(f);
18
+ if (p) return p;
19
+ if (e !== void 0) return e;
20
+ throw new Error(`\`${v}\` must be used within \`${r}\``);
21
+ }
22
+ return [m, N];
23
+ }
24
+ const n = () => {
25
+ const r = t.map((e) => s.createContext(e));
26
+ return function(e) {
27
+ const c = (e == null ? void 0 : e[o]) || r;
28
+ return s.useMemo(
29
+ () => ({ [`__scope${o}`]: { ...e, [o]: c } }),
30
+ [e, c]
31
+ );
32
+ };
33
+ };
34
+ return n.scopeName = o, [d, _(n, ...u)];
35
+ }
36
+ function _(...o) {
37
+ const u = o[0];
38
+ if (o.length === 1) return u;
39
+ const t = () => {
40
+ const d = o.map((n) => ({
41
+ useScope: n(),
42
+ scopeName: n.scopeName
43
+ }));
44
+ return function(n) {
45
+ const r = d.reduce((e, { useScope: c, scopeName: l }) => {
46
+ const m = c(n)[`__scope${l}`];
47
+ return { ...e, ...m };
48
+ }, {});
49
+ return s.useMemo(() => ({ [`__scope${u.scopeName}`]: r }), [r]);
50
+ };
51
+ };
52
+ return t.scopeName = u.scopeName, t;
53
+ }
54
+ export {
55
+ w as createContextScope
56
+ };
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ import * as t from "react";
3
+ var r = t.createContext(void 0);
4
+ function n(e) {
5
+ const o = t.useContext(r);
6
+ return e || o || "ltr";
7
+ }
8
+ export {
9
+ n as useDirection
10
+ };