@razorpay/blade 6.3.0 → 6.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 +27 -0
- package/build/components/index.d.ts +2043 -389
- package/build/components/index.native.d.ts +1874 -517
- package/build/components/index.native.js +351 -17538
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.web.js +4445 -18799
- package/build/components/index.web.js.map +1 -1
- package/build/css/bankingThemeDarkDesktop.css +2 -2
- package/build/css/bankingThemeDarkMobile.css +2 -2
- package/build/css/bankingThemeLightDesktop.css +2 -2
- package/build/css/bankingThemeLightMobile.css +2 -2
- package/build/css/paymentThemeDarkDesktop.css +2 -2
- package/build/css/paymentThemeDarkMobile.css +2 -2
- package/build/css/paymentThemeLightDesktop.css +2 -2
- package/build/css/paymentThemeLightMobile.css +2 -2
- package/build/tokens/index.d.ts +135 -14
- package/build/tokens/index.native.d.ts +135 -14
- package/build/tokens/index.native.js +1 -1
- package/build/tokens/index.native.js.map +1 -1
- package/build/tokens/index.web.js +7 -2
- package/build/tokens/index.web.js.map +1 -1
- package/build/utils/index.d.ts +74 -9
- package/build/utils/index.native.d.ts +74 -9
- package/build/utils/index.native.js +7 -5
- package/build/utils/index.native.js.map +1 -1
- package/build/utils/index.web.js +29 -18
- package/build/utils/index.web.js.map +1 -1
- package/package.json +1 -1
package/build/utils/index.d.ts
CHANGED
|
@@ -6,7 +6,10 @@ import React, { MutableRefObject } from 'react';
|
|
|
6
6
|
import { AccessibilityRole, Platform as Platform$2 } from 'react-native';
|
|
7
7
|
export { default as merge } from 'lodash/merge';
|
|
8
8
|
|
|
9
|
-
declare const metaAttribute: (name
|
|
9
|
+
declare const metaAttribute: ({ name, testID, }: {
|
|
10
|
+
name?: string | undefined;
|
|
11
|
+
testID?: string | undefined;
|
|
12
|
+
}) => Record<string, string>;
|
|
10
13
|
|
|
11
14
|
declare const MetaConstants: {
|
|
12
15
|
readonly ActionList: "action-list";
|
|
@@ -16,6 +19,7 @@ declare const MetaConstants: {
|
|
|
16
19
|
readonly ActionListSection: "action-list-section";
|
|
17
20
|
readonly Alert: "alert";
|
|
18
21
|
readonly Badge: "badge";
|
|
22
|
+
readonly Box: "Box";
|
|
19
23
|
readonly Button: "button";
|
|
20
24
|
readonly Checkbox: "checkbox";
|
|
21
25
|
readonly CheckboxGroup: "checkbox-group";
|
|
@@ -40,21 +44,77 @@ declare const MetaConstants: {
|
|
|
40
44
|
readonly CardBody: "card-body";
|
|
41
45
|
readonly CardHeader: "card-header";
|
|
42
46
|
readonly CardFooter: "card-footer";
|
|
47
|
+
readonly VisuallyHidden: "visually-hidden";
|
|
43
48
|
};
|
|
44
49
|
|
|
45
50
|
type Breakpoints = Readonly<{
|
|
46
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* `base` is used for responsive styling following a **mobile first** approach. It starts from 0px till the next existing token
|
|
53
|
+
*
|
|
54
|
+
* Think of this as styles without any media query.
|
|
55
|
+
*
|
|
56
|
+
* ### Example
|
|
57
|
+
*
|
|
58
|
+
* This code will set margin as `spacing.2` on "m" size screens and above. And as `spacing.1` on less than "m" size screens
|
|
59
|
+
* ```jsx
|
|
60
|
+
* <Box margin={{ base: 'spacing.1', m: 'spacing.2' }} />
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* This roughly translates into -
|
|
64
|
+
*
|
|
65
|
+
* ```
|
|
66
|
+
* .Box {
|
|
67
|
+
* margin: 'spacing.1';
|
|
68
|
+
* }
|
|
69
|
+
*
|
|
70
|
+
* @media screen and (min-width: 768px) {
|
|
71
|
+
* .Box {
|
|
72
|
+
* margin: 'spacing.2';
|
|
73
|
+
* }
|
|
74
|
+
* }
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
base: number;
|
|
78
|
+
/**
|
|
79
|
+
* `@media screen and (min-width: 320px)`
|
|
80
|
+
*
|
|
81
|
+
* Small Mobiles
|
|
82
|
+
*/
|
|
47
83
|
xs: number;
|
|
48
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* `@media screen and (min-width: 480px)`
|
|
86
|
+
*
|
|
87
|
+
* Mobiles and Small Tablets
|
|
88
|
+
*/
|
|
49
89
|
s: number;
|
|
50
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* `@media screen and (min-width: 768px)`
|
|
92
|
+
*
|
|
93
|
+
* Medium and Large Tablets.
|
|
94
|
+
*
|
|
95
|
+
* Dimensions with `m` and above can be treated as desktop in mobile-first approach (with min-width).
|
|
96
|
+
* Hence this breakpoint can be used for desktop styling.
|
|
97
|
+
*
|
|
98
|
+
* E.g. next example will keep flexDirection `row` on mobiles and `column` on large tablets, desktop, and larger screens
|
|
99
|
+
*
|
|
100
|
+
* ```jsx
|
|
101
|
+
* <Box display="flex" flexDirection={{ base: 'row', m: 'column' }} />
|
|
102
|
+
* ```
|
|
103
|
+
*
|
|
104
|
+
*/
|
|
51
105
|
m: number;
|
|
52
|
-
/**
|
|
106
|
+
/**
|
|
107
|
+
* `@media screen and (min-width: 1024px)`
|
|
108
|
+
*
|
|
109
|
+
* Desktop
|
|
110
|
+
*/
|
|
53
111
|
l: number;
|
|
54
|
-
/**
|
|
112
|
+
/**
|
|
113
|
+
* `@media screen and (min-width: 1200px)`
|
|
114
|
+
*
|
|
115
|
+
* HD Desktop
|
|
116
|
+
*/
|
|
55
117
|
xl: number;
|
|
56
|
-
/** min width: 1201px */
|
|
57
|
-
max: number;
|
|
58
118
|
}>;
|
|
59
119
|
|
|
60
120
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
@@ -98,6 +158,11 @@ type ColorSchemeNamesInput = ColorSchemeNames | 'system';
|
|
|
98
158
|
|
|
99
159
|
declare const getColorScheme: (colorScheme?: ColorSchemeNamesInput) => ColorSchemeNames;
|
|
100
160
|
|
|
161
|
+
declare const getMediaQuery: ({ min, max }: {
|
|
162
|
+
min: number;
|
|
163
|
+
max?: number | undefined;
|
|
164
|
+
}) => string;
|
|
165
|
+
|
|
101
166
|
declare type PlatformTypes = 'browser' | 'node' | 'react-native' | 'unknown';
|
|
102
167
|
declare const getPlatformType: () => PlatformTypes;
|
|
103
168
|
|
|
@@ -478,4 +543,4 @@ declare const castNativeType: <T>(value: T) => Extract<T, {
|
|
|
478
543
|
__brand__?: "platform-all" | "platform-native" | undefined;
|
|
479
544
|
}>;
|
|
480
545
|
|
|
481
|
-
export { AccessibilityKeys, AccessibilityMap, AccessibilityProps, AriaAttributes, AriaRoles, DeepPartial, MakeSize, MetaConstants, Platform, PlatformTypes, UseColorScheme, WithComponentId, castNativeType, castWebType, getColorScheme, getComponentId, getOS, getPlatformType, isAndroid, isPartialMatchObjectKeys, isReactNative, isValidAllowedChildren, makeAccessible, makeBezier, makeBorderSize, makeMotionTime, makeSize, makeSpace, makeTypographySize, metaAttribute, setupMatchMediaMock, testID, toTitleCase, useBreakpoint, useColorScheme, usePrevious };
|
|
546
|
+
export { AccessibilityKeys, AccessibilityMap, AccessibilityProps, AriaAttributes, AriaRoles, DeepPartial, MakeSize, MetaConstants, Platform, PlatformTypes, UseColorScheme, WithComponentId, castNativeType, castWebType, getColorScheme, getComponentId, getMediaQuery, getOS, getPlatformType, isAndroid, isPartialMatchObjectKeys, isReactNative, isValidAllowedChildren, makeAccessible, makeBezier, makeBorderSize, makeMotionTime, makeSize, makeSpace, makeTypographySize, metaAttribute, setupMatchMediaMock, testID, toTitleCase, useBreakpoint, useColorScheme, usePrevious };
|
|
@@ -7,7 +7,10 @@ import { AccessibilityRole, Platform as Platform$2 } from 'react-native';
|
|
|
7
7
|
import { EasingFunctionFactory } from 'react-native-reanimated';
|
|
8
8
|
export { default as merge } from 'lodash/merge';
|
|
9
9
|
|
|
10
|
-
declare const metaAttribute: (
|
|
10
|
+
declare const metaAttribute: ({ testID }: {
|
|
11
|
+
name?: string | undefined;
|
|
12
|
+
testID?: string | undefined;
|
|
13
|
+
}) => Record<string, string>;
|
|
11
14
|
|
|
12
15
|
declare const MetaConstants: {
|
|
13
16
|
readonly ActionList: "action-list";
|
|
@@ -17,6 +20,7 @@ declare const MetaConstants: {
|
|
|
17
20
|
readonly ActionListSection: "action-list-section";
|
|
18
21
|
readonly Alert: "alert";
|
|
19
22
|
readonly Badge: "badge";
|
|
23
|
+
readonly Box: "Box";
|
|
20
24
|
readonly Button: "button";
|
|
21
25
|
readonly Checkbox: "checkbox";
|
|
22
26
|
readonly CheckboxGroup: "checkbox-group";
|
|
@@ -41,21 +45,77 @@ declare const MetaConstants: {
|
|
|
41
45
|
readonly CardBody: "card-body";
|
|
42
46
|
readonly CardHeader: "card-header";
|
|
43
47
|
readonly CardFooter: "card-footer";
|
|
48
|
+
readonly VisuallyHidden: "visually-hidden";
|
|
44
49
|
};
|
|
45
50
|
|
|
46
51
|
type Breakpoints = Readonly<{
|
|
47
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* `base` is used for responsive styling following a **mobile first** approach. It starts from 0px till the next existing token
|
|
54
|
+
*
|
|
55
|
+
* Think of this as styles without any media query.
|
|
56
|
+
*
|
|
57
|
+
* ### Example
|
|
58
|
+
*
|
|
59
|
+
* This code will set margin as `spacing.2` on "m" size screens and above. And as `spacing.1` on less than "m" size screens
|
|
60
|
+
* ```jsx
|
|
61
|
+
* <Box margin={{ base: 'spacing.1', m: 'spacing.2' }} />
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* This roughly translates into -
|
|
65
|
+
*
|
|
66
|
+
* ```
|
|
67
|
+
* .Box {
|
|
68
|
+
* margin: 'spacing.1';
|
|
69
|
+
* }
|
|
70
|
+
*
|
|
71
|
+
* @media screen and (min-width: 768px) {
|
|
72
|
+
* .Box {
|
|
73
|
+
* margin: 'spacing.2';
|
|
74
|
+
* }
|
|
75
|
+
* }
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
base: number;
|
|
79
|
+
/**
|
|
80
|
+
* `@media screen and (min-width: 320px)`
|
|
81
|
+
*
|
|
82
|
+
* Small Mobiles
|
|
83
|
+
*/
|
|
48
84
|
xs: number;
|
|
49
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* `@media screen and (min-width: 480px)`
|
|
87
|
+
*
|
|
88
|
+
* Mobiles and Small Tablets
|
|
89
|
+
*/
|
|
50
90
|
s: number;
|
|
51
|
-
/**
|
|
91
|
+
/**
|
|
92
|
+
* `@media screen and (min-width: 768px)`
|
|
93
|
+
*
|
|
94
|
+
* Medium and Large Tablets.
|
|
95
|
+
*
|
|
96
|
+
* Dimensions with `m` and above can be treated as desktop in mobile-first approach (with min-width).
|
|
97
|
+
* Hence this breakpoint can be used for desktop styling.
|
|
98
|
+
*
|
|
99
|
+
* E.g. next example will keep flexDirection `row` on mobiles and `column` on large tablets, desktop, and larger screens
|
|
100
|
+
*
|
|
101
|
+
* ```jsx
|
|
102
|
+
* <Box display="flex" flexDirection={{ base: 'row', m: 'column' }} />
|
|
103
|
+
* ```
|
|
104
|
+
*
|
|
105
|
+
*/
|
|
52
106
|
m: number;
|
|
53
|
-
/**
|
|
107
|
+
/**
|
|
108
|
+
* `@media screen and (min-width: 1024px)`
|
|
109
|
+
*
|
|
110
|
+
* Desktop
|
|
111
|
+
*/
|
|
54
112
|
l: number;
|
|
55
|
-
/**
|
|
113
|
+
/**
|
|
114
|
+
* `@media screen and (min-width: 1200px)`
|
|
115
|
+
*
|
|
116
|
+
* HD Desktop
|
|
117
|
+
*/
|
|
56
118
|
xl: number;
|
|
57
|
-
/** min width: 1201px */
|
|
58
|
-
max: number;
|
|
59
119
|
}>;
|
|
60
120
|
|
|
61
121
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
@@ -99,6 +159,11 @@ type ColorSchemeNamesInput = ColorSchemeNames | 'system';
|
|
|
99
159
|
|
|
100
160
|
declare const getColorScheme: (colorScheme?: ColorSchemeNamesInput) => ColorSchemeNames;
|
|
101
161
|
|
|
162
|
+
declare const getMediaQuery: ({ min, max }: {
|
|
163
|
+
min: number;
|
|
164
|
+
max?: number | undefined;
|
|
165
|
+
}) => string;
|
|
166
|
+
|
|
102
167
|
declare type PlatformTypes = 'browser' | 'node' | 'react-native' | 'unknown';
|
|
103
168
|
declare const getPlatformType: () => PlatformTypes;
|
|
104
169
|
|
|
@@ -477,4 +542,4 @@ declare const castNativeType: <T>(value: T) => Extract<T, {
|
|
|
477
542
|
__brand__?: "platform-native" | "platform-all" | undefined;
|
|
478
543
|
}>;
|
|
479
544
|
|
|
480
|
-
export { AccessibilityKeys, AccessibilityMap, AccessibilityProps, AriaAttributes, AriaRoles, DeepPartial, MakeSize, MetaConstants, Platform, PlatformTypes, UseColorScheme, WithComponentId, castNativeType, castWebType, getColorScheme, getComponentId, getOS, getPlatformType, isAndroid, isPartialMatchObjectKeys, isReactNative, isValidAllowedChildren, makeAccessible, makeBezier, makeBorderSize, makeMotionTime, makeSize, makeSpace, makeTypographySize, metaAttribute, setupMatchMediaMock, testID, toTitleCase, useBreakpoint, useColorScheme, usePrevious };
|
|
545
|
+
export { AccessibilityKeys, AccessibilityMap, AccessibilityProps, AriaAttributes, AriaRoles, DeepPartial, MakeSize, MetaConstants, Platform, PlatformTypes, UseColorScheme, WithComponentId, castNativeType, castWebType, getColorScheme, getComponentId, getMediaQuery, getOS, getPlatformType, isAndroid, isPartialMatchObjectKeys, isReactNative, isValidAllowedChildren, makeAccessible, makeBezier, makeBorderSize, makeMotionTime, makeSize, makeSpace, makeTypographySize, metaAttribute, setupMatchMediaMock, testID, toTitleCase, useBreakpoint, useColorScheme, usePrevious };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import _extends from '@babel/runtime/helpers/extends';
|
|
1
2
|
import { Appearance, Platform as Platform$1 } from 'react-native';
|
|
2
3
|
import React, { useMemo, useCallback, useState, useEffect, useRef } from 'react';
|
|
3
4
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
5
|
import _defineProperty$1 from '@babel/runtime/helpers/defineProperty';
|
|
5
|
-
import _extends from '@babel/runtime/helpers/extends';
|
|
6
6
|
import { Easing } from 'react-native-reanimated';
|
|
7
7
|
|
|
8
8
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -2789,9 +2789,9 @@ function cloneDeep(value) {
|
|
|
2789
2789
|
|
|
2790
2790
|
var cloneDeep_1 = cloneDeep;
|
|
2791
2791
|
|
|
2792
|
-
var metaAttribute=function metaAttribute(
|
|
2792
|
+
var metaAttribute=function metaAttribute(_ref){var testID=_ref.testID;return _extends({},testID?{testID:testID}:{});};
|
|
2793
2793
|
|
|
2794
|
-
var MetaConstants={ActionList:'action-list',ActionListFooter:'action-list-footer',ActionListHeader:'action-list-header',ActionListItem:'action-list-item',ActionListSection:'action-list-section',Alert:'alert',Badge:'badge',Button:'button',Checkbox:'checkbox',CheckboxGroup:'checkbox-group',Code:'code',Component:'blade-component',Counter:'counter',DropdownOverlay:'dropdown-overlay',Icon:'icon',IconButton:'icon-button',Indicator:'indicator',Link:'link',List:'list',ListItem:'list-item',OTPInput:'otp-input',ProgressBar:'progress-bar',Radio:'radio',RadioGroup:'radio-group',SkipNav:'skipnav',Spinner:'spinner',SelectInput:'select-input',Card:'card',CardBody:'card-body',CardHeader:'card-header',CardFooter:'card-footer'};
|
|
2794
|
+
var MetaConstants={ActionList:'action-list',ActionListFooter:'action-list-footer',ActionListHeader:'action-list-header',ActionListItem:'action-list-item',ActionListSection:'action-list-section',Alert:'alert',Badge:'badge',Box:'Box',Button:'button',Checkbox:'checkbox',CheckboxGroup:'checkbox-group',Code:'code',Component:'blade-component',Counter:'counter',DropdownOverlay:'dropdown-overlay',Icon:'icon',IconButton:'icon-button',Indicator:'indicator',Link:'link',List:'list',ListItem:'list-item',OTPInput:'otp-input',ProgressBar:'progress-bar',Radio:'radio',RadioGroup:'radio-group',SkipNav:'skipnav',Spinner:'spinner',SelectInput:'select-input',Card:'card',CardBody:'card-body',CardHeader:'card-header',CardFooter:'card-footer',VisuallyHidden:'visually-hidden'};
|
|
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
|
|
|
@@ -3177,6 +3177,8 @@ function get(object, path, defaultValue) {
|
|
|
3177
3177
|
|
|
3178
3178
|
var get_1 = get;
|
|
3179
3179
|
|
|
3180
|
+
var getMediaQuery=function getMediaQuery(_ref){var min=_ref.min,max=_ref.max;return "screen and (min-width: "+min+"px)"+(max?" and (max-width: "+max+"px)":'');};
|
|
3181
|
+
|
|
3180
3182
|
var getPlatformType=function getPlatformType(){if(typeof navigator!=='undefined'&&navigator.product==='ReactNative'){return 'react-native';}if(typeof document!=='undefined'){return 'browser';}if(typeof process!=='undefined'){return 'node';}return 'unknown';};
|
|
3181
3183
|
|
|
3182
3184
|
var baseKeys = _baseKeys,
|
|
@@ -4537,7 +4539,7 @@ var testID=function testID(defaultKey){return {testID:defaultKey};};
|
|
|
4537
4539
|
|
|
4538
4540
|
var toTitleCase=function toTitleCase(inputString){return inputString.toLowerCase().split(' ').map(function(word){return word.charAt(0).toUpperCase()+word.slice(1);}).join(' ');};
|
|
4539
4541
|
|
|
4540
|
-
var deviceType={desktop:'desktop',mobile:'mobile'};var useBreakpoint=function useBreakpoint(_ref){var _window;var breakpoints=_ref.breakpoints;var supportsMatchMedia=typeof document!=='undefined'&&typeof window!=='undefined'&&typeof((_window=window)==null?void 0:_window.matchMedia)==='function';var breakpointsTokenAndQueryCollection=useMemo(function(){return supportsMatchMedia?Object.entries(breakpoints).map(function(_ref2,index,breakpointsArray){var _ref3=_slicedToArray(_ref2,2),token=_ref3[0],screenSize=_ref3[1];var
|
|
4542
|
+
var deviceType={desktop:'desktop',mobile:'mobile'};var useBreakpoint=function useBreakpoint(_ref){var _window;var breakpoints=_ref.breakpoints;var supportsMatchMedia=typeof document!=='undefined'&&typeof window!=='undefined'&&typeof((_window=window)==null?void 0:_window.matchMedia)==='function';var breakpointsTokenAndQueryCollection=useMemo(function(){return supportsMatchMedia?Object.entries(breakpoints).map(function(_ref2,index,breakpointsArray){var _breakpointsArray;var _ref3=_slicedToArray(_ref2,2),token=_ref3[0],screenSize=_ref3[1];var min=screenSize;var maxValue=(_breakpointsArray=breakpointsArray[index+1])==null?void 0:_breakpointsArray[1];var mediaQuery=getMediaQuery({min:min,max:maxValue?maxValue-1:undefined});return {token:token,screenSize:screenSize,mediaQuery:mediaQuery};}):[];},[breakpoints,supportsMatchMedia]);var getMatchedDeviceType=useCallback(function(matchedBreakpoint){var matchedDeviceType=deviceType.mobile;var platform=getPlatformType();if(platform==='react-native'){matchedDeviceType=deviceType.mobile;}else if(platform==='browser'){if(matchedBreakpoint&&['base','xs','s'].includes(matchedBreakpoint)){matchedDeviceType=deviceType.mobile;}else {matchedDeviceType=deviceType.desktop;}}else if(platform==='node'){matchedDeviceType=deviceType.desktop;}return matchedDeviceType;},[]);var getMatchedBreakpoint=useCallback(function(event){var _breakpointsTokenAndQ,_breakpointsTokenAndQ2;var matchedBreakpoint=(_breakpointsTokenAndQ=(_breakpointsTokenAndQ2=breakpointsTokenAndQueryCollection.find(function(_ref4){var _ref4$mediaQuery=_ref4.mediaQuery,mediaQuery=_ref4$mediaQuery===void 0?'':_ref4$mediaQuery;if((event==null?void 0:event.media)===mediaQuery){return true;}if(window.matchMedia(mediaQuery).matches){return true;}return false;}))==null?void 0:_breakpointsTokenAndQ2.token)!=null?_breakpointsTokenAndQ:undefined;return matchedBreakpoint;},[breakpointsTokenAndQueryCollection]);var _useState=useState(function(){var matchedBreakpoint=getMatchedBreakpoint();var matchedDeviceType=getMatchedDeviceType(matchedBreakpoint);return {matchedBreakpoint:matchedBreakpoint,matchedDeviceType:matchedDeviceType};}),_useState2=_slicedToArray(_useState,2),breakpointAndDevice=_useState2[0],setBreakpointAndDevice=_useState2[1];useEffect(function(){if(!supportsMatchMedia){return undefined;}var handleMediaQueryChange=function handleMediaQueryChange(event){setBreakpointAndDevice(function(){var matchedBreakpoint=getMatchedBreakpoint(event);var matchedDeviceType=getMatchedDeviceType(matchedBreakpoint);return {matchedBreakpoint:matchedBreakpoint,matchedDeviceType:matchedDeviceType};});};var mediaQueryInstances=breakpointsTokenAndQueryCollection.map(function(_ref5){var _ref5$mediaQuery=_ref5.mediaQuery,mediaQuery=_ref5$mediaQuery===void 0?'':_ref5$mediaQuery;var mediaQueryInstance=window.matchMedia(mediaQuery);if(mediaQueryInstance.addEventListener){mediaQueryInstance.addEventListener('change',handleMediaQueryChange);}else {mediaQueryInstance.addListener(handleMediaQueryChange);}return mediaQueryInstance;});return function(){mediaQueryInstances.forEach(function(mediaQueryInstance){if(mediaQueryInstance.removeEventListener){mediaQueryInstance.removeEventListener('change',handleMediaQueryChange);}else {mediaQueryInstance.removeListener(handleMediaQueryChange);}});};},[breakpointsTokenAndQueryCollection,getMatchedBreakpoint,getMatchedDeviceType,supportsMatchMedia]);return breakpointAndDevice;};
|
|
4541
4543
|
|
|
4542
4544
|
var fontFamily={text:'Lato',code:Platform$1.OS==='ios'?'Courier':'monospace'};
|
|
4543
4545
|
|
|
@@ -4559,5 +4561,5 @@ var Platform;(function(_Platform){})(Platform||(Platform={}));
|
|
|
4559
4561
|
|
|
4560
4562
|
var castWebType=function castWebType(value){return value;};var castNativeType=function castNativeType(value){return value;};
|
|
4561
4563
|
|
|
4562
|
-
export { MetaConstants, Platform, castNativeType, castWebType, cloneDeep_1 as cloneDeep, getColorScheme, getComponentId, get_1 as getIn, getOS, getPlatformType, isAndroid, 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 };
|
|
4564
|
+
export { MetaConstants, Platform, castNativeType, castWebType, cloneDeep_1 as cloneDeep, getColorScheme, getComponentId, get_1 as getIn, getMediaQuery, getOS, getPlatformType, isAndroid, 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 };
|
|
4563
4565
|
//# sourceMappingURL=index.native.js.map
|