From 2da39dc10c585d9ba77125d749980e219b464a1a Mon Sep 17 00:00:00 2001 From: Suraj Ahmed Date: Wed, 17 Aug 2022 17:41:42 +0530 Subject: [PATCH 1/4] v3.4.13 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fea807ae7..abc9d554e 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "prettier --write" ] }, - "version": "3.4.13-rc.0", + "version": "3.4.13", "license": "MIT", "private": false, "main": "lib/commonjs/index", From 9e940709462f0424042f9457c02267815a9b450a Mon Sep 17 00:00:00 2001 From: Suraj Ahmed Date: Mon, 22 Aug 2022 13:35:12 +0530 Subject: [PATCH 2/4] fix: dataSet issue on web --- src/hooks/useStyledSystemPropsResolver.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/useStyledSystemPropsResolver.ts b/src/hooks/useStyledSystemPropsResolver.ts index 8c0e3c003..0781fb21e 100644 --- a/src/hooks/useStyledSystemPropsResolver.ts +++ b/src/hooks/useStyledSystemPropsResolver.ts @@ -69,7 +69,7 @@ export const useStyledSystemPropsResolver = ({ console.log('style,resprops', currentBreakpoint); } - restProps.dataSet = dataSet; + restProps.dataSet = { ...restProps.dataSet, ...dataSet }; return [style, restProps]; }; From 55a1a762396f7ec8ed5d2cef00e7d1f00f19bbb2 Mon Sep 17 00:00:00 2001 From: ankit-tailor Date: Mon, 22 Aug 2022 13:36:51 +0530 Subject: [PATCH 3/4] fix: responsive props resolution --- .../useThemeProps/usePropsResolution.tsx | 87 +++++++++---------- 1 file changed, 39 insertions(+), 48 deletions(-) diff --git a/src/hooks/useThemeProps/usePropsResolution.tsx b/src/hooks/useThemeProps/usePropsResolution.tsx index f523d3413..c1b245b56 100644 --- a/src/hooks/useThemeProps/usePropsResolution.tsx +++ b/src/hooks/useThemeProps/usePropsResolution.tsx @@ -232,13 +232,9 @@ export const usePropsResolutionWithComponentTheme = ( const resolveComponentTheme = ( themeType: Array, - providedTheme: any, - config?: any + providedTheme: any ): any => { try { - if (config?.colorScheme) { - incomingWithDefaultProps.colorScheme = config.colorScheme; - } if (themeType[1]) { return typeof providedTheme[themeType[0]][themeType[1]] !== 'function' ? providedTheme[themeType[0]][themeType[1]] @@ -290,36 +286,7 @@ export const usePropsResolutionWithComponentTheme = ( cleanIncomingProps ); - //TODO: hack - // 2. Flatten incomingDefaultProps - let flattenProps: any, specificityMap; - [flattenProps, specificityMap] = callPropsFlattener( - incomingWithDefaultProps, - {}, - 2 - ); - const responsiveProps = {}; - if (disableCSSMediaQueries) { - // STEP 1.5: resolving responsive props - resolveResponsively.map((propsName) => { - if (flattenProps[propsName]) { - // @ts-ignore - responsiveProps[propsName] = flattenProps[propsName]; - } - }); - } - if (resolveResponsively.includes('direction')) { - const propName = 'direction'; - if (flattenProps[propName]) { - // @ts-ignore - responsiveProps[propName] = flattenProps[propName]; - } - } - const responsivelyResolvedProps: any = useBreakpointResolvedProps( - responsiveProps - ); - - // STEP 2: resolving component theme + // STEP 1.5: resolving component theme let combinedBaseStyle = {}; let combinedVariantStyle = {}; let combinedSizeStyle = {}; @@ -330,45 +297,44 @@ export const usePropsResolutionWithComponentTheme = ( ...resolveComponentTheme(['baseStyle'], extededComponentTheme), }; } - if (responsivelyResolvedProps.variant) { + if (incomingWithDefaultProps.variant) { if (extededComponentTheme.variants) { combinedVariantStyle = { ...combinedVariantStyle, ...resolveComponentTheme( - ['variants', responsivelyResolvedProps.variant], - extededComponentTheme, - { colorScheme: responsivelyResolvedProps?.colorScheme } + ['variants', incomingWithDefaultProps.variant], + extededComponentTheme ), }; } } if ( - responsivelyResolvedProps.size && + incomingWithDefaultProps.size && extededComponentTheme?.sizes && - extededComponentTheme?.sizes[responsivelyResolvedProps.size] + extededComponentTheme?.sizes[incomingWithDefaultProps.size] ) { if ( - typeof extededComponentTheme.sizes[responsivelyResolvedProps.size] === + typeof extededComponentTheme.sizes[incomingWithDefaultProps.size] === 'string' || - typeof extededComponentTheme.sizes[responsivelyResolvedProps.size] === + typeof extededComponentTheme.sizes[incomingWithDefaultProps.size] === 'number' ) { - responsivelyResolvedProps.size = - extededComponentTheme.sizes[responsivelyResolvedProps.size]; + incomingWithDefaultProps.size = + extededComponentTheme.sizes[incomingWithDefaultProps.size]; } else { combinedSizeStyle = { ...combinedSizeStyle, ...resolveComponentTheme( - ['sizes', responsivelyResolvedProps.size], + ['sizes', incomingWithDefaultProps.size], extededComponentTheme ), }; - responsivelyResolvedProps.size = undefined; + incomingWithDefaultProps.size = undefined; } } }); - // STEP 2.5: flatten them + // STEP 2: flatten them if (process.env.NODE_ENV === 'development' && cleanIncomingProps.debug) { /* eslint-disable-next-line */ console.log( @@ -376,6 +342,31 @@ export const usePropsResolutionWithComponentTheme = ( 'background: #4b5563; color: #FFF; font-weight: 700; padding: 2px 8px;' ); } + //TODO: hack + let flattenProps: any, specificityMap; + [flattenProps, specificityMap] = callPropsFlattener( + incomingWithDefaultProps, + {}, + 2 + ); + const responsiveProps = {}; + if (disableCSSMediaQueries) { + // STEP 2.5: resolving responsive props + resolveResponsively.map((propsName) => { + if (flattenProps[propsName]) { + // @ts-ignore + responsiveProps[propsName] = flattenProps[propsName]; + } + }); + } + if (resolveResponsively.includes('direction')) { + const propName = 'direction'; + if (flattenProps[propName]) { + // @ts-ignore + responsiveProps[propName] = flattenProps[propName]; + } + } + const responsivelyResolvedProps = useBreakpointResolvedProps(responsiveProps); flattenProps = { ...flattenProps, From cb5cc6b1988d1964a32c84e1468d3bbe02cc17eb Mon Sep 17 00:00:00 2001 From: Suraj Ahmed Date: Mon, 22 Aug 2022 13:40:12 +0530 Subject: [PATCH 4/4] v3.4.14-rc.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index abc9d554e..a4a3c8326 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "prettier --write" ] }, - "version": "3.4.13", + "version": "3.4.14-rc.0", "license": "MIT", "private": false, "main": "lib/commonjs/index",