@razorpay/blade 5.2.1 → 5.4.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 +12 -0
- package/build/components/index.d.ts +334 -44
- package/build/components/index.native.d.ts +332 -42
- package/build/components/index.native.js +222 -32
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.web.js +918 -140
- 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.native.js.map +1 -1
- package/build/tokens/index.web.js +1 -1
- package/build/tokens/index.web.js.map +1 -1
- package/build/utils/index.d.ts +23 -3
- package/build/utils/index.native.d.ts +23 -3
- package/build/utils/index.native.js +6 -4
- package/build/utils/index.native.js.map +1 -1
- package/build/utils/index.web.js +31 -3
- package/build/utils/index.web.js.map +1 -1
- package/package.json +1 -1
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
|
|
|
@@ -22,10 +22,15 @@ declare const MetaConstants: {
|
|
|
22
22
|
readonly Indicator: "indicator";
|
|
23
23
|
readonly Link: "link";
|
|
24
24
|
readonly OTPInput: "otp-input";
|
|
25
|
+
readonly ProgressBar: "progress-bar";
|
|
25
26
|
readonly Radio: "radio";
|
|
26
27
|
readonly RadioGroup: "radio-group";
|
|
27
28
|
readonly SkipNav: "skipnav";
|
|
28
29
|
readonly Spinner: "spinner";
|
|
30
|
+
readonly Card: "card";
|
|
31
|
+
readonly CardBody: "card-body";
|
|
32
|
+
readonly CardHeader: "card-header";
|
|
33
|
+
readonly CardFooter: "card-footer";
|
|
29
34
|
};
|
|
30
35
|
|
|
31
36
|
type Breakpoints = Readonly<{
|
|
@@ -87,6 +92,21 @@ declare const getColorScheme: (colorScheme?: ColorSchemeNamesInput) => ColorSche
|
|
|
87
92
|
declare type PlatformTypes = 'browser' | 'node' | 'react-native' | 'unknown';
|
|
88
93
|
declare const getPlatformType: () => PlatformTypes;
|
|
89
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
|
+
|
|
90
110
|
declare type DeepPartial<T> = {
|
|
91
111
|
[P in keyof T]?: T[P] extends Record<number | string, unknown> ? DeepPartial<T[P]> : T[P];
|
|
92
112
|
};
|
|
@@ -95,7 +115,7 @@ declare const isPartialMatchObjectKeys: <ActualObject>({ objectToMatch, objectTo
|
|
|
95
115
|
objectToInspect: ActualObject;
|
|
96
116
|
}) => boolean;
|
|
97
117
|
|
|
98
|
-
declare type AriaRoles = Exclude<AccessibilityRole, 'header' | 'adjustable' | 'image' | 'none' | 'summary'> | 'alert' | 'alertdialog' | 'application' | 'article' | 'banner' | 'button' | 'cell' | 'checkbox' | 'columnheader' | 'combobox' | 'complementary' | 'contentinfo' | 'definition' | 'dialog' | 'directory' | 'document' | 'feed' | 'figure' | 'form' | 'grid' | 'gridcell' | 'group' | 'heading' | 'img' | 'link' | 'list' | 'listbox' | 'listitem' | 'log' | 'main' | 'marquee' | 'math' | 'menu' | 'menubar' | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | 'navigation' | 'none' | 'note' | 'option' | 'presentation' | 'progressbar' | 'radio' | 'radiogroup' | 'region' | 'row' | 'rowgroup' | 'rowheader' | 'scrollbar' | 'search' | 'searchbox' | 'separator' | 'slider' | 'spinbutton' | 'status' | 'switch' | 'tab' | 'table' | 'tablist' | 'tabpanel' | 'term' | 'textbox' | 'timer' | 'toolbar' | 'tooltip' | 'tree' | 'treegrid' | 'treeitem';
|
|
118
|
+
declare type AriaRoles = Exclude<AccessibilityRole, 'header' | 'adjustable' | 'image' | 'none' | 'summary'> | 'alert' | 'alertdialog' | 'application' | 'article' | 'banner' | 'button' | 'cell' | 'checkbox' | 'columnheader' | 'combobox' | 'complementary' | 'contentinfo' | 'definition' | 'dialog' | 'directory' | 'document' | 'feed' | 'figure' | 'form' | 'grid' | 'gridcell' | 'group' | 'heading' | 'img' | 'link' | 'list' | 'listbox' | 'listitem' | 'log' | 'main' | 'marquee' | 'math' | 'menu' | 'menubar' | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | 'meter' | 'navigation' | 'none' | 'note' | 'option' | 'presentation' | 'progressbar' | 'radio' | 'radiogroup' | 'region' | 'row' | 'rowgroup' | 'rowheader' | 'scrollbar' | 'search' | 'searchbox' | 'separator' | 'slider' | 'spinbutton' | 'status' | 'switch' | 'tab' | 'table' | 'tablist' | 'tabpanel' | 'term' | 'textbox' | 'timer' | 'toolbar' | 'tooltip' | 'tree' | 'treegrid' | 'treeitem';
|
|
99
119
|
declare type AccessibilityKeys = keyof AriaAttributes;
|
|
100
120
|
declare type AccessibilityProps = AriaAttributes;
|
|
101
121
|
declare type AccessibilityMap = Record<AccessibilityKeys, string>;
|
|
@@ -446,4 +466,4 @@ declare const castNativeType: <T>(value: T) => Extract<T, {
|
|
|
446
466
|
__brand__?: "platform-all" | "platform-native" | undefined;
|
|
447
467
|
}>;
|
|
448
468
|
|
|
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 };
|
|
469
|
+
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
|
|
|
@@ -23,10 +23,15 @@ declare const MetaConstants: {
|
|
|
23
23
|
readonly Indicator: "indicator";
|
|
24
24
|
readonly Link: "link";
|
|
25
25
|
readonly OTPInput: "otp-input";
|
|
26
|
+
readonly ProgressBar: "progress-bar";
|
|
26
27
|
readonly Radio: "radio";
|
|
27
28
|
readonly RadioGroup: "radio-group";
|
|
28
29
|
readonly SkipNav: "skipnav";
|
|
29
30
|
readonly Spinner: "spinner";
|
|
31
|
+
readonly Card: "card";
|
|
32
|
+
readonly CardBody: "card-body";
|
|
33
|
+
readonly CardHeader: "card-header";
|
|
34
|
+
readonly CardFooter: "card-footer";
|
|
30
35
|
};
|
|
31
36
|
|
|
32
37
|
type Breakpoints = Readonly<{
|
|
@@ -88,6 +93,21 @@ declare const getColorScheme: (colorScheme?: ColorSchemeNamesInput) => ColorSche
|
|
|
88
93
|
declare type PlatformTypes = 'browser' | 'node' | 'react-native' | 'unknown';
|
|
89
94
|
declare const getPlatformType: () => PlatformTypes;
|
|
90
95
|
|
|
96
|
+
/**
|
|
97
|
+
* A type defining React component with additional static prop `componentId`
|
|
98
|
+
*/
|
|
99
|
+
declare type WithComponentId<Props> = ((props: Props) => React.ReactElement) & {
|
|
100
|
+
componentId: string;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Gets the `componentId` prop of React component if it exists.
|
|
104
|
+
*/
|
|
105
|
+
declare const getComponentId: (component: React.ReactNode) => string | null;
|
|
106
|
+
/**
|
|
107
|
+
* Checks if the `component` matches the `componentId`
|
|
108
|
+
*/
|
|
109
|
+
declare const isValidAllowedChildren: (component: React.ReactNode, id: string) => boolean;
|
|
110
|
+
|
|
91
111
|
declare type DeepPartial<T> = {
|
|
92
112
|
[P in keyof T]?: T[P] extends Record<number | string, unknown> ? DeepPartial<T[P]> : T[P];
|
|
93
113
|
};
|
|
@@ -96,7 +116,7 @@ declare const isPartialMatchObjectKeys: <ActualObject>({ objectToMatch, objectTo
|
|
|
96
116
|
objectToInspect: ActualObject;
|
|
97
117
|
}) => boolean;
|
|
98
118
|
|
|
99
|
-
declare type AriaRoles = Exclude<AccessibilityRole, 'header' | 'adjustable' | 'image' | 'none' | 'summary'> | 'alert' | 'alertdialog' | 'application' | 'article' | 'banner' | 'button' | 'cell' | 'checkbox' | 'columnheader' | 'combobox' | 'complementary' | 'contentinfo' | 'definition' | 'dialog' | 'directory' | 'document' | 'feed' | 'figure' | 'form' | 'grid' | 'gridcell' | 'group' | 'heading' | 'img' | 'link' | 'list' | 'listbox' | 'listitem' | 'log' | 'main' | 'marquee' | 'math' | 'menu' | 'menubar' | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | 'navigation' | 'none' | 'note' | 'option' | 'presentation' | 'progressbar' | 'radio' | 'radiogroup' | 'region' | 'row' | 'rowgroup' | 'rowheader' | 'scrollbar' | 'search' | 'searchbox' | 'separator' | 'slider' | 'spinbutton' | 'status' | 'switch' | 'tab' | 'table' | 'tablist' | 'tabpanel' | 'term' | 'textbox' | 'timer' | 'toolbar' | 'tooltip' | 'tree' | 'treegrid' | 'treeitem';
|
|
119
|
+
declare type AriaRoles = Exclude<AccessibilityRole, 'header' | 'adjustable' | 'image' | 'none' | 'summary'> | 'alert' | 'alertdialog' | 'application' | 'article' | 'banner' | 'button' | 'cell' | 'checkbox' | 'columnheader' | 'combobox' | 'complementary' | 'contentinfo' | 'definition' | 'dialog' | 'directory' | 'document' | 'feed' | 'figure' | 'form' | 'grid' | 'gridcell' | 'group' | 'heading' | 'img' | 'link' | 'list' | 'listbox' | 'listitem' | 'log' | 'main' | 'marquee' | 'math' | 'menu' | 'menubar' | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | 'meter' | 'navigation' | 'none' | 'note' | 'option' | 'presentation' | 'progressbar' | 'radio' | 'radiogroup' | 'region' | 'row' | 'rowgroup' | 'rowheader' | 'scrollbar' | 'search' | 'searchbox' | 'separator' | 'slider' | 'spinbutton' | 'status' | 'switch' | 'tab' | 'table' | 'tablist' | 'tabpanel' | 'term' | 'textbox' | 'timer' | 'toolbar' | 'tooltip' | 'tree' | 'treegrid' | 'treeitem';
|
|
100
120
|
declare type AccessibilityKeys = keyof AriaAttributes;
|
|
101
121
|
declare type AccessibilityProps = AriaAttributes;
|
|
102
122
|
declare type AccessibilityMap = Record<AccessibilityKeys, string>;
|
|
@@ -445,4 +465,4 @@ declare const castNativeType: <T>(value: T) => Extract<T, {
|
|
|
445
465
|
__brand__?: "platform-native" | "platform-all" | undefined;
|
|
446
466
|
}>;
|
|
447
467
|
|
|
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 };
|
|
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 };
|
|
@@ -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',ProgressBar:'progress-bar',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,9 +3840,11 @@ 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
|
-
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'};
|
|
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',meter:'progressbar'};
|
|
3846
3848
|
|
|
3847
3849
|
var makeAccessible=function makeAccessible(props){var newProps={};for(var key in props){var propKey=key;var propValue=props[propKey];var accessibilityAttribute=accessibilityMap[propKey];if(accessibilityStateKeys.includes(propKey)){newProps.accessibilityState=_extends({},newProps.accessibilityState,_defineProperty$1({},accessibilityAttribute,propValue));continue;}if(accessibilityValueKeys.includes(propKey)){newProps.accessibilityValue=_extends({},newProps.accessibilityValue,_defineProperty$1({},accessibilityAttribute,propValue));continue;}if(propKey==='hidden'){if(propValue===true){newProps.accessibilityElementsHidden=true;newProps.importantForAccessibility='no-hide-descendants';}delete newProps.accessibilityHidden;continue;}if(accessibilityAttribute){newProps[accessibilityAttribute]=propValue;}else {console.warn("[Blade: makeAccessible]: No mapping found for "+propKey+". Make sure you have entered valid key");}}if(newProps.accessibilityRole){var role=accessibilityRoleMap[newProps.accessibilityRole];newProps.accessibilityRole=role;if(!role){var validRoles=Object.keys(accessibilityRoleMap).join(', ');console.log("[Blade: makeAccessible]: Unsupported accessibility role for react-native. Expected one of "+validRoles+" but found "+props.role);delete newProps.accessibilityRole;}}return newProps;};
|
|
3848
3850
|
|
|
@@ -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
|