venice-ui 2.0.34 → 2.0.36

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.
@@ -26,6 +26,7 @@ exports.Theme = {
26
26
  red: '#ad1616'
27
27
  },
28
28
  fontSize: {
29
+ xxs: '10px',
29
30
  xs: "12px",
30
31
  s: "14px",
31
32
  m: "16px",
@@ -33,6 +34,7 @@ exports.Theme = {
33
34
  xl: "32px",
34
35
  },
35
36
  lineHeight: {
37
+ xxs: '12px',
36
38
  xs: "14px",
37
39
  s: "16px",
38
40
  m: "18px",
@@ -72,7 +74,7 @@ exports.mainTheme = {
72
74
  disabledText: exports.Theme.colors.gray_1,
73
75
  errorBackgroundColor: exports.Theme.colors.red,
74
76
  errorBackgroundColorHover: (0, polished_1.lighten)(0.3, exports.Theme.colors.red),
75
- errorBackgroundColorHoverLight: (0, polished_1.lighten)(0.5, exports.Theme.colors.red),
77
+ errorBackgroundColorHoverLight: (0, polished_1.lighten)(0.6, exports.Theme.colors.red),
76
78
  //icon
77
79
  iconColor: exports.Theme.colors.text,
78
80
  iconHoverColor: exports.Theme.colors.primary,
@@ -91,7 +93,7 @@ exports.mainTheme = {
91
93
  inputDisabledBackground: exports.Theme.colors.gray_4,
92
94
  inputDisabledBorder: exports.Theme.colors.gray_1,
93
95
  inputDisabledTextColor: exports.Theme.colors.gray_1,
94
- inputErrorBackground: (0, polished_1.lighten)(0.5, exports.Theme.colors.red),
96
+ inputErrorBackground: (0, polished_1.lighten)(0.6, exports.Theme.colors.red),
95
97
  inputErrorBorder: exports.Theme.colors.red,
96
98
  inputErrorTextColor: exports.Theme.colors.red,
97
99
  // global
@@ -72,6 +72,7 @@ const Calendar = ({ value, top, left, size, handleClose, handleSelect, zIndex })
72
72
  });
73
73
  };
74
74
  const setNewDate = (newDate) => {
75
+ console.log('setNewDate', newDate);
75
76
  setSellectedDate(newDate);
76
77
  };
77
78
  const confirmDate = () => {
@@ -35,7 +35,7 @@ const react_dom_1 = require("react-dom");
35
35
  const Calendar_1 = require("./Calendar");
36
36
  const date_fns_1 = require("date-fns");
37
37
  const Icons_1 = require("../Icons");
38
- const DatePicker = ({ label, labelPosition = 'top', value, name, disabled = false, size = 'medium', width, error, theme = Theme_1.mainTheme, readOnly = false, position = 'left', placeholder = 'Select date', handleChange, zIndex }) => {
38
+ const DatePicker = ({ label, labelPosition = 'top', value, name, disabled = false, size = 'medium', width, error, errorMsg, theme = Theme_1.mainTheme, readOnly = false, position = 'left', placeholder = 'Select date', handleChange, zIndex }) => {
39
39
  const [open, toogleOpen] = (0, react_1.useState)(false);
40
40
  const sourceRef = (0, react_1.useRef)(null);
41
41
  const [dropdownStyles, setDropdownStyles] = (0, react_1.useState)({
@@ -33,7 +33,7 @@ const common_1 = require("../common");
33
33
  const react_dom_1 = require("react-dom");
34
34
  const Icons_1 = require("../Icons");
35
35
  const Theme_1 = require("../../Theme");
36
- const Dropdown = ({ size = 'medium', label, labelPosition = 'top', disabled = false, error, width, options, value, placeholder = 'Please select', name, handleSelect, position = 'left', zIndex, readOnly = false, theme = Theme_1.mainTheme, }) => {
36
+ const Dropdown = ({ size = 'medium', label, labelPosition = 'top', disabled = false, error, errorMsg, width, options, value, placeholder = 'Please select', name, handleSelect, position = 'left', zIndex, readOnly = false, theme = Theme_1.mainTheme, }) => {
37
37
  const [open, toogleOpen] = (0, react_1.useState)(false);
38
38
  const ref = (0, react_1.useRef)(null);
39
39
  const sourceRef = (0, react_1.useRef)(null);
@@ -87,6 +87,6 @@ const Dropdown = ({ size = 'medium', label, labelPosition = 'top', disabled = fa
87
87
  open &&
88
88
  (0, react_dom_1.createPortal)(react_1.default.createElement(common_1.Panel, { style: dropdownStyles, ref: ref, size: size, fullWidth: true, zIndex: zIndex }, options &&
89
89
  options.map((option) => (react_1.default.createElement(common_1.PanelOption, { key: option.value, active: option.value === value, onClick: (e) => selectOption(e, option.value) }, option.label)))), document.body),
90
- error && react_1.default.createElement(Input_1.InputErrorMsg, null, error)))));
90
+ (error && errorMsg) && react_1.default.createElement(Input_1.InputErrorMsg, null, errorMsg)))));
91
91
  };
92
92
  exports.Dropdown = Dropdown;
@@ -30,7 +30,8 @@ const react_1 = __importStar(require("react"));
30
30
  const Button_1 = require("../Button");
31
31
  const File_styles_1 = require("./File.styles");
32
32
  const Dropdown_1 = require("../Dropdown");
33
- const File = ({ label, labelPosition = 'top', name, disabled = false, multiple = false, size = 'medium', handleChange, accept = 'application/pdf', width, error, placeholder, fileValue, }) => {
33
+ const Typography_1 = require("../Typography");
34
+ const File = ({ label, labelPosition = 'top', name, disabled = false, multiple = false, size = 'medium', handleChange, accept = 'application/pdf', width, error, errorMsg, placeholder, fileValue, subLabel }) => {
34
35
  const fileRef = (0, react_1.useRef)(null);
35
36
  const handleSelect = (e) => {
36
37
  handleChange(e);
@@ -41,10 +42,12 @@ const File = ({ label, labelPosition = 'top', name, disabled = false, multiple =
41
42
  return (react_1.default.createElement(Aligment_1.Aligment, { align: labelPosition === 'top' ? 'flex-start' : 'center', direction: labelPosition === 'top' ? 'column' : 'row', wrap: 'nowrap' },
42
43
  label && (react_1.default.createElement(Input_1.InputLabelElement, { size: size, labelPosition: labelPosition }, label)),
43
44
  react_1.default.createElement(Input_1.InputWrapper, { width: width },
44
- react_1.default.createElement(Aligment_1.Aligment, { gap: 10, wrap: "nowrap" },
45
- react_1.default.createElement(Dropdown_1.Field, { inputSize: size, disabled: disabled, width: width, active: false, error: error, onClick: openFileSelector }, fileValue ? fileValue.name : placeholder),
46
- react_1.default.createElement(Button_1.Button, { size: size, mode: "secondary", onClick: openFileSelector, text: "Wybierz plik" })),
45
+ react_1.default.createElement(Aligment_1.Aligment, { wrap: "nowrap", direction: 'column', gap: 2, align: 'start-flex' },
46
+ react_1.default.createElement(Aligment_1.Aligment, { gap: 10, wrap: "nowrap" },
47
+ react_1.default.createElement(Dropdown_1.Field, { inputSize: size, disabled: disabled, width: width, active: false, error: error, onClick: openFileSelector }, fileValue ? fileValue.name : placeholder),
48
+ react_1.default.createElement(Button_1.Button, { size: size, mode: "secondary", onClick: openFileSelector, text: "Wybierz plik" })),
49
+ subLabel && react_1.default.createElement(Typography_1.TextMicro, null, subLabel)),
47
50
  react_1.default.createElement(File_styles_1.HiddenField, { type: "file", name: name, onChange: (e) => handleSelect(e), ref: fileRef, accept: accept, multiple: multiple }),
48
- error && react_1.default.createElement(Input_1.InputErrorMsg, null, error))));
51
+ (error && errorMsg) && react_1.default.createElement(Input_1.InputErrorMsg, null, errorMsg))));
49
52
  };
50
53
  exports.File = File;
@@ -43,17 +43,17 @@ const Form = ({ formData, size = 'medium', read }) => {
43
43
  const selectType = (item) => {
44
44
  switch (item.type) {
45
45
  case 'text':
46
- return (react_1.default.createElement(Input_1.Input, { label: item.label, value: item.value, name: item.name, type: "text", size: size, handleChange: onChangeHandler, readOnly: read, autoFocus: !!item.isDisabled && item.autofocus, handleSubmit: item.submit, disabled: item.isDisabled }));
46
+ return (react_1.default.createElement(Input_1.Input, { label: item.label, value: item.value, name: item.name, type: "text", size: size, handleChange: onChangeHandler, readOnly: read, autoFocus: !!item.isDisabled && item.autofocus, handleSubmit: item.submit, disabled: item.isDisabled, error: item.error }));
47
47
  case 'number':
48
- return (react_1.default.createElement(Input_1.Input, { label: item.label, value: item.value, name: item.name, type: "number", size: size, min: item.min, max: item.max, step: item.step, handleChange: onIntChangeHandler, readOnly: read, autoFocus: !!item.isDisabled && item.autofocus, handleSubmit: item.submit, disabled: item.isDisabled }));
48
+ return (react_1.default.createElement(Input_1.Input, { label: item.label, value: item.value, name: item.name, type: "number", size: size, min: item.min, max: item.max, step: item.step, handleChange: onIntChangeHandler, readOnly: read, autoFocus: !!item.isDisabled && item.autofocus, handleSubmit: item.submit, disabled: item.isDisabled, error: item.error }));
49
49
  case 'increase':
50
- return (react_1.default.createElement(Input_1.Input, { type: "increase", label: item.label, value: item.value, name: item.name, size: size, handleChange: onIntChangeHandler, min: item.min, max: item.max, step: item.step, readOnly: read, autoFocus: item.autofocus, handleSubmit: item.submit }));
50
+ return (react_1.default.createElement(Input_1.Input, { type: "increase", label: item.label, value: item.value, name: item.name, size: size, handleChange: onIntChangeHandler, min: item.min, max: item.max, step: item.step, readOnly: read, autoFocus: item.autofocus, handleSubmit: item.submit, error: item.error }));
51
51
  case 'select':
52
- return (react_1.default.createElement(Dropdown_1.Dropdown, { options: item.options, handleSelect: onChangeHandler, name: item.name, value: item.value, size: size, label: item.label, position: item.position, zIndex: item.zIndex, readOnly: read }));
52
+ return (react_1.default.createElement(Dropdown_1.Dropdown, { options: item.options, handleSelect: onChangeHandler, name: item.name, value: item.value, size: size, label: item.label, position: item.position, zIndex: item.zIndex, readOnly: read, error: item.error }));
53
53
  case 'file':
54
- return (react_1.default.createElement(File_1.File, { label: item.label, fileValue: item.value, name: item.name, size: size, handleChange: onFileHandler, readOnly: read }));
54
+ return (react_1.default.createElement(File_1.File, { label: item.label, fileValue: item.value, name: item.name, size: size, handleChange: onFileHandler, readOnly: read, subLabel: item.subLabel, error: item.error }));
55
55
  case 'date':
56
- return (react_1.default.createElement(DatePicker_1.DatePicker, { label: item.label, value: item.value, name: item.name, size: size, readOnly: read, handleChange: onDateChangeHandler, zIndex: item.zIndex }));
56
+ return (react_1.default.createElement(DatePicker_1.DatePicker, { label: item.label, value: item.value, name: item.name, size: size, readOnly: read, handleChange: onDateChangeHandler, zIndex: item.zIndex, error: item.error }));
57
57
  }
58
58
  };
59
59
  return (react_1.default.createElement(FormElements_1.FormWrapper, null, formData.data.map((item) => {
@@ -30,7 +30,7 @@ const Aligment_1 = require("../Aligment");
30
30
  const Input_styles_1 = require("./Input.styles");
31
31
  const Icons_1 = require("../Icons");
32
32
  const Theme_1 = require("../../Theme");
33
- const Input = ({ label, labelPosition = 'top', value, type = 'text', name, disabled = false, size = 'medium', handleChange, handleSubmit, width, error, placeholder, min, max, step = 0.1, autoFocus, theme = Theme_1.mainTheme, readOnly = false, prefix, }) => {
33
+ const Input = ({ label, labelPosition = 'top', value, type = 'text', name, disabled = false, size = 'medium', handleChange, handleSubmit, width, error = false, errorMsg, placeholder, min, max, step = 0.1, autoFocus, theme = Theme_1.mainTheme, readOnly = false, prefix, }) => {
34
34
  const calculateNumberValue = (numberValue) => {
35
35
  return isNaN(parseFloat(numberValue))
36
36
  ? numberValue
@@ -99,6 +99,6 @@ const Input = ({ label, labelPosition = 'top', value, type = 'text', name, disab
99
99
  type === 'increase' && (react_1.default.createElement(Input_styles_1.IconsWrapper, null,
100
100
  react_1.default.createElement(Icons_1.Icon, { name: "add", size: size === 'small' ? 16 : 24, onClick: () => increaseValue(value), iconColor: theme.inputDefaultTextColor }),
101
101
  react_1.default.createElement(Icons_1.Icon, { name: "remove", size: size === 'small' ? 16 : 24, onClick: () => decreaseValue(value), iconColor: theme.inputDefaultTextColor }))),
102
- error && react_1.default.createElement(Input_styles_1.InputErrorMsg, null, error))))))));
102
+ (error && errorMsg) && react_1.default.createElement(Input_styles_1.InputErrorMsg, null, errorMsg))))))));
103
103
  };
