Skip to content

Commit fcd2e1c

Browse files
authored
Merge pull request #115 from gluestack/fix/windows-os
react-19/next15 template fixes
2 parents b3bfc50 + 2df0b91 commit fcd2e1c

File tree

63 files changed

+3404
-3247
lines changed

Some content is hidden

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

63 files changed

+3404
-3247
lines changed

apps/templates/next-app-router-with-nativewind/app/registry.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import React, { useRef, useState } from "react";
33
import { useServerInsertedHTML } from "next/navigation";
44
import { StyleRegistry, createStyleRegistry } from "styled-jsx";
5-
// @ts-ignore
5+
// @ts-expect-error : AppRegistry is defined in react-native-web but its type is not defined
66
import { AppRegistry } from "react-native-web";
77
import { flush } from "@gluestack-ui/nativewind-utils/flush";
88

apps/templates/next-app-router-with-nativewind/components/ui/accordion/index.tsx

Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,91 @@
1-
'use client';
2-
import React from 'react';
3-
import { createAccordion } from '@gluestack-ui/accordion';
4-
import { View, Pressable, Text, Platform, TextProps } from 'react-native';
5-
import { tva } from '@gluestack-ui/nativewind-utils/tva';
6-
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
1+
"use client";
2+
import React from "react";
3+
import { createAccordion } from "@gluestack-ui/accordion";
4+
import { View, Pressable, Text, Platform, TextProps } from "react-native";
5+
import { tva } from "@gluestack-ui/nativewind-utils/tva";
6+
import type { VariantProps } from "@gluestack-ui/nativewind-utils";
77
import {
88
withStyleContext,
99
useStyleContext,
10-
} from '@gluestack-ui/nativewind-utils/withStyleContext';
11-
import { H3 } from '@expo/html-elements';
12-
import { cssInterop } from 'nativewind';
13-
import { PrimitiveIcon, UIIcon } from '@gluestack-ui/icon';
10+
} from "@gluestack-ui/nativewind-utils/withStyleContext";
11+
import { H3 } from "@expo/html-elements";
12+
import { cssInterop } from "nativewind";
13+
import { PrimitiveIcon, UIIcon } from "@gluestack-ui/icon";
1414

15-
const SCOPE = 'ACCORDION';
15+
const SCOPE = "ACCORDION";
1616
/** Styles */
1717

1818
const accordionStyle = tva({
19-
base: 'w-full',
19+
base: "w-full",
2020
variants: {
2121
variant: {
22-
filled: 'bg-white shadow-hard-2',
23-
unfilled: '',
22+
filled: "bg-white shadow-hard-2",
23+
unfilled: "",
2424
},
2525
size: {
26-
sm: '',
27-
md: '',
28-
lg: '',
26+
sm: "",
27+
md: "",
28+
lg: "",
2929
},
3030
},
3131
});
3232

