@cascivo/react 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion/accordion.js +46 -44
- package/dist/action-sheet/action-sheet.js +16 -16
- package/dist/alert-dialog/alert-dialog.js +34 -34
- package/dist/app-shell/app-shell.css +1 -1
- package/dist/app-shell/app-shell.js +14 -12
- package/dist/app-shell/app-shell.module.js +8 -8
- package/dist/avatar-group/avatar-group.js +6 -6
- package/dist/bottom-sheet/bottom-sheet.js +18 -18
- package/dist/button/button.js +15 -12
- package/dist/button-group/button-group.js +8 -8
- package/dist/carousel/carousel.js +20 -20
- package/dist/checkbox/checkbox.js +21 -21
- package/dist/checkbox-card/checkbox-card.js +15 -13
- package/dist/collapsible/collapsible.js +7 -7
- package/dist/color-picker/color-picker.js +26 -26
- package/dist/combobox/combobox.js +86 -86
- package/dist/command-menu/command-menu.js +111 -111
- package/dist/comparison/comparison.js +10 -10
- package/dist/context-menu/context-menu.js +9 -9
- package/dist/copy-button/copy-button.js +18 -16
- package/dist/data-table/data-table.js +1 -1
- package/dist/date-picker/date-picker.js +25 -25
- package/dist/date-range-picker/date-range-picker.js +26 -26
- package/dist/drawer/drawer.css +1 -1
- package/dist/drawer/drawer.js +18 -17
- package/dist/drawer/drawer.module.js +9 -9
- package/dist/dropdown/dropdown.js +48 -48
- package/dist/editable/editable.js +11 -11
- package/dist/fab/fab.js +53 -53
- package/dist/field/field.js +8 -8
- package/dist/file-uploader/file-uploader.js +19 -19
- package/dist/header-panel/header-panel.js +31 -31
- package/dist/hover-card/hover-card.js +21 -21
- package/dist/icon-button/icon-button.js +5 -5
- package/dist/index.d.ts +233 -194
- package/dist/input/input.js +22 -21
- package/dist/link/link.js +8 -6
- package/dist/log-viewer/log-viewer.js +26 -26
- package/dist/menu/menu.js +20 -20
- package/dist/menu-button/menu-button.js +48 -48
- package/dist/menubar/menubar.js +42 -42
- package/dist/modal/modal.css +1 -1
- package/dist/modal/modal.js +41 -35
- package/dist/modal/modal.module.js +8 -7
- package/dist/multi-select/multi-select.css +1 -1
- package/dist/multi-select/multi-select.js +57 -57
- package/dist/multi-select/multi-select.module.js +11 -11
- package/dist/native-select/native-select.js +13 -11
- package/dist/navigation-menu/navigation-menu.js +46 -46
- package/dist/node/accordion/accordion.js +46 -44
- package/dist/node/action-sheet/action-sheet.js +16 -16
- package/dist/node/alert-dialog/alert-dialog.js +34 -34
- package/dist/node/app-shell/app-shell.js +14 -12
- package/dist/node/app-shell/app-shell.module.js +8 -8
- package/dist/node/avatar-group/avatar-group.js +6 -6
- package/dist/node/bottom-sheet/bottom-sheet.js +18 -18
- package/dist/node/button/button.js +15 -12
- package/dist/node/button-group/button-group.js +8 -8
- package/dist/node/carousel/carousel.js +20 -20
- package/dist/node/checkbox/checkbox.js +21 -21
- package/dist/node/checkbox-card/checkbox-card.js +15 -13
- package/dist/node/collapsible/collapsible.js +7 -7
- package/dist/node/color-picker/color-picker.js +26 -26
- package/dist/node/combobox/combobox.js +86 -86
- package/dist/node/command-menu/command-menu.js +111 -111
- package/dist/node/comparison/comparison.js +10 -10
- package/dist/node/context-menu/context-menu.js +9 -9
- package/dist/node/copy-button/copy-button.js +18 -16
- package/dist/node/data-table/data-table.js +1 -1
- package/dist/node/date-picker/date-picker.js +25 -25
- package/dist/node/date-range-picker/date-range-picker.js +26 -26
- package/dist/node/drawer/drawer.js +18 -17
- package/dist/node/drawer/drawer.module.js +9 -9
- package/dist/node/dropdown/dropdown.js +48 -48
- package/dist/node/editable/editable.js +11 -11
- package/dist/node/fab/fab.js +53 -53
- package/dist/node/field/field.js +8 -8
- package/dist/node/file-uploader/file-uploader.js +19 -19
- package/dist/node/header-panel/header-panel.js +31 -31
- package/dist/node/hover-card/hover-card.js +21 -21
- package/dist/node/icon-button/icon-button.js +5 -5
- package/dist/node/input/input.js +22 -21
- package/dist/node/link/link.js +8 -6
- package/dist/node/log-viewer/log-viewer.js +26 -26
- package/dist/node/menu/menu.js +20 -20
- package/dist/node/menu-button/menu-button.js +48 -48
- package/dist/node/menubar/menubar.js +42 -42
- package/dist/node/modal/modal.js +41 -35
- package/dist/node/modal/modal.module.js +8 -7
- package/dist/node/multi-select/multi-select.js +57 -57
- package/dist/node/multi-select/multi-select.module.js +11 -11
- package/dist/node/native-select/native-select.js +13 -11
- package/dist/node/navigation-menu/navigation-menu.js +46 -46
- package/dist/node/notification/notification.js +26 -26
- package/dist/node/number-input/number-input.js +52 -50
- package/dist/node/otp-input/otp-input.js +8 -8
- package/dist/node/password-input/password-input.js +28 -27
- package/dist/node/popover/popover.js +26 -24
- package/dist/node/pull-to-refresh/pull-to-refresh.js +13 -13
- package/dist/node/radial-progress/radial-progress.js +5 -5
- package/dist/node/radio/radio.js +23 -22
- package/dist/node/radio-card/radio-card.js +27 -26
- package/dist/node/react/src/index.js +3 -3
- package/dist/node/react/src/theme.js +30 -19
- package/dist/node/resizable/resizable.js +11 -11
- package/dist/node/scroll-area/scroll-area.js +4 -4
- package/dist/node/search/search.js +49 -49
- package/dist/node/select/select.js +27 -26
- package/dist/node/sheet/sheet.js +11 -10
- package/dist/node/sheet/sheet.module.js +5 -5
- package/dist/node/shell-header/shell-header.js +21 -18
- package/dist/node/shell-header/shell-header.module.js +20 -19
- package/dist/node/side-nav/side-nav.js +91 -91
- package/dist/node/skip-nav/skip-nav.js +12 -12
- package/dist/node/slider/slider.js +13 -11
- package/dist/node/structured-list/structured-list.js +23 -23
- package/dist/node/tabs/tabs.js +49 -47
- package/dist/node/tags-input/tags-input.js +35 -35
- package/dist/node/textarea/textarea.js +22 -21
- package/dist/node/time-picker/time-picker.js +22 -21
- package/dist/node/timeline/timeline.js +23 -16
- package/dist/node/timeline/timeline.module.js +7 -7
- package/dist/node/toast/toast.js +15 -15
- package/dist/node/toc/toc.js +8 -8
- package/dist/node/toggle/toggle.js +15 -13
- package/dist/node/toggle-group/toggle-group.js +10 -10
- package/dist/node/toggletip/toggletip.js +9 -9
- package/dist/node/tooltip/tooltip.js +5 -5
- package/dist/node/tree-view/tree-view.js +32 -32
- package/dist/notification/notification.js +26 -26
- package/dist/number-input/number-input.js +52 -50
- package/dist/otp-input/otp-input.js +8 -8
- package/dist/password-input/password-input.js +28 -27
- package/dist/popover/popover.js +26 -24
- package/dist/pull-to-refresh/pull-to-refresh.js +13 -13
- package/dist/radial-progress/radial-progress.js +5 -5
- package/dist/radio/radio.js +23 -22
- package/dist/radio-card/radio-card.js +27 -26
- package/dist/react/src/index.js +3 -3
- package/dist/react/src/theme.js +30 -19
- package/dist/resizable/resizable.js +11 -11
- package/dist/scroll-area/scroll-area.js +4 -4
- package/dist/search/search.js +49 -49
- package/dist/select/select.js +27 -26
- package/dist/sheet/sheet.css +1 -1
- package/dist/sheet/sheet.js +11 -10
- package/dist/sheet/sheet.module.js +5 -5
- package/dist/shell-header/shell-header.css +1 -1
- package/dist/shell-header/shell-header.js +21 -18
- package/dist/shell-header/shell-header.module.js +20 -19
- package/dist/side-nav/side-nav.js +91 -91
- package/dist/skip-nav/skip-nav.js +12 -12
- package/dist/slider/slider.js +13 -11
- package/dist/structured-list/structured-list.js +23 -23
- package/dist/styles.css +57 -7
- package/dist/tabs/tabs.js +49 -47
- package/dist/tags-input/tags-input.js +35 -35
- package/dist/textarea/textarea.js +22 -21
- package/dist/time-picker/time-picker.js +22 -21
- package/dist/timeline/timeline.css +1 -1
- package/dist/timeline/timeline.js +23 -16
- package/dist/timeline/timeline.module.js +7 -7
- package/dist/toast/toast.js +15 -15
- package/dist/toc/toc.js +8 -8
- package/dist/toggle/toggle.js +15 -13
- package/dist/toggle-group/toggle-group.js +10 -10
- package/dist/toggletip/toggletip.js +9 -9
- package/dist/tooltip/tooltip.js +5 -5
- package/dist/tree-view/tree-view.js +32 -32
- package/package.json +10 -4
|
@@ -2,62 +2,63 @@
|
|
|
2
2
|
|
|
3
3
|
import e from "./radio-card.module.js";
|
|
4
4
|
import { cn as t } from "@cascivo/core";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { createContext as n, forwardRef as r } from "react";
|
|
6
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
7
7
|
//#region ../components/src/radio-card/radio-card.tsx
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
return /* @__PURE__ */
|
|
8
|
+
var o = n({ name: "" });
|
|
9
|
+
function s({ name: n, label: r, value: a, defaultValue: s, onValueChange: c, children: l, className: u }) {
|
|
10
|
+
return /* @__PURE__ */ i(o.Provider, {
|
|
11
11
|
value: {
|
|
12
|
-
name:
|
|
13
|
-
value:
|
|
12
|
+
name: n,
|
|
13
|
+
value: a,
|
|
14
14
|
defaultValue: s,
|
|
15
15
|
onValueChange: c
|
|
16
16
|
},
|
|
17
|
-
children: /* @__PURE__ */
|
|
17
|
+
children: /* @__PURE__ */ i("div", {
|
|
18
18
|
role: "radiogroup",
|
|
19
|
-
"aria-label":
|
|
19
|
+
"aria-label": r,
|
|
20
20
|
className: t(e.group, u),
|
|
21
21
|
children: l
|
|
22
22
|
})
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
return /* @__PURE__ */
|
|
25
|
+
var c = r(function({ value: t, title: n, description: r, disabled: s, hideIndicator: c, ...l }, u) {
|
|
26
|
+
return /* @__PURE__ */ i(o.Consumer, { children: (o) => /* @__PURE__ */ a("label", {
|
|
27
27
|
className: e.card,
|
|
28
28
|
"data-disabled": s || void 0,
|
|
29
29
|
children: [
|
|
30
|
-
/* @__PURE__ */
|
|
30
|
+
/* @__PURE__ */ i("input", {
|
|
31
31
|
type: "radio",
|
|
32
32
|
className: e.input,
|
|
33
|
-
name:
|
|
33
|
+
name: o.name,
|
|
34
34
|
value: t,
|
|
35
35
|
disabled: s,
|
|
36
|
-
...
|
|
37
|
-
defaultChecked:
|
|
38
|
-
onChange: () =>
|
|
36
|
+
...o.value === void 0 ? {
|
|
37
|
+
defaultChecked: o.defaultValue === t,
|
|
38
|
+
onChange: () => o.onValueChange?.(t)
|
|
39
39
|
} : {
|
|
40
|
-
checked:
|
|
41
|
-
onChange: () =>
|
|
40
|
+
checked: o.value === t,
|
|
41
|
+
onChange: () => o.onValueChange?.(t)
|
|
42
42
|
},
|
|
43
|
+
ref: u,
|
|
43
44
|
...l
|
|
44
45
|
}),
|
|
45
|
-
!c && /* @__PURE__ */
|
|
46
|
+
!c && /* @__PURE__ */ i("span", {
|
|
46
47
|
className: e.glyph,
|
|
47
48
|
"aria-hidden": "true"
|
|
48
49
|
}),
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
+
/* @__PURE__ */ a("span", {
|
|
50
51
|
className: e.body,
|
|
51
|
-
children: [/* @__PURE__ */
|
|
52
|
+
children: [/* @__PURE__ */ i("span", {
|
|
52
53
|
className: e.title,
|
|
53
|
-
children:
|
|
54
|
-
}),
|
|
54
|
+
children: n
|
|
55
|
+
}), r && /* @__PURE__ */ i("span", {
|
|
55
56
|
className: e.description,
|
|
56
|
-
children:
|
|
57
|
+
children: r
|
|
57
58
|
})]
|
|
58
59
|
})
|
|
59
60
|
]
|
|
60
61
|
}) });
|
|
61
|
-
}
|
|
62
|
+
});
|
|
62
63
|
//#endregion
|
|
63
|
-
export {
|
|
64
|
+
export { c as RadioCard, s as RadioCardGroup };
|
|
@@ -134,6 +134,6 @@ import { Center as an } from "../../layouts/src/center/center.js";
|
|
|
134
134
|
import { Spacer as on } from "../../layouts/src/spacer/spacer.js";
|
|
135
135
|
import { AutoGrid as sn } from "../../layouts/src/auto-grid/auto-grid.js";
|
|
136
136
|
import { PageHeader as cn } from "../../layouts/src/page-header/page-header.js";
|
|
137
|
-
import { ThemeProvider as ln,
|
|
138
|
-
import { DismissableLayer as
|
|
139
|
-
export { M as Accordion, N as AccordionContent, P as AccordionItem, F as AccordionTrigger, I as ActionSheet, d as Alert, ye as AlertDialog, Yt as AppShell, _t as AspectRatio, sn as AutoGrid, f as Avatar, p as AvatarGroup, c as Badge, $e as Blockquote, xe as BottomSheet, z as Breadcrumb, t as Button, dt as ButtonGroup, Ft as Calendar, r as Card, i as CardContent, a as CardFooter, o as CardHeader, s as CardTitle, Rt as Carousel, an as Center, Xt as ChatBubble, v as Checkbox, He as CheckboxCard, Qe as Code, Ut as CodeSnippet, gt as Collapsible, Lt as ColorPicker, rn as Columns, ce as Combobox, ne as CommandMenu, we as Comparison, Tt as ContainedList, Et as ContainedListItem, Se as ContextMenu, Ce as ContextMenuItem, Ue as CopyButton, Dt as DataList, te as DataTable, le as DatePicker, It as DateRangePicker,
|
|
137
|
+
import { ThemeProvider as ln, applyTheme as un, setTheme as dn, themePreloadScript as fn, themeSignal as pn, useTheme as mn } from "./theme.js";
|
|
138
|
+
import { DismissableLayer as hn, ErrorBoundary as gn, FocusScope as _n, Portal as vn, Presence as yn, Slot as bn, SuspenseBoundary as xn, VisuallyHidden as Sn, batch as Cn, cn as wn, composeRefs as Tn, computePosition as En, computed as Dn, createMachine as On, createScope as kn, createStreamBuffer as An, effect as jn, getLinkComponent as Mn, mergeProps as Nn, setLinkComponent as Pn, signal as Fn, useAnchorPosition as In, useClipboard as Ln, useComputed as Rn, useControllableSignal as zn, useDisclosure as Bn, useEffectPropSignal as Vn, useId as Hn, useMachine as Un, useMediaQuery as Wn, useRovingFocus as Gn, useScope as Kn, useScrollLock as qn, useSignal as Jn, useSignalEffect as Yn, useSignals as Xn, useStreamBuffer as Zn, useTypeahead as Qn } from "@cascivo/core";
|
|
139
|
+
export { M as Accordion, N as AccordionContent, P as AccordionItem, F as AccordionTrigger, I as ActionSheet, d as Alert, ye as AlertDialog, Yt as AppShell, _t as AspectRatio, sn as AutoGrid, f as Avatar, p as AvatarGroup, c as Badge, $e as Blockquote, xe as BottomSheet, z as Breadcrumb, t as Button, dt as ButtonGroup, Ft as Calendar, r as Card, i as CardContent, a as CardFooter, o as CardHeader, s as CardTitle, Rt as Carousel, an as Center, Xt as ChatBubble, v as Checkbox, He as CheckboxCard, Qe as Code, Ut as CodeSnippet, gt as Collapsible, Lt as ColorPicker, rn as Columns, ce as Combobox, ne as CommandMenu, we as Comparison, Tt as ContainedList, Et as ContainedListItem, Se as ContextMenu, Ce as ContextMenuItem, Ue as CopyButton, Dt as DataList, te as DataTable, le as DatePicker, It as DateRangePicker, hn as DismissableLayer, Bt as Dock, Vt as Drawer, w as Dropdown, Ie as Editable, X as EmptyState, gn as ErrorBoundary, Z as Fab, ct as Field, ue as FileUploader, lt as Filter, nn as Flex, _n as FocusScope, ae as Form, en as Grid, tn as GridItem, H as Header, Be as HeaderPanel, Xe as Heading, Te as HoverCard, Ee as HoverCardContent, De as HoverCardTrigger, ut as IconButton, h as Image, Kt as Indicator, pt as InlineLoading, n as Input, Ne as InputGroup, Pe as InputGroupAddon, kt as Item, At as ItemActions, jt as ItemContent, Mt as ItemDescription, Nt as ItemMedia, Pt as ItemTitle, qt as Join, L as Kbd, st as Label, R as Link, et as List, tt as ListItem, nt as LogViewer, he as Menu, vt as MenuButton, ge as MenuItem, _e as MenuSeparator, ve as MenuTrigger, bt as Menubar, l as Modal, ke as MultiSelect, Ht as NativeSelect, xt as NavigationMenu, mt as Notification, ee as NumberInput, je as OtpInput, Q as OverflowMenu, cn as PageHeader, G as Pagination, Oe as PasswordInput, fe as Popover, pe as PopoverContent, me as PopoverTrigger, vn as Portal, yn as Presence, Je as Progress, Y as ProgressBar, Ye as ProgressCircle, K as ProgressIndicator, rt as Prose, it as PullToRefresh, at as QrCode, Zt as RadialProgress, y as Radio, Le as RadioCard, Re as RadioCardGroup, b as RadioGroup, Fe as RatingGroup, ot as RelativeTime, zt as Resizable, ht as ScrollArea, $ as Search, Me as SegmentedControl, _ as Select, u as Separator, be as Sheet, ze as ShellHeader, W as SideNav, J as Skeleton, Ke as SkipNavLink, qe as SkipNavTarget, S as Slider, bn as Slot, on as Spacer, e as Spinner, Jt as Stack, We as Stat, Ge as Status, Wt as Steps, wt as StructuredList, xn as SuspenseBoundary, Qt as Swap, $t as SwipeItem, Ve as Switcher, O as Tabs, k as TabsContent, A as TabsList, j as TabsTrigger, q as Tag, Ae as TagsInput, Ze as Text, g as Textarea, ln as ThemeProvider, Gt as Tile, de as TimePicker, Ot as Timeline, T as ToastProvider, B as Toc, x as Toggle, ft as ToggleGroup, yt as Toggletip, C as Tooltip, St as TreeView, m as User, Sn as VisuallyHidden, un as applyTheme, Cn as batch, wn as cn, Tn as composeRefs, En as computePosition, Dn as computed, oe as createForm, On as createMachine, kn as createScope, An as createStreamBuffer, E as dismissAllToasts, jn as effect, re as fuzzyMatch, ie as fuzzyScore, Mn as getLinkComponent, Nn as mergeProps, Pn as setLinkComponent, dn as setTheme, Fn as signal, fn as themePreloadScript, pn as themeSignal, Ct as treeViewMessages, In as useAnchorPosition, Ln as useClipboard, Rn as useComputed, zn as useControllableSignal, Bn as useDisclosure, Vn as useEffectPropSignal, se as useForm, Hn as useId, Un as useMachine, Wn as useMediaQuery, U as usePopover, Gn as useRovingFocus, Kn as useScope, qn as useScrollLock, Jn as useSignal, Yn as useSignalEffect, Xn as useSignals, Zn as useStreamBuffer, mn as useTheme, D as useToast, V as useTocFromRegion, Qn as useTypeahead };
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { persistedSignal as e } from "../../storage/src/persisted-signal.js";
|
|
4
4
|
import { useSignalEffect as t, useSignals as n } from "@cascivo/core";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { useRef as r } from "react";
|
|
6
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
7
|
//#region src/theme.tsx
|
|
8
8
|
var s = "cascivo-theme", c = "data-theme";
|
|
9
9
|
function l() {
|
|
@@ -12,7 +12,7 @@ function l() {
|
|
|
12
12
|
var u = /* @__PURE__ */ new Set();
|
|
13
13
|
function d(e, t) {
|
|
14
14
|
l() && (e === null || typeof document > "u" || typeof requestAnimationFrame != "function" || u.has(t) || requestAnimationFrame(() => {
|
|
15
|
-
u.has(t) || getComputedStyle(e).getPropertyValue("--cascivo-color-accent").trim() === "" && (u.add(t), console.warn(`cascivo ThemeProvider: data-theme=${JSON.stringify(t)} was set, but no cascivo theme CSS defines it — every --cascivo-color-* token is unresolved, so components render grayscale. Import '@cascivo/themes/all.css' once in your entry (or '@cascivo/react/styles.css', which bundles the light and dark themes). Using a custom theme? Ensure its stylesheet is loaded and defines [data-theme=${JSON.stringify(t)}]. Docs: https://cascivo.com/docs/theming — offline: npx -y @cascivo/docs guide theming`));
|
|
15
|
+
u.has(t) || getComputedStyle(e).getPropertyValue("--cascivo-color-accent").trim() === "" && (u.add(t), console.warn(`cascivo ThemeProvider: data-theme=${JSON.stringify(t)} was set, but no cascivo theme CSS defines it — every --cascivo-color-* token is unresolved, so components render grayscale. Import '@cascivo/themes/all.css' once in your entry (or '@cascivo/react/styles.css', which bundles the light and dark themes). Using a custom theme? Ensure its stylesheet is loaded and defines [data-theme=${JSON.stringify(t)}]. Docs: https://cascivo.com/docs/theming.md — offline: npx -y @cascivo/docs guide theming`));
|
|
16
16
|
}));
|
|
17
17
|
}
|
|
18
18
|
var f = null, p = {
|
|
@@ -29,39 +29,50 @@ function h() {
|
|
|
29
29
|
function g() {
|
|
30
30
|
return f ??= e(p.storageKey, h()), f;
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
var _ = !1, v = !1;
|
|
33
|
+
function y(e) {
|
|
34
|
+
!l() || v || typeof requestAnimationFrame == "function" && requestAnimationFrame(() => {
|
|
35
|
+
_ || v || (v = !0, console.warn(`cascivo setTheme(${JSON.stringify(e)}): no <ThemeProvider> is mounted, so the theme signal updated but the ${c} attribute was never written — nothing on the page will restyle. Wrap your app in <ThemeProvider> (it is SSR-safe and persists the choice), or call applyTheme() to write the attribute directly if you are theming outside React. Docs: https://cascivo.com/docs/theming.md — offline: npx -y @cascivo/docs guide theming`));
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function b(e) {
|
|
39
|
+
g().value = e, y(e);
|
|
40
|
+
}
|
|
41
|
+
function x(e, t) {
|
|
33
42
|
g().value = e;
|
|
43
|
+
let n = t ?? (typeof document < "u" ? document.documentElement : null);
|
|
44
|
+
n !== null && (n.setAttribute(c, e), d(n, e));
|
|
34
45
|
}
|
|
35
|
-
function
|
|
36
|
-
return n(), [g().value,
|
|
46
|
+
function S() {
|
|
47
|
+
return n(), [g().value, b];
|
|
37
48
|
}
|
|
38
|
-
function
|
|
49
|
+
function C() {
|
|
39
50
|
return g();
|
|
40
51
|
}
|
|
41
|
-
function
|
|
52
|
+
function w(e) {
|
|
42
53
|
return JSON.stringify(e).replace(/</g, "\\u003c");
|
|
43
54
|
}
|
|
44
|
-
function
|
|
45
|
-
let
|
|
46
|
-
|
|
55
|
+
function T({ defaultTheme: e, value: n, storageKey: l = s, attribute: u = c, target: m, onChange: h, nonce: v, children: y }) {
|
|
56
|
+
let b = r(!1);
|
|
57
|
+
b.current || (b.current = !0, (f === null || p.storageKey !== l) && (p = {
|
|
47
58
|
storageKey: l,
|
|
48
59
|
defaultTheme: e ?? "light",
|
|
49
60
|
explicit: e !== void 0
|
|
50
61
|
}, f = null));
|
|
51
62
|
let x = g();
|
|
52
63
|
n !== void 0 && (x.value = n);
|
|
53
|
-
let S =
|
|
64
|
+
let S = r(h);
|
|
54
65
|
return S.current = h, t(() => {
|
|
55
66
|
let e = x.value, t = m ? m.current : typeof document < "u" ? document.documentElement : null;
|
|
56
|
-
t?.setAttribute(u, e), d(t, e), S.current?.(e);
|
|
57
|
-
}), n !== void 0 && !m ? /* @__PURE__ */
|
|
58
|
-
nonce:
|
|
59
|
-
dangerouslySetInnerHTML: { __html: `document.documentElement.setAttribute(${
|
|
60
|
-
}),
|
|
67
|
+
_ = !0, t?.setAttribute(u, e), d(t, e), S.current?.(e);
|
|
68
|
+
}), n !== void 0 && !m ? /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a("script", {
|
|
69
|
+
nonce: v,
|
|
70
|
+
dangerouslySetInnerHTML: { __html: `document.documentElement.setAttribute(${w(u)},${w(n)})` }
|
|
71
|
+
}), y] }) : /* @__PURE__ */ a(i, { children: y });
|
|
61
72
|
}
|
|
62
|
-
function
|
|
73
|
+
function E(e = {}) {
|
|
63
74
|
let t = JSON.stringify(e.storageKey ?? s), n = JSON.stringify(e.attribute ?? c), r = JSON.stringify(e.defaultTheme ?? "light"), i = e.defaultTheme === void 0 ? "if(typeof matchMedia==='function'){if(matchMedia('(prefers-color-scheme: dark)').matches)v='dark';else if(matchMedia('(prefers-color-scheme: light)').matches)v='light';}" : "";
|
|
64
75
|
return `(function(){try{var v=${r};` + i + `var raw=localStorage.getItem(${t});if(raw){v=raw;try{var e=JSON.parse(raw);if(e&&typeof e==='object'&&'value'in e)v=e.value;}catch(_){}}document.documentElement.setAttribute(${n},v);}catch(_){}})();`;
|
|
65
76
|
}
|
|
66
77
|
//#endregion
|
|
67
|
-
export {
|
|
78
|
+
export { T as ThemeProvider, x as applyTheme, b as setTheme, E as themePreloadScript, C as themeSignal, S as useTheme };
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
import e from "./resizable.module.js";
|
|
4
4
|
import { cn as t, useControllableSignal as n, useSignal as r, useSignalEffect as i, useSignals as a } from "@cascivo/core";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { Children as o, useRef as s } from "react";
|
|
6
|
+
import { builtin as c, t as l } from "@cascivo/i18n";
|
|
7
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
8
8
|
//#region ../components/src/resizable/resizable.tsx
|
|
9
9
|
function f(e, t, n) {
|
|
10
10
|
return Math.min(n, Math.max(t, e));
|
|
11
11
|
}
|
|
12
12
|
function p({ children: p, orientation: m = "horizontal", defaultRatio: h = .5, ratio: g, minRatio: _ = .1, maxRatio: v = .9, onRatioChange: y, className: b, label: x }) {
|
|
13
13
|
a();
|
|
14
|
-
let [S, C] =
|
|
14
|
+
let [S, C] = o.toArray(p), [w, T] = n({
|
|
15
15
|
value: g,
|
|
16
16
|
defaultValue: h,
|
|
17
17
|
onChange: y
|
|
18
|
-
}), E =
|
|
18
|
+
}), E = s(null), D = r(!1), O = (e) => {
|
|
19
19
|
T(f(e, _, v));
|
|
20
20
|
}, k = (e, t) => {
|
|
21
21
|
let n = E.current;
|
|
@@ -40,18 +40,18 @@ function p({ children: p, orientation: m = "horizontal", defaultRatio: h = .5, r
|
|
|
40
40
|
else if (e.key === "End") O(v);
|
|
41
41
|
else return;
|
|
42
42
|
e.preventDefault();
|
|
43
|
-
}, j = x ??
|
|
44
|
-
return /* @__PURE__ */
|
|
43
|
+
}, j = x ?? l(c.resizable.handle), M = Math.round(w.value * 100);
|
|
44
|
+
return /* @__PURE__ */ d("div", {
|
|
45
45
|
ref: E,
|
|
46
46
|
className: t(e.resizable, b),
|
|
47
47
|
"data-orientation": m,
|
|
48
48
|
style: { "--cascivo-resizable-ratio": w.value },
|
|
49
49
|
children: [
|
|
50
|
-
/* @__PURE__ */
|
|
50
|
+
/* @__PURE__ */ u("div", {
|
|
51
51
|
className: e.pane,
|
|
52
52
|
children: S
|
|
53
53
|
}),
|
|
54
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ u("div", {
|
|
55
55
|
className: e.handle,
|
|
56
56
|
role: "separator",
|
|
57
57
|
"aria-orientation": m,
|
|
@@ -64,12 +64,12 @@ function p({ children: p, orientation: m = "horizontal", defaultRatio: h = .5, r
|
|
|
64
64
|
onPointerDown: (e) => {
|
|
65
65
|
e.preventDefault(), D.value = !0;
|
|
66
66
|
},
|
|
67
|
-
children: /* @__PURE__ */
|
|
67
|
+
children: /* @__PURE__ */ u("span", {
|
|
68
68
|
className: e.grip,
|
|
69
69
|
"aria-hidden": "true"
|
|
70
70
|
})
|
|
71
71
|
}),
|
|
72
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ u("div", {
|
|
73
73
|
className: e.pane,
|
|
74
74
|
children: C
|
|
75
75
|
})
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
import e from "./scroll-area.module.js";
|
|
4
4
|
import { cn as t, useSignalEffect as n, useSignals as r } from "@cascivo/core";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { useRef as i } from "react";
|
|
6
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
7
7
|
//#region ../components/src/scroll-area/scroll-area.tsx
|
|
8
8
|
function o({ height: o, width: s, orientation: c = "vertical", edges: l = "shadow", className: u, style: d, children: f, ...p }) {
|
|
9
9
|
r();
|
|
10
|
-
let m =
|
|
10
|
+
let m = i(null);
|
|
11
11
|
n(() => {
|
|
12
12
|
let e = m.current;
|
|
13
13
|
if (!e) return;
|
|
@@ -24,7 +24,7 @@ function o({ height: o, width: s, orientation: c = "vertical", edges: l = "shado
|
|
|
24
24
|
...s === void 0 ? {} : { "--cascivo-scroll-area-width": s },
|
|
25
25
|
...d
|
|
26
26
|
};
|
|
27
|
-
return /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ a("div", {
|
|
28
28
|
ref: m,
|
|
29
29
|
"data-orientation": c,
|
|
30
30
|
"data-edges": l,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import e from "./search.module.js";
|
|
4
|
-
import { cn as t,
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { cn as t, focusElement as n, useId as r, useSignal as i, useSignalEffect as a, useSignals as o } from "@cascivo/core";
|
|
5
|
+
import { useRef as s } from "react";
|
|
6
|
+
import { builtin as c, t as l } from "@cascivo/i18n";
|
|
7
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
8
8
|
//#region ../components/src/search/search.tsx
|
|
9
|
-
function
|
|
10
|
-
return /* @__PURE__ */
|
|
9
|
+
function f() {
|
|
10
|
+
return /* @__PURE__ */ d("svg", {
|
|
11
11
|
viewBox: "0 0 16 16",
|
|
12
12
|
width: "16",
|
|
13
13
|
height: "16",
|
|
@@ -16,11 +16,11 @@ function d() {
|
|
|
16
16
|
strokeWidth: "1.5",
|
|
17
17
|
strokeLinecap: "round",
|
|
18
18
|
"aria-hidden": "true",
|
|
19
|
-
children: [/* @__PURE__ */
|
|
19
|
+
children: [/* @__PURE__ */ u("circle", {
|
|
20
20
|
cx: "7",
|
|
21
21
|
cy: "7",
|
|
22
22
|
r: "4.5"
|
|
23
|
-
}), /* @__PURE__ */
|
|
23
|
+
}), /* @__PURE__ */ u("line", {
|
|
24
24
|
x1: "10.5",
|
|
25
25
|
y1: "10.5",
|
|
26
26
|
x2: "14",
|
|
@@ -28,58 +28,58 @@ function d() {
|
|
|
28
28
|
})]
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
|
|
33
|
-
let
|
|
34
|
-
|
|
35
|
-
let
|
|
36
|
-
|
|
37
|
-
let
|
|
38
|
-
|
|
31
|
+
function p({ value: p, defaultValue: m = "", onValueChange: h, onChange: g, onSearch: _, debounceMs: v = 300, placeholder: y, size: b = "md", label: x, disabled: S = !1, clearLabel: C, id: w, className: T }) {
|
|
32
|
+
o();
|
|
33
|
+
let E = y ?? l(c.search.placeholder), D = x ?? l(c.search.label), O = C ?? l(c.search.clear), k = s(null), A = r("cascade-search"), j = w ?? A, M = p !== void 0, N = i(M ? p : m);
|
|
34
|
+
M && (N.value = p);
|
|
35
|
+
let P = s(_);
|
|
36
|
+
P.current = _;
|
|
37
|
+
let F = s(null), I = () => {
|
|
38
|
+
F.current !== null && (clearTimeout(F.current), F.current = null);
|
|
39
39
|
};
|
|
40
|
-
|
|
41
|
-
let
|
|
40
|
+
a(() => I);
|
|
41
|
+
let L = (e) => {
|
|
42
42
|
let t = e.target.value;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
e.key === "Enter" && (
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
return /* @__PURE__ */
|
|
52
|
-
className: t(e.root,
|
|
53
|
-
"data-size":
|
|
54
|
-
"data-state":
|
|
43
|
+
M || (N.value = t), (h ?? g)?.(t), I(), F.current = setTimeout(() => {
|
|
44
|
+
F.current = null, P.current?.(t);
|
|
45
|
+
}, v);
|
|
46
|
+
}, R = (e) => {
|
|
47
|
+
e.key === "Enter" && (I(), _?.(N.value));
|
|
48
|
+
}, z = () => {
|
|
49
|
+
I(), M || (N.value = ""), (h ?? g)?.(""), _?.(""), n(k.current);
|
|
50
|
+
}, B = N.value !== "";
|
|
51
|
+
return /* @__PURE__ */ d("div", {
|
|
52
|
+
className: t(e.root, T),
|
|
53
|
+
"data-size": b,
|
|
54
|
+
"data-state": B ? "filled" : "empty",
|
|
55
55
|
children: [
|
|
56
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ u("label", {
|
|
57
57
|
className: e.label,
|
|
58
|
-
htmlFor:
|
|
59
|
-
children:
|
|
58
|
+
htmlFor: j,
|
|
59
|
+
children: D
|
|
60
60
|
}),
|
|
61
|
-
/* @__PURE__ */
|
|
61
|
+
/* @__PURE__ */ u("span", {
|
|
62
62
|
className: e.icon,
|
|
63
|
-
children: /* @__PURE__ */
|
|
63
|
+
children: /* @__PURE__ */ u(f, {})
|
|
64
64
|
}),
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
ref:
|
|
67
|
-
id:
|
|
65
|
+
/* @__PURE__ */ u("input", {
|
|
66
|
+
ref: k,
|
|
67
|
+
id: j,
|
|
68
68
|
type: "search",
|
|
69
69
|
className: e.input,
|
|
70
|
-
value:
|
|
71
|
-
placeholder:
|
|
72
|
-
disabled:
|
|
73
|
-
onChange:
|
|
74
|
-
onKeyDown:
|
|
70
|
+
value: N.value,
|
|
71
|
+
placeholder: E,
|
|
72
|
+
disabled: S,
|
|
73
|
+
onChange: L,
|
|
74
|
+
onKeyDown: R
|
|
75
75
|
}),
|
|
76
|
-
|
|
76
|
+
B && /* @__PURE__ */ u("button", {
|
|
77
77
|
type: "button",
|
|
78
78
|
className: e.clear,
|
|
79
|
-
"aria-label":
|
|
80
|
-
disabled:
|
|
81
|
-
onClick:
|
|
82
|
-
children: /* @__PURE__ */
|
|
79
|
+
"aria-label": O,
|
|
80
|
+
disabled: S,
|
|
81
|
+
onClick: z,
|
|
82
|
+
children: /* @__PURE__ */ u("span", {
|
|
83
83
|
"aria-hidden": "true",
|
|
84
84
|
children: "✕"
|
|
85
85
|
})
|
|
@@ -88,4 +88,4 @@ function f({ value: f, defaultValue: p = "", onValueChange: m, onChange: h, onSe
|
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
90
|
//#endregion
|
|
91
|
-
export {
|
|
91
|
+
export { p as Search };
|
|
@@ -2,70 +2,71 @@
|
|
|
2
2
|
|
|
3
3
|
import e from "./select.module.js";
|
|
4
4
|
import { cn as t, createMachine as n, useMachine as r } from "@cascivo/core";
|
|
5
|
-
import {
|
|
5
|
+
import { forwardRef as i } from "react";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
7
|
//#region ../components/src/select/select.tsx
|
|
7
|
-
var
|
|
8
|
+
var s = n({
|
|
8
9
|
initial: "idle",
|
|
9
10
|
states: {
|
|
10
11
|
idle: { on: { FOCUS: "focused" } },
|
|
11
12
|
focused: { on: { BLUR: "idle" } }
|
|
12
13
|
}
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return /* @__PURE__ */ a("div", {
|
|
14
|
+
}), c = i(function({ label: n, hint: i, error: c, placeholder: l, options: u, size: d = "md", className: f, id: p, defaultValue: m, value: h, onFocus: g, onBlur: _, ...v }, y) {
|
|
15
|
+
let [b, x] = r(s), S = p ?? (n ? `cascade-select-${n.toLowerCase().replace(/\s+/g, "-")}` : void 0), C = h !== void 0, w = l !== void 0;
|
|
16
|
+
return /* @__PURE__ */ o("div", {
|
|
17
17
|
className: t(e.wrapper, f),
|
|
18
|
-
"data-state": c ? "error" :
|
|
18
|
+
"data-state": c ? "error" : b.value,
|
|
19
19
|
"data-size": d,
|
|
20
20
|
children: [
|
|
21
|
-
n && /* @__PURE__ */
|
|
21
|
+
n && /* @__PURE__ */ a("label", {
|
|
22
22
|
className: e.label,
|
|
23
|
-
htmlFor:
|
|
23
|
+
htmlFor: S,
|
|
24
24
|
children: n
|
|
25
25
|
}),
|
|
26
|
-
/* @__PURE__ */
|
|
26
|
+
/* @__PURE__ */ o("div", {
|
|
27
27
|
className: e.field,
|
|
28
|
-
children: [/* @__PURE__ */
|
|
29
|
-
id:
|
|
28
|
+
children: [/* @__PURE__ */ o("select", {
|
|
29
|
+
id: S,
|
|
30
30
|
className: e.select,
|
|
31
31
|
"aria-invalid": c ? !0 : void 0,
|
|
32
|
-
"aria-describedby": c ? `${
|
|
32
|
+
"aria-describedby": c ? `${S}-error` : i ? `${S}-hint` : void 0,
|
|
33
33
|
value: h,
|
|
34
|
-
defaultValue: !
|
|
34
|
+
defaultValue: !C && w ? m ?? "" : m,
|
|
35
35
|
onFocus: (e) => {
|
|
36
|
-
|
|
36
|
+
x("FOCUS"), g?.(e);
|
|
37
37
|
},
|
|
38
38
|
onBlur: (e) => {
|
|
39
|
-
|
|
39
|
+
x("BLUR"), _?.(e);
|
|
40
40
|
},
|
|
41
|
+
ref: y,
|
|
41
42
|
...v,
|
|
42
|
-
children: [
|
|
43
|
+
children: [w && /* @__PURE__ */ a("option", {
|
|
43
44
|
value: "",
|
|
44
45
|
disabled: !0,
|
|
45
46
|
children: l
|
|
46
|
-
}), u.map((e) => /* @__PURE__ */
|
|
47
|
+
}), u.map((e) => /* @__PURE__ */ a("option", {
|
|
47
48
|
value: e.value,
|
|
48
49
|
disabled: e.disabled,
|
|
49
50
|
children: e.label
|
|
50
51
|
}, e.value))]
|
|
51
|
-
}), /* @__PURE__ */
|
|
52
|
+
}), /* @__PURE__ */ a("span", {
|
|
52
53
|
className: e.chevron,
|
|
53
54
|
"aria-hidden": "true"
|
|
54
55
|
})]
|
|
55
56
|
}),
|
|
56
|
-
c && /* @__PURE__ */
|
|
57
|
-
id: `${
|
|
57
|
+
c && /* @__PURE__ */ a("span", {
|
|
58
|
+
id: `${S}-error`,
|
|
58
59
|
className: e.error,
|
|
59
60
|
role: "alert",
|
|
60
61
|
children: c
|
|
61
62
|
}),
|
|
62
|
-
!c &&
|
|
63
|
-
id: `${
|
|
63
|
+
!c && i && /* @__PURE__ */ a("span", {
|
|
64
|
+
id: `${S}-hint`,
|
|
64
65
|
className: e.hint,
|
|
65
|
-
children:
|
|
66
|
+
children: i
|
|
66
67
|
})
|
|
67
68
|
]
|
|
68
69
|
});
|
|
69
|
-
}
|
|
70
|
+
});
|
|
70
71
|
//#endregion
|
|
71
|
-
export {
|
|
72
|
+
export { c as Select };
|
package/dist/node/sheet/sheet.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
import e from "./sheet.module.js";
|
|
4
4
|
import { useEffectPropSignal as t, useSignalEffect as n } from "@cascivo/core";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { useId as r, useRef as i } from "react";
|
|
6
|
+
import { builtin as a, t as o } from "@cascivo/i18n";
|
|
7
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
8
|
//#region ../components/src/sheet/sheet.tsx
|
|
9
9
|
function l({ open: l, onClose: u, title: d, children: f, side: p = "end" }) {
|
|
10
|
-
let m =
|
|
10
|
+
let m = i(null), h = r(), g = t(l), _ = i(u);
|
|
11
11
|
return _.current = u, n(() => {
|
|
12
12
|
let e = m.current;
|
|
13
13
|
if (e) if (g.value) try {
|
|
@@ -16,7 +16,7 @@ function l({ open: l, onClose: u, title: d, children: f, side: p = "end" }) {
|
|
|
16
16
|
else try {
|
|
17
17
|
e.hidePopover();
|
|
18
18
|
} catch {}
|
|
19
|
-
}), /* @__PURE__ */
|
|
19
|
+
}), /* @__PURE__ */ c("div", {
|
|
20
20
|
ref: m,
|
|
21
21
|
popover: "manual",
|
|
22
22
|
role: "dialog",
|
|
@@ -25,21 +25,22 @@ function l({ open: l, onClose: u, title: d, children: f, side: p = "end" }) {
|
|
|
25
25
|
"data-state": l ? "open" : "closed",
|
|
26
26
|
"data-side": p,
|
|
27
27
|
className: e.sheet,
|
|
28
|
-
children: [/* @__PURE__ */
|
|
28
|
+
children: [/* @__PURE__ */ c("div", {
|
|
29
29
|
className: e.header,
|
|
30
|
-
children: [d != null && /* @__PURE__ */
|
|
30
|
+
children: [d != null && /* @__PURE__ */ s("span", {
|
|
31
31
|
id: h,
|
|
32
32
|
className: e.title,
|
|
33
33
|
children: d
|
|
34
|
-
}), /* @__PURE__ */
|
|
34
|
+
}), /* @__PURE__ */ s("button", {
|
|
35
35
|
type: "button",
|
|
36
|
-
"aria-label":
|
|
36
|
+
"aria-label": o(a.sheet.close),
|
|
37
37
|
onClick: () => _.current(),
|
|
38
38
|
className: e.close,
|
|
39
39
|
children: "✕"
|
|
40
40
|
})]
|
|
41
|
-
}), /* @__PURE__ */
|
|
41
|
+
}), /* @__PURE__ */ s("div", {
|
|
42
42
|
className: e.body,
|
|
43
|
+
"data-cascivo-sheet-body": "",
|
|
43
44
|
children: f
|
|
44
45
|
})]
|
|
45
46
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
var e = {
|
|
4
|
-
sheet: "
|
|
5
|
-
header: "
|
|
6
|
-
title: "
|
|
7
|
-
close: "
|
|
8
|
-
body: "
|
|
4
|
+
sheet: "_sheet_gx7nz_2",
|
|
5
|
+
header: "_header_gx7nz_141",
|
|
6
|
+
title: "_title_gx7nz_150",
|
|
7
|
+
close: "_close_gx7nz_156",
|
|
8
|
+
body: "_body_gx7nz_184"
|
|
9
9
|
};
|
|
10
10
|
//#endregion
|
|
11
11
|
export { e as default };
|