104
104
  exports.Input = Input;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.TextLabel = exports.TextAccent = exports.TextSubHeader = exports.TextHeader = exports.TextSmall = exports.Text = void 0;
6
+ exports.TextLabel = exports.TextAccent = exports.TextSubHeader = exports.TextHeader = exports.TextMicro = exports.TextSmall = exports.Text = void 0;
7
7
  const common_1 = require("../common");
8
8
  const styled_components_1 = __importDefault(require("styled-components"));
9
9
  const Theme_1 = require("../../Theme/Theme");
@@ -28,6 +28,13 @@ exports.TextSmall = styled_components_1.default.div `
28
28
  color: ${(p) => (p.color ? p.color : Theme_1.Theme.colors.text)};
29
29
  cursor: ${(p) => (p.action ? 'pointer' : 'default')};
30
30
  `;
31
+ exports.TextMicro = styled_components_1.default.div `
32
+ font-size: ${Theme_1.Theme.fontSize.xxs};
33
+ line-height: ${Theme_1.Theme.lineHeight.xs};
34
+ font-weight: normal;
35
+ color: ${(p) => (p.color ? p.color : Theme_1.Theme.colors.text)};
36
+ cursor: ${(p) => (p.action ? 'pointer' : 'default')};
37
+ `;
31
38
  exports.TextHeader = styled_components_1.default.div `
32
39
  font-size: ${Theme_1.Theme.fontSize.l};
33
40
  line-height: ${Theme_1.Theme.lineHeight.l};
@@ -23,6 +23,7 @@ export const Theme = {
23
23
  red: '#ad1616'
24
24
  },
25
25
  fontSize: {
26
+ xxs: '10px',
26
27
  xs: "12px",
27
28
  s: "14px",
28
29
  m: "16px",
@@ -30,6 +31,7 @@ export const Theme = {
30
31
  xl: "32px",
31
32
  },
32
33
  lineHeight: {
34
+ xxs: '12px',
33
35
  xs: "14px",
34
36
  s: "16px",
35
37
  m: "18px",
@@ -69,7 +71,7 @@ export const mainTheme = {
69
71
  disabledText: Theme.colors.gray_1,
70
72
  errorBackgroundColor: Theme.colors.red,
71
73
  errorBackgroundColorHover: lighten(0.3, Theme.colors.red),
72
- errorBackgroundColorHoverLight: lighten(0.5, Theme.colors.red),
74
+ errorBackgroundColorHoverLight: lighten(0.6, Theme.colors.red),
73
75
  //icon
74
76
  iconColor: Theme.colors.text,
75
77
  iconHoverColor: Theme.colors.primary,
@@ -88,7 +90,7 @@ export const mainTheme = {
88
90
  inputDisabledBackground: Theme.colors.gray_4,
89
91
  inputDisabledBorder: Theme.colors.gray_1,
90
92
  inputDisabledTextColor: Theme.colors.gray_1,
91
- inputErrorBackground: lighten(0.5, Theme.colors.red),
93
+ inputErrorBackground: lighten(0.6, Theme.colors.red),
92
94
  inputErrorBorder: Theme.colors.red,
93
95
  inputErrorTextColor: Theme.colors.red,
94
96
  // global
@@ -46,6 +46,7 @@ export const Calendar = ({ value, top, left, size, handleClose, handleSelect, zI
46
46
  });
47
47
  };
48
48
  const setNewDate = (newDate) => {
49
+ console.log('setNewDate', newDate);
49
50
  setSellectedDate(newDate);
50
51
  };
51
52
  const confirmDate = () => {
@@ -9,7 +9,7 @@ import { createPortal } from 'react-dom';
9
9
  import { Calendar } from './Calendar';
10
10
  import { format } from 'date-fns';
11
11
  import { Icon } from '../Icons';
12
- export const DatePicker = ({ label, labelPosition = 'top', value, name, disabled = false, size = 'medium', width, error, theme = mainTheme, readOnly = false, position = 'left', placeholder = 'Select date', handleChange, zIndex }) => {
12
+ export const DatePicker = ({ label, labelPosition = 'top', value, name, disabled = false, size = 'medium', width, error, errorMsg, theme = mainTheme, readOnly = false, position = 'left', placeholder = 'Select date', handleChange, zIndex }) => {
13
13
  const [open, toogleOpen] = useState(false);
14
14
  const sourceRef = useRef(null);
15
15
  const [dropdownStyles, setDropdownStyles] = useState({
@@ -7,7 +7,7 @@ import { Panel, PanelOption } from '../common';
7
7
  import { createPortal } from 'react-dom';
8
8
  import { Icon } from '../Icons';
9
9
  import { mainTheme } from '../../Theme';
10
- export const Dropdown = ({ size = 'medium', label, labelPosition = 'top', disabled = false, error, width, options, value, placeholder = 'Please select', name, handleSelect, position = 'left', zIndex, readOnly = false, theme = mainTheme, }) => {
10
+ export const Dropdown = ({ size = 'medium', label, labelPosition = 'top', disabled = false, error, errorMsg, width, options, value, placeholder = 'Please select', name, handleSelect, position = 'left', zIndex, readOnly = false, theme = mainTheme, }) => {
11
11
  const [open, toogleOpen] = useState(false);
12
12
  const ref = useRef(null);
13
13
  const sourceRef = useRef(null);
@@ -61,5 +61,5 @@ export const Dropdown = ({ size = 'medium', label, labelPosition = 'top', disabl
61
61
  open &&
62
62
  createPortal(React.createElement(Panel, { style: dropdownStyles, ref: ref, size: size, fullWidth: true, zIndex: zIndex }, options &&
63
63
  options.map((option) => (React.createElement(PanelOption, { key: option.value, active: option.value === value, onClick: (e) => selectOption(e, option.value) }, option.label)))), document.body),
64
- error && React.createElement(InputErrorMsg, null, error)))));
64
+ (error && errorMsg) && React.createElement(InputErrorMsg, null, errorMsg)))));
65
65
  };
@@ -4,7 +4,8 @@ import React, { useRef } from 'react';
4
4
  import { Button } from '../Button';
5
5
  import { HiddenField } from './File.styles';
6
6
  import { Field } from '../Dropdown';
7
- export const File = ({ label, labelPosition = 'top', name, disabled = false, multiple = false, size = 'medium', handleChange, accept = 'application/pdf', width, error, placeholder, fileValue, }) => {
7
+ import { TextMicro } from '../Typography';
8
+ export const File = ({ label, labelPosition = 'top', name, disabled = false, multiple = false, size = 'medium', handleChange, accept = 'application/pdf', width, error, errorMsg, placeholder, fileValue, subLabel }) => {
8
9
  const fileRef = useRef(null);
9
10
  const handleSelect = (e) => {
10
11
  handleChange(e);
@@ -15,9 +16,11 @@ export const File = ({ label, labelPosition = 'top', name, disabled = false, mul
15
16
  return (React.createElement(Aligment, { align: labelPosition === 'top' ? 'flex-start' : 'center', direction: labelPosition === 'top' ? 'column' : 'row', wrap: 'nowrap' },
16
17
  label && (React.createElement(InputLabelElement, { size: size, labelPosition: labelPosition }, label)),
17
18
  React.createElement(InputWrapper, { width: width },
18
- React.createElement(Aligment, { gap: 10, wrap: "nowrap" },
19
- React.createElement(Field, { inputSize: size, disabled: disabled, width: width, active: false, error: error, onClick: openFileSelector }, fileValue ? fileValue.name : placeholder),
20
- React.createElement(Button, { size: size, mode: "secondary", onClick: openFileSelector, text: "Wybierz plik" })),
19
+ React.createElement(Aligment, { wrap: "nowrap", direction: 'column', gap: 2, align: 'start-flex' },
20
+ React.createElement(Aligment, { gap: 10, wrap: "nowrap" },
21
+ React.createElement(Field, { inputSize: size, disabled: disabled, width: width, active: false, error: error, onClick: openFileSelector }, fileValue ? fileValue.name : placeholder),
22
+ React.createElement(Button, { size: size, mode: "secondary", onClick: openFileSelector, text: "Wybierz plik" })),
23
+ subLabel && React.createElement(TextMicro, null, subLabel)),
21
24
  React.createElement(HiddenField, { type: "file", name: name, onChange: (e) => handleSelect(e), ref: fileRef, accept: accept, multiple: multiple }),
22
- error && React.createElement(InputErrorMsg, null, error))));
25
+ (error && errorMsg) && React.createElement(InputErrorMsg, null, errorMsg))));
23
26
  };
@@ -37,17 +37,17 @@ export const Form = ({ formData, size = 'medium', read }) => {
37
37
  const selectType = (item) => {
38
38
  switch (item.type) {
39
39
  case 'text':
40
- return (React.createElement(Input, { label: item.label, value: item.value, name: item.name, type: "text", size: size, handleChange: onChangeHandler, readOnly: read, autoFocus: !!item.isDisabled && item.autofocus, handleSubmit: item.submit, disabled: item.isDisabled }));
40
+ return (React.createElement(Input, { label: item.label, value: item.value, name: item.name, type: "text", size: size, handleChange: onChangeHandler, readOnly: read, autoFocus: !!item.isDisabled && item.autofocus, handleSubmit: item.submit, disabled: item.isDisabled, error: item.error }));
41
41
  case 'number':
42
- return (React.createElement(Input, { label: item.label, value: item.value, name: item.name, type: "number", size: size, min: item.min, max: item.max, step: item.step, handleChange: onIntChangeHandler, readOnly: read, autoFocus: !!item.isDisabled && item.autofocus, handleSubmit: item.submit, disabled: item.isDisabled }));
42
+ return (React.createElement(Input, { label: item.label, value: item.value, name: item.name, type: "number", size: size, min: item.min, max: item.max, step: item.step, handleChange: onIntChangeHandler, readOnly: read, autoFocus: !!item.isDisabled && item.autofocus, handleSubmit: item.submit, disabled: item.isDisabled, error: item.error }));
43
43
  case 'increase':
44
- return (React.createElement(Input, { type: "increase", label: item.label, value: item.value, name: item.name, size: size, handleChange: onIntChangeHandler, min: item.min, max: item.max, step: item.step, readOnly: read, autoFocus: item.autofocus, handleSubmit: item.submit }));
44
+ return (React.createElement(Input, { type: "increase", label: item.label, value: item.value, name: item.name, size: size, handleChange: onIntChangeHandler, min: item.min, max: item.max, step: item.step, readOnly: read, autoFocus: item.autofocus, handleSubmit: item.submit, error: item.error }));
45
45
  case 'select':
46
- return (React.createElement(Dropdown, { options: item.options, handleSelect: onChangeHandler, name: item.name, value: item.value, size: size, label: item.label, position: item.position, zIndex: item.zIndex, readOnly: read }));
46
+ return (React.createElement(Dropdown, { options: item.options, handleSelect: onChangeHandler, name: item.name, value: item.value, size: size, label: item.label, position: item.position, zIndex: item.zIndex, readOnly: read, error: item.error }));
47
47
  case 'file':
48
- return (React.createElement(File, { label: item.label, fileValue: item.value, name: item.name, size: size, handleChange: onFileHandler, readOnly: read }));
48
+ return (React.createElement(File, { label: item.label, fileValue: item.value, name: item.name, size: size, handleChange: onFileHandler, readOnly: read, subLabel: item.subLabel, error: item.error }));
49
49
  case 'date':
50
- return (React.createElement(DatePicker, { label: item.label, value: item.value, name: item.name, size: size, readOnly: read, handleChange: onDateChangeHandler, zIndex: item.zIndex }));
50
+ return (React.createElement(DatePicker, { label: item.label, value: item.value, name: item.name, size: size, readOnly: read, handleChange: onDateChangeHandler, zIndex: item.zIndex, error: item.error }));
51
51
  }
52
52
  };
53
53
  return (React.createElement(FormWrapper, null, formData.data.map((item) => {
@@ -4,7 +4,7 @@ import { Aligment } from '../Aligment';
4
4
  import { InputTextElement, InputLabelElement, InputErrorMsg, InputWrapper, EyeIconWrapper, IconsWrapper, InputReadOnlyElement, Prefix, } from './Input.styles';
5
5
  import { Icon } from '../Icons';
6
6
  import { mainTheme } from '../../Theme';
7
- export const Input = ({ label, labelPosition = 'top', value, type = 'text', name, disabled = false, size = 'medium', handleChange, handleSubmit, width, error, placeholder, min, max, step = 0.1, autoFocus, theme = mainTheme, readOnly = false, prefix, }) => {
7
+ export const Input = ({ label, labelPosition = 'top', value, type = 'text', name, disabled = false, size = 'medium', handleChange, handleSubmit, width, error = false, errorMsg, placeholder, min, max, step = 0.1, autoFocus, theme = mainTheme, readOnly = false, prefix, }) => {
8
8
  const calculateNumberValue = (numberValue) => {
9
9
  return isNaN(parseFloat(numberValue))
10
10
  ? numberValue
@@ -73,5 +73,5 @@ export const Input = ({ label, labelPosition = 'top', value, type = 'text', name
73
73
  type === 'increase' && (React.createElement(IconsWrapper, null,
74
74
  React.createElement(Icon, { name: "add", size: size === 'small' ? 16 : 24, onClick: () => increaseValue(value), iconColor: theme.inputDefaultTextColor }),
75
75
  React.createElement(Icon, { name: "remove", size: size === 'small' ? 16 : 24, onClick: () => decreaseValue(value), iconColor: theme.inputDefaultTextColor }))),
76
- error && React.createElement(InputErrorMsg, null, error))))))));
76
+ (error && errorMsg) && React.createElement(InputErrorMsg, null, errorMsg))))))));
77
77
  };
@@ -22,6 +22,13 @@ export const TextSmall = styled.div `
22
22
  color: ${(p) => (p.color ? p.color : Theme.colors.text)};
