neatkit 0.7.0 → 0.9.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.
Files changed (179) hide show
  1. package/dist/Avatar-Belo7qAY.cjs +1 -0
  2. package/dist/Avatar-DjDCFqNG.js +55 -0
  3. package/dist/Avatar.cjs +1 -1
  4. package/dist/Avatar.js +2 -52
  5. package/dist/Boundary.cjs +1 -0
  6. package/dist/Boundary.js +176 -0
  7. package/dist/Button-BV5OUXpc.js +101 -0
  8. package/dist/Button-DU4j_IED.cjs +1 -0
  9. package/dist/Button.cjs +1 -1
  10. package/dist/Button.js +1 -1
  11. package/dist/Checkbox.cjs +1 -1
  12. package/dist/Checkbox.js +213 -2
  13. package/dist/Code-B7s_rN0G.cjs +4 -0
  14. package/dist/Code-Bp2X1k-g.js +224 -0
  15. package/dist/Code.cjs +1 -1
  16. package/dist/Code.js +1 -1
  17. package/dist/Divider-C7XGlr26.cjs +1 -0
  18. package/dist/{Divider-BE15WVDI.js → Divider-DZgpYpr-.js} +1 -1
  19. package/dist/Divider.cjs +1 -1
  20. package/dist/Divider.js +1 -1
  21. package/dist/Icon-BIBzgznI.cjs +1 -0
  22. package/dist/{Icon-uQmpr5P2.js → Icon-CxK1wlGk.js} +194 -181
  23. package/dist/Icon.cjs +1 -1
  24. package/dist/Icon.js +2 -35
  25. package/dist/Input.cjs +1 -1
  26. package/dist/Input.js +70 -79
  27. package/dist/Markdown.cjs +1 -31
  28. package/dist/Markdown.js +469 -18066
  29. package/dist/Modal.cjs +1 -1
  30. package/dist/Modal.js +100 -122
  31. package/dist/PinInput.cjs +1 -1
  32. package/dist/PinInput.js +1 -1
  33. package/dist/Popover.cjs +1 -1
  34. package/dist/Popover.js +171 -165
  35. package/dist/Radio.cjs +1 -1
  36. package/dist/Radio.js +86 -41
  37. package/dist/Select.cjs +1 -1
  38. package/dist/Select.js +326 -315
  39. package/dist/Sidebar.cjs +1 -0
  40. package/dist/Sidebar.js +490 -0
  41. package/dist/Skeleton.cjs +1 -1
  42. package/dist/Skeleton.js +20 -16
  43. package/dist/Switch.cjs +1 -1
  44. package/dist/Switch.js +1 -1
  45. package/dist/Table-CADupJEU.js +423 -0
  46. package/dist/Table-qetwZpTC.cjs +1 -0
  47. package/dist/Table.cjs +1 -1
  48. package/dist/Table.js +1 -1
  49. package/dist/TextArea.cjs +1 -1
  50. package/dist/TextArea.js +1 -1
  51. package/dist/Tooltip-B2d5ss7S.cjs +1 -0
  52. package/dist/Tooltip-BK64rkxV.js +231 -0
  53. package/dist/Tooltip.cjs +1 -1
  54. package/dist/Tooltip.js +2 -3
  55. package/dist/albert-sans-cb3e34c4.woff2 +0 -0
  56. package/dist/aria-Bntn6ad_.cjs +1 -0
  57. package/dist/aria-CeA9QfD1.js +15 -0
  58. package/dist/components/Boundary/Boundary.d.ts +65 -0
  59. package/dist/components/Boundary/contexts/BoundaryContext.d.ts +28 -0
  60. package/dist/components/Boundary/hooks/useBoundary.d.ts +19 -0
  61. package/dist/components/Boundary/hooks/useBoundaryWidth.d.ts +23 -0
  62. package/dist/components/Boundary/index.d.ts +2 -0
  63. package/dist/components/Boundary/utils/width.d.ts +11 -0
  64. package/dist/components/Checkbox/Checkbox.d.ts +9 -1
  65. package/dist/components/{CheckboxGroup → Checkbox/components}/CheckboxGroup.d.ts +2 -2
  66. package/dist/components/Checkbox/index.d.ts +1 -0
  67. package/dist/components/Checkbox/utils/checkbox-option.d.ts +17 -0
  68. package/dist/components/Icon/Icon.d.ts +1 -0
  69. package/dist/components/Icon/icons/GearIcon.d.ts +11 -0
  70. package/dist/components/Icon/icons/ImageIcon.d.ts +11 -0
  71. package/dist/components/Icon/index.d.ts +0 -33
  72. package/dist/components/Icon/utils/registry.d.ts +2 -0
  73. package/dist/components/Input/Input.d.ts +1 -9
  74. package/dist/components/Modal/Modal.d.ts +0 -4
  75. package/dist/components/PinInput/PinInput.d.ts +1 -1
  76. package/dist/components/Popover/Popover.d.ts +2 -6
  77. package/dist/components/Portal/Portal.d.ts +11 -8
  78. package/dist/components/Portal/hooks/useDismissableLayer.d.ts +2 -0
  79. package/dist/components/Portal/hooks/useFloatingPosition.d.ts +4 -3
  80. package/dist/components/Portal/hooks/useFocusTrap.d.ts +2 -0
  81. package/dist/components/Portal/hooks/useScrollLock.d.ts +9 -3
  82. package/dist/components/Portal/utils/boundary-focus.d.ts +23 -0
  83. package/dist/components/Portal/utils/floating-position.d.ts +43 -9
  84. package/dist/components/Portal/utils/overlay-stack.d.ts +22 -10
  85. package/dist/components/Portal/utils/scroll-container.d.ts +13 -0
  86. package/dist/components/Radio/Radio.d.ts +9 -1
  87. package/dist/components/{RadioGroup → Radio/components}/RadioGroup.d.ts +9 -2
  88. package/dist/components/Radio/index.d.ts +1 -0
  89. package/dist/components/Select/Select.d.ts +0 -2
  90. package/dist/components/Select/utils/listbox-position.d.ts +28 -0
  91. package/dist/components/Sidebar/Sidebar.d.ts +113 -0
  92. package/dist/components/Sidebar/components/SidebarFooter.d.ts +24 -0
  93. package/dist/components/Sidebar/components/SidebarGroup.d.ts +31 -0
  94. package/dist/components/Sidebar/components/SidebarHeader.d.ts +29 -0
  95. package/dist/components/Sidebar/components/SidebarItem.d.ts +46 -0
  96. package/dist/components/Sidebar/components/SidebarOverlay.d.ts +38 -0
  97. package/dist/components/Sidebar/components/SidebarPanel.d.ts +47 -0
  98. package/dist/components/Sidebar/components/SidebarTrigger.d.ts +47 -0
  99. package/dist/components/Sidebar/components/SidebarUser.d.ts +59 -0
  100. package/dist/components/Sidebar/hooks/usePresentation.d.ts +14 -0
  101. package/dist/components/Sidebar/hooks/useSidebar.d.ts +9 -0
  102. package/dist/components/Sidebar/index.d.ts +2 -0
  103. package/dist/components/Sidebar/utils/presentation.d.ts +12 -0
  104. package/dist/components/Sidebar/utils/state.d.ts +62 -0
  105. package/dist/components/Skeleton/Skeleton.d.ts +21 -5
  106. package/dist/components/Table/Table.d.ts +21 -249
  107. package/dist/components/Table/components/TableAction.d.ts +18 -0
  108. package/dist/components/Table/components/TableActionCell.d.ts +15 -0
  109. package/dist/components/Table/components/TableActionHeaderCell.d.ts +13 -0
  110. package/dist/components/Table/components/TableBody.d.ts +27 -0
  111. package/dist/components/Table/components/TableCell.d.ts +42 -0
  112. package/dist/components/Table/components/TableFoot.d.ts +19 -0
  113. package/dist/components/Table/components/TableHead.d.ts +19 -0
  114. package/dist/components/Table/components/TableHeaderCell.d.ts +23 -0
  115. package/dist/components/Table/components/TableRow.d.ts +67 -0
  116. package/dist/components/Table/contexts/TableContext.d.ts +4 -0
  117. package/dist/components/Table/hooks/useHorizontalOverflow.d.ts +25 -0
  118. package/dist/components/Table/index.d.ts +1 -1
  119. package/dist/components/Table/utils/cell.d.ts +25 -0
  120. package/dist/components/Table/utils/children.d.ts +18 -0
  121. package/dist/components/Table/utils/trigger.d.ts +54 -0
  122. package/dist/components/Tooltip/Tooltip.d.ts +10 -4
  123. package/dist/components/Tooltip/TooltipProvider.d.ts +1 -1
  124. package/dist/components/Tooltip/index.d.ts +0 -1
  125. package/dist/effects-D5CWf-Pl.js +8 -0
  126. package/dist/effects-D85L_7zM.cjs +1 -0
  127. package/dist/floating-position-DIjh2wnP.cjs +1 -0
  128. package/dist/floating-position-DvR6e334.js +50 -0
  129. package/dist/style.css +1 -1
  130. package/dist/tokens.d.ts +1 -0
  131. package/dist/useFloatingPosition-B3ZC-v3v.js +43 -0
  132. package/dist/useFloatingPosition-GzkP9dCc.cjs +1 -0
  133. package/dist/useFocusTrap-BrFZdMqQ.cjs +1 -0
  134. package/dist/useFocusTrap-DhVnlboe.js +136 -0
  135. package/dist/usePresence-B5RYv4e1.cjs +1 -0
  136. package/dist/usePresence-CqegYqy4.js +221 -0
  137. package/dist/useScrollLock-Drd7OZRC.js +62 -0
  138. package/dist/useScrollLock-Dy8MZaSn.cjs +1 -0
  139. package/dist/utils/aria.d.ts +9 -0
  140. package/dist/utils/effects.d.ts +12 -0
  141. package/package.json +12 -16
  142. package/dist/Button-BAsLfA0D.js +0 -99
  143. package/dist/Button-D7JUO6Fs.cjs +0 -1
  144. package/dist/Checkbox-BvXM9VyY.js +0 -68
  145. package/dist/Checkbox-VQifZrZZ.cjs +0 -1
  146. package/dist/CheckboxGroup.cjs +0 -1
  147. package/dist/CheckboxGroup.js +0 -144
  148. package/dist/Code-BP2ZCmUf.js +0 -7446
  149. package/dist/Code-eispVOW3.cjs +0 -6
  150. package/dist/Content.cjs +0 -1
  151. package/dist/Content.js +0 -144
  152. package/dist/Divider-CJYbFcSX.cjs +0 -1
  153. package/dist/Icon-D8IZceys.cjs +0 -1
  154. package/dist/RadioGroup.cjs +0 -1
  155. package/dist/RadioGroup.js +0 -51
  156. package/dist/RadioGroupContext-BX9KnDek.cjs +0 -1
  157. package/dist/RadioGroupContext-DbKM4zPZ.js +0 -5
  158. package/dist/Table-83unQQOi.cjs +0 -1
  159. package/dist/Table-Cw8u-pEW.js +0 -403
  160. package/dist/Tooltip-BB82wNOE.cjs +0 -1
  161. package/dist/Tooltip-CqWK_GRD.js +0 -236
  162. package/dist/aria-DHnOMyYp.js +0 -10
  163. package/dist/aria-DKxpE8cA.cjs +0 -1
  164. package/dist/components/CheckboxGroup/index.d.ts +0 -2
  165. package/dist/components/Content/Content.d.ts +0 -60
  166. package/dist/components/Content/hooks/useContentLayout.d.ts +0 -18
  167. package/dist/components/Content/index.d.ts +0 -2
  168. package/dist/components/Content/utils/layout.d.ts +0 -11
  169. package/dist/components/RadioGroup/index.d.ts +0 -2
  170. package/dist/useFloatingPosition-CxzhAvy8.js +0 -73
  171. package/dist/useFloatingPosition-D1FqYy0l.cjs +0 -1
  172. package/dist/useFocusTrap--cgjy78G.cjs +0 -1
  173. package/dist/useFocusTrap-Da4nEash.js +0 -134
  174. package/dist/usePresence-DSPt6aKi.js +0 -210
  175. package/dist/usePresence-qe92UTvK.cjs +0 -1
  176. /package/dist/components/{CheckboxGroup → Checkbox}/contexts/CheckboxGroupContext.d.ts +0 -0
  177. /package/dist/components/{CheckboxGroup → Checkbox}/hooks/useCheckboxGroup.d.ts +0 -0
  178. /package/dist/components/{RadioGroup → Radio}/contexts/RadioGroupContext.d.ts +0 -0
  179. /package/dist/components/{RadioGroup → Radio}/hooks/useRadioGroup.d.ts +0 -0
