@cascivo/react 0.16.0 → 0.17.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/README.md +6 -1
- package/dist/accordion/accordion.js +5 -4
- package/dist/app-shell/app-shell.css +1 -1
- package/dist/app-shell/app-shell.js +28 -26
- package/dist/app-shell/app-shell.module.js +8 -8
- package/dist/badge/badge.js +1 -1
- package/dist/button/button.css +1 -1
- package/dist/button/button.js +4 -1
- package/dist/button/button.module.js +4 -1
- package/dist/calendar/calendar.js +67 -63
- package/dist/card/card.css +1 -1
- package/dist/card/card.module.js +8 -8
- package/dist/checkbox/checkbox.css +1 -1
- package/dist/checkbox/checkbox.module.js +4 -4
- package/dist/combobox/combobox.js +55 -54
- package/dist/context-menu/context-menu.js +42 -38
- package/dist/data-table/data-table.css +1 -1
- package/dist/data-table/data-table.js +155 -160
- package/dist/data-table/data-table.module.js +29 -29
- package/dist/date-picker/date-picker.js +90 -89
- package/dist/field/field.css +1 -1
- package/dist/field/field.module.js +3 -3
- package/dist/index.d.ts +307 -145
- package/dist/infinite-scroll/infinite-scroll.css +1 -0
- package/dist/infinite-scroll/infinite-scroll.js +49 -0
- package/dist/infinite-scroll/infinite-scroll.module.js +8 -0
- package/dist/large-title-header/large-title-header.css +1 -0
- package/dist/large-title-header/large-title-header.js +38 -0
- package/dist/large-title-header/large-title-header.module.js +13 -0
- package/dist/layouts/src/grid/grid.css +1 -1
- package/dist/layouts/src/grid/grid.module.js +3 -3
- package/dist/link/link.css +1 -1
- package/dist/link/link.module.js +1 -1
- package/dist/menu/menu.js +47 -43
- package/dist/node/accordion/accordion.js +5 -4
- package/dist/node/app-shell/app-shell.js +28 -26
- package/dist/node/app-shell/app-shell.module.js +8 -8
- package/dist/node/badge/badge.js +1 -1
- package/dist/node/button/button.js +4 -1
- package/dist/node/button/button.module.js +4 -1
- package/dist/node/calendar/calendar.js +67 -63
- package/dist/node/card/card.module.js +8 -8
- package/dist/node/checkbox/checkbox.module.js +4 -4
- package/dist/node/combobox/combobox.js +55 -54
- package/dist/node/context-menu/context-menu.js +42 -38
- package/dist/node/data-table/data-table.js +155 -160
- package/dist/node/data-table/data-table.module.js +29 -29
- package/dist/node/date-picker/date-picker.js +90 -89
- package/dist/node/field/field.module.js +3 -3
- package/dist/node/infinite-scroll/infinite-scroll.js +49 -0
- package/dist/node/infinite-scroll/infinite-scroll.module.js +7 -0
- package/dist/node/large-title-header/large-title-header.js +38 -0
- package/dist/node/large-title-header/large-title-header.module.js +12 -0
- package/dist/node/layouts/src/grid/grid.module.js +3 -3
- package/dist/node/link/link.module.js +1 -1
- package/dist/node/menu/menu.js +47 -43
- package/dist/node/react/src/index.js +27 -23
- package/dist/node/reorder-list/reorder-list.js +143 -0
- package/dist/node/reorder-list/reorder-list.module.js +11 -0
- package/dist/node/search/search.js +5 -4
- package/dist/node/side-nav/side-nav.js +90 -89
- package/dist/node/skip-nav/skip-nav.js +1 -0
- package/dist/node/swap/swap.js +2 -3
- package/dist/node/switcher/switcher.js +1 -1
- package/dist/node/tabs/tabs.js +41 -40
- package/dist/node/tag/tag.module.js +2 -2
- package/dist/node/toc/toc.js +5 -4
- package/dist/node/virtual-list/virtual-list.js +40 -0
- package/dist/node/virtual-list/virtual-list.module.js +7 -0
- package/dist/node/wheel-picker/wheel-picker.js +84 -0
- package/dist/node/wheel-picker/wheel-picker.module.js +8 -0
- package/dist/react/src/index.js +27 -23
- package/dist/reorder-list/reorder-list.css +1 -0
- package/dist/reorder-list/reorder-list.js +143 -0
- package/dist/reorder-list/reorder-list.module.js +12 -0
- package/dist/search/search.js +5 -4
- package/dist/side-nav/side-nav.js +90 -89
- package/dist/skip-nav/skip-nav.js +1 -0
- package/dist/styles.css +48 -11
- package/dist/swap/swap.js +2 -3
- package/dist/switcher/switcher.js +1 -1
- package/dist/tabs/tabs.js +41 -40
- package/dist/tag/tag.css +1 -1
- package/dist/tag/tag.module.js +2 -2
- package/dist/toc/toc.js +5 -4
- package/dist/virtual-list/virtual-list.css +1 -0
- package/dist/virtual-list/virtual-list.js +40 -0
- package/dist/virtual-list/virtual-list.module.js +8 -0
- package/dist/wheel-picker/wheel-picker.css +1 -0
- package/dist/wheel-picker/wheel-picker.js +84 -0
- package/dist/wheel-picker/wheel-picker.module.js +9 -0
- package/package.json +4 -4
- package/readme.body.md +6 -1
- package/dist/node/react/src/theme.js +0 -78
- package/dist/node/storage/src/drivers.js +0 -34
- package/dist/node/storage/src/persisted-signal.js +0 -41
- package/dist/react/src/theme.js +0 -78
- package/dist/storage/src/drivers.js +0 -34
- package/dist/storage/src/persisted-signal.js +0 -41
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import './large-title-header.css';
|
|
2
|
+
var e = {
|
|
3
|
+
root: "_root_1fozn_6",
|
|
4
|
+
bar: "_bar_1fozn_12",
|
|
5
|
+
slot: "_slot_1fozn_29",
|
|
6
|
+
slotEnd: "_slotEnd_1fozn_37",
|
|
7
|
+
compactTitle: "_compactTitle_1fozn_41",
|
|
8
|
+
largeTitle: "_largeTitle_1fozn_56",
|
|
9
|
+
"cascivo-large-title-reveal": "_cascivo-large-title-reveal_1fozn_1",
|
|
10
|
+
"cascivo-large-title-hairline": "_cascivo-large-title-hairline_1fozn_1"
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { e as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer cascivo.component{._grid-
|
|
1
|
+
@layer cascivo.component{._grid-container_1tchk_5{display:grid;container-type:inline-size}._grid_1tchk_2{grid-template-columns:repeat(var(--_grid-cols,12), minmax(0, 1fr));gap:var(--_grid-gap,var(--cascivo-space-4));align-items:var(--_grid-align,stretch);justify-items:var(--_grid-justify,stretch);min-inline-size:0;display:grid;container-type:inline-size}@container (width<=40rem){._grid_1tchk_2:not([data-responsive]){grid-template-columns:1fr}}@container (width>=30rem){._grid_1tchk_2[data-responsive]{grid-template-columns:repeat(var(--_grid-cols-sm,var(--_grid-cols,12)), minmax(0, 1fr))}}@container (width>=40rem){._grid_1tchk_2[data-responsive]{grid-template-columns:repeat(var(--_grid-cols-md,var(--_grid-cols-sm,var(--_grid-cols,12))), minmax(0, 1fr))}}@container (width>=64rem){._grid_1tchk_2[data-responsive]{grid-template-columns:repeat(var(--_grid-cols-lg,var(--_grid-cols-md,var(--_grid-cols-sm,var(--_grid-cols,12)))), minmax(0, 1fr))}}@container (width>=80rem){._grid_1tchk_2[data-responsive]{grid-template-columns:repeat(var(--_grid-cols-xl,var(--_grid-cols-lg,var(--_grid-cols-md,var(--_grid-cols-sm,var(--_grid-cols,12))))), minmax(0, 1fr))}}._grid-item_1tchk_55{grid-column:span var(--_span,1);align-content:stretch;display:grid}@container (width>=30rem){._grid-item_1tchk_55[data-responsive]{grid-column:span var(--_span-sm,var(--_span,1))}}@container (width>=40rem){._grid-item_1tchk_55[data-responsive]{grid-column:span var(--_span-md,var(--_span-sm,var(--_span,1)))}}@container (width>=64rem){._grid-item_1tchk_55[data-responsive]{grid-column:span var(--_span-lg,var(--_span-md,var(--_span-sm,var(--_span,1))))}}@container (width>=80rem){._grid-item_1tchk_55[data-responsive]{grid-column:span var(--_span-xl,var(--_span-lg,var(--_span-md,var(--_span-sm,var(--_span,1)))))}}}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import './grid.css';
|
|
2
2
|
var e = {
|
|
3
|
-
"grid-container": "_grid-
|
|
4
|
-
grid: "
|
|
5
|
-
"grid-item": "_grid-
|
|
3
|
+
"grid-container": "_grid-container_1tchk_5",
|
|
4
|
+
grid: "_grid_1tchk_2",
|
|
5
|
+
"grid-item": "_grid-item_1tchk_55"
|
|
6
6
|
};
|
|
7
7
|
//#endregion
|
|
8
8
|
export { e as default };
|
package/dist/link/link.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer cascivo.component{.
|
|
1
|
+
@layer cascivo.component{._link_14poz_2{color:var(--cascivo-link-color,var(--cascivo-color-accent));cursor:pointer;border-radius:var(--cascivo-radius-item);text-underline-offset:.2em;transition:color var(--cascivo-duration-150) var(--cascivo-ease-out)}._link_14poz_2:hover{color:var(--cascivo-color-accent-hover)}._link_14poz_2:active{color:var(--cascivo-color-accent-active)}._link_14poz_2:focus-visible{box-shadow:var(--cascivo-focus-ring);outline:none}._link_14poz_2[data-variant=standalone]{font-family:var(--cascivo-font-sans);font-weight:var(--cascivo-font-medium);text-decoration:none}._link_14poz_2[data-variant=standalone]:hover{text-decoration:underline}._link_14poz_2[data-variant=standalone][data-size=sm]{font-size:var(--cascivo-text-sm)}._link_14poz_2[data-variant=standalone][data-size=md]{font-size:var(--cascivo-text-base)}._link_14poz_2[data-variant=standalone][data-size=lg]{font-size:var(--cascivo-text-lg)}._link_14poz_2[data-variant=inline]{font:inherit;text-decoration:underline}._link_14poz_2[data-external]:not(:has(>svg:last-child)):after{content:"↗" / "";margin-inline-start:var(--cascivo-space-1);font-size:.8em}}
|
package/dist/link/link.module.js
CHANGED
package/dist/menu/menu.js
CHANGED
|
@@ -2,32 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
import { usePopover as e } from "../popover/use-popover.js";
|
|
4
4
|
import t from "./menu.module.js";
|
|
5
|
-
import {
|
|
6
|
-
import { useSignalEffect as
|
|
7
|
-
import { jsx as
|
|
5
|
+
import { Children as n, createContext as r, isValidElement as i } from "react";
|
|
6
|
+
import { useSignalEffect as a, useSignals as o, useTypeahead as s } from "@cascivo/core";
|
|
7
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
8
|
//#region ../components/src/menu/menu.tsx
|
|
9
|
-
var
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
let { popoverRef:
|
|
13
|
-
let e =
|
|
9
|
+
var u = r(null);
|
|
10
|
+
function d({ ctx: e, children: n }) {
|
|
11
|
+
o();
|
|
12
|
+
let { popoverRef: r, anchorName: i, isOpen: l } = e, u = () => {
|
|
13
|
+
let e = r.current;
|
|
14
14
|
return e ? Array.from(e.querySelectorAll("[role=\"menuitem\"]:not([aria-disabled=\"true\"])")) : [];
|
|
15
15
|
}, d = (e) => {
|
|
16
16
|
let t = u();
|
|
17
17
|
t.length !== 0 && t[e(t, t.indexOf(document.activeElement))]?.focus();
|
|
18
|
-
}, f =
|
|
18
|
+
}, f = s({ onMatch: (e) => {
|
|
19
19
|
u().find((t) => (t.textContent ?? "").trim().toLowerCase().startsWith(e))?.focus();
|
|
20
20
|
} });
|
|
21
|
-
return
|
|
21
|
+
return a(() => {
|
|
22
22
|
if (!l.value) return;
|
|
23
|
-
let e =
|
|
23
|
+
let e = r.current;
|
|
24
24
|
e && e.querySelector("[role=\"menuitem\"]:not([aria-disabled=\"true\"])")?.focus();
|
|
25
|
-
}), /* @__PURE__ */
|
|
26
|
-
ref:
|
|
25
|
+
}), /* @__PURE__ */ c("div", {
|
|
26
|
+
ref: r,
|
|
27
27
|
popover: "auto",
|
|
28
28
|
role: "menu",
|
|
29
29
|
"data-state": l.value ? "open" : "closed",
|
|
30
|
-
style: { positionAnchor:
|
|
30
|
+
style: { positionAnchor: i },
|
|
31
31
|
className: t.panel,
|
|
32
32
|
onKeyDown: (e) => {
|
|
33
33
|
switch (e.key) {
|
|
@@ -49,74 +49,78 @@ function l({ ctx: e, children: n }) {
|
|
|
49
49
|
children: n
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
return /* @__PURE__ */
|
|
52
|
+
function f({ children: e }) {
|
|
53
|
+
return /* @__PURE__ */ c(u.Consumer, { children: (t) => {
|
|
54
54
|
if (!t) throw Error("MenuPanel must be inside <Menu>");
|
|
55
|
-
return /* @__PURE__ */
|
|
55
|
+
return /* @__PURE__ */ c(d, {
|
|
56
56
|
ctx: t,
|
|
57
57
|
children: e
|
|
58
58
|
});
|
|
59
59
|
} });
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
function p() {
|
|
62
|
+
return globalThis.process?.env?.NODE_ENV !== "production";
|
|
63
|
+
}
|
|
64
|
+
function m({ children: t }) {
|
|
65
|
+
let r = e(), a = n.toArray(t), o = a.find((e) => i(e) && e.type === g), s = a.filter((e) => e !== o);
|
|
66
|
+
if (o === void 0 && p()) throw Error("<Menu> requires a <MenuTrigger> child. It is matched by component identity, so it may appear in any order — but it must be a direct child, not wrapped in a fragment or another component.");
|
|
67
|
+
return /* @__PURE__ */ l(u.Provider, {
|
|
68
|
+
value: r,
|
|
69
|
+
children: [o, /* @__PURE__ */ c(f, { children: s })]
|
|
66
70
|
});
|
|
67
71
|
}
|
|
68
|
-
function
|
|
69
|
-
|
|
70
|
-
let { triggerRef:
|
|
71
|
-
return /* @__PURE__ */
|
|
72
|
-
ref:
|
|
72
|
+
function h({ ctx: e, children: n, ariaLabel: r, "aria-label": i }) {
|
|
73
|
+
o();
|
|
74
|
+
let { triggerRef: a, toggle: s, anchorName: l, isOpen: u } = e;
|
|
75
|
+
return /* @__PURE__ */ c("button", {
|
|
76
|
+
ref: a,
|
|
73
77
|
type: "button",
|
|
74
78
|
"aria-haspopup": "menu",
|
|
75
79
|
"aria-expanded": u.value,
|
|
76
|
-
"aria-label": r ??
|
|
80
|
+
"aria-label": r ?? i,
|
|
77
81
|
style: { anchorName: l },
|
|
78
|
-
onClick:
|
|
82
|
+
onClick: s,
|
|
79
83
|
className: t.trigger,
|
|
80
84
|
children: n
|
|
81
85
|
});
|
|
82
86
|
}
|
|
83
|
-
function
|
|
87
|
+
function g({ children: e, ariaLabel: t, "aria-label": n }) {
|
|
84
88
|
let r = t ?? n;
|
|
85
|
-
return /* @__PURE__ */
|
|
89
|
+
return /* @__PURE__ */ c(u.Consumer, { children: (t) => {
|
|
86
90
|
if (!t) throw Error("MenuTrigger must be inside <Menu>");
|
|
87
|
-
return /* @__PURE__ */
|
|
91
|
+
return /* @__PURE__ */ c(h, {
|
|
88
92
|
ctx: t,
|
|
89
93
|
...r !== void 0 && { ariaLabel: r },
|
|
90
94
|
children: e
|
|
91
95
|
});
|
|
92
96
|
} });
|
|
93
97
|
}
|
|
94
|
-
function
|
|
95
|
-
return /* @__PURE__ */
|
|
98
|
+
function _({ children: e, onSelect: n, disabled: r }) {
|
|
99
|
+
return /* @__PURE__ */ c(u.Consumer, { children: (i) => {
|
|
96
100
|
if (!i) throw Error("MenuItem must be inside <Menu>");
|
|
97
101
|
let { close: a } = i;
|
|
98
|
-
function
|
|
102
|
+
function o() {
|
|
99
103
|
r || (n(), a());
|
|
100
104
|
}
|
|
101
|
-
function
|
|
102
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(),
|
|
105
|
+
function s(e) {
|
|
106
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), o());
|
|
103
107
|
}
|
|
104
|
-
return /* @__PURE__ */
|
|
108
|
+
return /* @__PURE__ */ c("div", {
|
|
105
109
|
role: "menuitem",
|
|
106
110
|
tabIndex: r ? -1 : 0,
|
|
107
111
|
"aria-disabled": r,
|
|
108
|
-
onClick:
|
|
109
|
-
onKeyDown:
|
|
112
|
+
onClick: o,
|
|
113
|
+
onKeyDown: s,
|
|
110
114
|
className: t.item,
|
|
111
115
|
children: e
|
|
112
116
|
});
|
|
113
117
|
} });
|
|
114
118
|
}
|
|
115
|
-
function
|
|
116
|
-
return /* @__PURE__ */
|
|
119
|
+
function v() {
|
|
120
|
+
return /* @__PURE__ */ c("div", {
|
|
117
121
|
role: "separator",
|
|
118
122
|
className: t.separator
|
|
119
123
|
});
|
|
120
124
|
}
|
|
121
125
|
//#endregion
|
|
122
|
-
export {
|
|
126
|
+
export { m as Menu, _ as MenuItem, v as MenuSeparator, g as MenuTrigger };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import e from "./accordion.module.js";
|
|
4
4
|
import { createContext as t, forwardRef as n, useId as r, useRef as i } from "react";
|
|
5
|
-
import { cn as a,
|
|
5
|
+
import { cn as a, useControllableSignal as o, useSignalEffect as s, useSignals as c } from "@cascivo/core";
|
|
6
6
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
7
7
|
//#region ../components/src/accordion/accordion.tsx
|
|
8
8
|
var d = t(null), f = t(null);
|
|
@@ -10,9 +10,10 @@ function p(e) {
|
|
|
10
10
|
return e === void 0 ? [] : Array.isArray(e) ? e : [e];
|
|
11
11
|
}
|
|
12
12
|
function m({ type: t = "single", defaultValue: n, value: i, onValueChange: s, className: c, children: u }) {
|
|
13
|
-
let f = r(), m = o(
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
let f = r(), [m] = o({
|
|
14
|
+
value: i === void 0 ? void 0 : p(i),
|
|
15
|
+
defaultValue: p(n)
|
|
16
|
+
}), h = {
|
|
16
17
|
open: m,
|
|
17
18
|
baseId: f,
|
|
18
19
|
type: t,
|
|
@@ -2,56 +2,57 @@
|
|
|
2
2
|
|
|
3
3
|
import e from "./app-shell.module.js";
|
|
4
4
|
import { cloneElement as t, isValidElement as n, useRef as r } from "react";
|
|
5
|
-
import { cn as i,
|
|
5
|
+
import { cn as i, useControllableSignal as a, useSignalEffect as o, useSignals as s } from "@cascivo/core";
|
|
6
6
|
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
7
7
|
//#region ../components/src/app-shell/app-shell.tsx
|
|
8
|
-
function d({ header: d, nav: f, children: p, footer: m, open: h, defaultOpen: g, onOpenChange: _,
|
|
8
|
+
function d({ header: d, nav: f, children: p, footer: m, open: h, defaultOpen: g, onOpenChange: _, padding: v = 6, className: y, ...b }) {
|
|
9
9
|
s();
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
let x = h !== void 0, [S] = a({
|
|
11
|
+
value: h,
|
|
12
|
+
defaultValue: g ?? !0
|
|
13
|
+
}), C = r(null), w = r(null);
|
|
14
|
+
function T(e) {
|
|
15
|
+
x || (S.value = e), _?.(e);
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
-
typeof document < "u" && (
|
|
17
|
+
function E() {
|
|
18
|
+
typeof document < "u" && (w.current = document.activeElement), T(!S.value);
|
|
18
19
|
}
|
|
19
20
|
o(() => {
|
|
20
|
-
|
|
21
|
+
x || g !== void 0 || typeof window > "u" || typeof window.matchMedia != "function" || window.matchMedia("(max-width: 63.999rem)").matches && (S.value = !1);
|
|
21
22
|
}), o(() => {
|
|
22
|
-
if (!
|
|
23
|
+
if (!S.value || typeof document > "u") return;
|
|
23
24
|
let e = (e) => {
|
|
24
|
-
e.key === "Escape" &&
|
|
25
|
+
e.key === "Escape" && T(!1);
|
|
25
26
|
};
|
|
26
27
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
27
28
|
}), o(() => {
|
|
28
|
-
let e =
|
|
29
|
-
if (e) if (
|
|
29
|
+
let e = C.current;
|
|
30
|
+
if (e) if (S.value) e.removeAttribute("inert");
|
|
30
31
|
else {
|
|
31
32
|
e.setAttribute("inert", "");
|
|
32
|
-
let t =
|
|
33
|
+
let t = w.current;
|
|
33
34
|
t && e.contains(document.activeElement) && t.focus();
|
|
34
35
|
}
|
|
35
36
|
});
|
|
36
|
-
let
|
|
37
|
-
onMenuClick:
|
|
38
|
-
menuExpanded:
|
|
37
|
+
let D = n(d) && f ? t(d, {
|
|
38
|
+
onMenuClick: E,
|
|
39
|
+
menuExpanded: S.value
|
|
39
40
|
}) : d;
|
|
40
41
|
return /* @__PURE__ */ u("div", {
|
|
41
|
-
className: i(e.shell,
|
|
42
|
-
"data-open":
|
|
43
|
-
...
|
|
42
|
+
className: i(e.shell, y),
|
|
43
|
+
"data-open": S.value,
|
|
44
|
+
...b,
|
|
44
45
|
children: [
|
|
45
46
|
/* @__PURE__ */ l("div", {
|
|
46
47
|
className: e.header,
|
|
47
|
-
children:
|
|
48
|
+
children: D
|
|
48
49
|
}),
|
|
49
50
|
/* @__PURE__ */ u("div", {
|
|
50
51
|
className: e.body,
|
|
51
52
|
children: [f && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("div", {
|
|
52
|
-
ref:
|
|
53
|
+
ref: C,
|
|
53
54
|
className: e.navWrapper,
|
|
54
|
-
"data-open":
|
|
55
|
+
"data-open": S.value,
|
|
55
56
|
"data-testid": "app-shell-nav",
|
|
56
57
|
"data-cascivo-appshell-nav": "",
|
|
57
58
|
children: /* @__PURE__ */ l("div", {
|
|
@@ -60,15 +61,16 @@ function d({ header: d, nav: f, children: p, footer: m, open: h, defaultOpen: g,
|
|
|
60
61
|
})
|
|
61
62
|
}), /* @__PURE__ */ l("div", {
|
|
62
63
|
className: e.scrim,
|
|
63
|
-
"data-open":
|
|
64
|
+
"data-open": S.value,
|
|
64
65
|
"data-testid": "app-shell-scrim",
|
|
65
66
|
"aria-hidden": "true",
|
|
66
|
-
onClick: () =>
|
|
67
|
+
onClick: () => T(!1)
|
|
67
68
|
})] }), /* @__PURE__ */ l("main", {
|
|
68
69
|
id: "cascade-main",
|
|
69
70
|
tabIndex: -1,
|
|
70
71
|
className: e.main,
|
|
71
72
|
"data-cascivo-appshell-main": "",
|
|
73
|
+
"data-padding": v === "none" ? "none" : String(v),
|
|
72
74
|
children: p
|
|
73
75
|
})]
|
|
74
76
|
}),
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var e = {
|
|
2
|
-
shell: "
|
|
3
|
-
header: "
|
|
4
|
-
body: "
|
|
5
|
-
navWrapper: "
|
|
6
|
-
navInner: "
|
|
7
|
-
scrim: "
|
|
8
|
-
main: "
|
|
9
|
-
footer: "
|
|
2
|
+
shell: "_shell_pf33o_4",
|
|
3
|
+
header: "_header_pf33o_16",
|
|
4
|
+
body: "_body_pf33o_21",
|
|
5
|
+
navWrapper: "_navWrapper_pf33o_32",
|
|
6
|
+
navInner: "_navInner_pf33o_58",
|
|
7
|
+
scrim: "_scrim_pf33o_70",
|
|
8
|
+
main: "_main_pf33o_87",
|
|
9
|
+
footer: "_footer_pf33o_128"
|
|
10
10
|
};
|
|
11
11
|
//#endregion
|
|
12
12
|
export { e as default };
|
package/dist/node/badge/badge.js
CHANGED
|
@@ -3,7 +3,7 @@ import { cn as t, normalizeTone as n } from "@cascivo/core/pure";
|
|
|
3
3
|
import { jsx as r } from "react/jsx-runtime";
|
|
4
4
|
//#region ../components/src/badge/badge.tsx
|
|
5
5
|
var i = {
|
|
6
|
-
neutral: "
|
|
6
|
+
neutral: "secondary",
|
|
7
7
|
info: "info",
|
|
8
8
|
success: "success",
|
|
9
9
|
warning: "warning",
|
|
@@ -25,7 +25,10 @@ var s = i(function({ variant: i = "primary", size: s = "md", loading: c = !1, as
|
|
|
25
25
|
children: [c && /* @__PURE__ */ a(e, {
|
|
26
26
|
size: "sm",
|
|
27
27
|
"aria-hidden": "true"
|
|
28
|
-
}), /* @__PURE__ */ a("span", {
|
|
28
|
+
}), /* @__PURE__ */ a("span", {
|
|
29
|
+
className: t.label,
|
|
30
|
+
children: f
|
|
31
|
+
})]
|
|
29
32
|
});
|
|
30
33
|
});
|
|
31
34
|
//#endregion
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import e from "./calendar.module.js";
|
|
4
|
-
import { batch as t, cn as n,
|
|
5
|
-
import { builtin as
|
|
6
|
-
import { jsx as
|
|
4
|
+
import { batch as t, cn as n, useControllableSignal as r, useSignal as i, useSignals as a } from "@cascivo/core";
|
|
5
|
+
import { builtin as o, currentLocale as s, t as c } from "@cascivo/i18n";
|
|
6
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
7
7
|
//#region ../components/src/calendar/calendar.tsx
|
|
8
|
-
function
|
|
8
|
+
function d(e) {
|
|
9
9
|
try {
|
|
10
10
|
let t = new Intl.Locale(e).weekInfo;
|
|
11
11
|
if (t) return t.firstDay % 7;
|
|
12
12
|
} catch {}
|
|
13
13
|
return 1;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function f(e, t, n) {
|
|
16
16
|
let r = new Date(Date.UTC(e, t, 1)), i = new Date(Date.UTC(e, t + 1, 0)), a = (r.getUTCDay() - n + 7) % 7, o = [];
|
|
17
17
|
for (let e = 0; e < a; e++) o.push(null);
|
|
18
18
|
for (let n = 1; n <= i.getUTCDate(); n++) o.push(new Date(Date.UTC(e, t, n)));
|
|
@@ -21,22 +21,22 @@ function d(e, t, n) {
|
|
|
21
21
|
for (let e = 0; e < o.length; e += 7) s.push(o.slice(e, e + 7));
|
|
22
22
|
return s;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function p(e) {
|
|
25
25
|
return `${e.getUTCFullYear()}-${e.getUTCMonth()}-${e.getUTCDate()}`;
|
|
26
26
|
}
|
|
27
|
-
function p(e, t) {
|
|
28
|
-
return !e || !t ? !1 : f(e) === f(t);
|
|
29
|
-
}
|
|
30
27
|
function m(e, t) {
|
|
31
|
-
return
|
|
28
|
+
return !e || !t ? !1 : p(e) === p(t);
|
|
32
29
|
}
|
|
33
30
|
function h(e, t) {
|
|
34
|
-
return new Date(Date.UTC(e.getUTCFullYear(), e.getUTCMonth()
|
|
31
|
+
return new Date(Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate() + t));
|
|
35
32
|
}
|
|
36
33
|
function g(e, t) {
|
|
37
|
-
return
|
|
34
|
+
return new Date(Date.UTC(e.getUTCFullYear(), e.getUTCMonth() + t, e.getUTCDate()));
|
|
35
|
+
}
|
|
36
|
+
function _(e, t) {
|
|
37
|
+
return h(e, -((e.getUTCDay() - t + 7) % 7));
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function v(e, t, n) {
|
|
40
40
|
if (t) {
|
|
41
41
|
let n = new Date(Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate()));
|
|
42
42
|
if (e.getTime() < n.getTime()) return !0;
|
|
@@ -47,96 +47,100 @@ function _(e, t, n) {
|
|
|
47
47
|
}
|
|
48
48
|
return !1;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
-
let
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
50
|
+
function y({ value: p, defaultValue: y, onValueChange: b, min: x, max: S, disabled: C, locale: w, size: T = "md", labels: E, className: D, isInRange: O, isRangeStart: k, isRangeEnd: A, onDayHover: j, month: M, year: N, onViewChange: P, hideNav: F = !1 }) {
|
|
51
|
+
a();
|
|
52
|
+
let I = w ?? s(), L = E?.previousMonth ?? c(o.calendar.previousMonth), R = E?.nextMonth ?? c(o.calendar.nextMonth), z = p === void 0 ? y ?? null : p, B = /* @__PURE__ */ new Date(), V = z ?? y ?? B, [H] = r({
|
|
53
|
+
value: N,
|
|
54
|
+
defaultValue: V.getUTCFullYear()
|
|
55
|
+
}), [U] = r({
|
|
56
|
+
value: M,
|
|
57
|
+
defaultValue: V.getUTCMonth()
|
|
58
|
+
}), W = i(V), G = d(I), K = f(H.value, U.value, G), q = new Intl.DateTimeFormat(I, { weekday: "short" }), J = Array.from({ length: 7 }, (e, t) => {
|
|
59
|
+
let n = new Date(Date.UTC(2024, 0, 7 + G + t));
|
|
60
|
+
return q.format(n);
|
|
61
|
+
}), ee = new Intl.DateTimeFormat(I, {
|
|
58
62
|
weekday: "long",
|
|
59
63
|
year: "numeric",
|
|
60
64
|
month: "long",
|
|
61
65
|
day: "numeric"
|
|
62
|
-
}), Y = new Intl.DateTimeFormat(
|
|
66
|
+
}), Y = new Intl.DateTimeFormat(I, {
|
|
63
67
|
month: "long",
|
|
64
68
|
year: "numeric"
|
|
65
|
-
}).format(new Date(Date.UTC(
|
|
66
|
-
Z ?
|
|
67
|
-
|
|
68
|
-
}),
|
|
69
|
+
}).format(new Date(Date.UTC(H.value, U.value, 1))), X = (e) => v(e, x, S) || (C ? C(e) : !1), Z = M !== void 0 || N !== void 0, te = (e) => {
|
|
70
|
+
Z ? W.value = e : t(() => {
|
|
71
|
+
H.value = e.getUTCFullYear(), U.value = e.getUTCMonth(), W.value = e;
|
|
72
|
+
}), P?.({
|
|
69
73
|
month: e.getUTCMonth(),
|
|
70
74
|
year: e.getUTCFullYear()
|
|
71
75
|
});
|
|
72
76
|
}, Q = (e) => {
|
|
73
|
-
X(e) ||
|
|
77
|
+
X(e) || b?.(e);
|
|
74
78
|
}, $ = (e) => {
|
|
75
|
-
let n =
|
|
79
|
+
let n = g(new Date(Date.UTC(H.value, U.value, 1)), e), r = n.getUTCMonth(), i = n.getUTCFullYear();
|
|
76
80
|
Z || t(() => {
|
|
77
|
-
|
|
78
|
-
}),
|
|
81
|
+
U.value = r, H.value = i;
|
|
82
|
+
}), P?.({
|
|
79
83
|
month: r,
|
|
80
84
|
year: i
|
|
81
85
|
});
|
|
82
86
|
};
|
|
83
|
-
return /* @__PURE__ */
|
|
84
|
-
className: n(e.calendar,
|
|
85
|
-
"data-size":
|
|
86
|
-
onMouseLeave: () =>
|
|
87
|
-
children: [/* @__PURE__ */
|
|
87
|
+
return /* @__PURE__ */ u("div", {
|
|
88
|
+
className: n(e.calendar, D),
|
|
89
|
+
"data-size": T,
|
|
90
|
+
onMouseLeave: () => j?.(null),
|
|
91
|
+
children: [/* @__PURE__ */ u("div", {
|
|
88
92
|
className: e.header,
|
|
89
93
|
children: [
|
|
90
|
-
|
|
94
|
+
F ? /* @__PURE__ */ l("span", { className: e.navSpacer }) : /* @__PURE__ */ l("button", {
|
|
91
95
|
type: "button",
|
|
92
96
|
className: e.navButton,
|
|
93
|
-
"aria-label":
|
|
97
|
+
"aria-label": L,
|
|
94
98
|
onClick: () => $(-1),
|
|
95
99
|
children: "‹"
|
|
96
100
|
}),
|
|
97
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ l("span", {
|
|
98
102
|
className: e.monthLabel,
|
|
99
103
|
"aria-live": "polite",
|
|
100
104
|
children: Y
|
|
101
105
|
}),
|
|
102
|
-
|
|
106
|
+
F ? /* @__PURE__ */ l("span", { className: e.navSpacer }) : /* @__PURE__ */ l("button", {
|
|
103
107
|
type: "button",
|
|
104
108
|
className: e.navButton,
|
|
105
|
-
"aria-label":
|
|
109
|
+
"aria-label": R,
|
|
106
110
|
onClick: () => $(1),
|
|
107
111
|
children: "›"
|
|
108
112
|
})
|
|
109
113
|
]
|
|
110
|
-
}), /* @__PURE__ */
|
|
114
|
+
}), /* @__PURE__ */ u("table", {
|
|
111
115
|
role: "grid",
|
|
112
116
|
"aria-label": Y,
|
|
113
117
|
className: e.grid,
|
|
114
118
|
onKeyDown: (e) => {
|
|
115
|
-
let t =
|
|
119
|
+
let t = W.value, n;
|
|
116
120
|
switch (e.key) {
|
|
117
121
|
case "ArrowRight":
|
|
118
|
-
n =
|
|
122
|
+
n = h(t, 1);
|
|
119
123
|
break;
|
|
120
124
|
case "ArrowLeft":
|
|
121
|
-
n =
|
|
125
|
+
n = h(t, -1);
|
|
122
126
|
break;
|
|
123
127
|
case "ArrowDown":
|
|
124
|
-
n =
|
|
128
|
+
n = h(t, 7);
|
|
125
129
|
break;
|
|
126
130
|
case "ArrowUp":
|
|
127
|
-
n =
|
|
131
|
+
n = h(t, -7);
|
|
128
132
|
break;
|
|
129
133
|
case "Home":
|
|
130
|
-
n =
|
|
134
|
+
n = _(t, G);
|
|
131
135
|
break;
|
|
132
136
|
case "End":
|
|
133
|
-
n =
|
|
137
|
+
n = h(_(t, G), 6);
|
|
134
138
|
break;
|
|
135
139
|
case "PageUp":
|
|
136
|
-
n =
|
|
140
|
+
n = g(t, e.shiftKey ? -12 : -1);
|
|
137
141
|
break;
|
|
138
142
|
case "PageDown":
|
|
139
|
-
n =
|
|
143
|
+
n = g(t, e.shiftKey ? 12 : 1);
|
|
140
144
|
break;
|
|
141
145
|
case "Enter":
|
|
142
146
|
case " ":
|
|
@@ -144,45 +148,45 @@ function v({ value: f, defaultValue: v, onValueChange: y, min: b, max: x, disabl
|
|
|
144
148
|
return;
|
|
145
149
|
default: return;
|
|
146
150
|
}
|
|
147
|
-
e.preventDefault(),
|
|
151
|
+
e.preventDefault(), te(n), j?.(n);
|
|
148
152
|
},
|
|
149
|
-
children: [/* @__PURE__ */
|
|
153
|
+
children: [/* @__PURE__ */ l("thead", { children: /* @__PURE__ */ l("tr", {
|
|
150
154
|
role: "row",
|
|
151
|
-
children:
|
|
155
|
+
children: J.map((t) => /* @__PURE__ */ l("th", {
|
|
152
156
|
className: e.weekday,
|
|
153
157
|
abbr: t,
|
|
154
158
|
scope: "col",
|
|
155
159
|
children: t
|
|
156
160
|
}, t))
|
|
157
|
-
}) }), /* @__PURE__ */
|
|
161
|
+
}) }), /* @__PURE__ */ l("tbody", { children: K.map((t, n) => /* @__PURE__ */ l("tr", {
|
|
158
162
|
role: "row",
|
|
159
163
|
children: t.map((t, n) => {
|
|
160
|
-
if (!t) return /* @__PURE__ */
|
|
164
|
+
if (!t) return /* @__PURE__ */ l("td", {
|
|
161
165
|
role: "gridcell",
|
|
162
166
|
className: e.empty
|
|
163
167
|
}, n);
|
|
164
|
-
let r =
|
|
165
|
-
return /* @__PURE__ */
|
|
168
|
+
let r = m(t, z), i = m(t, B), a = m(t, W.value), o = X(t), s = O ? O(t) : !1, c = k ? k(t) : !1, u = A ? A(t) : !1;
|
|
169
|
+
return /* @__PURE__ */ l("td", {
|
|
166
170
|
role: "gridcell",
|
|
167
171
|
className: e.cell,
|
|
168
172
|
"aria-selected": r,
|
|
169
|
-
children: /* @__PURE__ */
|
|
173
|
+
children: /* @__PURE__ */ l("button", {
|
|
170
174
|
type: "button",
|
|
171
175
|
className: e.day,
|
|
172
176
|
tabIndex: a ? 0 : -1,
|
|
173
|
-
"aria-label":
|
|
177
|
+
"aria-label": ee.format(t),
|
|
174
178
|
"aria-current": i ? "date" : void 0,
|
|
175
179
|
"aria-disabled": o || void 0,
|
|
176
180
|
"data-selected": r || void 0,
|
|
177
181
|
"data-today": i || void 0,
|
|
178
182
|
"data-in-range": s || void 0,
|
|
179
|
-
"data-range-start":
|
|
183
|
+
"data-range-start": c || void 0,
|
|
180
184
|
"data-range-end": u || void 0,
|
|
181
185
|
onClick: () => Q(t),
|
|
182
186
|
onFocus: () => {
|
|
183
|
-
|
|
187
|
+
W.value = t;
|
|
184
188
|
},
|
|
185
|
-
onMouseEnter: () =>
|
|
189
|
+
onMouseEnter: () => j?.(t),
|
|
186
190
|
children: t.getUTCDate()
|
|
187
191
|
})
|
|
188
192
|
}, n);
|
|
@@ -192,4 +196,4 @@ function v({ value: f, defaultValue: v, onValueChange: y, min: b, max: x, disabl
|
|
|
192
196
|
});
|
|
193
197
|
}
|
|
194
198
|
//#endregion
|
|
195
|
-
export {
|
|
199
|
+
export { y as Calendar };
|