@atlaskit/dynamic-table
Version:
A dynamic table displays rows of data with built-in pagination, sorting, and re-ordering functionality.
41 lines (40 loc) • 2.01 kB
JavaScript
/* table.tsx generated by @compiled/babel-plugin v3.0.2 */
import _extends from "@babel/runtime/helpers/extends";
import "./table.compiled.css";
import * as React from 'react';
import { ax, ix } from "@compiled/react/runtime";
/* eslint-disable @repo/internal/react/require-jsdoc */
import { forwardRef, version as reactVersion } from 'react';
// React 18 doesn't know `inert` and only forwards it as a string attribute (`inert=""`).
// React 19 treats `inert` as a boolean, so `''` is falsy and the attribute is dropped.
const isReact19OrLater = parseInt(reactVersion, 10) >= 19;
const inertValue = isReact19OrLater ? true : '';
const fixedSizeTableStyles = null;
const tableStyles = null;
const bodyBorder = null;
export const Table = /*#__PURE__*/forwardRef(({
isFixedSize,
hasDataRow,
children,
testId,
isLoading,
...rest
}, ref) => {
return /*#__PURE__*/React.createElement("table", _extends({
inert: isLoading ? inertValue : undefined,
style: {
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
'--local-dynamic-table-hover-bg': "var(--ds-background-neutral-subtle-hovered, #0515240F)",
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
'--local-dynamic-table-highlighted-bg': "var(--ds-background-selected, #E9F2FE)",
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
'--local-dynamic-table-hover-highlighted-bg': "var(--ds-background-selected-hovered, #CFE1FD)",
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
'--local-dynamic-table-row-focus-outline': "var(--ds-border-focused, #4688EC)"
},
ref: ref
}, rest, {
"data-testid": testId && `${testId}--table`,
className: ax(["_1bsb1osq _yq5hus1c _btyzidpf _ect4ttxp", isFixedSize && "_1kqm1n9t", hasDataRow && "_179r1uh4"])
}), children);
});