@@ -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 { SidebarPresentationState } 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: SidebarPresentationState;
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 { SidebarPresentationState, 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): SidebarPresentationState;
@@ -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, SidebarGroupProps, SidebarHeaderProps, SidebarItemProps, SidebarOpenChangeReason, SidebarPresentation, SidebarProps, SidebarSide, SidebarTriggerProps, SidebarUserAction, SidebarUserProps, SidebarVariant, } from "./Sidebar";
@@ -0,0 +1,12 @@
1
+ import type { SidebarPresentationState } from "./state";
2
+ /** A type representing the presentations a Sidebar's content renders in. */
3
+ export type SidebarPresentation = "both" | "inline" | "overlay";
4
+ /**
5
+ * Determines whether content renders in the Sidebar's presentation.
6
+ *
7
+ * @param requested - The presentations the content is rendered in.
8
+ * @param current - The presentation the Sidebar currently renders.
9
+ *
10
+ * @returns Whether the content renders rather than being omitted.
11
+ */
12
+ export declare function rendersInPresentation(requested: SidebarPresentation, current: SidebarPresentationState | undefined): boolean;
@@ -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 SidebarPresentationState = "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: SidebarPresentationState;
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;
@@ -1,14 +1,22 @@
1
1
  import { type HTMLAttributes } from "react";
