@basic-ui/material 1.0.0-alpha.46 → 1.0.0-alpha.48
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/build/cjs/index.js +12 -17
- package/build/cjs/index.js.map +1 -1
- package/build/esm/Chip/ButtonChip.d.ts +1 -1
- package/build/esm/Select/CustomContainerExample.d.ts +1 -1
- package/build/esm/Table/Table.d.ts +1 -1
- package/build/esm/Table/Table.js +7 -14
- package/build/esm/Table/Table.js.map +1 -1
- package/build/esm/Table/TableBody.d.ts +1 -1
- package/build/esm/Table/TableBody.js.map +1 -1
- package/build/esm/Table/TableCell.d.ts +1 -1
- package/build/esm/Table/TableCell.js +5 -3
- package/build/esm/Table/TableCell.js.map +1 -1
- package/build/esm/Table/TableHead.d.ts +1 -1
- package/build/esm/Table/TableHead.js +1 -3
- package/build/esm/Table/TableHead.js.map +1 -1
- package/build/esm/Table/TableRow.d.ts +1 -1
- package/build/esm/Table/TableRow.js +3 -3
- package/build/esm/Table/TableRow.js.map +1 -1
- package/build/esm/Table/index.js.map +1 -1
- package/build/tsconfig-build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/Table/Table.story.tsx +227 -227
- package/src/Table/Table.tsx +28 -34
- package/src/Table/TableBody.tsx +17 -17
- package/src/Table/TableCell.tsx +37 -34
- package/src/Table/TableHead.tsx +29 -31
- package/src/Table/TableRow.tsx +38 -38
- package/src/Table/index.ts +5 -5
package/src/Table/TableHead.tsx
CHANGED
|
@@ -1,31 +1,29 @@
|
|
|
1
|
-
import { forwardRef } from 'react';
|
|
2
|
-
import { rem } from 'polished';
|
|
3
|
-
|
|
4
|
-
import { TableHeadProvider } from './context';
|
|
5
|
-
import type { TableBodyProps } from './TableBody';
|
|
6
|
-
import { TableBody } from './TableBody';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
{
|
|
26
|
-
>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
);
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import { rem } from 'polished';
|
|
3
|
+
|
|
4
|
+
import { TableHeadProvider } from './context';
|
|
5
|
+
import type { TableBodyProps } from './TableBody';
|
|
6
|
+
import { TableBody } from './TableBody';
|
|
7
|
+
|
|
8
|
+
export type TableHeadProps = TableBodyProps;
|
|
9
|
+
|
|
10
|
+
export const TableHead = forwardRef<HTMLDivElement, TableHeadProps>(
|
|
11
|
+
(props, ref) => {
|
|
12
|
+
const { children, __css, ...rest } = props;
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<TableBody
|
|
16
|
+
ref={ref}
|
|
17
|
+
__css={{
|
|
18
|
+
borderBottomStyle: 'solid',
|
|
19
|
+
borderBottomWidth: rem(1),
|
|
20
|
+
borderBottomColor: 'surface-variant',
|
|
21
|
+
...__css,
|
|
22
|
+
}}
|
|
23
|
+
{...rest}
|
|
24
|
+
>
|
|
25
|
+
<TableHeadProvider value={true}>{children}</TableHeadProvider>
|
|
26
|
+
</TableBody>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
);
|
package/src/Table/TableRow.tsx
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { forwardRef } from 'react';
|
|
2
|
-
import { rem } from 'polished';
|
|
3
|
-
|
|
4
|
-
import type { TextProps } from '../Text';
|
|
5
|
-
import { Text } from '../Text';
|
|
6
|
-
|
|
7
|
-
export type TableRowProps = TextProps;
|
|
8
|
-
|
|
9
|
-
export const TableRow = forwardRef<HTMLDivElement, TableRowProps>(
|
|
10
|
-
(props, ref) => {
|
|
11
|
-
const { children, __css, ...rest } = props;
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<Text
|
|
15
|
-
ref={ref}
|
|
16
|
-
as="div"
|
|
17
|
-
role="row"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
borderBottomStyle: 'solid',
|
|
25
|
-
borderBottomWidth: rem(1),
|
|
26
|
-
borderBottomColor: 'surface-variant',
|
|
27
|
-
'&:last-of-type': {
|
|
28
|
-
borderBottom: 'none',
|
|
29
|
-
},
|
|
30
|
-
...__css,
|
|
31
|
-
}}
|
|
32
|
-
{...rest}
|
|
33
|
-
>
|
|
34
|
-
{children}
|
|
35
|
-
</Text>
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
);
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import { rem } from 'polished';
|
|
3
|
+
|
|
4
|
+
import type { TextProps } from '../Text';
|
|
5
|
+
import { Text } from '../Text';
|
|
6
|
+
|
|
7
|
+
export type TableRowProps = TextProps;
|
|
8
|
+
|
|
9
|
+
export const TableRow = forwardRef<HTMLDivElement, TableRowProps>(
|
|
10
|
+
(props, ref) => {
|
|
11
|
+
const { children, __css, ...rest } = props;
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<Text
|
|
15
|
+
ref={ref}
|
|
16
|
+
as="div"
|
|
17
|
+
role="row"
|
|
18
|
+
variant="body-medium"
|
|
19
|
+
px={2}
|
|
20
|
+
__css={{
|
|
21
|
+
display: 'flex',
|
|
22
|
+
flexDirection: 'row',
|
|
23
|
+
width: '100%',
|
|
24
|
+
borderBottomStyle: 'solid',
|
|
25
|
+
borderBottomWidth: rem(1),
|
|
26
|
+
borderBottomColor: 'surface-variant',
|
|
27
|
+
'&:last-of-type': {
|
|
28
|
+
borderBottom: 'none',
|
|
29
|
+
},
|
|
30
|
+
...__css,
|
|
31
|
+
}}
|
|
32
|
+
{...rest}
|
|
33
|
+
>
|
|
34
|
+
{children}
|
|
35
|
+
</Text>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
);
|
package/src/Table/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './Table';
|
|
2
|
-
export * from './TableHead';
|
|
3
|
-
export * from './TableBody';
|
|
4
|
-
export * from './TableCell';
|
|
5
|
-
export * from './TableRow';
|
|
1
|
+
export * from './Table';
|
|
2
|
+
export * from './TableHead';
|
|
3
|
+
export * from './TableBody';
|
|
4
|
+
export * from './TableCell';
|
|
5
|
+
export * from './TableRow';
|