draft-components 0.63.5 → 0.64.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.
@@ -1,3 +1,5 @@
1
- import { ComponentPropsWithoutRef } from 'react';
2
- export declare type TableBodyProps = ComponentPropsWithoutRef<'tbody'>;
3
- export declare function TableBody({ className, children, ...props }: TableBodyProps): JSX.Element;
1
+ import { ComponentPropsWithRef } from 'react';
2
+ export declare type TableBodyProps = ComponentPropsWithRef<'tbody'>;
3
+ export declare const TableBody: import("react").ForwardRefExoticComponent<Pick<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "key" | keyof import("react").HTMLAttributes<HTMLTableSectionElement>> & {
4
+ ref?: ((instance: HTMLTableSectionElement | null) => void) | import("react").RefObject<HTMLTableSectionElement> | null | undefined;
5
+ }, "key" | keyof import("react").HTMLAttributes<HTMLTableSectionElement>> & import("react").RefAttributes<HTMLTableSectionElement>>;
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TableBody = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
5
6
  const react_helpers_1 = require("../../lib/react-helpers");
6
- function TableBody({ className, children, ...props }) {
7
- return ((0, jsx_runtime_1.jsx)("tbody", Object.assign({}, props, { className: (0, react_helpers_1.classNames)(className, 'dc-table-body') }, { children: children }), void 0));
8
- }
9
- exports.TableBody = TableBody;
7
+ exports.TableBody = (0, react_1.forwardRef)(function TableBody({ className, children, ...props }, ref) {
8
+ return ((0, jsx_runtime_1.jsx)("tbody", Object.assign({}, props, { ref: ref, className: (0, react_helpers_1.classNames)(className, 'dc-table-body') }, { children: children }), void 0));
9
+ });
@@ -1,5 +1,5 @@
1
- import { ComponentPropsWithoutRef } from 'react';
2
- export declare type TableCellProps = ComponentPropsWithoutRef<'td'> & {
1
+ import { ComponentPropsWithRef } from 'react';
2
+ export declare type TableCellProps = ComponentPropsWithRef<'td'> & {
3
3
  isLoading?: boolean;
4
4
  };
5
- export declare function TableCell({ className, isLoading, align, children, ...props }: TableCellProps): JSX.Element;
5
+ export declare const TableCell: import("react").ForwardRefExoticComponent<Pick<TableCellProps, "key" | "isLoading" | keyof import("react").TdHTMLAttributes<HTMLTableDataCellElement>> & import("react").RefAttributes<HTMLTableCellElement>>;
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TableCell = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
5
6
  const react_helpers_1 = require("../../lib/react-helpers");
6
- function TableCell({ className, isLoading = false, align = 'left', children, ...props }) {
7
- return ((0, jsx_runtime_1.jsx)("td", Object.assign({}, props, { align: align, className: (0, react_helpers_1.classNames)('dc-table-cell', isLoading && 'dc-table-cell_loading', className) }, { children: children }), void 0));
8
- }
9
- exports.TableCell = TableCell;
7
+ exports.TableCell = (0, react_1.forwardRef)(function TableCell({ className, isLoading = false, align = 'left', children, ...props }, ref) {
8
+ return ((0, jsx_runtime_1.jsx)("td", Object.assign({}, props, { ref: ref, align: align, className: (0, react_helpers_1.classNames)('dc-table-cell', isLoading && 'dc-table-cell_loading', className) }, { children: children }), void 0));
9
+ });
@@ -1,2 +1,5 @@
1
- import { ComponentPropsWithoutRef } from 'react';
2
- export declare function TableContainer({ className, children, ...props }: ComponentPropsWithoutRef<'div'>): JSX.Element;
1
+ import { ComponentPropsWithRef } from 'react';
2
+ export declare type TableContainerProps = ComponentPropsWithRef<'div'>;
3
+ export declare const TableContainer: import("react").ForwardRefExoticComponent<Pick<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
4
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
5
+ }, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & import("react").RefAttributes<HTMLDivElement>>;
@@ -4,11 +4,11 @@ exports.TableContainer = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const react_helpers_1 = require("../../lib/react-helpers");
7
- function TableContainer({ className, children, ...props }) {
7
+ exports.TableContainer = (0, react_1.forwardRef)(function TableContainer({ className, children, ...props }, ref) {
8
8
  const [isScrollable, setIsScrollable] = (0, react_1.useState)(false);
9
- const ref = (0, react_1.useRef)(null);
9
+ const containerRef = (0, react_1.useRef)(null);
10
10
  (0, react_1.useEffect)(() => {
11
- const containerEl = ref.current;
11
+ const containerEl = containerRef.current;
12
12
  if (!containerEl) {
13
13
  return;
14
14
  }
@@ -21,6 +21,5 @@ function TableContainer({ className, children, ...props }) {
21
21
  window.removeEventListener('resize', updateTabIndex);
22
22
  };
23
23
  }, []);
24
- return ((0, jsx_runtime_1.jsx)("div", Object.assign({ tabIndex: isScrollable ? 0 : undefined, role: "group" }, props, { ref: ref, className: (0, react_helpers_1.classNames)(className, 'dc-table-container') }, { children: children }), void 0));
25
- }
26
- exports.TableContainer = TableContainer;
24
+ return ((0, jsx_runtime_1.jsx)("div", Object.assign({ tabIndex: isScrollable ? 0 : undefined, role: "group" }, props, { ref: (0, react_helpers_1.mergeRefs)(containerRef, ref), className: (0, react_helpers_1.classNames)(className, 'dc-table-container') }, { children: children }), void 0));
25
+ });
@@ -1,3 +1,5 @@
1
- import { ComponentPropsWithoutRef } from 'react';
2
- export declare type TableHeadProps = ComponentPropsWithoutRef<'thead'>;
3
- export declare function TableHead({ className, ...props }: TableHeadProps): JSX.Element;
1
+ import { ComponentPropsWithRef } from 'react';
2
+ export declare type TableHeadProps = ComponentPropsWithRef<'thead'>;
3
+ export declare const TableHead: import("react").ForwardRefExoticComponent<Pick<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "key" | keyof import("react").HTMLAttributes<HTMLTableSectionElement>> & {
4
+ ref?: ((instance: HTMLTableSectionElement | null) => void) | import("react").RefObject<HTMLTableSectionElement> | null | undefined;
5
+ }, "key" | keyof import("react").HTMLAttributes<HTMLTableSectionElement>> & import("react").RefAttributes<HTMLTableSectionElement>>;
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TableHead = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
5
6
  const react_helpers_1 = require("../../lib/react-helpers");
