@cascivo/react 0.11.0 → 0.12.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 +5 -2
- package/dist/alert-dialog/alert-dialog.js +2 -4
- package/dist/card/card.css +1 -1
- package/dist/card/card.js +21 -11
- package/dist/card/card.module.js +8 -5
- package/dist/checkbox/checkbox.js +2 -2
- package/dist/command-menu/command-menu.js +67 -71
- package/dist/dropdown/dropdown.js +48 -50
- package/dist/header-panel/header-panel.js +2 -4
- package/dist/icon-button/icon-button.js +10 -10
- package/dist/index.d.ts +29 -14
- package/dist/modal/modal.js +4 -4
- package/dist/node/alert-dialog/alert-dialog.js +2 -4
- package/dist/node/card/card.js +21 -11
- package/dist/node/card/card.module.js +8 -5
- package/dist/node/checkbox/checkbox.js +2 -2
- package/dist/node/command-menu/command-menu.js +67 -71
- package/dist/node/dropdown/dropdown.js +48 -50
- package/dist/node/header-panel/header-panel.js +2 -4
- package/dist/node/icon-button/icon-button.js +10 -10
- package/dist/node/modal/modal.js +4 -4
- package/dist/node/popover/use-popover.js +9 -9
- package/dist/node/react/src/index.js +63 -63
- package/dist/node/search/search.js +19 -22
- package/dist/node/sheet/sheet.js +2 -4
- package/dist/node/visually-hidden/visually-hidden.js +2 -13
- package/dist/popover/use-popover.js +9 -9
- package/dist/react/src/index.js +63 -63
- package/dist/search/search.js +19 -22
- package/dist/sheet/sheet.js +2 -4
- package/dist/styles.css +1 -3
- package/dist/visually-hidden/visually-hidden.js +2 -13
- package/package.json +4 -4
- package/readme.body.md +5 -2
- package/dist/node/visually-hidden/visually-hidden.module.js +0 -5
- package/dist/visually-hidden/visually-hidden.css +0 -1
- package/dist/visually-hidden/visually-hidden.module.js +0 -6
|
@@ -1,102 +1,100 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import e from "./dropdown.module.js";
|
|
4
|
-
import { composeRefs as t, createMachine as n,
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { cloneElement as
|
|
4
|
+
import { composeRefs as t, createMachine as n, useEffectPropSignal as r, useMachine as i, useSignal as a, useSignalEffect as o, useSignals as s } from "@cascivo/core";
|
|
5
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
|
+
import { cloneElement as u, useRef as d } from "react";
|
|
7
7
|
//#region ../components/src/dropdown/dropdown.tsx
|
|
8
|
-
var
|
|
8
|
+
var f = n({
|
|
9
9
|
initial: "closed",
|
|
10
10
|
states: {
|
|
11
11
|
closed: { on: { OPEN: "open" } },
|
|
12
12
|
open: { on: { CLOSE: "closed" } }
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
let [
|
|
18
|
-
E.value = T;
|
|
19
|
-
let D = f.map((e, t) => ({
|
|
15
|
+
function p({ trigger: n, items: p, onSelect: m, placement: h = "bottom-start", open: g, onOpenChange: _ }) {
|
|
16
|
+
s();
|
|
17
|
+
let [v, y] = i(f), b = d(null), x = d(null), S = d(null), C = d([]), w = a(-1), T = g !== void 0, E = T ? g : v.value === "open", D = r(E), O = p.map((e, t) => ({
|
|
20
18
|
item: e,
|
|
21
19
|
index: t
|
|
22
|
-
})).filter(({ item: e }) => !e.separator && !e.disabled).map(({ index: e }) => e),
|
|
23
|
-
|
|
20
|
+
})).filter(({ item: e }) => !e.separator && !e.disabled).map(({ index: e }) => e), k = (e) => {
|
|
21
|
+
T || y(e ? "OPEN" : "CLOSE"), _?.(e);
|
|
24
22
|
};
|
|
25
|
-
|
|
26
|
-
let e =
|
|
27
|
-
|
|
28
|
-
}),
|
|
29
|
-
|
|
30
|
-
}),
|
|
31
|
-
|
|
32
|
-
}),
|
|
33
|
-
let e =
|
|
23
|
+
o(() => {
|
|
24
|
+
let e = w.value;
|
|
25
|
+
D.value && e >= 0 && C.current[e]?.focus();
|
|
26
|
+
}), o(() => {
|
|
27
|
+
D.value ? w.value = O[0] ?? -1 : w.value = -1;
|
|
28
|
+
}), o(() => {
|
|
29
|
+
D.value ? S.current?.showPopover() : S.current?.hidePopover();
|
|
30
|
+
}), o(() => {
|
|
31
|
+
let e = S.current;
|
|
34
32
|
if (!e) return;
|
|
35
33
|
let t = (e) => {
|
|
36
|
-
e.newState === "closed" &&
|
|
34
|
+
e.newState === "closed" && k(!1);
|
|
37
35
|
};
|
|
38
36
|
return e.addEventListener("toggle", t), () => e.removeEventListener("toggle", t);
|
|
39
37
|
});
|
|
40
|
-
let
|
|
41
|
-
let t =
|
|
42
|
-
!t || t.separator || t.disabled || (
|
|
43
|
-
}, A = (e) => {
|
|
44
|
-
D.length !== 0 && (C.value = D[(D.indexOf(C.value) + e + D.length) % D.length] ?? -1);
|
|
38
|
+
let A = (e) => {
|
|
39
|
+
let t = p[e];
|
|
40
|
+
!t || t.separator || t.disabled || (m?.(t.value), k(!1), x.current?.focus());
|
|
45
41
|
}, j = (e) => {
|
|
42
|
+
O.length !== 0 && (w.value = O[(O.indexOf(w.value) + e + O.length) % O.length] ?? -1);
|
|
43
|
+
}, M = (e) => {
|
|
46
44
|
switch (e.key) {
|
|
47
45
|
case "ArrowDown":
|
|
48
|
-
e.preventDefault(),
|
|
46
|
+
e.preventDefault(), j(1);
|
|
49
47
|
break;
|
|
50
48
|
case "ArrowUp":
|
|
51
|
-
e.preventDefault(),
|
|
49
|
+
e.preventDefault(), j(-1);
|
|
52
50
|
break;
|
|
53
51
|
case "Home":
|
|
54
|
-
e.preventDefault(),
|
|
52
|
+
e.preventDefault(), w.value = O[0] ?? -1;
|
|
55
53
|
break;
|
|
56
54
|
case "End":
|
|
57
|
-
e.preventDefault(),
|
|
55
|
+
e.preventDefault(), w.value = O[O.length - 1] ?? -1;
|
|
58
56
|
break;
|
|
59
57
|
case "Escape":
|
|
60
|
-
e.preventDefault(),
|
|
58
|
+
e.preventDefault(), k(!1), x.current?.focus();
|
|
61
59
|
break;
|
|
62
60
|
case "Enter":
|
|
63
61
|
case " ":
|
|
64
|
-
e.preventDefault(),
|
|
62
|
+
e.preventDefault(), A(w.value);
|
|
65
63
|
break;
|
|
66
64
|
}
|
|
67
|
-
},
|
|
68
|
-
ref: t(
|
|
65
|
+
}, N = n, P = u(N, {
|
|
66
|
+
ref: t(x, N.props.ref),
|
|
69
67
|
onClick: (e) => {
|
|
70
|
-
|
|
68
|
+
N.props.onClick?.(e), k(!E);
|
|
71
69
|
},
|
|
72
70
|
"aria-haspopup": "menu",
|
|
73
|
-
"aria-expanded":
|
|
71
|
+
"aria-expanded": E
|
|
74
72
|
});
|
|
75
|
-
return /* @__PURE__ */
|
|
76
|
-
ref:
|
|
73
|
+
return /* @__PURE__ */ l("div", {
|
|
74
|
+
ref: b,
|
|
77
75
|
className: e.root,
|
|
78
|
-
children: [
|
|
79
|
-
ref:
|
|
76
|
+
children: [P, /* @__PURE__ */ c("div", {
|
|
77
|
+
ref: S,
|
|
80
78
|
popover: "auto",
|
|
81
79
|
role: "menu",
|
|
82
|
-
"data-placement":
|
|
83
|
-
"data-state":
|
|
80
|
+
"data-placement": h,
|
|
81
|
+
"data-state": E ? "open" : "closed",
|
|
84
82
|
className: e.menu,
|
|
85
|
-
onKeyDown:
|
|
86
|
-
children:
|
|
83
|
+
onKeyDown: M,
|
|
84
|
+
children: p.map((t, n) => t.separator ? /* @__PURE__ */ c("div", {
|
|
87
85
|
role: "separator",
|
|
88
86
|
className: e.separator
|
|
89
|
-
}, `sep-${n}`) : /* @__PURE__ */
|
|
87
|
+
}, `sep-${n}`) : /* @__PURE__ */ l("button", {
|
|
90
88
|
type: "button",
|
|
91
89
|
role: "menuitem",
|
|
92
90
|
ref: (e) => {
|
|
93
|
-
|
|
91
|
+
C.current[n] = e;
|
|
94
92
|
},
|
|
95
|
-
tabIndex:
|
|
93
|
+
tabIndex: w.value === n ? 0 : -1,
|
|
96
94
|
disabled: t.disabled,
|
|
97
95
|
className: e.item,
|
|
98
|
-
onClick: () =>
|
|
99
|
-
children: [t.icon && /* @__PURE__ */
|
|
96
|
+
onClick: () => A(n),
|
|
97
|
+
children: [t.icon && /* @__PURE__ */ c("span", {
|
|
100
98
|
className: e.icon,
|
|
101
99
|
"aria-hidden": "true",
|
|
102
100
|
children: t.icon
|
|
@@ -106,4 +104,4 @@ function f({ trigger: n, items: f, onSelect: p, placement: m = "bottom-start", o
|
|
|
106
104
|
});
|
|
107
105
|
}
|
|
108
106
|
//#endregion
|
|
109
|
-
export {
|
|
107
|
+
export { p as Dropdown };
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import e from "./header-panel.module.js";
|
|
4
|
-
import { cn as t,
|
|
4
|
+
import { cn as t, useEffectPropSignal as n, useSignalEffect as r, useSignals as i } from "@cascivo/core";
|
|
5
5
|
import { builtin as a, t as o } from "@cascivo/i18n";
|
|
6
6
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
7
|
import { useRef as l } from "react";
|
|
8
8
|
//#region ../components/src/header-panel/header-panel.tsx
|
|
9
9
|
function u({ open: u, onClose: d, label: f, children: p, labels: m, className: h }) {
|
|
10
10
|
i();
|
|
11
|
-
let g = l(null), _ = l(null), v = n(u);
|
|
12
|
-
v.value = u;
|
|
13
|
-
let y = l(d);
|
|
11
|
+
let g = l(null), _ = l(null), v = n(u), y = l(d);
|
|
14
12
|
return y.current = d, r(() => {
|
|
15
13
|
let e = g.current;
|
|
16
14
|
if (e) if (v.value) {
|
|
@@ -5,16 +5,16 @@ import { Slot as t, cn as n } from "@cascivo/core";
|
|
|
5
5
|
import { jsx as r } from "react/jsx-runtime";
|
|
6
6
|
import { forwardRef as i } from "react";
|
|
7
7
|
//#region ../components/src/icon-button/icon-button.tsx
|
|
8
|
-
var a = i(function({ label: i,
|
|
9
|
-
return /* @__PURE__ */ r(
|
|
10
|
-
type:
|
|
11
|
-
"aria-label": i,
|
|
12
|
-
"data-size":
|
|
13
|
-
"data-variant":
|
|
14
|
-
className: n(e.iconButton,
|
|
15
|
-
ref:
|
|
16
|
-
...
|
|
17
|
-
children:
|
|
8
|
+
var a = i(function({ label: i, ariaLabel: a, icon: o, size: s = "md", variant: c = "ghost", asChild: l = !1, className: u, children: d, ...f }, p) {
|
|
9
|
+
return /* @__PURE__ */ r(l ? t : "button", {
|
|
10
|
+
type: l ? void 0 : "button",
|
|
11
|
+
"aria-label": i ?? a,
|
|
12
|
+
"data-size": s,
|
|
13
|
+
"data-variant": c,
|
|
14
|
+
className: n(e.iconButton, u),
|
|
15
|
+
ref: p,
|
|
16
|
+
...f,
|
|
17
|
+
children: d ?? o
|
|
18
18
|
});
|
|
19
19
|
});
|
|
20
20
|
//#endregion
|
package/dist/node/modal/modal.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import e from "./modal.module.js";
|
|
4
|
-
import { cn as t, useDraggable as n,
|
|
4
|
+
import { cn as t, useDraggable as n, useEffectPropSignal as r, useId as i, useSignalEffect as a, useSignals as o } from "@cascivo/core";
|
|
5
5
|
import { builtin as s, t as c } from "@cascivo/i18n";
|
|
6
6
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
7
7
|
import { useRef as d } from "react";
|
|
@@ -10,11 +10,11 @@ function f({ open: f = !1, onClose: p, title: m, description: h, children: g, cl
|
|
|
10
10
|
o();
|
|
11
11
|
let b = d(null), x = d(p);
|
|
12
12
|
x.current = p;
|
|
13
|
-
let S =
|
|
13
|
+
let S = i("cascivo-modal-title"), C = i("cascivo-modal-desc"), { handleRef: w, offset: T } = n({ isDisabled: !y }), E = y ? {
|
|
14
14
|
"--modal-x": `${T.value.x}px`,
|
|
15
15
|
"--modal-y": `${T.value.y}px`
|
|
16
|
-
} : void 0, D =
|
|
17
|
-
return
|
|
16
|
+
} : void 0, D = r(f);
|
|
17
|
+
return a(() => {
|
|
18
18
|
let e = b.current;
|
|
19
19
|
e && (D.value ? e.open || e.showModal() : e.open && e.close());
|
|
20
20
|
}), a(() => {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { useRef as
|
|
3
|
+
import { useId as e, useSignal as t, useSignalEffect as n } from "@cascivo/core";
|
|
4
|
+
import { useRef as r } from "react";
|
|
5
5
|
//#region ../components/src/popover/use-popover.ts
|
|
6
|
-
var
|
|
6
|
+
var i = typeof CSS < "u" && typeof CSS.supports == "function" && CSS.supports("anchor-name: --cascivo-a");
|
|
7
7
|
function a(a = {}) {
|
|
8
|
-
let o =
|
|
8
|
+
let o = `--${e("cascivo-popover")}`, s = r(null), c = r(null), l = t(a.open ?? !1);
|
|
9
9
|
a.open !== void 0 && (l.value = a.open);
|
|
10
|
-
let u =
|
|
10
|
+
let u = r(a.onOpenChange);
|
|
11
11
|
u.current = a.onOpenChange;
|
|
12
|
-
let d =
|
|
12
|
+
let d = r(a.placement);
|
|
13
13
|
d.current = a.placement;
|
|
14
|
-
let f =
|
|
15
|
-
return f.current = a.offset,
|
|
14
|
+
let f = r(a.offset);
|
|
15
|
+
return f.current = a.offset, n(() => {
|
|
16
16
|
let e = l.value;
|
|
17
17
|
u.current?.(e);
|
|
18
18
|
let t = c.current;
|
|
@@ -30,7 +30,7 @@ function a(a = {}) {
|
|
|
30
30
|
r === "bottom" ? (t.style.top = `${n.bottom + i + window.scrollY}px`, t.style.left = `${n.left + window.scrollX}px`) : r === "top" ? (t.style.top = `${n.top - i + window.scrollY}px`, t.style.left = `${n.left + window.scrollX}px`, t.style.transform = "translateY(-100%)") : r === "left" ? (t.style.top = `${n.top + window.scrollY}px`, t.style.left = `${n.left - i + window.scrollX}px`, t.style.transform = "translateX(-100%)") : r === "right" && (t.style.top = `${n.top + window.scrollY}px`, t.style.left = `${n.right + i + window.scrollX}px`);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
}),
|
|
33
|
+
}), n(() => {
|
|
34
34
|
let e = c.current;
|
|
35
35
|
if (!e) return;
|
|
36
36
|
let t = (e) => {
|
|
@@ -73,66 +73,66 @@ import { CheckboxCard as He } from "../../checkbox-card/checkbox-card.js";
|
|
|
73
73
|
import { CopyButton as Ue } from "../../copy-button/copy-button.js";
|
|
74
74
|
import { Stat as We } from "../../stat/stat.js";
|
|
75
75
|
import { Status as Ge } from "../../status/status.js";
|
|
76
|
-
import
|
|
77
|
-
import { SkipNavLink as
|
|
78
|
-
import { Progress as
|
|
79
|
-
import { ProgressCircle as
|
|
80
|
-
import { Heading as
|
|
81
|
-
import { Text as
|
|
82
|
-
import { Code as
|
|
83
|
-
import { Blockquote as
|
|
84
|
-
import { List as
|
|
85
|
-
import { LogViewer as
|
|
86
|
-
import { Prose as
|
|
87
|
-
import { PullToRefresh as
|
|
88
|
-
import { QrCode as
|
|
89
|
-
import { RelativeTime as
|
|
90
|
-
import { Label as
|
|
91
|
-
import { Field as
|
|
92
|
-
import { Filter as
|
|
93
|
-
import { IconButton as
|
|
94
|
-
import { ButtonGroup as
|
|
95
|
-
import { ToggleGroup as
|
|
96
|
-
import { InlineLoading as
|
|
97
|
-
import { Notification as
|
|
98
|
-
import { ScrollArea as
|
|
99
|
-
import { Collapsible as
|
|
100
|
-
import { AspectRatio as
|
|
101
|
-
import { MenuButton as
|
|
102
|
-
import { Toggletip as
|
|
103
|
-
import { Menubar as
|
|
104
|
-
import { NavigationMenu as
|
|
105
|
-
import { TreeView as
|
|
106
|
-
import { StructuredList as
|
|
107
|
-
import { ContainedList as
|
|
108
|
-
import { DataList as
|
|
109
|
-
import { Timeline as
|
|
110
|
-
import { Item as
|
|
111
|
-
import { Calendar as
|
|
112
|
-
import { DateRangePicker as
|
|
113
|
-
import { ColorPicker as
|
|
114
|
-
import { Carousel as
|
|
115
|
-
import { Resizable as
|
|
116
|
-
import { Dock as
|
|
117
|
-
import { Drawer as
|
|
118
|
-
import { NativeSelect as
|
|
119
|
-
import { CodeSnippet as
|
|
120
|
-
import { Steps as
|
|
121
|
-
import { Tile as
|
|
122
|
-
import { Indicator as
|
|
123
|
-
import { Join as
|
|
124
|
-
import { Stack as
|
|
125
|
-
import { AppShell as
|
|
126
|
-
import { ChatBubble as
|
|
127
|
-
import { RadialProgress as
|
|
128
|
-
import { Swap as
|
|
129
|
-
import { SwipeItem as
|
|
130
|
-
import { Grid as
|
|
131
|
-
import { Flex as
|
|
132
|
-
import { Columns as
|
|
133
|
-
import { Center as
|
|
134
|
-
import { Spacer as
|
|
135
|
-
import { AutoGrid as
|
|
136
|
-
import { ThemeProvider as
|
|
137
|
-
import { ErrorBoundary as mn, FocusScope as hn, Portal as gn,
|
|
138
|
-
export { M as Accordion, N as AccordionContent, P as AccordionItem, F as AccordionTrigger, I as ActionSheet, d as Alert, ye as AlertDialog,
|
|
76
|
+
import "../../visually-hidden/visually-hidden.js";
|
|
77
|
+
import { SkipNavLink as Ke, SkipNavTarget as qe } from "../../skip-nav/skip-nav.js";
|
|
78
|
+
import { Progress as Je } from "../../progress/progress.js";
|
|
79
|
+
import { ProgressCircle as Ye } from "../../progress-circle/progress-circle.js";
|
|
80
|
+
import { Heading as Xe } from "../../heading/heading.js";
|
|
81
|
+
import { Text as Ze } from "../../text/text.js";
|
|
82
|
+
import { Code as Qe } from "../../code/code.js";
|
|
83
|
+
import { Blockquote as $e } from "../../blockquote/blockquote.js";
|
|
84
|
+
import { List as et, ListItem as tt } from "../../list/list.js";
|
|
85
|
+
import { LogViewer as nt } from "../../log-viewer/log-viewer.js";
|
|
86
|
+
import { Prose as rt } from "../../prose/prose.js";
|
|
87
|
+
import { PullToRefresh as it } from "../../pull-to-refresh/pull-to-refresh.js";
|
|
88
|
+
import { QrCode as at } from "../../qr-code/qr-code.js";
|
|
89
|
+
import { RelativeTime as ot } from "../../relative-time/relative-time.js";
|
|
90
|
+
import { Label as st } from "../../label/label.js";
|
|
91
|
+
import { Field as ct } from "../../field/field.js";
|
|
92
|
+
import { Filter as lt } from "../../filter/filter.js";
|
|
93
|
+
import { IconButton as ut } from "../../icon-button/icon-button.js";
|
|
94
|
+
import { ButtonGroup as dt } from "../../button-group/button-group.js";
|
|
95
|
+
import { ToggleGroup as ft } from "../../toggle-group/toggle-group.js";
|
|
96
|
+
import { InlineLoading as pt } from "../../inline-loading/inline-loading.js";
|
|
97
|
+
import { Notification as mt } from "../../notification/notification.js";
|
|
98
|
+
import { ScrollArea as ht } from "../../scroll-area/scroll-area.js";
|
|
99
|
+
import { Collapsible as gt } from "../../collapsible/collapsible.js";
|
|
100
|
+
import { AspectRatio as _t } from "../../aspect-ratio/aspect-ratio.js";
|
|
101
|
+
import { MenuButton as vt } from "../../menu-button/menu-button.js";
|
|
102
|
+
import { Toggletip as yt } from "../../toggletip/toggletip.js";
|
|
103
|
+
import { Menubar as bt } from "../../menubar/menubar.js";
|
|
104
|
+
import { NavigationMenu as xt } from "../../navigation-menu/navigation-menu.js";
|
|
105
|
+
import { TreeView as St, treeViewMessages as Ct } from "../../tree-view/tree-view.js";
|
|
106
|
+
import { StructuredList as wt } from "../../structured-list/structured-list.js";
|
|
107
|
+
import { ContainedList as Tt, ContainedListItem as Et } from "../../contained-list/contained-list.js";
|
|
108
|
+
import { DataList as Dt } from "../../data-list/data-list.js";
|
|
109
|
+
import { Timeline as Ot } from "../../timeline/timeline.js";
|
|
110
|
+
import { Item as kt, ItemActions as At, ItemContent as jt, ItemDescription as Mt, ItemMedia as Nt, ItemTitle as Pt } from "../../item/item.js";
|
|
111
|
+
import { Calendar as Ft } from "../../calendar/calendar.js";
|
|
112
|
+
import { DateRangePicker as It } from "../../date-range-picker/date-range-picker.js";
|
|
113
|
+
import { ColorPicker as Lt } from "../../color-picker/color-picker.js";
|
|
114
|
+
import { Carousel as Rt } from "../../carousel/carousel.js";
|
|
115
|
+
import { Resizable as zt } from "../../resizable/resizable.js";
|
|
116
|
+
import { Dock as Bt } from "../../dock/dock.js";
|
|
117
|
+
import { Drawer as Vt } from "../../drawer/drawer.js";
|
|
118
|
+
import { NativeSelect as Ht } from "../../native-select/native-select.js";
|
|
119
|
+
import { CodeSnippet as Ut } from "../../code-snippet/code-snippet.js";
|
|
120
|
+
import { Steps as Wt } from "../../steps/steps.js";
|
|
121
|
+
import { Tile as Gt } from "../../tile/tile.js";
|
|
122
|
+
import { Indicator as Kt } from "../../indicator/indicator.js";
|
|
123
|
+
import { Join as qt } from "../../join/join.js";
|
|
124
|
+
import { Stack as Jt } from "../../stack/stack.js";
|
|
125
|
+
import { AppShell as Yt } from "../../app-shell/app-shell.js";
|
|
126
|
+
import { ChatBubble as Xt } from "../../chat-bubble/chat-bubble.js";
|
|
127
|
+
import { RadialProgress as Zt } from "../../radial-progress/radial-progress.js";
|
|
128
|
+
import { Swap as Qt } from "../../swap/swap.js";
|
|
129
|
+
import { SwipeItem as $t } from "../../swipe-item/swipe-item.js";
|
|
130
|
+
import { Grid as en, GridItem as tn } from "../../layouts/src/grid/grid.js";
|
|
131
|
+
import { Flex as nn } from "../../layouts/src/flex/flex.js";
|
|
132
|
+
import { Columns as rn } from "../../layouts/src/columns/columns.js";
|
|
133
|
+
import { Center as an } from "../../layouts/src/center/center.js";
|
|
134
|
+
import { Spacer as on } from "../../layouts/src/spacer/spacer.js";
|
|
135
|
+
import { AutoGrid as sn } from "../../layouts/src/auto-grid/auto-grid.js";
|
|
136
|
+
import { ThemeProvider as cn, setTheme as ln, themePreloadScript as un, themeSignal as dn, useTheme as fn } from "./theme.js";
|
|
137
|
+
import { DismissableLayer as pn, ErrorBoundary as mn, FocusScope as hn, Portal as gn, Presence as _n, Slot as vn, SuspenseBoundary as yn, VisuallyHidden as bn, batch as xn, cn as Sn, composeRefs as Cn, computePosition as wn, computed as Tn, createMachine as En, createScope as Dn, createStreamBuffer as On, effect as kn, getLinkComponent as An, mergeProps as jn, setLinkComponent as Mn, signal as Nn, useAnchorPosition as Pn, useClipboard as Fn, useComputed as In, useControllableSignal as Ln, useDisclosure as Rn, useEffectPropSignal as zn, useId as Bn, useMachine as Vn, useMediaQuery as Hn, useRovingFocus as Un, useScope as Wn, useScrollLock as Gn, useSignal as Kn, useSignalEffect as qn, useSignals as Jn, useStreamBuffer as Yn, useTypeahead as Xn } from "@cascivo/core";
|
|
138
|
+
export { M as Accordion, N as AccordionContent, P as AccordionItem, F as AccordionTrigger, I as ActionSheet, d as Alert, ye as AlertDialog, Yt as AppShell, _t as AspectRatio, sn as AutoGrid, f as Avatar, p as AvatarGroup, c as Badge, $e as Blockquote, xe as BottomSheet, z as Breadcrumb, t as Button, dt as ButtonGroup, Ft as Calendar, r as Card, i as CardContent, a as CardFooter, o as CardHeader, s as CardTitle, Rt as Carousel, an as Center, Xt as ChatBubble, v as Checkbox, He as CheckboxCard, Qe as Code, Ut as CodeSnippet, gt as Collapsible, Lt as ColorPicker, rn as Columns, ce as Combobox, ne as CommandMenu, we as Comparison, Tt as ContainedList, Et as ContainedListItem, Se as ContextMenu, Ce as ContextMenuItem, Ue as CopyButton, Dt as DataList, te as DataTable, le as DatePicker, It as DateRangePicker, pn as DismissableLayer, Bt as Dock, Vt as Drawer, w as Dropdown, Ie as Editable, X as EmptyState, mn as ErrorBoundary, Z as Fab, ct as Field, ue as FileUploader, lt as Filter, nn as Flex, hn as FocusScope, ae as Form, en as Grid, tn as GridItem, H as Header, Be as HeaderPanel, Xe as Heading, Te as HoverCard, Ee as HoverCardContent, De as HoverCardTrigger, ut as IconButton, h as Image, Kt as Indicator, pt as InlineLoading, n as Input, Ne as InputGroup, Pe as InputGroupAddon, kt as Item, At as ItemActions, jt as ItemContent, Mt as ItemDescription, Nt as ItemMedia, Pt as ItemTitle, qt as Join, L as Kbd, st as Label, R as Link, et as List, tt as ListItem, nt as LogViewer, he as Menu, vt as MenuButton, ge as MenuItem, _e as MenuSeparator, ve as MenuTrigger, bt as Menubar, l as Modal, ke as MultiSelect, Ht as NativeSelect, xt as NavigationMenu, mt as Notification, ee as NumberInput, je as OtpInput, Q as OverflowMenu, G as Pagination, Oe as PasswordInput, fe as Popover, pe as PopoverContent, me as PopoverTrigger, gn as Portal, _n as Presence, Je as Progress, Y as ProgressBar, Ye as ProgressCircle, K as ProgressIndicator, rt as Prose, it as PullToRefresh, at as QrCode, Zt as RadialProgress, y as Radio, Le as RadioCard, Re as RadioCardGroup, b as RadioGroup, Fe as RatingGroup, ot as RelativeTime, zt as Resizable, ht as ScrollArea, $ as Search, Me as SegmentedControl, _ as Select, u as Separator, be as Sheet, ze as ShellHeader, W as SideNav, J as Skeleton, Ke as SkipNavLink, qe as SkipNavTarget, S as Slider, vn as Slot, on as Spacer, e as Spinner, Jt as Stack, We as Stat, Ge as Status, Wt as Steps, wt as StructuredList, yn as SuspenseBoundary, Qt as Swap, $t as SwipeItem, Ve as Switcher, O as Tabs, k as TabsContent, A as TabsList, j as TabsTrigger, q as Tag, Ae as TagsInput, Ze as Text, g as Textarea, cn as ThemeProvider, Gt as Tile, de as TimePicker, Ot as Timeline, T as ToastProvider, B as Toc, x as Toggle, ft as ToggleGroup, yt as Toggletip, C as Tooltip, St as TreeView, m as User, bn as VisuallyHidden, xn as batch, Sn as cn, Cn as composeRefs, wn as computePosition, Tn as computed, oe as createForm, En as createMachine, Dn as createScope, On as createStreamBuffer, E as dismissAllToasts, kn as effect, re as fuzzyMatch, ie as fuzzyScore, An as getLinkComponent, jn as mergeProps, Mn as setLinkComponent, ln as setTheme, Nn as signal, un as themePreloadScript, dn as themeSignal, Ct as treeViewMessages, Pn as useAnchorPosition, Fn as useClipboard, In as useComputed, Ln as useControllableSignal, Rn as useDisclosure, zn as useEffectPropSignal, se as useForm, Bn as useId, Vn as useMachine, Hn as useMediaQuery, U as usePopover, Un as useRovingFocus, Wn as useScope, Gn as useScrollLock, Kn as useSignal, qn as useSignalEffect, Jn as useSignals, Yn as useStreamBuffer, fn as useTheme, D as useToast, V as useTocFromRegion, Xn as useTypeahead };
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import e from "./search.module.js";
|
|
4
|
-
import { cn as t,
|
|
5
|
-
import { builtin as
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { useRef as
|
|
4
|
+
import { cn as t, useId as n, useSignal as r, useSignalEffect as i, useSignals as a } from "@cascivo/core";
|
|
5
|
+
import { builtin as o, t as s } from "@cascivo/i18n";
|
|
6
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
7
|
+
import { useRef as u } from "react";
|
|
8
8
|
//#region ../components/src/search/search.tsx
|
|
9
|
-
var u = 0;
|
|
10
9
|
function d() {
|
|
11
|
-
return /* @__PURE__ */
|
|
10
|
+
return /* @__PURE__ */ l("svg", {
|
|
12
11
|
viewBox: "0 0 16 16",
|
|
13
12
|
width: "16",
|
|
14
13
|
height: "16",
|
|
@@ -17,11 +16,11 @@ function d() {
|
|
|
17
16
|
strokeWidth: "1.5",
|
|
18
17
|
strokeLinecap: "round",
|
|
19
18
|
"aria-hidden": "true",
|
|
20
|
-
children: [/* @__PURE__ */
|
|
19
|
+
children: [/* @__PURE__ */ c("circle", {
|
|
21
20
|
cx: "7",
|
|
22
21
|
cy: "7",
|
|
23
22
|
r: "4.5"
|
|
24
|
-
}), /* @__PURE__ */
|
|
23
|
+
}), /* @__PURE__ */ c("line", {
|
|
25
24
|
x1: "10.5",
|
|
26
25
|
y1: "10.5",
|
|
27
26
|
x2: "14",
|
|
@@ -30,17 +29,15 @@ function d() {
|
|
|
30
29
|
});
|
|
31
30
|
}
|
|
32
31
|
function f({ value: f, defaultValue: p = "", onValueChange: m, onChange: h, onSearch: g, debounceMs: _ = 300, placeholder: v, size: y = "md", label: b, disabled: x = !1, clearLabel: S, id: C, className: w }) {
|
|
33
|
-
|
|
34
|
-
let T = v ?? o
|
|
35
|
-
k.current === "" && (u += 1, k.current = `cascade-search-${u}`);
|
|
36
|
-
let A = C ?? k.current, j = f !== void 0, M = n(j ? f : p);
|
|
32
|
+
a();
|
|
33
|
+
let T = v ?? s(o.search.placeholder), E = b ?? s(o.search.label), D = S ?? s(o.search.clear), O = u(null), k = n("cascade-search"), A = C ?? k, j = f !== void 0, M = r(j ? f : p);
|
|
37
34
|
j && (M.value = f);
|
|
38
|
-
let N =
|
|
35
|
+
let N = u(g);
|
|
39
36
|
N.current = g;
|
|
40
|
-
let P =
|
|
37
|
+
let P = u(null), F = () => {
|
|
41
38
|
P.current !== null && (clearTimeout(P.current), P.current = null);
|
|
42
39
|
};
|
|
43
|
-
|
|
40
|
+
i(() => F);
|
|
44
41
|
let I = (e) => {
|
|
45
42
|
let t = e.target.value;
|
|
46
43
|
j || (M.value = t), (m ?? h)?.(t), F(), P.current = setTimeout(() => {
|
|
@@ -51,21 +48,21 @@ function f({ value: f, defaultValue: p = "", onValueChange: m, onChange: h, onSe
|
|
|
51
48
|
}, R = () => {
|
|
52
49
|
F(), j || (M.value = ""), (m ?? h)?.(""), g?.(""), O.current?.focus();
|
|
53
50
|
}, z = M.value !== "";
|
|
54
|
-
return /* @__PURE__ */
|
|
51
|
+
return /* @__PURE__ */ l("div", {
|
|
55
52
|
className: t(e.root, w),
|
|
56
53
|
"data-size": y,
|
|
57
54
|
"data-state": z ? "filled" : "empty",
|
|
58
55
|
children: [
|
|
59
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ c("label", {
|
|
60
57
|
className: e.label,
|
|
61
58
|
htmlFor: A,
|
|
62
59
|
children: E
|
|
63
60
|
}),
|
|
64
|
-
/* @__PURE__ */
|
|
61
|
+
/* @__PURE__ */ c("span", {
|
|
65
62
|
className: e.icon,
|
|
66
|
-
children: /* @__PURE__ */
|
|
63
|
+
children: /* @__PURE__ */ c(d, {})
|
|
67
64
|
}),
|
|
68
|
-
/* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ c("input", {
|
|
69
66
|
ref: O,
|
|
70
67
|
id: A,
|
|
71
68
|
type: "search",
|
|
@@ -76,13 +73,13 @@ function f({ value: f, defaultValue: p = "", onValueChange: m, onChange: h, onSe
|
|
|
76
73
|
onChange: I,
|
|
77
74
|
onKeyDown: L
|
|
78
75
|
}),
|
|
79
|
-
z && /* @__PURE__ */
|
|
76
|
+
z && /* @__PURE__ */ c("button", {
|
|
80
77
|
type: "button",
|
|
81
78
|
className: e.clear,
|
|
82
79
|
"aria-label": D,
|
|
83
80
|
disabled: x,
|
|
84
81
|
onClick: R,
|
|
85
|
-
children: /* @__PURE__ */
|
|
82
|
+
children: /* @__PURE__ */ c("span", {
|
|
86
83
|
"aria-hidden": "true",
|
|
87
84
|
children: "✕"
|
|
88
85
|
})
|
package/dist/node/sheet/sheet.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import e from "./sheet.module.js";
|
|
4
|
-
import {
|
|
4
|
+
import { useEffectPropSignal as t, useSignalEffect as n } from "@cascivo/core";
|
|
5
5
|
import { builtin as r, t as i } from "@cascivo/i18n";
|
|
6
6
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
7
|
import { useId as s, useRef as c } from "react";
|
|
8
8
|
//#region ../components/src/sheet/sheet.tsx
|
|
9
9
|
function l({ open: l, onClose: u, title: d, children: f, side: p = "end" }) {
|
|
10
|
-
let m = c(null), h = s(), g = t(l);
|
|
11
|
-
g.value = l;
|
|
12
|
-
let _ = c(u);
|
|
10
|
+
let m = c(null), h = s(), g = t(l), _ = c(u);
|
|
13
11
|
return _.current = u, n(() => {
|
|
14
12
|
let e = m.current;
|
|
15
13
|
if (e) if (g.value) try {
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
6
|
-
//#region ../components/src/visually-hidden/visually-hidden.tsx
|
|
7
|
-
function r({ children: r, className: i, ...a }) {
|
|
8
|
-
return /* @__PURE__ */ n("span", {
|
|
9
|
-
className: t(e.visuallyHidden, i),
|
|
10
|
-
...a,
|
|
11
|
-
children: r
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
//#endregion
|
|
15
|
-
export { r as VisuallyHidden };
|
|
3
|
+
import "@cascivo/core";
|
|
4
|
+
import "react/jsx-runtime";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { useRef as
|
|
3
|
+
import { useId as e, useSignal as t, useSignalEffect as n } from "@cascivo/core";
|
|
4
|
+
import { useRef as r } from "react";
|
|
5
5
|
//#region ../components/src/popover/use-popover.ts
|
|
6
|
-
var
|
|
6
|
+
var i = typeof CSS < "u" && typeof CSS.supports == "function" && CSS.supports("anchor-name: --cascivo-a");
|
|
7
7
|
function a(a = {}) {
|
|
8
|
-
let o =
|
|
8
|
+
let o = `--${e("cascivo-popover")}`, s = r(null), c = r(null), l = t(a.open ?? !1);
|
|
9
9
|
a.open !== void 0 && (l.value = a.open);
|
|
10
|
-
let u =
|
|
10
|
+
let u = r(a.onOpenChange);
|
|
11
11
|
u.current = a.onOpenChange;
|
|
12
|
-
let d =
|
|
12
|
+
let d = r(a.placement);
|
|
13
13
|
d.current = a.placement;
|
|
14
|
-
let f =
|
|
15
|
-
return f.current = a.offset,
|
|
14
|
+
let f = r(a.offset);
|
|
15
|
+
return f.current = a.offset, n(() => {
|
|
16
16
|
let e = l.value;
|
|
17
17
|
u.current?.(e);
|
|
18
18
|
let t = c.current;
|
|
@@ -30,7 +30,7 @@ function a(a = {}) {
|
|
|
30
30
|
r === "bottom" ? (t.style.top = `${n.bottom + i + window.scrollY}px`, t.style.left = `${n.left + window.scrollX}px`) : r === "top" ? (t.style.top = `${n.top - i + window.scrollY}px`, t.style.left = `${n.left + window.scrollX}px`, t.style.transform = "translateY(-100%)") : r === "left" ? (t.style.top = `${n.top + window.scrollY}px`, t.style.left = `${n.left - i + window.scrollX}px`, t.style.transform = "translateX(-100%)") : r === "right" && (t.style.top = `${n.top + window.scrollY}px`, t.style.left = `${n.right + i + window.scrollX}px`);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
}),
|
|
33
|
+
}), n(() => {
|
|
34
34
|
let e = c.current;
|
|
35
35
|
if (!e) return;
|
|
36
36
|
let t = (e) => {
|