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