venice-ui 1.0.62 → 1.1.0
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 -1
- package/dist/cjs/components/Aligment/Aligment.styles.js +9 -8
- package/dist/cjs/components/Button/Button.js +3 -3
- package/dist/cjs/components/Button/Button.styles.js +12 -14
- package/dist/cjs/components/ButtonsFooter/ButtonsFooter.js +4 -4
- package/dist/cjs/components/Card/Card.js +3 -2
- package/dist/cjs/components/Card/Card.styles.js +0 -1
- package/dist/cjs/components/Chips/Chips.styles.js +3 -0
- package/dist/cjs/components/Dropdown/DropdownElements.js +1 -0
- package/dist/cjs/components/ElementHeader/ElementHeader.js +10 -10
- package/dist/cjs/components/Icons/IconsPath.js +1 -0
- package/dist/cjs/components/Input/Input.js +7 -2
- package/dist/cjs/components/Loader/Loader.js +1 -1
- package/dist/cjs/components/Modal/Modal.js +1 -1
- package/dist/cjs/components/Section/Section.js +1 -1
- package/dist/cjs/components/Sidepanel/Sidepanel.js +1 -3
- package/dist/cjs/components/Tile/Tile.js +2 -2
- package/dist/cjs/components/common/commonComponents.js +4 -4
- package/dist/cjs/docs/Overview.js +91 -0
- package/dist/cjs/example/ExampleComponent.js +3 -2
- package/dist/esm/Theme/Theme.js +2 -1
- package/dist/esm/components/Aligment/Aligment.styles.js +10 -9
- package/dist/esm/components/Button/Button.js +3 -3
- package/dist/esm/components/Button/Button.styles.js +12 -14
- package/dist/esm/components/ButtonsFooter/ButtonsFooter.js +4 -4
- package/dist/esm/components/Card/Card.js +3 -2
- package/dist/esm/components/Card/Card.styles.js +0 -1
- package/dist/esm/components/Chips/Chips.styles.js +3 -0
- package/dist/esm/components/Dropdown/DropdownElements.js +1 -0
- package/dist/esm/components/ElementHeader/ElementHeader.js +11 -11
- package/dist/esm/components/Icons/IconsPath.js +1 -0
- package/dist/esm/components/Input/Input.js +7 -2
- package/dist/esm/components/Loader/Loader.js +2 -2
- package/dist/esm/components/Modal/Modal.js +1 -1
- package/dist/esm/components/Section/Section.js +2 -2
- package/dist/esm/components/Sidepanel/Sidepanel.js +1 -3
- package/dist/esm/components/Tile/Tile.js +3 -3
- package/dist/esm/components/common/commonComponents.js +4 -4
- package/dist/esm/docs/Overview.js +64 -0
- package/dist/esm/example/ExampleComponent.js +3 -2
- package/dist/types/Theme/Theme.d.ts +1 -0
- package/dist/types/components/ButtonsFooter/ButtonsFooter.d.ts +1 -0
- package/dist/types/components/Card/Card.d.ts +3 -2
- package/dist/types/components/ElementHeader/ElementHeader.d.ts +4 -6
- package/dist/types/components/Icons/IconsPath.d.ts +1 -0
- package/dist/types/components/Input/Input.d.ts +3 -1
- package/dist/types/components/Input/Input.styles.d.ts +1 -0
- package/dist/types/components/Loader/Loader.d.ts +1 -0
- package/dist/types/components/Section/Section.d.ts +2 -1
- package/dist/types/components/Tile/Tile.d.ts +1 -0
- package/dist/types/docs/Overview.d.ts +9 -0
- package/package.json +1 -1
package/dist/cjs/Theme/Theme.js
CHANGED
|
@@ -102,5 +102,6 @@ exports.mainTheme = {
|
|
|
102
102
|
tableMoreIconColor: exports.Theme.colors.primary,
|
|
103
103
|
// chips
|
|
104
104
|
chipsNeutralBackground: exports.Theme.colors.primary,
|
|
105
|
-
chipsNeutralTextColor: exports.Theme.colors.white
|
|
105
|
+
chipsNeutralTextColor: exports.Theme.colors.white,
|
|
106
|
+
chipsNeutralHoverBackground: (0, polished_1.lighten)(0.1, exports.Theme.colors.primary),
|
|
106
107
|
};
|
|
@@ -6,14 +6,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.Aligment = void 0;
|
|
7
7
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
8
|
exports.Aligment = styled_components_1.default.div `
|
|
9
|
+
align-items: ${(p) => (p.align ? p.align : 'center')};
|
|
10
|
+
background-color: ${(p) => p.backgroundColor ? p.backgroundColor : 'transparent'};
|
|
9
11
|
box-sizing: border-box;
|
|
10
12
|
display: flex;
|
|
11
|
-
|
|
12
|
-
flex-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
gap: ${p => p.gap ? p.gap + 'px' : '0px'};
|
|
13
|
+
flex-direction: ${(p) => (p.direction ? p.direction : 'row')};
|
|
14
|
+
flex-wrap: ${(p) => (p.wrap ? p.wrap : 'wrap')};
|
|
15
|
+
gap: ${(p) => (p.gap ? p.gap + 'px' : '0px')};
|
|
16
|
+
justify-content: ${(p) => (p.justify ? p.justify : 'space-between')};
|
|
17
|
+
padding: ${(p) => (p.vPadding ? p.vPadding : '0')}
|
|
18
|
+
${(p) => (p.hPadding ? p.hPadding : '0')};
|
|
19
|
+
width: ${(p) => (p.width ? p.width : '100%')};
|
|
19
20
|
`;
|
|
@@ -9,12 +9,12 @@ const styled_components_1 = require("styled-components");
|
|
|
9
9
|
const Theme_1 = require("../../Theme");
|
|
10
10
|
const Button_styles_1 = require("./Button.styles");
|
|
11
11
|
const Loader_1 = require("../Loader");
|
|
12
|
-
const Button = ({ text, mode = 'primary', size = 'medium', right = false, left = false, theme = Theme_1.mainTheme, disabled = false, onClick, loader = false, }) => {
|
|
12
|
+
const Button = ({ text = 'Click me', mode = 'primary', size = 'medium', right = false, left = false, theme = Theme_1.mainTheme, disabled = false, onClick, loader = false, }) => {
|
|
13
13
|
const handleClick = () => {
|
|
14
|
-
!disabled && onClick();
|
|
14
|
+
(!disabled && !loader) && onClick();
|
|
15
15
|
};
|
|
16
16
|
return (react_1.default.createElement(styled_components_1.ThemeProvider, { theme: theme },
|
|
17
17
|
react_1.default.createElement(Button_styles_1.ButtonElement, { mode: mode, size: size, right: right, left: left, disabled: disabled, onClick: handleClick, loader: loader }, loader ? (react_1.default.createElement(Button_styles_1.ButtonLoader, { size: size },
|
|
18
|
-
react_1.default.createElement(Loader_1.Loader, { size: "small", color: mode === 'primary' ?
|
|
18
|
+
react_1.default.createElement(Loader_1.Loader, { size: "small", color: mode === 'primary' ? theme.buttonText : theme.action }))) : (text))));
|
|
19
19
|
};
|
|
20
20
|
exports.Button = Button;
|
|
@@ -8,24 +8,23 @@ const common_1 = require("../common");
|
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const Theme_1 = require("../../Theme/Theme");
|
|
10
10
|
exports.ButtonElement = styled_components_1.default.button `
|
|
11
|
-
|
|
11
|
+
align-items: center;
|
|
12
12
|
border-radius: ${Theme_1.Theme.borderRadius.s};
|
|
13
|
-
overflow: hidden;
|
|
14
|
-
cursor: pointer;
|
|
15
13
|
box-sizing: border-box;
|
|
16
|
-
|
|
17
|
-
margin-right: ${(p) => (p.left ? Theme_1.Theme.padding.m : '0')};
|
|
14
|
+
cursor: pointer;
|
|
18
15
|
display: flex;
|
|
19
|
-
|
|
16
|
+
flex-shrink: 1;
|
|
20
17
|
justify-content: center;
|
|
21
|
-
|
|
18
|
+
margin-left: ${(p) => (p.right ? Theme_1.Theme.padding.m : '0')};
|
|
19
|
+
margin-right: ${(p) => (p.left ? Theme_1.Theme.padding.m : '0')};
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
transition: 300ms;
|
|
22
22
|
white-space: nowrap;
|
|
23
|
-
flex-shrink: 1;
|
|
24
23
|
|
|
25
24
|
${(p) => p.mode === 'primary' &&
|
|
26
25
|
`background-color: ${p.theme.action};
|
|
27
|
-
color: ${p.theme.buttonText};
|
|
28
26
|
border: 1px solid rgba(0,0,0,0.15);
|
|
27
|
+
color: ${p.theme.buttonText};
|
|
29
28
|
&:disabled{
|
|
30
29
|
color: ${p.theme.disabledText};
|
|
31
30
|
background-color: ${p.theme.disabledBackground};
|
|
@@ -33,8 +32,8 @@ exports.ButtonElement = styled_components_1.default.button `
|
|
|
33
32
|
`}
|
|
34
33
|
${(p) => p.mode === 'secondary' &&
|
|
35
34
|
`background-color: transparent;
|
|
36
|
-
color: ${p.theme.action};
|
|
37
35
|
border: 1px solid ${p.theme.action};
|
|
36
|
+
color: ${p.theme.action};
|
|
38
37
|
&:disabled{
|
|
39
38
|
color: ${p.theme.disabledText};
|
|
40
39
|
border: 1px solid ${p.theme.disabledText};
|
|
@@ -42,8 +41,8 @@ exports.ButtonElement = styled_components_1.default.button `
|
|
|
42
41
|
`}
|
|
43
42
|
${(p) => p.mode === 'inverse' &&
|
|
44
43
|
`background-color:transparent;
|
|
45
|
-
color: ${p.theme.action};
|
|
46
44
|
border:none;
|
|
45
|
+
color: ${p.theme.action};
|
|
47
46
|
&:disabled{
|
|
48
47
|
color: ${p.theme.disabledText};
|
|
49
48
|
}
|
|
@@ -75,8 +74,7 @@ exports.ButtonElement = styled_components_1.default.button `
|
|
|
75
74
|
}
|
|
76
75
|
`;
|
|
77
76
|
exports.ButtonLoader = styled_components_1.default.div `
|
|
78
|
-
display:flex;
|
|
79
|
-
box-sizing:border-box;
|
|
77
|
+
display: flex;
|
|
78
|
+
box-sizing: border-box;
|
|
80
79
|
${(p) => (0, common_1.setButtonLoaderSize)(p.size)}
|
|
81
|
-
|
|
82
80
|
`;
|
|
@@ -4,19 +4,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ButtonsFooter = void 0;
|
|
7
|
-
const
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const Theme_1 = require("../../Theme/Theme");
|
|
9
|
+
const Button_1 = require("../Button");
|
|
9
10
|
const Aligment_1 = require("../Aligment");
|
|
10
|
-
const react_1 = __importDefault(require("react"));
|
|
11
11
|
const ButtonsFooter_style_1 = require("./ButtonsFooter.style");
|
|
12
|
-
const ButtonsFooter = ({ handleConfirm, handleClose, handleAdditional, labelConfirm, labelClose, labelAdditional, submitDisabled, submitLoader, }) => {
|
|
12
|
+
const ButtonsFooter = ({ handleConfirm, handleClose, handleAdditional, labelConfirm = 'Confirm', labelClose = "Close", labelAdditional = "Reset", submitDisabled, submitLoader, backgroundColor = 'transparent' }) => {
|
|
13
13
|
const isAdditional = () => {
|
|
14
14
|
return labelAdditional !== undefined && handleAdditional !== undefined;
|
|
15
15
|
};
|
|
16
16
|
const isMultiButtons = () => {
|
|
17
17
|
return handleConfirm !== undefined && labelConfirm !== undefined;
|
|
18
18
|
};
|
|
19
|
-
return (react_1.default.createElement(Aligment_1.Aligment, { justify: isAdditional() ? 'space-between' : 'flex-end', vPadding: Theme_1.Theme.padding.l, hPadding: Theme_1.Theme.padding.l },
|
|
19
|
+
return (react_1.default.createElement(Aligment_1.Aligment, { justify: isAdditional() ? 'space-between' : 'flex-end', vPadding: Theme_1.Theme.padding.l, hPadding: Theme_1.Theme.padding.l, backgroundColor: backgroundColor },
|
|
20
20
|
labelAdditional && handleAdditional && (react_1.default.createElement(ButtonsFooter_style_1.ButtonsFooterGroup, null, !submitLoader && (react_1.default.createElement(Button_1.Button, { mode: 'inverse', onClick: () => handleAdditional(), text: labelAdditional, left: isMultiButtons() })))),
|
|
21
21
|
react_1.default.createElement(ButtonsFooter_style_1.ButtonsFooterGroup, null,
|
|
22
22
|
!submitLoader && (react_1.default.createElement(Button_1.Button, { mode: isMultiButtons() ? 'secondary' : 'primary', onClick: () => handleClose(), text: labelClose, left: isMultiButtons() })),
|
|
@@ -7,9 +7,10 @@ exports.Card = void 0;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const Card_styles_1 = require("./Card.styles");
|
|
9
9
|
const ElementHeader_1 = require("../ElementHeader");
|
|
10
|
-
const
|
|
10
|
+
const Theme_1 = require("../../Theme");
|
|
11
|
+
const Card = ({ children, title, actionLabel, theme = Theme_1.mainTheme, iconColor = theme.textColor, iconHoverColor = theme.action, handleClick, handleBack, height, options, }) => {
|
|
11
12
|
return (react_1.default.createElement(Card_styles_1.CardElement, { height: height },
|
|
12
|
-
(title || actionLabel) && (react_1.default.createElement(ElementHeader_1.ElementHeader, { title: title, actionLabel: actionLabel, handleClick: handleClick, handleBack: handleBack,
|
|
13
|
+
(title || actionLabel) && (react_1.default.createElement(ElementHeader_1.ElementHeader, { title: title, actionLabel: actionLabel, handleClick: handleClick, handleBack: handleBack, options: options, theme: theme, iconColor: iconColor, iconHoverColor: iconHoverColor })),
|
|
13
14
|
react_1.default.createElement(Card_styles_1.CardContent, { soloMode: !title && !actionLabel }, children)));
|
|
14
15
|
};
|
|
15
16
|
exports.Card = Card;
|
|
@@ -19,7 +19,6 @@ exports.CardElement = styled_components_1.default.div `
|
|
|
19
19
|
exports.CardContent = styled_components_1.default.div `
|
|
20
20
|
box-sizing: border-box;
|
|
21
21
|
display: flex;
|
|
22
|
-
backgorund-color:#ff0000;
|
|
23
22
|
padding: ${Theme_1.Theme.padding.l};
|
|
24
23
|
width: 100%;
|
|
25
24
|
flex-direction: row;
|
|
@@ -15,6 +15,9 @@ exports.ChipsElement = styled_components_1.default.div `
|
|
|
15
15
|
width:auto;
|
|
16
16
|
box-sizing: border-box;
|
|
17
17
|
border-radius:30px;
|
|
18
|
+
&:hover{
|
|
19
|
+
background-color:${p => p.theme.chipsNeutralHoverBackground};
|
|
20
|
+
}
|
|
18
21
|
`;
|
|
19
22
|
exports.ChipsLabel = styled_components_1.default.div `
|
|
20
23
|
font-size:${Theme_1.Theme.fontSize.s}
|
|
@@ -16,6 +16,7 @@ exports.Field = styled_components_1.default.div `
|
|
|
16
16
|
color: ${Theme_1.Theme.colors.text};
|
|
17
17
|
width: ${(p) => (p.width ? p.width : '100%')};
|
|
18
18
|
height: ${(p) => (0, common_1.setFieldHeight)(p.inputSize)};
|
|
19
|
+
min-width: 30px;
|
|
19
20
|
${(p) => p.error &&
|
|
20
21
|
`
|
|
21
22
|
${common_1.inputColorSchema.error}
|
|
@@ -11,28 +11,28 @@ const Typography_1 = require("../Typography");
|
|
|
11
11
|
const Theme_1 = require("../../Theme");
|
|
12
12
|
const Button_1 = require("../Button");
|
|
13
13
|
const DropdownMenu_1 = require("../DropdownMenu");
|
|
14
|
-
const ElementHeader = ({ title,
|
|
14
|
+
const ElementHeader = ({ title, actionLabel = '', handleClose, handleClick, handleBack, children, theme = Theme_1.mainTheme, backgroundColor = theme.contentBackground, iconColor = theme.textColor, iconHoverColor = theme.action, options, }) => {
|
|
15
15
|
const leftSide = () => {
|
|
16
|
-
if (
|
|
17
|
-
return (react_1.default.createElement(Aligment_1.Aligment, { align:
|
|
18
|
-
|
|
16
|
+
if (title) {
|
|
17
|
+
return (react_1.default.createElement(Aligment_1.Aligment, { align: "center", direction: "row", width: "auto" },
|
|
18
|
+
handleBack && (react_1.default.createElement(Icons_1.Icon, { name: "back_arrow", onClick: () => handleBack(), left: true })),
|
|
19
19
|
react_1.default.createElement(Typography_1.TextHeader, null, title)));
|
|
20
20
|
}
|
|
21
|
-
else if (!
|
|
21
|
+
else if (!title && children) {
|
|
22
22
|
return children;
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
const rightSide = () => {
|
|
26
|
-
if (
|
|
27
|
-
return react_1.default.createElement(Icons_1.Icon, { onClick: () => handleClose(), name: "close", color: Theme_1.Theme.colors.text });
|
|
26
|
+
if (handleClose) {
|
|
27
|
+
return (react_1.default.createElement(Icons_1.Icon, { onClick: () => handleClose(), name: "close", color: Theme_1.Theme.colors.text }));
|
|
28
28
|
}
|
|
29
|
-
else if (!
|
|
29
|
+
else if (!handleClose && handleClick && actionLabel) {
|
|
30
30
|
return (react_1.default.createElement(Aligment_1.Aligment, { align: "center", width: "auto" },
|
|
31
31
|
react_1.default.createElement(Button_1.Button, { mode: "secondary", text: actionLabel, onClick: () => handleClick() }),
|
|
32
|
-
|
|
32
|
+
options && (react_1.default.createElement(DropdownMenu_1.DropdownMenu, { options: options, right: true, color: iconColor, iconHoverColor: iconHoverColor, iconInverseMode: true }))));
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
|
-
return (react_1.default.createElement(Aligment_1.Aligment, { justify: !
|
|
35
|
+
return (react_1.default.createElement(Aligment_1.Aligment, { justify: !title && !children ? 'flex-end' : 'space-between', vPadding: Theme_1.Theme.padding.m, hPadding: Theme_1.Theme.padding.l, backgroundColor: backgroundColor },
|
|
36
36
|
react_1.default.createElement(react_1.default.Fragment, null,
|
|
37
37
|
leftSide(),
|
|
38
38
|
rightSide())));
|
|
@@ -36,4 +36,5 @@ exports.iconsPath = {
|
|
|
36
36
|
upgrade: "M8.6 22.5L6.7 19.3L3.1 18.5L3.45 14.8L1 12L3.45 9.2L3.1 5.5L6.7 4.7L8.6 1.5L12 2.95L15.4 1.5L17.3 4.7L20.9 5.5L20.55 9.2L23 12L20.55 14.8L20.9 18.5L17.3 19.3L15.4 22.5L12 21.05L8.6 22.5ZM9.45 19.95L12 18.85L14.6 19.95L16 17.55L18.75 16.9L18.5 14.1L20.35 12L18.5 9.85L18.75 7.05L16 6.45L14.55 4.05L12 5.15L9.4 4.05L8 6.45L5.25 7.05L5.5 9.85L3.65 12L5.5 14.1L5.25 16.95L8 17.55L9.45 19.95ZM10.95 15.55L16.6 9.9L15.2 8.45L10.95 12.7L8.8 10.6L7.4 12L10.95 15.55Z",
|
|
37
37
|
visibility: "M12 16q1.875 0 3.188-1.312Q16.5 13.375 16.5 11.5q0-1.875-1.312-3.188Q13.875 7 12 7q-1.875 0-3.188 1.312Q7.5 9.625 7.5 11.5q0 1.875 1.312 3.188Q10.125 16 12 16Zm0-1.8q-1.125 0-1.912-.788Q9.3 12.625 9.3 11.5t.788-1.913Q10.875 8.8 12 8.8t1.913.787q.787.788.787 1.913t-.787 1.912q-.788.788-1.913.788Zm0 4.8q-3.65 0-6.65-2.038-3-2.037-4.35-5.462 1.35-3.425 4.35-5.463Q8.35 4 12 4q3.65 0 6.65 2.037 3 2.038 4.35 5.463-1.35 3.425-4.35 5.462Q15.65 19 12 19Zm0-7.5Zm0 5.5q2.825 0 5.188-1.488Q19.55 14.025 20.8 11.5q-1.25-2.525-3.612-4.013Q14.825 6 12 6 9.175 6 6.812 7.487 4.45 8.975 3.2 11.5q1.25 2.525 3.612 4.012Q9.175 17 12 17Z",
|
|
38
38
|
visability_off: "M16.1 13.3L14.65 11.85C14.8 11.0667 14.575 10.3333 13.975 9.65C13.375 8.96667 12.6 8.7 11.65 8.85L10.2 7.4C10.4833 7.26667 10.7708 7.16667 11.0625 7.1C11.3542 7.03333 11.6667 7 12 7C13.25 7 14.3125 7.4375 15.1875 8.3125C16.0625 9.1875 16.5 10.25 16.5 11.5C16.5 11.8333 16.4667 12.1458 16.4 12.4375C16.3333 12.7292 16.2333 13.0167 16.1 13.3ZM19.3 16.45L17.85 15.05C18.4833 14.5667 19.0458 14.0375 19.5375 13.4625C20.0292 12.8875 20.45 12.2333 20.8 11.5C19.9667 9.81667 18.7708 8.47917 17.2125 7.4875C15.6542 6.49583 13.9167 6 12 6C11.5167 6 11.0417 6.03333 10.575 6.1C10.1083 6.16667 9.65 6.26667 9.2 6.4L7.65 4.85C8.33333 4.56667 9.03333 4.35417 9.75 4.2125C10.4667 4.07083 11.2167 4 12 4C14.5167 4 16.7583 4.69583 18.725 6.0875C20.6917 7.47917 22.1167 9.28333 23 11.5C22.6167 12.4833 22.1125 13.3958 21.4875 14.2375C20.8625 15.0792 20.1333 15.8167 19.3 16.45ZM19.8 22.6L15.6 18.45C15.0167 18.6333 14.4292 18.7708 13.8375 18.8625C13.2458 18.9542 12.6333 19 12 19C9.48333 19 7.24167 18.3042 5.275 16.9125C3.30833 15.5208 1.88333 13.7167 1 11.5C1.35 10.6167 1.79167 9.79583 2.325 9.0375C2.85833 8.27917 3.46667 7.6 4.15 7L1.4 4.2L2.8 2.8L21.2 21.2L19.8 22.6ZM5.55 8.4C5.06667 8.83333 4.625 9.30833 4.225 9.825C3.825 10.3417 3.48333 10.9 3.2 11.5C4.03333 13.1833 5.22917 14.5208 6.7875 15.5125C8.34583 16.5042 10.0833 17 12 17C12.3333 17 12.6583 16.9792 12.975 16.9375C13.2917 16.8958 13.6167 16.85 13.95 16.8L13.05 15.85C12.8667 15.9 12.6917 15.9375 12.525 15.9625C12.3583 15.9875 12.1833 16 12 16C10.75 16 9.6875 15.5625 8.8125 14.6875C7.9375 13.8125 7.5 12.75 7.5 11.5C7.5 11.3167 7.5125 11.1417 7.5375 10.975C7.5625 10.8083 7.6 10.6333 7.65 10.45L5.55 8.4Z",
|
|
39
|
+
warning: "M0 19L11 0L22 19H0ZM3.45 17H18.55L11 4L3.45 17ZM11 16C11.2833 16 11.5208 15.9042 11.7125 15.7125C11.9042 15.5208 12 15.2833 12 15C12 14.7167 11.9042 14.4792 11.7125 14.2875C11.5208 14.0958 11.2833 14 11 14C10.7167 14 10.4792 14.0958 10.2875 14.2875C10.0958 14.4792 10 14.7167 10 15C10 15.2833 10.0958 15.5208 10.2875 15.7125C10.4792 15.9042 10.7167 16 11 16ZM10 13H12V8H10V13Z"
|
|
39
40
|
};
|
|
@@ -30,10 +30,15 @@ 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, width, error, placeholder, min, max, step, theme = Theme_1.mainTheme, }) => {
|
|
33
|
+
const Input = ({ label, labelPosition = 'top', value, type = 'text', name, disabled = false, size = 'medium', handleChange, handleSubmit, width, error, placeholder, min, max, step, autoFocus, theme = Theme_1.mainTheme, }) => {
|
|
34
34
|
const onChange = (e) => {
|
|
35
35
|
handleChange(name, e.target.value);
|
|
36
36
|
};
|
|
37
|
+
const onKeyDown = (e) => {
|
|
38
|
+
if (handleSubmit && e.key === 'Enter') {
|
|
39
|
+
handleSubmit();
|
|
40
|
+
}
|
|
41
|
+
};
|
|
37
42
|
const [inputType] = (0, react_1.useState)(type);
|
|
38
43
|
const [showPassword, setShowPassword] = (0, react_1.useState)(false);
|
|
39
44
|
const tooglePassword = () => {
|
|
@@ -43,7 +48,7 @@ const Input = ({ label, labelPosition = 'top', value, type = 'text', name, disab
|
|
|
43
48
|
react_1.default.createElement(Aligment_1.Aligment, { align: labelPosition === 'top' ? 'flex-start' : 'center', direction: labelPosition === 'top' ? 'column' : 'row', wrap: 'nowrap' },
|
|
44
49
|
label && (react_1.default.createElement(Input_styles_1.InputLabelElement, { size: size, labelPosition: labelPosition }, label)),
|
|
45
50
|
react_1.default.createElement(Input_styles_1.InputWrapper, { width: width },
|
|
46
|
-
react_1.default.createElement(Input_styles_1.InputTextElement, { inputSize: size, type: showPassword ? 'text' : inputType, disabled: disabled, name: name, value: value, onChange: onChange, error: error, placeholder: placeholder, min: min, max: max, step: step }),
|
|
51
|
+
react_1.default.createElement(Input_styles_1.InputTextElement, { autoFocus: autoFocus, inputSize: size, type: showPassword ? 'text' : inputType, disabled: disabled, name: name, value: value, onChange: onChange, onKeyDown: onKeyDown, error: error, placeholder: placeholder, min: min, max: max, step: step }),
|
|
47
52
|
inputType === 'password' && (react_1.default.createElement(Input_styles_1.EyeIconWrapper, { size: size },
|
|
48
53
|
react_1.default.createElement(Icons_1.Icon, { name: showPassword ? 'visability_off' : 'visibility', size: 24, onClick: tooglePassword, color: theme.inputDefaultTextColor, inverseMode: true }))),
|
|
49
54
|
error && react_1.default.createElement(Input_styles_1.InputErrorMsg, null, error)))));
|
|
@@ -8,7 +8,7 @@ const react_1 = __importDefault(require("react"));
|
|
|
8
8
|
const Theme_1 = require("../../Theme");
|
|
9
9
|
const Aligment_1 = require("../Aligment");
|
|
10
10
|
const Loader_styles_1 = require("./Loader.styles");
|
|
11
|
-
const Loader = ({
|
|
11
|
+
const Loader = ({ theme = Theme_1.mainTheme, color = theme.action, size = 'medium', }) => {
|
|
12
12
|
return (react_1.default.createElement(Aligment_1.Aligment, { justify: 'center', align: 'center' },
|
|
13
13
|
react_1.default.createElement(Loader_styles_1.LoaderElement, { size: size },
|
|
14
14
|
react_1.default.createElement(Loader_styles_1.LoaderItem, { color: color, size: size }),
|
|
@@ -11,7 +11,7 @@ const common_1 = require("../common");
|
|
|
11
11
|
const Modal_styles_1 = require("./Modal.styles");
|
|
12
12
|
const styled_components_1 = require("styled-components");
|
|
13
13
|
const ButtonsFooter_1 = require("../ButtonsFooter");
|
|
14
|
-
const Modal = ({ theme = Theme_1.mainTheme, children, title, handleConfirm, handleClose, handleAdditional, labelConfirm, labelClose, labelAdditional, submitDisabled, size = 'small', submitLoader = false, }) => {
|
|
14
|
+
const Modal = ({ theme = Theme_1.mainTheme, children, title, handleConfirm, handleClose, handleAdditional, labelConfirm = 'Save', labelClose = 'Cancel', labelAdditional = 'Reset', submitDisabled, size = 'small', submitLoader = false, }) => {
|
|
15
15
|
return (react_1.default.createElement(styled_components_1.ThemeProvider, { theme: theme },
|
|
16
16
|
react_1.default.createElement(Modal_styles_1.ModalOverlayer, null,
|
|
17
17
|
react_1.default.createElement(Modal_styles_1.ModalElement, { size: size },
|
|
@@ -8,7 +8,7 @@ const Typography_1 = require("../Typography");
|
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const Section_styles_1 = require("./Section.styles");
|
|
10
10
|
const Theme_1 = require("../../Theme");
|
|
11
|
-
const Section = ({ title, children, titlePosition = "left", noPadding = false,
|
|
11
|
+
const Section = ({ title, children, titlePosition = "left", noPadding = false, theme = Theme_1.mainTheme, backgroundColor = theme.contentBackground, }) => {
|
|
12
12
|
return (react_1.default.createElement(Section_styles_1.SectionElement, { backgroundColor: backgroundColor },
|
|
13
13
|
title && (react_1.default.createElement(Section_styles_1.SectionTitle, { titlePosition: titlePosition, noPadding: noPadding },
|
|
14
14
|
react_1.default.createElement(Typography_1.TextSubHeader, null, title))),
|
|
@@ -34,9 +34,7 @@ const Sidepanel = ({ isOpen, handleClose, children, right = false, overlayer = t
|
|
|
34
34
|
const ref = (0, react_1.useRef)(null);
|
|
35
35
|
(0, react_1.useEffect)(() => {
|
|
36
36
|
const handleClickOutside = (event) => {
|
|
37
|
-
console.log('click:', isOpen);
|
|
38
37
|
if (ref.current && !ref.current.contains(event.target)) {
|
|
39
|
-
console.log('fire:', isOpen);
|
|
40
38
|
handleClose && handleClose();
|
|
41
39
|
}
|
|
42
40
|
};
|
|
@@ -49,7 +47,7 @@ const Sidepanel = ({ isOpen, handleClose, children, right = false, overlayer = t
|
|
|
49
47
|
if (isOpen) {
|
|
50
48
|
return ReactDOM.createPortal(react_1.default.createElement(react_1.default.Fragment, null,
|
|
51
49
|
react_1.default.createElement(Sidepanel_styles_1.SidepanelElement, { right: right, top: top, ref: ref },
|
|
52
|
-
react_1.default.createElement(ElementHeader_1.ElementHeader, { handleClose: handleClose
|
|
50
|
+
react_1.default.createElement(ElementHeader_1.ElementHeader, { handleClose: handleClose }, iconOptions &&
|
|
53
51
|
iconOptions.map((icon) => (react_1.default.createElement(Icons_1.Icon, { name: icon.iconName, onClick: icon.action, key: icon.iconName })))),
|
|
54
52
|
children),
|
|
55
53
|
overlayer && react_1.default.createElement(Modal_styles_1.ModalOverlayer, { onClick: handleClose })), modalRoot);
|
|
@@ -8,9 +8,9 @@ const ElementHeader_1 = require("../ElementHeader");
|
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const Tile_styles_1 = require("./Tile.styles");
|
|
10
10
|
const Theme_1 = require("../../Theme");
|
|
11
|
-
const Tile = ({ size = 'small', shadow = true, title, children,
|
|
11
|
+
const Tile = ({ size = 'small', shadow = true, title, children, theme = Theme_1.mainTheme, backgroundColor = theme.contentBackground, height = 'auto', }) => {
|
|
12
12
|
return (react_1.default.createElement(Tile_styles_1.TileElement, { size: size, shadow: shadow, backgroundColor: backgroundColor, height: height },
|
|
13
|
-
title && react_1.default.createElement(ElementHeader_1.ElementHeader, { title: title,
|
|
13
|
+
title && (react_1.default.createElement(ElementHeader_1.ElementHeader, { title: title, backgroundColor: backgroundColor })),
|
|
14
14
|
children));
|
|
15
15
|
};
|
|
16
16
|
exports.Tile = Tile;
|
|
@@ -24,22 +24,22 @@ exports.Panel = styled_components_1.default.div `
|
|
|
24
24
|
padding: ${Theme_1.Theme.padding.m} 0;
|
|
25
25
|
border-radius: ${Theme_1.Theme.borderRadius.m};
|
|
26
26
|
height: ${(p) => (p.height ? p.height : 'auto')};
|
|
27
|
-
width: ${p => p.fullWidth ? '100%' : 'auto'};
|
|
27
|
+
width: ${(p) => (p.fullWidth ? '100%' : 'auto')};
|
|
28
28
|
position: absolute;
|
|
29
29
|
z-index: ${Theme_1.Theme.zIndex.dropdown};
|
|
30
30
|
top: ${(p) => (0, inputStyles_1.setPanelTop)(p.size)};
|
|
31
31
|
border: 1px solid ${Theme_1.Theme.colors.gray_2};
|
|
32
32
|
border-top: none;
|
|
33
|
-
|
|
33
|
+
min-width: 30px;
|
|
34
|
+
${(p) => (0, inputStyles_1.setPanelPosition)(p.position)}
|
|
34
35
|
`;
|
|
35
36
|
exports.PanelOption = styled_components_1.default.div `
|
|
36
37
|
padding: ${Theme_1.Theme.padding.s} ${Theme_1.Theme.padding.m};
|
|
37
38
|
cursor: pointer;
|
|
38
39
|
white-space: nowrap;
|
|
39
40
|
color: ${(p) => (p.active ? Theme_1.Theme.colors.primary : Theme_1.Theme.colors.text)};
|
|
40
|
-
|
|
41
41
|
:hover {
|
|
42
42
|
background-color: ${(0, polished_1.lighten)(0.4, Theme_1.Theme.colors.primary)};
|
|
43
43
|
}
|
|
44
|
-
${p => p.width && `width:${p.width};`}
|
|
44
|
+
${(p) => p.width && `width:${p.width};`}
|
|
45
45
|
`;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.Overview = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const Input_1 = require("../components/Input");
|
|
29
|
+
const example_1 = require("../example");
|
|
30
|
+
const Button_1 = require("../components/Button");
|
|
31
|
+
const Dropdown_1 = require("../components/Dropdown");
|
|
32
|
+
const Selector_1 = require("../components/Selector");
|
|
33
|
+
const DropdownMenu_1 = require("../components/DropdownMenu");
|
|
34
|
+
const Aligment_1 = require("../components/Aligment");
|
|
35
|
+
const Overview = ({ sectionName, size, labelPosition, }) => {
|
|
36
|
+
const [data, setData] = (0, react_1.useState)({
|
|
37
|
+
input: 'my text',
|
|
38
|
+
dropdown: '',
|
|
39
|
+
selector1: 'test_01',
|
|
40
|
+
selector2: '',
|
|
41
|
+
});
|
|
42
|
+
const onChange = (name, value) => {
|
|
43
|
+
setData({
|
|
44
|
+
...data,
|
|
45
|
+
[name]: value,
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
const onClick = () => {
|
|
49
|
+
alert('button click');
|
|
50
|
+
};
|
|
51
|
+
const handleClear1 = () => {
|
|
52
|
+
setData({
|
|
53
|
+
...data,
|
|
54
|
+
selector1: '',
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
const handleClear2 = () => {
|
|
58
|
+
setData({
|
|
59
|
+
...data,
|
|
60
|
+
selector2: '',
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
return (react_1.default.createElement(Aligment_1.Aligment, { gap: 20, direction: 'column', align: 'stretch', justify: 'space-between' },
|
|
64
|
+
react_1.default.createElement(example_1.ExampleAreaTitle, null, sectionName),
|
|
65
|
+
react_1.default.createElement(example_1.ExampleArea, null,
|
|
66
|
+
react_1.default.createElement(example_1.ExampleItem, null,
|
|
67
|
+
react_1.default.createElement(Input_1.Input, { value: data.input, size: size, label: "Input", name: "input", handleChange: onChange, labelPosition: labelPosition })),
|
|
68
|
+
react_1.default.createElement(example_1.ExampleItem, null,
|
|
69
|
+
react_1.default.createElement(Button_1.Button, { size: size, text: "Button", onClick: onClick })),
|
|
70
|
+
react_1.default.createElement(example_1.ExampleItem, null,
|
|
71
|
+
react_1.default.createElement(Dropdown_1.Dropdown, { size: size, label: "Dropdown", labelPosition: labelPosition, handleSelect: onChange, name: "dropdown", value: data.dropdown, options: [
|
|
72
|
+
{ value: 'test_01', label: 'test 01' },
|
|
73
|
+
{ value: 'test_02', label: 'test 02' },
|
|
74
|
+
] })),
|
|
75
|
+
react_1.default.createElement(example_1.ExampleItem, null,
|
|
76
|
+
react_1.default.createElement(Selector_1.Selector, { labelPosition: labelPosition, size: size, label: "Selected selector", value: data.selector1, handleSelect: onChange, handleClear: handleClear1, name: "selector1", options: [
|
|
77
|
+
{ value: 'test_01', label: 'test 01' },
|
|
78
|
+
{ value: 'test_02', label: 'test 02' },
|
|
79
|
+
] })),
|
|
80
|
+
react_1.default.createElement(example_1.ExampleItem, null,
|
|
81
|
+
react_1.default.createElement(Selector_1.Selector, { handleSelect: onChange, handleClear: handleClear2, name: "selector2", value: data.selector2, labelPosition: labelPosition, size: size, label: "Selector", options: [
|
|
82
|
+
{ value: 'test_01', label: 'test 01' },
|
|
83
|
+
{ value: 'test_02', label: 'test 02' },
|
|
84
|
+
] })),
|
|
85
|
+
react_1.default.createElement(example_1.ExampleItem, null,
|
|
86
|
+
react_1.default.createElement(DropdownMenu_1.DropdownMenu, { size: size, options: [
|
|
87
|
+
{ action: () => alert('action one'), label: 'action one' },
|
|
88
|
+
{ action: () => alert('action two'), label: 'action two' },
|
|
89
|
+
] })))));
|
|
90
|
+
};
|
|
91
|
+
exports.Overview = Overview;
|
|
@@ -16,8 +16,10 @@ exports.ExmpleBlock = styled_components_1.default.div `
|
|
|
16
16
|
font-size: ${Theme_1.Theme.fontSize.xl};
|
|
17
17
|
`;
|
|
18
18
|
exports.ExmpleBlockWrapper = styled_components_1.default.div `
|
|
19
|
-
background-color: ${(p) => (p.color ? p.color : '#
|
|
19
|
+
background-color: ${(p) => (p.color ? p.color : '#ffffff')};
|
|
20
20
|
border-radius: ${Theme_1.Theme.borderRadius.m};
|
|
21
|
+
box-sizing:border-box;
|
|
22
|
+
border:1px solid #dddddd;
|
|
21
23
|
`;
|
|
22
24
|
exports.ExampleTable = styled_components_1.default.table `
|
|
23
25
|
width: 100%;
|
|
@@ -46,7 +48,6 @@ exports.ExampleArea = styled_components_1.default.div `
|
|
|
46
48
|
display: flex;
|
|
47
49
|
margin-bottom: 20px;
|
|
48
50
|
padding-bottom: 20px;
|
|
49
|
-
border-bottom: 1px solid #cbcbcb;
|
|
50
51
|
align-items: flex-end;
|
|
51
52
|
gap: 10px;
|
|
52
53
|
`;
|
package/dist/esm/Theme/Theme.js
CHANGED
|
@@ -99,5 +99,6 @@ export const mainTheme = {
|
|
|
99
99
|
tableMoreIconColor: Theme.colors.primary,
|
|
100
100
|
// chips
|
|
101
101
|
chipsNeutralBackground: Theme.colors.primary,
|
|
102
|
-
chipsNeutralTextColor: Theme.colors.white
|
|
102
|
+
chipsNeutralTextColor: Theme.colors.white,
|
|
103
|
+
chipsNeutralHoverBackground: lighten(0.1, Theme.colors.primary),
|
|
103
104
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import styled from
|
|
1
|
+
import styled from 'styled-components';
|
|
2
2
|
export const Aligment = styled.div `
|
|
3
|
+
align-items: ${(p) => (p.align ? p.align : 'center')};
|
|
4
|
+
background-color: ${(p) => p.backgroundColor ? p.backgroundColor : 'transparent'};
|
|
3
5
|
box-sizing: border-box;
|
|
4
6
|
display: flex;
|
|
5
|
-
|
|
6
|
-
flex-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
gap: ${p => p.gap ? p.gap + 'px' : '0px'};
|
|
7
|
+
flex-direction: ${(p) => (p.direction ? p.direction : 'row')};
|
|
8
|
+
flex-wrap: ${(p) => (p.wrap ? p.wrap : 'wrap')};
|
|
9
|
+
gap: ${(p) => (p.gap ? p.gap + 'px' : '0px')};
|
|
10
|
+
justify-content: ${(p) => (p.justify ? p.justify : 'space-between')};
|
|
11
|
+
padding: ${(p) => (p.vPadding ? p.vPadding : '0')}
|
|
12
|
+
${(p) => (p.hPadding ? p.hPadding : '0')};
|
|
13
|
+
width: ${(p) => (p.width ? p.width : '100%')};
|
|
13
14
|
`;
|
|
@@ -3,11 +3,11 @@ import { ThemeProvider } from 'styled-components';
|
|
|
3
3
|
import { mainTheme } from '../../Theme';
|
|
4
4
|
import { ButtonElement, ButtonLoader } from './Button.styles';
|
|
5
5
|
import { Loader } from '../Loader';
|
|
6
|
-
export const Button = ({ text, mode = 'primary', size = 'medium', right = false, left = false, theme = mainTheme, disabled = false, onClick, loader = false, }) => {
|
|
6
|
+
export const Button = ({ text = 'Click me', mode = 'primary', size = 'medium', right = false, left = false, theme = mainTheme, disabled = false, onClick, loader = false, }) => {
|
|
7
7
|
const handleClick = () => {
|
|
8
|
-
!disabled && onClick();
|
|
8
|
+
(!disabled && !loader) && onClick();
|
|
9
9
|
};
|
|
10
10
|
return (React.createElement(ThemeProvider, { theme: theme },
|
|
11
11
|
React.createElement(ButtonElement, { mode: mode, size: size, right: right, left: left, disabled: disabled, onClick: handleClick, loader: loader }, loader ? (React.createElement(ButtonLoader, { size: size },
|
|
12
|
-
React.createElement(Loader, { size: "small", color: mode === 'primary' ?
|
|
12
|
+
React.createElement(Loader, { size: "small", color: mode === 'primary' ? theme.buttonText : theme.action }))) : (text))));
|
|
13
13
|
};
|
|
@@ -2,24 +2,23 @@ import { setButtonLoaderSize, setButtonSize } from '../common';
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { Theme } from '../../Theme/Theme';
|
|
4
4
|
export const ButtonElement = styled.button `
|
|
5
|
-
|
|
5
|
+
align-items: center;
|
|
6
6
|
border-radius: ${Theme.borderRadius.s};
|
|
7
|
-
overflow: hidden;
|
|
8
|
-
cursor: pointer;
|
|
9
7
|
box-sizing: border-box;
|
|
10
|
-
|
|
11
|
-
margin-right: ${(p) => (p.left ? Theme.padding.m : '0')};
|
|
8
|
+
cursor: pointer;
|
|
12
9
|
display: flex;
|
|
13
|
-
|
|
10
|
+
flex-shrink: 1;
|
|
14
11
|
justify-content: center;
|
|
15
|
-
|
|
12
|
+
margin-left: ${(p) => (p.right ? Theme.padding.m : '0')};
|
|
13
|
+
margin-right: ${(p) => (p.left ? Theme.padding.m : '0')};
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
transition: 300ms;
|
|
16
16
|
white-space: nowrap;
|
|
17
|
-
flex-shrink: 1;
|
|
18
17
|
|
|
19
18
|
${(p) => p.mode === 'primary' &&
|
|
20
19
|
`background-color: ${p.theme.action};
|
|
21
|
-
color: ${p.theme.buttonText};
|
|
22
20
|
border: 1px solid rgba(0,0,0,0.15);
|
|
21
|
+
color: ${p.theme.buttonText};
|
|
23
22
|
&:disabled{
|
|
24
23
|
color: ${p.theme.disabledText};
|
|
25
24
|
background-color: ${p.theme.disabledBackground};
|
|
@@ -27,8 +26,8 @@ export const ButtonElement = styled.button `
|
|
|
27
26
|
`}
|
|
28
27
|
${(p) => p.mode === 'secondary' &&
|
|
29
28
|
`background-color: transparent;
|
|
30
|
-
color: ${p.theme.action};
|
|
31
29
|
border: 1px solid ${p.theme.action};
|
|
30
|
+
color: ${p.theme.action};
|
|
32
31
|
&:disabled{
|
|
33
32
|
color: ${p.theme.disabledText};
|
|
34
33
|
border: 1px solid ${p.theme.disabledText};
|
|
@@ -36,8 +35,8 @@ export const ButtonElement = styled.button `
|
|
|
36
35
|
`}
|
|
37
36
|
${(p) => p.mode === 'inverse' &&
|
|
38
37
|
`background-color:transparent;
|
|
39
|
-
color: ${p.theme.action};
|
|
40
38
|
border:none;
|
|
39
|
+
color: ${p.theme.action};
|
|
41
40
|
&:disabled{
|
|
42
41
|
color: ${p.theme.disabledText};
|
|
43
42
|
}
|
|
@@ -69,8 +68,7 @@ export const ButtonElement = styled.button `
|
|
|
69
68
|
}
|
|
70
69
|
`;
|
|
71
70
|
export const ButtonLoader = styled.div `
|
|
72
|
-
display:flex;
|
|
73
|
-
box-sizing:border-box;
|
|
71
|
+
display: flex;
|
|
72
|
+
box-sizing: border-box;
|
|
74
73
|
${(p) => setButtonLoaderSize(p.size)}
|
|
75
|
-
|
|
76
74
|
`;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { Theme } from '../../Theme/Theme';
|
|
3
|
+
import { Button } from '../Button';
|
|
3
4
|
import { Aligment } from '../Aligment';
|
|
4
|
-
import React from 'react';
|
|
5
5
|
import { ButtonsFooterGroup } from './ButtonsFooter.style';
|
|
6
|
-
export const ButtonsFooter = ({ handleConfirm, handleClose, handleAdditional, labelConfirm, labelClose, labelAdditional, submitDisabled, submitLoader, }) => {
|
|
6
|
+
export const ButtonsFooter = ({ handleConfirm, handleClose, handleAdditional, labelConfirm = 'Confirm', labelClose = "Close", labelAdditional = "Reset", submitDisabled, submitLoader, backgroundColor = 'transparent' }) => {
|
|
7
7
|
const isAdditional = () => {
|
|
8
8
|
return labelAdditional !== undefined && handleAdditional !== undefined;
|
|
9
9
|
};
|
|
10
10
|
const isMultiButtons = () => {
|
|
11
11
|
return handleConfirm !== undefined && labelConfirm !== undefined;
|
|
12
12
|
};
|
|
13
|
-
return (React.createElement(Aligment, { justify: isAdditional() ? 'space-between' : 'flex-end', vPadding: Theme.padding.l, hPadding: Theme.padding.l },
|
|
13
|
+
return (React.createElement(Aligment, { justify: isAdditional() ? 'space-between' : 'flex-end', vPadding: Theme.padding.l, hPadding: Theme.padding.l, backgroundColor: backgroundColor },
|
|
14
14
|
labelAdditional && handleAdditional && (React.createElement(ButtonsFooterGroup, null, !submitLoader && (React.createElement(Button, { mode: 'inverse', onClick: () => handleAdditional(), text: labelAdditional, left: isMultiButtons() })))),
|
|
15
15
|
React.createElement(ButtonsFooterGroup, null,
|
|
16
16
|
!submitLoader && (React.createElement(Button, { mode: isMultiButtons() ? 'secondary' : 'primary', onClick: () => handleClose(), text: labelClose, left: isMultiButtons() })),
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CardContent, CardElement } from './Card.styles';
|
|
3
3
|
import { ElementHeader } from '../ElementHeader';
|
|
4
|
-
|
|
4
|
+
import { mainTheme } from '../../Theme';
|
|
5
|
+
export const Card = ({ children, title, actionLabel, theme = mainTheme, iconColor = theme.textColor, iconHoverColor = theme.action, handleClick, handleBack, height, options, }) => {
|
|
5
6
|
return (React.createElement(CardElement, { height: height },
|
|
6
|
-
(title || actionLabel) && (React.createElement(ElementHeader, { title: title, actionLabel: actionLabel, handleClick: handleClick, handleBack: handleBack,
|
|
7
|
+
(title || actionLabel) && (React.createElement(ElementHeader, { title: title, actionLabel: actionLabel, handleClick: handleClick, handleBack: handleBack, options: options, theme: theme, iconColor: iconColor, iconHoverColor: iconHoverColor })),
|
|
7
8
|
React.createElement(CardContent, { soloMode: !title && !actionLabel }, children)));
|
|
8
9
|
};
|
|
@@ -9,6 +9,9 @@ export const ChipsElement = styled.div `
|
|
|
9
9
|
width:auto;
|
|
10
10
|
box-sizing: border-box;
|
|
11
11
|
border-radius:30px;
|
|
12
|
+
&:hover{
|
|
13
|
+
background-color:${p => p.theme.chipsNeutralHoverBackground};
|
|
14
|
+
}
|
|
12
15
|
`;
|
|
13
16
|
export const ChipsLabel = styled.div `
|
|
14
17
|
font-size:${Theme.fontSize.s}
|
|
@@ -2,31 +2,31 @@ import React from 'react';
|
|
|
2
2
|
import { Icon } from '../Icons';
|
|
3
3
|
import { Aligment } from '../Aligment';
|
|
4
4
|
import { TextHeader } from '../Typography';
|
|
5
|
-
import { Theme } from '../../Theme';
|
|
5
|
+
import { Theme, mainTheme } from '../../Theme';
|
|
6
6
|
import { Button } from '../Button';
|
|
7
7
|
import { DropdownMenu } from '../DropdownMenu';
|
|
8
|
-
export const ElementHeader = ({ title,
|
|
8
|
+
export const ElementHeader = ({ title, actionLabel = '', handleClose, handleClick, handleBack, children, theme = mainTheme, backgroundColor = theme.contentBackground, iconColor = theme.textColor, iconHoverColor = theme.action, options, }) => {
|
|
9
9
|
const leftSide = () => {
|
|
10
|
-
if (
|
|
11
|
-
return (React.createElement(Aligment, { align:
|
|
12
|
-
|
|
10
|
+
if (title) {
|
|
11
|
+
return (React.createElement(Aligment, { align: "center", direction: "row", width: "auto" },
|
|
12
|
+
handleBack && (React.createElement(Icon, { name: "back_arrow", onClick: () => handleBack(), left: true })),
|
|
13
13
|
React.createElement(TextHeader, null, title)));
|
|
14
14
|
}
|
|
15
|
-
else if (!
|
|
15
|
+
else if (!title && children) {
|
|
16
16
|
return children;
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
const rightSide = () => {
|
|
20
|
-
if (
|
|
21
|
-
return React.createElement(Icon, { onClick: () => handleClose(), name: "close", color: Theme.colors.text });
|
|
20
|
+
if (handleClose) {
|
|
21
|
+
return (React.createElement(Icon, { onClick: () => handleClose(), name: "close", color: Theme.colors.text }));
|
|
22
22
|
}
|
|
23
|
-
else if (!
|
|
23
|
+
else if (!handleClose && handleClick && actionLabel) {
|
|
24
24
|
return (React.createElement(Aligment, { align: "center", width: "auto" },
|
|
25
25
|
React.createElement(Button, { mode: "secondary", text: actionLabel, onClick: () => handleClick() }),
|
|
26
|
-
|
|
26
|
+
options && (React.createElement(DropdownMenu, { options: options, right: true, color: iconColor, iconHoverColor: iconHoverColor, iconInverseMode: true }))));
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
|
-
return (React.createElement(Aligment, { justify: !
|
|
29
|
+
return (React.createElement(Aligment, { justify: !title && !children ? 'flex-end' : 'space-between', vPadding: Theme.padding.m, hPadding: Theme.padding.l, backgroundColor: backgroundColor },
|
|
30
30
|
React.createElement(React.Fragment, null,
|
|
31
31
|
leftSide(),
|
|
32
32
|
rightSide())));
|
|
@@ -33,4 +33,5 @@ export const iconsPath = {
|
|
|
33
33
|
upgrade: "M8.6 22.5L6.7 19.3L3.1 18.5L3.45 14.8L1 12L3.45 9.2L3.1 5.5L6.7 4.7L8.6 1.5L12 2.95L15.4 1.5L17.3 4.7L20.9 5.5L20.55 9.2L23 12L20.55 14.8L20.9 18.5L17.3 19.3L15.4 22.5L12 21.05L8.6 22.5ZM9.45 19.95L12 18.85L14.6 19.95L16 17.55L18.75 16.9L18.5 14.1L20.35 12L18.5 9.85L18.75 7.05L16 6.45L14.55 4.05L12 5.15L9.4 4.05L8 6.45L5.25 7.05L5.5 9.85L3.65 12L5.5 14.1L5.25 16.95L8 17.55L9.45 19.95ZM10.95 15.55L16.6 9.9L15.2 8.45L10.95 12.7L8.8 10.6L7.4 12L10.95 15.55Z",
|
|
34
34
|
visibility: "M12 16q1.875 0 3.188-1.312Q16.5 13.375 16.5 11.5q0-1.875-1.312-3.188Q13.875 7 12 7q-1.875 0-3.188 1.312Q7.5 9.625 7.5 11.5q0 1.875 1.312 3.188Q10.125 16 12 16Zm0-1.8q-1.125 0-1.912-.788Q9.3 12.625 9.3 11.5t.788-1.913Q10.875 8.8 12 8.8t1.913.787q.787.788.787 1.913t-.787 1.912q-.788.788-1.913.788Zm0 4.8q-3.65 0-6.65-2.038-3-2.037-4.35-5.462 1.35-3.425 4.35-5.463Q8.35 4 12 4q3.65 0 6.65 2.037 3 2.038 4.35 5.463-1.35 3.425-4.35 5.462Q15.65 19 12 19Zm0-7.5Zm0 5.5q2.825 0 5.188-1.488Q19.55 14.025 20.8 11.5q-1.25-2.525-3.612-4.013Q14.825 6 12 6 9.175 6 6.812 7.487 4.45 8.975 3.2 11.5q1.25 2.525 3.612 4.012Q9.175 17 12 17Z",
|
|
35
35
|
visability_off: "M16.1 13.3L14.65 11.85C14.8 11.0667 14.575 10.3333 13.975 9.65C13.375 8.96667 12.6 8.7 11.65 8.85L10.2 7.4C10.4833 7.26667 10.7708 7.16667 11.0625 7.1C11.3542 7.03333 11.6667 7 12 7C13.25 7 14.3125 7.4375 15.1875 8.3125C16.0625 9.1875 16.5 10.25 16.5 11.5C16.5 11.8333 16.4667 12.1458 16.4 12.4375C16.3333 12.7292 16.2333 13.0167 16.1 13.3ZM19.3 16.45L17.85 15.05C18.4833 14.5667 19.0458 14.0375 19.5375 13.4625C20.0292 12.8875 20.45 12.2333 20.8 11.5C19.9667 9.81667 18.7708 8.47917 17.2125 7.4875C15.6542 6.49583 13.9167 6 12 6C11.5167 6 11.0417 6.03333 10.575 6.1C10.1083 6.16667 9.65 6.26667 9.2 6.4L7.65 4.85C8.33333 4.56667 9.03333 4.35417 9.75 4.2125C10.4667 4.07083 11.2167 4 12 4C14.5167 4 16.7583 4.69583 18.725 6.0875C20.6917 7.47917 22.1167 9.28333 23 11.5C22.6167 12.4833 22.1125 13.3958 21.4875 14.2375C20.8625 15.0792 20.1333 15.8167 19.3 16.45ZM19.8 22.6L15.6 18.45C15.0167 18.6333 14.4292 18.7708 13.8375 18.8625C13.2458 18.9542 12.6333 19 12 19C9.48333 19 7.24167 18.3042 5.275 16.9125C3.30833 15.5208 1.88333 13.7167 1 11.5C1.35 10.6167 1.79167 9.79583 2.325 9.0375C2.85833 8.27917 3.46667 7.6 4.15 7L1.4 4.2L2.8 2.8L21.2 21.2L19.8 22.6ZM5.55 8.4C5.06667 8.83333 4.625 9.30833 4.225 9.825C3.825 10.3417 3.48333 10.9 3.2 11.5C4.03333 13.1833 5.22917 14.5208 6.7875 15.5125C8.34583 16.5042 10.0833 17 12 17C12.3333 17 12.6583 16.9792 12.975 16.9375C13.2917 16.8958 13.6167 16.85 13.95 16.8L13.05 15.85C12.8667 15.9 12.6917 15.9375 12.525 15.9625C12.3583 15.9875 12.1833 16 12 16C10.75 16 9.6875 15.5625 8.8125 14.6875C7.9375 13.8125 7.5 12.75 7.5 11.5C7.5 11.3167 7.5125 11.1417 7.5375 10.975C7.5625 10.8083 7.6 10.6333 7.65 10.45L5.55 8.4Z",
|
|
36
|
+
warning: "M0 19L11 0L22 19H0ZM3.45 17H18.55L11 4L3.45 17ZM11 16C11.2833 16 11.5208 15.9042 11.7125 15.7125C11.9042 15.5208 12 15.2833 12 15C12 14.7167 11.9042 14.4792 11.7125 14.2875C11.5208 14.0958 11.2833 14 11 14C10.7167 14 10.4792 14.0958 10.2875 14.2875C10.0958 14.4792 10 14.7167 10 15C10 15.2833 10.0958 15.5208 10.2875 15.7125C10.4792 15.9042 10.7167 16 11 16ZM10 13H12V8H10V13Z"
|
|
36
37
|
};
|
|
@@ -4,10 +4,15 @@ import { Aligment } from '../Aligment';
|
|
|
4
4
|
import { InputTextElement, InputLabelElement, InputErrorMsg, InputWrapper, EyeIconWrapper, } 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, width, error, placeholder, min, max, step, theme = mainTheme, }) => {
|
|
7
|
+
export const Input = ({ label, labelPosition = 'top', value, type = 'text', name, disabled = false, size = 'medium', handleChange, handleSubmit, width, error, placeholder, min, max, step, autoFocus, theme = mainTheme, }) => {
|
|
8
8
|
const onChange = (e) => {
|
|
9
9
|
handleChange(name, e.target.value);
|
|
10
10
|
};
|
|
11
|
+
const onKeyDown = (e) => {
|
|
12
|
+
if (handleSubmit && e.key === 'Enter') {
|
|
13
|
+
handleSubmit();
|
|
14
|
+
}
|
|
15
|
+
};
|
|
11
16
|
const [inputType] = useState(type);
|
|
12
17
|
const [showPassword, setShowPassword] = useState(false);
|
|
13
18
|
const tooglePassword = () => {
|
|
@@ -17,7 +22,7 @@ export const Input = ({ label, labelPosition = 'top', value, type = 'text', name
|
|
|
17
22
|
React.createElement(Aligment, { align: labelPosition === 'top' ? 'flex-start' : 'center', direction: labelPosition === 'top' ? 'column' : 'row', wrap: 'nowrap' },
|
|
18
23
|
label && (React.createElement(InputLabelElement, { size: size, labelPosition: labelPosition }, label)),
|
|
19
24
|
React.createElement(InputWrapper, { width: width },
|
|
20
|
-
React.createElement(InputTextElement, { inputSize: size, type: showPassword ? 'text' : inputType, disabled: disabled, name: name, value: value, onChange: onChange, error: error, placeholder: placeholder, min: min, max: max, step: step }),
|
|
25
|
+
React.createElement(InputTextElement, { autoFocus: autoFocus, inputSize: size, type: showPassword ? 'text' : inputType, disabled: disabled, name: name, value: value, onChange: onChange, onKeyDown: onKeyDown, error: error, placeholder: placeholder, min: min, max: max, step: step }),
|
|
21
26
|
inputType === 'password' && (React.createElement(EyeIconWrapper, { size: size },
|
|
22
27
|
React.createElement(Icon, { name: showPassword ? 'visability_off' : 'visibility', size: 24, onClick: tooglePassword, color: theme.inputDefaultTextColor, inverseMode: true }))),
|
|
23
28
|
error && React.createElement(InputErrorMsg, null, error)))));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { mainTheme } from '../../Theme';
|
|
3
3
|
import { Aligment } from '../Aligment';
|
|
4
4
|
import { LoaderElement, LoaderItem } from './Loader.styles';
|
|
5
|
-
export const Loader = ({ color =
|
|
5
|
+
export const Loader = ({ theme = mainTheme, color = theme.action, size = 'medium', }) => {
|
|
6
6
|
return (React.createElement(Aligment, { justify: 'center', align: 'center' },
|
|
7
7
|
React.createElement(LoaderElement, { size: size },
|
|
8
8
|
React.createElement(LoaderItem, { color: color, size: size }),
|
|
@@ -5,7 +5,7 @@ import { ScrollCotainer } from '../common';
|
|
|
5
5
|
import { ModalElement, ModalOverlayer } from './Modal.styles';
|
|
6
6
|
import { ThemeProvider } from 'styled-components';
|
|
7
7
|
import { ButtonsFooter } from '../ButtonsFooter';
|
|
8
|
-
export const Modal = ({ theme = mainTheme, children, title, handleConfirm, handleClose, handleAdditional, labelConfirm, labelClose, labelAdditional, submitDisabled, size = 'small', submitLoader = false, }) => {
|
|
8
|
+
export const Modal = ({ theme = mainTheme, children, title, handleConfirm, handleClose, handleAdditional, labelConfirm = 'Save', labelClose = 'Cancel', labelAdditional = 'Reset', submitDisabled, size = 'small', submitLoader = false, }) => {
|
|
9
9
|
return (React.createElement(ThemeProvider, { theme: theme },
|
|
10
10
|
React.createElement(ModalOverlayer, null,
|
|
11
11
|
React.createElement(ModalElement, { size: size },
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TextSubHeader } from '../Typography';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { SectionElement, SectionTitle, SectionContent } from './Section.styles';
|
|
4
|
-
import {
|
|
5
|
-
export const Section = ({ title, children, titlePosition = "left", noPadding = false, backgroundColor =
|
|
4
|
+
import { mainTheme } from '../../Theme';
|
|
5
|
+
export const Section = ({ title, children, titlePosition = "left", noPadding = false, theme = mainTheme, backgroundColor = theme.contentBackground, }) => {
|
|
6
6
|
return (React.createElement(SectionElement, { backgroundColor: backgroundColor },
|
|
7
7
|
title && (React.createElement(SectionTitle, { titlePosition: titlePosition, noPadding: noPadding },
|
|
8
8
|
React.createElement(TextSubHeader, null, title))),
|
|
@@ -8,9 +8,7 @@ export const Sidepanel = ({ isOpen, handleClose, children, right = false, overla
|
|
|
8
8
|
const ref = useRef(null);
|
|
9
9
|
useEffect(() => {
|
|
10
10
|
const handleClickOutside = (event) => {
|
|
11
|
-
console.log('click:', isOpen);
|
|
12
11
|
if (ref.current && !ref.current.contains(event.target)) {
|
|
13
|
-
console.log('fire:', isOpen);
|
|
14
12
|
handleClose && handleClose();
|
|
15
13
|
}
|
|
16
14
|
};
|
|
@@ -23,7 +21,7 @@ export const Sidepanel = ({ isOpen, handleClose, children, right = false, overla
|
|
|
23
21
|
if (isOpen) {
|
|
24
22
|
return ReactDOM.createPortal(React.createElement(React.Fragment, null,
|
|
25
23
|
React.createElement(SidepanelElement, { right: right, top: top, ref: ref },
|
|
26
|
-
React.createElement(ElementHeader, { handleClose: handleClose
|
|
24
|
+
React.createElement(ElementHeader, { handleClose: handleClose }, iconOptions &&
|
|
27
25
|
iconOptions.map((icon) => (React.createElement(Icon, { name: icon.iconName, onClick: icon.action, key: icon.iconName })))),
|
|
28
26
|
children),
|
|
29
27
|
overlayer && React.createElement(ModalOverlayer, { onClick: handleClose })), modalRoot);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ElementHeader } from '../ElementHeader';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { TileElement } from './Tile.styles';
|
|
4
|
-
import {
|
|
5
|
-
export const Tile = ({ size = 'small', shadow = true, title, children, backgroundColor =
|
|
4
|
+
import { mainTheme } from '../../Theme';
|
|
5
|
+
export const Tile = ({ size = 'small', shadow = true, title, children, theme = mainTheme, backgroundColor = theme.contentBackground, height = 'auto', }) => {
|
|
6
6
|
return (React.createElement(TileElement, { size: size, shadow: shadow, backgroundColor: backgroundColor, height: height },
|
|
7
|
-
title && React.createElement(ElementHeader, { title: title,
|
|
7
|
+
title && (React.createElement(ElementHeader, { title: title, backgroundColor: backgroundColor })),
|
|
8
8
|
children));
|
|
9
9
|
};
|
|
@@ -18,22 +18,22 @@ export const Panel = styled.div `
|
|
|
18
18
|
padding: ${Theme.padding.m} 0;
|
|
19
19
|
border-radius: ${Theme.borderRadius.m};
|
|
20
20
|
height: ${(p) => (p.height ? p.height : 'auto')};
|
|
21
|
-
width: ${p => p.fullWidth ? '100%' : 'auto'};
|
|
21
|
+
width: ${(p) => (p.fullWidth ? '100%' : 'auto')};
|
|
22
22
|
position: absolute;
|
|
23
23
|
z-index: ${Theme.zIndex.dropdown};
|
|
24
24
|
top: ${(p) => setPanelTop(p.size)};
|
|
25
25
|
border: 1px solid ${Theme.colors.gray_2};
|
|
26
26
|
border-top: none;
|
|
27
|
-
|
|
27
|
+
min-width: 30px;
|
|
28
|
+
${(p) => setPanelPosition(p.position)}
|
|
28
29
|
`;
|
|
29
30
|
export const PanelOption = styled.div `
|
|
30
31
|
padding: ${Theme.padding.s} ${Theme.padding.m};
|
|
31
32
|
cursor: pointer;
|
|
32
33
|
white-space: nowrap;
|
|
33
34
|
color: ${(p) => (p.active ? Theme.colors.primary : Theme.colors.text)};
|
|
34
|
-
|
|
35
35
|
:hover {
|
|
36
36
|
background-color: ${lighten(0.4, Theme.colors.primary)};
|
|
37
37
|
}
|
|
38
|
-
${p => p.width && `width:${p.width};`}
|
|
38
|
+
${(p) => p.width && `width:${p.width};`}
|
|
39
39
|
`;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Input } from '../components/Input';
|
|
3
|
+
import { ExampleArea, ExampleAreaTitle, ExampleItem } from '../example';
|
|
4
|
+
import { Button } from '../components/Button';
|
|
5
|
+
import { Dropdown } from '../components/Dropdown';
|
|
6
|
+
import { Selector } from '../components/Selector';
|
|
7
|
+
import { DropdownMenu } from '../components/DropdownMenu';
|
|
8
|
+
import { Aligment } from '../components/Aligment';
|
|
9
|
+
export const Overview = ({ sectionName, size, labelPosition, }) => {
|
|
10
|
+
const [data, setData] = useState({
|
|
11
|
+
input: 'my text',
|
|
12
|
+
dropdown: '',
|
|
13
|
+
selector1: 'test_01',
|
|
14
|
+
selector2: '',
|
|
15
|
+
});
|
|
16
|
+
const onChange = (name, value) => {
|
|
17
|
+
setData({
|
|
18
|
+
...data,
|
|
19
|
+
[name]: value,
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
const onClick = () => {
|
|
23
|
+
alert('button click');
|
|
24
|
+
};
|
|
25
|
+
const handleClear1 = () => {
|
|
26
|
+
setData({
|
|
27
|
+
...data,
|
|
28
|
+
selector1: '',
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
const handleClear2 = () => {
|
|
32
|
+
setData({
|
|
33
|
+
...data,
|
|
34
|
+
selector2: '',
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
return (React.createElement(Aligment, { gap: 20, direction: 'column', align: 'stretch', justify: 'space-between' },
|
|
38
|
+
React.createElement(ExampleAreaTitle, null, sectionName),
|
|
39
|
+
React.createElement(ExampleArea, null,
|
|
40
|
+
React.createElement(ExampleItem, null,
|
|
41
|
+
React.createElement(Input, { value: data.input, size: size, label: "Input", name: "input", handleChange: onChange, labelPosition: labelPosition })),
|
|
42
|
+
React.createElement(ExampleItem, null,
|
|
43
|
+
React.createElement(Button, { size: size, text: "Button", onClick: onClick })),
|
|
44
|
+
React.createElement(ExampleItem, null,
|
|
45
|
+
React.createElement(Dropdown, { size: size, label: "Dropdown", labelPosition: labelPosition, handleSelect: onChange, name: "dropdown", value: data.dropdown, options: [
|
|
46
|
+
{ value: 'test_01', label: 'test 01' },
|
|
47
|
+
{ value: 'test_02', label: 'test 02' },
|
|
48
|
+
] })),
|
|
49
|
+
React.createElement(ExampleItem, null,
|
|
50
|
+
React.createElement(Selector, { labelPosition: labelPosition, size: size, label: "Selected selector", value: data.selector1, handleSelect: onChange, handleClear: handleClear1, name: "selector1", options: [
|
|
51
|
+
{ value: 'test_01', label: 'test 01' },
|
|
52
|
+
{ value: 'test_02', label: 'test 02' },
|
|
53
|
+
] })),
|
|
54
|
+
React.createElement(ExampleItem, null,
|
|
55
|
+
React.createElement(Selector, { handleSelect: onChange, handleClear: handleClear2, name: "selector2", value: data.selector2, labelPosition: labelPosition, size: size, label: "Selector", options: [
|
|
56
|
+
{ value: 'test_01', label: 'test 01' },
|
|
57
|
+
{ value: 'test_02', label: 'test 02' },
|
|
58
|
+
] })),
|
|
59
|
+
React.createElement(ExampleItem, null,
|
|
60
|
+
React.createElement(DropdownMenu, { size: size, options: [
|
|
61
|
+
{ action: () => alert('action one'), label: 'action one' },
|
|
62
|
+
{ action: () => alert('action two'), label: 'action two' },
|
|
63
|
+
] })))));
|
|
64
|
+
};
|
|
@@ -10,8 +10,10 @@ export const ExmpleBlock = styled.div `
|
|
|
10
10
|
font-size: ${Theme.fontSize.xl};
|
|
11
11
|
`;
|
|
12
12
|
export const ExmpleBlockWrapper = styled.div `
|
|
13
|
-
background-color: ${(p) => (p.color ? p.color : '#
|
|
13
|
+
background-color: ${(p) => (p.color ? p.color : '#ffffff')};
|
|
14
14
|
border-radius: ${Theme.borderRadius.m};
|
|
15
|
+
box-sizing:border-box;
|
|
16
|
+
border:1px solid #dddddd;
|
|
15
17
|
`;
|
|
16
18
|
export const ExampleTable = styled.table `
|
|
17
19
|
width: 100%;
|
|
@@ -40,7 +42,6 @@ export const ExampleArea = styled.div `
|
|
|
40
42
|
display: flex;
|
|
41
43
|
margin-bottom: 20px;
|
|
42
44
|
padding-bottom: 20px;
|
|
43
|
-
border-bottom: 1px solid #cbcbcb;
|
|
44
45
|
align-items: flex-end;
|
|
45
46
|
gap: 10px;
|
|
46
47
|
`;
|
|
@@ -7,9 +7,10 @@ interface ICardProps {
|
|
|
7
7
|
handleClick?: () => void;
|
|
8
8
|
handleBack?: () => void;
|
|
9
9
|
height?: string;
|
|
10
|
-
moreIcon?: boolean;
|
|
11
|
-
backIcon?: boolean;
|
|
12
10
|
options?: IAction[];
|
|
11
|
+
theme: any;
|
|
12
|
+
iconColor?: string;
|
|
13
|
+
iconHoverColor?: string;
|
|
13
14
|
}
|
|
14
15
|
export declare const Card: FC<ICardProps>;
|
|
15
16
|
export {};
|
|
@@ -2,18 +2,16 @@ import React, { FC } from 'react';
|
|
|
2
2
|
import { IAction } from '../../types';
|
|
3
3
|
interface IElementHeader {
|
|
4
4
|
title?: string;
|
|
5
|
-
showTitle?: boolean;
|
|
6
|
-
moreIcon?: boolean;
|
|
7
|
-
closeIcon?: boolean;
|
|
8
|
-
backIcon?: boolean;
|
|
9
|
-
actionButton?: boolean;
|
|
10
5
|
actionLabel?: string;
|
|
11
6
|
handleClose?: () => void;
|
|
12
7
|
handleClick?: () => void;
|
|
13
8
|
handleBack?: () => void;
|
|
14
9
|
children?: React.ReactNode;
|
|
15
|
-
|
|
10
|
+
backgroundColor?: string;
|
|
11
|
+
iconColor?: string;
|
|
12
|
+
iconHoverColor?: string;
|
|
16
13
|
options?: IAction[];
|
|
14
|
+
theme?: any;
|
|
17
15
|
}
|
|
18
16
|
export declare const ElementHeader: FC<IElementHeader>;
|
|
19
17
|
export {};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { InputType, IFormElement } from '../../types';
|
|
3
3
|
export interface IInputProps extends IFormElement {
|
|
4
|
-
type
|
|
4
|
+
type?: InputType;
|
|
5
5
|
handleChange: (name: string, value: string | number) => void;
|
|
6
6
|
placeholder?: string;
|
|
7
7
|
min?: number;
|
|
8
8
|
max?: number;
|
|
9
9
|
step?: number;
|
|
10
|
+
autoFocus?: boolean;
|
|
10
11
|
theme?: any;
|
|
12
|
+
handleSubmit?: () => void;
|
|
11
13
|
}
|
|
12
14
|
export declare const Input: FC<IInputProps>;
|
|
@@ -7,6 +7,7 @@ interface IInputTextElementProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
|
7
7
|
width?: string;
|
|
8
8
|
type: InputType;
|
|
9
9
|
theme: any;
|
|
10
|
+
onKeyDown: any;
|
|
10
11
|
}
|
|
11
12
|
export declare const InputTextElement: import("styled-components").StyledComponent<"input", any, IInputTextElementProps, never>;
|
|
12
13
|
export declare const InputLabelElement: import("styled-components").StyledComponent<"div", any, import("../Typography").ITextLabelProps, never>;
|
|
@@ -2,9 +2,10 @@ import React, { FC } from 'react';
|
|
|
2
2
|
import { TitlePosition } from '../../types';
|
|
3
3
|
export interface ISectionProps {
|
|
4
4
|
title?: string;
|
|
5
|
-
children: React.ReactNode;
|
|
6
5
|
titlePosition?: TitlePosition;
|
|
7
6
|
noPadding?: boolean;
|
|
8
7
|
backgroundColor?: string;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
theme?: any;
|
|
9
10
|
}
|
|
10
11
|
export declare const Section: FC<ISectionProps>;
|