Skip to content

Commit c5fd197

Browse files
Viraj Ajay JoshiViraj Ajay Joshi
authored andcommitted
fix: merge conflicts
2 parents 4c29095 + 7e53030 commit c5fd197

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+8143
-4813
lines changed

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
"access": "public",
88
"baseBranch": "main",
99
"updateInternalDependencies": "patch",
10-
"ignore": ["@gluestack/ui-storybook"]
10+
"ignore": ["@gluestack/ui-storybook", "@gluestack/storybook-nativewind"]
1111
}

example/storybook-nativewind/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"@react-aria/separator": "^3.3.0",
4141
"@react-aria/utils": "^3.15.0",
4242
"@react-native-aria/button": "^0.2.5",
43-
"@react-native-aria/overlays": "0.3.10",
43+
"@react-native-aria/overlays": "^0.3.10",
4444
"@react-native-aria/separator": "^0.2.6",
4545
"@react-native-async-storage/async-storage": "~1.17.3",
4646
"@react-native-community/datetimepicker": "6.5.2",

example/storybook-nativewind/src/components-example/nativewind/Button/index.tsx

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
import React from 'react';
22
import { createButton } from '@gluestack-ui/button';
3+
34
import {
45
tva,
56
withStyleContextAndStates,
67
useStyleContext,
78
withStyleContext,
9+
cssInterop,
10+
VariantProps,
811
} from '@gluestack-ui/nativewind-utils';
12+
913
import {
1014
ActivityIndicator,
1115
Pressable,
1216
Text,
1317
View,
1418
Platform,
1519
} from 'react-native';
16-
import { cssInterop } from 'nativewind';
1720

1821
const UIButton = createButton({
1922
// @ts-ignore
@@ -34,23 +37,24 @@ cssInterop(UIButton.Spinner, { className: 'style' });
3437
cssInterop(UIButton.Icon, { className: 'style' });
3538

3639
const buttonStyle = tva({
37-
base: 'group/button rounded-lg bg-primary-500 flex-row items-center justify-center data-[focus=true]:outline-none data-[focus-visible=true]:ring-2 ',
40+
base: 'group/button rounded-lg bg-primary-500 flex-row items-center justify-center data-[focus=true]:web:outline-none data-[focus-visible=true]:web:ring-2 ',
3841
variants: {
3942
action: {
4043
primary:
41-
'bg-primary-500 hover:bg-primary-600 active:bg-primary-700 border-primary-300 hover:border-primary-400 active:border-primary-500 data-[focus-visible=true]:ring-primary-500',
44+
'bg-primary-500 hover:bg-primary-600 active:bg-primary-700 border-primary-300 hover:border-primary-400 active:border-primary-500 data-[focus-visible=true]:web:ring-primary-500',
4245
secondary:
43-
'bg-secondary-500 border-secondary-300 hover:bg-secondary-600 hover:border-secondary-400 active:bg-secondary-700 active:border-secondary-500 data-[focus-visible=true]:ring-secondary-500',
46+
'bg-secondary-500 border-secondary-300 hover:bg-secondary-600 hover:border-secondary-400 active:bg-secondary-700 active:border-secondary-500 data-[focus-visible=true]:web:ring-secondary-500',
4447
positive:
45-
'bg-success-500 border-success-300 hover:bg-success-600 hover:border-success-400 active:bg-success-700 active:border-success-500 data-[focus-visible=true]:ring-success-500',
48+
'bg-success-500 border-success-300 hover:bg-success-600 hover:border-success-400 active:bg-success-700 active:border-success-500 data-[focus-visible=true]:web:ring-success-500',
4649
negative:
47-
'bg-error-500 border-error-300 hover:bg-error-600 hover:border-error-400 active:bg-error-700 active:border-error-500 data-[focus-visible=true]:ring-error-500',
50+
'bg-error-500 border-error-300 hover:bg-error-600 hover:border-error-400 active:bg-error-700 active:border-error-500 data-[focus-visible=true]:web:ring-error-500',
4851
default: 'bg-transparent hover:bg-background-50 active:bg-transparent',
4952
},
5053
variant: {
5154
link: 'px-0',
5255
outline:
5356
'bg-transparent border hover:bg-background-50 active:bg-transparent',
57+
solid: '',
5458
},
5559

5660
size: {
@@ -156,6 +160,11 @@ const buttonTextStyle = tva({
156160
],
157161
});
158162

163+
type IButtonProps = React.ComponentProps<typeof UIButton> &
164+
VariantProps<typeof buttonStyle>;
165+
166+
type IButtonTextProps = React.ComponentProps<typeof UIButton.Text> &
167+
VariantProps<typeof buttonTextStyle>;
159168
const Button = React.forwardRef(
160169
(
161170
{
@@ -164,11 +173,12 @@ const Button = React.forwardRef(
164173
size = 'md',
165174
action = 'primary',
166175
...props
167-
}: any,
176+
}: { className?: string } & IButtonProps,
168177
ref
169178
) => {
170179
return (
171180
<UIButton
181+
// @ts-ignore
172182
ref={ref}
173183
{...props}
174184
className={buttonStyle({ variant, size, action, class: className })}
@@ -178,8 +188,20 @@ const Button = React.forwardRef(
178188
}
179189
);
180190

191+
type IButtonIcon = React.ComponentProps<typeof UIButton.Icon> & {
192+
as?: any;
193+
};
181194
const ButtonText = React.forwardRef(
182-
({ className, variant, size, action, ...props }: any, ref) => {
195+
(
196+
{
197+
className,
198+
variant,
199+
size,
200+
action,
201+
...props
202+
}: { className?: string } & IButtonTextProps,
203+
ref?: any
204+
) => {
183205
const {
184206
variant: parentVariant,
185207
size: parentSize,
@@ -188,6 +210,7 @@ const ButtonText = React.forwardRef(
188210

189211
return (
190212
<UIButton.Text
213+
// @ts-ignore
191214
ref={ref}
192215
{...props}
193216
className={buttonTextStyle({
@@ -208,13 +231,19 @@ const ButtonText = React.forwardRef(
208231

209232
const ButtonSpinner = UIButton.Spinner;
210233

211-
const ButtonIcon = ({ className, as: AsComp, ...props }: any) => {
234+
const ButtonIcon = ({
235+
className,
236+
as: AsComp,
237+
...props
238+
}: IButtonIcon & { className?: any }) => {
212239
if (AsComp) {
213240
return <AsComp className={className} {...props} />;
214241
}
215242
return <UIButton.Icon className={className} {...props} />;
216243
};
217244
Button.displayName = 'Button';
218245
ButtonText.displayName = 'ButtonText';
246+
ButtonSpinner.displayName = 'ButtonSpinner';
247+
ButtonIcon.displayName = 'ButtonIcon';
219248

220249
export { Button, ButtonText, ButtonSpinner, ButtonIcon };

example/storybook-nativewind/src/components-example/nativewind/Checkbox/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import {
88
useStyleContext,
99
tva,
1010
withStyleContext,
11+
cssInterop,
1112
} from '@gluestack-ui/nativewind-utils';
1213
import { Platform } from 'react-native';
1314

1415
import { Check } from 'lucide-react-native';
15-
import { cssInterop } from 'nativewind';
1616

1717
const UICheckbox = createCheckbox({
1818
// @ts-ignore

0 commit comments

Comments
 (0)