@razorpay/blade 5.2.0 → 5.3.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 +13 -0
- package/build/components/index.d.ts +257 -45
- package/build/components/index.native.d.ts +257 -45
- package/build/components/index.native.js +22 -8
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.web.js +533 -186
- 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/build/tokens/index.native.js +1 -1
- package/build/tokens/index.web.js +1 -1
- package/build/utils/index.d.ts +21 -2
- package/build/utils/index.native.d.ts +21 -2
- package/build/utils/index.native.js +5 -3
- package/build/utils/index.native.js.map +1 -1
- package/build/utils/index.web.js +30 -3
- package/build/utils/index.web.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _extends from '@babel/runtime/helpers/extends';
|
|
2
2
|
import { Platform } from 'react-native';
|
|
3
|
+
import 'react';
|
|
3
4
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
5
|
import '@babel/runtime/helpers/defineProperty';
|
|
5
6
|
import { Easing } from 'react-native-reanimated';
|
|
6
|
-
import 'react';
|
|
7
7
|
|
|
8
8
|
var opacities={0:0,1:0.09,2:0.18,3:0.32,4:1.0,5:1.0,6:1.0,7:1.0,8:1.0,9:1.0};
|
|
9
9
|
|
package/build/utils/index.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ export { default as cloneDeep } from 'lodash/cloneDeep';
|
|
|
2
2
|
export { default as getIn } from 'lodash/get';
|
|
3
3
|
export { default as isEmpty } from 'lodash/isEmpty';
|
|
4
4
|
export { default as isEqual } from 'lodash/isEqual';
|
|
5
|
+
import React, { MutableRefObject } from 'react';
|
|
5
6
|
import { AccessibilityRole } from 'react-native';
|
|
6
7
|
export { default as merge } from 'lodash/merge';
|
|
7
|
-
import { MutableRefObject } from 'react';
|
|
8
8
|
|
|
9
9
|
declare const metaAttribute: (name: string, value: string | undefined) => Record<string, string>;
|
|
10
10
|
|
|
@@ -26,6 +26,10 @@ declare const MetaConstants: {
|
|
|
26
26
|
readonly RadioGroup: "radio-group";
|
|
27
27
|
readonly SkipNav: "skipnav";
|
|
28
28
|
readonly Spinner: "spinner";
|
|
29
|
+
readonly Card: "card";
|
|
30
|
+
readonly CardBody: "card-body";
|
|
31
|
+
readonly CardHeader: "card-header";
|
|
32
|
+
readonly CardFooter: "card-footer";
|
|
29
33
|
};
|
|
30
34
|
|
|
31
35
|
type Breakpoints = Readonly<{
|
|
@@ -87,6 +91,21 @@ declare const getColorScheme: (colorScheme?: ColorSchemeNamesInput) => ColorSche
|
|
|
87
91
|
declare type PlatformTypes = 'browser' | 'node' | 'react-native' | 'unknown';
|
|
88
92
|
declare const getPlatformType: () => PlatformTypes;
|
|
89
93
|
|
|
94
|
+
/**
|
|
95
|
+
* A type defining React component with additional static prop `componentId`
|
|
96
|
+
*/
|
|
97
|
+
declare type WithComponentId<Props> = ((props: Props) => React.ReactElement) & {
|
|
98
|
+
componentId: string;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Gets the `componentId` prop of React component if it exists.
|
|
102
|
+
*/
|
|
103
|
+
declare const getComponentId: (component: React.ReactNode) => string | null;
|
|
104
|
+
/**
|
|
105
|
+
* Checks if the `component` matches the `componentId`
|
|
106
|
+
*/
|
|
107
|
+
declare const isValidAllowedChildren: (component: React.ReactNode, id: string) => boolean;
|
|
108
|
+
|
|
90
109
|
declare type DeepPartial<T> = {
|
|
91
110
|
[P in keyof T]?: T[P] extends Record<number | string, unknown> ? DeepPartial<T[P]> : T[P];
|
|
92
111
|
};
|
|
@@ -446,4 +465,4 @@ declare const castNativeType: <T>(value: T) => Extract<T, {
|
|
|
446
465
|
__brand__?: "platform-all" | "platform-native" | undefined;
|
|
447
466
|
}>;
|
|
448
467
|
|
|
449
|
-
export { AccessibilityKeys, AccessibilityMap, AccessibilityProps, AriaAttributes, AriaRoles, DeepPartial, MakeSize, MetaConstants, Platform, PlatformTypes, UseColorScheme, castNativeType, castWebType, getColorScheme, getPlatformType, isPartialMatchObjectKeys, isReactNative, makeAccessible, makeBezier, makeBorderSize, makeMotionTime, makeSize, makeSpace, makeTypographySize, metaAttribute, setupMatchMediaMock, testID, toTitleCase, useBreakpoint, useColorScheme, usePrevious };
|
|
468
|
+
export { AccessibilityKeys, AccessibilityMap, AccessibilityProps, AriaAttributes, AriaRoles, DeepPartial, MakeSize, MetaConstants, Platform, PlatformTypes, UseColorScheme, WithComponentId, castNativeType, castWebType, getColorScheme, getComponentId, getPlatformType, isPartialMatchObjectKeys, isReactNative, isValidAllowedChildren, makeAccessible, makeBezier, makeBorderSize, makeMotionTime, makeSize, makeSpace, makeTypographySize, metaAttribute, setupMatchMediaMock, testID, toTitleCase, useBreakpoint, useColorScheme, usePrevious };
|
|
@@ -2,10 +2,10 @@ export { default as cloneDeep } from 'lodash/cloneDeep';
|
|
|
2
2
|
export { default as getIn } from 'lodash/get';
|
|
3
3
|
export { default as isEmpty } from 'lodash/isEmpty';
|
|
4
4
|
export { default as isEqual } from 'lodash/isEqual';
|
|
5
|
+
import React, { MutableRefObject } from 'react';
|
|
5
6
|
import { AccessibilityRole } from 'react-native';
|
|
6
7
|
import { EasingFunctionFactory } from 'react-native-reanimated';
|
|
7
8
|
export { default as merge } from 'lodash/merge';
|
|
8
|
-
import { MutableRefObject } from 'react';
|
|
9
9
|
|
|
10
10
|
declare const metaAttribute: (_name: string, _value: string) => Record<string, string>;
|
|
11
11
|
|
|
@@ -27,6 +27,10 @@ declare const MetaConstants: {
|
|
|
27
27
|
readonly RadioGroup: "radio-group";
|
|
28
28
|
readonly SkipNav: "skipnav";
|
|
29
29
|
readonly Spinner: "spinner";
|
|
30
|
+
readonly Card: "card";
|
|
31
|
+
readonly CardBody: "card-body";
|
|
32
|
+
readonly CardHeader: "card-header";
|
|
33
|
+
readonly CardFooter: "card-footer";
|
|
30
34
|
};
|
|
31
35
|
|
|
32
36
|
type Breakpoints = Readonly<{
|
|
@@ -88,6 +92,21 @@ declare const getColorScheme: (colorScheme?: ColorSchemeNamesInput) => ColorSche
|
|
|
88
92
|
declare type PlatformTypes = 'browser' | 'node' | 'react-native' | 'unknown';
|
|
89
93
|
declare const getPlatformType: () => PlatformTypes;
|
|
90
94
|
|
|
95
|
+
/**
|
|
96
|
+
* A type defining React component with additional static prop `componentId`
|
|
97
|
+
*/
|
|
98
|
+
declare type WithComponentId<Props> = ((props: Props) => React.ReactElement) & {
|
|
99
|
+
componentId: string;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Gets the `componentId` prop of React component if it exists.
|
|
103
|
+
*/
|
|
104
|
+
declare const getComponentId: (component: React.ReactNode) => string | null;
|
|
105
|
+
/**
|
|
106
|
+
* Checks if the `component` matches the `componentId`
|
|
107
|
+
*/
|
|
108
|
+
declare const isValidAllowedChildren: (component: React.ReactNode, id: string) => boolean;
|
|
109
|
+
|
|
91
110
|
declare type DeepPartial<T> = {
|
|
92
111
|
[P in keyof T]?: T[P] extends Record<number | string, unknown> ? DeepPartial<T[P]> : T[P];
|
|
93
112
|
};
|
|
@@ -445,4 +464,4 @@ declare const castNativeType: <T>(value: T) => Extract<T, {
|
|
|
445
464
|
__brand__?: "platform-native" | "platform-all" | undefined;
|
|
446
465
|
}>;
|
|
447
466
|
|
|
448
|
-
export { AccessibilityKeys, AccessibilityMap, AccessibilityProps, AriaAttributes, AriaRoles, DeepPartial, MakeSize, MetaConstants, Platform, PlatformTypes, UseColorScheme, castNativeType, castWebType, getColorScheme, getPlatformType, isPartialMatchObjectKeys, isReactNative, makeAccessible, makeBezier, makeBorderSize, makeMotionTime, makeSize, makeSpace, makeTypographySize, metaAttribute, setupMatchMediaMock, testID, toTitleCase, useBreakpoint, useColorScheme, usePrevious };
|
|
467
|
+
export { AccessibilityKeys, AccessibilityMap, AccessibilityProps, AriaAttributes, AriaRoles, DeepPartial, MakeSize, MetaConstants, Platform, PlatformTypes, UseColorScheme, WithComponentId, castNativeType, castWebType, getColorScheme, getComponentId, getPlatformType, isPartialMatchObjectKeys, isReactNative, isValidAllowedChildren, makeAccessible, makeBezier, makeBorderSize, makeMotionTime, makeSize, makeSpace, makeTypographySize, metaAttribute, setupMatchMediaMock, testID, toTitleCase, useBreakpoint, useColorScheme, usePrevious };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Appearance, Platform as Platform$1 } from 'react-native';
|
|
2
|
+
import React, { useMemo, useCallback, useState, useEffect, useRef } from 'react';
|
|
2
3
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
3
4
|
import _defineProperty$1 from '@babel/runtime/helpers/defineProperty';
|
|
4
5
|
import _extends from '@babel/runtime/helpers/extends';
|
|
5
6
|
import { Easing } from 'react-native-reanimated';
|
|
6
|
-
import { useMemo, useCallback, useState, useEffect, useRef } from 'react';
|
|
7
7
|
|
|
8
8
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
9
9
|
|
|
@@ -2791,7 +2791,7 @@ var cloneDeep_1 = cloneDeep;
|
|
|
2791
2791
|
|
|
2792
2792
|
var metaAttribute=function metaAttribute(_name,_value){return {};};
|
|
2793
2793
|
|
|
2794
|
-
var MetaConstants={Alert:'alert',Badge:'badge',Button:'button',Checkbox:'checkbox',CheckboxGroup:'checkbox-group',Code:'code',Component:'blade-component',Counter:'counter',Icon:'icon',IconButton:'icon-button',Indicator:'indicator',Link:'link',OTPInput:'otp-input',Radio:'radio',RadioGroup:'radio-group',SkipNav:'skipnav',Spinner:'spinner'};
|
|
2794
|
+
var MetaConstants={Alert:'alert',Badge:'badge',Button:'button',Checkbox:'checkbox',CheckboxGroup:'checkbox-group',Code:'code',Component:'blade-component',Counter:'counter',Icon:'icon',IconButton:'icon-button',Indicator:'indicator',Link:'link',OTPInput:'otp-input',Radio:'radio',RadioGroup:'radio-group',SkipNav:'skipnav',Spinner:'spinner',Card:'card',CardBody:'card-body',CardHeader:'card-header',CardFooter:'card-footer'};
|
|
2795
2795
|
|
|
2796
2796
|
var getColorScheme=function getColorScheme(){var colorScheme=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'light';if(colorScheme==='light'||colorScheme==='dark'){return colorScheme;}if(colorScheme==='system'){var _Appearance$getColorS;return (_Appearance$getColorS=Appearance.getColorScheme())!=null?_Appearance$getColorS:'light';}return 'light';};
|
|
2797
2797
|
|
|
@@ -3840,6 +3840,8 @@ function isEqual(value, other) {
|
|
|
3840
3840
|
|
|
3841
3841
|
var isEqual_1 = isEqual;
|
|
3842
3842
|
|
|
3843
|
+
var getComponentId=function getComponentId(component){var _component$type;if(!React.isValidElement(component))return null;return (_component$type=component.type)==null?void 0:_component$type.componentId;};var isValidAllowedChildren=function isValidAllowedChildren(component,id){return getComponentId(component)===id;};
|
|
3844
|
+
|
|
3843
3845
|
var isPartialMatchObjectKeys=function isPartialMatchObjectKeys(_ref){var objectToMatch=_ref.objectToMatch,objectToInspect=_ref.objectToInspect;var matchResponses=[];var matchObjectKeys=function matchObjectKeys(_ref2){var innerObjectToMatch=_ref2.innerObjectToMatch,innerObjectToInspect=_ref2.innerObjectToInspect;for(var _i=0,_Object$entries=Object.entries(innerObjectToMatch);_i<_Object$entries.length;_i++){var _ref3=_Object$entries[_i];var _ref4=_slicedToArray(_ref3,2);var key=_ref4[0];var valueToMatch=_ref4[1];var valueToInspect=innerObjectToInspect[key];if(innerObjectToInspect.hasOwnProperty(key)){if(valueToMatch===null||valueToMatch===undefined||valueToMatch===''||Array.isArray(valueToMatch)||!(valueToMatch instanceof Object)&&typeof valueToMatch!==typeof valueToInspect){console.error("[isPartialMatchObjectKeys]: Unexpected value: "+JSON.stringify(valueToMatch)+" of type "+typeof valueToMatch+" for key: "+key);matchResponses.push(false);}if(typeof valueToMatch==='string'){matchResponses.push(true);}if(isObject_1(valueToMatch)&&isObject_1(valueToInspect)){matchObjectKeys({innerObjectToMatch:valueToMatch,innerObjectToInspect:valueToInspect});}}else {console.error("[isPartialMatchObjectKeys]: "+key+" doesn't exist in "+JSON.stringify(innerObjectToInspect,null,2));matchResponses.push(false);}}};matchObjectKeys({innerObjectToMatch:objectToMatch,innerObjectToInspect:objectToInspect});return matchResponses.every(Boolean);};
|
|
3844
3846
|
|
|
3845
3847
|
var accessibilityValue={valueMax:'max',valueMin:'min',valueNow:'now',valueText:'text'};var accessibilityState={selected:'selected',disabled:'disabled',expanded:'expanded',busy:'busy',checked:'checked'};var accessibilityValueKeys=Object.keys(accessibilityValue);var accessibilityStateKeys=Object.keys(accessibilityState);var accessibilityMap=_extends({},accessibilityState,accessibilityValue,{activeDescendant:'accessibilityActiveDescendant',atomic:'accessibilityAtomic',autoComplete:'accessibilityAutoComplete',colCount:'accessibilityColCount',colIndex:'accessibilityColIndex',colSpan:'accessibilityColSpan',controls:'accessibilityControls',describedBy:'accessibilityDescribedBy',details:'accessibilityDetails',errorMessage:'accessibilityErrorMessage',flowTo:'accessibilityFlowTo',hasPopup:'accessibilityHasPopup',hidden:'accessibilityHidden',invalid:'accessibilityInvalid',keyShortcuts:'accessibilityKeyShortcuts',label:'accessibilityLabel',labelledBy:'accessibilityLabelledBy',liveRegion:'accessibilityLiveRegion',modal:'accessibilityModal',multiline:'accessibilityMultiline',multiSelectable:'accessibilityMultiSelectable',orientation:'accessibilityOrientation',owns:'accessibilityOwns',placeholder:'accessibilityPlaceholder',posInSet:'accessibilityPosInSet',pressed:'accessibilityPressed',readOnly:'accessibilityReadOnly',required:'accessibilityRequired',role:'accessibilityRole',roleDescription:'accessibilityRoleDescription',rowCount:'accessibilityRowCount',rowIndex:'accessibilityRowIndex',rowSpan:'accessibilityRowSpan',setSize:'accessibilitySetSize',sort:'accessibilitySort',current:'accessibilityCurrent',dropEffect:'accessibilityDropEffect',grabbed:'accessibilityGrabbed',level:'accessibilityLevel',relevant:'accessibilityRelevant'});var accessibilityRoleMap={alert:'alert',button:'button',checkbox:'checkbox',combobox:'combobox',image:'image',link:'link',menu:'menu',menubar:'menubar',menuitem:'menuitem',progressbar:'progressbar',radio:'radio',radiogroup:'radiogroup',scrollbar:'scrollbar',search:'search',spinbutton:'spinbutton',switch:'switch',tab:'tab',tablist:'tablist',timer:'timer',togglebutton:'togglebutton',toolbar:'toolbar',heading:'header',slider:'adjustable',img:'image',presentation:'none',region:'summary',imagebutton:'imagebutton',keyboardkey:'keyboardkey',label:'label',text:'text'};
|
|
@@ -4555,5 +4557,5 @@ var Platform;(function(_Platform){})(Platform||(Platform={}));
|
|
|
4555
4557
|
|
|
4556
4558
|
var castWebType=function castWebType(value){return value;};var castNativeType=function castNativeType(value){return value;};
|
|
4557
4559
|
|
|
4558
|
-
export { MetaConstants, Platform, castNativeType, castWebType, cloneDeep_1 as cloneDeep, getColorScheme, get_1 as getIn, getPlatformType, isEmpty_1 as isEmpty, isEqual_1 as isEqual, isPartialMatchObjectKeys, isReactNative, makeAccessible, makeBezier, makeBorderSize, makeMotionTime, makeSize, makeSpace, makeTypographySize, merge_1 as merge, metaAttribute, setupMatchMediaMock, testID, toTitleCase, useBreakpoint, useColorScheme, usePrevious };
|
|
4560
|
+
export { MetaConstants, Platform, castNativeType, castWebType, cloneDeep_1 as cloneDeep, getColorScheme, getComponentId, get_1 as getIn, getPlatformType, isEmpty_1 as isEmpty, isEqual_1 as isEqual, isPartialMatchObjectKeys, isReactNative, isValidAllowedChildren, makeAccessible, makeBezier, makeBorderSize, makeMotionTime, makeSize, makeSpace, makeTypographySize, merge_1 as merge, metaAttribute, setupMatchMediaMock, testID, toTitleCase, useBreakpoint, useColorScheme, usePrevious };
|
|
4559
4561
|
//# sourceMappingURL=index.native.js.map
|