venice-ui 3.0.6 → 3.0.8
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/cjs/components/Checkbox/Checkbox.styles.js +6 -2
- package/dist/cjs/components/Filters/Filters.styles.js +1 -3
- package/dist/cjs/components/Table/Table.js +2 -2
- package/dist/cjs/components/Table/Table.styles.js +9 -2
- package/dist/cjs/components/Tile/Tile.js +2 -2
- package/dist/cjs/components/Tile/Tile.styles.js +1 -1
- package/dist/cjs/config/config.js +1 -1
- package/dist/esm/components/Checkbox/Checkbox.styles.js +6 -2
- package/dist/esm/components/Filters/Filters.styles.js +1 -3
- package/dist/esm/components/Table/Table.js +2 -2
- package/dist/esm/components/Table/Table.styles.js +9 -2
- package/dist/esm/components/Tile/Tile.js +2 -2
- package/dist/esm/components/Tile/Tile.styles.js +1 -1
- package/dist/esm/config/config.js +1 -1
- package/dist/types/components/Table/Table.d.ts +1 -0
- package/dist/types/components/Table/Table.styles.d.ts +6 -1
- package/dist/types/components/Tile/Tile.d.ts +1 -0
- package/dist/types/components/Tile/Tile.styles.d.ts +1 -0
- package/dist/types/config/config.d.ts +3 -3
- package/package.json +1 -1
|
@@ -21,8 +21,12 @@ exports.CheckboxBox = styled_components_1.default.div `
|
|
|
21
21
|
align-items: center;
|
|
22
22
|
justify-content: center;
|
|
23
23
|
box-sizing: border-box;
|
|
24
|
-
height:
|
|
25
|
-
|
|
24
|
+
height: calc(
|
|
25
|
+
${({ theme, config, size }) => config.size[size].height}px - 2px
|
|
26
|
+
);
|
|
27
|
+
width: calc(
|
|
28
|
+
${({ theme, config, size }) => config.size[size].width}px - 2px
|
|
29
|
+
);
|
|
26
30
|
border: 1px solid
|
|
27
31
|
${({ theme, config, isActive, isDisabled, isIntermedian }) => isDisabled
|
|
28
32
|
? config.color.disabled.boxBorder
|
|
@@ -20,9 +20,7 @@ exports.FilterTrigerRoot = styled_components_1.default.div `
|
|
|
20
20
|
font-size: ${({ theme, config, size }) => config.size.triger[size].fontSize}px;
|
|
21
21
|
line-height: ${({ theme, config, size }) => config.size.triger[size].lineHeight}px;
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
? `box-shadow: 0 0 0 ${config.size.triger.common.activeShadowWidth}px ${config.color.activeShadow};`
|
|
25
|
-
: ''}
|
|
23
|
+
|
|
26
24
|
|
|
27
25
|
&:hover {
|
|
28
26
|
background: ${({ theme, config }) => config.color.hover.background};
|
|
@@ -47,7 +47,7 @@ const Cell_1 = require("./Cell");
|
|
|
47
47
|
const Table = ({ theme, themeVariant = 'default', headers, elements, hover = true, selectable = true, filtrable = false, pagination = false, sortable = true, sort = {
|
|
48
48
|
name: '',
|
|
49
49
|
order: 'none',
|
|
50
|
-
}, pageSize = 20, moreActions = [], onRowClick, labels, paginationCounters }) => {
|
|
50
|
+
}, pageSize = 20, moreActions = [], onRowClick, labels, paginationCounters, tableHeight }) => {
|
|
51
51
|
const resolvedThemeData = (0, config_1.resolveThemeWithComponentsConfig)({
|
|
52
52
|
theme,
|
|
53
53
|
themeVariant,
|
|
@@ -148,7 +148,7 @@ const Table = ({ theme, themeVariant = 'default', headers, elements, hover = tru
|
|
|
148
148
|
return tableProps.elements;
|
|
149
149
|
}, [pagination, paginatedElements, tableProps.elements]);
|
|
150
150
|
return (react_1.default.createElement(styled_components_1.ThemeProvider, { theme: resolvedTheme },
|
|
151
|
-
react_1.default.createElement(Table_styles_1.TableRoot,
|
|
151
|
+
react_1.default.createElement(Table_styles_1.TableRoot, { theme: resolvedTheme, config: tableConfig, height: tableHeight },
|
|
152
152
|
react_1.default.createElement(react_1.default.Fragment, null,
|
|
153
153
|
(filtrable || pagination) && (react_1.default.createElement(Table_styles_1.TableHeader, { theme: resolvedTheme, config: tableConfig, right: pagination && !filtrable },
|
|
154
154
|
react_1.default.createElement(react_1.default.Fragment, null,
|
|
@@ -9,6 +9,7 @@ exports.TableRoot = styled_components_1.default.div `
|
|
|
9
9
|
display: flex;
|
|
10
10
|
width: 100%;
|
|
11
11
|
flex-direction: column;
|
|
12
|
+
${({ height }) => height && `height: ${height};`}
|
|
12
13
|
`;
|
|
13
14
|
exports.TableHeader = styled_components_1.default.div `
|
|
14
15
|
display: flex;
|
|
@@ -25,6 +26,7 @@ exports.TableContentWrapper = styled_components_1.default.div `
|
|
|
25
26
|
overflow-y: hidden;
|
|
26
27
|
overflow-x: auto;
|
|
27
28
|
height: 100%;
|
|
29
|
+
flex-shrink: 0;
|
|
28
30
|
`;
|
|
29
31
|
exports.HeaderSection = styled_components_1.default.div `
|
|
30
32
|
display: flex;
|
|
@@ -40,17 +42,22 @@ exports.TableContent = styled_components_1.default.table `
|
|
|
40
42
|
overflow-x: auto;
|
|
41
43
|
overflow-y: auto;
|
|
42
44
|
height: 100%;
|
|
43
|
-
// border: 1px solid ${({ theme, config }) => config.color.default.common.border};
|
|
44
45
|
border-radius: ${({ theme, config }) => config.size.common.borderRadius}px;
|
|
45
46
|
border-collapse: separate;
|
|
46
47
|
border-spacing: 0;
|
|
48
|
+
position: sticky;
|
|
49
|
+
top: 0;
|
|
50
|
+
z-index: 2;
|
|
47
51
|
`;
|
|
48
52
|
exports.TableHead = styled_components_1.default.thead `
|
|
49
53
|
box-sizing: border-box;
|
|
54
|
+
position: sticky;
|
|
55
|
+
top: 0;
|
|
56
|
+
z-index: 2;
|
|
50
57
|
tr:first-child {
|
|
51
58
|
position: sticky;
|
|
52
59
|
top: 0;
|
|
53
|
-
z-index:
|
|
60
|
+
z-index: 2;
|
|
54
61
|
}
|
|
55
62
|
`;
|
|
56
63
|
exports.TableBody = styled_components_1.default.tbody `
|
|
@@ -9,7 +9,7 @@ const react_1 = __importDefault(require("react"));
|
|
|
9
9
|
const Tile_styles_1 = require("./Tile.styles");
|
|
10
10
|
const Header_1 = require("../Header");
|
|
11
11
|
const styled_components_1 = require("styled-components");
|
|
12
|
-
const Tile = ({ theme, themeVariant = 'default', title, children, customHeader, headerDivader, height, size = 'sm', shadow = false, }) => {
|
|
12
|
+
const Tile = ({ theme, themeVariant = 'default', title, children, customHeader, headerDivader, height, size = 'sm', shadow = false, backgroundColor }) => {
|
|
13
13
|
const resolvedThemeData = (0, config_1.resolveThemeWithComponentsConfig)({
|
|
14
14
|
theme,
|
|
15
15
|
themeVariant,
|
|
@@ -18,7 +18,7 @@ const Tile = ({ theme, themeVariant = 'default', title, children, customHeader,
|
|
|
18
18
|
const { componentsConfig } = resolvedThemeData;
|
|
19
19
|
const headerConfig = componentsConfig.tile;
|
|
20
20
|
return (react_1.default.createElement(styled_components_1.ThemeProvider, { theme: resolvedTheme },
|
|
21
|
-
react_1.default.createElement(Tile_styles_1.TileRoot, { height: height, shadow: shadow, theme: resolvedTheme, config: headerConfig, size: size },
|
|
21
|
+
react_1.default.createElement(Tile_styles_1.TileRoot, { height: height, shadow: shadow, theme: resolvedTheme, config: headerConfig, size: size, backgroundColor: backgroundColor },
|
|
22
22
|
title && (react_1.default.createElement(Header_1.Header, { title: title, theme: theme, bottomDivader: headerDivader, themeVariant: themeVariant, header: customHeader })),
|
|
23
23
|
react_1.default.createElement(Tile_styles_1.TileContent, { theme: resolvedTheme, config: headerConfig }, children))));
|
|
24
24
|
};
|
|
@@ -10,7 +10,7 @@ exports.TileRoot = styled_components_1.default.div `
|
|
|
10
10
|
display: flex;
|
|
11
11
|
flex-direction: column;
|
|
12
12
|
width: 100%;
|
|
13
|
-
background-color: ${({ config }) => config.color.background};
|
|
13
|
+
background-color: ${({ config, backgroundColor }) => backgroundColor || config.color.background};
|
|
14
14
|
height: ${(p) => (p.height ? p.height : '100%')};
|
|
15
15
|
${(p) => p.shadow && `box-shadow: ${p.config.color.shadow};`}
|
|
16
16
|
max-width:${({ config, size }) => config.size[size].maxWidth};
|
|
@@ -442,7 +442,7 @@ const createComponentsConfig = (theme = 'default') => {
|
|
|
442
442
|
sm: {
|
|
443
443
|
height: exports.measurements.space.xl4,
|
|
444
444
|
paddingX: exports.measurements.space.sm,
|
|
445
|
-
|
|
445
|
+
radius: exports.measurements.size.radius.sm,
|
|
446
446
|
fontSize: exports.measurements.font.size.sm,
|
|
447
447
|
lineHeight: exports.measurements.font.lineHeight.sm,
|
|
448
448
|
iconSize: 'md',
|
|
@@ -15,8 +15,12 @@ export const CheckboxBox = styled.div `
|
|
|
15
15
|
align-items: center;
|
|
16
16
|
justify-content: center;
|
|
17
17
|
box-sizing: border-box;
|
|
18
|
-
height:
|
|
19
|
-
|
|
18
|
+
height: calc(
|
|
19
|
+
${({ theme, config, size }) => config.size[size].height}px - 2px
|
|
20
|
+
);
|
|
21
|
+
width: calc(
|
|
22
|
+
${({ theme, config, size }) => config.size[size].width}px - 2px
|
|
23
|
+
);
|
|
20
24
|
border: 1px solid
|
|
21
25
|
${({ theme, config, isActive, isDisabled, isIntermedian }) => isDisabled
|
|
22
26
|
? config.color.disabled.boxBorder
|
|
@@ -14,9 +14,7 @@ export const FilterTrigerRoot = styled.div `
|
|
|
14
14
|
font-size: ${({ theme, config, size }) => config.size.triger[size].fontSize}px;
|
|
15
15
|
line-height: ${({ theme, config, size }) => config.size.triger[size].lineHeight}px;
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
? `box-shadow: 0 0 0 ${config.size.triger.common.activeShadowWidth}px ${config.color.activeShadow};`
|
|
19
|
-
: ''}
|
|
17
|
+
|
|
20
18
|
|
|
21
19
|
&:hover {
|
|
22
20
|
background: ${({ theme, config }) => config.color.hover.background};
|
|
@@ -11,7 +11,7 @@ import { Cell } from './Cell';
|
|
|
11
11
|
export const Table = ({ theme, themeVariant = 'default', headers, elements, hover = true, selectable = true, filtrable = false, pagination = false, sortable = true, sort = {
|
|
12
12
|
name: '',
|
|
13
13
|
order: 'none',
|
|
14
|
-
}, pageSize = 20, moreActions = [], onRowClick, labels, paginationCounters }) => {
|
|
14
|
+
}, pageSize = 20, moreActions = [], onRowClick, labels, paginationCounters, tableHeight }) => {
|
|
15
15
|
const resolvedThemeData = resolveThemeWithComponentsConfig({
|
|
16
16
|
theme,
|
|
17
17
|
themeVariant,
|
|
@@ -112,7 +112,7 @@ export const Table = ({ theme, themeVariant = 'default', headers, elements, hove
|
|
|
112
112
|
return tableProps.elements;
|
|
113
113
|
}, [pagination, paginatedElements, tableProps.elements]);
|
|
114
114
|
return (React.createElement(ThemeProvider, { theme: resolvedTheme },
|
|
115
|
-
React.createElement(TableRoot,
|
|
115
|
+
React.createElement(TableRoot, { theme: resolvedTheme, config: tableConfig, height: tableHeight },
|
|
116
116
|
React.createElement(React.Fragment, null,
|
|
117
117
|
(filtrable || pagination) && (React.createElement(TableHeader, { theme: resolvedTheme, config: tableConfig, right: pagination && !filtrable },
|
|
118
118
|
React.createElement(React.Fragment, null,
|
|
@@ -3,6 +3,7 @@ export const TableRoot = styled.div `
|
|
|
3
3
|
display: flex;
|
|
4
4
|
width: 100%;
|
|
5
5
|
flex-direction: column;
|
|
6
|
+
${({ height }) => height && `height: ${height};`}
|
|
6
7
|
`;
|
|
7
8
|
export const TableHeader = styled.div `
|
|
8
9
|
display: flex;
|
|
@@ -19,6 +20,7 @@ export const TableContentWrapper = styled.div `
|
|
|
19
20
|
overflow-y: hidden;
|
|
20
21
|
overflow-x: auto;
|
|
21
22
|
height: 100%;
|
|
23
|
+
flex-shrink: 0;
|
|
22
24
|
`;
|
|
23
25
|
export const HeaderSection = styled.div `
|
|
24
26
|
display: flex;
|
|
@@ -34,17 +36,22 @@ export const TableContent = styled.table `
|
|
|
34
36
|
overflow-x: auto;
|
|
35
37
|
overflow-y: auto;
|
|
36
38
|
height: 100%;
|
|
37
|
-
// border: 1px solid ${({ theme, config }) => config.color.default.common.border};
|
|
38
39
|
border-radius: ${({ theme, config }) => config.size.common.borderRadius}px;
|
|
39
40
|
border-collapse: separate;
|
|
40
41
|
border-spacing: 0;
|
|
42
|
+
position: sticky;
|
|
43
|
+
top: 0;
|
|
44
|
+
z-index: 2;
|
|
41
45
|
`;
|
|
42
46
|
export const TableHead = styled.thead `
|
|
43
47
|
box-sizing: border-box;
|
|
48
|
+
position: sticky;
|
|
49
|
+
top: 0;
|
|
50
|
+
z-index: 2;
|
|
44
51
|
tr:first-child {
|
|
45
52
|
position: sticky;
|
|
46
53
|
top: 0;
|
|
47
|
-
z-index:
|
|
54
|
+
z-index: 2;
|
|
48
55
|
}
|
|
49
56
|
`;
|
|
50
57
|
export const TableBody = styled.tbody `
|
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { TileContent, TileRoot } from './Tile.styles';
|
|
4
4
|
import { Header } from '../Header';
|
|
5
5
|
import { ThemeProvider } from 'styled-components';
|
|
6
|
-
export const Tile = ({ theme, themeVariant = 'default', title, children, customHeader, headerDivader, height, size = 'sm', shadow = false, }) => {
|
|
6
|
+
export const Tile = ({ theme, themeVariant = 'default', title, children, customHeader, headerDivader, height, size = 'sm', shadow = false, backgroundColor }) => {
|
|
7
7
|
const resolvedThemeData = resolveThemeWithComponentsConfig({
|
|
8
8
|
theme,
|
|
9
9
|
themeVariant,
|
|
@@ -12,7 +12,7 @@ export const Tile = ({ theme, themeVariant = 'default', title, children, customH
|
|
|
12
12
|
const { componentsConfig } = resolvedThemeData;
|
|
13
13
|
const headerConfig = componentsConfig.tile;
|
|
14
14
|
return (React.createElement(ThemeProvider, { theme: resolvedTheme },
|
|
15
|
-
React.createElement(TileRoot, { height: height, shadow: shadow, theme: resolvedTheme, config: headerConfig, size: size },
|
|
15
|
+
React.createElement(TileRoot, { height: height, shadow: shadow, theme: resolvedTheme, config: headerConfig, size: size, backgroundColor: backgroundColor },
|
|
16
16
|
title && (React.createElement(Header, { title: title, theme: theme, bottomDivader: headerDivader, themeVariant: themeVariant, header: customHeader })),
|
|
17
17
|
React.createElement(TileContent, { theme: resolvedTheme, config: headerConfig }, children))));
|
|
18
18
|
};
|
|
@@ -4,7 +4,7 @@ export const TileRoot = styled.div `
|
|
|
4
4
|
display: flex;
|
|
5
5
|
flex-direction: column;
|
|
6
6
|
width: 100%;
|
|
7
|
-
background-color: ${({ config }) => config.color.background};
|
|
7
|
+
background-color: ${({ config, backgroundColor }) => backgroundColor || config.color.background};
|
|
8
8
|
height: ${(p) => (p.height ? p.height : '100%')};
|
|
9
9
|
${(p) => p.shadow && `box-shadow: ${p.config.color.shadow};`}
|
|
10
10
|
max-width:${({ config, size }) => config.size[size].maxWidth};
|
|
@@ -437,7 +437,7 @@ export const createComponentsConfig = (theme = 'default') => {
|
|
|
437
437
|
sm: {
|
|
438
438
|
height: measurements.space.xl4,
|
|
439
439
|
paddingX: measurements.space.sm,
|
|
440
|
-
|
|
440
|
+
radius: measurements.size.radius.sm,
|
|
441
441
|
fontSize: measurements.font.size.sm,
|
|
442
442
|
lineHeight: measurements.font.lineHeight.sm,
|
|
443
443
|
iconSize: 'md',
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { AppTheme } from 'config/themes';
|
|
2
2
|
import { InputSize } from 'types';
|
|
3
|
-
|
|
3
|
+
interface ITableRoot {
|
|
4
|
+
theme: AppTheme;
|
|
5
|
+
config: any;
|
|
6
|
+
height?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const TableRoot: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, ITableRoot, never>;
|
|
4
9
|
interface ITableHeaderProps {
|
|
5
10
|
theme: AppTheme;
|
|
6
11
|
config: any;
|
|
@@ -5,6 +5,7 @@ interface ITileRootStyles {
|
|
|
5
5
|
theme?: any;
|
|
6
6
|
config: any;
|
|
7
7
|
size: InputSize;
|
|
8
|
+
backgroundColor?: string;
|
|
8
9
|
}
|
|
9
10
|
export declare const TileRoot: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, ITileRootStyles, never>;
|
|
10
11
|
interface ITileContentProps {
|
|
@@ -445,7 +445,7 @@ export declare const createComponentsConfig: (theme?: ThemeName | AppTheme) => {
|
|
|
445
445
|
sm: {
|
|
446
446
|
height: 32;
|
|
447
447
|
paddingX: 8;
|
|
448
|
-
|
|
448
|
+
radius: 8;
|
|
449
449
|
fontSize: 13;
|
|
450
450
|
lineHeight: 18;
|
|
451
451
|
iconSize: string;
|
|
@@ -1766,7 +1766,7 @@ export declare const componentsConfig: {
|
|
|
1766
1766
|
sm: {
|
|
1767
1767
|
height: 32;
|
|
1768
1768
|
paddingX: 8;
|
|
1769
|
-
|
|
1769
|
+
radius: 8;
|
|
1770
1770
|
fontSize: 13;
|
|
1771
1771
|
lineHeight: 18;
|
|
1772
1772
|
iconSize: string;
|
|
@@ -3230,7 +3230,7 @@ export declare const createConfig: (theme?: ThemeName | AppTheme) => {
|
|
|
3230
3230
|
sm: {
|
|
3231
3231
|
height: 32;
|
|
3232
3232
|
paddingX: 8;
|
|
3233
|
-
|
|
3233
|
+
radius: 8;
|
|
3234
3234
|
fontSize: 13;
|
|
3235
3235
|
lineHeight: 18;
|
|
3236
3236
|
iconSize: string;
|