venice-ui 2.0.34 → 2.0.35
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/Theme/Theme.js +2 -0
- package/dist/cjs/components/File/File.js +7 -4
- package/dist/cjs/components/Form/Form.js +6 -6
- package/dist/cjs/components/Typography/Typography.styles.js +8 -1
- package/dist/esm/Theme/Theme.js +2 -0
- package/dist/esm/components/File/File.js +7 -4
- package/dist/esm/components/Form/Form.js +6 -6
- package/dist/esm/components/Typography/Typography.styles.js +7 -0
- package/dist/types/Theme/Theme.d.ts +2 -0
- package/dist/types/components/File/File.d.ts +1 -0
- package/dist/types/components/Form/formTypes.d.ts +2 -0
- package/dist/types/components/Typography/Typography.styles.d.ts +1 -0
- package/package.json +1 -1
package/dist/cjs/Theme/Theme.js
CHANGED
|
@@ -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",
|
|
@@ -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
|
|
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, placeholder, fileValue, subLabel }) => {
|
|
34
35
|
const fileRef = (0, react_1.useRef)(null);
|
|
35
36
|
const handleSelect = (e) => {
|
|
36
37
|
handleChange(e);
|
|
@@ -41,9 +42,11 @@ 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:
|
|
45
|
-
react_1.default.createElement(
|
|
46
|
-
|
|
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
51
|
error && react_1.default.createElement(Input_1.InputErrorMsg, null, error))));
|
|
49
52
|
};
|
|
@@ -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) => {
|
|
@@ -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};
|
package/dist/esm/Theme/Theme.js
CHANGED
|
@@ -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",
|
|
@@ -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
|
-
|
|
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, 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:
|
|
19
|
-
React.createElement(
|
|
20
|
-
|
|
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
25
|
error && React.createElement(InputErrorMsg, null, error))));
|
|
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) => {
|
|
@@ -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;
|
|
@@ -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>;
|