venice-ui 3.0.5 → 3.0.7

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.
@@ -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: ${({ theme, config, size }) => config.size[size].height}px;
25
- width: ${({ theme, config, size }) => config.size[size].width}px;
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
@@ -17,6 +17,10 @@ exports.FilterTrigerRoot = styled_components_1.default.div `
17
17
  cursor: pointer;
18
18
  color: ${({ theme, config, isActive }) => isActive ? config.color.activeText : config.color.text};
19
19
  border: none;
20
+ font-size: ${({ theme, config, size }) => config.size.triger[size].fontSize}px;
21
+ line-height: ${({ theme, config, size }) => config.size.triger[size].lineHeight}px;
22
+
23
+
20
24
 
21
25
  &:hover {
22
26
  background: ${({ theme, config }) => config.color.hover.background};
@@ -32,7 +36,8 @@ exports.FilterCounter = styled_components_1.default.div `
32
36
  border-radius: ${({ theme, config, size }) => config.size.counter[size].radius}px;
33
37
  font-size: ${({ theme, config, size }) => config.size.counter[size].fontSize}px;
34
38
  line-height: ${({ theme, config, size }) => config.size.counter[size].lineHeight}px;
35
- padding: 0 ${({ theme, config, size }) => config.size.counter[size].paddingX}px;
39
+ padding: 0
40
+ ${({ theme, config, size }) => config.size.counter[size].paddingX}px;
36
41
  `;
37
42
  exports.FiltersArea = styled_components_1.default.div `
38
43
  width: 100%;
@@ -11,7 +11,7 @@ const react_1 = __importDefault(require("react"));
11
11
  const Dropdown_1 = require("../Dropdown");
12
12
  const config_2 = require("../../config");
13
13
  const styled_components_1 = require("styled-components");