3333
const accordionItemStyle = tva({
34-
base: '',
34+
base: "",
3535
parentVariants: {
3636
variant: {
37-
filled: 'bg-background-0',
38-
unfilled: 'bg-transparent',
37+
filled: "bg-background-0",
38+
unfilled: "bg-transparent",
3939
},
4040
},
4141
});
4242
const accordionTitleTextStyle = tva({
43-
base: 'text-typography-900 font-bold flex-1 text-left',
43+
base: "text-typography-900 font-bold flex-1 text-left",
4444
parentVariants: {
4545
size: {
46-
sm: 'text-sm',
47-
md: 'text-base',
48-
lg: 'text-lg',
46+
sm: "text-sm",
47+
md: "text-base",
48+
lg: "text-lg",
4949
},
5050
},
5151
});
5252
const accordionIconStyle = tva({
53-
base: 'text-typography-900 fill-none',
53+
base: "text-typography-900 fill-none",
5454
parentVariants: {
5555
size: {
56-
'2xs': 'h-3 w-3',
57-
'xs': 'h-3.5 w-3.5',
58-
'sm': 'h-4 w-4',
59-
'md': 'h-[18px] w-[18px]',
60-
'lg': 'h-5 w-5',
61-
'xl': 'h-6 w-6',
56+
"2xs": "h-3 w-3",
57+
xs: "h-3.5 w-3.5",
58+
sm: "h-4 w-4",
59+
md: "h-[18px] w-[18px]",
60+
lg: "h-5 w-5",
61+
xl: "h-6 w-6",
6262
},
6363
},
6464
});
6565
const accordionContentTextStyle = tva({
66-
base: 'text-typography-700 font-normal',
66+
base: "text-typography-700 font-normal",
6767
parentVariants: {
6868
size: {
69-
sm: 'text-sm',
70-
md: 'text-base',
71-
lg: 'text-lg',
69+
sm: "text-sm",
70+
md: "text-base",
71+
lg: "text-lg",
7272
},
7373
},
7474
});
7575
const accordionHeaderStyle = tva({
76-
base: 'mx-0 my-0',
76+
base: "mx-0 my-0",
7777
});
7878
const accordionContentStyle = tva({
79-
base: 'pt-1 pb-3 px-4',
79+
base: "pt-1 pb-3 px-4",
8080
});
8181
const accordionTriggerStyle = tva({
82-
base: 'w-full flex-row justify-between items-center web:outline-none focus:outline-none data-[disabled=true]:opacity-40 data-[disabled=true]:cursor-not-allowed data-[focus-visible=true]:bg-background-50 py-3 px-4',
82+
base: "w-full flex-row justify-between items-center web:outline-none focus:outline-none data-[disabled=true]:opacity-40 data-[disabled=true]:cursor-not-allowed data-[focus-visible=true]:bg-background-50 py-3 px-4",
8383
});
8484

8585
const Root = withStyleContext(View, SCOPE);
8686

8787
const Header = (
88-
Platform.OS === 'web' ? H3 : View
88+
Platform.OS === "web" ? H3 : View
8989
) as React.ComponentType<TextProps>;
9090

