@smart-react-components/ui 2.0.12 → 2.0.14
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.
|
@@ -24,7 +24,9 @@ exports.default = (0, styled_components_1.default)(Input_1.default).attrs(({ cla
|
|
|
24
24
|
padding-right: ${(0, css_1.toCSSValue)(t.$.size.input[v].padding.x)(v => v / 2)};
|
|
25
25
|
`
|
|
26
26
|
: ''}
|
|
27
|
-
`, isInput })))(({ theme, cursorKey, isDisabled, isFocused, isInput, isOutline, isSoft, palette }) =>
|
|
27
|
+
`, isInput })))(({ theme, cursorKey, isDisabled, isFocused, isInput, isOutline, isSoft, palette }) => {
|
|
28
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
29
|
+
return `
|
|
28
30
|
border: 0;
|
|
29
31
|
border-radius: 0;
|
|
30
32
|
flex: 1 1 auto;
|
|
@@ -36,68 +38,71 @@ exports.default = (0, styled_components_1.default)(Input_1.default).attrs(({ cla
|
|
|
36
38
|
-webkit-tap-highlight-color: transparent;
|
|
37
39
|
|
|
38
40
|
${(!isOutline && isSoft)
|
|
39
|
-
|
|
41
|
+
? `
|
|
40
42
|
font-weight: ${theme.$.fontWeight.bold};
|
|
41
43
|
`
|
|
42
|
-
|
|
44
|
+
: ''}
|
|
43
45
|
|
|
44
46
|
${!isOutline
|
|
45
|
-
? `
|
|
46
|
-
${!isSoft
|
|
47
47
|
? `
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
${!isSoft
|
|
49
|
+
? `
|
|
50
|
+
background: ${!isFocused ? ((_b = (_a = theme.$.palette[palette].input) === null || _a === void 0 ? void 0 : _a.background) !== null && _b !== void 0 ? _b : theme.$.palette[palette].main) : ((_e = (_d = (_c = theme.$.palette[palette].input) === null || _c === void 0 ? void 0 : _c.focused) === null || _d === void 0 ? void 0 : _d.background) !== null && _e !== void 0 ? _e : theme.$.palette[palette].dynamicer)};
|
|
51
|
+
color: ${(_g = (_f = theme.$.palette[palette].input) === null || _f === void 0 ? void 0 : _f.font) !== null && _g !== void 0 ? _g : theme.$.palette[palette].font};
|
|
50
52
|
`
|
|
51
|
-
|
|
53
|
+
: `
|
|
52
54
|
background: ${!isFocused ? theme.$.palette[palette].soft : theme.$.palette[palette].softDynamicer};
|
|
53
55
|
color: ${theme.$.palette[palette].softFont};
|
|
54
56
|
`}
|
|
55
57
|
|
|
56
58
|
${!isInput
|
|
57
|
-
|
|
59
|
+
? `
|
|
58
60
|
${InputPlaceholder_1.default} {
|
|
59
|
-
color: ${(0, color_1.getColor)(!isSoft ? theme.$.palette[palette].font : theme.$.palette[palette].softFont).alpha(theme.$.opacity.inputPlaceholder).rgb().toString()};
|
|
61
|
+
color: ${(!isSoft && ((_j = (_h = theme.$.palette[palette].input) === null || _h === void 0 ? void 0 : _h.placeholder) === null || _j === void 0 ? void 0 : _j.font)) ? (_l = (_k = theme.$.palette[palette].input) === null || _k === void 0 ? void 0 : _k.placeholder) === null || _l === void 0 ? void 0 : _l.font : (0, color_1.getColor)(!isSoft ? theme.$.palette[palette].font : theme.$.palette[palette].softFont).alpha(theme.$.opacity.inputPlaceholder).rgb().toString()};
|
|
60
62
|
}
|
|
61
63
|
`
|
|
62
|
-
|
|
63
|
-
${dom_1.placeholder.map(item =>
|
|
64
|
+
: `
|
|
65
|
+
${dom_1.placeholder.map(item => {
|
|
66
|
+
var _a, _b, _c, _d;
|
|
67
|
+
return `
|
|
64
68
|
&${item} {
|
|
65
|
-
color: ${(0, color_1.getColor)(!isSoft ? theme.$.palette[palette].font : theme.$.palette[palette].softFont).alpha(theme.$.opacity.inputPlaceholder).rgb().toString()};
|
|
69
|
+
color: ${(!isSoft && ((_b = (_a = theme.$.palette[palette].input) === null || _a === void 0 ? void 0 : _a.placeholder) === null || _b === void 0 ? void 0 : _b.font)) ? (_d = (_c = theme.$.palette[palette].input) === null || _c === void 0 ? void 0 : _c.placeholder) === null || _d === void 0 ? void 0 : _d.font : (0, color_1.getColor)(!isSoft ? theme.$.palette[palette].font : theme.$.palette[palette].softFont).alpha(theme.$.opacity.inputPlaceholder).rgb().toString()};
|
|
66
70
|
opacity: 1;
|
|
67
71
|
}
|
|
68
|
-
|
|
72
|
+
`;
|
|
73
|
+
}).join(' ')}
|
|
69
74
|
`}
|
|
70
75
|
`
|
|
71
|
-
|
|
76
|
+
: `
|
|
72
77
|
background: ${theme.$.color.dynamic.background};
|
|
73
78
|
color: ${theme.$.color.dynamic.font};
|
|
74
79
|
|
|
75
80
|
${!isInput
|
|
76
|
-
? `
|
|
77
|
-
${!isDisabled
|
|
78
81
|
? `
|
|
82
|
+
${!isDisabled
|
|
83
|
+
? `
|
|
79
84
|
${InputPlaceholder_1.default} {
|
|
80
85
|
color: ${theme.$.color.dynamic.accent};
|
|
81
86
|
}
|
|
82
87
|
`
|
|
83
|
-
|
|
88
|
+
: ''}
|
|
84
89
|
`
|
|
85
|
-
|
|
90
|
+
: `
|
|
86
91
|
${dom_1.placeholder.map(item => `
|
|
87
92
|
&${item} {
|
|
88
93
|
opacity: 1;
|
|
89
94
|
|
|
90
95
|
${!isDisabled
|
|
91
|
-
|
|
96
|
+
? `
|
|
92
97
|
color: ${theme.$.color.dynamic.accent};
|
|
93
98
|
`
|
|
94
|
-
|
|
99
|
+
: ''}
|
|
95
100
|
|
|
96
101
|
${(!isOutline && isSoft)
|
|
97
|
-
|
|
102
|
+
? `
|
|
98
103
|
font-weight: ${theme.$.fontWeight.bold};
|
|
99
104
|
`
|
|
100
|
-
|
|
105
|
+
: ''}
|
|
101
106
|
}
|
|
102
107
|
`).join(' ')}
|
|
103
108
|
`}
|
|
@@ -109,24 +114,25 @@ exports.default = (0, styled_components_1.default)(Input_1.default).attrs(({ cla
|
|
|
109
114
|
}
|
|
110
115
|
|
|
111
116
|
${isDisabled && isOutline
|
|
112
|
-
|
|
117
|
+
? `
|
|
113
118
|
background: ${theme.$.color.dynamic.accent};
|
|
114
119
|
color: ${theme.$.color.dynamic.gray};
|
|
115
120
|
`
|
|
116
|
-
|
|
121
|
+
: ''}
|
|
117
122
|
|
|
118
123
|
${!isInput
|
|
119
|
-
|
|
124
|
+
? `
|
|
120
125
|
align-items: center;
|
|
121
126
|
display: flex;
|
|
122
127
|
justify-content: space-between;
|
|
123
128
|
position: relative;
|
|
124
129
|
`
|
|
125
|
-
|
|
130
|
+
: ''}
|
|
126
131
|
|
|
127
132
|
${(!isDisabled && cursorKey)
|
|
128
|
-
|
|
133
|
+
? `
|
|
129
134
|
cursor: ${theme.$.cursor[cursorKey]};
|
|
130
135
|
`
|
|
131
|
-
|
|
132
|
-
|
|
136
|
+
: ''}
|
|
137
|
+
`;
|
|
138
|
+
});
|
|
@@ -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, hasBorder, hasSeparatedLeftAddon, hasSeparatedRightAddon, isDisabled, isFocused, isOutline, isSoft, palette, shape }) =>
|
|
8
|
+
exports.default = (0, styled_components_1.default)(Div_1.default)(({ theme, hasBorder, hasSeparatedLeftAddon, hasSeparatedRightAddon, isDisabled, isFocused, isOutline, isSoft, palette, shape }) => {
|
|
9
|
+
var _a, _b, _c, _d, _e;
|
|
10
|
+
return `
|
|
9
11
|
border: ${hasBorder ? 'solid 1px' : '0'};
|
|
10
12
|
border-radius: ${theme.$.radius.input[shape]};
|
|
11
13
|
display: flex;
|
|
@@ -16,43 +18,44 @@ exports.default = (0, styled_components_1.default)(Div_1.default)(({ theme, hasB
|
|
|
16
18
|
transition-property: border;
|
|
17
19
|
|
|
18
20
|
${!isOutline
|
|
19
|
-
? `
|
|
20
|
-
${!isSoft
|
|
21
21
|
? `
|
|
22
|
-
|
|
22
|
+
${!isSoft
|
|
23
|
+
? `
|
|
24
|
+
border-color: ${!isFocused ? ((_b = (_a = theme.$.palette[palette].input) === null || _a === void 0 ? void 0 : _a.border) !== null && _b !== void 0 ? _b : theme.$.palette[palette].dark) : ((_e = (_d = (_c = theme.$.palette[palette].input) === null || _c === void 0 ? void 0 : _c.focused) === null || _d === void 0 ? void 0 : _d.border) !== null && _e !== void 0 ? _e : theme.$.palette[palette].dynamicest)};
|
|
23
25
|
`
|
|
24
|
-
|
|
26
|
+
: `
|
|
25
27
|
border-color: ${!isFocused ? theme.$.palette[palette].softDynamic : theme.$.palette[palette].softDynamicest};
|
|
26
28
|
`}
|
|
27
29
|
`
|
|
28
|
-
|
|
30
|
+
: `
|
|
29
31
|
${!isFocused
|
|
30
|
-
|
|
32
|
+
? `
|
|
31
33
|
border-color: ${theme.$.color.dynamic.accent};
|
|
32
34
|
`
|
|
33
|
-
|
|
35
|
+
: `
|
|
34
36
|
border-color: ${!isSoft ? theme.$.palette[palette].main : theme.$.palette[palette].soft};
|
|
35
37
|
`}
|
|
36
38
|
`}
|
|
37
39
|
|
|
38
40
|
${isDisabled
|
|
39
|
-
|
|
41
|
+
? `
|
|
40
42
|
opacity: ${theme.$.opacity.formDisabled};
|
|
41
43
|
`
|
|
42
|
-
|
|
44
|
+
: ''}
|
|
43
45
|
|
|
44
46
|
${(hasSeparatedLeftAddon)
|
|
45
|
-
|
|
47
|
+
? `
|
|
46
48
|
border-left: 0;
|
|
47
49
|
border-bottom-left-radius: 0;
|
|
48
50
|
border-top-left-radius: 0;
|
|
49
51
|
`
|
|
50
|
-
|
|
52
|
+
: ''}
|
|
51
53
|
${hasSeparatedRightAddon
|
|
52
|
-
|
|
54
|
+
? `
|
|
53
55
|
border-right: 0;
|
|
54
56
|
border-bottom-right-radius: 0;
|
|
55
57
|
border-top-right-radius: 0;
|
|
56
58
|
`
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
: ''}
|
|
60
|
+
`;
|
|
61
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smart-react-components/ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.14",
|
|
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.0.
|
|
68
|
-
"@smart-react-components/router": "2.0.
|
|
69
|
-
"@smart-react-components/transition": "2.0.
|
|
67
|
+
"@smart-react-components/core": "2.0.12",
|
|
68
|
+
"@smart-react-components/router": "2.0.10",
|
|
69
|
+
"@smart-react-components/transition": "2.0.11",
|
|
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.0.
|
|
87
|
-
"@smart-react-components/router": "^2.0.
|
|
88
|
-
"@smart-react-components/transition": "^2.0.
|
|
86
|
+
"@smart-react-components/core": "^2.0.12",
|
|
87
|
+
"@smart-react-components/router": "^2.0.10",
|
|
88
|
+
"@smart-react-components/transition": "^2.0.11",
|
|
89
89
|
"react": "^18.2.0",
|
|
90
90
|
"react-dom": "^18.2.0",
|
|
91
91
|
"styled-components": "^5.3.5"
|