14
- const Pagination = ({ theme, themeVariant = 'default', currentPage, totalPages, pageSize, onPageChange, onPageSizeChange, availableValues = [10, 20, 50], dropdownLabel = config_2.wordbook.pagination.dropdownLabel, }) => {
14
+ const Pagination = ({ theme, themeVariant = 'default', currentPage, totalPages, pageSize, onPageChange, onPageSizeChange, availableValues = [10, 20, 50], label = config_2.wordbook.pagination.dropdownLabel, }) => {
15
15
  const resolvedThemeData = (0, config_1.resolveThemeWithComponentsConfig)({
16
16
  theme,
17
17
  themeVariant,
@@ -56,7 +56,7 @@ const Pagination = ({ theme, themeVariant = 'default', currentPage, totalPages,
56
56
  react_1.default.createElement(Icon_1.Icon, { name: 'back', size: "md", onClick: () => onPageChange(Math.max(1, currentPage - 1)), isDisabled: currentPage === 1 }),
57
57
  pageNumbers.map((num, idx) => num === '...' ? (react_1.default.createElement("span", { key: `ellipsis-${idx}` }, "...")) : (react_1.default.createElement(Pagination_styles_1.PaginationItem, { key: num, onClick: () => onPageChange(Number(num)), isActive: num === currentPage, theme: resolvedTheme, config: paginationConfig }, num))),
58
58
  react_1.default.createElement(Icon_1.Icon, { name: 'forward', size: "md", onClick: () => onPageChange(Math.min(totalPages, currentPage + 1)), isDisabled: currentPage === totalPages })),
59
- react_1.default.createElement(Dropdown_1.Dropdown, { size: "sm", label: dropdownLabel, labelPosition: "left", handleChange: (name, value) => {
59
+ react_1.default.createElement(Dropdown_1.Dropdown, { size: "sm", label: label, labelPosition: "left", handleChange: (name, value) => {
60
60
  const num = Number(value);
61
61
  if (!isNaN(num) && num > 0) {
62
62
  onPageSizeChange(num);
@@ -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, filterLabels, }) => {
50
+ }, pageSize = 20, moreActions = [], onRowClick, labels, paginationCounters }) => {
51
51
  const resolvedThemeData = (0, config_1.resolveThemeWithComponentsConfig)({
52
52
  theme,
53
53
  themeVariant,
@@ -153,15 +153,15 @@ const Table = ({ theme, themeVariant = 'default', headers, elements, hover = tru
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,
155
155
  filtrable && (react_1.default.createElement(Table_styles_1.HeaderSection, null,
156
- react_1.default.createElement(Filters_1.Filters, { labels: filterLabels, headers: headers, elements: initialElementsRef.current &&
156
+ react_1.default.createElement(Filters_1.Filters, { labels: labels, headers: headers, elements: initialElementsRef.current &&
157
157
  initialElementsRef.current.length > 0
158
158
  ? initialElementsRef.current
159
159
  : elements, fullElements: initialElementsRef.current &&
160
160
  initialElementsRef.current.length > 0
161
161
  ? initialElementsRef.current
162
162
  : elements, handleSubmitFilters: handleApplyFilters, externalClearSignal: filtersClearSignal, onClear: handleClearFilters }))),
163
- pagination && (react_1.default.createElement(Table_styles_1.HeaderSection, null,
164
- react_1.default.createElement(Pagination_1.Pagination, { currentPage: currentPage, totalPages: totalPages, pageSize: currentPageSize, onPageChange: setCurrentPage, onPageSizeChange: setCurrentPageSize })))))),
163
+ pagination && (react_1.default.createElement(Table_styles_1.HeaderSection, { right: true },
164
+ react_1.default.createElement(Pagination_1.Pagination, { currentPage: currentPage, totalPages: totalPages, pageSize: currentPageSize, onPageChange: setCurrentPage, onPageSizeChange: setCurrentPageSize, label: labels?.pagination, availableValues: paginationCounters })))))),
165
165
  react_1.default.createElement(Table_styles_1.TableContentWrapper, null,
166
166
  react_1.default.createElement(Table_styles_1.TableContent, { theme: resolvedTheme, config: tableConfig, cellPadding: "0", cellSpacing: "0" },
167
167
  react_1.default.createElement(Table_styles_1.TableHead, null,
@@ -29,7 +29,7 @@ exports.TableContentWrapper = styled_components_1.default.div `
29
29
  exports.HeaderSection = styled_components_1.default.div `
30
30
  display: flex;
31
31
  align-items: center;
32
- justify-content: space-between;
32
+ justify-content: ${({ right }) => (right ? 'flex-end' : 'flex-start')};
33
33
  width: 50%;
34
34
  `;
35
35
  exports.TableContent = styled_components_1.default.table `
@@ -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
- borderRadius: exports.measurements.size.radius.sm,
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: ${({ theme, config, size }) => config.size[size].height}px;
19
- width: ${({ theme, config, size }) => config.size[size].width}px;
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
@@ -11,6 +11,10 @@ export const FilterTrigerRoot = styled.div `
11
11
  cursor: pointer;
12
12
  color: ${({ theme, config, isActive }) => isActive ? config.color.activeText : config.color.text};
13
13
  border: none;
14
+ font-size: ${({ theme, config, size }) => config.size.triger[size].fontSize}px;
15
+ line-height: ${({ theme, config, size }) => config.size.triger[size].lineHeight}px;
16
+
17
+
14
18
 
15
19
  &:hover {
16
20
  background: ${({ theme, config }) => config.color.hover.background};
@@ -26,7 +30,8 @@ export const FilterCounter = styled.div `
26
30
  border-radius: ${({ theme, config, size }) => config.size.counter[size].radius}px;
27
31
  font-size: ${({ theme, config, size }) => config.size.counter[size].fontSize}px;
28
32
  line-height: ${({ theme, config, size }) => config.size.counter[size].lineHeight}px;
29
- padding: 0 ${({ theme, config, size }) => config.size.counter[size].paddingX}px;
33
+ padding: 0
34
+ ${({ theme, config, size }) => config.size.counter[size].paddingX}px;
30
35
  `;
31
36
  export const FiltersArea = styled.div `
32
37
  width: 100%;
@@ -5,7 +5,7 @@ import React from 'react';
5
5
  import { Dropdown } from '../Dropdown';
6
6
  import { wordbook } from '../../config';
7
7
  import { ThemeProvider } from 'styled-components';
8
- export const Pagination = ({ theme, themeVariant = 'default', currentPage, totalPages, pageSize, onPageChange, onPageSizeChange, availableValues = [10, 20, 50], dropdownLabel = wordbook.pagination.dropdownLabel, }) => {
8
+ export const Pagination = ({ theme, themeVariant = 'default', currentPage, totalPages, pageSize, onPageChange, onPageSizeChange, availableValues = [10, 20, 50], label = wordbook.pagination.dropdownLabel, }) => {
9
9
  const resolvedThemeData = resolveThemeWithComponentsConfig({
10
10
  theme,
11
11
  themeVariant,
@@ -50,7 +50,7 @@ export const Pagination = ({ theme, themeVariant = 'default', currentPage, total
50
50
  React.createElement(Icon, { name: 'back', size: "md", onClick: () => onPageChange(Math.max(1, currentPage - 1)), isDisabled: currentPage === 1 }),
51
51
  pageNumbers.map((num, idx) => num === '...' ? (React.createElement("span", { key: `ellipsis-${idx}` }, "...")) : (React.createElement(PaginationItem, { key: num, onClick: () => onPageChange(Number(num)), isActive: num === currentPage, theme: resolvedTheme, config: paginationConfig }, num))),
52
52
  React.createElement(Icon, { name: 'forward', size: "md", onClick: () => onPageChange(Math.min(totalPages, currentPage + 1)), isDisabled: currentPage === totalPages })),
53
- React.createElement(Dropdown, { size: "sm", label: dropdownLabel, labelPosition: "left", handleChange: (name, value) => {
53
+ React.createElement(Dropdown, { size: "sm", label: label, labelPosition: "left", handleChange: (name, value) => {
54
54
  const num = Number(value);
55
55
  if (!isNaN(num) && num > 0) {
56
56
  onPageSizeChange(num);
@@ -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, filterLabels, }) => {
14
+ }, pageSize = 20, moreActions = [], onRowClick, labels, paginationCounters }) => {
15
15
  const resolvedThemeData = resolveThemeWithComponentsConfig({
16
16
  theme,
17
17
  themeVariant,
@@ -117,15 +117,15 @@ export const Table = ({ theme, themeVariant = 'default', headers, elements, hove
117
117
  (filtrable || pagination) && (React.createElement(TableHeader, { theme: resolvedTheme, config: tableConfig, right: pagination && !filtrable },
118
118
  React.createElement(React.Fragment, null,
119
119
  filtrable && (React.createElement(HeaderSection, null,
120
- React.createElement(Filters, { labels: filterLabels, headers: headers, elements: initialElementsRef.current &&
120
+ React.createElement(Filters, { labels: labels, headers: headers, elements: initialElementsRef.current &&
121
121
  initialElementsRef.current.length > 0
122
122
  ? initialElementsRef.current
123
123
  : elements, fullElements: initialElementsRef.current &&
124
124
  initialElementsRef.current.length > 0
125
125
  ? initialElementsRef.current
126
126
  : elements, handleSubmitFilters: handleApplyFilters, externalClearSignal: filtersClearSignal, onClear: handleClearFilters }))),
127
- pagination && (React.createElement(HeaderSection, null,
128
- React.createElement(Pagination, { currentPage: currentPage, totalPages: totalPages, pageSize: currentPageSize, onPageChange: setCurrentPage, onPageSizeChange: setCurrentPageSize })))))),
127
+ pagination && (React.createElement(HeaderSection, { right: true },
128
+ React.createElement(Pagination, { currentPage: currentPage, totalPages: totalPages, pageSize: currentPageSize, onPageChange: setCurrentPage, onPageSizeChange: setCurrentPageSize, label: labels?.pagination, availableValues: paginationCounters })))))),
129
129
  React.createElement(TableContentWrapper, null,
130
130
  React.createElement(TableContent, { theme: resolvedTheme, config: tableConfig, cellPadding: "0", cellSpacing: "0" },
131
131
  React.createElement(TableHead, null,
@@ -23,7 +23,7 @@ export const TableContentWrapper = styled.div `
23
23
  export const HeaderSection = styled.div `
24
24
  display: flex;
25
25
  align-items: center;
26
- justify-content: space-between;
26
+ justify-content: ${({ right }) => (right ? 'flex-end' : 'flex-start')};
27
27
  width: 50%;
28
28
  `;
29
29
  export const TableContent = styled.table `
@@ -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
- borderRadius: measurements.size.radius.sm,
440
+ radius: measurements.size.radius.sm,
441
441
  fontSize: measurements.font.size.sm,
442
442
  lineHeight: measurements.font.lineHeight.sm,
443
443
  iconSize: 'md',
@@ -9,7 +9,7 @@ interface IPaginationProps {
9
9
  onPageChange: (page: number) => void;
10
10
  onPageSizeChange: (size: number) => void;
11
11
  availableValues?: number[];
12
- dropdownLabel?: string;
12
+ label?: string;
13
13
  }
14
14
  export declare const Pagination: FC<IPaginationProps>;
15
15
  export {};
@@ -15,7 +15,8 @@ interface ITableProps {
15
15
  pageSize?: number;
16
16
  onRowClick?: (id: string) => void;
17
17
  pagination?: boolean;
18
- filterLabels?: IFilterLabels;
18
+ labels?: IFilterLabels;
19
+ paginationCounters?: number[];
19
20
  }
20
21
  export interface ITableHeaderProps {
21
22
  name: string;
@@ -8,7 +8,10 @@ interface ITableHeaderProps {
8
8
  }
9
9
  export declare const TableHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, ITableHeaderProps, never>;
10
10
  export declare const TableContentWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
11
- export declare const HeaderSection: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
11
+ interface IHeaderSectionProps {
12
+ right?: boolean;
13
+ }
14
+ export declare const HeaderSection: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, IHeaderSectionProps, never>;
12
15
  interface ITableContentProps {
13
16
  theme: AppTheme;
14
17
  config: any;
@@ -11,6 +11,7 @@ interface ITileProps {
11
11
  height?: string;
12
12
  size?: InputSize;
13
13
  shadow?: boolean;
14
+ backgroundColor?: string;
14
15
  }
15
16
  export declare const Tile: FC<ITileProps>;
16
17
  export {};
@@ -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
- borderRadius: 8;
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
- borderRadius: 8;
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
- borderRadius: 8;
3233
+ radius: 8;
3234
3234
  fontSize: 13;
3235
3235
  lineHeight: 18;
3236
3236
  iconSize: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "venice-ui",
3
- "version": "3.0.5",
3
+ "version": "3.0.7",
4
4
  "description": "Component library",
5
5
  "main": "index.js",
6
6
  "module": "./dist/esm/index.js",