@cascivo/react 0.16.1 → 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/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/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/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 +72 -4
- package/dist/layouts/src/grid/grid.css +1 -1
- package/dist/layouts/src/grid/grid.module.js +3 -3
- 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/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/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/layouts/src/grid/grid.module.js +3 -3
- package/dist/node/search/search.js +5 -4
- package/dist/node/side-nav/side-nav.js +90 -89
- package/dist/node/swap/swap.js +2 -3
- package/dist/node/switcher/switcher.js +1 -1
- package/dist/node/tabs/tabs.js +5 -4
- package/dist/node/toc/toc.js +5 -4
- package/dist/search/search.js +5 -4
- package/dist/side-nav/side-nav.js +90 -89
- package/dist/styles.css +7 -7
- package/dist/swap/swap.js +2 -3
- package/dist/switcher/switcher.js +1 -1
- package/dist/tabs/tabs.js +5 -4
- package/dist/toc/toc.js +5 -4
- package/package.json +3 -3
|
@@ -2,25 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
import e from "./date-picker.module.js";
|
|
4
4
|
import { useId as t, useRef as n } from "react";
|
|
5
|
-
import { batch as r, cn as i, createMachine as a,
|
|
6
|
-
import { builtin as
|
|
7
|
-
import { jsx as
|
|
5
|
+
import { batch as r, cn as i, createMachine as a, useControllableSignal as o, useMachine as s, useSignal as c, useSignalEffect as l, useSignals as ee } from "@cascivo/core";
|
|
6
|
+
import { builtin as u, currentLocale as d, t as f } from "@cascivo/i18n";
|
|
7
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
8
8
|
//#region ../components/src/date-picker/date-picker.tsx
|
|
9
|
-
var
|
|
9
|
+
var h = a({
|
|
10
10
|
initial: "closed",
|
|
11
11
|
states: {
|
|
12
12
|
closed: { on: { OPEN: "open" } },
|
|
13
13
|
open: { on: { CLOSE: "closed" } }
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
function
|
|
16
|
+
function g(e) {
|
|
17
17
|
try {
|
|
18
18
|
let t = new Intl.Locale(e).weekInfo;
|
|
19
19
|
if (t) return t.firstDay % 7;
|
|
20
20
|
} catch {}
|
|
21
21
|
return 1;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function te(e, t, n) {
|
|
24
24
|
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 = [];
|
|
25
25
|
for (let e = 0; e < a; e++) o.push(null);
|
|
26
26
|
for (let n = 1; n <= i.getUTCDate(); n++) o.push(new Date(Date.UTC(e, t, n)));
|
|
@@ -29,170 +29,171 @@ function m(e, t, n) {
|
|
|
29
29
|
for (let e = 0; e < o.length; e += 7) s.push(o.slice(e, e + 7));
|
|
30
30
|
return s;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function _(e, t) {
|
|
33
33
|
return new Intl.DateTimeFormat(t).format(e);
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function v(e) {
|
|
36
36
|
return e.toISOString().slice(0, 10);
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function y(e) {
|
|
39
39
|
let [t, n, r] = e.split("-").map(Number);
|
|
40
40
|
return new Date(Date.UTC(t, n - 1, r));
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function b({ value: a, defaultValue: b, onValueChange: ne, onChange: x, min: S, max: C, clearable: w = !1, label: T, hint: E, error: D, size: re = "md", disabled: O = !1, labels: k, className: ie, id: ae }) {
|
|
43
43
|
ee();
|
|
44
|
-
let [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
c(()
|
|
48
|
-
|
|
44
|
+
let [A, j] = s(h), M = t(), N = ae ?? `cascade-date-picker-${M}`, P = `${M}-grid`, F = d(), I = k?.placeholder ?? f(u.datePicker.placeholder), L = k?.previousMonth ?? f(u.datePicker.previousMonth), R = k?.nextMonth ?? f(u.datePicker.nextMonth), z = k?.clear ?? f(u.datePicker.clear), B = /* @__PURE__ */ new Date(), V = v(B), [H] = o({
|
|
45
|
+
value: a,
|
|
46
|
+
defaultValue: b
|
|
47
|
+
}), U = c(H.value ? y(H.value).getUTCFullYear() : B.getUTCFullYear()), W = c(H.value ? y(H.value).getUTCMonth() : B.getUTCMonth()), G = c(H.value), K = n(null);
|
|
48
|
+
l(() => {
|
|
49
|
+
if (A.value !== "open") return;
|
|
49
50
|
let e = (e) => {
|
|
50
|
-
|
|
51
|
+
K.current && !K.current.contains(e.target) && j("CLOSE");
|
|
51
52
|
};
|
|
52
53
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
53
54
|
});
|
|
54
|
-
let
|
|
55
|
-
O ||
|
|
56
|
-
},
|
|
57
|
-
|
|
55
|
+
let q = () => {
|
|
56
|
+
O || j("OPEN");
|
|
57
|
+
}, J = () => j("CLOSE"), Y = ne ?? x, X = (e) => {
|
|
58
|
+
S && e < S || C && e > C || (a === void 0 && (H.value = e), Y?.(e), J());
|
|
58
59
|
}, oe = (e) => {
|
|
59
|
-
e.stopPropagation(), a === void 0 && (
|
|
60
|
+
e.stopPropagation(), a === void 0 && (H.value = void 0), Y?.(void 0);
|
|
60
61
|
}, se = () => {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}) :
|
|
62
|
+
W.value === 0 ? r(() => {
|
|
63
|
+
U.value--, W.value = 11;
|
|
64
|
+
}) : W.value--;
|
|
64
65
|
}, ce = () => {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}) :
|
|
68
|
-
},
|
|
69
|
-
let n = new Date(Date.UTC(2024, 0, 7 +
|
|
70
|
-
return
|
|
71
|
-
}), Q = new Intl.DateTimeFormat(
|
|
66
|
+
W.value === 11 ? r(() => {
|
|
67
|
+
U.value++, W.value = 0;
|
|
68
|
+
}) : W.value++;
|
|
69
|
+
}, Z = g(F), le = te(U.value, W.value, Z), ue = new Intl.DateTimeFormat(F, { weekday: "short" }), de = Array.from({ length: 7 }, (e, t) => {
|
|
70
|
+
let n = new Date(Date.UTC(2024, 0, 7 + Z + t));
|
|
71
|
+
return ue.format(n);
|
|
72
|
+
}), Q = new Intl.DateTimeFormat(F, {
|
|
72
73
|
month: "long",
|
|
73
74
|
year: "numeric"
|
|
74
|
-
}).format(new Date(Date.UTC(
|
|
75
|
-
let t =
|
|
75
|
+
}).format(new Date(Date.UTC(U.value, W.value, 1))), fe = (e) => {
|
|
76
|
+
let t = G.value;
|
|
76
77
|
if (!t) return;
|
|
77
|
-
let n =
|
|
78
|
+
let n = y(t), i;
|
|
78
79
|
if (e.key === "ArrowRight") i = new Date(Date.UTC(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate() + 1));
|
|
79
80
|
else if (e.key === "ArrowLeft") i = new Date(Date.UTC(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate() - 1));
|
|
80
81
|
else if (e.key === "ArrowDown") i = new Date(Date.UTC(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate() + 7));
|
|
81
82
|
else if (e.key === "ArrowUp") i = new Date(Date.UTC(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate() - 7));
|
|
82
83
|
else if (e.key === "Enter" || e.key === " ") {
|
|
83
|
-
e.preventDefault(),
|
|
84
|
+
e.preventDefault(), X(t);
|
|
84
85
|
return;
|
|
85
86
|
} else if (e.key === "Escape") {
|
|
86
|
-
|
|
87
|
+
J();
|
|
87
88
|
return;
|
|
88
89
|
} else return;
|
|
89
90
|
if (e.preventDefault(), i) {
|
|
90
|
-
let e =
|
|
91
|
-
if (
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
let e = v(i);
|
|
92
|
+
if (S && e < S || C && e > C) return;
|
|
93
|
+
G.value = e, r(() => {
|
|
94
|
+
U.value = i.getUTCFullYear(), W.value = i.getUTCMonth();
|
|
94
95
|
});
|
|
95
96
|
}
|
|
96
|
-
}, $ =
|
|
97
|
-
return /* @__PURE__ */
|
|
98
|
-
ref:
|
|
99
|
-
className: i(e.wrapper,
|
|
100
|
-
"data-state":
|
|
101
|
-
"data-size":
|
|
97
|
+
}, $ = H.value ? _(y(H.value), F) : "";
|
|
98
|
+
return /* @__PURE__ */ m("div", {
|
|
99
|
+
ref: K,
|
|
100
|
+
className: i(e.wrapper, ie),
|
|
101
|
+
"data-state": D ? "error" : A.value,
|
|
102
|
+
"data-size": re,
|
|
102
103
|
children: [
|
|
103
|
-
|
|
104
|
+
T && /* @__PURE__ */ p("label", {
|
|
104
105
|
className: e.label,
|
|
105
|
-
htmlFor:
|
|
106
|
-
children:
|
|
106
|
+
htmlFor: N,
|
|
107
|
+
children: T
|
|
107
108
|
}),
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ m("div", {
|
|
109
110
|
className: e.field,
|
|
110
|
-
children: [/* @__PURE__ */
|
|
111
|
-
id:
|
|
111
|
+
children: [/* @__PURE__ */ m("button", {
|
|
112
|
+
id: N,
|
|
112
113
|
type: "button",
|
|
113
114
|
role: "combobox",
|
|
114
|
-
"aria-expanded":
|
|
115
|
-
"aria-controls":
|
|
115
|
+
"aria-expanded": A.value === "open",
|
|
116
|
+
"aria-controls": P,
|
|
116
117
|
"aria-haspopup": "dialog",
|
|
117
|
-
"aria-invalid":
|
|
118
|
-
"aria-describedby":
|
|
118
|
+
"aria-invalid": D ? !0 : void 0,
|
|
119
|
+
"aria-describedby": D ? `${M}-error` : E ? `${M}-hint` : void 0,
|
|
119
120
|
className: e.trigger,
|
|
120
121
|
disabled: O,
|
|
121
|
-
onClick:
|
|
122
|
-
children: [/* @__PURE__ */
|
|
122
|
+
onClick: A.value === "open" ? J : q,
|
|
123
|
+
children: [/* @__PURE__ */ p("span", {
|
|
123
124
|
className: i(e.value, $ ? void 0 : e.placeholder),
|
|
124
|
-
children: $ ||
|
|
125
|
-
}), /* @__PURE__ */
|
|
125
|
+
children: $ || I
|
|
126
|
+
}), /* @__PURE__ */ p("span", {
|
|
126
127
|
className: e.icon,
|
|
127
128
|
"aria-hidden": "true",
|
|
128
129
|
children: "📅"
|
|
129
130
|
})]
|
|
130
|
-
}),
|
|
131
|
+
}), w && H.value !== void 0 && /* @__PURE__ */ p("button", {
|
|
131
132
|
type: "button",
|
|
132
133
|
className: e.clear,
|
|
133
|
-
"aria-label":
|
|
134
|
+
"aria-label": z,
|
|
134
135
|
onClick: oe,
|
|
135
136
|
children: "✕"
|
|
136
137
|
})]
|
|
137
138
|
}),
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
id:
|
|
139
|
+
/* @__PURE__ */ m("div", {
|
|
140
|
+
id: P,
|
|
140
141
|
role: "dialog",
|
|
141
142
|
"aria-label": Q,
|
|
142
143
|
className: e.calendar,
|
|
143
|
-
"data-state":
|
|
144
|
-
onKeyDown:
|
|
145
|
-
children: [/* @__PURE__ */
|
|
144
|
+
"data-state": A.value,
|
|
145
|
+
onKeyDown: fe,
|
|
146
|
+
children: [/* @__PURE__ */ m("div", {
|
|
146
147
|
className: e.header,
|
|
147
148
|
children: [
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ p("button", {
|
|
149
150
|
type: "button",
|
|
150
151
|
className: e.navButton,
|
|
151
|
-
"aria-label":
|
|
152
|
+
"aria-label": L,
|
|
152
153
|
onClick: se,
|
|
153
154
|
children: "‹"
|
|
154
155
|
}),
|
|
155
|
-
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ p("span", {
|
|
156
157
|
className: e.monthLabel,
|
|
157
158
|
"aria-live": "polite",
|
|
158
159
|
children: Q
|
|
159
160
|
}),
|
|
160
|
-
/* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ p("button", {
|
|
161
162
|
type: "button",
|
|
162
163
|
className: e.navButton,
|
|
163
|
-
"aria-label":
|
|
164
|
+
"aria-label": R,
|
|
164
165
|
onClick: ce,
|
|
165
166
|
children: "›"
|
|
166
167
|
})
|
|
167
168
|
]
|
|
168
|
-
}), /* @__PURE__ */
|
|
169
|
+
}), /* @__PURE__ */ m("table", {
|
|
169
170
|
role: "grid",
|
|
170
171
|
className: e.grid,
|
|
171
|
-
children: [/* @__PURE__ */
|
|
172
|
+
children: [/* @__PURE__ */ p("thead", { children: /* @__PURE__ */ p("tr", { children: de.map((t) => /* @__PURE__ */ p("th", {
|
|
172
173
|
className: e.weekday,
|
|
173
174
|
abbr: t,
|
|
174
175
|
scope: "col",
|
|
175
176
|
children: t
|
|
176
|
-
}, t)) }) }), /* @__PURE__ */
|
|
177
|
-
if (!t) return /* @__PURE__ */
|
|
178
|
-
let r =
|
|
179
|
-
return /* @__PURE__ */
|
|
177
|
+
}, t)) }) }), /* @__PURE__ */ p("tbody", { children: le.map((t, n) => /* @__PURE__ */ p("tr", { children: t.map((t, n) => {
|
|
178
|
+
if (!t) return /* @__PURE__ */ p("td", { className: e.empty }, n);
|
|
179
|
+
let r = v(t), i = r === H.value, a = r === V, o = r === G.value, s = S !== void 0 && r < S || C !== void 0 && r > C;
|
|
180
|
+
return /* @__PURE__ */ p("td", {
|
|
180
181
|
className: e.cell,
|
|
181
|
-
children: /* @__PURE__ */
|
|
182
|
+
children: /* @__PURE__ */ p("button", {
|
|
182
183
|
type: "button",
|
|
183
184
|
className: e.day,
|
|
184
185
|
tabIndex: o ? 0 : -1,
|
|
185
186
|
"aria-pressed": i,
|
|
186
|
-
"aria-label":
|
|
187
|
+
"aria-label": _(t, F),
|
|
187
188
|
"aria-current": a ? "date" : void 0,
|
|
188
189
|
"aria-disabled": s || void 0,
|
|
189
190
|
"data-selected": i || void 0,
|
|
190
191
|
"data-today": a || void 0,
|
|
191
192
|
onClick: () => {
|
|
192
|
-
s ||
|
|
193
|
+
s || X(r);
|
|
193
194
|
},
|
|
194
195
|
onFocus: () => {
|
|
195
|
-
|
|
196
|
+
G.value = r;
|
|
196
197
|
},
|
|
197
198
|
children: t.getUTCDate()
|
|
198
199
|
})
|
|
@@ -200,19 +201,19 @@ function v({ value: a, defaultValue: v, onValueChange: y, onChange: b, min: x, m
|
|
|
200
201
|
}) }, n)) })]
|
|
201
202
|
})]
|
|
202
203
|
}),
|
|
203
|
-
|
|
204
|
-
id: `${
|
|
204
|
+
D && /* @__PURE__ */ p("span", {
|
|
205
|
+
id: `${M}-error`,
|
|
205
206
|
className: e.error,
|
|
206
207
|
role: "alert",
|
|
207
|
-
children:
|
|
208
|
+
children: D
|
|
208
209
|
}),
|
|
209
|
-
!
|
|
210
|
-
id: `${
|
|
210
|
+
!D && E && /* @__PURE__ */ p("span", {
|
|
211
|
+
id: `${M}-hint`,
|
|
211
212
|
className: e.hint,
|
|
212
|
-
children:
|
|
213
|
+
children: E
|
|
213
214
|
})
|
|
214
215
|
]
|
|
215
216
|
});
|
|
216
217
|
}
|
|
217
218
|
//#endregion
|
|
218
|
-
export {
|
|
219
|
+
export { b as DatePicker };
|
package/dist/field/field.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer cascivo.component{.
|
|
1
|
+
@layer cascivo.component{._field_1y14o_2{gap:var(--cascivo-space-2);font-family:var(--cascivo-font-sans);align-content:start;display:grid}._field_1y14o_2[data-disabled]{opacity:.5}._description_1y14o_20{font-size:var(--cascivo-text-sm);line-height:var(--cascivo-leading-snug);color:var(--cascivo-color-text-muted);margin:0}._error_1y14o_27{font-size:var(--cascivo-text-sm);line-height:var(--cascivo-leading-snug);color:var(--cascivo-color-destructive);margin:0}}@media (forced-colors:active){._error_1y14o_27{color:buttontext}}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import './field.css';
|
|
2
2
|
var e = {
|
|
3
|
-
field: "
|
|
4
|
-
description: "
|
|
5
|
-
error: "
|
|
3
|
+
field: "_field_1y14o_2",
|
|
4
|
+
description: "_description_1y14o_20",
|
|
5
|
+
error: "_error_1y14o_27"
|
|
6
6
|
};
|
|
7
7
|
//#endregion
|
|
8
8
|
export { e as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -24,6 +24,16 @@
|
|
|
24
24
|
import { AnchorHTMLAttributes, ButtonHTMLAttributes, FormHTMLAttributes, HTMLAttributes, ImgHTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes, LiHTMLAttributes, MouseEvent, ReactElement, ReactNode, RefObject, SelectHTMLAttributes, TextareaHTMLAttributes, TimeHTMLAttributes } from "react";
|
|
25
25
|
import { DismissableLayer, DismissableLayerProps, ErrorBoundary, FocusScope, LinkComponent, LinkComponentProps, Machine, MachineConfig, Portal, Presence, ProgressInput, RovingOrientation, Signal, Slot, SlotProps, SpaceStep, SuspenseBoundary, ThemeProvider, ThemeProviderProps, ToneInput, UseClipboardOptions, UseClipboardReturn, UseControllableSignalOptions, UseDisclosureOptions, UseDisclosureReturn, VisuallyHidden, VisuallyHiddenProps, applyTheme, batch, cn, composeRefs, computePosition, computed, createMachine, createScope, createStreamBuffer, effect, getLinkComponent, mergeProps, setLinkComponent, setTheme, signal, themePreloadScript, themeSignal, useAnchorPosition, useClipboard, useComputed, useControllableSignal, useDisclosure, useEffectPropSignal, useId, useMachine, useMediaQuery, useRovingFocus, useScope, useScrollLock, useSignal, useSignalEffect, useSignals, useStreamBuffer, useTheme, useTypeahead } from "@cascivo/core";
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Button.
|
|
29
|
+
*
|
|
30
|
+
* ⚠ **DOM shape:** children are wrapped in an inner `<span>` so the loading `Spinner` can be
|
|
31
|
+
* a sibling rather than being nested inside the label. Layout CSS written against
|
|
32
|
+
* `.my-button > span` therefore targets that wrapper, not your content — one adopter's
|
|
33
|
+
* `> span { display: flex }` hit the wrapper and collapsed the spacing inside it. The wrapper
|
|
34
|
+
* is already a flex row that inherits the button's `gap`, so composing an icon with a label
|
|
35
|
+
* needs no CSS of your own.
|
|
36
|
+
*/
|
|
27
37
|
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
28
38
|
/**
|
|
29
39
|
* Selects the visual style variant.
|
|
@@ -78,7 +88,12 @@ interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
78
88
|
*/
|
|
79
89
|
variant?: 'default' | 'outlined' | 'elevated';
|
|
80
90
|
/**
|
|
81
|
-
* Inner padding of the
|
|
91
|
+
* Inner padding of the CARD BOX. ⚠ `padding="none"` deliberately does NOT strip the
|
|
92
|
+
* padding from CardHeader/CardContent/CardFooter — those keep their own. It means "let a
|
|
93
|
+
* flush child (a LogViewer, an image, an edge-to-edge table) reach the card's edge";
|
|
94
|
+
* zeroing both put the title flush against the border and made the mode unusable with the
|
|
95
|
+
* composition it exists for. For an edge-to-edge table, skip CardContent and pass the
|
|
96
|
+
* table as a direct child.
|
|
82
97
|
*
|
|
83
98
|
* @defaultValue `md`
|
|
84
99
|
* @see the component manifest
|
|
@@ -128,8 +143,16 @@ declare function CardFooter({
|
|
|
128
143
|
children,
|
|
129
144
|
...props
|
|
130
145
|
}: CardFooterProps): import("react").JSX.Element;
|
|
131
|
-
/**
|
|
132
|
-
|
|
146
|
+
/**
|
|
147
|
+
* Badge-only looks that aren't a severity tone.
|
|
148
|
+
*
|
|
149
|
+
* Named for the PROP it types, not for a prop that does not exist. As `BadgeShape` it sat
|
|
150
|
+
* directly above `BadgeProps` in the generated `.d.ts` and read as the type of a `shape`
|
|
151
|
+
* prop, so an adopter wrote `<Badge shape="outline">` in four files before the compiler
|
|
152
|
+
* disagreed (2026-08-08 report A). A type named after a prop the component does not have is
|
|
153
|
+
* a trap of our own making.
|
|
154
|
+
*/
|
|
155
|
+
type BadgeVariant = 'secondary' | 'outline' | 'primary';
|
|
133
156
|
interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
134
157
|
/**
|
|
135
158
|
* Severity tone or badge-specific look. Accepts the catalog-wide `Tone` vocabulary
|
|
@@ -137,7 +160,7 @@ interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
137
160
|
* (`default`, `destructive`, `error`) — they are aliases of the same tones, so one domain
|
|
138
161
|
* enum can drive `Badge`, `Tag`, `Status` and `Notification` with no lookup table.
|
|
139
162
|
*/
|
|
140
|
-
variant?: ToneInput |
|
|
163
|
+
variant?: ToneInput | BadgeVariant;
|
|
141
164
|
size?: 'sm' | 'md';
|
|
142
165
|
}
|
|
143
166
|
declare function Badge({
|
|
@@ -1461,6 +1484,14 @@ interface Column<Row> {
|
|
|
1461
1484
|
* can exceed its container — the extra columns are reachable by horizontal scroll, not
|
|
1462
1485
|
* dropped. Leave at least one free-form column unsized unless you specifically want
|
|
1463
1486
|
* page-stable widths.
|
|
1487
|
+
*
|
|
1488
|
+
* ⚠ **"Leave one unsized" is necessary, not sufficient.** The leftover width is split
|
|
1489
|
+
* between the unsized columns by `table-layout: auto`, which weighs them by content — so
|
|
1490
|
+
* if the sized columns nearly fill the table, what remains can be narrower than the
|
|
1491
|
+
* content needs and long tokens wrap mid-word (`acme-` / `storefront`). Reported at
|
|
1492
|
+
* 6-of-8 columns sized. Rules of thumb: leave the widest free-form column unsized, keep
|
|
1493
|
+
* the sized columns to roughly two thirds of the table, and give the free-form one a
|
|
1494
|
+
* `minWidth` when the data has long unbreakable tokens like slugs or IDs.
|
|
1464
1495
|
*/
|
|
1465
1496
|
width?: string;
|
|
1466
1497
|
/**
|
|
@@ -1515,6 +1546,18 @@ interface DataTableProps<Row> {
|
|
|
1515
1546
|
onClick: (selectedIds: string[]) => void;
|
|
1516
1547
|
}[];
|
|
1517
1548
|
renderExpandedRow?: (row: Row) => ReactNode;
|
|
1549
|
+
/**
|
|
1550
|
+
* Row height preset.
|
|
1551
|
+
*
|
|
1552
|
+
* ⚠ It sets a row **height floor** (`--_row-height`), so it is invisible whenever the cell
|
|
1553
|
+
* content is already taller — a two-line cell or a cell containing a `Badge` stack looks
|
|
1554
|
+
* identical at every density. Reported as "barely distinguishable"; the prop is working,
|
|
1555
|
+
* the content is simply winning. Shrink the cell content, or set
|
|
1556
|
+
* `--cascivo-data-table-cell-gap` to tighten the horizontal rhythm too.
|
|
1557
|
+
*
|
|
1558
|
+
* @defaultValue `normal`
|
|
1559
|
+
* @see the component manifest
|
|
1560
|
+
*/
|
|
1518
1561
|
density?: 'compact' | 'normal' | 'relaxed';
|
|
1519
1562
|
/**
|
|
1520
1563
|
* When true, applies alternating row striping.
|
|
@@ -2650,6 +2693,16 @@ declare function HeaderPanel({
|
|
|
2650
2693
|
className
|
|
2651
2694
|
}: HeaderPanelProps): import("react").JSX.Element;
|
|
2652
2695
|
interface SwitcherLink {
|
|
2696
|
+
/**
|
|
2697
|
+
* Stable React key. Provide when `label`/`href` may repeat (e.g. placeholder `#` links).
|
|
2698
|
+
*
|
|
2699
|
+
* Without it the rows key on `href`, so three sibling teams that all link to `/` produce
|
|
2700
|
+
* duplicate-key warnings on every render and the adopter has to make the hrefs artificially
|
|
2701
|
+
* distinct (2026-08-08 report A). `SideNavItem`, `ShellHeaderNavLink`,
|
|
2702
|
+
* `ShellHeaderNavMenuItem`, `HeaderLink` and `CommandItem` all carry this field already;
|
|
2703
|
+
* `Switcher` was missed by that sweep.
|
|
2704
|
+
*/
|
|
2705
|
+
id?: string;
|
|
2653
2706
|
label: string;
|
|
2654
2707
|
href: string;
|
|
2655
2708
|
active?: boolean;
|
|
@@ -4645,6 +4698,20 @@ interface AppShellProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
4645
4698
|
defaultOpen?: boolean;
|
|
4646
4699
|
/** Fired when the nav requests open/close (burger, Escape, scrim). */
|
|
4647
4700
|
onOpenChange?: ((open: boolean) => void) | undefined;
|
|
4701
|
+
/**
|
|
4702
|
+
* Inset around the main content area, as a space-scale step.
|
|
4703
|
+
*
|
|
4704
|
+
* ⚠ It **defaults to `6`**, not to none. `<main>` shipped with `padding: 0` for three
|
|
4705
|
+
* releases, so every adopter wrote the same wrapper `<div style={{ padding: … }}>` and
|
|
4706
|
+
* every app's first screenshot had its buttons clipped against the viewport edge — the CLI's
|
|
4707
|
+
* own generated dashboard modelled the workaround with an inline style its sibling
|
|
4708
|
+
* AGENTS.md forbids. Reported three times (2026-07-24, 2026-08-06, 2026-08-08).
|
|
4709
|
+
*
|
|
4710
|
+
* Pass `'none'` for a full-bleed layout that owns its own insets (a map, a split pane).
|
|
4711
|
+
*
|
|
4712
|
+
* @defaultValue `6`
|
|
4713
|
+
*/
|
|
4714
|
+
padding?: SpaceStep | 'none';
|
|
4648
4715
|
className?: string | undefined;
|
|
4649
4716
|
}
|
|
4650
4717
|
/**
|
|
@@ -4673,6 +4740,7 @@ declare function AppShell({
|
|
|
4673
4740
|
open,
|
|
4674
4741
|
defaultOpen,
|
|
4675
4742
|
onOpenChange,
|
|
4743
|
+
padding,
|
|
4676
4744
|
className,
|
|
4677
4745
|
...props
|
|
4678
4746
|
}: AppShellProps): import("react").JSX.Element;
|
|
@@ -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 };
|
|
@@ -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 };
|
|
@@ -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
|