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.
- 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-BV5OUXpc.js +101 -0
- package/dist/Button-DU4j_IED.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-B7s_rN0G.cjs +4 -0
- package/dist/Code-Bp2X1k-g.js +224 -0
- package/dist/Code.cjs +1 -1
- package/dist/Code.js +1 -1
- package/dist/Divider-C7XGlr26.cjs +1 -0
- package/dist/{Divider-BE15WVDI.js → Divider-DZgpYpr-.js} +1 -1
- package/dist/Divider.cjs +1 -1
- package/dist/Divider.js +1 -1
- package/dist/Icon-BIBzgznI.cjs +1 -0
- package/dist/{Icon-uQmpr5P2.js → Icon-CxK1wlGk.js} +194 -181
- 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 +469 -18066
- 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 +171 -165
- 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 +490 -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-CADupJEU.js +423 -0
- package/dist/Table-qetwZpTC.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-B2d5ss7S.cjs +1 -0
- package/dist/Tooltip-BK64rkxV.js +231 -0
- package/dist/Tooltip.cjs +1 -1
- package/dist/Tooltip.js +2 -3
- package/dist/albert-sans-cb3e34c4.woff2 +0 -0
- 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/icons/GearIcon.d.ts +11 -0
- package/dist/components/Icon/icons/ImageIcon.d.ts +11 -0
- package/dist/components/Icon/index.d.ts +0 -33
- package/dist/components/Icon/utils/registry.d.ts +2 -0
- 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 +113 -0
- package/dist/components/Sidebar/components/SidebarFooter.d.ts +24 -0
- package/dist/components/Sidebar/components/SidebarGroup.d.ts +31 -0
- package/dist/components/Sidebar/components/SidebarHeader.d.ts +29 -0
- package/dist/components/Sidebar/components/SidebarItem.d.ts +46 -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/presentation.d.ts +12 -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 +21 -249
- package/dist/components/Table/components/TableAction.d.ts +18 -0
- package/dist/components/Table/components/TableActionCell.d.ts +15 -0
- package/dist/components/Table/components/TableActionHeaderCell.d.ts +13 -0
- package/dist/components/Table/components/TableBody.d.ts +27 -0
- package/dist/components/Table/components/TableCell.d.ts +42 -0
- package/dist/components/Table/components/TableFoot.d.ts +19 -0
- package/dist/components/Table/components/TableHead.d.ts +19 -0
- package/dist/components/Table/components/TableHeaderCell.d.ts +23 -0
- package/dist/components/Table/components/TableRow.d.ts +67 -0
- package/dist/components/Table/contexts/TableContext.d.ts +4 -0
- package/dist/components/Table/hooks/useHorizontalOverflow.d.ts +25 -0
- package/dist/components/Table/index.d.ts +1 -1
- package/dist/components/Table/utils/cell.d.ts +25 -0
- package/dist/components/Table/utils/children.d.ts +18 -0
- package/dist/components/Table/utils/trigger.d.ts +54 -0
- 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-DIjh2wnP.cjs +1 -0
- package/dist/floating-position-DvR6e334.js +50 -0
- package/dist/style.css +1 -1
- package/dist/tokens.d.ts +1 -0
- package/dist/useFloatingPosition-B3ZC-v3v.js +43 -0
- package/dist/useFloatingPosition-GzkP9dCc.cjs +1 -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 +12 -16
- package/dist/Button-BAsLfA0D.js +0 -99
- 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/Divider-CJYbFcSX.cjs +0 -1
- 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,15 @@
|
|
|
1
|
+
import { type TableRowAction } from "./TableAction";
|
|
2
|
+
/** Internal action-cell properties supplied by a Table.Row. */
|
|
3
|
+
export type TableActionCellProps = {
|
|
4
|
+
/** The controls rendered inside the row's action cell. */
|
|
5
|
+
actions: readonly TableRowAction[];
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Renders the cell containing controls for one Table row.
|
|
9
|
+
*
|
|
10
|
+
* @param props - The composed Table actions operating on the row.
|
|
11
|
+
*
|
|
12
|
+
* @returns The rendered Table action cell.
|
|
13
|
+
*/
|
|
14
|
+
declare function TableActionCell(props: TableActionCellProps): import("react").JSX.Element;
|
|
15
|
+
export default TableActionCell;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type TableHeaderCellProps } from "./TableHeaderCell";
|
|
2
|
+
/** A type representing properties for the Table action header cell. */
|
|
3
|
+
export type TableActionHeaderCellProps = Omit<TableHeaderCellProps, "align">;
|
|
4
|
+
/**
|
|
5
|
+
* Renders the header for a row-actions column.
|
|
6
|
+
*
|
|
7
|
+
* @param props - The native header properties and optional visible label.
|
|
8
|
+
* @param forwardedReference - The reference assigned to the header cell.
|
|
9
|
+
*
|
|
10
|
+
* @returns The rendered Table actions header.
|
|
11
|
+
*/
|
|
12
|
+
declare const TableActionHeaderCell: import("react").ForwardRefExoticComponent<TableActionHeaderCellProps & import("react").RefAttributes<HTMLTableCellElement>>;
|
|
13
|
+
export default TableActionHeaderCell;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
/** A type representing properties for the Table.Body component. */
|
|
3
|
+
export type TableBodyProps = HTMLAttributes<HTMLTableSectionElement> & {
|
|
4
|
+
/** The rows rendered inside the Table body. */
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
/** The number of columns occupied by the generated empty-state cell. */
|
|
7
|
+
emptyColumnCount?: number;
|
|
8
|
+
/** The content displayed when children contain no explicit content. */
|
|
9
|
+
emptyMessage?: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Renders the Table body and its optional empty state.
|
|
13
|
+
*
|
|
14
|
+
* @param props - The native section, row, and empty-state properties.
|
|
15
|
+
* @param forwardedReference - The reference assigned to the body element.
|
|
16
|
+
*
|
|
17
|
+
* @returns The rendered Table body section.
|
|
18
|
+
*/
|
|
19
|
+
declare const TableBody: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLTableSectionElement> & {
|
|
20
|
+
/** The rows rendered inside the Table body. */
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
/** The number of columns occupied by the generated empty-state cell. */
|
|
23
|
+
emptyColumnCount?: number;
|
|
24
|
+
/** The content displayed when children contain no explicit content. */
|
|
25
|
+
emptyMessage?: ReactNode;
|
|
26
|
+
} & import("react").RefAttributes<HTMLTableSectionElement>>;
|
|
27
|
+
export default TableBody;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type ReactNode, type TdHTMLAttributes } from "react";
|
|
2
|
+
import { type TableCellAlignment, type TableCellFormatter, type TableCellValue } from "../utils/cell";
|
|
3
|
+
import type { TableRowTrigger } from "../utils/trigger";
|
|
4
|
+
/** A type representing properties for the Table.Cell component. */
|
|
5
|
+
export type TableCellProps = Omit<TdHTMLAttributes<HTMLTableCellElement>, "align" | "children"> & {
|
|
6
|
+
/** The horizontal alignment applied to the cell content. */
|
|
7
|
+
align?: TableCellAlignment;
|
|
8
|
+
/** Content rendered when no value is supplied. */
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
/** A function transforming the supplied value into displayed content. */
|
|
11
|
+
format?: TableCellFormatter;
|
|
12
|
+
/** The maximum CSS width used to truncate overflowing content. */
|
|
13
|
+
truncate?: string;
|
|
14
|
+
/** The primitive value displayed or passed to the format function. */
|
|
15
|
+
value?: TableCellValue;
|
|
16
|
+
};
|
|
17
|
+
/** Internal Table.Cell properties supplied by an interactive Table.Row. */
|
|
18
|
+
export type TableCellImplementationProps = TableCellProps & {
|
|
19
|
+
/** The primary row control rendered inside the first data cell. */
|
|
20
|
+
rowTrigger?: TableRowTrigger;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Renders a data cell with optional value formatting and truncation.
|
|
24
|
+
*
|
|
25
|
+
* @param props - The native cell, content, and display properties.
|
|
26
|
+
* @param forwardedReference - The reference assigned to the data cell.
|
|
27
|
+
*
|
|
28
|
+
* @returns The rendered Table data cell.
|
|
29
|
+
*/
|
|
30
|
+
declare const TableCell: import("react").ForwardRefExoticComponent<Omit<TdHTMLAttributes<HTMLTableCellElement>, "children" | "align"> & {
|
|
31
|
+
/** The horizontal alignment applied to the cell content. */
|
|
32
|
+
align?: TableCellAlignment;
|
|
33
|
+
/** Content rendered when no value is supplied. */
|
|
34
|
+
children?: ReactNode;
|
|
35
|
+
/** A function transforming the supplied value into displayed content. */
|
|
36
|
+
format?: TableCellFormatter;
|
|
37
|
+
/** The maximum CSS width used to truncate overflowing content. */
|
|
38
|
+
truncate?: string;
|
|
39
|
+
/** The primitive value displayed or passed to the format function. */
|
|
40
|
+
value?: TableCellValue;
|
|
41
|
+
} & import("react").RefAttributes<HTMLTableCellElement>>;
|
|
42
|
+
export default TableCell;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
/** A type representing properties for the Table.Foot component. */
|
|
3
|
+
export type TableFootProps = HTMLAttributes<HTMLTableSectionElement> & {
|
|
4
|
+
/** The rows rendered inside the Table foot. */
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Renders the Table foot section.
|
|
9
|
+
*
|
|
10
|
+
* @param props - The native section properties and footer rows.
|
|
11
|
+
* @param forwardedReference - The reference assigned to the foot element.
|
|
12
|
+
*
|
|
13
|
+
* @returns The rendered Table foot section.
|
|
14
|
+
*/
|
|
15
|
+
declare const TableFoot: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLTableSectionElement> & {
|
|
16
|
+
/** The rows rendered inside the Table foot. */
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
} & import("react").RefAttributes<HTMLTableSectionElement>>;
|
|
19
|
+
export default TableFoot;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
/** A type representing properties for the Table.Head component. */
|
|
3
|
+
export type TableHeadProps = HTMLAttributes<HTMLTableSectionElement> & {
|
|
4
|
+
/** The rows rendered inside the Table head. */
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Renders the Table head section.
|
|
9
|
+
*
|
|
10
|
+
* @param props - The native section properties and header rows.
|
|
11
|
+
* @param forwardedReference - The reference assigned to the head element.
|
|
12
|
+
*
|
|
13
|
+
* @returns The rendered Table head section.
|
|
14
|
+
*/
|
|
15
|
+
declare const TableHead: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLTableSectionElement> & {
|
|
16
|
+
/** The rows rendered inside the Table head. */
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
} & import("react").RefAttributes<HTMLTableSectionElement>>;
|
|
19
|
+
export default TableHead;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ReactNode, type ThHTMLAttributes } from "react";
|
|
2
|
+
import type { TableCellAlignment } from "../utils/cell";
|
|
3
|
+
/** Shared properties configuring a Table header cell. */
|
|
4
|
+
type TableHeaderCellOwnProps = {
|
|
5
|
+
/** The horizontal alignment applied to the header content. */
|
|
6
|
+
align?: TableCellAlignment;
|
|
7
|
+
/** The content rendered inside the header cell. */
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
/** Whether the header pins its supported edge column during scrolling. */
|
|
10
|
+
sticky?: boolean;
|
|
11
|
+
};
|
|
12
|
+
/** A type representing properties for the Table.HeaderCell component. */
|
|
13
|
+
export type TableHeaderCellProps = Omit<ThHTMLAttributes<HTMLTableCellElement>, "align" | "children"> & TableHeaderCellOwnProps;
|
|
14
|
+
/**
|
|
15
|
+
* Renders a column header cell.
|
|
16
|
+
*
|
|
17
|
+
* @param props - The native header properties and displayed label.
|
|
18
|
+
* @param forwardedReference - The reference assigned to the header cell.
|
|
19
|
+
*
|
|
20
|
+
* @returns The rendered Table column header.
|
|
21
|
+
*/
|
|
22
|
+
declare const TableHeaderCell: import("react").ForwardRefExoticComponent<Omit<ThHTMLAttributes<HTMLTableCellElement>, "children" | "align"> & TableHeaderCellOwnProps & import("react").RefAttributes<HTMLTableCellElement>>;
|
|
23
|
+
export default TableHeaderCell;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { type HTMLAttributes, type MouseEventHandler, type ReactNode } from "react";
|
|
2
|
+
import { type TableRowLinkProperties } from "../utils/trigger";
|
|
3
|
+
import type { TableRowAction } from "./TableAction";
|
|
4
|
+
/** Shared native properties for every Table.Row configuration. */
|
|
5
|
+
type TableRowBaseProps = Omit<HTMLAttributes<HTMLTableRowElement>, "aria-label" | "children" | "onClick"> & {
|
|
6
|
+
/**
|
|
7
|
+
* The controls operating on this row.
|
|
8
|
+
*
|
|
9
|
+
* Each action is keyed by its label, so labels must be unique per row.
|
|
10
|
+
*/
|
|
11
|
+
actions?: readonly TableRowAction[];
|
|
12
|
+
/** The cells rendered inside the Table row. */
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
};
|
|
15
|
+
/** A type representing a static Table.Row configuration. */
|
|
16
|
+
type TableStaticRowProps = {
|
|
17
|
+
/** The optional accessible name applied to the static row. */
|
|
18
|
+
"aria-label"?: string;
|
|
19
|
+
/** Static rows do not expose download behavior. */
|
|
20
|
+
download?: never;
|
|
21
|
+
/** Static rows do not expose a navigation destination. */
|
|
22
|
+
href?: never;
|
|
23
|
+
/** Static rows do not describe a linked resource language. */
|
|
24
|
+
hrefLang?: never;
|
|
25
|
+
/** Static rows do not expose whole-row activation. */
|
|
26
|
+
onClick?: never;
|
|
27
|
+
/** Static rows do not expose navigation interception. */
|
|
28
|
+
onNavigate?: never;
|
|
29
|
+
/** Static rows do not target a browsing context. */
|
|
30
|
+
target?: never;
|
|
31
|
+
};
|
|
32
|
+
/** A type representing a button-backed Table.Row configuration. */
|
|
33
|
+
type TableButtonRowProps = {
|
|
34
|
+
/** The accessible name describing the whole-row action. */
|
|
35
|
+
"aria-label": string;
|
|
36
|
+
/** Button-backed rows do not expose download behavior. */
|
|
37
|
+
download?: never;
|
|
38
|
+
/** Button-backed rows do not expose a navigation destination. */
|
|
39
|
+
href?: never;
|
|
40
|
+
/** Button-backed rows do not describe a linked resource language. */
|
|
41
|
+
hrefLang?: never;
|
|
42
|
+
/** The callback invoked when the row's button is activated. */
|
|
43
|
+
onClick: MouseEventHandler<HTMLButtonElement>;
|
|
44
|
+
/** Button-backed rows do not expose navigation interception. */
|
|
45
|
+
onNavigate?: never;
|
|
46
|
+
/** Button-backed rows do not target a browsing context. */
|
|
47
|
+
target?: never;
|
|
48
|
+
};
|
|
49
|
+
/** A type representing a link-backed Table.Row configuration. */
|
|
50
|
+
type TableLinkRowProps = TableRowLinkProperties & {
|
|
51
|
+
/** The accessible name describing the whole-row link. */
|
|
52
|
+
"aria-label": string;
|
|
53
|
+
/** Link-backed rows do not expose button activation. */
|
|
54
|
+
onClick?: never;
|
|
55
|
+
};
|
|
56
|
+
/** A type representing properties for the Table.Row component. */
|
|
57
|
+
export type TableRowProps = TableRowBaseProps & (TableButtonRowProps | TableLinkRowProps | TableStaticRowProps);
|
|
58
|
+
/**
|
|
59
|
+
* Renders a native Table row without replacing its table semantics.
|
|
60
|
+
*
|
|
61
|
+
* @param props - The native row properties and cells.
|
|
62
|
+
* @param forwardedReference - The reference assigned to the row element.
|
|
63
|
+
*
|
|
64
|
+
* @returns The rendered Table row.
|
|
65
|
+
*/
|
|
66
|
+
declare const TableRow: import("react").ForwardRefExoticComponent<TableRowProps & import("react").RefAttributes<HTMLTableRowElement>>;
|
|
67
|
+
export default TableRow;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** A type representing the section a Table row belongs to. */
|
|
2
|
+
export type TableSection = "head" | "body" | "foot";
|
|
3
|
+
/** The internal context naming the section a row is rendered inside. */
|
|
4
|
+
export declare const TableSectionContext: import("react").Context<TableSection>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type MutableRefObject, type UIEvent } from "react";
|
|
2
|
+
/** A type representing the tracked horizontal overflow of a scroll region. */
|
|
3
|
+
export type HorizontalOverflow = {
|
|
4
|
+
/** The reference assigned to the scrolling container. */
|
|
5
|
+
containerReference: MutableRefObject<HTMLDivElement | null>;
|
|
6
|
+
/** The reference assigned to the content measured for overflow. */
|
|
7
|
+
contentReference: MutableRefObject<HTMLElement | null>;
|
|
8
|
+
/** Whether the content currently overflows its container horizontally. */
|
|
9
|
+
isScrollable: boolean;
|
|
10
|
+
/** Whether the container is scrolled away from its inline start. */
|
|
11
|
+
isScrolled: boolean;
|
|
12
|
+
/** Records the scroll position reached by the container. */
|
|
13
|
+
handleScroll: (event: UIEvent<HTMLDivElement>) => void;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Tracks whether a container's content overflows it horizontally.
|
|
17
|
+
*
|
|
18
|
+
* Overflow is measured rather than assumed, so a scroll region only becomes
|
|
19
|
+
* focusable while there is content a keyboard user cannot otherwise reach.
|
|
20
|
+
*
|
|
21
|
+
* @note Falls back to resize events when `ResizeObserver` is unavailable.
|
|
22
|
+
*
|
|
23
|
+
* @returns The element references, overflow state, and scroll handler.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useHorizontalOverflow(): HorizontalOverflow;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default } from "./Table";
|
|
2
|
-
export type {
|
|
2
|
+
export type { TableBodyProps, TableCellAlignment, TableCellProps, TableCellValue, TableFootProps, TableHeaderCellProps, TableHeadProps, TableProps, TableRowAction, TableRowProps, } from "./Table";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/** A value rendered directly or formatted by a Table cell. */
|
|
3
|
+
export type TableCellValue = boolean | Date | number | string;
|
|
4
|
+
/** The horizontal alignment applied to Table cell content. */
|
|
5
|
+
export type TableCellAlignment = "left" | "center" | "right";
|
|
6
|
+
/** A function transforming a supplied value into displayed cell content. */
|
|
7
|
+
export type TableCellFormatter = (value: TableCellValue) => ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Resolves the content displayed for a Table cell value.
|
|
10
|
+
*
|
|
11
|
+
* @param value - The supplied cell value.
|
|
12
|
+
* @param children - The fallback content used when no value is supplied.
|
|
13
|
+
* @param format - The optional consumer formatter applied to the value.
|
|
14
|
+
*
|
|
15
|
+
* @returns The content displayed inside the Table cell.
|
|
16
|
+
*/
|
|
17
|
+
export declare function resolveCellContent(value: TableCellValue | undefined, children: ReactNode, format: TableCellFormatter | undefined): ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Resolves a native title for truncated primitive content.
|
|
20
|
+
*
|
|
21
|
+
* @param content - The rendered content considered for a title.
|
|
22
|
+
*
|
|
23
|
+
* @returns A readable title, when the content can be represented as text.
|
|
24
|
+
*/
|
|
25
|
+
export declare function resolveTruncateTitle(content: ReactNode): string | undefined;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Determines whether Table body children contain explicit content.
|
|
4
|
+
*
|
|
5
|
+
* Empty Fragments are inspected recursively. Components are considered
|
|
6
|
+
* content because their eventual render output cannot be known by the parent.
|
|
7
|
+
*
|
|
8
|
+
* @param content - The Table body children inspected for content.
|
|
9
|
+
*
|
|
10
|
+
* @returns Whether the children contain a non-empty explicit child.
|
|
11
|
+
*/
|
|
12
|
+
export declare function hasTableBodyContent(content: ReactNode): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Warns when a sticky Table header is placed outside its supported edge.
|
|
15
|
+
*
|
|
16
|
+
* @param content - The cells rendered inside one Table row.
|
|
17
|
+
*/
|
|
18
|
+
export declare function warnAboutInvalidStickyHeaders(content: ReactNode): void;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type HTMLAttributeAnchorTarget, type MouseEventHandler, type ReactNode } from "react";
|
|
2
|
+
/** The navigation properties describing a link-backed Table row. */
|
|
3
|
+
export type TableRowLinkProperties = {
|
|
4
|
+
/** Whether the linked resource should be downloaded. */
|
|
5
|
+
download?: boolean | string;
|
|
6
|
+
/** The destination opened by whole-row activation. */
|
|
7
|
+
href: string;
|
|
8
|
+
/** The language of the linked resource. */
|
|
9
|
+
hrefLang?: string;
|
|
10
|
+
/** The callback invoked when the row's link is activated. */
|
|
11
|
+
onNavigate?: MouseEventHandler<HTMLAnchorElement>;
|
|
12
|
+
/** The relationship between the table and linked resource. */
|
|
13
|
+
rel?: string;
|
|
14
|
+
/** The browsing context used to open the linked resource. */
|
|
15
|
+
target?: HTMLAttributeAnchorTarget;
|
|
16
|
+
};
|
|
17
|
+
/** A type representing the primary control injected into a Table row. */
|
|
18
|
+
export type TableRowTrigger = {
|
|
19
|
+
/** The accessible name describing the row activation. */
|
|
20
|
+
ariaLabel: string;
|
|
21
|
+
/** Whether the primary control uses link or button semantics. */
|
|
22
|
+
kind: "button" | "link";
|
|
23
|
+
/** Assigns the rendered primary control to its owning row. */
|
|
24
|
+
reference: (element: HTMLAnchorElement | HTMLButtonElement | null) => void;
|
|
25
|
+
/** The link-backed row properties, when navigation is configured. */
|
|
26
|
+
linkProperties?: TableRowLinkProperties;
|
|
27
|
+
/** The button activation callback, when an action is configured. */
|
|
28
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
29
|
+
};
|
|
30
|
+
/** A type representing the outcome of injecting a row's primary control. */
|
|
31
|
+
export type TableRowTriggerAttachment = {
|
|
32
|
+
/** Whether a data cell was available to receive the control. */
|
|
33
|
+
attached: boolean;
|
|
34
|
+
/** The row content containing the injected control, when one was found. */
|
|
35
|
+
content: ReactNode;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Determines whether a click originated from a nested interactive descendant.
|
|
39
|
+
*
|
|
40
|
+
* @param target - The deepest element receiving the click.
|
|
41
|
+
* @param row - The row limiting ancestor inspection.
|
|
42
|
+
*
|
|
43
|
+
* @returns Whether a nested native or ARIA widget owns the interaction.
|
|
44
|
+
*/
|
|
45
|
+
export declare function isInteractiveRowDescendant(target: Element, row: HTMLTableRowElement): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Injects a row's semantic trigger into its first explicit data cell.
|
|
48
|
+
*
|
|
49
|
+
* @param content - The row cells inspected recursively.
|
|
50
|
+
* @param trigger - The link or button representing whole-row activation.
|
|
51
|
+
*
|
|
52
|
+
* @returns The row content containing one primary control.
|
|
53
|
+
*/
|
|
54
|
+
export declare function attachRowTrigger(content: ReactNode, trigger: TableRowTrigger): TableRowTriggerAttachment;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type CSSProperties, type ReactElement, type ReactNode } from "react";
|
|
2
2
|
import type { FloatingPlacement } from "../Portal/utils/floating-position";
|
|
3
|
+
import TooltipProvider from "./TooltipProvider";
|
|
3
4
|
import "./styles/tooltip.css";
|
|
4
5
|
/** A type representing the preferred placement of a Tooltip. */
|
|
5
6
|
export type TooltipPlacement = FloatingPlacement;
|
|
@@ -30,10 +31,8 @@ export type TooltipProps = {
|
|
|
30
31
|
disabled?: boolean;
|
|
31
32
|
/** The callback invoked whenever the Tooltip opens or closes. */
|
|
32
33
|
onOpenChange?: (open: boolean) => void;
|
|
33
|
-
/** The preferred placement before
|
|
34
|
+
/** The preferred placement before collision handling. */
|
|
34
35
|
placement?: TooltipPlacement;
|
|
35
|
-
/** The optional element receiving the Tooltip portal. */
|
|
36
|
-
portalContainer?: Element | null;
|
|
37
36
|
/** The inline styles applied to the trigger element. */
|
|
38
37
|
style?: CSSProperties;
|
|
39
38
|
};
|
|
@@ -50,5 +49,12 @@ export type TooltipProps = {
|
|
|
50
49
|
*
|
|
51
50
|
* @returns The trigger and its portal-backed Tooltip description.
|
|
52
51
|
*/
|
|
53
|
-
declare const
|
|
52
|
+
declare const TooltipRoot: import("react").ForwardRefExoticComponent<TooltipProps & import("react").RefAttributes<HTMLElement>>;
|
|
53
|
+
/** A type representing the complete compound Tooltip component. */
|
|
54
|
+
type TooltipComponent = typeof TooltipRoot & {
|
|
55
|
+
/** The provider supplying shared behavior to descendant Tooltips. */
|
|
56
|
+
Provider: typeof TooltipProvider;
|
|
57
|
+
};
|
|
58
|
+
/** The compound Tooltip component and its shared-behavior provider. */
|
|
59
|
+
declare const Tooltip: TooltipComponent;
|
|
54
60
|
export default Tooltip;
|
|
@@ -6,7 +6,7 @@ type TooltipContextValue = {
|
|
|
6
6
|
};
|
|
7
7
|
/** Shared Tooltip behavior remains optional for standalone usage. */
|
|
8
8
|
export declare const TooltipContext: import("react").Context<TooltipContextValue | null>;
|
|
9
|
-
/** A type representing properties for the
|
|
9
|
+
/** A type representing properties for the Tooltip.Provider component. */
|
|
10
10
|
export type TooltipProviderProps = {
|
|
11
11
|
/** The Tooltip-bearing interface receiving shared behavior. */
|
|
12
12
|
children: ReactNode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react"),e=t.createContext(void 0),o=typeof window>"u"?t.useEffect:t.useLayoutEffect;exports.BoundaryContext=e;exports.useIsomorphicLayoutEffect=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const T={bottom:"top",left:"right",right:"left",top:"bottom"};function x(h,i){const t=Math.min(12,i/2);return Math.min(Math.max(t,h),i-t)}function E(h){return T[h]}function _(h,i){return i==="left"||i==="right"?h.width:h.height}function A(h,i,t){const e=Math.max(h.left,0),o=Math.max(h.top,0),l=Math.min(h.right,i),M=Math.min(h.bottom,t);return l<=e||M<=o?h:{bottom:M,left:e,right:l,top:o}}function F(h,i,t,e,o){const l={bottom:o.bottom-t.bottom-i*2,left:t.left-o.left-i*2,right:o.right-t.right-i*2,top:t.top-o.top-i*2},M=E(h),P=_(e,h),f=l[h]<P&&l[M]>l[h]?M:h;let m=t.left+(t.width-e.width)/2,c=t.top+(t.height-e.height)/2;f==="top"?c=t.top-e.height-i:f==="bottom"?c=t.bottom+i:f==="left"?m=t.left-e.width-i:m=t.right+i;const w=o.left+i,O=o.top+i;m=Math.min(Math.max(w,m),Math.max(w,o.right-i-e.width)),c=Math.min(Math.max(O,c),Math.max(O,o.bottom-i-e.height));let a;return f==="top"||f==="bottom"?a=x(t.left+t.width/2-m,e.width):a=x(t.top+t.height/2-c,e.height),{arrowOffset:a,left:m,placement:f,top:c}}exports.calculateFloatingPosition=F;exports.getVisibleBounds=A;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
const E = {
|
|
2
|
+
bottom: "top",
|
|
3
|
+
left: "right",
|
|
4
|
+
right: "left",
|
|
5
|
+
top: "bottom"
|
|
6
|
+
};
|
|
7
|
+
function x(i, h) {
|
|
8
|
+
const t = Math.min(12, h / 2);
|
|
9
|
+
return Math.min(Math.max(t, i), h - t);
|
|
10
|
+
}
|
|
11
|
+
function P(i) {
|
|
12
|
+
return E[i];
|
|
13
|
+
}
|
|
14
|
+
function _(i, h) {
|
|
15
|
+
return h === "left" || h === "right" ? i.width : i.height;
|
|
16
|
+
}
|
|
17
|
+
function p(i, h, t) {
|
|
18
|
+
const e = Math.max(i.left, 0), f = Math.max(i.top, 0), o = Math.min(i.right, h), M = Math.min(i.bottom, t);
|
|
19
|
+
return o <= e || M <= f ? i : { bottom: M, left: e, right: o, top: f };
|
|
20
|
+
}
|
|
21
|
+
function F(i, h, t, e, f) {
|
|
22
|
+
const o = {
|
|
23
|
+
bottom: f.bottom - t.bottom - h * 2,
|
|
24
|
+
left: t.left - f.left - h * 2,
|
|
25
|
+
right: f.right - t.right - h * 2,
|
|
26
|
+
top: t.top - f.top - h * 2
|
|
27
|
+
}, M = P(i), T = _(e, i), m = o[i] < T && o[M] > o[i] ? M : i;
|
|
28
|
+
let l = t.left + (t.width - e.width) / 2, c = t.top + (t.height - e.height) / 2;
|
|
29
|
+
m === "top" ? c = t.top - e.height - h : m === "bottom" ? c = t.bottom + h : m === "left" ? l = t.left - e.width - h : l = t.right + h;
|
|
30
|
+
const O = f.left + h, a = f.top + h;
|
|
31
|
+
l = Math.min(
|
|
32
|
+
Math.max(O, l),
|
|
33
|
+
Math.max(O, f.right - h - e.width)
|
|
34
|
+
), c = Math.min(
|
|
35
|
+
Math.max(a, c),
|
|
36
|
+
Math.max(a, f.bottom - h - e.height)
|
|
37
|
+
);
|
|
38
|
+
let w;
|
|
39
|
+
return m === "top" || m === "bottom" ? w = x(
|
|
40
|
+
t.left + t.width / 2 - l,
|
|
41
|
+
e.width
|
|
42
|
+
) : w = x(
|
|
43
|
+
t.top + t.height / 2 - c,
|
|
44
|
+
e.height
|
|
45
|
+
), { arrowOffset: w, left: l, placement: m, top: c };
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
F as c,
|
|
49
|
+
p as g
|
|
50
|
+
};
|