@cascivo/react 0.8.0 → 0.10.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 +24 -11
- package/dist/combobox/combobox.js +73 -73
- package/dist/command-menu/command-menu.js +2 -2
- package/dist/date-picker/date-picker.js +95 -95
- package/dist/field/field.js +24 -15
- package/dist/filter/filter.js +12 -12
- package/dist/index.d.ts +74 -8
- package/dist/index.js +2 -0
- package/dist/node/accordion/accordion.js +95 -0
- package/dist/node/accordion/accordion.module.js +13 -0
- package/dist/node/action-sheet/action-sheet.js +91 -0
- package/dist/node/action-sheet/action-sheet.module.js +14 -0
- package/dist/node/alert/alert.js +55 -0
- package/dist/node/alert/alert.module.js +13 -0
- package/dist/node/alert-dialog/alert-dialog.js +68 -0
- package/dist/node/alert-dialog/alert-dialog.module.js +13 -0
- package/dist/node/app-shell/app-shell.js +80 -0
- package/dist/node/app-shell/app-shell.module.js +14 -0
- package/dist/node/aspect-ratio/aspect-ratio.js +22 -0
- package/dist/node/aspect-ratio/aspect-ratio.module.js +8 -0
- package/dist/node/avatar/avatar.js +57 -0
- package/dist/node/avatar/avatar.module.js +10 -0
- package/dist/node/avatar-group/avatar-group.js +26 -0
- package/dist/node/avatar-group/avatar-group.module.js +8 -0
- package/dist/node/badge/badge.js +17 -0
- package/dist/node/badge/badge.module.js +5 -0
- package/dist/node/blockquote/blockquote.js +18 -0
- package/dist/node/blockquote/blockquote.module.js +8 -0
- package/dist/node/bottom-sheet/bottom-sheet.js +111 -0
- package/dist/node/bottom-sheet/bottom-sheet.module.js +16 -0
- package/dist/node/breadcrumb/breadcrumb.js +28 -0
- package/dist/node/breadcrumb/breadcrumb.module.js +5 -0
- package/dist/node/button/button.js +31 -0
- package/dist/node/button/button.module.js +5 -0
- package/dist/node/button-group/button-group.js +39 -0
- package/dist/node/button-group/button-group.module.js +5 -0
- package/dist/node/calendar/calendar.js +195 -0
- package/dist/node/calendar/calendar.module.js +16 -0
- package/dist/node/card/card.js +45 -0
- package/dist/node/card/card.module.js +11 -0
- package/dist/node/carousel/carousel.js +138 -0
- package/dist/node/carousel/carousel.module.js +15 -0
- package/dist/node/chat-bubble/chat-bubble.js +33 -0
- package/dist/node/chat-bubble/chat-bubble.module.js +13 -0
- package/dist/node/checkbox/checkbox.js +38 -0
- package/dist/node/checkbox/checkbox.module.js +10 -0
- package/dist/node/checkbox-card/checkbox-card.js +48 -0
- package/dist/node/checkbox-card/checkbox-card.module.js +13 -0
- package/dist/node/code/code.js +16 -0
- package/dist/node/code/code.module.js +5 -0
- package/dist/node/code-snippet/code-snippet.js +116 -0
- package/dist/node/code-snippet/code-snippet.module.js +19 -0
- package/dist/node/code-snippet/highlight.js +69 -0
- package/dist/node/collapsible/collapsible.js +42 -0
- package/dist/node/collapsible/collapsible.module.js +10 -0
- package/dist/node/color-picker/color-picker.js +268 -0
- package/dist/node/color-picker/color-picker.module.js +20 -0
- package/dist/node/combobox/combobox.js +164 -0
- package/dist/node/combobox/combobox.module.js +21 -0
- package/dist/node/command-menu/command-menu.js +425 -0
- package/dist/node/command-menu/command-menu.module.js +36 -0
- package/dist/node/comparison/comparison.js +69 -0
- package/dist/node/comparison/comparison.module.js +11 -0
- package/dist/node/contained-list/contained-list.js +41 -0
- package/dist/node/contained-list/contained-list.module.js +13 -0
- package/dist/node/context-menu/context-menu.js +89 -0
- package/dist/node/context-menu/context-menu.module.js +9 -0
- package/dist/node/copy-button/copy-button.js +58 -0
- package/dist/node/copy-button/copy-button.module.js +8 -0
- package/dist/node/data-list/data-list.js +27 -0
- package/dist/node/data-list/data-list.module.js +10 -0
- package/dist/node/data-table/data-table.js +370 -0
- package/dist/node/data-table/data-table.module.js +35 -0
- package/dist/node/date-picker/date-picker.js +218 -0
- package/dist/node/date-picker/date-picker.module.js +25 -0
- package/dist/node/date-range-picker/date-range-picker.js +196 -0
- package/dist/node/date-range-picker/date-range-picker.module.js +20 -0
- package/dist/node/dock/dock.js +34 -0
- package/dist/node/dock/dock.module.js +10 -0
- package/dist/node/drawer/drawer.js +95 -0
- package/dist/node/drawer/drawer.module.js +15 -0
- package/dist/node/dropdown/dropdown.js +109 -0
- package/dist/node/dropdown/dropdown.module.js +11 -0
- package/dist/node/editable/editable.js +67 -0
- package/dist/node/editable/editable.module.js +13 -0
- package/dist/node/empty-state/empty-state.js +34 -0
- package/dist/node/empty-state/empty-state.module.js +11 -0
- package/dist/node/fab/fab.js +93 -0
- package/dist/node/fab/fab.module.js +14 -0
- package/dist/node/field/field.js +48 -0
- package/dist/node/field/field.module.js +9 -0
- package/dist/node/file-uploader/file-uploader.js +122 -0
- package/dist/node/file-uploader/file-uploader.module.js +20 -0
- package/dist/node/filter/filter.js +34 -0
- package/dist/node/filter/filter.module.js +8 -0
- package/dist/node/form/form.js +95 -0
- package/dist/node/form/form.module.js +5 -0
- package/dist/node/header/header.js +44 -0
- package/dist/node/header/header.module.js +13 -0
- package/dist/node/header-panel/header-panel.js +74 -0
- package/dist/node/header-panel/header-panel.module.js +11 -0
- package/dist/node/heading/heading.js +24 -0
- package/dist/node/heading/heading.module.js +5 -0
- package/dist/node/hover-card/hover-card.js +84 -0
- package/dist/node/hover-card/hover-card.module.js +8 -0
- package/dist/node/icon-button/icon-button.js +21 -0
- package/dist/node/icon-button/icon-button.module.js +5 -0
- package/dist/node/image/image.js +64 -0
- package/dist/node/image/image.module.js +11 -0
- package/dist/node/index.js +2 -0
- package/dist/node/indicator/indicator.js +18 -0
- package/dist/node/indicator/indicator.module.js +8 -0
- package/dist/node/inline-loading/inline-loading.js +76 -0
- package/dist/node/inline-loading/inline-loading.module.js +11 -0
- package/dist/node/input/input.js +54 -0
- package/dist/node/input/input.module.js +11 -0
- package/dist/node/input-group/input-group.js +41 -0
- package/dist/node/input-group/input-group.module.js +11 -0
- package/dist/node/item/item.js +52 -0
- package/dist/node/item/item.module.js +12 -0
- package/dist/node/join/join.js +14 -0
- package/dist/node/join/join.module.js +5 -0
- package/dist/node/kbd/kbd.js +16 -0
- package/dist/node/kbd/kbd.module.js +5 -0
- package/dist/node/label/label.js +25 -0
- package/dist/node/label/label.module.js +9 -0
- package/dist/node/layouts/src/auto-grid/auto-grid.js +19 -0
- package/dist/node/layouts/src/auto-grid/auto-grid.module.js +6 -0
- package/dist/node/layouts/src/center/center.js +18 -0
- package/dist/node/layouts/src/center/center.module.js +5 -0
- package/dist/node/layouts/src/columns/columns.js +23 -0
- package/dist/node/layouts/src/columns/columns.module.js +8 -0
- package/dist/node/layouts/src/flex/flex.js +22 -0
- package/dist/node/layouts/src/flex/flex.module.js +5 -0
- package/dist/node/layouts/src/grid/grid.js +57 -0
- package/dist/node/layouts/src/grid/grid.module.js +9 -0
- package/dist/node/layouts/src/spacer/spacer.js +19 -0
- package/dist/node/layouts/src/spacer/spacer.module.js +5 -0
- package/dist/node/link/link.js +22 -0
- package/dist/node/link/link.module.js +5 -0
- package/dist/node/list/list.js +23 -0
- package/dist/node/list/list.module.js +8 -0
- package/dist/node/log-viewer/log-viewer.js +184 -0
- package/dist/node/log-viewer/log-viewer.module.js +18 -0
- package/dist/node/menu/menu.js +121 -0
- package/dist/node/menu/menu.module.js +10 -0
- package/dist/node/menu-button/menu-button.js +92 -0
- package/dist/node/menu-button/menu-button.module.js +10 -0
- package/dist/node/menubar/menubar.js +103 -0
- package/dist/node/menubar/menubar.module.js +10 -0
- package/dist/node/modal/modal.js +70 -0
- package/dist/node/modal/modal.module.js +13 -0
- package/dist/node/multi-select/multi-select.js +106 -0
- package/dist/node/multi-select/multi-select.module.js +17 -0
- package/dist/node/native-select/native-select.js +37 -0
- package/dist/node/native-select/native-select.module.js +9 -0
- package/dist/node/navigation-menu/navigation-menu.js +99 -0
- package/dist/node/navigation-menu/navigation-menu.module.js +12 -0
- package/dist/node/notification/notification.js +134 -0
- package/dist/node/notification/notification.module.js +13 -0
- package/dist/node/number-input/number-input.js +145 -0
- package/dist/node/number-input/number-input.module.js +14 -0
- package/dist/node/otp-input/otp-input.js +70 -0
- package/dist/node/otp-input/otp-input.module.js +8 -0
- package/dist/node/overflow-menu/overflow-menu.js +65 -0
- package/dist/node/overflow-menu/overflow-menu.module.js +9 -0
- package/dist/node/pagination/pagination.js +92 -0
- package/dist/node/pagination/pagination.module.js +13 -0
- package/dist/node/password-input/password-input.js +80 -0
- package/dist/node/password-input/password-input.module.js +13 -0
- package/dist/node/popover/popover.js +49 -0
- package/dist/node/popover/popover.module.js +8 -0
- package/dist/node/popover/use-popover.js +57 -0
- package/dist/node/progress/progress.js +17 -0
- package/dist/node/progress/progress.module.js +8 -0
- package/dist/node/progress-bar/progress-bar.js +44 -0
- package/dist/node/progress-bar/progress-bar.module.js +13 -0
- package/dist/node/progress-circle/progress-circle.js +48 -0
- package/dist/node/progress-circle/progress-circle.module.js +11 -0
- package/dist/node/progress-indicator/progress-indicator.js +36 -0
- package/dist/node/progress-indicator/progress-indicator.module.js +12 -0
- package/dist/node/prose/prose.js +15 -0
- package/dist/node/prose/prose.module.js +5 -0
- package/dist/node/pull-to-refresh/pull-to-refresh.js +82 -0
- package/dist/node/pull-to-refresh/pull-to-refresh.module.js +11 -0
- package/dist/node/qr-code/encode.js +585 -0
- package/dist/node/qr-code/qr-code.js +41 -0
- package/dist/node/qr-code/qr-code.module.js +8 -0
- package/dist/node/radial-progress/radial-progress.js +28 -0
- package/dist/node/radial-progress/radial-progress.module.js +8 -0
- package/dist/node/radio/radio.js +49 -0
- package/dist/node/radio/radio.module.js +11 -0
- package/dist/node/radio-card/radio-card.js +63 -0
- package/dist/node/radio-card/radio-card.module.js +13 -0
- package/dist/node/rating-group/rating-group.js +37 -0
- package/dist/node/rating-group/rating-group.module.js +8 -0
- package/dist/node/react/src/index.js +138 -0
- package/dist/node/react/src/theme.js +54 -0
- package/dist/node/relative-time/relative-time.js +66 -0
- package/dist/node/relative-time/relative-time.module.js +5 -0
- package/dist/node/resizable/resizable.js +80 -0
- package/dist/node/resizable/resizable.module.js +10 -0
- package/dist/node/scroll-area/scroll-area.js +38 -0
- package/dist/node/scroll-area/scroll-area.module.js +5 -0
- package/dist/node/search/search.js +94 -0
- package/dist/node/search/search.module.js +11 -0
- package/dist/node/segmented-control/segmented-control.js +43 -0
- package/dist/node/segmented-control/segmented-control.module.js +8 -0
- package/dist/node/select/select.js +71 -0
- package/dist/node/select/select.module.js +13 -0
- package/dist/node/separator/separator.js +21 -0
- package/dist/node/separator/separator.module.js +5 -0
- package/dist/node/sheet/sheet.js +50 -0
- package/dist/node/sheet/sheet.module.js +11 -0
- package/dist/node/shell-header/shell-header.js +166 -0
- package/dist/node/shell-header/shell-header.module.js +25 -0
- package/dist/node/side-nav/side-nav.js +333 -0
- package/dist/node/side-nav/side-nav.module.js +33 -0
- package/dist/node/skeleton/skeleton.js +25 -0
- package/dist/node/skeleton/skeleton.module.js +9 -0
- package/dist/node/skip-nav/skip-nav.js +27 -0
- package/dist/node/skip-nav/skip-nav.module.js +5 -0
- package/dist/node/slider/slider.js +29 -0
- package/dist/node/slider/slider.module.js +9 -0
- package/dist/node/spinner/spinner.js +18 -0
- package/dist/node/spinner/spinner.module.js +8 -0
- package/dist/node/stack/stack.js +19 -0
- package/dist/node/stack/stack.module.js +8 -0
- package/dist/node/stat/stat.js +41 -0
- package/dist/node/stat/stat.module.js +13 -0
- package/dist/node/status/status.js +20 -0
- package/dist/node/status/status.module.js +9 -0
- package/dist/node/steps/steps.js +35 -0
- package/dist/node/steps/steps.module.js +10 -0
- package/dist/node/storage/src/drivers.js +36 -0
- package/dist/node/storage/src/persisted-signal.js +43 -0
- package/dist/node/structured-list/structured-list.js +101 -0
- package/dist/node/structured-list/structured-list.module.js +14 -0
- package/dist/node/swap/swap.js +36 -0
- package/dist/node/swap/swap.module.js +9 -0
- package/dist/node/swipe-item/swipe-item.js +62 -0
- package/dist/node/swipe-item/swipe-item.module.js +14 -0
- package/dist/node/switcher/switcher.js +32 -0
- package/dist/node/switcher/switcher.module.js +10 -0
- package/dist/node/tabs/tabs.js +95 -0
- package/dist/node/tabs/tabs.module.js +10 -0
- package/dist/node/tag/tag.js +26 -0
- package/dist/node/tag/tag.module.js +8 -0
- package/dist/node/tags-input/tags-input.js +64 -0
- package/dist/node/tags-input/tags-input.module.js +10 -0
- package/dist/node/text/text.js +18 -0
- package/dist/node/text/text.module.js +5 -0
- package/dist/node/textarea/textarea.js +56 -0
- package/dist/node/textarea/textarea.module.js +11 -0
- package/dist/node/tile/tile.js +39 -0
- package/dist/node/tile/tile.module.js +9 -0
- package/dist/node/time-picker/time-picker.js +62 -0
- package/dist/node/time-picker/time-picker.module.js +11 -0
- package/dist/node/timeline/timeline.js +41 -0
- package/dist/node/timeline/timeline.module.js +13 -0
- package/dist/node/toast/toast.js +85 -0
- package/dist/node/toast/toast.module.js +13 -0
- package/dist/node/toc/toc.js +42 -0
- package/dist/node/toc/toc.module.js +5 -0
- package/dist/node/toc/use-toc-from-region.js +18 -0
- package/dist/node/toggle/toggle.js +39 -0
- package/dist/node/toggle/toggle.module.js +10 -0
- package/dist/node/toggle-group/toggle-group.js +55 -0
- package/dist/node/toggle-group/toggle-group.module.js +8 -0
- package/dist/node/toggletip/toggletip.js +49 -0
- package/dist/node/toggletip/toggletip.module.js +9 -0
- package/dist/node/tooltip/tooltip.js +58 -0
- package/dist/node/tooltip/tooltip.module.js +8 -0
- package/dist/node/tree-view/tree-view.js +201 -0
- package/dist/node/tree-view/tree-view.module.js +15 -0
- package/dist/node/user/user.js +37 -0
- package/dist/node/user/user.module.js +11 -0
- package/dist/node/visually-hidden/visually-hidden.js +15 -0
- package/dist/node/visually-hidden/visually-hidden.module.js +5 -0
- package/dist/number-input/number-input.js +41 -41
- package/dist/react/src/theme.js +42 -31
- package/dist/search/search.js +35 -35
- package/dist/swap/swap.js +12 -12
- package/dist/time-picker/time-picker.js +24 -24
- package/dist/toggle/toggle.js +12 -12
- package/package.json +7 -6
- package/readme.body.md +24 -11
package/dist/field/field.js
CHANGED
|
@@ -6,34 +6,43 @@ import { cn as n, useId as r } from "@cascivo/core";
|
|
|
6
6
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
7
7
|
import { Children as o, cloneElement as s, isValidElement as c } from "react";
|
|
8
8
|
//#region ../components/src/field/field.tsx
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
var l = /* @__PURE__ */ new Set();
|
|
10
|
+
function u() {
|
|
11
|
+
return globalThis.process?.env?.NODE_ENV !== "production";
|
|
12
|
+
}
|
|
13
|
+
function d(e, t) {
|
|
14
|
+
if (!u() || e == null || t.props.label == null) return;
|
|
15
|
+
let n = String(e);
|
|
16
|
+
l.has(n) || (l.add(n), console.warn(`cascivo Field: both the Field and its child control define a \`label\` (${n}). Omit the child's \`label\` inside a Field — it renders a second <label> for the same control. The Field owns the label.`));
|
|
17
|
+
}
|
|
18
|
+
function f({ label: l, description: u, error: f, required: p = !1, disabled: m = !1, id: h, children: g, className: _ }) {
|
|
19
|
+
let v = r("cascade-field"), y = h ?? v, b = `${y}-description`, x = `${y}-error`, S = [u ? b : null, f ? x : null].filter(Boolean).join(" ") || void 0, C = { id: y };
|
|
20
|
+
S && (C["aria-describedby"] = S), f && (C["aria-invalid"] = !0), (m || g.props.disabled) && (C.disabled = !0), c(g) && d(l, g);
|
|
21
|
+
let w = c(g) ? s(o.only(g), C) : g;
|
|
13
22
|
return /* @__PURE__ */ a("div", {
|
|
14
|
-
className: n(t.field,
|
|
15
|
-
"data-disabled":
|
|
23
|
+
className: n(t.field, _),
|
|
24
|
+
"data-disabled": m ? "" : void 0,
|
|
16
25
|
children: [
|
|
17
26
|
l && /* @__PURE__ */ i(e, {
|
|
18
|
-
htmlFor:
|
|
19
|
-
required:
|
|
20
|
-
disabled:
|
|
27
|
+
htmlFor: y,
|
|
28
|
+
required: p,
|
|
29
|
+
disabled: m,
|
|
21
30
|
children: l
|
|
22
31
|
}),
|
|
23
|
-
|
|
32
|
+
w,
|
|
24
33
|
u && /* @__PURE__ */ i("p", {
|
|
25
|
-
id:
|
|
34
|
+
id: b,
|
|
26
35
|
className: t.description,
|
|
27
36
|
children: u
|
|
28
37
|
}),
|
|
29
|
-
|
|
30
|
-
id:
|
|
38
|
+
f && /* @__PURE__ */ i("p", {
|
|
39
|
+
id: x,
|
|
31
40
|
role: "alert",
|
|
32
41
|
className: t.error,
|
|
33
|
-
children:
|
|
42
|
+
children: f
|
|
34
43
|
})
|
|
35
44
|
]
|
|
36
45
|
});
|
|
37
46
|
}
|
|
38
47
|
//#endregion
|
|
39
|
-
export {
|
|
48
|
+
export { f as Field };
|
package/dist/filter/filter.js
CHANGED
|
@@ -4,28 +4,28 @@ import e from "./filter.module.js";
|
|
|
4
4
|
import { useControllableSignal as t, useSignals as n } from "@cascivo/core";
|
|
5
5
|
import { jsx as r } from "react/jsx-runtime";
|
|
6
6
|
//#region ../components/src/filter/filter.tsx
|
|
7
|
-
function i({ options: i, value: a, defaultValue: o = [],
|
|
7
|
+
function i({ options: i, value: a, defaultValue: o = [], onValueChange: s, onChange: c, multi: l = !1, variant: u = "pill", className: d, ...f }) {
|
|
8
8
|
n();
|
|
9
|
-
let [
|
|
9
|
+
let [p, m] = t({
|
|
10
10
|
value: a,
|
|
11
11
|
defaultValue: o,
|
|
12
|
-
onChange: s
|
|
12
|
+
onChange: s ?? c
|
|
13
13
|
});
|
|
14
|
-
function
|
|
15
|
-
let t =
|
|
16
|
-
n =
|
|
14
|
+
function h(e) {
|
|
15
|
+
let t = p.value, n;
|
|
16
|
+
n = l ? t.includes(e) ? t.filter((t) => t !== e) : [...t, e] : t.includes(e) ? [] : [e], m(n);
|
|
17
17
|
}
|
|
18
18
|
return /* @__PURE__ */ r("div", {
|
|
19
19
|
role: "group",
|
|
20
|
-
className: [e.filter,
|
|
21
|
-
"data-variant":
|
|
22
|
-
...
|
|
20
|
+
className: [e.filter, d].filter(Boolean).join(" "),
|
|
21
|
+
"data-variant": u,
|
|
22
|
+
...f,
|
|
23
23
|
children: i.map((t) => /* @__PURE__ */ r("button", {
|
|
24
24
|
type: "button",
|
|
25
25
|
className: e.item,
|
|
26
|
-
"data-selected":
|
|
27
|
-
onClick: () =>
|
|
28
|
-
"aria-pressed":
|
|
26
|
+
"data-selected": p.value.includes(t.value) || void 0,
|
|
27
|
+
onClick: () => h(t.value),
|
|
28
|
+
"aria-pressed": p.value.includes(t.value),
|
|
29
29
|
children: t.label
|
|
30
30
|
}, t.value))
|
|
31
31
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ErrorBoundary, FocusScope, LinkComponent, Portal, RovingOrientation, Signal, SuspenseBoundary, getLinkComponent, setLinkComponent } from "@cascivo/core";
|
|
1
|
+
import { ErrorBoundary, FocusScope, LinkComponent, LinkComponentProps, Portal, RovingOrientation, Signal, SuspenseBoundary, getLinkComponent, setLinkComponent } from "@cascivo/core";
|
|
2
2
|
import { AnchorHTMLAttributes, ButtonHTMLAttributes, FormHTMLAttributes, HTMLAttributes, ImgHTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes, LiHTMLAttributes, MouseEvent, ReactElement, ReactNode, RefObject, SelectHTMLAttributes, TextareaHTMLAttributes, TimeHTMLAttributes } from "react";
|
|
3
3
|
|
|
4
4
|
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
@@ -335,6 +335,9 @@ declare function RadioGroup({
|
|
|
335
335
|
interface ToggleProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> {
|
|
336
336
|
checked?: boolean;
|
|
337
337
|
defaultChecked?: boolean;
|
|
338
|
+
/** Called with the new checked state when the switch is toggled. */
|
|
339
|
+
onValueChange?: (checked: boolean) => void;
|
|
340
|
+
/** @deprecated Use `onValueChange` — it receives the same `checked` boolean. */
|
|
338
341
|
onChange?: (checked: boolean) => void;
|
|
339
342
|
/**
|
|
340
343
|
* Renders a **visible** text label beside the switch that also becomes its
|
|
@@ -348,6 +351,7 @@ interface ToggleProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onC
|
|
|
348
351
|
declare function Toggle({
|
|
349
352
|
checked,
|
|
350
353
|
defaultChecked,
|
|
354
|
+
onValueChange,
|
|
351
355
|
onChange,
|
|
352
356
|
label,
|
|
353
357
|
size,
|
|
@@ -652,7 +656,13 @@ interface SideNavLinkProps {
|
|
|
652
656
|
'data-state'?: 'active' | undefined;
|
|
653
657
|
'data-tone'?: Exclude<SideNavTone, 'default'> | undefined;
|
|
654
658
|
tabIndex?: number | undefined;
|
|
655
|
-
|
|
659
|
+
/**
|
|
660
|
+
* Always provided by cascivo when it builds the bag; only calls
|
|
661
|
+
* `preventDefault()` for a disabled item, otherwise inert. Optional on the type
|
|
662
|
+
* so it composes cleanly — spread it onto a router `<Link>`, which layers its own
|
|
663
|
+
* click handling on top.
|
|
664
|
+
*/
|
|
665
|
+
onClick?: (e: MouseEvent<HTMLAnchorElement>) => void;
|
|
656
666
|
}
|
|
657
667
|
/** A selectable/navigable sub-item (link when `href` is set, action when `onSelect` is set). */
|
|
658
668
|
interface SideNavLinkSubItem {
|
|
@@ -924,6 +934,9 @@ declare function OverflowMenu({
|
|
|
924
934
|
interface SearchProps {
|
|
925
935
|
value?: string;
|
|
926
936
|
defaultValue?: string;
|
|
937
|
+
/** Called with the current text on every keystroke. */
|
|
938
|
+
onValueChange?: (value: string) => void;
|
|
939
|
+
/** @deprecated Use `onValueChange` — it receives the same string. */
|
|
927
940
|
onChange?: (value: string) => void;
|
|
928
941
|
onSearch?: (value: string) => void;
|
|
929
942
|
debounceMs?: number;
|
|
@@ -938,6 +951,7 @@ interface SearchProps {
|
|
|
938
951
|
declare function Search({
|
|
939
952
|
value,
|
|
940
953
|
defaultValue,
|
|
954
|
+
onValueChange,
|
|
941
955
|
onChange,
|
|
942
956
|
onSearch,
|
|
943
957
|
debounceMs,
|
|
@@ -952,6 +966,9 @@ declare function Search({
|
|
|
952
966
|
interface NumberInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type' | 'value' | 'defaultValue' | 'onChange' | 'min' | 'max' | 'step'> {
|
|
953
967
|
value?: number | null;
|
|
954
968
|
defaultValue?: number;
|
|
969
|
+
/** Called with the new numeric value (or null when cleared). */
|
|
970
|
+
onValueChange?: (value: number | null) => void;
|
|
971
|
+
/** @deprecated Use `onValueChange` — it receives the same `number | null`. */
|
|
955
972
|
onChange?: (value: number | null) => void;
|
|
956
973
|
min?: number;
|
|
957
974
|
max?: number;
|
|
@@ -968,6 +985,7 @@ interface NumberInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, '
|
|
|
968
985
|
declare function NumberInput({
|
|
969
986
|
value,
|
|
970
987
|
defaultValue,
|
|
988
|
+
onValueChange,
|
|
971
989
|
onChange,
|
|
972
990
|
min,
|
|
973
991
|
max,
|
|
@@ -1251,6 +1269,9 @@ interface ComboboxProps {
|
|
|
1251
1269
|
options: ComboboxOption[];
|
|
1252
1270
|
value?: string;
|
|
1253
1271
|
defaultValue?: string;
|
|
1272
|
+
/** Called with the selected option value (or undefined when cleared). */
|
|
1273
|
+
onValueChange?: (value: string | undefined) => void;
|
|
1274
|
+
/** @deprecated Use `onValueChange` — it receives the same `string | undefined`. */
|
|
1254
1275
|
onChange?: (value: string | undefined) => void;
|
|
1255
1276
|
clearable?: boolean;
|
|
1256
1277
|
searchable?: boolean;
|
|
@@ -1267,6 +1288,7 @@ declare function Combobox({
|
|
|
1267
1288
|
options,
|
|
1268
1289
|
value,
|
|
1269
1290
|
defaultValue,
|
|
1291
|
+
onValueChange,
|
|
1270
1292
|
onChange,
|
|
1271
1293
|
clearable,
|
|
1272
1294
|
searchable,
|
|
@@ -1288,6 +1310,9 @@ interface DatePickerLabels {
|
|
|
1288
1310
|
interface DatePickerProps {
|
|
1289
1311
|
value?: string;
|
|
1290
1312
|
defaultValue?: string;
|
|
1313
|
+
/** Called with the selected ISO date string (or undefined when cleared). */
|
|
1314
|
+
onValueChange?: (value: string | undefined) => void;
|
|
1315
|
+
/** @deprecated Use `onValueChange` — it receives the same ISO `string | undefined`. */
|
|
1291
1316
|
onChange?: (value: string | undefined) => void;
|
|
1292
1317
|
min?: string;
|
|
1293
1318
|
max?: string;
|
|
@@ -1304,6 +1329,7 @@ interface DatePickerProps {
|
|
|
1304
1329
|
declare function DatePicker({
|
|
1305
1330
|
value,
|
|
1306
1331
|
defaultValue,
|
|
1332
|
+
onValueChange,
|
|
1307
1333
|
onChange,
|
|
1308
1334
|
min,
|
|
1309
1335
|
max,
|
|
@@ -1363,6 +1389,9 @@ declare function FileUploader({
|
|
|
1363
1389
|
interface TimePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type' | 'value' | 'defaultValue' | 'onChange' | 'min' | 'max' | 'step'> {
|
|
1364
1390
|
value?: string;
|
|
1365
1391
|
defaultValue?: string;
|
|
1392
|
+
/** Called with the new `HH:MM` time string when the value changes. */
|
|
1393
|
+
onValueChange?: (value: string) => void;
|
|
1394
|
+
/** @deprecated Use `onValueChange` — it receives the same time string. */
|
|
1366
1395
|
onChange?: (value: string) => void;
|
|
1367
1396
|
min?: string;
|
|
1368
1397
|
max?: string;
|
|
@@ -1375,6 +1404,7 @@ interface TimePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 's
|
|
|
1375
1404
|
declare function TimePicker({
|
|
1376
1405
|
value,
|
|
1377
1406
|
defaultValue,
|
|
1407
|
+
onValueChange,
|
|
1378
1408
|
onChange,
|
|
1379
1409
|
min,
|
|
1380
1410
|
max,
|
|
@@ -2315,6 +2345,9 @@ interface FilterProps {
|
|
|
2315
2345
|
options: FilterOption[];
|
|
2316
2346
|
value?: string[];
|
|
2317
2347
|
defaultValue?: string[];
|
|
2348
|
+
/** Called with the selected values whenever the selection changes. */
|
|
2349
|
+
onValueChange?: (selected: string[]) => void;
|
|
2350
|
+
/** @deprecated Use `onValueChange` — it receives the same `string[]`. */
|
|
2318
2351
|
onChange?: (selected: string[]) => void;
|
|
2319
2352
|
multi?: boolean;
|
|
2320
2353
|
variant?: FilterVariant;
|
|
@@ -2325,6 +2358,7 @@ declare function Filter({
|
|
|
2325
2358
|
options,
|
|
2326
2359
|
value,
|
|
2327
2360
|
defaultValue,
|
|
2361
|
+
onValueChange,
|
|
2328
2362
|
onChange,
|
|
2329
2363
|
multi,
|
|
2330
2364
|
variant,
|
|
@@ -3201,6 +3235,9 @@ interface SwapProps {
|
|
|
3201
3235
|
on: React.ReactNode;
|
|
3202
3236
|
off: React.ReactNode;
|
|
3203
3237
|
checked?: boolean;
|
|
3238
|
+
/** Called with the new checked state when the swap is toggled. */
|
|
3239
|
+
onValueChange?: (checked: boolean) => void;
|
|
3240
|
+
/** @deprecated Use `onValueChange` — it receives the same `checked` boolean. */
|
|
3204
3241
|
onChange?: (checked: boolean) => void;
|
|
3205
3242
|
mode?: SwapMode;
|
|
3206
3243
|
'aria-label'?: string;
|
|
@@ -3210,6 +3247,7 @@ declare function Swap({
|
|
|
3210
3247
|
on,
|
|
3211
3248
|
off,
|
|
3212
3249
|
checked,
|
|
3250
|
+
onValueChange,
|
|
3213
3251
|
onChange,
|
|
3214
3252
|
mode,
|
|
3215
3253
|
className,
|
|
@@ -3365,8 +3403,11 @@ declare function setTheme(next: string): void;
|
|
|
3365
3403
|
declare function useTheme(): readonly [Signal<string>, (next: string) => void];
|
|
3366
3404
|
interface ThemeProviderProps {
|
|
3367
3405
|
/**
|
|
3368
|
-
* Theme to use when nothing is persisted yet.
|
|
3369
|
-
* `prefers-color-scheme`
|
|
3406
|
+
* Theme to use when nothing is persisted yet. When set, it **wins over** the
|
|
3407
|
+
* visitor's OS `prefers-color-scheme` — pass it for a "dark by default" or
|
|
3408
|
+
* custom-theme (`'midnight'`, …) app. Omit it to follow the OS (light/dark),
|
|
3409
|
+
* falling back to `'light'`. Precedence: persisted value > `defaultTheme` (if
|
|
3410
|
+
* set) > OS preference > `'light'`.
|
|
3370
3411
|
*/
|
|
3371
3412
|
defaultTheme?: string;
|
|
3372
3413
|
/**
|
|
@@ -3386,6 +3427,12 @@ interface ThemeProviderProps {
|
|
|
3386
3427
|
target?: RefObject<HTMLElement | null>;
|
|
3387
3428
|
/** Called whenever the active theme changes. */
|
|
3388
3429
|
onChange?: (theme: string) => void;
|
|
3430
|
+
/**
|
|
3431
|
+
* CSP nonce forwarded to the inline attribute-setter script emitted for the
|
|
3432
|
+
* controlled ({@link ThemeProviderProps.value}) SSR flow. Set it to match your
|
|
3433
|
+
* Content-Security-Policy `script-src 'nonce-…'`.
|
|
3434
|
+
*/
|
|
3435
|
+
nonce?: string;
|
|
3389
3436
|
children?: ReactNode;
|
|
3390
3437
|
}
|
|
3391
3438
|
/**
|
|
@@ -3397,6 +3444,12 @@ interface ThemeProviderProps {
|
|
|
3397
3444
|
* - No banned React hooks: the DOM write happens in `useSignalEffect`, not
|
|
3398
3445
|
* `useEffect`; there is no `useState`/`useContext`.
|
|
3399
3446
|
* - Uncontrolled by default (persists to localStorage); pass `value` to control.
|
|
3447
|
+
* - SSR-safe when controlled: with a `value` (and no scoped `target`), the
|
|
3448
|
+
* provider renders a tiny inline script that sets `data-theme` during HTML
|
|
3449
|
+
* parsing, so the server-rendered first paint is themed — no flash, no
|
|
3450
|
+
* hydration mismatch (the same markup renders on both sides; the client effect
|
|
3451
|
+
* owns every update after hydration). For the uncontrolled/persisted flow, pair
|
|
3452
|
+
* with {@link themePreloadScript} in `<head>` instead.
|
|
3400
3453
|
*/
|
|
3401
3454
|
declare function ThemeProvider({
|
|
3402
3455
|
defaultTheme,
|
|
@@ -3405,6 +3458,7 @@ declare function ThemeProvider({
|
|
|
3405
3458
|
attribute,
|
|
3406
3459
|
target,
|
|
3407
3460
|
onChange,
|
|
3461
|
+
nonce,
|
|
3408
3462
|
children
|
|
3409
3463
|
}: ThemeProviderProps): ReactNode;
|
|
3410
3464
|
/**
|
|
@@ -3413,11 +3467,23 @@ declare function ThemeProvider({
|
|
|
3413
3467
|
* SSR or a hard reload. Pass the same `storageKey`/`attribute`/`defaultTheme`
|
|
3414
3468
|
* you give {@link ThemeProvider}.
|
|
3415
3469
|
*
|
|
3470
|
+
* Precedence matches {@link ThemeProvider}: persisted value > `defaultTheme`
|
|
3471
|
+
* (if set) > OS `prefers-color-scheme` > `'light'`. Passing `defaultTheme`
|
|
3472
|
+
* suppresses the OS check, so a "dark by default" app stays dark on a light-OS
|
|
3473
|
+
* visitor.
|
|
3474
|
+
*
|
|
3475
|
+
* The script sets `data-theme` **before** React hydrates, so add
|
|
3476
|
+
* `suppressHydrationWarning` to the element that carries the attribute (usually
|
|
3477
|
+
* `<html>`) — the mutation is intentional, and without the flag React 19 logs a
|
|
3478
|
+
* hydration mismatch.
|
|
3479
|
+
*
|
|
3416
3480
|
* ```tsx
|
|
3417
3481
|
* // Next.js app/layout.tsx
|
|
3418
|
-
* <
|
|
3419
|
-
* <
|
|
3420
|
-
*
|
|
3482
|
+
* <html suppressHydrationWarning>
|
|
3483
|
+
* <head>
|
|
3484
|
+
* <script dangerouslySetInnerHTML={{ __html: themePreloadScript({ defaultTheme: 'dark' }) }} />
|
|
3485
|
+
* </head>
|
|
3486
|
+
* </html>
|
|
3421
3487
|
* ```
|
|
3422
3488
|
*/
|
|
3423
3489
|
declare function themePreloadScript(options?: {
|
|
@@ -3425,4 +3491,4 @@ declare function themePreloadScript(options?: {
|
|
|
3425
3491
|
attribute?: string;
|
|
3426
3492
|
defaultTheme?: string;
|
|
3427
3493
|
}): string;
|
|
3428
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionItemProps, AccordionProps, AccordionTrigger, ActionSheet, ActionSheetAction, ActionSheetProps, Alert, AlertDialog, AlertDialogLabels, AlertDialogProps, AlertProps, AppShell, AppShellProps, AspectRatio, AspectRatioProps, AutoGrid, AutoGridProps, Avatar, AvatarGroup, AvatarGroupLabels, AvatarGroupProps, AvatarProps, Badge, BadgeProps, Blockquote, BlockquoteProps, BottomSheet, BottomSheetProps, Breadcrumb, BreadcrumbItem, BreadcrumbProps, Button, ButtonGroup, ButtonGroupProps, ButtonProps, Calendar, CalendarLabels, CalendarProps, Card, CardContent, CardContentProps, CardFooter, CardFooterProps, CardHeader, CardHeaderProps, CardProps, CardTitle, CardTitleProps, Carousel, CarouselLabels, CarouselProps, Center, CenterProps, ChatBubble, ChatBubbleProps, ChatBubbleSide, Checkbox, CheckboxCard, CheckboxCardProps, CheckboxProps, Code, type CodeLang, CodeProps, CodeSnippet, CodeSnippetProps, Collapsible, CollapsibleProps, ColorPicker, ColorPickerLabels, ColorPickerProps, Column, Columns, ColumnsProps, Combobox, ComboboxLabels, ComboboxOption, ComboboxProps, CommandAction, CommandGroup, CommandItem, CommandMenu, CommandMenuProps, CommandPage, CommandScope, CommandStatus, Comparison, ComparisonProps, ContainedList, ContainedListItem, ContainedListItemProps, ContainedListProps, ContextMenu, ContextMenuItem, ContextMenuItemProps, ContextMenuProps, CopyButton, CopyButtonProps, DataList, DataListItem, DataListProps, DataTable, DataTableLabels, DataTableProps, DatePicker, DatePickerLabels, DatePickerProps, DateRange, DateRangePicker, DateRangePickerLabels, DateRangePickerProps, DateRangePreset, Dock, DockItem, DockProps, Drawer, DrawerProps, Dropdown, DropdownItem, DropdownProps, Editable, EditableProps, EmptyState, EmptyStateProps, ErrorBoundary, Fab, FabAction, FabProps, Field, FieldProps, FileUploader, FileUploaderLabels, FileUploaderProps, Filter, FilterOption, FilterProps, FilterVariant, Flex, FlexProps, FocusScope, Form, FormConfig, FormProps, FormStore, FuzzyMatch, Grid, GridAlign, GridItem, GridItemProps, GridProps, Header, HeaderLabels, HeaderLink, HeaderPanel, HeaderPanelLabels, HeaderPanelProps, HeaderProps, Heading, HeadingLevel, HeadingProps, HeadingSize, HoverCard, HoverCardContent, HoverCardContentProps, HoverCardProps, HoverCardTrigger, HoverCardTriggerProps, IconButton, IconButtonProps, Image, ImageProps, Indicator, IndicatorPlacement, IndicatorProps, InlineLoading, InlineLoadingProps, InlineLoadingStatus, Input, InputGroup, InputGroupAddon, type InputGroupAddonProps, type InputGroupProps, InputProps, Item, ItemActions, ItemActionsProps, ItemContent, ItemContentProps, ItemDescription, ItemDescriptionProps, ItemMedia, ItemMediaProps, ItemProps, ItemTitle, ItemTitleProps, Join, JoinOrientation, JoinProps, Kbd, KbdProps, Label, LabelProps, Link, type LinkComponent, LinkProps, List, ListItem, ListItemProps, ListProps, LogLevel, LogLine, LogViewer, LogViewerLabels, LogViewerProps, Menu, MenuButton, MenuButtonItem, MenuButtonProps, MenuItem, MenuItemProps, MenuProps, MenuSeparator, MenuTrigger, MenuTriggerProps, Menubar, MenubarItem, MenubarMenu, MenubarProps, Modal, ModalProps, MultiSelect, MultiSelectLabels, MultiSelectOption, MultiSelectProps, NativeSelect, NativeSelectOption, NativeSelectProps, NavigationMenu, NavigationMenuItem, NavigationMenuProps, Notification, NotificationProps, NotificationVariant, NumberInput, NumberInputProps, OtpInput, OtpInputProps, OverflowMenu, OverflowMenuItem, OverflowMenuProps, Pagination, PaginationLabels, PaginationProps, PasswordInput, PasswordInputLabels, PasswordInputProps, Popover, PopoverContent, PopoverContentProps, PopoverProps, PopoverTrigger, PopoverTriggerProps, Portal, Progress, ProgressBar, ProgressBarProps, ProgressCircle, ProgressCircleProps, ProgressIndicator, ProgressIndicatorProps, ProgressProps, ProgressSize, ProgressStep, ProgressVariant, Prose, ProseProps, PullToRefresh, PullToRefreshProps, QrCode, QrCodeProps, RadialProgress, RadialProgressProps, RadialProgressSize, RadialProgressVariant, Radio, RadioCard, RadioCardGroup, RadioCardGroupProps, RadioCardProps, RadioGroup, RadioGroupProps, RadioProps, RatingGroup, RatingGroupLabels, RatingGroupProps, RelativeTime, RelativeTimeProps, Resizable, ResizableProps, Responsive, ScrollArea, ScrollAreaProps, Search, SearchProps, SegmentedControl, SegmentedControlOption, SegmentedControlProps, Select, SelectOption, SelectProps, Separator, SeparatorProps, Sheet, SheetProps, ShellHeader, ShellHeaderAction, ShellHeaderBrand, ShellHeaderLabels, ShellHeaderNavItem, ShellHeaderNavLink, ShellHeaderNavMenu, ShellHeaderNavMenuItem, ShellHeaderProps, SideNav, SideNavGroup, SideNavItem, SideNavLinkProps, SideNavLinkSubItem, SideNavProps, SideNavSubItem, SideNavTone, Skeleton, SkeletonProps, SkipNavLink, SkipNavLinkProps, SkipNavTarget, SkipNavTargetProps, Slider, SliderProps, SortDirection, SortState, Spacer, SpacerProps, Spinner, SpinnerProps, Stack, StackProps, type StandardSchemaV1, Stat, StatProps, Status, StatusProps, Step, StepState, Steps, StepsProps, StructuredList, StructuredListItem, StructuredListProps, SuspenseBoundary, Swap, SwapMode, SwapProps, SwipeAction, SwipeItem, SwipeItemProps, Switcher, SwitcherEntry, SwitcherLink, SwitcherProps, Tabs, TabsContent, TabsContentProps, TabsList, TabsProps, TabsTrigger, TabsTriggerProps, Tag$1 as Tag, TagProps, TagsInput, TagsInputProps, Text, TextProps, Textarea, TextareaProps, ThemeProvider, type ThemeProviderProps, Tile, TileProps, TimePicker, TimePickerProps, Timeline, TimelineItem, TimelineProps, ToastOptions, ToastProvider, ToastVariant, Toc, TocItem, TocProps, Toggle, ToggleGroup, ToggleGroupItem, ToggleGroupProps, ToggleProps, Toggletip, ToggletipPlacement, ToggletipProps, Tooltip, TooltipProps, TreeNode, TreeView, TreeViewProps, UploaderFile, type UsePopoverOptions, type UsePopoverReturn, type UseTocFromRegionOptions, User, UserProps, VisuallyHidden, VisuallyHiddenProps, createForm, dismissAllToasts, fuzzyMatch, fuzzyScore, getLinkComponent, setLinkComponent, setTheme, themePreloadScript, treeViewMessages, useForm, usePopover, useTheme, useToast, useTocFromRegion };
|
|
3494
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionItemProps, AccordionProps, AccordionTrigger, ActionSheet, ActionSheetAction, ActionSheetProps, Alert, AlertDialog, AlertDialogLabels, AlertDialogProps, AlertProps, AppShell, AppShellProps, AspectRatio, AspectRatioProps, AutoGrid, AutoGridProps, Avatar, AvatarGroup, AvatarGroupLabels, AvatarGroupProps, AvatarProps, Badge, BadgeProps, Blockquote, BlockquoteProps, BottomSheet, BottomSheetProps, Breadcrumb, BreadcrumbItem, BreadcrumbProps, Button, ButtonGroup, ButtonGroupProps, ButtonProps, Calendar, CalendarLabels, CalendarProps, Card, CardContent, CardContentProps, CardFooter, CardFooterProps, CardHeader, CardHeaderProps, CardProps, CardTitle, CardTitleProps, Carousel, CarouselLabels, CarouselProps, Center, CenterProps, ChatBubble, ChatBubbleProps, ChatBubbleSide, Checkbox, CheckboxCard, CheckboxCardProps, CheckboxProps, Code, type CodeLang, CodeProps, CodeSnippet, CodeSnippetProps, Collapsible, CollapsibleProps, ColorPicker, ColorPickerLabels, ColorPickerProps, Column, Columns, ColumnsProps, Combobox, ComboboxLabels, ComboboxOption, ComboboxProps, CommandAction, CommandGroup, CommandItem, CommandMenu, CommandMenuProps, CommandPage, CommandScope, CommandStatus, Comparison, ComparisonProps, ContainedList, ContainedListItem, ContainedListItemProps, ContainedListProps, ContextMenu, ContextMenuItem, ContextMenuItemProps, ContextMenuProps, CopyButton, CopyButtonProps, DataList, DataListItem, DataListProps, DataTable, DataTableLabels, DataTableProps, DatePicker, DatePickerLabels, DatePickerProps, DateRange, DateRangePicker, DateRangePickerLabels, DateRangePickerProps, DateRangePreset, Dock, DockItem, DockProps, Drawer, DrawerProps, Dropdown, DropdownItem, DropdownProps, Editable, EditableProps, EmptyState, EmptyStateProps, ErrorBoundary, Fab, FabAction, FabProps, Field, FieldProps, FileUploader, FileUploaderLabels, FileUploaderProps, Filter, FilterOption, FilterProps, FilterVariant, Flex, FlexProps, FocusScope, Form, FormConfig, FormProps, FormStore, FuzzyMatch, Grid, GridAlign, GridItem, GridItemProps, GridProps, Header, HeaderLabels, HeaderLink, HeaderPanel, HeaderPanelLabels, HeaderPanelProps, HeaderProps, Heading, HeadingLevel, HeadingProps, HeadingSize, HoverCard, HoverCardContent, HoverCardContentProps, HoverCardProps, HoverCardTrigger, HoverCardTriggerProps, IconButton, IconButtonProps, Image, ImageProps, Indicator, IndicatorPlacement, IndicatorProps, InlineLoading, InlineLoadingProps, InlineLoadingStatus, Input, InputGroup, InputGroupAddon, type InputGroupAddonProps, type InputGroupProps, InputProps, Item, ItemActions, ItemActionsProps, ItemContent, ItemContentProps, ItemDescription, ItemDescriptionProps, ItemMedia, ItemMediaProps, ItemProps, ItemTitle, ItemTitleProps, Join, JoinOrientation, JoinProps, Kbd, KbdProps, Label, LabelProps, Link, type LinkComponent, type LinkComponentProps, LinkProps, List, ListItem, ListItemProps, ListProps, LogLevel, LogLine, LogViewer, LogViewerLabels, LogViewerProps, Menu, MenuButton, MenuButtonItem, MenuButtonProps, MenuItem, MenuItemProps, MenuProps, MenuSeparator, MenuTrigger, MenuTriggerProps, Menubar, MenubarItem, MenubarMenu, MenubarProps, Modal, ModalProps, MultiSelect, MultiSelectLabels, MultiSelectOption, MultiSelectProps, NativeSelect, NativeSelectOption, NativeSelectProps, NavigationMenu, NavigationMenuItem, NavigationMenuProps, Notification, NotificationProps, NotificationVariant, NumberInput, NumberInputProps, OtpInput, OtpInputProps, OverflowMenu, OverflowMenuItem, OverflowMenuProps, Pagination, PaginationLabels, PaginationProps, PasswordInput, PasswordInputLabels, PasswordInputProps, Popover, PopoverContent, PopoverContentProps, PopoverProps, PopoverTrigger, PopoverTriggerProps, Portal, Progress, ProgressBar, ProgressBarProps, ProgressCircle, ProgressCircleProps, ProgressIndicator, ProgressIndicatorProps, ProgressProps, ProgressSize, ProgressStep, ProgressVariant, Prose, ProseProps, PullToRefresh, PullToRefreshProps, QrCode, QrCodeProps, RadialProgress, RadialProgressProps, RadialProgressSize, RadialProgressVariant, Radio, RadioCard, RadioCardGroup, RadioCardGroupProps, RadioCardProps, RadioGroup, RadioGroupProps, RadioProps, RatingGroup, RatingGroupLabels, RatingGroupProps, RelativeTime, RelativeTimeProps, Resizable, ResizableProps, Responsive, ScrollArea, ScrollAreaProps, Search, SearchProps, SegmentedControl, SegmentedControlOption, SegmentedControlProps, Select, SelectOption, SelectProps, Separator, SeparatorProps, Sheet, SheetProps, ShellHeader, ShellHeaderAction, ShellHeaderBrand, ShellHeaderLabels, ShellHeaderNavItem, ShellHeaderNavLink, ShellHeaderNavMenu, ShellHeaderNavMenuItem, ShellHeaderProps, SideNav, SideNavGroup, SideNavItem, SideNavLinkProps, SideNavLinkSubItem, SideNavProps, SideNavSubItem, SideNavTone, Skeleton, SkeletonProps, SkipNavLink, SkipNavLinkProps, SkipNavTarget, SkipNavTargetProps, Slider, SliderProps, SortDirection, SortState, Spacer, SpacerProps, Spinner, SpinnerProps, Stack, StackProps, type StandardSchemaV1, Stat, StatProps, Status, StatusProps, Step, StepState, Steps, StepsProps, StructuredList, StructuredListItem, StructuredListProps, SuspenseBoundary, Swap, SwapMode, SwapProps, SwipeAction, SwipeItem, SwipeItemProps, Switcher, SwitcherEntry, SwitcherLink, SwitcherProps, Tabs, TabsContent, TabsContentProps, TabsList, TabsProps, TabsTrigger, TabsTriggerProps, Tag$1 as Tag, TagProps, TagsInput, TagsInputProps, Text, TextProps, Textarea, TextareaProps, ThemeProvider, type ThemeProviderProps, Tile, TileProps, TimePicker, TimePickerProps, Timeline, TimelineItem, TimelineProps, ToastOptions, ToastProvider, ToastVariant, Toc, TocItem, TocProps, Toggle, ToggleGroup, ToggleGroupItem, ToggleGroupProps, ToggleProps, Toggletip, ToggletipPlacement, ToggletipProps, Tooltip, TooltipProps, TreeNode, TreeView, TreeViewProps, UploaderFile, type UsePopoverOptions, type UsePopoverReturn, type UseTocFromRegionOptions, User, UserProps, VisuallyHidden, VisuallyHiddenProps, createForm, dismissAllToasts, fuzzyMatch, fuzzyScore, getLinkComponent, setLinkComponent, setTheme, themePreloadScript, treeViewMessages, useForm, usePopover, useTheme, useToast, useTocFromRegion };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./accordion.module.js";
|
|
4
|
+
import { cn as t, useSignal as n, useSignals as r } from "@cascivo/core";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import { createContext as o, useId as s } from "react";
|
|
7
|
+
//#region ../components/src/accordion/accordion.tsx
|
|
8
|
+
var c = o(null), l = o(null);
|
|
9
|
+
function u(e) {
|
|
10
|
+
return e === void 0 ? [] : Array.isArray(e) ? e : [e];
|
|
11
|
+
}
|
|
12
|
+
function d({ type: r = "single", defaultValue: a, value: o, onValueChange: l, className: d, children: f }) {
|
|
13
|
+
let p = s(), m = n(u(o ?? a));
|
|
14
|
+
o !== void 0 && (m.value = u(o));
|
|
15
|
+
let h = {
|
|
16
|
+
open: m,
|
|
17
|
+
baseId: p,
|
|
18
|
+
toggle: (e) => {
|
|
19
|
+
let t = m.value, n;
|
|
20
|
+
n = r === "multiple" ? t.includes(e) ? t.filter((t) => t !== e) : [...t, e] : t.includes(e) ? [] : [e], o === void 0 && (m.value = n), l?.(r === "multiple" ? n : n[0] ?? "");
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
return /* @__PURE__ */ i(c.Provider, {
|
|
24
|
+
value: h,
|
|
25
|
+
children: /* @__PURE__ */ i("div", {
|
|
26
|
+
"data-type": r,
|
|
27
|
+
className: t(e.accordion, d),
|
|
28
|
+
children: f
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function f({ value: n, className: r, children: a, ...o }) {
|
|
33
|
+
return /* @__PURE__ */ i(l.Provider, {
|
|
34
|
+
value: { value: n },
|
|
35
|
+
children: /* @__PURE__ */ i("div", {
|
|
36
|
+
"data-value": n,
|
|
37
|
+
className: t(e.item, r),
|
|
38
|
+
...o,
|
|
39
|
+
children: a
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function p(e) {
|
|
44
|
+
return /* @__PURE__ */ i(c.Consumer, { children: (t) => /* @__PURE__ */ i(l.Consumer, { children: (n) => t && n ? /* @__PURE__ */ i(m, {
|
|
45
|
+
store: t,
|
|
46
|
+
item: n,
|
|
47
|
+
...e
|
|
48
|
+
}) : null }) });
|
|
49
|
+
}
|
|
50
|
+
function m({ store: n, item: o, className: s, children: c, ...l }) {
|
|
51
|
+
r();
|
|
52
|
+
let u = n.open.value.includes(o.value);
|
|
53
|
+
return /* @__PURE__ */ i("h3", {
|
|
54
|
+
className: e.heading,
|
|
55
|
+
children: /* @__PURE__ */ a("button", {
|
|
56
|
+
type: "button",
|
|
57
|
+
id: `${n.baseId}-trigger-${o.value}`,
|
|
58
|
+
"aria-expanded": u,
|
|
59
|
+
"aria-controls": `${n.baseId}-content-${o.value}`,
|
|
60
|
+
"data-state": u ? "open" : "closed",
|
|
61
|
+
className: t(e.trigger, s),
|
|
62
|
+
onClick: () => n.toggle(o.value),
|
|
63
|
+
...l,
|
|
64
|
+
children: [/* @__PURE__ */ i("span", { children: c }), /* @__PURE__ */ i("span", {
|
|
65
|
+
className: e.indicator,
|
|
66
|
+
"aria-hidden": "true"
|
|
67
|
+
})]
|
|
68
|
+
})
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function h(e) {
|
|
72
|
+
return /* @__PURE__ */ i(c.Consumer, { children: (t) => /* @__PURE__ */ i(l.Consumer, { children: (n) => t && n ? /* @__PURE__ */ i(g, {
|
|
73
|
+
store: t,
|
|
74
|
+
item: n,
|
|
75
|
+
...e
|
|
76
|
+
}) : null }) });
|
|
77
|
+
}
|
|
78
|
+
function g({ store: n, item: a, className: o, children: s, ...c }) {
|
|
79
|
+
r();
|
|
80
|
+
let l = n.open.value.includes(a.value);
|
|
81
|
+
return /* @__PURE__ */ i("div", {
|
|
82
|
+
role: "region",
|
|
83
|
+
id: `${n.baseId}-content-${a.value}`,
|
|
84
|
+
"aria-labelledby": `${n.baseId}-trigger-${a.value}`,
|
|
85
|
+
"data-state": l ? "open" : "closed",
|
|
86
|
+
className: t(e.content, o),
|
|
87
|
+
...c,
|
|
88
|
+
children: /* @__PURE__ */ i("div", {
|
|
89
|
+
className: e.contentInner,
|
|
90
|
+
children: s
|
|
91
|
+
})
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
//#endregion
|
|
95
|
+
export { d as Accordion, h as AccordionContent, f as AccordionItem, p as AccordionTrigger };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
var e = {
|
|
4
|
+
accordion: "_accordion_9ch4s_2",
|
|
5
|
+
item: "_item_9ch4s_10",
|
|
6
|
+
heading: "_heading_9ch4s_16",
|
|
7
|
+
trigger: "_trigger_9ch4s_22",
|
|
8
|
+
indicator: "_indicator_9ch4s_48",
|
|
9
|
+
content: "_content_9ch4s_62",
|
|
10
|
+
contentInner: "_contentInner_9ch4s_77"
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { e as default };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./action-sheet.module.js";
|
|
4
|
+
import { DismissableLayer as t, FocusScope as n, Portal as r, Presence as i, cn as a, useControllableSignal as o, useRovingFocus as s, useSignals as c } from "@cascivo/core";
|
|
5
|
+
import { builtin as l, t as u } from "@cascivo/i18n";
|
|
6
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
7
|
+
import { useId as p } from "react";
|
|
8
|
+
//#region ../components/src/action-sheet/action-sheet.tsx
|
|
9
|
+
function m({ open: m, defaultOpen: h, onOpenChange: g, actions: _, title: v, description: y, showCancel: b = !0, labels: x, className: S }) {
|
|
10
|
+
c();
|
|
11
|
+
let [C, w] = o({
|
|
12
|
+
value: m,
|
|
13
|
+
defaultValue: h ?? !1,
|
|
14
|
+
onChange: g
|
|
15
|
+
}), T = s({
|
|
16
|
+
orientation: "vertical",
|
|
17
|
+
loop: !0
|
|
18
|
+
}), E = p(), D = p(), O = x?.cancel ?? u(l.actionSheet.cancel), k = x?.label ?? u(l.actionSheet.label), A = (e) => {
|
|
19
|
+
e.disabled || (e.onSelect(), w(!1));
|
|
20
|
+
}, j = _.length;
|
|
21
|
+
return /* @__PURE__ */ d(r, { children: /* @__PURE__ */ d(i, {
|
|
22
|
+
present: C,
|
|
23
|
+
children: /* @__PURE__ */ d("div", {
|
|
24
|
+
className: e.overlay,
|
|
25
|
+
children: /* @__PURE__ */ d(t, {
|
|
26
|
+
onDismiss: () => w(!1),
|
|
27
|
+
children: /* @__PURE__ */ d(n, {
|
|
28
|
+
trapped: !0,
|
|
29
|
+
restoreFocus: !0,
|
|
30
|
+
autoFocus: !0,
|
|
31
|
+
children: /* @__PURE__ */ f("div", {
|
|
32
|
+
role: "menu",
|
|
33
|
+
"aria-label": v ? void 0 : k,
|
|
34
|
+
"aria-labelledby": v ? E : void 0,
|
|
35
|
+
"aria-describedby": y ? D : void 0,
|
|
36
|
+
className: a(e.sheet, S),
|
|
37
|
+
children: [/* @__PURE__ */ f("div", {
|
|
38
|
+
className: e.group,
|
|
39
|
+
children: [(v || y) && /* @__PURE__ */ f("div", {
|
|
40
|
+
className: e.heading,
|
|
41
|
+
role: "presentation",
|
|
42
|
+
children: [v && /* @__PURE__ */ d("p", {
|
|
43
|
+
id: E,
|
|
44
|
+
className: e.title,
|
|
45
|
+
children: v
|
|
46
|
+
}), y && /* @__PURE__ */ d("p", {
|
|
47
|
+
id: D,
|
|
48
|
+
className: e.description,
|
|
49
|
+
children: y
|
|
50
|
+
})]
|
|
51
|
+
}), _.map((t, n) => {
|
|
52
|
+
let r = T.getItemProps(n);
|
|
53
|
+
return /* @__PURE__ */ d("button", {
|
|
54
|
+
ref: r.ref,
|
|
55
|
+
type: "button",
|
|
56
|
+
role: "menuitem",
|
|
57
|
+
tabIndex: r.tabIndex,
|
|
58
|
+
"aria-disabled": t.disabled || void 0,
|
|
59
|
+
"data-destructive": t.destructive ? "" : void 0,
|
|
60
|
+
className: e.item,
|
|
61
|
+
onKeyDown: r.onKeyDown,
|
|
62
|
+
onFocus: r.onFocus,
|
|
63
|
+
onClick: () => A(t),
|
|
64
|
+
children: t.label
|
|
65
|
+
}, n);
|
|
66
|
+
})]
|
|
67
|
+
}), b && /* @__PURE__ */ d("div", {
|
|
68
|
+
className: e.group,
|
|
69
|
+
children: (() => {
|
|
70
|
+
let t = T.getItemProps(j);
|
|
71
|
+
return /* @__PURE__ */ d("button", {
|
|
72
|
+
ref: t.ref,
|
|
73
|
+
type: "button",
|
|
74
|
+
role: "menuitem",
|
|
75
|
+
tabIndex: t.tabIndex,
|
|
76
|
+
className: a(e.item, e.cancel),
|
|
77
|
+
onKeyDown: t.onKeyDown,
|
|
78
|
+
onFocus: t.onFocus,
|
|
79
|
+
onClick: () => w(!1),
|
|
80
|
+
children: O
|
|
81
|
+
});
|
|
82
|
+
})()
|
|
83
|
+
})]
|
|
84
|
+
})
|
|
85
|
+
})
|
|
86
|
+
})
|
|
87
|
+
})
|
|
88
|
+
}) });
|
|
89
|
+
}
|
|
90
|
+
//#endregion
|
|
91
|
+
export { m as ActionSheet };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
var e = {
|
|
4
|
+
overlay: "_overlay_17irl_2",
|
|
5
|
+
sheet: "_sheet_17irl_28",
|
|
6
|
+
group: "_group_17irl_50",
|
|
7
|
+
heading: "_heading_17irl_60",
|
|
8
|
+
title: "_title_17irl_66",
|
|
9
|
+
description: "_description_17irl_73",
|
|
10
|
+
item: "_item_17irl_79",
|
|
11
|
+
cancel: "_cancel_17irl_119"
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { e as default };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./alert.module.js";
|
|
4
|
+
import { cn as t, useSignal 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
|
+
//#region ../components/src/alert/alert.tsx
|
|
8
|
+
var c = new Set(["warning", "destructive"]);
|
|
9
|
+
function l({ variant: l = "default", title: u, icon: d, dismissible: f = !1, onDismiss: p, action: m, className: h, children: g, ..._ }) {
|
|
10
|
+
r();
|
|
11
|
+
let v = n(!1);
|
|
12
|
+
return v.value ? null : /* @__PURE__ */ s("div", {
|
|
13
|
+
role: c.has(l) ? "alert" : "status",
|
|
14
|
+
"data-variant": l,
|
|
15
|
+
className: t(e.alert, h),
|
|
16
|
+
..._,
|
|
17
|
+
children: [
|
|
18
|
+
d && /* @__PURE__ */ o("span", {
|
|
19
|
+
className: e.icon,
|
|
20
|
+
"aria-hidden": "true",
|
|
21
|
+
children: d
|
|
22
|
+
}),
|
|
23
|
+
/* @__PURE__ */ s("div", {
|
|
24
|
+
className: e.body,
|
|
25
|
+
children: [
|
|
26
|
+
u && /* @__PURE__ */ o("div", {
|
|
27
|
+
className: e.title,
|
|
28
|
+
children: u
|
|
29
|
+
}),
|
|
30
|
+
g && /* @__PURE__ */ o("div", {
|
|
31
|
+
className: e.content,
|
|
32
|
+
children: g
|
|
33
|
+
}),
|
|
34
|
+
m && /* @__PURE__ */ o("button", {
|
|
35
|
+
type: "button",
|
|
36
|
+
className: e.action,
|
|
37
|
+
onClick: m.onClick,
|
|
38
|
+
children: m.label
|
|
39
|
+
})
|
|
40
|
+
]
|
|
41
|
+
}),
|
|
42
|
+
f && /* @__PURE__ */ o("button", {
|
|
43
|
+
type: "button",
|
|
44
|
+
className: e.dismiss,
|
|
45
|
+
"aria-label": a(i.alert.dismiss),
|
|
46
|
+
onClick: () => {
|
|
47
|
+
v.value = !0, p?.();
|
|
48
|
+
},
|
|
49
|
+
children: "✕"
|
|
50
|
+
})
|
|
51
|
+
]
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
export { l as Alert };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
var e = {
|
|
4
|
+
alert: "_alert_a2dn2_2",
|
|
5
|
+
icon: "_icon_a2dn2_18",
|
|
6
|
+
title: "_title_a2dn2_19",
|
|
7
|
+
body: "_body_a2dn2_90",
|
|
8
|
+
content: "_content_a2dn2_104",
|
|
9
|
+
action: "_action_a2dn2_110",
|
|
10
|
+
dismiss: "_dismiss_a2dn2_149"
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { e as default };
|