@razorpay/blade 7.0.4 → 7.1.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 +10 -0
- package/build/components/index.d.ts +38 -2
- package/build/components/index.native.d.ts +11 -2
- package/build/components/index.native.js +40 -24
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.web.js +4614 -1848
- 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/utils/index.d.ts +38 -1
- package/build/utils/index.native.d.ts +38 -1
- package/build/utils/index.native.js +3 -1
- package/build/utils/index.native.js.map +1 -1
- package/build/utils/index.web.js +39 -1
- package/build/utils/index.web.js.map +1 -1
- package/package.json +5 -2
package/build/utils/index.d.ts
CHANGED
|
@@ -538,4 +538,41 @@ declare const castNativeType: <T>(value: T) => Extract<T, {
|
|
|
538
538
|
__brand__?: "platform-all" | "platform-native" | undefined;
|
|
539
539
|
}>;
|
|
540
540
|
|
|
541
|
-
|
|
541
|
+
/**
|
|
542
|
+
* Do you want to define `displayName` or `componentId` on your component? Use this instead to make sure treeshaking doesn't break.
|
|
543
|
+
*
|
|
544
|
+
* ## Usage
|
|
545
|
+
*
|
|
546
|
+
* ### ❌ Incorrect Code (Breaks treeshaking)
|
|
547
|
+
*
|
|
548
|
+
* ```ts
|
|
549
|
+
* const _MyComponent = () => {};
|
|
550
|
+
* const MyComponent = React.forwardRef(_MyComponent);
|
|
551
|
+
* const MyComponent.displayName = 'MyComponent'; // this breaks treeshaking
|
|
552
|
+
*
|
|
553
|
+
* export { MyComponent }
|
|
554
|
+
* ```
|
|
555
|
+
*
|
|
556
|
+
* ### ✅ Correct Code (No Side-Effects. Treeshaking continues to work)
|
|
557
|
+
*
|
|
558
|
+
* ```ts
|
|
559
|
+
* const _MyComponent = () => {};
|
|
560
|
+
* const MyComponentWithRef = React.forwardRef(_MyComponent);
|
|
561
|
+
* const MyComponent = assignWithoutSideEffects(
|
|
562
|
+
* MyComponentWithRef,
|
|
563
|
+
* { displayName: 'MyComponent' }
|
|
564
|
+
* );
|
|
565
|
+
*
|
|
566
|
+
* export { MyComponent }
|
|
567
|
+
* ```
|
|
568
|
+
*
|
|
569
|
+
* Checkout other components like [Button.tsx](../../components/Button/Button/Button.tsx), [SelectInput.tsx](../../components/Input/SelectInput/SelectInput.tsx) for example.
|
|
570
|
+
*
|
|
571
|
+
* _Note: You don't have to add PURE comment to this function as it is added during build-time by our `manualPureFunctions` babel plugin_
|
|
572
|
+
*/
|
|
573
|
+
declare const assignWithoutSideEffects: <T extends {}>(component: T, sourceObj: {
|
|
574
|
+
displayName?: string;
|
|
575
|
+
componentId?: string;
|
|
576
|
+
}) => T;
|
|
577
|
+
|
|
578
|
+
export { AccessibilityKeys, AccessibilityMap, AccessibilityProps, AriaAttributes, AriaRoles, DeepPartial, MakeSize, MetaConstants, Platform, PlatformTypes, UseColorScheme, assignWithoutSideEffects, 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 };
|
|
@@ -537,4 +537,41 @@ declare const castNativeType: <T>(value: T) => Extract<T, {
|
|
|
537
537
|
__brand__?: "platform-native" | "platform-all" | undefined;
|
|
538
538
|
}>;
|
|
539
539
|
|
|
540
|
-
|
|
540
|
+
/**
|
|
541
|
+
* Do you want to define `displayName` or `componentId` on your component? Use this instead to make sure treeshaking doesn't break.
|
|
542
|
+
*
|
|
543
|
+
* ## Usage
|
|
544
|
+
*
|
|
545
|
+
* ### ❌ Incorrect Code (Breaks treeshaking)
|
|
546
|
+
*
|
|
547
|
+
* ```ts
|
|
548
|
+
* const _MyComponent = () => {};
|
|
549
|
+
* const MyComponent = React.forwardRef(_MyComponent);
|
|
550
|
+
* const MyComponent.displayName = 'MyComponent'; // this breaks treeshaking
|
|
551
|
+
*
|
|
552
|
+
* export { MyComponent }
|
|
553
|
+
* ```
|
|
554
|
+
*
|
|
555
|
+
* ### ✅ Correct Code (No Side-Effects. Treeshaking continues to work)
|
|
556
|
+
*
|
|
557
|
+
* ```ts
|
|
558
|
+
* const _MyComponent = () => {};
|
|
559
|
+
* const MyComponentWithRef = React.forwardRef(_MyComponent);
|
|
560
|
+
* const MyComponent = assignWithoutSideEffects(
|
|
561
|
+
* MyComponentWithRef,
|
|
562
|
+
* { displayName: 'MyComponent' }
|
|
563
|
+
* );
|
|
564
|
+
*
|
|
565
|
+
* export { MyComponent }
|
|
566
|
+
* ```
|
|
567
|
+
*
|
|
568
|
+
* Checkout other components like [Button.tsx](../../components/Button/Button/Button.tsx), [SelectInput.tsx](../../components/Input/SelectInput/SelectInput.tsx) for example.
|
|
569
|
+
*
|
|
570
|
+
* _Note: You don't have to add PURE comment to this function as it is added during build-time by our `manualPureFunctions` babel plugin_
|
|
571
|
+
*/
|
|
572
|
+
declare const assignWithoutSideEffects: <T extends {}>(component: T, sourceObj: {
|
|
573
|
+
displayName?: string;
|
|
574
|
+
componentId?: string;
|
|
575
|
+
}) => T;
|
|
576
|
+
|
|
577
|
+
export { AccessibilityKeys, AccessibilityMap, AccessibilityProps, AriaAttributes, AriaRoles, DeepPartial, MakeSize, MetaConstants, Platform, PlatformTypes, UseColorScheme, assignWithoutSideEffects, 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 };
|
|
@@ -4561,5 +4561,7 @@ var Platform;(function(_Platform){})(Platform||(Platform={}));
|
|
|
4561
4561
|
|
|
4562
4562
|
var castWebType=function castWebType(value){return value;};var castNativeType=function castNativeType(value){return value;};
|
|
4563
4563
|
|
|
4564
|
-
|
|
4564
|
+
var assignWithoutSideEffects=function assignWithoutSideEffects(component,sourceObj){return _extends(component,sourceObj);};
|
|
4565
|
+
|
|
4566
|
+
export { MetaConstants, Platform, assignWithoutSideEffects, 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 };
|
|
4565
4567
|
//# sourceMappingURL=index.native.js.map
|