Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #487 from gluestack/main
Browse files Browse the repository at this point in the history
Backmerge: main
  • Loading branch information
ankit-tailor authored Oct 18, 2023
2 parents 0a4bb8c + 47da14e commit 3ea1418
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 65 deletions.
2 changes: 1 addition & 1 deletion example/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"dependencies": {
"@expo/html-elements": "^0.4.2",
"@gluestack-style/react": "1.0.6",
"@gluestack-style/react": "1.0.7",
"@gluestack-ui/actionsheet": "^0.2.16",
"@gluestack-ui/alert-dialog": "^0.1.14",
"@gluestack-ui/button": "^0.1.23",
Expand Down
4 changes: 2 additions & 2 deletions packages/animation-moti-driver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
"clean": "rm -rf lib"
},
"peerDependencies": {
"@gluestack-style/react": ">=0.2",
"@gluestack-style/react": ">=1.0.7",
"moti": ">=0.26",
"react-native-gesture-handler": ">=2.12",
"react-native-reanimated": ">=3.5"
},
"devDependencies": {
"@gluestack-style/react": "^0.2.49",
"@gluestack-style/react": "^1.0.7",
"@types/react": "^18.0.22",
"@types/react-native": "^0.69.15",
"babel-plugin-transform-remove-console": "^6.9.4",
Expand Down
4 changes: 2 additions & 2 deletions packages/animation-resolver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
"clean": "rm -rf lib"
},
"peerDependencies": {
"@gluestack-style/react": ">=0.2"
"@gluestack-style/react": ">=1.0.7"
},
"devDependencies": {
"@gluestack-style/react": "^0.2.49",
"@gluestack-style/react": "^1.0.7",
"@types/react": "^18.0.22",
"@types/react-native": "^0.69.15",
"babel-plugin-transform-remove-console": "^6.9.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/benchmark-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"devDependencies": {
"@gluestack-style/babel-plugin-styled-resolver": "1.0.0",
"@gluestack-style/react": "1.0.6",
"@gluestack-style/react": "1.0.7",
"@emotion/styled": "^11.3.0",
"@expo/next-adapter": "^4.0.13",
"@types/react": "17.0.1",
Expand Down
6 changes: 6 additions & 0 deletions packages/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @gluestack-style/react

## 1.0.7

### Patch Changes

- fix: component typings

## 0.2.9

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gluestack-style/react",
"description": "A universal & performant styling library for React Native, Next.js & React",
"version": "1.0.6",
"version": "1.0.7",
"keywords": [
"React Native",
"Next.js",
Expand Down
8 changes: 7 additions & 1 deletion packages/react/src/styled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type {
ExtendedConfigType,
IComponentStyleConfig,
StyledConfig,
UtilityProps,
} from './types';
import {
deepMerge,
Expand Down Expand Up @@ -995,7 +996,12 @@ export function verboseStyled<P, Variants, ComCon>(
// sxHash: BUILD_TIME_sxHash = '',
...componentProps
}: Omit<
ComponentProps<ITypeReactNativeStyles, Variants, P, ComCon>,
Omit<P, keyof Variants> &
Partial<ComponentProps<ITypeReactNativeStyles, Variants, P, ComCon>> &
Partial<UtilityProps<ITypeReactNativeStyles, P>> & {
as?: any;
children?: any;
},
'animationComponentGluestack'
>,
ref: React.ForwardedRef<P>
Expand Down
108 changes: 51 additions & 57 deletions packages/react/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -735,69 +735,63 @@ interface GenericComponents {
/********************* COMPONENT PROPS TYPE *****************************************/

export type ComponentProps<GenericComponentStyles, Variants, P, ComCon> =
Partial<
Omit<P, keyof Variants> &
SxStyleProps<
GenericComponentStyles,
Variants,
P,
'animationComponentGluestack' extends keyof P
? P['animationComponentGluestack'] extends true
? Plugins
: []
: []
> & {
as?: any;
children?: any;
} & UtilityProps<GenericComponentStyles, P> & {
states?: {
[K in IState]?: boolean;
};
} & (GSConfig['globalStyle'] extends object
? {
[Key in keyof MergeNestedThree<
GlobalVariants,
Variants,
// @ts-ignore
Components[`${ComCon}`]['theme']['variants']
>]?: keyof MergeNestedThree<
GlobalVariants,
Variants,
// @ts-ignore
Components[`${ComCon}`]['theme']['variants']
>[Key] extends 'true' | 'false'
? boolean
: keyof MergeNestedThree<
GlobalVariants,
Variants,
// @ts-ignore
Components[`${ComCon}`]['theme']['variants']
>[Key];
} & Omit<P, keyof Variants>
: {
[Key in keyof MergeNested<
Variants,
// @ts-ignore
Components[`${ComCon}`]['theme']['variants']
>]?: keyof MergeNested<
Variants, // @ts-ignore
Components[`${ComCon}`]['theme']['variants']
>[Key] extends 'true' | 'false'
? boolean
: keyof MergeNested<
Variants,
// @ts-ignore
Components[`${ComCon}`]['theme']['variants']
>[Key];
})
>;
SxStyleProps<
GenericComponentStyles,
Variants,
P,
'animationComponentGluestack' extends keyof P
? P['animationComponentGluestack'] extends true
? Plugins
: []
: []
> & {
states?: {
[K in IState]?: boolean;
};
} & (GSConfig['globalStyle'] extends object
? {
[Key in keyof MergeNestedThree<
GlobalVariants,
Variants,
// @ts-ignore
Components[`${ComCon}`]['theme']['variants']
>]?: keyof MergeNestedThree<
GlobalVariants,
Variants,
// @ts-ignore
Components[`${ComCon}`]['theme']['variants']
>[Key] extends 'true' | 'false'
? boolean
: keyof MergeNestedThree<
GlobalVariants,
Variants,
// @ts-ignore
Components[`${ComCon}`]['theme']['variants']
>[Key];
} & Omit<P, keyof Variants>
: {
[Key in keyof MergeNested<
Variants,
// @ts-ignore
Components[`${ComCon}`]['theme']['variants']
>]?: keyof MergeNested<
Variants, // @ts-ignore
Components[`${ComCon}`]['theme']['variants']
>[Key] extends 'true' | 'false'
? boolean
: keyof MergeNested<
Variants,
// @ts-ignore
Components[`${ComCon}`]['theme']['variants']
>[Key];
});

export type UtilityProps<GenericComponentStyles, GenericComponentProps> = Omit<
TokenizedRNStyleProps<GetRNStyles<GenericComponentStyles>>,
keyof GenericComponentProps
> &
Omit<
AliasesProps<RNStyles<GenericComponentStyles>>,
AliasesProps<GetRNStyles<GenericComponentStyles>>,
keyof GenericComponentProps
>;

Expand Down

0 comments on commit 3ea1418

Please sign in to comment.