@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
package/dist/node/badge/badge.js
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import e from "./badge.module.js";
|
|
4
|
-
import { cn as t } from "@cascivo/core";
|
|
5
|
-
import { jsx as
|
|
4
|
+
import { cn as t, normalizeTone as n } from "@cascivo/core";
|
|
5
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
6
6
|
//#region ../components/src/badge/badge.tsx
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
var i = {
|
|
8
|
+
neutral: "default",
|
|
9
|
+
info: "info",
|
|
10
|
+
success: "success",
|
|
11
|
+
warning: "warning",
|
|
12
|
+
danger: "destructive"
|
|
13
|
+
};
|
|
14
|
+
function a({ variant: a = "default", size: o = "md", className: s, children: c, ...l }) {
|
|
15
|
+
return /* @__PURE__ */ r("span", {
|
|
16
|
+
"data-variant": i[n(a)] ?? a,
|
|
17
|
+
"data-size": o,
|
|
18
|
+
className: t(e.badge, s),
|
|
19
|
+
...l,
|
|
20
|
+
children: c
|
|
14
21
|
});
|
|
15
22
|
}
|
|
16
23
|
//#endregion
|
|
17
|
-
export {
|
|
24
|
+
export { a as Badge };
|
|
@@ -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
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
var e = {
|
|
4
|
-
card: "
|
|
5
|
-
header: "
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
card: "_card_ssezx_2",
|
|
5
|
+
header: "_header_ssezx_12",
|
|
6
|
+
content: "_content_ssezx_12",
|
|
7
|
+
footer: "_footer_ssezx_12",
|
|
8
|
+
headerRow: "_headerRow_ssezx_67",
|
|
9
|
+
headerMain: "_headerMain_ssezx_75",
|
|
10
|
+
headerActions: "_headerActions_ssezx_82",
|
|
11
|
+
title: "_title_ssezx_90"
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
14
14
|
export { e as default };
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
import e from "./carousel.module.js";
|
|
4
4
|
import { cn as t, useControllableSignal as n, useRovingFocus as r, useSignalEffect as i, useSignals as a } from "@cascivo/core";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { useId as o, useRef as s } from "react";
|
|
6
|
+
import { builtin as c, t as l } from "@cascivo/i18n";
|
|
7
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
8
8
|
//#region ../components/src/carousel/carousel.tsx
|
|
9
9
|
function f(e, t) {
|
|
10
10
|
return t || (e == null ? [] : Array.isArray(e) ? e : [e]);
|
|
11
11
|
}
|
|
12
12
|
function p({ children: p, slides: m, index: h, defaultIndex: g, onIndexChange: _, loop: v = !1, className: y, labels: b }) {
|
|
13
13
|
a();
|
|
14
|
-
let x =
|
|
14
|
+
let x = o(), S = f(p, m), C = S.length, [w, T] = n({
|
|
15
15
|
value: h,
|
|
16
16
|
defaultValue: g ?? 0,
|
|
17
17
|
onChange: _
|
|
18
|
-
}), E =
|
|
18
|
+
}), E = s(null), D = s([]), O = s(!1), { getItemProps: k, setActiveIndex: A } = r({
|
|
19
19
|
orientation: "horizontal",
|
|
20
20
|
loop: v
|
|
21
21
|
});
|
|
@@ -40,28 +40,28 @@ function p({ children: p, slides: m, index: h, defaultIndex: g, onIndexChange: _
|
|
|
40
40
|
}), window.setTimeout(() => {
|
|
41
41
|
O.current = !1;
|
|
42
42
|
}, 400)), T(t), A(t);
|
|
43
|
-
}, M = b?.region ??
|
|
44
|
-
return /* @__PURE__ */
|
|
43
|
+
}, M = b?.region ?? l(c.carousel.region), N = b?.previous ?? l(c.carousel.previous), P = b?.next ?? l(c.carousel.next);
|
|
44
|
+
return /* @__PURE__ */ d("section", {
|
|
45
45
|
className: t(e.carousel, y),
|
|
46
46
|
"aria-roledescription": "carousel",
|
|
47
47
|
"aria-label": M,
|
|
48
|
-
children: [/* @__PURE__ */
|
|
48
|
+
children: [/* @__PURE__ */ d("div", {
|
|
49
49
|
className: e.viewport,
|
|
50
50
|
children: [
|
|
51
|
-
/* @__PURE__ */
|
|
51
|
+
/* @__PURE__ */ u("button", {
|
|
52
52
|
type: "button",
|
|
53
53
|
className: t(e.nav, e.prev),
|
|
54
54
|
"aria-label": N,
|
|
55
55
|
"aria-controls": `${x}-track`,
|
|
56
56
|
disabled: !v && w.value <= 0,
|
|
57
57
|
onClick: () => j(w.value - 1),
|
|
58
|
-
children: /* @__PURE__ */
|
|
58
|
+
children: /* @__PURE__ */ u("svg", {
|
|
59
59
|
width: "20",
|
|
60
60
|
height: "20",
|
|
61
61
|
viewBox: "0 0 24 24",
|
|
62
62
|
fill: "none",
|
|
63
63
|
"aria-hidden": "true",
|
|
64
|
-
children: /* @__PURE__ */
|
|
64
|
+
children: /* @__PURE__ */ u("path", {
|
|
65
65
|
d: "m15 18-6-6 6-6",
|
|
66
66
|
stroke: "currentColor",
|
|
67
67
|
strokeWidth: "2",
|
|
@@ -70,18 +70,18 @@ function p({ children: p, slides: m, index: h, defaultIndex: g, onIndexChange: _
|
|
|
70
70
|
})
|
|
71
71
|
})
|
|
72
72
|
}),
|
|
73
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ u("div", {
|
|
74
74
|
ref: E,
|
|
75
75
|
id: `${x}-track`,
|
|
76
76
|
className: e.track,
|
|
77
|
-
children: S.map((t, n) => /* @__PURE__ */
|
|
77
|
+
children: S.map((t, n) => /* @__PURE__ */ u("div", {
|
|
78
78
|
ref: (e) => {
|
|
79
79
|
D.current[n] = e;
|
|
80
80
|
},
|
|
81
81
|
className: e.slide,
|
|
82
82
|
role: "group",
|
|
83
83
|
"aria-roledescription": "slide",
|
|
84
|
-
"aria-label":
|
|
84
|
+
"aria-label": l(c.carousel.slide, {
|
|
85
85
|
n: n + 1,
|
|
86
86
|
total: C
|
|
87
87
|
}),
|
|
@@ -89,20 +89,20 @@ function p({ children: p, slides: m, index: h, defaultIndex: g, onIndexChange: _
|
|
|
89
89
|
children: t
|
|
90
90
|
}, n))
|
|
91
91
|
}),
|
|
92
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ u("button", {
|
|
93
93
|
type: "button",
|
|
94
94
|
className: t(e.nav, e.next),
|
|
95
95
|
"aria-label": P,
|
|
96
96
|
"aria-controls": `${x}-track`,
|
|
97
97
|
disabled: !v && w.value >= C - 1,
|
|
98
98
|
onClick: () => j(w.value + 1),
|
|
99
|
-
children: /* @__PURE__ */
|
|
99
|
+
children: /* @__PURE__ */ u("svg", {
|
|
100
100
|
width: "20",
|
|
101
101
|
height: "20",
|
|
102
102
|
viewBox: "0 0 24 24",
|
|
103
103
|
fill: "none",
|
|
104
104
|
"aria-hidden": "true",
|
|
105
|
-
children: /* @__PURE__ */
|
|
105
|
+
children: /* @__PURE__ */ u("path", {
|
|
106
106
|
d: "m9 18 6-6-6-6",
|
|
107
107
|
stroke: "currentColor",
|
|
108
108
|
strokeWidth: "2",
|
|
@@ -112,17 +112,17 @@ function p({ children: p, slides: m, index: h, defaultIndex: g, onIndexChange: _
|
|
|
112
112
|
})
|
|
113
113
|
})
|
|
114
114
|
]
|
|
115
|
-
}), /* @__PURE__ */
|
|
115
|
+
}), /* @__PURE__ */ u("div", {
|
|
116
116
|
className: e.dots,
|
|
117
117
|
role: "group",
|
|
118
118
|
"aria-label": M,
|
|
119
119
|
children: S.map((t, n) => {
|
|
120
120
|
let r = k(n);
|
|
121
|
-
return /* @__PURE__ */
|
|
121
|
+
return /* @__PURE__ */ u("button", {
|
|
122
122
|
ref: r.ref,
|
|
123
123
|
type: "button",
|
|
124
124
|
className: e.dot,
|
|
125
|
-
"aria-label":
|
|
125
|
+
"aria-label": l(c.carousel.goTo, { n: n + 1 }),
|
|
126
126
|
"aria-current": n === w.value || void 0,
|
|
127
127
|
"data-active": n === w.value || void 0,
|
|
128
128
|
tabIndex: r.tabIndex,
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import e from "./checkbox.module.js";
|
|
4
|
-
import { cn as t,
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { cn as t, composeRefs as n, useEffectPropSignal as r, useSignalEffect as i } from "@cascivo/core";
|
|
5
|
+
import { forwardRef as a, useRef as o } from "react";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
7
|
//#region ../components/src/checkbox/checkbox.tsx
|
|
8
|
-
|
|
9
|
-
let
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
var l = a(function({ label: a, indeterminate: l = !1, className: u, id: d, disabled: f, ...p }, m) {
|
|
9
|
+
let h = o(null), g = r(l);
|
|
10
|
+
i(() => {
|
|
11
|
+
h.current && (h.current.indeterminate = g.value);
|
|
12
12
|
});
|
|
13
|
-
let
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
className: t(e.wrapper,
|
|
16
|
-
"data-disabled":
|
|
13
|
+
let _ = d ?? (a ? `cascade-checkbox-${a.toLowerCase().replace(/\s+/g, "-")}` : void 0);
|
|
14
|
+
return /* @__PURE__ */ c("label", {
|
|
15
|
+
className: t(e.wrapper, u),
|
|
16
|
+
"data-disabled": f || void 0,
|
|
17
17
|
children: [
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
ref:
|
|
20
|
-
id:
|
|
18
|
+
/* @__PURE__ */ s("input", {
|
|
19
|
+
ref: n(m, h),
|
|
20
|
+
id: _,
|
|
21
21
|
type: "checkbox",
|
|
22
22
|
className: e.input,
|
|
23
|
-
disabled:
|
|
24
|
-
...
|
|
23
|
+
disabled: f,
|
|
24
|
+
...p
|
|
25
25
|
}),
|
|
26
|
-
/* @__PURE__ */
|
|
26
|
+
/* @__PURE__ */ s("span", {
|
|
27
27
|
className: e.control,
|
|
28
28
|
"aria-hidden": "true"
|
|
29
29
|
}),
|
|
30
|
-
|
|
30
|
+
a && /* @__PURE__ */ s("span", {
|
|
31
31
|
className: e.label,
|
|
32
|
-
children:
|
|
32
|
+
children: a
|
|
33
33
|
})
|
|
34
34
|
]
|
|
35
35
|
});
|
|
36
|
-
}
|
|
36
|
+
});
|
|
37
37
|
//#endregion
|
|
38
|
-
export {
|
|
38
|
+
export { l as Checkbox };
|
|
@@ -2,28 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
import e from "./checkbox-card.module.js";
|
|
4
4
|
import { cn as t } from "@cascivo/core";
|
|
5
|
-
import {
|
|
5
|
+
import { forwardRef as n } from "react";
|
|
6
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
7
|
//#region ../components/src/checkbox-card/checkbox-card.tsx
|
|
7
|
-
|
|
8
|
-
return /* @__PURE__ */
|
|
8
|
+
var a = n(function({ title: n, description: a, checked: o, defaultChecked: s, disabled: c, onCheckedChange: l, className: u, ...d }, f) {
|
|
9
|
+
return /* @__PURE__ */ i("label", {
|
|
9
10
|
className: t(e.card, u),
|
|
10
11
|
"data-disabled": c || void 0,
|
|
11
12
|
children: [
|
|
12
|
-
/* @__PURE__ */
|
|
13
|
+
/* @__PURE__ */ r("input", {
|
|
13
14
|
type: "checkbox",
|
|
14
15
|
className: e.input,
|
|
15
16
|
disabled: c,
|
|
16
17
|
...o === void 0 ? { defaultChecked: s } : { checked: o },
|
|
17
18
|
onChange: (e) => l?.(e.currentTarget.checked),
|
|
19
|
+
ref: f,
|
|
18
20
|
...d
|
|
19
21
|
}),
|
|
20
|
-
/* @__PURE__ */
|
|
22
|
+
/* @__PURE__ */ r("span", {
|
|
21
23
|
className: e.glyph,
|
|
22
24
|
"aria-hidden": "true",
|
|
23
|
-
children: /* @__PURE__ */
|
|
25
|
+
children: /* @__PURE__ */ r("svg", {
|
|
24
26
|
viewBox: "0 0 12 12",
|
|
25
27
|
className: e.check,
|
|
26
|
-
children: /* @__PURE__ */
|
|
28
|
+
children: /* @__PURE__ */ r("path", {
|
|
27
29
|
d: "M2.5 6.5 5 9l4.5-5.5",
|
|
28
30
|
fill: "none",
|
|
29
31
|
stroke: "currentColor",
|
|
@@ -31,18 +33,18 @@ function i({ title: i, description: a, checked: o, defaultChecked: s, disabled:
|
|
|
31
33
|
})
|
|
32
34
|
})
|
|
33
35
|
}),
|
|
34
|
-
/* @__PURE__ */
|
|
36
|
+
/* @__PURE__ */ i("span", {
|
|
35
37
|
className: e.body,
|
|
36
|
-
children: [/* @__PURE__ */
|
|
38
|
+
children: [/* @__PURE__ */ r("span", {
|
|
37
39
|
className: e.title,
|
|
38
|
-
children:
|
|
39
|
-
}), a && /* @__PURE__ */
|
|
40
|
+
children: n
|
|
41
|
+
}), a && /* @__PURE__ */ r("span", {
|
|
40
42
|
className: e.description,
|
|
41
43
|
children: a
|
|
42
44
|
})]
|
|
43
45
|
})
|
|
44
46
|
]
|
|
45
47
|
});
|
|
46
|
-
}
|
|
48
|
+
});
|
|
47
49
|
//#endregion
|
|
48
|
-
export {
|
|
50
|
+
export { a as CheckboxCard };
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import e from "./collapsible.module.js";
|
|
4
4
|
import { cn as t, useControllableSignal as n, useSignals as r } from "@cascivo/core";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { useId as i } from "react";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
7
|
//#region ../components/src/collapsible/collapsible.tsx
|
|
8
8
|
function s({ open: s, defaultOpen: c = !1, onOpenChange: l, trigger: u, disabled: d = !1, className: f, children: p }) {
|
|
9
9
|
r();
|
|
@@ -11,11 +11,11 @@ function s({ open: s, defaultOpen: c = !1, onOpenChange: l, trigger: u, disabled
|
|
|
11
11
|
...s === void 0 ? {} : { value: s },
|
|
12
12
|
defaultValue: c,
|
|
13
13
|
...l ? { onChange: l } : {}
|
|
14
|
-
}), g =
|
|
15
|
-
return /* @__PURE__ */
|
|
14
|
+
}), g = i(), _ = `${g}-content`, v = `${g}-trigger`, y = m.value;
|
|
15
|
+
return /* @__PURE__ */ o("div", {
|
|
16
16
|
"data-state": y ? "open" : "closed",
|
|
17
17
|
className: t(e.root, f),
|
|
18
|
-
children: [/* @__PURE__ */
|
|
18
|
+
children: [/* @__PURE__ */ a("button", {
|
|
19
19
|
type: "button",
|
|
20
20
|
id: v,
|
|
21
21
|
"aria-expanded": y,
|
|
@@ -25,13 +25,13 @@ function s({ open: s, defaultOpen: c = !1, onOpenChange: l, trigger: u, disabled
|
|
|
25
25
|
className: e.trigger,
|
|
26
26
|
onClick: () => h(!y),
|
|
27
27
|
children: u
|
|
28
|
-
}), /* @__PURE__ */
|
|
28
|
+
}), /* @__PURE__ */ a("div", {
|
|
29
29
|
id: _,
|
|
30
30
|
role: "region",
|
|
31
31
|
"aria-labelledby": v,
|
|
32
32
|
"data-state": y ? "open" : "closed",
|
|
33
33
|
className: e.content,
|
|
34
|
-
children: /* @__PURE__ */
|
|
34
|
+
children: /* @__PURE__ */ a("div", {
|
|
35
35
|
className: e.contentInner,
|
|
36
36
|
children: p
|
|
37
37
|
})
|