-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2589 from gluestack/release/@gluestack-ui/popover…
…@0.1.43 release: @gluestack-ui/popover version 0.1.43
- Loading branch information
Showing
21 changed files
with
86 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
example/storybook-nativewind/src/core-components/nativewind/icon/index.web.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ( | ||
<ParentContext.Provider value={contextValues}> | ||
<Component {...props} ref={ref} /> | ||
</ParentContext.Provider> | ||
); | ||
}); | ||
}; | ||
export const useStyleContext = (scope = 'Global') => { | ||
const parentContextValues = useParentContext(); | ||
return parentContextValues[scope]; | ||
}; |
29 changes: 0 additions & 29 deletions
29
packages/nativewind/utils/withStyleContextAndStates/index.js
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
packages/nativewind/utils/withStyleContextAndStates/index.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ( | ||
<ParentContext.Provider value={contextValues}> | ||
<Component className={classNamesFinal} {...props} ref={ref} /> | ||
</ParentContext.Provider> | ||
); | ||
}); | ||
}; | ||
export const useStyleContext = (scope = 'Global') => { | ||
const parentContextValues = useParentContext(); | ||
return parentContextValues[scope]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2607,15 +2607,6 @@ | |
dependencies: | ||
"@legendapp/motion" "^2.2.0" | ||
|
||
"@gluestack-ui/[email protected]": | ||
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" | ||
|