@razorpay/blade 3.4.0 → 3.5.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/CHANGELOG.md +18 -0
- package/README.md +39 -0
- package/build/components/index.d.ts +33 -5
- package/build/components/index.native.d.ts +33 -5
- package/build/components/index.native.js +19 -13
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.web.js +353 -154
- package/build/components/index.web.js.map +1 -1
- package/build/css/bankingThemeDarkDesktop.css +2 -1
- package/build/css/bankingThemeDarkMobile.css +2 -1
- package/build/css/bankingThemeLightDesktop.css +2 -1
- package/build/css/bankingThemeLightMobile.css +2 -1
- package/build/css/paymentThemeDarkDesktop.css +2 -1
- package/build/css/paymentThemeDarkMobile.css +2 -1
- package/build/css/paymentThemeLightDesktop.css +2 -1
- package/build/css/paymentThemeLightMobile.css +2 -1
- package/build/tokens/index.d.ts +4 -0
- package/build/tokens/index.native.d.ts +4 -0
- package/build/tokens/index.native.js +1 -1
- package/build/tokens/index.native.js.map +1 -1
- package/build/tokens/index.web.js +2 -1
- package/build/tokens/index.web.js.map +1 -1
- package/package.json +9 -1
|
@@ -4426,6 +4426,33 @@ var InfoIcon = function InfoIcon(_ref) {
|
|
|
4426
4426
|
});
|
|
4427
4427
|
};
|
|
4428
4428
|
|
|
4429
|
+
var LinkIcon = function LinkIcon(_ref) {
|
|
4430
|
+
var size = _ref.size,
|
|
4431
|
+
color = _ref.color;
|
|
4432
|
+
|
|
4433
|
+
var _useIconProps = useIconProps({
|
|
4434
|
+
size: size,
|
|
4435
|
+
color: color
|
|
4436
|
+
}),
|
|
4437
|
+
height = _useIconProps.height,
|
|
4438
|
+
width = _useIconProps.width,
|
|
4439
|
+
iconColor = _useIconProps.iconColor;
|
|
4440
|
+
|
|
4441
|
+
return /*#__PURE__*/jsxs(Svg, {
|
|
4442
|
+
height: height,
|
|
4443
|
+
width: width,
|
|
4444
|
+
viewBox: "0 0 22 22",
|
|
4445
|
+
fill: "none",
|
|
4446
|
+
children: [/*#__PURE__*/jsx(Path, {
|
|
4447
|
+
d: "M20.1863 1.82377C17.8719 -0.490636 14.1296 -0.523155 11.7753 1.75068L11.765 1.7608L10.045 3.4708C9.65336 3.86019 9.65151 4.49335 10.0409 4.88501C10.4303 5.27667 11.0634 5.27852 11.4551 4.88913L13.1697 3.18451C14.7395 1.67341 17.2307 1.69666 18.772 3.23798C20.313 4.77898 20.3366 7.26948 18.8265 8.83934L15.833 11.8329C15.0124 12.6537 13.8758 13.0778 12.7181 12.9949C11.5605 12.9119 10.496 12.3303 9.80083 11.401C9.47002 10.9587 8.84333 10.8684 8.40108 11.1992C7.95883 11.53 7.86849 12.1567 8.1993 12.5989C9.24204 13.993 10.8388 14.8654 12.5753 14.9897C14.3117 15.1141 16.0165 14.4782 17.2473 13.2469L20.2472 10.2471L20.2593 10.2347C22.5332 7.8804 22.5007 4.13817 20.1863 1.82377Z",
|
|
4448
|
+
fill: iconColor
|
|
4449
|
+
}), /*#__PURE__*/jsx(Path, {
|
|
4450
|
+
d: "M9.42474 7.01016C7.68837 6.8858 5.9836 7.52171 4.75285 8.75283L1.75285 11.7528L1.74067 11.7652C-0.533165 14.1195 -0.500646 17.8617 1.81376 20.1761C4.12816 22.4905 7.8704 22.5231 10.2247 20.2492L10.2371 20.237L11.9471 18.527C12.3376 18.1365 12.3376 17.5034 11.9471 17.1128C11.5565 16.7223 10.9234 16.7223 10.5329 17.1128L8.82933 18.8164C7.25947 20.3265 4.76897 20.3029 3.22797 18.7619C1.68697 17.2209 1.66341 14.7304 3.17354 13.1606L6.16719 10.1669C6.9877 9.34611 8.12425 8.92214 9.28187 9.00505C10.4395 9.08796 11.504 9.66956 12.1992 10.5989C12.53 11.0412 13.1567 11.1315 13.5989 10.8007C14.0412 10.4699 14.1315 9.84321 13.8007 9.40096C12.758 8.00693 11.1612 7.13452 9.42474 7.01016Z",
|
|
4451
|
+
fill: iconColor
|
|
4452
|
+
})]
|
|
4453
|
+
});
|
|
4454
|
+
};
|
|
4455
|
+
|
|
4429
4456
|
var PauseIcon = function PauseIcon(_ref) {
|
|
4430
4457
|
var size = _ref.size,
|
|
4431
4458
|
color = _ref.color;
|
|
@@ -6866,35 +6893,61 @@ var useCheckboxGroupContext = function useCheckboxGroupContext() {
|
|
|
6866
6893
|
return context;
|
|
6867
6894
|
};
|
|
6868
6895
|
|
|
6869
|
-
var
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6896
|
+
var checkboxSizes = {
|
|
6897
|
+
group: {
|
|
6898
|
+
gap: {
|
|
6899
|
+
small: {
|
|
6900
|
+
mobile: 'spacing.2',
|
|
6901
|
+
desktop: 'spacing.0'
|
|
6902
|
+
},
|
|
6903
|
+
medium: {
|
|
6904
|
+
mobile: 'spacing.3',
|
|
6905
|
+
desktop: 'spacing.2'
|
|
6906
|
+
}
|
|
6878
6907
|
}
|
|
6879
6908
|
},
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6909
|
+
icon: {
|
|
6910
|
+
small: {
|
|
6911
|
+
width: 12,
|
|
6912
|
+
height: 12
|
|
6884
6913
|
},
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
|
-
|
|
6914
|
+
medium: {
|
|
6915
|
+
width: 16,
|
|
6916
|
+
height: 16
|
|
6888
6917
|
}
|
|
6889
|
-
}
|
|
6890
|
-
|
|
6891
|
-
|
|
6892
|
-
|
|
6893
|
-
|
|
6918
|
+
}
|
|
6919
|
+
};
|
|
6920
|
+
var checkboxIconColors = {
|
|
6921
|
+
variants: {
|
|
6922
|
+
"default": {
|
|
6923
|
+
border: {
|
|
6924
|
+
checked: 'colors.brand.primary.500',
|
|
6925
|
+
unchecked: 'colors.brand.gray.500'
|
|
6926
|
+
},
|
|
6927
|
+
background: {
|
|
6928
|
+
checked: 'colors.brand.primary.500',
|
|
6929
|
+
unchecked: 'transparent'
|
|
6930
|
+
}
|
|
6894
6931
|
},
|
|
6895
|
-
|
|
6896
|
-
|
|
6897
|
-
|
|
6932
|
+
disabled: {
|
|
6933
|
+
border: {
|
|
6934
|
+
checked: 'transparent',
|
|
6935
|
+
unchecked: 'colors.brand.gray.a100'
|
|
6936
|
+
},
|
|
6937
|
+
background: {
|
|
6938
|
+
checked: 'colors.brand.gray.a100',
|
|
6939
|
+
unchecked: 'transparent'
|
|
6940
|
+
}
|
|
6941
|
+
},
|
|
6942
|
+
negative: {
|
|
6943
|
+
border: {
|
|
6944
|
+
checked: 'colors.feedback.border.negative.highContrast',
|
|
6945
|
+
unchecked: 'colors.feedback.border.negative.highContrast'
|
|
6946
|
+
},
|
|
6947
|
+
background: {
|
|
6948
|
+
checked: 'colors.feedback.background.negative.highContrast',
|
|
6949
|
+
unchecked: 'colors.feedback.background.negative.lowContrast'
|
|
6950
|
+
}
|
|
6898
6951
|
}
|
|
6899
6952
|
}
|
|
6900
6953
|
};
|
|
@@ -6903,26 +6956,28 @@ var getCheckboxIconWrapperStyles = function getCheckboxIconWrapperStyles(_ref) {
|
|
|
6903
6956
|
var theme = _ref.theme,
|
|
6904
6957
|
isChecked = _ref.isChecked,
|
|
6905
6958
|
isDisabled = _ref.isDisabled,
|
|
6906
|
-
isNegative = _ref.isNegative
|
|
6959
|
+
isNegative = _ref.isNegative,
|
|
6960
|
+
size = _ref.size;
|
|
6907
6961
|
var variant = 'default';
|
|
6908
6962
|
if (isDisabled) variant = 'disabled';
|
|
6909
6963
|
if (isNegative) variant = 'negative';
|
|
6910
6964
|
var checked = isChecked ? 'checked' : 'unchecked';
|
|
6911
|
-
var
|
|
6912
|
-
var
|
|
6965
|
+
var background = checkboxIconColors.variants[variant].background[checked];
|
|
6966
|
+
var border = checkboxIconColors.variants[variant].border[checked];
|
|
6967
|
+
var backgroundColor = background === 'transparent' ? background : get_1(theme, background);
|
|
6968
|
+
var borderColor = border === 'transparent' ? border : get_1(theme, border);
|
|
6913
6969
|
return {
|
|
6914
6970
|
display: 'flex',
|
|
6915
6971
|
alignItems: 'center',
|
|
6916
6972
|
justifyContent: 'center',
|
|
6917
|
-
width:
|
|
6918
|
-
height:
|
|
6919
|
-
borderWidth: makeBorderSize(theme.border.width.
|
|
6973
|
+
width: makeSpace(checkboxSizes.icon[size].width),
|
|
6974
|
+
height: makeSpace(checkboxSizes.icon[size].height),
|
|
6975
|
+
borderWidth: makeBorderSize(theme.border.width.thick),
|
|
6920
6976
|
borderStyle: 'solid',
|
|
6921
|
-
margin: makeSpace(theme.spacing[
|
|
6977
|
+
margin: makeSpace(theme.spacing[1]),
|
|
6922
6978
|
borderRadius: makeSize(theme.border.radius.small),
|
|
6923
|
-
|
|
6924
|
-
|
|
6925
|
-
borderColor: get_1(theme, borderColor)
|
|
6979
|
+
backgroundColor: backgroundColor,
|
|
6980
|
+
borderColor: borderColor
|
|
6926
6981
|
};
|
|
6927
6982
|
};
|
|
6928
6983
|
|
|
@@ -6969,35 +7024,59 @@ var Fade$1 = function Fade(_ref2) {
|
|
|
6969
7024
|
};
|
|
6970
7025
|
|
|
6971
7026
|
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
|
|
7027
|
+
var svgSize = {
|
|
7028
|
+
small: {
|
|
7029
|
+
width: 8,
|
|
7030
|
+
height: 8
|
|
7031
|
+
},
|
|
7032
|
+
medium: {
|
|
7033
|
+
width: 12,
|
|
7034
|
+
height: 12
|
|
7035
|
+
}
|
|
7036
|
+
};
|
|
6972
7037
|
|
|
6973
7038
|
var CheckedIcon$1 = function CheckedIcon(_ref) {
|
|
6974
|
-
var color = _ref.color
|
|
7039
|
+
var color = _ref.color,
|
|
7040
|
+
size = _ref.size;
|
|
7041
|
+
var width = makeSpace(svgSize[size].width);
|
|
7042
|
+
var height = makeSpace(svgSize[size].height);
|
|
6975
7043
|
return /*#__PURE__*/jsx(Svg, {
|
|
6976
|
-
width:
|
|
6977
|
-
height:
|
|
6978
|
-
viewBox: "0 0
|
|
7044
|
+
width: width,
|
|
7045
|
+
height: height,
|
|
7046
|
+
viewBox: "0 0 8 8",
|
|
6979
7047
|
fill: "none",
|
|
6980
7048
|
children: /*#__PURE__*/jsx(Path, {
|
|
6981
7049
|
fillRule: "evenodd",
|
|
6982
7050
|
clipRule: "evenodd",
|
|
6983
|
-
d: "
|
|
6984
|
-
fill: color
|
|
7051
|
+
d: "M6.90237 1.76413C7.03254 1.89431 7.03254 2.10536 6.90237 2.23554L3.2357 5.90221C3.10553 6.03238 2.89447 6.03238 2.7643 5.90221L1.09763 4.23554C0.967456 4.10536 0.967456 3.89431 1.09763 3.76414C1.22781 3.63396 1.43886 3.63396 1.56904 3.76414L3 5.1951L6.43096 1.76413C6.56114 1.63396 6.77219 1.63396 6.90237 1.76413Z",
|
|
7052
|
+
fill: color,
|
|
7053
|
+
stroke: "white",
|
|
7054
|
+
strokeWidth: "0.5",
|
|
7055
|
+
strokeLinecap: "round",
|
|
7056
|
+
strokeLinejoin: "round"
|
|
6985
7057
|
})
|
|
6986
7058
|
});
|
|
6987
7059
|
};
|
|
6988
7060
|
|
|
6989
7061
|
var IndeterminateIcon = function IndeterminateIcon(_ref2) {
|
|
6990
|
-
var color = _ref2.color
|
|
7062
|
+
var color = _ref2.color,
|
|
7063
|
+
size = _ref2.size;
|
|
7064
|
+
var width = "".concat(svgSize[size].width, "px");
|
|
7065
|
+
var height = "".concat(svgSize[size].height, "px");
|
|
6991
7066
|
return /*#__PURE__*/jsx(Svg, {
|
|
6992
|
-
width:
|
|
6993
|
-
height:
|
|
6994
|
-
viewBox: "0 0
|
|
7067
|
+
width: width,
|
|
7068
|
+
height: height,
|
|
7069
|
+
viewBox: "0 0 8 8",
|
|
6995
7070
|
fill: "none",
|
|
6996
7071
|
children: /*#__PURE__*/jsx(Path, {
|
|
6997
7072
|
fillRule: "evenodd",
|
|
6998
7073
|
clipRule: "evenodd",
|
|
6999
|
-
d: "
|
|
7000
|
-
fill: color
|
|
7074
|
+
d: "M1.3335 3.99984C1.3335 3.81574 1.48273 3.6665 1.66683 3.6665H6.3335C6.51759 3.6665 6.66683 3.81574 6.66683 3.99984C6.66683 4.18393 6.51759 4.33317 6.3335 4.33317H1.66683C1.48273 4.33317 1.3335 4.18393 1.3335 3.99984Z",
|
|
7075
|
+
fill: color,
|
|
7076
|
+
stroke: "white",
|
|
7077
|
+
strokeWidth: "0.5",
|
|
7078
|
+
strokeLinecap: "round",
|
|
7079
|
+
strokeLinejoin: "round"
|
|
7001
7080
|
})
|
|
7002
7081
|
});
|
|
7003
7082
|
};
|
|
@@ -7006,7 +7085,8 @@ var CheckboxIcon = function CheckboxIcon(_ref3) {
|
|
|
7006
7085
|
var isChecked = _ref3.isChecked,
|
|
7007
7086
|
isIndeterminate = _ref3.isIndeterminate,
|
|
7008
7087
|
isDisabled = _ref3.isDisabled,
|
|
7009
|
-
isNegative = _ref3.isNegative
|
|
7088
|
+
isNegative = _ref3.isNegative,
|
|
7089
|
+
size = _ref3.size;
|
|
7010
7090
|
|
|
7011
7091
|
var _useTheme = useTheme(),
|
|
7012
7092
|
theme = _useTheme.theme;
|
|
@@ -7015,6 +7095,7 @@ var CheckboxIcon = function CheckboxIcon(_ref3) {
|
|
|
7015
7095
|
var disabledIconColor = get_1(theme, 'colors.brand.gray.500');
|
|
7016
7096
|
var iconColor = isDisabled ? disabledIconColor : defaultIconColor;
|
|
7017
7097
|
return /*#__PURE__*/jsxs(CheckboxIconWrapper, {
|
|
7098
|
+
size: size,
|
|
7018
7099
|
isIndeterminate: isIndeterminate,
|
|
7019
7100
|
isDisabled: isDisabled,
|
|
7020
7101
|
isNegative: isNegative,
|
|
@@ -7026,6 +7107,7 @@ var CheckboxIcon = function CheckboxIcon(_ref3) {
|
|
|
7026
7107
|
display: 'flex'
|
|
7027
7108
|
},
|
|
7028
7109
|
children: /*#__PURE__*/jsx(IndeterminateIcon, {
|
|
7110
|
+
size: size,
|
|
7029
7111
|
color: iconColor
|
|
7030
7112
|
})
|
|
7031
7113
|
}), /*#__PURE__*/jsx(Fade$1, {
|
|
@@ -7035,6 +7117,7 @@ var CheckboxIcon = function CheckboxIcon(_ref3) {
|
|
|
7035
7117
|
display: 'flex'
|
|
7036
7118
|
},
|
|
7037
7119
|
children: isChecked ? /*#__PURE__*/jsx(CheckedIcon$1, {
|
|
7120
|
+
size: size,
|
|
7038
7121
|
color: iconColor
|
|
7039
7122
|
}) : null
|
|
7040
7123
|
})]
|
|
@@ -7486,15 +7569,17 @@ var FormLabel = function FormLabel(_ref) {
|
|
|
7486
7569
|
var StyledSelectorLabel = /*#__PURE__*/styled.label.withConfig({
|
|
7487
7570
|
displayName: "SelectorLabelweb__StyledSelectorLabel",
|
|
7488
7571
|
componentId: "sc-1yoi09a-0"
|
|
7489
|
-
})({
|
|
7490
|
-
|
|
7491
|
-
|
|
7492
|
-
|
|
7493
|
-
|
|
7572
|
+
})(function (_ref) {
|
|
7573
|
+
var theme = _ref.theme;
|
|
7574
|
+
return {
|
|
7575
|
+
display: 'flex',
|
|
7576
|
+
marginTop: makeSpace(theme.spacing[1]),
|
|
7577
|
+
marginBottom: makeSpace(theme.spacing[1])
|
|
7578
|
+
};
|
|
7494
7579
|
});
|
|
7495
7580
|
|
|
7496
|
-
var SelectorLabel = function SelectorLabel(
|
|
7497
|
-
var children =
|
|
7581
|
+
var SelectorLabel = function SelectorLabel(_ref2) {
|
|
7582
|
+
var children = _ref2.children;
|
|
7498
7583
|
return /*#__PURE__*/jsx(StyledSelectorLabel, {
|
|
7499
7584
|
children: children
|
|
7500
7585
|
});
|
|
@@ -7502,14 +7587,28 @@ var SelectorLabel = function SelectorLabel(_ref) {
|
|
|
7502
7587
|
|
|
7503
7588
|
var SelectorTitle = function SelectorTitle(_ref) {
|
|
7504
7589
|
var children = _ref.children,
|
|
7505
|
-
isDisabled = _ref.isDisabled
|
|
7506
|
-
|
|
7507
|
-
|
|
7508
|
-
|
|
7509
|
-
|
|
7510
|
-
|
|
7511
|
-
|
|
7512
|
-
|
|
7590
|
+
isDisabled = _ref.isDisabled,
|
|
7591
|
+
_ref$size = _ref.size,
|
|
7592
|
+
size = _ref$size === void 0 ? 'medium' : _ref$size;
|
|
7593
|
+
var lineHeight = {
|
|
7594
|
+
small: 's',
|
|
7595
|
+
medium: 'l'
|
|
7596
|
+
};
|
|
7597
|
+
var fontSize = {
|
|
7598
|
+
small: 75,
|
|
7599
|
+
medium: 100
|
|
7600
|
+
};
|
|
7601
|
+
return /*#__PURE__*/jsxs(Fragment$1, {
|
|
7602
|
+
children: [/*#__PURE__*/jsx(Box, {
|
|
7603
|
+
marginLeft: "spacing.2"
|
|
7604
|
+
}), /*#__PURE__*/jsx(BaseText, {
|
|
7605
|
+
lineHeight: lineHeight[size],
|
|
7606
|
+
fontFamily: "text",
|
|
7607
|
+
fontWeight: "regular",
|
|
7608
|
+
fontSize: fontSize[size],
|
|
7609
|
+
color: isDisabled ? 'surface.text.placeholder.lowContrast' : 'surface.text.subtle.lowContrast',
|
|
7610
|
+
children: children
|
|
7611
|
+
})]
|
|
7513
7612
|
});
|
|
7514
7613
|
};
|
|
7515
7614
|
|
|
@@ -7532,11 +7631,15 @@ var SelectorSupportText = function SelectorSupportText(_ref) {
|
|
|
7532
7631
|
function ownKeys$c(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7533
7632
|
|
|
7534
7633
|
function _objectSpread$c(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$c(Object(source), !0)).call(_context, function (key) { _defineProperty$1(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$c(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7535
|
-
var variants
|
|
7634
|
+
var variants = {
|
|
7536
7635
|
"default": {
|
|
7537
7636
|
background: {
|
|
7538
7637
|
checked: 'colors.brand.primary.600',
|
|
7539
|
-
unchecked: 'colors.brand.gray.
|
|
7638
|
+
unchecked: 'colors.brand.gray.a50'
|
|
7639
|
+
},
|
|
7640
|
+
border: {
|
|
7641
|
+
checked: 'colors.brand.primary.600',
|
|
7642
|
+
unchecked: 'colors.brand.gray.500'
|
|
7540
7643
|
}
|
|
7541
7644
|
}
|
|
7542
7645
|
};
|
|
@@ -7548,9 +7651,10 @@ var getHoverStyles = function getHoverStyles(_ref) {
|
|
|
7548
7651
|
isChecked = _ref.isChecked;
|
|
7549
7652
|
if (isDisabled || isNegative) return {};
|
|
7550
7653
|
var checked = isChecked ? 'checked' : 'unchecked';
|
|
7551
|
-
var backgroundColor = variants
|
|
7654
|
+
var backgroundColor = variants["default"].background[checked];
|
|
7655
|
+
var borderColor = variants["default"].border[checked];
|
|
7552
7656
|
return {
|
|
7553
|
-
borderColor: get_1(theme,
|
|
7657
|
+
borderColor: get_1(theme, borderColor),
|
|
7554
7658
|
backgroundColor: get_1(theme, backgroundColor),
|
|
7555
7659
|
transitionTimingFunction: theme.motion.easing.standard.effective,
|
|
7556
7660
|
transitionDuration: castWebType(makeMotionTime(theme.motion.duration['2xquick']))
|
|
@@ -7593,7 +7697,7 @@ var SelectorInput = function SelectorInput(_ref3) {
|
|
|
7593
7697
|
};
|
|
7594
7698
|
|
|
7595
7699
|
var Checkbox = function Checkbox(_ref) {
|
|
7596
|
-
var _groupProps$state;
|
|
7700
|
+
var _groupProps$state, _groupProps$size;
|
|
7597
7701
|
|
|
7598
7702
|
var defaultChecked = _ref.defaultChecked,
|
|
7599
7703
|
validationState = _ref.validationState,
|
|
@@ -7606,7 +7710,9 @@ var Checkbox = function Checkbox(_ref) {
|
|
|
7606
7710
|
value = _ref.value,
|
|
7607
7711
|
children = _ref.children,
|
|
7608
7712
|
helpText = _ref.helpText,
|
|
7609
|
-
errorText = _ref.errorText
|
|
7713
|
+
errorText = _ref.errorText,
|
|
7714
|
+
_ref$size = _ref.size,
|
|
7715
|
+
size = _ref$size === void 0 ? 'medium' : _ref$size;
|
|
7610
7716
|
var groupProps = useCheckboxGroupContext(); // ban certain props in checkbox while inside group
|
|
7611
7717
|
|
|
7612
7718
|
var hasValidationState = !isUndefined_1(validationState);
|
|
@@ -7636,9 +7742,12 @@ var Checkbox = function Checkbox(_ref) {
|
|
|
7636
7742
|
|
|
7637
7743
|
var _name = name !== null && name !== void 0 ? name : groupProps === null || groupProps === void 0 ? void 0 : groupProps.name;
|
|
7638
7744
|
|
|
7639
|
-
var _isChecked = isChecked !== null && isChecked !== void 0 ? isChecked : groupProps === null || groupProps === void 0 ? void 0 : (_groupProps$state = groupProps.state) === null || _groupProps$state === void 0 ? void 0 : _groupProps$state.isChecked(value);
|
|
7640
|
-
|
|
7745
|
+
var _isChecked = isChecked !== null && isChecked !== void 0 ? isChecked : groupProps === null || groupProps === void 0 ? void 0 : (_groupProps$state = groupProps.state) === null || _groupProps$state === void 0 ? void 0 : _groupProps$state.isChecked(value);
|
|
7746
|
+
|
|
7747
|
+
var _size = (_groupProps$size = groupProps.size) !== null && _groupProps$size !== void 0 ? _groupProps$size : size;
|
|
7641
7748
|
|
|
7749
|
+
var isSmall = _size === 'small'; // only show error when the self validation is set to error
|
|
7750
|
+
// Since we don't want to show errorText inside the group
|
|
7642
7751
|
|
|
7643
7752
|
var showSupportingText = validationState !== 'error' && helpText;
|
|
7644
7753
|
|
|
@@ -7696,16 +7805,18 @@ var Checkbox = function Checkbox(_ref) {
|
|
|
7696
7805
|
isNegative: _hasError,
|
|
7697
7806
|
inputProps: inputProps
|
|
7698
7807
|
}), /*#__PURE__*/jsx(CheckboxIcon, {
|
|
7808
|
+
size: _size,
|
|
7699
7809
|
isChecked: state.isChecked,
|
|
7700
7810
|
isIndeterminate: isIndeterminate,
|
|
7701
7811
|
isDisabled: _isDisabled,
|
|
7702
7812
|
isNegative: _hasError
|
|
7703
7813
|
}), /*#__PURE__*/jsx(SelectorTitle, {
|
|
7814
|
+
size: _size,
|
|
7704
7815
|
isDisabled: _isDisabled,
|
|
7705
7816
|
children: children
|
|
7706
7817
|
})]
|
|
7707
7818
|
}), /*#__PURE__*/jsx(Box, {
|
|
7708
|
-
marginLeft:
|
|
7819
|
+
marginLeft: isSmall ? 'spacing.6' : 'spacing.7',
|
|
7709
7820
|
children: showSupportingText && /*#__PURE__*/jsx(SelectorSupportText, {
|
|
7710
7821
|
id: ids === null || ids === void 0 ? void 0 : ids.helpTextId,
|
|
7711
7822
|
children: helpText
|
|
@@ -7727,7 +7838,8 @@ var useCheckboxGroup = function useCheckboxGroup(_ref) {
|
|
|
7727
7838
|
labelPosition = _ref.labelPosition,
|
|
7728
7839
|
_onChange = _ref.onChange,
|
|
7729
7840
|
validationState = _ref.validationState,
|
|
7730
|
-
name = _ref.name
|
|
7841
|
+
name = _ref.name,
|
|
7842
|
+
size = _ref.size;
|
|
7731
7843
|
|
|
7732
7844
|
var _useTheme = useTheme(),
|
|
7733
7845
|
platform = _useTheme.platform;
|
|
@@ -7806,9 +7918,10 @@ var useCheckboxGroup = function useCheckboxGroup(_ref) {
|
|
|
7806
7918
|
isDisabled: isDisabled,
|
|
7807
7919
|
labelPosition: platform === 'onMobile' ? 'top' : labelPosition,
|
|
7808
7920
|
name: name,
|
|
7809
|
-
state: state
|
|
7921
|
+
state: state,
|
|
7922
|
+
size: size
|
|
7810
7923
|
};
|
|
7811
|
-
}, [validationState, isDisabled, platform, labelPosition, name, state]);
|
|
7924
|
+
}, [validationState, isDisabled, platform, labelPosition, name, state, size]);
|
|
7812
7925
|
return {
|
|
7813
7926
|
state: state,
|
|
7814
7927
|
contextValue: contextValue,
|
|
@@ -7844,7 +7957,7 @@ var SelectorGroupField = function SelectorGroupField(_ref) {
|
|
|
7844
7957
|
};
|
|
7845
7958
|
|
|
7846
7959
|
var CheckboxGroup = function CheckboxGroup(_ref) {
|
|
7847
|
-
var _context;
|
|
7960
|
+
var _context, _context2;
|
|
7848
7961
|
|
|
7849
7962
|
var children = _ref.children,
|
|
7850
7963
|
label = _ref.label,
|
|
@@ -7859,7 +7972,9 @@ var CheckboxGroup = function CheckboxGroup(_ref) {
|
|
|
7859
7972
|
name = _ref.name,
|
|
7860
7973
|
defaultValue = _ref.defaultValue,
|
|
7861
7974
|
onChange = _ref.onChange,
|
|
7862
|
-
value = _ref.value
|
|
7975
|
+
value = _ref.value,
|
|
7976
|
+
_ref$size = _ref.size,
|
|
7977
|
+
size = _ref$size === void 0 ? 'medium' : _ref$size;
|
|
7863
7978
|
|
|
7864
7979
|
var _useCheckboxGroup = useCheckboxGroup({
|
|
7865
7980
|
defaultValue: defaultValue,
|
|
@@ -7868,16 +7983,27 @@ var CheckboxGroup = function CheckboxGroup(_ref) {
|
|
|
7868
7983
|
isDisabled: isDisabled,
|
|
7869
7984
|
name: name,
|
|
7870
7985
|
labelPosition: labelPosition,
|
|
7871
|
-
validationState: validationState
|
|
7986
|
+
validationState: validationState,
|
|
7987
|
+
size: size
|
|
7872
7988
|
}),
|
|
7873
7989
|
contextValue = _useCheckboxGroup.contextValue,
|
|
7874
7990
|
ids = _useCheckboxGroup.ids;
|
|
7875
7991
|
|
|
7992
|
+
var _useTheme = useTheme(),
|
|
7993
|
+
theme = _useTheme.theme;
|
|
7994
|
+
|
|
7876
7995
|
var showError = validationState === 'error' && errorText;
|
|
7877
7996
|
var showHelpText = !showError && helpText;
|
|
7878
7997
|
|
|
7879
7998
|
var accessibilityText = _concatInstanceProperty(_context = ",".concat(showError ? errorText : '', " ")).call(_context, showHelpText ? helpText : '');
|
|
7880
7999
|
|
|
8000
|
+
var _useBreakpoint = useBreakpoint({
|
|
8001
|
+
breakpoints: theme.breakpoints
|
|
8002
|
+
}),
|
|
8003
|
+
matchedDeviceType = _useBreakpoint.matchedDeviceType;
|
|
8004
|
+
|
|
8005
|
+
var gap = checkboxSizes.group.gap[size][matchedDeviceType];
|
|
8006
|
+
var childCount = React__default.Children.count(children);
|
|
7881
8007
|
return /*#__PURE__*/jsx(CheckboxGroupProvider, {
|
|
7882
8008
|
value: contextValue,
|
|
7883
8009
|
children: /*#__PURE__*/jsxs(SelectorGroupField, {
|
|
@@ -7894,8 +8020,12 @@ var CheckboxGroup = function CheckboxGroup(_ref) {
|
|
|
7894
8020
|
children: [/*#__PURE__*/jsx(Box, {
|
|
7895
8021
|
display: "flex",
|
|
7896
8022
|
flexDirection: "column",
|
|
7897
|
-
|
|
7898
|
-
|
|
8023
|
+
children: _mapInstanceProperty(_context2 = React__default.Children).call(_context2, children, function (child, index) {
|
|
8024
|
+
return /*#__PURE__*/jsx(Box, {
|
|
8025
|
+
marginBottom: index === childCount - 1 ? 0 : gap,
|
|
8026
|
+
children: child
|
|
8027
|
+
}, index);
|
|
8028
|
+
})
|
|
7899
8029
|
}), /*#__PURE__*/jsx(FormHint, {
|
|
7900
8030
|
errorText: errorText,
|
|
7901
8031
|
helpText: helpText,
|
|
@@ -9669,67 +9799,110 @@ var useRadio = function useRadio(_ref) {
|
|
|
9669
9799
|
};
|
|
9670
9800
|
};
|
|
9671
9801
|
|
|
9672
|
-
|
|
9673
|
-
|
|
9674
|
-
|
|
9675
|
-
|
|
9676
|
-
|
|
9677
|
-
|
|
9678
|
-
|
|
9679
|
-
|
|
9680
|
-
|
|
9681
|
-
|
|
9682
|
-
|
|
9683
|
-
unchecked: 'colors.brand.gray.200'
|
|
9802
|
+
var radioSizes = {
|
|
9803
|
+
group: {
|
|
9804
|
+
gap: {
|
|
9805
|
+
small: {
|
|
9806
|
+
mobile: 'spacing.2',
|
|
9807
|
+
desktop: 'spacing.0'
|
|
9808
|
+
},
|
|
9809
|
+
medium: {
|
|
9810
|
+
mobile: 'spacing.3',
|
|
9811
|
+
desktop: 'spacing.2'
|
|
9812
|
+
}
|
|
9684
9813
|
}
|
|
9685
9814
|
},
|
|
9686
|
-
|
|
9687
|
-
|
|
9688
|
-
|
|
9689
|
-
|
|
9815
|
+
icon: {
|
|
9816
|
+
small: {
|
|
9817
|
+
width: 12,
|
|
9818
|
+
height: 12,
|
|
9819
|
+
dotRadius: 2
|
|
9690
9820
|
},
|
|
9691
|
-
|
|
9692
|
-
|
|
9693
|
-
|
|
9821
|
+
medium: {
|
|
9822
|
+
width: 16,
|
|
9823
|
+
height: 16,
|
|
9824
|
+
dotRadius: 3
|
|
9694
9825
|
}
|
|
9695
|
-
}
|
|
9696
|
-
|
|
9697
|
-
|
|
9698
|
-
|
|
9699
|
-
|
|
9826
|
+
}
|
|
9827
|
+
};
|
|
9828
|
+
var radioIconColors = {
|
|
9829
|
+
variants: {
|
|
9830
|
+
"default": {
|
|
9831
|
+
dot: {
|
|
9832
|
+
checked: 'colors.brand.gray.200',
|
|
9833
|
+
unchecked: 'colors.brand.gray.200'
|
|
9834
|
+
},
|
|
9835
|
+
border: {
|
|
9836
|
+
checked: 'colors.brand.primary.500',
|
|
9837
|
+
unchecked: 'colors.brand.gray.500'
|
|
9838
|
+
},
|
|
9839
|
+
background: {
|
|
9840
|
+
checked: 'colors.brand.primary.500',
|
|
9841
|
+
unchecked: 'transparent'
|
|
9842
|
+
}
|
|
9700
9843
|
},
|
|
9701
|
-
|
|
9702
|
-
|
|
9703
|
-
|
|
9844
|
+
disabled: {
|
|
9845
|
+
dot: {
|
|
9846
|
+
checked: 'colors.brand.gray.200',
|
|
9847
|
+
unchecked: 'colors.brand.gray.200'
|
|
9848
|
+
},
|
|
9849
|
+
border: {
|
|
9850
|
+
checked: 'transparent',
|
|
9851
|
+
unchecked: 'colors.brand.gray.a100'
|
|
9852
|
+
},
|
|
9853
|
+
background: {
|
|
9854
|
+
checked: 'colors.brand.gray.a100',
|
|
9855
|
+
unchecked: 'transparent'
|
|
9856
|
+
}
|
|
9857
|
+
},
|
|
9858
|
+
negative: {
|
|
9859
|
+
dot: {
|
|
9860
|
+
checked: 'colors.brand.gray.200',
|
|
9861
|
+
unchecked: 'colors.brand.gray.200'
|
|
9862
|
+
},
|
|
9863
|
+
border: {
|
|
9864
|
+
checked: 'colors.feedback.border.negative.highContrast',
|
|
9865
|
+
unchecked: 'colors.feedback.border.negative.highContrast'
|
|
9866
|
+
},
|
|
9867
|
+
background: {
|
|
9868
|
+
checked: 'colors.feedback.background.negative.highContrast',
|
|
9869
|
+
unchecked: 'colors.feedback.background.negative.lowContrast'
|
|
9870
|
+
}
|
|
9704
9871
|
}
|
|
9705
9872
|
}
|
|
9706
9873
|
};
|
|
9707
9874
|
|
|
9875
|
+
function ownKeys$1(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9876
|
+
|
|
9877
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1(Object(source), !0)).call(_context, function (key) { _defineProperty$1(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9878
|
+
|
|
9708
9879
|
var getRadioIconWrapperStyles = function getRadioIconWrapperStyles(_ref) {
|
|
9709
9880
|
var theme = _ref.theme,
|
|
9710
9881
|
isChecked = _ref.isChecked,
|
|
9711
9882
|
isDisabled = _ref.isDisabled,
|
|
9712
|
-
isNegative = _ref.isNegative
|
|
9883
|
+
isNegative = _ref.isNegative,
|
|
9884
|
+
size = _ref.size;
|
|
9713
9885
|
var isReactNative = getPlatformType() === 'react-native';
|
|
9714
9886
|
var variant = 'default';
|
|
9715
9887
|
if (isDisabled) variant = 'disabled';
|
|
9716
9888
|
if (isNegative) variant = 'negative';
|
|
9717
9889
|
var checked = isChecked ? 'checked' : 'unchecked';
|
|
9718
|
-
var
|
|
9719
|
-
var
|
|
9890
|
+
var background = radioIconColors.variants[variant].background[checked];
|
|
9891
|
+
var border = radioIconColors.variants[variant].border[checked];
|
|
9892
|
+
var backgroundColor = background === 'transparent' ? background : get_1(theme, background);
|
|
9893
|
+
var borderColor = border === 'transparent' ? border : get_1(theme, border);
|
|
9720
9894
|
return _objectSpread$1({
|
|
9721
9895
|
display: 'flex',
|
|
9722
9896
|
alignItems: 'center',
|
|
9723
9897
|
justifyContent: 'center',
|
|
9724
|
-
width:
|
|
9725
|
-
height:
|
|
9726
|
-
borderWidth: makeBorderSize(theme.border.width.
|
|
9898
|
+
width: makeSpace(radioSizes.icon[size].width),
|
|
9899
|
+
height: makeSpace(radioSizes.icon[size].height),
|
|
9900
|
+
borderWidth: makeBorderSize(theme.border.width.thick),
|
|
9727
9901
|
borderStyle: 'solid',
|
|
9728
|
-
margin: makeSpace(theme.spacing[
|
|
9902
|
+
margin: makeSpace(theme.spacing[1]),
|
|
9729
9903
|
borderRadius: makeSize(theme.border.radius.max),
|
|
9730
|
-
|
|
9731
|
-
|
|
9732
|
-
borderColor: get_1(theme, borderColor)
|
|
9904
|
+
backgroundColor: backgroundColor,
|
|
9905
|
+
borderColor: borderColor
|
|
9733
9906
|
}, !isReactNative && {
|
|
9734
9907
|
transitionDuration: castWebType(makeMotionTime(theme.motion.duration.xquick)),
|
|
9735
9908
|
transitionTimingFunction: castWebType(theme.motion.easing.exit.attentive)
|
|
@@ -9884,42 +10057,38 @@ var Circle = function Circle(_ref) {
|
|
|
9884
10057
|
});
|
|
9885
10058
|
};
|
|
9886
10059
|
|
|
9887
|
-
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
9888
|
-
|
|
9889
10060
|
var CheckedIcon = function CheckedIcon(_ref) {
|
|
9890
|
-
var
|
|
10061
|
+
var _context;
|
|
10062
|
+
|
|
10063
|
+
var color = _ref.color,
|
|
10064
|
+
size = _ref.size;
|
|
10065
|
+
var width = radioSizes.icon[size].width;
|
|
10066
|
+
var height = radioSizes.icon[size].height;
|
|
10067
|
+
var radius = radioSizes.icon[size].dotRadius;
|
|
10068
|
+
|
|
10069
|
+
var viewBox = _concatInstanceProperty(_context = "0 0 ".concat(width, " ")).call(_context, height);
|
|
10070
|
+
|
|
10071
|
+
var cx = "".concat(width / 2);
|
|
10072
|
+
var cy = "".concat(height / 2);
|
|
9891
10073
|
return /*#__PURE__*/jsx(Svg, {
|
|
9892
|
-
width:
|
|
9893
|
-
height:
|
|
9894
|
-
viewBox:
|
|
10074
|
+
width: makeSpace(width),
|
|
10075
|
+
height: makeSpace(height),
|
|
10076
|
+
viewBox: viewBox,
|
|
9895
10077
|
fill: "none",
|
|
9896
10078
|
children: /*#__PURE__*/jsx(Circle, {
|
|
9897
|
-
cx:
|
|
9898
|
-
cy:
|
|
9899
|
-
r: "
|
|
10079
|
+
cx: cx,
|
|
10080
|
+
cy: cy,
|
|
10081
|
+
r: "".concat(radius),
|
|
9900
10082
|
fill: color
|
|
9901
10083
|
})
|
|
9902
10084
|
});
|
|
9903
10085
|
};
|
|
9904
10086
|
|
|
9905
|
-
// Radio icon center dot color
|
|
9906
|
-
var variants = {
|
|
9907
|
-
unchecked: {
|
|
9908
|
-
"default": 'colors.brand.gray.200',
|
|
9909
|
-
disabled: 'colors.brand.gray.300',
|
|
9910
|
-
negative: 'colors.feedback.background.negative.lowContrast'
|
|
9911
|
-
},
|
|
9912
|
-
checked: {
|
|
9913
|
-
"default": 'colors.brand.gray.200',
|
|
9914
|
-
disabled: 'colors.brand.gray.400',
|
|
9915
|
-
negative: 'colors.feedback.background.negative.highContrast'
|
|
9916
|
-
}
|
|
9917
|
-
};
|
|
9918
|
-
|
|
9919
10087
|
var RadioIcon = function RadioIcon(_ref2) {
|
|
9920
10088
|
var isChecked = _ref2.isChecked,
|
|
9921
10089
|
isDisabled = _ref2.isDisabled,
|
|
9922
|
-
isNegative = _ref2.isNegative
|
|
10090
|
+
isNegative = _ref2.isNegative,
|
|
10091
|
+
size = _ref2.size;
|
|
9923
10092
|
|
|
9924
10093
|
var _useTheme = useTheme(),
|
|
9925
10094
|
theme = _useTheme.theme;
|
|
@@ -9929,8 +10098,9 @@ var RadioIcon = function RadioIcon(_ref2) {
|
|
|
9929
10098
|
var variant = 'default';
|
|
9930
10099
|
if (isDisabled) variant = 'disabled';
|
|
9931
10100
|
if (isNegative) variant = 'negative';
|
|
9932
|
-
var dotColor = get_1(theme, variants[
|
|
10101
|
+
var dotColor = get_1(theme, radioIconColors.variants[variant].dot[state]);
|
|
9933
10102
|
return /*#__PURE__*/jsx(RadioIconWrapper, {
|
|
10103
|
+
size: size,
|
|
9934
10104
|
isDisabled: isDisabled,
|
|
9935
10105
|
isNegative: isNegative,
|
|
9936
10106
|
isChecked: checked,
|
|
@@ -9941,6 +10111,7 @@ var RadioIcon = function RadioIcon(_ref2) {
|
|
|
9941
10111
|
display: 'flex'
|
|
9942
10112
|
},
|
|
9943
10113
|
children: /*#__PURE__*/jsx(CheckedIcon, {
|
|
10114
|
+
size: size,
|
|
9944
10115
|
color: dotColor
|
|
9945
10116
|
})
|
|
9946
10117
|
})
|
|
@@ -9959,12 +10130,14 @@ var useRadioGroupContext = function useRadioGroupContext() {
|
|
|
9959
10130
|
/* eslint-disable @typescript-eslint/no-shadow */
|
|
9960
10131
|
|
|
9961
10132
|
var Radio = function Radio(_ref) {
|
|
9962
|
-
var _groupProps$state;
|
|
10133
|
+
var _groupProps$state, _groupProps$size;
|
|
9963
10134
|
|
|
9964
10135
|
var value = _ref.value,
|
|
9965
10136
|
children = _ref.children,
|
|
9966
10137
|
helpText = _ref.helpText,
|
|
9967
|
-
isDisabled = _ref.isDisabled
|
|
10138
|
+
isDisabled = _ref.isDisabled,
|
|
10139
|
+
_ref$size = _ref.size,
|
|
10140
|
+
size = _ref$size === void 0 ? 'medium' : _ref$size;
|
|
9968
10141
|
var groupProps = useRadioGroupContext();
|
|
9969
10142
|
var isInsideGroup = !isEmpty_1(groupProps);
|
|
9970
10143
|
|
|
@@ -9983,6 +10156,10 @@ var Radio = function Radio(_ref) {
|
|
|
9983
10156
|
var showHelpText = !hasError && helpText;
|
|
9984
10157
|
var isReactNative = getPlatformType() === 'react-native';
|
|
9985
10158
|
|
|
10159
|
+
var _size = (_groupProps$size = groupProps.size) !== null && _groupProps$size !== void 0 ? _groupProps$size : size;
|
|
10160
|
+
|
|
10161
|
+
var isSmall = _size === 'small';
|
|
10162
|
+
|
|
9986
10163
|
var handleChange = function handleChange(_ref2) {
|
|
9987
10164
|
var isChecked = _ref2.isChecked,
|
|
9988
10165
|
value = _ref2.value;
|
|
@@ -10023,19 +10200,22 @@ var Radio = function Radio(_ref) {
|
|
|
10023
10200
|
flexDirection: "row",
|
|
10024
10201
|
children: [/*#__PURE__*/jsx(SelectorInput, {
|
|
10025
10202
|
isChecked: state.isChecked,
|
|
10026
|
-
isDisabled:
|
|
10203
|
+
isDisabled: _isDisabled,
|
|
10027
10204
|
isNegative: hasError // TODO: rename to hasError
|
|
10028
10205
|
,
|
|
10029
10206
|
inputProps: inputProps
|
|
10030
10207
|
}), /*#__PURE__*/jsx(RadioIcon, {
|
|
10208
|
+
size: _size,
|
|
10031
10209
|
isChecked: state.isChecked,
|
|
10032
10210
|
isDisabled: _isDisabled,
|
|
10033
10211
|
isNegative: hasError
|
|
10034
10212
|
}), /*#__PURE__*/jsx(SelectorTitle, {
|
|
10213
|
+
size: _size,
|
|
10214
|
+
isDisabled: _isDisabled,
|
|
10035
10215
|
children: children
|
|
10036
10216
|
})]
|
|
10037
10217
|
}), /*#__PURE__*/jsx(Box, {
|
|
10038
|
-
marginLeft:
|
|
10218
|
+
marginLeft: isSmall ? 'spacing.6' : 'spacing.7',
|
|
10039
10219
|
children: showHelpText && /*#__PURE__*/jsx(SelectorSupportText, {
|
|
10040
10220
|
id: ids === null || ids === void 0 ? void 0 : ids.helpTextId,
|
|
10041
10221
|
children: helpText
|
|
@@ -10053,7 +10233,8 @@ var useRadioGroup = function useRadioGroup(_ref) {
|
|
|
10053
10233
|
_onChange = _ref.onChange,
|
|
10054
10234
|
validationState = _ref.validationState,
|
|
10055
10235
|
necessityIndicator = _ref.necessityIndicator,
|
|
10056
|
-
name = _ref.name
|
|
10236
|
+
name = _ref.name,
|
|
10237
|
+
size = _ref.size;
|
|
10057
10238
|
|
|
10058
10239
|
var _useTheme = useTheme(),
|
|
10059
10240
|
platform = _useTheme.platform;
|
|
@@ -10118,9 +10299,10 @@ var useRadioGroup = function useRadioGroup(_ref) {
|
|
|
10118
10299
|
isDisabled: isDisabled,
|
|
10119
10300
|
labelPosition: platform === 'onMobile' ? 'top' : labelPosition,
|
|
10120
10301
|
name: fallbackName,
|
|
10121
|
-
state: state
|
|
10302
|
+
state: state,
|
|
10303
|
+
size: size
|
|
10122
10304
|
};
|
|
10123
|
-
}, [validationState, isDisabled, platform, labelPosition, state, fallbackName, necessityIndicator]);
|
|
10305
|
+
}, [validationState, isDisabled, platform, labelPosition, state, fallbackName, necessityIndicator, size]);
|
|
10124
10306
|
return {
|
|
10125
10307
|
state: state,
|
|
10126
10308
|
contextValue: contextValue,
|
|
@@ -10131,7 +10313,7 @@ var useRadioGroup = function useRadioGroup(_ref) {
|
|
|
10131
10313
|
};
|
|
10132
10314
|
|
|
10133
10315
|
var RadioGroup = function RadioGroup(_ref) {
|
|
10134
|
-
var _context;
|
|
10316
|
+
var _context, _context2;
|
|
10135
10317
|
|
|
10136
10318
|
var children = _ref.children,
|
|
10137
10319
|
label = _ref.label,
|
|
@@ -10148,7 +10330,9 @@ var RadioGroup = function RadioGroup(_ref) {
|
|
|
10148
10330
|
name = _ref.name,
|
|
10149
10331
|
defaultValue = _ref.defaultValue,
|
|
10150
10332
|
onChange = _ref.onChange,
|
|
10151
|
-
value = _ref.value
|
|
10333
|
+
value = _ref.value,
|
|
10334
|
+
_ref$size = _ref.size,
|
|
10335
|
+
size = _ref$size === void 0 ? 'medium' : _ref$size;
|
|
10152
10336
|
|
|
10153
10337
|
var _useRadioGroup = useRadioGroup({
|
|
10154
10338
|
defaultValue: defaultValue,
|
|
@@ -10157,17 +10341,28 @@ var RadioGroup = function RadioGroup(_ref) {
|
|
|
10157
10341
|
name: name,
|
|
10158
10342
|
onChange: onChange,
|
|
10159
10343
|
validationState: validationState,
|
|
10160
|
-
value: value
|
|
10344
|
+
value: value,
|
|
10345
|
+
size: size
|
|
10161
10346
|
}),
|
|
10162
10347
|
contextValue = _useRadioGroup.contextValue,
|
|
10163
10348
|
ids = _useRadioGroup.ids;
|
|
10164
10349
|
|
|
10350
|
+
var _useTheme = useTheme(),
|
|
10351
|
+
theme = _useTheme.theme;
|
|
10352
|
+
|
|
10353
|
+
var _useBreakpoint = useBreakpoint({
|
|
10354
|
+
breakpoints: theme.breakpoints
|
|
10355
|
+
}),
|
|
10356
|
+
matchedDeviceType = _useBreakpoint.matchedDeviceType;
|
|
10357
|
+
|
|
10165
10358
|
var showError = validationState === 'error' && errorText;
|
|
10166
10359
|
var showHelpText = !showError && helpText;
|
|
10167
10360
|
|
|
10168
10361
|
var accessibilityText = _concatInstanceProperty(_context = ",".concat(showError ? errorText : '', " ")).call(_context, showHelpText ? helpText : '');
|
|
10169
10362
|
|
|
10170
10363
|
var isReactNative = getPlatformType() === 'react-native';
|
|
10364
|
+
var gap = radioSizes.group.gap[size][matchedDeviceType];
|
|
10365
|
+
var childCount = React__default.Children.count(children);
|
|
10171
10366
|
return /*#__PURE__*/jsx(RadioGroupProvider, {
|
|
10172
10367
|
value: contextValue,
|
|
10173
10368
|
children: /*#__PURE__*/jsxs(SelectorGroupField, {
|
|
@@ -10185,8 +10380,12 @@ var RadioGroup = function RadioGroup(_ref) {
|
|
|
10185
10380
|
children: [/*#__PURE__*/jsx(Box, {
|
|
10186
10381
|
display: "flex",
|
|
10187
10382
|
flexDirection: "column",
|
|
10188
|
-
|
|
10189
|
-
|
|
10383
|
+
children: _mapInstanceProperty(_context2 = React__default.Children).call(_context2, children, function (child, index) {
|
|
10384
|
+
return /*#__PURE__*/jsx(Box, {
|
|
10385
|
+
marginBottom: index === childCount - 1 ? 0 : gap,
|
|
10386
|
+
children: child
|
|
10387
|
+
}, index);
|
|
10388
|
+
})
|
|
10190
10389
|
}), /*#__PURE__*/jsx(FormHint, {
|
|
10191
10390
|
type: validationState === 'error' ? 'error' : 'help',
|
|
10192
10391
|
errorText: errorText,
|
|
@@ -10261,5 +10460,5 @@ var SkipNavContent = function SkipNavContent(_ref3) {
|
|
|
10261
10460
|
}, testID('skipnav-content')));
|
|
10262
10461
|
};
|
|
10263
10462
|
|
|
10264
|
-
export { Alert, AlertTriangleIcon as AlertOctagonIcon, AlertTriangleIcon$1 as AlertTriangleIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, ArrowUpRightIcon, Badge, BladeProvider, Button, CheckCircleIcon, CheckIcon, Checkbox, CheckboxGroup, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CloseIcon, Code, CreditCardIcon, DollarIcon, DownloadIcon, EditIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, Heading, HelpCircleIcon, HistoryIcon, HomeIcon, InfoIcon, Link, MinusIcon, OTPInput, PasswordInput, PauseIcon, PlusIcon, Radio, RadioGroup, RefreshLeftIcon, RotateCounterClockWiseIcon, RupeeIcon, SearchIcon, SkipNavContent, SkipNavLink, Spinner, Text, TextArea, TextInput, Title, TrashIcon, TrendingDownIcon, TrendingUpIcon, VisuallyHidden, announce, clearAnnouncer, destroyAnnouncer, getTextProps, screenReaderStyles, useTheme };
|
|
10463
|
+
export { Alert, AlertTriangleIcon as AlertOctagonIcon, AlertTriangleIcon$1 as AlertTriangleIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, ArrowUpRightIcon, Badge, BladeProvider, Button, CheckCircleIcon, CheckIcon, Checkbox, CheckboxGroup, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CloseIcon, Code, CreditCardIcon, DollarIcon, DownloadIcon, EditIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, Heading, HelpCircleIcon, HistoryIcon, HomeIcon, InfoIcon, Link, LinkIcon, MinusIcon, OTPInput, PasswordInput, PauseIcon, PlusIcon, Radio, RadioGroup, RefreshLeftIcon, RotateCounterClockWiseIcon, RupeeIcon, SearchIcon, SkipNavContent, SkipNavLink, Spinner, Text, TextArea, TextInput, Title, TrashIcon, TrendingDownIcon, TrendingUpIcon, VisuallyHidden, announce, clearAnnouncer, destroyAnnouncer, getTextProps, screenReaderStyles, useTheme };
|
|
10265
10464
|
//# sourceMappingURL=index.web.js.map
|