@commercetools-uikit/radio-input 15.2.4 → 15.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commercetools-uikit-radio-input.cjs.dev.js +56 -64
- package/dist/commercetools-uikit-radio-input.cjs.prod.js +53 -61
- package/dist/commercetools-uikit-radio-input.esm.js +58 -66
- package/dist/declarations/src/icons/generated/RadioOptionCheckedReact.d.ts +1 -2
- package/dist/declarations/src/icons/generated/RadioOptionUncheckedReact.d.ts +1 -2
- package/package.json +9 -9
|
@@ -91,44 +91,41 @@ var getSizeStyle$1 = function getSizeStyle(size) {
|
|
|
91
91
|
}
|
|
92
92
|
};
|
|
93
93
|
|
|
94
|
-
var getColor$1 = function getColor(color
|
|
94
|
+
var getColor$1 = function getColor(color) {
|
|
95
95
|
if (!color) return 'inherit';
|
|
96
|
-
|
|
97
|
-
var overwrittenVars = _objectSpread$3(_objectSpread$3({}, designSystem.customProperties), theme);
|
|
98
|
-
|
|
99
96
|
var iconColor;
|
|
100
97
|
|
|
101
98
|
switch (color) {
|
|
102
99
|
case 'solid':
|
|
103
|
-
iconColor =
|
|
100
|
+
iconColor = designSystem.designTokens.colorSolid;
|
|
104
101
|
break;
|
|
105
102
|
|
|
106
103
|
case 'neutral60':
|
|
107
|
-
iconColor =
|
|
104
|
+
iconColor = designSystem.designTokens.colorNeutral60;
|
|
108
105
|
break;
|
|
109
106
|
|
|
110
107
|
case 'surface':
|
|
111
|
-
iconColor =
|
|
108
|
+
iconColor = designSystem.designTokens.colorSurface;
|
|
112
109
|
break;
|
|
113
110
|
|
|
114
111
|
case 'info':
|
|
115
|
-
iconColor =
|
|
112
|
+
iconColor = designSystem.designTokens.colorInfo;
|
|
116
113
|
break;
|
|
117
114
|
|
|
118
115
|
case 'primary':
|
|
119
|
-
iconColor =
|
|
116
|
+
iconColor = designSystem.designTokens.colorPrimary;
|
|
120
117
|
break;
|
|
121
118
|
|
|
122
119
|
case 'primary40':
|
|
123
|
-
iconColor =
|
|
120
|
+
iconColor = designSystem.designTokens.colorPrimary40;
|
|
124
121
|
break;
|
|
125
122
|
|
|
126
123
|
case 'warning':
|
|
127
|
-
iconColor =
|
|
124
|
+
iconColor = designSystem.designTokens.colorWarning;
|
|
128
125
|
break;
|
|
129
126
|
|
|
130
127
|
case 'error':
|
|
131
|
-
iconColor =
|
|
128
|
+
iconColor = designSystem.designTokens.colorError;
|
|
132
129
|
break;
|
|
133
130
|
}
|
|
134
131
|
|
|
@@ -139,8 +136,8 @@ var getColor$1 = function getColor(color, theme) {
|
|
|
139
136
|
return iconColor;
|
|
140
137
|
};
|
|
141
138
|
|
|
142
|
-
var getIconStyles$1 = function getIconStyles(props
|
|
143
|
-
return /*#__PURE__*/react.css("*:not([fill='none']){fill:", getColor$1(props.color
|
|
139
|
+
var getIconStyles$1 = function getIconStyles(props) {
|
|
140
|
+
return /*#__PURE__*/react.css("*:not([fill='none']){fill:", getColor$1(props.color), ";}&,image{", getSizeStyle$1(props.size), ";}flex-shrink:0;" + ("" ), "" );
|
|
144
141
|
};
|
|
145
142
|
|
|
146
143
|
var SvgRadioOptionChecked = function SvgRadioOptionChecked(props) {
|
|
@@ -179,12 +176,11 @@ var SvgRadioOptionChecked = function SvgRadioOptionChecked(props) {
|
|
|
179
176
|
SvgRadioOptionChecked.displayName = 'SvgRadioOptionChecked';
|
|
180
177
|
|
|
181
178
|
var RadioOptionCheckedIcon = function RadioOptionCheckedIcon(props) {
|
|
182
|
-
var theme = react.useTheme();
|
|
183
179
|
return jsxRuntime.jsx(react.ClassNames, {
|
|
184
180
|
children: function children(_ref) {
|
|
185
181
|
var createClass = _ref.css;
|
|
186
182
|
return jsxRuntime.jsx(SvgRadioOptionChecked, _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
187
|
-
className: createClass(getIconStyles$1(props
|
|
183
|
+
className: createClass(getIconStyles$1(props))
|
|
188
184
|
}));
|
|
189
185
|
}
|
|
190
186
|
});
|
|
@@ -240,44 +236,41 @@ var getSizeStyle = function getSizeStyle(size) {
|
|
|
240
236
|
}
|
|
241
237
|
};
|
|
242
238
|
|
|
243
|
-
var getColor = function getColor(color
|
|
239
|
+
var getColor = function getColor(color) {
|
|
244
240
|
if (!color) return 'inherit';
|
|
245
|
-
|
|
246
|
-
var overwrittenVars = _objectSpread$2(_objectSpread$2({}, designSystem.customProperties), theme);
|
|
247
|
-
|
|
248
241
|
var iconColor;
|
|
249
242
|
|
|
250
243
|
switch (color) {
|
|
251
244
|
case 'solid':
|
|
252
|
-
iconColor =
|
|
245
|
+
iconColor = designSystem.designTokens.colorSolid;
|
|
253
246
|
break;
|
|
254
247
|
|
|
255
248
|
case 'neutral60':
|
|
256
|
-
iconColor =
|
|
249
|
+
iconColor = designSystem.designTokens.colorNeutral60;
|
|
257
250
|
break;
|
|
258
251
|
|
|
259
252
|
case 'surface':
|
|
260
|
-
iconColor =
|
|
253
|
+
iconColor = designSystem.designTokens.colorSurface;
|
|
261
254
|
break;
|
|
262
255
|
|
|
263
256
|
case 'info':
|
|
264
|
-
iconColor =
|
|
257
|
+
iconColor = designSystem.designTokens.colorInfo;
|
|
265
258
|
break;
|
|
266
259
|
|
|
267
260
|
case 'primary':
|
|
268
|
-
iconColor =
|
|
261
|
+
iconColor = designSystem.designTokens.colorPrimary;
|
|
269
262
|
break;
|
|
270
263
|
|
|
271
264
|
case 'primary40':
|
|
272
|
-
iconColor =
|
|
265
|
+
iconColor = designSystem.designTokens.colorPrimary40;
|
|
273
266
|
break;
|
|
274
267
|
|
|
275
268
|
case 'warning':
|
|
276
|
-
iconColor =
|
|
269
|
+
iconColor = designSystem.designTokens.colorWarning;
|
|
277
270
|
break;
|
|
278
271
|
|
|
279
272
|
case 'error':
|
|
280
|
-
iconColor =
|
|
273
|
+
iconColor = designSystem.designTokens.colorError;
|
|
281
274
|
break;
|
|
282
275
|
}
|
|
283
276
|
|
|
@@ -288,8 +281,8 @@ var getColor = function getColor(color, theme) {
|
|
|
288
281
|
return iconColor;
|
|
289
282
|
};
|
|
290
283
|
|
|
291
|
-
var getIconStyles = function getIconStyles(props
|
|
292
|
-
return /*#__PURE__*/react.css("*:not([fill='none']){fill:", getColor(props.color
|
|
284
|
+
var getIconStyles = function getIconStyles(props) {
|
|
285
|
+
return /*#__PURE__*/react.css("*:not([fill='none']){fill:", getColor(props.color), ";}&,image{", getSizeStyle(props.size), ";}flex-shrink:0;" + ("" ), "" );
|
|
293
286
|
};
|
|
294
287
|
|
|
295
288
|
var SvgRadioOptionUnchecked = function SvgRadioOptionUnchecked(props) {
|
|
@@ -320,12 +313,11 @@ var SvgRadioOptionUnchecked = function SvgRadioOptionUnchecked(props) {
|
|
|
320
313
|
SvgRadioOptionUnchecked.displayName = 'SvgRadioOptionUnchecked';
|
|
321
314
|
|
|
322
315
|
var RadioOptionUncheckedIcon = function RadioOptionUncheckedIcon(props) {
|
|
323
|
-
var theme = react.useTheme();
|
|
324
316
|
return jsxRuntime.jsx(react.ClassNames, {
|
|
325
317
|
children: function children(_ref) {
|
|
326
318
|
var createClass = _ref.css;
|
|
327
319
|
return jsxRuntime.jsx(SvgRadioOptionUnchecked, _objectSpread$2(_objectSpread$2({}, props), {}, {
|
|
328
|
-
className: createClass(getIconStyles(props
|
|
320
|
+
className: createClass(getIconStyles(props))
|
|
329
321
|
}));
|
|
330
322
|
}
|
|
331
323
|
});
|
|
@@ -336,14 +328,14 @@ var RadioOptionUncheckedIcon$1 = RadioOptionUncheckedIcon;
|
|
|
336
328
|
|
|
337
329
|
var LabelTextWrapper = /*#__PURE__*/_styled__default["default"]("div", {
|
|
338
330
|
target: "e1x57rfz2"
|
|
339
|
-
} )("grid-area:label;margin-left:", designSystem.
|
|
340
|
-
return props.isDisabled ? designSystem.
|
|
331
|
+
} )("grid-area:label;margin-left:", designSystem.designTokens.spacingS, ";font-size:1rem;font-family:inherit;color:", function (props) {
|
|
332
|
+
return props.isDisabled ? designSystem.designTokens.fontColorForInputWhenDisabled : designSystem.designTokens.fontColorForInput;
|
|
341
333
|
}, ";" + ("" ));
|
|
342
334
|
|
|
343
335
|
var AdditionalTextWrapper = /*#__PURE__*/_styled__default["default"]("div", {
|
|
344
336
|
target: "e1x57rfz1"
|
|
345
|
-
} )("grid-area:content;margin-left:", designSystem.
|
|
346
|
-
return props.isDisabled ? designSystem.
|
|
337
|
+
} )("grid-area:content;margin-left:", designSystem.designTokens.spacingXs, ";font-size:1rem;font-family:inherit;color:", function (props) {
|
|
338
|
+
return props.isDisabled ? designSystem.designTokens.fontColorForInputWhenDisabled : designSystem.designTokens.fontColorForInput;
|
|
347
339
|
}, ";" + ("" ));
|
|
348
340
|
|
|
349
341
|
var RadioOptionsWrapper = /*#__PURE__*/_styled__default["default"]("div", {
|
|
@@ -355,90 +347,90 @@ var RadioOptionsWrapper = /*#__PURE__*/_styled__default["default"]("div", {
|
|
|
355
347
|
|
|
356
348
|
var getSvgContainerBorderStroke = function getSvgContainerBorderStroke(props) {
|
|
357
349
|
if (props.isDisabled) {
|
|
358
|
-
return designSystem.
|
|
350
|
+
return designSystem.designTokens.borderColorForInputWhenDisabled;
|
|
359
351
|
}
|
|
360
352
|
|
|
361
353
|
if (props.hasError) {
|
|
362
|
-
return designSystem.
|
|
354
|
+
return designSystem.designTokens.borderColorForInputWhenError;
|
|
363
355
|
}
|
|
364
356
|
|
|
365
357
|
if (props.hasWarning) {
|
|
366
|
-
return designSystem.
|
|
358
|
+
return designSystem.designTokens.borderColorForInputWhenWarning;
|
|
367
359
|
}
|
|
368
360
|
|
|
369
361
|
if (props.isHovered && !props.isDisabled) {
|
|
370
|
-
return designSystem.
|
|
362
|
+
return designSystem.designTokens.borderColorForInputWhenFocused;
|
|
371
363
|
}
|
|
372
364
|
|
|
373
365
|
if (props.isReadOnly) {
|
|
374
|
-
return designSystem.
|
|
366
|
+
return designSystem.designTokens.borderColorForInputWhenReadonly;
|
|
375
367
|
}
|
|
376
368
|
|
|
377
|
-
return designSystem.
|
|
369
|
+
return designSystem.designTokens.borderColorForInput;
|
|
378
370
|
};
|
|
379
371
|
|
|
380
372
|
var getSvgContainerContentFill = function getSvgContainerContentFill(props) {
|
|
381
373
|
if (props.isDisabled) {
|
|
382
|
-
return designSystem.
|
|
374
|
+
return designSystem.designTokens.fontColorForInputWhenDisabled;
|
|
383
375
|
}
|
|
384
376
|
|
|
385
377
|
if (props.hasError) {
|
|
386
|
-
return designSystem.
|
|
378
|
+
return designSystem.designTokens.fontColorForInputWhenError;
|
|
387
379
|
}
|
|
388
380
|
|
|
389
381
|
if (props.hasWarning) {
|
|
390
|
-
return designSystem.
|
|
382
|
+
return designSystem.designTokens.fontColorForInputWhenWarning;
|
|
391
383
|
}
|
|
392
384
|
|
|
393
385
|
if (props.isReadOnly) {
|
|
394
|
-
return designSystem.
|
|
386
|
+
return designSystem.designTokens.fontColorForInputWhenReadonly;
|
|
395
387
|
}
|
|
396
388
|
|
|
397
|
-
return designSystem.
|
|
389
|
+
return designSystem.designTokens.borderColorForInputWhenFocused;
|
|
398
390
|
};
|
|
399
391
|
|
|
400
392
|
var getContainerStyles = function getContainerStyles(props) {
|
|
401
|
-
return /*#__PURE__*/react.css("display:flex;align-items:center;grid-area:radio;svg{fill:", props.isDisabled ? designSystem.
|
|
393
|
+
return /*#__PURE__*/react.css("display:flex;align-items:center;grid-area:radio;svg{fill:", props.isDisabled ? designSystem.designTokens.backgroundColorForInputWhenDisabled : designSystem.designTokens.backgroundColorForInput, ";}svg *[data-style='radio-option__border']{stroke:", getSvgContainerBorderStroke(props), ";}svg *[data-style='radio-option__content']{fill:", getSvgContainerContentFill(props), ";}" + ("" ), "" );
|
|
402
394
|
};
|
|
403
395
|
|
|
404
396
|
var getSvgLabelBorderStroke = function getSvgLabelBorderStroke(props) {
|
|
405
397
|
if (props.isDisabled) {
|
|
406
|
-
return designSystem.
|
|
398
|
+
return designSystem.designTokens.borderColorForInputWhenDisabled;
|
|
407
399
|
}
|
|
408
400
|
|
|
409
401
|
if (props.hasError) {
|
|
410
|
-
return designSystem.
|
|
402
|
+
return designSystem.designTokens.borderColorForInputWhenError;
|
|
411
403
|
}
|
|
412
404
|
|
|
413
405
|
if (props.hasWarning) {
|
|
414
|
-
return designSystem.
|
|
406
|
+
return designSystem.designTokens.borderColorForInputWhenWarning;
|
|
415
407
|
}
|
|
416
408
|
|
|
417
409
|
if (props.isReadOnly) {
|
|
418
|
-
return designSystem.
|
|
410
|
+
return designSystem.designTokens.borderColorForInputWhenReadonly;
|
|
419
411
|
}
|
|
420
412
|
|
|
421
|
-
return designSystem.
|
|
413
|
+
return designSystem.designTokens.borderColorForInputWhenFocused;
|
|
422
414
|
};
|
|
423
415
|
|
|
424
416
|
var getLabelColor = function getLabelColor(props) {
|
|
425
417
|
if (props.isDisabled) {
|
|
426
|
-
return designSystem.
|
|
418
|
+
return designSystem.designTokens.fontColorForInputWhenDisabled;
|
|
427
419
|
}
|
|
428
420
|
|
|
429
421
|
if (props.hasError) {
|
|
430
|
-
return designSystem.
|
|
422
|
+
return designSystem.designTokens.fontColorForInputWhenError;
|
|
431
423
|
}
|
|
432
424
|
|
|
433
425
|
if (props.hasWarning) {
|
|
434
|
-
return designSystem.
|
|
426
|
+
return designSystem.designTokens.fontColorForInputWhenWarning;
|
|
435
427
|
}
|
|
436
428
|
|
|
437
429
|
if (props.isReadOnly) {
|
|
438
|
-
return designSystem.
|
|
430
|
+
return designSystem.designTokens.fontColorForInputWhenReadonly;
|
|
439
431
|
}
|
|
440
432
|
|
|
441
|
-
return designSystem.
|
|
433
|
+
return designSystem.designTokens.fontColorForInput;
|
|
442
434
|
};
|
|
443
435
|
|
|
444
436
|
var getLabelCursor = function getLabelCursor(props) {
|
|
@@ -454,7 +446,7 @@ var getLabelCursor = function getLabelCursor(props) {
|
|
|
454
446
|
};
|
|
455
447
|
|
|
456
448
|
var getLabelStyles = function getLabelStyles(props) {
|
|
457
|
-
return /*#__PURE__*/react.css("align-items:center;color:", getLabelColor(props), ";cursor:", getLabelCursor(props), ";display:flex;position:relative;&:hover svg *[data-style='radio-option__border']{stroke:", getSvgLabelBorderStroke(props), ";}:focus-within ", LabelTextWrapper, "{outline:auto 2px ", designSystem.
|
|
449
|
+
return /*#__PURE__*/react.css("align-items:center;color:", getLabelColor(props), ";cursor:", getLabelCursor(props), ";display:flex;position:relative;&:hover svg *[data-style='radio-option__border']{stroke:", getSvgLabelBorderStroke(props), ";}:focus-within ", LabelTextWrapper, "{outline:auto 2px ", designSystem.designTokens.borderColorForInputWhenFocused, ";outline-offset:3px;}" + ("" ), "" );
|
|
458
450
|
};
|
|
459
451
|
|
|
460
452
|
function ownKeys$1(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -463,7 +455,7 @@ function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) {
|
|
|
463
455
|
|
|
464
456
|
var Input = /*#__PURE__*/_styled__default["default"]("input", {
|
|
465
457
|
target: "ejtzo910"
|
|
466
|
-
} )("&:focus+div>svg *[data-style='radio-option__border']{stroke:", designSystem.
|
|
458
|
+
} )("&:focus+div>svg *[data-style='radio-option__border']{stroke:", designSystem.designTokens.borderColorForInputWhenFocused, ";}" + ("" ));
|
|
467
459
|
|
|
468
460
|
var Option = function Option(props) {
|
|
469
461
|
var _props$components;
|
|
@@ -599,7 +591,7 @@ Group.defaultProps = defaultProps;
|
|
|
599
591
|
var Group$1 = Group;
|
|
600
592
|
|
|
601
593
|
// NOTE: This string will be replaced on build time with the package version.
|
|
602
|
-
var version = "15.
|
|
594
|
+
var version = "15.3.0";
|
|
603
595
|
|
|
604
596
|
var RadioInput = {
|
|
605
597
|
Group: Group$1,
|