2
2
  import "./styles/skeleton.css";
3
3
  /** A type representing the silhouette drawn by Skeleton. */
4
- export type SkeletonShape = "rectangle" | "circle";
4
+ export type SkeletonShape = "rectangle" | "ellipse";
5
5
  /** A type representing properties for the Skeleton component. */
6
6
  export type SkeletonProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
7
7
  /** The silhouette drawn by the loading placeholder. */
8
8
  shape?: SkeletonShape;
9
- /** The CSS-compatible width of the loading placeholder. */
9
+ /**
10
+ * The CSS-compatible width of the loading placeholder.
11
+ *
12
+ * Placeholders otherwise fill their container.
13
+ */
10
14
  width?: number | string;
11
- /** The CSS-compatible height of the loading placeholder. */
15
+ /**
16
+ * The CSS-compatible height of the loading placeholder.
17
+ *
18
+ * Placeholders otherwise match the height of the surrounding text.
19
+ */
12
20
  height?: number | string;
13
21
  };
14
22
  /**
@@ -22,9 +30,17 @@ export type SkeletonProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
22
30
  declare const Skeleton: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
23
31
  /** The silhouette drawn by the loading placeholder. */
24
32
  shape?: SkeletonShape;
25
- /** The CSS-compatible width of the loading placeholder. */
33
+ /**
34
+ * The CSS-compatible width of the loading placeholder.
35
+ *
36
+ * Placeholders otherwise fill their container.
37
+ */
26
38
  width?: number | string;
