@razorpay/blade 5.4.3 → 5.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 +15 -0
- package/build/components/index.d.ts +23 -7
- package/build/components/index.native.d.ts +23 -7
- package/build/components/index.native.js +23 -7
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.web.js +255 -17
- package/build/components/index.web.js.map +1 -1
- package/build/css/bankingThemeDarkDesktop.css +1 -1
- package/build/css/bankingThemeDarkMobile.css +1 -1
- package/build/css/bankingThemeLightDesktop.css +1 -1
- package/build/css/bankingThemeLightMobile.css +1 -1
- package/build/css/paymentThemeDarkDesktop.css +1 -1
- package/build/css/paymentThemeDarkMobile.css +1 -1
- package/build/css/paymentThemeLightDesktop.css +1 -1
- package/build/css/paymentThemeLightMobile.css +1 -1
- package/package.json +1 -1
|
@@ -4128,6 +4128,35 @@ var ChevronUpIcon = function ChevronUpIcon(_ref) {
|
|
|
4128
4128
|
});
|
|
4129
4129
|
};
|
|
4130
4130
|
|
|
4131
|
+
var ClockIcon = function ClockIcon(_ref) {
|
|
4132
|
+
var size = _ref.size,
|
|
4133
|
+
color = _ref.color;
|
|
4134
|
+
|
|
4135
|
+
var _useIconProps = useIconProps({
|
|
4136
|
+
size: size,
|
|
4137
|
+
color: color
|
|
4138
|
+
}),
|
|
4139
|
+
height = _useIconProps.height,
|
|
4140
|
+
width = _useIconProps.width,
|
|
4141
|
+
iconColor = _useIconProps.iconColor;
|
|
4142
|
+
|
|
4143
|
+
return /*#__PURE__*/jsxs(Svg, {
|
|
4144
|
+
height: height,
|
|
4145
|
+
width: width,
|
|
4146
|
+
viewBox: "0 0 24 24",
|
|
4147
|
+
fill: "none",
|
|
4148
|
+
children: [/*#__PURE__*/jsx(Path, {
|
|
4149
|
+
d: "M13 6a1 1 0 1 0-2 0v6a1 1 0 0 0 .293.707l3 3a1 1 0 0 0 1.414-1.414L13 11.586V6Z",
|
|
4150
|
+
fill: iconColor
|
|
4151
|
+
}), /*#__PURE__*/jsx(Path, {
|
|
4152
|
+
fillRule: "evenodd",
|
|
4153
|
+
clipRule: "evenodd",
|
|
4154
|
+
d: "M12 1C5.925 1 1 5.925 1 12s4.925 11 11 11 11-4.925 11-11S18.075 1 12 1ZM3 12a9 9 0 1 1 18 0 9 9 0 0 1-18 0Z",
|
|
4155
|
+
fill: iconColor
|
|
4156
|
+
})]
|
|
4157
|
+
});
|
|
4158
|
+
};
|
|
4159
|
+
|
|
4131
4160
|
var CloseIcon = function CloseIcon(_ref) {
|
|
4132
4161
|
var size = _ref.size,
|
|
4133
4162
|
color = _ref.color;
|
|
@@ -4647,6 +4676,30 @@ var SlashIcon = function SlashIcon(_ref) {
|
|
|
4647
4676
|
});
|
|
4648
4677
|
};
|
|
4649
4678
|
|
|
4679
|
+
var BankIcon = function BankIcon(_ref) {
|
|
4680
|
+
var size = _ref.size,
|
|
4681
|
+
color = _ref.color;
|
|
4682
|
+
|
|
4683
|
+
var _useIconProps = useIconProps({
|
|
4684
|
+
size: size,
|
|
4685
|
+
color: color
|
|
4686
|
+
}),
|
|
4687
|
+
height = _useIconProps.height,
|
|
4688
|
+
width = _useIconProps.width,
|
|
4689
|
+
iconColor = _useIconProps.iconColor;
|
|
4690
|
+
|
|
4691
|
+
return /*#__PURE__*/jsx(Svg, {
|
|
4692
|
+
height: height,
|
|
4693
|
+
width: width,
|
|
4694
|
+
viewBox: "0 0 24 24",
|
|
4695
|
+
fill: "none",
|
|
4696
|
+
children: /*#__PURE__*/jsx(Path, {
|
|
4697
|
+
d: "M5.105 10.429a1 1 0 0 0-1 1v5.333a1 1 0 0 0 1 1h1.158a1 1 0 0 0 1-1v-5.333a1 1 0 0 0-1-1H5.105Zm6.316 0a1 1 0 0 0-1 1v5.333a1 1 0 0 0 1 1h1.158a1 1 0 0 0 1-1v-5.333a1 1 0 0 0-1-1H11.42ZM2 22a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1v-1.143a1 1 0 0 0-1-1H3a1 1 0 0 0-1 1V22Zm15.737-11.571a1 1 0 0 0-1 1v5.333a1 1 0 0 0 1 1h1.158a1 1 0 0 0 1-1v-5.333a1 1 0 0 0-1-1h-1.158Zm-5.273-9.186a1 1 0 0 0-.928 0l-9 4.714A1 1 0 0 0 2 6.843v.49a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1v-.49a1 1 0 0 0-.536-.886l-9-4.714Z",
|
|
4698
|
+
fill: iconColor
|
|
4699
|
+
})
|
|
4700
|
+
});
|
|
4701
|
+
};
|
|
4702
|
+
|
|
4650
4703
|
var TrashIcon = function TrashIcon(_ref) {
|
|
4651
4704
|
var size = _ref.size,
|
|
4652
4705
|
color = _ref.color;
|
|
@@ -5043,6 +5096,162 @@ var MailIcon = function MailIcon(_ref) {
|
|
|
5043
5096
|
});
|
|
5044
5097
|
};
|
|
5045
5098
|
|
|
5099
|
+
var BookIcon = function BookIcon(_ref) {
|
|
5100
|
+
var size = _ref.size,
|
|
5101
|
+
color = _ref.color;
|
|
5102
|
+
|
|
5103
|
+
var _useIconProps = useIconProps({
|
|
5104
|
+
size: size,
|
|
5105
|
+
color: color
|
|
5106
|
+
}),
|
|
5107
|
+
height = _useIconProps.height,
|
|
5108
|
+
width = _useIconProps.width,
|
|
5109
|
+
iconColor = _useIconProps.iconColor;
|
|
5110
|
+
|
|
5111
|
+
return /*#__PURE__*/jsx(Svg, {
|
|
5112
|
+
width: width,
|
|
5113
|
+
height: height,
|
|
5114
|
+
viewBox: "0 0 24 24",
|
|
5115
|
+
fill: "none",
|
|
5116
|
+
children: /*#__PURE__*/jsx(Path, {
|
|
5117
|
+
fillRule: "evenodd",
|
|
5118
|
+
clipRule: "evenodd",
|
|
5119
|
+
d: "M21 2a1 1 0 0 0-1-1H6.5A3.5 3.5 0 0 0 3 4.5v15A3.5 3.5 0 0 0 6.5 23H20a1 1 0 0 0 1-1V2ZM5 4.5A1.5 1.5 0 0 1 6.5 3H19v13H6.5c-.537 0-1.045.12-1.5.337V4.5Zm0 15A1.5 1.5 0 0 0 6.5 21H19v-3H6.5A1.5 1.5 0 0 0 5 19.5Z",
|
|
5120
|
+
fill: iconColor
|
|
5121
|
+
})
|
|
5122
|
+
});
|
|
5123
|
+
};
|
|
5124
|
+
|
|
5125
|
+
var SettlementsIcon = function SettlementsIcon(_ref) {
|
|
5126
|
+
var size = _ref.size,
|
|
5127
|
+
color = _ref.color;
|
|
5128
|
+
|
|
5129
|
+
var _useIconProps = useIconProps({
|
|
5130
|
+
size: size,
|
|
5131
|
+
color: color
|
|
5132
|
+
}),
|
|
5133
|
+
height = _useIconProps.height,
|
|
5134
|
+
width = _useIconProps.width,
|
|
5135
|
+
iconColor = _useIconProps.iconColor;
|
|
5136
|
+
|
|
5137
|
+
return /*#__PURE__*/jsx(Svg, {
|
|
5138
|
+
width: width,
|
|
5139
|
+
height: height,
|
|
5140
|
+
fill: "none",
|
|
5141
|
+
viewBox: "0 0 24 24",
|
|
5142
|
+
children: /*#__PURE__*/jsx(Path, {
|
|
5143
|
+
d: "m22.763 7.879-7.797 9.697c-.097.118-.22.216-.362.29a1.283 1.283 0 0 1-.461.134h-.11c-.293 0-.575-.099-.79-.276l-3.58-2.957-2.054 2.582a1.059 1.059 0 0 1-.357.302c-.142.075-.302.12-.467.132h-.11c-.29.004-.57-.095-.779-.276l-4.502-3.705a1.01 1.01 0 0 1-.281-.321.906.906 0 0 1-.036-.798.984.984 0 0 1 .25-.34 1.09 1.09 0 0 1 .358-.252 1.2 1.2 0 0 1 1.268.193l3.558 2.907 7.006-8.742c.083-.115.192-.213.32-.288a1.22 1.22 0 0 1 .877-.13c.148.035.286.097.406.182.13.075.241.173.326.289a.928.928 0 0 1 .166.383.887.887 0 0 1-.022.41.95.95 0 0 1-.207.367l-4.392 5.41 2.833 2.346 7.072-8.752a1.05 1.05 0 0 1 .322-.286 1.22 1.22 0 0 1 .876-.124c.148.035.286.098.405.184.129.074.238.172.322.287a.93.93 0 0 1 .164.38.887.887 0 0 1-.02.407.949.949 0 0 1-.202.365Z",
|
|
5144
|
+
fill: iconColor
|
|
5145
|
+
})
|
|
5146
|
+
});
|
|
5147
|
+
};
|
|
5148
|
+
|
|
5149
|
+
var ShuffleIcon = function ShuffleIcon(_ref) {
|
|
5150
|
+
var size = _ref.size,
|
|
5151
|
+
color = _ref.color;
|
|
5152
|
+
|
|
5153
|
+
var _useIconProps = useIconProps({
|
|
5154
|
+
size: size,
|
|
5155
|
+
color: color
|
|
5156
|
+
}),
|
|
5157
|
+
height = _useIconProps.height,
|
|
5158
|
+
width = _useIconProps.width,
|
|
5159
|
+
iconColor = _useIconProps.iconColor;
|
|
5160
|
+
|
|
5161
|
+
return /*#__PURE__*/jsx(Svg, {
|
|
5162
|
+
width: width,
|
|
5163
|
+
height: height,
|
|
5164
|
+
fill: "none",
|
|
5165
|
+
viewBox: "0 0 24 24",
|
|
5166
|
+
children: /*#__PURE__*/jsx(Path, {
|
|
5167
|
+
d: "M14 3a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0V5.414L3.707 20.707a1 1 0 0 1-1.414-1.414L17.586 4H15a1 1 0 0 1-1-1ZM21 16a1 1 0 1 0-2 0v2.586l-4.293-4.293a1 1 0 0 0-1.414 1.414L17.586 20H15a1 1 0 1 0 0 2h5a1 1 0 0 0 1-1v-5ZM3.707 3.293a1 1 0 0 0-1.414 1.414l5 5a1 1 0 0 0 1.414-1.414l-5-5Z",
|
|
5168
|
+
fill: iconColor
|
|
5169
|
+
})
|
|
5170
|
+
});
|
|
5171
|
+
};
|
|
5172
|
+
|
|
5173
|
+
var TagIcon = function TagIcon(_ref) {
|
|
5174
|
+
var size = _ref.size,
|
|
5175
|
+
color = _ref.color;
|
|
5176
|
+
|
|
5177
|
+
var _useIconProps = useIconProps({
|
|
5178
|
+
size: size,
|
|
5179
|
+
color: color
|
|
5180
|
+
}),
|
|
5181
|
+
height = _useIconProps.height,
|
|
5182
|
+
width = _useIconProps.width,
|
|
5183
|
+
iconColor = _useIconProps.iconColor;
|
|
5184
|
+
|
|
5185
|
+
return /*#__PURE__*/jsxs(Svg, {
|
|
5186
|
+
width: width,
|
|
5187
|
+
height: height,
|
|
5188
|
+
fill: "none",
|
|
5189
|
+
viewBox: "0 0 24 24",
|
|
5190
|
+
children: [/*#__PURE__*/jsx(Path, {
|
|
5191
|
+
fillRule: "evenodd",
|
|
5192
|
+
clipRule: "evenodd",
|
|
5193
|
+
d: "M1 2a1 1 0 0 1 1-1h10a1 1 0 0 1 .707.293L21.3 9.885a3 3 0 0 1 0 4.23l-.002.002-7.17 7.17a3.001 3.001 0 0 1-4.244 0l-8.59-8.58A1 1 0 0 1 1 12V2Zm2 1v8.585l8.297 8.287v.001a1 1 0 0 0 1.415 0l7.169-7.168a1 1 0 0 0 0-1.41L11.586 3H3Z",
|
|
5194
|
+
fill: iconColor
|
|
5195
|
+
}), /*#__PURE__*/jsx(Path, {
|
|
5196
|
+
d: "M10 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z",
|
|
5197
|
+
fill: iconColor
|
|
5198
|
+
})]
|
|
5199
|
+
});
|
|
5200
|
+
};
|
|
5201
|
+
|
|
5202
|
+
var UserIcon = function UserIcon(_ref) {
|
|
5203
|
+
var size = _ref.size,
|
|
5204
|
+
color = _ref.color;
|
|
5205
|
+
|
|
5206
|
+
var _useIconProps = useIconProps({
|
|
5207
|
+
size: size,
|
|
5208
|
+
color: color
|
|
5209
|
+
}),
|
|
5210
|
+
height = _useIconProps.height,
|
|
5211
|
+
width = _useIconProps.width,
|
|
5212
|
+
iconColor = _useIconProps.iconColor;
|
|
5213
|
+
|
|
5214
|
+
return /*#__PURE__*/jsxs(Svg, {
|
|
5215
|
+
width: width,
|
|
5216
|
+
height: height,
|
|
5217
|
+
fill: "none",
|
|
5218
|
+
viewBox: "0 0 24 24",
|
|
5219
|
+
children: [/*#__PURE__*/jsx(Path, {
|
|
5220
|
+
fillRule: "evenodd",
|
|
5221
|
+
clipRule: "evenodd",
|
|
5222
|
+
d: "M12 2a5 5 0 1 0 0 10 5 5 0 0 0 0-10ZM9 7a3 3 0 1 1 6 0 3 3 0 0 1-6 0Z",
|
|
5223
|
+
fill: iconColor
|
|
5224
|
+
}), /*#__PURE__*/jsx(Path, {
|
|
5225
|
+
d: "M8 14a5 5 0 0 0-5 5v2a1 1 0 1 0 2 0v-2a3 3 0 0 1 3-3h8a3 3 0 0 1 3 3v2a1 1 0 1 0 2 0v-2a5 5 0 0 0-5-5H8Z",
|
|
5226
|
+
fill: iconColor
|
|
5227
|
+
})]
|
|
5228
|
+
});
|
|
5229
|
+
};
|
|
5230
|
+
|
|
5231
|
+
var TransactionsIcon = function TransactionsIcon(_ref) {
|
|
5232
|
+
var size = _ref.size,
|
|
5233
|
+
color = _ref.color;
|
|
5234
|
+
|
|
5235
|
+
var _useIconProps = useIconProps({
|
|
5236
|
+
size: size,
|
|
5237
|
+
color: color
|
|
5238
|
+
}),
|
|
5239
|
+
height = _useIconProps.height,
|
|
5240
|
+
width = _useIconProps.width,
|
|
5241
|
+
iconColor = _useIconProps.iconColor;
|
|
5242
|
+
|
|
5243
|
+
return /*#__PURE__*/jsx(Svg, {
|
|
5244
|
+
width: width,
|
|
5245
|
+
height: height,
|
|
5246
|
+
fill: "none",
|
|
5247
|
+
viewBox: "0 0 24 24",
|
|
5248
|
+
children: /*#__PURE__*/jsx(Path, {
|
|
5249
|
+
d: "M6.24 12.03a.878.878 0 0 1 .26.623.898.898 0 0 1-.249.627.85.85 0 0 1-.61.257.833.833 0 0 1-.606-.268L1.25 9.377a.869.869 0 0 1-.107-.134c-.014-.022-.024-.044-.036-.067a.853.853 0 0 1-.042-.084.843.843 0 0 1-.027-.087c-.007-.026-.017-.05-.022-.076a.91.91 0 0 1 0-.343c.005-.026.015-.05.022-.075a.812.812 0 0 1 .027-.087.91.91 0 0 1 .042-.085c.012-.022.022-.043.036-.066a.895.895 0 0 1 .107-.135l3.785-3.892a.84.84 0 0 1 .6-.246.84.84 0 0 1 .595.257.89.89 0 0 1 .01 1.228L3.91 7.883h9.715a.84.84 0 0 1 .602.256c.16.164.25.387.25.62 0 .232-.09.455-.25.62a.84.84 0 0 1-.602.256H3.909l2.332 2.395Zm16.617 3.674c.014-.022.024-.044.035-.067a.896.896 0 0 0 .043-.084.806.806 0 0 0 .027-.088c.007-.024.017-.049.022-.074a.912.912 0 0 0 0-.344c-.005-.026-.015-.05-.022-.075a.836.836 0 0 0-.027-.088.843.843 0 0 0-.043-.083c-.011-.023-.021-.044-.035-.067a.87.87 0 0 0-.107-.134l-3.785-3.893a.84.84 0 0 0-1.195.011.889.889 0 0 0-.25.612.89.89 0 0 0 .24.616l2.33 2.397h-9.715a.84.84 0 0 0-.602.257.889.889 0 0 0-.25.62c0 .232.09.455.25.62a.84.84 0 0 0 .602.256h9.716l-2.332 2.397a.877.877 0 0 0-.26.623.898.898 0 0 0 .25.627.85.85 0 0 0 .61.257.833.833 0 0 0 .605-.267l3.786-3.893a.894.894 0 0 0 .107-.134v-.002Z",
|
|
5250
|
+
fill: iconColor
|
|
5251
|
+
})
|
|
5252
|
+
});
|
|
5253
|
+
};
|
|
5254
|
+
|
|
5046
5255
|
function ownKeys$C(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; }
|
|
5047
5256
|
|
|
5048
5257
|
function _objectSpread$C(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$C(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$C(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -5517,7 +5726,16 @@ var getTextProps = function getTextProps(_ref) {
|
|
|
5517
5726
|
props.fontSize = 75;
|
|
5518
5727
|
props.lineHeight = 's';
|
|
5519
5728
|
}
|
|
5729
|
+
|
|
5730
|
+
if (size === 'xsmall') {
|
|
5731
|
+
props.fontSize = 25;
|
|
5732
|
+
props.lineHeight = 's';
|
|
5733
|
+
}
|
|
5520
5734
|
} else if (variant === 'caption') {
|
|
5735
|
+
if (size === 'xsmall') {
|
|
5736
|
+
throw new Error("[Blade: Text]: size cannot be 'xsmall' when variant is 'caption'");
|
|
5737
|
+
}
|
|
5738
|
+
|
|
5521
5739
|
if (size === 'small') {
|
|
5522
5740
|
throw new Error("[Blade: Text]: size cannot be 'small' when variant is 'caption'");
|
|
5523
5741
|
}
|
|
@@ -6009,7 +6227,7 @@ var getColor = function getColor(_ref) {
|
|
|
6009
6227
|
} else if (contrast == 'low') {
|
|
6010
6228
|
return get_1(theme.colors, 'brand.gray.700.lowContrast');
|
|
6011
6229
|
} else {
|
|
6012
|
-
return get_1(theme.colors, 'brand.gray.
|
|
6230
|
+
return get_1(theme.colors, 'brand.gray.700.highContrast');
|
|
6013
6231
|
}
|
|
6014
6232
|
};
|
|
6015
6233
|
|
|
@@ -6976,6 +7194,20 @@ var Badge = function Badge(_ref2) {
|
|
|
6976
7194
|
iconColor = _getColorProps.iconColor,
|
|
6977
7195
|
textColor = _getColorProps.textColor;
|
|
6978
7196
|
|
|
7197
|
+
var badgeTextSizes = {
|
|
7198
|
+
small: {
|
|
7199
|
+
variant: 'body',
|
|
7200
|
+
size: 'xsmall'
|
|
7201
|
+
},
|
|
7202
|
+
medium: {
|
|
7203
|
+
variant: 'body',
|
|
7204
|
+
size: 'small'
|
|
7205
|
+
},
|
|
7206
|
+
large: {
|
|
7207
|
+
variant: 'body',
|
|
7208
|
+
size: 'small'
|
|
7209
|
+
}
|
|
7210
|
+
};
|
|
6979
7211
|
return /*#__PURE__*/jsx(StyledBadge, _objectSpread$p(_objectSpread$p({
|
|
6980
7212
|
backgroundColor: backgroundColor,
|
|
6981
7213
|
size: size
|
|
@@ -6997,12 +7229,7 @@ var Badge = function Badge(_ref2) {
|
|
|
6997
7229
|
color: iconColor,
|
|
6998
7230
|
size: iconSize[size]
|
|
6999
7231
|
})
|
|
7000
|
-
}) : null, /*#__PURE__*/jsx(Text, _objectSpread$p(_objectSpread$p({}, size
|
|
7001
|
-
variant: 'caption'
|
|
7002
|
-
} : {
|
|
7003
|
-
variant: 'body',
|
|
7004
|
-
size: 'small'
|
|
7005
|
-
}), {}, {
|
|
7232
|
+
}) : null, /*#__PURE__*/jsx(Text, _objectSpread$p(_objectSpread$p({}, badgeTextSizes[size]), {}, {
|
|
7006
7233
|
type: "normal",
|
|
7007
7234
|
weight: fontWeight,
|
|
7008
7235
|
truncateAfterLines: 1,
|
|
@@ -7291,9 +7518,10 @@ var Counter = function Counter(_ref2) {
|
|
|
7291
7518
|
backgroundColor = _getColorProps.backgroundColor,
|
|
7292
7519
|
textColor = _getColorProps.textColor;
|
|
7293
7520
|
|
|
7294
|
-
var
|
|
7521
|
+
var counterTextSizes = {
|
|
7295
7522
|
small: {
|
|
7296
|
-
variant: '
|
|
7523
|
+
variant: 'body',
|
|
7524
|
+
size: 'xsmall'
|
|
7297
7525
|
},
|
|
7298
7526
|
medium: {
|
|
7299
7527
|
variant: 'body',
|
|
@@ -7319,7 +7547,7 @@ var Counter = function Counter(_ref2) {
|
|
|
7319
7547
|
alignItems: "center",
|
|
7320
7548
|
overflow: "hidden"
|
|
7321
7549
|
}, metaAttribute(MetaConstants.Component, MetaConstants.Counter)), {}, {
|
|
7322
|
-
children: /*#__PURE__*/jsx(Text, _objectSpread$k(_objectSpread$k({},
|
|
7550
|
+
children: /*#__PURE__*/jsx(Text, _objectSpread$k(_objectSpread$k({}, counterTextSizes[size]), {}, {
|
|
7323
7551
|
type: "normal",
|
|
7324
7552
|
weight: "regular",
|
|
7325
7553
|
truncateAfterLines: 1,
|
|
@@ -9722,8 +9950,6 @@ var isReactNative$2 = function isReactNative(_textInputRef) {
|
|
|
9722
9950
|
};
|
|
9723
9951
|
|
|
9724
9952
|
var TextInput = function TextInput(_ref2) {
|
|
9725
|
-
var _Boolean;
|
|
9726
|
-
|
|
9727
9953
|
var label = _ref2.label,
|
|
9728
9954
|
_ref2$labelPosition = _ref2.labelPosition,
|
|
9729
9955
|
labelPosition = _ref2$labelPosition === void 0 ? 'top' : _ref2$labelPosition,
|
|
@@ -9735,6 +9961,7 @@ var TextInput = function TextInput(_ref2) {
|
|
|
9735
9961
|
value = _ref2.value,
|
|
9736
9962
|
maxCharacters = _ref2.maxCharacters,
|
|
9737
9963
|
_onChange = _ref2.onChange,
|
|
9964
|
+
onFocus = _ref2.onFocus,
|
|
9738
9965
|
onBlur = _ref2.onBlur,
|
|
9739
9966
|
isDisabled = _ref2.isDisabled,
|
|
9740
9967
|
necessityIndicator = _ref2.necessityIndicator,
|
|
@@ -9754,11 +9981,15 @@ var TextInput = function TextInput(_ref2) {
|
|
|
9754
9981
|
autoCompleteSuggestionType = _ref2.autoCompleteSuggestionType;
|
|
9755
9982
|
var textInputRef = React__default.useRef(null);
|
|
9756
9983
|
|
|
9757
|
-
var _useState = useState(
|
|
9984
|
+
var _useState = useState(false),
|
|
9758
9985
|
_useState2 = _slicedToArray(_useState, 2),
|
|
9759
9986
|
shouldShowClearButton = _useState2[0],
|
|
9760
9987
|
setShouldShowClearButton = _useState2[1];
|
|
9761
9988
|
|
|
9989
|
+
React__default.useEffect(function () {
|
|
9990
|
+
setShouldShowClearButton(Boolean(showClearButton && (defaultValue !== null && defaultValue !== void 0 ? defaultValue : value)));
|
|
9991
|
+
}, [showClearButton, defaultValue, value]);
|
|
9992
|
+
|
|
9762
9993
|
var renderInteractionElement = function renderInteractionElement() {
|
|
9763
9994
|
if (isLoading) {
|
|
9764
9995
|
return /*#__PURE__*/jsx(Spinner, {
|
|
@@ -9826,6 +10057,7 @@ var TextInput = function TextInput(_ref2) {
|
|
|
9826
10057
|
value: value
|
|
9827
10058
|
});
|
|
9828
10059
|
},
|
|
10060
|
+
onFocus: onFocus,
|
|
9829
10061
|
onBlur: onBlur,
|
|
9830
10062
|
isDisabled: isDisabled,
|
|
9831
10063
|
necessityIndicator: necessityIndicator,
|
|
@@ -9975,8 +10207,9 @@ var TextArea = function TextArea(_ref) {
|
|
|
9975
10207
|
isDisabled = _ref.isDisabled,
|
|
9976
10208
|
isRequired = _ref.isRequired,
|
|
9977
10209
|
name = _ref.name,
|
|
9978
|
-
onBlur = _ref.onBlur,
|
|
9979
10210
|
_onChange = _ref.onChange,
|
|
10211
|
+
onFocus = _ref.onFocus,
|
|
10212
|
+
onBlur = _ref.onBlur,
|
|
9980
10213
|
placeholder = _ref.placeholder,
|
|
9981
10214
|
value = _ref.value,
|
|
9982
10215
|
maxCharacters = _ref.maxCharacters,
|
|
@@ -9987,11 +10220,15 @@ var TextArea = function TextArea(_ref) {
|
|
|
9987
10220
|
numberOfLines = _ref$numberOfLines === void 0 ? 2 : _ref$numberOfLines;
|
|
9988
10221
|
var inputRef = React__default.useRef(null);
|
|
9989
10222
|
|
|
9990
|
-
var _React$useState = React__default.useState(
|
|
10223
|
+
var _React$useState = React__default.useState(false),
|
|
9991
10224
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
9992
10225
|
shouldShowClearButton = _React$useState2[0],
|
|
9993
10226
|
setShouldShowClearButton = _React$useState2[1];
|
|
9994
10227
|
|
|
10228
|
+
React__default.useEffect(function () {
|
|
10229
|
+
setShouldShowClearButton(Boolean(showClearButton && ((value === null || value === void 0 ? void 0 : value.length) || (defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.length))));
|
|
10230
|
+
}, [showClearButton, defaultValue, value]);
|
|
10231
|
+
|
|
9995
10232
|
var renderInteractionElement = function renderInteractionElement() {
|
|
9996
10233
|
if (shouldShowClearButton) {
|
|
9997
10234
|
return /*#__PURE__*/jsx(Box, {
|
|
@@ -10043,7 +10280,6 @@ var TextArea = function TextArea(_ref) {
|
|
|
10043
10280
|
isRequired: isRequired,
|
|
10044
10281
|
name: name,
|
|
10045
10282
|
maxCharacters: maxCharacters,
|
|
10046
|
-
onBlur: onBlur,
|
|
10047
10283
|
placeholder: placeholder,
|
|
10048
10284
|
interactionElement: renderInteractionElement(),
|
|
10049
10285
|
defaultValue: defaultValue,
|
|
@@ -10068,6 +10304,8 @@ var TextArea = function TextArea(_ref) {
|
|
|
10068
10304
|
value: value
|
|
10069
10305
|
});
|
|
10070
10306
|
},
|
|
10307
|
+
onFocus: onFocus,
|
|
10308
|
+
onBlur: onBlur,
|
|
10071
10309
|
trailingFooterSlot: function trailingFooterSlot(value) {
|
|
10072
10310
|
var _value$length;
|
|
10073
10311
|
|
|
@@ -11636,5 +11874,5 @@ var SkipNavContent = function SkipNavContent(_ref3) {
|
|
|
11636
11874
|
}, testID('skipnav-content')), metaAttribute(MetaConstants.Component, MetaConstants.SkipNav)));
|
|
11637
11875
|
};
|
|
11638
11876
|
|
|
11639
|
-
export { Alert, AlertTriangleIcon as AlertOctagonIcon, AlertTriangleIcon$1 as AlertTriangleIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, ArrowUpRightIcon, Badge, BladeProvider, Button, Card, CardBody, CardFooter, CardFooterLeading, CardFooterTrailing, CardHeader, CardHeaderBadge, CardHeaderCounter, CardHeaderIcon, CardHeaderIconButton, CardHeaderLeading, CardHeaderLink, CardHeaderText, CardHeaderTrailing, CheckCircleIcon, CheckIcon, Checkbox, CheckboxGroup, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CloseIcon, Code, ComponentIds, Counter, CreditCardIcon, DollarIcon, DownloadIcon, EditIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FileTextIcon, Heading, HelpCircleIcon, HistoryIcon, HomeIcon, IconButton, Indicator, InfoIcon, Link, LinkIcon, LockIcon, MailIcon, MinusIcon, OTPInput, PasswordInput, PauseIcon, PlusIcon, ProgressBar, Radio, RadioGroup, RefreshLeftIcon, RotateCounterClockWiseIcon, RupeeIcon, SearchIcon, SettingsIcon, SkipNavContent, SkipNavLink, SlashIcon, Spinner, Text, TextArea, TextInput, Title, TrashIcon, TrendingDownIcon, TrendingUpIcon, UsersIcon, VisuallyHidden, announce, clearAnnouncer, destroyAnnouncer, getTextProps, screenReaderStyles, useTheme };
|
|
11877
|
+
export { Alert, AlertTriangleIcon as AlertOctagonIcon, AlertTriangleIcon$1 as AlertTriangleIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, ArrowUpRightIcon, Badge, BankIcon, BladeProvider, BookIcon, Button, Card, CardBody, CardFooter, CardFooterLeading, CardFooterTrailing, CardHeader, CardHeaderBadge, CardHeaderCounter, CardHeaderIcon, CardHeaderIconButton, CardHeaderLeading, CardHeaderLink, CardHeaderText, CardHeaderTrailing, CheckCircleIcon, CheckIcon, Checkbox, CheckboxGroup, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ClockIcon, CloseIcon, Code, ComponentIds, Counter, CreditCardIcon, DollarIcon, DownloadIcon, EditIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FileTextIcon, Heading, HelpCircleIcon, HistoryIcon, HomeIcon, IconButton, Indicator, InfoIcon, Link, LinkIcon, LockIcon, MailIcon, MinusIcon, OTPInput, PasswordInput, PauseIcon, PlusIcon, ProgressBar, Radio, RadioGroup, RefreshLeftIcon, RotateCounterClockWiseIcon, RupeeIcon, SearchIcon, SettingsIcon, SettlementsIcon, ShuffleIcon, SkipNavContent, SkipNavLink, SlashIcon, Spinner, TagIcon, Text, TextArea, TextInput, Title, TransactionsIcon, TrashIcon, TrendingDownIcon, TrendingUpIcon, UserIcon, UsersIcon, VisuallyHidden, announce, clearAnnouncer, destroyAnnouncer, getTextProps, screenReaderStyles, useTheme };
|
|
11640
11878
|
//# sourceMappingURL=index.web.js.map
|