@xqmsg/ui-core 0.14.2 → 0.14.3
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/components/table/index.d.ts +1 -2
- package/dist/theme/components/table.d.ts +11 -10
- package/dist/ui-core.cjs.development.js +19 -17
- package/dist/ui-core.cjs.development.js.map +1 -1
- package/dist/ui-core.cjs.production.min.js +1 -1
- package/dist/ui-core.cjs.production.min.js.map +1 -1
- package/dist/ui-core.esm.js +19 -17
- package/dist/ui-core.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/input/components/token/index.tsx +1 -0
- package/src/components/table/Table.stories.tsx +6 -18
- package/src/components/table/index.tsx +9 -6
- package/src/theme/components/table.ts +11 -10
package/package.json
CHANGED
|
@@ -4,22 +4,21 @@ import { Text } from '../text';
|
|
|
4
4
|
import { Table, TableProps } from '.';
|
|
5
5
|
import { TableBody, TableHeaders } from './TableTypes';
|
|
6
6
|
import { useArgs } from '@storybook/addons';
|
|
7
|
-
import { TableText } from './components/text';
|
|
8
7
|
|
|
9
|
-
const tableColumns = ['
|
|
8
|
+
const tableColumns = ['AppliesToTypes', 'bar'];
|
|
10
9
|
|
|
11
10
|
const tableHeaders: TableHeaders<typeof tableColumns> = {
|
|
12
|
-
|
|
13
|
-
bar: <Text variant="
|
|
11
|
+
AppliesToTypes: <Text variant="paragraph">AppliesToTypes</Text>,
|
|
12
|
+
bar: <Text variant="paragraph">BAR</Text>,
|
|
14
13
|
};
|
|
15
14
|
|
|
16
15
|
const tableBody: TableBody<typeof tableColumns> = [
|
|
17
16
|
{
|
|
18
|
-
|
|
17
|
+
AppliesToTypes: 'hi',
|
|
19
18
|
bar: 'hey',
|
|
20
19
|
},
|
|
21
|
-
{
|
|
22
|
-
{
|
|
20
|
+
{ AppliesToTypes: 'hi', bar: 'hey' },
|
|
21
|
+
{ AppliesToTypes: 'hi', bar: 'hey' },
|
|
23
22
|
];
|
|
24
23
|
|
|
25
24
|
const meta: Meta<TableProps<typeof tableColumns>> = {
|
|
@@ -40,17 +39,6 @@ const meta: Meta<TableProps<typeof tableColumns>> = {
|
|
|
40
39
|
loadMore: {
|
|
41
40
|
description: 'The callback used on click of the load more button',
|
|
42
41
|
},
|
|
43
|
-
variant: {
|
|
44
|
-
control: 'select',
|
|
45
|
-
description: 'The variant type of the table',
|
|
46
|
-
},
|
|
47
|
-
colorScheme: {
|
|
48
|
-
description: 'The color scheme of the table',
|
|
49
|
-
},
|
|
50
|
-
borderTopRadius: {
|
|
51
|
-
description:
|
|
52
|
-
'Whether or not the top border has a radius - if the user wants to add a filter to the top, etc. they can set it to true',
|
|
53
|
-
},
|
|
54
42
|
},
|
|
55
43
|
parameters: {
|
|
56
44
|
controls: { expanded: true },
|
|
@@ -25,7 +25,6 @@ export interface TableProps<T extends ReadonlyTableColumns> {
|
|
|
25
25
|
headers: TableHeaders<T>;
|
|
26
26
|
body: TableBody<T>;
|
|
27
27
|
loading?: boolean;
|
|
28
|
-
borderTopRadius?: boolean;
|
|
29
28
|
loadMore?: () => void;
|
|
30
29
|
placeholder?: string;
|
|
31
30
|
}
|
|
@@ -40,7 +39,6 @@ export function Table<T extends ReadonlyTableColumns>({
|
|
|
40
39
|
placeholder = 'There is currently no available data',
|
|
41
40
|
loading,
|
|
42
41
|
|
|
43
|
-
borderTopRadius = true,
|
|
44
42
|
loadMore,
|
|
45
43
|
}: TableProps<T>) {
|
|
46
44
|
const columnsAsConst = generateTableColumnsAsConst(columns);
|
|
@@ -50,11 +48,16 @@ export function Table<T extends ReadonlyTableColumns>({
|
|
|
50
48
|
border="none"
|
|
51
49
|
overflowX="auto"
|
|
52
50
|
bg="white"
|
|
53
|
-
|
|
54
|
-
borderTopLeftRadius={borderTopRadius ? 'md' : 0}
|
|
55
|
-
borderTopRightRadius={borderTopRadius ? 'md' : 0}
|
|
51
|
+
width="fit-content"
|
|
56
52
|
>
|
|
57
|
-
<ChakraTable
|
|
53
|
+
<ChakraTable
|
|
54
|
+
variant="unstyled"
|
|
55
|
+
width="fit-content"
|
|
56
|
+
style={{
|
|
57
|
+
borderCollapse: 'separate',
|
|
58
|
+
borderSpacing: '0px',
|
|
59
|
+
}}
|
|
60
|
+
>
|
|
58
61
|
<Thead>
|
|
59
62
|
<Tr _odd={{ bg: colors.label.primary.dark }}>
|
|
60
63
|
{columnsAsConst.map(column => (
|
|
@@ -5,26 +5,27 @@ const parts = ['th', 'td', 'tr', 'body', 'thead'];
|
|
|
5
5
|
const baseStyle = {
|
|
6
6
|
thead: { bg: colors.label.primary.dark },
|
|
7
7
|
th: {
|
|
8
|
-
height: '100%',
|
|
9
|
-
width: '100%',
|
|
10
8
|
bg: colors.label.primary.dark,
|
|
11
9
|
padding: '5px 8px !important',
|
|
12
10
|
},
|
|
13
11
|
tr: {
|
|
14
12
|
fontSize: '13px',
|
|
15
|
-
display: 'flex',
|
|
16
|
-
alignItems: 'center',
|
|
17
|
-
width: '100%',
|
|
18
|
-
height: '100%',
|
|
19
|
-
borderRadius: 'md',
|
|
20
13
|
_odd: {
|
|
21
|
-
|
|
14
|
+
td: {
|
|
15
|
+
bg: colors.fill.light.tertiary,
|
|
16
|
+
_first: {
|
|
17
|
+
borderTopLeftRadius: 'md',
|
|
18
|
+
borderBottomLeftRadius: 'md',
|
|
19
|
+
},
|
|
20
|
+
_last: {
|
|
21
|
+
borderTopRightRadius: 'md',
|
|
22
|
+
borderBottomRightRadius: 'md',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
22
25
|
},
|
|
23
26
|
},
|
|
24
27
|
td: {
|
|
25
28
|
padding: '5px 8px !important',
|
|
26
|
-
borderRadius: 'md',
|
|
27
|
-
width: '100%',
|
|
28
29
|
},
|
|
29
30
|
};
|
|
30
31
|
|