27
- /** The CSS-compatible height of the loading placeholder. */
39
+ /**
40
+ * The CSS-compatible height of the loading placeholder.
41
+ *
42
+ * Placeholders otherwise match the height of the surrounding text.
43
+ */
28
44
  height?: number | string;
29
45
  } & import("react").RefAttributes<HTMLDivElement>>;
30
46
  export default Skeleton;
@@ -1,143 +1,21 @@
1
- import { type HTMLAttributeAnchorTarget, type HTMLAttributes, type MouseEventHandler, type ReactNode, type TableHTMLAttributes, type TdHTMLAttributes, type ThHTMLAttributes } from "react";
2
- import { type ButtonProps } from "../Button";
3
- import { type IconType } from "../Icon";
1
+ import { type ReactNode, type TableHTMLAttributes } from "react";
2
+ import TableBody from "./components/TableBody";
3
+ import TableCell from "./components/TableCell";
4
+ import TableFoot from "./components/TableFoot";
5
+ import TableHead from "./components/TableHead";
6
+ import TableHeaderCell from "./components/TableHeaderCell";
7
+ import TableRow from "./components/TableRow";
4
8
  import "./styles/table.css";
5
- /** A value rendered directly or formatted by a Table cell. */
6
- export type TableCellValue = boolean | Date | number | string;
7
- /** The horizontal alignment applied to Table cell content. */
8
- export type TableCellAlignment = "left" | "center" | "right";
9
- /** A type representing properties for the Table component. */
10
- export type TableProps = TableHTMLAttributes<HTMLTableElement> & {
11
- /** The table sections, rows, and cells rendered inside the Table. */
12
- children: ReactNode;
13
- /** The additional class name applied to the horizontal scroll container. */
14
- containerClassName?: string;
15
- };
16
- /** A type representing properties for the Table.Head component. */
17
- export type TableHeadProps = HTMLAttributes<HTMLTableSectionElement> & {
18
- /** The rows rendered inside the Table head. */
19
- children: ReactNode;
20
- };
21
- /** A type representing properties for the Table.Body component. */
22
- export type TableBodyProps = HTMLAttributes<HTMLTableSectionElement> & {
23
- /** The rows rendered inside the Table body. */
24
- children?: ReactNode;
25
- /** The number of columns occupied by the generated empty-state cell. */
26
- emptyColumnCount?: number;
27
- /** The content displayed when children contain no explicit content. */
28
- emptyMessage?: ReactNode;
29
- };
30
- /** A type representing properties for the Table.Foot component. */
31
- export type TableFootProps = HTMLAttributes<HTMLTableSectionElement> & {
32
- /** The rows rendered inside the Table foot. */
33
- children: ReactNode;
34
- };
35
- /** Shared native properties for every Table.Row configuration. */
36
- type TableRowBaseProps = Omit<HTMLAttributes<HTMLTableRowElement>, "aria-label" | "children" | "onClick"> & {
37
- /** The cells rendered inside the Table row. */
38
- children: ReactNode;
39
- };
40
- /** A type representing a static Table.Row configuration. */
41
- type TableStaticRowProps = {
42
- /** The optional accessible name applied to the static row. */
43
- "aria-label"?: string;
44
- /** Static rows do not expose download behavior. */
45
- download?: never;
46
- /** Static rows do not expose a navigation destination. */
47
- href?: never;
48
- /** Static rows do not describe a linked resource language. */
49
- hrefLang?: never;
50
- /** Static rows do not expose whole-row activation. */
51
- onClick?: never;
52
- /** Static rows do not expose navigation interception. */
53
- onNavigate?: never;
54
- /** Static rows do not target a browsing context. */
55
- target?: never;
56
- };
57
- /** A type representing a button-backed Table.Row configuration. */
58
- type TableButtonRowProps = {
59
- /** The accessible name describing the whole-row action. */
60
- "aria-label": string;
61
- /** Button-backed rows do not expose download behavior. */
62
- download?: never;
63
- /** Button-backed rows do not expose a navigation destination. */
64
- href?: never;
65
- /** Button-backed rows do not describe a linked resource language. */
66
- hrefLang?: never;
67
- /** The callback invoked when the row's button is activated. */
68
- onClick: MouseEventHandler<HTMLButtonElement>;
69
- /** Button-backed rows do not expose navigation interception. */
70
- onNavigate?: never;
71
- /** Button-backed rows do not target a browsing context. */
72
- target?: never;
73
- };
74
- /** A type representing a link-backed Table.Row configuration. */
75
- type TableLinkRowProps = {
76
- /** The accessible name describing the whole-row link. */
77
- "aria-label": string;
78
- /** Whether the linked resource should be downloaded. */
79
- download?: boolean | string;
80
- /** The destination opened by whole-row activation. */
81
- href: string;
82
- /** The language of the linked resource. */
83
- hrefLang?: string;
84
- /** Link-backed rows do not expose button activation. */
85
- onClick?: never;
86
- /** The callback invoked when the row's link is activated. */
87
- onNavigate?: MouseEventHandler<HTMLAnchorElement>;
88
- /** The relationship between the table and linked resource. */
89
- rel?: string;
90
- /** The browsing context used to open the linked resource. */
91
- target?: HTMLAttributeAnchorTarget;
92
- };
93
- /** A type representing properties for the Table.Row component. */
94
- export type TableRowProps = TableRowBaseProps & (TableButtonRowProps | TableLinkRowProps | TableStaticRowProps);
95
- /** Shared properties configuring a Table header cell. */
96
- type TableHeaderCellOwnProps = {
97
- /** The horizontal alignment applied to the header content. */
98
- align?: TableCellAlignment;
99
- /** The content rendered inside the header cell. */
100
- children?: ReactNode;
101
- /** Whether the header pins its supported edge column during scrolling. */
102
- sticky?: boolean;
103
- };
104
- /** A type representing properties for the Table.HeaderCell component. */
105
- export type TableHeaderCellProps = Omit<ThHTMLAttributes<HTMLTableCellElement>, "align" | "children"> & TableHeaderCellOwnProps;
106
- /** A type representing properties for the Table.ActionHeaderCell component. */
107
- export type TableActionHeaderCellProps = Omit<TableHeaderCellProps, "align">;
108
- /** A type representing properties for the Table.Cell component. */
109
- export type TableCellProps = Omit<TdHTMLAttributes<HTMLTableCellElement>, "align" | "children"> & {
110
- /** The horizontal alignment applied to the cell content. */
111
- align?: TableCellAlignment;
112
- /** Content rendered when no value is supplied. */
113
- children?: ReactNode;
114
- /** A function transforming the supplied value into displayed content. */
115
- format?: (value: TableCellValue) => ReactNode;
116
- /** The maximum CSS width used to truncate overflowing content. */
117
- truncate?: string;
118
- /** The primitive value displayed or passed to the format function. */
119
- value?: TableCellValue;
120
- };
121
- /** A type representing properties for the Table.Action component. */
122
- export type TableActionProps = Omit<ButtonProps<"button">, "as" | "children" | "className" | "fullWidth" | "icon" | "iconAlignment" | "shape" | "style" | "textAlignment" | "type" | "variant"> & {
123
- /** The icon identifying the row action. */
124
- icon: IconType;
125
- /** The short Tooltip label and base accessible name for the row action. */
126
- label: string;
127
- };
128
- /** A type representing properties for the Table.ActionCell component. */
129
- export type TableActionCellProps = Omit<TdHTMLAttributes<HTMLTableCellElement>, "align" | "children"> & {
130
- /** The consistently styled row actions rendered inside the cell. */
131
- children?: ReactNode;
132
- };
9
+ export type { TableRowAction } from "./components/TableAction";
10
+ export type { TableBodyProps } from "./components/TableBody";
11
+ export type { TableCellProps } from "./components/TableCell";
12
+ export type { TableFootProps } from "./components/TableFoot";
13
+ export type { TableHeadProps } from "./components/TableHead";
14
+ export type { TableHeaderCellProps } from "./components/TableHeaderCell";
15
+ export type { TableRowProps } from "./components/TableRow";
16
+ export type { TableCellAlignment, TableCellValue } from "./utils/cell";
133
17
  /** A type representing the complete compound Table component. */
