@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
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
import './drawer.css';
|
|
4
4
|
var e = {
|
|
5
|
-
overlay: "
|
|
6
|
-
panel: "
|
|
7
|
-
header: "
|
|
8
|
-
heading: "
|
|
9
|
-
title: "
|
|
10
|
-
description: "
|
|
11
|
-
close: "
|
|
12
|
-
closeIcon: "
|
|
13
|
-
body: "
|
|
5
|
+
overlay: "_overlay_1q94b_2",
|
|
6
|
+
panel: "_panel_1q94b_39",
|
|
7
|
+
header: "_header_1q94b_124",
|
|
8
|
+
heading: "_heading_1q94b_134",
|
|
9
|
+
title: "_title_1q94b_140",
|
|
10
|
+
description: "_description_1q94b_147",
|
|
11
|
+
close: "_close_1q94b_153",
|
|
12
|
+
closeIcon: "_closeIcon_1q94b_181",
|
|
13
|
+
body: "_body_1q94b_186"
|
|
14
14
|
};
|
|
15
15
|
//#endregion
|
|
16
16
|
export { e as default };
|
|
@@ -1,100 +1,100 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import e from "./dropdown.module.js";
|
|
4
|
-
import { composeRefs as t, createMachine as n,
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { composeRefs as t, createMachine as n, focusElement as r, useEffectPropSignal as i, useMachine as a, useSignal as o, useSignalEffect as s, useSignals as c } from "@cascivo/core";
|
|
5
|
+
import { cloneElement as l, useRef as u } from "react";
|
|
6
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
7
7
|
//#region ../components/src/dropdown/dropdown.tsx
|
|
8
|
-
var
|
|
8
|
+
var p = n({
|
|
9
9
|
initial: "closed",
|
|
10
10
|
states: {
|
|
11
11
|
closed: { on: { OPEN: "open" } },
|
|
12
12
|
open: { on: { CLOSE: "closed" } }
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
let [
|
|
15
|
+
function m({ trigger: n, items: m, onSelect: h, placement: g = "bottom-start", open: _, onOpenChange: v }) {
|
|
16
|
+
c();
|
|
17
|
+
let [y, b] = a(p), x = u(null), S = u(null), C = u(null), w = u([]), T = o(-1), E = _ !== void 0, D = E ? _ : y.value === "open", O = i(D), k = m.map((e, t) => ({
|
|
18
18
|
item: e,
|
|
19
19
|
index: t
|
|
20
|
-
})).filter(({ item: e }) => !e.separator && !e.disabled).map(({ index: e }) => e),
|
|
21
|
-
|
|
20
|
+
})).filter(({ item: e }) => !e.separator && !e.disabled).map(({ index: e }) => e), A = (e) => {
|
|
21
|
+
E || b(e ? "OPEN" : "CLOSE"), v?.(e);
|
|
22
22
|
};
|
|
23
|
-
|
|
24
|
-
let e =
|
|
25
|
-
|
|
26
|
-
}),
|
|
27
|
-
|
|
28
|
-
}),
|
|
29
|
-
|
|
30
|
-
}),
|
|
31
|
-
let e =
|
|
23
|
+
s(() => {
|
|
24
|
+
let e = T.value;
|
|
25
|
+
O.value && e >= 0 && w.current[e]?.focus();
|
|
26
|
+
}), s(() => {
|
|
27
|
+
O.value ? T.value = k[0] ?? -1 : T.value = -1;
|
|
28
|
+
}), s(() => {
|
|
29
|
+
O.value ? C.current?.showPopover() : C.current?.hidePopover();
|
|
30
|
+
}), s(() => {
|
|
31
|
+
let e = C.current;
|
|
32
32
|
if (!e) return;
|
|
33
33
|
let t = (e) => {
|
|
34
|
-
e.newState === "closed" &&
|
|
34
|
+
e.newState === "closed" && A(!1);
|
|
35
35
|
};
|
|
36
36
|
return e.addEventListener("toggle", t), () => e.removeEventListener("toggle", t);
|
|
37
37
|
});
|
|
38
|
-
let
|
|
39
|
-
let t =
|
|
40
|
-
!t || t.separator || t.disabled || (
|
|
41
|
-
}, j = (e) => {
|
|
42
|
-
O.length !== 0 && (w.value = O[(O.indexOf(w.value) + e + O.length) % O.length] ?? -1);
|
|
38
|
+
let j = (e) => {
|
|
39
|
+
let t = m[e];
|
|
40
|
+
!t || t.separator || t.disabled || (h?.(t.value), A(!1), r(S.current));
|
|
43
41
|
}, M = (e) => {
|
|
42
|
+
k.length !== 0 && (T.value = k[(k.indexOf(T.value) + e + k.length) % k.length] ?? -1);
|
|
43
|
+
}, N = (e) => {
|
|
44
44
|
switch (e.key) {
|
|
45
45
|
case "ArrowDown":
|
|
46
|
-
e.preventDefault(),
|
|
46
|
+
e.preventDefault(), M(1);
|
|
47
47
|
break;
|
|
48
48
|
case "ArrowUp":
|
|
49
|
-
e.preventDefault(),
|
|
49
|
+
e.preventDefault(), M(-1);
|
|
50
50
|
break;
|
|
51
51
|
case "Home":
|
|
52
|
-
e.preventDefault(),
|
|
52
|
+
e.preventDefault(), T.value = k[0] ?? -1;
|
|
53
53
|
break;
|
|
54
54
|
case "End":
|
|
55
|
-
e.preventDefault(),
|
|
55
|
+
e.preventDefault(), T.value = k[k.length - 1] ?? -1;
|
|
56
56
|
break;
|
|
57
57
|
case "Escape":
|
|
58
|
-
e.preventDefault(),
|
|
58
|
+
e.preventDefault(), A(!1), r(S.current);
|
|
59
59
|
break;
|
|
60
60
|
case "Enter":
|
|
61
61
|
case " ":
|
|
62
|
-
e.preventDefault(),
|
|
62
|
+
e.preventDefault(), j(T.value);
|
|
63
63
|
break;
|
|
64
64
|
}
|
|
65
|
-
},
|
|
66
|
-
ref: t(
|
|
65
|
+
}, P = n, F = l(P, {
|
|
66
|
+
ref: t(S, P.props.ref),
|
|
67
67
|
onClick: (e) => {
|
|
68
|
-
|
|
68
|
+
P.props.onClick?.(e), A(!D);
|
|
69
69
|
},
|
|
70
70
|
"aria-haspopup": "menu",
|
|
71
|
-
"aria-expanded":
|
|
71
|
+
"aria-expanded": D
|
|
72
72
|
});
|
|
73
|
-
return /* @__PURE__ */
|
|
74
|
-
ref:
|
|
73
|
+
return /* @__PURE__ */ f("div", {
|
|
74
|
+
ref: x,
|
|
75
75
|
className: e.root,
|
|
76
|
-
children: [
|
|
77
|
-
ref:
|
|
76
|
+
children: [F, /* @__PURE__ */ d("div", {
|
|
77
|
+
ref: C,
|
|
78
78
|
popover: "auto",
|
|
79
79
|
role: "menu",
|
|
80
|
-
"data-placement":
|
|
81
|
-
"data-state":
|
|
80
|
+
"data-placement": g,
|
|
81
|
+
"data-state": D ? "open" : "closed",
|
|
82
82
|
className: e.menu,
|
|
83
|
-
onKeyDown:
|
|
84
|
-
children:
|
|
83
|
+
onKeyDown: N,
|
|
84
|
+
children: m.map((t, n) => t.separator ? /* @__PURE__ */ d("div", {
|
|
85
85
|
role: "separator",
|
|
86
86
|
className: e.separator
|
|
87
|
-
}, `sep-${n}`) : /* @__PURE__ */
|
|
87
|
+
}, `sep-${n}`) : /* @__PURE__ */ f("button", {
|
|
88
88
|
type: "button",
|
|
89
89
|
role: "menuitem",
|
|
90
90
|
ref: (e) => {
|
|
91
|
-
|
|
91
|
+
w.current[n] = e;
|
|
92
92
|
},
|
|
93
|
-
tabIndex:
|
|
93
|
+
tabIndex: T.value === n ? 0 : -1,
|
|
94
94
|
disabled: t.disabled,
|
|
95
95
|
className: e.item,
|
|
96
|
-
onClick: () =>
|
|
97
|
-
children: [t.icon && /* @__PURE__ */
|
|
96
|
+
onClick: () => j(n),
|
|
97
|
+
children: [t.icon && /* @__PURE__ */ d("span", {
|
|
98
98
|
className: e.icon,
|
|
99
99
|
"aria-hidden": "true",
|
|
100
100
|
children: t.icon
|
|
@@ -104,4 +104,4 @@ function p({ trigger: n, items: p, onSelect: m, placement: h = "bottom-start", o
|
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
106
|
//#endregion
|
|
107
|
-
export {
|
|
107
|
+
export { m as Dropdown };
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
import e from "./editable.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 { useRef as a } from "react";
|
|
6
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
7
|
//#region ../components/src/editable/editable.tsx
|
|
8
8
|
function c({ value: c, onValueChange: l, placeholder: u, disabled: d = !1, submitOnBlur: f = !0, onCancel: p, className: m, ...h }) {
|
|
9
9
|
i();
|
|
10
|
-
let g = n(!1), _ = n(c), v =
|
|
10
|
+
let g = n(!1), _ = n(c), v = a(null), y = a(p);
|
|
11
11
|
y.current = p;
|
|
12
|
-
let b =
|
|
12
|
+
let b = a(l);
|
|
13
13
|
b.current = l, g.value || (_.value = c), r(() => {
|
|
14
14
|
if (g.value) {
|
|
15
15
|
let e = v.current;
|
|
@@ -22,10 +22,10 @@ function c({ value: c, onValueChange: l, placeholder: u, disabled: d = !1, submi
|
|
|
22
22
|
function S() {
|
|
23
23
|
_.value = c, g.value = !1, y.current?.();
|
|
24
24
|
}
|
|
25
|
-
return g.value ? /* @__PURE__ */
|
|
25
|
+
return g.value ? /* @__PURE__ */ o("div", {
|
|
26
26
|
className: t(e.wrapper, e.editing, m),
|
|
27
27
|
...h,
|
|
28
|
-
children: /* @__PURE__ */
|
|
28
|
+
children: /* @__PURE__ */ o("input", {
|
|
29
29
|
ref: v,
|
|
30
30
|
className: e.input,
|
|
31
31
|
value: _.value,
|
|
@@ -39,24 +39,24 @@ function c({ value: c, onValueChange: l, placeholder: u, disabled: d = !1, submi
|
|
|
39
39
|
f ? x() : S();
|
|
40
40
|
}
|
|
41
41
|
})
|
|
42
|
-
}) : /* @__PURE__ */
|
|
42
|
+
}) : /* @__PURE__ */ o("div", {
|
|
43
43
|
className: t(e.wrapper, m),
|
|
44
44
|
"data-disabled": d ? "" : void 0,
|
|
45
45
|
...h,
|
|
46
|
-
children: /* @__PURE__ */
|
|
46
|
+
children: /* @__PURE__ */ s("button", {
|
|
47
47
|
type: "button",
|
|
48
48
|
className: e.preview,
|
|
49
49
|
disabled: d,
|
|
50
50
|
onClick: () => {
|
|
51
51
|
d || (g.value = !0);
|
|
52
52
|
},
|
|
53
|
-
children: [/* @__PURE__ */
|
|
53
|
+
children: [/* @__PURE__ */ o("span", {
|
|
54
54
|
className: e["preview-text"],
|
|
55
|
-
children: c || /* @__PURE__ */
|
|
55
|
+
children: c || /* @__PURE__ */ o("span", {
|
|
56
56
|
className: e.placeholder,
|
|
57
57
|
children: u
|
|
58
58
|
})
|
|
59
|
-
}), /* @__PURE__ */
|
|
59
|
+
}), /* @__PURE__ */ o("span", {
|
|
60
60
|
className: e["edit-icon"],
|
|
61
61
|
"aria-hidden": "true"
|
|
62
62
|
})]
|
package/dist/fab/fab.js
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import e from "./fab.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, useControllableSignal as a, useRovingFocus as o, useSignalEffect as s, useSignals as c } from "@cascivo/core";
|
|
5
|
+
import { useId as l, useRef as u } from "react";
|
|
6
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
7
7
|
//#region ../components/src/fab/fab.tsx
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
let
|
|
11
|
-
value:
|
|
12
|
-
defaultValue:
|
|
13
|
-
onChange:
|
|
14
|
-
}),
|
|
8
|
+
function p({ children: p, label: m, onClick: h, actions: g, position: _ = "bottom-end", open: v, defaultOpen: y, onOpenChange: b, className: x }) {
|
|
9
|
+
c();
|
|
10
|
+
let S = g != null && g.length > 0, [C, w] = a({
|
|
11
|
+
value: v,
|
|
12
|
+
defaultValue: y ?? !1,
|
|
13
|
+
onChange: b
|
|
14
|
+
}), T = o({
|
|
15
15
|
orientation: "vertical",
|
|
16
16
|
loop: !0
|
|
17
|
-
}),
|
|
18
|
-
|
|
19
|
-
let e =
|
|
20
|
-
e && !
|
|
17
|
+
}), E = u(null), D = u(null), O = l(), k = u(!1);
|
|
18
|
+
s(() => {
|
|
19
|
+
let e = S && C.value;
|
|
20
|
+
e && !k.current ? D.current?.querySelector("[role=\"menuitem\"]:not([aria-disabled=\"true\"])")?.focus() : !e && k.current && i(E.current), k.current = e;
|
|
21
21
|
});
|
|
22
|
-
let
|
|
23
|
-
e.disabled || (e.onSelect(),
|
|
24
|
-
},
|
|
25
|
-
ref:
|
|
22
|
+
let A = (e) => {
|
|
23
|
+
e.disabled || (e.onSelect(), w(!1));
|
|
24
|
+
}, j = /* @__PURE__ */ d("button", {
|
|
25
|
+
ref: E,
|
|
26
26
|
type: "button",
|
|
27
|
-
"aria-label":
|
|
27
|
+
"aria-label": m,
|
|
28
28
|
className: e.fab,
|
|
29
|
-
...
|
|
29
|
+
...S ? {
|
|
30
30
|
"aria-haspopup": "menu",
|
|
31
|
-
"aria-expanded":
|
|
32
|
-
"aria-controls":
|
|
33
|
-
"data-state":
|
|
34
|
-
onClick: () =>
|
|
35
|
-
} : { onClick:
|
|
36
|
-
children: /* @__PURE__ */
|
|
31
|
+
"aria-expanded": C.value,
|
|
32
|
+
"aria-controls": O,
|
|
33
|
+
"data-state": C.value ? "open" : "closed",
|
|
34
|
+
onClick: () => w(!C.value)
|
|
35
|
+
} : { onClick: h },
|
|
36
|
+
children: /* @__PURE__ */ d("span", {
|
|
37
37
|
className: e.icon,
|
|
38
38
|
"aria-hidden": "true",
|
|
39
|
-
children:
|
|
39
|
+
children: p
|
|
40
40
|
})
|
|
41
41
|
});
|
|
42
|
-
return
|
|
43
|
-
onDismiss: () =>
|
|
44
|
-
escapeDismisses:
|
|
45
|
-
disableOutsidePointer: !
|
|
46
|
-
children: /* @__PURE__ */
|
|
47
|
-
className: r(e.root,
|
|
48
|
-
"data-position":
|
|
49
|
-
children: [/* @__PURE__ */
|
|
50
|
-
present:
|
|
51
|
-
children: /* @__PURE__ */
|
|
52
|
-
ref:
|
|
53
|
-
id:
|
|
42
|
+
return S ? /* @__PURE__ */ d(t, {
|
|
43
|
+
onDismiss: () => w(!1),
|
|
44
|
+
escapeDismisses: C.value,
|
|
45
|
+
disableOutsidePointer: !C.value,
|
|
46
|
+
children: /* @__PURE__ */ f("div", {
|
|
47
|
+
className: r(e.root, x),
|
|
48
|
+
"data-position": _,
|
|
49
|
+
children: [/* @__PURE__ */ d(n, {
|
|
50
|
+
present: C,
|
|
51
|
+
children: /* @__PURE__ */ d("menu", {
|
|
52
|
+
ref: D,
|
|
53
|
+
id: O,
|
|
54
54
|
role: "menu",
|
|
55
|
-
"aria-label":
|
|
55
|
+
"aria-label": m,
|
|
56
56
|
className: e.dial,
|
|
57
|
-
children:
|
|
58
|
-
let r =
|
|
59
|
-
return /* @__PURE__ */
|
|
57
|
+
children: g.map((t, n) => {
|
|
58
|
+
let r = T.getItemProps(n);
|
|
59
|
+
return /* @__PURE__ */ d("li", {
|
|
60
60
|
role: "presentation",
|
|
61
61
|
className: e.dialItem,
|
|
62
|
-
children: /* @__PURE__ */
|
|
62
|
+
children: /* @__PURE__ */ f("button", {
|
|
63
63
|
ref: r.ref,
|
|
64
64
|
type: "button",
|
|
65
65
|
role: "menuitem",
|
|
@@ -68,11 +68,11 @@ function f({ children: f, label: p, onClick: m, actions: h, position: g = "botto
|
|
|
68
68
|
className: e.action,
|
|
69
69
|
onKeyDown: r.onKeyDown,
|
|
70
70
|
onFocus: r.onFocus,
|
|
71
|
-
onClick: () =>
|
|
72
|
-
children: [/* @__PURE__ */
|
|
71
|
+
onClick: () => A(t),
|
|
72
|
+
children: [/* @__PURE__ */ d("span", {
|
|
73
73
|
className: e.actionLabel,
|
|
74
74
|
children: t.label
|
|
75
|
-
}), /* @__PURE__ */
|
|
75
|
+
}), /* @__PURE__ */ d("span", {
|
|
76
76
|
className: e.actionIcon,
|
|
77
77
|
"aria-hidden": "true",
|
|
78
78
|
children: t.icon
|
|
@@ -81,13 +81,13 @@ function f({ children: f, label: p, onClick: m, actions: h, position: g = "botto
|
|
|
81
81
|
}, t.id ?? n);
|
|
82
82
|
})
|
|
83
83
|
})
|
|
84
|
-
}),
|
|
84
|
+
}), j]
|
|
85
85
|
})
|
|
86
|
-
}) : /* @__PURE__ */
|
|
87
|
-
className: r(e.root,
|
|
88
|
-
"data-position":
|
|
89
|
-
children:
|
|
86
|
+
}) : /* @__PURE__ */ d("div", {
|
|
87
|
+
className: r(e.root, x),
|
|
88
|
+
"data-position": _,
|
|
89
|
+
children: j
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
92
|
//#endregion
|
|
93
|
-
export {
|
|
93
|
+
export { p as Fab };
|
package/dist/field/field.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { Label as e } from "../label/label.js";
|
|
4
4
|
import t from "./field.module.js";
|
|
5
5
|
import { cn as n, useId as r } from "@cascivo/core";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { Children as i, cloneElement as a, isValidElement as o } from "react";
|
|
7
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
8
|
//#region ../components/src/field/field.tsx
|
|
9
9
|
var l = /* @__PURE__ */ new Set();
|
|
10
10
|
function u() {
|
|
@@ -17,25 +17,25 @@ function d(e, t) {
|
|
|
17
17
|
}
|
|
18
18
|
function f({ label: l, description: u, error: f, required: p = !1, disabled: m = !1, id: h, children: g, className: _ }) {
|
|
19
19
|
let v = r("cascade-field"), y = h ?? v, b = `${y}-description`, x = `${y}-error`, S = [u ? b : null, f ? x : null].filter(Boolean).join(" ") || void 0, C = { id: y };
|
|
20
|
-
S && (C["aria-describedby"] = S), f && (C["aria-invalid"] = !0), (m || g.props.disabled) && (C.disabled = !0),
|
|
21
|
-
let w =
|
|
22
|
-
return /* @__PURE__ */
|
|
20
|
+
S && (C["aria-describedby"] = S), f && (C["aria-invalid"] = !0), (m || g.props.disabled) && (C.disabled = !0), o(g) && d(l, g);
|
|
21
|
+
let w = o(g) ? a(i.only(g), C) : g;
|
|
22
|
+
return /* @__PURE__ */ c("div", {
|
|
23
23
|
className: n(t.field, _),
|
|
24
24
|
"data-disabled": m ? "" : void 0,
|
|
25
25
|
children: [
|
|
26
|
-
l && /* @__PURE__ */
|
|
26
|
+
l && /* @__PURE__ */ s(e, {
|
|
27
27
|
htmlFor: y,
|
|
28
28
|
required: p,
|
|
29
29
|
disabled: m,
|
|
30
30
|
children: l
|
|
31
31
|
}),
|
|
32
32
|
w,
|
|
33
|
-
u && /* @__PURE__ */
|
|
33
|
+
u && /* @__PURE__ */ s("p", {
|
|
34
34
|
id: b,
|
|
35
35
|
className: t.description,
|
|
36
36
|
children: u
|
|
37
37
|
}),
|
|
38
|
-
f && /* @__PURE__ */
|
|
38
|
+
f && /* @__PURE__ */ s("p", {
|
|
39
39
|
id: x,
|
|
40
40
|
role: "alert",
|
|
41
41
|
className: t.error,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer cascivo.component{.
|
|
1
|
+
@layer cascivo.component{._uploader_nfhc5_2{gap:var(--cascivo-space-2);flex-direction:column;inline-size:100%;min-inline-size:0;display:flex}._label_nfhc5_13{font-size:var(--cascivo-font-size-sm);font-weight:var(--cascivo-font-weight-medium);color:var(--cascivo-color-text)}._input_nfhc5_19{clip-path:inset(50%);white-space:nowrap;block-size:1px;inline-size:1px;position:absolute;overflow:hidden}._zone_nfhc5_28{padding:var(--cascivo-space-8) var(--cascivo-space-4);border:2px dashed var(--cascivo-color-border);border-radius:var(--cascivo-radius-surface);background:var(--cascivo-color-surface);color:var(--cascivo-color-text-muted);font-size:var(--cascivo-font-size-sm);cursor:pointer;transition:border-color var(--cascivo-duration-150) var(--cascivo-ease-out), background var(--cascivo-duration-150) var(--cascivo-ease-out);text-align:center;justify-content:center;align-items:center;inline-size:100%;display:flex}._zone_nfhc5_28:hover:not(:disabled),._zone_nfhc5_28[data-state=dragover]{border-color:var(--cascivo-color-accent);background:var(--cascivo-color-accent-subtle)}._zone_nfhc5_28:disabled{opacity:.5;cursor:not-allowed}._hint_nfhc5_61{font-size:var(--cascivo-font-size-xs);color:var(--cascivo-color-text-muted)}._list_nfhc5_66{gap:var(--cascivo-space-2);flex-direction:column;margin:0;padding:0;list-style:none;display:flex}._file_nfhc5_75{align-items:center;gap:var(--cascivo-space-2);padding:var(--cascivo-space-2) var(--cascivo-space-3);border:1px solid var(--cascivo-color-border);border-radius:var(--cascivo-radius-surface);background:var(--cascivo-color-surface);font-size:var(--cascivo-font-size-sm);grid-template-columns:auto 1fr auto auto;grid-template-areas:"status name size remove""status error error error";display:grid}._file_nfhc5_75[data-state=error]{border-color:var(--cascivo-color-danger)}._status_nfhc5_92{grid-area:status;align-items:center;display:flex}._glyph-complete_nfhc5_98{color:var(--cascivo-color-success-foreground)}._glyph-error_nfhc5_102{color:var(--cascivo-color-danger)}._name_nfhc5_106{text-overflow:ellipsis;white-space:nowrap;grid-area:name;overflow:hidden}._size_nfhc5_113{color:var(--cascivo-color-text-muted);font-size:var(--cascivo-font-size-xs);grid-area:size}._remove_nfhc5_119{padding:var(--cascivo-space-1);border-radius:var(--cascivo-radius-control);color:var(--cascivo-color-text-muted);cursor:pointer;font-size:var(--cascivo-font-size-xs);background:0 0;border:none;grid-area:remove;justify-content:center;align-items:center;line-height:1;display:flex}._remove_nfhc5_119:hover{color:var(--cascivo-color-danger);background:var(--cascivo-color-danger-subtle)}._error-message_nfhc5_139{font-size:var(--cascivo-font-size-xs);color:var(--cascivo-color-danger);grid-area:error}}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import { Spinner as e } from "../spinner/spinner.js";
|
|
4
4
|
import t from "./file-uploader.module.js";
|
|
5
5
|
import { cn as n, useSignal as r, useSignals as i } from "@cascivo/core";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { useRef as a } from "react";
|
|
7
|
+
import { builtin as o, t as s } from "@cascivo/i18n";
|
|
8
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
9
9
|
//#region ../components/src/file-uploader/file-uploader.tsx
|
|
10
10
|
function u(e, t) {
|
|
11
11
|
let n = t.split(",").map((e) => e.trim()).filter(Boolean);
|
|
@@ -16,21 +16,21 @@ function d(e) {
|
|
|
16
16
|
}
|
|
17
17
|
function f({ files: f = [], onFilesAdded: p, onRemove: m, multiple: h = !1, accept: g, maxSize: _, onRejected: v, label: y, hint: b, labels: x, disabled: S = !1, className: C }) {
|
|
18
18
|
i();
|
|
19
|
-
let w =
|
|
19
|
+
let w = a(null), T = r(!1), E = y ?? x?.label ?? s(o.fileUploader.label), D = x?.drop ?? s(o.fileUploader.drop), O = x?.uploading ?? s(o.fileUploader.uploading), k = x?.complete ?? s(o.fileUploader.complete), A = x?.error ?? s(o.fileUploader.error), j = (e) => x?.remove ? x.remove.replace("{name}", e) : s(o.fileUploader.remove, { name: e }), M = `cascade-uploader-${E.toLowerCase().replace(/\s+/g, "-")}`, N = `${M}-label`, P = `${M}-hint`, F = (e) => {
|
|
20
20
|
if (!e || e.length === 0) return;
|
|
21
21
|
let t = h ? Array.from(e) : Array.from(e).slice(0, 1), n = [], r = [], i = [];
|
|
22
22
|
for (let e of t) g && !u(e, g) ? r.push(e) : _ !== void 0 && e.size > _ ? i.push(e) : n.push(e);
|
|
23
23
|
r.length > 0 && v?.(r, "type"), i.length > 0 && v?.(i, "size"), n.length > 0 && p?.(n);
|
|
24
24
|
};
|
|
25
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ l("div", {
|
|
26
26
|
className: n(t.uploader, C),
|
|
27
27
|
children: [
|
|
28
|
-
/* @__PURE__ */
|
|
28
|
+
/* @__PURE__ */ c("span", {
|
|
29
29
|
id: N,
|
|
30
30
|
className: t.label,
|
|
31
31
|
children: E
|
|
32
32
|
}),
|
|
33
|
-
/* @__PURE__ */
|
|
33
|
+
/* @__PURE__ */ c("input", {
|
|
34
34
|
ref: w,
|
|
35
35
|
type: "file",
|
|
36
36
|
className: t.input,
|
|
@@ -43,7 +43,7 @@ function f({ files: f = [], onFilesAdded: p, onRemove: m, multiple: h = !1, acce
|
|
|
43
43
|
F(e.target.files), e.target.value = "";
|
|
44
44
|
}
|
|
45
45
|
}),
|
|
46
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ c("button", {
|
|
47
47
|
type: "button",
|
|
48
48
|
className: t.zone,
|
|
49
49
|
"data-state": T.value ? "dragover" : "idle",
|
|
@@ -62,53 +62,53 @@ function f({ files: f = [], onFilesAdded: p, onRemove: m, multiple: h = !1, acce
|
|
|
62
62
|
},
|
|
63
63
|
children: D
|
|
64
64
|
}),
|
|
65
|
-
b && /* @__PURE__ */
|
|
65
|
+
b && /* @__PURE__ */ c("span", {
|
|
66
66
|
id: P,
|
|
67
67
|
className: t.hint,
|
|
68
68
|
children: b
|
|
69
69
|
}),
|
|
70
|
-
f.length > 0 && /* @__PURE__ */
|
|
70
|
+
f.length > 0 && /* @__PURE__ */ c("ul", {
|
|
71
71
|
className: t.list,
|
|
72
72
|
"aria-live": "polite",
|
|
73
|
-
children: f.map((n) => /* @__PURE__ */
|
|
73
|
+
children: f.map((n) => /* @__PURE__ */ l("li", {
|
|
74
74
|
className: t.file,
|
|
75
75
|
"data-state": n.status,
|
|
76
76
|
children: [
|
|
77
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ l("span", {
|
|
78
78
|
className: t.status,
|
|
79
79
|
children: [
|
|
80
|
-
n.status === "uploading" && /* @__PURE__ */
|
|
80
|
+
n.status === "uploading" && /* @__PURE__ */ c(e, {
|
|
81
81
|
size: "sm",
|
|
82
82
|
label: O
|
|
83
83
|
}),
|
|
84
|
-
n.status === "complete" && /* @__PURE__ */
|
|
84
|
+
n.status === "complete" && /* @__PURE__ */ c("span", {
|
|
85
85
|
className: t["glyph-complete"],
|
|
86
86
|
"aria-label": k,
|
|
87
87
|
children: "✓"
|
|
88
88
|
}),
|
|
89
|
-
n.status === "error" && /* @__PURE__ */
|
|
89
|
+
n.status === "error" && /* @__PURE__ */ c("span", {
|
|
90
90
|
className: t["glyph-error"],
|
|
91
91
|
"aria-label": A,
|
|
92
92
|
children: "✕"
|
|
93
93
|
})
|
|
94
94
|
]
|
|
95
95
|
}),
|
|
96
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ c("span", {
|
|
97
97
|
className: t.name,
|
|
98
98
|
children: n.name
|
|
99
99
|
}),
|
|
100
|
-
n.size !== void 0 && /* @__PURE__ */
|
|
100
|
+
n.size !== void 0 && /* @__PURE__ */ c("span", {
|
|
101
101
|
className: t.size,
|
|
102
102
|
children: d(n.size)
|
|
103
103
|
}),
|
|
104
|
-
/* @__PURE__ */
|
|
104
|
+
/* @__PURE__ */ c("button", {
|
|
105
105
|
type: "button",
|
|
106
106
|
className: t.remove,
|
|
107
107
|
"aria-label": j(n.name),
|
|
108
108
|
onClick: () => m?.(n.id),
|
|
109
109
|
children: "✕"
|
|
110
110
|
}),
|
|
111
|
-
n.status === "error" && n.errorMessage && /* @__PURE__ */
|
|
111
|
+
n.status === "error" && n.errorMessage && /* @__PURE__ */ c("span", {
|
|
112
112
|
className: t["error-message"],
|
|
113
113
|
children: n.errorMessage
|
|
114
114
|
})
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
import './file-uploader.css';
|
|
4
4
|
var e = {
|
|
5
|
-
uploader: "
|
|
6
|
-
label: "
|
|
7
|
-
input: "
|
|
8
|
-
zone: "
|
|
9
|
-
hint: "
|
|
10
|
-
list: "
|
|
11
|
-
file: "
|
|
12
|
-
status: "
|
|
13
|
-
"glyph-complete": "_glyph-
|
|
14
|
-
"glyph-error": "_glyph-
|
|
15
|
-
name: "
|
|
16
|
-
size: "
|
|
17
|
-
remove: "
|
|
18
|
-
"error-message": "_error-
|
|
5
|
+
uploader: "_uploader_nfhc5_2",
|
|
6
|
+
label: "_label_nfhc5_13",
|
|
7
|
+
input: "_input_nfhc5_19",
|
|
8
|
+
zone: "_zone_nfhc5_28",
|
|
9
|
+
hint: "_hint_nfhc5_61",
|
|
10
|
+
list: "_list_nfhc5_66",
|
|
11
|
+
file: "_file_nfhc5_75",
|
|
12
|
+
status: "_status_nfhc5_92",
|
|
13
|
+
"glyph-complete": "_glyph-complete_nfhc5_98",
|
|
14
|
+
"glyph-error": "_glyph-error_nfhc5_102",
|
|
15
|
+
name: "_name_nfhc5_106",
|
|
16
|
+
size: "_size_nfhc5_113",
|
|
17
|
+
remove: "_remove_nfhc5_119",
|
|
18
|
+
"error-message": "_error-message_nfhc5_139"
|
|
19
19
|
};
|
|
20
20
|
//#endregion
|
|
21
21
|
export { e as default };
|
package/dist/filter/filter.js
CHANGED
|
@@ -4,28 +4,29 @@ import e from "./filter.module.js";
|
|
|
4
4
|
import { useControllableSignal as t, useSignals as n } from "@cascivo/core";
|
|
5
5
|
import { jsx as r } from "react/jsx-runtime";
|
|
6
6
|
//#region ../components/src/filter/filter.tsx
|
|
7
|
-
function i({ options: i, value: a, defaultValue: o = [], onValueChange: s, onChange: c, multi: l = !1, variant: u = "pill", className: d,
|
|
7
|
+
function i({ options: i, value: a, defaultValue: o = [], onValueChange: s, onChange: c, multi: l = !1, variant: u = "pill", className: d, ariaLabel: f, ...p }) {
|
|
8
8
|
n();
|
|
9
|
-
let [
|
|
9
|
+
let [m, h] = t({
|
|
10
10
|
value: a,
|
|
11
11
|
defaultValue: o,
|
|
12
12
|
onChange: s ?? c
|
|
13
13
|
});
|
|
14
|
-
function
|
|
15
|
-
let t =
|
|
16
|
-
n = l ? t.includes(e) ? t.filter((t) => t !== e) : [...t, e] : t.includes(e) ? [] : [e],
|
|
14
|
+
function g(e) {
|
|
15
|
+
let t = m.value, n;
|
|
16
|
+
n = l ? t.includes(e) ? t.filter((t) => t !== e) : [...t, e] : t.includes(e) ? [] : [e], h(n);
|
|
17
17
|
}
|
|
18
18
|
return /* @__PURE__ */ r("div", {
|
|
19
19
|
role: "group",
|
|
20
20
|
className: [e.filter, d].filter(Boolean).join(" "),
|
|
21
21
|
"data-variant": u,
|
|
22
|
-
|
|
22
|
+
"aria-label": p["aria-label"] ?? f,
|
|
23
|
+
...p,
|
|
23
24
|
children: i.map((t) => /* @__PURE__ */ r("button", {
|
|
24
25
|
type: "button",
|
|
25
26
|
className: e.item,
|
|
26
|
-
"data-selected":
|
|
27
|
-
onClick: () =>
|
|
28
|
-
"aria-pressed":
|
|
27
|
+
"data-selected": m.value.includes(t.value) || void 0,
|
|
28
|
+
onClick: () => g(t.value),
|
|
29
|
+
"aria-pressed": m.value.includes(t.value),
|
|
29
30
|
children: t.label
|
|
30
31
|
}, t.value))
|
|
31
32
|
});
|