@cascivo/react 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +233 -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/shell-header/shell-header.js +21 -18
- package/dist/node/shell-header/shell-header.module.js +20 -19
- 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/timeline/timeline.js +23 -16
- package/dist/node/timeline/timeline.module.js +7 -7
- 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/shell-header/shell-header.css +1 -1
- package/dist/shell-header/shell-header.js +21 -18
- package/dist/shell-header/shell-header.module.js +20 -19
- 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 +57 -7
- 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/timeline/timeline.css +1 -1
- package/dist/timeline/timeline.js +23 -16
- package/dist/timeline/timeline.module.js +7 -7
- 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,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
|
|
@@ -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
|
})
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import e from "./color-picker.module.js";
|
|
4
4
|
import { cn as t, useControllableSignal as n, useSignal 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 { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
8
8
|
//#region ../components/src/color-picker/color-picker.tsx
|
|
9
9
|
function p(e, t, n) {
|
|
10
10
|
return Math.min(n, Math.max(t, e));
|
|
@@ -75,11 +75,11 @@ function _({ h: e, s: t, l: n, a: r }) {
|
|
|
75
75
|
}
|
|
76
76
|
function v({ value: v, defaultValue: y, onValueChange: b, presets: x, alpha: S = !0, label: C, disabled: w, size: T = "md", className: E, labels: D }) {
|
|
77
77
|
a();
|
|
78
|
-
let O =
|
|
78
|
+
let O = o(), [k, A] = n({
|
|
79
79
|
value: v,
|
|
80
80
|
defaultValue: y ?? "#3b82f6",
|
|
81
81
|
onChange: b
|
|
82
|
-
}), j =
|
|
82
|
+
}), j = s(null), M = r(!1), N = g(m(k.value)), P = (e) => {
|
|
83
83
|
A(h(_(e), S));
|
|
84
84
|
}, F = (e, t) => {
|
|
85
85
|
let n = j.current;
|
|
@@ -119,22 +119,22 @@ function v({ value: v, defaultValue: y, onValueChange: b, presets: x, alpha: S =
|
|
|
119
119
|
}, R = typeof window < "u" ? window.EyeDropper : void 0, z = () => {
|
|
120
120
|
R && new R().open().then((e) => A(e.sRGBHex));
|
|
121
121
|
}, B = {
|
|
122
|
-
hue: D?.hue ??
|
|
123
|
-
alpha: D?.alpha ??
|
|
124
|
-
colorArea: D?.colorArea ??
|
|
125
|
-
eyedropper: D?.eyedropper ??
|
|
122
|
+
hue: D?.hue ?? l(c.colorPicker.hue),
|
|
123
|
+
alpha: D?.alpha ?? l(c.colorPicker.alpha),
|
|
124
|
+
colorArea: D?.colorArea ?? l(c.colorPicker.colorArea),
|
|
125
|
+
eyedropper: D?.eyedropper ?? l(c.colorPicker.eyedropper)
|
|
126
126
|
}, V = h(m(k.value), !1), H = `hsl(${N.h} 100% 50%)`;
|
|
127
|
-
return /* @__PURE__ */
|
|
127
|
+
return /* @__PURE__ */ f("div", {
|
|
128
128
|
className: t(e.picker, E),
|
|
129
129
|
"data-size": T,
|
|
130
130
|
"data-disabled": w || void 0,
|
|
131
131
|
children: [
|
|
132
|
-
C && /* @__PURE__ */
|
|
132
|
+
C && /* @__PURE__ */ d("span", {
|
|
133
133
|
className: e.label,
|
|
134
134
|
id: `${O}-label`,
|
|
135
135
|
children: C
|
|
136
136
|
}),
|
|
137
|
-
/* @__PURE__ */
|
|
137
|
+
/* @__PURE__ */ d("div", {
|
|
138
138
|
ref: j,
|
|
139
139
|
className: e.area,
|
|
140
140
|
role: "slider",
|
|
@@ -147,7 +147,7 @@ function v({ value: v, defaultValue: y, onValueChange: b, presets: x, alpha: S =
|
|
|
147
147
|
w || (e.preventDefault(), M.value = !0, F(e.clientX, e.clientY));
|
|
148
148
|
},
|
|
149
149
|
onKeyDown: I,
|
|
150
|
-
children: /* @__PURE__ */
|
|
150
|
+
children: /* @__PURE__ */ d("span", {
|
|
151
151
|
className: e.thumb,
|
|
152
152
|
style: {
|
|
153
153
|
insetInlineStart: `${N.s}%`,
|
|
@@ -156,15 +156,15 @@ function v({ value: v, defaultValue: y, onValueChange: b, presets: x, alpha: S =
|
|
|
156
156
|
}
|
|
157
157
|
})
|
|
158
158
|
}),
|
|
159
|
-
/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ f("div", {
|
|
160
160
|
className: e.sliders,
|
|
161
161
|
children: [
|
|
162
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ d("label", {
|
|
163
163
|
className: e.srOnly,
|
|
164
164
|
htmlFor: `${O}-hue`,
|
|
165
165
|
children: B.hue
|
|
166
166
|
}),
|
|
167
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ d("input", {
|
|
168
168
|
id: `${O}-hue`,
|
|
169
169
|
className: e.hue,
|
|
170
170
|
type: "range",
|
|
@@ -181,11 +181,11 @@ function v({ value: v, defaultValue: y, onValueChange: b, presets: x, alpha: S =
|
|
|
181
181
|
a: N.a
|
|
182
182
|
})
|
|
183
183
|
}),
|
|
184
|
-
S && /* @__PURE__ */ u
|
|
184
|
+
S && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("label", {
|
|
185
185
|
className: e.srOnly,
|
|
186
186
|
htmlFor: `${O}-alpha`,
|
|
187
187
|
children: B.alpha
|
|
188
|
-
}), /* @__PURE__ */
|
|
188
|
+
}), /* @__PURE__ */ d("input", {
|
|
189
189
|
id: `${O}-alpha`,
|
|
190
190
|
className: e.alpha,
|
|
191
191
|
type: "range",
|
|
@@ -205,11 +205,11 @@ function v({ value: v, defaultValue: y, onValueChange: b, presets: x, alpha: S =
|
|
|
205
205
|
})] })
|
|
206
206
|
]
|
|
207
207
|
}),
|
|
208
|
-
x && x.length > 0 && /* @__PURE__ */
|
|
208
|
+
x && x.length > 0 && /* @__PURE__ */ d("div", {
|
|
209
209
|
className: e.presets,
|
|
210
210
|
role: "group",
|
|
211
211
|
"aria-label": B.colorArea,
|
|
212
|
-
children: x.map((t, n) => /* @__PURE__ */
|
|
212
|
+
children: x.map((t, n) => /* @__PURE__ */ d("button", {
|
|
213
213
|
type: "button",
|
|
214
214
|
className: e.preset,
|
|
215
215
|
style: { backgroundColor: t },
|
|
@@ -222,15 +222,15 @@ function v({ value: v, defaultValue: y, onValueChange: b, presets: x, alpha: S =
|
|
|
222
222
|
}
|
|
223
223
|
}, t))
|
|
224
224
|
}),
|
|
225
|
-
/* @__PURE__ */
|
|
225
|
+
/* @__PURE__ */ f("div", {
|
|
226
226
|
className: e.row,
|
|
227
227
|
children: [
|
|
228
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ d("span", {
|
|
229
229
|
className: e.preview,
|
|
230
230
|
style: { backgroundColor: k.value },
|
|
231
231
|
"aria-hidden": "true"
|
|
232
232
|
}),
|
|
233
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ d("input", {
|
|
234
234
|
className: e.text,
|
|
235
235
|
type: "text",
|
|
236
236
|
value: k.value,
|
|
@@ -238,19 +238,19 @@ function v({ value: v, defaultValue: y, onValueChange: b, presets: x, alpha: S =
|
|
|
238
238
|
"aria-label": C ?? B.colorArea,
|
|
239
239
|
onChange: (e) => A(e.target.value)
|
|
240
240
|
}),
|
|
241
|
-
R && /* @__PURE__ */
|
|
241
|
+
R && /* @__PURE__ */ d("button", {
|
|
242
242
|
type: "button",
|
|
243
243
|
className: e.eyedropper,
|
|
244
244
|
"aria-label": B.eyedropper,
|
|
245
245
|
disabled: w,
|
|
246
246
|
onClick: z,
|
|
247
|
-
children: /* @__PURE__ */
|
|
247
|
+
children: /* @__PURE__ */ d("svg", {
|
|
248
248
|
width: "16",
|
|
249
249
|
height: "16",
|
|
250
250
|
viewBox: "0 0 24 24",
|
|
251
251
|
fill: "none",
|
|
252
252
|
"aria-hidden": "true",
|
|
253
|
-
children: /* @__PURE__ */
|
|
253
|
+
children: /* @__PURE__ */ d("path", {
|
|
254
254
|
d: "m2 22 1-1h3l9-9M3 21v-3l9-9m1.5 1.5-2-2M19 2l3 3-9 9-3-3z",
|
|
255
255
|
stroke: "currentColor",
|
|
256
256
|
strokeWidth: "2",
|