134
18
  type TableComponent = typeof TableRoot & {
135
- /** A consistently styled control operating on one Table row. */
136
- Action: typeof TableAction;
137
- /** The cell containing persistent row-level actions. */
138
- ActionCell: typeof TableActionCell;
139
- /** The header cell labelling the row-actions column. */
140
- ActionHeaderCell: typeof TableActionHeaderCell;
141
19
  /** The body section containing Table data rows. */
142
20
  Body: typeof TableBody;
143
21
  /** A standard Table data cell. */
@@ -151,119 +29,13 @@ type TableComponent = typeof TableRoot & {
151
29
  /** A Table row. */
152
30
  Row: typeof TableRow;
153
31
  };
154
- /**
155
- * Renders the Table head section.
156
- *
157
- * @param props - The native section properties and header rows.
158
- * @param forwardedReference - The reference assigned to the head element.
159
- *
160
- * @returns The rendered Table head section.
161
- */
162
- declare const TableHead: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLTableSectionElement> & {
163
- /** The rows rendered inside the Table head. */
164
- children: ReactNode;
165
- } & import("react").RefAttributes<HTMLTableSectionElement>>;
166
- /**
167
- * Renders the Table body and its optional empty state.
168
- *
169
- * @param props - The native section, row, and empty-state properties.
170
- * @param forwardedReference - The reference assigned to the body element.
171
- *
172
- * @returns The rendered Table body section.
173
- */
174
- declare const TableBody: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLTableSectionElement> & {
175
- /** The rows rendered inside the Table body. */
176
- children?: ReactNode;
177
- /** The number of columns occupied by the generated empty-state cell. */
178
- emptyColumnCount?: number;
179
- /** The content displayed when children contain no explicit content. */
180
- emptyMessage?: ReactNode;
181
- } & import("react").RefAttributes<HTMLTableSectionElement>>;
182
- /**
183
- * Renders the Table foot section.
184
- *
185
- * @param props - The native section properties and footer rows.
186
- * @param forwardedReference - The reference assigned to the foot element.
187
- *
188
- * @returns The rendered Table foot section.
189
- */
190
- declare const TableFoot: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLTableSectionElement> & {
191
- /** The rows rendered inside the Table foot. */
32
+ /** A type representing properties for the Table component. */
33
+ export type TableProps = TableHTMLAttributes<HTMLTableElement> & {
34
+ /** The table sections, rows, and cells rendered inside the Table. */
192
35
  children: ReactNode;
193
- } & import("react").RefAttributes<HTMLTableSectionElement>>;
194
- /**
195
- * Renders a native Table row without replacing its table semantics.
196
- *
197
- * @param props - The native row properties and cells.
198
- * @param forwardedReference - The reference assigned to the row element.
199
- *
200
- * @returns The rendered Table row.
201
- */
202
- declare const TableRow: import("react").ForwardRefExoticComponent<TableRowProps & import("react").RefAttributes<HTMLTableRowElement>>;
203
- /**
204
- * Renders a column header cell.
205
- *
206
- * @param props - The native header properties and displayed label.
207
- * @param forwardedReference - The reference assigned to the header cell.
208
- *
209
- * @returns The rendered Table column header.
210
- */
211
- declare const TableHeaderCell: import("react").ForwardRefExoticComponent<Omit<ThHTMLAttributes<HTMLTableCellElement>, "children" | "align"> & TableHeaderCellOwnProps & import("react").RefAttributes<HTMLTableCellElement>>;
212
- /**
213
- * Renders the header for a row-actions column.
214
- *
215
- * @param props - The native header properties and optional visible label.
216
- * @param forwardedReference - The reference assigned to the header cell.
217
- *
218
- * @returns The rendered Table actions header.
219
- */
220
- declare const TableActionHeaderCell: import("react").ForwardRefExoticComponent<TableActionHeaderCellProps & import("react").RefAttributes<HTMLTableCellElement>>;
221
- /**
222
- * Renders a data cell with optional value formatting and truncation.
223
- *
224
- * @param props - The native cell, content, and display properties.
225
- * @param forwardedReference - The reference assigned to the data cell.
226
- *
227
- * @returns The rendered Table data cell.
228
- */
229
- declare const TableCell: import("react").ForwardRefExoticComponent<Omit<TdHTMLAttributes<HTMLTableCellElement>, "children" | "align"> & {
230
- /** The horizontal alignment applied to the cell content. */
231
- align?: TableCellAlignment;
232
- /** Content rendered when no value is supplied. */
233
- children?: ReactNode;
234
- /** A function transforming the supplied value into displayed content. */
235
- format?: (value: TableCellValue) => ReactNode;
236
- /** The maximum CSS width used to truncate overflowing content. */
237
- truncate?: string;
238
- /** The primitive value displayed or passed to the format function. */
239
- value?: TableCellValue;
240
- } & import("react").RefAttributes<HTMLTableCellElement>>;
241
- /**
242
- * Renders one consistently styled control operating on a Table row.
243
- *
244
- * @param props - The short label, icon, and native button properties.
245
- * @param forwardedReference - The reference assigned to the action button.
246
- *
247
- * @returns The rendered Table row action.
248
- */
249
- declare const TableAction: import("react").ForwardRefExoticComponent<Omit<ButtonProps<"button">, "className" | "style" | "children" | "icon" | "variant" | "type" | "as" | "shape" | "fullWidth" | "iconAlignment" | "textAlignment"> & {
250
- /** The icon identifying the row action. */
251
- icon: IconType;
252
- /** The short Tooltip label and base accessible name for the row action. */
253
- label: string;
254
- } & import("react").RefAttributes<HTMLButtonElement>>;
255
- /**
256
- * Renders the cell containing controls for one Table row.
257
- *
258
- * @param props - The native cell properties and composed Table actions.
259
- * @param forwardedReference - The reference assigned to the action cell.
260
- *
261
- * @returns The rendered Table action cell.
262
- */
263
- declare const TableActionCell: import("react").ForwardRefExoticComponent<Omit<TdHTMLAttributes<HTMLTableCellElement>, "children" | "align"> & {
264
- /** The consistently styled row actions rendered inside the cell. */
265
- children?: ReactNode;
266
- } & import("react").RefAttributes<HTMLTableCellElement>>;
36
+ /** The additional class name applied to the horizontal scroll container. */
37
+ containerClassName?: string;
38
+ };
267
39
  /**
268
40
  * Renders a semantic Table inside a keyboard-scrollable surface.
269
41
  *
@@ -0,0 +1,18 @@
1
+ import { type ButtonProps } from "../../Button";
2
+ import type { IconType } from "../../Icon";
3
+ /** A type representing one consistently styled Table row action. */
4
+ export type TableRowAction = Omit<ButtonProps<"button">, "as" | "children" | "className" | "fullWidth" | "icon" | "iconAlignment" | "shape" | "style" | "textAlignment" | "type" | "variant"> & {
5
+ /** The icon identifying the row action. */
6
+ icon: IconType;
7
+ /** The short Tooltip label and base accessible name for the row action. */
8
+ label: string;
9
+ };
10
+ /**
11
+ * Renders one consistently styled control operating on a Table row.
12
+ *
13
+ * @param props - The short label, icon, and native button properties.
14
+ *
15
+ * @returns The rendered Table row action.
16
+ */
17
+ declare function TableAction(props: TableRowAction): import("react").JSX.Element;
18
+ export default TableAction;