@cascivo/react 1.1.0 → 1.2.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 +1 -1
- package/dist/action-sheet/action-sheet.js +1 -1
- package/dist/alert/alert.js +1 -1
- package/dist/alert-dialog/alert-dialog.js +1 -1
- package/dist/app-shell/app-shell.css +1 -1
- package/dist/app-shell/app-shell.js +1 -1
- package/dist/app-shell/app-shell.module.js +1 -1
- package/dist/aspect-ratio/aspect-ratio.js +1 -1
- package/dist/avatar/avatar.js +1 -1
- package/dist/avatar-group/avatar-group.js +1 -1
- package/dist/badge/badge.js +1 -1
- package/dist/blockquote/blockquote.js +1 -1
- package/dist/bottom-sheet/bottom-sheet.js +1 -1
- package/dist/brand/logo/logo.js +1 -1
- package/dist/breadcrumb/breadcrumb.js +1 -1
- package/dist/button/button.css +1 -1
- package/dist/button/button.module.js +1 -1
- package/dist/button-group/button-group.js +1 -1
- package/dist/calendar/calendar-date.js +1 -1
- package/dist/calendar/calendar.js +1 -1
- package/dist/card/card.js +1 -1
- package/dist/carousel/carousel.js +1 -1
- package/dist/chat-bubble/chat-bubble.js +1 -1
- package/dist/code/code.js +1 -1
- package/dist/code-snippet/code-snippet.js +2 -2
- package/dist/code-snippet/highlight.js +1 -1
- package/dist/collapsible/collapsible.js +1 -1
- package/dist/color-picker/color-picker.js +1 -1
- package/dist/color-picker/color.js +1 -1
- package/dist/combobox/combobox.js +1 -1
- package/dist/combobox/list-nav.js +1 -1
- package/dist/combobox/option-list.js +1 -1
- package/dist/command-menu/command-menu.js +1 -1
- package/dist/comparison/comparison.js +1 -1
- package/dist/contained-list/contained-list.js +1 -1
- package/dist/context-menu/context-menu.js +1 -1
- package/dist/data-list/data-list.js +1 -1
- package/dist/data-table/column-filter.js +1 -1
- package/dist/data-table/column-layout.js +1 -1
- package/dist/data-table/data-table.js +1 -1
- package/dist/data-table/grid-keys.js +1 -1
- package/dist/data-table/row-group.js +1 -1
- package/dist/data-table/row-search.js +1 -1
- package/dist/data-table/row-sort.js +1 -1
- package/dist/data-table/to-csv.js +2 -2
- package/dist/data-table/virtual-window.js +1 -1
- package/dist/date-picker/date-picker.js +1 -1
- package/dist/date-picker/parse-date.js +1 -1
- package/dist/date-range-picker/date-range-picker.js +1 -1
- package/dist/dock/dock.js +1 -1
- package/dist/drawer/drawer.js +1 -1
- package/dist/dropdown/dropdown.js +1 -1
- package/dist/editable/editable.js +1 -1
- package/dist/empty-state/empty-state.js +1 -1
- package/dist/fab/fab.js +1 -1
- package/dist/field/field.js +1 -1
- package/dist/file-uploader/file-uploader.js +1 -1
- package/dist/filter/filter.js +1 -1
- package/dist/form/form.js +1 -1
- package/dist/header/header.js +1 -1
- package/dist/header-panel/header-panel.js +1 -1
- package/dist/heading/heading.js +1 -1
- package/dist/hover-card/hover-card.js +1 -1
- package/dist/image/image.js +1 -1
- package/dist/index.d.ts +749 -13
- package/dist/indicator/indicator.js +1 -1
- package/dist/infinite-scroll/infinite-scroll.js +1 -1
- package/dist/inline-loading/inline-loading.js +1 -1
- package/dist/input-group/input-group.js +1 -1
- package/dist/item/item.js +1 -1
- package/dist/join/join.js +1 -1
- package/dist/kbd/kbd.js +1 -1
- package/dist/label/label.js +1 -1
- package/dist/large-title-header/large-title-header.js +1 -1
- package/dist/layouts/src/auto-grid/auto-grid.js +1 -1
- package/dist/layouts/src/center/center.js +1 -1
- package/dist/layouts/src/columns/columns.js +1 -1
- package/dist/layouts/src/flex/flex.css +1 -1
- package/dist/layouts/src/flex/flex.js +1 -1
- package/dist/layouts/src/flex/flex.module.js +1 -1
- package/dist/layouts/src/grid/grid.js +1 -1
- package/dist/layouts/src/page-header/page-header.js +1 -1
- package/dist/layouts/src/spacer/spacer.js +1 -1
- package/dist/list/list.js +1 -1
- package/dist/log-viewer/log-viewer.css +1 -1
- package/dist/log-viewer/log-viewer.js +2 -2
- package/dist/log-viewer/log-viewer.module.js +1 -1
- package/dist/menu/menu.js +1 -1
- package/dist/menu-button/menu-button.js +1 -1
- package/dist/menubar/menubar.js +1 -1
- package/dist/modal/modal.js +1 -1
- package/dist/multi-select/list-nav.js +1 -1
- package/dist/multi-select/multi-select.js +1 -1
- package/dist/multi-select/option-list.js +1 -1
- package/dist/navigation-menu/navigation-menu.js +1 -1
- package/dist/node/accordion/accordion.js +1 -1
- package/dist/node/action-sheet/action-sheet.js +1 -1
- package/dist/node/alert/alert.js +1 -1
- package/dist/node/alert-dialog/alert-dialog.js +1 -1
- package/dist/node/app-shell/app-shell.js +1 -1
- package/dist/node/app-shell/app-shell.module.js +1 -1
- package/dist/node/aspect-ratio/aspect-ratio.js +1 -1
- package/dist/node/avatar/avatar.js +1 -1
- package/dist/node/avatar-group/avatar-group.js +1 -1
- package/dist/node/badge/badge.js +1 -1
- package/dist/node/blockquote/blockquote.js +1 -1
- package/dist/node/bottom-sheet/bottom-sheet.js +1 -1
- package/dist/node/brand/logo/logo.js +1 -1
- package/dist/node/breadcrumb/breadcrumb.js +1 -1
- package/dist/node/button/button.module.js +1 -1
- package/dist/node/button-group/button-group.js +1 -1
- package/dist/node/calendar/calendar-date.js +1 -1
- package/dist/node/calendar/calendar.js +1 -1
- package/dist/node/card/card.js +1 -1
- package/dist/node/carousel/carousel.js +1 -1
- package/dist/node/chat-bubble/chat-bubble.js +1 -1
- package/dist/node/code/code.js +1 -1
- package/dist/node/code-snippet/code-snippet.js +2 -2
- package/dist/node/code-snippet/highlight.js +1 -1
- package/dist/node/collapsible/collapsible.js +1 -1
- package/dist/node/color-picker/color-picker.js +1 -1
- package/dist/node/color-picker/color.js +1 -1
- package/dist/node/combobox/combobox.js +1 -1
- package/dist/node/combobox/list-nav.js +1 -1
- package/dist/node/combobox/option-list.js +1 -1
- package/dist/node/command-menu/command-menu.js +1 -1
- package/dist/node/comparison/comparison.js +1 -1
- package/dist/node/contained-list/contained-list.js +1 -1
- package/dist/node/context-menu/context-menu.js +1 -1
- package/dist/node/data-list/data-list.js +1 -1
- package/dist/node/data-table/column-filter.js +1 -1
- package/dist/node/data-table/column-layout.js +1 -1
- package/dist/node/data-table/data-table.js +1 -1
- package/dist/node/data-table/grid-keys.js +1 -1
- package/dist/node/data-table/row-group.js +1 -1
- package/dist/node/data-table/row-search.js +1 -1
- package/dist/node/data-table/row-sort.js +1 -1
- package/dist/node/data-table/to-csv.js +2 -2
- package/dist/node/data-table/virtual-window.js +1 -1
- package/dist/node/date-picker/date-picker.js +1 -1
- package/dist/node/date-picker/parse-date.js +1 -1
- package/dist/node/date-range-picker/date-range-picker.js +1 -1
- package/dist/node/dock/dock.js +1 -1
- package/dist/node/drawer/drawer.js +1 -1
- package/dist/node/dropdown/dropdown.js +1 -1
- package/dist/node/editable/editable.js +1 -1
- package/dist/node/empty-state/empty-state.js +1 -1
- package/dist/node/fab/fab.js +1 -1
- package/dist/node/field/field.js +1 -1
- package/dist/node/file-uploader/file-uploader.js +1 -1
- package/dist/node/filter/filter.js +1 -1
- package/dist/node/form/form.js +1 -1
- package/dist/node/header/header.js +1 -1
- package/dist/node/header-panel/header-panel.js +1 -1
- package/dist/node/heading/heading.js +1 -1
- package/dist/node/hover-card/hover-card.js +1 -1
- package/dist/node/image/image.js +1 -1
- package/dist/node/indicator/indicator.js +1 -1
- package/dist/node/infinite-scroll/infinite-scroll.js +1 -1
- package/dist/node/inline-loading/inline-loading.js +1 -1
- package/dist/node/input-group/input-group.js +1 -1
- package/dist/node/item/item.js +1 -1
- package/dist/node/join/join.js +1 -1
- package/dist/node/kbd/kbd.js +1 -1
- package/dist/node/label/label.js +1 -1
- package/dist/node/large-title-header/large-title-header.js +1 -1
- package/dist/node/layouts/src/auto-grid/auto-grid.js +1 -1
- package/dist/node/layouts/src/center/center.js +1 -1
- package/dist/node/layouts/src/columns/columns.js +1 -1
- package/dist/node/layouts/src/flex/flex.js +1 -1
- package/dist/node/layouts/src/flex/flex.module.js +1 -1
- package/dist/node/layouts/src/grid/grid.js +1 -1
- package/dist/node/layouts/src/page-header/page-header.js +1 -1
- package/dist/node/layouts/src/spacer/spacer.js +1 -1
- package/dist/node/list/list.js +1 -1
- package/dist/node/log-viewer/log-viewer.js +2 -2
- package/dist/node/log-viewer/log-viewer.module.js +1 -1
- package/dist/node/menu/menu.js +1 -1
- package/dist/node/menu-button/menu-button.js +1 -1
- package/dist/node/menubar/menubar.js +1 -1
- package/dist/node/modal/modal.js +1 -1
- package/dist/node/multi-select/list-nav.js +1 -1
- package/dist/node/multi-select/multi-select.js +1 -1
- package/dist/node/multi-select/option-list.js +1 -1
- package/dist/node/navigation-menu/navigation-menu.js +1 -1
- package/dist/node/notification/notification.js +1 -1
- package/dist/node/number-input/number-input.js +1 -1
- package/dist/node/otp-input/otp-input.js +1 -1
- package/dist/node/overflow-menu/overflow-menu.js +1 -1
- package/dist/node/pagination/pagination.js +1 -1
- package/dist/node/password-input/password-input.js +1 -1
- package/dist/node/popover/popover.js +1 -1
- package/dist/node/popover/use-popover.js +1 -1
- package/dist/node/progress/progress.js +1 -1
- package/dist/node/progress-bar/progress-bar.js +1 -1
- package/dist/node/progress-circle/progress-circle.js +1 -1
- package/dist/node/progress-indicator/progress-indicator.js +1 -1
- package/dist/node/prose/prose.js +1 -1
- package/dist/node/pull-to-refresh/pull-to-refresh.js +1 -1
- package/dist/node/qr-code/encode.js +1 -1
- package/dist/node/qr-code/qr-code.js +1 -1
- package/dist/node/radial-progress/radial-progress.js +1 -1
- package/dist/node/radio/radio.js +1 -1
- package/dist/node/radio-card/radio-card.js +1 -1
- package/dist/node/rating-group/rating-group.js +1 -1
- package/dist/node/react/src/index.js +1 -1
- package/dist/node/relative-time/relative-time.js +1 -1
- package/dist/node/reorder-list/reorder-list.js +1 -1
- package/dist/node/resizable/resizable.js +1 -1
- package/dist/node/scroll-area/scroll-area.js +1 -1
- package/dist/node/search/search.js +1 -1
- package/dist/node/segmented-control/segmented-control.js +1 -1
- package/dist/node/separator/separator.js +1 -1
- package/dist/node/sheet/sheet.js +1 -1
- package/dist/node/shell-header/shell-header.js +1 -1
- package/dist/node/side-nav/side-nav.js +1 -1
- package/dist/node/side-nav/side-nav.module.js +1 -1
- package/dist/node/skeleton/skeleton.js +1 -1
- package/dist/node/skip-nav/skip-nav.js +1 -1
- package/dist/node/spinner/spinner.js +1 -1
- package/dist/node/stack/stack.js +1 -1
- package/dist/node/stat/stat.js +1 -1
- package/dist/node/status/status.js +1 -1
- package/dist/node/steps/steps.js +1 -1
- package/dist/node/structured-list/structured-list.js +1 -1
- package/dist/node/swap/swap.js +1 -1
- package/dist/node/swipe-item/swipe-item.js +1 -1
- package/dist/node/switcher/switcher.js +1 -1
- package/dist/node/tabs/tabs.js +1 -1
- package/dist/node/tag/tag.js +1 -1
- package/dist/node/tags-input/tags-input.js +1 -1
- package/dist/node/text/text.js +1 -1
- package/dist/node/tile/tile.js +1 -1
- package/dist/node/timeline/timeline.js +1 -1
- package/dist/node/toast/toast.js +1 -1
- package/dist/node/toc/toc.js +1 -1
- package/dist/node/toc/use-toc-from-region.js +1 -1
- package/dist/node/toggle-group/toggle-group.js +1 -1
- package/dist/node/toggletip/toggletip.js +1 -1
- package/dist/node/tooltip/tooltip.js +1 -1
- package/dist/node/tree-view/tree-view.js +1 -1
- package/dist/node/user/user.js +1 -1
- package/dist/node/virtual-list/virtual-list.js +1 -1
- package/dist/node/wheel-picker/wheel-picker.js +1 -1
- package/dist/notification/notification.js +1 -1
- package/dist/number-input/number-input.js +1 -1
- package/dist/otp-input/otp-input.js +1 -1
- package/dist/overflow-menu/overflow-menu.js +1 -1
- package/dist/pagination/pagination.js +1 -1
- package/dist/password-input/password-input.js +1 -1
- package/dist/popover/popover.js +1 -1
- package/dist/popover/use-popover.js +1 -1
- package/dist/progress/progress.js +1 -1
- package/dist/progress-bar/progress-bar.js +1 -1
- package/dist/progress-circle/progress-circle.js +1 -1
- package/dist/progress-indicator/progress-indicator.js +1 -1
- package/dist/prose/prose.js +1 -1
- package/dist/pull-to-refresh/pull-to-refresh.js +1 -1
- package/dist/qr-code/encode.js +1 -1
- package/dist/qr-code/qr-code.js +1 -1
- package/dist/radial-progress/radial-progress.js +1 -1
- package/dist/radio/radio.js +1 -1
- package/dist/radio-card/radio-card.js +1 -1
- package/dist/rating-group/rating-group.js +1 -1
- package/dist/react/src/index.js +1 -1
- package/dist/relative-time/relative-time.js +1 -1
- package/dist/reorder-list/reorder-list.js +1 -1
- package/dist/resizable/resizable.js +1 -1
- package/dist/scroll-area/scroll-area.js +1 -1
- package/dist/search/search.js +1 -1
- package/dist/segmented-control/segmented-control.js +1 -1
- package/dist/separator/separator.js +1 -1
- package/dist/sheet/sheet.js +1 -1
- package/dist/shell-header/shell-header.js +1 -1
- package/dist/side-nav/side-nav.css +1 -1
- package/dist/side-nav/side-nav.js +1 -1
- package/dist/side-nav/side-nav.module.js +1 -1
- package/dist/skeleton/skeleton.js +1 -1
- package/dist/skip-nav/skip-nav.js +1 -1
- package/dist/spinner/spinner.js +1 -1
- package/dist/stack/stack.js +1 -1
- package/dist/stat/stat.js +1 -1
- package/dist/status/status.js +1 -1
- package/dist/steps/steps.js +1 -1
- package/dist/structured-list/structured-list.js +1 -1
- package/dist/styles.css +10 -6
- package/dist/swap/swap.js +1 -1
- package/dist/swipe-item/swipe-item.js +1 -1
- package/dist/switcher/switcher.js +1 -1
- package/dist/tabs/tabs.js +1 -1
- package/dist/tag/tag.js +1 -1
- package/dist/tags-input/tags-input.js +1 -1
- package/dist/text/text.js +1 -1
- package/dist/tile/tile.js +1 -1
- package/dist/timeline/timeline.js +1 -1
- package/dist/toast/toast.js +1 -1
- package/dist/toc/toc.js +1 -1
- package/dist/toc/use-toc-from-region.js +1 -1
- package/dist/toggle-group/toggle-group.js +1 -1
- package/dist/toggletip/toggletip.js +1 -1
- package/dist/tooltip/tooltip.js +1 -1
- package/dist/tree-view/tree-view.js +1 -1
- package/dist/user/user.js +1 -1
- package/dist/virtual-list/virtual-list.js +1 -1
- package/dist/wheel-picker/wheel-picker.js +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1332,6 +1332,11 @@ interface SideNavGroup {
|
|
|
1332
1332
|
label?: string;
|
|
1333
1333
|
items: SideNavItem[];
|
|
1334
1334
|
}
|
|
1335
|
+
/** What the `header` / `footer` render functions receive. */
|
|
1336
|
+
interface SideNavSlotContext {
|
|
1337
|
+
/** `true` while the nav is collapsed to its icon rail. */
|
|
1338
|
+
collapsed: boolean;
|
|
1339
|
+
}
|
|
1335
1340
|
interface SideNavProps {
|
|
1336
1341
|
items?: SideNavItem[];
|
|
1337
1342
|
groups?: SideNavGroup[];
|
|
@@ -1387,11 +1392,20 @@ interface SideNavProps {
|
|
|
1387
1392
|
* @see the component manifest
|
|
1388
1393
|
*/
|
|
1389
1394
|
showCollapseToggle?: boolean;
|
|
1390
|
-
/**
|
|
1391
|
-
|
|
1395
|
+
/**
|
|
1396
|
+
* Content rendered above the items, inside the item padding context.
|
|
1397
|
+
*
|
|
1398
|
+
* Accepts a render function as well as a node: `header={({ collapsed }) => …}` receives
|
|
1399
|
+
* the live rail state, so a team switcher can shrink to its avatar on the rail instead of
|
|
1400
|
+
* being clipped. `SideNavItem.render` already worked this way; the slots did not, which is
|
|
1401
|
+
* what forced an adopter to control `collapsed` from outside purely to read it
|
|
1402
|
+
* (2026-08-31 report §18).
|
|
1403
|
+
*/
|
|
1404
|
+
header?: ReactNode | ((ctx: SideNavSlotContext) => ReactNode);
|
|
1392
1405
|
/** Content rendered above the collapse toggle, inside the item padding context —
|
|
1393
|
-
* it lines up with the nav items above it, exactly as `header` does.
|
|
1394
|
-
|
|
1406
|
+
* it lines up with the nav items above it, exactly as `header` does. Accepts the same
|
|
1407
|
+
* `({ collapsed }) => …` render function. */
|
|
1408
|
+
footer?: ReactNode | ((ctx: SideNavSlotContext) => ReactNode);
|
|
1395
1409
|
className?: string;
|
|
1396
1410
|
}
|
|
1397
1411
|
declare function SideNav({
|
|
@@ -1760,13 +1774,18 @@ interface SearchProps {
|
|
|
1760
1774
|
*/
|
|
1761
1775
|
label?: string;
|
|
1762
1776
|
/**
|
|
1763
|
-
*
|
|
1764
|
-
* labels it and `label` would render that text a second time.
|
|
1777
|
+
* Accessible name set through `aria-label` instead of a rendered `<label>` element.
|
|
1765
1778
|
*
|
|
1766
|
-
* `
|
|
1767
|
-
*
|
|
1768
|
-
*
|
|
1769
|
-
*
|
|
1779
|
+
* ⚠ On `Search`, **both** props give an invisible name — `label` renders a real `<label>`
|
|
1780
|
+
* that the stylesheet visually hides (see it above). The two differ in mechanism, not in
|
|
1781
|
+
* what you see: `label` names the control through a `<label for>` association, `ariaLabel`
|
|
1782
|
+
* through the attribute. Use `ariaLabel` when a visible element outside the component
|
|
1783
|
+
* already labels the field, so nothing is announced twice; use `label` otherwise.
|
|
1784
|
+
*
|
|
1785
|
+
* This docblock previously read "`label` on this component is **visible**", copied from
|
|
1786
|
+
* `Input`/`Select`/`Toggle` where that is true. It is not true here, and the contradiction
|
|
1787
|
+
* sat inside the `.d.ts` the docs tell you to trust over everything else (2026-08-31
|
|
1788
|
+
* report §20).
|
|
1770
1789
|
*/
|
|
1771
1790
|
ariaLabel?: string;
|
|
1772
1791
|
/**
|
|
@@ -3544,6 +3563,18 @@ interface SegmentedControlProps extends Omit<HTMLAttributes<HTMLDivElement>, 'on
|
|
|
3544
3563
|
value: string;
|
|
3545
3564
|
onValueChange: (v: string) => void;
|
|
3546
3565
|
size?: 'sm' | 'md' | 'lg';
|
|
3566
|
+
/**
|
|
3567
|
+
* Accessible name for the group. Invisible — it names the `role="group"`, it renders
|
|
3568
|
+
* nothing.
|
|
3569
|
+
*
|
|
3570
|
+
* This component extended `HTMLAttributes` and nothing else, so it took the raw DOM
|
|
3571
|
+
* `aria-label` while every sibling in the catalog took `ariaLabel` — the one control in an
|
|
3572
|
+
* adopter's filter toolbar where the catalog spelling was a type error (2026-08-31 report
|
|
3573
|
+
* §21). Both spellings work now; the raw `aria-label` still wins if you pass both.
|
|
3574
|
+
*/
|
|
3575
|
+
ariaLabel?: string;
|
|
3576
|
+
/** Alias of `ariaLabel` — same invisible accessible name, the other spelling. Not rendered. */
|
|
3577
|
+
label?: string;
|
|
3547
3578
|
/**
|
|
3548
3579
|
* When true, disables the control and removes it from the tab order.
|
|
3549
3580
|
*
|
|
@@ -3558,6 +3589,8 @@ declare function SegmentedControl({
|
|
|
3558
3589
|
onValueChange,
|
|
3559
3590
|
size,
|
|
3560
3591
|
disabled,
|
|
3592
|
+
ariaLabel,
|
|
3593
|
+
label,
|
|
3561
3594
|
className,
|
|
3562
3595
|
...props
|
|
3563
3596
|
}: SegmentedControlProps): import("react").JSX.Element;
|
|
@@ -4185,6 +4218,19 @@ interface LogLine {
|
|
|
4185
4218
|
text: string;
|
|
4186
4219
|
/** Semantic level driving the row color when `ansi` is off. */
|
|
4187
4220
|
level?: LogLevel;
|
|
4221
|
+
/**
|
|
4222
|
+
* Timestamp for the line, rendered in its own dimmed, column-aligned gutter.
|
|
4223
|
+
*
|
|
4224
|
+
* Pass it here rather than prefixing `text` by hand. A timestamp inside `text` cannot be
|
|
4225
|
+
* dimmed or aligned independently and pollutes the built-in search — typing `08:59` matched
|
|
4226
|
+
* every line of a build log (2026-08-31 report §23). This gutter is excluded from both
|
|
4227
|
+
* search and the match count, and from the text the copy button writes; `timestampWidth`
|
|
4228
|
+
* sizes it.
|
|
4229
|
+
*
|
|
4230
|
+
* Pre-formatted on purpose: every console formats its clock differently (relative offsets,
|
|
4231
|
+
* ISO, locale time), and `@cascivo/i18n`'s formatters already cover that.
|
|
4232
|
+
*/
|
|
4233
|
+
timestamp?: string;
|
|
4188
4234
|
}
|
|
4189
4235
|
interface LogViewerLabels {
|
|
4190
4236
|
searchPlaceholder?: string;
|
|
@@ -4229,6 +4275,14 @@ interface LogViewerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'
|
|
|
4229
4275
|
search?: string;
|
|
4230
4276
|
/** Max block size of the scroll region (CSS length). Default '24rem'. */
|
|
4231
4277
|
maxHeight?: string;
|
|
4278
|
+
/**
|
|
4279
|
+
* Width of the `LogLine.timestamp` gutter (CSS length). Widen it for an ISO stamp, narrow
|
|
4280
|
+
* it for a relative offset.
|
|
4281
|
+
*
|
|
4282
|
+
* @defaultValue `'6.5rem'`
|
|
4283
|
+
* @see the component manifest
|
|
4284
|
+
*/
|
|
4285
|
+
timestampWidth?: string;
|
|
4232
4286
|
labels?: LogViewerLabels;
|
|
4233
4287
|
}
|
|
4234
4288
|
/**
|
|
@@ -4246,6 +4300,7 @@ declare function LogViewer({
|
|
|
4246
4300
|
ansi,
|
|
4247
4301
|
search,
|
|
4248
4302
|
maxHeight,
|
|
4303
|
+
timestampWidth,
|
|
4249
4304
|
labels,
|
|
4250
4305
|
className,
|
|
4251
4306
|
...props
|
|
@@ -5071,13 +5126,30 @@ declare function ContainedListItem({
|
|
|
5071
5126
|
children,
|
|
5072
5127
|
...props
|
|
5073
5128
|
}: ContainedListItemProps): import("react").JSX.Element;
|
|
5074
|
-
|
|
5129
|
+
/** One label/value pair in a config-driven `DataList`. */
|
|
5130
|
+
interface DataListEntry {
|
|
5075
5131
|
id?: string;
|
|
5076
5132
|
label: ReactNode;
|
|
5077
5133
|
value: ReactNode;
|
|
5078
5134
|
}
|
|
5135
|
+
/**
|
|
5136
|
+
* The label/value pair shape.
|
|
5137
|
+
*
|
|
5138
|
+
* @deprecated Use `DataListEntry`. `DataListItem` is now also the **component** — every
|
|
5139
|
+
* structural sibling in the catalog is one (`AccordionItem`, `ContextMenuItem`,
|
|
5140
|
+
* `TimelineItem`, `ListItem`, `ContainedListItem`, `StructuredListItem`, `SwipeItem`), so an
|
|
5141
|
+
* adopter wrote `<DataList><DataListItem label="Domain">…</DataListItem></DataList>` and hit
|
|
5142
|
+
* a type where a component belonged (2026-08-31 report §22). TypeScript keeps a type and a
|
|
5143
|
+
* function of the same name in separate spaces, so this alias holds existing
|
|
5144
|
+
* `DataListItem[]` annotations compiling while the JSX now works; it is removed at 2.0.
|
|
5145
|
+
*/
|
|
5146
|
+
type DataListItem = DataListEntry;
|
|
5079
5147
|
interface DataListProps extends HTMLAttributes<HTMLDListElement> {
|
|
5080
|
-
|
|
5148
|
+
/**
|
|
5149
|
+
* The pairs to render. Omit it and pass `<DataListItem>` children instead when a value
|
|
5150
|
+
* needs surrounding JSX (a `Status`, a `CopyButton`) that reads better inline.
|
|
5151
|
+
*/
|
|
5152
|
+
items?: DataListEntry[];
|
|
5081
5153
|
/**
|
|
5082
5154
|
* Where each **value** sits relative to its own label — not the axis of the list.
|
|
5083
5155
|
*
|
|
@@ -5099,6 +5171,8 @@ interface DataListProps extends HTMLAttributes<HTMLDListElement> {
|
|
|
5099
5171
|
*/
|
|
5100
5172
|
dividers?: boolean;
|
|
5101
5173
|
size?: 'sm' | 'md';
|
|
5174
|
+
/** `<DataListItem>` rows, as an alternative to `items`. */
|
|
5175
|
+
children?: ReactNode;
|
|
5102
5176
|
}
|
|
5103
5177
|
declare function DataList({
|
|
5104
5178
|
items,
|
|
@@ -5106,8 +5180,26 @@ declare function DataList({
|
|
|
5106
5180
|
dividers,
|
|
5107
5181
|
size,
|
|
5108
5182
|
className,
|
|
5183
|
+
children,
|
|
5109
5184
|
...props
|
|
5110
5185
|
}: DataListProps): import("react").JSX.Element;
|
|
5186
|
+
interface DataListItemProps {
|
|
5187
|
+
/** The term. Rendered as the row's `<dt>`. */
|
|
5188
|
+
label: ReactNode;
|
|
5189
|
+
/** The value. Rendered as the row's `<dd>`. */
|
|
5190
|
+
children: ReactNode;
|
|
5191
|
+
}
|
|
5192
|
+
/**
|
|
5193
|
+
* One row of a `DataList`, for when a value needs surrounding JSX that reads better inline
|
|
5194
|
+
* than inside an `items` array.
|
|
5195
|
+
*
|
|
5196
|
+
* Must be a direct child of `DataList` — it renders the `<dt>`/`<dd>` pair that a `<dl>`
|
|
5197
|
+
* expects, and inherits every layout token (`orientation`, `size`, `dividers`) from it.
|
|
5198
|
+
*/
|
|
5199
|
+
declare function DataListItem({
|
|
5200
|
+
label,
|
|
5201
|
+
children
|
|
5202
|
+
}: DataListItemProps): import("react").JSX.Element;
|
|
5111
5203
|
interface TimelineItem {
|
|
5112
5204
|
id: string;
|
|
5113
5205
|
title: ReactNode;
|
|
@@ -6468,6 +6560,59 @@ declare function Flex({
|
|
|
6468
6560
|
style,
|
|
6469
6561
|
...props
|
|
6470
6562
|
}: FlexProps): import("react").JSX.Element;
|
|
6563
|
+
/**
|
|
6564
|
+
* How a `Flex` child sizes itself along the main axis.
|
|
6565
|
+
*
|
|
6566
|
+
* `'auto'` grows and shrinks (`flex: 1 1 auto`); `'fixed'` does neither (`flex: 0 0 auto`),
|
|
6567
|
+
* which is what a fixed-width child like `Sparkline` needs; `'grow'` takes the leftover space
|
|
6568
|
+
* without shrinking below its content; `'shrink'` gives way but never grows.
|
|
6569
|
+
*/
|
|
6570
|
+
type FlexItemSize = 'auto' | 'fixed' | 'grow' | 'shrink';
|
|
6571
|
+
interface FlexItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
6572
|
+
/**
|
|
6573
|
+
* Main-axis sizing behaviour.
|
|
6574
|
+
*
|
|
6575
|
+
* `Flex` had no item-level control at all, so the documented fix for a fixed-width child —
|
|
6576
|
+
* pull it out of flex sizing — was unwritable in cascivo and every dashboard reached for a
|
|
6577
|
+
* raw `style={{ flex: '0 0 auto' }}` wrapper. All four raw-CSS escapes in one 1,500-line
|
|
6578
|
+
* app were this (2026-08-31 report §24).
|
|
6579
|
+
*
|
|
6580
|
+
* @defaultValue `auto`
|
|
6581
|
+
* @see the component manifest
|
|
6582
|
+
*/
|
|
6583
|
+
size?: FlexItemSize;
|
|
6584
|
+
/**
|
|
6585
|
+
* `flex-basis` — the child's size before free space is distributed. Any CSS length; `0`
|
|
6586
|
+
* with `size="grow"` gives equal-width columns regardless of content.
|
|
6587
|
+
*/
|
|
6588
|
+
basis?: string;
|
|
6589
|
+
/**
|
|
6590
|
+
* Allow the child to shrink below its intrinsic content width.
|
|
6591
|
+
*
|
|
6592
|
+
* A flex item defaults to `min-width: auto`, so a long unbreakable string (a deployment
|
|
6593
|
+
* URL, a commit sha) refuses to shrink and pushes its siblings out of the row. This is the
|
|
6594
|
+
* `minWidth: 0` every layout eventually writes by hand.
|
|
6595
|
+
*
|
|
6596
|
+
* @defaultValue `false`
|
|
6597
|
+
* @see the component manifest
|
|
6598
|
+
*/
|
|
6599
|
+
truncate?: boolean;
|
|
6600
|
+
}
|
|
6601
|
+
/**
|
|
6602
|
+
* A `Flex` child with main-axis sizing, the counterpart to `GridItem`.
|
|
6603
|
+
*
|
|
6604
|
+
* Only needed for a child that must NOT size like the rest — a fixed-width `Sparkline`, the
|
|
6605
|
+
* one field in a toolbar that should absorb the leftover width, a cell whose text must be
|
|
6606
|
+
* allowed to ellipsize. Children with no special sizing need no wrapper.
|
|
6607
|
+
*/
|
|
6608
|
+
declare function FlexItem({
|
|
6609
|
+
size,
|
|
6610
|
+
basis,
|
|
6611
|
+
truncate,
|
|
6612
|
+
className,
|
|
6613
|
+
style,
|
|
6614
|
+
...props
|
|
6615
|
+
}: FlexItemProps): import("react").JSX.Element;
|
|
6471
6616
|
interface ColumnsProps extends HTMLAttributes<HTMLDivElement> {
|
|
6472
6617
|
/**
|
|
6473
6618
|
* Number of equal columns
|
|
@@ -6687,7 +6832,9 @@ export {
|
|
|
6687
6832
|
CopyButton,
|
|
6688
6833
|
CopyButtonProps,
|
|
6689
6834
|
DataList,
|
|
6835
|
+
DataListEntry,
|
|
6690
6836
|
DataListItem,
|
|
6837
|
+
DataListItemProps,
|
|
6691
6838
|
DataListProps,
|
|
6692
6839
|
DataTable,
|
|
6693
6840
|
DataTableLabels,
|
|
@@ -6731,6 +6878,9 @@ export {
|
|
|
6731
6878
|
FilterProps,
|
|
6732
6879
|
FilterVariant,
|
|
6733
6880
|
Flex,
|
|
6881
|
+
FlexItem,
|
|
6882
|
+
FlexItemProps,
|
|
6883
|
+
FlexItemSize,
|
|
6734
6884
|
FlexProps,
|
|
6735
6885
|
FocusScope,
|
|
6736
6886
|
Form,
|
|
@@ -6941,6 +7091,7 @@ export {
|
|
|
6941
7091
|
SideNavLinkProps,
|
|
6942
7092
|
SideNavLinkSubItem,
|
|
6943
7093
|
SideNavProps,
|
|
7094
|
+
SideNavSlotContext,
|
|
6944
7095
|
SideNavSubItem,
|
|
6945
7096
|
SideNavTone,
|
|
6946
7097
|
Skeleton,
|
|
@@ -7093,4 +7244,589 @@ export {
|
|
|
7093
7244
|
useToast,
|
|
7094
7245
|
useTocFromRegion,
|
|
7095
7246
|
useTypeahead,
|
|
7096
|
-
};
|
|
7247
|
+
};
|
|
7248
|
+
// ════ Re-exported from `@cascivo/core` ═══════════════════════════════════════════
|
|
7249
|
+
//
|
|
7250
|
+
// The declarations below live in `@cascivo/core`, a TRANSITIVE dependency on this path —
|
|
7251
|
+
// do not add it to your package.json. Their docblocks are reproduced here so this file
|
|
7252
|
+
// stays the one place to read, and to grep, for every name it exports.
|
|
7253
|
+
//
|
|
7254
|
+
// ── applyTheme ──────────────────────────────────────────────────────────────────
|
|
7255
|
+
// /**
|
|
7256
|
+
// * Write a theme onto an element directly, with no provider and no React.
|
|
7257
|
+
// *
|
|
7258
|
+
// * The escape hatch for imperative setups: a theme toggle in a non-React shell, a
|
|
7259
|
+
// * pre-hydration inline script, a Storybook decorator, an e2e test. Also updates the theme
|
|
7260
|
+
// * signal, so a React tree reading {@link useTheme} stays in sync.
|
|
7261
|
+
// *
|
|
7262
|
+
// * `setTheme` deliberately does **not** do this itself: it is SSR-callable, and
|
|
7263
|
+
// * `ThemeProvider` can scope a theme to any subtree via its `target` ref. A direct document
|
|
7264
|
+
// * write inside `setTheme` would break scoped theming and touch `document` on the server.
|
|
7265
|
+
// *
|
|
7266
|
+
// * ```ts
|
|
7267
|
+
// * applyTheme('midnight') // <html data-theme="midnight">
|
|
7268
|
+
// * applyTheme('warm', panelRef.current) // scope to a subtree
|
|
7269
|
+
// * ```
|
|
7270
|
+
// *
|
|
7271
|
+
// * No-op on the server (no `document`).
|
|
7272
|
+
// */
|
|
7273
|
+
// declare function applyTheme(next: string, target?: HTMLElement | null): void;
|
|
7274
|
+
//
|
|
7275
|
+
// ── cn ──────────────────────────────────────────────────────────────────────────
|
|
7276
|
+
// declare function cn(...classes: (string | undefined | null | false | 0)[]): string;
|
|
7277
|
+
//
|
|
7278
|
+
// ── composeRefs ─────────────────────────────────────────────────────────────────
|
|
7279
|
+
// declare function composeRefs<T>(...refs: (Ref<T> | undefined)[]): RefCallback<T>;
|
|
7280
|
+
//
|
|
7281
|
+
// ── computePosition ─────────────────────────────────────────────────────────────
|
|
7282
|
+
// declare function computePosition(anchor: {
|
|
7283
|
+
//
|
|
7284
|
+
// ── createMachine ───────────────────────────────────────────────────────────────
|
|
7285
|
+
// declare function createMachine<S extends string, I extends S = S>(config: MachineConfig<S, I>): Machine<S>;
|
|
7286
|
+
//
|
|
7287
|
+
// ── createScope ─────────────────────────────────────────────────────────────────
|
|
7288
|
+
// /**
|
|
7289
|
+
// * A disposable owner for a set of signals/computeds/effects. Use one scope per
|
|
7290
|
+
// * tenant boundary — a workspace, an org, a repository group. When the user
|
|
7291
|
+
// * switches scope, call `dispose()` and create a fresh scope: every effect the
|
|
7292
|
+
// * old scope started stops firing at once, with no orphaned subscriptions or
|
|
7293
|
+
// * stale state left running against unmounted UI.
|
|
7294
|
+
// *
|
|
7295
|
+
// * This is a thin ownership wrapper over `@cascivo/core` signals — not a store,
|
|
7296
|
+
// * not a context, not a DI container. Prefer it over accumulating per-workspace
|
|
7297
|
+
// * state in a single global signal root, which leaks effects across switches.
|
|
7298
|
+
// */
|
|
7299
|
+
// declare function createScope(): SignalScope;
|
|
7300
|
+
//
|
|
7301
|
+
// ── createStreamBuffer ──────────────────────────────────────────────────────────
|
|
7302
|
+
// /**
|
|
7303
|
+
// * A fixed-capacity ring buffer with O(1) append and once-per-frame flushing —
|
|
7304
|
+
// * the primitive for high-frequency streams (build logs, live metrics).
|
|
7305
|
+
// *
|
|
7306
|
+
// * Memory is O(capacity), not O(total appended): the backing array is allocated
|
|
7307
|
+
// * once and overwritten in place. A burst of N appends within one animation
|
|
7308
|
+
// * frame produces a single `signal` write (one render), so ingestion rate is
|
|
7309
|
+
// * decoupled from render rate.
|
|
7310
|
+
// *
|
|
7311
|
+
// * This replaces the O(n)-per-line anti-pattern
|
|
7312
|
+
// * `logsSignal.value = [...logsSignal.value.slice(1), line]`, which reallocates
|
|
7313
|
+
// * and re-copies the whole array on every append and renders once per line.
|
|
7314
|
+
// */
|
|
7315
|
+
// declare function createStreamBuffer<T>(options: StreamBufferOptions): StreamBuffer<T>;
|
|
7316
|
+
//
|
|
7317
|
+
// ── DismissableLayer ────────────────────────────────────────────────────────────
|
|
7318
|
+
// /**
|
|
7319
|
+
// * Wraps its children and dismisses on an outside pointer press or Escape. One tested implementation
|
|
7320
|
+
// * of the dismissal logic every overlay reinvents. Nested layers form a stack — only the top-most
|
|
7321
|
+
// * responds to Escape and outside pointers. All listeners run inside `useSignalEffect`.
|
|
7322
|
+
// */
|
|
7323
|
+
// declare function DismissableLayer( {
|
|
7324
|
+
//
|
|
7325
|
+
// ── DismissableLayerProps ───────────────────────────────────────────────────────
|
|
7326
|
+
// interface DismissableLayerProps {
|
|
7327
|
+
// children: ReactNode;
|
|
7328
|
+
// /** Called when an outside pointer lands or Escape is pressed (when this is the top-most layer). */
|
|
7329
|
+
// onDismiss?: () => void;
|
|
7330
|
+
// /** Disable the outside-pointer dismissal (Escape still works unless escapeDismisses is false). */
|
|
7331
|
+
// disableOutsidePointer?: boolean;
|
|
7332
|
+
// /** Whether Escape dismisses the top-most layer. Default true. */
|
|
7333
|
+
// escapeDismisses?: boolean;
|
|
7334
|
+
// }
|
|
7335
|
+
//
|
|
7336
|
+
// ── ErrorBoundary ───────────────────────────────────────────────────────────────
|
|
7337
|
+
// declare class ErrorBoundary extends Component<ErrorBoundaryProps, State> {
|
|
7338
|
+
//
|
|
7339
|
+
// ── FocusScope ──────────────────────────────────────────────────────────────────
|
|
7340
|
+
// declare function FocusScope( {
|
|
7341
|
+
//
|
|
7342
|
+
// ── getLinkComponent ────────────────────────────────────────────────────────────
|
|
7343
|
+
// declare function getLinkComponent(): LinkComponent;
|
|
7344
|
+
//
|
|
7345
|
+
// ── LinkComponent ───────────────────────────────────────────────────────────────
|
|
7346
|
+
// /**
|
|
7347
|
+
// * A component (or intrinsic tag) that renders a navigation link. It receives a
|
|
7348
|
+
// * {@link LinkComponentProps} bag (an `href` plus anchor passthrough) and must
|
|
7349
|
+
// * render an actual `<a>` (or equivalent) so the browser and the router see a real
|
|
7350
|
+
// * link. `'a'` is the default.
|
|
7351
|
+
// */
|
|
7352
|
+
// type LinkComponent = ElementType;
|
|
7353
|
+
//
|
|
7354
|
+
// ── LinkComponentProps ──────────────────────────────────────────────────────────
|
|
7355
|
+
// /**
|
|
7356
|
+
// * The prop bag cascivo's config-driven nav components spread onto the link they
|
|
7357
|
+
// * render — the exact contract a custom {@link LinkComponent} receives. Map `href`
|
|
7358
|
+
// * to your router's destination prop (TanStack Router uses `to`) and spread the
|
|
7359
|
+
// * rest so active-state and accessibility attributes carry over. Because navigation
|
|
7360
|
+
// * stays a real `<a>`, middle-click / open-in-new-tab keep working — you do not need
|
|
7361
|
+
// * to intercept `onClick`.
|
|
7362
|
+
// */
|
|
7363
|
+
// interface LinkComponentProps {
|
|
7364
|
+
// /** Destination URL. Undefined for a disabled item. Map to your router's prop. */
|
|
7365
|
+
// href?: string | undefined;
|
|
7366
|
+
// /** Class names cascivo computes (layout + active-state styling). */
|
|
7367
|
+
// className?: string | undefined;
|
|
7368
|
+
// /** Rendered link content — cascivo's computed icon + label + trailing nodes. */
|
|
7369
|
+
// children?: ReactNode;
|
|
7370
|
+
// /**
|
|
7371
|
+
// * Click handler cascivo attaches. It only calls `preventDefault()` for a disabled
|
|
7372
|
+
// * item; otherwise it is inert. Spread it onto your router `<Link>` — routers
|
|
7373
|
+
// * compose their own click handling with a passed-through `onClick`.
|
|
7374
|
+
// */
|
|
7375
|
+
// onClick?: (e: MouseEvent<HTMLAnchorElement>) => void;
|
|
7376
|
+
// /** `'page'` on the active item (assistive tech + active styling). */
|
|
7377
|
+
// 'aria-current'?: 'page' | undefined;
|
|
7378
|
+
// 'aria-label'?: string | undefined;
|
|
7379
|
+
// 'aria-disabled'?: boolean | undefined;
|
|
7380
|
+
// /** `'active'` on the current item — a style hook mirroring `aria-current`. */
|
|
7381
|
+
// 'data-state'?: 'active' | undefined;
|
|
7382
|
+
// tabIndex?: number | undefined;
|
|
7383
|
+
// /**
|
|
7384
|
+
// * Additional computed `data-*` attributes cascivo may attach (e.g. `data-tone`).
|
|
7385
|
+
// * Spread the whole bag so future attributes carry over without an adapter change.
|
|
7386
|
+
// */
|
|
7387
|
+
// [dataAttr: `data-${string}`]: string | undefined;
|
|
7388
|
+
// }
|
|
7389
|
+
//
|
|
7390
|
+
// ── Machine ─────────────────────────────────────────────────────────────────────
|
|
7391
|
+
// interface Machine<S extends string = string> {
|
|
7392
|
+
// initial: S;
|
|
7393
|
+
// states: Record<S, StateConfig>;
|
|
7394
|
+
// }
|
|
7395
|
+
//
|
|
7396
|
+
// ── MachineConfig ───────────────────────────────────────────────────────────────
|
|
7397
|
+
// interface MachineConfig<S extends string = string, I extends S = S> {
|
|
7398
|
+
// initial: I;
|
|
7399
|
+
// states: Record<S, StateConfig>;
|
|
7400
|
+
// }
|
|
7401
|
+
//
|
|
7402
|
+
// ── mergeProps ──────────────────────────────────────────────────────────────────
|
|
7403
|
+
// declare function mergeProps<T extends Record<string, unknown>>(...propsList: Partial<T>[]): T;
|
|
7404
|
+
//
|
|
7405
|
+
// ── Portal ──────────────────────────────────────────────────────────────────────
|
|
7406
|
+
// declare function Portal( {
|
|
7407
|
+
//
|
|
7408
|
+
// ── Presence ────────────────────────────────────────────────────────────────────
|
|
7409
|
+
// /**
|
|
7410
|
+
// * The return type is declared rather than inferred. Inferred, it widened to
|
|
7411
|
+
// * `ReactElement<…, string | JSXElementConstructor<any>>`, which leaked React's internal
|
|
7412
|
+
// * `any` into cascivo's published `.d.ts` — the only such leak the surface had that was
|
|
7413
|
+
// * cascivo's own to fix.
|
|
7414
|
+
// */
|
|
7415
|
+
// declare function Presence( {
|
|
7416
|
+
//
|
|
7417
|
+
// ── ProgressInput ───────────────────────────────────────────────────────────────
|
|
7418
|
+
// type ProgressInput = Progress | ProgressAlias;
|
|
7419
|
+
//
|
|
7420
|
+
// ── RovingOrientation ───────────────────────────────────────────────────────────
|
|
7421
|
+
// type RovingOrientation = 'horizontal' | 'vertical' | 'both';
|
|
7422
|
+
//
|
|
7423
|
+
// ── setLinkComponent ────────────────────────────────────────────────────────────
|
|
7424
|
+
// /**
|
|
7425
|
+
// * Register the component cascivo's config-driven nav components (SideNav,
|
|
7426
|
+
// * ShellHeader, Header, Breadcrumb, Switcher, Dock) use to render links. Call once
|
|
7427
|
+
// * at app startup. The component receives the full {@link LinkComponentProps} bag —
|
|
7428
|
+
// * spread it so active-state and a11y attributes carry over, and so middle-click /
|
|
7429
|
+
// * open-in-new-tab keep working (no `onClick` interception needed). Framework recipes:
|
|
7430
|
+
// *
|
|
7431
|
+
// * ```tsx
|
|
7432
|
+
// * // TanStack Router — its Link takes `to`, so map href → to and spread the rest:
|
|
7433
|
+
// * import { Link } from '@tanstack/react-router'
|
|
7434
|
+
// * import type { LinkComponentProps } from '@cascivo/react' // or '@cascivo/core' for copied source
|
|
7435
|
+
// * setLinkComponent(({ href, ...rest }: LinkComponentProps) => <Link to={href} {...rest} />)
|
|
7436
|
+
// *
|
|
7437
|
+
// * // React Router — its Link takes `to`, and `to` is REQUIRED, so supply a fallback
|
|
7438
|
+
// * // for the disabled-item case where cascivo passes `href: undefined`:
|
|
7439
|
+
// * import { Link } from 'react-router'
|
|
7440
|
+
// * import type { LinkComponentProps } from '@cascivo/react' // or '@cascivo/core' for copied source
|
|
7441
|
+
// * setLinkComponent(({ href, ...rest }: LinkComponentProps) => <Link to={href ?? '#'} {...rest} />)
|
|
7442
|
+
// *
|
|
7443
|
+
// * // Next.js — its Link takes `href` directly:
|
|
7444
|
+
// * import Link from 'next/link'
|
|
7445
|
+
// * setLinkComponent(Link)
|
|
7446
|
+
// * ```
|
|
7447
|
+
// *
|
|
7448
|
+
// * Full guide: https://cascivo.com/docs/using-with-a-router.md — offline:
|
|
7449
|
+
// * `npx -y @cascivo/docs guide using-with-a-router`.
|
|
7450
|
+
// */
|
|
7451
|
+
// declare function setLinkComponent(component: (props: LinkComponentProps) => ReactElement | null): void;
|
|
7452
|
+
//
|
|
7453
|
+
// ── setTheme ────────────────────────────────────────────────────────────────────
|
|
7454
|
+
// /**
|
|
7455
|
+
// * Set the active theme imperatively, from anywhere. Persists the choice and
|
|
7456
|
+
// * drives the `data-theme` attribute through the mounted {@link ThemeProvider}.
|
|
7457
|
+
// *
|
|
7458
|
+
// * Requires a mounted {@link ThemeProvider} — this writes the signal, the provider writes
|
|
7459
|
+
// * the DOM. Without one, nothing restyles (dev builds warn). To write the attribute
|
|
7460
|
+
// * directly, with no provider and no React, use {@link applyTheme}.
|
|
7461
|
+
// */
|
|
7462
|
+
// declare function setTheme(next: string): void;
|
|
7463
|
+
//
|
|
7464
|
+
// ── Signal ──────────────────────────────────────────────────────────────────────
|
|
7465
|
+
// /**
|
|
7466
|
+
// * The base class for plain and computed signals.
|
|
7467
|
+
// */
|
|
7468
|
+
// declare class Signal<T = any> {
|
|
7469
|
+
//
|
|
7470
|
+
// ── Slot ────────────────────────────────────────────────────────────────────────
|
|
7471
|
+
// /**
|
|
7472
|
+
// * Slot renders its single child element while merging the Slot's own props and ref onto it —
|
|
7473
|
+
// * the Radix-style `asChild` composition primitive, built on cascivo's existing
|
|
7474
|
+
// * `mergeProps`/`composeRefs`/`cn`.
|
|
7475
|
+
// *
|
|
7476
|
+
// * - Non-handler props: child wins (so the consumer's element controls its own identity).
|
|
7477
|
+
// * - `on*` handlers: chained (Slot's runs, then the child's) via `mergeProps`.
|
|
7478
|
+
// * - `className`: unioned via `cn`. `style`: shallow-merged (child wins on conflicts).
|
|
7479
|
+
// * - `ref`: composed so both the Slot consumer's ref and the child's own ref receive the node.
|
|
7480
|
+
// *
|
|
7481
|
+
// * Fails fast if `children` is not exactly one valid React element.
|
|
7482
|
+
// */
|
|
7483
|
+
// declare const Slot: import("react").ForwardRefExoticComponent<Omit<SlotProps, "ref"> & import("react").RefAttributes<unknown>>;
|
|
7484
|
+
//
|
|
7485
|
+
// ── SlotProps ───────────────────────────────────────────────────────────────────
|
|
7486
|
+
// interface SlotProps {
|
|
7487
|
+
// children?: ReactNode;
|
|
7488
|
+
// className?: string;
|
|
7489
|
+
// style?: CSSProperties;
|
|
7490
|
+
// [key: string]: unknown;
|
|
7491
|
+
// }
|
|
7492
|
+
//
|
|
7493
|
+
// ── SpaceStep ───────────────────────────────────────────────────────────────────
|
|
7494
|
+
// /**
|
|
7495
|
+
// * A step on cascivo's spacing scale, mapping to the `--cascivo-space-*` design
|
|
7496
|
+
// * tokens. Used by the `gap` (and related) props of the layout primitives.
|
|
7497
|
+
// *
|
|
7498
|
+
// * The scale is deliberately non-linear and **skips 7** — it mirrors the token
|
|
7499
|
+
// * scale (`--cascivo-space-1 … -6, -8, -10, -12`), which has no `space-7`. So
|
|
7500
|
+
// * `gap={7}` is a type error by design; use `6` or `8`.
|
|
7501
|
+
// *
|
|
7502
|
+
// * Note the props take a **number**, not a string: write `gap={4}`, not `gap="4"`
|
|
7503
|
+
// * (a string is not assignable to `SpaceStep`).
|
|
7504
|
+
// *
|
|
7505
|
+
// * Lives in `@cascivo/core` (a dependency every layout primitive already has) as a
|
|
7506
|
+
// * single shared declaration, so the published `@cascivo/react` types name it
|
|
7507
|
+
// * `SpaceStep` everywhere — never the dts bundler's deduped `SpaceStep$N` aliases —
|
|
7508
|
+
// * and each copied layout component resolves it from its `@cascivo/core` dep.
|
|
7509
|
+
// */
|
|
7510
|
+
// type SpaceStep = 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12;
|
|
7511
|
+
//
|
|
7512
|
+
// ── SuspenseBoundary ────────────────────────────────────────────────────────────
|
|
7513
|
+
// declare function SuspenseBoundary( {
|
|
7514
|
+
//
|
|
7515
|
+
// ── themePreloadScript ──────────────────────────────────────────────────────────
|
|
7516
|
+
// /**
|
|
7517
|
+
// * A tiny script to inline in your document `<head>` (before the app bundle) so
|
|
7518
|
+
// * the persisted theme paints on the first byte — no flash of the wrong theme on
|
|
7519
|
+
// * SSR or a hard reload. Pass the same `storageKey`/`attribute`/`defaultTheme`
|
|
7520
|
+
// * you give {@link ThemeProvider}.
|
|
7521
|
+
// *
|
|
7522
|
+
// * Precedence matches {@link ThemeProvider}: persisted value > `defaultTheme`
|
|
7523
|
+
// * (if set) > OS `prefers-color-scheme` > `'light'`. Passing `defaultTheme`
|
|
7524
|
+
// * suppresses the OS check, so a "dark by default" app stays dark on a light-OS
|
|
7525
|
+
// * visitor.
|
|
7526
|
+
// *
|
|
7527
|
+
// * The script sets `data-theme` **before** React hydrates, so add
|
|
7528
|
+
// * `suppressHydrationWarning` to the element that carries the attribute (usually
|
|
7529
|
+
// * `<html>`) — the mutation is intentional, and without the flag React 19 logs a
|
|
7530
|
+
// * hydration mismatch.
|
|
7531
|
+
// *
|
|
7532
|
+
// * ```tsx
|
|
7533
|
+
// * // Next.js app/layout.tsx
|
|
7534
|
+
// * <html suppressHydrationWarning>
|
|
7535
|
+
// * <head>
|
|
7536
|
+
// * <script dangerouslySetInnerHTML={{ __html: themePreloadScript({ defaultTheme: 'dark' }) }} />
|
|
7537
|
+
// * </head>
|
|
7538
|
+
// * </html>
|
|
7539
|
+
// * ```
|
|
7540
|
+
// */
|
|
7541
|
+
// declare function themePreloadScript(options?: {
|
|
7542
|
+
//
|
|
7543
|
+
// ── ThemeProvider ───────────────────────────────────────────────────────────────
|
|
7544
|
+
// /**
|
|
7545
|
+
// * Binds the active theme signal to a `data-theme` attribute and persists the
|
|
7546
|
+
// * choice — the reusable, SSR-safe form of the wiring apps otherwise hand-roll.
|
|
7547
|
+
// *
|
|
7548
|
+
// * - No flash of the wrong theme: pair with {@link themePreloadScript} in your
|
|
7549
|
+
// * document `<head>` so the correct theme paints on first byte.
|
|
7550
|
+
// * - No banned React hooks: the DOM write happens in `useSignalEffect`, not
|
|
7551
|
+
// * `useEffect`; there is no `useState`/`useContext`.
|
|
7552
|
+
// * - Uncontrolled by default (persists to localStorage); pass `value` to control.
|
|
7553
|
+
// * - SSR-safe when controlled: with a `value` (and no scoped `target`), the
|
|
7554
|
+
// * provider renders a tiny inline script that sets `data-theme` during HTML
|
|
7555
|
+
// * parsing, so the server-rendered first paint is themed — no flash, no
|
|
7556
|
+
// * hydration mismatch (the same markup renders on both sides; the client effect
|
|
7557
|
+
// * owns every update after hydration). For the uncontrolled/persisted flow, pair
|
|
7558
|
+
// * with {@link themePreloadScript} in `<head>` instead.
|
|
7559
|
+
// */
|
|
7560
|
+
// declare function ThemeProvider( {
|
|
7561
|
+
//
|
|
7562
|
+
// ── ThemeProviderProps ──────────────────────────────────────────────────────────
|
|
7563
|
+
// interface ThemeProviderProps {
|
|
7564
|
+
// /**
|
|
7565
|
+
// * Theme to use when nothing is persisted yet. When set, it **wins over** the
|
|
7566
|
+
// * visitor's OS `prefers-color-scheme` — pass it for a "dark by default" or
|
|
7567
|
+
// * custom-theme (`'midnight'`, …) app. Omit it to follow the OS (light/dark),
|
|
7568
|
+
// * falling back to `'light'`. Precedence: persisted value > `defaultTheme` (if
|
|
7569
|
+
// * set) > OS preference > `'light'`.
|
|
7570
|
+
// */
|
|
7571
|
+
// defaultTheme?: string;
|
|
7572
|
+
// /**
|
|
7573
|
+
// * Controlled theme. When set, the provider mirrors it on every render and the
|
|
7574
|
+
// * persisted value is ignored — the parent owns the state (React semantics).
|
|
7575
|
+
// */
|
|
7576
|
+
// value?: string;
|
|
7577
|
+
// /** localStorage key for the persisted choice. Defaults to `cascivo-theme`. */
|
|
7578
|
+
// storageKey?: string;
|
|
7579
|
+
// /** Attribute written to the target element. Defaults to `data-theme`. */
|
|
7580
|
+
// attribute?: string;
|
|
7581
|
+
// /**
|
|
7582
|
+
// * Element to theme. Omit to theme the whole document (`<html>`). Pass a ref to
|
|
7583
|
+
// * a container to scope the theme to a subtree — cascivo themes resolve against
|
|
7584
|
+
// * the nearest `data-theme`, so a scoped subtree can differ from the page.
|
|
7585
|
+
// */
|
|
7586
|
+
// target?: RefObject<HTMLElement | null>;
|
|
7587
|
+
// /** Called whenever the active theme changes. */
|
|
7588
|
+
// onChange?: (theme: string) => void;
|
|
7589
|
+
// /**
|
|
7590
|
+
// * CSP nonce forwarded to the inline attribute-setter script emitted for the
|
|
7591
|
+
// * controlled ({@link ThemeProviderProps.value}) SSR flow. Set it to match your
|
|
7592
|
+
// * Content-Security-Policy `script-src 'nonce-…'`.
|
|
7593
|
+
// */
|
|
7594
|
+
// nonce?: string;
|
|
7595
|
+
// children?: ReactNode;
|
|
7596
|
+
// }
|
|
7597
|
+
//
|
|
7598
|
+
// ── themeSignal ─────────────────────────────────────────────────────────────────
|
|
7599
|
+
// /**
|
|
7600
|
+
// * The underlying theme signal, for signal-native code — `computed()`, `effect()`,
|
|
7601
|
+
// * or a Preact app where signals are natively reactive. Most React apps want
|
|
7602
|
+
// * {@link useTheme}, which hands back a plain string and handles subscription.
|
|
7603
|
+
// */
|
|
7604
|
+
// declare function themeSignal(): Signal<string>;
|
|
7605
|
+
//
|
|
7606
|
+
// ── ToneInput ───────────────────────────────────────────────────────────────────
|
|
7607
|
+
// type ToneInput = Tone | ToneAlias;
|
|
7608
|
+
//
|
|
7609
|
+
// ── useAnchorPosition ───────────────────────────────────────────────────────────
|
|
7610
|
+
// /**
|
|
7611
|
+
// * Positions a floating element relative to an anchor. Primary path: CSS anchor positioning
|
|
7612
|
+
// * (Chrome-leading) — emits `anchor-name`/`position-anchor` + `anchor()` insets. Fallback (behind
|
|
7613
|
+
// * `CSS.supports`): JS `getBoundingClientRect` placement recomputed on scroll/resize inside
|
|
7614
|
+
// * `useSignalEffect`. Small by design — not a collision/flip engine (deferred).
|
|
7615
|
+
// */
|
|
7616
|
+
// declare function useAnchorPosition(options: UseAnchorPositionOptions): UseAnchorPositionReturn;
|
|
7617
|
+
//
|
|
7618
|
+
// ── useClipboard ────────────────────────────────────────────────────────────────
|
|
7619
|
+
// /**
|
|
7620
|
+
// * Copy-to-clipboard helper that de-dupes the inline logic in `copy-button`.
|
|
7621
|
+
// * `copy(text)` writes via `navigator.clipboard.writeText`; `copied` flips true then resets after
|
|
7622
|
+
// * `timeout`. The reset timer is cleared on unmount via `useSignalEffect` (no `useEffect`).
|
|
7623
|
+
// */
|
|
7624
|
+
// declare function useClipboard(options?: UseClipboardOptions): UseClipboardReturn;
|
|
7625
|
+
//
|
|
7626
|
+
// ── UseClipboardOptions ─────────────────────────────────────────────────────────
|
|
7627
|
+
// interface UseClipboardOptions {
|
|
7628
|
+
// /** How long `copied` stays true after a successful copy, in ms. */
|
|
7629
|
+
// timeout?: number;
|
|
7630
|
+
// }
|
|
7631
|
+
//
|
|
7632
|
+
// ── UseClipboardReturn ──────────────────────────────────────────────────────────
|
|
7633
|
+
// interface UseClipboardReturn {
|
|
7634
|
+
// copied: ReadonlySignal<boolean>;
|
|
7635
|
+
// copy: (text: string) => Promise<void>;
|
|
7636
|
+
// }
|
|
7637
|
+
//
|
|
7638
|
+
// ── useComputed ─────────────────────────────────────────────────────────────────
|
|
7639
|
+
// /**
|
|
7640
|
+
// * Derived reactive state (use instead of a `useMemo`/`useState` pair). Recomputes only when a
|
|
7641
|
+
// * signal it reads changes.
|
|
7642
|
+
// *
|
|
7643
|
+
// * Calls `useSignals()` internally — same contract and same tracking-window caveat as
|
|
7644
|
+
// * {@link useSignal}.
|
|
7645
|
+
// */
|
|
7646
|
+
// declare function useComputed<T>(compute: () => T): ReadonlySignal<T>;
|
|
7647
|
+
//
|
|
7648
|
+
// ── useControllableSignal ───────────────────────────────────────────────────────
|
|
7649
|
+
// /**
|
|
7650
|
+
// * Codifies the controlled/uncontrolled pattern documented by hand in CLAUDE.md
|
|
7651
|
+
// * (`const x = useSignal(open); x.value = open`).
|
|
7652
|
+
// *
|
|
7653
|
+
// * Returns a `[signal, setValue]` pair:
|
|
7654
|
+
// * - **Controlled** (`value` provided): the signal mirrors `value` on every render; `setValue`
|
|
7655
|
+
// * does not mutate the signal locally — it only routes the request through `onChange` so the
|
|
7656
|
+
// * parent owns the state (React semantics).
|
|
7657
|
+
// * - **Uncontrolled** (`value` undefined): the signal owns the state seeded from `defaultValue`;
|
|
7658
|
+
// * `setValue` updates it locally and also calls `onChange`.
|
|
7659
|
+
// *
|
|
7660
|
+
// * Whether a component is controlled is fixed for its life, exactly like React.
|
|
7661
|
+
// */
|
|
7662
|
+
// declare function useControllableSignal<T>(options: UseControllableSignalOptions<T>): [Signal<T>, (next: T) => void];
|
|
7663
|
+
//
|
|
7664
|
+
// ── UseControllableSignalOptions ────────────────────────────────────────────────
|
|
7665
|
+
// interface UseControllableSignalOptions<T> {
|
|
7666
|
+
// /** Controlled value. When provided, the component is controlled for its whole life. */
|
|
7667
|
+
// value?: T | undefined;
|
|
7668
|
+
// /** Initial value for uncontrolled use. */
|
|
7669
|
+
// defaultValue?: T | undefined;
|
|
7670
|
+
// /** Called on every write, in both controlled and uncontrolled modes. */
|
|
7671
|
+
// onChange?: ((value: T) => void) | undefined;
|
|
7672
|
+
// }
|
|
7673
|
+
//
|
|
7674
|
+
// ── useDisclosure ───────────────────────────────────────────────────────────────
|
|
7675
|
+
// /**
|
|
7676
|
+
// * Open/close state for overlays (modal, drawer, popover, …), replacing the
|
|
7677
|
+
// * per-component `useSignal(open)` boilerplate. Backed by `useControllableSignal`
|
|
7678
|
+
// * so it is controlled when `isOpen` is passed and uncontrolled otherwise.
|
|
7679
|
+
// * Replaces HeroUI's `@heroui/use-disclosure`. No `useState`/`useEffect`.
|
|
7680
|
+
// */
|
|
7681
|
+
// declare function useDisclosure(options?: UseDisclosureOptions): UseDisclosureReturn;
|
|
7682
|
+
//
|
|
7683
|
+
// ── UseDisclosureOptions ────────────────────────────────────────────────────────
|
|
7684
|
+
// interface UseDisclosureOptions {
|
|
7685
|
+
// /** Initial open state for uncontrolled use. */
|
|
7686
|
+
// defaultOpen?: boolean;
|
|
7687
|
+
// /** Controlled open state. When provided, the parent owns the state. */
|
|
7688
|
+
// isOpen?: boolean;
|
|
7689
|
+
// /** Called whenever open/close/toggle is requested. */
|
|
7690
|
+
// onOpenChange?: (open: boolean) => void;
|
|
7691
|
+
// }
|
|
7692
|
+
//
|
|
7693
|
+
// ── UseDisclosureReturn ─────────────────────────────────────────────────────────
|
|
7694
|
+
// interface UseDisclosureReturn {
|
|
7695
|
+
// isOpen: ReadonlySignal<boolean>;
|
|
7696
|
+
// open: () => void;
|
|
7697
|
+
// close: () => void;
|
|
7698
|
+
// toggle: () => void;
|
|
7699
|
+
// }
|
|
7700
|
+
//
|
|
7701
|
+
// ── useEffectPropSignal ─────────────────────────────────────────────────────────
|
|
7702
|
+
// /**
|
|
7703
|
+
// * Mirror a controlled React prop into a signal that is read **inside effects**, not in
|
|
7704
|
+
// * render. The write is deferred to a microtask, so a prop change never runs a subscribed
|
|
7705
|
+
// * `useSignalEffect` body during React's render phase.
|
|
7706
|
+
// *
|
|
7707
|
+
// * ## Which mirror do I want?
|
|
7708
|
+
// *
|
|
7709
|
+
// * | The signal is read… | Use | Why |
|
|
7710
|
+
// * | --- | --- | --- |
|
|
7711
|
+
// * | in render (JSX, a `data-*` attribute, a derived value) | `useControllableSignal` — or the plain `const s = useSignal(prop); s.value = prop` idiom | The write must be synchronous or the component renders one tick stale. A render-phase write that only notifies the *writing* component's own subscription is a legal same-fiber render-phase update. |
|
|
7712
|
+
// * | only inside `useSignalEffect` | **this** | Preact signals run effects **synchronously on write**, so a render-phase write executes effect bodies mid-render — imperative DOM calls (`showModal()`), listener registration against a pre-commit ref, and parent `setState` callbacks, all inside React's render phase. React warns `Cannot update a component while rendering a different component`; the behavior is wrong even when it doesn't. |
|
|
7713
|
+
// *
|
|
7714
|
+
// * That distinction is the rule; it is documented in `CLAUDE.md` ("Syncing a controlled React
|
|
7715
|
+
// * prop into a signal"), `docs/HEADLESS.md`, and `docs/AI-RULES.md`.
|
|
7716
|
+
// *
|
|
7717
|
+
// * ## Constraints
|
|
7718
|
+
// *
|
|
7719
|
+
// * - **Do not read the returned signal in render.** It lags the prop by one microtask by
|
|
7720
|
+
// * design. Read the prop itself, or use `useControllableSignal`.
|
|
7721
|
+
// * - **Pass a primitive.** A value with a new identity every render (an inline object or
|
|
7722
|
+
// * array literal) never compares equal, so the effect would re-run every render. Mirror
|
|
7723
|
+
// * its identity-stable parts instead.
|
|
7724
|
+
// * - SSR-safe: on the server the first render's value already matches, so nothing is ever
|
|
7725
|
+
// * scheduled and no work can leak between requests.
|
|
7726
|
+
// */
|
|
7727
|
+
// declare function useEffectPropSignal<T>(value: T): ReadonlySignal<T>;
|
|
7728
|
+
//
|
|
7729
|
+
// ── useId ───────────────────────────────────────────────────────────────────────
|
|
7730
|
+
// /**
|
|
7731
|
+
// * SSR-safe stable id for aria wiring (Label/Field). Wraps React's `useId` and strips the
|
|
7732
|
+
// * non-selector-safe colons React emits, prefixing for readability (default `cascivo`).
|
|
7733
|
+
// */
|
|
7734
|
+
// declare function useId(prefix?: string): string;
|
|
7735
|
+
//
|
|
7736
|
+
// ── useMachine ──────────────────────────────────────────────────────────────────
|
|
7737
|
+
// declare function useMachine<S extends string>(machine: Machine<S>): readonly [Signal<S>, (event: string) => void];
|
|
7738
|
+
//
|
|
7739
|
+
// ── useMediaQuery ───────────────────────────────────────────────────────────────
|
|
7740
|
+
// /**
|
|
7741
|
+
// * `useMediaQuery(query)` → a `ReadonlySignal<boolean>` that tracks whether the media query matches.
|
|
7742
|
+
// * SSR-safe (defaults to `false` when `window`/`matchMedia` is unavailable). Subscribes to changes
|
|
7743
|
+
// * inside `useSignalEffect`; the listener is cleaned up on teardown.
|
|
7744
|
+
// */
|
|
7745
|
+
// declare function useMediaQuery(query: string): ReadonlySignal<boolean>;
|
|
7746
|
+
//
|
|
7747
|
+
// ── useRovingFocus ──────────────────────────────────────────────────────────────
|
|
7748
|
+
// /**
|
|
7749
|
+
// * Roving tabindex without context. The parent calls `useRovingFocus(...)` and spreads
|
|
7750
|
+
// * `getItemProps(i)` onto each item. Only the active item is tabbable (`tabIndex={0}`); arrow keys
|
|
7751
|
+
// * move focus (Home/End jump; `loop` wraps). State lives in a signal; this hook calls `useSignals()`
|
|
7752
|
+
// * for you, so a plain React consumer that reads the active index in render stays reactive.
|
|
7753
|
+
// */
|
|
7754
|
+
// declare function useRovingFocus(options?: UseRovingFocusOptions): UseRovingFocusReturn;
|
|
7755
|
+
//
|
|
7756
|
+
// ── useScope ────────────────────────────────────────────────────────────────────
|
|
7757
|
+
// /**
|
|
7758
|
+
// * Bind a {@link createScope} to a component's lifetime: created once on mount,
|
|
7759
|
+
// * disposed on unmount. The scope's effects stop when the component unmounts.
|
|
7760
|
+
// */
|
|
7761
|
+
// declare function useScope(): SignalScope;
|
|
7762
|
+
//
|
|
7763
|
+
// ── useScrollLock ───────────────────────────────────────────────────────────────
|
|
7764
|
+
// /**
|
|
7765
|
+
// * Locks `document.body` scroll while `locked` is true, compensating for the scrollbar width to
|
|
7766
|
+
// * avoid a layout shift. Accepts a plain boolean or a `Signal<boolean>` (reactive). The previous
|
|
7767
|
+
// * inline styles are restored on unlock/teardown. DOM work runs inside `useSignalEffect`.
|
|
7768
|
+
// */
|
|
7769
|
+
// declare function useScrollLock(locked: Signal<boolean> | boolean): void;
|
|
7770
|
+
//
|
|
7771
|
+
// ── useSignal ───────────────────────────────────────────────────────────────────
|
|
7772
|
+
// /**
|
|
7773
|
+
// * Local reactive state — the signal IS the state (use instead of `useState`).
|
|
7774
|
+
// *
|
|
7775
|
+
// * Calls `useSignals()` internally, so a component that reads the returned signal during
|
|
7776
|
+
// * render re-renders on writes **without** the Babel signals transform and without calling
|
|
7777
|
+
// * `useSignals()` itself.
|
|
7778
|
+
// *
|
|
7779
|
+
// * Caveat: the tracking window opens where this hook is called. A signal read that happens
|
|
7780
|
+
// * *earlier* in the render body than the first `useSignal`/`useComputed` call is not tracked —
|
|
7781
|
+
// * so call these before any signal read, or call `useSignals()` first. (Reading a signal before
|
|
7782
|
+
// * any hook runs is unusual; the case is locked by a test.)
|
|
7783
|
+
// */
|
|
7784
|
+
// declare function useSignal<T>(initial: T): Signal<T>;
|
|
7785
|
+
//
|
|
7786
|
+
// ── useStreamBuffer ─────────────────────────────────────────────────────────────
|
|
7787
|
+
// /**
|
|
7788
|
+
// * Component-scoped {@link createStreamBuffer}. Created once and stable across
|
|
7789
|
+
// * renders; cancels any pending flush on unmount. Read `buffer.signal.value` in
|
|
7790
|
+
// * render to subscribe the component to the stream.
|
|
7791
|
+
// */
|
|
7792
|
+
// declare function useStreamBuffer<T>(options: StreamBufferOptions): StreamBuffer<T>;
|
|
7793
|
+
//
|
|
7794
|
+
// ── useTheme ────────────────────────────────────────────────────────────────────
|
|
7795
|
+
// /**
|
|
7796
|
+
// * Read and set the active theme. Returns the current theme **name** (a plain
|
|
7797
|
+
// * string) and a setter — the component re-renders when the theme changes with no
|
|
7798
|
+
// * signal handling on your part (this hook calls `useSignals()` for you, so it
|
|
7799
|
+
// * works in React apps with no Babel transform). This is the React-idiomatic shape;
|
|
7800
|
+
// * for signal-native code (`computed()`, `effect()`, Preact) use {@link themeSignal}.
|
|
7801
|
+
// *
|
|
7802
|
+
// * ```tsx
|
|
7803
|
+
// * const [theme, setTheme] = useTheme()
|
|
7804
|
+
// * return <button onClick={() => setTheme(theme === 'dark' ? 'light' : 'dark')}>
|
|
7805
|
+
// * {theme}
|
|
7806
|
+
// * </button>
|
|
7807
|
+
// * ```
|
|
7808
|
+
// */
|
|
7809
|
+
// declare function useTheme(): readonly [string, (next: string) => void];
|
|
7810
|
+
//
|
|
7811
|
+
// ── useTypeahead ────────────────────────────────────────────────────────────────
|
|
7812
|
+
// /**
|
|
7813
|
+
// * Type-to-select buffer, without context. The consumer calls `useTypeahead({ onMatch })`
|
|
7814
|
+
// * and spreads `onKeyDown` onto the focusable list container; each printable key extends
|
|
7815
|
+
// * the query and fires `onMatch(query)`. The buffer resets after `resetMs` of inactivity.
|
|
7816
|
+
// *
|
|
7817
|
+
// * Space is treated as a query character only while a query is already in progress, so a
|
|
7818
|
+
// * leading Space stays available for activation (WAI-ARIA menu/listbox convention). Repeated
|
|
7819
|
+
// * identical characters are passed through verbatim (e.g. "aa"); consumers that want the
|
|
7820
|
+
// * "press 'a' repeatedly to cycle A-items" behavior can detect an all-same-char query.
|
|
7821
|
+
// */
|
|
7822
|
+
// declare function useTypeahead(options: UseTypeaheadOptions): UseTypeaheadReturn;
|
|
7823
|
+
//
|
|
7824
|
+
// ── VisuallyHidden ──────────────────────────────────────────────────────────────
|
|
7825
|
+
// declare function VisuallyHidden( {
|
|
7826
|
+
//
|
|
7827
|
+
// ── VisuallyHiddenProps ─────────────────────────────────────────────────────────
|
|
7828
|
+
// interface VisuallyHiddenProps extends HTMLAttributes<HTMLSpanElement> {
|
|
7829
|
+
// children: ReactNode;
|
|
7830
|
+
// showOnFocus?: boolean;
|
|
7831
|
+
// }
|
|
7832
|
+
//
|