@cascivo/react 0.12.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 +36 -33
- package/dist/app-shell/app-shell.module.js +8 -8
- package/dist/avatar-group/avatar-group.js +6 -6
- package/dist/badge/badge.js +17 -10
- package/dist/bottom-sheet/bottom-sheet.js +18 -18
- package/dist/button/button.css +1 -1
- package/dist/button/button.js +15 -12
- package/dist/button/button.module.js +1 -1
- package/dist/button-group/button-group.js +8 -8
- package/dist/card/card.css +1 -1
- package/dist/card/card.module.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.css +1 -1
- package/dist/combobox/combobox.js +86 -86
- package/dist/combobox/combobox.module.js +15 -15
- 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.css +1 -1
- package/dist/data-table/data-table.js +8 -2
- package/dist/data-table/data-table.module.js +29 -29
- package/dist/date-picker/date-picker.css +1 -1
- package/dist/date-picker/date-picker.js +25 -25
- package/dist/date-picker/date-picker.module.js +19 -19
- 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.css +1 -1
- package/dist/file-uploader/file-uploader.js +19 -19
- package/dist/file-uploader/file-uploader.module.js +14 -14
- package/dist/filter/filter.js +10 -9
- package/dist/header-panel/header-panel.js +31 -31
- package/dist/hover-card/hover-card.js +21 -21
- package/dist/icon-button/icon-button.css +1 -1
- package/dist/icon-button/icon-button.js +5 -5
- package/dist/icon-button/icon-button.module.js +1 -1
- package/dist/index.d.ts +1475 -251
- package/dist/input/input.css +1 -1
- package/dist/input/input.js +22 -21
- package/dist/input/input.module.js +5 -5
- package/dist/item/item.css +1 -1
- package/dist/item/item.module.js +6 -6
- package/dist/layouts/src/page-header/page-header.css +1 -0
- package/dist/layouts/src/page-header/page-header.js +33 -0
- package/dist/layouts/src/page-header/page-header.module.js +13 -0
- package/dist/link/link.js +14 -12
- 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 +36 -33
- package/dist/node/app-shell/app-shell.module.js +8 -8
- package/dist/node/avatar-group/avatar-group.js +6 -6
- package/dist/node/badge/badge.js +17 -10
- package/dist/node/bottom-sheet/bottom-sheet.js +18 -18
- package/dist/node/button/button.js +15 -12
- package/dist/node/button/button.module.js +1 -1
- package/dist/node/button-group/button-group.js +8 -8
- package/dist/node/card/card.module.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/combobox/combobox.module.js +15 -15
- 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 +8 -2
- package/dist/node/data-table/data-table.module.js +29 -29
- package/dist/node/date-picker/date-picker.js +25 -25
- package/dist/node/date-picker/date-picker.module.js +19 -19
- 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/file-uploader/file-uploader.module.js +14 -14
- package/dist/node/filter/filter.js +10 -9
- 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/icon-button/icon-button.module.js +1 -1
- package/dist/node/input/input.js +22 -21
- package/dist/node/input/input.module.js +5 -5
- package/dist/node/item/item.module.js +6 -6
- package/dist/node/layouts/src/page-header/page-header.js +33 -0
- package/dist/node/layouts/src/page-header/page-header.module.js +12 -0
- package/dist/node/link/link.js +14 -12
- 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 +50 -44
- package/dist/node/notification/notification.module.js +7 -7
- package/dist/node/number-input/number-input.js +52 -50
- package/dist/node/number-input/number-input.module.js +8 -8
- package/dist/node/otp-input/otp-input.js +8 -8
- package/dist/node/otp-input/otp-input.module.js +2 -2
- package/dist/node/overflow-menu/overflow-menu.js +18 -13
- package/dist/node/password-input/password-input.js +28 -27
- package/dist/node/password-input/password-input.module.js +7 -7
- package/dist/node/popover/popover.js +26 -24
- package/dist/node/progress/progress.js +3 -2
- 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 +4 -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/search/search.module.js +5 -5
- 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/stat/stat.js +6 -5
- package/dist/node/stat/stat.module.js +7 -7
- package/dist/node/status/status.js +18 -11
- package/dist/node/steps/steps.js +23 -23
- package/dist/node/structured-list/structured-list.js +33 -32
- package/dist/node/tabs/tabs.js +49 -47
- package/dist/node/tag/tag.js +22 -15
- package/dist/node/tags-input/tags-input.js +35 -35
- package/dist/node/tags-input/tags-input.module.js +4 -4
- package/dist/node/textarea/textarea.js +22 -21
- package/dist/node/tile/tile.module.js +3 -3
- package/dist/node/time-picker/time-picker.js +22 -21
- package/dist/node/time-picker/time-picker.module.js +5 -5
- package/dist/node/timeline/timeline.js +22 -16
- 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.css +1 -1
- package/dist/notification/notification.js +50 -44
- package/dist/notification/notification.module.js +7 -7
- package/dist/number-input/number-input.css +1 -1
- package/dist/number-input/number-input.js +52 -50
- package/dist/number-input/number-input.module.js +8 -8
- package/dist/otp-input/otp-input.css +1 -1
- package/dist/otp-input/otp-input.js +8 -8
- package/dist/otp-input/otp-input.module.js +2 -2
- package/dist/overflow-menu/overflow-menu.js +18 -13
- package/dist/password-input/password-input.css +1 -1
- package/dist/password-input/password-input.js +28 -27
- package/dist/password-input/password-input.module.js +7 -7
- package/dist/popover/popover.js +26 -24
- package/dist/progress/progress.js +3 -2
- 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 +4 -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.css +1 -1
- package/dist/search/search.js +49 -49
- package/dist/search/search.module.js +5 -5
- 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/stat/stat.css +1 -1
- package/dist/stat/stat.js +6 -5
- package/dist/stat/stat.module.js +7 -7
- package/dist/status/status.js +18 -11
- package/dist/steps/steps.js +23 -23
- package/dist/structured-list/structured-list.js +33 -32
- package/dist/styles.css +87 -23
- package/dist/tabs/tabs.js +49 -47
- package/dist/tag/tag.js +22 -15
- package/dist/tags-input/tags-input.css +1 -1
- package/dist/tags-input/tags-input.js +35 -35
- package/dist/tags-input/tags-input.module.js +4 -4
- package/dist/textarea/textarea.js +22 -21
- package/dist/tile/tile.css +1 -1
- package/dist/tile/tile.module.js +3 -3
- package/dist/time-picker/time-picker.css +1 -1
- package/dist/time-picker/time-picker.js +22 -21
- package/dist/time-picker/time-picker.module.js +5 -5
- package/dist/timeline/timeline.js +22 -16
- 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
|
@@ -1,92 +1,92 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import e from "./navigation-menu.module.js";
|
|
4
|
-
import { DismissableLayer as t, Presence as n, cn as r,
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { DismissableLayer as t, Presence as n, cn as r, focusElement as i, getLinkComponent as a, useAnchorPosition as o, useRovingFocus as s, useSignal as c, useSignals as l } from "@cascivo/core";
|
|
5
|
+
import { useId as u, useRef as d } from "react";
|
|
6
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
7
7
|
//#region ../components/src/navigation-menu/navigation-menu.tsx
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
let
|
|
8
|
+
function m({ items: t, "aria-label": n, orientation: i = "horizontal", className: a }) {
|
|
9
|
+
l();
|
|
10
|
+
let o = u(), d = c(null), p = s({
|
|
11
11
|
orientation: i,
|
|
12
12
|
loop: !0
|
|
13
13
|
});
|
|
14
|
-
return /* @__PURE__ */
|
|
14
|
+
return /* @__PURE__ */ f("nav", {
|
|
15
15
|
"aria-label": n,
|
|
16
16
|
className: r(e.nav, a),
|
|
17
17
|
"data-orientation": i,
|
|
18
|
-
children: /* @__PURE__ */
|
|
18
|
+
children: /* @__PURE__ */ f("ul", {
|
|
19
19
|
role: "list",
|
|
20
20
|
className: e.list,
|
|
21
|
-
children: t.map((e, t) => /* @__PURE__ */
|
|
21
|
+
children: t.map((e, t) => /* @__PURE__ */ f(h, {
|
|
22
22
|
item: e,
|
|
23
|
-
baseId:
|
|
24
|
-
openId:
|
|
23
|
+
baseId: o,
|
|
24
|
+
openId: d,
|
|
25
25
|
itemProps: p.getItemProps(t)
|
|
26
26
|
}, e.id))
|
|
27
27
|
})
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
let
|
|
33
|
-
anchorRef:
|
|
34
|
-
floatingRef:
|
|
30
|
+
function h({ item: t, baseId: r, openId: s, itemProps: c }) {
|
|
31
|
+
l();
|
|
32
|
+
let u = d(null), m = d(null), h = t.content != null, _ = s.value === t.id, v = `${r}-panel-${t.id}`, { anchorStyle: y, floatingStyle: b } = o({
|
|
33
|
+
anchorRef: u,
|
|
34
|
+
floatingRef: m,
|
|
35
35
|
placement: "bottom-start",
|
|
36
|
-
enabled:
|
|
37
|
-
}), { ref:
|
|
38
|
-
if (!
|
|
39
|
-
let n =
|
|
40
|
-
return /* @__PURE__ */
|
|
36
|
+
enabled: _
|
|
37
|
+
}), { ref: x, onKeyDown: S, ...C } = c;
|
|
38
|
+
if (!h) {
|
|
39
|
+
let n = a();
|
|
40
|
+
return /* @__PURE__ */ f("li", {
|
|
41
41
|
className: e.item,
|
|
42
|
-
children: /* @__PURE__ */
|
|
43
|
-
ref: (e) =>
|
|
42
|
+
children: /* @__PURE__ */ f(n, {
|
|
43
|
+
ref: (e) => x(e),
|
|
44
44
|
href: t.href,
|
|
45
45
|
className: e.link,
|
|
46
|
-
onKeyDown:
|
|
47
|
-
...
|
|
46
|
+
onKeyDown: S,
|
|
47
|
+
...C,
|
|
48
48
|
children: t.label
|
|
49
49
|
})
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
-
return /* @__PURE__ */
|
|
52
|
+
return /* @__PURE__ */ p("li", {
|
|
53
53
|
className: e.item,
|
|
54
|
-
children: [/* @__PURE__ */
|
|
54
|
+
children: [/* @__PURE__ */ f("button", {
|
|
55
55
|
ref: (e) => {
|
|
56
|
-
|
|
56
|
+
u.current = e, x(e);
|
|
57
57
|
},
|
|
58
58
|
type: "button",
|
|
59
|
-
"aria-expanded":
|
|
60
|
-
"aria-controls":
|
|
61
|
-
"data-state":
|
|
59
|
+
"aria-expanded": _,
|
|
60
|
+
"aria-controls": v,
|
|
61
|
+
"data-state": _ ? "open" : "closed",
|
|
62
62
|
className: e.trigger,
|
|
63
|
-
style:
|
|
63
|
+
style: y,
|
|
64
64
|
onClick: () => {
|
|
65
|
-
|
|
65
|
+
s.value = _ ? null : t.id;
|
|
66
66
|
},
|
|
67
67
|
onKeyDown: (e) => {
|
|
68
|
-
|
|
68
|
+
S(e), !e.defaultPrevented && e.key === "Escape" && (s.value = null);
|
|
69
69
|
},
|
|
70
|
-
...
|
|
70
|
+
...C,
|
|
71
71
|
children: t.label
|
|
72
|
-
}), /* @__PURE__ */
|
|
73
|
-
present:
|
|
74
|
-
children: /* @__PURE__ */
|
|
75
|
-
panelId:
|
|
76
|
-
floatingRef:
|
|
77
|
-
floatingStyle:
|
|
72
|
+
}), /* @__PURE__ */ f(n, {
|
|
73
|
+
present: _,
|
|
74
|
+
children: /* @__PURE__ */ f(g, {
|
|
75
|
+
panelId: v,
|
|
76
|
+
floatingRef: m,
|
|
77
|
+
floatingStyle: b,
|
|
78
78
|
onClose: () => {
|
|
79
|
-
|
|
79
|
+
s.value = null, i(u.current);
|
|
80
80
|
},
|
|
81
81
|
children: t.content
|
|
82
82
|
})
|
|
83
83
|
})]
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
return /* @__PURE__ */
|
|
86
|
+
function g({ panelId: n, floatingRef: r, floatingStyle: i, onClose: a, children: o }) {
|
|
87
|
+
return /* @__PURE__ */ f(t, {
|
|
88
88
|
onDismiss: a,
|
|
89
|
-
children: /* @__PURE__ */
|
|
89
|
+
children: /* @__PURE__ */ f("div", {
|
|
90
90
|
ref: r,
|
|
91
91
|
id: n,
|
|
92
92
|
className: e.panel,
|
|
@@ -96,4 +96,4 @@ function h({ panelId: n, floatingRef: r, floatingStyle: i, onClose: a, children:
|
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
98
|
//#endregion
|
|
99
|
-
export {
|
|
99
|
+
export { m as NavigationMenu };
|
|
@@ -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,74 +2,77 @@
|
|
|
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
|
-
function d({ header: d, nav: f, children: p, footer: m, open: h, defaultOpen: g, onOpenChange: _, className: v }) {
|
|
8
|
+
function d({ header: d, nav: f, children: p, footer: m, open: h, defaultOpen: g, onOpenChange: _, className: v, ...y }) {
|
|
9
9
|
i();
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
let
|
|
13
|
-
function
|
|
14
|
-
|
|
10
|
+
let b = h !== void 0, x = n(h ?? g ?? !0);
|
|
11
|
+
b && (x.value = h);
|
|
12
|
+
let S = s(null), C = s(null);
|
|
13
|
+
function w(e) {
|
|
14
|
+
b || (x.value = e), _?.(e);
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
typeof document < "u" && (
|
|
16
|
+
function T() {
|
|
17
|
+
typeof document < "u" && (C.current = document.activeElement), w(!x.value);
|
|
18
18
|
}
|
|
19
19
|
r(() => {
|
|
20
|
-
|
|
20
|
+
b || g !== void 0 || typeof window > "u" || typeof window.matchMedia != "function" || window.matchMedia("(max-width: 63.999rem)").matches && (x.value = !1);
|
|
21
21
|
}), r(() => {
|
|
22
|
-
if (!
|
|
22
|
+
if (!x.value || typeof document > "u") return;
|
|
23
23
|
let e = (e) => {
|
|
24
|
-
e.key === "Escape" &&
|
|
24
|
+
e.key === "Escape" && w(!1);
|
|
25
25
|
};
|
|
26
26
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
27
27
|
}), r(() => {
|
|
28
|
-
let e =
|
|
29
|
-
if (e) if (
|
|
28
|
+
let e = S.current;
|
|
29
|
+
if (e) if (x.value) e.removeAttribute("inert");
|
|
30
30
|
else {
|
|
31
31
|
e.setAttribute("inert", "");
|
|
32
|
-
let t =
|
|
32
|
+
let t = C.current;
|
|
33
33
|
t && e.contains(document.activeElement) && t.focus();
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
-
let
|
|
37
|
-
onMenuClick:
|
|
38
|
-
menuExpanded:
|
|
36
|
+
let E = o(d) && f ? a(d, {
|
|
37
|
+
onMenuClick: T,
|
|
38
|
+
menuExpanded: x.value
|
|
39
39
|
}) : d;
|
|
40
|
-
return /* @__PURE__ */
|
|
40
|
+
return /* @__PURE__ */ u("div", {
|
|
41
41
|
className: t(e.shell, v),
|
|
42
|
-
"data-open":
|
|
42
|
+
"data-open": x.value,
|
|
43
|
+
...y,
|
|
43
44
|
children: [
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ l("div", {
|
|
45
46
|
className: e.header,
|
|
46
|
-
children:
|
|
47
|
+
children: E
|
|
47
48
|
}),
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ u("div", {
|
|
49
50
|
className: e.body,
|
|
50
|
-
children: [f && /* @__PURE__ */
|
|
51
|
-
ref:
|
|
51
|
+
children: [f && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("div", {
|
|
52
|
+
ref: S,
|
|
52
53
|
className: e.navWrapper,
|
|
53
|
-
"data-open":
|
|
54
|
+
"data-open": x.value,
|
|
54
55
|
"data-testid": "app-shell-nav",
|
|
55
|
-
|
|
56
|
+
"data-cascivo-appshell-nav": "",
|
|
57
|
+
children: /* @__PURE__ */ l("div", {
|
|
56
58
|
className: e.navInner,
|
|
57
59
|
children: f
|
|
58
60
|
})
|
|
59
|
-
}), /* @__PURE__ */
|
|
61
|
+
}), /* @__PURE__ */ l("div", {
|
|
60
62
|
className: e.scrim,
|
|
61
|
-
"data-open":
|
|
63
|
+
"data-open": x.value,
|
|
62
64
|
"data-testid": "app-shell-scrim",
|
|
63
65
|
"aria-hidden": "true",
|
|
64
|
-
onClick: () =>
|
|
65
|
-
})] }), /* @__PURE__ */
|
|
66
|
+
onClick: () => w(!1)
|
|
67
|
+
})] }), /* @__PURE__ */ l("main", {
|
|
66
68
|
id: "cascade-main",
|
|
67
69
|
tabIndex: -1,
|
|
68
70
|
className: e.main,
|
|
71
|
+
"data-cascivo-appshell-main": "",
|
|
69
72
|
children: p
|
|
70
73
|
})]
|
|
71
74
|
}),
|
|
72
|
-
m && /* @__PURE__ */
|
|
75
|
+
m && /* @__PURE__ */ l("div", {
|
|
73
76
|
className: e.footer,
|
|
74
77
|
children: m
|
|
75
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
|