@salutejs/plasma-new-hope 0.326.0-canary.1973.15492799823.0 → 0.326.0-canary.1973.15523989355.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/cjs/components/CodeInput/CodeInput.css +1 -1
- package/cjs/components/CodeInput/CodeInput.js +14 -30
- package/cjs/components/CodeInput/CodeInput.js.map +1 -1
- package/cjs/components/CodeInput/CodeInput.tokens.js +12 -37
- package/cjs/components/CodeInput/CodeInput.tokens.js.map +1 -1
- package/cjs/components/CodeInput/variations/_size/base.js +1 -1
- package/cjs/components/CodeInput/variations/_size/base.js.map +1 -1
- package/cjs/components/CodeInput/variations/_size/base_h42a8b.css +1 -0
- package/cjs/index.css +1 -1
- package/cjs/index.js +0 -2
- package/cjs/index.js.map +1 -1
- package/emotion/cjs/components/CodeInput/CodeInput.js +12 -27
- package/emotion/cjs/components/CodeInput/CodeInput.tokens.js +12 -30
- package/emotion/cjs/components/CodeInput/index.js +1 -8
- package/emotion/cjs/components/CodeInput/utils/index.js +6 -26
- package/emotion/cjs/components/CodeInput/variations/_size/base.js +16 -1
- package/emotion/cjs/examples/plasma_b2c/components/CodeInput/CodeInput.config.js +5 -9
- package/emotion/cjs/examples/plasma_web/components/CodeInput/CodeInput.config.js +5 -9
- package/emotion/es/components/CodeInput/CodeInput.js +13 -28
- package/emotion/es/components/CodeInput/CodeInput.tokens.js +12 -30
- package/emotion/es/components/CodeInput/index.js +1 -2
- package/emotion/es/components/CodeInput/utils/index.js +2 -3
- package/emotion/es/components/CodeInput/variations/_size/base.js +16 -1
- package/emotion/es/examples/plasma_b2c/components/CodeInput/CodeInput.config.js +6 -10
- package/emotion/es/examples/plasma_web/components/CodeInput/CodeInput.config.js +6 -10
- package/es/components/CodeInput/CodeInput.css +1 -1
- package/es/components/CodeInput/CodeInput.js +14 -30
- package/es/components/CodeInput/CodeInput.js.map +1 -1
- package/es/components/CodeInput/CodeInput.tokens.js +13 -37
- package/es/components/CodeInput/CodeInput.tokens.js.map +1 -1
- package/es/components/CodeInput/variations/_size/base.js +1 -1
- package/es/components/CodeInput/variations/_size/base.js.map +1 -1
- package/es/components/CodeInput/variations/_size/base_h42a8b.css +1 -0
- package/es/index.css +1 -1
- package/es/index.js +0 -1
- package/es/index.js.map +1 -1
- package/package.json +5 -5
- package/styled-components/cjs/components/CodeInput/CodeInput.js +12 -27
- package/styled-components/cjs/components/CodeInput/CodeInput.tokens.js +12 -30
- package/styled-components/cjs/components/CodeInput/index.js +1 -8
- package/styled-components/cjs/components/CodeInput/utils/index.js +6 -26
- package/styled-components/cjs/components/CodeInput/variations/_size/base.js +16 -1
- package/styled-components/cjs/examples/plasma_b2c/components/CodeInput/CodeInput.config.js +4 -8
- package/styled-components/cjs/examples/plasma_web/components/CodeInput/CodeInput.config.js +4 -8
- package/styled-components/es/components/CodeInput/CodeInput.js +13 -28
- package/styled-components/es/components/CodeInput/CodeInput.tokens.js +12 -30
- package/styled-components/es/components/CodeInput/index.js +1 -2
- package/styled-components/es/components/CodeInput/utils/index.js +2 -3
- package/styled-components/es/components/CodeInput/variations/_size/base.js +16 -1
- package/styled-components/es/examples/plasma_b2c/components/CodeInput/CodeInput.config.js +5 -9
- package/styled-components/es/examples/plasma_web/components/CodeInput/CodeInput.config.js +5 -9
- package/types/components/CodeInput/CodeInput.d.ts.map +1 -1
- package/types/components/CodeInput/CodeInput.tokens.d.ts +12 -30
- package/types/components/CodeInput/CodeInput.tokens.d.ts.map +1 -1
- package/types/components/CodeInput/index.d.ts +0 -1
- package/types/components/CodeInput/index.d.ts.map +1 -1
- package/types/components/CodeInput/utils/index.d.ts +2 -3
- package/types/components/CodeInput/utils/index.d.ts.map +1 -1
- package/types/components/CodeInput/variations/_size/base.d.ts.map +1 -1
- package/cjs/components/CodeInput/utils/generateMediaQuery.js +0 -49
- package/cjs/components/CodeInput/utils/generateMediaQuery.js.map +0 -1
- package/cjs/components/CodeInput/utils/handleCodeError.js +0 -55
- package/cjs/components/CodeInput/utils/handleCodeError.js.map +0 -1
- package/cjs/components/CodeInput/utils/initialValuesHelper.js +0 -33
- package/cjs/components/CodeInput/utils/initialValuesHelper.js.map +0 -1
- package/cjs/components/CodeInput/variations/_size/base_eip8ma.css +0 -1
- package/emotion/cjs/components/CodeInput/utils/generateMediaQuery.js +0 -45
- package/emotion/cjs/components/CodeInput/utils/handleCodeError.js +0 -58
- package/emotion/cjs/components/CodeInput/utils/initialValuesHelper.js +0 -30
- package/emotion/es/components/CodeInput/utils/generateMediaQuery.js +0 -39
- package/emotion/es/components/CodeInput/utils/handleCodeError.js +0 -52
- package/emotion/es/components/CodeInput/utils/initialValuesHelper.js +0 -24
- package/es/components/CodeInput/utils/generateMediaQuery.js +0 -43
- package/es/components/CodeInput/utils/generateMediaQuery.js.map +0 -1
- package/es/components/CodeInput/utils/handleCodeError.js +0 -51
- package/es/components/CodeInput/utils/handleCodeError.js.map +0 -1
- package/es/components/CodeInput/utils/initialValuesHelper.js +0 -27
- package/es/components/CodeInput/utils/initialValuesHelper.js.map +0 -1
- package/es/components/CodeInput/variations/_size/base_eip8ma.css +0 -1
- package/styled-components/cjs/components/CodeInput/utils/generateMediaQuery.js +0 -45
- package/styled-components/cjs/components/CodeInput/utils/handleCodeError.js +0 -58
- package/styled-components/cjs/components/CodeInput/utils/initialValuesHelper.js +0 -30
- package/styled-components/es/components/CodeInput/utils/generateMediaQuery.js +0 -39
- package/styled-components/es/components/CodeInput/utils/handleCodeError.js +0 -52
- package/styled-components/es/components/CodeInput/utils/initialValuesHelper.js +0 -24
- package/types/components/CodeInput/utils/generateMediaQuery.d.ts +0 -12
- package/types/components/CodeInput/utils/generateMediaQuery.d.ts.map +0 -1
- package/types/components/CodeInput/utils/handleCodeError.d.ts +0 -15
- package/types/components/CodeInput/utils/handleCodeError.d.ts.map +0 -1
- package/types/components/CodeInput/utils/initialValuesHelper.d.ts +0 -4
- package/types/components/CodeInput/utils/initialValuesHelper.d.ts.map +0 -1
@@ -82,7 +82,6 @@ var codeInputRoot = exports.codeInputRoot = function codeInputRoot(Root) {
|
|
82
82
|
var fieldPattern = (0, _utils2.getFieldPattern)(allowedSymbols);
|
83
83
|
var placeholderValue = (0, _utils2.getPlaceholderValue)(codeLength, placeholder);
|
84
84
|
var parts = codeLength === 6 ? 2 : 1;
|
85
|
-
var viewClass = (0, _utils2.getCodeInputViewClass)(view || 'default');
|
86
85
|
var widthValue = width ? (0, _utils.getSizeValueFromProp)(width, 'rem') : undefined;
|
87
86
|
var getLastActiveIndex = function getLastActiveIndex() {
|
88
87
|
if (code.length && code.length < codeLength) {
|
@@ -102,7 +101,7 @@ var codeInputRoot = exports.codeInputRoot = function codeInputRoot(Root) {
|
|
102
101
|
inputRefs.current[lastActiveIndex].focus();
|
103
102
|
}
|
104
103
|
};
|
105
|
-
var handleOnKeyDown = function handleOnKeyDown(event, index) {
|
104
|
+
var handleOnKeyDown = function handleOnKeyDown(event, index, type) {
|
106
105
|
if (disabled) {
|
107
106
|
return;
|
108
107
|
}
|
@@ -117,6 +116,11 @@ var codeInputRoot = exports.codeInputRoot = function codeInputRoot(Root) {
|
|
117
116
|
(_inputRefs$current = inputRefs.current[index - 1]) === null || _inputRefs$current === void 0 || _inputRefs$current.focus();
|
118
117
|
}
|
119
118
|
}
|
119
|
+
if (type === 'circle') {
|
120
|
+
var _inputRefs$current$in;
|
121
|
+
handleAddSymbol(key, index);
|
122
|
+
(_inputRefs$current$in = inputRefs.current[index]) === null || _inputRefs$current$in === void 0 || _inputRefs$current$in.focus();
|
123
|
+
}
|
120
124
|
};
|
121
125
|
var codeSetter = function codeSetter(newCode) {
|
122
126
|
setCode(newCode);
|
@@ -133,25 +137,6 @@ var codeInputRoot = exports.codeInputRoot = function codeInputRoot(Root) {
|
|
133
137
|
var symbol = rawSymbol.charAt(rawSymbol.length - 1);
|
134
138
|
handleAddSymbol(symbol, index);
|
135
139
|
};
|
136
|
-
var handleOnKeyDownCircle = function handleOnKeyDownCircle(event, index) {
|
137
|
-
var _inputRefs$current$in;
|
138
|
-
if (disabled) {
|
139
|
-
return;
|
140
|
-
}
|
141
|
-
var key = event.key;
|
142
|
-
if (_constants.FORBIDDEN_KEYS.includes(key)) {
|
143
|
-
event.preventDefault();
|
144
|
-
return;
|
145
|
-
}
|
146
|
-
if (key === _constants.BACKSPACE_KEY) {
|
147
|
-
if (index > 0 && code[index] === '') {
|
148
|
-
var _inputRefs$current2;
|
149
|
-
(_inputRefs$current2 = inputRefs.current[index - 1]) === null || _inputRefs$current2 === void 0 || _inputRefs$current2.focus();
|
150
|
-
}
|
151
|
-
}
|
152
|
-
handleAddSymbol(key, index);
|
153
|
-
(_inputRefs$current$in = inputRefs.current[index]) === null || _inputRefs$current$in === void 0 || _inputRefs$current$in.focus();
|
154
|
-
};
|
155
140
|
var handleAddSymbol = function handleAddSymbol(symbol, index) {
|
156
141
|
var _inputRefs$current$in2;
|
157
142
|
var newCode = _toConsumableArray(code);
|
@@ -171,8 +156,8 @@ var codeInputRoot = exports.codeInputRoot = function codeInputRoot(Root) {
|
|
171
156
|
newCode[index] = symbol;
|
172
157
|
codeSetter(newCode);
|
173
158
|
if (symbol && index < codeLength - 1) {
|
174
|
-
var _inputRefs$
|
175
|
-
(_inputRefs$
|
159
|
+
var _inputRefs$current2;
|
160
|
+
(_inputRefs$current2 = inputRefs.current[index + 1]) === null || _inputRefs$current2 === void 0 || _inputRefs$current2.focus();
|
176
161
|
}
|
177
162
|
return;
|
178
163
|
}
|
@@ -185,8 +170,8 @@ var codeInputRoot = exports.codeInputRoot = function codeInputRoot(Root) {
|
|
185
170
|
newCode[index] = symbol.charAt(symbol.length - 1);
|
186
171
|
codeSetter(newCode);
|
187
172
|
if (index < codeLength - 1) {
|
188
|
-
var _inputRefs$
|
189
|
-
(_inputRefs$
|
173
|
+
var _inputRefs$current3;
|
174
|
+
(_inputRefs$current3 = inputRefs.current[index + 1]) === null || _inputRefs$current3 === void 0 || _inputRefs$current3.focus();
|
190
175
|
}
|
191
176
|
} else {
|
192
177
|
newCode[index] = symbol.charAt(symbol.length - 1);
|
@@ -262,7 +247,7 @@ var codeInputRoot = exports.codeInputRoot = function codeInputRoot(Root) {
|
|
262
247
|
disabled: disabled,
|
263
248
|
screen: screen,
|
264
249
|
onClick: handleClick,
|
265
|
-
className: (0, _classnames["default"])(className,
|
250
|
+
className: (0, _classnames["default"])(className, _defineProperty({}, _CodeInput.classes.captionAlignLeft, captionAlign === 'left'))
|
266
251
|
}, rest), /*#__PURE__*/_react["default"].createElement(_CodeInput2.CodeWrapper, {
|
267
252
|
ref: inputContainerRef
|
268
253
|
}, _toConsumableArray(Array(parts)).map(function (_, partIndex) {
|
@@ -278,7 +263,7 @@ var codeInputRoot = exports.codeInputRoot = function codeInputRoot(Root) {
|
|
278
263
|
role: "tab",
|
279
264
|
tabIndex: originalValue.length === inputCorrectIndex ? 0 : -1,
|
280
265
|
onKeyDown: function onKeyDown(e) {
|
281
|
-
|
266
|
+
handleOnKeyDown(e, inputCorrectIndex, 'circle');
|
282
267
|
},
|
283
268
|
className: (0, _classnames["default"])([!!code[inputCorrectIndex] && hidden ? _CodeInput.classes.itemCirlceFilled : '', "".concat(_CodeInput.classes.itemCircle, "-").concat(inputCorrectIndex)])
|
284
269
|
}), /*#__PURE__*/_react["default"].createElement(_CodeInput2.ItemInput, _extends({
|
@@ -20,11 +20,6 @@ var classes = exports.classes = {
|
|
20
20
|
hoverEnabled: 'codeinput-item-hover-enabled',
|
21
21
|
segmented: 'codeinput-shape-segmented',
|
22
22
|
"default": 'codeinput-shape-default',
|
23
|
-
largeMScreen: 'codeinput-large-m-screen',
|
24
|
-
largeSScreen: 'codeinput-large-s-screen',
|
25
|
-
mediumMScreen: 'codeinput-medium-m-screen',
|
26
|
-
mediumSScreen: 'codeinput-medium-s-screen',
|
27
|
-
smallMScreen: 'codeinput-small-m-screen',
|
28
23
|
disabled: 'codeinput-disabled'
|
29
24
|
};
|
30
25
|
var privateTokens = exports.privateTokens = {
|
@@ -36,38 +31,25 @@ var privateTokens = exports.privateTokens = {
|
|
36
31
|
var tokens = exports.tokens = {
|
37
32
|
captionGap: '--plasma-codeinput-caption-gap',
|
38
33
|
codeItemsGap: '--plasma-codeinput-code-item-gap',
|
39
|
-
smallMMinWidth: '--plasma-codeinput-smallM-min-width',
|
40
|
-
mediumSMinWidth: '--plasma-codeinput-mediumS-min-width',
|
41
|
-
mediumMMinWidth: '--plasma-codeinput-mediumM-min-width',
|
42
|
-
largeSMinWidth: '--plasma-codeinput-largeS-min-width',
|
43
|
-
largeMMinWidth: '--plasma-codeinput-largeM-min-width',
|
44
34
|
separatorWidth: '--plasma-codeinput-separator-width',
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
mediumSCodeItemWidth: '--plasma-codeinput-item-medium-s-width',
|
52
|
-
mediumSCodeItemHeight: '--plasma-codeinput-item-medium-s-height',
|
53
|
-
smallMCodeItemWidth: '--plasma-codeinput-item-small-m-width',
|
54
|
-
smallMCodeItemHeight: '--plasma-codeinput-item-small-m-height',
|
35
|
+
largeCodeItemWidth: '--plasma-codeinput-item-large-width',
|
36
|
+
largeCodeItemHeight: '--plasma-codeinput-item-large-height',
|
37
|
+
mediumCodeItemWidth: '--plasma-codeinput-item-medium-width',
|
38
|
+
mediumCodeItemHeight: '--plasma-codeinput-item-medium-height',
|
39
|
+
smallCodeItemWidth: '--plasma-codeinput-item-small-width',
|
40
|
+
smallCodeItemHeight: '--plasma-codeinput-item-small-height',
|
55
41
|
codeItemCircleSize: '--plasma-codeinput-item-circle-size',
|
56
42
|
codeItemCircleBorderWidth: '--plasma-codeinput-item-circle-border-width',
|
57
43
|
fontStyle: '--plasma-codeinput-font-style',
|
58
44
|
fontFamily: '--plasma-codeinput-font-family',
|
59
45
|
fontWeight: '--plasma-codeinput-font-weight',
|
60
46
|
letterSpacing: '--plasma-codeinput-letter-spacing',
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
mediumSFontSize: '--plasma-codeinput-medium-s-font-size',
|
68
|
-
mediumSLineHeight: '--plasma-codeinput-medium-s-line-height',
|
69
|
-
smallMFontSize: '--plasma-codeinput-small-m-font-size',
|
70
|
-
smallMLineHeight: '--plasma-codeinput-small-m-line-height',
|
47
|
+
largeFontSize: '--plasma-codeinput-large-font-size',
|
48
|
+
largeLineHeight: '--plasma-codeinput-large-line-height',
|
49
|
+
mediumFontSize: '--plasma-codeinput-medium-font-size',
|
50
|
+
mediumLineHeight: '--plasma-codeinput-medium-line-height',
|
51
|
+
smallFontSize: '--plasma-codeinput-small-font-size',
|
52
|
+
smallLineHeight: '--plasma-codeinput-small-line-height',
|
71
53
|
captionFontFamily: '--plasma-codeinput-caption-font-family',
|
72
54
|
captionFontSize: '--plasma-codeinput-caption-font-style',
|
73
55
|
captionFontStyle: '--plasma-codeinput-caption-font-size',
|
@@ -27,12 +27,5 @@ Object.defineProperty(exports, "codeInputTokens", {
|
|
27
27
|
return _CodeInput2.tokens;
|
28
28
|
}
|
29
29
|
});
|
30
|
-
Object.defineProperty(exports, "getCodeInputView", {
|
31
|
-
enumerable: true,
|
32
|
-
get: function get() {
|
33
|
-
return _utils.getCodeInputView;
|
34
|
-
}
|
35
|
-
});
|
36
30
|
var _CodeInput = /*#__PURE__*/require("./CodeInput");
|
37
|
-
var _CodeInput2 = /*#__PURE__*/require("./CodeInput.tokens");
|
38
|
-
var _utils = /*#__PURE__*/require("./utils");
|
31
|
+
var _CodeInput2 = /*#__PURE__*/require("./CodeInput.tokens");
|
@@ -3,35 +3,28 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
var _exportNames = {
|
7
|
-
getFieldPattern: true,
|
8
|
-
getPlaceholderValue: true,
|
9
|
-
getCodeValue: true,
|
10
|
-
handleItemError: true,
|
11
|
-
handleCodeError: true
|
12
|
-
};
|
13
6
|
Object.defineProperty(exports, "getCodeValue", {
|
14
7
|
enumerable: true,
|
15
8
|
get: function get() {
|
16
|
-
return
|
9
|
+
return _utils.getCodeValue;
|
17
10
|
}
|
18
11
|
});
|
19
12
|
Object.defineProperty(exports, "getFieldPattern", {
|
20
13
|
enumerable: true,
|
21
14
|
get: function get() {
|
22
|
-
return
|
15
|
+
return _utils.getFieldPattern;
|
23
16
|
}
|
24
17
|
});
|
25
18
|
Object.defineProperty(exports, "getPlaceholderValue", {
|
26
19
|
enumerable: true,
|
27
20
|
get: function get() {
|
28
|
-
return
|
21
|
+
return _utils.getPlaceholderValue;
|
29
22
|
}
|
30
23
|
});
|
31
24
|
Object.defineProperty(exports, "handleCodeError", {
|
32
25
|
enumerable: true,
|
33
26
|
get: function get() {
|
34
|
-
return
|
27
|
+
return _utils.handleCodeError;
|
35
28
|
}
|
36
29
|
});
|
37
30
|
Object.defineProperty(exports, "handleItemError", {
|
@@ -40,18 +33,5 @@ Object.defineProperty(exports, "handleItemError", {
|
|
40
33
|
return _handleItemError.handleItemError;
|
41
34
|
}
|
42
35
|
});
|
43
|
-
var
|
44
|
-
var _handleItemError = /*#__PURE__*/require("./handleItemError");
|
45
|
-
var _handleCodeError = /*#__PURE__*/require("./handleCodeError");
|
46
|
-
var _generateMediaQuery = /*#__PURE__*/require("./generateMediaQuery");
|
47
|
-
Object.keys(_generateMediaQuery).forEach(function (key) {
|
48
|
-
if (key === "default" || key === "__esModule") return;
|
49
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
50
|
-
if (key in exports && exports[key] === _generateMediaQuery[key]) return;
|
51
|
-
Object.defineProperty(exports, key, {
|
52
|
-
enumerable: true,
|
53
|
-
get: function get() {
|
54
|
-
return _generateMediaQuery[key];
|
55
|
-
}
|
56
|
-
});
|
57
|
-
});
|
36
|
+
var _utils = /*#__PURE__*/require("../../CodeField/utils");
|
37
|
+
var _handleItemError = /*#__PURE__*/require("./handleItemError");
|
@@ -7,4 +7,19 @@ exports.base = void 0;
|
|
7
7
|
var _styledComponents = /*#__PURE__*/require("styled-components");
|
8
8
|
var _CodeInput = /*#__PURE__*/require("../../CodeInput.styles");
|
9
9
|
var _CodeInput2 = /*#__PURE__*/require("../../CodeInput.tokens");
|
10
|
-
var
|
10
|
+
var _constants = /*#__PURE__*/require("../../../../utils/constants");
|
11
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
12
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
13
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
14
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
15
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
16
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
17
|
+
var getIconMediaQueries = function getIconMediaQueries() {
|
18
|
+
return Object.entries(_constants.screenGroupBreakpoints).map(function (_ref) {
|
19
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
20
|
+
name = _ref2[0],
|
21
|
+
minWidth = _ref2[1];
|
22
|
+
return "\n @media (min-width: ".concat(minWidth, ") {\n ").concat(_CodeInput2.privateTokens.fontSize, ": var(").concat(_CodeInput2.tokens["".concat(name, "FontSize")], ");\n ").concat(_CodeInput2.privateTokens.lineHeight, ": var(").concat(_CodeInput2.tokens["".concat(name, "CodeItemHeight")], ");\n ").concat(_CodeInput2.privateTokens.itemWidth, ": var(").concat(_CodeInput2.tokens["".concat(name, "CodeItemWidth")], ");\n ").concat(_CodeInput2.privateTokens.itemHeight, ": var(").concat(_CodeInput2.tokens["".concat(name, "LineHeight")], ");\n }\n ");
|
23
|
+
}).join('\n');
|
24
|
+
};
|
25
|
+
var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["", " gap:var(", ");", ",", "{gap:var(", ");}", "{font-size:var(", ");font-family:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");width:var(", ");height:var(", ");}", "{font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");}"], /*#__PURE__*/getIconMediaQueries(), _CodeInput2.tokens.captionGap, _CodeInput.CodeWrapper, _CodeInput.CodeGroup, _CodeInput2.tokens.codeItemsGap, _CodeInput.ItemInput, _CodeInput2.privateTokens.fontSize, _CodeInput2.tokens.fontFamily, _CodeInput2.tokens.fontStyle, _CodeInput2.tokens.fontWeight, _CodeInput2.tokens.letterSpacing, _CodeInput2.privateTokens.lineHeight, _CodeInput2.privateTokens.itemWidth, _CodeInput2.privateTokens.itemHeight, _CodeInput.CaptionWrapper, _CodeInput2.tokens.captionFontFamily, _CodeInput2.tokens.captionFontSize, _CodeInput2.tokens.captionFontStyle, _CodeInput2.tokens.captionFontWeight, _CodeInput2.tokens.captionLetterSpacing, _CodeInput2.tokens.captionLineHeight);
|
@@ -6,10 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
exports.config = void 0;
|
7
7
|
var _styledComponents = /*#__PURE__*/require("styled-components");
|
8
8
|
var _CodeInput = /*#__PURE__*/require("../../../../components/CodeInput");
|
9
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
10
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
11
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
12
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
13
9
|
var config = exports.config = {
|
14
10
|
defaults: {
|
15
11
|
view: 'default',
|
@@ -17,12 +13,12 @@ var config = exports.config = {
|
|
17
13
|
},
|
18
14
|
variations: {
|
19
15
|
view: {
|
20
|
-
"default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-secondary);", ":var(--text-negative);", ":var(--text-primary);", ":var(--text-negative);", ":var(--outline-accent);"
|
16
|
+
"default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-secondary);", ":var(--text-negative);", ":var(--text-primary);", ":var(--text-negative);", ":var(--outline-accent);"], _CodeInput.codeInputTokens.captionColor, _CodeInput.codeInputTokens.captionColorError, _CodeInput.codeInputTokens.codeColor, _CodeInput.codeInputTokens.codeColorError, _CodeInput.codeInputTokens.borderColorFocus)
|
21
17
|
},
|
22
18
|
size: {
|
23
|
-
l: /*#__PURE__*/(0, _styledComponents.css)(["", ":2.5rem;", ":0.75rem;", ":0.75rem;", ":var(--plasma-typo-dspl-l-font-family);", ":var(--plasma-typo-dspl-l-font-style);", ":var(--plasma-typo-dspl-l-bold-font-weight);", ":var(--plasma-typo-dspl-l-letter-spacing);", ":8rem;", ":8rem;", ":
|
24
|
-
m: /*#__PURE__*/(0, _styledComponents.css)(["", ":1.75rem;", ":0.5rem;", ":0.75rem;", ":var(--plasma-typo-dspl-m-font-family);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-bold-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":5.5rem;", ":5.75rem;", ":
|
25
|
-
s: /*#__PURE__*/(0, _styledComponents.css)(["", ":1.5rem;", ":0.25rem;", ":0.5rem;", ":var(--plasma-typo-dspl-s-font-family);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-bold-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":4rem;", ":4.25rem;", ":
|
19
|
+
l: /*#__PURE__*/(0, _styledComponents.css)(["", ":2.5rem;", ":0.75rem;", ":0.75rem;", ":var(--plasma-typo-dspl-l-font-family);", ":var(--plasma-typo-dspl-l-font-style);", ":var(--plasma-typo-dspl-l-bold-font-weight);", ":var(--plasma-typo-dspl-l-letter-spacing);", ":8rem;", ":8rem;", ":7rem;", ":7rem;", ":5.5rem;", ":5.75rem;", ":var(--plasma-typo-h3-font-family);", ":var(--plasma-typo-h3-font-size);", ":var(--plasma-typo-h3-font-style);", ":var(--plasma-typo-h3-font-weight);", ":var(--plasma-typo-h3-letter-spacing);", ":var(--plasma-typo-h3-line-height);", ":5rem;", ":8rem;", ":4.5rem;", ":7rem;", ":3.5rem;", ":5.75rem;", ":0.125rem;", ":1.5rem;"], _CodeInput.codeInputTokens.captionGap, _CodeInput.codeInputTokens.codeItemsGap, _CodeInput.codeInputTokens.separatorWidth, _CodeInput.codeInputTokens.fontFamily, _CodeInput.codeInputTokens.fontStyle, _CodeInput.codeInputTokens.fontWeight, _CodeInput.codeInputTokens.letterSpacing, _CodeInput.codeInputTokens.largeFontSize, _CodeInput.codeInputTokens.largeLineHeight, _CodeInput.codeInputTokens.mediumFontSize, _CodeInput.codeInputTokens.mediumLineHeight, _CodeInput.codeInputTokens.smallFontSize, _CodeInput.codeInputTokens.smallLineHeight, _CodeInput.codeInputTokens.captionFontFamily, _CodeInput.codeInputTokens.captionFontSize, _CodeInput.codeInputTokens.captionFontStyle, _CodeInput.codeInputTokens.captionFontWeight, _CodeInput.codeInputTokens.captionLetterSpacing, _CodeInput.codeInputTokens.captionLineHeight, _CodeInput.codeInputTokens.largeCodeItemWidth, _CodeInput.codeInputTokens.largeCodeItemHeight, _CodeInput.codeInputTokens.mediumCodeItemWidth, _CodeInput.codeInputTokens.mediumCodeItemHeight, _CodeInput.codeInputTokens.smallCodeItemWidth, _CodeInput.codeInputTokens.smallCodeItemHeight, _CodeInput.codeInputTokens.codeItemCircleBorderWidth, _CodeInput.codeInputTokens.codeItemCircleSize),
|
20
|
+
m: /*#__PURE__*/(0, _styledComponents.css)(["", ":1.75rem;", ":0.5rem;", ":0.75rem;", ":var(--plasma-typo-dspl-m-font-family);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-bold-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":5.5rem;", ":5.75rem;", ":4.5rem;", ":4.75rem;", ":3.5rem;", ":3.75rem;", ":var(--plasma-typo-h4-font-family);", ":var(--plasma-typo-h4-font-size);", ":var(--plasma-typo-h4-font-style);", ":var(--plasma-typo-h4-font-weight);", ":var(--plasma-typo-h4-letter-spacing);", ":var(--plasma-typo-h4-line-height);", ":3.5rem;", ":5.75rem;", ":3rem;", ":4.75rem;", ":2.25rem;", ":3.75rem;", ":0.094rem;", ":1rem;"], _CodeInput.codeInputTokens.captionGap, _CodeInput.codeInputTokens.codeItemsGap, _CodeInput.codeInputTokens.separatorWidth, _CodeInput.codeInputTokens.fontFamily, _CodeInput.codeInputTokens.fontStyle, _CodeInput.codeInputTokens.fontWeight, _CodeInput.codeInputTokens.letterSpacing, _CodeInput.codeInputTokens.largeFontSize, _CodeInput.codeInputTokens.largeLineHeight, _CodeInput.codeInputTokens.mediumFontSize, _CodeInput.codeInputTokens.mediumLineHeight, _CodeInput.codeInputTokens.smallFontSize, _CodeInput.codeInputTokens.smallLineHeight, _CodeInput.codeInputTokens.captionFontFamily, _CodeInput.codeInputTokens.captionFontSize, _CodeInput.codeInputTokens.captionFontStyle, _CodeInput.codeInputTokens.captionFontWeight, _CodeInput.codeInputTokens.captionLetterSpacing, _CodeInput.codeInputTokens.captionLineHeight, _CodeInput.codeInputTokens.largeCodeItemWidth, _CodeInput.codeInputTokens.largeCodeItemHeight, _CodeInput.codeInputTokens.mediumCodeItemWidth, _CodeInput.codeInputTokens.mediumCodeItemHeight, _CodeInput.codeInputTokens.smallCodeItemWidth, _CodeInput.codeInputTokens.smallCodeItemHeight, _CodeInput.codeInputTokens.codeItemCircleBorderWidth, _CodeInput.codeInputTokens.codeItemCircleSize),
|
21
|
+
s: /*#__PURE__*/(0, _styledComponents.css)(["", ":1.5rem;", ":0.25rem;", ":0.5rem;", ":var(--plasma-typo-dspl-s-font-family);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-bold-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":4rem;", ":4.25rem;", ":3rem;", ":3.25rem;", ":2.5rem;", ":2.75rem;", ":var(--plasma-typo-h5-font-family);", ":var(--plasma-typo-h5-font-size);", ":var(--plasma-typo-h5-font-style);", ":var(--plasma-typo-h5-font-weight);", ":var(--plasma-typo-h5-letter-spacing);", ":var(--plasma-typo-h5-line-height);", ":2.5rem;", ":4.25rem;", ":2rem;", ":3.25rem;", ":1.625rem;", ":2.75rem;", ":0.063rem;", ":0.75rem;"], _CodeInput.codeInputTokens.captionGap, _CodeInput.codeInputTokens.codeItemsGap, _CodeInput.codeInputTokens.separatorWidth, _CodeInput.codeInputTokens.fontFamily, _CodeInput.codeInputTokens.fontStyle, _CodeInput.codeInputTokens.fontWeight, _CodeInput.codeInputTokens.letterSpacing, _CodeInput.codeInputTokens.largeFontSize, _CodeInput.codeInputTokens.largeLineHeight, _CodeInput.codeInputTokens.mediumFontSize, _CodeInput.codeInputTokens.mediumLineHeight, _CodeInput.codeInputTokens.smallFontSize, _CodeInput.codeInputTokens.smallLineHeight, _CodeInput.codeInputTokens.captionFontFamily, _CodeInput.codeInputTokens.captionFontSize, _CodeInput.codeInputTokens.captionFontStyle, _CodeInput.codeInputTokens.captionFontWeight, _CodeInput.codeInputTokens.captionLetterSpacing, _CodeInput.codeInputTokens.captionLineHeight, _CodeInput.codeInputTokens.largeCodeItemWidth, _CodeInput.codeInputTokens.largeCodeItemHeight, _CodeInput.codeInputTokens.mediumCodeItemWidth, _CodeInput.codeInputTokens.mediumCodeItemHeight, _CodeInput.codeInputTokens.smallCodeItemWidth, _CodeInput.codeInputTokens.smallCodeItemHeight, _CodeInput.codeInputTokens.codeItemCircleBorderWidth, _CodeInput.codeInputTokens.codeItemCircleSize)
|
26
22
|
},
|
27
23
|
disabled: {
|
28
24
|
"true": /*#__PURE__*/(0, _styledComponents.css)(["", ":0.4;"], _CodeInput.codeInputTokens.disabledOpacity)
|
@@ -6,10 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
exports.config = void 0;
|
7
7
|
var _styledComponents = /*#__PURE__*/require("styled-components");
|
8
8
|
var _CodeInput = /*#__PURE__*/require("../../../../components/CodeInput");
|
9
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
10
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
11
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
12
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
13
9
|
var config = exports.config = {
|
14
10
|
defaults: {
|
15
11
|
view: 'default',
|
@@ -17,12 +13,12 @@ var config = exports.config = {
|
|
17
13
|
},
|
18
14
|
variations: {
|
19
15
|
view: {
|
20
|
-
"default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-secondary);", ":var(--text-negative);", ":var(--text-primary);", ":var(--text-negative);", ":var(--outline-accent);"
|
16
|
+
"default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-secondary);", ":var(--text-negative);", ":var(--text-primary);", ":var(--text-negative);", ":var(--outline-accent);"], _CodeInput.codeInputTokens.captionColor, _CodeInput.codeInputTokens.captionColorError, _CodeInput.codeInputTokens.codeColor, _CodeInput.codeInputTokens.codeColorError, _CodeInput.codeInputTokens.borderColorFocus)
|
21
17
|
},
|
22
18
|
size: {
|
23
|
-
l: /*#__PURE__*/(0, _styledComponents.css)(["", ":2.5rem;", ":0.75rem;", ":0.75rem;", ":var(--plasma-typo-dspl-l-font-family);", ":var(--plasma-typo-dspl-l-font-style);", ":var(--plasma-typo-dspl-l-bold-font-weight);", ":var(--plasma-typo-dspl-l-letter-spacing);", ":8rem;", ":8rem;", ":
|
24
|
-
m: /*#__PURE__*/(0, _styledComponents.css)(["", ":1.75rem;", ":0.5rem;", ":0.75rem;", ":var(--plasma-typo-dspl-m-font-family);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-bold-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":5.5rem;", ":5.75rem;", ":
|
25
|
-
s: /*#__PURE__*/(0, _styledComponents.css)(["", ":1.5rem;", ":0.25rem;", ":0.5rem;", ":var(--plasma-typo-dspl-s-font-family);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-bold-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":4rem;", ":4.25rem;", ":
|
19
|
+
l: /*#__PURE__*/(0, _styledComponents.css)(["", ":2.5rem;", ":0.75rem;", ":0.75rem;", ":var(--plasma-typo-dspl-l-font-family);", ":var(--plasma-typo-dspl-l-font-style);", ":var(--plasma-typo-dspl-l-bold-font-weight);", ":var(--plasma-typo-dspl-l-letter-spacing);", ":8rem;", ":8rem;", ":7rem;", ":7rem;", ":5.5rem;", ":5.75rem;", ":var(--plasma-typo-h3-font-family);", ":var(--plasma-typo-h3-font-size);", ":var(--plasma-typo-h3-font-style);", ":var(--plasma-typo-h3-font-weight);", ":var(--plasma-typo-h3-letter-spacing);", ":var(--plasma-typo-h3-line-height);", ":5rem;", ":8rem;", ":4.5rem;", ":7rem;", ":3.5rem;", ":5.75rem;", ":0.125rem;", ":1.5rem;"], _CodeInput.codeInputTokens.captionGap, _CodeInput.codeInputTokens.codeItemsGap, _CodeInput.codeInputTokens.separatorWidth, _CodeInput.codeInputTokens.fontFamily, _CodeInput.codeInputTokens.fontStyle, _CodeInput.codeInputTokens.fontWeight, _CodeInput.codeInputTokens.letterSpacing, _CodeInput.codeInputTokens.largeFontSize, _CodeInput.codeInputTokens.largeLineHeight, _CodeInput.codeInputTokens.mediumFontSize, _CodeInput.codeInputTokens.mediumLineHeight, _CodeInput.codeInputTokens.smallFontSize, _CodeInput.codeInputTokens.smallLineHeight, _CodeInput.codeInputTokens.captionFontFamily, _CodeInput.codeInputTokens.captionFontSize, _CodeInput.codeInputTokens.captionFontStyle, _CodeInput.codeInputTokens.captionFontWeight, _CodeInput.codeInputTokens.captionLetterSpacing, _CodeInput.codeInputTokens.captionLineHeight, _CodeInput.codeInputTokens.largeCodeItemWidth, _CodeInput.codeInputTokens.largeCodeItemHeight, _CodeInput.codeInputTokens.mediumCodeItemWidth, _CodeInput.codeInputTokens.mediumCodeItemHeight, _CodeInput.codeInputTokens.smallCodeItemWidth, _CodeInput.codeInputTokens.smallCodeItemHeight, _CodeInput.codeInputTokens.codeItemCircleBorderWidth, _CodeInput.codeInputTokens.codeItemCircleSize),
|
20
|
+
m: /*#__PURE__*/(0, _styledComponents.css)(["", ":1.75rem;", ":0.5rem;", ":0.75rem;", ":var(--plasma-typo-dspl-m-font-family);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-bold-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":5.5rem;", ":5.75rem;", ":4.5rem;", ":4.75rem;", ":3.5rem;", ":3.75rem;", ":var(--plasma-typo-h4-font-family);", ":var(--plasma-typo-h4-font-size);", ":var(--plasma-typo-h4-font-style);", ":var(--plasma-typo-h4-font-weight);", ":var(--plasma-typo-h4-letter-spacing);", ":var(--plasma-typo-h4-line-height);", ":3.5rem;", ":5.75rem;", ":3rem;", ":4.75rem;", ":2.25rem;", ":3.75rem;", ":0.094rem;", ":1rem;"], _CodeInput.codeInputTokens.captionGap, _CodeInput.codeInputTokens.codeItemsGap, _CodeInput.codeInputTokens.separatorWidth, _CodeInput.codeInputTokens.fontFamily, _CodeInput.codeInputTokens.fontStyle, _CodeInput.codeInputTokens.fontWeight, _CodeInput.codeInputTokens.letterSpacing, _CodeInput.codeInputTokens.largeFontSize, _CodeInput.codeInputTokens.largeLineHeight, _CodeInput.codeInputTokens.mediumFontSize, _CodeInput.codeInputTokens.mediumLineHeight, _CodeInput.codeInputTokens.smallFontSize, _CodeInput.codeInputTokens.smallLineHeight, _CodeInput.codeInputTokens.captionFontFamily, _CodeInput.codeInputTokens.captionFontSize, _CodeInput.codeInputTokens.captionFontStyle, _CodeInput.codeInputTokens.captionFontWeight, _CodeInput.codeInputTokens.captionLetterSpacing, _CodeInput.codeInputTokens.captionLineHeight, _CodeInput.codeInputTokens.largeCodeItemWidth, _CodeInput.codeInputTokens.largeCodeItemHeight, _CodeInput.codeInputTokens.mediumCodeItemWidth, _CodeInput.codeInputTokens.mediumCodeItemHeight, _CodeInput.codeInputTokens.smallCodeItemWidth, _CodeInput.codeInputTokens.smallCodeItemHeight, _CodeInput.codeInputTokens.codeItemCircleBorderWidth, _CodeInput.codeInputTokens.codeItemCircleSize),
|
21
|
+
s: /*#__PURE__*/(0, _styledComponents.css)(["", ":1.5rem;", ":0.25rem;", ":0.5rem;", ":var(--plasma-typo-dspl-s-font-family);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-bold-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":4rem;", ":4.25rem;", ":3rem;", ":3.25rem;", ":2.5rem;", ":2.75rem;", ":var(--plasma-typo-h5-font-family);", ":var(--plasma-typo-h5-font-size);", ":var(--plasma-typo-h5-font-style);", ":var(--plasma-typo-h5-font-weight);", ":var(--plasma-typo-h5-letter-spacing);", ":var(--plasma-typo-h5-line-height);", ":2.5rem;", ":4.25rem;", ":2rem;", ":3.25rem;", ":1.625rem;", ":2.75rem;", ":0.063rem;", ":0.75rem;"], _CodeInput.codeInputTokens.captionGap, _CodeInput.codeInputTokens.codeItemsGap, _CodeInput.codeInputTokens.separatorWidth, _CodeInput.codeInputTokens.fontFamily, _CodeInput.codeInputTokens.fontStyle, _CodeInput.codeInputTokens.fontWeight, _CodeInput.codeInputTokens.letterSpacing, _CodeInput.codeInputTokens.largeFontSize, _CodeInput.codeInputTokens.largeLineHeight, _CodeInput.codeInputTokens.mediumFontSize, _CodeInput.codeInputTokens.mediumLineHeight, _CodeInput.codeInputTokens.smallFontSize, _CodeInput.codeInputTokens.smallLineHeight, _CodeInput.codeInputTokens.captionFontFamily, _CodeInput.codeInputTokens.captionFontSize, _CodeInput.codeInputTokens.captionFontStyle, _CodeInput.codeInputTokens.captionFontWeight, _CodeInput.codeInputTokens.captionLetterSpacing, _CodeInput.codeInputTokens.captionLineHeight, _CodeInput.codeInputTokens.largeCodeItemWidth, _CodeInput.codeInputTokens.largeCodeItemHeight, _CodeInput.codeInputTokens.mediumCodeItemWidth, _CodeInput.codeInputTokens.mediumCodeItemHeight, _CodeInput.codeInputTokens.smallCodeItemWidth, _CodeInput.codeInputTokens.smallCodeItemHeight, _CodeInput.codeInputTokens.codeItemCircleBorderWidth, _CodeInput.codeInputTokens.codeItemCircleSize)
|
26
22
|
},
|
27
23
|
disabled: {
|
28
24
|
"true": /*#__PURE__*/(0, _styledComponents.css)(["", ":0.4;"], _CodeInput.codeInputTokens.disabledOpacity)
|
@@ -22,7 +22,7 @@ import cls from 'classnames';
|
|
22
22
|
import { useDidMountEffect } from "../../hooks";
|
23
23
|
import { getSizeValueFromProp } from "../../utils";
|
24
24
|
import { BACKSPACE_KEY, FORBIDDEN_KEYS, ONLY_DIGITS_PATTERN } from "./utils/constants";
|
25
|
-
import {
|
25
|
+
import { getCodeValue, getFieldPattern, getPlaceholderValue, handleCodeError, handleItemError } from "./utils";
|
26
26
|
import { classes } from "./CodeInput.tokens";
|
27
27
|
import { base, CaptionWrapper, CodeGroup, CodeWrapper, ItemInput, Separator, ItemWrapper, ItemCircle } from "./CodeInput.styles";
|
28
28
|
import { base as viewCSS } from "./variations/_view/base";
|
@@ -73,7 +73,6 @@ export var codeInputRoot = function codeInputRoot(Root) {
|
|
73
73
|
var fieldPattern = getFieldPattern(allowedSymbols);
|
74
74
|
var placeholderValue = getPlaceholderValue(codeLength, placeholder);
|
75
75
|
var parts = codeLength === 6 ? 2 : 1;
|
76
|
-
var viewClass = getCodeInputViewClass(view || 'default');
|
77
76
|
var widthValue = width ? getSizeValueFromProp(width, 'rem') : undefined;
|
78
77
|
var getLastActiveIndex = function getLastActiveIndex() {
|
79
78
|
if (code.length && code.length < codeLength) {
|
@@ -93,7 +92,7 @@ export var codeInputRoot = function codeInputRoot(Root) {
|
|
93
92
|
inputRefs.current[lastActiveIndex].focus();
|
94
93
|
}
|
95
94
|
};
|
96
|
-
var handleOnKeyDown = function handleOnKeyDown(event, index) {
|
95
|
+
var handleOnKeyDown = function handleOnKeyDown(event, index, type) {
|
97
96
|
if (disabled) {
|
98
97
|
return;
|
99
98
|
}
|
@@ -108,6 +107,11 @@ export var codeInputRoot = function codeInputRoot(Root) {
|
|
108
107
|
(_inputRefs$current = inputRefs.current[index - 1]) === null || _inputRefs$current === void 0 || _inputRefs$current.focus();
|
109
108
|
}
|
110
109
|
}
|
110
|
+
if (type === 'circle') {
|
111
|
+
var _inputRefs$current$in;
|
112
|
+
handleAddSymbol(key, index);
|
113
|
+
(_inputRefs$current$in = inputRefs.current[index]) === null || _inputRefs$current$in === void 0 || _inputRefs$current$in.focus();
|
114
|
+
}
|
111
115
|
};
|
112
116
|
var codeSetter = function codeSetter(newCode) {
|
113
117
|
setCode(newCode);
|
@@ -124,25 +128,6 @@ export var codeInputRoot = function codeInputRoot(Root) {
|
|
124
128
|
var symbol = rawSymbol.charAt(rawSymbol.length - 1);
|
125
129
|
handleAddSymbol(symbol, index);
|
126
130
|
};
|
127
|
-
var handleOnKeyDownCircle = function handleOnKeyDownCircle(event, index) {
|
128
|
-
var _inputRefs$current$in;
|
129
|
-
if (disabled) {
|
130
|
-
return;
|
131
|
-
}
|
132
|
-
var key = event.key;
|
133
|
-
if (FORBIDDEN_KEYS.includes(key)) {
|
134
|
-
event.preventDefault();
|
135
|
-
return;
|
136
|
-
}
|
137
|
-
if (key === BACKSPACE_KEY) {
|
138
|
-
if (index > 0 && code[index] === '') {
|
139
|
-
var _inputRefs$current2;
|
140
|
-
(_inputRefs$current2 = inputRefs.current[index - 1]) === null || _inputRefs$current2 === void 0 || _inputRefs$current2.focus();
|
141
|
-
}
|
142
|
-
}
|
143
|
-
handleAddSymbol(key, index);
|
144
|
-
(_inputRefs$current$in = inputRefs.current[index]) === null || _inputRefs$current$in === void 0 || _inputRefs$current$in.focus();
|
145
|
-
};
|
146
131
|
var handleAddSymbol = function handleAddSymbol(symbol, index) {
|
147
132
|
var _inputRefs$current$in2;
|
148
133
|
var newCode = _toConsumableArray(code);
|
@@ -162,8 +147,8 @@ export var codeInputRoot = function codeInputRoot(Root) {
|
|
162
147
|
newCode[index] = symbol;
|
163
148
|
codeSetter(newCode);
|
164
149
|
if (symbol && index < codeLength - 1) {
|
165
|
-
var _inputRefs$
|
166
|
-
(_inputRefs$
|
150
|
+
var _inputRefs$current2;
|
151
|
+
(_inputRefs$current2 = inputRefs.current[index + 1]) === null || _inputRefs$current2 === void 0 || _inputRefs$current2.focus();
|
167
152
|
}
|
168
153
|
return;
|
169
154
|
}
|
@@ -176,8 +161,8 @@ export var codeInputRoot = function codeInputRoot(Root) {
|
|
176
161
|
newCode[index] = symbol.charAt(symbol.length - 1);
|
177
162
|
codeSetter(newCode);
|
178
163
|
if (index < codeLength - 1) {
|
179
|
-
var _inputRefs$
|
180
|
-
(_inputRefs$
|
164
|
+
var _inputRefs$current3;
|
165
|
+
(_inputRefs$current3 = inputRefs.current[index + 1]) === null || _inputRefs$current3 === void 0 || _inputRefs$current3.focus();
|
181
166
|
}
|
182
167
|
} else {
|
183
168
|
newCode[index] = symbol.charAt(symbol.length - 1);
|
@@ -253,7 +238,7 @@ export var codeInputRoot = function codeInputRoot(Root) {
|
|
253
238
|
disabled: disabled,
|
254
239
|
screen: screen,
|
255
240
|
onClick: handleClick,
|
256
|
-
className: cls(className,
|
241
|
+
className: cls(className, _defineProperty({}, classes.captionAlignLeft, captionAlign === 'left'))
|
257
242
|
}, rest), /*#__PURE__*/React.createElement(CodeWrapper, {
|
258
243
|
ref: inputContainerRef
|
259
244
|
}, _toConsumableArray(Array(parts)).map(function (_, partIndex) {
|
@@ -269,7 +254,7 @@ export var codeInputRoot = function codeInputRoot(Root) {
|
|
269
254
|
role: "tab",
|
270
255
|
tabIndex: originalValue.length === inputCorrectIndex ? 0 : -1,
|
271
256
|
onKeyDown: function onKeyDown(e) {
|
272
|
-
|
257
|
+
handleOnKeyDown(e, inputCorrectIndex, 'circle');
|
273
258
|
},
|
274
259
|
className: cls([!!code[inputCorrectIndex] && hidden ? classes.itemCirlceFilled : '', "".concat(classes.itemCircle, "-").concat(inputCorrectIndex)])
|
275
260
|
}), /*#__PURE__*/React.createElement(ItemInput, _extends({
|
@@ -14,11 +14,6 @@ export var classes = {
|
|
14
14
|
hoverEnabled: 'codeinput-item-hover-enabled',
|
15
15
|
segmented: 'codeinput-shape-segmented',
|
16
16
|
"default": 'codeinput-shape-default',
|
17
|
-
largeMScreen: 'codeinput-large-m-screen',
|
18
|
-
largeSScreen: 'codeinput-large-s-screen',
|
19
|
-
mediumMScreen: 'codeinput-medium-m-screen',
|
20
|
-
mediumSScreen: 'codeinput-medium-s-screen',
|
21
|
-
smallMScreen: 'codeinput-small-m-screen',
|
22
17
|
disabled: 'codeinput-disabled'
|
23
18
|
};
|
24
19
|
export var privateTokens = {
|
@@ -30,38 +25,25 @@ export var privateTokens = {
|
|
30
25
|
export var tokens = {
|
31
26
|
captionGap: '--plasma-codeinput-caption-gap',
|
32
27
|
codeItemsGap: '--plasma-codeinput-code-item-gap',
|
33
|
-
smallMMinWidth: '--plasma-codeinput-smallM-min-width',
|
34
|
-
mediumSMinWidth: '--plasma-codeinput-mediumS-min-width',
|
35
|
-
mediumMMinWidth: '--plasma-codeinput-mediumM-min-width',
|
36
|
-
largeSMinWidth: '--plasma-codeinput-largeS-min-width',
|
37
|
-
largeMMinWidth: '--plasma-codeinput-largeM-min-width',
|
38
28
|
separatorWidth: '--plasma-codeinput-separator-width',
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
mediumSCodeItemWidth: '--plasma-codeinput-item-medium-s-width',
|
46
|
-
mediumSCodeItemHeight: '--plasma-codeinput-item-medium-s-height',
|
47
|
-
smallMCodeItemWidth: '--plasma-codeinput-item-small-m-width',
|
48
|
-
smallMCodeItemHeight: '--plasma-codeinput-item-small-m-height',
|
29
|
+
largeCodeItemWidth: '--plasma-codeinput-item-large-width',
|
30
|
+
largeCodeItemHeight: '--plasma-codeinput-item-large-height',
|
31
|
+
mediumCodeItemWidth: '--plasma-codeinput-item-medium-width',
|
32
|
+
mediumCodeItemHeight: '--plasma-codeinput-item-medium-height',
|
33
|
+
smallCodeItemWidth: '--plasma-codeinput-item-small-width',
|
34
|
+
smallCodeItemHeight: '--plasma-codeinput-item-small-height',
|
49
35
|
codeItemCircleSize: '--plasma-codeinput-item-circle-size',
|
50
36
|
codeItemCircleBorderWidth: '--plasma-codeinput-item-circle-border-width',
|
51
37
|
fontStyle: '--plasma-codeinput-font-style',
|
52
38
|
fontFamily: '--plasma-codeinput-font-family',
|
53
39
|
fontWeight: '--plasma-codeinput-font-weight',
|
54
40
|
letterSpacing: '--plasma-codeinput-letter-spacing',
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
mediumSFontSize: '--plasma-codeinput-medium-s-font-size',
|
62
|
-
mediumSLineHeight: '--plasma-codeinput-medium-s-line-height',
|
63
|
-
smallMFontSize: '--plasma-codeinput-small-m-font-size',
|
64
|
-
smallMLineHeight: '--plasma-codeinput-small-m-line-height',
|
41
|
+
largeFontSize: '--plasma-codeinput-large-font-size',
|
42
|
+
largeLineHeight: '--plasma-codeinput-large-line-height',
|
43
|
+
mediumFontSize: '--plasma-codeinput-medium-font-size',
|
44
|
+
mediumLineHeight: '--plasma-codeinput-medium-line-height',
|
45
|
+
smallFontSize: '--plasma-codeinput-small-font-size',
|
46
|
+
smallLineHeight: '--plasma-codeinput-small-line-height',
|
65
47
|
captionFontFamily: '--plasma-codeinput-caption-font-family',
|
66
48
|
captionFontSize: '--plasma-codeinput-caption-font-style',
|
67
49
|
captionFontStyle: '--plasma-codeinput-caption-font-size',
|
@@ -1,3 +1,2 @@
|
|
1
1
|
export { codeInputRoot, codeInputConfig } from "./CodeInput";
|
2
|
-
export { tokens as codeInputTokens, classes as codeInputClasses } from "./CodeInput.tokens";
|
3
|
-
export { getCodeInputView } from "./utils";
|
2
|
+
export { tokens as codeInputTokens, classes as codeInputClasses } from "./CodeInput.tokens";
|
@@ -1,4 +1,3 @@
|
|
1
|
-
export { getFieldPattern, getPlaceholderValue, getCodeValue } from "
|
1
|
+
export { getFieldPattern, getPlaceholderValue, getCodeValue } from "../../CodeField/utils";
|
2
2
|
export { handleItemError } from "./handleItemError";
|
3
|
-
export { handleCodeError } from "
|
4
|
-
export * from "./generateMediaQuery";
|
3
|
+
export { handleCodeError } from "../../CodeField/utils";
|
@@ -1,4 +1,19 @@
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
1
7
|
import { css } from 'styled-components';
|
2
8
|
import { CaptionWrapper, CodeGroup, CodeWrapper, ItemInput } from "../../CodeInput.styles";
|
3
9
|
import { tokens, privateTokens } from "../../CodeInput.tokens";
|
4
|
-
|
10
|
+
import { screenGroupBreakpoints } from "../../../../utils/constants";
|
11
|
+
var getIconMediaQueries = function getIconMediaQueries() {
|
12
|
+
return Object.entries(screenGroupBreakpoints).map(function (_ref) {
|
13
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
14
|
+
name = _ref2[0],
|
15
|
+
minWidth = _ref2[1];
|
16
|
+
return "\n @media (min-width: ".concat(minWidth, ") {\n ").concat(privateTokens.fontSize, ": var(").concat(tokens["".concat(name, "FontSize")], ");\n ").concat(privateTokens.lineHeight, ": var(").concat(tokens["".concat(name, "CodeItemHeight")], ");\n ").concat(privateTokens.itemWidth, ": var(").concat(tokens["".concat(name, "CodeItemWidth")], ");\n ").concat(privateTokens.itemHeight, ": var(").concat(tokens["".concat(name, "LineHeight")], ");\n }\n ");
|
17
|
+
}).join('\n');
|
18
|
+
};
|
19
|
+
export var base = /*#__PURE__*/css(["", " gap:var(", ");", ",", "{gap:var(", ");}", "{font-size:var(", ");font-family:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");width:var(", ");height:var(", ");}", "{font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");}"], /*#__PURE__*/getIconMediaQueries(), tokens.captionGap, CodeWrapper, CodeGroup, tokens.codeItemsGap, ItemInput, privateTokens.fontSize, tokens.fontFamily, tokens.fontStyle, tokens.fontWeight, tokens.letterSpacing, privateTokens.lineHeight, privateTokens.itemWidth, privateTokens.itemHeight, CaptionWrapper, tokens.captionFontFamily, tokens.captionFontSize, tokens.captionFontStyle, tokens.captionFontWeight, tokens.captionLetterSpacing, tokens.captionLineHeight);
|