@cascivo/react 0.9.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 +5 -5
- package/dist/command-menu/command-menu.js +2 -2
- package/dist/field/field.js +24 -15
- package/dist/index.d.ts +13 -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/react/src/theme.js +35 -29
- package/package.json +3 -2
- package/readme.body.md +5 -5
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./carousel.module.js";
|
|
4
|
+
import { cn as t, useControllableSignal as n, useRovingFocus as r, useSignalEffect as i, useSignals as a } from "@cascivo/core";
|
|
5
|
+
import { builtin as o, t as s } from "@cascivo/i18n";
|
|
6
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
7
|
+
import { useId as u, useRef as d } from "react";
|
|
8
|
+
//#region ../components/src/carousel/carousel.tsx
|
|
9
|
+
function f(e, t) {
|
|
10
|
+
return t || (e == null ? [] : Array.isArray(e) ? e : [e]);
|
|
11
|
+
}
|
|
12
|
+
function p({ children: p, slides: m, index: h, defaultIndex: g, onIndexChange: _, loop: v = !1, className: y, labels: b }) {
|
|
13
|
+
a();
|
|
14
|
+
let x = u(), S = f(p, m), C = S.length, [w, T] = n({
|
|
15
|
+
value: h,
|
|
16
|
+
defaultValue: g ?? 0,
|
|
17
|
+
onChange: _
|
|
18
|
+
}), E = d(null), D = d([]), O = d(!1), { getItemProps: k, setActiveIndex: A } = r({
|
|
19
|
+
orientation: "horizontal",
|
|
20
|
+
loop: v
|
|
21
|
+
});
|
|
22
|
+
i(() => {
|
|
23
|
+
let e = E.current;
|
|
24
|
+
if (!e) return;
|
|
25
|
+
let t = () => {
|
|
26
|
+
if (O.current) return;
|
|
27
|
+
let t = Math.round(e.scrollLeft / e.clientWidth);
|
|
28
|
+
t !== w.value && T(t);
|
|
29
|
+
};
|
|
30
|
+
return e.addEventListener("scroll", t, { passive: !0 }), () => e.removeEventListener("scroll", t);
|
|
31
|
+
});
|
|
32
|
+
let j = (e) => {
|
|
33
|
+
if (C === 0) return;
|
|
34
|
+
let t = e;
|
|
35
|
+
t < 0 && (t = v ? C - 1 : 0), t >= C && (t = v ? 0 : C - 1);
|
|
36
|
+
let n = E.current;
|
|
37
|
+
n && typeof n.scrollTo == "function" && (O.current = !0, n.scrollTo({
|
|
38
|
+
left: t * n.clientWidth,
|
|
39
|
+
behavior: "smooth"
|
|
40
|
+
}), window.setTimeout(() => {
|
|
41
|
+
O.current = !1;
|
|
42
|
+
}, 400)), T(t), A(t);
|
|
43
|
+
}, M = b?.region ?? s(o.carousel.region), N = b?.previous ?? s(o.carousel.previous), P = b?.next ?? s(o.carousel.next);
|
|
44
|
+
return /* @__PURE__ */ l("section", {
|
|
45
|
+
className: t(e.carousel, y),
|
|
46
|
+
"aria-roledescription": "carousel",
|
|
47
|
+
"aria-label": M,
|
|
48
|
+
children: [/* @__PURE__ */ l("div", {
|
|
49
|
+
className: e.viewport,
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ c("button", {
|
|
52
|
+
type: "button",
|
|
53
|
+
className: t(e.nav, e.prev),
|
|
54
|
+
"aria-label": N,
|
|
55
|
+
"aria-controls": `${x}-track`,
|
|
56
|
+
disabled: !v && w.value <= 0,
|
|
57
|
+
onClick: () => j(w.value - 1),
|
|
58
|
+
children: /* @__PURE__ */ c("svg", {
|
|
59
|
+
width: "20",
|
|
60
|
+
height: "20",
|
|
61
|
+
viewBox: "0 0 24 24",
|
|
62
|
+
fill: "none",
|
|
63
|
+
"aria-hidden": "true",
|
|
64
|
+
children: /* @__PURE__ */ c("path", {
|
|
65
|
+
d: "m15 18-6-6 6-6",
|
|
66
|
+
stroke: "currentColor",
|
|
67
|
+
strokeWidth: "2",
|
|
68
|
+
strokeLinecap: "round",
|
|
69
|
+
strokeLinejoin: "round"
|
|
70
|
+
})
|
|
71
|
+
})
|
|
72
|
+
}),
|
|
73
|
+
/* @__PURE__ */ c("div", {
|
|
74
|
+
ref: E,
|
|
75
|
+
id: `${x}-track`,
|
|
76
|
+
className: e.track,
|
|
77
|
+
children: S.map((t, n) => /* @__PURE__ */ c("div", {
|
|
78
|
+
ref: (e) => {
|
|
79
|
+
D.current[n] = e;
|
|
80
|
+
},
|
|
81
|
+
className: e.slide,
|
|
82
|
+
role: "group",
|
|
83
|
+
"aria-roledescription": "slide",
|
|
84
|
+
"aria-label": s(o.carousel.slide, {
|
|
85
|
+
n: n + 1,
|
|
86
|
+
total: C
|
|
87
|
+
}),
|
|
88
|
+
"aria-hidden": n !== w.value || void 0,
|
|
89
|
+
children: t
|
|
90
|
+
}, n))
|
|
91
|
+
}),
|
|
92
|
+
/* @__PURE__ */ c("button", {
|
|
93
|
+
type: "button",
|
|
94
|
+
className: t(e.nav, e.next),
|
|
95
|
+
"aria-label": P,
|
|
96
|
+
"aria-controls": `${x}-track`,
|
|
97
|
+
disabled: !v && w.value >= C - 1,
|
|
98
|
+
onClick: () => j(w.value + 1),
|
|
99
|
+
children: /* @__PURE__ */ c("svg", {
|
|
100
|
+
width: "20",
|
|
101
|
+
height: "20",
|
|
102
|
+
viewBox: "0 0 24 24",
|
|
103
|
+
fill: "none",
|
|
104
|
+
"aria-hidden": "true",
|
|
105
|
+
children: /* @__PURE__ */ c("path", {
|
|
106
|
+
d: "m9 18 6-6-6-6",
|
|
107
|
+
stroke: "currentColor",
|
|
108
|
+
strokeWidth: "2",
|
|
109
|
+
strokeLinecap: "round",
|
|
110
|
+
strokeLinejoin: "round"
|
|
111
|
+
})
|
|
112
|
+
})
|
|
113
|
+
})
|
|
114
|
+
]
|
|
115
|
+
}), /* @__PURE__ */ c("div", {
|
|
116
|
+
className: e.dots,
|
|
117
|
+
role: "group",
|
|
118
|
+
"aria-label": M,
|
|
119
|
+
children: S.map((t, n) => {
|
|
120
|
+
let r = k(n);
|
|
121
|
+
return /* @__PURE__ */ c("button", {
|
|
122
|
+
ref: r.ref,
|
|
123
|
+
type: "button",
|
|
124
|
+
className: e.dot,
|
|
125
|
+
"aria-label": s(o.carousel.goTo, { n: n + 1 }),
|
|
126
|
+
"aria-current": n === w.value || void 0,
|
|
127
|
+
"data-active": n === w.value || void 0,
|
|
128
|
+
tabIndex: r.tabIndex,
|
|
129
|
+
onKeyDown: r.onKeyDown,
|
|
130
|
+
onFocus: r.onFocus,
|
|
131
|
+
onClick: () => j(n)
|
|
132
|
+
}, n);
|
|
133
|
+
})
|
|
134
|
+
})]
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
//#endregion
|
|
138
|
+
export { p as Carousel };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
var e = {
|
|
4
|
+
carousel: "_carousel_1dvrl_2",
|
|
5
|
+
viewport: "_viewport_1dvrl_9",
|
|
6
|
+
track: "_track_1dvrl_15",
|
|
7
|
+
slide: "_slide_1dvrl_28",
|
|
8
|
+
nav: "_nav_1dvrl_35",
|
|
9
|
+
prev: "_prev_1dvrl_65",
|
|
10
|
+
next: "_next_1dvrl_69",
|
|
11
|
+
dots: "_dots_1dvrl_73",
|
|
12
|
+
dot: "_dot_1dvrl_73"
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { e as default };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./chat-bubble.module.js";
|
|
4
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
5
|
+
//#region ../components/src/chat-bubble/chat-bubble.tsx
|
|
6
|
+
function r({ children: r, side: i = "start", avatar: a, name: o, time: s, className: c }) {
|
|
7
|
+
return /* @__PURE__ */ n("div", {
|
|
8
|
+
className: [e.bubble, c].filter(Boolean).join(" "),
|
|
9
|
+
"data-side": i,
|
|
10
|
+
children: [a && /* @__PURE__ */ t("div", {
|
|
11
|
+
className: e.avatar,
|
|
12
|
+
"aria-hidden": "true",
|
|
13
|
+
children: a
|
|
14
|
+
}), /* @__PURE__ */ n("div", {
|
|
15
|
+
className: e.content,
|
|
16
|
+
children: [(o || s) && /* @__PURE__ */ n("div", {
|
|
17
|
+
className: e.meta,
|
|
18
|
+
children: [o && /* @__PURE__ */ t("span", {
|
|
19
|
+
className: e.name,
|
|
20
|
+
children: o
|
|
21
|
+
}), s && /* @__PURE__ */ t("time", {
|
|
22
|
+
className: e.time,
|
|
23
|
+
children: s
|
|
24
|
+
})]
|
|
25
|
+
}), /* @__PURE__ */ t("div", {
|
|
26
|
+
className: e.body,
|
|
27
|
+
children: r
|
|
28
|
+
})]
|
|
29
|
+
})]
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { r as ChatBubble };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
var e = {
|
|
4
|
+
bubble: "_bubble_ykkyv_2",
|
|
5
|
+
avatar: "_avatar_ykkyv_18",
|
|
6
|
+
content: "_content_ykkyv_23",
|
|
7
|
+
meta: "_meta_ykkyv_32",
|
|
8
|
+
name: "_name_ykkyv_40",
|
|
9
|
+
time: "_time_ykkyv_44",
|
|
10
|
+
body: "_body_ykkyv_48"
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { e as default };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./checkbox.module.js";
|
|
4
|
+
import { cn as t, useSignal as n, useSignalEffect as r } from "@cascivo/core";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import { useRef as o } from "react";
|
|
7
|
+
//#region ../components/src/checkbox/checkbox.tsx
|
|
8
|
+
function s({ label: s, indeterminate: c = !1, className: l, id: u, disabled: d, ...f }) {
|
|
9
|
+
let p = o(null), m = n(c);
|
|
10
|
+
m.value = c, r(() => {
|
|
11
|
+
p.current && (p.current.indeterminate = m.value);
|
|
12
|
+
});
|
|
13
|
+
let h = u ?? (s ? `cascade-checkbox-${s.toLowerCase().replace(/\s+/g, "-")}` : void 0);
|
|
14
|
+
return /* @__PURE__ */ a("label", {
|
|
15
|
+
className: t(e.wrapper, l),
|
|
16
|
+
"data-disabled": d || void 0,
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ i("input", {
|
|
19
|
+
ref: p,
|
|
20
|
+
id: h,
|
|
21
|
+
type: "checkbox",
|
|
22
|
+
className: e.input,
|
|
23
|
+
disabled: d,
|
|
24
|
+
...f
|
|
25
|
+
}),
|
|
26
|
+
/* @__PURE__ */ i("span", {
|
|
27
|
+
className: e.control,
|
|
28
|
+
"aria-hidden": "true"
|
|
29
|
+
}),
|
|
30
|
+
s && /* @__PURE__ */ i("span", {
|
|
31
|
+
className: e.label,
|
|
32
|
+
children: s
|
|
33
|
+
})
|
|
34
|
+
]
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { s as Checkbox };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./checkbox-card.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/checkbox-card/checkbox-card.tsx
|
|
7
|
+
function i({ title: i, description: a, checked: o, defaultChecked: s, disabled: c, onCheckedChange: l, className: u, ...d }) {
|
|
8
|
+
return /* @__PURE__ */ r("label", {
|
|
9
|
+
className: t(e.card, u),
|
|
10
|
+
"data-disabled": c || void 0,
|
|
11
|
+
children: [
|
|
12
|
+
/* @__PURE__ */ n("input", {
|
|
13
|
+
type: "checkbox",
|
|
14
|
+
className: e.input,
|
|
15
|
+
disabled: c,
|
|
16
|
+
...o === void 0 ? { defaultChecked: s } : { checked: o },
|
|
17
|
+
onChange: (e) => l?.(e.currentTarget.checked),
|
|
18
|
+
...d
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ n("span", {
|
|
21
|
+
className: e.glyph,
|
|
22
|
+
"aria-hidden": "true",
|
|
23
|
+
children: /* @__PURE__ */ n("svg", {
|
|
24
|
+
viewBox: "0 0 12 12",
|
|
25
|
+
className: e.check,
|
|
26
|
+
children: /* @__PURE__ */ n("path", {
|
|
27
|
+
d: "M2.5 6.5 5 9l4.5-5.5",
|
|
28
|
+
fill: "none",
|
|
29
|
+
stroke: "currentColor",
|
|
30
|
+
strokeWidth: "1.5"
|
|
31
|
+
})
|
|
32
|
+
})
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ r("span", {
|
|
35
|
+
className: e.body,
|
|
36
|
+
children: [/* @__PURE__ */ n("span", {
|
|
37
|
+
className: e.title,
|
|
38
|
+
children: i
|
|
39
|
+
}), a && /* @__PURE__ */ n("span", {
|
|
40
|
+
className: e.description,
|
|
41
|
+
children: a
|
|
42
|
+
})]
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { i as CheckboxCard };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
var e = {
|
|
4
|
+
card: "_card_102u6_2",
|
|
5
|
+
input: "_input_102u6_34",
|
|
6
|
+
glyph: "_glyph_102u6_43",
|
|
7
|
+
check: "_check_102u6_62",
|
|
8
|
+
body: "_body_102u6_67",
|
|
9
|
+
title: "_title_102u6_73",
|
|
10
|
+
description: "_description_102u6_79"
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { e as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./code.module.js";
|
|
4
|
+
import { cn as t } from "@cascivo/core";
|
|
5
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
6
|
+
//#region ../components/src/code/code.tsx
|
|
7
|
+
function r({ size: r = "md", className: i, children: a, ...o }) {
|
|
8
|
+
return /* @__PURE__ */ n("code", {
|
|
9
|
+
"data-size": r,
|
|
10
|
+
className: t(e.code, i),
|
|
11
|
+
...o,
|
|
12
|
+
children: a
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { r as Code };
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { tokenize as e } from "./highlight.js";
|
|
4
|
+
import t from "./code-snippet.module.js";
|
|
5
|
+
import { cn as n, useClipboard as r, useSignals as i } from "@cascivo/core";
|
|
6
|
+
import { builtin as a, t as o } from "@cascivo/i18n";
|
|
7
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
|
+
//#region ../components/src/code-snippet/code-snippet.tsx
|
|
9
|
+
function l({ code: n, language: r }) {
|
|
10
|
+
return /* @__PURE__ */ s("code", {
|
|
11
|
+
className: t.code,
|
|
12
|
+
children: e(n, r).map((e, t) => e.type === "text" ? /* @__PURE__ */ s("span", { children: e.value }, t) : /* @__PURE__ */ s("span", {
|
|
13
|
+
"data-tok": e.type,
|
|
14
|
+
children: e.value
|
|
15
|
+
}, t))
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function u({ code: e, variant: u = "single", language: d, terminal: f = !1, title: p, showLineNumbers: m, showCopyButton: h, labels: g, className: _ }) {
|
|
19
|
+
i();
|
|
20
|
+
let { copied: v, copy: y } = r(), b = g?.copy ?? o(a.codeSnippet.copy), x = g?.copied ?? o(a.codeSnippet.copied), S = h ?? u !== "inline" ? /* @__PURE__ */ s("button", {
|
|
21
|
+
type: "button",
|
|
22
|
+
"aria-label": v.value ? x : b,
|
|
23
|
+
"data-state": v.value ? "copied" : "idle",
|
|
24
|
+
className: t.copy,
|
|
25
|
+
onClick: () => void y(e),
|
|
26
|
+
children: v.value ? /* @__PURE__ */ s("svg", {
|
|
27
|
+
"aria-hidden": "true",
|
|
28
|
+
viewBox: "0 0 16 16",
|
|
29
|
+
className: t.icon,
|
|
30
|
+
children: /* @__PURE__ */ s("path", {
|
|
31
|
+
d: "M13.5 4.5 6 12 2.5 8.5",
|
|
32
|
+
fill: "none",
|
|
33
|
+
stroke: "currentColor",
|
|
34
|
+
strokeWidth: "1.5",
|
|
35
|
+
strokeLinecap: "round",
|
|
36
|
+
strokeLinejoin: "round"
|
|
37
|
+
})
|
|
38
|
+
}) : /* @__PURE__ */ c("svg", {
|
|
39
|
+
"aria-hidden": "true",
|
|
40
|
+
viewBox: "0 0 16 16",
|
|
41
|
+
className: t.icon,
|
|
42
|
+
children: [/* @__PURE__ */ s("rect", {
|
|
43
|
+
x: "5.5",
|
|
44
|
+
y: "5.5",
|
|
45
|
+
width: "8",
|
|
46
|
+
height: "8",
|
|
47
|
+
rx: "1.5",
|
|
48
|
+
fill: "none",
|
|
49
|
+
stroke: "currentColor",
|
|
50
|
+
strokeWidth: "1.5"
|
|
51
|
+
}), /* @__PURE__ */ s("path", {
|
|
52
|
+
d: "M3.5 10.5h-1a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1h7a1 1 0 0 1 1 1v1",
|
|
53
|
+
fill: "none",
|
|
54
|
+
stroke: "currentColor",
|
|
55
|
+
strokeWidth: "1.5"
|
|
56
|
+
})]
|
|
57
|
+
})
|
|
58
|
+
}) : null;
|
|
59
|
+
if (u === "inline") return /* @__PURE__ */ c("span", {
|
|
60
|
+
className: n(t.root, _),
|
|
61
|
+
"data-variant": "inline",
|
|
62
|
+
children: [/* @__PURE__ */ s("code", {
|
|
63
|
+
className: t.inlineCode,
|
|
64
|
+
children: e
|
|
65
|
+
}), S]
|
|
66
|
+
});
|
|
67
|
+
let C = e.split("\n"), w = u === "multi" && m && !d;
|
|
68
|
+
return /* @__PURE__ */ c("div", {
|
|
69
|
+
className: n(t.root, _),
|
|
70
|
+
"data-variant": u,
|
|
71
|
+
"data-terminal": f ? "" : void 0,
|
|
72
|
+
children: [
|
|
73
|
+
f && /* @__PURE__ */ c("div", {
|
|
74
|
+
className: t.bar,
|
|
75
|
+
"aria-hidden": "true",
|
|
76
|
+
children: [/* @__PURE__ */ c("span", {
|
|
77
|
+
className: t.dots,
|
|
78
|
+
children: [
|
|
79
|
+
/* @__PURE__ */ s("span", { className: t.dot }),
|
|
80
|
+
/* @__PURE__ */ s("span", { className: t.dot }),
|
|
81
|
+
/* @__PURE__ */ s("span", { className: t.dot })
|
|
82
|
+
]
|
|
83
|
+
}), p && /* @__PURE__ */ s("span", {
|
|
84
|
+
className: t.title,
|
|
85
|
+
children: p
|
|
86
|
+
})]
|
|
87
|
+
}),
|
|
88
|
+
/* @__PURE__ */ s("pre", {
|
|
89
|
+
className: t.pre,
|
|
90
|
+
children: w ? /* @__PURE__ */ s("code", {
|
|
91
|
+
className: t.code,
|
|
92
|
+
children: C.map((e, n) => /* @__PURE__ */ c("span", {
|
|
93
|
+
className: t.line,
|
|
94
|
+
children: [/* @__PURE__ */ s("span", {
|
|
95
|
+
"aria-hidden": "true",
|
|
96
|
+
className: t.lineNumber,
|
|
97
|
+
children: n + 1
|
|
98
|
+
}), /* @__PURE__ */ s("span", {
|
|
99
|
+
className: t.lineText,
|
|
100
|
+
children: e
|
|
101
|
+
})]
|
|
102
|
+
}, n))
|
|
103
|
+
}) : d ? /* @__PURE__ */ s(l, {
|
|
104
|
+
code: e,
|
|
105
|
+
language: d
|
|
106
|
+
}) : /* @__PURE__ */ s("code", {
|
|
107
|
+
className: t.code,
|
|
108
|
+
children: e
|
|
109
|
+
})
|
|
110
|
+
}),
|
|
111
|
+
S
|
|
112
|
+
]
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
//#endregion
|
|
116
|
+
export { u as CodeSnippet };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
var e = {
|
|
4
|
+
root: "_root_4lyzf_2",
|
|
5
|
+
inlineCode: "_inlineCode_4lyzf_12",
|
|
6
|
+
pre: "_pre_4lyzf_23",
|
|
7
|
+
code: "_code_4lyzf_44",
|
|
8
|
+
line: "_line_4lyzf_49",
|
|
9
|
+
lineNumber: "_lineNumber_4lyzf_54",
|
|
10
|
+
lineText: "_lineText_4lyzf_62",
|
|
11
|
+
copy: "_copy_4lyzf_66",
|
|
12
|
+
icon: "_icon_4lyzf_106",
|
|
13
|
+
bar: "_bar_4lyzf_153",
|
|
14
|
+
dots: "_dots_4lyzf_163",
|
|
15
|
+
dot: "_dot_4lyzf_163",
|
|
16
|
+
title: "_title_4lyzf_187"
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { e as default };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
//#region ../components/src/code-snippet/highlight.ts
|
|
4
|
+
function e(e) {
|
|
5
|
+
return e.map(([e, t]) => ({
|
|
6
|
+
type: e,
|
|
7
|
+
re: RegExp(`^(?:${t})`)
|
|
8
|
+
}));
|
|
9
|
+
}
|
|
10
|
+
var t = "\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'", n = "`(?:[^`\\\\]|\\\\.)*`", r = "const|let|var|function|return|if|else|for|while|do|switch|case|break|continue|new|class|extends|super|import|export|from|default|async|await|yield|typeof|instanceof|in|of|void|delete|this|null|true|false|undefined", i = `${r}|interface|type|as|readonly|enum|implements|public|private|protected|abstract|namespace|declare|satisfies|keyof|infer|is|string|number|boolean|unknown|never|any`, a = {
|
|
11
|
+
bash: e([
|
|
12
|
+
["comment", "#[^\\n]*"],
|
|
13
|
+
["string", t],
|
|
14
|
+
["prompt", "\\$(?= )"],
|
|
15
|
+
["keyword", "\\b(?:npx|npm|pnpm|yarn|bun|deno|node|git|cd|ls|cat|echo|export|sudo|mkdir|rm|cp|mv|curl|wget|chmod|source)\\b"],
|
|
16
|
+
["variable", "--?[A-Za-z][\\w-]*"],
|
|
17
|
+
["number", "\\b\\d+(?:\\.\\d+)?\\b"]
|
|
18
|
+
]),
|
|
19
|
+
css: e([
|
|
20
|
+
["comment", "/\\*[\\s\\S]*?\\*/"],
|
|
21
|
+
["string", t],
|
|
22
|
+
["keyword", "@[\\w-]+"],
|
|
23
|
+
["variable", "--[\\w-]+"],
|
|
24
|
+
["fn", "[\\w-]+(?=\\()"],
|
|
25
|
+
["number", "#[0-9a-fA-F]{3,8}\\b|-?\\d*\\.?\\d+(?:[a-z%]+)?"],
|
|
26
|
+
["punct", "[{}();:,]"]
|
|
27
|
+
]),
|
|
28
|
+
js: e([
|
|
29
|
+
["comment", "//[^\\n]*|/\\*[\\s\\S]*?\\*/"],
|
|
30
|
+
["string", `${t}|${n}`],
|
|
31
|
+
["keyword", `\\b(?:${r})\\b`],
|
|
32
|
+
["fn", "[A-Za-z_$][\\w$]*(?=\\()"],
|
|
33
|
+
["number", "-?\\d*\\.?\\d+"],
|
|
34
|
+
["punct", "[{}()\\[\\];:,.]|=>"]
|
|
35
|
+
]),
|
|
36
|
+
ts: e([
|
|
37
|
+
["comment", "//[^\\n]*|/\\*[\\s\\S]*?\\*/"],
|
|
38
|
+
["string", `${t}|${n}`],
|
|
39
|
+
["keyword", `\\b(?:${i})\\b`],
|
|
40
|
+
["fn", "[A-Za-z_$][\\w$]*(?=\\()"],
|
|
41
|
+
["number", "-?\\d*\\.?\\d+"],
|
|
42
|
+
["punct", "[{}()\\[\\];:,.]|=>"]
|
|
43
|
+
])
|
|
44
|
+
};
|
|
45
|
+
function o(e, t) {
|
|
46
|
+
let n = a[t], r = [], i = e, o = "", s = () => {
|
|
47
|
+
o &&= (r.push({
|
|
48
|
+
type: "text",
|
|
49
|
+
value: o
|
|
50
|
+
}), "");
|
|
51
|
+
};
|
|
52
|
+
for (; i.length > 0;) {
|
|
53
|
+
let e = !1;
|
|
54
|
+
for (let { type: t, re: a } of n) {
|
|
55
|
+
let n = a.exec(i);
|
|
56
|
+
if (n && n[0].length > 0) {
|
|
57
|
+
s(), r.push({
|
|
58
|
+
type: t,
|
|
59
|
+
value: n[0]
|
|
60
|
+
}), i = i.slice(n[0].length), e = !0;
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
e || (o += i[0], i = i.slice(1));
|
|
65
|
+
}
|
|
66
|
+
return s(), r;
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
export { o as tokenize };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import e from "./collapsible.module.js";
|
|
4
|
+
import { cn as t, useControllableSignal as n, useSignals as r } from "@cascivo/core";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import { useId as o } from "react";
|
|
7
|
+
//#region ../components/src/collapsible/collapsible.tsx
|
|
8
|
+
function s({ open: s, defaultOpen: c = !1, onOpenChange: l, trigger: u, disabled: d = !1, className: f, children: p }) {
|
|
9
|
+
r();
|
|
10
|
+
let [m, h] = n({
|
|
11
|
+
...s === void 0 ? {} : { value: s },
|
|
12
|
+
defaultValue: c,
|
|
13
|
+
...l ? { onChange: l } : {}
|
|
14
|
+
}), g = o(), _ = `${g}-content`, v = `${g}-trigger`, y = m.value;
|
|
15
|
+
return /* @__PURE__ */ a("div", {
|
|
16
|
+
"data-state": y ? "open" : "closed",
|
|
17
|
+
className: t(e.root, f),
|
|
18
|
+
children: [/* @__PURE__ */ i("button", {
|
|
19
|
+
type: "button",
|
|
20
|
+
id: v,
|
|
21
|
+
"aria-expanded": y,
|
|
22
|
+
"aria-controls": _,
|
|
23
|
+
disabled: d,
|
|
24
|
+
"data-state": y ? "open" : "closed",
|
|
25
|
+
className: e.trigger,
|
|
26
|
+
onClick: () => h(!y),
|
|
27
|
+
children: u
|
|
28
|
+
}), /* @__PURE__ */ i("div", {
|
|
29
|
+
id: _,
|
|
30
|
+
role: "region",
|
|
31
|
+
"aria-labelledby": v,
|
|
32
|
+
"data-state": y ? "open" : "closed",
|
|
33
|
+
className: e.content,
|
|
34
|
+
children: /* @__PURE__ */ i("div", {
|
|
35
|
+
className: e.contentInner,
|
|
36
|
+
children: p
|
|
37
|
+
})
|
|
38
|
+
})]
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { s as Collapsible };
|