@dxos/react-ui-table 0.4.9-main.a108ade → 0.4.9-main.c54559c
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/lib/browser/index.mjs +124 -119
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/components/Table/Table.d.ts +2 -1
- package/dist/types/src/components/Table/Table.d.ts.map +1 -1
- package/dist/types/src/components/Table/TableBody.d.ts +3 -3
- package/dist/types/src/components/Table/TableBody.d.ts.map +1 -1
- package/dist/types/src/components/Table/TableContext.d.ts +5 -4
- package/dist/types/src/components/Table/TableContext.d.ts.map +1 -1
- package/dist/types/src/components/Table/TableFooter.d.ts +1 -1
- package/dist/types/src/components/Table/TableFooter.d.ts.map +1 -1
- package/dist/types/src/components/Table/TableHead.d.ts +1 -1
- package/dist/types/src/components/Table/TableHead.d.ts.map +1 -1
- package/dist/types/src/components/Table/props.d.ts +1 -1
- package/dist/types/src/components/Table/props.d.ts.map +1 -1
- package/dist/types/src/helpers.d.ts.map +1 -1
- package/dist/types/src/theme.d.ts +4 -3
- package/dist/types/src/theme.d.ts.map +1 -1
- package/package.json +14 -14
- package/src/components/Cell/Cell.tsx +3 -3
- package/src/components/Table/Table.tsx +10 -8
- package/src/components/Table/TableBody.tsx +4 -5
- package/src/components/Table/TableContext.tsx +16 -11
- package/src/components/Table/TableFooter.tsx +3 -3
- package/src/components/Table/TableHead.tsx +13 -18
- package/src/components/Table/props.ts +1 -1
- package/src/helpers.tsx +2 -1
- package/src/theme.ts +21 -20
package/src/theme.ts
CHANGED
|
@@ -4,15 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { type CellContext } from '@tanstack/react-table';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
modalSurface,
|
|
9
|
-
fixedSurface,
|
|
10
|
-
focusRing,
|
|
11
|
-
ghostSelected,
|
|
12
|
-
ghostSelectedCurrent,
|
|
13
|
-
groupBorder,
|
|
14
|
-
mx,
|
|
15
|
-
} from '@dxos/react-ui-theme';
|
|
7
|
+
import { modalSurface, focusRing, ghostSelected, ghostSelectedCurrent, groupBorder, mx } from '@dxos/react-ui-theme';
|
|
16
8
|
import { type ComponentFunction } from '@dxos/react-ui-types';
|
|
17
9
|
|
|
18
10
|
import { type TableContextValue, type TableFlags } from './components';
|
|
@@ -21,7 +13,7 @@ export const currentRow = '!bg-neutral-75 !dark:bg-neutral-850';
|
|
|
21
13
|
export const selectedRow = '!bg-primary-100 dark:!bg-primary-700';
|
|
22
14
|
export const flushPadding = 'pli-0 plb-0';
|
|
23
15
|
export const textPadding = 'pli-2 plb-0.5';
|
|
24
|
-
export const headPadding = 'pli-2 plb-1
|
|
16
|
+
export const headPadding = 'pli-2 plb-1';
|
|
25
17
|
|
|
26
18
|
export const gridCellFocusRing =
|
|
27
19
|
'focus-within:z-[11] focus-within:outline outline-2 outline-primary-500 dark:outline-primary-400';
|
|
@@ -45,27 +37,36 @@ export const groupTh: ComponentFunction<TableStyleProps> = (_props, ...etc) =>
|
|
|
45
37
|
export type TheadStyleProps = Partial<TableFlags>;
|
|
46
38
|
|
|
47
39
|
export const theadRoot: ComponentFunction<TheadStyleProps> = ({ header, stickyHeader }, ...etc) =>
|
|
48
|
-
mx(
|
|
40
|
+
mx(
|
|
41
|
+
header ? stickyHeader && 'sticky block-start-[--sticky-top] z-[1]' : 'collapse',
|
|
42
|
+
header && 'base-surface',
|
|
43
|
+
'drop-shadow-sm',
|
|
44
|
+
...etc,
|
|
45
|
+
);
|
|
49
46
|
|
|
50
47
|
export const theadTr: ComponentFunction<TheadStyleProps> = (_props, ...etc) => mx('group', ...etc);
|
|
51
48
|
|
|
52
49
|
export const theadTh: ComponentFunction<TheadStyleProps> = ({ border }, ...etc) =>
|
|
53
50
|
mx(
|
|
54
|
-
'relative
|
|
51
|
+
'relative',
|
|
52
|
+
'text-start font-medium select-none truncate',
|
|
55
53
|
headPadding,
|
|
56
|
-
border && 'border',
|
|
57
54
|
border && groupBorder,
|
|
55
|
+
border && 'border border-t-0 border-b-0 border-neutral-200',
|
|
58
56
|
...etc,
|
|
59
57
|
);
|
|
60
58
|
|
|
61
|
-
export const theadResizeRoot: ComponentFunction<
|
|
62
|
-
mx(
|
|
63
|
-
'absolute
|
|
64
|
-
|
|
59
|
+
export const theadResizeRoot: ComponentFunction<{ isResizing: boolean }> = ({ isResizing }) => {
|
|
60
|
+
return mx(
|
|
61
|
+
'absolute h-full w-[4px] top-0 right-0',
|
|
62
|
+
'cursor-col-resize',
|
|
63
|
+
'user-select-none',
|
|
64
|
+
'touch-action-none',
|
|
65
|
+
!isResizing && 'group-hover:bg-neutral-100 dark:group-hover:bg-neutral-800',
|
|
66
|
+
'pointer-coarse:bg-neutral-100 dark:pointer-coarse:bg-neutral-800',
|
|
67
|
+
isResizing && 'bg-primary-500 dark:bg-primary-400',
|
|
65
68
|
);
|
|
66
|
-
|
|
67
|
-
export const theadResizeThumb: ComponentFunction<TheadStyleProps> = (_props, ...etc) =>
|
|
68
|
-
mx('flex group-hover:bg-neutral-700 -ml-[2px] w-[1px] h-full', ...etc);
|
|
69
|
+
};
|
|
69
70
|
|
|
70
71
|
//
|
|
71
72
|
// tbody
|