9191
/** Creator */
@@ -102,20 +102,20 @@ const UIAccordion = createAccordion({
102102

103103
cssInterop(PrimitiveIcon, {
104104
className: {
105-
target: 'style',
105+
target: "style",
106106
nativeStyleToProp: {
107107
height: true,
108108
width: true,
109109
fill: true,
110-
color: 'classNameColor',
110+
color: "classNameColor",
111111
stroke: true,
112112
},
113113
},
114114
});
115115

116116
cssInterop(H3, {
117117
className: {
118-
target: 'style',
118+
target: "style",
119119
},
120120
});
121121

@@ -162,9 +162,9 @@ type IAccordionTitleTextProps = React.ComponentPropsWithoutRef<
162162
/** Components */
163163

164164
const Accordion = React.forwardRef<
165-
React.ElementRef<typeof UIAccordion>,
165+
React.ComponentRef<typeof UIAccordion>,
166166
IAccordionProps
167-
>(({ className, variant = 'filled', size = 'md', ...props }, ref) => {
167+
>(({ className, variant = "filled", size = "md", ...props }, ref) => {
168168
return (
169169
<UIAccordion
170170
ref={ref}
@@ -176,7 +176,7 @@ const Accordion = React.forwardRef<
176176
});
177177

178178
const AccordionItem = React.forwardRef<
179-
React.ElementRef<typeof UIAccordion.Item>,
179+
React.ComponentRef<typeof UIAccordion.Item>,
180180
IAccordionItemProps
181181
>(({ className, ...props }, ref) => {
182182
const { variant } = useStyleContext(SCOPE);
@@ -193,9 +193,9 @@ const AccordionItem = React.forwardRef<
193193
});
194194

195195
const AccordionContent = React.forwardRef<
196-
React.ElementRef<typeof UIAccordion.Content>,
196+
React.ComponentRef<typeof UIAccordion.Content>,
197197
IAccordionContentProps
198-
>(({ className, ...props }, ref) => {
198+
>(function AccordionContent({ className, ...props }, ref) {
199199
return (
200200
<UIAccordion.Content
201201
ref={ref}
@@ -208,9 +208,9 @@ const AccordionContent = React.forwardRef<
208208
});
209209

210210
const AccordionContentText = React.forwardRef<
211-
React.ElementRef<typeof UIAccordion.ContentText>,
211+
React.ComponentRef<typeof UIAccordion.ContentText>,
212212
IAccordionContentTextProps
213-
>(({ className, ...props }, ref) => {
213+
>(function AccordionContentText({ className, ...props }, ref) {
214214
const { size } = useStyleContext(SCOPE);
215215
return (
216216
<UIAccordion.ContentText
@@ -225,12 +225,12 @@ const AccordionContentText = React.forwardRef<
225225
});
226226

227227
const AccordionIcon = React.forwardRef<
228-
React.ElementRef<typeof UIAccordion.Icon>,
228+
React.ComponentRef<typeof UIAccordion.Icon>,
229229
IAccordionIconProps
230-
>(({ size, className, ...props }, ref) => {
230+
>(function AccordionIcon({ size, className, ...props }, ref) {
231231
const { size: parentSize } = useStyleContext(SCOPE);
232232

233-
if (typeof size === 'number') {
233+
if (typeof size === "number") {
234234
return (
235235
<UIAccordion.Icon
236236
ref={ref}
@@ -265,9 +265,9 @@ const AccordionIcon = React.forwardRef<
265265
});
266266

267267
const AccordionHeader = React.forwardRef<
268-
React.ElementRef<typeof UIAccordion.Header>,
268+
React.ComponentRef<typeof UIAccordion.Header>,
269269
IAccordionHeaderProps
270-
>(({ className, ...props }, ref) => {
270+
>(function AccordionHeader({ className, ...props }, ref) {
271271
return (
272272
<UIAccordion.Header
273273
ref={ref}
@@ -280,9 +280,9 @@ const AccordionHeader = React.forwardRef<
280280
});
281281

282282
const AccordionTrigger = React.forwardRef<
283-
React.ElementRef<typeof UIAccordion.Trigger>,
283+
React.ComponentRef<typeof UIAccordion.Trigger>,
284284
IAccordionTriggerProps
285-
>(({ className, ...props }, ref) => {
285+
>(function AccordionTrigger({ className, ...props }, ref) {
286286
return (
287287
<UIAccordion.Trigger
288288
ref={ref}
@@ -294,9 +294,9 @@ const AccordionTrigger = React.forwardRef<
294294
);
295295
});
296296
const AccordionTitleText = React.forwardRef<
297-
React.ElementRef<typeof UIAccordion.TitleText>,
297+
React.ComponentRef<typeof UIAccordion.TitleText>,
298298
IAccordionTitleTextProps
299-
>(({ className, ...props }, ref) => {
299+
>(function AccordionTitleText({ className, ...props }, ref) {
300300
const { size } = useStyleContext(SCOPE);
301301
return (
302302
<UIAccordion.TitleText
@@ -310,14 +310,14 @@ const AccordionTitleText = React.forwardRef<
310310
);
311311
});
312312

313-
Accordion.displayName = 'Accordion';
314-
AccordionItem.displayName = 'AccordionItem';
315-
AccordionHeader.displayName = 'AccordionHeader';
316-
AccordionTrigger.displayName = 'AccordionTrigger';
317-
AccordionTitleText.displayName = 'AccordionTitleText';
318-
AccordionContentText.displayName = 'AccordionContentText';
319-
AccordionIcon.displayName = 'AccordionIcon';
320-
AccordionContent.displayName = 'AccordionContent';
313+
Accordion.displayName = "Accordion";
314+
AccordionItem.displayName = "AccordionItem";
315+
AccordionHeader.displayName = "AccordionHeader";
316+
AccordionTrigger.displayName = "AccordionTrigger";
317+
AccordionTitleText.displayName = "AccordionTitleText";
318+
AccordionContentText.displayName = "AccordionContentText";
319+
AccordionIcon.displayName = "AccordionIcon";
320+
AccordionContent.displayName = "AccordionContent";
321321

322322
export {
323323
Accordion,

0 commit comments

Comments
 (0)