23
23
  cursor: ${(p) => (p.action ? 'pointer' : 'default')};
24
24
  `;
25
+ export const TextMicro = styled.div `
26
+ font-size: ${Theme.fontSize.xxs};
27
+ line-height: ${Theme.lineHeight.xs};
28
+ font-weight: normal;
29
+ color: ${(p) => (p.color ? p.color : Theme.colors.text)};
30
+ cursor: ${(p) => (p.action ? 'pointer' : 'default')};
31
+ `;
25
32
  export const TextHeader = styled.div `
26
33
  font-size: ${Theme.fontSize.l};
27
34
  line-height: ${Theme.lineHeight.l};
@@ -22,6 +22,7 @@ export declare const Theme: {
22
22
  red: string;
23
23
  };
24
24
  fontSize: {
25
+ xxs: string;
25
26
  xs: string;
26
27
  s: string;
27
28
  m: string;
@@ -29,6 +30,7 @@ export declare const Theme: {
29
30
  xl: string;
30
31
  };
31
32
  lineHeight: {
33
+ xxs: string;
32
34
  xs: string;
33
35
  s: string;
34
36
  m: string;
@@ -2,7 +2,7 @@ import { InputSize } from "../../types";
2
2
  export interface IFieldProps {
3
3
  inputSize: InputSize;
4
4
  disabled: boolean;
5
- error?: string;
5
+ error?: boolean;
6
6
  width?: string;
7
7
  active: boolean;
8
8
  }
@@ -6,5 +6,6 @@ export interface IFileProps extends IFormElement {
6
6
  fileValue: File | null;
7
7
  multiple?: boolean;
8
8
  accept?: string;
9
+ subLabel?: string;
9
10
  }
10
11
  export declare const File: FC<IFileProps>;
@@ -13,6 +13,8 @@ export interface FormDataProps {
13
13
  position?: string;
14
14
  zIndex?: number;
15
15
  isDisabled?: boolean;
16
+ error?: boolean;
17
+ subLabel?: string;
16
18
  }
17
19
  interface FormDataParentProps {
18
20
  row: FormDataProps[];
@@ -3,7 +3,7 @@ import { InputSize, InputType } from '../../types';
3
3
  interface IInputTextElementProps extends InputHTMLAttributes<HTMLInputElement> {
4
4
  inputSize: InputSize;
5
5
  disabled: boolean;
6
- error?: string;
6
+ error?: boolean;
7
7
  width?: string;
8
8
  type: InputType;
9
9
  theme: any;
@@ -6,6 +6,7 @@ interface ITextStyle {
6
6
  }
7
7
  export declare const Text: import("styled-components").StyledComponent<"div", any, ITextStyle, never>;
8
8
  export declare const TextSmall: import("styled-components").StyledComponent<"div", any, ITextStyle, never>;
9
+ export declare const TextMicro: import("styled-components").StyledComponent<"div", any, ITextStyle, never>;
9
10
  export declare const TextHeader: import("styled-components").StyledComponent<"div", any, ITextStyle, never>;
10
11
  export declare const TextSubHeader: import("styled-components").StyledComponent<"div", any, ITextStyle, never>;
11
12
  export declare const TextAccent: import("styled-components").StyledComponent<"div", any, ITextStyle, never>;
@@ -11,7 +11,8 @@ export interface IFormElement {
11
11
  size?: InputSize;
12
12
  width?: string;
13
13
  disabled?: boolean;
14
- error?: string;
14
+ error?: boolean;
15
+ errorMsg?: string;
15
16
  placeholder?: string;
16
17
  readOnly?: boolean;
17
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "venice-ui",
3
- "version": "2.0.34",
3
+ "version": "2.0.36",
4
4
  "description": "Component library",
5
5
  "main": "index.js",
6
6
  "module": "./dist/esm/index.js",