@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
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./alert-dialog.module.js";
|
|
4
|
+
import { useId as t, useSignal as n, useSignalEffect 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
|
+
import { useRef as c } from "react";
|
|
8
|
+
//#region ../components/src/alert-dialog/alert-dialog.tsx
|
|
9
|
+
function l({ open: l, title: u, description: d, onConfirm: f, onCancel: p, labels: m, variant: h = "default" }) {
|
|
10
|
+
let g = c(null), _ = t("cascivo-alert-dialog-title"), v = t("cascivo-alert-dialog-desc"), y = n(l);
|
|
11
|
+
y.value = l;
|
|
12
|
+
let b = c(null), x = c(p);
|
|
13
|
+
x.current = p;
|
|
14
|
+
let S = c(f);
|
|
15
|
+
return S.current = f, r(() => {
|
|
16
|
+
let e = g.current;
|
|
17
|
+
if (e) if (y.value) {
|
|
18
|
+
try {
|
|
19
|
+
e.showPopover();
|
|
20
|
+
} catch {}
|
|
21
|
+
requestAnimationFrame(() => b.current?.focus());
|
|
22
|
+
} else try {
|
|
23
|
+
e.hidePopover();
|
|
24
|
+
} catch {}
|
|
25
|
+
}), /* @__PURE__ */ o("div", {
|
|
26
|
+
ref: g,
|
|
27
|
+
popover: "manual",
|
|
28
|
+
role: "alertdialog",
|
|
29
|
+
"aria-modal": "true",
|
|
30
|
+
"aria-labelledby": _,
|
|
31
|
+
"aria-describedby": v,
|
|
32
|
+
"data-state": l ? "open" : "closed",
|
|
33
|
+
"data-variant": h,
|
|
34
|
+
className: e.dialog,
|
|
35
|
+
children: /* @__PURE__ */ s("div", {
|
|
36
|
+
className: e.content,
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ o("p", {
|
|
39
|
+
id: _,
|
|
40
|
+
className: e.title,
|
|
41
|
+
children: u
|
|
42
|
+
}),
|
|
43
|
+
/* @__PURE__ */ o("p", {
|
|
44
|
+
id: v,
|
|
45
|
+
className: e.description,
|
|
46
|
+
children: d
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ s("div", {
|
|
49
|
+
className: e.actions,
|
|
50
|
+
children: [/* @__PURE__ */ o("button", {
|
|
51
|
+
ref: b,
|
|
52
|
+
type: "button",
|
|
53
|
+
className: e.cancel,
|
|
54
|
+
onClick: () => x.current(),
|
|
55
|
+
children: m?.cancel ?? a(i.alertDialog.cancel)
|
|
56
|
+
}), /* @__PURE__ */ o("button", {
|
|
57
|
+
type: "button",
|
|
58
|
+
className: e.confirm,
|
|
59
|
+
onClick: () => S.current(),
|
|
60
|
+
children: m?.confirm ?? a(i.alertDialog.confirm)
|
|
61
|
+
})]
|
|
62
|
+
})
|
|
63
|
+
]
|
|
64
|
+
})
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
export { l as AlertDialog };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
var e = {
|
|
4
|
+
dialog: "_dialog_1net6_2",
|
|
5
|
+
content: "_content_1net6_58",
|
|
6
|
+
title: "_title_1net6_71",
|
|
7
|
+
description: "_description_1net6_78",
|
|
8
|
+
actions: "_actions_1net6_84",
|
|
9
|
+
cancel: "_cancel_1net6_123",
|
|
10
|
+
confirm: "_confirm_1net6_124"
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { e as default };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./app-shell.module.js";
|
|
4
|
+
import { cn as t, useSignal as n, useSignalEffect as r, useSignals as i } from "@cascivo/core";
|
|
5
|
+
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
import { cloneElement as c, isValidElement as l, useRef as u } from "react";
|
|
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: _, className: v }) {
|
|
9
|
+
i();
|
|
10
|
+
let y = h !== void 0, b = n(h ?? g ?? !0);
|
|
11
|
+
y && (b.value = h);
|
|
12
|
+
let x = u(null), S = u(null);
|
|
13
|
+
function C(e) {
|
|
14
|
+
y || (b.value = e), _?.(e);
|
|
15
|
+
}
|
|
16
|
+
function w() {
|
|
17
|
+
typeof document < "u" && (S.current = document.activeElement), C(!b.value);
|
|
18
|
+
}
|
|
19
|
+
r(() => {
|
|
20
|
+
y || g !== void 0 || typeof window > "u" || typeof window.matchMedia != "function" || window.matchMedia("(max-width: 63.999rem)").matches && (b.value = !1);
|
|
21
|
+
}), r(() => {
|
|
22
|
+
if (!b.value || typeof document > "u") return;
|
|
23
|
+
let e = (e) => {
|
|
24
|
+
e.key === "Escape" && C(!1);
|
|
25
|
+
};
|
|
26
|
+
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
27
|
+
}), r(() => {
|
|
28
|
+
let e = x.current;
|
|
29
|
+
if (e) if (b.value) e.removeAttribute("inert");
|
|
30
|
+
else {
|
|
31
|
+
e.setAttribute("inert", "");
|
|
32
|
+
let t = S.current;
|
|
33
|
+
t && e.contains(document.activeElement) && t.focus();
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
let T = l(d) && f ? c(d, {
|
|
37
|
+
onMenuClick: w,
|
|
38
|
+
menuExpanded: b.value
|
|
39
|
+
}) : d;
|
|
40
|
+
return /* @__PURE__ */ s("div", {
|
|
41
|
+
className: t(e.shell, v),
|
|
42
|
+
"data-open": b.value,
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ o("div", {
|
|
45
|
+
className: e.header,
|
|
46
|
+
children: T
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ s("div", {
|
|
49
|
+
className: e.body,
|
|
50
|
+
children: [f && /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("div", {
|
|
51
|
+
ref: x,
|
|
52
|
+
className: e.navWrapper,
|
|
53
|
+
"data-open": b.value,
|
|
54
|
+
"data-testid": "app-shell-nav",
|
|
55
|
+
children: /* @__PURE__ */ o("div", {
|
|
56
|
+
className: e.navInner,
|
|
57
|
+
children: f
|
|
58
|
+
})
|
|
59
|
+
}), /* @__PURE__ */ o("div", {
|
|
60
|
+
className: e.scrim,
|
|
61
|
+
"data-open": b.value,
|
|
62
|
+
"data-testid": "app-shell-scrim",
|
|
63
|
+
"aria-hidden": "true",
|
|
64
|
+
onClick: () => C(!1)
|
|
65
|
+
})] }), /* @__PURE__ */ o("main", {
|
|
66
|
+
id: "cascade-main",
|
|
67
|
+
tabIndex: -1,
|
|
68
|
+
className: e.main,
|
|
69
|
+
children: p
|
|
70
|
+
})]
|
|
71
|
+
}),
|
|
72
|
+
m && /* @__PURE__ */ o("div", {
|
|
73
|
+
className: e.footer,
|
|
74
|
+
children: m
|
|
75
|
+
})
|
|
76
|
+
]
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
export { d as AppShell };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
var e = {
|
|
4
|
+
shell: "_shell_11je2_4",
|
|
5
|
+
header: "_header_11je2_16",
|
|
6
|
+
body: "_body_11je2_21",
|
|
7
|
+
navWrapper: "_navWrapper_11je2_32",
|
|
8
|
+
navInner: "_navInner_11je2_58",
|
|
9
|
+
scrim: "_scrim_11je2_70",
|
|
10
|
+
main: "_main_11je2_87",
|
|
11
|
+
footer: "_footer_11je2_93"
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { e as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./aspect-ratio.module.js";
|
|
4
|
+
import { cn as t } from "@cascivo/core";
|
|
5
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
6
|
+
//#region ../components/src/aspect-ratio/aspect-ratio.tsx
|
|
7
|
+
function r({ ratio: r = 16 / 9, className: i, style: a, children: o, ...s }) {
|
|
8
|
+
return /* @__PURE__ */ n("div", {
|
|
9
|
+
className: t(e.root, i),
|
|
10
|
+
style: {
|
|
11
|
+
"--cascivo-aspect-ratio": r,
|
|
12
|
+
...a
|
|
13
|
+
},
|
|
14
|
+
...s,
|
|
15
|
+
children: /* @__PURE__ */ n("div", {
|
|
16
|
+
className: e.inner,
|
|
17
|
+
children: o
|
|
18
|
+
})
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { r as AspectRatio };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./avatar.module.js";
|
|
4
|
+
import { cn as t, createMachine as n, useMachine as r, useSignals as i } from "@cascivo/core";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
//#region ../components/src/avatar/avatar.tsx
|
|
7
|
+
var s = n({
|
|
8
|
+
initial: "loading",
|
|
9
|
+
states: {
|
|
10
|
+
loading: { on: {
|
|
11
|
+
LOADED: "loaded",
|
|
12
|
+
ERROR: "error"
|
|
13
|
+
} },
|
|
14
|
+
loaded: {},
|
|
15
|
+
error: {}
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
function c({ src: n, alt: c = "", name: u, fallback: d, size: f = "md", status: p, className: m, ...h }) {
|
|
19
|
+
i();
|
|
20
|
+
let [g, _] = r(s), v = !!n && g.value !== "error", y = d ?? l(u), b = c || u || d;
|
|
21
|
+
return /* @__PURE__ */ o("span", {
|
|
22
|
+
"data-size": f,
|
|
23
|
+
"data-status": p,
|
|
24
|
+
className: t(e.avatar, m),
|
|
25
|
+
role: v || !b ? void 0 : "img",
|
|
26
|
+
"aria-label": v ? void 0 : b || void 0,
|
|
27
|
+
...h,
|
|
28
|
+
children: [v ? /* @__PURE__ */ a("img", {
|
|
29
|
+
className: e.image,
|
|
30
|
+
src: n,
|
|
31
|
+
alt: c || u || "",
|
|
32
|
+
onLoad: () => _("LOADED"),
|
|
33
|
+
onError: () => _("ERROR")
|
|
34
|
+
}) : /* @__PURE__ */ a("span", {
|
|
35
|
+
className: e.fallback,
|
|
36
|
+
"aria-hidden": "true",
|
|
37
|
+
children: y
|
|
38
|
+
}), p && /* @__PURE__ */ a("span", {
|
|
39
|
+
className: e.status,
|
|
40
|
+
"aria-hidden": "true"
|
|
41
|
+
})]
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function l(e) {
|
|
45
|
+
if (!e) return;
|
|
46
|
+
let t = e.trim().split(/\s+/).filter(Boolean);
|
|
47
|
+
if (t.length !== 0) return (u(t[0]) + (t.length > 1 ? u(t[t.length - 1]) : "")).toLocaleUpperCase() || void 0;
|
|
48
|
+
}
|
|
49
|
+
function u(e) {
|
|
50
|
+
if (typeof Intl < "u" && "Segmenter" in Intl) {
|
|
51
|
+
let t = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
52
|
+
for (let n of t.segment(e)) return n.segment;
|
|
53
|
+
}
|
|
54
|
+
return [...e][0] ?? "";
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { c as Avatar };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Avatar as e } from "../avatar/avatar.js";
|
|
4
|
+
import t from "./avatar-group.module.js";
|
|
5
|
+
import { cn as n } from "@cascivo/core";
|
|
6
|
+
import { builtin as r, t as i } from "@cascivo/i18n";
|
|
7
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
8
|
+
import { Children as s } from "react";
|
|
9
|
+
//#region ../components/src/avatar-group/avatar-group.tsx
|
|
10
|
+
function c({ max: c, total: l, spacing: u = "md", isGrid: d = !1, labels: f, className: p, children: m, ...h }) {
|
|
11
|
+
let g = s.toArray(m), _ = c == null ? g : g.slice(0, c), v = (l ?? g.length) - _.length, y = f?.more?.(v) ?? i(r.avatarGroup.more, { count: v });
|
|
12
|
+
return /* @__PURE__ */ o("div", {
|
|
13
|
+
role: "group",
|
|
14
|
+
"data-spacing": u,
|
|
15
|
+
"data-grid": d || void 0,
|
|
16
|
+
className: n(t.group, p),
|
|
17
|
+
...h,
|
|
18
|
+
children: [_, v > 0 && /* @__PURE__ */ a(e, {
|
|
19
|
+
className: t.overflow,
|
|
20
|
+
fallback: `+${v}`,
|
|
21
|
+
"aria-label": y
|
|
22
|
+
})]
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { c as AvatarGroup };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./badge.module.js";
|
|
4
|
+
import { cn as t } from "@cascivo/core";
|
|
5
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
6
|
+
//#region ../components/src/badge/badge.tsx
|
|
7
|
+
function r({ variant: r = "default", size: i = "md", className: a, children: o, ...s }) {
|
|
8
|
+
return /* @__PURE__ */ n("span", {
|
|
9
|
+
"data-variant": r,
|
|
10
|
+
"data-size": i,
|
|
11
|
+
className: t(e.badge, a),
|
|
12
|
+
...s,
|
|
13
|
+
children: o
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { r as Badge };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./blockquote.module.js";
|
|
4
|
+
import { cn as t } from "@cascivo/core";
|
|
5
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
6
|
+
//#region ../components/src/blockquote/blockquote.tsx
|
|
7
|
+
function i({ cite: i, className: a, children: o, ...s }) {
|
|
8
|
+
return /* @__PURE__ */ r("blockquote", {
|
|
9
|
+
className: t(e.blockquote, a),
|
|
10
|
+
...s,
|
|
11
|
+
children: [o, i ? /* @__PURE__ */ n("footer", {
|
|
12
|
+
className: e.footer,
|
|
13
|
+
children: /* @__PURE__ */ n("cite", { children: i })
|
|
14
|
+
}) : null]
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { i as Blockquote };
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./bottom-sheet.module.js";
|
|
4
|
+
import { DismissableLayer as t, FocusScope as n, Portal as r, Presence as i, cn as a, useControllableSignal as o, useDraggable as s, useScrollLock as c, useSignals as l } from "@cascivo/core";
|
|
5
|
+
import { builtin as u, t as d } from "@cascivo/i18n";
|
|
6
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
7
|
+
import { useId as m } from "react";
|
|
8
|
+
//#region ../components/src/bottom-sheet/bottom-sheet.tsx
|
|
9
|
+
var h = 120, g = .6, _ = .1, v = [.5, .92];
|
|
10
|
+
function y({ open: y, defaultOpen: b, onOpenChange: x, snapPoints: S = v, activeSnap: C, defaultSnap: w = 0, onSnapChange: T, title: E, description: D, children: O, labels: k, className: A }) {
|
|
11
|
+
l();
|
|
12
|
+
let [j, M] = o({
|
|
13
|
+
value: y,
|
|
14
|
+
defaultValue: b ?? !1,
|
|
15
|
+
onChange: x
|
|
16
|
+
}), [N, P] = o({
|
|
17
|
+
value: C,
|
|
18
|
+
defaultValue: w,
|
|
19
|
+
onChange: T
|
|
20
|
+
});
|
|
21
|
+
c(j);
|
|
22
|
+
let F = S, I = F[F.length - 1] ?? 1, L = F[0] ?? 0, R = F[Math.min(N.value, F.length - 1)] ?? I, { handleRef: z, offset: B, velocity: V, isDragging: H, reset: U } = s({
|
|
23
|
+
axis: "y",
|
|
24
|
+
onDragEnd: (e) => {
|
|
25
|
+
let t = typeof window > "u" ? 0 : window.innerHeight, n = V.value.y;
|
|
26
|
+
if (U(), t === 0) return;
|
|
27
|
+
let r = R - e.y / t - n * h / t;
|
|
28
|
+
if (n > g || r < L - _) {
|
|
29
|
+
M(!1);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
let i = 0;
|
|
33
|
+
for (let e = 1; e < F.length; e++) Math.abs((F[e] ?? 0) - r) < Math.abs((F[i] ?? 0) - r) && (i = e);
|
|
34
|
+
P(i);
|
|
35
|
+
}
|
|
36
|
+
}), W = m(), G = m(), K = k?.close ?? d(u.bottomSheet.close), q = k?.handle ?? d(u.bottomSheet.handle), J = `${(1 - R / I) * 100}%`, Y = {
|
|
37
|
+
"--_sheet-height": `${I * 100}dvh`,
|
|
38
|
+
"--_sheet-y": J,
|
|
39
|
+
"--_sheet-drag": `${B.value.y}px`
|
|
40
|
+
};
|
|
41
|
+
return /* @__PURE__ */ f(r, { children: /* @__PURE__ */ f(i, {
|
|
42
|
+
present: j,
|
|
43
|
+
children: /* @__PURE__ */ f("div", {
|
|
44
|
+
className: e.overlay,
|
|
45
|
+
children: /* @__PURE__ */ f(t, {
|
|
46
|
+
onDismiss: () => M(!1),
|
|
47
|
+
children: /* @__PURE__ */ f(n, {
|
|
48
|
+
trapped: !0,
|
|
49
|
+
restoreFocus: !0,
|
|
50
|
+
autoFocus: !0,
|
|
51
|
+
children: /* @__PURE__ */ p("div", {
|
|
52
|
+
role: "dialog",
|
|
53
|
+
"aria-modal": "true",
|
|
54
|
+
"aria-labelledby": E ? W : void 0,
|
|
55
|
+
"aria-describedby": D ? G : void 0,
|
|
56
|
+
"data-dragging": H.value ? "" : void 0,
|
|
57
|
+
className: a(e.panel, A),
|
|
58
|
+
style: Y,
|
|
59
|
+
children: [/* @__PURE__ */ p("div", {
|
|
60
|
+
className: e.header,
|
|
61
|
+
ref: z,
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ f("div", {
|
|
64
|
+
className: e.handle,
|
|
65
|
+
role: "separator",
|
|
66
|
+
"aria-label": q,
|
|
67
|
+
"aria-orientation": "horizontal"
|
|
68
|
+
}),
|
|
69
|
+
(E || D) && /* @__PURE__ */ p("div", {
|
|
70
|
+
className: e.heading,
|
|
71
|
+
children: [E && /* @__PURE__ */ f("h2", {
|
|
72
|
+
id: W,
|
|
73
|
+
className: e.title,
|
|
74
|
+
children: E
|
|
75
|
+
}), D && /* @__PURE__ */ f("p", {
|
|
76
|
+
id: G,
|
|
77
|
+
className: e.description,
|
|
78
|
+
children: D
|
|
79
|
+
})]
|
|
80
|
+
}),
|
|
81
|
+
/* @__PURE__ */ f("button", {
|
|
82
|
+
type: "button",
|
|
83
|
+
"aria-label": K,
|
|
84
|
+
onClick: () => M(!1),
|
|
85
|
+
className: e.close,
|
|
86
|
+
children: /* @__PURE__ */ f("svg", {
|
|
87
|
+
"aria-hidden": "true",
|
|
88
|
+
viewBox: "0 0 16 16",
|
|
89
|
+
className: e.closeIcon,
|
|
90
|
+
children: /* @__PURE__ */ f("path", {
|
|
91
|
+
d: "M4 4l8 8M12 4l-8 8",
|
|
92
|
+
fill: "none",
|
|
93
|
+
stroke: "currentColor",
|
|
94
|
+
strokeWidth: "1.5",
|
|
95
|
+
strokeLinecap: "round"
|
|
96
|
+
})
|
|
97
|
+
})
|
|
98
|
+
})
|
|
99
|
+
]
|
|
100
|
+
}), /* @__PURE__ */ f("div", {
|
|
101
|
+
className: e.body,
|
|
102
|
+
children: O
|
|
103
|
+
})]
|
|
104
|
+
})
|
|
105
|
+
})
|
|
106
|
+
})
|
|
107
|
+
})
|
|
108
|
+
}) });
|
|
109
|
+
}
|
|
110
|
+
//#endregion
|
|
111
|
+
export { y as BottomSheet };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
var e = {
|
|
4
|
+
overlay: "_overlay_k9sg5_2",
|
|
5
|
+
panel: "_panel_k9sg5_25",
|
|
6
|
+
header: "_header_k9sg5_59",
|
|
7
|
+
handle: "_handle_k9sg5_77",
|
|
8
|
+
heading: "_heading_k9sg5_87",
|
|
9
|
+
title: "_title_k9sg5_93",
|
|
10
|
+
description: "_description_k9sg5_100",
|
|
11
|
+
close: "_close_k9sg5_106",
|
|
12
|
+
closeIcon: "_closeIcon_k9sg5_140",
|
|
13
|
+
body: "_body_k9sg5_145"
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { e as default };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./breadcrumb.module.js";
|
|
4
|
+
import { cn as t, getLinkComponent as n, useSignals as r } from "@cascivo/core";
|
|
5
|
+
import { builtin as i, t as a } from "@cascivo/i18n";
|
|
6
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
7
|
+
//#region ../components/src/breadcrumb/breadcrumb.tsx
|
|
8
|
+
function s({ items: s, maxVisible: c, className: l, ariaLabel: u }) {
|
|
9
|
+
r();
|
|
10
|
+
let d = n(), f = u ?? a(i.breadcrumb.nav), p = s, m = s[0];
|
|
11
|
+
return m !== void 0 && c !== void 0 && s.length > c && (p = [
|
|
12
|
+
m,
|
|
13
|
+
{ label: "…" },
|
|
14
|
+
...s.slice(s.length - (c - 2))
|
|
15
|
+
]), /* @__PURE__ */ o("nav", {
|
|
16
|
+
"aria-label": f,
|
|
17
|
+
className: t(e.breadcrumb, l),
|
|
18
|
+
children: /* @__PURE__ */ o("ol", { children: p.map((e, t) => /* @__PURE__ */ o("li", { children: t === p.length - 1 ? /* @__PURE__ */ o("span", {
|
|
19
|
+
"aria-current": "page",
|
|
20
|
+
children: e.label
|
|
21
|
+
}) : e.href === void 0 ? /* @__PURE__ */ o("span", { children: e.label }) : /* @__PURE__ */ o(d, {
|
|
22
|
+
href: e.href,
|
|
23
|
+
children: e.label
|
|
24
|
+
}) }, `${t}-${e.label}`)) })
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { s as Breadcrumb };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Spinner as e } from "../spinner/spinner.js";
|
|
4
|
+
import t from "./button.module.js";
|
|
5
|
+
import { Slot as n, cn as r } from "@cascivo/core";
|
|
6
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
7
|
+
//#region ../components/src/button/button.tsx
|
|
8
|
+
function o({ variant: o = "primary", size: s = "md", loading: c = !1, asChild: l = !1, className: u, disabled: d, children: f, ...p }) {
|
|
9
|
+
let m = {
|
|
10
|
+
"data-variant": o,
|
|
11
|
+
"data-size": s,
|
|
12
|
+
"data-state": c ? "loading" : "idle",
|
|
13
|
+
"aria-busy": c || void 0,
|
|
14
|
+
className: r(t.button, u)
|
|
15
|
+
};
|
|
16
|
+
return l ? /* @__PURE__ */ i(n, {
|
|
17
|
+
...m,
|
|
18
|
+
...p,
|
|
19
|
+
children: f
|
|
20
|
+
}) : /* @__PURE__ */ a("button", {
|
|
21
|
+
...m,
|
|
22
|
+
disabled: d || c,
|
|
23
|
+
...p,
|
|
24
|
+
children: [c && /* @__PURE__ */ i(e, {
|
|
25
|
+
size: "sm",
|
|
26
|
+
"aria-hidden": "true"
|
|
27
|
+
}), /* @__PURE__ */ i("span", { children: f })]
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { o as Button };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./button-group.module.js";
|
|
4
|
+
import { cn as t } from "@cascivo/core";
|
|
5
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
6
|
+
import { forwardRef as r } from "react";
|
|
7
|
+
//#region ../components/src/button-group/button-group.tsx
|
|
8
|
+
function i(e) {
|
|
9
|
+
return Array.from(e.querySelectorAll("button, a[href], [tabindex]")).filter((e) => !e.hasAttribute("disabled") && e.getAttribute("aria-disabled") !== "true");
|
|
10
|
+
}
|
|
11
|
+
var a = r(function({ orientation: r = "horizontal", size: a = "md", roving: o = !1, loop: s = !1, className: c, onKeyDown: l, children: u, ...d }, f) {
|
|
12
|
+
return /* @__PURE__ */ n("div", {
|
|
13
|
+
role: "group",
|
|
14
|
+
"data-orientation": r,
|
|
15
|
+
"data-size": a,
|
|
16
|
+
className: t(e.buttonGroup, c),
|
|
17
|
+
ref: f,
|
|
18
|
+
onKeyDown: (e) => {
|
|
19
|
+
if (l?.(e), !o) return;
|
|
20
|
+
let t = r === "horizontal", n = t ? "ArrowRight" : "ArrowDown", a = t ? "ArrowLeft" : "ArrowUp";
|
|
21
|
+
if (![
|
|
22
|
+
n,
|
|
23
|
+
a,
|
|
24
|
+
"Home",
|
|
25
|
+
"End"
|
|
26
|
+
].includes(e.key)) return;
|
|
27
|
+
let c = i(e.currentTarget);
|
|
28
|
+
if (c.length === 0) return;
|
|
29
|
+
let u = c.indexOf(document.activeElement);
|
|
30
|
+
if (u === -1) return;
|
|
31
|
+
let d = u;
|
|
32
|
+
e.key === n ? d = u + 1 : e.key === a ? d = u - 1 : e.key === "Home" ? d = 0 : e.key === "End" && (d = c.length - 1), d < 0 && (d = s ? c.length - 1 : 0), d >= c.length && (d = s ? 0 : c.length - 1), e.preventDefault(), c[d]?.focus();
|
|
33
|
+
},
|
|
34
|
+
...d,
|
|
35
|
+
children: u
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
//#endregion
|
|
39
|
+
export { a as ButtonGroup };
|