neatkit 0.7.0 → 0.8.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/Avatar-Belo7qAY.cjs +1 -0
- package/dist/Avatar-DjDCFqNG.js +55 -0
- package/dist/Avatar.cjs +1 -1
- package/dist/Avatar.js +2 -52
- package/dist/Boundary.cjs +1 -0
- package/dist/Boundary.js +176 -0
- package/dist/{Button-BAsLfA0D.js → Button-Chv4O66e.js} +35 -35
- package/dist/Button-DCKtFvSo.cjs +1 -0
- package/dist/Button.cjs +1 -1
- package/dist/Button.js +1 -1
- package/dist/Checkbox.cjs +1 -1
- package/dist/Checkbox.js +213 -2
- package/dist/Code-ClkozPlv.js +227 -0
- package/dist/Code-JDb4VFl7.cjs +4 -0
- package/dist/Code.cjs +1 -1
- package/dist/Code.js +1 -1
- package/dist/{Icon-uQmpr5P2.js → Icon-BoEUoOk7.js} +144 -177
- package/dist/Icon-DJ4BigRz.cjs +1 -0
- package/dist/Icon.cjs +1 -1
- package/dist/Icon.js +2 -35
- package/dist/Input.cjs +1 -1
- package/dist/Input.js +70 -79
- package/dist/Markdown.cjs +1 -31
- package/dist/Markdown.js +461 -18062
- package/dist/Modal.cjs +1 -1
- package/dist/Modal.js +100 -122
- package/dist/PinInput.cjs +1 -1
- package/dist/PinInput.js +1 -1
- package/dist/Popover.cjs +1 -1
- package/dist/Popover.js +106 -106
- package/dist/Radio.cjs +1 -1
- package/dist/Radio.js +86 -41
- package/dist/Select.cjs +1 -1
- package/dist/Select.js +326 -315
- package/dist/Sidebar.cjs +1 -0
- package/dist/Sidebar.js +475 -0
- package/dist/Skeleton.cjs +1 -1
- package/dist/Skeleton.js +20 -16
- package/dist/Switch.cjs +1 -1
- package/dist/Switch.js +1 -1
- package/dist/Table-B30TBckZ.js +402 -0
- package/dist/Table-DceR12X9.cjs +1 -0
- package/dist/Table.cjs +1 -1
- package/dist/Table.js +1 -1
- package/dist/TextArea.cjs +1 -1
- package/dist/TextArea.js +1 -1
- package/dist/Tooltip-B4bajPtk.cjs +1 -0
- package/dist/Tooltip-BVqdnKK_.js +231 -0
- package/dist/Tooltip.cjs +1 -1
- package/dist/Tooltip.js +2 -3
- package/dist/aria-Bntn6ad_.cjs +1 -0
- package/dist/aria-CeA9QfD1.js +15 -0
- package/dist/components/Boundary/Boundary.d.ts +65 -0
- package/dist/components/Boundary/contexts/BoundaryContext.d.ts +28 -0
- package/dist/components/Boundary/hooks/useBoundary.d.ts +19 -0
- package/dist/components/Boundary/hooks/useBoundaryWidth.d.ts +23 -0
- package/dist/components/Boundary/index.d.ts +2 -0
- package/dist/components/Boundary/utils/width.d.ts +11 -0
- package/dist/components/Checkbox/Checkbox.d.ts +9 -1
- package/dist/components/{CheckboxGroup → Checkbox/components}/CheckboxGroup.d.ts +2 -2
- package/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/components/Checkbox/utils/checkbox-option.d.ts +17 -0
- package/dist/components/Icon/Icon.d.ts +1 -0
- package/dist/components/Icon/index.d.ts +0 -33
- package/dist/components/Input/Input.d.ts +1 -9
- package/dist/components/Modal/Modal.d.ts +0 -4
- package/dist/components/PinInput/PinInput.d.ts +1 -1
- package/dist/components/Popover/Popover.d.ts +2 -6
- package/dist/components/Portal/Portal.d.ts +11 -8
- package/dist/components/Portal/hooks/useDismissableLayer.d.ts +2 -0
- package/dist/components/Portal/hooks/useFloatingPosition.d.ts +4 -3
- package/dist/components/Portal/hooks/useFocusTrap.d.ts +2 -0
- package/dist/components/Portal/hooks/useScrollLock.d.ts +9 -3
- package/dist/components/Portal/utils/boundary-focus.d.ts +23 -0
- package/dist/components/Portal/utils/floating-position.d.ts +43 -9
- package/dist/components/Portal/utils/overlay-stack.d.ts +22 -10
- package/dist/components/Portal/utils/scroll-container.d.ts +13 -0
- package/dist/components/Radio/Radio.d.ts +9 -1
- package/dist/components/{RadioGroup → Radio/components}/RadioGroup.d.ts +9 -2
- package/dist/components/Radio/index.d.ts +1 -0
- package/dist/components/Select/Select.d.ts +0 -2
- package/dist/components/Select/utils/listbox-position.d.ts +28 -0
- package/dist/components/Sidebar/Sidebar.d.ts +108 -0
- package/dist/components/Sidebar/components/SidebarFooter.d.ts +19 -0
- package/dist/components/Sidebar/components/SidebarGroup.d.ts +42 -0
- package/dist/components/Sidebar/components/SidebarItem.d.ts +43 -0
- package/dist/components/Sidebar/components/SidebarOverlay.d.ts +38 -0
- package/dist/components/Sidebar/components/SidebarPanel.d.ts +47 -0
- package/dist/components/Sidebar/components/SidebarTrigger.d.ts +47 -0
- package/dist/components/Sidebar/components/SidebarUser.d.ts +59 -0
- package/dist/components/Sidebar/hooks/usePresentation.d.ts +14 -0
- package/dist/components/Sidebar/hooks/useSidebar.d.ts +9 -0
- package/dist/components/Sidebar/index.d.ts +2 -0
- package/dist/components/Sidebar/utils/state.d.ts +62 -0
- package/dist/components/Skeleton/Skeleton.d.ts +21 -5
- package/dist/components/Table/Table.d.ts +9 -49
- package/dist/components/Table/contexts/TableContext.d.ts +4 -0
- package/dist/components/Table/index.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +10 -4
- package/dist/components/Tooltip/TooltipProvider.d.ts +1 -1
- package/dist/components/Tooltip/index.d.ts +0 -1
- package/dist/effects-D5CWf-Pl.js +8 -0
- package/dist/effects-D85L_7zM.cjs +1 -0
- package/dist/floating-position-5wJ5G5IT.js +48 -0
- package/dist/floating-position-Cy9xxdH4.cjs +1 -0
- package/dist/style.css +1 -1
- package/dist/tokens.d.ts +1 -0
- package/dist/useFloatingPosition-BBEUHPqy.cjs +1 -0
- package/dist/useFloatingPosition-CMirP2-2.js +43 -0
- package/dist/useFocusTrap-BrFZdMqQ.cjs +1 -0
- package/dist/useFocusTrap-DhVnlboe.js +136 -0
- package/dist/usePresence-B5RYv4e1.cjs +1 -0
- package/dist/usePresence-CqegYqy4.js +221 -0
- package/dist/useScrollLock-Drd7OZRC.js +62 -0
- package/dist/useScrollLock-Dy8MZaSn.cjs +1 -0
- package/dist/utils/aria.d.ts +9 -0
- package/dist/utils/effects.d.ts +12 -0
- package/package.json +11 -16
- package/dist/Button-D7JUO6Fs.cjs +0 -1
- package/dist/Checkbox-BvXM9VyY.js +0 -68
- package/dist/Checkbox-VQifZrZZ.cjs +0 -1
- package/dist/CheckboxGroup.cjs +0 -1
- package/dist/CheckboxGroup.js +0 -144
- package/dist/Code-BP2ZCmUf.js +0 -7446
- package/dist/Code-eispVOW3.cjs +0 -6
- package/dist/Content.cjs +0 -1
- package/dist/Content.js +0 -144
- package/dist/Icon-D8IZceys.cjs +0 -1
- package/dist/RadioGroup.cjs +0 -1
- package/dist/RadioGroup.js +0 -51
- package/dist/RadioGroupContext-BX9KnDek.cjs +0 -1
- package/dist/RadioGroupContext-DbKM4zPZ.js +0 -5
- package/dist/Table-83unQQOi.cjs +0 -1
- package/dist/Table-Cw8u-pEW.js +0 -403
- package/dist/Tooltip-BB82wNOE.cjs +0 -1
- package/dist/Tooltip-CqWK_GRD.js +0 -236
- package/dist/aria-DHnOMyYp.js +0 -10
- package/dist/aria-DKxpE8cA.cjs +0 -1
- package/dist/components/CheckboxGroup/index.d.ts +0 -2
- package/dist/components/Content/Content.d.ts +0 -60
- package/dist/components/Content/hooks/useContentLayout.d.ts +0 -18
- package/dist/components/Content/index.d.ts +0 -2
- package/dist/components/Content/utils/layout.d.ts +0 -11
- package/dist/components/RadioGroup/index.d.ts +0 -2
- package/dist/useFloatingPosition-CxzhAvy8.js +0 -73
- package/dist/useFloatingPosition-D1FqYy0l.cjs +0 -1
- package/dist/useFocusTrap--cgjy78G.cjs +0 -1
- package/dist/useFocusTrap-Da4nEash.js +0 -134
- package/dist/usePresence-DSPt6aKi.js +0 -210
- package/dist/usePresence-qe92UTvK.cjs +0 -1
- /package/dist/components/{CheckboxGroup → Checkbox}/contexts/CheckboxGroupContext.d.ts +0 -0
- /package/dist/components/{CheckboxGroup → Checkbox}/hooks/useCheckboxGroup.d.ts +0 -0
- /package/dist/components/{RadioGroup → Radio}/contexts/RadioGroupContext.d.ts +0 -0
- /package/dist/components/{RadioGroup → Radio}/hooks/useRadioGroup.d.ts +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves the nearest scroller an overlay should lock within its Boundary.
|
|
3
|
+
*
|
|
4
|
+
* An overlay is positioned within its boundary rather than the viewport, so
|
|
5
|
+
* it travels with the content behind it, and locking nothing is correct when
|
|
6
|
+
* no scroller lies in between.
|
|
7
|
+
*
|
|
8
|
+
* @param boundary - The boundary owning the overlay requesting the lock.
|
|
9
|
+
* @param ownerDocument - The document containing the boundary.
|
|
10
|
+
*
|
|
11
|
+
* @returns The enclosing scroller, or null when the overlay locks nothing.
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveScrollContainer(boundary: Element | null, ownerDocument: Document): Element | Document | null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type CSSProperties, type InputHTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
import RadioGroup from "./components/RadioGroup";
|
|
2
3
|
import "./styles/radio.css";
|
|
3
4
|
/** A type representing properties for the Radio component. */
|
|
4
5
|
export type RadioProps = Omit<InputHTMLAttributes<HTMLInputElement>, "checked" | "children" | "className" | "defaultChecked" | "name" | "onChange" | "required" | "style" | "type" | "value"> & {
|
|
@@ -19,7 +20,7 @@ export type RadioProps = Omit<InputHTMLAttributes<HTMLInputElement>, "checked" |
|
|
|
19
20
|
*
|
|
20
21
|
* @returns The rendered Radio option.
|
|
21
22
|
*/
|
|
22
|
-
declare const
|
|
23
|
+
declare const RadioRoot: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "defaultChecked" | "className" | "style" | "children" | "onChange" | "name" | "type" | "value" | "required" | "checked"> & {
|
|
23
24
|
/** The clickable and accessible label for the Radio option. */
|
|
24
25
|
children: ReactNode;
|
|
25
26
|
/** The additional class name applied to the Radio label root. */
|
|
@@ -29,4 +30,11 @@ declare const Radio: import("react").ForwardRefExoticComponent<Omit<InputHTMLAtt
|
|
|
29
30
|
/** The string submitted when the Radio option is selected. */
|
|
30
31
|
value: string;
|
|
31
32
|
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
33
|
+
/** A type representing the complete compound Radio component. */
|
|
34
|
+
type RadioComponent = typeof RadioRoot & {
|
|
35
|
+
/** A labelled set of mutually exclusive Radio options. */
|
|
36
|
+
Group: typeof RadioGroup;
|
|
37
|
+
};
|
|
38
|
+
/** The compound Radio component and its grouping form. */
|
|
39
|
+
declare const Radio: RadioComponent;
|
|
32
40
|
export default Radio;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type ChangeEventHandler, type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
-
import "
|
|
2
|
+
import "../styles/radio-group.css";
|
|
3
3
|
/** A type representing the visual direction of Radio options. */
|
|
4
4
|
export type RadioGroupOrientation = "horizontal" | "vertical";
|
|
5
|
-
/** A type representing properties for the
|
|
5
|
+
/** A type representing properties for the Radio.Group component. */
|
|
6
6
|
export type RadioGroupProps = Omit<HTMLAttributes<HTMLDivElement>, "children" | "defaultValue" | "onChange"> & {
|
|
7
7
|
/** The Radio options belonging to the group. */
|
|
8
8
|
children: ReactNode;
|
|
@@ -26,6 +26,13 @@ export type RadioGroupProps = Omit<HTMLAttributes<HTMLDivElement>, "children" |
|
|
|
26
26
|
/**
|
|
27
27
|
* Renders a native radio group with shared form and validation state.
|
|
28
28
|
*
|
|
29
|
+
* @note Radio children are deliberately not validated, unlike Checkbox.Group.
|
|
30
|
+
* The browser groups radios by their shared `name` and enforces `required`
|
|
31
|
+
* across that group, so this component never reads its children and content
|
|
32
|
+
* may be wrapped or arranged freely. Checkbox.Group has no such native
|
|
33
|
+
* primitive and must inspect each option during render, which is why it
|
|
34
|
+
* rejects wrappers. The divergence follows the platform, not a preference.
|
|
35
|
+
*
|
|
29
36
|
* @param props - The properties that configure the RadioGroup.
|
|
30
37
|
* @param forwardedReference - The reference assigned to the group root.
|
|
31
38
|
*
|
|
@@ -62,8 +62,6 @@ export type CustomSelectProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "c
|
|
|
62
62
|
options: readonly SelectOption[];
|
|
63
63
|
/** The guidance displayed when no option is selected. */
|
|
64
64
|
placeholder?: string;
|
|
65
|
-
/** The optional element receiving the listbox portal. */
|
|
66
|
-
portalContainer?: Element | null;
|
|
67
65
|
/** The inline styles applied to the composite Select root. */
|
|
68
66
|
style?: CSSProperties;
|
|
69
67
|
/** Whether the custom Select communicates that a value is required. */
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { EdgeBounds } from "../../Portal/utils/floating-position";
|
|
2
|
+
/** A type representing the fitted position of a Select listbox. */
|
|
3
|
+
export type ListboxPosition = {
|
|
4
|
+
/** The boundary-relative horizontal position. */
|
|
5
|
+
left: number;
|
|
6
|
+
/** The maximum height available in the selected vertical direction. */
|
|
7
|
+
maxHeight: number;
|
|
8
|
+
/** The minimum width inherited from the trigger. */
|
|
9
|
+
minWidth: number;
|
|
10
|
+
/** The boundary-relative vertical position. */
|
|
11
|
+
top: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Calculates the listbox position and height fitted inside a boundary.
|
|
15
|
+
*
|
|
16
|
+
* Every rectangle is expressed in the same coordinate space, so the returned
|
|
17
|
+
* coordinates share that space and callers convert them once.
|
|
18
|
+
*
|
|
19
|
+
* A boundary shorter than the readable minimum is deliberately exceeded,
|
|
20
|
+
* because a listbox collapsed to a few pixels shows nothing at all.
|
|
21
|
+
*
|
|
22
|
+
* @param triggerBounds - The bounds of the trigger anchoring the listbox.
|
|
23
|
+
* @param listboxBounds - The measured listbox bounds, when it is mounted.
|
|
24
|
+
* @param boundaryBounds - The bounds the listbox must remain inside.
|
|
25
|
+
*
|
|
26
|
+
* @returns The fitted listbox coordinates and size constraints.
|
|
27
|
+
*/
|
|
28
|
+
export declare function calculateListboxPosition(triggerBounds: DOMRect, listboxBounds: DOMRect | undefined, boundaryBounds: EdgeBounds): ListboxPosition;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode, type RefObject } from "react";
|
|
2
|
+
import SidebarFooter from "./components/SidebarFooter";
|
|
3
|
+
import SidebarGroup from "./components/SidebarGroup";
|
|
4
|
+
import SidebarItem from "./components/SidebarItem";
|
|
5
|
+
import { type SidebarSide, type SidebarStyle } from "./components/SidebarPanel";
|
|
6
|
+
import SidebarTrigger from "./components/SidebarTrigger";
|
|
7
|
+
import SidebarUser from "./components/SidebarUser";
|
|
8
|
+
import { type SidebarOpenChangeReason, type SidebarVariant } from "./utils/state";
|
|
9
|
+
import "./styles/sidebar.css";
|
|
10
|
+
export type { SidebarFooterProps } from "./components/SidebarFooter";
|
|
11
|
+
export type { SidebarGroupPresentation, SidebarGroupProps, } from "./components/SidebarGroup";
|
|
12
|
+
export type { SidebarItemProps } from "./components/SidebarItem";
|
|
13
|
+
export type { SidebarSide } from "./components/SidebarPanel";
|
|
14
|
+
export type { SidebarTriggerProps } from "./components/SidebarTrigger";
|
|
15
|
+
export type { SidebarUserAction, SidebarUserProps, } from "./components/SidebarUser";
|
|
16
|
+
export type { SidebarOpenChangeReason, SidebarVariant } from "./utils/state";
|
|
17
|
+
/** A type representing the complete compound Sidebar component. */
|
|
18
|
+
type SidebarComponent = typeof SidebarRoot & {
|
|
19
|
+
/** The region pinned to the bottom of the Sidebar. */
|
|
20
|
+
Footer: typeof SidebarFooter;
|
|
21
|
+
/** A related set of Sidebar items forming one navigation region. */
|
|
22
|
+
Group: typeof SidebarGroup;
|
|
23
|
+
/** One navigation destination or action inside a group. */
|
|
24
|
+
Item: typeof SidebarItem;
|
|
25
|
+
/** The control disclosing an overlay Sidebar. */
|
|
26
|
+
Trigger: typeof SidebarTrigger;
|
|
27
|
+
/** A person's avatar, name, and optional trailing control. */
|
|
28
|
+
User: typeof SidebarUser;
|
|
29
|
+
};
|
|
30
|
+
/** A type representing properties for the Sidebar component. */
|
|
31
|
+
export type SidebarProps = Omit<HTMLAttributes<HTMLElement>, "children" | "id" | "role" | "style" | "tabIndex"> & {
|
|
32
|
+
/** The regions and groups composing the Sidebar. */
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
/** Whether an uncontrolled overlay Sidebar is initially open. */
|
|
35
|
+
defaultOpen?: boolean;
|
|
36
|
+
/** The preferred element focused when the overlay Sidebar opens. */
|
|
37
|
+
initialFocusReference?: RefObject<HTMLElement | null>;
|
|
38
|
+
/** The distance the inline Sidebar is pinned below its scroll container. */
|
|
39
|
+
top?: string;
|
|
40
|
+
/** Whether document scrolling is locked while the overlay is open. */
|
|
41
|
+
lockScroll?: boolean;
|
|
42
|
+
/** The controlled open state of the overlay Sidebar. */
|
|
43
|
+
open?: boolean;
|
|
44
|
+
/** Whether focus returns to the Trigger after the overlay closes. */
|
|
45
|
+
restoreFocus?: boolean;
|
|
46
|
+
/** The edge the overlay Sidebar occupies. */
|
|
47
|
+
side?: SidebarSide;
|
|
48
|
+
/** The styles applied to the Sidebar panel. */
|
|
49
|
+
style?: SidebarStyle;
|
|
50
|
+
/** The responsive behavior selecting the Sidebar presentation. */
|
|
51
|
+
variant?: SidebarVariant;
|
|
52
|
+
/** The width of the Sidebar as a valid CSS length. */
|
|
53
|
+
width?: string;
|
|
54
|
+
/** The callback invoked when an interaction requests a changed state. */
|
|
55
|
+
onOpenChange?: (open: boolean, reason: SidebarOpenChangeReason) => void;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Renders a navigation panel beside content or as a disclosed overlay.
|
|
59
|
+
*
|
|
60
|
+
* An overlay Sidebar is always dismissable through Escape and an outside
|
|
61
|
+
* press, because it traps focus behind a modal dialog that renders no close
|
|
62
|
+
* control of its own.
|
|
63
|
+
*
|
|
64
|
+
* The panel advertises its own state for styling, and those attributes are
|
|
65
|
+
* part of the public contract: `data-variant` reports the presentation as
|
|
66
|
+
* `inline` or `overlay`, `data-side` the edge it occupies, and `data-state`
|
|
67
|
+
* whether a disclosed panel is `open` or `closing`. Select them beside a
|
|
68
|
+
* consumer class to style one presentation without a prop for each.
|
|
69
|
+
*
|
|
70
|
+
* The Sidebar publishes its state to the surrounding boundary, so a
|
|
71
|
+
* Trigger placed anywhere inside that boundary can disclose it. The boundary
|
|
72
|
+
* is also what the responsive presentation measures, so a narrow Boundary
|
|
73
|
+
* presents an overlay even on a wide display.
|
|
74
|
+
*
|
|
75
|
+
* @param props - The properties that configure the Sidebar.
|
|
76
|
+
* @param forwardedReference - The reference assigned to the panel element.
|
|
77
|
+
*
|
|
78
|
+
* @returns The inline, disclosed, or unmounted Sidebar panel.
|
|
79
|
+
*/
|
|
80
|
+
declare const SidebarRoot: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLElement>, "id" | "style" | "tabIndex" | "role" | "children"> & {
|
|
81
|
+
/** The regions and groups composing the Sidebar. */
|
|
82
|
+
children?: ReactNode;
|
|
83
|
+
/** Whether an uncontrolled overlay Sidebar is initially open. */
|
|
84
|
+
defaultOpen?: boolean;
|
|
85
|
+
/** The preferred element focused when the overlay Sidebar opens. */
|
|
86
|
+
initialFocusReference?: RefObject<HTMLElement | null>;
|
|
87
|
+
/** The distance the inline Sidebar is pinned below its scroll container. */
|
|
88
|
+
top?: string;
|
|
89
|
+
/** Whether document scrolling is locked while the overlay is open. */
|
|
90
|
+
lockScroll?: boolean;
|
|
91
|
+
/** The controlled open state of the overlay Sidebar. */
|
|
92
|
+
open?: boolean;
|
|
93
|
+
/** Whether focus returns to the Trigger after the overlay closes. */
|
|
94
|
+
restoreFocus?: boolean;
|
|
95
|
+
/** The edge the overlay Sidebar occupies. */
|
|
96
|
+
side?: SidebarSide;
|
|
97
|
+
/** The styles applied to the Sidebar panel. */
|
|
98
|
+
style?: SidebarStyle;
|
|
99
|
+
/** The responsive behavior selecting the Sidebar presentation. */
|
|
100
|
+
variant?: SidebarVariant;
|
|
101
|
+
/** The width of the Sidebar as a valid CSS length. */
|
|
102
|
+
width?: string;
|
|
103
|
+
/** The callback invoked when an interaction requests a changed state. */
|
|
104
|
+
onOpenChange?: (open: boolean, reason: SidebarOpenChangeReason) => void;
|
|
105
|
+
} & import("react").RefAttributes<HTMLElement>>;
|
|
106
|
+
/** The compound Sidebar component and its composable regions. */
|
|
107
|
+
declare const Sidebar: SidebarComponent;
|
|
108
|
+
export default Sidebar;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
/** A type representing properties for the Sidebar.Footer component. */
|
|
3
|
+
export type SidebarFooterProps = HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
/** The content pinned to the bottom of the Sidebar. */
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Renders the region pinned to the bottom of a Sidebar.
|
|
9
|
+
*
|
|
10
|
+
* @param props - The native properties that configure the footer.
|
|
11
|
+
* @param forwardedReference - The reference assigned to the footer element.
|
|
12
|
+
*
|
|
13
|
+
* @returns The rendered Sidebar footer.
|
|
14
|
+
*/
|
|
15
|
+
declare const SidebarFooter: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
16
|
+
/** The content pinned to the bottom of the Sidebar. */
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
19
|
+
export default SidebarFooter;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
/** A type representing the presentations that render a Sidebar group. */
|
|
3
|
+
export type SidebarGroupPresentation = "both" | "inline" | "overlay";
|
|
4
|
+
/** A type representing properties for the Sidebar.Group component. */
|
|
5
|
+
export type SidebarGroupProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
6
|
+
/** The Sidebar items rendered inside the group. */
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
/** The visible heading naming the group's navigation region. */
|
|
9
|
+
label?: ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* The Sidebar presentations that render the group.
|
|
12
|
+
*
|
|
13
|
+
* Restricting a group suits navigation duplicated elsewhere in a wide
|
|
14
|
+
* layout, such as links an application bar already provides.
|
|
15
|
+
*/
|
|
16
|
+
presentation?: SidebarGroupPresentation;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Renders a related set of Sidebar items as one navigation region.
|
|
20
|
+
*
|
|
21
|
+
* A group becomes a navigation landmark only when it carries an accessible
|
|
22
|
+
* name, because repeated unnamed landmarks cannot be told apart.
|
|
23
|
+
*
|
|
24
|
+
* @param props - The label and native properties that configure the group.
|
|
25
|
+
* @param forwardedReference - The reference assigned to the group element.
|
|
26
|
+
*
|
|
27
|
+
* @returns The rendered Sidebar group.
|
|
28
|
+
*/
|
|
29
|
+
declare const SidebarGroup: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
30
|
+
/** The Sidebar items rendered inside the group. */
|
|
31
|
+
children?: ReactNode;
|
|
32
|
+
/** The visible heading naming the group's navigation region. */
|
|
33
|
+
label?: ReactNode;
|
|
34
|
+
/**
|
|
35
|
+
* The Sidebar presentations that render the group.
|
|
36
|
+
*
|
|
37
|
+
* Restricting a group suits navigation duplicated elsewhere in a wide
|
|
38
|
+
* layout, such as links an application bar already provides.
|
|
39
|
+
*/
|
|
40
|
+
presentation?: SidebarGroupPresentation;
|
|
41
|
+
} & import("react").RefAttributes<HTMLElement>>;
|
|
42
|
+
export default SidebarGroup;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type ComponentPropsWithoutRef, type ElementType, type ReactElement, type ReactNode } from "react";
|
|
2
|
+
import { type IconType } from "../../Icon";
|
|
3
|
+
/** A type representing properties owned by the Sidebar.Item component. */
|
|
4
|
+
type SidebarItemOwnProps = {
|
|
5
|
+
/** Whether the item represents the current page or view. */
|
|
6
|
+
active?: boolean;
|
|
7
|
+
/** The label displayed inside the item. */
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
/** Whether the item is present but unavailable. */
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/** The icon displayed before the item label. */
|
|
12
|
+
icon?: IconType;
|
|
13
|
+
};
|
|
14
|
+
/** A type representing the reference accepted by a polymorphic element. */
|
|
15
|
+
type SidebarItemReference<Component extends ElementType> = ComponentPropsWithRef<Component>["ref"];
|
|
16
|
+
/** A type representing properties for a polymorphic Sidebar item. */
|
|
17
|
+
export type SidebarItemProps<Component extends ElementType = "button"> = SidebarItemOwnProps & {
|
|
18
|
+
/**
|
|
19
|
+
* The intrinsic element or custom component used as the item control.
|
|
20
|
+
*
|
|
21
|
+
* Custom components own their native semantics and must forward the
|
|
22
|
+
* class name, reference, event handlers, and ARIA properties to their
|
|
23
|
+
* interactive root.
|
|
24
|
+
*/
|
|
25
|
+
as?: Component;
|
|
26
|
+
} & Omit<ComponentPropsWithoutRef<Component>, keyof SidebarItemOwnProps | "as">;
|
|
27
|
+
/** A type representing the public polymorphic Sidebar item component. */
|
|
28
|
+
type SidebarItemComponent = <Component extends ElementType = "button">(props: SidebarItemProps<Component> & {
|
|
29
|
+
ref?: SidebarItemReference<Component>;
|
|
30
|
+
}) => ReactElement | null;
|
|
31
|
+
/**
|
|
32
|
+
* Renders one navigation destination or action inside a Sidebar group.
|
|
33
|
+
*
|
|
34
|
+
* Items carrying a navigation target report the current page, while action
|
|
35
|
+
* items report the current selection instead.
|
|
36
|
+
*
|
|
37
|
+
* @param props - The properties that configure the item and its element.
|
|
38
|
+
* @param forwardedReference - The reference assigned to the item control.
|
|
39
|
+
*
|
|
40
|
+
* @returns The rendered Sidebar item and its list container.
|
|
41
|
+
*/
|
|
42
|
+
declare const SidebarItem: SidebarItemComponent;
|
|
43
|
+
export default SidebarItem;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
import type { SidebarState } from "../utils/state";
|
|
3
|
+
import { type SidebarPanelProps } from "./SidebarPanel";
|
|
4
|
+
/**
|
|
5
|
+
* A type representing properties for the mounted Sidebar overlay layer.
|
|
6
|
+
*
|
|
7
|
+
* The forwarded panel properties are derived rather than restated, so the
|
|
8
|
+
* consumer attributes the root spreads through here stay described by one
|
|
9
|
+
* declaration. The overlay supplies the presentation, open state, and
|
|
10
|
+
* identifier itself, and a top offset applies to no overlay.
|
|
11
|
+
*/
|
|
12
|
+
type SidebarOverlayProps = Omit<SidebarPanelProps, "top" | "open" | "panelId" | "panelReference" | "presentation" | "state"> & {
|
|
13
|
+
/** The elements treated as part of the overlay dismissal layer. */
|
|
14
|
+
boundaries: readonly RefObject<HTMLElement | null>[];
|
|
15
|
+
/** The preferred element focused when the Sidebar opens. */
|
|
16
|
+
initialFocusReference?: RefObject<HTMLElement | null>;
|
|
17
|
+
/** Whether scrolling is locked while the Sidebar is open. */
|
|
18
|
+
lockScroll: boolean;
|
|
19
|
+
/** The document owning the mounted overlay layer. */
|
|
20
|
+
ownerDocument: Document;
|
|
21
|
+
/** Assigns the mounted panel to internal and consumer references. */
|
|
22
|
+
panelReference: (element: HTMLElement | null) => void;
|
|
23
|
+
/** The visual phase exposed to transition styles. */
|
|
24
|
+
presenceState: "closing" | "open";
|
|
25
|
+
/** Whether focus returns to its prior owner when the Sidebar closes. */
|
|
26
|
+
restoreFocus: boolean;
|
|
27
|
+
/** The shared Sidebar state supplied by its provider. */
|
|
28
|
+
sidebar: SidebarState;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Renders and coordinates one mounted Sidebar overlay layer.
|
|
32
|
+
*
|
|
33
|
+
* @param props - The panel, document, and transition properties.
|
|
34
|
+
*
|
|
35
|
+
* @returns The open or exiting Sidebar overlay.
|
|
36
|
+
*/
|
|
37
|
+
export default function SidebarOverlay(props: SidebarOverlayProps): import("react").JSX.Element;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { CSSProperties, HTMLAttributes, ReactNode, Ref } from "react";
|
|
2
|
+
import type { SidebarPresentation } from "../utils/state";
|
|
3
|
+
/** A type representing the edge an overlay Sidebar occupies. */
|
|
4
|
+
export type SidebarSide = "end" | "start";
|
|
5
|
+
/** A type representing CSS custom properties accepted by Sidebar styles. */
|
|
6
|
+
type SidebarCustomProperties = {
|
|
7
|
+
[CustomProperty in `--${string}`]?: string | number;
|
|
8
|
+
};
|
|
9
|
+
/** A type representing native Sidebar styles and CSS custom properties. */
|
|
10
|
+
export type SidebarStyle = CSSProperties & SidebarCustomProperties;
|
|
11
|
+
/** A type representing properties used to implement the Sidebar panel. */
|
|
12
|
+
export type SidebarPanelProps = Omit<HTMLAttributes<HTMLElement>, "children" | "style"> & {
|
|
13
|
+
/** The regions and groups composing the Sidebar. */
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
/** The distance the inline panel is pinned below its scroll container. */
|
|
16
|
+
top?: string;
|
|
17
|
+
/** The identifier associating the panel with its Trigger. */
|
|
18
|
+
panelId?: string;
|
|
19
|
+
/** The reference assigned to the rendered panel element. */
|
|
20
|
+
panelReference: Ref<HTMLElement>;
|
|
21
|
+
/** The presentation currently rendered by the Sidebar. */
|
|
22
|
+
presentation: SidebarPresentation;
|
|
23
|
+
/** Whether the Sidebar is currently disclosed as an overlay. */
|
|
24
|
+
open: boolean;
|
|
25
|
+
/** The edge the overlay panel occupies. */
|
|
26
|
+
side: SidebarSide;
|
|
27
|
+
/** The visual phase exposed to transition styles. */
|
|
28
|
+
state?: "closing" | "open";
|
|
29
|
+
/** The styles applied to the panel. */
|
|
30
|
+
style?: SidebarStyle;
|
|
31
|
+
/** The width of the Sidebar as a CSS length. */
|
|
32
|
+
width?: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Renders the Sidebar panel shared by both of its presentations.
|
|
36
|
+
*
|
|
37
|
+
* Authoring the panel once keeps both presentations in step, though it does
|
|
38
|
+
* not preserve the element itself: an overlay is portalled into the boundary
|
|
39
|
+
* while an inline panel stays in place, so crossing the responsive breakpoint
|
|
40
|
+
* remounts the panel and restarts anything stateful inside it.
|
|
41
|
+
*
|
|
42
|
+
* @param props - The presentation, state, and native panel properties.
|
|
43
|
+
*
|
|
44
|
+
* @returns The rendered Sidebar panel.
|
|
45
|
+
*/
|
|
46
|
+
export default function SidebarPanel(props: SidebarPanelProps): import("react").JSX.Element;
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type MouseEvent, type ReactElement, type Ref } from "react";
|
|
2
|
+
import type { SidebarVariant } from "../utils/state";
|
|
3
|
+
/** A type representing the properties applied to a cloned Trigger child. */
|
|
4
|
+
type SidebarTriggerChildProps = {
|
|
5
|
+
/** The panel association announced while the Sidebar is open. */
|
|
6
|
+
"aria-controls"?: string;
|
|
7
|
+
/** The disclosure state announced for the Sidebar. */
|
|
8
|
+
"aria-expanded"?: boolean;
|
|
9
|
+
/** The kind of interface the control discloses. */
|
|
10
|
+
"aria-haspopup"?: "dialog";
|
|
11
|
+
/** The class names applied to the control. */
|
|
12
|
+
className?: string;
|
|
13
|
+
/** The responsive behavior selecting stylesheet visibility. */
|
|
14
|
+
"data-sidebar-variant"?: SidebarVariant;
|
|
15
|
+
/** The callback invoked when the control is activated. */
|
|
16
|
+
onClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
17
|
+
/** The reference assigned to the control. */
|
|
18
|
+
ref?: Ref<HTMLElement>;
|
|
19
|
+
};
|
|
20
|
+
/** A type representing properties for the Sidebar.Trigger component. */
|
|
21
|
+
export type SidebarTriggerProps = {
|
|
22
|
+
/**
|
|
23
|
+
* The single control that opens the overlay Sidebar.
|
|
24
|
+
*
|
|
25
|
+
* Custom components must forward the class name, reference, click handler,
|
|
26
|
+
* and ARIA properties to their interactive root.
|
|
27
|
+
*/
|
|
28
|
+
children: ReactElement;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Connects an existing control to the overlay Sidebar it opens.
|
|
32
|
+
*
|
|
33
|
+
* The Trigger renders no element of its own, and renders nothing at all
|
|
34
|
+
* until a Sidebar publishes to the surrounding boundary. A server render
|
|
35
|
+
* resolves no presentation, so server markup carries no control and
|
|
36
|
+
* hydration adds one rather than withdrawing one the page should never
|
|
37
|
+
* have shown. A Trigger whose boundary holds no Sidebar stays absent for
|
|
38
|
+
* the same reason: there is nothing for it to disclose, and the control
|
|
39
|
+
* returns as soon as a Sidebar publishes.
|
|
40
|
+
*
|
|
41
|
+
* @param props - The single control receiving Sidebar behavior.
|
|
42
|
+
*
|
|
43
|
+
* @returns The control extended with Sidebar disclosure behavior, or
|
|
44
|
+
* nothing while no Sidebar is connected.
|
|
45
|
+
*/
|
|
46
|
+
export default function SidebarTrigger(props: SidebarTriggerProps): ReactElement<SidebarTriggerChildProps, string | import("react").JSXElementConstructor<any>> | null;
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
import { type ButtonProps } from "../../Button";
|
|
3
|
+
import { type IconType } from "../../Icon";
|
|
4
|
+
/** A type representing one consistently styled Sidebar user action. */
|
|
5
|
+
export type SidebarUserAction = Omit<ButtonProps<"button">, "as" | "children" | "className" | "fullWidth" | "icon" | "iconAlignment" | "shape" | "style" | "textAlignment" | "type" | "variant"> & {
|
|
6
|
+
/** The icon identifying the action. */
|
|
7
|
+
icon: IconType;
|
|
8
|
+
/** The short Tooltip label and base accessible name for the action. */
|
|
9
|
+
label: string;
|
|
10
|
+
};
|
|
11
|
+
/** A type representing properties for the Sidebar.User component. */
|
|
12
|
+
export type SidebarUserProps = Omit<HTMLAttributes<HTMLDivElement>, "children" | "onClick"> & {
|
|
13
|
+
/**
|
|
14
|
+
* The controls operating on the represented person.
|
|
15
|
+
*
|
|
16
|
+
* Each action is keyed by its label, so labels must be unique.
|
|
17
|
+
*/
|
|
18
|
+
actions?: readonly SidebarUserAction[];
|
|
19
|
+
/** The secondary line displayed beneath the name. */
|
|
20
|
+
description?: ReactNode;
|
|
21
|
+
/** The image displayed until loading fails. */
|
|
22
|
+
image?: string;
|
|
23
|
+
/** Whether the details are replaced by a loading indicator. */
|
|
24
|
+
loading?: boolean;
|
|
25
|
+
/** The display name shown for the represented person. */
|
|
26
|
+
name: string;
|
|
27
|
+
/** The callback invoked when the details are activated. */
|
|
28
|
+
onClick?: () => void;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Renders a person's avatar, name, and its consistently styled actions.
|
|
32
|
+
*
|
|
33
|
+
* The details and the actions are separately operable, so an activatable
|
|
34
|
+
* identity does not absorb the controls beside it.
|
|
35
|
+
*
|
|
36
|
+
* @param props - The identity, state, and native properties.
|
|
37
|
+
* @param forwardedReference - The reference assigned to the root element.
|
|
38
|
+
*
|
|
39
|
+
* @returns The rendered Sidebar user row.
|
|
40
|
+
*/
|
|
41
|
+
declare const SidebarUser: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children" | "onClick"> & {
|
|
42
|
+
/**
|
|
43
|
+
* The controls operating on the represented person.
|
|
44
|
+
*
|
|
45
|
+
* Each action is keyed by its label, so labels must be unique.
|
|
46
|
+
*/
|
|
47
|
+
actions?: readonly SidebarUserAction[];
|
|
48
|
+
/** The secondary line displayed beneath the name. */
|
|
49
|
+
description?: ReactNode;
|
|
50
|
+
/** The image displayed until loading fails. */
|
|
51
|
+
image?: string;
|
|
52
|
+
/** Whether the details are replaced by a loading indicator. */
|
|
53
|
+
loading?: boolean;
|
|
54
|
+
/** The display name shown for the represented person. */
|
|
55
|
+
name: string;
|
|
56
|
+
/** The callback invoked when the details are activated. */
|
|
57
|
+
onClick?: () => void;
|
|
58
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
59
|
+
export default SidebarUser;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { BoundaryWidthStore } from "../../Boundary/contexts/BoundaryContext";
|
|
2
|
+
import type { SidebarPresentation, SidebarVariant } from "../utils/state";
|
|
3
|
+
/**
|
|
4
|
+
* Resolves the presentation a Sidebar renders inside its boundary.
|
|
5
|
+
*
|
|
6
|
+
* The boundary is measured rather than the viewport, so a narrow Boundary on a
|
|
7
|
+
* wide display still presents its Sidebar as an overlay.
|
|
8
|
+
*
|
|
9
|
+
* @param variant - The responsive behavior requested by the consumer.
|
|
10
|
+
* @param width - The boundary width store, when a boundary exists.
|
|
11
|
+
*
|
|
12
|
+
* @returns The explicit, measured, or pending Sidebar presentation.
|
|
13
|
+
*/
|
|
14
|
+
export declare function usePresentation(variant: SidebarVariant, width: BoundaryWidthStore | undefined): SidebarPresentation;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type SidebarState } from "../utils/state";
|
|
2
|
+
/**
|
|
3
|
+
* Returns the Sidebar state published to the surrounding boundary.
|
|
4
|
+
*
|
|
5
|
+
* @param componentName - The subcomponent name reported when unconnected.
|
|
6
|
+
*
|
|
7
|
+
* @returns The published Sidebar state when one exists.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useSidebar(componentName: string): SidebarState | undefined;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { default } from "./Sidebar";
|
|
2
|
+
export type { SidebarFooterProps, SidebarGroupPresentation, SidebarGroupProps, SidebarItemProps, SidebarOpenChangeReason, SidebarProps, SidebarSide, SidebarTriggerProps, SidebarUserAction, SidebarUserProps, SidebarVariant, } from "./Sidebar";
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/** A type representing the responsive behavior of a Sidebar. */
|
|
2
|
+
export type SidebarVariant = "inline" | "overlay" | "responsive";
|
|
3
|
+
/**
|
|
4
|
+
* A type representing the presentation a Sidebar currently renders.
|
|
5
|
+
*
|
|
6
|
+
* The pending presentation covers server rendering and hydration, where the
|
|
7
|
+
* boundary is not yet measured and stylesheets select the presentation.
|
|
8
|
+
*/
|
|
9
|
+
export type SidebarPresentation = "inline" | "overlay" | "pending";
|
|
10
|
+
/** A type representing an interaction requesting a Sidebar state change. */
|
|
11
|
+
export type SidebarOpenChangeReason = "escape" | "item" | "outside" | "trigger" | "variant";
|
|
12
|
+
/** A type representing the state one Sidebar publishes to its boundary. */
|
|
13
|
+
export type SidebarState = {
|
|
14
|
+
/** The identifier applied to the Sidebar panel. */
|
|
15
|
+
id: string;
|
|
16
|
+
/** Whether the overlay Sidebar is currently open. */
|
|
17
|
+
open: boolean;
|
|
18
|
+
/** The presentation currently rendered by the Sidebar. */
|
|
19
|
+
presentation: SidebarPresentation;
|
|
20
|
+
/** The responsive behavior requested for the Sidebar. */
|
|
21
|
+
variant: SidebarVariant;
|
|
22
|
+
/** Adds a mounted Trigger to the overlay dismissal layer. */
|
|
23
|
+
registerTrigger: (element: HTMLElement) => void;
|
|
24
|
+
/** Removes an unmounted Trigger from the overlay dismissal layer. */
|
|
25
|
+
unregisterTrigger: (element: HTMLElement) => void;
|
|
26
|
+
/** Requests a change to the overlay open state. */
|
|
27
|
+
requestOpenChange: (open: boolean, reason: SidebarOpenChangeReason) => void;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Publishes a Sidebar's state while no other Sidebar holds the boundary.
|
|
31
|
+
*
|
|
32
|
+
* @param boundary - The boundary the publishing Sidebar occupies.
|
|
33
|
+
* @param owner - The token identifying the publishing Sidebar.
|
|
34
|
+
* @param state - The state shared with the boundary's descendants.
|
|
35
|
+
*
|
|
36
|
+
* @returns Whether the publishing Sidebar holds the boundary.
|
|
37
|
+
*/
|
|
38
|
+
export declare function publishSidebarState(boundary: Element, owner: symbol, state: SidebarState): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Releases a boundary when the requesting Sidebar still holds it.
|
|
41
|
+
*
|
|
42
|
+
* @param boundary - The boundary being released.
|
|
43
|
+
* @param owner - The token identifying the releasing Sidebar.
|
|
44
|
+
*/
|
|
45
|
+
export declare function releaseSidebarState(boundary: Element, owner: symbol): void;
|
|
46
|
+
/**
|
|
47
|
+
* Reads the Sidebar state registered for a boundary.
|
|
48
|
+
*
|
|
49
|
+
* @param boundary - The boundary whose Sidebar is read, when one exists.
|
|
50
|
+
*
|
|
51
|
+
* @returns The registered state, or undefined while none is registered.
|
|
52
|
+
*/
|
|
53
|
+
export declare function readSidebarState(boundary: Element | null): SidebarState | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Subscribes a listener to a boundary's Sidebar registration.
|
|
56
|
+
*
|
|
57
|
+
* @param boundary - The boundary being observed, when one exists.
|
|
58
|
+
* @param listener - The listener notified after every change.
|
|
59
|
+
*
|
|
60
|
+
* @returns The teardown removing the registered listener.
|
|
61
|
+
*/
|
|
62
|
+
export declare function subscribeToSidebarState(boundary: Element | null, listener: () => void): () => void;
|