@razorpay/blade 10.13.2 → 10.14.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/build/components/index.d.ts +114 -46
- package/build/components/index.development.web.js +163 -145
- package/build/components/index.development.web.js.map +1 -1
- package/build/components/index.native.d.ts +114 -46
- package/build/components/index.native.js +16 -16
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.production.web.js +163 -145
- package/build/components/index.production.web.js.map +1 -1
- package/build/css/bankingThemeDarkDesktop.css +333 -157
- package/build/css/bankingThemeDarkMobile.css +333 -157
- package/build/css/bankingThemeLightDesktop.css +332 -156
- package/build/css/bankingThemeLightMobile.css +332 -156
- package/build/css/paymentThemeDarkDesktop.css +333 -157
- package/build/css/paymentThemeDarkMobile.css +333 -157
- package/build/css/paymentThemeLightDesktop.css +332 -156
- package/build/css/paymentThemeLightMobile.css +332 -156
- package/build/tokens/index.d.ts +46 -25
- package/build/tokens/index.development.web.js +3344 -1488
- package/build/tokens/index.development.web.js.map +1 -1
- package/build/tokens/index.native.d.ts +46 -25
- package/build/tokens/index.native.js +2 -2
- package/build/tokens/index.native.js.map +1 -1
- package/build/tokens/index.production.web.js +3344 -1488
- package/build/tokens/index.production.web.js.map +1 -1
- package/build/utils/index.d.ts +46 -25
- package/build/utils/index.development.web.js.map +1 -1
- package/build/utils/index.native.d.ts +46 -25
- package/build/utils/index.native.js.map +1 -1
- package/package.json +1 -1
|
@@ -12799,13 +12799,16 @@ var getBaseTextStyles = function getBaseTextStyles(_ref) {
|
|
|
12799
12799
|
};
|
|
12800
12800
|
}
|
|
12801
12801
|
}
|
|
12802
|
-
return _objectSpread$1N({
|
|
12802
|
+
return _objectSpread$1N(_objectSpread$1N({
|
|
12803
12803
|
color: textColor,
|
|
12804
12804
|
fontFamily: themeFontFamily,
|
|
12805
12805
|
fontSize: themeFontSize,
|
|
12806
12806
|
fontWeight: themeFontWeight,
|
|
12807
12807
|
fontStyle: fontStyle,
|
|
12808
|
-
textDecorationLine: textDecorationLine
|
|
12808
|
+
textDecorationLine: textDecorationLine
|
|
12809
|
+
}, textDecorationLine !== 'none' && {
|
|
12810
|
+
textDecorationColor: textColor
|
|
12811
|
+
}), {}, {
|
|
12809
12812
|
lineHeight: themeLineHeight,
|
|
12810
12813
|
textAlign: textAlign,
|
|
12811
12814
|
margin: 0,
|
|
@@ -15482,7 +15485,7 @@ var getStringFromReactText = function getStringFromReactText(childReactText) {
|
|
|
15482
15485
|
return String(childReactText);
|
|
15483
15486
|
};
|
|
15484
15487
|
|
|
15485
|
-
var _excluded$C = ["children", "contrast", "fontWeight", "icon", "size", "variant", "testID"];
|
|
15488
|
+
var _excluded$C = ["children", "contrast", "fontWeight", "icon", "size", "variant", "color", "testID"];
|
|
15486
15489
|
function ownKeys$1s(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
15487
15490
|
function _objectSpread$1r(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1s(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1s(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
15488
15491
|
var isFeedbackVariant$1 = function isFeedbackVariant(variant) {
|
|
@@ -15492,19 +15495,20 @@ var isFeedbackVariant$1 = function isFeedbackVariant(variant) {
|
|
|
15492
15495
|
var getColorProps$1 = function getColorProps(_ref) {
|
|
15493
15496
|
var variant = _ref.variant,
|
|
15494
15497
|
contrast = _ref.contrast;
|
|
15498
|
+
var badgeVariant = variant === 'default' ? 'blue' : variant;
|
|
15495
15499
|
var props = {
|
|
15496
15500
|
iconColor: 'feedback.icon.neutral.lowContrast',
|
|
15497
15501
|
textColor: 'feedback.text.neutral.lowContrast',
|
|
15498
15502
|
backgroundColor: 'feedback.background.neutral.lowContrast'
|
|
15499
15503
|
};
|
|
15500
|
-
if (isFeedbackVariant$1(
|
|
15501
|
-
props.iconColor = "feedback.icon.".concat(
|
|
15502
|
-
props.textColor = "feedback.text.".concat(
|
|
15503
|
-
props.backgroundColor = "feedback.background.".concat(
|
|
15504
|
+
if (isFeedbackVariant$1(badgeVariant)) {
|
|
15505
|
+
props.iconColor = "feedback.icon.".concat(badgeVariant, ".").concat(contrast, "Contrast");
|
|
15506
|
+
props.textColor = "feedback.text.".concat(badgeVariant, ".").concat(contrast, "Contrast");
|
|
15507
|
+
props.backgroundColor = "feedback.background.".concat(badgeVariant, ".").concat(contrast, "Contrast");
|
|
15504
15508
|
} else {
|
|
15505
|
-
props.iconColor = "badge.icon.".concat(
|
|
15506
|
-
props.textColor = "badge.text.".concat(
|
|
15507
|
-
props.backgroundColor = "badge.background.".concat(
|
|
15509
|
+
props.iconColor = "badge.icon.".concat(badgeVariant, ".").concat(contrast, "Contrast");
|
|
15510
|
+
props.textColor = "badge.text.".concat(badgeVariant, ".").concat(contrast, "Contrast");
|
|
15511
|
+
props.backgroundColor = "badge.background.".concat(badgeVariant, ".").concat(contrast, "Contrast");
|
|
15508
15512
|
}
|
|
15509
15513
|
return props;
|
|
15510
15514
|
};
|
|
@@ -15519,11 +15523,13 @@ var _Badge = function _Badge(_ref2) {
|
|
|
15519
15523
|
size = _ref2$size === void 0 ? 'medium' : _ref2$size,
|
|
15520
15524
|
_ref2$variant = _ref2.variant,
|
|
15521
15525
|
variant = _ref2$variant === void 0 ? 'neutral' : _ref2$variant,
|
|
15526
|
+
color = _ref2.color,
|
|
15522
15527
|
testID = _ref2.testID,
|
|
15523
15528
|
styledProps = _objectWithoutProperties$1(_ref2, _excluded$C);
|
|
15524
15529
|
getStringFromReactText(children);
|
|
15530
|
+
var badgeVariant = color !== null && color !== void 0 ? color : variant;
|
|
15525
15531
|
var _getColorProps = getColorProps$1({
|
|
15526
|
-
variant:
|
|
15532
|
+
variant: badgeVariant,
|
|
15527
15533
|
contrast: contrast
|
|
15528
15534
|
}),
|
|
15529
15535
|
backgroundColor = _getColorProps.backgroundColor,
|
|
@@ -16123,20 +16129,24 @@ var StyledBaseButton = /*#__PURE__*/styled.button.withConfig({
|
|
|
16123
16129
|
transitionTimingFunction: getIn(props.theme.motion, props.motionEasing),
|
|
16124
16130
|
transitionDuration: castWebType(makeMotionTime(getIn(props.theme.motion, props.motionDuration))),
|
|
16125
16131
|
position: 'relative',
|
|
16126
|
-
'&:hover': {
|
|
16127
|
-
backgroundColor: props.hoverBackgroundColor
|
|
16132
|
+
'&:hover': _objectSpread$1o({
|
|
16133
|
+
backgroundColor: props.hoverBackgroundColor
|
|
16134
|
+
}, props.variant !== 'tertiary' && {
|
|
16128
16135
|
borderColor: props.hoverBorderColor
|
|
16129
|
-
},
|
|
16130
|
-
'&:active': {
|
|
16131
|
-
backgroundColor: props.activeBackgroundColor
|
|
16136
|
+
}),
|
|
16137
|
+
'&:active': _objectSpread$1o({
|
|
16138
|
+
backgroundColor: props.activeBackgroundColor
|
|
16139
|
+
}, props.variant !== 'tertiary' && {
|
|
16132
16140
|
borderColor: props.activeBorderColor
|
|
16133
|
-
},
|
|
16134
|
-
'&:focus': {
|
|
16135
|
-
backgroundColor: props.focusBackgroundColor
|
|
16136
|
-
|
|
16137
|
-
|
|
16138
|
-
|
|
16139
|
-
|
|
16141
|
+
}),
|
|
16142
|
+
'&:focus-visible': _objectSpread$1o(_objectSpread$1o({
|
|
16143
|
+
backgroundColor: props.focusBackgroundColor
|
|
16144
|
+
}, props.variant !== 'tertiary' && {
|
|
16145
|
+
borderColor: props.focusBorderColor
|
|
16146
|
+
}), {}, {
|
|
16147
|
+
outline: "1px solid ".concat(props.theme.colors.surface.background.level1.lowContrast),
|
|
16148
|
+
boxShadow: "0px 0px 0px 4px ".concat(props.focusRingColor)
|
|
16149
|
+
}),
|
|
16140
16150
|
'*': {
|
|
16141
16151
|
transitionProperty: 'color, fill',
|
|
16142
16152
|
transitionDuration: castWebType(makeMotionTime(getIn(props.theme.motion, props.motionDuration))),
|
|
@@ -16217,8 +16227,8 @@ var buttonIconOnlyPadding = {
|
|
|
16217
16227
|
large: {
|
|
16218
16228
|
top: 0,
|
|
16219
16229
|
bottom: 0,
|
|
16220
|
-
left:
|
|
16221
|
-
right:
|
|
16230
|
+
left: 2,
|
|
16231
|
+
right: 2
|
|
16222
16232
|
}
|
|
16223
16233
|
};
|
|
16224
16234
|
var buttonSizeToIconSizeMap = {
|
|
@@ -16228,10 +16238,10 @@ var buttonSizeToIconSizeMap = {
|
|
|
16228
16238
|
large: 'medium'
|
|
16229
16239
|
};
|
|
16230
16240
|
var buttonIconOnlySizeToIconSizeMap = {
|
|
16231
|
-
xsmall: '
|
|
16232
|
-
small: '
|
|
16233
|
-
medium: '
|
|
16234
|
-
large: '
|
|
16241
|
+
xsmall: 'small',
|
|
16242
|
+
small: 'small',
|
|
16243
|
+
medium: 'medium',
|
|
16244
|
+
large: 'medium'
|
|
16235
16245
|
};
|
|
16236
16246
|
var buttonSizeToSpinnerSizeMap = {
|
|
16237
16247
|
xsmall: 'medium',
|
|
@@ -16239,11 +16249,11 @@ var buttonSizeToSpinnerSizeMap = {
|
|
|
16239
16249
|
medium: 'large',
|
|
16240
16250
|
large: 'xlarge'
|
|
16241
16251
|
};
|
|
16242
|
-
var
|
|
16243
|
-
xsmall:
|
|
16244
|
-
small:
|
|
16245
|
-
medium:
|
|
16246
|
-
large:
|
|
16252
|
+
var buttonIconPadding = {
|
|
16253
|
+
xsmall: 1,
|
|
16254
|
+
small: 1,
|
|
16255
|
+
medium: 2,
|
|
16256
|
+
large: 2
|
|
16247
16257
|
};
|
|
16248
16258
|
|
|
16249
16259
|
var LIVEREGION_TIMEOUT_DELAY = 1000;
|
|
@@ -16386,20 +16396,20 @@ var SpinningBox = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
|
16386
16396
|
return css(["padding:1px;width:max-content;display:inline-flex;animation:", " ", " ", " infinite;"], rotate, makeMotionTime(getIn(theme.motion, motion.duration)), getIn(theme.motion, motion.easing));
|
|
16387
16397
|
});
|
|
16388
16398
|
|
|
16389
|
-
var _excluded$B = ["label", "labelPosition", "accessibilityLabel", "contrast", "
|
|
16399
|
+
var _excluded$B = ["label", "labelPosition", "accessibilityLabel", "contrast", "color", "size", "testID"];
|
|
16390
16400
|
function ownKeys$1o(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
16391
16401
|
function _objectSpread$1n(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1o(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1o(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16392
16402
|
var getColor = function getColor(_ref) {
|
|
16393
16403
|
var contrast = _ref.contrast,
|
|
16394
|
-
|
|
16404
|
+
color = _ref.color,
|
|
16395
16405
|
theme = _ref.theme;
|
|
16396
|
-
if (
|
|
16397
|
-
return getIn(theme.colors,
|
|
16398
|
-
}
|
|
16399
|
-
|
|
16400
|
-
|
|
16401
|
-
return getIn(theme.colors, 'brand.gray.700.highContrast');
|
|
16406
|
+
if (contrast === 'high' || color && color === 'white') {
|
|
16407
|
+
return getIn(theme.colors, 'static.white');
|
|
16408
|
+
}
|
|
16409
|
+
if (color && color !== 'default') {
|
|
16410
|
+
return getIn(theme.colors, "feedback.".concat(color, ".action.icon.primary.disabled.lowContrast"));
|
|
16402
16411
|
}
|
|
16412
|
+
return getIn(theme.colors, 'brand.gray.700.lowContrast');
|
|
16403
16413
|
};
|
|
16404
16414
|
var BaseSpinner = function BaseSpinner(_ref2) {
|
|
16405
16415
|
var label = _ref2.label,
|
|
@@ -16408,7 +16418,8 @@ var BaseSpinner = function BaseSpinner(_ref2) {
|
|
|
16408
16418
|
accessibilityLabel = _ref2.accessibilityLabel,
|
|
16409
16419
|
_ref2$contrast = _ref2.contrast,
|
|
16410
16420
|
contrast = _ref2$contrast === void 0 ? 'low' : _ref2$contrast,
|
|
16411
|
-
|
|
16421
|
+
_ref2$color = _ref2.color,
|
|
16422
|
+
color = _ref2$color === void 0 ? 'default' : _ref2$color,
|
|
16412
16423
|
_ref2$size = _ref2.size,
|
|
16413
16424
|
size = _ref2$size === void 0 ? 'medium' : _ref2$size,
|
|
16414
16425
|
testID = _ref2.testID,
|
|
@@ -16432,7 +16443,7 @@ var BaseSpinner = function BaseSpinner(_ref2) {
|
|
|
16432
16443
|
dimensions: makeSize(dimensions[size]),
|
|
16433
16444
|
color: getColor({
|
|
16434
16445
|
contrast: contrast,
|
|
16435
|
-
|
|
16446
|
+
color: color,
|
|
16436
16447
|
theme: theme
|
|
16437
16448
|
})
|
|
16438
16449
|
})
|
|
@@ -16452,7 +16463,7 @@ var BaseSpinner = function BaseSpinner(_ref2) {
|
|
|
16452
16463
|
}));
|
|
16453
16464
|
};
|
|
16454
16465
|
|
|
16455
|
-
var _excluded$A = ["href", "target", "rel", "variant", "
|
|
16466
|
+
var _excluded$A = ["href", "target", "rel", "variant", "color", "size", "icon", "iconPosition", "isDisabled", "isFullWidth", "isLoading", "onClick", "onBlur", "onKeyDown", "type", "children", "testID", "onFocus", "onMouseLeave", "onMouseMove", "onPointerDown", "onPointerEnter", "accessibilityProps", "onTouchEnd", "onTouchStart"];
|
|
16456
16467
|
function ownKeys$1n(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
16457
16468
|
function _objectSpread$1m(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1n(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1n(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16458
16469
|
var getRenderElement = function getRenderElement(href) {
|
|
@@ -16469,13 +16480,14 @@ var getColorToken$1 = function getColorToken(_ref) {
|
|
|
16469
16480
|
var property = _ref.property,
|
|
16470
16481
|
variant = _ref.variant,
|
|
16471
16482
|
state = _ref.state,
|
|
16472
|
-
|
|
16473
|
-
|
|
16474
|
-
|
|
16475
|
-
|
|
16476
|
-
|
|
16483
|
+
color = _ref.color;
|
|
16484
|
+
if (!color || color === 'default') {
|
|
16485
|
+
return "action.".concat(property, ".").concat(variant, ".").concat(state);
|
|
16486
|
+
}
|
|
16487
|
+
if (color === 'white') {
|
|
16488
|
+
return "white.action.".concat(property, ".").concat(variant, ".").concat(state);
|
|
16477
16489
|
}
|
|
16478
|
-
return "action.".concat(property, ".").concat(
|
|
16490
|
+
return "feedback.".concat(color, ".action.").concat(property, ".primary.").concat(state, ".").concat(variant === 'primary' ? 'high' : 'low', "Contrast");
|
|
16479
16491
|
};
|
|
16480
16492
|
var getProps$1 = function getProps(_ref2) {
|
|
16481
16493
|
var buttonTypographyTokens = _ref2.buttonTypographyTokens,
|
|
@@ -16484,9 +16496,14 @@ var getProps$1 = function getProps(_ref2) {
|
|
|
16484
16496
|
size = _ref2.size,
|
|
16485
16497
|
theme = _ref2.theme,
|
|
16486
16498
|
variant = _ref2.variant,
|
|
16487
|
-
|
|
16488
|
-
contrast = _ref2.contrast,
|
|
16499
|
+
color = _ref2.color,
|
|
16489
16500
|
hasIcon = _ref2.hasIcon;
|
|
16501
|
+
if (variant === 'tertiary' && color !== 'default' && color !== 'white') {
|
|
16502
|
+
throwBladeError({
|
|
16503
|
+
moduleName: 'BaseButton',
|
|
16504
|
+
message: "Tertiary variant can only be used with color: \"default\" or \"white\" but received \"".concat(color, "\"")
|
|
16505
|
+
});
|
|
16506
|
+
}
|
|
16490
16507
|
var isIconOnly = hasIcon && (!children || (children === null || children === void 0 ? void 0 : children.trim().length) === 0);
|
|
16491
16508
|
var props = {
|
|
16492
16509
|
iconSize: isIconOnly ? buttonIconOnlySizeToIconSizeMap[size] : buttonSizeToIconSizeMap[size],
|
|
@@ -16494,19 +16511,17 @@ var getProps$1 = function getProps(_ref2) {
|
|
|
16494
16511
|
fontSize: buttonTypographyTokens.fonts.size[size],
|
|
16495
16512
|
lineHeight: buttonTypographyTokens.lineHeights[size],
|
|
16496
16513
|
minHeight: makeSize(minHeight[size]),
|
|
16497
|
-
iconPadding: hasIcon && children !== null && children !== void 0 && children.trim() ? "spacing.".concat(
|
|
16514
|
+
iconPadding: hasIcon && children !== null && children !== void 0 && children.trim() ? "spacing.".concat(buttonIconPadding[size]) : undefined,
|
|
16498
16515
|
iconColor: getColorToken$1({
|
|
16499
16516
|
property: 'icon',
|
|
16500
16517
|
variant: variant,
|
|
16501
|
-
|
|
16502
|
-
intent: intent,
|
|
16518
|
+
color: color,
|
|
16503
16519
|
state: 'default'
|
|
16504
16520
|
}),
|
|
16505
16521
|
textColor: getColorToken$1({
|
|
16506
16522
|
property: 'text',
|
|
16507
16523
|
variant: variant,
|
|
16508
|
-
|
|
16509
|
-
intent: intent,
|
|
16524
|
+
color: color,
|
|
16510
16525
|
state: 'default'
|
|
16511
16526
|
}),
|
|
16512
16527
|
buttonPaddingTop: isIconOnly ? makeSpace(theme.spacing[buttonIconOnlyPadding[size].top]) : makeSpace(theme.spacing[buttonPadding[size].top]),
|
|
@@ -16517,57 +16532,49 @@ var getProps$1 = function getProps(_ref2) {
|
|
|
16517
16532
|
defaultBackgroundColor: getIn(theme.colors, getColorToken$1({
|
|
16518
16533
|
property: 'background',
|
|
16519
16534
|
variant: variant,
|
|
16520
|
-
|
|
16521
|
-
intent: intent,
|
|
16535
|
+
color: color,
|
|
16522
16536
|
state: 'default'
|
|
16523
16537
|
})),
|
|
16524
16538
|
defaultBorderColor: getIn(theme.colors, getColorToken$1({
|
|
16525
16539
|
property: 'border',
|
|
16526
16540
|
variant: variant,
|
|
16527
|
-
|
|
16528
|
-
intent: intent,
|
|
16541
|
+
color: color,
|
|
16529
16542
|
state: 'default'
|
|
16530
16543
|
})),
|
|
16531
16544
|
hoverBackgroundColor: getIn(theme.colors, getColorToken$1({
|
|
16532
16545
|
property: 'background',
|
|
16533
16546
|
variant: variant,
|
|
16534
|
-
|
|
16535
|
-
intent: intent,
|
|
16547
|
+
color: color,
|
|
16536
16548
|
state: 'hover'
|
|
16537
16549
|
})),
|
|
16538
16550
|
hoverBorderColor: getIn(theme.colors, getColorToken$1({
|
|
16539
16551
|
property: 'border',
|
|
16540
16552
|
variant: variant,
|
|
16541
|
-
|
|
16542
|
-
intent: intent,
|
|
16553
|
+
color: color,
|
|
16543
16554
|
state: 'hover'
|
|
16544
16555
|
})),
|
|
16545
16556
|
activeBackgroundColor: getIn(theme.colors, getColorToken$1({
|
|
16546
16557
|
property: 'background',
|
|
16547
16558
|
variant: variant,
|
|
16548
|
-
|
|
16549
|
-
intent: intent,
|
|
16559
|
+
color: color,
|
|
16550
16560
|
state: 'active'
|
|
16551
16561
|
})),
|
|
16552
16562
|
activeBorderColor: getIn(theme.colors, getColorToken$1({
|
|
16553
16563
|
property: 'border',
|
|
16554
16564
|
variant: variant,
|
|
16555
|
-
|
|
16556
|
-
intent: intent,
|
|
16565
|
+
color: color,
|
|
16557
16566
|
state: 'active'
|
|
16558
16567
|
})),
|
|
16559
16568
|
focusBackgroundColor: getIn(theme.colors, getColorToken$1({
|
|
16560
16569
|
property: 'background',
|
|
16561
16570
|
variant: variant,
|
|
16562
|
-
|
|
16563
|
-
intent: intent,
|
|
16571
|
+
color: color,
|
|
16564
16572
|
state: 'focus'
|
|
16565
16573
|
})),
|
|
16566
16574
|
focusBorderColor: getIn(theme.colors, getColorToken$1({
|
|
16567
16575
|
property: 'border',
|
|
16568
16576
|
variant: variant,
|
|
16569
|
-
|
|
16570
|
-
intent: intent,
|
|
16577
|
+
color: color,
|
|
16571
16578
|
state: 'focus'
|
|
16572
16579
|
})),
|
|
16573
16580
|
focusRingColor: getIn(theme.colors, 'brand.primary.400'),
|
|
@@ -16580,29 +16587,25 @@ var getProps$1 = function getProps(_ref2) {
|
|
|
16580
16587
|
var disabledBackgroundColor = getIn(theme.colors, getColorToken$1({
|
|
16581
16588
|
property: 'background',
|
|
16582
16589
|
variant: variant,
|
|
16583
|
-
|
|
16584
|
-
intent: intent,
|
|
16590
|
+
color: color,
|
|
16585
16591
|
state: 'disabled'
|
|
16586
16592
|
}));
|
|
16587
16593
|
var disabledBorderColor = getIn(theme.colors, getColorToken$1({
|
|
16588
16594
|
property: 'border',
|
|
16589
16595
|
variant: variant,
|
|
16590
|
-
|
|
16591
|
-
intent: intent,
|
|
16596
|
+
color: color,
|
|
16592
16597
|
state: 'disabled'
|
|
16593
16598
|
}));
|
|
16594
16599
|
props.iconColor = getColorToken$1({
|
|
16595
16600
|
property: 'icon',
|
|
16596
16601
|
variant: variant,
|
|
16597
|
-
|
|
16598
|
-
intent: intent,
|
|
16602
|
+
color: color,
|
|
16599
16603
|
state: 'disabled'
|
|
16600
16604
|
});
|
|
16601
16605
|
props.textColor = getColorToken$1({
|
|
16602
16606
|
property: 'text',
|
|
16603
16607
|
variant: variant,
|
|
16604
|
-
|
|
16605
|
-
intent: intent,
|
|
16608
|
+
color: color,
|
|
16606
16609
|
state: 'disabled'
|
|
16607
16610
|
});
|
|
16608
16611
|
props.defaultBackgroundColor = disabledBackgroundColor;
|
|
@@ -16631,9 +16634,8 @@ var _BaseButton = function _BaseButton(_ref4, ref) {
|
|
|
16631
16634
|
rel = _ref4.rel,
|
|
16632
16635
|
_ref4$variant = _ref4.variant,
|
|
16633
16636
|
variant = _ref4$variant === void 0 ? 'primary' : _ref4$variant,
|
|
16634
|
-
|
|
16635
|
-
_ref4$
|
|
16636
|
-
contrast = _ref4$contrast === void 0 ? 'low' : _ref4$contrast,
|
|
16637
|
+
_ref4$color = _ref4.color,
|
|
16638
|
+
color = _ref4$color === void 0 ? 'default' : _ref4$color,
|
|
16637
16639
|
_ref4$size = _ref4.size,
|
|
16638
16640
|
size = _ref4$size === void 0 ? 'medium' : _ref4$size,
|
|
16639
16641
|
Icon = _ref4.icon,
|
|
@@ -16679,8 +16681,7 @@ var _BaseButton = function _BaseButton(_ref4, ref) {
|
|
|
16679
16681
|
size: size,
|
|
16680
16682
|
variant: variant,
|
|
16681
16683
|
theme: theme,
|
|
16682
|
-
|
|
16683
|
-
contrast: contrast,
|
|
16684
|
+
color: color,
|
|
16684
16685
|
hasIcon: Boolean(Icon)
|
|
16685
16686
|
}),
|
|
16686
16687
|
activeBorderColor = _getProps.activeBorderColor,
|
|
@@ -16725,6 +16726,7 @@ var _BaseButton = function _BaseButton(_ref4, ref) {
|
|
|
16725
16726
|
accessibilityProps: _objectSpread$1m({}, makeAccessible(_objectSpread$1m({
|
|
16726
16727
|
role: isLink ? 'link' : 'button'
|
|
16727
16728
|
}, accessibilityProps))),
|
|
16729
|
+
variant: variant,
|
|
16728
16730
|
isLoading: isLoading,
|
|
16729
16731
|
disabled: disabled,
|
|
16730
16732
|
activeBorderColor: activeBorderColor,
|
|
@@ -16773,8 +16775,7 @@ var _BaseButton = function _BaseButton(_ref4, ref) {
|
|
|
16773
16775
|
children: /*#__PURE__*/jsx(BaseSpinner, {
|
|
16774
16776
|
accessibilityLabel: "Loading",
|
|
16775
16777
|
size: spinnerSize,
|
|
16776
|
-
|
|
16777
|
-
contrast: contrast
|
|
16778
|
+
color: color
|
|
16778
16779
|
})
|
|
16779
16780
|
}) : null, /*#__PURE__*/jsxs(ButtonContent, {
|
|
16780
16781
|
display: "flex",
|
|
@@ -16890,14 +16891,13 @@ var useInteraction = function useInteraction() {
|
|
|
16890
16891
|
};
|
|
16891
16892
|
};
|
|
16892
16893
|
|
|
16893
|
-
var _excluded$z = ["children", "icon", "iconPosition", "isDisabled", "onClick", "onKeyDown", "variant", "href", "target", "rel", "
|
|
16894
|
+
var _excluded$z = ["children", "icon", "iconPosition", "isDisabled", "onClick", "onKeyDown", "variant", "href", "target", "rel", "color", "accessibilityProps", "className", "style", "size", "testID", "hitSlop", "htmlTitle", "onBlur", "onFocus", "onMouseLeave", "onMouseMove", "onPointerDown", "onPointerEnter", "onTouchStart", "onTouchEnd"],
|
|
16894
16895
|
_excluded2 = ["currentInteraction", "setCurrentInteraction"];
|
|
16895
16896
|
function ownKeys$1l(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
16896
16897
|
function _objectSpread$1k(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1l(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1l(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16897
16898
|
var getColorToken = function getColorToken(_ref) {
|
|
16898
16899
|
var variant = _ref.variant,
|
|
16899
|
-
|
|
16900
|
-
contrast = _ref.contrast,
|
|
16900
|
+
color = _ref.color,
|
|
16901
16901
|
element = _ref.element,
|
|
16902
16902
|
currentInteraction = _ref.currentInteraction,
|
|
16903
16903
|
isDisabled = _ref.isDisabled,
|
|
@@ -16906,12 +16906,15 @@ var getColorToken = function getColorToken(_ref) {
|
|
|
16906
16906
|
if (isDisabled && variant == 'button') {
|
|
16907
16907
|
state = 'disabled';
|
|
16908
16908
|
}
|
|
16909
|
-
if (isVisited && variant == 'anchor'
|
|
16910
|
-
// visited state is only valid for anchor variant
|
|
16909
|
+
if (isVisited && variant == 'anchor') {
|
|
16910
|
+
// visited state is only valid for anchor variant
|
|
16911
16911
|
state = 'visited';
|
|
16912
16912
|
}
|
|
16913
|
-
if (
|
|
16914
|
-
|
|
16913
|
+
if (color && color !== 'default' && state !== 'visited') {
|
|
16914
|
+
if (color !== 'white') {
|
|
16915
|
+
return "feedback.".concat(color, ".action.").concat(element, ".link.").concat(state, ".lowContrast");
|
|
16916
|
+
}
|
|
16917
|
+
return "white.action.".concat(element, ".link.").concat(state);
|
|
16915
16918
|
}
|
|
16916
16919
|
return "action.".concat(element, ".link.").concat(state);
|
|
16917
16920
|
};
|
|
@@ -16921,8 +16924,7 @@ var getProps = function getProps(_ref2) {
|
|
|
16921
16924
|
currentInteraction = _ref2.currentInteraction,
|
|
16922
16925
|
children = _ref2.children,
|
|
16923
16926
|
isDisabled = _ref2.isDisabled,
|
|
16924
|
-
|
|
16925
|
-
contrast = _ref2.contrast,
|
|
16927
|
+
color = _ref2.color,
|
|
16926
16928
|
isVisited = _ref2.isVisited,
|
|
16927
16929
|
target = _ref2.target,
|
|
16928
16930
|
size = _ref2.size;
|
|
@@ -16946,8 +16948,7 @@ var getProps = function getProps(_ref2) {
|
|
|
16946
16948
|
textDecorationLine: !isButton && currentInteraction !== 'default' ? 'underline' : 'none',
|
|
16947
16949
|
iconColor: getColorToken({
|
|
16948
16950
|
variant: variant,
|
|
16949
|
-
|
|
16950
|
-
contrast: contrast,
|
|
16951
|
+
color: color,
|
|
16951
16952
|
element: 'icon',
|
|
16952
16953
|
currentInteraction: currentInteraction,
|
|
16953
16954
|
isDisabled: isDisabled,
|
|
@@ -16959,8 +16960,7 @@ var getProps = function getProps(_ref2) {
|
|
|
16959
16960
|
iconPadding: children !== null && children !== void 0 && children.trim() ? 'spacing.2' : 'spacing.0',
|
|
16960
16961
|
textColor: getColorToken({
|
|
16961
16962
|
variant: variant,
|
|
16962
|
-
|
|
16963
|
-
contrast: contrast,
|
|
16963
|
+
color: color,
|
|
16964
16964
|
element: 'text',
|
|
16965
16965
|
currentInteraction: currentInteraction,
|
|
16966
16966
|
isDisabled: isDisabled,
|
|
@@ -16991,9 +16991,8 @@ var _BaseLink = function _BaseLink(_ref3, ref) {
|
|
|
16991
16991
|
href = _ref3.href,
|
|
16992
16992
|
target = _ref3.target,
|
|
16993
16993
|
rel = _ref3.rel,
|
|
16994
|
-
|
|
16995
|
-
_ref3$
|
|
16996
|
-
contrast = _ref3$contrast === void 0 ? 'low' : _ref3$contrast,
|
|
16994
|
+
_ref3$color = _ref3.color,
|
|
16995
|
+
color = _ref3$color === void 0 ? 'default' : _ref3$color,
|
|
16997
16996
|
accessibilityProps = _ref3.accessibilityProps,
|
|
16998
16997
|
className = _ref3.className,
|
|
16999
16998
|
style = _ref3.style,
|
|
@@ -17028,8 +17027,7 @@ var _BaseLink = function _BaseLink(_ref3, ref) {
|
|
|
17028
17027
|
currentInteraction: currentInteraction,
|
|
17029
17028
|
children: childrenString,
|
|
17030
17029
|
isDisabled: isDisabled,
|
|
17031
|
-
|
|
17032
|
-
contrast: contrast,
|
|
17030
|
+
color: color,
|
|
17033
17031
|
isVisited: isVisited,
|
|
17034
17032
|
target: target,
|
|
17035
17033
|
size: size
|
|
@@ -17051,8 +17049,8 @@ var _BaseLink = function _BaseLink(_ref3, ref) {
|
|
|
17051
17049
|
type = _getProps.type,
|
|
17052
17050
|
lineHeight = _getProps.lineHeight;
|
|
17053
17051
|
var handleOnClick = function handleOnClick(event) {
|
|
17054
|
-
if (!isVisited &&
|
|
17055
|
-
// visited state is only valid for anchor variant
|
|
17052
|
+
if (!isVisited && variant === 'anchor') {
|
|
17053
|
+
// visited state is only valid for anchor variant
|
|
17056
17054
|
setIsVisited(true);
|
|
17057
17055
|
}
|
|
17058
17056
|
if (onClick) {
|
|
@@ -17152,7 +17150,7 @@ var BaseLink = /*#__PURE__*/assignWithoutSideEffects( /*#__PURE__*/React__defaul
|
|
|
17152
17150
|
componentId: 'BaseLink'
|
|
17153
17151
|
});
|
|
17154
17152
|
|
|
17155
|
-
var _excluded$y = ["description", "title", "isDismissible", "onDismiss", "contrast", "isFullWidth", "intent", "actions", "testID"];
|
|
17153
|
+
var _excluded$y = ["description", "title", "isDismissible", "onDismiss", "contrast", "isFullWidth", "intent", "color", "actions", "testID"];
|
|
17156
17154
|
function ownKeys$1k(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17157
17155
|
function _objectSpread$1j(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1k(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1k(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17158
17156
|
var isReactNative$3 = getPlatformType() === 'react-native';
|
|
@@ -17178,6 +17176,7 @@ var Alert = function Alert(_ref) {
|
|
|
17178
17176
|
isFullWidth = _ref$isFullWidth === void 0 ? false : _ref$isFullWidth,
|
|
17179
17177
|
_ref$intent = _ref.intent,
|
|
17180
17178
|
intent = _ref$intent === void 0 ? 'neutral' : _ref$intent,
|
|
17179
|
+
color = _ref.color,
|
|
17181
17180
|
actions = _ref.actions,
|
|
17182
17181
|
testID = _ref.testID,
|
|
17183
17182
|
styledProps = _objectWithoutProperties$1(_ref, _excluded$y);
|
|
@@ -17254,8 +17253,8 @@ var Alert = function Alert(_ref) {
|
|
|
17254
17253
|
children: /*#__PURE__*/jsx(BaseButton, {
|
|
17255
17254
|
size: textSize,
|
|
17256
17255
|
onClick: actions.primary.onClick,
|
|
17257
|
-
|
|
17258
|
-
contrast:
|
|
17256
|
+
color: color || intent,
|
|
17257
|
+
variant: contrast === 'high' ? 'primary' : 'secondary',
|
|
17259
17258
|
children: actions.primary.text
|
|
17260
17259
|
})
|
|
17261
17260
|
}) : null;
|
|
@@ -17279,8 +17278,7 @@ var Alert = function Alert(_ref) {
|
|
|
17279
17278
|
display: isReactNative$3 ? castNativeType('flex') : castWebType('inline-flex'),
|
|
17280
17279
|
children: /*#__PURE__*/jsx(BaseLink, _objectSpread$1j(_objectSpread$1j({
|
|
17281
17280
|
size: textSize,
|
|
17282
|
-
contrast:
|
|
17283
|
-
intent: intent
|
|
17281
|
+
color: contrast === 'high' ? 'white' : intent
|
|
17284
17282
|
}, secondaryActionParams), {}, {
|
|
17285
17283
|
children: actions.secondary.text
|
|
17286
17284
|
}))
|
|
@@ -17617,7 +17615,7 @@ var CardBody = /*#__PURE__*/assignWithoutSideEffects(_CardBody, {
|
|
|
17617
17615
|
componentId: ComponentIds$1.CardBody
|
|
17618
17616
|
});
|
|
17619
17617
|
|
|
17620
|
-
var _excluded$v = ["children", "icon", "iconPosition", "isDisabled", "onClick", "variant", "href", "target", "rel", "accessibilityLabel", "size", "testID", "hitSlop", "htmlTitle", "onBlur", "onFocus", "onMouseLeave", "onMouseMove", "onPointerDown", "onPointerEnter", "onTouchStart", "onTouchEnd"];
|
|
17618
|
+
var _excluded$v = ["children", "icon", "iconPosition", "isDisabled", "onClick", "variant", "color", "href", "target", "rel", "accessibilityLabel", "size", "testID", "hitSlop", "htmlTitle", "onBlur", "onFocus", "onMouseLeave", "onMouseMove", "onPointerDown", "onPointerEnter", "onTouchStart", "onTouchEnd"];
|
|
17621
17619
|
function ownKeys$1h(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17622
17620
|
function _objectSpread$1g(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1h(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1h(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17623
17621
|
var _Link = function _Link(_ref, ref) {
|
|
@@ -17630,6 +17628,8 @@ var _Link = function _Link(_ref, ref) {
|
|
|
17630
17628
|
onClick = _ref.onClick,
|
|
17631
17629
|
_ref$variant = _ref.variant,
|
|
17632
17630
|
variant = _ref$variant === void 0 ? 'anchor' : _ref$variant,
|
|
17631
|
+
_ref$color = _ref.color,
|
|
17632
|
+
color = _ref$color === void 0 ? 'default' : _ref$color,
|
|
17633
17633
|
href = _ref.href,
|
|
17634
17634
|
target = _ref.target,
|
|
17635
17635
|
rel = _ref.rel,
|
|
@@ -17670,6 +17670,7 @@ var _Link = function _Link(_ref, ref) {
|
|
|
17670
17670
|
describedBy: rest['aria-describedby']
|
|
17671
17671
|
},
|
|
17672
17672
|
size: size,
|
|
17673
|
+
color: color,
|
|
17673
17674
|
testID: testID,
|
|
17674
17675
|
hitSlop: hitSlop,
|
|
17675
17676
|
htmlTitle: htmlTitle,
|
|
@@ -17688,7 +17689,7 @@ var Link = /*#__PURE__*/assignWithoutSideEffects( /*#__PURE__*/React__default.fo
|
|
|
17688
17689
|
componentId: 'Link'
|
|
17689
17690
|
});
|
|
17690
17691
|
|
|
17691
|
-
var _excluded$u = ["children", "icon", "iconPosition", "isDisabled", "isFullWidth", "isLoading", "href", "target", "rel", "onClick", "size", "type", "variant", "accessibilityLabel", "testID", "onBlur", "onFocus", "onMouseLeave", "onMouseMove", "onPointerDown", "onPointerEnter", "onTouchStart", "onTouchEnd"];
|
|
17692
|
+
var _excluded$u = ["children", "icon", "iconPosition", "isDisabled", "isFullWidth", "isLoading", "href", "target", "rel", "onClick", "size", "type", "variant", "color", "accessibilityLabel", "testID", "onBlur", "onFocus", "onMouseLeave", "onMouseMove", "onPointerDown", "onPointerEnter", "onTouchStart", "onTouchEnd"];
|
|
17692
17693
|
function ownKeys$1g(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17693
17694
|
function _objectSpread$1f(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1g(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1g(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17694
17695
|
var _Button = function _Button( // While adding any prop here, make sure to handle it in DropdownButton as well
|
|
@@ -17713,6 +17714,8 @@ _ref, ref) {
|
|
|
17713
17714
|
type = _ref$type === void 0 ? 'button' : _ref$type,
|
|
17714
17715
|
_ref$variant = _ref.variant,
|
|
17715
17716
|
variant = _ref$variant === void 0 ? 'primary' : _ref$variant,
|
|
17717
|
+
_ref$color = _ref.color,
|
|
17718
|
+
color = _ref$color === void 0 ? 'default' : _ref$color,
|
|
17716
17719
|
accessibilityLabel = _ref.accessibilityLabel,
|
|
17717
17720
|
testID = _ref.testID,
|
|
17718
17721
|
onBlur = _ref.onBlur,
|
|
@@ -17739,6 +17742,7 @@ _ref, ref) {
|
|
|
17739
17742
|
describedBy: rest['aria-describedby']
|
|
17740
17743
|
},
|
|
17741
17744
|
iconPosition: iconPosition,
|
|
17745
|
+
color: color,
|
|
17742
17746
|
isDisabled: isDisabled,
|
|
17743
17747
|
isFullWidth: isFullWidth,
|
|
17744
17748
|
onClick: onClick,
|
|
@@ -17801,7 +17805,7 @@ var StyledCounter = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
|
17801
17805
|
});
|
|
17802
17806
|
});
|
|
17803
17807
|
|
|
17804
|
-
var _excluded$t = ["value", "max", "intent", "variant", "contrast", "size", "testID"];
|
|
17808
|
+
var _excluded$t = ["value", "max", "intent", "variant", "color", "contrast", "size", "testID"];
|
|
17805
17809
|
function ownKeys$1e(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17806
17810
|
function _objectSpread$1d(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1e(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1e(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17807
17811
|
var isFeedbackVariant = function isFeedbackVariant(variant) {
|
|
@@ -17813,25 +17817,28 @@ var getColorProps = function getColorProps(_ref) {
|
|
|
17813
17817
|
variant = _ref$variant === void 0 ? 'neutral' : _ref$variant,
|
|
17814
17818
|
_ref$contrast = _ref.contrast,
|
|
17815
17819
|
contrast = _ref$contrast === void 0 ? 'low' : _ref$contrast;
|
|
17820
|
+
var counterVariant = variant === 'default' ? 'blue' : variant;
|
|
17816
17821
|
var props = {
|
|
17817
17822
|
textColor: 'feedback.text.neutral.lowContrast',
|
|
17818
17823
|
backgroundColor: 'feedback.background.neutral.lowContrast'
|
|
17819
17824
|
};
|
|
17820
|
-
if (isFeedbackVariant(
|
|
17821
|
-
props.textColor = "feedback.text.".concat(
|
|
17822
|
-
props.backgroundColor = "feedback.background.".concat(
|
|
17825
|
+
if (isFeedbackVariant(counterVariant)) {
|
|
17826
|
+
props.textColor = "feedback.text.".concat(counterVariant, ".").concat(contrast, "Contrast");
|
|
17827
|
+
props.backgroundColor = "feedback.background.".concat(counterVariant, ".").concat(contrast, "Contrast");
|
|
17823
17828
|
} else {
|
|
17824
|
-
props.textColor = "badge.text.".concat(
|
|
17825
|
-
props.backgroundColor = "badge.background.".concat(
|
|
17829
|
+
props.textColor = "badge.text.".concat(counterVariant, ".").concat(contrast, "Contrast");
|
|
17830
|
+
props.backgroundColor = "badge.background.".concat(counterVariant, ".").concat(contrast, "Contrast");
|
|
17826
17831
|
}
|
|
17827
17832
|
return props;
|
|
17828
17833
|
};
|
|
17829
17834
|
var Counter = function Counter(_ref2) {
|
|
17835
|
+
var _ref3;
|
|
17830
17836
|
var value = _ref2.value,
|
|
17831
17837
|
max = _ref2.max,
|
|
17832
17838
|
intent = _ref2.intent,
|
|
17833
17839
|
_ref2$variant = _ref2.variant,
|
|
17834
17840
|
variant = _ref2$variant === void 0 ? 'neutral' : _ref2$variant,
|
|
17841
|
+
color = _ref2.color,
|
|
17835
17842
|
_ref2$contrast = _ref2.contrast,
|
|
17836
17843
|
contrast = _ref2$contrast === void 0 ? 'low' : _ref2$contrast,
|
|
17837
17844
|
_ref2$size = _ref2.size,
|
|
@@ -17845,7 +17852,7 @@ var Counter = function Counter(_ref2) {
|
|
|
17845
17852
|
var _useTheme = useTheme(),
|
|
17846
17853
|
platform = _useTheme.platform;
|
|
17847
17854
|
var _getColorProps = getColorProps({
|
|
17848
|
-
variant:
|
|
17855
|
+
variant: (_ref3 = color !== null && color !== void 0 ? color : intent) !== null && _ref3 !== void 0 ? _ref3 : variant,
|
|
17849
17856
|
contrast: contrast
|
|
17850
17857
|
}),
|
|
17851
17858
|
backgroundColor = _getColorProps.backgroundColor,
|
|
@@ -19401,14 +19408,14 @@ var chipColorTokens = {
|
|
|
19401
19408
|
text: {
|
|
19402
19409
|
unchecked: 'surface.text.subtle.lowContrast',
|
|
19403
19410
|
disabled: 'surface.text.placeholder.lowContrast',
|
|
19404
|
-
|
|
19411
|
+
"default": 'action.text.secondary.default',
|
|
19405
19412
|
positive: 'feedback.text.positive.lowContrast',
|
|
19406
19413
|
negative: 'feedback.text.negative.lowContrast'
|
|
19407
19414
|
},
|
|
19408
19415
|
icon: {
|
|
19409
19416
|
unchecked: 'surface.text.subtle.lowContrast',
|
|
19410
19417
|
disabled: 'surface.text.placeholder.lowContrast',
|
|
19411
|
-
|
|
19418
|
+
"default": 'action.icon.secondary.default',
|
|
19412
19419
|
positive: 'feedback.icon.positive.lowContrast',
|
|
19413
19420
|
negative: 'feedback.icon.negative.lowContrast'
|
|
19414
19421
|
},
|
|
@@ -19418,7 +19425,7 @@ var chipColorTokens = {
|
|
|
19418
19425
|
hover: 'brand.gray.a50.lowContrast',
|
|
19419
19426
|
disabled: 'transparent'
|
|
19420
19427
|
},
|
|
19421
|
-
|
|
19428
|
+
"default": {
|
|
19422
19429
|
"default": 'brand.primary.300',
|
|
19423
19430
|
hover: 'brand.primary.400',
|
|
19424
19431
|
disabled: 'brand.gray.a50.lowContrast'
|
|
@@ -19439,7 +19446,7 @@ var chipColorTokens = {
|
|
|
19439
19446
|
"default": 'brand.gray.400.lowContrast',
|
|
19440
19447
|
disabled: 'brand.gray.400.lowContrast'
|
|
19441
19448
|
},
|
|
19442
|
-
|
|
19449
|
+
"default": {
|
|
19443
19450
|
"default": 'brand.primary.500',
|
|
19444
19451
|
hover: 'brand.primary.500',
|
|
19445
19452
|
disabled: 'brand.gray.a100.lowContrast'
|
|
@@ -19456,7 +19463,7 @@ var chipColorTokens = {
|
|
|
19456
19463
|
}
|
|
19457
19464
|
}
|
|
19458
19465
|
};
|
|
19459
|
-
var getChipInputHoverTokens = function getChipInputHoverTokens(
|
|
19466
|
+
var getChipInputHoverTokens = function getChipInputHoverTokens(color) {
|
|
19460
19467
|
return {
|
|
19461
19468
|
"default": {
|
|
19462
19469
|
background: {
|
|
@@ -19464,7 +19471,7 @@ var getChipInputHoverTokens = function getChipInputHoverTokens(intent) {
|
|
|
19464
19471
|
unchecked: 'transparent'
|
|
19465
19472
|
},
|
|
19466
19473
|
border: {
|
|
19467
|
-
checked: "colors.".concat(chipColorTokens.border[
|
|
19474
|
+
checked: "colors.".concat(chipColorTokens.border[color || 'default'].hover),
|
|
19468
19475
|
unchecked: 'colors.brand.gray.500.lowContrast'
|
|
19469
19476
|
}
|
|
19470
19477
|
}
|
|
@@ -19546,7 +19553,7 @@ var StyledChipWrapper = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
|
19546
19553
|
borderColor = _ref.borderColor,
|
|
19547
19554
|
isChecked = _ref.isChecked,
|
|
19548
19555
|
isDisabled = _ref.isDisabled,
|
|
19549
|
-
|
|
19556
|
+
color = _ref.color;
|
|
19550
19557
|
var easing = getIn(theme, chipMotionTokens.easing);
|
|
19551
19558
|
var duration = castWebType(makeMotionTime(getIn(theme, chipMotionTokens.duration)));
|
|
19552
19559
|
return _objectSpread$12({
|
|
@@ -19554,7 +19561,7 @@ var StyledChipWrapper = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
|
19554
19561
|
borderColor: isChecked ? getIn(theme.colors, borderColor) : 'transparent'
|
|
19555
19562
|
}, !isDisabled && {
|
|
19556
19563
|
'&:hover': {
|
|
19557
|
-
backgroundColor: getIn(theme.colors, chipColorTokens.background[isChecked &&
|
|
19564
|
+
backgroundColor: getIn(theme.colors, chipColorTokens.background[isChecked && color ? color : 'unchecked'].hover),
|
|
19558
19565
|
transitionTimingFunction: easing,
|
|
19559
19566
|
transitionDuration: duration
|
|
19560
19567
|
}
|
|
@@ -19643,16 +19650,17 @@ var useRadio = function useRadio(_ref) {
|
|
|
19643
19650
|
};
|
|
19644
19651
|
};
|
|
19645
19652
|
|
|
19646
|
-
var _excluded$r = ["isDisabled", "value", "children", "icon", "intent", "testID"];
|
|
19653
|
+
var _excluded$r = ["isDisabled", "value", "children", "icon", "intent", "color", "testID"];
|
|
19647
19654
|
function ownKeys$11(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19648
19655
|
function _objectSpread$10(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$11(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$11(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19649
19656
|
var _Chip = function _Chip(_ref, ref) {
|
|
19650
|
-
var _groupProps$state, _groupProps$defaultVa;
|
|
19657
|
+
var _groupProps$state, _groupProps$defaultVa, _ref2;
|
|
19651
19658
|
var isDisabled = _ref.isDisabled,
|
|
19652
19659
|
value = _ref.value,
|
|
19653
19660
|
children = _ref.children,
|
|
19654
19661
|
Icon = _ref.icon,
|
|
19655
19662
|
intent = _ref.intent,
|
|
19663
|
+
color = _ref.color,
|
|
19656
19664
|
testID = _ref.testID,
|
|
19657
19665
|
styledProps = _objectWithoutProperties$1(_ref, _excluded$r);
|
|
19658
19666
|
var _useTheme = useTheme(),
|
|
@@ -19677,9 +19685,12 @@ var _Chip = function _Chip(_ref, ref) {
|
|
|
19677
19685
|
var useChip = (groupProps === null || groupProps === void 0 ? void 0 : groupProps.selectionType) === 'single' ? useRadio : useCheckbox;
|
|
19678
19686
|
var _size = (groupProps === null || groupProps === void 0 ? void 0 : groupProps.size) || 'small';
|
|
19679
19687
|
var _intent = intent !== null && intent !== void 0 ? intent : groupProps === null || groupProps === void 0 ? void 0 : groupProps.intent;
|
|
19680
|
-
|
|
19681
|
-
|
|
19682
|
-
|
|
19688
|
+
// If intent is proovided and it's not none, use intent otherwise use color
|
|
19689
|
+
var _color = (_ref2 = color !== null && color !== void 0 ? color : groupProps === null || groupProps === void 0 ? void 0 : groupProps.color) !== null && _ref2 !== void 0 ? _ref2 : 'default';
|
|
19690
|
+
var chipColor = _intent && _intent !== 'none' ? _intent : _color;
|
|
19691
|
+
var handleChange = function handleChange(_ref3) {
|
|
19692
|
+
var isChecked = _ref3.isChecked,
|
|
19693
|
+
value = _ref3.value;
|
|
19683
19694
|
if (isChecked) {
|
|
19684
19695
|
var _groupProps$state2;
|
|
19685
19696
|
groupProps === null || groupProps === void 0 ? void 0 : (_groupProps$state2 = groupProps.state) === null || _groupProps$state2 === void 0 ? void 0 : _groupProps$state2.addValue(value);
|
|
@@ -19719,8 +19730,8 @@ var _Chip = function _Chip(_ref, ref) {
|
|
|
19719
19730
|
}
|
|
19720
19731
|
}, [_isDisabled]);
|
|
19721
19732
|
var textVariant = 'unchecked';
|
|
19722
|
-
if (_isChecked &&
|
|
19723
|
-
textVariant =
|
|
19733
|
+
if (_isChecked && chipColor) {
|
|
19734
|
+
textVariant = chipColor;
|
|
19724
19735
|
}
|
|
19725
19736
|
if (_isDisabled) {
|
|
19726
19737
|
textVariant = 'disabled';
|
|
@@ -19729,8 +19740,8 @@ var _Chip = function _Chip(_ref, ref) {
|
|
|
19729
19740
|
var chipIconColor = chipColorTokens.icon[textVariant];
|
|
19730
19741
|
var intentVariant = 'unchecked';
|
|
19731
19742
|
var stateVariant = _isDisabled ? 'disabled' : 'default';
|
|
19732
|
-
if (_isChecked &&
|
|
19733
|
-
intentVariant =
|
|
19743
|
+
if (_isChecked && chipColor) {
|
|
19744
|
+
intentVariant = chipColor;
|
|
19734
19745
|
}
|
|
19735
19746
|
var chipBackgroundColor = chipColorTokens.background[intentVariant][stateVariant];
|
|
19736
19747
|
var chipBorderColor = chipColorTokens.border[intentVariant][stateVariant];
|
|
@@ -19760,7 +19771,7 @@ var _Chip = function _Chip(_ref, ref) {
|
|
|
19760
19771
|
alignItems: "center",
|
|
19761
19772
|
flexDirection: "row",
|
|
19762
19773
|
children: [/*#__PURE__*/jsx(SelectorInput, {
|
|
19763
|
-
hoverTokens: getChipInputHoverTokens(
|
|
19774
|
+
hoverTokens: getChipInputHoverTokens(chipColor),
|
|
19764
19775
|
isChecked: state.isChecked,
|
|
19765
19776
|
isDisabled: _isDisabled,
|
|
19766
19777
|
inputProps: inputProps,
|
|
@@ -19774,7 +19785,7 @@ var _Chip = function _Chip(_ref, ref) {
|
|
|
19774
19785
|
borderColor: chipBorderColor,
|
|
19775
19786
|
isChecked: _isChecked,
|
|
19776
19787
|
isDisabled: _isDisabled,
|
|
19777
|
-
|
|
19788
|
+
color: chipColor,
|
|
19778
19789
|
display: "flex",
|
|
19779
19790
|
flexDirection: "row",
|
|
19780
19791
|
justifyContent: "center",
|
|
@@ -19818,6 +19829,7 @@ var useChipGroup = function useChipGroup(_ref) {
|
|
|
19818
19829
|
name = _ref.name,
|
|
19819
19830
|
size = _ref.size,
|
|
19820
19831
|
intent = _ref.intent,
|
|
19832
|
+
color = _ref.color,
|
|
19821
19833
|
selectionType = _ref.selectionType;
|
|
19822
19834
|
var idBase = useId('chip-group');
|
|
19823
19835
|
var labelId = "".concat(idBase, "-label");
|
|
@@ -19885,9 +19897,10 @@ var useChipGroup = function useChipGroup(_ref) {
|
|
|
19885
19897
|
state: state,
|
|
19886
19898
|
size: size,
|
|
19887
19899
|
intent: intent,
|
|
19900
|
+
color: color,
|
|
19888
19901
|
selectionType: selectionType
|
|
19889
19902
|
};
|
|
19890
|
-
}, [isDisabled, name, state, size, intent, selectionType]);
|
|
19903
|
+
}, [isDisabled, name, state, size, intent, color, selectionType]);
|
|
19891
19904
|
return {
|
|
19892
19905
|
state: state,
|
|
19893
19906
|
contextValue: contextValue,
|
|
@@ -19897,7 +19910,7 @@ var useChipGroup = function useChipGroup(_ref) {
|
|
|
19897
19910
|
};
|
|
19898
19911
|
};
|
|
19899
19912
|
|
|
19900
|
-
var _excluded$q = ["accessibilityLabel", "children", "isDisabled", "name", "defaultValue", "onChange", "value", "size", "intent", "testID", "selectionType"];
|
|
19913
|
+
var _excluded$q = ["accessibilityLabel", "children", "isDisabled", "name", "defaultValue", "onChange", "value", "size", "intent", "color", "testID", "selectionType"];
|
|
19901
19914
|
function ownKeys$10(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19902
19915
|
function _objectSpread$$(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$10(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$10(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19903
19916
|
var ChipGroup = function ChipGroup(_ref) {
|
|
@@ -19913,6 +19926,7 @@ var ChipGroup = function ChipGroup(_ref) {
|
|
|
19913
19926
|
size = _ref$size === void 0 ? 'small' : _ref$size,
|
|
19914
19927
|
_ref$intent = _ref.intent,
|
|
19915
19928
|
intent = _ref$intent === void 0 ? 'none' : _ref$intent,
|
|
19929
|
+
color = _ref.color,
|
|
19916
19930
|
testID = _ref.testID,
|
|
19917
19931
|
_ref$selectionType = _ref.selectionType,
|
|
19918
19932
|
selectionType = _ref$selectionType === void 0 ? 'single' : _ref$selectionType,
|
|
@@ -19925,6 +19939,7 @@ var ChipGroup = function ChipGroup(_ref) {
|
|
|
19925
19939
|
name: name,
|
|
19926
19940
|
size: size,
|
|
19927
19941
|
intent: intent,
|
|
19942
|
+
color: color,
|
|
19928
19943
|
selectionType: selectionType
|
|
19929
19944
|
}),
|
|
19930
19945
|
contextValue = _useChipGroup.contextValue,
|
|
@@ -22151,7 +22166,7 @@ var CharacterCounter = function CharacterCounter(_ref) {
|
|
|
22151
22166
|
});
|
|
22152
22167
|
};
|
|
22153
22168
|
|
|
22154
|
-
var _excluded$i = ["label", "labelPosition", "accessibilityLabel", "contrast", "size", "testID"];
|
|
22169
|
+
var _excluded$i = ["label", "labelPosition", "accessibilityLabel", "color", "contrast", "size", "testID"];
|
|
22155
22170
|
function ownKeys$N(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
22156
22171
|
function _objectSpread$M(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$N(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$N(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
22157
22172
|
var Spinner = function Spinner(_ref) {
|
|
@@ -22159,6 +22174,8 @@ var Spinner = function Spinner(_ref) {
|
|
|
22159
22174
|
var label = _ref.label,
|
|
22160
22175
|
labelPosition = _ref.labelPosition,
|
|
22161
22176
|
accessibilityLabel = _ref.accessibilityLabel,
|
|
22177
|
+
_ref$color = _ref.color,
|
|
22178
|
+
color = _ref$color === void 0 ? 'default' : _ref$color,
|
|
22162
22179
|
_ref$contrast = _ref.contrast,
|
|
22163
22180
|
contrast = _ref$contrast === void 0 ? 'low' : _ref$contrast,
|
|
22164
22181
|
_ref$size = _ref.size,
|
|
@@ -22170,6 +22187,7 @@ var Spinner = function Spinner(_ref) {
|
|
|
22170
22187
|
labelPosition: labelPosition,
|
|
22171
22188
|
accessibilityLabel: (_ref2 = accessibilityLabel !== null && accessibilityLabel !== void 0 ? accessibilityLabel : label) !== null && _ref2 !== void 0 ? _ref2 : 'Loading',
|
|
22172
22189
|
contrast: contrast,
|
|
22190
|
+
color: color,
|
|
22173
22191
|
size: size,
|
|
22174
22192
|
testID: testID
|
|
22175
22193
|
}, styledProps));
|