From 150569ead77c850f582e1b4d8beecaf752c48a35 Mon Sep 17 00:00:00 2001 From: viraj-10 Date: Mon, 11 Nov 2024 19:02:46 +0530 Subject: [PATCH 1/8] fix: next js issue --- .../src/core-components/nativewind/icon/index.web.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/example/storybook-nativewind/src/core-components/nativewind/icon/index.web.tsx b/example/storybook-nativewind/src/core-components/nativewind/icon/index.web.tsx index 5088e2a15..c95bd1c6d 100644 --- a/example/storybook-nativewind/src/core-components/nativewind/icon/index.web.tsx +++ b/example/storybook-nativewind/src/core-components/nativewind/icon/index.web.tsx @@ -1,3 +1,4 @@ +'use client'; import React, { useMemo } from 'react'; import { createIcon } from '@gluestack-ui/icon'; import { tva } from '@gluestack-ui/nativewind-utils/tva'; From 9b1b6d9f46c562a6a5d593c88ac16f55c6e8a6e9 Mon Sep 17 00:00:00 2001 From: rajat693 Date: Tue, 12 Nov 2024 16:29:42 +0530 Subject: [PATCH 2/8] fix: drawer border and sliderThumbStyle during active state --- .../src/core-components/nativewind/drawer/index.tsx | 10 +++++----- .../src/core-components/nativewind/slider/index.tsx | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/example/storybook-nativewind/src/core-components/nativewind/drawer/index.tsx b/example/storybook-nativewind/src/core-components/nativewind/drawer/index.tsx index 09bc3aee3..1fbd0cfaf 100644 --- a/example/storybook-nativewind/src/core-components/nativewind/drawer/index.tsx +++ b/example/storybook-nativewind/src/core-components/nativewind/drawer/index.tsx @@ -81,7 +81,7 @@ const drawerBackdropStyle = tva({ }); const drawerContentStyle = tva({ - base: 'bg-background-0 overflow-scroll border border-outline-100 p-6 absolute', + base: 'bg-background-0 overflow-scroll border-outline-100 p-6 absolute', parentVariants: { size: { sm: 'w-1/4', @@ -90,10 +90,10 @@ const drawerContentStyle = tva({ full: 'w-full', }, anchor: { - left: 'h-full', - right: 'h-full', - top: 'w-full', - bottom: 'w-full', + left: 'h-full border-r', + right: 'h-full border-l', + top: 'w-full border-b', + bottom: 'w-full border-t', }, }, parentCompoundVariants: [ diff --git a/example/storybook-nativewind/src/core-components/nativewind/slider/index.tsx b/example/storybook-nativewind/src/core-components/nativewind/slider/index.tsx index 455ccd2c0..9b090a630 100644 --- a/example/storybook-nativewind/src/core-components/nativewind/slider/index.tsx +++ b/example/storybook-nativewind/src/core-components/nativewind/slider/index.tsx @@ -60,7 +60,7 @@ const sliderStyle = tva({ }); const sliderThumbStyle = tva({ - base: 'bg-primary-500 absolute rounded-full data-[focus=true]:bg-primary-600 data-[active=true]:bg-primary-600 data-[hover=true]:bg-primary-600 data-[disabled=true]:bg-primary-500 web:cursor-pointer web:active:outline-4 web:active:outline web:active:outline-primary-400 data-[focus=true]:web:outline-4 data-[focus=true]:web:outline data-[focus=true]:web:outline-primary-400 shadow-hard-1', + base: 'bg-primary-500 absolute rounded-full data-[focus=true]:bg-primary-600 data-[active=true]:bg-primary-600 data-[hover=true]:bg-primary-600 data-[disabled=true]:bg-primary-500 web:cursor-pointer web:data-[active=true]:outline web:data-[active=true]:outline-4 web:data-[active=true]:outline-primary-400 shadow-hard-1', parentVariants: { size: { From 35dcd9f8820684f6b9d0382bb3334a706cefb172 Mon Sep 17 00:00:00 2001 From: viraj-10 Date: Fri, 15 Nov 2024 16:19:37 +0530 Subject: [PATCH 3/8] v1.0.26-alpha.0 --- packages/nativewind/utils/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nativewind/utils/package.json b/packages/nativewind/utils/package.json index da9136b57..03e8ceaa4 100644 --- a/packages/nativewind/utils/package.json +++ b/packages/nativewind/utils/package.json @@ -17,7 +17,7 @@ "main": "index.js", "module": "index.js", "types": "index.d.ts", - "version": "1.0.25", + "version": "1.0.26-alpha.0", "react-native": "src/index", "source": "src/index", "scripts": { From f7d0209266db208cc7577f6365c6cd19b9297e49 Mon Sep 17 00:00:00 2001 From: viraj-10 Date: Fri, 15 Nov 2024 16:29:25 +0530 Subject: [PATCH 4/8] v1.0.26-alpha.1 --- packages/nativewind/utils/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nativewind/utils/package.json b/packages/nativewind/utils/package.json index 03e8ceaa4..e9fbbb0b7 100644 --- a/packages/nativewind/utils/package.json +++ b/packages/nativewind/utils/package.json @@ -17,7 +17,7 @@ "main": "index.js", "module": "index.js", "types": "index.d.ts", - "version": "1.0.26-alpha.0", + "version": "1.0.26-alpha.1", "react-native": "src/index", "source": "src/index", "scripts": { From c44d02216e2992bc75ad90440595d0d5a2649161 Mon Sep 17 00:00:00 2001 From: viraj-10 Date: Fri, 15 Nov 2024 17:54:48 +0530 Subject: [PATCH 5/8] v1.0.26-alpha.2 --- packages/nativewind/utils/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nativewind/utils/package.json b/packages/nativewind/utils/package.json index e9fbbb0b7..c78fea625 100644 --- a/packages/nativewind/utils/package.json +++ b/packages/nativewind/utils/package.json @@ -17,7 +17,7 @@ "main": "index.js", "module": "index.js", "types": "index.d.ts", - "version": "1.0.26-alpha.1", + "version": "1.0.26-alpha.2", "react-native": "src/index", "source": "src/index", "scripts": { From ea896bc2ecc1357dc9b2f1cef937bc1f9f00394c Mon Sep 17 00:00:00 2001 From: viraj-10 Date: Mon, 18 Nov 2024 18:37:52 +0530 Subject: [PATCH 6/8] fix: jsx issue for with context --- .../utils/context/{index.js => index.jsx} | 2 +- .../utils/context/{index.ts => index.tsx} | 0 packages/nativewind/utils/tsconfig.json | 2 +- .../utils/withStates/{index.js => index.jsx} | 6 +--- .../utils/withStyleContext/index.js | 23 -------------- .../utils/withStyleContext/index.jsx | 25 ++++++++++++++++ .../utils/withStyleContextAndStates/index.js | 29 ------------------ .../utils/withStyleContextAndStates/index.jsx | 30 +++++++++++++++++++ yarn.lock | 9 ------ 9 files changed, 58 insertions(+), 68 deletions(-) rename packages/nativewind/utils/context/{index.js => index.jsx} (80%) rename packages/nativewind/utils/context/{index.ts => index.tsx} (100%) rename packages/nativewind/utils/withStates/{index.js => index.jsx} (77%) delete mode 100644 packages/nativewind/utils/withStyleContext/index.js create mode 100644 packages/nativewind/utils/withStyleContext/index.jsx delete mode 100644 packages/nativewind/utils/withStyleContextAndStates/index.js create mode 100644 packages/nativewind/utils/withStyleContextAndStates/index.jsx diff --git a/packages/nativewind/utils/context/index.js b/packages/nativewind/utils/context/index.jsx similarity index 80% rename from packages/nativewind/utils/context/index.js rename to packages/nativewind/utils/context/index.jsx index 66461e76d..b0693066f 100644 --- a/packages/nativewind/utils/context/index.js +++ b/packages/nativewind/utils/context/index.jsx @@ -2,5 +2,5 @@ import { createContext, useContext } from 'react'; export const ParentContext = createContext({}); export const useParentContext = () => { - return useContext(ParentContext); + return useContext(ParentContext); }; diff --git a/packages/nativewind/utils/context/index.ts b/packages/nativewind/utils/context/index.tsx similarity index 100% rename from packages/nativewind/utils/context/index.ts rename to packages/nativewind/utils/context/index.tsx diff --git a/packages/nativewind/utils/tsconfig.json b/packages/nativewind/utils/tsconfig.json index 77b985f95..dacf1bff3 100644 --- a/packages/nativewind/utils/tsconfig.json +++ b/packages/nativewind/utils/tsconfig.json @@ -26,7 +26,7 @@ "esModuleInterop": true, "importsNotUsedAsValues": "error", "forceConsistentCasingInFileNames": true, - "jsx": "react", + "jsx": "preserve", "lib": ["esnext", "dom"], "module": "esnext", "moduleResolution": "node", diff --git a/packages/nativewind/utils/withStates/index.js b/packages/nativewind/utils/withStates/index.jsx similarity index 77% rename from packages/nativewind/utils/withStates/index.js rename to packages/nativewind/utils/withStates/index.jsx index 798051a1b..74c19e882 100644 --- a/packages/nativewind/utils/withStates/index.js +++ b/packages/nativewind/utils/withStates/index.jsx @@ -9,10 +9,6 @@ export const withStates = (Component) => }, [className, states]); return ( // @ts-ignore - React.createElement(Component, { - className: classNamesFinal, - ...props, - ref: ref, - }) + ); }); diff --git a/packages/nativewind/utils/withStyleContext/index.js b/packages/nativewind/utils/withStyleContext/index.js deleted file mode 100644 index 3e7d63f20..000000000 --- a/packages/nativewind/utils/withStyleContext/index.js +++ /dev/null @@ -1,23 +0,0 @@ -'use client'; -import React from 'react'; -import { ParentContext } from '../context'; -import { useParentContext } from '../context'; -export const withStyleContext = (Component, scope = 'Global') => { - return React.forwardRef(({ context, ...props }, ref) => { - let contextValues = {}; - const parentContextValues = useParentContext(); - if (parentContextValues[scope] !== undefined) { - parentContextValues[scope] = context; - contextValues = parentContextValues; - } - else { - contextValues = { ...parentContextValues, [scope]: context }; - } - return (React.createElement(ParentContext.Provider, { value: contextValues }, - React.createElement(Component, { ...props, ref: ref }))); - }); -}; -export const useStyleContext = (scope = 'Global') => { - const parentContextValues = useParentContext(); - return parentContextValues[scope]; -}; diff --git a/packages/nativewind/utils/withStyleContext/index.jsx b/packages/nativewind/utils/withStyleContext/index.jsx new file mode 100644 index 000000000..4006aa9da --- /dev/null +++ b/packages/nativewind/utils/withStyleContext/index.jsx @@ -0,0 +1,25 @@ +'use client'; +import React from 'react'; +import { ParentContext } from '../context'; +import { useParentContext } from '../context'; +export const withStyleContext = (Component, scope = 'Global') => { + return React.forwardRef(({ context, ...props }, ref) => { + let contextValues = {}; + const parentContextValues = useParentContext(); + if (parentContextValues[scope] !== undefined) { + parentContextValues[scope] = context; + contextValues = parentContextValues; + } else { + contextValues = { ...parentContextValues, [scope]: context }; + } + return ( + + + + ); + }); +}; +export const useStyleContext = (scope = 'Global') => { + const parentContextValues = useParentContext(); + return parentContextValues[scope]; +}; diff --git a/packages/nativewind/utils/withStyleContextAndStates/index.js b/packages/nativewind/utils/withStyleContextAndStates/index.js deleted file mode 100644 index 7c82f52e3..000000000 --- a/packages/nativewind/utils/withStyleContextAndStates/index.js +++ /dev/null @@ -1,29 +0,0 @@ -'use client'; -import React from 'react'; -import { extractDataClassName } from '../utils'; -import { ParentContext } from '../context'; -import { useParentContext } from '../context'; -export const withStyleContextAndStates = (Component, scope = 'Global') => { - return React.forwardRef(({ context, className, states, ...props }, ref) => { - let contextValues = {}; - const parentContextValues = useParentContext(); - if (parentContextValues[scope] !== undefined) { - parentContextValues[scope] = context; - contextValues = parentContextValues; - } - else { - contextValues = { ...parentContextValues, [scope]: context }; - } - const classNamesFinal = React.useMemo(() => { - if (!className) - return; - return extractDataClassName(className, states); - }, [className, states]); - return (React.createElement(ParentContext.Provider, { value: contextValues }, - React.createElement(Component, { className: classNamesFinal, ...props, ref: ref }))); - }); -}; -export const useStyleContext = (scope = 'Global') => { - const parentContextValues = useParentContext(); - return parentContextValues[scope]; -}; diff --git a/packages/nativewind/utils/withStyleContextAndStates/index.jsx b/packages/nativewind/utils/withStyleContextAndStates/index.jsx new file mode 100644 index 000000000..f922e79b6 --- /dev/null +++ b/packages/nativewind/utils/withStyleContextAndStates/index.jsx @@ -0,0 +1,30 @@ +'use client'; +import React from 'react'; +import { extractDataClassName } from '../utils'; +import { ParentContext } from '../context'; +import { useParentContext } from '../context'; +export const withStyleContextAndStates = (Component, scope = 'Global') => { + return React.forwardRef(({ context, className, states, ...props }, ref) => { + let contextValues = {}; + const parentContextValues = useParentContext(); + if (parentContextValues[scope] !== undefined) { + parentContextValues[scope] = context; + contextValues = parentContextValues; + } else { + contextValues = { ...parentContextValues, [scope]: context }; + } + const classNamesFinal = React.useMemo(() => { + if (!className) return; + return extractDataClassName(className, states); + }, [className, states]); + return ( + + + + ); + }); +}; +export const useStyleContext = (scope = 'Global') => { + const parentContextValues = useParentContext(); + return parentContextValues[scope]; +}; diff --git a/yarn.lock b/yarn.lock index f8c78e0fa..424281ba0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2607,15 +2607,6 @@ dependencies: "@legendapp/motion" "^2.2.0" -"@gluestack-ui/button@1.0.7": - version "1.0.7" - resolved "https://registry.yarnpkg.com/@gluestack-ui/button/-/button-1.0.7.tgz#513c42b895f285b527969f7dde9abc7f622d7905" - integrity sha512-6hz5BPoB+iHMpDvys6AbIpeRPbnFiqyE3SnnbKPSCj8lgl3Dr9sFln41BvDmqmZ98d0usJluk50rz8pVNRZRgw== - dependencies: - "@gluestack-ui/utils" "0.1.13" - "@react-native-aria/focus" "^0.2.9" - "@react-native-aria/interactions" "0.2.13" - "@gluestack-ui/button@^0.1.15": version "0.1.34" resolved "https://registry.yarnpkg.com/@gluestack-ui/button/-/button-0.1.34.tgz#f635aba6a9023d153f5dd82cd96a3785b6244951" From c2ff9fbc8fef28bc4807fbd7d0c33fd71d1beb84 Mon Sep 17 00:00:00 2001 From: viraj-10 Date: Mon, 18 Nov 2024 18:41:52 +0530 Subject: [PATCH 7/8] fix: removed unwanted key from popover content and arrow --- packages/unstyled/popover/src/PopoverArrow.tsx | 1 - packages/unstyled/popover/src/PopoverContent.tsx | 1 - 2 files changed, 2 deletions(-) diff --git a/packages/unstyled/popover/src/PopoverArrow.tsx b/packages/unstyled/popover/src/PopoverArrow.tsx index 61bdc945c..76e9ddda6 100644 --- a/packages/unstyled/popover/src/PopoverArrow.tsx +++ b/packages/unstyled/popover/src/PopoverArrow.tsx @@ -36,7 +36,6 @@ const PopoverArrow = (StyledPopoverArrow: any) => updateArrowSize({ height, width }); }} {...props} - key={actualPlacement + 'arrow'} initial={{ opacity: 0, y: diff --git a/packages/unstyled/popover/src/PopoverContent.tsx b/packages/unstyled/popover/src/PopoverContent.tsx index 01ec30c56..d321b4a85 100644 --- a/packages/unstyled/popover/src/PopoverContent.tsx +++ b/packages/unstyled/popover/src/PopoverContent.tsx @@ -226,7 +226,6 @@ const PopoverContent = (StyledPopoverContent: any, AnimatePresence?: any) => collapsable={false} {...dialogProps} tabIndex={Platform.OS === 'web' ? -1 : undefined} - key={placement + calculatedPlacement} initial={initialAnimatedStyles} animate={animatedStyles} exit={exitAnimatedStyles} From 86a6737f17cadc3e08735398497a02a710a79c73 Mon Sep 17 00:00:00 2001 From: viraj-10 Date: Mon, 18 Nov 2024 18:43:16 +0530 Subject: [PATCH 8/8] chore: @gluestack-ui/popover version bump to 0.1.43 --- example/storybook-nativewind/package.json | 2 +- packages/config/package.json | 6 +++--- packages/themed/CHANGELOG.md | 7 +++++++ packages/themed/package.json | 4 ++-- packages/unstyled/popover/CHANGELOG.md | 6 ++++++ packages/unstyled/popover/package.json | 2 +- 6 files changed, 20 insertions(+), 7 deletions(-) diff --git a/example/storybook-nativewind/package.json b/example/storybook-nativewind/package.json index 460b33206..4ca0f5f9d 100644 --- a/example/storybook-nativewind/package.json +++ b/example/storybook-nativewind/package.json @@ -32,7 +32,7 @@ "@gluestack-style/animation-resolver": "^1.0.4", "@gluestack-style/react": "^1.0.57", "@gluestack-ui/config": "^1.1.19", - "@gluestack-ui/themed": "^1.1.60", + "@gluestack-ui/themed": "^1.1.61", "@gluestack/design-system": "^0.5.36", "@gorhom/bottom-sheet": "^5.0.0-alpha.10", "@legendapp/motion": "^2.2.0", diff --git a/packages/config/package.json b/packages/config/package.json index 693737132..8d14a1598 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -55,7 +55,7 @@ "@gluestack-ui/menu": "0.2.37", "@gluestack-ui/modal": "0.1.35", "@gluestack-ui/overlay": "0.1.16", - "@gluestack-ui/popover": "0.1.42", + "@gluestack-ui/popover": "0.1.43", "@gluestack-ui/pressable": "0.1.17", "@gluestack-ui/progress": "0.1.18", "@gluestack-ui/provider": "0.1.13", @@ -66,14 +66,14 @@ "@gluestack-ui/switch": "0.1.23", "@gluestack-ui/tabs": "0.1.18", "@gluestack-ui/textarea": "0.1.24", - "@gluestack-ui/themed": "1.1.60", + "@gluestack-ui/themed": "1.1.61", "@gluestack-ui/toast": "1.0.8", "@gluestack-ui/tooltip": "0.1.35", "@legendapp/motion": "latest" }, "peerDependencies": { "@gluestack-style/react": ">=1.0.57", - "@gluestack-ui/themed": ">=1.1.60" + "@gluestack-ui/themed": ">=1.1.61" }, "release-it": { "git": { diff --git a/packages/themed/CHANGELOG.md b/packages/themed/CHANGELOG.md index ccd2df99c..16553213b 100644 --- a/packages/themed/CHANGELOG.md +++ b/packages/themed/CHANGELOG.md @@ -1,5 +1,12 @@ # @gluestack-ui/themed +## 1.1.61 + +### Patch Changes + +- Updated dependencies + - @gluestack-ui/popover@0.1.43 + ## 1.1.60 ### Patch Changes diff --git a/packages/themed/package.json b/packages/themed/package.json index 8a6cddafa..b15059a82 100644 --- a/packages/themed/package.json +++ b/packages/themed/package.json @@ -1,6 +1,6 @@ { "name": "@gluestack-ui/themed", - "version": "1.1.60", + "version": "1.1.61", "main": "build/index.js", "types": "build/index.d.ts", "module": "build/index", @@ -54,7 +54,7 @@ "@gluestack-ui/menu": "0.2.37", "@gluestack-ui/modal": "0.1.35", "@gluestack-ui/overlay": "0.1.16", - "@gluestack-ui/popover": "0.1.42", + "@gluestack-ui/popover": "0.1.43", "@gluestack-ui/pressable": "0.1.17", "@gluestack-ui/progress": "0.1.18", "@gluestack-ui/provider": "0.1.13", diff --git a/packages/unstyled/popover/CHANGELOG.md b/packages/unstyled/popover/CHANGELOG.md index e3a790794..7d0c78e37 100644 --- a/packages/unstyled/popover/CHANGELOG.md +++ b/packages/unstyled/popover/CHANGELOG.md @@ -1,5 +1,11 @@ # @gluestack-ui/popover +## 0.1.43 + +### Patch Changes + +- fix: removed unwanted key from popover + ## 0.1.42 ### Patch Changes diff --git a/packages/unstyled/popover/package.json b/packages/unstyled/popover/package.json index fb2575435..f600f5aee 100644 --- a/packages/unstyled/popover/package.json +++ b/packages/unstyled/popover/package.json @@ -1,6 +1,6 @@ { "name": "@gluestack-ui/popover", - "version": "0.1.42", + "version": "0.1.43", "main": "lib/index", "module": "lib/index", "types": "lib/index.d.ts",