@cascivo/react 0.3.8 → 0.5.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/LICENSE +1 -1
- package/README.md +6 -3
- package/dist/alert/alert.css +1 -1
- package/dist/alert/alert.module.js +7 -7
- package/dist/alert-dialog/alert-dialog.js +36 -36
- package/dist/avatar/avatar.js +3 -3
- package/dist/combobox/combobox.css +1 -1
- package/dist/combobox/combobox.js +46 -46
- package/dist/combobox/combobox.module.js +15 -15
- package/dist/data-table/data-table.css +1 -1
- package/dist/data-table/data-table.js +7 -5
- package/dist/data-table/data-table.module.js +29 -29
- package/dist/date-picker/date-picker.css +1 -1
- package/dist/date-picker/date-picker.module.js +19 -19
- package/dist/date-range-picker/date-range-picker.js +1 -0
- package/dist/dock/dock.js +21 -19
- package/dist/fab/fab.js +1 -1
- package/dist/file-uploader/file-uploader.css +1 -1
- package/dist/file-uploader/file-uploader.module.js +14 -14
- package/dist/header/header.js +2 -2
- package/dist/index.d.ts +50 -2
- package/dist/log-viewer/log-viewer.css +1 -1
- package/dist/log-viewer/log-viewer.module.js +12 -12
- package/dist/menu/menu.css +1 -1
- package/dist/menu/menu.js +60 -35
- package/dist/menu/menu.module.js +4 -4
- package/dist/modal/modal.js +43 -46
- package/dist/multi-select/multi-select.js +3 -2
- package/dist/password-input/password-input.js +4 -0
- package/dist/popover/popover.css +1 -1
- package/dist/popover/popover.module.js +2 -2
- package/dist/radial-progress/radial-progress.js +13 -10
- package/dist/shell-header/shell-header.js +5 -4
- package/dist/side-nav/side-nav.js +4 -4
- package/dist/stat/stat.css +1 -1
- package/dist/stat/stat.module.js +6 -6
- package/dist/steps/steps.css +1 -1
- package/dist/steps/steps.js +19 -16
- package/dist/steps/steps.module.js +4 -4
- package/dist/styles.css +42 -13
- package/dist/swipe-item/swipe-item.js +2 -2
- package/dist/switcher/switcher.css +1 -1
- package/dist/switcher/switcher.js +3 -2
- package/dist/switcher/switcher.module.js +4 -4
- package/dist/tag/tag.css +1 -1
- package/dist/tag/tag.module.js +2 -2
- package/dist/tags-input/tags-input.css +1 -1
- package/dist/tags-input/tags-input.js +1 -0
- package/dist/tags-input/tags-input.module.js +4 -4
- package/dist/tooltip/tooltip.js +11 -11
- package/package.json +3 -3
- package/readme.body.md +6 -3
|
@@ -2,25 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
import './date-picker.css';
|
|
4
4
|
var e = {
|
|
5
|
-
wrapper: "
|
|
6
|
-
label: "
|
|
7
|
-
field: "
|
|
8
|
-
trigger: "
|
|
9
|
-
value: "
|
|
10
|
-
placeholder: "
|
|
11
|
-
icon: "
|
|
12
|
-
clear: "
|
|
13
|
-
calendar: "
|
|
14
|
-
header: "
|
|
15
|
-
monthLabel: "
|
|
16
|
-
navButton: "
|
|
17
|
-
grid: "
|
|
18
|
-
weekday: "
|
|
19
|
-
cell: "
|
|
20
|
-
empty: "
|
|
21
|
-
day: "
|
|
22
|
-
error: "
|
|
23
|
-
hint: "
|
|
5
|
+
wrapper: "_wrapper_6chzy_2",
|
|
6
|
+
label: "_label_6chzy_27",
|
|
7
|
+
field: "_field_6chzy_34",
|
|
8
|
+
trigger: "_trigger_6chzy_40",
|
|
9
|
+
value: "_value_6chzy_78",
|
|
10
|
+
placeholder: "_placeholder_6chzy_84",
|
|
11
|
+
icon: "_icon_6chzy_87",
|
|
12
|
+
clear: "_clear_6chzy_92",
|
|
13
|
+
calendar: "_calendar_6chzy_117",
|
|
14
|
+
header: "_header_6chzy_149",
|
|
15
|
+
monthLabel: "_monthLabel_6chzy_156",
|
|
16
|
+
navButton: "_navButton_6chzy_162",
|
|
17
|
+
grid: "_grid_6chzy_184",
|
|
18
|
+
weekday: "_weekday_6chzy_189",
|
|
19
|
+
cell: "_cell_6chzy_198",
|
|
20
|
+
empty: "_empty_6chzy_202",
|
|
21
|
+
day: "_day_6chzy_206",
|
|
22
|
+
error: "_error_6chzy_241",
|
|
23
|
+
hint: "_hint_6chzy_245"
|
|
24
24
|
};
|
|
25
25
|
//#endregion
|
|
26
26
|
export { e as default };
|
|
@@ -114,6 +114,7 @@ function g({ value: g, defaultValue: _, onValueChange: te, min: v, max: y, disab
|
|
|
114
114
|
role: "combobox",
|
|
115
115
|
"aria-expanded": N.value,
|
|
116
116
|
"aria-haspopup": "dialog",
|
|
117
|
+
"aria-label": T?.label ?? l(c.dateRangePicker.label),
|
|
117
118
|
className: t.trigger,
|
|
118
119
|
onClick: N.value ? V : B,
|
|
119
120
|
children: [/* @__PURE__ */ u("span", {
|
package/dist/dock/dock.js
CHANGED
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import e from "./dock.module.js";
|
|
4
|
-
import {
|
|
4
|
+
import { useSignals as t } from "@cascivo/core";
|
|
5
|
+
import { builtin as n, t as r } from "@cascivo/i18n";
|
|
6
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
7
|
//#region ../components/src/dock/dock.tsx
|
|
6
|
-
function
|
|
7
|
-
return /* @__PURE__ */
|
|
8
|
-
"aria-label":
|
|
9
|
-
className: [e.dock,
|
|
10
|
-
children:
|
|
11
|
-
let
|
|
12
|
-
return /* @__PURE__ */
|
|
8
|
+
function o({ items: o, activeIndex: s, className: c, ariaLabel: l }) {
|
|
9
|
+
return t(), /* @__PURE__ */ i("nav", {
|
|
10
|
+
"aria-label": l ?? r(n.dock.nav),
|
|
11
|
+
className: [e.dock, c].filter(Boolean).join(" "),
|
|
12
|
+
children: o.map((t, n) => {
|
|
13
|
+
let r = n === s;
|
|
14
|
+
return /* @__PURE__ */ a(t.href ? "a" : "button", {
|
|
13
15
|
className: e.item,
|
|
14
|
-
"data-active":
|
|
15
|
-
"aria-current":
|
|
16
|
-
...
|
|
17
|
-
type:
|
|
18
|
-
onClick:
|
|
19
|
-
children: [/* @__PURE__ */
|
|
16
|
+
"data-active": r || void 0,
|
|
17
|
+
"aria-current": r ? "page" : void 0,
|
|
18
|
+
...t.href ? { href: t.href } : {},
|
|
19
|
+
type: t.href ? void 0 : "button",
|
|
20
|
+
onClick: t.onClick,
|
|
21
|
+
children: [/* @__PURE__ */ i("span", {
|
|
20
22
|
className: e.icon,
|
|
21
23
|
"aria-hidden": "true",
|
|
22
|
-
children:
|
|
23
|
-
}), /* @__PURE__ */
|
|
24
|
+
children: t.icon
|
|
25
|
+
}), /* @__PURE__ */ i("span", {
|
|
24
26
|
className: e.label,
|
|
25
|
-
children:
|
|
27
|
+
children: t.label
|
|
26
28
|
})]
|
|
27
|
-
},
|
|
29
|
+
}, n);
|
|
28
30
|
})
|
|
29
31
|
});
|
|
30
32
|
}
|
|
31
33
|
//#endregion
|
|
32
|
-
export {
|
|
34
|
+
export { o as Dock };
|
package/dist/fab/fab.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer cascivo.component{.
|
|
1
|
+
@layer cascivo.component{._uploader_bw6tn_2{gap:var(--cascivo-space-2);flex-direction:column;inline-size:100%;display:flex}._label_bw6tn_9{font-size:var(--cascivo-font-size-sm);font-weight:var(--cascivo-font-weight-medium);color:var(--cascivo-color-text)}._input_bw6tn_15{clip-path:inset(50%);white-space:nowrap;block-size:1px;inline-size:1px;position:absolute;overflow:hidden}._zone_bw6tn_24{padding:var(--cascivo-space-8) var(--cascivo-space-4);border:2px dashed var(--cascivo-color-border);border-radius:var(--cascivo-radius-surface);background:var(--cascivo-color-surface);color:var(--cascivo-color-text-muted);font-size:var(--cascivo-font-size-sm);cursor:pointer;transition:border-color var(--cascivo-duration-150) var(--cascivo-ease-out), background var(--cascivo-duration-150) var(--cascivo-ease-out);text-align:center;justify-content:center;align-items:center;inline-size:100%;display:flex}._zone_bw6tn_24:hover:not(:disabled),._zone_bw6tn_24[data-state=dragover]{border-color:var(--cascivo-color-accent);background:var(--cascivo-color-accent-subtle)}._zone_bw6tn_24:disabled{opacity:.5;cursor:not-allowed}._hint_bw6tn_57{font-size:var(--cascivo-font-size-xs);color:var(--cascivo-color-text-muted)}._list_bw6tn_62{gap:var(--cascivo-space-2);flex-direction:column;margin:0;padding:0;list-style:none;display:flex}._file_bw6tn_71{align-items:center;gap:var(--cascivo-space-2);padding:var(--cascivo-space-2) var(--cascivo-space-3);border:1px solid var(--cascivo-color-border);border-radius:var(--cascivo-radius-surface);background:var(--cascivo-color-surface);font-size:var(--cascivo-font-size-sm);grid-template-columns:auto 1fr auto auto;grid-template-areas:"status name size remove""status error error error";display:grid}._file_bw6tn_71[data-state=error]{border-color:var(--cascivo-color-danger)}._status_bw6tn_88{grid-area:status;align-items:center;display:flex}._glyph-complete_bw6tn_94{color:var(--cascivo-color-success-foreground)}._glyph-error_bw6tn_98{color:var(--cascivo-color-danger)}._name_bw6tn_102{text-overflow:ellipsis;white-space:nowrap;grid-area:name;overflow:hidden}._size_bw6tn_109{color:var(--cascivo-color-text-muted);font-size:var(--cascivo-font-size-xs);grid-area:size}._remove_bw6tn_115{padding:var(--cascivo-space-1);border-radius:var(--cascivo-radius-control);color:var(--cascivo-color-text-muted);cursor:pointer;font-size:var(--cascivo-font-size-xs);background:0 0;border:none;grid-area:remove;justify-content:center;align-items:center;line-height:1;display:flex}._remove_bw6tn_115:hover{color:var(--cascivo-color-danger);background:var(--cascivo-color-danger-subtle)}._error-message_bw6tn_135{font-size:var(--cascivo-font-size-xs);color:var(--cascivo-color-danger);grid-area:error}}
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
import './file-uploader.css';
|
|
4
4
|
var e = {
|
|
5
|
-
uploader: "
|
|
6
|
-
label: "
|
|
7
|
-
input: "
|
|
8
|
-
zone: "
|
|
9
|
-
hint: "
|
|
10
|
-
list: "
|
|
11
|
-
file: "
|
|
12
|
-
status: "
|
|
13
|
-
"glyph-complete": "_glyph-
|
|
14
|
-
"glyph-error": "_glyph-
|
|
15
|
-
name: "
|
|
16
|
-
size: "
|
|
17
|
-
remove: "
|
|
18
|
-
"error-message": "_error-
|
|
5
|
+
uploader: "_uploader_bw6tn_2",
|
|
6
|
+
label: "_label_bw6tn_9",
|
|
7
|
+
input: "_input_bw6tn_15",
|
|
8
|
+
zone: "_zone_bw6tn_24",
|
|
9
|
+
hint: "_hint_bw6tn_57",
|
|
10
|
+
list: "_list_bw6tn_62",
|
|
11
|
+
file: "_file_bw6tn_71",
|
|
12
|
+
status: "_status_bw6tn_88",
|
|
13
|
+
"glyph-complete": "_glyph-complete_bw6tn_94",
|
|
14
|
+
"glyph-error": "_glyph-error_bw6tn_98",
|
|
15
|
+
name: "_name_bw6tn_102",
|
|
16
|
+
size: "_size_bw6tn_109",
|
|
17
|
+
remove: "_remove_bw6tn_115",
|
|
18
|
+
"error-message": "_error-message_bw6tn_135"
|
|
19
19
|
};
|
|
20
20
|
//#endregion
|
|
21
21
|
export { e as default };
|
package/dist/header/header.js
CHANGED
|
@@ -23,13 +23,13 @@ function s({ brand: s, links: c, actions: l, sticky: u = !1, labels: d, classNam
|
|
|
23
23
|
className: e.nav,
|
|
24
24
|
children: /* @__PURE__ */ a("ul", {
|
|
25
25
|
className: e.list,
|
|
26
|
-
children: c.map((t) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a("a", {
|
|
26
|
+
children: c.map((t, n) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a("a", {
|
|
27
27
|
href: t.href,
|
|
28
28
|
"aria-current": t.active ? "page" : void 0,
|
|
29
29
|
"data-state": t.active ? "active" : void 0,
|
|
30
30
|
className: e.link,
|
|
31
31
|
children: t.label
|
|
32
|
-
}) }, t.href))
|
|
32
|
+
}) }, t.id ?? `${n}-${t.href}`))
|
|
33
33
|
})
|
|
34
34
|
}),
|
|
35
35
|
/* @__PURE__ */ a("div", { className: e.spacer }),
|
package/dist/index.d.ts
CHANGED
|
@@ -332,6 +332,12 @@ interface ToggleProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onC
|
|
|
332
332
|
checked?: boolean;
|
|
333
333
|
defaultChecked?: boolean;
|
|
334
334
|
onChange?: (checked: boolean) => void;
|
|
335
|
+
/**
|
|
336
|
+
* Renders a **visible** text label beside the switch that also becomes its
|
|
337
|
+
* accessible name. When a visible heading already labels the control, omit
|
|
338
|
+
* `label` (it would duplicate that text) and pass `aria-label` instead —
|
|
339
|
+
* `aria-label` is forwarded to the underlying button.
|
|
340
|
+
*/
|
|
335
341
|
label?: string;
|
|
336
342
|
size?: 'sm' | 'md';
|
|
337
343
|
}
|
|
@@ -406,6 +412,18 @@ declare function ToastProvider({
|
|
|
406
412
|
}: {
|
|
407
413
|
children: ReactNode;
|
|
408
414
|
}): import("react").JSX.Element;
|
|
415
|
+
/**
|
|
416
|
+
* Returns `{ toast }` — an object, not a callable. Destructure it and call
|
|
417
|
+
* `toast(...)`:
|
|
418
|
+
*
|
|
419
|
+
* ```tsx
|
|
420
|
+
* const { toast } = useToast()
|
|
421
|
+
* toast({ title: 'Saved' })
|
|
422
|
+
* ```
|
|
423
|
+
*
|
|
424
|
+
* (`useToast()(...)` is a type error — the hook returns the namespace object so
|
|
425
|
+
* more helpers can be added without changing its shape.)
|
|
426
|
+
*/
|
|
409
427
|
declare function useToast(): {
|
|
410
428
|
toast: typeof enqueue;
|
|
411
429
|
};
|
|
@@ -590,6 +608,8 @@ interface UseTocFromRegionOptions {
|
|
|
590
608
|
*/
|
|
591
609
|
declare function useTocFromRegion(ref: RefObject<HTMLElement | null>, options?: UseTocFromRegionOptions): Signal<TocItem[]>;
|
|
592
610
|
interface HeaderLink {
|
|
611
|
+
/** Stable React key. Provide when `href`/`label` may repeat (e.g. placeholder `#` links). */
|
|
612
|
+
id?: string;
|
|
593
613
|
label: string;
|
|
594
614
|
href: string;
|
|
595
615
|
active?: boolean;
|
|
@@ -616,6 +636,8 @@ declare function Header({
|
|
|
616
636
|
type SideNavTone = 'default' | 'danger' | 'warning' | 'success';
|
|
617
637
|
/** A selectable/navigable sub-item (link when `href` is set, action when `onSelect` is set). */
|
|
618
638
|
interface SideNavLinkSubItem {
|
|
639
|
+
/** Stable React key. Provide when `label`/`href` may repeat (e.g. placeholder `#` links). */
|
|
640
|
+
id?: string;
|
|
619
641
|
label: string;
|
|
620
642
|
href?: string;
|
|
621
643
|
icon?: ReactNode;
|
|
@@ -633,6 +655,8 @@ type SideNavSubItem = SideNavLinkSubItem | {
|
|
|
633
655
|
label: string;
|
|
634
656
|
};
|
|
635
657
|
interface SideNavItem {
|
|
658
|
+
/** Stable React key. Provide when `label`/`href` may repeat (e.g. placeholder `#` links). */
|
|
659
|
+
id?: string;
|
|
636
660
|
label: string;
|
|
637
661
|
href?: string;
|
|
638
662
|
icon?: ReactNode;
|
|
@@ -798,6 +822,8 @@ declare function EmptyState({
|
|
|
798
822
|
...props
|
|
799
823
|
}: EmptyStateProps): import("react").JSX.Element;
|
|
800
824
|
interface FabAction {
|
|
825
|
+
/** Stable React key. Provide when `label` may repeat across actions. */
|
|
826
|
+
id?: string;
|
|
801
827
|
/** Accessible name and visible label for the speed-dial item. */
|
|
802
828
|
label: string;
|
|
803
829
|
icon: ReactNode;
|
|
@@ -953,6 +979,8 @@ interface DataTableLabels {
|
|
|
953
979
|
selectRow?: string;
|
|
954
980
|
itemsSelected?: (n: number) => string;
|
|
955
981
|
expandRow?: string;
|
|
982
|
+
previousPage?: string;
|
|
983
|
+
nextPage?: string;
|
|
956
984
|
}
|
|
957
985
|
interface DataTableProps<Row> {
|
|
958
986
|
columns: Column<Row>[];
|
|
@@ -973,6 +1001,7 @@ interface DataTableProps<Row> {
|
|
|
973
1001
|
onChange?: (ids: string[]) => void;
|
|
974
1002
|
};
|
|
975
1003
|
batchActions?: {
|
|
1004
|
+
id?: string;
|
|
976
1005
|
label: string;
|
|
977
1006
|
onClick: (selectedIds: string[]) => void;
|
|
978
1007
|
}[];
|
|
@@ -1138,6 +1167,7 @@ interface ComboboxLabels {
|
|
|
1138
1167
|
placeholder?: string;
|
|
1139
1168
|
empty?: string;
|
|
1140
1169
|
clear?: string;
|
|
1170
|
+
search?: string;
|
|
1141
1171
|
}
|
|
1142
1172
|
interface ComboboxProps {
|
|
1143
1173
|
options: ComboboxOption[];
|
|
@@ -1526,6 +1556,7 @@ interface MultiSelectOption {
|
|
|
1526
1556
|
disabled?: boolean;
|
|
1527
1557
|
}
|
|
1528
1558
|
interface MultiSelectLabels {
|
|
1559
|
+
label?: string;
|
|
1529
1560
|
placeholder?: string;
|
|
1530
1561
|
selected?: (count: number) => string;
|
|
1531
1562
|
search?: string;
|
|
@@ -1708,16 +1739,24 @@ interface ShellHeaderBrand {
|
|
|
1708
1739
|
href?: string;
|
|
1709
1740
|
}
|
|
1710
1741
|
interface ShellHeaderNavLink {
|
|
1742
|
+
/** Stable React key. Provide when `href`/`label` may repeat (e.g. placeholder `#` links). */
|
|
1743
|
+
id?: string;
|
|
1711
1744
|
label: string;
|
|
1712
1745
|
href: string;
|
|
1713
1746
|
active?: boolean;
|
|
1747
|
+
/** Intercept navigation (e.g. a SPA section switch). Forwarded to the `<a>`. */
|
|
1748
|
+
onClick?: ((e: MouseEvent<HTMLAnchorElement>) => void) | undefined;
|
|
1714
1749
|
}
|
|
1715
1750
|
interface ShellHeaderNavMenuItem {
|
|
1751
|
+
/** Stable React key. Provide when `href`/`label` may repeat (e.g. placeholder `#` links). */
|
|
1752
|
+
id?: string;
|
|
1716
1753
|
label: string;
|
|
1717
1754
|
href: string;
|
|
1718
1755
|
active?: boolean;
|
|
1719
1756
|
}
|
|
1720
1757
|
interface ShellHeaderNavMenu {
|
|
1758
|
+
/** Stable React key. Provide when `label` may repeat across menus. */
|
|
1759
|
+
id?: string;
|
|
1721
1760
|
label: string;
|
|
1722
1761
|
items: ShellHeaderNavMenuItem[];
|
|
1723
1762
|
}
|
|
@@ -2654,6 +2693,7 @@ interface DateRangePreset {
|
|
|
2654
2693
|
range: DateRange;
|
|
2655
2694
|
}
|
|
2656
2695
|
interface DateRangePickerLabels {
|
|
2696
|
+
label?: string;
|
|
2657
2697
|
placeholder?: string;
|
|
2658
2698
|
start?: string;
|
|
2659
2699
|
end?: string;
|
|
@@ -2777,11 +2817,14 @@ interface DockProps {
|
|
|
2777
2817
|
items: DockItem[];
|
|
2778
2818
|
activeIndex?: number;
|
|
2779
2819
|
className?: string;
|
|
2820
|
+
/** Accessible label for the nav landmark */
|
|
2821
|
+
ariaLabel?: string;
|
|
2780
2822
|
}
|
|
2781
2823
|
declare function Dock({
|
|
2782
2824
|
items,
|
|
2783
2825
|
activeIndex,
|
|
2784
|
-
className
|
|
2826
|
+
className,
|
|
2827
|
+
ariaLabel
|
|
2785
2828
|
}: DockProps): import("react").JSX.Element;
|
|
2786
2829
|
interface DrawerProps {
|
|
2787
2830
|
/** Controlled open state. */
|
|
@@ -2914,12 +2957,15 @@ interface StepsProps {
|
|
|
2914
2957
|
activeStep?: number;
|
|
2915
2958
|
orientation?: 'horizontal' | 'vertical';
|
|
2916
2959
|
className?: string;
|
|
2960
|
+
/** Accessible label for the steps list */
|
|
2961
|
+
ariaLabel?: string;
|
|
2917
2962
|
}
|
|
2918
2963
|
declare function Steps({
|
|
2919
2964
|
steps,
|
|
2920
2965
|
activeStep: controlledActiveStep,
|
|
2921
2966
|
orientation,
|
|
2922
|
-
className
|
|
2967
|
+
className,
|
|
2968
|
+
ariaLabel
|
|
2923
2969
|
}: StepsProps): import("react").JSX.Element;
|
|
2924
2970
|
interface TileProps {
|
|
2925
2971
|
/** Identifies this tile within a group. */
|
|
@@ -3089,6 +3135,8 @@ declare function Swap({
|
|
|
3089
3135
|
...aria
|
|
3090
3136
|
}: SwapProps): import("react").JSX.Element;
|
|
3091
3137
|
interface SwipeAction {
|
|
3138
|
+
/** Stable React key. Provide when `label` may repeat across actions. */
|
|
3139
|
+
id?: string;
|
|
3092
3140
|
/** Accessible name and visible label. */
|
|
3093
3141
|
label: string;
|
|
3094
3142
|
icon?: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer cascivo.component{.
|
|
1
|
+
@layer cascivo.component{._root_1mutf_2{border:1px solid var(--cascivo-color-border);border-radius:var(--cascivo-radius-surface);background-color:var(--cascivo-color-surface);flex-direction:column;display:flex;overflow:clip}._toolbar_1mutf_11{align-items:center;gap:var(--cascivo-space-2);padding-block:var(--cascivo-space-2);padding-inline:var(--cascivo-space-3);border-block-end:1px solid var(--cascivo-color-border);display:flex}._search_1mutf_20{min-inline-size:0;font:inherit;font-size:var(--cascivo-text-sm);color:var(--cascivo-color-text);background-color:var(--cascivo-color-surface-raised);border:1px solid var(--cascivo-color-border);border-radius:var(--cascivo-radius-field);padding-block:var(--cascivo-space-1);padding-inline:var(--cascivo-space-2);flex:0 16rem}._count_1mutf_33{font-size:var(--cascivo-text-sm);color:var(--cascivo-color-text-muted)}._spacer_1mutf_38{flex:auto}._toggle_1mutf_42,._copy_1mutf_43{font:inherit;font-size:var(--cascivo-text-sm);color:var(--cascivo-color-text);background-color:var(--cascivo-color-surface-raised);border:1px solid var(--cascivo-color-border);border-radius:var(--cascivo-radius-button);padding-block:var(--cascivo-space-1);padding-inline:var(--cascivo-space-3);cursor:pointer}:is(._toggle_1mutf_42,._copy_1mutf_43):hover{background-color:var(--cascivo-color-surface)}:is(._toggle_1mutf_42,._copy_1mutf_43):focus-visible{outline:2px solid var(--cascivo-color-accent);outline-offset:2px}._toggle_1mutf_42[aria-pressed=true]{color:var(--cascivo-color-accent-content,var(--cascivo-color-text-on-accent));background-color:var(--cascivo-color-accent);border-color:var(--cascivo-color-accent)}@media (pointer:coarse){._toggle_1mutf_42,._copy_1mutf_43,._search_1mutf_20{min-block-size:var(--cascivo-target-min-coarse,2.75rem)}}._scroll_1mutf_81{font-family:var(--cascivo-font-mono);font-size:var(--cascivo-text-sm);color:var(--cascivo-color-text);background-color:var(--cascivo-color-surface);line-height:1.45;position:relative;overflow:auto}._scroll_1mutf_81:focus-visible{outline:2px solid var(--cascivo-color-accent);outline-offset:-2px}._sizer_1mutf_96{inline-size:100%;position:relative}._line_1mutf_101{padding-inline:var(--cascivo-space-3);white-space:pre;align-items:center;display:flex;position:absolute;inset-inline:0}._line_1mutf_101[data-level=warn]{color:var(--cascivo-color-warning-foreground)}._line_1mutf_101[data-level=error]{color:var(--cascivo-color-destructive-foreground)}._line_1mutf_101[data-level=debug]{color:var(--cascivo-color-text-subtle)}._line_1mutf_101 mark{color:inherit;background-color:var(--cascivo-color-warning-subtle);border-radius:var(--cascivo-radius-indicator)}._ansi_1mutf_128[data-ansi=red]{color:var(--cascivo-color-error)}._ansi_1mutf_128[data-ansi=green]{color:var(--cascivo-color-success)}._ansi_1mutf_128[data-ansi=yellow]{color:var(--cascivo-color-warning)}._ansi_1mutf_128[data-ansi=blue],._ansi_1mutf_128[data-ansi=cyan]{color:var(--cascivo-color-info)}._ansi_1mutf_128[data-ansi=magenta]{color:var(--cascivo-color-accent)}._ansi_1mutf_128[data-ansi=black],._ansi_1mutf_128[data-ansi=bright-black]{color:var(--cascivo-color-text-muted)}._empty_1mutf_149{padding-block:var(--cascivo-space-6);padding-inline:var(--cascivo-space-3);text-align:center;color:var(--cascivo-color-text-muted)}}
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
import './log-viewer.css';
|
|
4
4
|
var e = {
|
|
5
|
-
root: "
|
|
6
|
-
toolbar: "
|
|
7
|
-
search: "
|
|
8
|
-
count: "
|
|
9
|
-
spacer: "
|
|
10
|
-
toggle: "
|
|
11
|
-
copy: "
|
|
12
|
-
scroll: "
|
|
13
|
-
sizer: "
|
|
14
|
-
line: "
|
|
15
|
-
ansi: "
|
|
16
|
-
empty: "
|
|
5
|
+
root: "_root_1mutf_2",
|
|
6
|
+
toolbar: "_toolbar_1mutf_11",
|
|
7
|
+
search: "_search_1mutf_20",
|
|
8
|
+
count: "_count_1mutf_33",
|
|
9
|
+
spacer: "_spacer_1mutf_38",
|
|
10
|
+
toggle: "_toggle_1mutf_42",
|
|
11
|
+
copy: "_copy_1mutf_43",
|
|
12
|
+
scroll: "_scroll_1mutf_81",
|
|
13
|
+
sizer: "_sizer_1mutf_96",
|
|
14
|
+
line: "_line_1mutf_101",
|
|
15
|
+
ansi: "_ansi_1mutf_128",
|
|
16
|
+
empty: "_empty_1mutf_149"
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
19
19
|
export { e as default };
|
package/dist/menu/menu.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer cascivo.component{.
|
|
1
|
+
@layer cascivo.component{._trigger_11vpw_2{min-block-size:1.5rem;min-inline-size:1.5rem;padding:var(--cascivo-space-1);border-radius:var(--cascivo-radius-control);color:inherit;cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;display:inline-flex}._trigger_11vpw_2:hover{background:var(--cascivo-color-active-bg)}._trigger_11vpw_2:focus-visible{outline:var(--cascivo-focus-ring);outline-offset:2px}._panel_11vpw_25{padding:var(--cascivo-space-1);background:var(--cascivo-color-surface);border:1px solid var(--cascivo-color-border);border-radius:var(--cascivo-radius-overlay);min-width:10rem;box-shadow:var(--cascivo-shadow-md);margin:0;position:fixed;inset:auto}@supports (anchor-name:--a){._panel_11vpw_25{position-try-fallbacks:flip-block, flip-inline, flip-block flip-inline;inset-block-start:anchor(end);inset-inline-start:anchor(start)}}._panel_11vpw_25{opacity:1;transition:opacity var(--cascivo-motion-enter), translate var(--cascivo-motion-enter), display var(--cascivo-motion-enter) allow-discrete, overlay var(--cascivo-motion-enter) allow-discrete;translate:0}@starting-style{._panel_11vpw_25{opacity:0;translate:0 calc(-1 * var(--cascivo-space-2))}}._panel_11vpw_25[data-state=closed]{opacity:0;translate:0 calc(-1 * var(--cascivo-space-2));transition:opacity var(--cascivo-motion-exit), translate var(--cascivo-motion-exit), display var(--cascivo-motion-exit) allow-discrete, overlay var(--cascivo-motion-exit) allow-discrete}._item_11vpw_69{align-items:center;gap:var(--cascivo-space-2);padding:var(--cascivo-space-2) var(--cascivo-space-3);border-radius:var(--cascivo-radius-item);font-size:var(--cascivo-text-sm);color:var(--cascivo-color-text);cursor:pointer;-webkit-user-select:none;user-select:none;outline:none;display:flex}._item_11vpw_69:hover,._item_11vpw_69:focus-visible{background:var(--cascivo-color-bg-subtle)}._item_11vpw_69[aria-disabled=true]{opacity:.5;cursor:not-allowed}._separator_11vpw_92{height:1px;margin-block:var(--cascivo-space-1);background:var(--cascivo-color-border)}}
|
package/dist/menu/menu.js
CHANGED
|
@@ -2,80 +2,105 @@
|
|
|
2
2
|
|
|
3
3
|
import { usePopover as e } from "../popover/use-popover.js";
|
|
4
4
|
import t from "./menu.module.js";
|
|
5
|
-
import { useSignalEffect as n, useSignals as r } from "@cascivo/core";
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { createContext as
|
|
5
|
+
import { useSignalEffect as n, useSignals as r, useTypeahead as i } from "@cascivo/core";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
import { createContext as s } from "react";
|
|
8
8
|
//#region ../components/src/menu/menu.tsx
|
|
9
|
-
var
|
|
10
|
-
function
|
|
9
|
+
var c = s(null);
|
|
10
|
+
function l({ ctx: e, children: o }) {
|
|
11
11
|
r();
|
|
12
|
-
let { popoverRef:
|
|
12
|
+
let { popoverRef: s, anchorName: c, isOpen: l } = e, u = () => {
|
|
13
|
+
let e = s.current;
|
|
14
|
+
return e ? Array.from(e.querySelectorAll("[role=\"menuitem\"]:not([aria-disabled=\"true\"])")) : [];
|
|
15
|
+
}, d = (e) => {
|
|
16
|
+
let t = u();
|
|
17
|
+
t.length !== 0 && t[e(t, t.indexOf(document.activeElement))]?.focus();
|
|
18
|
+
}, f = i({ onMatch: (e) => {
|
|
19
|
+
u().find((t) => (t.textContent ?? "").trim().toLowerCase().startsWith(e))?.focus();
|
|
20
|
+
} });
|
|
13
21
|
return n(() => {
|
|
14
|
-
if (!
|
|
15
|
-
let e =
|
|
22
|
+
if (!l.value) return;
|
|
23
|
+
let e = s.current;
|
|
16
24
|
e && e.querySelector("[role=\"menuitem\"]:not([aria-disabled=\"true\"])")?.focus();
|
|
17
|
-
}), /* @__PURE__ */
|
|
18
|
-
ref:
|
|
25
|
+
}), /* @__PURE__ */ a("div", {
|
|
26
|
+
ref: s,
|
|
19
27
|
popover: "auto",
|
|
20
28
|
role: "menu",
|
|
21
|
-
"data-state":
|
|
22
|
-
style: { positionAnchor:
|
|
29
|
+
"data-state": l.value ? "open" : "closed",
|
|
30
|
+
style: { positionAnchor: c },
|
|
23
31
|
className: t.panel,
|
|
24
|
-
|
|
32
|
+
onKeyDown: (e) => {
|
|
33
|
+
switch (e.key) {
|
|
34
|
+
case "ArrowDown":
|
|
35
|
+
e.preventDefault(), d((e, t) => t < 0 ? 0 : (t + 1) % e.length);
|
|
36
|
+
break;
|
|
37
|
+
case "ArrowUp":
|
|
38
|
+
e.preventDefault(), d((e, t) => t < 0 ? e.length - 1 : (t - 1 + e.length) % e.length);
|
|
39
|
+
break;
|
|
40
|
+
case "Home":
|
|
41
|
+
e.preventDefault(), d(() => 0);
|
|
42
|
+
break;
|
|
43
|
+
case "End":
|
|
44
|
+
e.preventDefault(), d((e) => e.length - 1);
|
|
45
|
+
break;
|
|
46
|
+
default: f.onKeyDown(e);
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
children: o
|
|
25
50
|
});
|
|
26
51
|
}
|
|
27
|
-
function
|
|
28
|
-
return /* @__PURE__ */
|
|
52
|
+
function u({ children: e }) {
|
|
53
|
+
return /* @__PURE__ */ a(c.Consumer, { children: (t) => {
|
|
29
54
|
if (!t) throw Error("MenuPanel must be inside <Menu>");
|
|
30
|
-
return /* @__PURE__ */
|
|
55
|
+
return /* @__PURE__ */ a(l, {
|
|
31
56
|
ctx: t,
|
|
32
57
|
children: e
|
|
33
58
|
});
|
|
34
59
|
} });
|
|
35
60
|
}
|
|
36
|
-
function
|
|
37
|
-
let n = e(), [r, ...
|
|
38
|
-
return /* @__PURE__ */
|
|
61
|
+
function d({ children: t }) {
|
|
62
|
+
let n = e(), [r, ...i] = Array.isArray(t) ? t : [t];
|
|
63
|
+
return /* @__PURE__ */ o(c.Provider, {
|
|
39
64
|
value: n,
|
|
40
|
-
children: [r, /* @__PURE__ */
|
|
65
|
+
children: [r, /* @__PURE__ */ a(u, { children: i })]
|
|
41
66
|
});
|
|
42
67
|
}
|
|
43
|
-
function
|
|
68
|
+
function f({ ctx: e, children: n, "aria-label": i }) {
|
|
44
69
|
r();
|
|
45
70
|
let { triggerRef: o, toggle: s, anchorName: c, isOpen: l } = e;
|
|
46
|
-
return /* @__PURE__ */
|
|
71
|
+
return /* @__PURE__ */ a("button", {
|
|
47
72
|
ref: o,
|
|
48
73
|
type: "button",
|
|
49
74
|
"aria-haspopup": "menu",
|
|
50
75
|
"aria-expanded": l.value,
|
|
51
|
-
"aria-label":
|
|
76
|
+
"aria-label": i,
|
|
52
77
|
style: { anchorName: c },
|
|
53
78
|
onClick: s,
|
|
54
79
|
className: t.trigger,
|
|
55
80
|
children: n
|
|
56
81
|
});
|
|
57
82
|
}
|
|
58
|
-
function
|
|
59
|
-
return /* @__PURE__ */
|
|
83
|
+
function p({ children: e, "aria-label": t }) {
|
|
84
|
+
return /* @__PURE__ */ a(c.Consumer, { children: (n) => {
|
|
60
85
|
if (!n) throw Error("MenuTrigger must be inside <Menu>");
|
|
61
|
-
return /* @__PURE__ */
|
|
86
|
+
return /* @__PURE__ */ a(f, {
|
|
62
87
|
ctx: n,
|
|
63
88
|
...t !== void 0 && { "aria-label": t },
|
|
64
89
|
children: e
|
|
65
90
|
});
|
|
66
91
|
} });
|
|
67
92
|
}
|
|
68
|
-
function
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
-
if (!
|
|
71
|
-
let { close: o } =
|
|
93
|
+
function m({ children: e, onSelect: n, disabled: r }) {
|
|
94
|
+
return /* @__PURE__ */ a(c.Consumer, { children: (i) => {
|
|
95
|
+
if (!i) throw Error("MenuItem must be inside <Menu>");
|
|
96
|
+
let { close: o } = i;
|
|
72
97
|
function s() {
|
|
73
98
|
r || (n(), o());
|
|
74
99
|
}
|
|
75
100
|
function c(e) {
|
|
76
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
101
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), s());
|
|
77
102
|
}
|
|
78
|
-
return /* @__PURE__ */
|
|
103
|
+
return /* @__PURE__ */ a("div", {
|
|
79
104
|
role: "menuitem",
|
|
80
105
|
tabIndex: r ? -1 : 0,
|
|
81
106
|
"aria-disabled": r,
|
|
@@ -86,11 +111,11 @@ function p({ children: e, onSelect: n, disabled: r }) {
|
|
|
86
111
|
});
|
|
87
112
|
} });
|
|
88
113
|
}
|
|
89
|
-
function
|
|
90
|
-
return /* @__PURE__ */
|
|
114
|
+
function h() {
|
|
115
|
+
return /* @__PURE__ */ a("div", {
|
|
91
116
|
role: "separator",
|
|
92
117
|
className: t.separator
|
|
93
118
|
});
|
|
94
119
|
}
|
|
95
120
|
//#endregion
|
|
96
|
-
export {
|
|
121
|
+
export { d as Menu, m as MenuItem, h as MenuSeparator, p as MenuTrigger };
|
package/dist/menu/menu.module.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import './menu.css';
|
|
4
4
|
var e = {
|
|
5
|
-
trigger: "
|
|
6
|
-
panel: "
|
|
7
|
-
item: "
|
|
8
|
-
separator: "
|
|
5
|
+
trigger: "_trigger_11vpw_2",
|
|
6
|
+
panel: "_panel_11vpw_25",
|
|
7
|
+
item: "_item_11vpw_69",
|
|
8
|
+
separator: "_separator_11vpw_92"
|
|
9
9
|
};
|
|
10
10
|
//#endregion
|
|
11
11
|
export { e as default };
|