@smart-react-components/ui 2.1.0-alpha-6 → 2.1.0-alpha-8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Checkbox/CheckboxAll.js +1 -1
- package/Checkbox/index.js +1 -1
- package/Radio/index.js +1 -1
- package/components/Checkbox/CheckboxElement.js +36 -24
- package/components/Dropdown/DropdownItemElement.js +33 -30
- package/components/Dropdown/DropdownListElement.js +14 -11
- package/components/Form/FormInlineLabel.d.ts +2 -1
- package/components/Form/FormInlineLabel.js +10 -7
- package/components/ProgressBar/ProgressBarElement.js +22 -19
- package/components/Radio/RadioElement.js +26 -17
- package/components/Switch/SwitchElement.js +27 -21
- package/package.json +7 -7
package/Checkbox/CheckboxAll.js
CHANGED
|
@@ -26,7 +26,7 @@ const CheckboxAll = react_1.default.forwardRef((props, forwardRef) => {
|
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
const input = (react_1.default.createElement(HiddenInput_1.default, Object.assign({ checked: isChecked, onChange: handleOnChange, ref: forwardRef, type: "checkbox" }, (props.isDisabled && { disabled: true }), (props.name && { name: props.name }))));
|
|
29
|
-
return (react_1.default.createElement(FormInlineLabel_1.default, Object.assign({ formSize: props.size, formSizeSm: props.sizeSm, formSizeMd: props.sizeMd, formSizeLg: props.sizeLg, formSizeXl: props.sizeXl, isBlock: props.isBlock, isDisabled: props.isDisabled, labelPosition: props.position }, (0, element_props_1.default)(props, [intrinsic_styled_core_props_1.default])),
|
|
29
|
+
return (react_1.default.createElement(FormInlineLabel_1.default, Object.assign({ formSize: props.size, formSizeSm: props.sizeSm, formSizeMd: props.sizeMd, formSizeLg: props.sizeLg, formSizeXl: props.sizeXl, isBlock: props.isBlock, isDisabled: props.isDisabled, labelPosition: props.position, palette: props.palette }, (0, element_props_1.default)(props, [intrinsic_styled_core_props_1.default])),
|
|
30
30
|
react_1.default.cloneElement(props.template, {
|
|
31
31
|
checkboxSize: props.size,
|
|
32
32
|
checkboxSizeSm: props.sizeSm,
|
package/Checkbox/index.js
CHANGED
|
@@ -39,7 +39,7 @@ const Checkbox = react_1.default.forwardRef((props, forwardRef) => {
|
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
const input = (react_1.default.createElement(HiddenInput_1.default, Object.assign({ checked: isChecked, onChange: handleOnChange, ref: forwardRef, type: "checkbox" }, (props.isDisabled && { disabled: true }), (props.isRequired && { required: true }), (props.name && { name: props.name }))));
|
|
42
|
-
return (react_1.default.createElement(FormInlineLabel_1.default, Object.assign({ formSize: props.size, formSizeSm: props.sizeSm, formSizeMd: props.sizeMd, formSizeLg: props.sizeLg, formSizeXl: props.sizeXl, isBlock: props.isBlock, isDisabled: props.isDisabled, labelPosition: props.position }, (0, element_props_1.default)(props, [intrinsic_styled_core_props_1.default])),
|
|
42
|
+
return (react_1.default.createElement(FormInlineLabel_1.default, Object.assign({ formSize: props.size, formSizeSm: props.sizeSm, formSizeMd: props.sizeMd, formSizeLg: props.sizeLg, formSizeXl: props.sizeXl, isBlock: props.isBlock, isDisabled: props.isDisabled, labelPosition: props.position, palette: props.palette }, (0, element_props_1.default)(props, [intrinsic_styled_core_props_1.default])),
|
|
43
43
|
react_1.default.cloneElement(props.template, {
|
|
44
44
|
checkboxSize: props.size,
|
|
45
45
|
checkboxSizeSm: props.sizeSm,
|
package/Radio/index.js
CHANGED
|
@@ -20,7 +20,7 @@ const Radio = react_1.default.forwardRef((props, forwardRef) => {
|
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
const input = (react_1.default.createElement(HiddenInput_1.default, Object.assign({ checked: props.value === props.active, onChange: handleOnChange, ref: forwardRef, type: "radio" }, (props.isDisabled && { disabled: true }), (props.isRequired && { required: true }), (props.name && { name: props.name }))));
|
|
23
|
-
return (react_1.default.createElement(FormInlineLabel_1.default, Object.assign({ formSize: props.size, formSizeSm: props.sizeSm, formSizeMd: props.sizeMd, formSizeLg: props.sizeLg, formSizeXl: props.sizeXl, isBlock: props.isBlock, isDisabled: props.isDisabled, labelPosition: props.position }, (0, element_props_1.default)(props, [intrinsic_styled_core_props_1.default])),
|
|
23
|
+
return (react_1.default.createElement(FormInlineLabel_1.default, Object.assign({ formSize: props.size, formSizeSm: props.sizeSm, formSizeMd: props.sizeMd, formSizeLg: props.sizeLg, formSizeXl: props.sizeXl, isBlock: props.isBlock, isDisabled: props.isDisabled, labelPosition: props.position, palette: props.palette }, (0, element_props_1.default)(props, [intrinsic_styled_core_props_1.default])),
|
|
24
24
|
react_1.default.cloneElement(props.template, {
|
|
25
25
|
children: (react_1.default.createElement(react_1.default.Fragment, null,
|
|
26
26
|
input,
|
|
@@ -8,14 +8,17 @@ const react_1 = __importDefault(require("react"));
|
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const Container = styled_components_1.default.div.attrs({
|
|
10
10
|
className: 'src-checkbox-container',
|
|
11
|
-
})(({ theme }) =>
|
|
12
|
-
|
|
11
|
+
})(({ theme, palette }) => {
|
|
12
|
+
var _a, _b;
|
|
13
|
+
return `
|
|
14
|
+
border: solid 2px ${(_b = (_a = theme.$.palette[palette].checkbox) === null || _a === void 0 ? void 0 : _a.border) !== null && _b !== void 0 ? _b : theme.$.color.dynamic.accent};
|
|
13
15
|
box-sizing: border-box;
|
|
14
16
|
display: flex;
|
|
15
17
|
height: 100%;
|
|
16
18
|
justify-content: center;
|
|
17
19
|
position: relative;
|
|
18
|
-
|
|
20
|
+
`;
|
|
21
|
+
});
|
|
19
22
|
const Rectangle = styled_components_1.default.div.attrs({
|
|
20
23
|
className: 'src-checkbox-rectangle',
|
|
21
24
|
}) `
|
|
@@ -30,23 +33,28 @@ const Svg = styled_components_1.default.svg.attrs({
|
|
|
30
33
|
children: react_1.default.createElement("path", { d: "M3.5,17.2l7.6,7.6L28.5,7.3" }),
|
|
31
34
|
className: 'src-checkbox-svg',
|
|
32
35
|
viewBox: '0 0 32 32',
|
|
33
|
-
})(({ theme }) =>
|
|
36
|
+
})(({ theme, palette }) => {
|
|
37
|
+
var _a, _b, _c;
|
|
38
|
+
return `
|
|
34
39
|
flex: 0 0 auto;
|
|
35
40
|
position: relative;
|
|
36
41
|
|
|
37
42
|
> path {
|
|
38
43
|
fill: transparent;
|
|
39
|
-
stroke: ${theme.$.color.white};
|
|
44
|
+
stroke: ${(_c = (_b = (_a = theme.$.palette[palette].checkbox) === null || _a === void 0 ? void 0 : _a.active) === null || _b === void 0 ? void 0 : _b.mark) !== null && _c !== void 0 ? _c : theme.$.color.white};
|
|
40
45
|
stroke-width: 4px;
|
|
41
46
|
stroke-dasharray: 36px;
|
|
42
47
|
stroke-dashoffset: 36px;
|
|
43
48
|
transition: stroke-dashoffset 200ms 0s ease-in-out;
|
|
44
49
|
}
|
|
45
|
-
|
|
50
|
+
`;
|
|
51
|
+
});
|
|
46
52
|
const IndeterminateMark = styled_components_1.default.div.attrs({
|
|
47
53
|
className: 'src-checkbox-indeterminate-mark',
|
|
48
|
-
})(({ theme }) =>
|
|
49
|
-
|
|
54
|
+
})(({ theme, palette }) => {
|
|
55
|
+
var _a, _b, _c;
|
|
56
|
+
return `
|
|
57
|
+
background: ${(_c = (_b = (_a = theme.$.palette[palette].checkbox) === null || _a === void 0 ? void 0 : _a.active) === null || _b === void 0 ? void 0 : _b.mark) !== null && _c !== void 0 ? _c : theme.$.color.white};
|
|
50
58
|
height: 2px;
|
|
51
59
|
margin-top: -1px;
|
|
52
60
|
opacity: 0;
|
|
@@ -57,19 +65,22 @@ const IndeterminateMark = styled_components_1.default.div.attrs({
|
|
|
57
65
|
transition-timing-function: ease-in-out;
|
|
58
66
|
top: 50%;
|
|
59
67
|
width: 100%;
|
|
60
|
-
|
|
61
|
-
|
|
68
|
+
`;
|
|
69
|
+
});
|
|
70
|
+
exports.default = (0, styled_components_1.default)(Div_1.default).attrs(({ children, isIndeterminate, palette }) => ({
|
|
62
71
|
children: (react_1.default.createElement(react_1.default.Fragment, null,
|
|
63
72
|
children && children,
|
|
64
|
-
react_1.default.createElement(Container,
|
|
73
|
+
react_1.default.createElement(Container, { palette: palette },
|
|
65
74
|
react_1.default.createElement(Rectangle, null),
|
|
66
|
-
react_1.default.createElement(Svg,
|
|
67
|
-
typeof isIndeterminate !== 'undefined' && react_1.default.createElement(IndeterminateMark,
|
|
75
|
+
react_1.default.createElement(Svg, { palette: palette }),
|
|
76
|
+
typeof isIndeterminate !== 'undefined' && react_1.default.createElement(IndeterminateMark, { palette: palette })))),
|
|
68
77
|
getCheckboxSize: (v, t) => `
|
|
69
78
|
height: ${t.$.size.checkbox[v]};
|
|
70
79
|
width: ${t.$.size.checkbox[v]};
|
|
71
80
|
`,
|
|
72
|
-
}))(({ theme, isChecked, isIndeterminate, isOutline, isSoft, palette, shape }) =>
|
|
81
|
+
}))(({ theme, isChecked, isIndeterminate, isOutline, isSoft, palette, shape }) => {
|
|
82
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
83
|
+
return `
|
|
73
84
|
position: relative;
|
|
74
85
|
|
|
75
86
|
.src-checkbox-container {
|
|
@@ -77,10 +88,10 @@ exports.default = (0, styled_components_1.default)(Div_1.default).attrs(({ child
|
|
|
77
88
|
transition: border-color 200ms 0s ease-in-out;
|
|
78
89
|
|
|
79
90
|
${!isOutline
|
|
80
|
-
|
|
81
|
-
background: ${theme.$.color.dynamic.accent};
|
|
91
|
+
? `
|
|
92
|
+
background: ${(_b = (_a = theme.$.palette[palette].checkbox) === null || _a === void 0 ? void 0 : _a.background) !== null && _b !== void 0 ? _b : theme.$.color.dynamic.accent};
|
|
82
93
|
`
|
|
83
|
-
|
|
94
|
+
: ''}
|
|
84
95
|
}
|
|
85
96
|
|
|
86
97
|
.src-checkbox-rectangle {
|
|
@@ -88,21 +99,21 @@ exports.default = (0, styled_components_1.default)(Div_1.default).attrs(({ child
|
|
|
88
99
|
}
|
|
89
100
|
|
|
90
101
|
${isChecked
|
|
91
|
-
|
|
102
|
+
? `
|
|
92
103
|
.src-checkbox-container {
|
|
93
|
-
border-color: ${!isSoft ? theme.$.palette[palette].main : theme.$.palette[palette].soft};
|
|
104
|
+
border-color: ${!isSoft ? ((_e = (_d = (_c = theme.$.palette[palette].checkbox) === null || _c === void 0 ? void 0 : _c.active) === null || _d === void 0 ? void 0 : _d.border) !== null && _e !== void 0 ? _e : theme.$.palette[palette].main) : ((_j = (_h = (_g = (_f = theme.$.palette[palette].checkbox) === null || _f === void 0 ? void 0 : _f.soft) === null || _g === void 0 ? void 0 : _g.active) === null || _h === void 0 ? void 0 : _h.border) !== null && _j !== void 0 ? _j : theme.$.palette[palette].soft)};
|
|
94
105
|
|
|
95
106
|
.src-checkbox-rectangle {
|
|
96
|
-
background: ${!isSoft ? theme.$.palette[palette].main : theme.$.palette[palette].soft};
|
|
107
|
+
background: ${!isSoft ? ((_m = (_l = (_k = theme.$.palette[palette].checkbox) === null || _k === void 0 ? void 0 : _k.active) === null || _l === void 0 ? void 0 : _l.background) !== null && _m !== void 0 ? _m : theme.$.palette[palette].main) : ((_r = (_q = (_p = (_o = theme.$.palette[palette].checkbox) === null || _o === void 0 ? void 0 : _o.soft) === null || _p === void 0 ? void 0 : _p.active) === null || _q === void 0 ? void 0 : _q.background) !== null && _r !== void 0 ? _r : theme.$.palette[palette].soft)};
|
|
97
108
|
}
|
|
98
109
|
|
|
99
110
|
${!isIndeterminate
|
|
100
|
-
|
|
111
|
+
? `
|
|
101
112
|
.src-checkbox-svg > path {
|
|
102
113
|
stroke-dashoffset: 0;
|
|
103
114
|
}
|
|
104
115
|
`
|
|
105
|
-
|
|
116
|
+
: `
|
|
106
117
|
.src-checkbox-indeterminate-mark {
|
|
107
118
|
opacity: 1;
|
|
108
119
|
transform: scaleX(1);
|
|
@@ -110,5 +121,6 @@ exports.default = (0, styled_components_1.default)(Div_1.default).attrs(({ child
|
|
|
110
121
|
`}
|
|
111
122
|
}
|
|
112
123
|
`
|
|
113
|
-
|
|
114
|
-
|
|
124
|
+
: ''}
|
|
125
|
+
`;
|
|
126
|
+
});
|
|
@@ -5,7 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const Div_1 = __importDefault(require("@smart-react-components/core/Element/Div"));
|
|
7
7
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
-
exports.default = (0, styled_components_1.default)(Div_1.default)(({ theme, hasHover, isActive, isDisabled, isHovered, isOutline, isSoft, palette }) =>
|
|
8
|
+
exports.default = (0, styled_components_1.default)(Div_1.default)(({ theme, hasHover, isActive, isDisabled, isHovered, isOutline, isSoft, palette }) => {
|
|
9
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86, _87, _88, _89, _90, _91, _92, _93, _94, _95, _96, _97, _98, _99, _100, _101, _102, _103;
|
|
10
|
+
return `
|
|
9
11
|
border-radius: ${theme.$.radius.dropdown};
|
|
10
12
|
fill: currrentcolor;
|
|
11
13
|
transition: 100ms 0s ease-in-out;
|
|
@@ -19,81 +21,82 @@ exports.default = (0, styled_components_1.default)(Div_1.default)(({ theme, hasH
|
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
${isSoft
|
|
22
|
-
|
|
24
|
+
? `
|
|
23
25
|
font-weight: ${theme.$.fontWeight.bold};
|
|
24
26
|
`
|
|
25
|
-
|
|
27
|
+
: ''}
|
|
26
28
|
|
|
27
29
|
${!isActive
|
|
28
|
-
? `
|
|
29
|
-
${(hasHover || isHovered) && !theme.$.vars.isMobile
|
|
30
30
|
? `
|
|
31
|
+
${(hasHover || isHovered) && !theme.$.vars.isMobile
|
|
32
|
+
? `
|
|
31
33
|
${!isHovered ? '&:hover {' : ''}
|
|
32
34
|
${!isSoft
|
|
33
|
-
|
|
34
|
-
background: ${!isOutline ? theme.$.palette[palette].dynamic : theme.$.palette[palette].main};
|
|
35
|
-
color: ${theme.$.palette[palette].font};
|
|
35
|
+
? `
|
|
36
|
+
background: ${!isOutline ? ((_c = (_b = (_a = theme.$.palette[palette].dropdown) === null || _a === void 0 ? void 0 : _a.hover) === null || _b === void 0 ? void 0 : _b.background) !== null && _c !== void 0 ? _c : theme.$.palette[palette].dynamic) : ((_g = (_f = (_e = (_d = theme.$.palette[palette].dropdown) === null || _d === void 0 ? void 0 : _d.outline) === null || _e === void 0 ? void 0 : _e.hover) === null || _f === void 0 ? void 0 : _f.background) !== null && _g !== void 0 ? _g : theme.$.palette[palette].main)};
|
|
37
|
+
color: ${!isOutline ? ((_k = (_j = (_h = theme.$.palette[palette].dropdown) === null || _h === void 0 ? void 0 : _h.hover) === null || _j === void 0 ? void 0 : _j.font) !== null && _k !== void 0 ? _k : theme.$.palette[palette].font) : ((_p = (_o = (_m = (_l = theme.$.palette[palette].dropdown) === null || _l === void 0 ? void 0 : _l.outline) === null || _m === void 0 ? void 0 : _m.hover) === null || _o === void 0 ? void 0 : _o.font) !== null && _p !== void 0 ? _p : theme.$.palette[palette].font)};
|
|
36
38
|
|
|
37
39
|
.svg,
|
|
38
40
|
.svg .fill {
|
|
39
|
-
fill: ${theme.$.palette[palette].font};
|
|
41
|
+
fill: ${!isOutline ? ((_s = (_r = (_q = theme.$.palette[palette].dropdown) === null || _q === void 0 ? void 0 : _q.hover) === null || _r === void 0 ? void 0 : _r.font) !== null && _s !== void 0 ? _s : theme.$.palette[palette].font) : ((_w = (_v = (_u = (_t = theme.$.palette[palette].dropdown) === null || _t === void 0 ? void 0 : _t.outline) === null || _u === void 0 ? void 0 : _u.hover) === null || _v === void 0 ? void 0 : _v.font) !== null && _w !== void 0 ? _w : theme.$.palette[palette].font)};
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
.svg .stroke {
|
|
43
|
-
stroke: ${theme.$.palette[palette].font};
|
|
45
|
+
stroke: ${!isOutline ? ((_z = (_y = (_x = theme.$.palette[palette].dropdown) === null || _x === void 0 ? void 0 : _x.hover) === null || _y === void 0 ? void 0 : _y.font) !== null && _z !== void 0 ? _z : theme.$.palette[palette].font) : ((_3 = (_2 = (_1 = (_0 = theme.$.palette[palette].dropdown) === null || _0 === void 0 ? void 0 : _0.outline) === null || _1 === void 0 ? void 0 : _1.hover) === null || _2 === void 0 ? void 0 : _2.font) !== null && _3 !== void 0 ? _3 : theme.$.palette[palette].font)};
|
|
44
46
|
}
|
|
45
47
|
`
|
|
46
|
-
|
|
47
|
-
background: ${!isOutline ? theme.$.palette[palette].softDynamic : theme.$.palette[palette].soft};
|
|
48
|
-
color: ${theme.$.palette[palette].softFont};
|
|
48
|
+
: `
|
|
49
|
+
background: ${!isOutline ? ((_7 = (_6 = (_5 = (_4 = theme.$.palette[palette].dropdown) === null || _4 === void 0 ? void 0 : _4.soft) === null || _5 === void 0 ? void 0 : _5.hover) === null || _6 === void 0 ? void 0 : _6.background) !== null && _7 !== void 0 ? _7 : theme.$.palette[palette].softDynamic) : ((_12 = (_11 = (_10 = (_9 = (_8 = theme.$.palette[palette].dropdown) === null || _8 === void 0 ? void 0 : _8.soft) === null || _9 === void 0 ? void 0 : _9.outline) === null || _10 === void 0 ? void 0 : _10.hover) === null || _11 === void 0 ? void 0 : _11.background) !== null && _12 !== void 0 ? _12 : theme.$.palette[palette].soft)};
|
|
50
|
+
color: ${!isOutline ? ((_16 = (_15 = (_14 = (_13 = theme.$.palette[palette].dropdown) === null || _13 === void 0 ? void 0 : _13.soft) === null || _14 === void 0 ? void 0 : _14.hover) === null || _15 === void 0 ? void 0 : _15.font) !== null && _16 !== void 0 ? _16 : theme.$.palette[palette].softFont) : ((_21 = (_20 = (_19 = (_18 = (_17 = theme.$.palette[palette].dropdown) === null || _17 === void 0 ? void 0 : _17.soft) === null || _18 === void 0 ? void 0 : _18.outline) === null || _19 === void 0 ? void 0 : _19.hover) === null || _20 === void 0 ? void 0 : _20.font) !== null && _21 !== void 0 ? _21 : theme.$.palette[palette].softFont)};
|
|
49
51
|
|
|
50
52
|
.svg,
|
|
51
53
|
.svg .fill {
|
|
52
|
-
fill: ${theme.$.palette[palette].softFont};
|
|
54
|
+
fill: ${!isOutline ? ((_25 = (_24 = (_23 = (_22 = theme.$.palette[palette].dropdown) === null || _22 === void 0 ? void 0 : _22.soft) === null || _23 === void 0 ? void 0 : _23.hover) === null || _24 === void 0 ? void 0 : _24.font) !== null && _25 !== void 0 ? _25 : theme.$.palette[palette].softFont) : ((_30 = (_29 = (_28 = (_27 = (_26 = theme.$.palette[palette].dropdown) === null || _26 === void 0 ? void 0 : _26.soft) === null || _27 === void 0 ? void 0 : _27.outline) === null || _28 === void 0 ? void 0 : _28.hover) === null || _29 === void 0 ? void 0 : _29.font) !== null && _30 !== void 0 ? _30 : theme.$.palette[palette].softFont)};
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
.svg .stroke {
|
|
56
|
-
stroke: ${theme.$.palette[palette].softFont};
|
|
58
|
+
stroke: ${!isOutline ? ((_34 = (_33 = (_32 = (_31 = theme.$.palette[palette].dropdown) === null || _31 === void 0 ? void 0 : _31.soft) === null || _32 === void 0 ? void 0 : _32.hover) === null || _33 === void 0 ? void 0 : _33.font) !== null && _34 !== void 0 ? _34 : theme.$.palette[palette].softFont) : ((_39 = (_38 = (_37 = (_36 = (_35 = theme.$.palette[palette].dropdown) === null || _35 === void 0 ? void 0 : _35.soft) === null || _36 === void 0 ? void 0 : _36.outline) === null || _37 === void 0 ? void 0 : _37.hover) === null || _38 === void 0 ? void 0 : _38.font) !== null && _39 !== void 0 ? _39 : theme.$.palette[palette].softFont)};
|
|
57
59
|
}
|
|
58
60
|
`}
|
|
59
61
|
${!isHovered ? '}' : ''}
|
|
60
62
|
`
|
|
61
|
-
|
|
63
|
+
: ''}
|
|
62
64
|
`
|
|
63
|
-
|
|
65
|
+
: `
|
|
64
66
|
${!isSoft
|
|
65
|
-
|
|
66
|
-
background: ${!isOutline ? theme.$.palette[palette].dynamicest : theme.$.palette[palette].dynamicer};
|
|
67
|
-
color: ${theme.$.palette[palette].font};
|
|
67
|
+
? `
|
|
68
|
+
background: ${!isOutline ? ((_42 = (_41 = (_40 = theme.$.palette[palette].dropdown) === null || _40 === void 0 ? void 0 : _40.active) === null || _41 === void 0 ? void 0 : _41.background) !== null && _42 !== void 0 ? _42 : theme.$.palette[palette].dynamicest) : ((_46 = (_45 = (_44 = (_43 = theme.$.palette[palette].dropdown) === null || _43 === void 0 ? void 0 : _43.outline) === null || _44 === void 0 ? void 0 : _44.active) === null || _45 === void 0 ? void 0 : _45.background) !== null && _46 !== void 0 ? _46 : theme.$.palette[palette].dynamicer)};
|
|
69
|
+
color: ${!isOutline ? ((_49 = (_48 = (_47 = theme.$.palette[palette].dropdown) === null || _47 === void 0 ? void 0 : _47.active) === null || _48 === void 0 ? void 0 : _48.font) !== null && _49 !== void 0 ? _49 : theme.$.palette[palette].font) : ((_53 = (_52 = (_51 = (_50 = theme.$.palette[palette].dropdown) === null || _50 === void 0 ? void 0 : _50.outline) === null || _51 === void 0 ? void 0 : _51.active) === null || _52 === void 0 ? void 0 : _52.font) !== null && _53 !== void 0 ? _53 : theme.$.palette[palette].font)};
|
|
68
70
|
|
|
69
71
|
.svg,
|
|
70
72
|
.svg .fill {
|
|
71
|
-
fill: ${theme.$.palette[palette].font};
|
|
73
|
+
fill: ${!isOutline ? ((_56 = (_55 = (_54 = theme.$.palette[palette].dropdown) === null || _54 === void 0 ? void 0 : _54.active) === null || _55 === void 0 ? void 0 : _55.font) !== null && _56 !== void 0 ? _56 : theme.$.palette[palette].font) : ((_60 = (_59 = (_58 = (_57 = theme.$.palette[palette].dropdown) === null || _57 === void 0 ? void 0 : _57.outline) === null || _58 === void 0 ? void 0 : _58.active) === null || _59 === void 0 ? void 0 : _59.font) !== null && _60 !== void 0 ? _60 : theme.$.palette[palette].font)};
|
|
72
74
|
}
|
|
73
75
|
|
|
74
76
|
.svg .stroke {
|
|
75
|
-
stroke: ${theme.$.palette[palette].font};
|
|
77
|
+
stroke: ${!isOutline ? ((_63 = (_62 = (_61 = theme.$.palette[palette].dropdown) === null || _61 === void 0 ? void 0 : _61.active) === null || _62 === void 0 ? void 0 : _62.font) !== null && _63 !== void 0 ? _63 : theme.$.palette[palette].font) : ((_67 = (_66 = (_65 = (_64 = theme.$.palette[palette].dropdown) === null || _64 === void 0 ? void 0 : _64.outline) === null || _65 === void 0 ? void 0 : _65.active) === null || _66 === void 0 ? void 0 : _66.font) !== null && _67 !== void 0 ? _67 : theme.$.palette[palette].font)};
|
|
76
78
|
}
|
|
77
79
|
`
|
|
78
|
-
|
|
79
|
-
background: ${!isOutline ? theme.$.palette[palette].softDynamicest : theme.$.palette[palette].softDynamicer};
|
|
80
|
-
color: ${theme.$.palette[palette].softFont};
|
|
80
|
+
: `
|
|
81
|
+
background: ${!isOutline ? ((_71 = (_70 = (_69 = (_68 = theme.$.palette[palette].dropdown) === null || _68 === void 0 ? void 0 : _68.soft) === null || _69 === void 0 ? void 0 : _69.active) === null || _70 === void 0 ? void 0 : _70.background) !== null && _71 !== void 0 ? _71 : theme.$.palette[palette].softDynamicest) : ((_76 = (_75 = (_74 = (_73 = (_72 = theme.$.palette[palette].dropdown) === null || _72 === void 0 ? void 0 : _72.soft) === null || _73 === void 0 ? void 0 : _73.outline) === null || _74 === void 0 ? void 0 : _74.active) === null || _75 === void 0 ? void 0 : _75.background) !== null && _76 !== void 0 ? _76 : theme.$.palette[palette].softDynamicer)};
|
|
82
|
+
color: ${!isOutline ? ((_80 = (_79 = (_78 = (_77 = theme.$.palette[palette].dropdown) === null || _77 === void 0 ? void 0 : _77.soft) === null || _78 === void 0 ? void 0 : _78.active) === null || _79 === void 0 ? void 0 : _79.font) !== null && _80 !== void 0 ? _80 : theme.$.palette[palette].softFont) : ((_85 = (_84 = (_83 = (_82 = (_81 = theme.$.palette[palette].dropdown) === null || _81 === void 0 ? void 0 : _81.soft) === null || _82 === void 0 ? void 0 : _82.outline) === null || _83 === void 0 ? void 0 : _83.active) === null || _84 === void 0 ? void 0 : _84.font) !== null && _85 !== void 0 ? _85 : theme.$.palette[palette].softFont)};
|
|
81
83
|
|
|
82
84
|
.svg,
|
|
83
85
|
.svg .fill {
|
|
84
|
-
fill: ${theme.$.palette[palette].softFont};
|
|
86
|
+
fill: ${!isOutline ? ((_89 = (_88 = (_87 = (_86 = theme.$.palette[palette].dropdown) === null || _86 === void 0 ? void 0 : _86.soft) === null || _87 === void 0 ? void 0 : _87.active) === null || _88 === void 0 ? void 0 : _88.font) !== null && _89 !== void 0 ? _89 : theme.$.palette[palette].softFont) : ((_94 = (_93 = (_92 = (_91 = (_90 = theme.$.palette[palette].dropdown) === null || _90 === void 0 ? void 0 : _90.soft) === null || _91 === void 0 ? void 0 : _91.outline) === null || _92 === void 0 ? void 0 : _92.active) === null || _93 === void 0 ? void 0 : _93.font) !== null && _94 !== void 0 ? _94 : theme.$.palette[palette].softFont)};
|
|
85
87
|
}
|
|
86
88
|
|
|
87
89
|
.svg .stroke {
|
|
88
|
-
stroke: ${theme.$.palette[palette].softFont};
|
|
90
|
+
stroke: ${!isOutline ? ((_98 = (_97 = (_96 = (_95 = theme.$.palette[palette].dropdown) === null || _95 === void 0 ? void 0 : _95.soft) === null || _96 === void 0 ? void 0 : _96.active) === null || _97 === void 0 ? void 0 : _97.font) !== null && _98 !== void 0 ? _98 : theme.$.palette[palette].softFont) : ((_103 = (_102 = (_101 = (_100 = (_99 = theme.$.palette[palette].dropdown) === null || _99 === void 0 ? void 0 : _99.soft) === null || _100 === void 0 ? void 0 : _100.outline) === null || _101 === void 0 ? void 0 : _101.active) === null || _102 === void 0 ? void 0 : _102.font) !== null && _103 !== void 0 ? _103 : theme.$.palette[palette].softFont)};
|
|
89
91
|
}
|
|
90
92
|
`}
|
|
91
93
|
`}
|
|
92
94
|
|
|
93
95
|
${isDisabled
|
|
94
|
-
|
|
96
|
+
? `
|
|
95
97
|
opacity: ${theme.$.opacity.dropdownDisabled};
|
|
96
98
|
pointer-events: none;
|
|
97
99
|
`
|
|
98
|
-
|
|
99
|
-
|
|
100
|
+
: ''}
|
|
101
|
+
`;
|
|
102
|
+
});
|
|
@@ -15,9 +15,11 @@ exports.default = (0, styled_components_1.default)(Div_1.default).attrs({
|
|
|
15
15
|
padding: ${t.$.size.dropdown[v].padding.y} ${t.$.size.dropdown[v].padding.x};
|
|
16
16
|
}
|
|
17
17
|
`,
|
|
18
|
-
})(({ theme, isOutline, isSoft, palette }) =>
|
|
18
|
+
})(({ theme, isOutline, isSoft, palette }) => {
|
|
19
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13;
|
|
20
|
+
return `
|
|
19
21
|
border-radius: ${theme.$.radius.dropdown};
|
|
20
|
-
box-shadow: 0 0 10px 1px ${theme.$.color.dynamic.shadow};
|
|
22
|
+
box-shadow: 0 0 10px 1px ${(_b = (_a = theme.$.palette[palette].dropdown) === null || _a === void 0 ? void 0 : _a.shadow) !== null && _b !== void 0 ? _b : theme.$.color.dynamic.shadow};
|
|
21
23
|
font-family: ${theme.$.fontFamily.dropdown};
|
|
22
24
|
height: inherit;
|
|
23
25
|
overflow: auto;
|
|
@@ -31,14 +33,15 @@ exports.default = (0, styled_components_1.default)(Div_1.default).attrs({
|
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
${!isOutline
|
|
34
|
-
|
|
35
|
-
background: ${!isSoft ? theme.$.palette[palette].main : theme.$.palette[palette].soft};
|
|
36
|
-
color: ${!isSoft ? theme.$.palette[palette].font : theme.$.palette[palette].softFont};
|
|
37
|
-
fill: ${!isSoft ? theme.$.palette[palette].font : theme.$.palette[palette].softFont};
|
|
36
|
+
? `
|
|
37
|
+
background: ${!isSoft ? ((_d = (_c = theme.$.palette[palette].dropdown) === null || _c === void 0 ? void 0 : _c.background) !== null && _d !== void 0 ? _d : theme.$.palette[palette].main) : ((_g = (_f = (_e = theme.$.palette[palette].dropdown) === null || _e === void 0 ? void 0 : _e.soft) === null || _f === void 0 ? void 0 : _f.background) !== null && _g !== void 0 ? _g : theme.$.palette[palette].soft)};
|
|
38
|
+
color: ${!isSoft ? ((_j = (_h = theme.$.palette[palette].dropdown) === null || _h === void 0 ? void 0 : _h.font) !== null && _j !== void 0 ? _j : theme.$.palette[palette].font) : ((_m = (_l = (_k = theme.$.palette[palette].dropdown) === null || _k === void 0 ? void 0 : _k.soft) === null || _l === void 0 ? void 0 : _l.font) !== null && _m !== void 0 ? _m : theme.$.palette[palette].softFont)};
|
|
39
|
+
fill: ${!isSoft ? ((_p = (_o = theme.$.palette[palette].dropdown) === null || _o === void 0 ? void 0 : _o.font) !== null && _p !== void 0 ? _p : theme.$.palette[palette].font) : ((_s = (_r = (_q = theme.$.palette[palette].dropdown) === null || _q === void 0 ? void 0 : _q.soft) === null || _r === void 0 ? void 0 : _r.font) !== null && _s !== void 0 ? _s : theme.$.palette[palette].softFont)};
|
|
38
40
|
`
|
|
39
|
-
|
|
40
|
-
background: ${theme.$.color.dynamic.background};
|
|
41
|
-
color: ${theme.$.color.dynamic.font};
|
|
42
|
-
fill: ${theme.$.color.dynamic.font};
|
|
41
|
+
: `
|
|
42
|
+
background: ${!isSoft ? ((_v = (_u = (_t = theme.$.palette[palette].dropdown) === null || _t === void 0 ? void 0 : _t.outline) === null || _u === void 0 ? void 0 : _u.background) !== null && _v !== void 0 ? _v : theme.$.color.dynamic.background) : ((_z = (_y = (_x = (_w = theme.$.palette[palette].dropdown) === null || _w === void 0 ? void 0 : _w.soft) === null || _x === void 0 ? void 0 : _x.outline) === null || _y === void 0 ? void 0 : _y.background) !== null && _z !== void 0 ? _z : theme.$.color.dynamic.background)};
|
|
43
|
+
color: ${!isSoft ? ((_2 = (_1 = (_0 = theme.$.palette[palette].dropdown) === null || _0 === void 0 ? void 0 : _0.outline) === null || _1 === void 0 ? void 0 : _1.font) !== null && _2 !== void 0 ? _2 : theme.$.color.dynamic.font) : ((_6 = (_5 = (_4 = (_3 = theme.$.palette[palette].dropdown) === null || _3 === void 0 ? void 0 : _3.soft) === null || _4 === void 0 ? void 0 : _4.outline) === null || _5 === void 0 ? void 0 : _5.font) !== null && _6 !== void 0 ? _6 : theme.$.color.dynamic.font)};
|
|
44
|
+
fill: ${!isSoft ? ((_9 = (_8 = (_7 = theme.$.palette[palette].dropdown) === null || _7 === void 0 ? void 0 : _7.outline) === null || _8 === void 0 ? void 0 : _8.font) !== null && _9 !== void 0 ? _9 : theme.$.color.dynamic.font) : ((_13 = (_12 = (_11 = (_10 = theme.$.palette[palette].dropdown) === null || _10 === void 0 ? void 0 : _10.soft) === null || _11 === void 0 ? void 0 : _11.outline) === null || _12 === void 0 ? void 0 : _12.font) !== null && _13 !== void 0 ? _13 : theme.$.color.dynamic.font)};
|
|
43
45
|
`}
|
|
44
|
-
|
|
46
|
+
`;
|
|
47
|
+
});
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { StyledProps } from '@smart-react-components/core/styled-props';
|
|
2
|
-
import { ResponsiveProp, SizeProp } from '@smart-react-components/core/types';
|
|
2
|
+
import { PaletteProp, ResponsiveProp, SizeProp } from '@smart-react-components/core/types';
|
|
3
3
|
import { OrderPosition } from '../../types';
|
|
4
4
|
interface Props extends StyledProps, ResponsiveProp<'formSize', SizeProp> {
|
|
5
5
|
isBlock: boolean;
|
|
6
6
|
isDisabled: boolean;
|
|
7
7
|
labelPosition: OrderPosition;
|
|
8
|
+
palette: PaletteProp;
|
|
8
9
|
}
|
|
9
10
|
declare const _default: import("styled-components").StyledComponent<"label", any, StyledProps & Props, never>;
|
|
10
11
|
export default _default;
|
|
@@ -24,7 +24,9 @@ exports.default = (0, styled_components_1.default)(Label_1.default).attrs(({ isB
|
|
|
24
24
|
margin-${types_1.OrderPosition[(0, props_1.getReverseOrderPosition)(labelPosition)].toLowerCase()}: ${(0, css_1.toCSSValue)(t.$.size.form.inlineLabel[v].margin.x)(form_1.calculateFormLabelMarginX)};
|
|
25
25
|
}
|
|
26
26
|
`,
|
|
27
|
-
}))(({ theme, isBlock, isDisabled, labelPosition }) =>
|
|
27
|
+
}))(({ theme, palette, isBlock, isDisabled, labelPosition }) => {
|
|
28
|
+
var _a, _b, _c;
|
|
29
|
+
return `
|
|
28
30
|
align-items: center;
|
|
29
31
|
cursor: ${theme.$.cursor.formInlineLabel};
|
|
30
32
|
display: ${isBlock ? 'flex' : 'inline-flex'};
|
|
@@ -36,7 +38,7 @@ exports.default = (0, styled_components_1.default)(Label_1.default).attrs(({ isB
|
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
> span {
|
|
39
|
-
color: ${theme.$.color.dynamic.bodyFont};
|
|
41
|
+
color: ${(_c = (_b = (_a = theme.$.palette[palette].form) === null || _a === void 0 ? void 0 : _a.inlineLabel) === null || _b === void 0 ? void 0 : _b.font) !== null && _c !== void 0 ? _c : theme.$.color.dynamic.bodyFont};
|
|
40
42
|
display: inline-flex;
|
|
41
43
|
flex: 1 1 auto;
|
|
42
44
|
font-family: ${theme.$.fontFamily.form};
|
|
@@ -46,14 +48,14 @@ exports.default = (0, styled_components_1.default)(Label_1.default).attrs(({ isB
|
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
${isDisabled
|
|
49
|
-
|
|
51
|
+
? `
|
|
50
52
|
opacity: ${theme.$.opacity.formDisabled};
|
|
51
53
|
pointer-events: none;
|
|
52
54
|
`
|
|
53
|
-
|
|
55
|
+
: ''}
|
|
54
56
|
|
|
55
57
|
${labelPosition === types_1.OrderPosition.LEFT
|
|
56
|
-
|
|
58
|
+
? `
|
|
57
59
|
> span {
|
|
58
60
|
order: 1;
|
|
59
61
|
}
|
|
@@ -62,5 +64,6 @@ exports.default = (0, styled_components_1.default)(Label_1.default).attrs(({ isB
|
|
|
62
64
|
order: 2;
|
|
63
65
|
}
|
|
64
66
|
`
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
: ''}
|
|
68
|
+
`;
|
|
69
|
+
});
|
|
@@ -19,45 +19,47 @@ exports.Percentage = styled_components_1.default.div `
|
|
|
19
19
|
flex: 0 0 auto;
|
|
20
20
|
position: relative;
|
|
21
21
|
`;
|
|
22
|
-
exports.default = (0, styled_components_1.default)(Div_1.default)(({ theme, hasStripedAnimation, height, isFilled, isNested, isStriped, palette, stripedAnimationDuration, transitionDuration, transitionTimingFunction }) =>
|
|
22
|
+
exports.default = (0, styled_components_1.default)(Div_1.default)(({ theme, hasStripedAnimation, height, isFilled, isNested, isStriped, palette, stripedAnimationDuration, transitionDuration, transitionTimingFunction }) => {
|
|
23
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
24
|
+
return `
|
|
23
25
|
align-items: center;
|
|
24
|
-
color: ${theme.$.palette[palette].main};
|
|
26
|
+
color: ${(_b = (_a = theme.$.palette[palette].progressBar) === null || _a === void 0 ? void 0 : _a.background) !== null && _b !== void 0 ? _b : theme.$.palette[palette].main};
|
|
25
27
|
display: flex;
|
|
26
|
-
fill: ${theme.$.palette[palette].main};
|
|
28
|
+
fill: ${(_d = (_c = theme.$.palette[palette].progressBar) === null || _c === void 0 ? void 0 : _c.background) !== null && _d !== void 0 ? _d : theme.$.palette[palette].main};
|
|
27
29
|
overflow: hidden;
|
|
28
30
|
position: relative;
|
|
29
31
|
|
|
30
32
|
${exports.Bar} {
|
|
31
|
-
background: ${theme.$.palette[palette].main};
|
|
32
|
-
color: ${theme.$.palette[palette].font};
|
|
33
|
-
fill: ${theme.$.palette[palette].font};
|
|
33
|
+
background: ${(_f = (_e = theme.$.palette[palette].progressBar) === null || _e === void 0 ? void 0 : _e.background) !== null && _f !== void 0 ? _f : theme.$.palette[palette].main};
|
|
34
|
+
color: ${(_h = (_g = theme.$.palette[palette].progressBar) === null || _g === void 0 ? void 0 : _g.font) !== null && _h !== void 0 ? _h : theme.$.palette[palette].font};
|
|
35
|
+
fill: ${(_k = (_j = theme.$.palette[palette].progressBar) === null || _j === void 0 ? void 0 : _j.font) !== null && _k !== void 0 ? _k : theme.$.palette[palette].font};
|
|
34
36
|
transition: width ${transitionDuration}ms 0s ${transitionTimingFunction};
|
|
35
37
|
|
|
36
38
|
${isNested
|
|
37
|
-
|
|
38
|
-
background: ${(0, color_1.getColor)(theme.$.color.light.background).alpha(.3).rgb().toString()};
|
|
39
|
+
? `
|
|
40
|
+
background: ${((_m = (_l = theme.$.palette[palette].progressBar) === null || _l === void 0 ? void 0 : _l.nested) === null || _m === void 0 ? void 0 : _m.background) ? (_p = (_o = theme.$.palette[palette].progressBar) === null || _o === void 0 ? void 0 : _o.nested) === null || _p === void 0 ? void 0 : _p.background : (0, color_1.getColor)(theme.$.color.light.background).alpha(.3).rgb().toString()};
|
|
39
41
|
`
|
|
40
|
-
|
|
42
|
+
: `
|
|
41
43
|
border-radius: .125rem;
|
|
42
44
|
`}
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
${isFilled
|
|
46
|
-
|
|
47
|
-
background: ${theme.$.color.dynamic.gray};
|
|
48
|
+
? `
|
|
49
|
+
background: ${(_s = (_r = (_q = theme.$.palette[palette].progressBar) === null || _q === void 0 ? void 0 : _q.filled) === null || _r === void 0 ? void 0 : _r.background) !== null && _s !== void 0 ? _s : theme.$.color.dynamic.gray};
|
|
48
50
|
`
|
|
49
|
-
|
|
51
|
+
: ''}
|
|
50
52
|
|
|
51
53
|
${isNested
|
|
52
|
-
|
|
54
|
+
? `
|
|
53
55
|
flex: 1 1 auto;
|
|
54
56
|
`
|
|
55
|
-
|
|
57
|
+
: `
|
|
56
58
|
border-radius: .125rem;
|
|
57
59
|
`}
|
|
58
60
|
|
|
59
61
|
${isStriped
|
|
60
|
-
|
|
62
|
+
? `
|
|
61
63
|
&,
|
|
62
64
|
${exports.Bar} {
|
|
63
65
|
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
|
@@ -65,7 +67,7 @@ exports.default = (0, styled_components_1.default)(Div_1.default)(({ theme, hasS
|
|
|
65
67
|
}
|
|
66
68
|
|
|
67
69
|
${hasStripedAnimation
|
|
68
|
-
|
|
70
|
+
? `
|
|
69
71
|
&,
|
|
70
72
|
${exports.Bar} {
|
|
71
73
|
animation: src-progress-bar-stripes ${stripedAnimationDuration}ms 0s ${transitionTimingFunction} infinite;
|
|
@@ -81,7 +83,8 @@ exports.default = (0, styled_components_1.default)(Div_1.default)(({ theme, hasS
|
|
|
81
83
|
}
|
|
82
84
|
}
|
|
83
85
|
`
|
|
84
|
-
|
|
86
|
+
: ''}
|
|
85
87
|
`
|
|
86
|
-
|
|
87
|
-
|
|
88
|
+
: ''}
|
|
89
|
+
`;
|
|
90
|
+
});
|
|
@@ -10,15 +10,18 @@ const css_1 = require("../../util/css");
|
|
|
10
10
|
const radio_1 = require("../../util/radio");
|
|
11
11
|
const Container = styled_components_1.default.div.attrs({
|
|
12
12
|
className: 'src-radio-container',
|
|
13
|
-
})(({ theme }) =>
|
|
13
|
+
})(({ theme, palette }) => {
|
|
14
|
+
var _a, _b;
|
|
15
|
+
return `
|
|
14
16
|
align-items: center;
|
|
15
|
-
border: solid 2px ${theme.$.color.dynamic.accent};
|
|
17
|
+
border: solid 2px ${(_b = (_a = theme.$.palette[palette].radio) === null || _a === void 0 ? void 0 : _a.border) !== null && _b !== void 0 ? _b : theme.$.color.dynamic.accent};
|
|
16
18
|
border-radius: 100%;
|
|
17
19
|
box-sizing: border-box;
|
|
18
20
|
display: flex;
|
|
19
21
|
justify-content: center;
|
|
20
22
|
height: 100%;
|
|
21
|
-
|
|
23
|
+
`;
|
|
24
|
+
});
|
|
22
25
|
const OuterCircle = styled_components_1.default.div.attrs({
|
|
23
26
|
className: 'src-radio-outer-circle',
|
|
24
27
|
}) `
|
|
@@ -33,17 +36,20 @@ const OuterCircle = styled_components_1.default.div.attrs({
|
|
|
33
36
|
`;
|
|
34
37
|
const InnerCircle = styled_components_1.default.div.attrs({
|
|
35
38
|
className: 'src-radio-inner-circle',
|
|
36
|
-
})(({ theme }) =>
|
|
37
|
-
|
|
39
|
+
})(({ theme, palette }) => {
|
|
40
|
+
var _a, _b, _c;
|
|
41
|
+
return `
|
|
42
|
+
background: ${(_c = (_b = (_a = theme.$.palette[palette].radio) === null || _a === void 0 ? void 0 : _a.active) === null || _b === void 0 ? void 0 : _b.mark) !== null && _c !== void 0 ? _c : theme.$.color.white};
|
|
38
43
|
border-radius: 100%;
|
|
39
44
|
flex: 0 0 auto;
|
|
40
|
-
|
|
41
|
-
|
|
45
|
+
`;
|
|
46
|
+
});
|
|
47
|
+
exports.default = (0, styled_components_1.default)(Div_1.default).attrs(({ children, palette }) => ({
|
|
42
48
|
children: (react_1.default.createElement(react_1.default.Fragment, null,
|
|
43
49
|
children && children,
|
|
44
|
-
react_1.default.createElement(Container,
|
|
50
|
+
react_1.default.createElement(Container, { palette: palette },
|
|
45
51
|
react_1.default.createElement(OuterCircle, null,
|
|
46
|
-
react_1.default.createElement(InnerCircle,
|
|
52
|
+
react_1.default.createElement(InnerCircle, { palette: palette }))))),
|
|
47
53
|
getRadioSize: (v, t) => `
|
|
48
54
|
height: ${t.$.size.radio[v]};
|
|
49
55
|
width: ${t.$.size.radio[v]};
|
|
@@ -53,28 +59,31 @@ exports.default = (0, styled_components_1.default)(Div_1.default).attrs(({ child
|
|
|
53
59
|
width: ${(0, css_1.toCSSValue)(t.$.size.radio[v])(v => (0, radio_1.calculateRadioInnerCircleSize)(v))};
|
|
54
60
|
}
|
|
55
61
|
`,
|
|
56
|
-
}))(({ theme, isChecked, isOutline, isSoft, palette }) =>
|
|
62
|
+
}))(({ theme, isChecked, isOutline, isSoft, palette }) => {
|
|
63
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
64
|
+
return `
|
|
57
65
|
position: relative;
|
|
58
66
|
|
|
59
67
|
${!isOutline
|
|
60
|
-
|
|
68
|
+
? `
|
|
61
69
|
.src-radio-container {
|
|
62
|
-
background: ${theme.$.color.dynamic.accent};
|
|
70
|
+
background: ${(_b = (_a = theme.$.palette[palette].radio) === null || _a === void 0 ? void 0 : _a.background) !== null && _b !== void 0 ? _b : theme.$.color.dynamic.accent};
|
|
63
71
|
}
|
|
64
72
|
`
|
|
65
|
-
|
|
73
|
+
: ''}
|
|
66
74
|
|
|
67
75
|
.src-radio-outer-circle {
|
|
68
|
-
background: ${!isSoft ? theme.$.palette[palette].main : theme.$.palette[palette].soft};
|
|
76
|
+
background: ${!isSoft ? ((_e = (_d = (_c = theme.$.palette[palette].radio) === null || _c === void 0 ? void 0 : _c.active) === null || _d === void 0 ? void 0 : _d.background) !== null && _e !== void 0 ? _e : theme.$.palette[palette].main) : ((_j = (_h = (_g = (_f = theme.$.palette[palette].radio) === null || _f === void 0 ? void 0 : _f.soft) === null || _g === void 0 ? void 0 : _g.active) === null || _h === void 0 ? void 0 : _h.background) !== null && _j !== void 0 ? _j : theme.$.palette[palette].soft)};
|
|
69
77
|
|
|
70
78
|
${!isChecked
|
|
71
|
-
|
|
79
|
+
? `
|
|
72
80
|
height: 0;
|
|
73
81
|
width: 0;
|
|
74
82
|
`
|
|
75
|
-
|
|
83
|
+
: `
|
|
76
84
|
height: calc(100% + 4px);
|
|
77
85
|
width: calc(100% + 4px);
|
|
78
86
|
`}
|
|
79
87
|
}
|
|
80
|
-
|
|
88
|
+
`;
|
|
89
|
+
});
|
|
@@ -9,8 +9,10 @@ const styled_components_1 = __importDefault(require("styled-components"));
|
|
|
9
9
|
const css_1 = require("../../util/css");
|
|
10
10
|
const Slider = styled_components_1.default.div.attrs({
|
|
11
11
|
className: 'switch-slider',
|
|
12
|
-
})(({ theme }) =>
|
|
13
|
-
|
|
12
|
+
})(({ theme, palette }) => {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
return `
|
|
15
|
+
background: ${(_b = (_a = theme.$.palette[palette].slider) === null || _a === void 0 ? void 0 : _a.mark) !== null && _b !== void 0 ? _b : theme.$.color.white};
|
|
14
16
|
border-radius: 100%;
|
|
15
17
|
box-shadow: 0 1px 3px rgba(0,0,0,.4);
|
|
16
18
|
left: 0;
|
|
@@ -18,11 +20,12 @@ const Slider = styled_components_1.default.div.attrs({
|
|
|
18
20
|
top: 0;
|
|
19
21
|
transition: 200ms 0s ease-in-out;
|
|
20
22
|
transition-property: left, right;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
`;
|
|
24
|
+
});
|
|
25
|
+
exports.default = (0, styled_components_1.default)(Div_1.default).attrs(({ children, isChecked, palette }) => ({
|
|
23
26
|
children: (react_1.default.createElement(react_1.default.Fragment, null,
|
|
24
27
|
children,
|
|
25
|
-
react_1.default.createElement(Slider,
|
|
28
|
+
react_1.default.createElement(Slider, { palette: palette }))),
|
|
26
29
|
getCheckboxSize: (v, t) => `
|
|
27
30
|
height: ${t.$.size.switch[v].height};
|
|
28
31
|
width: ${t.$.size.switch[v].width};
|
|
@@ -38,7 +41,9 @@ exports.default = (0, styled_components_1.default)(Div_1.default).attrs(({ child
|
|
|
38
41
|
: ''}
|
|
39
42
|
}
|
|
40
43
|
`,
|
|
41
|
-
}))(({ theme, isChecked, isOutline, isSoft, palette }) =>
|
|
44
|
+
}))(({ theme, isChecked, isOutline, isSoft, palette }) => {
|
|
45
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
46
|
+
return `
|
|
42
47
|
border: solid 1px ${theme.$.color.dynamic.accent};
|
|
43
48
|
border-radius: 20px;
|
|
44
49
|
box-sizing: border-box;
|
|
@@ -47,27 +52,28 @@ exports.default = (0, styled_components_1.default)(Div_1.default).attrs(({ child
|
|
|
47
52
|
transition-property: border, box-shadow;
|
|
48
53
|
|
|
49
54
|
${!isOutline
|
|
50
|
-
|
|
51
|
-
background: ${theme.$.color.dynamic.accent};
|
|
52
|
-
box-shadow: ${theme.$.color.dynamic.accent} 0 0 0 0 inset;
|
|
55
|
+
? `
|
|
56
|
+
background: ${(_b = (_a = theme.$.palette[palette].switch) === null || _a === void 0 ? void 0 : _a.background) !== null && _b !== void 0 ? _b : theme.$.color.dynamic.accent};
|
|
57
|
+
box-shadow: ${(_d = (_c = theme.$.palette[palette].switch) === null || _c === void 0 ? void 0 : _c.background) !== null && _d !== void 0 ? _d : theme.$.color.dynamic.accent} 0 0 0 0 inset;
|
|
53
58
|
`
|
|
54
|
-
|
|
59
|
+
: ''}
|
|
55
60
|
|
|
56
61
|
${isChecked
|
|
57
|
-
|
|
62
|
+
? `
|
|
58
63
|
transition: border 400ms 0s ease-in-out, box-shadow 400ms 0s ease-in-out, background 0s 400ms ease-in-out;
|
|
59
64
|
|
|
60
65
|
${!isSoft
|
|
61
|
-
|
|
62
|
-
background: ${theme.$.palette[palette].main};
|
|
63
|
-
border-color: ${theme.$.palette[palette].main};
|
|
64
|
-
box-shadow: ${theme.$.palette[palette].main} 0 0 0 11px inset;
|
|
66
|
+
? `
|
|
67
|
+
background: ${(_g = (_f = (_e = theme.$.palette[palette].switch) === null || _e === void 0 ? void 0 : _e.active) === null || _f === void 0 ? void 0 : _f.background) !== null && _g !== void 0 ? _g : theme.$.palette[palette].main};
|
|
68
|
+
border-color: ${(_k = (_j = (_h = theme.$.palette[palette].switch) === null || _h === void 0 ? void 0 : _h.active) === null || _j === void 0 ? void 0 : _j.background) !== null && _k !== void 0 ? _k : theme.$.palette[palette].main};
|
|
69
|
+
box-shadow: ${(_o = (_m = (_l = theme.$.palette[palette].switch) === null || _l === void 0 ? void 0 : _l.active) === null || _m === void 0 ? void 0 : _m.background) !== null && _o !== void 0 ? _o : theme.$.palette[palette].main} 0 0 0 11px inset;
|
|
65
70
|
`
|
|
66
|
-
|
|
67
|
-
background: ${theme.$.palette[palette].soft};
|
|
68
|
-
border-color: ${theme.$.palette[palette].soft};
|
|
69
|
-
box-shadow: ${theme.$.palette[palette].soft} 0 0 0 11px inset;
|
|
71
|
+
: `
|
|
72
|
+
background: ${(_s = (_r = (_q = (_p = theme.$.palette[palette].switch) === null || _p === void 0 ? void 0 : _p.soft) === null || _q === void 0 ? void 0 : _q.active) === null || _r === void 0 ? void 0 : _r.background) !== null && _s !== void 0 ? _s : theme.$.palette[palette].soft};
|
|
73
|
+
border-color: ${(_w = (_v = (_u = (_t = theme.$.palette[palette].switch) === null || _t === void 0 ? void 0 : _t.soft) === null || _u === void 0 ? void 0 : _u.active) === null || _v === void 0 ? void 0 : _v.background) !== null && _w !== void 0 ? _w : theme.$.palette[palette].soft};
|
|
74
|
+
box-shadow: ${(_0 = (_z = (_y = (_x = theme.$.palette[palette].switch) === null || _x === void 0 ? void 0 : _x.soft) === null || _y === void 0 ? void 0 : _y.active) === null || _z === void 0 ? void 0 : _z.background) !== null && _0 !== void 0 ? _0 : theme.$.palette[palette].soft} 0 0 0 11px inset;
|
|
70
75
|
`}
|
|
71
76
|
`
|
|
72
|
-
|
|
73
|
-
|
|
77
|
+
: ''}
|
|
78
|
+
`;
|
|
79
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smart-react-components/ui",
|
|
3
|
-
"version": "2.1.0-alpha-
|
|
3
|
+
"version": "2.1.0-alpha-8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"description": "SRC UI includes React and Styled components.",
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
"test": "jest"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@smart-react-components/core": "2.1.0-alpha-
|
|
68
|
-
"@smart-react-components/router": "2.1.0-alpha-
|
|
69
|
-
"@smart-react-components/transition": "2.1.0-alpha-
|
|
67
|
+
"@smart-react-components/core": "2.1.0-alpha-8",
|
|
68
|
+
"@smart-react-components/router": "2.1.0-alpha-5",
|
|
69
|
+
"@smart-react-components/transition": "2.1.0-alpha-5",
|
|
70
70
|
"@testing-library/react": "13.4.0",
|
|
71
71
|
"@types/jest": "29.0.1",
|
|
72
72
|
"@types/react": "18.0.19",
|
|
@@ -83,9 +83,9 @@
|
|
|
83
83
|
"typescript": "4.8.3"
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
|
-
"@smart-react-components/core": "^2.1.0-alpha-
|
|
87
|
-
"@smart-react-components/router": "^2.1.0-alpha-
|
|
88
|
-
"@smart-react-components/transition": "^2.1.0-alpha-
|
|
86
|
+
"@smart-react-components/core": "^2.1.0-alpha-8",
|
|
87
|
+
"@smart-react-components/router": "^2.1.0-alpha-5",
|
|
88
|
+
"@smart-react-components/transition": "^2.1.0-alpha-5",
|
|
89
89
|
"react": "^18.2.0",
|
|
90
90
|
"react-dom": "^18.2.0",
|
|
91
91
|
"styled-components": "^5.3.5"
|