@cascivo/react 0.13.0 → 0.13.1
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/dist/accordion/accordion.js +46 -44
- package/dist/action-sheet/action-sheet.js +16 -16
- package/dist/alert-dialog/alert-dialog.js +34 -34
- package/dist/app-shell/app-shell.css +1 -1
- package/dist/app-shell/app-shell.js +14 -12
- package/dist/app-shell/app-shell.module.js +8 -8
- package/dist/avatar-group/avatar-group.js +6 -6
- package/dist/bottom-sheet/bottom-sheet.js +18 -18
- package/dist/button/button.js +15 -12
- package/dist/button-group/button-group.js +8 -8
- package/dist/carousel/carousel.js +20 -20
- package/dist/checkbox/checkbox.js +21 -21
- package/dist/checkbox-card/checkbox-card.js +15 -13
- package/dist/collapsible/collapsible.js +7 -7
- package/dist/color-picker/color-picker.js +26 -26
- package/dist/combobox/combobox.js +86 -86
- package/dist/command-menu/command-menu.js +111 -111
- package/dist/comparison/comparison.js +10 -10
- package/dist/context-menu/context-menu.js +9 -9
- package/dist/copy-button/copy-button.js +18 -16
- package/dist/data-table/data-table.js +1 -1
- package/dist/date-picker/date-picker.js +25 -25
- package/dist/date-range-picker/date-range-picker.js +26 -26
- package/dist/drawer/drawer.css +1 -1
- package/dist/drawer/drawer.js +18 -17
- package/dist/drawer/drawer.module.js +9 -9
- package/dist/dropdown/dropdown.js +48 -48
- package/dist/editable/editable.js +11 -11
- package/dist/fab/fab.js +53 -53
- package/dist/field/field.js +8 -8
- package/dist/file-uploader/file-uploader.js +19 -19
- package/dist/header-panel/header-panel.js +31 -31
- package/dist/hover-card/hover-card.js +21 -21
- package/dist/icon-button/icon-button.js +5 -5
- package/dist/index.d.ts +202 -194
- package/dist/input/input.js +22 -21
- package/dist/link/link.js +8 -6
- package/dist/log-viewer/log-viewer.js +26 -26
- package/dist/menu/menu.js +20 -20
- package/dist/menu-button/menu-button.js +48 -48
- package/dist/menubar/menubar.js +42 -42
- package/dist/modal/modal.css +1 -1
- package/dist/modal/modal.js +41 -35
- package/dist/modal/modal.module.js +8 -7
- package/dist/multi-select/multi-select.css +1 -1
- package/dist/multi-select/multi-select.js +57 -57
- package/dist/multi-select/multi-select.module.js +11 -11
- package/dist/native-select/native-select.js +13 -11
- package/dist/navigation-menu/navigation-menu.js +46 -46
- package/dist/node/accordion/accordion.js +46 -44
- package/dist/node/action-sheet/action-sheet.js +16 -16
- package/dist/node/alert-dialog/alert-dialog.js +34 -34
- package/dist/node/app-shell/app-shell.js +14 -12
- package/dist/node/app-shell/app-shell.module.js +8 -8
- package/dist/node/avatar-group/avatar-group.js +6 -6
- package/dist/node/bottom-sheet/bottom-sheet.js +18 -18
- package/dist/node/button/button.js +15 -12
- package/dist/node/button-group/button-group.js +8 -8
- package/dist/node/carousel/carousel.js +20 -20
- package/dist/node/checkbox/checkbox.js +21 -21
- package/dist/node/checkbox-card/checkbox-card.js +15 -13
- package/dist/node/collapsible/collapsible.js +7 -7
- package/dist/node/color-picker/color-picker.js +26 -26
- package/dist/node/combobox/combobox.js +86 -86
- package/dist/node/command-menu/command-menu.js +111 -111
- package/dist/node/comparison/comparison.js +10 -10
- package/dist/node/context-menu/context-menu.js +9 -9
- package/dist/node/copy-button/copy-button.js +18 -16
- package/dist/node/data-table/data-table.js +1 -1
- package/dist/node/date-picker/date-picker.js +25 -25
- package/dist/node/date-range-picker/date-range-picker.js +26 -26
- package/dist/node/drawer/drawer.js +18 -17
- package/dist/node/drawer/drawer.module.js +9 -9
- package/dist/node/dropdown/dropdown.js +48 -48
- package/dist/node/editable/editable.js +11 -11
- package/dist/node/fab/fab.js +53 -53
- package/dist/node/field/field.js +8 -8
- package/dist/node/file-uploader/file-uploader.js +19 -19
- package/dist/node/header-panel/header-panel.js +31 -31
- package/dist/node/hover-card/hover-card.js +21 -21
- package/dist/node/icon-button/icon-button.js +5 -5
- package/dist/node/input/input.js +22 -21
- package/dist/node/link/link.js +8 -6
- package/dist/node/log-viewer/log-viewer.js +26 -26
- package/dist/node/menu/menu.js +20 -20
- package/dist/node/menu-button/menu-button.js +48 -48
- package/dist/node/menubar/menubar.js +42 -42
- package/dist/node/modal/modal.js +41 -35
- package/dist/node/modal/modal.module.js +8 -7
- package/dist/node/multi-select/multi-select.js +57 -57
- package/dist/node/multi-select/multi-select.module.js +11 -11
- package/dist/node/native-select/native-select.js +13 -11
- package/dist/node/navigation-menu/navigation-menu.js +46 -46
- package/dist/node/notification/notification.js +26 -26
- package/dist/node/number-input/number-input.js +52 -50
- package/dist/node/otp-input/otp-input.js +8 -8
- package/dist/node/password-input/password-input.js +28 -27
- package/dist/node/popover/popover.js +26 -24
- package/dist/node/pull-to-refresh/pull-to-refresh.js +13 -13
- package/dist/node/radial-progress/radial-progress.js +5 -5
- package/dist/node/radio/radio.js +23 -22
- package/dist/node/radio-card/radio-card.js +27 -26
- package/dist/node/react/src/index.js +3 -3
- package/dist/node/react/src/theme.js +30 -19
- package/dist/node/resizable/resizable.js +11 -11
- package/dist/node/scroll-area/scroll-area.js +4 -4
- package/dist/node/search/search.js +49 -49
- package/dist/node/select/select.js +27 -26
- package/dist/node/sheet/sheet.js +11 -10
- package/dist/node/sheet/sheet.module.js +5 -5
- package/dist/node/side-nav/side-nav.js +91 -91
- package/dist/node/skip-nav/skip-nav.js +12 -12
- package/dist/node/slider/slider.js +13 -11
- package/dist/node/structured-list/structured-list.js +23 -23
- package/dist/node/tabs/tabs.js +49 -47
- package/dist/node/tags-input/tags-input.js +35 -35
- package/dist/node/textarea/textarea.js +22 -21
- package/dist/node/time-picker/time-picker.js +22 -21
- package/dist/node/toast/toast.js +15 -15
- package/dist/node/toc/toc.js +8 -8
- package/dist/node/toggle/toggle.js +15 -13
- package/dist/node/toggle-group/toggle-group.js +10 -10
- package/dist/node/toggletip/toggletip.js +9 -9
- package/dist/node/tooltip/tooltip.js +5 -5
- package/dist/node/tree-view/tree-view.js +32 -32
- package/dist/notification/notification.js +26 -26
- package/dist/number-input/number-input.js +52 -50
- package/dist/otp-input/otp-input.js +8 -8
- package/dist/password-input/password-input.js +28 -27
- package/dist/popover/popover.js +26 -24
- package/dist/pull-to-refresh/pull-to-refresh.js +13 -13
- package/dist/radial-progress/radial-progress.js +5 -5
- package/dist/radio/radio.js +23 -22
- package/dist/radio-card/radio-card.js +27 -26
- package/dist/react/src/index.js +3 -3
- package/dist/react/src/theme.js +30 -19
- package/dist/resizable/resizable.js +11 -11
- package/dist/scroll-area/scroll-area.js +4 -4
- package/dist/search/search.js +49 -49
- package/dist/select/select.js +27 -26
- package/dist/sheet/sheet.css +1 -1
- package/dist/sheet/sheet.js +11 -10
- package/dist/sheet/sheet.module.js +5 -5
- package/dist/side-nav/side-nav.js +91 -91
- package/dist/skip-nav/skip-nav.js +12 -12
- package/dist/slider/slider.js +13 -11
- package/dist/structured-list/structured-list.js +23 -23
- package/dist/styles.css +55 -5
- package/dist/tabs/tabs.js +49 -47
- package/dist/tags-input/tags-input.js +35 -35
- package/dist/textarea/textarea.js +22 -21
- package/dist/time-picker/time-picker.js +22 -21
- package/dist/toast/toast.js +15 -15
- package/dist/toc/toc.js +8 -8
- package/dist/toggle/toggle.js +15 -13
- package/dist/toggle-group/toggle-group.js +10 -10
- package/dist/toggletip/toggletip.js +9 -9
- package/dist/tooltip/tooltip.js +5 -5
- package/dist/tree-view/tree-view.js +32 -32
- package/package.json +10 -4
|
@@ -2,94 +2,96 @@
|
|
|
2
2
|
|
|
3
3
|
import e from "./accordion.module.js";
|
|
4
4
|
import { cn as t, useSignal as n, useSignals as r } from "@cascivo/core";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { createContext as i, forwardRef as a, useId as o } from "react";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
7
|
//#region ../components/src/accordion/accordion.tsx
|
|
8
|
-
var
|
|
9
|
-
function
|
|
8
|
+
var l = i(null), u = i(null);
|
|
9
|
+
function d(e) {
|
|
10
10
|
return e === void 0 ? [] : Array.isArray(e) ? e : [e];
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
let p =
|
|
14
|
-
|
|
12
|
+
function f({ type: r = "single", defaultValue: i, value: a, onValueChange: c, className: u, children: f }) {
|
|
13
|
+
let p = o(), m = n(d(a ?? i));
|
|
14
|
+
a !== void 0 && (m.value = d(a));
|
|
15
15
|
let h = {
|
|
16
16
|
open: m,
|
|
17
17
|
baseId: p,
|
|
18
18
|
toggle: (e) => {
|
|
19
19
|
let t = m.value, n;
|
|
20
|
-
n = r === "multiple" ? t.includes(e) ? t.filter((t) => t !== e) : [...t, e] : t.includes(e) ? [] : [e],
|
|
20
|
+
n = r === "multiple" ? t.includes(e) ? t.filter((t) => t !== e) : [...t, e] : t.includes(e) ? [] : [e], a === void 0 && (m.value = n), c?.(r === "multiple" ? n : n[0] ?? "");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
return /* @__PURE__ */
|
|
23
|
+
return /* @__PURE__ */ s(l.Provider, {
|
|
24
24
|
value: h,
|
|
25
|
-
children: /* @__PURE__ */
|
|
25
|
+
children: /* @__PURE__ */ s("div", {
|
|
26
26
|
"data-type": r,
|
|
27
|
-
className: t(e.accordion,
|
|
27
|
+
className: t(e.accordion, u),
|
|
28
28
|
children: f
|
|
29
29
|
})
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
return /* @__PURE__ */
|
|
32
|
+
function p({ value: n, className: r, children: i, ...a }) {
|
|
33
|
+
return /* @__PURE__ */ s(u.Provider, {
|
|
34
34
|
value: { value: n },
|
|
35
|
-
children: /* @__PURE__ */
|
|
35
|
+
children: /* @__PURE__ */ s("div", {
|
|
36
36
|
"data-value": n,
|
|
37
37
|
className: t(e.item, r),
|
|
38
|
-
...
|
|
39
|
-
children:
|
|
38
|
+
...a,
|
|
39
|
+
children: i
|
|
40
40
|
})
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
return /* @__PURE__ */
|
|
45
|
-
store:
|
|
46
|
-
item:
|
|
43
|
+
var m = a(function(e, t) {
|
|
44
|
+
return /* @__PURE__ */ s(l.Consumer, { children: (n) => /* @__PURE__ */ s(u.Consumer, { children: (r) => n && r ? /* @__PURE__ */ s(h, {
|
|
45
|
+
store: n,
|
|
46
|
+
item: r,
|
|
47
|
+
buttonRef: t,
|
|
47
48
|
...e
|
|
48
49
|
}) : null }) });
|
|
49
|
-
}
|
|
50
|
-
function
|
|
50
|
+
});
|
|
51
|
+
function h({ store: n, item: i, className: a, children: o, buttonRef: l, ...u }) {
|
|
51
52
|
r();
|
|
52
|
-
let
|
|
53
|
-
return /* @__PURE__ */
|
|
53
|
+
let d = n.open.value.includes(i.value);
|
|
54
|
+
return /* @__PURE__ */ s("h3", {
|
|
54
55
|
className: e.heading,
|
|
55
|
-
children: /* @__PURE__ */
|
|
56
|
+
children: /* @__PURE__ */ c("button", {
|
|
56
57
|
type: "button",
|
|
57
|
-
id: `${n.baseId}-trigger-${
|
|
58
|
-
"aria-expanded":
|
|
59
|
-
"aria-controls": `${n.baseId}-content-${
|
|
60
|
-
"data-state":
|
|
61
|
-
className: t(e.trigger,
|
|
62
|
-
onClick: () => n.toggle(
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
id: `${n.baseId}-trigger-${i.value}`,
|
|
59
|
+
"aria-expanded": d,
|
|
60
|
+
"aria-controls": `${n.baseId}-content-${i.value}`,
|
|
61
|
+
"data-state": d ? "open" : "closed",
|
|
62
|
+
className: t(e.trigger, a),
|
|
63
|
+
onClick: () => n.toggle(i.value),
|
|
64
|
+
ref: l,
|
|
65
|
+
...u,
|
|
66
|
+
children: [/* @__PURE__ */ s("span", { children: o }), /* @__PURE__ */ s("span", {
|
|
65
67
|
className: e.indicator,
|
|
66
68
|
"aria-hidden": "true"
|
|
67
69
|
})]
|
|
68
70
|
})
|
|
69
71
|
});
|
|
70
72
|
}
|
|
71
|
-
function
|
|
72
|
-
return /* @__PURE__ */
|
|
73
|
+
function g(e) {
|
|
74
|
+
return /* @__PURE__ */ s(l.Consumer, { children: (t) => /* @__PURE__ */ s(u.Consumer, { children: (n) => t && n ? /* @__PURE__ */ s(_, {
|
|
73
75
|
store: t,
|
|
74
76
|
item: n,
|
|
75
77
|
...e
|
|
76
78
|
}) : null }) });
|
|
77
79
|
}
|
|
78
|
-
function
|
|
80
|
+
function _({ store: n, item: i, className: a, children: o, ...c }) {
|
|
79
81
|
r();
|
|
80
|
-
let l = n.open.value.includes(
|
|
81
|
-
return /* @__PURE__ */
|
|
82
|
+
let l = n.open.value.includes(i.value);
|
|
83
|
+
return /* @__PURE__ */ s("div", {
|
|
82
84
|
role: "region",
|
|
83
|
-
id: `${n.baseId}-content-${
|
|
84
|
-
"aria-labelledby": `${n.baseId}-trigger-${
|
|
85
|
+
id: `${n.baseId}-content-${i.value}`,
|
|
86
|
+
"aria-labelledby": `${n.baseId}-trigger-${i.value}`,
|
|
85
87
|
"data-state": l ? "open" : "closed",
|
|
86
|
-
className: t(e.content,
|
|
88
|
+
className: t(e.content, a),
|
|
87
89
|
...c,
|
|
88
|
-
children: /* @__PURE__ */
|
|
90
|
+
children: /* @__PURE__ */ s("div", {
|
|
89
91
|
className: e.contentInner,
|
|
90
|
-
children:
|
|
92
|
+
children: o
|
|
91
93
|
})
|
|
92
94
|
});
|
|
93
95
|
}
|
|
94
96
|
//#endregion
|
|
95
|
-
export {
|
|
97
|
+
export { f as Accordion, g as AccordionContent, p as AccordionItem, m as AccordionTrigger };
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import e from "./action-sheet.module.js";
|
|
4
4
|
import { DismissableLayer as t, FocusScope as n, Portal as r, Presence as i, cn as a, useControllableSignal as o, useRovingFocus as s, useSignals as c } from "@cascivo/core";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { useId as l } from "react";
|
|
6
|
+
import { builtin as u, t as d } from "@cascivo/i18n";
|
|
7
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
8
8
|
//#region ../components/src/action-sheet/action-sheet.tsx
|
|
9
9
|
function m({ open: m, defaultOpen: h, onOpenChange: g, actions: _, title: v, description: y, showCancel: b = !0, labels: x, className: S }) {
|
|
10
10
|
c();
|
|
@@ -15,42 +15,42 @@ function m({ open: m, defaultOpen: h, onOpenChange: g, actions: _, title: v, des
|
|
|
15
15
|
}), T = s({
|
|
16
16
|
orientation: "vertical",
|
|
17
17
|
loop: !0
|
|
18
|
-
}), E =
|
|
18
|
+
}), E = l(), D = l(), O = x?.cancel ?? d(u.actionSheet.cancel), k = x?.label ?? d(u.actionSheet.label), A = (e) => {
|
|
19
19
|
e.disabled || (e.onSelect(), w(!1));
|
|
20
20
|
}, j = _.length;
|
|
21
|
-
return /* @__PURE__ */
|
|
21
|
+
return /* @__PURE__ */ f(r, { children: /* @__PURE__ */ f(i, {
|
|
22
22
|
present: C,
|
|
23
|
-
children: /* @__PURE__ */
|
|
23
|
+
children: /* @__PURE__ */ f("div", {
|
|
24
24
|
className: e.overlay,
|
|
25
|
-
children: /* @__PURE__ */
|
|
25
|
+
children: /* @__PURE__ */ f(t, {
|
|
26
26
|
onDismiss: () => w(!1),
|
|
27
|
-
children: /* @__PURE__ */
|
|
27
|
+
children: /* @__PURE__ */ f(n, {
|
|
28
28
|
trapped: !0,
|
|
29
29
|
restoreFocus: !0,
|
|
30
30
|
autoFocus: !0,
|
|
31
|
-
children: /* @__PURE__ */
|
|
31
|
+
children: /* @__PURE__ */ p("div", {
|
|
32
32
|
role: "menu",
|
|
33
33
|
"aria-label": v ? void 0 : k,
|
|
34
34
|
"aria-labelledby": v ? E : void 0,
|
|
35
35
|
"aria-describedby": y ? D : void 0,
|
|
36
36
|
className: a(e.sheet, S),
|
|
37
|
-
children: [/* @__PURE__ */
|
|
37
|
+
children: [/* @__PURE__ */ p("div", {
|
|
38
38
|
className: e.group,
|
|
39
|
-
children: [(v || y) && /* @__PURE__ */
|
|
39
|
+
children: [(v || y) && /* @__PURE__ */ p("div", {
|
|
40
40
|
className: e.heading,
|
|
41
41
|
role: "presentation",
|
|
42
|
-
children: [v && /* @__PURE__ */
|
|
42
|
+
children: [v && /* @__PURE__ */ f("p", {
|
|
43
43
|
id: E,
|
|
44
44
|
className: e.title,
|
|
45
45
|
children: v
|
|
46
|
-
}), y && /* @__PURE__ */
|
|
46
|
+
}), y && /* @__PURE__ */ f("p", {
|
|
47
47
|
id: D,
|
|
48
48
|
className: e.description,
|
|
49
49
|
children: y
|
|
50
50
|
})]
|
|
51
51
|
}), _.map((t, n) => {
|
|
52
52
|
let r = T.getItemProps(n);
|
|
53
|
-
return /* @__PURE__ */
|
|
53
|
+
return /* @__PURE__ */ f("button", {
|
|
54
54
|
ref: r.ref,
|
|
55
55
|
type: "button",
|
|
56
56
|
role: "menuitem",
|
|
@@ -64,11 +64,11 @@ function m({ open: m, defaultOpen: h, onOpenChange: g, actions: _, title: v, des
|
|
|
64
64
|
children: t.label
|
|
65
65
|
}, n);
|
|
66
66
|
})]
|
|
67
|
-
}), b && /* @__PURE__ */
|
|
67
|
+
}), b && /* @__PURE__ */ f("div", {
|
|
68
68
|
className: e.group,
|
|
69
69
|
children: (() => {
|
|
70
70
|
let t = T.getItemProps(j);
|
|
71
|
-
return /* @__PURE__ */
|
|
71
|
+
return /* @__PURE__ */ f("button", {
|
|
72
72
|
ref: t.ref,
|
|
73
73
|
type: "button",
|
|
74
74
|
role: "menuitem",
|
|
@@ -1,61 +1,61 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import e from "./alert-dialog.module.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { focusElement as t, useEffectPropSignal as n, useId as r, useSignalEffect as i } from "@cascivo/core";
|
|
5
|
+
import { useRef as a } from "react";
|
|
6
|
+
import { builtin as o, t as s } from "@cascivo/i18n";
|
|
7
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
8
|
//#region ../components/src/alert-dialog/alert-dialog.tsx
|
|
9
|
-
function
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
let
|
|
13
|
-
return
|
|
14
|
-
let e =
|
|
15
|
-
if (e) if (
|
|
9
|
+
function u({ open: u, title: d, description: f, onConfirm: p, onCancel: m, labels: h, variant: g = "default" }) {
|
|
10
|
+
let _ = a(null), v = r("cascivo-alert-dialog-title"), y = r("cascivo-alert-dialog-desc"), b = n(u), x = a(null), S = a(m);
|
|
11
|
+
S.current = m;
|
|
12
|
+
let C = a(p);
|
|
13
|
+
return C.current = p, i(() => {
|
|
14
|
+
let e = _.current;
|
|
15
|
+
if (e) if (b.value) {
|
|
16
16
|
try {
|
|
17
17
|
e.showPopover();
|
|
18
18
|
} catch {}
|
|
19
|
-
requestAnimationFrame(() =>
|
|
19
|
+
requestAnimationFrame(() => t(x.current));
|
|
20
20
|
} else try {
|
|
21
21
|
e.hidePopover();
|
|
22
22
|
} catch {}
|
|
23
|
-
}), /* @__PURE__ */
|
|
24
|
-
ref:
|
|
23
|
+
}), /* @__PURE__ */ c("div", {
|
|
24
|
+
ref: _,
|
|
25
25
|
popover: "manual",
|
|
26
26
|
role: "alertdialog",
|
|
27
27
|
"aria-modal": "true",
|
|
28
|
-
"aria-labelledby":
|
|
29
|
-
"aria-describedby":
|
|
30
|
-
"data-state":
|
|
31
|
-
"data-variant":
|
|
28
|
+
"aria-labelledby": v,
|
|
29
|
+
"aria-describedby": y,
|
|
30
|
+
"data-state": u ? "open" : "closed",
|
|
31
|
+
"data-variant": g,
|
|
32
32
|
className: e.dialog,
|
|
33
|
-
children: /* @__PURE__ */
|
|
33
|
+
children: /* @__PURE__ */ l("div", {
|
|
34
34
|
className: e.content,
|
|
35
35
|
children: [
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
id:
|
|
36
|
+
/* @__PURE__ */ c("p", {
|
|
37
|
+
id: v,
|
|
38
38
|
className: e.title,
|
|
39
|
-
children:
|
|
39
|
+
children: d
|
|
40
40
|
}),
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
id:
|
|
41
|
+
/* @__PURE__ */ c("p", {
|
|
42
|
+
id: y,
|
|
43
43
|
className: e.description,
|
|
44
|
-
children:
|
|
44
|
+
children: f
|
|
45
45
|
}),
|
|
46
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ l("div", {
|
|
47
47
|
className: e.actions,
|
|
48
|
-
children: [/* @__PURE__ */
|
|
49
|
-
ref:
|
|
48
|
+
children: [/* @__PURE__ */ c("button", {
|
|
49
|
+
ref: x,
|
|
50
50
|
type: "button",
|
|
51
51
|
className: e.cancel,
|
|
52
|
-
onClick: () =>
|
|
53
|
-
children:
|
|
54
|
-
}), /* @__PURE__ */
|
|
52
|
+
onClick: () => S.current(),
|
|
53
|
+
children: h?.cancel ?? s(o.alertDialog.cancel)
|
|
54
|
+
}), /* @__PURE__ */ c("button", {
|
|
55
55
|
type: "button",
|
|
56
56
|
className: e.confirm,
|
|
57
|
-
onClick: () =>
|
|
58
|
-
children:
|
|
57
|
+
onClick: () => C.current(),
|
|
58
|
+
children: h?.confirm ?? s(o.alertDialog.confirm)
|
|
59
59
|
})]
|
|
60
60
|
})
|
|
61
61
|
]
|
|
@@ -63,4 +63,4 @@ function l({ open: l, title: u, description: d, onConfirm: f, onCancel: p, label
|
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
//#endregion
|
|
66
|
-
export {
|
|
66
|
+
export { u as AlertDialog };
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
import e from "./app-shell.module.js";
|
|
4
4
|
import { cn as t, useSignal as n, useSignalEffect as r, useSignals as i } from "@cascivo/core";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { cloneElement as a, isValidElement as o, useRef as s } from "react";
|
|
6
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
7
7
|
//#region ../components/src/app-shell/app-shell.tsx
|
|
8
8
|
function d({ header: d, nav: f, children: p, footer: m, open: h, defaultOpen: g, onOpenChange: _, className: v, ...y }) {
|
|
9
9
|
i();
|
|
10
10
|
let b = h !== void 0, x = n(h ?? g ?? !0);
|
|
11
11
|
b && (x.value = h);
|
|
12
|
-
let S =
|
|
12
|
+
let S = s(null), C = s(null);
|
|
13
13
|
function w(e) {
|
|
14
14
|
b || (x.value = e), _?.(e);
|
|
15
15
|
}
|
|
@@ -33,44 +33,46 @@ function d({ header: d, nav: f, children: p, footer: m, open: h, defaultOpen: g,
|
|
|
33
33
|
t && e.contains(document.activeElement) && t.focus();
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
-
let E =
|
|
36
|
+
let E = o(d) && f ? a(d, {
|
|
37
37
|
onMenuClick: T,
|
|
38
38
|
menuExpanded: x.value
|
|
39
39
|
}) : d;
|
|
40
|
-
return /* @__PURE__ */
|
|
40
|
+
return /* @__PURE__ */ u("div", {
|
|
41
41
|
className: t(e.shell, v),
|
|
42
42
|
"data-open": x.value,
|
|
43
43
|
...y,
|
|
44
44
|
children: [
|
|
45
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ l("div", {
|
|
46
46
|
className: e.header,
|
|
47
47
|
children: E
|
|
48
48
|
}),
|
|
49
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ u("div", {
|
|
50
50
|
className: e.body,
|
|
51
|
-
children: [f && /* @__PURE__ */
|
|
51
|
+
children: [f && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("div", {
|
|
52
52
|
ref: S,
|
|
53
53
|
className: e.navWrapper,
|
|
54
54
|
"data-open": x.value,
|
|
55
55
|
"data-testid": "app-shell-nav",
|
|
56
|
-
|
|
56
|
+
"data-cascivo-appshell-nav": "",
|
|
57
|
+
children: /* @__PURE__ */ l("div", {
|
|
57
58
|
className: e.navInner,
|
|
58
59
|
children: f
|
|
59
60
|
})
|
|
60
|
-
}), /* @__PURE__ */
|
|
61
|
+
}), /* @__PURE__ */ l("div", {
|
|
61
62
|
className: e.scrim,
|
|
62
63
|
"data-open": x.value,
|
|
63
64
|
"data-testid": "app-shell-scrim",
|
|
64
65
|
"aria-hidden": "true",
|
|
65
66
|
onClick: () => w(!1)
|
|
66
|
-
})] }), /* @__PURE__ */
|
|
67
|
+
})] }), /* @__PURE__ */ l("main", {
|
|
67
68
|
id: "cascade-main",
|
|
68
69
|
tabIndex: -1,
|
|
69
70
|
className: e.main,
|
|
71
|
+
"data-cascivo-appshell-main": "",
|
|
70
72
|
children: p
|
|
71
73
|
})]
|
|
72
74
|
}),
|
|
73
|
-
m && /* @__PURE__ */
|
|
75
|
+
m && /* @__PURE__ */ l("div", {
|
|
74
76
|
className: e.footer,
|
|
75
77
|
children: m
|
|
76
78
|
})
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
var e = {
|
|
4
|
-
shell: "
|
|
5
|
-
header: "
|
|
6
|
-
body: "
|
|
7
|
-
navWrapper: "
|
|
8
|
-
navInner: "
|
|
9
|
-
scrim: "
|
|
10
|
-
main: "
|
|
11
|
-
footer: "
|
|
4
|
+
shell: "_shell_1y4cv_4",
|
|
5
|
+
header: "_header_1y4cv_16",
|
|
6
|
+
body: "_body_1y4cv_21",
|
|
7
|
+
navWrapper: "_navWrapper_1y4cv_32",
|
|
8
|
+
navInner: "_navInner_1y4cv_58",
|
|
9
|
+
scrim: "_scrim_1y4cv_70",
|
|
10
|
+
main: "_main_1y4cv_87",
|
|
11
|
+
footer: "_footer_1y4cv_93"
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
14
14
|
export { e as default };
|
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
import { Avatar as e } from "../avatar/avatar.js";
|
|
4
4
|
import t from "./avatar-group.module.js";
|
|
5
5
|
import { cn as n } from "@cascivo/core";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { Children as r } from "react";
|
|
7
|
+
import { builtin as i, t as a } from "@cascivo/i18n";
|
|
8
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
9
9
|
//#region ../components/src/avatar-group/avatar-group.tsx
|
|
10
10
|
function c({ max: c, total: l, spacing: u = "md", isGrid: d = !1, labels: f, className: p, children: m, ...h }) {
|
|
11
|
-
let g =
|
|
12
|
-
return /* @__PURE__ */
|
|
11
|
+
let g = r.toArray(m), _ = c == null ? g : g.slice(0, c), v = (l ?? g.length) - _.length, y = f?.more?.(v) ?? a(i.avatarGroup.more, { count: v });
|
|
12
|
+
return /* @__PURE__ */ s("div", {
|
|
13
13
|
role: "group",
|
|
14
14
|
"data-spacing": u,
|
|
15
15
|
"data-grid": d || void 0,
|
|
16
16
|
className: n(t.group, p),
|
|
17
17
|
...h,
|
|
18
|
-
children: [_, v > 0 && /* @__PURE__ */
|
|
18
|
+
children: [_, v > 0 && /* @__PURE__ */ o(e, {
|
|
19
19
|
className: t.overflow,
|
|
20
20
|
fallback: `+${v}`,
|
|
21
21
|
"aria-label": y
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import e from "./bottom-sheet.module.js";
|
|
4
4
|
import { DismissableLayer as t, FocusScope as n, Portal as r, Presence as i, cn as a, useControllableSignal as o, useDraggable as s, useScrollLock as c, useSignals as l } from "@cascivo/core";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { useId as u } from "react";
|
|
6
|
+
import { builtin as d, t as f } from "@cascivo/i18n";
|
|
7
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
8
8
|
//#region ../components/src/bottom-sheet/bottom-sheet.tsx
|
|
9
9
|
var h = 120, g = .6, _ = .1, v = [.5, .92];
|
|
10
10
|
function y({ open: y, defaultOpen: b, onOpenChange: x, snapPoints: S = v, activeSnap: C, defaultSnap: w = 0, onSnapChange: T, title: E, description: D, children: O, labels: k, className: A }) {
|
|
@@ -33,22 +33,22 @@ function y({ open: y, defaultOpen: b, onOpenChange: x, snapPoints: S = v, active
|
|
|
33
33
|
for (let e = 1; e < F.length; e++) Math.abs((F[e] ?? 0) - r) < Math.abs((F[i] ?? 0) - r) && (i = e);
|
|
34
34
|
P(i);
|
|
35
35
|
}
|
|
36
|
-
}), W =
|
|
36
|
+
}), W = u(), G = u(), K = k?.close ?? f(d.bottomSheet.close), q = k?.handle ?? f(d.bottomSheet.handle), J = `${(1 - R / I) * 100}%`, Y = {
|
|
37
37
|
"--_sheet-height": `${I * 100}dvh`,
|
|
38
38
|
"--_sheet-y": J,
|
|
39
39
|
"--_sheet-drag": `${B.value.y}px`
|
|
40
40
|
};
|
|
41
|
-
return /* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ p(r, { children: /* @__PURE__ */ p(i, {
|
|
42
42
|
present: j,
|
|
43
|
-
children: /* @__PURE__ */
|
|
43
|
+
children: /* @__PURE__ */ p("div", {
|
|
44
44
|
className: e.overlay,
|
|
45
|
-
children: /* @__PURE__ */
|
|
45
|
+
children: /* @__PURE__ */ p(t, {
|
|
46
46
|
onDismiss: () => M(!1),
|
|
47
|
-
children: /* @__PURE__ */
|
|
47
|
+
children: /* @__PURE__ */ p(n, {
|
|
48
48
|
trapped: !0,
|
|
49
49
|
restoreFocus: !0,
|
|
50
50
|
autoFocus: !0,
|
|
51
|
-
children: /* @__PURE__ */
|
|
51
|
+
children: /* @__PURE__ */ m("div", {
|
|
52
52
|
role: "dialog",
|
|
53
53
|
"aria-modal": "true",
|
|
54
54
|
"aria-labelledby": E ? W : void 0,
|
|
@@ -56,38 +56,38 @@ function y({ open: y, defaultOpen: b, onOpenChange: x, snapPoints: S = v, active
|
|
|
56
56
|
"data-dragging": H.value ? "" : void 0,
|
|
57
57
|
className: a(e.panel, A),
|
|
58
58
|
style: Y,
|
|
59
|
-
children: [/* @__PURE__ */
|
|
59
|
+
children: [/* @__PURE__ */ m("div", {
|
|
60
60
|
className: e.header,
|
|
61
61
|
ref: z,
|
|
62
62
|
children: [
|
|
63
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ p("div", {
|
|
64
64
|
className: e.handle,
|
|
65
65
|
role: "separator",
|
|
66
66
|
"aria-label": q,
|
|
67
67
|
"aria-orientation": "horizontal"
|
|
68
68
|
}),
|
|
69
|
-
(E || D) && /* @__PURE__ */
|
|
69
|
+
(E || D) && /* @__PURE__ */ m("div", {
|
|
70
70
|
className: e.heading,
|
|
71
|
-
children: [E && /* @__PURE__ */
|
|
71
|
+
children: [E && /* @__PURE__ */ p("h2", {
|
|
72
72
|
id: W,
|
|
73
73
|
className: e.title,
|
|
74
74
|
children: E
|
|
75
|
-
}), D && /* @__PURE__ */
|
|
75
|
+
}), D && /* @__PURE__ */ p("p", {
|
|
76
76
|
id: G,
|
|
77
77
|
className: e.description,
|
|
78
78
|
children: D
|
|
79
79
|
})]
|
|
80
80
|
}),
|
|
81
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ p("button", {
|
|
82
82
|
type: "button",
|
|
83
83
|
"aria-label": K,
|
|
84
84
|
onClick: () => M(!1),
|
|
85
85
|
className: e.close,
|
|
86
|
-
children: /* @__PURE__ */
|
|
86
|
+
children: /* @__PURE__ */ p("svg", {
|
|
87
87
|
"aria-hidden": "true",
|
|
88
88
|
viewBox: "0 0 16 16",
|
|
89
89
|
className: e.closeIcon,
|
|
90
|
-
children: /* @__PURE__ */
|
|
90
|
+
children: /* @__PURE__ */ p("path", {
|
|
91
91
|
d: "M4 4l8 8M12 4l-8 8",
|
|
92
92
|
fill: "none",
|
|
93
93
|
stroke: "currentColor",
|
|
@@ -97,7 +97,7 @@ function y({ open: y, defaultOpen: b, onOpenChange: x, snapPoints: S = v, active
|
|
|
97
97
|
})
|
|
98
98
|
})
|
|
99
99
|
]
|
|
100
|
-
}), /* @__PURE__ */
|
|
100
|
+
}), /* @__PURE__ */ p("div", {
|
|
101
101
|
className: e.body,
|
|
102
102
|
children: O
|
|
103
103
|
})]
|
|
@@ -3,29 +3,32 @@
|
|
|
3
3
|
import { Spinner as e } from "../spinner/spinner.js";
|
|
4
4
|
import t from "./button.module.js";
|
|
5
5
|
import { Slot as n, cn as r } from "@cascivo/core";
|
|
6
|
-
import {
|
|
6
|
+
import { forwardRef as i } from "react";
|
|
7
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
8
|
//#region ../components/src/button/button.tsx
|
|
8
|
-
|
|
9
|
-
let
|
|
10
|
-
"data-variant":
|
|
9
|
+
var s = i(function({ variant: i = "primary", size: s = "md", loading: c = !1, asChild: l = !1, className: u, disabled: d, children: f, ...p }, m) {
|
|
10
|
+
let h = {
|
|
11
|
+
"data-variant": i,
|
|
11
12
|
"data-size": s,
|
|
12
13
|
"data-state": c ? "loading" : "idle",
|
|
13
14
|
"aria-busy": c || void 0,
|
|
14
15
|
className: r(t.button, u)
|
|
15
16
|
};
|
|
16
|
-
return l ? /* @__PURE__ */
|
|
17
|
-
...
|
|
17
|
+
return l ? /* @__PURE__ */ a(n, {
|
|
18
|
+
...h,
|
|
19
|
+
ref: m,
|
|
18
20
|
...p,
|
|
19
21
|
children: f
|
|
20
|
-
}) : /* @__PURE__ */
|
|
21
|
-
...
|
|
22
|
+
}) : /* @__PURE__ */ o("button", {
|
|
23
|
+
...h,
|
|
24
|
+
ref: m,
|
|
22
25
|
disabled: d || c,
|
|
23
26
|
...p,
|
|
24
|
-
children: [c && /* @__PURE__ */
|
|
27
|
+
children: [c && /* @__PURE__ */ a(e, {
|
|
25
28
|
size: "sm",
|
|
26
29
|
"aria-hidden": "true"
|
|
27
|
-
}), /* @__PURE__ */
|
|
30
|
+
}), /* @__PURE__ */ a("span", { children: f })]
|
|
28
31
|
});
|
|
29
|
-
}
|
|
32
|
+
});
|
|
30
33
|
//#endregion
|
|
31
|
-
export {
|
|
34
|
+
export { s as Button };
|
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
import e from "./button-group.module.js";
|
|
4
4
|
import { cn as t } from "@cascivo/core";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { forwardRef as n } from "react";
|
|
6
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
7
7
|
//#region ../components/src/button-group/button-group.tsx
|
|
8
8
|
function i(e) {
|
|
9
9
|
return Array.from(e.querySelectorAll("button, a[href], [tabindex]")).filter((e) => !e.hasAttribute("disabled") && e.getAttribute("aria-disabled") !== "true");
|
|
10
10
|
}
|
|
11
|
-
var a =
|
|
12
|
-
return /* @__PURE__ */
|
|
11
|
+
var a = n(function({ orientation: n = "horizontal", size: a = "md", roving: o = !1, loop: s = !1, className: c, onKeyDown: l, children: u, ...d }, f) {
|
|
12
|
+
return /* @__PURE__ */ r("div", {
|
|
13
13
|
role: "group",
|
|
14
|
-
"data-orientation":
|
|
14
|
+
"data-orientation": n,
|
|
15
15
|
"data-size": a,
|
|
16
16
|
className: t(e.buttonGroup, c),
|
|
17
17
|
ref: f,
|
|
18
18
|
onKeyDown: (e) => {
|
|
19
19
|
if (l?.(e), !o) return;
|
|
20
|
-
let t =
|
|
20
|
+
let t = n === "horizontal", r = t ? "ArrowRight" : "ArrowDown", a = t ? "ArrowLeft" : "ArrowUp";
|
|
21
21
|
if (![
|
|
22
|
-
|
|
22
|
+
r,
|
|
23
23
|
a,
|
|
24
24
|
"Home",
|
|
25
25
|
"End"
|
|
@@ -29,7 +29,7 @@ var a = r(function({ orientation: r = "horizontal", size: a = "md", roving: o =
|
|
|
29
29
|
let u = c.indexOf(document.activeElement);
|
|
30
30
|
if (u === -1) return;
|
|
31
31
|
let d = u;
|
|
32
|
-
e.key ===
|
|
32
|
+
e.key === r ? d = u + 1 : e.key === a ? d = u - 1 : e.key === "Home" ? d = 0 : e.key === "End" && (d = c.length - 1), d < 0 && (d = s ? c.length - 1 : 0), d >= c.length && (d = s ? 0 : c.length - 1), e.preventDefault(), c[d]?.focus();
|
|
33
33
|
},
|
|
34
34
|
...d,
|
|
35
35
|
children: u
|