6
- function TableHead({ className, ...props }) {
7
- return ((0, jsx_runtime_1.jsx)("thead", Object.assign({}, props, { className: (0, react_helpers_1.classNames)(className, 'dc-table-head') }), void 0));
8
- }
9
- exports.TableHead = TableHead;
7
+ exports.TableHead = (0, react_1.forwardRef)(function TableHead({ className, ...props }, ref) {
8
+ return ((0, jsx_runtime_1.jsx)("thead", Object.assign({}, props, { ref: ref, className: (0, react_helpers_1.classNames)(className, 'dc-table-head') }), void 0));
9
+ });
@@ -1,9 +1,9 @@
1
- import { ComponentPropsWithoutRef } from 'react';
1
+ import { ComponentPropsWithRef } from 'react';
2
2
  import { TableSortButtonProps } from './table-sort-button';
3
- export interface TableHeaderCellProps extends ComponentPropsWithoutRef<'th'> {
3
+ export interface TableHeaderCellProps extends ComponentPropsWithRef<'th'> {
4
4
  isSortable?: boolean;
5
5
  order?: TableSortButtonProps['order'];
6
6
  onChangeOrder?: TableSortButtonProps['onSort'];
7
7
  renderSortButtonLabel?: TableSortButtonProps['renderLabel'];
8
8
  }
9
- export declare function TableHeaderCell({ isSortable, order, renderSortButtonLabel, onChangeOrder, className, role, align, children, ...props }: TableHeaderCellProps): JSX.Element;
9
+ export declare const TableHeaderCell: import("react").ForwardRefExoticComponent<Pick<TableHeaderCellProps, "abbr" | "slot" | "style" | "title" | "className" | "color" | "id" | "lang" | "role" | "tabIndex" | "order" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "hidden" | "translate" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "align" | "colSpan" | "headers" | "rowSpan" | "scope" | "isSortable" | "onChangeOrder" | "renderSortButtonLabel"> & import("react").RefAttributes<HTMLTableHeaderCellElement>>;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TableHeaderCell = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
5
6
  const react_helpers_1 = require("../../lib/react-helpers");
6
7
  const table_sort_button_1 = require("./table-sort-button");
7
8
  const ariaSortValues = {
@@ -9,7 +10,6 @@ const ariaSortValues = {
9
10
  asc: 'ascending',
10
11
  desc: 'descending',
11
12
  };
12
- function TableHeaderCell({ isSortable, order = 'none', renderSortButtonLabel, onChangeOrder, className, role = 'columnheader', align = 'left', children, ...props }) {
13
- return ((0, jsx_runtime_1.jsx)("th", Object.assign({ "aria-sort": isSortable ? ariaSortValues[order] : undefined }, props, { className: (0, react_helpers_1.classNames)(className, 'dc-table-cell', 'dc-table-cell_header'), role: role, align: align }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "dc-table-cell__body" }, { children: [children, isSortable && ((0, jsx_runtime_1.jsx)(table_sort_button_1.TableSortButton, { className: "dc-table-cell__sort-btn", column: children, order: order, onSort: onChangeOrder, renderLabel: renderSortButtonLabel }, void 0))] }), void 0) }), void 0));
14
- }
15
- exports.TableHeaderCell = TableHeaderCell;
13
+ exports.TableHeaderCell = (0, react_1.forwardRef)(function TableHeaderCell({ isSortable, order = 'none', renderSortButtonLabel, onChangeOrder, className, role = 'columnheader', align = 'left', children, ...props }, ref) {
14
+ return ((0, jsx_runtime_1.jsx)("th", Object.assign({ "aria-sort": isSortable ? ariaSortValues[order] : undefined }, props, { ref: ref, className: (0, react_helpers_1.classNames)(className, 'dc-table-cell', 'dc-table-cell_header'), role: role, align: align }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "dc-table-cell__body" }, { children: [children, isSortable && ((0, jsx_runtime_1.jsx)(table_sort_button_1.TableSortButton, { className: "dc-table-cell__sort-btn", column: children, order: order, onSort: onChangeOrder, renderLabel: renderSortButtonLabel }, void 0))] }), void 0) }), void 0));
15
+ });
@@ -1,5 +1,5 @@
1
- import { ComponentPropsWithoutRef } from 'react';
2
- export interface TableRowProps extends ComponentPropsWithoutRef<'tr'> {
1
+ import { ComponentPropsWithRef } from 'react';
2
+ export interface TableRowProps extends ComponentPropsWithRef<'tr'> {
3
3
  isSelected?: boolean;
4
4
  }
5
- export declare function TableRow({ isSelected, className, ...props }: TableRowProps): JSX.Element;
5
+ export declare const TableRow: import("react").ForwardRefExoticComponent<Pick<TableRowProps, "slot" | "style" | "title" | "className" | "color" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "hidden" | "translate" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "isSelected"> & import("react").RefAttributes<HTMLTableRowElement>>;
@@ -2,10 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TableRow = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
5
6
  const react_helpers_1 = require("../../lib/react-helpers");
6
- function TableRow({ isSelected, className, ...props }) {
7
- return ((0, jsx_runtime_1.jsx)("tr", Object.assign({}, props, { className: (0, react_helpers_1.classNames)(className, 'dc-table-row', {
8
- 'dc-table-row_selected': isSelected,
9
- }) }), void 0));
10
- }
11
- exports.TableRow = TableRow;
7
+ exports.TableRow = (0, react_1.forwardRef)(function TableRow({ isSelected, className, ...props }, ref) {
8
+ return ((0, jsx_runtime_1.jsx)("tr", Object.assign({}, props, { ref: ref, className: (0, react_helpers_1.classNames)('dc-table-row', isSelected && 'dc-table-row_selected', className) }), void 0));
9
+ });
@@ -1,11 +1,5 @@
1
- import { ComponentPropsWithoutRef } from 'react';
2
- import { TableContainer } from './table-container';
3
- import { TableHead } from './table-head';
4
- import { TableBody } from './table-body';
5
- import { TableRow } from './table-row';
6
- import { TableHeaderCell } from './table-header-cell';
7
- import { TableCell } from './table-cell';
8
- export interface TableProps extends ComponentPropsWithoutRef<'table'> {
1
+ import { ComponentPropsWithRef } from 'react';
2
+ export interface TableProps extends ComponentPropsWithRef<'table'> {
9
3
  isLoading?: boolean;
10
4
  isBordered?: boolean;
11
5
  isStriped?: boolean;
@@ -13,12 +7,4 @@ export interface TableProps extends ComponentPropsWithoutRef<'table'> {
13
7
  hasStickyHeader?: boolean;
14
8
  shouldHighlightActiveRow?: boolean;
15
9
  }
16
- export declare function Table({ isLoading, isBordered, isStriped, cellPadding, hasStickyHeader, shouldHighlightActiveRow, className, children, ...props }: TableProps): JSX.Element;
17
- export declare namespace Table {
18
- var Container: typeof TableContainer;
19
- var Head: typeof TableHead;
20
- var Body: typeof TableBody;
21
- var Row: typeof TableRow;
22
- var HeaderCell: typeof TableHeaderCell;
23
- var Cell: typeof TableCell;
24
- }
10
+ export declare const Table: import("react").ForwardRefExoticComponent<Pick<TableProps, "slot" | "style" | "summary" | "title" | "className" | "color" | "id" | "lang" | "width" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "hidden" | "translate" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "isLoading" | "cellPadding" | "cellSpacing" | "isBordered" | "isStriped" | "hasStickyHeader" | "shouldHighlightActiveRow"> & import("react").RefAttributes<HTMLTableElement>>;
@@ -2,15 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Table = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
5
6
  const react_helpers_1 = require("../../lib/react-helpers");
6
- const table_container_1 = require("./table-container");
7
- const table_head_1 = require("./table-head");
8
- const table_body_1 = require("./table-body");
9
- const table_row_1 = require("./table-row");
10
- const table_header_cell_1 = require("./table-header-cell");
11
- const table_cell_1 = require("./table-cell");
12
- function Table({ isLoading, isBordered, isStriped, cellPadding, hasStickyHeader, shouldHighlightActiveRow, className, children, ...props }) {
13
- return ((0, jsx_runtime_1.jsx)("table", Object.assign({}, props, { className: (0, react_helpers_1.classNames)(className, 'dc-table', {
7
+ exports.Table = (0, react_1.forwardRef)(function Table({ isLoading, isBordered, isStriped, cellPadding, hasStickyHeader, shouldHighlightActiveRow, className, children, ...props }, ref) {
8
+ return ((0, jsx_runtime_1.jsx)("table", Object.assign({}, props, { ref: ref, className: (0, react_helpers_1.classNames)(className, 'dc-table', {
14
9
  'dc-table_loading': isLoading,
15
10
  'dc-table_bordered': isBordered,
16
11
  'dc-table_striped': isStriped,
@@ -18,11 +13,4 @@ function Table({ isLoading, isBordered, isStriped, cellPadding, hasStickyHeader,
18
13
  'dc-table_row_highlighted': shouldHighlightActiveRow,
19
14
  [`dc-table_padding_${cellPadding}`]: cellPadding,
20
15
  }), cellSpacing: 0 }, { children: children }), void 0));
21
- }
22
- exports.Table = Table;
23
- Table.Container = table_container_1.TableContainer;
24
- Table.Head = table_head_1.TableHead;
25
- Table.Body = table_body_1.TableBody;
26
- Table.Row = table_row_1.TableRow;
27
- Table.HeaderCell = table_header_cell_1.TableHeaderCell;
28
- Table.Cell = table_cell_1.TableCell;
16
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "draft-components",
3
- "version": "0.63.5",
3
+ "version": "0.64.0",
4
4
  "description": "The set of React.js components for rapid prototyping.",
5
5
  "main": "components/index.js",
6
6
  "files": [