@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/tabs/tabs.js
CHANGED
|
@@ -2,94 +2,96 @@
|
|
|
2
2
|
|
|
3
3
|
import e from "./tabs.module.js";
|
|
4
4
|
import { cn as t, useSignal as n, useSignals as r } from "@cascivo/core";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { createContext as i, forwardRef as a, useId as o, useRef as s } from "react";
|
|
6
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
7
7
|
//#region ../components/src/tabs/tabs.tsx
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
let d = o(), f = n(
|
|
11
|
-
|
|
8
|
+
var l = i(null);
|
|
9
|
+
function u({ defaultValue: r, value: i, onValueChange: a, className: s, children: u }) {
|
|
10
|
+
let d = o(), f = n(i ?? r ?? "");
|
|
11
|
+
i !== void 0 && (f.value = i);
|
|
12
12
|
let p = {
|
|
13
13
|
active: f,
|
|
14
14
|
baseId: d,
|
|
15
15
|
setValue: (e) => {
|
|
16
|
-
|
|
16
|
+
i === void 0 && (f.value = e), a?.(e);
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ c(l.Provider, {
|
|
20
20
|
value: p,
|
|
21
|
-
children: /* @__PURE__ */
|
|
22
|
-
className: t(e.tabs,
|
|
21
|
+
children: /* @__PURE__ */ c("div", {
|
|
22
|
+
className: t(e.tabs, s),
|
|
23
23
|
children: u
|
|
24
24
|
})
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
let
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
ref:
|
|
27
|
+
function d({ className: n, children: r, ...i }) {
|
|
28
|
+
let a = s(null);
|
|
29
|
+
return /* @__PURE__ */ c(l.Consumer, { children: (o) => /* @__PURE__ */ c("div", {
|
|
30
|
+
ref: a,
|
|
31
31
|
role: "tablist",
|
|
32
32
|
className: t(e.list, n),
|
|
33
33
|
onKeyDown: (e) => {
|
|
34
|
-
if (!
|
|
34
|
+
if (!o || ![
|
|
35
35
|
"ArrowRight",
|
|
36
36
|
"ArrowLeft",
|
|
37
37
|
"Home",
|
|
38
38
|
"End"
|
|
39
39
|
].includes(e.key)) return;
|
|
40
|
-
let t = Array.from(
|
|
40
|
+
let t = Array.from(a.current?.querySelectorAll("[role=\"tab\"]:not([disabled])") ?? []);
|
|
41
41
|
if (t.length === 0) return;
|
|
42
42
|
e.preventDefault();
|
|
43
|
-
let n = t.findIndex((e) => e.dataset.value ===
|
|
43
|
+
let n = t.findIndex((e) => e.dataset.value === o.active.value), r = n;
|
|
44
44
|
e.key === "ArrowRight" ? r = (n + 1) % t.length : e.key === "ArrowLeft" ? r = (n - 1 + t.length) % t.length : e.key === "Home" ? r = 0 : e.key === "End" && (r = t.length - 1);
|
|
45
45
|
let i = t[r];
|
|
46
|
-
i?.focus(), i?.dataset.value &&
|
|
46
|
+
i?.focus(), i?.dataset.value && o.setValue(i.dataset.value);
|
|
47
47
|
},
|
|
48
|
-
...
|
|
48
|
+
...i,
|
|
49
49
|
children: r
|
|
50
50
|
}) });
|
|
51
51
|
}
|
|
52
|
-
|
|
53
|
-
return /* @__PURE__ */
|
|
54
|
-
store:
|
|
52
|
+
var f = a(function(e, t) {
|
|
53
|
+
return /* @__PURE__ */ c(l.Consumer, { children: (n) => n ? /* @__PURE__ */ c(p, {
|
|
54
|
+
store: n,
|
|
55
|
+
buttonRef: t,
|
|
55
56
|
...e
|
|
56
57
|
}) : null });
|
|
57
|
-
}
|
|
58
|
-
function
|
|
58
|
+
});
|
|
59
|
+
function p({ store: n, value: i, className: a, children: o, disabled: s, buttonRef: l, ...u }) {
|
|
59
60
|
r();
|
|
60
|
-
let
|
|
61
|
-
return /* @__PURE__ */
|
|
61
|
+
let d = n.active.value === i;
|
|
62
|
+
return /* @__PURE__ */ c("button", {
|
|
62
63
|
type: "button",
|
|
63
64
|
role: "tab",
|
|
64
|
-
id: `${n.baseId}-trigger-${
|
|
65
|
-
"aria-selected":
|
|
66
|
-
"aria-controls": `${n.baseId}-content-${
|
|
67
|
-
tabIndex:
|
|
68
|
-
"data-state":
|
|
69
|
-
"data-value":
|
|
70
|
-
disabled:
|
|
71
|
-
className: t(e.trigger,
|
|
72
|
-
onClick: () => n.setValue(
|
|
73
|
-
|
|
74
|
-
|
|
65
|
+
id: `${n.baseId}-trigger-${i}`,
|
|
66
|
+
"aria-selected": d,
|
|
67
|
+
"aria-controls": `${n.baseId}-content-${i}`,
|
|
68
|
+
tabIndex: d ? 0 : -1,
|
|
69
|
+
"data-state": d ? "active" : "inactive",
|
|
70
|
+
"data-value": i,
|
|
71
|
+
disabled: s,
|
|
72
|
+
className: t(e.trigger, a),
|
|
73
|
+
onClick: () => n.setValue(i),
|
|
74
|
+
ref: l,
|
|
75
|
+
...u,
|
|
76
|
+
children: o
|
|
75
77
|
});
|
|
76
78
|
}
|
|
77
|
-
function
|
|
78
|
-
return /* @__PURE__ */
|
|
79
|
+
function m(e) {
|
|
80
|
+
return /* @__PURE__ */ c(l.Consumer, { children: (t) => t ? /* @__PURE__ */ c(h, {
|
|
79
81
|
store: t,
|
|
80
82
|
...e
|
|
81
83
|
}) : null });
|
|
82
84
|
}
|
|
83
|
-
function
|
|
84
|
-
return r(), n.active.value ===
|
|
85
|
+
function h({ store: n, value: i, className: a, children: o, ...s }) {
|
|
86
|
+
return r(), n.active.value === i ? /* @__PURE__ */ c("div", {
|
|
85
87
|
role: "tabpanel",
|
|
86
|
-
id: `${n.baseId}-content-${
|
|
87
|
-
"aria-labelledby": `${n.baseId}-trigger-${
|
|
88
|
+
id: `${n.baseId}-content-${i}`,
|
|
89
|
+
"aria-labelledby": `${n.baseId}-trigger-${i}`,
|
|
88
90
|
tabIndex: 0,
|
|
89
|
-
className: t(e.content,
|
|
90
|
-
...
|
|
91
|
-
children:
|
|
91
|
+
className: t(e.content, a),
|
|
92
|
+
...s,
|
|
93
|
+
children: o
|
|
92
94
|
}) : null;
|
|
93
95
|
}
|
|
94
96
|
//#endregion
|
|
95
|
-
export {
|
|
97
|
+
export { u as Tabs, m as TabsContent, d as TabsList, f as TabsTrigger };
|
package/dist/tag/tag.js
CHANGED
|
@@ -1,26 +1,33 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import e from "./tag.module.js";
|
|
4
|
-
import { cn as t,
|
|
5
|
-
import { builtin as
|
|
6
|
-
import { jsx as
|
|
4
|
+
import { cn as t, normalizeTone as n, useSignals as r } from "@cascivo/core";
|
|
5
|
+
import { builtin as i, t as a } from "@cascivo/i18n";
|
|
6
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
7
|
//#region ../components/src/tag/tag.tsx
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
var c = {
|
|
9
|
+
neutral: "default",
|
|
10
|
+
info: "info",
|
|
11
|
+
success: "success",
|
|
12
|
+
warning: "warning",
|
|
13
|
+
danger: "error"
|
|
14
|
+
};
|
|
15
|
+
function l({ variant: l = "default", size: u = "md", onDismiss: d, dismissLabel: f, className: p, children: m, ...h }) {
|
|
16
|
+
r();
|
|
17
|
+
let g = f ?? a(i.tag.dismiss);
|
|
18
|
+
return /* @__PURE__ */ s("span", {
|
|
19
|
+
"data-variant": c[n(l)] ?? l,
|
|
20
|
+
"data-size": u,
|
|
21
|
+
className: t(e.tag, p),
|
|
22
|
+
...h,
|
|
23
|
+
children: [m, d && /* @__PURE__ */ o("button", {
|
|
17
24
|
type: "button",
|
|
18
25
|
className: e.dismiss,
|
|
19
|
-
"aria-label":
|
|
20
|
-
onClick:
|
|
26
|
+
"aria-label": g,
|
|
27
|
+
onClick: d,
|
|
21
28
|
children: "✕"
|
|
22
29
|
})]
|
|
23
30
|
});
|
|
24
31
|
}
|
|
25
32
|
//#endregion
|
|
26
|
-
export {
|
|
33
|
+
export { l as Tag };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer cascivo.component{.
|
|
1
|
+
@layer cascivo.component{._wrapper_1ycwz_2{gap:var(--cascivo-space-1);min-inline-size:0;min-height:2.5rem;padding:var(--cascivo-space-2);background-color:var(--cascivo-color-surface);border:1px solid var(--cascivo-color-border);border-radius:var(--cascivo-radius-field);cursor:text;transition:border-color var(--cascivo-duration-150) var(--cascivo-ease-out), box-shadow var(--cascivo-duration-150) var(--cascivo-ease-out);flex-wrap:wrap;display:flex}._wrapper_1ycwz_2:focus-within{border-color:var(--cascivo-color-accent);box-shadow:var(--cascivo-focus-ring)}._wrapper_1ycwz_2[data-disabled]{cursor:not-allowed;background-color:var(--cascivo-color-bg-subtle)}._wrapper_1ycwz_2[data-disabled] ._tag_1ycwz_32{color:var(--cascivo-color-text-muted);border-color:var(--cascivo-color-border)}._tag_1ycwz_32{align-items:center;gap:var(--cascivo-space-1);padding-block:var(--cascivo-space-0-5);padding-inline:var(--cascivo-space-2);font-family:var(--cascivo-font-sans);font-size:var(--cascivo-text-sm);color:var(--cascivo-color-text);background-color:var(--cascivo-color-bg-subtle);border:1px solid var(--cascivo-color-border);border-radius:var(--cascivo-radius-full);line-height:1.25;display:inline-flex}._tag_1ycwz_32[data-state=invalid]{color:var(--cascivo-color-destructive);background-color:rgb(from var(--cascivo-color-destructive) r g b / .08);border-color:var(--cascivo-color-destructive)}._dismiss_1ycwz_59{border-radius:var(--cascivo-radius-full);width:1rem;height:1rem;color:var(--cascivo-color-text-muted);cursor:pointer;font-size:var(--cascivo-text-sm);background:0 0;border:none;justify-content:center;align-items:center;padding:0;line-height:1;display:inline-flex}._dismiss_1ycwz_59:hover{color:var(--cascivo-color-text);background-color:var(--cascivo-color-border)}._dismiss_1ycwz_59:focus-visible{outline:2px solid var(--cascivo-color-accent);outline-offset:1px}._dismiss_1ycwz_59:disabled{cursor:not-allowed}._input_1ycwz_89{min-width:4rem;font-family:var(--cascivo-font-sans);font-size:var(--cascivo-text-sm);color:var(--cascivo-color-text);background:0 0;border:none;outline:none;flex:1}._input_1ycwz_89::placeholder{color:var(--cascivo-color-text-muted)}._input_1ycwz_89:disabled{cursor:not-allowed}}
|
|
@@ -1,64 +1,64 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import e from "./tags-input.module.js";
|
|
4
|
-
import { cn as t,
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { cn as t, focusElement as n, useSignal as r, useSignals as i } from "@cascivo/core";
|
|
5
|
+
import { useRef as a } from "react";
|
|
6
|
+
import { builtin as o, t as s } from "@cascivo/i18n";
|
|
7
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
8
|
//#region ../components/src/tags-input/tags-input.tsx
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
let
|
|
12
|
-
function
|
|
9
|
+
function u({ value: u, onValueChange: d, placeholder: f, validate: p, max: m, disabled: h = !1, className: g, ..._ }) {
|
|
10
|
+
i();
|
|
11
|
+
let v = r(""), y = a(null);
|
|
12
|
+
function b(e) {
|
|
13
13
|
let t = e.trim();
|
|
14
|
-
t && (
|
|
14
|
+
t && (m !== void 0 && u.length >= m || u.includes(t) || p && !p(t) || (d([...u, t]), v.value = ""));
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
u
|
|
16
|
+
function x(e) {
|
|
17
|
+
d(u.filter((t, n) => n !== e));
|
|
18
18
|
}
|
|
19
|
-
let
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
className: t(e.wrapper,
|
|
22
|
-
"data-disabled":
|
|
23
|
-
onClick: () =>
|
|
24
|
-
...
|
|
25
|
-
children: [
|
|
26
|
-
let r =
|
|
27
|
-
return /* @__PURE__ */
|
|
19
|
+
let S = f ?? s(o.tagsInput.placeholder);
|
|
20
|
+
return /* @__PURE__ */ l("div", {
|
|
21
|
+
className: t(e.wrapper, g),
|
|
22
|
+
"data-disabled": h ? "" : void 0,
|
|
23
|
+
onClick: () => n(y.current),
|
|
24
|
+
..._,
|
|
25
|
+
children: [u.map((t, n) => {
|
|
26
|
+
let r = p ? !p(t) : !1;
|
|
27
|
+
return /* @__PURE__ */ l("span", {
|
|
28
28
|
className: e.tag,
|
|
29
29
|
"data-state": r ? "invalid" : void 0,
|
|
30
|
-
children: [t, /* @__PURE__ */
|
|
30
|
+
children: [t, /* @__PURE__ */ c("button", {
|
|
31
31
|
type: "button",
|
|
32
32
|
className: e.dismiss,
|
|
33
|
-
"aria-label":
|
|
34
|
-
disabled:
|
|
33
|
+
"aria-label": s(o.tagsInput.remove, { tag: t }),
|
|
34
|
+
disabled: h,
|
|
35
35
|
onClick: (e) => {
|
|
36
|
-
e.stopPropagation(),
|
|
36
|
+
e.stopPropagation(), x(n);
|
|
37
37
|
},
|
|
38
|
-
children: /* @__PURE__ */
|
|
38
|
+
children: /* @__PURE__ */ c("span", {
|
|
39
39
|
"aria-hidden": "true",
|
|
40
40
|
children: "×"
|
|
41
41
|
})
|
|
42
42
|
})]
|
|
43
43
|
}, n);
|
|
44
|
-
}), /* @__PURE__ */
|
|
45
|
-
ref:
|
|
44
|
+
}), /* @__PURE__ */ c("input", {
|
|
45
|
+
ref: y,
|
|
46
46
|
className: e.input,
|
|
47
|
-
value:
|
|
48
|
-
"aria-label":
|
|
49
|
-
placeholder:
|
|
50
|
-
disabled:
|
|
47
|
+
value: v.value,
|
|
48
|
+
"aria-label": s(o.tagsInput.label),
|
|
49
|
+
placeholder: u.length === 0 ? S : void 0,
|
|
50
|
+
disabled: h,
|
|
51
51
|
onChange: (e) => {
|
|
52
|
-
|
|
52
|
+
v.value = e.currentTarget.value;
|
|
53
53
|
},
|
|
54
54
|
onKeyDown: (e) => {
|
|
55
|
-
e.key === "Enter" || e.key === "," ? (e.preventDefault(),
|
|
55
|
+
e.key === "Enter" || e.key === "," ? (e.preventDefault(), b(v.value)) : e.key === "Backspace" && !v.value && x(u.length - 1);
|
|
56
56
|
},
|
|
57
57
|
onBlur: () => {
|
|
58
|
-
|
|
58
|
+
v.value && b(v.value);
|
|
59
59
|
}
|
|
60
60
|
})]
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
//#endregion
|
|
64
|
-
export {
|
|
64
|
+
export { u as TagsInput };
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import './tags-input.css';
|
|
4
4
|
var e = {
|
|
5
|
-
wrapper: "
|
|
6
|
-
tag: "
|
|
7
|
-
dismiss: "
|
|
8
|
-
input: "
|
|
5
|
+
wrapper: "_wrapper_1ycwz_2",
|
|
6
|
+
tag: "_tag_1ycwz_32",
|
|
7
|
+
dismiss: "_dismiss_1ycwz_59",
|
|
8
|
+
input: "_input_1ycwz_89"
|
|
9
9
|
};
|
|
10
10
|
//#endregion
|
|
11
11
|
export { e as default };
|
|
@@ -2,55 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
import e from "./textarea.module.js";
|
|
4
4
|
import { cn as t, createMachine as n, useMachine as r } from "@cascivo/core";
|
|
5
|
-
import {
|
|
5
|
+
import { forwardRef as i } from "react";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
7
|
//#region ../components/src/textarea/textarea.tsx
|
|
7
|
-
var
|
|
8
|
+
var s = n({
|
|
8
9
|
initial: "idle",
|
|
9
10
|
states: {
|
|
10
11
|
idle: { on: { FOCUS: "focused" } },
|
|
11
12
|
focused: { on: { BLUR: "idle" } }
|
|
12
13
|
}
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return /* @__PURE__ */ a("div", {
|
|
14
|
+
}), c = i(function({ label: n, hint: i, error: c, resize: l = "vertical", rows: u = 4, className: d, id: f, onFocus: p, onBlur: m, ...h }, g) {
|
|
15
|
+
let [_, v] = r(s), y = f ?? (n ? `cascade-textarea-${n.toLowerCase().replace(/\s+/g, "-")}` : void 0);
|
|
16
|
+
return /* @__PURE__ */ o("div", {
|
|
17
17
|
className: t(e.wrapper, d),
|
|
18
|
-
"data-state": c ? "error" :
|
|
18
|
+
"data-state": c ? "error" : _.value,
|
|
19
19
|
"data-resize": l,
|
|
20
20
|
children: [
|
|
21
|
-
n && /* @__PURE__ */
|
|
21
|
+
n && /* @__PURE__ */ a("label", {
|
|
22
22
|
className: e.label,
|
|
23
|
-
htmlFor:
|
|
23
|
+
htmlFor: y,
|
|
24
24
|
children: n
|
|
25
25
|
}),
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
|
|
26
|
+
/* @__PURE__ */ a("textarea", {
|
|
27
|
+
ref: g,
|
|
28
|
+
id: y,
|
|
28
29
|
rows: u,
|
|
29
30
|
"aria-multiline": "true",
|
|
30
31
|
className: e.textarea,
|
|
31
32
|
"aria-invalid": c ? !0 : void 0,
|
|
32
|
-
"aria-describedby": c ? `${
|
|
33
|
+
"aria-describedby": c ? `${y}-error` : i ? `${y}-hint` : void 0,
|
|
33
34
|
onFocus: (e) => {
|
|
34
|
-
|
|
35
|
+
v("FOCUS"), p?.(e);
|
|
35
36
|
},
|
|
36
37
|
onBlur: (e) => {
|
|
37
|
-
|
|
38
|
+
v("BLUR"), m?.(e);
|
|
38
39
|
},
|
|
39
40
|
...h
|
|
40
41
|
}),
|
|
41
|
-
c && /* @__PURE__ */
|
|
42
|
-
id: `${
|
|
42
|
+
c && /* @__PURE__ */ a("span", {
|
|
43
|
+
id: `${y}-error`,
|
|
43
44
|
className: e.error,
|
|
44
45
|
role: "alert",
|
|
45
46
|
children: c
|
|
46
47
|
}),
|
|
47
|
-
!c &&
|
|
48
|
-
id: `${
|
|
48
|
+
!c && i && /* @__PURE__ */ a("span", {
|
|
49
|
+
id: `${y}-hint`,
|
|
49
50
|
className: e.hint,
|
|
50
|
-
children:
|
|
51
|
+
children: i
|
|
51
52
|
})
|
|
52
53
|
]
|
|
53
54
|
});
|
|
54
|
-
}
|
|
55
|
+
});
|
|
55
56
|
//#endregion
|
|
56
|
-
export {
|
|
57
|
+
export { c as Textarea };
|
package/dist/tile/tile.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer cascivo.component{.
|
|
1
|
+
@layer cascivo.component{._tile_cxt7m_2{gap:var(--cascivo-space-3);padding:var(--cascivo-space-4);border:1px solid var(--cascivo-color-border);border-radius:var(--cascivo-radius-surface);background:var(--cascivo-color-bg);color:var(--cascivo-color-text);cursor:pointer;transition:border-color var(--cascivo-duration-150) var(--cascivo-ease-out), background-color var(--cascivo-duration-150) var(--cascivo-ease-out);align-items:flex-start;text-decoration:none;display:flex}._tile_cxt7m_2:hover:not([data-disabled]){border-color:var(--cascivo-color-border-strong)}._tile_cxt7m_2:focus-visible{box-shadow:var(--cascivo-focus-ring);outline:none}._tile_cxt7m_2[data-selected]{border-color:var(--cascivo-color-accent);background:color-mix(in oklch, var(--cascivo-color-accent) 4%, var(--cascivo-color-bg))}._tile_cxt7m_2[data-disabled]{opacity:.5;cursor:not-allowed}._icon_cxt7m_38{block-size:1.5rem;inline-size:1.5rem;color:var(--cascivo-color-text-muted);flex:none;place-items:center;display:grid}._tile_cxt7m_2[data-selected] ._icon_cxt7m_38{color:var(--cascivo-color-accent)}._body_cxt7m_51{gap:var(--cascivo-space-1);font-size:var(--cascivo-text-sm);flex-direction:column;display:flex}}
|
package/dist/tile/tile.module.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer cascivo.component{.
|
|
1
|
+
@layer cascivo.component{._wrapper_auxoq_2{gap:var(--cascivo-space-1);min-inline-size:0;font-family:var(--cascivo-font-sans);flex-direction:column;display:flex}._wrapper_auxoq_2[data-size=sm]{--_height:2rem;--_font:var(--cascivo-text-sm);--_px:var(--cascivo-space-3)}._wrapper_auxoq_2[data-size=md]{--_height:2.5rem;--_font:var(--cascivo-text-sm);--_px:var(--cascivo-space-4)}._wrapper_auxoq_2[data-size=lg]{--_height:3rem;--_font:var(--cascivo-text-base);--_px:var(--cascivo-space-4)}._label_auxoq_29{font-size:var(--cascivo-text-sm);font-weight:var(--cascivo-font-medium);color:var(--cascivo-color-text);line-height:var(--cascivo-leading-snug)}._input_auxoq_36{block-size:var(--_height,2.5rem);padding-inline:var(--_px,var(--cascivo-space-4));font-family:var(--cascivo-font-sans);font-size:var(--_font,var(--cascivo-text-sm));color:var(--cascivo-color-text);background-color:var(--cascivo-color-surface);border:1px solid var(--cascivo-color-border);border-radius:var(--cascivo-radius-field);transition:border-color var(--cascivo-duration-150) var(--cascivo-ease-out), box-shadow var(--cascivo-duration-150) var(--cascivo-ease-out);outline:none}._input_auxoq_36:hover:not(:disabled):not(:focus-visible){border-color:var(--cascivo-color-border-strong)}._input_auxoq_36:focus-visible{border-color:var(--cascivo-color-accent);box-shadow:0 0 0 3px color-mix(in srgb, var(--cascivo-color-accent) 20%, transparent)}._input_auxoq_36:disabled{opacity:.5;cursor:not-allowed;background-color:var(--cascivo-color-bg-subtle)}._wrapper_auxoq_2[data-state=error] ._input_auxoq_36{border-color:var(--cascivo-color-danger)}._error_auxoq_70{font-size:var(--cascivo-text-xs);color:var(--cascivo-color-danger)}._hint_auxoq_75{font-size:var(--cascivo-text-xs);color:var(--cascivo-color-text-muted)}}
|
|
@@ -2,61 +2,62 @@
|
|
|
2
2
|
|
|
3
3
|
import e from "./time-picker.module.js";
|
|
4
4
|
import { cn as t, createMachine as n, useMachine as r, useSignals as i } from "@cascivo/core";
|
|
5
|
-
import {
|
|
5
|
+
import { forwardRef as a } from "react";
|
|
6
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
7
|
//#region ../components/src/time-picker/time-picker.tsx
|
|
7
|
-
var
|
|
8
|
+
var c = n({
|
|
8
9
|
initial: "idle",
|
|
9
10
|
states: {
|
|
10
11
|
idle: { on: { FOCUS: "focused" } },
|
|
11
12
|
focused: { on: { BLUR: "idle" } }
|
|
12
13
|
}
|
|
13
|
-
})
|
|
14
|
-
function c({ value: n, defaultValue: c, onValueChange: l, onChange: u, min: d, max: f, step: p, label: m, hint: h, error: g, size: _ = "md", className: v, id: y, onFocus: b, onBlur: x, ...S }) {
|
|
14
|
+
}), l = a(function({ value: n, defaultValue: a, onValueChange: l, onChange: u, min: d, max: f, step: p, label: m, hint: h, error: g, size: _ = "md", className: v, id: y, onFocus: b, onBlur: x, ...S }, C) {
|
|
15
15
|
i();
|
|
16
|
-
let [
|
|
17
|
-
return /* @__PURE__ */
|
|
16
|
+
let [w, T] = r(c), E = y ?? (m ? `cascade-time-picker-${m.toLowerCase().replace(/\s+/g, "-")}` : void 0);
|
|
17
|
+
return /* @__PURE__ */ s("div", {
|
|
18
18
|
className: t(e.wrapper, v),
|
|
19
|
-
"data-state": g ? "error" :
|
|
19
|
+
"data-state": g ? "error" : w.value,
|
|
20
20
|
"data-size": _,
|
|
21
21
|
children: [
|
|
22
|
-
m && /* @__PURE__ */
|
|
22
|
+
m && /* @__PURE__ */ o("label", {
|
|
23
23
|
className: e.label,
|
|
24
|
-
htmlFor:
|
|
24
|
+
htmlFor: E,
|
|
25
25
|
children: m
|
|
26
26
|
}),
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
id:
|
|
27
|
+
/* @__PURE__ */ o("input", {
|
|
28
|
+
id: E,
|
|
29
29
|
type: "time",
|
|
30
30
|
className: e.input,
|
|
31
31
|
value: n,
|
|
32
|
-
defaultValue:
|
|
32
|
+
defaultValue: a,
|
|
33
33
|
min: d,
|
|
34
34
|
max: f,
|
|
35
35
|
step: p,
|
|
36
36
|
"aria-invalid": g ? !0 : void 0,
|
|
37
|
-
"aria-describedby": g ? `${
|
|
37
|
+
"aria-describedby": g ? `${E}-error` : h ? `${E}-hint` : void 0,
|
|
38
38
|
onChange: (e) => (l ?? u)?.(e.target.value),
|
|
39
39
|
onFocus: (e) => {
|
|
40
|
-
|
|
40
|
+
T("FOCUS"), b?.(e);
|
|
41
41
|
},
|
|
42
42
|
onBlur: (e) => {
|
|
43
|
-
|
|
43
|
+
T("BLUR"), x?.(e);
|
|
44
44
|
},
|
|
45
|
+
ref: C,
|
|
45
46
|
...S
|
|
46
47
|
}),
|
|
47
|
-
g && /* @__PURE__ */
|
|
48
|
-
id: `${
|
|
48
|
+
g && /* @__PURE__ */ o("span", {
|
|
49
|
+
id: `${E}-error`,
|
|
49
50
|
className: e.error,
|
|
50
51
|
role: "alert",
|
|
51
52
|
children: g
|
|
52
53
|
}),
|
|
53
|
-
!g && h && /* @__PURE__ */
|
|
54
|
-
id: `${
|
|
54
|
+
!g && h && /* @__PURE__ */ o("span", {
|
|
55
|
+
id: `${E}-hint`,
|
|
55
56
|
className: e.hint,
|
|
56
57
|
children: h
|
|
57
58
|
})
|
|
58
59
|
]
|
|
59
60
|
});
|
|
60
|
-
}
|
|
61
|
+
});
|
|
61
62
|
//#endregion
|
|
62
|
-
export {
|
|
63
|
+
export { l as TimePicker };
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
import './time-picker.css';
|
|
4
4
|
var e = {
|
|
5
|
-
wrapper: "
|
|
6
|
-
label: "
|
|
7
|
-
input: "
|
|
8
|
-
error: "
|
|
9
|
-
hint: "
|
|
5
|
+
wrapper: "_wrapper_auxoq_2",
|
|
6
|
+
label: "_label_auxoq_29",
|
|
7
|
+
input: "_input_auxoq_36",
|
|
8
|
+
error: "_error_auxoq_70",
|
|
9
|
+
hint: "_hint_auxoq_75"
|
|
10
10
|
};
|
|
11
11
|
//#endregion
|
|
12
12
|
export { e as default };
|
|
@@ -1,34 +1,40 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import e from "./timeline.module.js";
|
|
4
|
-
import { cn as t } from "@cascivo/core";
|
|
5
|
-
import { jsx as
|
|
4
|
+
import { cn as t, normalizeProgress as n } from "@cascivo/core";
|
|
5
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
6
|
//#region ../components/src/timeline/timeline.tsx
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
var a = {
|
|
8
|
+
pending: "upcoming",
|
|
9
|
+
active: "current",
|
|
10
|
+
complete: "complete",
|
|
11
|
+
error: "current"
|
|
12
|
+
};
|
|
13
|
+
function o({ items: o, orientation: s = "vertical", className: c, ...l }) {
|
|
14
|
+
return /* @__PURE__ */ r("ol", {
|
|
15
|
+
"data-orientation": s,
|
|
16
|
+
className: t(e.list, c),
|
|
17
|
+
...l,
|
|
18
|
+
children: o.map((t) => /* @__PURE__ */ i("li", {
|
|
19
|
+
"data-status": a[n(t.status ?? "pending")] ?? "upcoming",
|
|
20
|
+
"aria-current": n(t.status ?? "pending") === "active" ? "step" : void 0,
|
|
15
21
|
className: e.item,
|
|
16
|
-
children: [/* @__PURE__ */
|
|
22
|
+
children: [/* @__PURE__ */ r("span", {
|
|
17
23
|
className: e.marker,
|
|
18
24
|
"aria-hidden": "true",
|
|
19
25
|
children: t.icon
|
|
20
|
-
}), /* @__PURE__ */
|
|
26
|
+
}), /* @__PURE__ */ i("div", {
|
|
21
27
|
className: e.content,
|
|
22
28
|
children: [
|
|
23
|
-
/* @__PURE__ */
|
|
29
|
+
/* @__PURE__ */ r("div", {
|
|
24
30
|
className: e.title,
|
|
25
31
|
children: t.title
|
|
26
32
|
}),
|
|
27
|
-
t.time ? /* @__PURE__ */
|
|
33
|
+
t.time ? /* @__PURE__ */ r("time", {
|
|
28
34
|
className: e.time,
|
|
29
35
|
children: t.time
|
|
30
36
|
}) : null,
|
|
31
|
-
t.description ? /* @__PURE__ */
|
|
37
|
+
t.description ? /* @__PURE__ */ r("div", {
|
|
32
38
|
className: e.description,
|
|
33
39
|
children: t.description
|
|
34
40
|
}) : null
|
|
@@ -38,4 +44,4 @@ function i({ items: i, orientation: a = "vertical", className: o, ...s }) {
|
|
|
38
44
|
});
|
|
39
45
|
}
|
|
40
46
|
//#endregion
|
|
41
|
-
export {
|
|
47
|
+
export { o as Timeline };
|