@razorpay/blade 10.15.1 → 10.15.3
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/README.md +28 -26
- package/build/components/index.d.ts +2 -1
- package/build/components/index.development.web.js +50 -31
- package/build/components/index.development.web.js.map +1 -1
- package/build/components/index.native.d.ts +2 -1
- package/build/components/index.native.js +13 -11
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.production.web.js +50 -31
- package/build/components/index.production.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
package/README.md
CHANGED
|
@@ -1,39 +1,41 @@
|
|
|
1
|
-
<
|
|
2
|
-
Blade
|
|
3
|
-
</h1>
|
|
1
|
+
<br/>
|
|
4
2
|
<p align="center">
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
</a>
|
|
11
|
-
<a href="https://github.com/razorpay/blade/blob/master/LICENSE.md">
|
|
12
|
-
<img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="Blade is released under the MIT license." />
|
|
13
|
-
</a>
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="./branding/blade-original-dark-mode.min.svg">
|
|
5
|
+
<source media="(prefers-color-scheme: light)" srcset="./branding/blade-original.min.svg">
|
|
6
|
+
<img width="450px" alt="Blade Design System Logo" src="./branding/blade-original.min.svg">
|
|
7
|
+
</picture>
|
|
14
8
|
</p>
|
|
15
9
|
|
|
10
|
+
<br/>
|
|
11
|
+
|
|
16
12
|
<p align="center">
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
<a href="https://npmjs.org/package/@razorpay/blade"><img alt="Blade Latest Version" src="https://img.shields.io/github/package-json/v/razorpay/blade?style=for-the-badge&labelColor=322&logo=npm&label=@razorpay/Blade&color=darkred&filename=packages%2Fblade%2Fpackage.json"></a> <a href="https://blade.razorpay.com/"><img alt="Documentation blade.razorpay.com" src="https://img.shields.io/badge/Documentation-blade.razorpay.com-0648EF?style=for-the-badge&labelColor=0012AD&logo=readthedocs&logoColor=eee"/></a> <a href="https://github.com/razorpay/blade/tree/master/CONTRIBUTING.md"><img alt="Discord Join Chat" src="https://img.shields.io/badge/Contributions-Open-333333?style=for-the-badge&logo=github&logoColor=ffffff&labelColor=111111"/></a></p>
|
|
14
|
+
|
|
15
|
+
<h1 aria-hidden="true"></h1>
|
|
19
16
|
|
|
20
|
-
|
|
17
|
+
<br/>
|
|
21
18
|
|
|
22
|
-
|
|
19
|
+
Blade is the Design System that powers [Razorpay](https://razorpay.com/).
|
|
23
20
|
|
|
24
|
-
|
|
25
|
-
- [Installation Guide](https://master--61c19ee8d3d282003ac1d81c.chromatic.com/?path=/docs/guides-installation--page)
|
|
26
|
-
- [Contributing guidelines](https://github.com/razorpay/blade/blob/master/CONTRIBUTING.md)
|
|
21
|
+
## 🔗 Links
|
|
27
22
|
|
|
28
|
-
|
|
23
|
+
- [Docs](https://blade.razorpay.com)
|
|
24
|
+
- [Installation](https://blade.razorpay.com/?path=/docs/guides-installation--page)
|
|
25
|
+
- [@razorpay/blade-old](https://github.com/razorpay/blade-old) (Deprecated, Private)
|
|
29
26
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
## ✨ Features
|
|
28
|
+
- Cross-Platform (Works Natively on [React Web](https://blade.razorpay.com/?path=/docs/guides-installation--page#%EF%B8%8F-installation) and [React Native](https://blade.razorpay.com/?path=/docs/guides-installation--page#react-native-projects))
|
|
29
|
+
- [White Labelling](https://blade.razorpay.com/?path=/docs/guides-theming-theme-playground--page)
|
|
30
|
+
- [CSS Variables for non-React Projects](https://blade.razorpay.com/?path=/docs/tokens-css-variables--page)
|
|
31
|
+
- [Accessible](https://github.com/razorpay/blade/blob/master/rfcs/2022-04-09-accessibility.md#manual-testing)
|
|
32
|
+
- Documented [RFCs](https://github.com/razorpay/blade/tree/docs/make-docs-pretty/rfcs) and [API Decisions](https://github.com/razorpay/blade/blob/master/packages/blade/src/components/Alert/_decisions/decisions.md)
|
|
36
33
|
|
|
37
34
|
## 📝 License
|
|
38
35
|
|
|
39
36
|
Licensed under the [MIT License](https://github.com/razorpay/blade/blob/master/LICENSE.md).
|
|
37
|
+
|
|
38
|
+
<h1 aria-hidden="true"></h1>
|
|
39
|
+
|
|
40
|
+
<p align="center">Interested in working with us? Checkout our <a href="https://razorpay.com/jobs">Jobs Page</a> for open roles 🤗</p>
|
|
41
|
+
|
|
@@ -3122,10 +3122,11 @@ declare type ActionColors = `action.text.${DotNotationColorStringToken<Theme['co
|
|
|
3122
3122
|
declare type BadgeTextColors = `badge.text.${DotNotationColorStringToken<Theme['colors']['badge']['text']>}`;
|
|
3123
3123
|
declare type WhiteTextColors = `white.action.text.${DotNotationColorStringToken<Theme['colors']['white']['action']['text']>}`;
|
|
3124
3124
|
declare type BrandPrimaryColors = `brand.primary.${keyof Theme['colors']['brand']['primary']}`;
|
|
3125
|
+
declare type BrandSecondaryColors = `brand.secondary.${keyof Theme['colors']['brand']['secondary']}`;
|
|
3125
3126
|
declare type As = 'code' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'abbr' | 'q' | 'cite' | 'figcaption' | 'div';
|
|
3126
3127
|
declare type BaseTextProps = {
|
|
3127
3128
|
id?: string;
|
|
3128
|
-
color?: BrandPrimaryColors | ActionColors | FeedbackColors | SurfaceColors | FeedbackActionColors | WhiteTextColors | BadgeTextColors;
|
|
3129
|
+
color?: BrandPrimaryColors | BrandSecondaryColors | ActionColors | FeedbackColors | SurfaceColors | FeedbackActionColors | WhiteTextColors | BadgeTextColors;
|
|
3129
3130
|
fontFamily?: keyof Theme['typography']['fonts']['family'];
|
|
3130
3131
|
fontSize?: keyof Theme['typography']['fonts']['size'];
|
|
3131
3132
|
fontWeight?: keyof Theme['typography']['fonts']['weight'];
|
|
@@ -14525,6 +14525,7 @@ var getCheckboxIconWrapperStyles = function getCheckboxIconWrapperStyles(_ref) {
|
|
|
14525
14525
|
display: 'flex',
|
|
14526
14526
|
alignItems: 'center',
|
|
14527
14527
|
justifyContent: 'center',
|
|
14528
|
+
flexShrink: 0,
|
|
14528
14529
|
width: makeSpace(checkboxSizes.icon[size].width),
|
|
14529
14530
|
height: makeSpace(checkboxSizes.icon[size].height),
|
|
14530
14531
|
borderWidth: makeBorderSize(theme.border.width.thick),
|
|
@@ -15130,7 +15131,7 @@ var SelectorLabel = function SelectorLabel(_ref2) {
|
|
|
15130
15131
|
var children = _ref2.children,
|
|
15131
15132
|
componentName = _ref2.componentName,
|
|
15132
15133
|
testID = _ref2.testID,
|
|
15133
|
-
|
|
15134
|
+
onMouseDown = _ref2.onMouseDown,
|
|
15134
15135
|
onMouseUp = _ref2.onMouseUp,
|
|
15135
15136
|
onMouseOut = _ref2.onMouseOut,
|
|
15136
15137
|
onKeyDown = _ref2.onKeyDown,
|
|
@@ -15141,10 +15142,7 @@ var SelectorLabel = function SelectorLabel(_ref2) {
|
|
|
15141
15142
|
return /*#__PURE__*/jsx(StyledSelectorLabel, _objectSpread$1x(_objectSpread$1x({
|
|
15142
15143
|
onTouchStart: onTouchStart,
|
|
15143
15144
|
onTouchEnd: onTouchEnd,
|
|
15144
|
-
onMouseDown:
|
|
15145
|
-
e.preventDefault();
|
|
15146
|
-
_onMouseDown === null || _onMouseDown === void 0 ? void 0 : _onMouseDown(e);
|
|
15147
|
-
},
|
|
15145
|
+
onMouseDown: onMouseDown,
|
|
15148
15146
|
onMouseUp: onMouseUp,
|
|
15149
15147
|
onMouseOut: onMouseOut,
|
|
15150
15148
|
onKeyDown: onKeyDown,
|
|
@@ -15427,7 +15425,6 @@ var _Checkbox = function _Checkbox(_ref, ref) {
|
|
|
15427
15425
|
flexDirection: "column",
|
|
15428
15426
|
children: [/*#__PURE__*/jsxs(BaseBox, {
|
|
15429
15427
|
display: "flex",
|
|
15430
|
-
alignItems: "center",
|
|
15431
15428
|
flexDirection: "row",
|
|
15432
15429
|
children: [/*#__PURE__*/jsx(SelectorInput, {
|
|
15433
15430
|
hoverTokens: checkboxHoverTokens,
|
|
@@ -15966,14 +15963,6 @@ var _ActionListItemText = function _ActionListItemText(_ref4) {
|
|
|
15966
15963
|
var ActionListItemText = /*#__PURE__*/assignWithoutSideEffects(_ActionListItemText, {
|
|
15967
15964
|
componentId: componentIds.ActionListItemText
|
|
15968
15965
|
});
|
|
15969
|
-
var ActionListCheckboxWrapper = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
15970
|
-
displayName: "ActionListItem__ActionListCheckboxWrapper",
|
|
15971
|
-
componentId: "m6qdwa-1"
|
|
15972
|
-
})(function (_props) {
|
|
15973
|
-
return {
|
|
15974
|
-
pointerEvents: 'none'
|
|
15975
|
-
};
|
|
15976
|
-
});
|
|
15977
15966
|
var makeActionListItemClickable = function makeActionListItemClickable(clickHandler) {
|
|
15978
15967
|
if (isReactNative$4()) {
|
|
15979
15968
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error
|
|
@@ -16010,8 +15999,9 @@ var _ActionListItemBody = function _ActionListItemBody(_ref5) {
|
|
|
16010
15999
|
children: selectionType === 'multiple' ?
|
|
16011
16000
|
/*#__PURE__*/
|
|
16012
16001
|
// Adding aria-hidden because the listbox item in multiselect in itself explains the behaviour so announcing checkbox is unneccesary and just a nice UI tweak for us
|
|
16013
|
-
jsx(
|
|
16014
|
-
|
|
16002
|
+
jsx(BaseBox, _objectSpread$1q(_objectSpread$1q({
|
|
16003
|
+
pointerEvents: "none",
|
|
16004
|
+
paddingRight: "spacing.2"
|
|
16015
16005
|
}, makeAccessible({
|
|
16016
16006
|
hidden: true
|
|
16017
16007
|
})), {}, {
|
|
@@ -21699,7 +21689,7 @@ var _StyledBaseInput = function _StyledBaseInput(_ref, ref) {
|
|
|
21699
21689
|
}, commonProps), props), accessibilityProps), {}, {
|
|
21700
21690
|
value: props.value,
|
|
21701
21691
|
children: /*#__PURE__*/jsx(Text, {
|
|
21702
|
-
type: props.value ? 'subtle' : 'placeholder',
|
|
21692
|
+
type: props.value && !isDisabled ? 'subtle' : 'placeholder',
|
|
21703
21693
|
truncateAfterLines: 1,
|
|
21704
21694
|
textAlign: props.textAlign,
|
|
21705
21695
|
children: props.value ? props.value : props.placeholder
|
|
@@ -21972,7 +21962,8 @@ var BaseInputTagSlot = function BaseInputTagSlot(_ref3) {
|
|
|
21972
21962
|
handleOnInputClick = _ref3.handleOnInputClick,
|
|
21973
21963
|
isDropdownTrigger = _ref3.isDropdownTrigger,
|
|
21974
21964
|
visibleTagsCountRef = _ref3.visibleTagsCountRef,
|
|
21975
|
-
labelPrefix = _ref3.labelPrefix
|
|
21965
|
+
labelPrefix = _ref3.labelPrefix,
|
|
21966
|
+
isDisabled = _ref3.isDisabled;
|
|
21976
21967
|
var hasTags = tags && tags.length > 0;
|
|
21977
21968
|
var slotRef = React__default.useRef(null);
|
|
21978
21969
|
var visibleTagsCount = useVisibleTagsCount({
|
|
@@ -22041,6 +22032,7 @@ var BaseInputTagSlot = function BaseInputTagSlot(_ref3) {
|
|
|
22041
22032
|
setShouldIgnoreBlurAnimation === null || setShouldIgnoreBlurAnimation === void 0 ? void 0 : setShouldIgnoreBlurAnimation(false);
|
|
22042
22033
|
},
|
|
22043
22034
|
children: [visibleTags, tags && !showAllTags && invisibleTagsCount ? /*#__PURE__*/jsx(Text, {
|
|
22035
|
+
type: isDisabled ? 'placeholder' : 'normal',
|
|
22044
22036
|
alignSelf: "center",
|
|
22045
22037
|
marginY: "spacing.2",
|
|
22046
22038
|
marginRight: "spacing.4",
|
|
@@ -22491,6 +22483,7 @@ var BaseInput = /*#__PURE__*/React__default.forwardRef(function (_ref11, ref) {
|
|
|
22491
22483
|
}), /*#__PURE__*/jsx(BaseInputTagSlot, {
|
|
22492
22484
|
renderAs: as,
|
|
22493
22485
|
tags: tags,
|
|
22486
|
+
isDisabled: isDisabled,
|
|
22494
22487
|
showAllTags: showAllTagsWithAnimation,
|
|
22495
22488
|
setFocusOnInput: function setFocusOnInput() {
|
|
22496
22489
|
if (ref && !isReactNative && 'current' in ref) {
|
|
@@ -23431,22 +23424,32 @@ var _OTPInput = function _OTPInput(_ref, incomingRef) {
|
|
|
23431
23424
|
};
|
|
23432
23425
|
var OTPInput = /*#__PURE__*/React__default.forwardRef(_OTPInput);
|
|
23433
23426
|
|
|
23427
|
+
var Chevron = function Chevron(props) {
|
|
23428
|
+
var iconColor = "surface.text.".concat(props.isDisabled ? 'placeholder' : 'normal', ".lowContrast");
|
|
23429
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
23430
|
+
children: [/*#__PURE__*/jsx(ChevronDownIcon, {
|
|
23431
|
+
display: props.isOpen ? 'none' : 'flex',
|
|
23432
|
+
size: "medium",
|
|
23433
|
+
color: iconColor
|
|
23434
|
+
}), /*#__PURE__*/jsx(ChevronUpIcon, {
|
|
23435
|
+
display: props.isOpen ? 'flex' : 'none',
|
|
23436
|
+
size: "medium",
|
|
23437
|
+
color: iconColor
|
|
23438
|
+
})]
|
|
23439
|
+
});
|
|
23440
|
+
};
|
|
23441
|
+
|
|
23434
23442
|
var InputChevronIcon = function InputChevronIcon(props) {
|
|
23435
|
-
return /*#__PURE__*/
|
|
23443
|
+
return /*#__PURE__*/jsx(BaseBox, {
|
|
23436
23444
|
display: "flex",
|
|
23437
23445
|
height: "100%",
|
|
23438
23446
|
justifyContent: "center",
|
|
23439
23447
|
alignItems: "center",
|
|
23440
23448
|
onClick: props.onClick,
|
|
23441
|
-
children:
|
|
23442
|
-
|
|
23443
|
-
|
|
23444
|
-
|
|
23445
|
-
}), /*#__PURE__*/jsx(ChevronUpIcon, {
|
|
23446
|
-
display: props.isOpen ? 'flex' : 'none',
|
|
23447
|
-
color: "surface.text.normal.lowContrast",
|
|
23448
|
-
size: "medium"
|
|
23449
|
-
})]
|
|
23449
|
+
children: /*#__PURE__*/jsx(Chevron, {
|
|
23450
|
+
isOpen: props.isOpen,
|
|
23451
|
+
isDisabled: props.isDisabled
|
|
23452
|
+
})
|
|
23450
23453
|
});
|
|
23451
23454
|
};
|
|
23452
23455
|
|
|
@@ -23596,6 +23599,7 @@ var AnimatedTagContainer = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
|
23596
23599
|
var AnimatedTag = function AnimatedTag(_ref) {
|
|
23597
23600
|
var children = _ref.children,
|
|
23598
23601
|
currentTagIndex = _ref.currentTagIndex,
|
|
23602
|
+
isDisabled = _ref.isDisabled,
|
|
23599
23603
|
activeTagIndex = _ref.activeTagIndex,
|
|
23600
23604
|
onDismiss = _ref.onDismiss;
|
|
23601
23605
|
var _React$useState = React__default.useState(true),
|
|
@@ -23625,6 +23629,7 @@ var AnimatedTag = function AnimatedTag(_ref) {
|
|
|
23625
23629
|
},
|
|
23626
23630
|
marginRight: "spacing.3",
|
|
23627
23631
|
marginY: "spacing.2",
|
|
23632
|
+
isDisabled: isDisabled,
|
|
23628
23633
|
children: children
|
|
23629
23634
|
})
|
|
23630
23635
|
});
|
|
@@ -23633,6 +23638,7 @@ var AnimatedTag = function AnimatedTag(_ref) {
|
|
|
23633
23638
|
var getTagsGroup = function getTagsGroup(_ref) {
|
|
23634
23639
|
var tags = _ref.tags,
|
|
23635
23640
|
activeTagIndex = _ref.activeTagIndex,
|
|
23641
|
+
isDisabled = _ref.isDisabled,
|
|
23636
23642
|
onDismiss = _ref.onDismiss;
|
|
23637
23643
|
return tags.map(function (tagName, tagIndex) {
|
|
23638
23644
|
return /*#__PURE__*/jsx(AnimatedTag, {
|
|
@@ -23640,6 +23646,7 @@ var getTagsGroup = function getTagsGroup(_ref) {
|
|
|
23640
23646
|
onDismiss: onDismiss,
|
|
23641
23647
|
currentTagIndex: tagIndex,
|
|
23642
23648
|
tagsLength: tags.length,
|
|
23649
|
+
isDisabled: isDisabled,
|
|
23643
23650
|
children: tagName
|
|
23644
23651
|
}, tagName);
|
|
23645
23652
|
});
|
|
@@ -23819,9 +23826,11 @@ var _BaseDropdownInputTrigger = function _BaseDropdownInputTrigger(props, ref) {
|
|
|
23819
23826
|
}
|
|
23820
23827
|
return getTagsGroup({
|
|
23821
23828
|
tags: selectedIndices.map(function (selectedIndex) {
|
|
23822
|
-
|
|
23829
|
+
var _options$selectedInde;
|
|
23830
|
+
return (_options$selectedInde = options[selectedIndex]) === null || _options$selectedInde === void 0 ? void 0 : _options$selectedInde.title;
|
|
23823
23831
|
}),
|
|
23824
23832
|
activeTagIndex: activeTagIndex,
|
|
23833
|
+
isDisabled: props.isDisabled,
|
|
23825
23834
|
onDismiss: function onDismiss(_ref) {
|
|
23826
23835
|
var tagIndex = _ref.tagIndex;
|
|
23827
23836
|
if (isTagDismissedRef.current) {
|
|
@@ -23887,7 +23896,13 @@ var _BaseDropdownInputTrigger = function _BaseDropdownInputTrigger(props, ref) {
|
|
|
23887
23896
|
autoFocus: props.autoFocus // eslint-disable-line jsx-a11y/no-autofocus
|
|
23888
23897
|
,
|
|
23889
23898
|
value: getValue(),
|
|
23890
|
-
onClick:
|
|
23899
|
+
onClick: function onClick(e) {
|
|
23900
|
+
var _props$onTriggerClick;
|
|
23901
|
+
if (props.isDisabled) {
|
|
23902
|
+
return;
|
|
23903
|
+
}
|
|
23904
|
+
(_props$onTriggerClick = props.onTriggerClick) === null || _props$onTriggerClick === void 0 ? void 0 : _props$onTriggerClick.call(props, e);
|
|
23905
|
+
},
|
|
23891
23906
|
onFocus: props.onFocus,
|
|
23892
23907
|
onBlur: function onBlur(_ref2) {
|
|
23893
23908
|
var _props$onBlur;
|
|
@@ -23925,6 +23940,7 @@ var _BaseDropdownInputTrigger = function _BaseDropdownInputTrigger(props, ref) {
|
|
|
23925
23940
|
onTriggerClick();
|
|
23926
23941
|
}
|
|
23927
23942
|
},
|
|
23943
|
+
isDisabled: props.isDisabled,
|
|
23928
23944
|
isOpen: isOpen
|
|
23929
23945
|
})
|
|
23930
23946
|
});
|
|
@@ -24126,7 +24142,10 @@ var useAutoComplete = function useAutoComplete(_ref) {
|
|
|
24126
24142
|
name: props.name,
|
|
24127
24143
|
value: displayText
|
|
24128
24144
|
});
|
|
24129
|
-
|
|
24145
|
+
// Use displayText as inputValue only if its not controlled by user
|
|
24146
|
+
if (typeof props.value === 'undefined') {
|
|
24147
|
+
setInputValue(displayText !== null && displayText !== void 0 ? displayText : '');
|
|
24148
|
+
}
|
|
24130
24149
|
}
|
|
24131
24150
|
(_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, {
|
|
24132
24151
|
name: props.name,
|