@alfalab/core-components-with-suffix 4.2.20 → 4.2.21
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/Component.js +7 -4
- package/cssm/Component.js +6 -3
- package/cssm/index.module.css +21 -2
- package/esm/Component.js +7 -4
- package/esm/index.css +31 -12
- package/index.css +31 -12
- package/modern/Component.js +4 -1
- package/modern/index.css +31 -12
- package/moderncssm/Component.js +3 -0
- package/moderncssm/index.module.css +23 -0
- package/package.json +4 -4
- package/src/Component.tsx +4 -0
- package/src/index.module.css +19 -0
package/Component.js
CHANGED
|
@@ -14,16 +14,17 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
|
14
14
|
var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
|
|
15
15
|
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
16
16
|
|
|
17
|
-
var styles = {"suffixContainer":"with-
|
|
17
|
+
var styles = {"suffixContainer":"with-suffix__suffixContainer_98wwg","bold":"with-suffix__bold_98wwg","medium":"with-suffix__medium_98wwg","size-40":"with-suffix__size-40_98wwg","suffixVisible":"with-suffix__suffixVisible_98wwg","hasSuffix":"with-suffix__hasSuffix_98wwg","spacer":"with-suffix__spacer_98wwg","suffix":"with-suffix__suffix_98wwg","disabled":"with-suffix__disabled_98wwg","inverted":"with-suffix__inverted_98wwg","readOnly":"with-suffix__readOnly_98wwg"};
|
|
18
18
|
require('./index.css')
|
|
19
19
|
|
|
20
20
|
var withSuffix = function (Input) {
|
|
21
21
|
return React.forwardRef(function (_a, ref) {
|
|
22
22
|
var _b, _c, _d;
|
|
23
|
-
var
|
|
23
|
+
var _e;
|
|
24
|
+
var value = _a.value, defaultValue = _a.defaultValue, onChange = _a.onChange, onClear = _a.onClear, _f = _a.suffix, suffix = _f === void 0 ? '' : _f, placeholder = _a.placeholder, className = _a.className, disabled = _a.disabled, readOnly = _a.readOnly, suffixContainerClassName = _a.suffixContainerClassName, restProps = tslib.__rest(_a, ["value", "defaultValue", "onChange", "onClear", "suffix", "placeholder", "className", "disabled", "readOnly", "suffixContainerClassName"]);
|
|
24
25
|
var uncontrolled = value === undefined;
|
|
25
|
-
var
|
|
26
|
-
var
|
|
26
|
+
var _g = React.useState(null), inputNode = _g[0], setInputNode = _g[1];
|
|
27
|
+
var _h = React.useState(defaultValue || ''), stateValue = _h[0], setStateValue = _h[1];
|
|
27
28
|
var handleInputChange = React.useCallback(function (event, payload) {
|
|
28
29
|
if (onChange) {
|
|
29
30
|
onChange(event, payload);
|
|
@@ -53,6 +54,8 @@ var withSuffix = function (Input) {
|
|
|
53
54
|
React__default.default.createElement(coreComponentsPortal.Portal, { getPortalContainer: getPortalContainer },
|
|
54
55
|
React__default.default.createElement("div", { translate: 'no', className: cn__default.default(styles.suffixContainer, suffixContainerClassName, (_c = {},
|
|
55
56
|
_c[styles["size-".concat(restProps.size)]] = restProps.size,
|
|
57
|
+
_c[styles.bold] = ((_e = restProps.fontWeight) !== null && _e !== void 0 ? _e : (restProps.bold ? 'bold' : 'regular')) === 'bold',
|
|
58
|
+
_c[styles.medium] = restProps.fontWeight === 'medium',
|
|
56
59
|
_c)) },
|
|
57
60
|
React__default.default.createElement("span", { className: styles.spacer }, visibleValue),
|
|
58
61
|
suffix && (React__default.default.createElement("div", { className: cn__default.default(styles.suffix, (_d = {},
|
package/cssm/Component.js
CHANGED
|
@@ -19,10 +19,11 @@ var styles__default = /*#__PURE__*/_interopDefaultCompat(styles);
|
|
|
19
19
|
var withSuffix = function (Input) {
|
|
20
20
|
return React.forwardRef(function (_a, ref) {
|
|
21
21
|
var _b, _c, _d;
|
|
22
|
-
var
|
|
22
|
+
var _e;
|
|
23
|
+
var value = _a.value, defaultValue = _a.defaultValue, onChange = _a.onChange, onClear = _a.onClear, _f = _a.suffix, suffix = _f === void 0 ? '' : _f, placeholder = _a.placeholder, className = _a.className, disabled = _a.disabled, readOnly = _a.readOnly, suffixContainerClassName = _a.suffixContainerClassName, restProps = tslib.__rest(_a, ["value", "defaultValue", "onChange", "onClear", "suffix", "placeholder", "className", "disabled", "readOnly", "suffixContainerClassName"]);
|
|
23
24
|
var uncontrolled = value === undefined;
|
|
24
|
-
var
|
|
25
|
-
var
|
|
25
|
+
var _g = React.useState(null), inputNode = _g[0], setInputNode = _g[1];
|
|
26
|
+
var _h = React.useState(defaultValue || ''), stateValue = _h[0], setStateValue = _h[1];
|
|
26
27
|
var handleInputChange = React.useCallback(function (event, payload) {
|
|
27
28
|
if (onChange) {
|
|
28
29
|
onChange(event, payload);
|
|
@@ -52,6 +53,8 @@ var withSuffix = function (Input) {
|
|
|
52
53
|
React__default.default.createElement(coreComponentsPortal.Portal, { getPortalContainer: getPortalContainer },
|
|
53
54
|
React__default.default.createElement("div", { translate: 'no', className: cn__default.default(styles__default.default.suffixContainer, suffixContainerClassName, (_c = {},
|
|
54
55
|
_c[styles__default.default["size-".concat(restProps.size)]] = restProps.size,
|
|
56
|
+
_c[styles__default.default.bold] = ((_e = restProps.fontWeight) !== null && _e !== void 0 ? _e : (restProps.bold ? 'bold' : 'regular')) === 'bold',
|
|
57
|
+
_c[styles__default.default.medium] = restProps.fontWeight === 'medium',
|
|
55
58
|
_c)) },
|
|
56
59
|
React__default.default.createElement("span", { className: styles__default.default.spacer }, visibleValue),
|
|
57
60
|
suffix && (React__default.default.createElement("div", { className: cn__default.default(styles__default.default.suffix, (_d = {},
|
package/cssm/index.module.css
CHANGED
|
@@ -52,12 +52,31 @@
|
|
|
52
52
|
align-items: center;
|
|
53
53
|
display: none;
|
|
54
54
|
pointer-events: none
|
|
55
|
-
} .suffixContainer.
|
|
55
|
+
} .suffixContainer.bold {
|
|
56
|
+
font-size: 16px;
|
|
57
|
+
line-height: 20px;
|
|
58
|
+
font-weight: 700;
|
|
59
|
+
} .suffixContainer.medium {
|
|
60
|
+
font-size: 16px;
|
|
61
|
+
line-height: 20px;
|
|
62
|
+
font-weight: 500;
|
|
63
|
+
} .suffixContainer.size-40 {
|
|
56
64
|
font-size: 14px;
|
|
57
65
|
line-height: 18px;
|
|
58
66
|
font-weight: 400;
|
|
59
67
|
padding: var(--gap-0) var(--gap-8);
|
|
60
|
-
|
|
68
|
+
|
|
69
|
+
/* TODO shift on focus. find out why. probably border appers */
|
|
70
|
+
top: 1px
|
|
71
|
+
} .suffixContainer.size-40.bold {
|
|
72
|
+
font-size: 14px;
|
|
73
|
+
line-height: 18px;
|
|
74
|
+
font-weight: 700;
|
|
75
|
+
} .suffixContainer.size-40.medium {
|
|
76
|
+
font-size: 14px;
|
|
77
|
+
line-height: 18px;
|
|
78
|
+
font-weight: 500;
|
|
79
|
+
} input:focus:not(:read-only) + .suffixContainer,
|
|
61
80
|
.suffixVisible .suffixContainer {
|
|
62
81
|
display: inline-flex;
|
|
63
82
|
} .hasSuffix input:focus::placeholder {
|
package/esm/Component.js
CHANGED
|
@@ -4,16 +4,17 @@ import mergeRefs from 'react-merge-refs';
|
|
|
4
4
|
import cn from 'classnames';
|
|
5
5
|
import { Portal } from '@alfalab/core-components-portal/esm';
|
|
6
6
|
|
|
7
|
-
var styles = {"suffixContainer":"with-
|
|
7
|
+
var styles = {"suffixContainer":"with-suffix__suffixContainer_98wwg","bold":"with-suffix__bold_98wwg","medium":"with-suffix__medium_98wwg","size-40":"with-suffix__size-40_98wwg","suffixVisible":"with-suffix__suffixVisible_98wwg","hasSuffix":"with-suffix__hasSuffix_98wwg","spacer":"with-suffix__spacer_98wwg","suffix":"with-suffix__suffix_98wwg","disabled":"with-suffix__disabled_98wwg","inverted":"with-suffix__inverted_98wwg","readOnly":"with-suffix__readOnly_98wwg"};
|
|
8
8
|
require('./index.css')
|
|
9
9
|
|
|
10
10
|
var withSuffix = function (Input) {
|
|
11
11
|
return forwardRef(function (_a, ref) {
|
|
12
12
|
var _b, _c, _d;
|
|
13
|
-
var
|
|
13
|
+
var _e;
|
|
14
|
+
var value = _a.value, defaultValue = _a.defaultValue, onChange = _a.onChange, onClear = _a.onClear, _f = _a.suffix, suffix = _f === void 0 ? '' : _f, placeholder = _a.placeholder, className = _a.className, disabled = _a.disabled, readOnly = _a.readOnly, suffixContainerClassName = _a.suffixContainerClassName, restProps = __rest(_a, ["value", "defaultValue", "onChange", "onClear", "suffix", "placeholder", "className", "disabled", "readOnly", "suffixContainerClassName"]);
|
|
14
15
|
var uncontrolled = value === undefined;
|
|
15
|
-
var
|
|
16
|
-
var
|
|
16
|
+
var _g = useState(null), inputNode = _g[0], setInputNode = _g[1];
|
|
17
|
+
var _h = useState(defaultValue || ''), stateValue = _h[0], setStateValue = _h[1];
|
|
17
18
|
var handleInputChange = useCallback(function (event, payload) {
|
|
18
19
|
if (onChange) {
|
|
19
20
|
onChange(event, payload);
|
|
@@ -43,6 +44,8 @@ var withSuffix = function (Input) {
|
|
|
43
44
|
React.createElement(Portal, { getPortalContainer: getPortalContainer },
|
|
44
45
|
React.createElement("div", { translate: 'no', className: cn(styles.suffixContainer, suffixContainerClassName, (_c = {},
|
|
45
46
|
_c[styles["size-".concat(restProps.size)]] = restProps.size,
|
|
47
|
+
_c[styles.bold] = ((_e = restProps.fontWeight) !== null && _e !== void 0 ? _e : (restProps.bold ? 'bold' : 'regular')) === 'bold',
|
|
48
|
+
_c[styles.medium] = restProps.fontWeight === 'medium',
|
|
46
49
|
_c)) },
|
|
47
50
|
React.createElement("span", { className: styles.spacer }, visibleValue),
|
|
48
51
|
suffix && (React.createElement("div", { className: cn(styles.suffix, (_d = {},
|
package/esm/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: s12of */
|
|
2
2
|
:root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-text-tertiary: rgba(5, 8, 29, 0.38);
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
/* display */
|
|
42
42
|
|
|
43
43
|
/* управляет видимостью иконки ошибки, если она стоит рядом с другой иконкой */
|
|
44
|
-
} .with-
|
|
44
|
+
} .with-suffix__suffixContainer_98wwg {
|
|
45
45
|
font-size: 16px;
|
|
46
46
|
line-height: 20px;
|
|
47
47
|
font-weight: 400;
|
|
@@ -53,29 +53,48 @@
|
|
|
53
53
|
align-items: center;
|
|
54
54
|
display: none;
|
|
55
55
|
pointer-events: none
|
|
56
|
-
} .with-
|
|
56
|
+
} .with-suffix__suffixContainer_98wwg.with-suffix__bold_98wwg {
|
|
57
|
+
font-size: 16px;
|
|
58
|
+
line-height: 20px;
|
|
59
|
+
font-weight: 700;
|
|
60
|
+
} .with-suffix__suffixContainer_98wwg.with-suffix__medium_98wwg {
|
|
61
|
+
font-size: 16px;
|
|
62
|
+
line-height: 20px;
|
|
63
|
+
font-weight: 500;
|
|
64
|
+
} .with-suffix__suffixContainer_98wwg.with-suffix__size-40_98wwg {
|
|
57
65
|
font-size: 14px;
|
|
58
66
|
line-height: 18px;
|
|
59
67
|
font-weight: 400;
|
|
60
68
|
padding: var(--gap-0) var(--gap-8);
|
|
61
|
-
|
|
62
|
-
.
|
|
69
|
+
|
|
70
|
+
/* TODO shift on focus. find out why. probably border appers */
|
|
71
|
+
top: 1px
|
|
72
|
+
} .with-suffix__suffixContainer_98wwg.with-suffix__size-40_98wwg.with-suffix__bold_98wwg {
|
|
73
|
+
font-size: 14px;
|
|
74
|
+
line-height: 18px;
|
|
75
|
+
font-weight: 700;
|
|
76
|
+
} .with-suffix__suffixContainer_98wwg.with-suffix__size-40_98wwg.with-suffix__medium_98wwg {
|
|
77
|
+
font-size: 14px;
|
|
78
|
+
line-height: 18px;
|
|
79
|
+
font-weight: 500;
|
|
80
|
+
} input:focus:not(:read-only) + .with-suffix__suffixContainer_98wwg,
|
|
81
|
+
.with-suffix__suffixVisible_98wwg .with-suffix__suffixContainer_98wwg {
|
|
63
82
|
display: inline-flex;
|
|
64
|
-
} .with-
|
|
83
|
+
} .with-suffix__hasSuffix_98wwg input:focus::placeholder {
|
|
65
84
|
color: transparent;
|
|
66
85
|
transition: none;
|
|
67
|
-
} .with-
|
|
86
|
+
} .with-suffix__spacer_98wwg {
|
|
68
87
|
visibility: hidden;
|
|
69
88
|
flex-shrink: 0;
|
|
70
89
|
white-space: pre;
|
|
71
|
-
} .with-
|
|
90
|
+
} .with-suffix__suffix_98wwg {
|
|
72
91
|
white-space: pre;
|
|
73
|
-
} .with-
|
|
92
|
+
} .with-suffix__disabled_98wwg {
|
|
74
93
|
color: var(--input-disabled-color)
|
|
75
|
-
} .with-
|
|
94
|
+
} .with-suffix__disabled_98wwg.with-suffix__inverted_98wwg {
|
|
76
95
|
color: var(--input-inverted-disabled-color);
|
|
77
|
-
} .with-
|
|
96
|
+
} .with-suffix__readOnly_98wwg {
|
|
78
97
|
color: var(--input-read-only-color)
|
|
79
|
-
} .with-
|
|
98
|
+
} .with-suffix__readOnly_98wwg.with-suffix__inverted_98wwg {
|
|
80
99
|
color: var(--input-inverted-read-only-color);
|
|
81
100
|
}
|
package/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: s12of */
|
|
2
2
|
:root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-text-tertiary: rgba(5, 8, 29, 0.38);
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
/* display */
|
|
42
42
|
|
|
43
43
|
/* управляет видимостью иконки ошибки, если она стоит рядом с другой иконкой */
|
|
44
|
-
} .with-
|
|
44
|
+
} .with-suffix__suffixContainer_98wwg {
|
|
45
45
|
font-size: 16px;
|
|
46
46
|
line-height: 20px;
|
|
47
47
|
font-weight: 400;
|
|
@@ -53,29 +53,48 @@
|
|
|
53
53
|
align-items: center;
|
|
54
54
|
display: none;
|
|
55
55
|
pointer-events: none
|
|
56
|
-
} .with-
|
|
56
|
+
} .with-suffix__suffixContainer_98wwg.with-suffix__bold_98wwg {
|
|
57
|
+
font-size: 16px;
|
|
58
|
+
line-height: 20px;
|
|
59
|
+
font-weight: 700;
|
|
60
|
+
} .with-suffix__suffixContainer_98wwg.with-suffix__medium_98wwg {
|
|
61
|
+
font-size: 16px;
|
|
62
|
+
line-height: 20px;
|
|
63
|
+
font-weight: 500;
|
|
64
|
+
} .with-suffix__suffixContainer_98wwg.with-suffix__size-40_98wwg {
|
|
57
65
|
font-size: 14px;
|
|
58
66
|
line-height: 18px;
|
|
59
67
|
font-weight: 400;
|
|
60
68
|
padding: var(--gap-0) var(--gap-8);
|
|
61
|
-
|
|
62
|
-
.
|
|
69
|
+
|
|
70
|
+
/* TODO shift on focus. find out why. probably border appers */
|
|
71
|
+
top: 1px
|
|
72
|
+
} .with-suffix__suffixContainer_98wwg.with-suffix__size-40_98wwg.with-suffix__bold_98wwg {
|
|
73
|
+
font-size: 14px;
|
|
74
|
+
line-height: 18px;
|
|
75
|
+
font-weight: 700;
|
|
76
|
+
} .with-suffix__suffixContainer_98wwg.with-suffix__size-40_98wwg.with-suffix__medium_98wwg {
|
|
77
|
+
font-size: 14px;
|
|
78
|
+
line-height: 18px;
|
|
79
|
+
font-weight: 500;
|
|
80
|
+
} input:focus:not(:read-only) + .with-suffix__suffixContainer_98wwg,
|
|
81
|
+
.with-suffix__suffixVisible_98wwg .with-suffix__suffixContainer_98wwg {
|
|
63
82
|
display: inline-flex;
|
|
64
|
-
} .with-
|
|
83
|
+
} .with-suffix__hasSuffix_98wwg input:focus::placeholder {
|
|
65
84
|
color: transparent;
|
|
66
85
|
transition: none;
|
|
67
|
-
} .with-
|
|
86
|
+
} .with-suffix__spacer_98wwg {
|
|
68
87
|
visibility: hidden;
|
|
69
88
|
flex-shrink: 0;
|
|
70
89
|
white-space: pre;
|
|
71
|
-
} .with-
|
|
90
|
+
} .with-suffix__suffix_98wwg {
|
|
72
91
|
white-space: pre;
|
|
73
|
-
} .with-
|
|
92
|
+
} .with-suffix__disabled_98wwg {
|
|
74
93
|
color: var(--input-disabled-color)
|
|
75
|
-
} .with-
|
|
94
|
+
} .with-suffix__disabled_98wwg.with-suffix__inverted_98wwg {
|
|
76
95
|
color: var(--input-inverted-disabled-color);
|
|
77
|
-
} .with-
|
|
96
|
+
} .with-suffix__readOnly_98wwg {
|
|
78
97
|
color: var(--input-read-only-color)
|
|
79
|
-
} .with-
|
|
98
|
+
} .with-suffix__readOnly_98wwg.with-suffix__inverted_98wwg {
|
|
80
99
|
color: var(--input-inverted-read-only-color);
|
|
81
100
|
}
|
package/modern/Component.js
CHANGED
|
@@ -3,7 +3,7 @@ import mergeRefs from 'react-merge-refs';
|
|
|
3
3
|
import cn from 'classnames';
|
|
4
4
|
import { Portal } from '@alfalab/core-components-portal/modern';
|
|
5
5
|
|
|
6
|
-
const styles = {"suffixContainer":"with-
|
|
6
|
+
const styles = {"suffixContainer":"with-suffix__suffixContainer_98wwg","bold":"with-suffix__bold_98wwg","medium":"with-suffix__medium_98wwg","size-40":"with-suffix__size-40_98wwg","suffixVisible":"with-suffix__suffixVisible_98wwg","hasSuffix":"with-suffix__hasSuffix_98wwg","spacer":"with-suffix__spacer_98wwg","suffix":"with-suffix__suffix_98wwg","disabled":"with-suffix__disabled_98wwg","inverted":"with-suffix__inverted_98wwg","readOnly":"with-suffix__readOnly_98wwg"};
|
|
7
7
|
require('./index.css')
|
|
8
8
|
|
|
9
9
|
const withSuffix = (Input) => forwardRef(({ value, defaultValue, onChange, onClear, suffix = '', placeholder, className, disabled, readOnly, suffixContainerClassName, ...restProps }, ref) => {
|
|
@@ -39,6 +39,9 @@ const withSuffix = (Input) => forwardRef(({ value, defaultValue, onChange, onCle
|
|
|
39
39
|
React.createElement(Portal, { getPortalContainer: getPortalContainer },
|
|
40
40
|
React.createElement("div", { translate: 'no', className: cn(styles.suffixContainer, suffixContainerClassName, {
|
|
41
41
|
[styles[`size-${restProps.size}`]]: restProps.size,
|
|
42
|
+
[styles.bold]: (restProps.fontWeight ??
|
|
43
|
+
(restProps.bold ? 'bold' : 'regular')) === 'bold',
|
|
44
|
+
[styles.medium]: restProps.fontWeight === 'medium',
|
|
42
45
|
}) },
|
|
43
46
|
React.createElement("span", { className: styles.spacer }, visibleValue),
|
|
44
47
|
suffix && (React.createElement("div", { className: cn(styles.suffix, {
|
package/modern/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: s12of */
|
|
2
2
|
:root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-text-tertiary: rgba(5, 8, 29, 0.38);
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
/* display */
|
|
42
42
|
|
|
43
43
|
/* управляет видимостью иконки ошибки, если она стоит рядом с другой иконкой */
|
|
44
|
-
} .with-
|
|
44
|
+
} .with-suffix__suffixContainer_98wwg {
|
|
45
45
|
font-size: 16px;
|
|
46
46
|
line-height: 20px;
|
|
47
47
|
font-weight: 400;
|
|
@@ -53,29 +53,48 @@
|
|
|
53
53
|
align-items: center;
|
|
54
54
|
display: none;
|
|
55
55
|
pointer-events: none
|
|
56
|
-
} .with-
|
|
56
|
+
} .with-suffix__suffixContainer_98wwg.with-suffix__bold_98wwg {
|
|
57
|
+
font-size: 16px;
|
|
58
|
+
line-height: 20px;
|
|
59
|
+
font-weight: 700;
|
|
60
|
+
} .with-suffix__suffixContainer_98wwg.with-suffix__medium_98wwg {
|
|
61
|
+
font-size: 16px;
|
|
62
|
+
line-height: 20px;
|
|
63
|
+
font-weight: 500;
|
|
64
|
+
} .with-suffix__suffixContainer_98wwg.with-suffix__size-40_98wwg {
|
|
57
65
|
font-size: 14px;
|
|
58
66
|
line-height: 18px;
|
|
59
67
|
font-weight: 400;
|
|
60
68
|
padding: var(--gap-0) var(--gap-8);
|
|
61
|
-
|
|
62
|
-
.
|
|
69
|
+
|
|
70
|
+
/* TODO shift on focus. find out why. probably border appers */
|
|
71
|
+
top: 1px
|
|
72
|
+
} .with-suffix__suffixContainer_98wwg.with-suffix__size-40_98wwg.with-suffix__bold_98wwg {
|
|
73
|
+
font-size: 14px;
|
|
74
|
+
line-height: 18px;
|
|
75
|
+
font-weight: 700;
|
|
76
|
+
} .with-suffix__suffixContainer_98wwg.with-suffix__size-40_98wwg.with-suffix__medium_98wwg {
|
|
77
|
+
font-size: 14px;
|
|
78
|
+
line-height: 18px;
|
|
79
|
+
font-weight: 500;
|
|
80
|
+
} input:focus:not(:read-only) + .with-suffix__suffixContainer_98wwg,
|
|
81
|
+
.with-suffix__suffixVisible_98wwg .with-suffix__suffixContainer_98wwg {
|
|
63
82
|
display: inline-flex;
|
|
64
|
-
} .with-
|
|
83
|
+
} .with-suffix__hasSuffix_98wwg input:focus::placeholder {
|
|
65
84
|
color: transparent;
|
|
66
85
|
transition: none;
|
|
67
|
-
} .with-
|
|
86
|
+
} .with-suffix__spacer_98wwg {
|
|
68
87
|
visibility: hidden;
|
|
69
88
|
flex-shrink: 0;
|
|
70
89
|
white-space: pre;
|
|
71
|
-
} .with-
|
|
90
|
+
} .with-suffix__suffix_98wwg {
|
|
72
91
|
white-space: pre;
|
|
73
|
-
} .with-
|
|
92
|
+
} .with-suffix__disabled_98wwg {
|
|
74
93
|
color: var(--input-disabled-color)
|
|
75
|
-
} .with-
|
|
94
|
+
} .with-suffix__disabled_98wwg.with-suffix__inverted_98wwg {
|
|
76
95
|
color: var(--input-inverted-disabled-color);
|
|
77
|
-
} .with-
|
|
96
|
+
} .with-suffix__readOnly_98wwg {
|
|
78
97
|
color: var(--input-read-only-color)
|
|
79
|
-
} .with-
|
|
98
|
+
} .with-suffix__readOnly_98wwg.with-suffix__inverted_98wwg {
|
|
80
99
|
color: var(--input-inverted-read-only-color);
|
|
81
100
|
}
|
package/moderncssm/Component.js
CHANGED
|
@@ -37,6 +37,9 @@ const withSuffix = (Input) => forwardRef(({ value, defaultValue, onChange, onCle
|
|
|
37
37
|
React.createElement(Portal, { getPortalContainer: getPortalContainer },
|
|
38
38
|
React.createElement("div", { translate: 'no', className: cn(styles.suffixContainer, suffixContainerClassName, {
|
|
39
39
|
[styles[`size-${restProps.size}`]]: restProps.size,
|
|
40
|
+
[styles.bold]: (restProps.fontWeight ??
|
|
41
|
+
(restProps.bold ? 'bold' : 'regular')) === 'bold',
|
|
42
|
+
[styles.medium]: restProps.fontWeight === 'medium',
|
|
40
43
|
}) },
|
|
41
44
|
React.createElement("span", { className: styles.spacer }, visibleValue),
|
|
42
45
|
suffix && (React.createElement("div", { className: cn(styles.suffix, {
|
|
@@ -28,12 +28,35 @@
|
|
|
28
28
|
display: none;
|
|
29
29
|
pointer-events: none
|
|
30
30
|
}
|
|
31
|
+
.suffixContainer.bold {
|
|
32
|
+
font-size: 16px;
|
|
33
|
+
line-height: 20px;
|
|
34
|
+
font-weight: 700;
|
|
35
|
+
}
|
|
36
|
+
.suffixContainer.medium {
|
|
37
|
+
font-size: 16px;
|
|
38
|
+
line-height: 20px;
|
|
39
|
+
font-weight: 500;
|
|
40
|
+
}
|
|
31
41
|
.suffixContainer.size-40 {
|
|
32
42
|
font-size: 14px;
|
|
33
43
|
line-height: 18px;
|
|
34
44
|
font-weight: 400;
|
|
35
45
|
padding: var(--gap-0) var(--gap-8);
|
|
46
|
+
|
|
47
|
+
/* TODO shift on focus. find out why. probably border appers */
|
|
48
|
+
top: 1px
|
|
36
49
|
}
|
|
50
|
+
.suffixContainer.size-40.bold {
|
|
51
|
+
font-size: 14px;
|
|
52
|
+
line-height: 18px;
|
|
53
|
+
font-weight: 700;
|
|
54
|
+
}
|
|
55
|
+
.suffixContainer.size-40.medium {
|
|
56
|
+
font-size: 14px;
|
|
57
|
+
line-height: 18px;
|
|
58
|
+
font-weight: 500;
|
|
59
|
+
}
|
|
37
60
|
input:focus:not(:read-only) + .suffixContainer,
|
|
38
61
|
.suffixVisible .suffixContainer {
|
|
39
62
|
display: inline-flex;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-with-suffix",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.21",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
"react": "^16.9.0 || ^17.0.1 || ^18.0.0"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@alfalab/core-components-input": "^15.
|
|
18
|
+
"@alfalab/core-components-input": "^15.7.0",
|
|
19
19
|
"@alfalab/core-components-portal": "^3.3.10",
|
|
20
20
|
"classnames": "^2.5.1",
|
|
21
21
|
"react-merge-refs": "^1.1.0",
|
|
22
22
|
"tslib": "^2.4.0"
|
|
23
23
|
},
|
|
24
|
-
"themesVersion": "13.7.
|
|
25
|
-
"varsVersion": "9.
|
|
24
|
+
"themesVersion": "13.7.6",
|
|
25
|
+
"varsVersion": "9.22.0"
|
|
26
26
|
}
|
package/src/Component.tsx
CHANGED
|
@@ -110,6 +110,10 @@ export const withSuffix = (Input: FC<InputProps & RefAttributes<HTMLInputElement
|
|
|
110
110
|
translate='no'
|
|
111
111
|
className={cn(styles.suffixContainer, suffixContainerClassName, {
|
|
112
112
|
[styles[`size-${restProps.size}`]]: restProps.size,
|
|
113
|
+
[styles.bold]:
|
|
114
|
+
(restProps.fontWeight ??
|
|
115
|
+
(restProps.bold ? 'bold' : 'regular')) === 'bold',
|
|
116
|
+
[styles.medium]: restProps.fontWeight === 'medium',
|
|
113
117
|
})}
|
|
114
118
|
>
|
|
115
119
|
<span className={styles.spacer}>{visibleValue}</span>
|
package/src/index.module.css
CHANGED
|
@@ -12,9 +12,28 @@
|
|
|
12
12
|
display: none;
|
|
13
13
|
pointer-events: none;
|
|
14
14
|
|
|
15
|
+
&.bold {
|
|
16
|
+
@mixin accent_component_primary;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&.medium {
|
|
20
|
+
@mixin action_component_primary;
|
|
21
|
+
}
|
|
22
|
+
|
|
15
23
|
&.size-40 {
|
|
16
24
|
@mixin paragraph_component_secondary;
|
|
17
25
|
padding: var(--gap-0) var(--gap-8);
|
|
26
|
+
|
|
27
|
+
/* TODO shift on focus. find out why. probably border appers */
|
|
28
|
+
top: 1px;
|
|
29
|
+
|
|
30
|
+
&.bold {
|
|
31
|
+
@mixin accent_component_secondary;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&.medium {
|
|
35
|
+
@mixin action_component_secondary;
|
|
36
|
+
}
|
|
18
37
|
}
|
|
19
38
|
}
|
|
20
39
|
|