diff --git a/example/storybook-nativewind/.storybook/preview.js b/example/storybook-nativewind/.storybook/preview.js
index 8201d81410..693855c586 100644
--- a/example/storybook-nativewind/.storybook/preview.js
+++ b/example/storybook-nativewind/.storybook/preview.js
@@ -31,11 +31,13 @@ export const parameters = {
method: '',
order: [
'Overview',
- ['Introduction'],
+ ['Introduction', 'All Components'],
'Getting Started',
- ['Installation', 'Tooling Setup'],
+ ['Installation', 'Tooling Setup', 'Figma UI Kit'],
'Core Concepts',
['Accessibility', 'Universal'],
+ 'Theme Configuration',
+ ['Default Tokens', 'Customizing Theme'],
'Components',
[
'Typography',
diff --git a/example/storybook-nativewind/babel.config.js b/example/storybook-nativewind/babel.config.js
index 8f54b5c7e2..ac70512697 100644
--- a/example/storybook-nativewind/babel.config.js
+++ b/example/storybook-nativewind/babel.config.js
@@ -95,6 +95,18 @@ module.exports = function (api) {
__dirname,
'../../packages/nativewind/utils/'
),
+ '@gluestack-ui/overlay': path.join(
+ __dirname,
+ '../../packages/unstyled/overlay/src'
+ ),
+ '@gluestack-ui/toast': path.join(
+ __dirname,
+ '../../packages/unstyled/toast/src'
+ ),
+ 'tailwind.config': path.join(
+ __dirname,
+ '../../example/storybook-nativewind/tailwind.config.js'
+ ),
},
},
],
diff --git a/example/storybook-nativewind/package.json b/example/storybook-nativewind/package.json
index ce1f7a3088..b41039fbe9 100644
--- a/example/storybook-nativewind/package.json
+++ b/example/storybook-nativewind/package.json
@@ -29,7 +29,7 @@
"@geometricpanda/storybook-addon-iframe": "^0.2.2",
"@gluestack-style/react": "^1.0.52",
"@gluestack-ui/config": "^1.1.17",
- "@gluestack-ui/themed": "^1.1.17",
+ "@gluestack-ui/themed": "^1.1.19",
"@gluestack/design-system": "^0.5.36",
"@legendapp/motion": "^2.2.0",
"@react-aria/button": "^3.7.0",
diff --git a/example/storybook-nativewind/src/components/Actionsheet/index.nw.stories.mdx b/example/storybook-nativewind/src/components/Actionsheet/index.nw.stories.mdx
index f39f378e5e..1d9bdfdbce 100644
--- a/example/storybook-nativewind/src/components/Actionsheet/index.nw.stories.mdx
+++ b/example/storybook-nativewind/src/components/Actionsheet/index.nw.stories.mdx
@@ -61,6 +61,7 @@ import {
AddIcon,
InfoIcon,
Alert,
+ Tabs
} from '@gluestack/design-system';
import {Platform, KeyboardAvoidingView,} from 'react-native';
import {CreditCardIcon} from 'lucide-react-native';
@@ -134,6 +135,28 @@ function App(){
## Installation
+
+
+
+ CLI
+
+
+ Manual
+
+
+
+
+<>
+
+### Run the following command:
+ ```bash
+ npx gluestack-ui add actionsheet
+ ```
+>
+
+
+<>
+
### Step 1: Install the following dependencies:
```bash
npm i @gluestack-ui/actionsheet
@@ -146,6 +169,12 @@ npm i @gluestack-ui/actionsheet
```
+### Step 3: Update the import paths to match your project setup.
+>
+
+
+
+
## API Reference
To use this component in your project, include the following import statement in your file.
diff --git a/example/storybook-nativewind/src/components/AlertDialog/index.nw.stories.mdx b/example/storybook-nativewind/src/components/AlertDialog/index.nw.stories.mdx
index 1944349bce..22357afaa2 100644
--- a/example/storybook-nativewind/src/components/AlertDialog/index.nw.stories.mdx
+++ b/example/storybook-nativewind/src/components/AlertDialog/index.nw.stories.mdx
@@ -385,22 +385,6 @@ It inherits all the properties of React Native's [View](https://reactnative.dev/
{`If true, the keyboard can dismiss the AlertDialog`}
-
-
-
- animationPreset
-
-
-
- slide | fade
-
-
- slide
-
-
- {`Specifies the animation preset for the AlertDialog`}
-
-
diff --git a/example/storybook-nativewind/src/components/AlertDialog/index.themed.stories.mdx b/example/storybook-nativewind/src/components/AlertDialog/index.themed.stories.mdx
index 6b748bcf6b..1c6863e222 100644
--- a/example/storybook-nativewind/src/components/AlertDialog/index.themed.stories.mdx
+++ b/example/storybook-nativewind/src/components/AlertDialog/index.themed.stories.mdx
@@ -391,22 +391,6 @@ It inherits all the properties of React Native's [View](https://reactnative.dev/
{`If true, the keyboard can dismiss the AlertDialog`}
-
-
-
- animationPreset
-
-
-
- slide | fade
-
-
- slide
-
-
- {`Specifies the animation preset for the AlertDialog`}
-
-
diff --git a/example/storybook-nativewind/src/components/Box/index.nw.stories.mdx b/example/storybook-nativewind/src/components/Box/index.nw.stories.mdx
index edc75b6fac..43e0117682 100644
--- a/example/storybook-nativewind/src/components/Box/index.nw.stories.mdx
+++ b/example/storybook-nativewind/src/components/Box/index.nw.stories.mdx
@@ -80,7 +80,7 @@ This is an illustration of **Box** component.
<>
-### Step 1: Copy and paste the following code into your project.
+### Step 1: Copy and paste the following code into index.tsx in your project.
```jsx
@@ -88,7 +88,25 @@ This is an illustration of **Box** component.
```
-### Step 2: Update the import paths to match your project setup.
+> Note: **This Step is (optional) and only required if you want to add support for [React Server Components](https://vercel.com/blog/understanding-react-server-components), You can skip this and jump to Step 3 directly if you don't have this requirement.**
+
+### Step 2: Copy and paste the following code into index.web.tsx in your project.
+
+
+```jsx
+%%-- File: core-components/nativewind/box/index.web.tsx --%%
+```
+
+
+### Step 3: Copy and paste the following code into styles.tsx in your project.
+
+
+```jsx
+%%-- File: core-components/nativewind/box/styles.tsx --%%
+```
+
+
+### Step 4: Update the import paths to match your project setup.
>
diff --git a/example/storybook-nativewind/src/components/Card/index.nw.stories.mdx b/example/storybook-nativewind/src/components/Card/index.nw.stories.mdx
index f012b808bd..5d168ed347 100644
--- a/example/storybook-nativewind/src/components/Card/index.nw.stories.mdx
+++ b/example/storybook-nativewind/src/components/Card/index.nw.stories.mdx
@@ -112,7 +112,7 @@ This is an illustration of a **Card** component.
<>
-### Step 1: Copy and paste the following code into your project.
+### Step 1: Copy and paste the following code into index.tsx in your project.
```jsx
@@ -120,7 +120,25 @@ This is an illustration of a **Card** component.
```
-### Step 2: Update the import paths to match your project setup.
+> Note: **This Step is (optional) and only required if you want to add support for [React Server Components](https://vercel.com/blog/understanding-react-server-components), You can skip this and jump to Step 3 directly if you don't have this requirement.**
+
+### Step 2: Copy and paste the following code into index.web.tsx in your project.
+
+
+```jsx
+%%-- File: core-components/nativewind/card/index.web.tsx --%%
+```
+
+
+### Step 3: Copy and paste the following code into styles.tsx in your project.
+
+
+```jsx
+%%-- File: core-components/nativewind/card/styles.tsx --%%
+```
+
+
+### Step 4: Update the import paths to match your project setup.
>
diff --git a/example/storybook-nativewind/src/components/Center/Center.tsx b/example/storybook-nativewind/src/components/Center/Center.tsx
index 7f9e782225..d61ff5a691 100644
--- a/example/storybook-nativewind/src/components/Center/Center.tsx
+++ b/example/storybook-nativewind/src/components/Center/Center.tsx
@@ -4,10 +4,8 @@ import React from 'react';
const CenterBasic = () => {
return (
-
-
- This is the center.
-
+
+ This is the center.
);
};
diff --git a/example/storybook-nativewind/src/components/Center/index.nw.stories.mdx b/example/storybook-nativewind/src/components/Center/index.nw.stories.mdx
index ba511a920d..dc015ed490 100644
--- a/example/storybook-nativewind/src/components/Center/index.nw.stories.mdx
+++ b/example/storybook-nativewind/src/components/Center/index.nw.stories.mdx
@@ -78,7 +78,7 @@ This is an illustration of **Center** component.
<>
-### Step 1: Copy and paste the following code into your project.
+### Step 1: Copy and paste the following code into index.tsx in your project.
```jsx
@@ -86,7 +86,25 @@ This is an illustration of **Center** component.
```
-### Step 2: Update the import paths to match your project setup.
+> Note: **This Step is (optional) and only required if you want to add support for [React Server Components](https://vercel.com/blog/understanding-react-server-components), You can skip this and jump to Step 3 directly if you don't have this requirement.**
+
+### Step 2: Copy and paste the following code into index.web.tsx in your project.
+
+
+```jsx
+%%-- File: core-components/nativewind/center/index.web.tsx --%%
+```
+
+
+### Step 3: Copy and paste the following code into styles.tsx in your project.
+
+
+```jsx
+%%-- File: core-components/nativewind/center/styles.tsx --%%
+```
+
+
+### Step 4: Update the import paths to match your project setup.
>
diff --git a/example/storybook-nativewind/src/components/HStack/index.nw.stories.mdx b/example/storybook-nativewind/src/components/HStack/index.nw.stories.mdx
index 8b33e504c4..e8cc4f07fc 100644
--- a/example/storybook-nativewind/src/components/HStack/index.nw.stories.mdx
+++ b/example/storybook-nativewind/src/components/HStack/index.nw.stories.mdx
@@ -89,7 +89,7 @@ This is an illustration of **HStack** component.
<>
-### Step 1: Copy and paste the following code into your project.
+### Step 1: Copy and paste the following code into index.tsx in your project.
```jsx
@@ -97,7 +97,25 @@ This is an illustration of **HStack** component.
```
-### Step 2: Update the import paths to match your project setup.
+> Note: **This Step is (optional) and only required if you want to add support for [React Server Components](https://vercel.com/blog/understanding-react-server-components), You can skip this and jump to Step 3 directly if you don't have this requirement.**
+
+### Step 2: Copy and paste the following code into index.web.tsx in your project.
+
+
+```jsx
+%%-- File: core-components/nativewind/hstack/index.web.tsx --%%
+```
+
+
+### Step 3: Copy and paste the following code into styles.tsx in your project.
+
+
+```jsx
+%%-- File: core-components/nativewind/hstack/styles.tsx --%%
+```
+
+
+### Step 4: Update the import paths to match your project setup.
>
diff --git a/example/storybook-nativewind/src/components/Heading/index.nw.stories.mdx b/example/storybook-nativewind/src/components/Heading/index.nw.stories.mdx
index bcc4d18453..35aa8d1153 100644
--- a/example/storybook-nativewind/src/components/Heading/index.nw.stories.mdx
+++ b/example/storybook-nativewind/src/components/Heading/index.nw.stories.mdx
@@ -77,20 +77,33 @@ This is an illustration of **Heading** component.
<>
-### Step 1: Install the following dependencies:
-```bash
-npm i @expo/html-elements
+### Step 1: Copy and paste the following code into index.tsx in your project.
+
+
+```jsx
+%%-- File: core-components/nativewind/heading/index.tsx --%%
```
+
+
+> Note: **This Step is (optional) and only required if you want to add support for [React Server Components](https://vercel.com/blog/understanding-react-server-components), You can skip this and jump to Step 3 directly if you don't have this requirement.**
-### Step 2: Copy and paste the following code into your project.
+### Step 2: Copy and paste the following code into index.web.tsx in your project.
```jsx
-%%-- File: core-components/nativewind/heading/index.tsx --%%
+%%-- File: core-components/nativewind/heading/index.web.tsx --%%
+```
+
+
+### Step 3: Copy and paste the following code into styles.tsx in your project.
+
+
+```jsx
+%%-- File: core-components/nativewind/heading/styles.tsx --%%
```
-### Step 3: Update the import paths to match your project setup.
+### Step 4: Update the import paths to match your project setup.
>
diff --git a/example/storybook-nativewind/src/components/Modal/index.nw.stories.mdx b/example/storybook-nativewind/src/components/Modal/index.nw.stories.mdx
index f5691c007c..0b7e088316 100644
--- a/example/storybook-nativewind/src/components/Modal/index.nw.stories.mdx
+++ b/example/storybook-nativewind/src/components/Modal/index.nw.stories.mdx
@@ -82,7 +82,7 @@ This is an illustration of **Modal** component.
Engage with Modals
-
@@ -762,7 +762,7 @@ A versatile modal component offering different sizes to accommodate various cont
Delete Folder
-
diff --git a/example/storybook-nativewind/src/components/Select/Select.tsx b/example/storybook-nativewind/src/components/Select/Select.tsx
index 99dcc38fa5..20fba565d9 100644
--- a/example/storybook-nativewind/src/components/Select/Select.tsx
+++ b/example/storybook-nativewind/src/components/Select/Select.tsx
@@ -1,7 +1,6 @@
import React from 'react';
-
-import { Center, ChevronDownIcon, Icon } from '@gluestack-ui/themed';
-
+import { Center } from '@/components/ui/center';
+import { Icon, ChevronDownIcon } from '@/components/ui/icon';
import {
Select,
SelectIcon,
@@ -20,11 +19,7 @@ const SelectBasic = ({ size = 'md', variant = 'outline', ...props }: any) => {
-
+
diff --git a/example/storybook-nativewind/src/components/Text/index.nw.stories.mdx b/example/storybook-nativewind/src/components/Text/index.nw.stories.mdx
index 923780f287..fb432b0e17 100644
--- a/example/storybook-nativewind/src/components/Text/index.nw.stories.mdx
+++ b/example/storybook-nativewind/src/components/Text/index.nw.stories.mdx
@@ -77,7 +77,7 @@ This is an illustration of **Text** component.
<>
-### Step 1: Copy and paste the following code into your project.
+### Step 1: Copy and paste the following code into index.tsx in your project.
```jsx
@@ -85,7 +85,25 @@ This is an illustration of **Text** component.
```
-### Step 2: Update the import paths to match your project setup.
+> Note: **This Step is (optional) and only required if you want to add support for [React Server Components](https://vercel.com/blog/understanding-react-server-components), You can skip this and jump to Step 3 directly if you don't have this requirement.**
+
+### Step 2: Copy and paste the following code into index.web.tsx in your project.
+
+
+```jsx
+%%-- File: core-components/nativewind/text/index.web.tsx --%%
+```
+
+
+### Step 3: Copy and paste the following code into styles.tsx in your project.
+
+
+```jsx
+%%-- File: core-components/nativewind/text/styles.tsx --%%
+```
+
+
+### Step 4: Update the import paths to match your project setup.
>
diff --git a/example/storybook-nativewind/src/components/Toast/index.nw.stories.mdx b/example/storybook-nativewind/src/components/Toast/index.nw.stories.mdx
index d990dcb28f..4be2cd25e6 100644
--- a/example/storybook-nativewind/src/components/Toast/index.nw.stories.mdx
+++ b/example/storybook-nativewind/src/components/Toast/index.nw.stories.mdx
@@ -1,5 +1,5 @@
---
-title: Toast | gluestack-ui | Installation, Usage, and API
+title: gluestack-ui Toast Component | Installation, Usage, and API
description: Toast is a component that can display alerts, notifications, or messages on top of an overlay layer. It is commonly used to inform users of important information or actions.
@@ -7,15 +7,819 @@ pageTitle: Toast
pageDescription: Toast is a component that can display alerts, notifications, or messages on top of an overlay layer. It is commonly used to inform users of important information or actions.
-showHeader: false
-
-tag: coming soon
+showHeader: true
---
import { Meta } from '@storybook/addon-docs';
-# Toast
+import {
+ Toast,
+ ToastTitle,
+ ToastDescription,
+ useToast,
+ Button,
+ ButtonText,
+ CheckIcon,
+ MessageCircleIcon,
+ Icon,
+ CloseIcon,
+ VStack,
+ Pressable,
+ Center,
+} from '../../core-components/nativewind';
+import { transformedCode } from '../../utils';
+import {
+ AppProvider,
+ CodePreview,
+ Table,
+ TableContainer,
+ Text,
+ InlineCode,
+ CollapsibleCode,
+ Tabs,
+} from '@gluestack/design-system';
+import { View } from 'react-native';
+import Wrapper from '../../core-components/nativewind/Wrapper';
+import {AlertTriangle} from 'lucide-react-native'
+
+This is an illustration of **Toast** component.
+
+<>
+ {
+ toast.show({
+ placement:"top",
+ render: ({ id }) => {
+ const toastId = "toast-" + id;
+ return (
+
+
+ New Message
+
+ Hey, just wanted to touch base and see how you're doing. Let's catch up soon!
+
+
+
+ );
+ },
+ });
+ }}
+ >
+ Press Me
+
+ );
+ };
+ `,
+ transformCode: (code) => {
+ return transformedCode(code, 'function', 'Example');
+ },
+ scope: {
+ Wrapper,
+ Toast,
+ ToastTitle,
+ ToastDescription,
+ useToast,
+ Text,
+ Button,
+ ButtonText,
+ VStack,
+ },
+ argsType: {
+ action: {
+ control: 'select',
+ options: ['success', 'info', 'error', 'warning', 'attention'],
+ default: 'attention',
+ },
+ variant: {
+ control: 'select',
+ options: ['accent', 'solid', 'outline'],
+ default: 'solid',
+ },
+ },
+ }}
+ />
+>
+
+
+
+## Installation
+
+
+
+
+ CLI
+
+
+ Manual
+
+
+
+
+<>
+
+### Run the following command:
+ ```bash
+ npx gluestack-ui add toast
+ ```
+>
+
+
+<>
+
+### Step 1: Install the following dependencies:
+
+```bash
+
+npm i @gluestack-ui/toast
+
+```
+
+### Step 2: Copy and paste the following code into your project.
+
+
+
+```jsx
+%%-- File: core-components/nativewind/toast/index.tsx --%%
+```
+
+
+
+### Step 3: Update the import paths to match your project setup.
+>
+
+
+
+
+## API Reference
+
+To use this component in your project, include the following import statement in your file.
+
+```jsx
+import { useToast, Toast } from '@/components/ui/toast';
+```
+
+```jsx
+export default () => (
+
+
+
+
+);
+```
+### Component Props
+
+This section provides a comprehensive reference list for the component props, detailing descriptions, properties, types, and default behavior for easy project integration.
+
+#### Toast
+
+It inherits all the properties of React Native's [View](https://reactnative.dev/docs/view) component.
+
+<>
+
+
+
+
+
+ Prop
+
+
+ Type
+
+
+ Default
+
+
+ Description
+
+
+
+
+
+
+
+ duration
+
+
+
+ number or null
+
+
+ 5000
+
+
+ {`The delay before the toast hides (in milliseconds). If set to null, toast will never dismiss.`}
+
+
+
+
+
+ onCloseComplete
+
+
+
+ {`()=>{}`}
+
+
+ -
+
+
+ {`Callback function to run side effects after the toast has closed.`}
+
+
+
+
+
+ placement
+
+
+
+
+ 'top'| 'top right' | 'top left' | 'bottom' | 'bottom left' |
+ 'bottom right'
+
+
+
+ bottom
+
+
+ Position of toast on the web page.
+
+
+
+
+
+ render?: (props: any)
+
+
+
+ ReactNode
+
+
+ -
+
+
+ Renders a toast component
+
+
+
+
+
+ avoidKeyboard
+
+
+
+ bool
+
+
+ false
+
+
+ {`If true and the keyboard is opened, the Toast will move up equivalent to the keyboard height.`}
+
+
+
+
+
+ containerStyle
+
+
+
+ ViewStyle
+
+
+ -
+
+
+ Container style object for the toast.
+
+
+
+
+
+>
+
+#### ToastTitle
+
+Contains all Text related layout style props and actions.
+It inherits all the properties of React Native's [Text](https://reactnative.dev/docs/text) component.
+
+#### ToastDescription
+
+Contains all Text related layout style props and actions.
+It inherits all the properties of React Native's [Text](https://reactnative.dev/docs/text) component.
+
+### Accessibility
+
+We have outlined the various features that ensure the Toast component is accessible to all users, including those with disabilities. These features help ensure that your application is inclusive and meets accessibility standards.Adheres to the [WAI-ARIA design pattern](https://www.w3.org/WAI/ARIA/apg/patterns/alert/).
+
+#### Keyboard
+
+- `Tab + Enter`: Triggers the toast's action.
+
+#### Screen Reader
+
+- VoiceOver: When the toast is focused, the screen reader will announce the toast's title.
+
+### Props
+
+Toast component is created using View component from react-native. It extends all the props supported by [React Native View](https://reactnative.dev/docs/view#props) and the props mentioned below.
+
+#### Toast
+
+<>
+
+
+
+
+
+ Name
+
+
+ Value
+
+
+ Default
+
+
+
+
+
+
+
+ action
+
+
+
+
+ error | warning | success | info | attention
+
+
+
+ attention
+
+
+
+
+
+ variant
+
+
+
+ solid | outline | accent
+
+
+ solid
+
+
+
+
+
+>
+
+### Examples
+
+The Examples section provides visual representations of the different variants of the component, allowing you to quickly and easily determine which one best fits your needs. Simply copy the code and integrate it into your project.
+
+#### Toast with actions
+
+A versatile Toast component with customizable actions, enabling users to take various actions directly from the notification popup for enhanced usability and convenience.
+
+
+
+
+ {
+ toastActions.map((action, index)=>{
+ return (
+ {
+ toast.show({
+ placement:"top",
+ render: ({ id }) => {
+ const toastId = "toast-" + id;
+ return (
+
+
+ {action.title}
+
+ {action.description}
+
+
+
+ );
+ },
+ });
+ }}
+ >
+ {action.actionType}
+
+ )
+ })
+ }
+
+
+ );
+ };
+ `,
+ transformCode: (code) => {
+ return transformedCode(code, 'function', 'Example');
+ },
+ scope: {
+ View,
+ Wrapper,
+ Toast,
+ ToastTitle,
+ ToastDescription,
+ useToast,
+ Text,
+ Button,
+ ButtonText,
+ VStack,
+ Center,
+ },
+ argsType: {},
+ }}
+ />
+
+
+#### Toast with variants
+
+A versatile Toast component with multiple variants, offering different styles and visual cues to effectively convey various types of notifications and feedback to users.
+
+
+ {
+ toast.show({
+ placement:"top",
+ render: ({ id }) => {
+ const toastId = "toast-" + id;
+ return (
+
+
+ Attention!
+
+ Please review and accept our updated terms and conditions before continuing to use the application.
+
+
+
+ );
+ },
+ });
+ }}
+ >
+ Press Me
+
+ );
+ };
+ `,
+ transformCode: (code) => {
+ return transformedCode(code, 'function', 'Example');
+ },
+ scope: {
+ View,
+ Wrapper,
+ Toast,
+ ToastTitle,
+ ToastDescription,
+ useToast,
+ Text,
+ Button,
+ ButtonText,
+ VStack,
+ },
+ argsType: {
+ variant: {
+ control: 'select',
+ options: ['accent', 'solid', 'outline'],
+ default: 'solid',
+ },
+ },
+ }}
+ />
+
+
+#### Toast with placement
+
+A Toast component with different placement options allows for the flexible positioning of toast notifications, enabling them to appear in various locations within a user interface, enhancing user visibility and providing a customizable approach to displaying temporary messages or alerts.
+
+
+ {
+ toast.show({
+ placement: placement,
+ render: ({ id }) => {
+ const toastId = "toast-" + id;
+ return (
+
+ {placements[placement]}
+
+ );
+ },
+ });
+ }}
+ >
+ Press Me
+
+ );
+ };
+ `,
+ transformCode: (code) => {
+ return transformedCode(code, 'function', 'Example');
+ },
+ scope: {
+ View,
+ Wrapper,
+ Toast,
+ ToastTitle,
+ ToastDescription,
+ useToast,
+ Text,
+ Button,
+ ButtonText,
+ },
+ argsType: {
+ placement: {
+ control: 'select',
+ options: [
+ 'bottom',
+ 'top',
+ 'top right',
+ 'top left',
+ 'bottom left',
+ 'bottom right',
+ ],
+ default: 'bottom',
+ },
+ },
+ }}
+ />
+
+
+#### Dismissable Toast
+
+A dismissable Toast component offers users the ability to dismiss or close the toast notification, providing control and convenience in managing temporary messages or alerts within a user interface.
+
+
+ {
+ toast.show({
+ placement: 'top',
+ render: ({ id }) => {
+ const toastId = "toast-" + id;
+ return (
+
+
+
+ Download Complete
+ Your file 'wadewarren.docx' has been downloaded successfully. You can find it in your Downloads folder.
+
+ toast.close(id)} className="mt-1">
+
+
+
+ );
+ },
+ });
+ }}
+ >
+ Press Me
+
+ );
+ };
+ `,
+ transformCode: (code) => {
+ return transformedCode(code, 'function', 'Example');
+ },
+ scope: {
+ View,
+ Wrapper,
+ Toast,
+ ToastTitle,
+ ToastDescription,
+ useToast,
+ Text,
+ Icon,
+ CloseIcon,
+ VStack,
+ CheckIcon,
+ Button,
+ ButtonText,
+ Pressable,
+ },
+ argsType: {},
+ }}
+ />
+
+
+#### Toast custom duration
+
+A Toast component with custom duration allows for specifying the length of time the toast notification remains visible, offering flexibility in controlling the duration of temporary messages or alerts within a user interface.
+
+
+ {
+ toast.show({
+ placement: 'top',
+ duration: duration,
+ render: ({ id }) => {
+ const toastId = "toast-" + id;
+ return (
+
+
+
+ New Message
+ Hey, just wanted to touch base and see how you're doing. Let's catch up soon!
+
+ toast.close(id)} className="mt-1">
+
+
+
+ );
+ },
+ });
+ }}
+ >
+ Press Me
+
+ );
+ };
+ `,
+ transformCode: (code) => {
+ return transformedCode(code, 'function', 'Example');
+ },
+ scope: {
+ View,
+ Wrapper,
+ Toast,
+ ToastTitle,
+ ToastDescription,
+ useToast,
+ Text,
+ Button,
+ ButtonText,
+ Pressable,
+ Icon,
+ CloseIcon,
+ VStack,
+ MessageCircleIcon,
+ },
+ argsType: {
+ duration: {
+ control: 'input',
+ default: 5000,
+ },
+ },
+ }}
+ />
+
+
+#### Preserve Toast
+
+A Toast component with preserve toast functionality retains the notification on the screen until explicitly dismissed, ensuring important messages or alerts remain visible and accessible to the user, even during subsequent interactions within the user interface.
-Coming Soon!
\ No newline at end of file
+
+ {
+ toast.show({
+ placement: 'top',
+ duration: null,
+ render: ({ id }) => {
+ const toastId = "toast-" + id;
+ return (
+
+
+
+ Account Security Alert
+ Your account password was recently changed.
+ If you did not authorize this change, please contact our support team immediately.
+
+
+ toast.close(id)} className="mt-1">
+
+
+
+ );
+ },
+ });
+ }}
+ >
+ Press Me
+
+ );
+ };
+ `,
+ transformCode: (code) => {
+ return transformedCode(code, 'function', 'Example');
+ },
+ scope: {
+ View,
+ Wrapper,
+ Toast,
+ ToastTitle,
+ ToastDescription,
+ useToast,
+ Text,
+ Icon,
+ CloseIcon,
+ Pressable,
+ VStack,
+ AlertTriangle,
+ Button,
+ ButtonText,
+ },
+ argsType: {},
+ }}
+ />
+
diff --git a/example/storybook-nativewind/src/components/VStack/index.nw.stories.mdx b/example/storybook-nativewind/src/components/VStack/index.nw.stories.mdx
index 02005ec3d9..5904aede56 100644
--- a/example/storybook-nativewind/src/components/VStack/index.nw.stories.mdx
+++ b/example/storybook-nativewind/src/components/VStack/index.nw.stories.mdx
@@ -95,7 +95,7 @@ This is an illustration of **VStack** component.
<>
-### Step 1: Copy and paste the following code into your project.
+### Step 1: Copy and paste the following code into index.tsx in your project.
```jsx
@@ -103,7 +103,25 @@ This is an illustration of **VStack** component.
```
-### Step 2: Update the import paths to match your project setup.
+> Note: **This Step is (optional) and only required if you want to add support for [React Server Components](https://vercel.com/blog/understanding-react-server-components), You can skip this and jump to Step 3 directly if you don't have this requirement.**
+
+### Step 2: Copy and paste the following code into index.web.tsx in your project.
+
+
+```jsx
+%%-- File: core-components/nativewind/vstack/index.web.tsx --%%
+```
+
+
+### Step 3: Copy and paste the following code into styles.tsx in your project.
+
+
+```jsx
+%%-- File: core-components/nativewind/vstack/styles.tsx --%%
+```
+
+
+### Step 4: Update the import paths to match your project setup.
>
diff --git a/example/storybook-nativewind/src/components/docs-components/DefaultComponent.tsx b/example/storybook-nativewind/src/components/docs-components/DefaultComponent.tsx
new file mode 100644
index 0000000000..16684b96c9
--- /dev/null
+++ b/example/storybook-nativewind/src/components/docs-components/DefaultComponent.tsx
@@ -0,0 +1,99 @@
+import React, { useContext, Fragment, useMemo } from 'react';
+import tailwindConfig from 'tailwind.config';
+import { GluestackUIProvider } from '../../core-components/nativewind/gluestack-ui-provider';
+import { config } from '../../core-components/nativewind/gluestack-ui-provider/config';
+import {
+ VStack,
+ HStack,
+ Box,
+ Text,
+ Heading,
+} from '../../core-components/nativewind';
+import { LayoutContext } from '@gluestack/design-system';
+
+const ColorPaletteComponent = () => {
+ const { colorMode } = useContext(LayoutContext);
+
+ const colorPalette = useMemo(() => {
+ const sourceObject = tailwindConfig!.theme!.extend!.colors; // get the source object to loop
+ const paletteData: {
+ name: string;
+ variants: {
+ name: string;
+ variant: string;
+ color: string;
+ className: string;
+ };
+ }[] = []; // result array to push data into
+
+ for (const [name, colors] of Object.entries(sourceObject)) {
+ // object.entries gives us the key value pair of the object and makes it iterable. {primary: [{0: '#fff'}]} where primary is the key (name) and the value is an object with the color variants (colors)
+
+ const variants: {
+ name: string;
+ variant: string;
+ color: string;
+ className: string;
+ }[] = [];
+
+ for (const [variant, color] of Object.entries(colors)) {
+ // loop over all the variants of the color i.e. the {0: '#fff'} object in the same way as the above loop
+ const variableName = extractVariableName(color); // extract the --color-name part from the var(---color-name) string using regex, it will return null if we pass it a hex code
+ const colorName = variableName || color; // variableName will be null in case there was a hex code passed to the extract function
+
+ const colorCode =
+ colorMode === 'light'
+ ? config.light[colorName]
+ : config.dark[colorName]; // get the color code from the config based on the color name and the color mode
+
+ const className = `bg-${name}-${variant}`; // need to save the class name for the color to use in the UI
+
+ variants.push({
+ name,
+ variant,
+ color: colorCode || color,
+ className,
+ }); // push the data into the result array
+ }
+
+ paletteData.push({ name, variants }); // push the data into the result array
+ }
+
+ return paletteData; // return the result array
+ }, [colorMode]);
+
+ function extractVariableName(text: string): string | null {
+ const pattern = /\bvar\((.*?)\)/g;
+ const match = pattern.exec(text);
+ return match?.[1] ?? null;
+ }
+
+ return (
+
+
+ {colorPalette.map(({ name }, i) => (
+
+
+ {name}
+
+
+ {colorPalette[i].variants.map((variant, j) => (
+
+
+
+ {variant.variant}
+ {variant.color}
+
+
+ ))}
+
+
+ ))}
+
+
+ );
+};
+
+export { ColorPaletteComponent };
diff --git a/example/storybook-nativewind/src/components/docs-components/DefaultComponentThemed.tsx b/example/storybook-nativewind/src/components/docs-components/DefaultComponentThemed.tsx
new file mode 100644
index 0000000000..a58a3c0554
--- /dev/null
+++ b/example/storybook-nativewind/src/components/docs-components/DefaultComponentThemed.tsx
@@ -0,0 +1,471 @@
+import React, {
+ Fragment,
+ useContext,
+ useState,
+ useEffect,
+ useMemo,
+} from 'react';
+import {
+ Text,
+ VStack,
+ HStack,
+ Box,
+ GluestackUIProvider,
+ Divider,
+ Tooltip,
+ TooltipContent,
+ TooltipText,
+ Pressable,
+} from '@gluestack-ui/themed';
+import { config } from '../../core-components/themed/gluestack-ui-provider/config';
+import { LayoutContext } from '@gluestack/design-system';
+
+const ColorPaletteComponent = () => {
+ const { colorMode } = useContext(LayoutContext);
+ const [colors, setColors] = useState([]);
+
+ useEffect(() => {
+ if (!colorMode) return;
+ if (colorMode === 'light') {
+ setColors(config.tokens.colors);
+ } else {
+ setColors(config.themes[colorMode].colors);
+ }
+ }, [colorMode]);
+
+ const sortedPalette = useMemo(() => {
+ const colorPalette: any = {
+ primary: {},
+ secondary: {},
+ tertiary: {},
+ others: {},
+ };
+
+ for (const colorKey in colors) {
+ const category = colorKey.replace(/\d+/g, '');
+ const shade = colorKey.replace(/\D+/g, '');
+
+ if (shade === '') {
+ colorPalette.others[category] = colors[colorKey];
+ continue;
+ }
+
+ if (!colorPalette[category]) {
+ colorPalette[category] = {};
+ }
+
+ colorPalette[category][shade] = colors[colorKey];
+ }
+
+ const sortedColorPalette: any = {};
+
+ for (const category in colorPalette) {
+ if (category !== 'others') {
+ sortedColorPalette[category] = Object.fromEntries(
+ Object.entries(colorPalette[category]).sort()
+ );
+ }
+ }
+
+ sortedColorPalette.others = { ...colorPalette.others };
+
+ return sortedColorPalette;
+ }, [colors]);
+ return (
+
+
+ {Object.keys(sortedPalette).map((category: string) => {
+ return (
+
+
+ {category}
+
+
+ {Object.keys(sortedPalette[category]).map((shade: string) => {
+ return (
+
+
+
+
+ {category === 'others'
+ ? `${shade}`
+ : `${category}${shade}`}
+
+ {sortedPalette[category][shade]}
+
+
+ );
+ })}
+
+
+ );
+ })}
+
+
+ );
+};
+
+const spaces: any = config.tokens.space;
+
+const sortedSpaceObject: any = spaces;
+
+// Convert the map to an array of key-value pairs for sorting
+const mapEntries = Object.entries(sortedSpaceObject);
+
+// Sort the map entries based on the keys
+mapEntries.sort(([keyA, valueA]: any, [keyB, valueB]: any) => {
+ // Treat 'px' as the smallest and 'full' as the largest
+ // Place '0' at the top
+ if (keyA === '0') return -1;
+ if (keyB === '0') return 1;
+
+ // Treat 'px' as the second smallest
+ if (keyA === 'px') return -1;
+ if (keyB === 'px') return 1;
+
+ // Treat 'full' as the largest
+ if (keyA === 'full') return 1;
+ if (keyB === 'full') return -1;
+
+ // Values with '%' should be grouped and sorted at the end
+ const isValueAPercentage = valueA.toString().includes('%');
+ const isValueBPercentage = valueB.toString().includes('%');
+ if (isValueAPercentage && !isValueBPercentage) return 1;
+ if (isValueBPercentage && !isValueAPercentage) return -1;
+
+ // Group values with the same denominator and sort them
+ const [numA, denomA] = keyA.split('/').map(parseFloat);
+ const [numB, denomB] = keyB.split('/').map(parseFloat);
+
+ if (!isNaN(numA) && !isNaN(denomA) && !isNaN(numB) && !isNaN(denomB)) {
+ if (denomA === denomB) {
+ return numA - numB;
+ } else {
+ return denomA - denomB; // Sort by denominator if they are different
+ }
+ }
+
+ // For numeric keys, compare them as numbers
+ if (!isNaN(numA) && !isNaN(numB)) {
+ return numA - numB;
+ }
+
+ // For other keys, compare them as strings
+ return keyA.localeCompare(keyB);
+});
+// const spaceElementsArray =
+// Create a new Map from the sorted map entries
+
+const SpaceComponent = () => {
+ const { colorMode } = useContext(LayoutContext);
+ return (
+
+
+
+
+ Tokens
+
+
+ Value (Pixels)
+
+ Representation
+
+ {mapEntries.map(([key, value]: any) => {
+ return (
+
+
+
+
+ {key}
+
+
+ {value}
+
+
+
+
+
+
+ );
+ })}
+
+
+ );
+};
+
+const opacity: any = config.tokens.opacity;
+
+const OpacityComponent = () => {
+ const { colorMode } = useContext(LayoutContext);
+ return (
+
+
+ {Object.keys(opacity).map((op: string) => {
+ return (
+
+
+
+
+ {op}
+
+
+ ({opacity[op]})
+
+
+
+ );
+ })}
+
+
+ );
+};
+
+const ShadowsComponent = () => {
+ const { colorMode } = useContext(LayoutContext);
+ const hardShadows: any = config.globalStyle.variants.hardShadow;
+ const softShadows: any = config.globalStyle.variants.softShadow;
+
+ return (
+
+
+
+ Hard Shadows
+
+
+ {Object.keys(hardShadows).map((shadow: string) => {
+ return (
+ {
+ return (
+
+
+ {shadow}
+
+
+ );
+ }}
+ >
+
+
+ {JSON.stringify(hardShadows[shadow], null, 2)}
+
+
+
+ );
+ })}
+
+
+ Soft Shadows
+
+
+ {Object.keys(softShadows).map((shadow: string) => {
+ return (
+ {
+ return (
+
+
+ {shadow}
+
+
+ );
+ }}
+ >
+
+
+ {JSON.stringify(softShadows[shadow], null, 2)}
+
+
+
+ );
+ })}
+
+
+
+ );
+};
+
+const borderWidths = config.tokens.borderWidths;
+const BorderWidthComponent = () => {
+ const { colorMode } = useContext(LayoutContext);
+ return (
+
+
+ {Object.keys(borderWidths).map((borderWidth: any) => {
+ return (
+
+ {borderWidth}
+
+ ({borderWidths[borderWidth]})
+
+
+ );
+ })}
+
+
+ );
+};
+
+const radii = config.tokens.radii;
+const RadiiComponent = () => {
+ const { colorMode } = useContext(LayoutContext);
+ return (
+
+
+ {Object.keys(radii).map((borderRadiusValue: any) => {
+ return (
+
+ {borderRadiusValue}
+
+ ({radii[borderRadiusValue]})
+
+
+ );
+ })}
+
+
+ );
+};
+
+export {
+ ColorPaletteComponent,
+ SpaceComponent,
+ OpacityComponent,
+ ShadowsComponent,
+ BorderWidthComponent,
+ RadiiComponent,
+};
+
+export { Text, VStack, HStack, Box };
diff --git a/example/storybook-nativewind/src/core-components/nativewind/Wrapper.tsx b/example/storybook-nativewind/src/core-components/nativewind/Wrapper.tsx
index b0c5b269c8..54ab86a8ed 100644
--- a/example/storybook-nativewind/src/core-components/nativewind/Wrapper.tsx
+++ b/example/storybook-nativewind/src/core-components/nativewind/Wrapper.tsx
@@ -1,7 +1,30 @@
'use client';
import React from 'react';
import { Box, Center, useColorMode } from '@gluestack-ui/themed';
-import { GluestackUIProvider } from './gluestack-ui-provider';
+import { config } from './gluestack-ui-provider/config';
+
+export function GluestackUIProvider({
+ mode = 'light',
+ ...props
+}: {
+ mode?: 'light' | 'dark';
+ children?: any;
+}) {
+ if (config[mode] && typeof document !== 'undefined') {
+ const element = document.documentElement;
+ if (element) {
+ const head = element.querySelector('head');
+ const style = document.createElement('style');
+ const stringcssvars = Object.keys(config[mode]).reduce((acc, cur) => {
+ acc += `${cur}:${config[mode][cur]};`;
+ return acc;
+ }, '');
+ style.innerHTML = `:root {${stringcssvars}} `;
+ if (head) head.appendChild(style);
+ }
+ }
+ return props.children;
+}
const Wrapper = ({ children, ...props }: any) => {
const colorMode: any = useColorMode();
diff --git a/example/storybook-nativewind/src/core-components/nativewind/accordion/index.tsx b/example/storybook-nativewind/src/core-components/nativewind/accordion/index.tsx
index c949bd7333..fd5463bba3 100644
--- a/example/storybook-nativewind/src/core-components/nativewind/accordion/index.tsx
+++ b/example/storybook-nativewind/src/core-components/nativewind/accordion/index.tsx
@@ -13,6 +13,7 @@ import { withStyleContextAndStates } from '@gluestack-ui/nativewind-utils/withSt
import { H3 } from '@expo/html-elements';
import { cssInterop } from '@gluestack-ui/nativewind-utils/cssInterop';
+const SCOPE = 'ACCORDION';
/** Styles */
const accordionStyle = tva({
@@ -21,6 +22,11 @@ const accordionStyle = tva({
variant: {
filled: 'bg-white',
},
+ size: {
+ sm: '',
+ md: '',
+ lg: '',
+ },
},
});
const accordionItemStyle = tva({
@@ -74,17 +80,18 @@ const accordionTriggerStyle = tva({
base: 'w-full py-5 px-5 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',
});
+const Root =
+ Platform.OS === 'web'
+ ? withStyleContext(View, SCOPE)
+ : withStyleContextAndStates(View, SCOPE);
+
+const Header = Platform.OS === 'web' ? H3 : View;
/** Creator */
const UIAccordion = createAccordion({
- //@ts-ignore
- Root:
- Platform.OS === 'web'
- ? withStyleContext(View)
- : withStyleContextAndStates(View),
+ Root: Root,
Item: View,
- // @ts-ignore
- Header: Platform.OS === 'web' ? H3 : View,
//@ts-ignore
+ Header: Header,
Trigger: Pressable,
Icon: View,
TitleText: Text,
@@ -138,7 +145,6 @@ const Accordion = React.forwardRef(
{
className,
variant = 'filled',
- //@ts-ignore
size = 'md',
...props
}: { className?: string } & IAccordionProps,
@@ -160,7 +166,7 @@ const AccordionItem = React.forwardRef(
{ className, ...props }: { className?: string } & IAccordionItemProps,
ref?: any
) => {
- const { variant } = useStyleContext();
+ const { variant } = useStyleContext(SCOPE);
return (
{
- const { size } = useStyleContext();
+ const { size } = useStyleContext(SCOPE);
return (
{
- const { size: parentSize } = useStyleContext();
+ const { size: parentSize } = useStyleContext(SCOPE);
if (AsComp) {
return (
@@ -243,6 +249,7 @@ const AccordionIcon = React.forwardRef(
return (
{
- const { size } = useStyleContext();
+ const { size } = useStyleContext(SCOPE);
return (
{
- const { size: parentSize } = useStyleContext();
+ const { size: parentSize } = useStyleContext(SCOPE);
return (
{
- return (
-
- );
-};
-const AlertText = ({
- className,
- isTruncated,
- bold,
- underline,
- strikeThrough,
- size = 'md',
- sub,
- italic,
- highlight,
- ...props
-}: any) => {
- return (
-
- );
+type IAlertProps = Omit, 'context'> &
+ VariantProps;
+const Alert = React.forwardRef(
+ (
+ {
+ className,
+ variant = 'solid',
+ action = 'info',
+ ...props
+ }: { className?: string } & IAlertProps,
+ ref?: any
+ ) => {
+ return (
+
+ );
+ }
+);
+
+type IAlertTextProps = React.ComponentProps &
+ VariantProps;
+const AlertText = React.forwardRef(
+ (
+ {
+ className,
+ isTruncated,
+ bold,
+ underline,
+ strikeThrough,
+ size = 'md',
+ sub,
+ italic,
+ highlight,
+ ...props
+ }: { className?: string } & IAlertTextProps,
+ ref?: any
+ ) => {
+ return (
+
+ );
+ }
+);
+
+interface DefaultColors {
+ info: string;
+ success: string;
+ error: string;
+ warning: string;
+ muted: string;
+}
+const defaultColors: DefaultColors = {
+ info: '#0DA6F2',
+ success: '#38A169',
+ error: '#D32F2F',
+ warning: '#FFC107',
+ muted: '#999999',
};
+type IAlertIconProps = React.ComponentProps &
+ VariantProps;
const AlertIcon = ({
className,
size = 'md',
fill = 'none',
as: AsComp,
...props
-}: any) => {
- const { action } = useStyleContext();
+}: {
+ className?: string;
+ as?: any;
+ fill?: string;
+ color?: any;
+} & IAlertIconProps) => {
+ const { action: parentAction } = useStyleContext(SCOPE);
+ const { color = defaultColors[parentAction as keyof DefaultColors] } = props;
+
if (AsComp) {
return (
-
+ >
+
+
);
}
return (
);
diff --git a/example/storybook-nativewind/src/core-components/nativewind/avatar/index.tsx b/example/storybook-nativewind/src/core-components/nativewind/avatar/index.tsx
index fe6352235b..5b1aa86a66 100644
--- a/example/storybook-nativewind/src/core-components/nativewind/avatar/index.tsx
+++ b/example/storybook-nativewind/src/core-components/nativewind/avatar/index.tsx
@@ -10,9 +10,11 @@ import {
useStyleContext,
} from '@gluestack-ui/nativewind-utils/withStyleContext';
import { cssInterop } from '@gluestack-ui/nativewind-utils/cssInterop';
+const SCOPE = 'AVATAR';
+import type { VariantProps } from '@gluestack-ui/nativewind-utils';
const UIAvatar = createAvatar({
- Root: withStyleContext(View),
+ Root: withStyleContext(View, SCOPE),
Badge: View,
Group: View,
Image: Image,
@@ -71,39 +73,37 @@ const avatarBadgeStyle = tva({
},
},
});
+
const avatarImageStyle = tva({
base: 'h-full w-full rounded-full absolute',
});
+type IAvatarProps = Omit, 'context'> &
+ VariantProps;
export const Avatar = React.forwardRef(
(
- {
- className,
- variant = 'solid',
- size = 'md',
- action = 'primary',
- ...props
- }: any,
- ref
+ { className, size = 'md', ...props }: { className?: string } & IAvatarProps,
+ ref?: any
) => {
return (
);
}
);
+type IAvatarBadgeProps = React.ComponentProps &
+ VariantProps;
export const AvatarBadge = React.forwardRef(
- ({ className, variant, size, action, ...props }: any, ref) => {
- const {
- variant: parentVariant,
- size: parentSize,
- action: parentAction,
- } = useStyleContext();
+ (
+ { className, size, ...props }: { className?: string } & IAvatarBadgeProps,
+ ref?: any
+ ) => {
+ const { size: parentSize } = useStyleContext(SCOPE);
return (
);
}
);
+
+type IAvatarFallbackTextProps = React.ComponentProps<
+ typeof UIAvatar.FallbackText
+> &
+ VariantProps;
export const AvatarFallbackText = React.forwardRef(
- ({ className, variant, size, action, ...props }: any, ref) => {
- const {
- variant: parentVariant,
- size: parentSize,
- action: parentAction,
- } = useStyleContext();
+ (
+ {
+ className,
+ size,
+ ...props
+ }: { className?: string } & IAvatarFallbackTextProps,
+ ref?: any
+ ) => {
+ const { size: parentSize } = useStyleContext(SCOPE);
return (
@@ -152,8 +152,13 @@ export const AvatarFallbackText = React.forwardRef(
}
);
+type IAvatarImageProps = React.ComponentProps &
+ VariantProps;
export const AvatarImage = React.forwardRef(
- ({ className, ...props }: any, ref) => {
+ (
+ { className, ...props }: { className?: string } & IAvatarImageProps,
+ ref?: any
+ ) => {
return (
&
+ VariantProps;
export const AvatarGroup = React.forwardRef(
- ({ className, ...props }: any, ref) => {
+ (
+ { className, ...props }: { className?: string } & IAvatarGroupProps,
+ ref?: any
+ ) => {
return (
{
- const { size: parentSize, action: parentAction } = useStyleContext();
+ const { size: parentSize, action: parentAction } = useStyleContext(SCOPE);
return (
& {
- as?: any;
+interface DefaultColors {
+ info: string;
+ success: string;
+ error: string;
+ warning: string;
+ muted: string;
+}
+const defaultColors: DefaultColors = {
+ info: '#0B8DCD',
+ success: '#2A7948',
+ error: '#DC2626',
+ warning: '#D76C1F',
+ muted: '#515252',
};
+type IBadgeIconProps = React.ComponentProps &
+ VariantProps;
const BadgeIcon = ({
className,
size,
as: AsComp,
+ fill = 'none',
...props
-}: IBadgeIconProps & { className?: any }) => {
- const { size: parentSize, action: parentAction } = useStyleContext();
+}: IBadgeIconProps & { className?: any } & {
+ color?: any;
+ fill?: string;
+ as?: any;
+}) => {
+ const { size: parentSize, action: parentAction } = useStyleContext(SCOPE);
+ const { color = defaultColors[parentAction as keyof DefaultColors] } = props;
+
if (AsComp) {
return (
-
+ >
+
+
);
}
return (
@@ -177,12 +197,14 @@ const BadgeIcon = ({
className={badgeIconStyle({
parentVariants: {
size: parentSize,
- action: parentAction,
},
size,
class: className,
})}
{...props}
+ //@ts-ignore
+ fill={fill}
+ color={color}
/>
);
};
diff --git a/example/storybook-nativewind/src/core-components/nativewind/box/index.tsx b/example/storybook-nativewind/src/core-components/nativewind/box/index.tsx
index 1d9adcd006..ba2a3e6ae4 100644
--- a/example/storybook-nativewind/src/core-components/nativewind/box/index.tsx
+++ b/example/storybook-nativewind/src/core-components/nativewind/box/index.tsx
@@ -1,11 +1,8 @@
-'use client';
import React from 'react';
import { View } from 'react-native';
-import { tva } from '@gluestack-ui/nativewind-utils/tva';
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
-
-const boxStyle = tva({});
+import { boxStyle } from './styles';
type IBoxProps = React.ComponentProps &
VariantProps;
diff --git a/example/storybook-nativewind/src/core-components/nativewind/box/index.web.tsx b/example/storybook-nativewind/src/core-components/nativewind/box/index.web.tsx
new file mode 100644
index 0000000000..11a28108d0
--- /dev/null
+++ b/example/storybook-nativewind/src/core-components/nativewind/box/index.web.tsx
@@ -0,0 +1,11 @@
+import React from 'react';
+import { boxStyle } from './styles';
+
+const Box = React.forwardRef(({ className, ...props }: any, ref) => {
+ return (
+
+ );
+});
+
+Box.displayName = 'Box';
+export { Box };
diff --git a/example/storybook-nativewind/src/core-components/nativewind/box/styles.tsx b/example/storybook-nativewind/src/core-components/nativewind/box/styles.tsx
new file mode 100644
index 0000000000..95ace8c57f
--- /dev/null
+++ b/example/storybook-nativewind/src/core-components/nativewind/box/styles.tsx
@@ -0,0 +1,2 @@
+import { tva } from '@gluestack-ui/nativewind-utils/tva';
+export const boxStyle = tva({});
diff --git a/example/storybook-nativewind/src/core-components/nativewind/button/index.tsx b/example/storybook-nativewind/src/core-components/nativewind/button/index.tsx
index c48ddfb3e6..aaa356b91a 100644
--- a/example/storybook-nativewind/src/core-components/nativewind/button/index.tsx
+++ b/example/storybook-nativewind/src/core-components/nativewind/button/index.tsx
@@ -19,12 +19,14 @@ import {
Platform,
} from 'react-native';
+const SCOPE = 'BUTTON';
+const Root =
+ Platform.OS === 'web'
+ ? withStyleContext(Pressable, SCOPE)
+ : withStyleContextAndStates(Pressable, SCOPE);
+
const UIButton = createButton({
- // @ts-ignore
- Root:
- Platform.OS === 'web'
- ? withStyleContext(Pressable)
- : withStyleContextAndStates(Pressable),
+ Root: Root,
Text,
Group: View,
Spinner: ActivityIndicator,
@@ -219,10 +221,6 @@ const buttonIconStyle = tva({
type IButtonProps = Omit, 'context'> &
VariantProps;
-
-type IButtonTextProps = React.ComponentProps &
- VariantProps;
-
const Button = React.forwardRef(
(
{
@@ -232,11 +230,10 @@ const Button = React.forwardRef(
action = 'primary',
...props
}: { className?: string } & IButtonProps,
- ref
+ ref?: any
) => {
return (
;
-
-type IButtonIcon = React.ComponentProps & {
- as?: any;
-};
+type IButtonTextProps = React.ComponentProps &
+ VariantProps;
const ButtonText = React.forwardRef(
(
{
@@ -266,13 +260,13 @@ const ButtonText = React.forwardRef(
variant: parentVariant,
size: parentSize,
action: parentAction,
- } = useStyleContext();
+ } = useStyleContext(SCOPE);
return (
&
+ VariantProps;
const ButtonIcon = ({
className,
as: AsComp,
+ fill = 'none',
size,
...props
-}: IButtonIcon & { className?: any }) => {
+}: IButtonIcon & {
+ className?: any;
+ fill?: string;
+ color?: string;
+ as?: any;
+}) => {
const {
variant: parentVariant,
size: parentSize,
action: parentAction,
- } = useStyleContext();
+ } = useStyleContext(SCOPE);
+
+ let localColor;
+ if (parentVariant !== 'solid') {
+ localColor = defaultColors[parentAction as keyof DefaultColors];
+ } else {
+ localColor = '#FEFEFF';
+ }
+ const { color = localColor } = props;
if (AsComp) {
return (
-
+ >
+
+
);
}
return (
);
};
+
Button.displayName = 'Button';
ButtonText.displayName = 'ButtonText';
ButtonSpinner.displayName = 'ButtonSpinner';
diff --git a/example/storybook-nativewind/src/core-components/nativewind/card/index.tsx b/example/storybook-nativewind/src/core-components/nativewind/card/index.tsx
index f166efac9d..6b137f4114 100644
--- a/example/storybook-nativewind/src/core-components/nativewind/card/index.tsx
+++ b/example/storybook-nativewind/src/core-components/nativewind/card/index.tsx
@@ -1,37 +1,25 @@
-'use client';
import React from 'react';
-import { tva } from '@gluestack-ui/nativewind-utils/tva';
+import type { VariantProps } from '@gluestack-ui/nativewind-utils';
import { View } from 'react-native';
+import { cardStyle } from './styles';
-const cardStyle = tva({
- variants: {
- size: {
- sm: 'p-3 rounded',
- md: 'p-4 rounded-md',
- lg: 'p-6 rounded-xl',
- },
- variant: {
- elevated: 'bg-background-0',
- outline: 'border border-outline-200 ',
- ghost: 'rounded-none',
- filled: 'bg-background-50',
- },
- },
-});
+type ICardProps = React.ComponentProps &
+ VariantProps;
-const Card = ({
- className,
- size = 'md',
- variant = 'elevated',
- ...props
-}: any) => {
- return (
-
- );
-};
+const Card = React.forwardRef(
+ (
+ { className, size = 'md', variant = 'elevated', ...props }: ICardProps,
+ ref?: any
+ ) => {
+ return (
+
+ );
+ }
+);
Card.displayName = 'Card';
diff --git a/example/storybook-nativewind/src/core-components/nativewind/card/index.web.tsx b/example/storybook-nativewind/src/core-components/nativewind/card/index.web.tsx
new file mode 100644
index 0000000000..ed012bcf38
--- /dev/null
+++ b/example/storybook-nativewind/src/core-components/nativewind/card/index.web.tsx
@@ -0,0 +1,20 @@
+import React from 'react';
+import { cardStyle } from './styles';
+
+const Card = ({
+ className,
+ size = 'md',
+ variant = 'elevated',
+ ...props
+}: any) => {
+ return (
+
+ );
+};
+
+Card.displayName = 'Card';
+
+export { Card };
diff --git a/example/storybook-nativewind/src/core-components/nativewind/card/styles.tsx b/example/storybook-nativewind/src/core-components/nativewind/card/styles.tsx
new file mode 100644
index 0000000000..d5fa01f8e3
--- /dev/null
+++ b/example/storybook-nativewind/src/core-components/nativewind/card/styles.tsx
@@ -0,0 +1,16 @@
+import { tva } from '@gluestack-ui/nativewind-utils/tva';
+export const cardStyle = tva({
+ variants: {
+ size: {
+ sm: 'p-3 rounded',
+ md: 'p-4 rounded-md',
+ lg: 'p-6 rounded-xl',
+ },
+ variant: {
+ elevated: 'bg-background-0',
+ outline: 'border border-outline-200 ',
+ ghost: 'rounded-none',
+ filled: 'bg-background-50',
+ },
+ },
+});
diff --git a/example/storybook-nativewind/src/core-components/nativewind/center/index.tsx b/example/storybook-nativewind/src/core-components/nativewind/center/index.tsx
index a0d3514458..f5bc459a7c 100644
--- a/example/storybook-nativewind/src/core-components/nativewind/center/index.tsx
+++ b/example/storybook-nativewind/src/core-components/nativewind/center/index.tsx
@@ -1,10 +1,6 @@
-'use client';
import { View } from 'react-native';
import React from 'react';
-import { tva } from '@gluestack-ui/nativewind-utils/tva';
-const centerStyle = tva({
- base: 'justify-center items-center',
-});
+import { centerStyle } from './styles';
const Center = ({ className, ...props }: any) => {
return ;
diff --git a/example/storybook-nativewind/src/core-components/nativewind/center/index.web.tsx b/example/storybook-nativewind/src/core-components/nativewind/center/index.web.tsx
new file mode 100644
index 0000000000..9bdb3b2b3b
--- /dev/null
+++ b/example/storybook-nativewind/src/core-components/nativewind/center/index.web.tsx
@@ -0,0 +1,10 @@
+import React from 'react';
+import { centerStyle } from './styles';
+
+const Center = ({ className, ...props }: any) => {
+ return
;
+};
+
+Center.displayName = 'Center';
+
+export { Center };
diff --git a/example/storybook-nativewind/src/core-components/nativewind/center/styles.tsx b/example/storybook-nativewind/src/core-components/nativewind/center/styles.tsx
new file mode 100644
index 0000000000..d247d80ca4
--- /dev/null
+++ b/example/storybook-nativewind/src/core-components/nativewind/center/styles.tsx
@@ -0,0 +1,4 @@
+import { tva } from '@gluestack-ui/nativewind-utils/tva';
+export const centerStyle = tva({
+ base: 'web:flex web:flex-col justify-center items-center',
+});
diff --git a/example/storybook-nativewind/src/core-components/nativewind/checkbox/index.tsx b/example/storybook-nativewind/src/core-components/nativewind/checkbox/index.tsx
index bd746e5920..60a7815e13 100644
--- a/example/storybook-nativewind/src/core-components/nativewind/checkbox/index.tsx
+++ b/example/storybook-nativewind/src/core-components/nativewind/checkbox/index.tsx
@@ -11,18 +11,17 @@ import { withStyleContextAndStates } from '@gluestack-ui/nativewind-utils/withSt
import { cssInterop } from '@gluestack-ui/nativewind-utils/cssInterop';
import { withStates } from '@gluestack-ui/nativewind-utils/withStates';
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
-
import { Platform } from 'react-native';
-import { Check } from 'lucide-react-native';
+const SCOPE = 'CHECKBOX';
const UICheckbox = createCheckbox({
// @ts-ignore
Root:
Platform.OS === 'web'
- ? withStyleContext(View)
- : withStyleContextAndStates(Pressable),
+ ? withStyleContext(View, SCOPE)
+ : withStyleContextAndStates(Pressable, SCOPE),
Group: withStates(View),
- Icon: withStates(Check),
+ Icon: withStates(View),
Label: withStates(Text),
Indicator: withStates(View),
});
@@ -60,7 +59,7 @@ const checkboxLabelStyle = tva({
});
const checkboxIconStyle = tva({
- base: 'text-typography-0 data-[disabled=true]:opacity-40 fill-none',
+ base: 'text-typography-0 data-[disabled=true]:opacity-40',
parentVariants: {
size: {
@@ -81,8 +80,8 @@ const Checkbox = React.forwardRef(
className,
size = 'md',
...props
- }: { className?: string } & ICheckboxProps,
- ref
+ }: { className?: string; size?: string } & ICheckboxProps,
+ ref?: any
) => {
return (
{
- const { size: parentSize } = useStyleContext();
+ const { size: parentSize } = useStyleContext(SCOPE);
return (
&
const CheckboxLabel = React.forwardRef(
(
{ className, ...props }: { className?: string } & ICheckboxLabelProps,
- ref
+ ref?: any
) => {
- const { size: parentSize } = useStyleContext();
+ const { size: parentSize } = useStyleContext(SCOPE);
return (
& {
- as?: any;
-};
+type ICheckboxIconProps = React.ComponentProps &
+ VariantProps;
const CheckboxIcon = React.forwardRef(
- (
- {
- className,
- as: AsComp,
- ...props
- }: ICheckboxIconProps & { className?: any },
- ref
- ) => {
- const { size: parentSize } = useStyleContext();
+ ({
+ className,
+ as: AsComp,
+ fill = 'none',
+ size,
+ ...props
+ }: ICheckboxIconProps & {
+ className?: any;
+ fill?: string;
+ color?: string;
+ as?: any;
+ }) => {
+ const { size: parentSize } = useStyleContext(SCOPE);
+ const { color = 'gray' } = props;
+
if (AsComp) {
return (
-
+
);
@@ -185,15 +195,17 @@ const CheckboxIcon = React.forwardRef(
size: parentSize,
},
class: className,
+ size,
})}
{...props}
- ref={ref}
+ //@ts-ignore
+ fill={fill}
+ color={color}
/>
);
}
);
-// Assign display names
Checkbox.displayName = 'Checkbox';
CheckboxIndicator.displayName = 'CheckboxIndicator';
CheckboxLabel.displayName = 'CheckboxLabel';
diff --git a/example/storybook-nativewind/src/core-components/nativewind/fab/index.tsx b/example/storybook-nativewind/src/core-components/nativewind/fab/index.tsx
index 9044e8f60c..20a3e5be5f 100644
--- a/example/storybook-nativewind/src/core-components/nativewind/fab/index.tsx
+++ b/example/storybook-nativewind/src/core-components/nativewind/fab/index.tsx
@@ -11,18 +11,16 @@ import { withStyleContextAndStates } from '@gluestack-ui/nativewind-utils/withSt
import { cssInterop } from '@gluestack-ui/nativewind-utils/cssInterop';
import React from 'react';
-
+const SCOPE = 'FAB';
export const UIFab = createFab({
- // @ts-ignore
Root:
Platform.OS === 'web'
- ? withStyleContext(Pressable)
- : withStyleContextAndStates(Pressable),
+ ? withStyleContext(Pressable, SCOPE)
+ : withStyleContextAndStates(Pressable, SCOPE),
Label: Text,
Icon: View,
});
-// @ts-ignore
cssInterop(UIFab, { className: 'style' });
cssInterop(UIFab.Label, { className: 'style' });
cssInterop(UIFab.Icon, { className: 'style' });
@@ -142,7 +140,7 @@ const FabLabel = React.forwardRef(
}: any,
ref: any
) => {
- const { size: parentSize } = useStyleContext();
+ const { size: parentSize } = useStyleContext(SCOPE);
return (
{
- const { size: parentSize } = useStyleContext();
+ const { size: parentSize } = useStyleContext(SCOPE);
if (AsComp) {
return (
{
- const { size: parentSize } = useStyleContext();
+ const { size: parentSize } = useStyleContext(SCOPE);
return (
{
};
export const UIFormControl = createFormControl({
- Root: withStyleContext(View),
+ Root: withStyleContext(View, SCOPE),
Error: View,
ErrorText: Text,
ErrorIcon: View,
@@ -282,7 +283,7 @@ const FormControlErrorText = ({
size,
...props
}: { className?: string } & IFormControlErrorTextProps) => {
- const { size: parentSize } = useStyleContext();
+ const { size: parentSize } = useStyleContext(SCOPE);
return (
{
- const { size: parentSize } = useStyleContext();
+ const { size: parentSize } = useStyleContext(SCOPE);
if (AsComp) {
return (
{
- const { size: parentSize } = useStyleContext();
+ const { size: parentSize } = useStyleContext(SCOPE);
return (
{
- const { size: parentSize } = useStyleContext();
+ const { size: parentSize } = useStyleContext(SCOPE);
return (
- {props.children}
+
+ {props.children}
+
);
}
diff --git a/example/storybook-nativewind/src/core-components/nativewind/gluestack-ui-provider/index.web.tsx b/example/storybook-nativewind/src/core-components/nativewind/gluestack-ui-provider/index.web.tsx
index df62bbd792..71d6147949 100644
--- a/example/storybook-nativewind/src/core-components/nativewind/gluestack-ui-provider/index.web.tsx
+++ b/example/storybook-nativewind/src/core-components/nativewind/gluestack-ui-provider/index.web.tsx
@@ -1,12 +1,15 @@
'use client';
+import React from 'react';
import { config } from './config';
+import { OverlayProvider } from '@gluestack-ui/overlay';
+import { ToastProvider } from '@gluestack-ui/toast';
export function GluestackUIProvider({
mode = 'light',
...props
}: {
- mode: 'light' | 'dark';
- children: any;
+ mode?: 'light' | 'dark';
+ children?: any;
}) {
if (config[mode] && typeof document !== 'undefined') {
const element = document.documentElement;
@@ -21,5 +24,9 @@ export function GluestackUIProvider({
if (head) head.appendChild(style);
}
}
- return props.children;
+ return (
+
+ {props.children}
+
+ );
}
diff --git a/example/storybook-nativewind/src/core-components/nativewind/heading/index.tsx b/example/storybook-nativewind/src/core-components/nativewind/heading/index.tsx
index 438d214ed4..027beba6ce 100644
--- a/example/storybook-nativewind/src/core-components/nativewind/heading/index.tsx
+++ b/example/storybook-nativewind/src/core-components/nativewind/heading/index.tsx
@@ -1,46 +1,7 @@
-'use client';
import React, { useCallback } from 'react';
import { H1, H2, H3, H4, H5, H6 } from '@expo/html-elements';
-import { tva } from '@gluestack-ui/nativewind-utils/tva';
import { cssInterop } from '@gluestack-ui/nativewind-utils/cssInterop';
-
-const headingStyle = tva({
- base: 'text-typography-900 font-bold font-heading tracking-sm my-0',
- variants: {
- isTruncated: {
- true: 'web:truncate',
- },
- bold: {
- true: 'font-bold',
- },
- underline: {
- true: 'underline',
- },
- strikeThrough: {
- true: 'line-through',
- },
- sub: {
- true: 'text-xs',
- },
- italic: {
- true: 'italic',
- },
- highlight: {
- true: 'bg-yellow-500',
- },
- size: {
- '5xl': 'text-6xl',
- '4xl': 'text-5xl',
- '3xl': 'text-4xl',
- '2xl': 'text-3xl',
- 'xl': 'text-2xl',
- 'lg': 'text-xl',
- 'md': 'text-lg',
- 'sm': 'text-base',
- 'xs': 'text-sm',
- },
- },
-});
+import { headingStyle } from './styles';
cssInterop(H4, { className: 'style' });
diff --git a/example/storybook-nativewind/src/core-components/nativewind/heading/index.web.tsx b/example/storybook-nativewind/src/core-components/nativewind/heading/index.web.tsx
new file mode 100644
index 0000000000..48ad1a818b
--- /dev/null
+++ b/example/storybook-nativewind/src/core-components/nativewind/heading/index.web.tsx
@@ -0,0 +1,78 @@
+import React, { memo } from 'react';
+import { headingStyle } from './styles';
+
+const Heading = memo(
+ ({ className, size = 'lg', as: AsComp, ...props }: any) => {
+ const MappedHeading = ({ size }: any) => {
+ switch (size) {
+ case '5xl':
+ case '4xl':
+ case '3xl':
+ return (
+
+ );
+ case '2xl':
+ return (
+
+ );
+ case 'xl':
+ return (
+
+ );
+ case 'lg':
+ return (
+
+ );
+ case 'md':
+ return (
+
+ );
+ case 'sm':
+ case 'xs':
+ return (
+
+ );
+ default:
+ return (
+
+ );
+ }
+ };
+
+ if (AsComp) {
+ return (
+
+ );
+ }
+
+ return ;
+ }
+);
+
+Heading.displayName = 'Heading';
+
+export { Heading };
diff --git a/example/storybook-nativewind/src/core-components/nativewind/heading/styles.tsx b/example/storybook-nativewind/src/core-components/nativewind/heading/styles.tsx
new file mode 100644
index 0000000000..f387a91721
--- /dev/null
+++ b/example/storybook-nativewind/src/core-components/nativewind/heading/styles.tsx
@@ -0,0 +1,38 @@
+import { tva } from '@gluestack-ui/nativewind-utils/tva';
+export const headingStyle = tva({
+ base: 'text-typography-900 font-bold font-heading tracking-sm my-0 web:font-sans web:tracking-sm web:bg-transparent web:border-0 web:box-border web:display-inline web:list-none web:margin-0 web:padding-0 web:position-relative web:text-start web:no-underline web:whitespace-pre-wrap web:word-wrap-break-word',
+ variants: {
+ isTruncated: {
+ true: 'web:truncate',
+ },
+ bold: {
+ true: 'font-bold',
+ },
+ underline: {
+ true: 'underline',
+ },
+ strikeThrough: {
+ true: 'line-through',
+ },
+ sub: {
+ true: 'text-xs',
+ },
+ italic: {
+ true: 'italic',
+ },
+ highlight: {
+ true: 'bg-yellow-500',
+ },
+ size: {
+ '5xl': 'text-6xl',
+ '4xl': 'text-5xl',
+ '3xl': 'text-4xl',
+ '2xl': 'text-3xl',
+ 'xl': 'text-2xl',
+ 'lg': 'text-xl',
+ 'md': 'text-lg',
+ 'sm': 'text-base',
+ 'xs': 'text-sm',
+ },
+ },
+});
diff --git a/example/storybook-nativewind/src/core-components/nativewind/hstack/index.tsx b/example/storybook-nativewind/src/core-components/nativewind/hstack/index.tsx
index fd9558d8b9..b3123041ef 100644
--- a/example/storybook-nativewind/src/core-components/nativewind/hstack/index.tsx
+++ b/example/storybook-nativewind/src/core-components/nativewind/hstack/index.tsx
@@ -1,35 +1,22 @@
-'use client';
import React from 'react';
-import { tva } from '@gluestack-ui/nativewind-utils/tva';
+import type { VariantProps } from '@gluestack-ui/nativewind-utils';
import { View } from 'react-native';
+import { hstackStyle } from './styles';
-const hstackStyle = tva({
- base: 'flex-row',
- variants: {
- space: {
- 'xs': 'gap-1',
- 'sm': 'gap-2',
- 'md': 'gap-3',
- 'lg': 'gap-4',
- 'xl': 'gap-5',
- '2xl': 'gap-6',
- '3xl': 'gap-7',
- '4xl': 'gap-8',
- },
- reversed: {
- true: 'flex-row-reverse',
- },
- },
-});
+type IHStackProps = React.ComponentProps &
+ VariantProps;
-const HStack = ({ className, space, reversed, ...props }: any) => {
- return (
-
- );
-};
+const HStack = React.forwardRef(
+ ({ className, space, reversed, ...props }: IHStackProps, ref?: any) => {
+ return (
+
+ );
+ }
+);
HStack.displayName = 'HStack';
diff --git a/example/storybook-nativewind/src/core-components/nativewind/hstack/index.web.tsx b/example/storybook-nativewind/src/core-components/nativewind/hstack/index.web.tsx
new file mode 100644
index 0000000000..df827dcf5b
--- /dev/null
+++ b/example/storybook-nativewind/src/core-components/nativewind/hstack/index.web.tsx
@@ -0,0 +1,22 @@
+import React from 'react';
+import type { VariantProps } from '@gluestack-ui/nativewind-utils';
+import { hstackStyle } from './styles';
+
+type IHStackProps = React.ComponentProps<'div'> &
+ VariantProps;
+
+const HStack = React.forwardRef(
+ ({ className, space, reversed, ...props }: IHStackProps, ref?: any) => {
+ return (
+
+ );
+ }
+);
+
+HStack.displayName = 'HStack';
+
+export { HStack };
diff --git a/example/storybook-nativewind/src/core-components/nativewind/hstack/styles.tsx b/example/storybook-nativewind/src/core-components/nativewind/hstack/styles.tsx
new file mode 100644
index 0000000000..da89d00240
--- /dev/null
+++ b/example/storybook-nativewind/src/core-components/nativewind/hstack/styles.tsx
@@ -0,0 +1,19 @@
+import { tva } from '@gluestack-ui/nativewind-utils/tva';
+export const hstackStyle = tva({
+ base: 'web:flex flex-row',
+ variants: {
+ space: {
+ 'xs': 'gap-1',
+ 'sm': 'gap-2',
+ 'md': 'gap-3',
+ 'lg': 'gap-4',
+ 'xl': 'gap-5',
+ '2xl': 'gap-6',
+ '3xl': 'gap-7',
+ '4xl': 'gap-8',
+ },
+ reversed: {
+ true: 'flex-row-reverse',
+ },
+ },
+});
diff --git a/example/storybook-nativewind/src/core-components/nativewind/icon/index.tsx b/example/storybook-nativewind/src/core-components/nativewind/icon/index.tsx
index e9e734d529..2e92fa3bd0 100644
--- a/example/storybook-nativewind/src/core-components/nativewind/icon/index.tsx
+++ b/example/storybook-nativewind/src/core-components/nativewind/icon/index.tsx
@@ -4,13 +4,14 @@ import { createIcon } from '@gluestack-ui/icon';
import { Path, Svg } from 'react-native-svg';
import { tva } from '@gluestack-ui/nativewind-utils/tva';
import { cssInterop } from '@gluestack-ui/nativewind-utils/cssInterop';
+import { View } from 'react-native';
export const UIIcon = createIcon({
Root: Svg,
});
const iconStyle = tva({
- base: 'text-typography-900',
+ // base: 'text-typography-900',
variants: {
size: {
'2xs': 'h-3 w-3',
@@ -30,12 +31,20 @@ export const Icon = React.forwardRef(
) => {
if (AsComp) {
return (
-
+
+
+
);
}
return (
diff --git a/example/storybook-nativewind/src/core-components/nativewind/input/index.tsx b/example/storybook-nativewind/src/core-components/nativewind/input/index.tsx
index de9b02c382..6ce64aae15 100644
--- a/example/storybook-nativewind/src/core-components/nativewind/input/index.tsx
+++ b/example/storybook-nativewind/src/core-components/nativewind/input/index.tsx
@@ -11,20 +11,21 @@ import { withStyleContextAndStates } from '@gluestack-ui/nativewind-utils/withSt
import { cssInterop } from '@gluestack-ui/nativewind-utils/cssInterop';
import { withStates } from '@gluestack-ui/nativewind-utils/withStates';
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
+const SCOPE = 'INPUT';
const UIInput = createInput({
// @ts-ignore
Root:
Platform.OS === 'web'
- ? withStyleContext(View)
- : withStyleContextAndStates(View),
+ ? withStyleContext(View, SCOPE)
+ : withStyleContextAndStates(View, SCOPE),
Icon: View,
Slot: Pressable,
Input: Platform.OS === 'web' ? TextInput : withStates(TextInput),
});
const inputStyle = tva({
- base: 'border-background-300 flex-row overflow-hidden content-center data-[hover=true]:border-outline-400 data-[focus=true]:border-primary-700 data-[focus=true]:hover:border-primary-700 data-[disabled=true]:opacity-40 data-[disabled=true]:hover:border-background-300',
+ base: 'border-background-300 flex-row overflow-hidden content-center data-[hover=true]:border-outline-400 data-[focus=true]:border-primary-700 data-[focus=true]:hover:border-primary-700 data-[disabled=true]:opacity-40 data-[disabled=true]:hover:border-background-300 items-center',
variants: {
size: {
@@ -36,7 +37,7 @@ const inputStyle = tva({
variant: {
underlined:
- 'rounded-none border-b data-[invalid=true]:border-b-2 data-[invalid=true]:border-error-700 data-[invalid=true]:hover:border-error-700 data-[invalid=true]:data-[focus=true]:border-error-700 data-[invalid=true]:data-[focus=true]:hover:border-error-700 data-[invalid=true]:data-[disabled=true]:hover:border-error-700 data-[focus=true]:web:ring-1 data-[focus=true]:web:ring-inset data-[focus=true]:web:ring-primary-700 data-[invalid=true]:web:ring-1 data-[invalid=true]:web:ring-inset data-[invalid=true]:web:ring-error-700 data-[invalid=true]:data-[focus=true]:hover:web:ring-1 data-[invalid=true]:data-[focus=true]:hover:web:ring-inset data-[invalid=true]:data-[focus=true]:hover:web:ring-error-700 data-[invalid=true]:data-[disabled=true]:hover:web:ring-1 data-[invalid=true]:data-[disabled=true]:hover:web:ring-inset data-[invalid=true]:data-[disabled=true]:hover:web:ring-error-700',
+ 'rounded-none border-b data-[invalid=true]:border-b-2 data-[invalid=true]:border-error-700 data-[invalid=true]:hover:border-error-700 data-[invalid=true]:data-[focus=true]:border-error-700 data-[invalid=true]:data-[focus=true]:hover:border-error-700 data-[invalid=true]:data-[disabled=true]:hover:border-error-700',
outline:
'rounded border data-[invalid=true]:border-error-700 data-[invalid=true]:hover:border-error-700 data-[invalid=true]:data-[focus=true]:border-error-700 data-[invalid=true]:data-[focus=true]:hover:border-error-700 data-[invalid=true]:data-[disabled=true]:hover:border-error-700 data-[focus=true]:web:ring-1 data-[focus=true]:web:ring-inset data-[focus=true]:web:ring-primary-700 data-[invalid=true]:web:ring-1 data-[invalid=true]:web:ring-inset data-[invalid=true]:web:ring-error-700 data-[invalid=true]:data-[focus=true]:hover:web:ring-1 data-[invalid=true]:data-[focus=true]:hover:web:ring-inset data-[invalid=true]:data-[focus=true]:hover:web:ring-error-700 data-[invalid=true]:data-[disabled=true]:hover:web:ring-1 data-[invalid=true]:data-[disabled=true]:hover:web:ring-inset data-[invalid=true]:data-[disabled=true]:hover:web:ring-error-700',
@@ -48,7 +49,7 @@ const inputStyle = tva({
});
const inputIconStyle = tva({
- base: 'text-typography-400',
+ // base: 'text-typography-400',
parentVariants: {
size: {
'2xs': 'h-3 w-3',
@@ -76,17 +77,17 @@ const inputFieldStyle = tva({
},
size: {
- '2xs': 'text-2xs',
- 'xs': 'text-xs',
- 'sm': 'text-sm',
- 'md': 'text-base',
- 'lg': 'text-lg',
- 'xl': 'text-xl',
- '2xl': 'text-2xl',
- '3xl': 'text-3xl',
- '4xl': 'text-4xl',
- '5xl': 'text-5xl',
- '6xl': 'text-6xl',
+ '2xs': 'text-2xs leading-[0px]',
+ 'xs': 'text-xs leading-[0px]',
+ 'sm': 'text-sm leading-[0px]',
+ 'md': 'text-base leading-none',
+ 'lg': 'text-lg leading-[0px]',
+ 'xl': 'text-xl leading-[0px]',
+ '2xl': 'text-2xl leading-[0px]',
+ '3xl': 'text-3xl leading-[0px]',
+ '4xl': 'text-4xl leading-[0px]',
+ '5xl': 'text-5xl leading-[0px]',
+ '6xl': 'text-6xl leading-[0px]',
},
},
});
@@ -98,7 +99,6 @@ cssInterop(UIInput.Input, { className: 'style' });
type IInputProps = React.ComponentProps &
VariantProps;
-//@ts-ignore
const Input = React.forwardRef(
(
{
@@ -107,7 +107,7 @@ const Input = React.forwardRef(
size = 'md',
...props
}: { className?: string } & IInputProps,
- ref
+ ref?: any
) => {
return (
& { as: any };
-
const InputIcon = React.forwardRef(
(
{
@@ -129,30 +128,37 @@ const InputIcon = React.forwardRef(
fill = 'none',
as: AsComp,
...props
- }: { className?: any } & IInputIconProps,
- ref
+ }: { className?: any; fill?: string; color?: string } & IInputIconProps,
+ ref?: any
) => {
- const { size: parentSize } = useStyleContext();
+ const { size: parentSize } = useStyleContext(SCOPE);
+ const { color = '#8C8C8C' } = props;
if (AsComp) {
return (
-
+ >
+
+
);
}
return (
&
VariantProps;
-
const InputSlot = React.forwardRef(
- ({ className, ...props }: { className?: string } & IInputSlotProps, ref) => {
+ (
+ { className, ...props }: { className?: string } & IInputSlotProps,
+ ref?: any
+ ) => {
return (
&
VariantProps;
-
const InputField = React.forwardRef(
- ({ className, ...props }: { className?: string } & IInputFieldProps, ref) => {
- const { variant: parentVariant, size: parentSize } = useStyleContext();
+ (
+ { className, ...props }: { className?: string } & IInputFieldProps,
+ ref?: any
+ ) => {
+ const { variant: parentVariant, size: parentSize } = useStyleContext(SCOPE);
return (
&
VariantProps;
+
const LinkText = React.forwardRef(
(
{ className, ...props }: { className?: string } & ILinkTextProps,
diff --git a/example/storybook-nativewind/src/core-components/nativewind/modal/index.tsx b/example/storybook-nativewind/src/core-components/nativewind/modal/index.tsx
index 4a1f2c940f..d5f8a63c91 100644
--- a/example/storybook-nativewind/src/core-components/nativewind/modal/index.tsx
+++ b/example/storybook-nativewind/src/core-components/nativewind/modal/index.tsx
@@ -18,12 +18,13 @@ import type { VariantProps } from '@gluestack-ui/nativewind-utils';
const AnimatedPressable = createMotionAnimatedComponent(Pressable);
+const SCOPE = 'MODAL';
+
const UIModal = createModal({
- // @ts-ignore
Root:
Platform.OS === 'web'
- ? withStyleContext(View)
- : withStyleContextAndStates(View),
+ ? withStyleContext(View, SCOPE)
+ : withStyleContextAndStates(View, SCOPE),
Backdrop: AnimatedPressable,
Content: Motion.View,
Body: ScrollView,
@@ -163,7 +164,7 @@ const ModalContent = React.forwardRef(
{ className, size, ...props }: { className?: string } & IModalContentProps,
ref?: any
) => {
- const { size: parentSize } = useStyleContext();
+ const { size: parentSize } = useStyleContext(SCOPE);
return (
{
- const { size: parentSize } = useStyleContext();
+ const { size: parentSize } = useStyleContext(SCOPE);
return (
{
- const { size: parentSize } = useStyleContext();
+ const { size: parentSize } = useStyleContext(SCOPE);
return (
{
- return (
-
- );
-};
+type IRadioProps = Omit, 'context'> &
+ VariantProps;
+const Radio = React.forwardRef(
+ (
+ { className, size = 'md', ...props }: { className?: string } & IRadioProps,
+ ref?: any
+ ) => {
+ return (
+
+ );
+ }
+);
-const RadioGroup = ({ className, ...props }: any) => {
- return (
-
- );
-};
+type IRadioGroupProps = React.ComponentProps &
+ VariantProps;
+const RadioGroup = React.forwardRef(
+ (
+ { className, ...props }: { className?: string } & IRadioGroupProps,
+ ref?: any
+ ) => {
+ return (
+
+ );
+ }
+);
-const RadioIndicator = ({ className, ...props }: any) => {
- const { size } = useStyleContext();
- return (
-
- );
-};
+type IRadioIndicatorProps = React.ComponentProps &
+ VariantProps;
+const RadioIndicator = React.forwardRef(
+ (
+ { className, ...props }: { className?: string } & IRadioIndicatorProps,
+ ref?: any
+ ) => {
+ const { size } = useStyleContext(SCOPE);
+ return (
+
+ );
+ }
+);
-const RadioLabel = ({ className, ...props }: any) => {
- const { size } = useStyleContext();
- return (
-
- );
-};
+type IRadioLabelProps = React.ComponentProps &
+ VariantProps;
+const RadioLabel = React.forwardRef(
+ (
+ { className, ...props }: { className?: string } & IRadioLabelProps,
+ ref?: any
+ ) => {
+ const { size } = useStyleContext(SCOPE);
+ return (
+
+ );
+ }
+);
+
+type IRadioIconProps = React.ComponentProps &
+ VariantProps;
+const RadioIcon = ({
+ className,
+ as: AsComp,
+ size,
+ fill = 'none',
+ ...props
+}: IRadioIconProps & {
+ className?: string;
+ fill?: string;
+ color?: string;
+ as?: any;
+}) => {
+ const { size: parentSize } = useStyleContext(SCOPE);
+ const { color = 'gray' } = props;
-const RadioIcon = ({ className, as: AsComp, size, ...props }: any) => {
- const { size: parentSize } = useStyleContext();
if (AsComp) {
return (
-
+
);
@@ -128,13 +206,16 @@ const RadioIcon = ({ className, as: AsComp, size, ...props }: any) => {
return (
);
};
diff --git a/example/storybook-nativewind/src/core-components/nativewind/select/index.tsx b/example/storybook-nativewind/src/core-components/nativewind/select/index.tsx
index c24c253a80..0c81e12e42 100644
--- a/example/storybook-nativewind/src/core-components/nativewind/select/index.tsx
+++ b/example/storybook-nativewind/src/core-components/nativewind/select/index.tsx
@@ -1,681 +1,300 @@
-import { H1, H2, H3, H4, H5, H6 } from '@expo/html-elements';
+import React from 'react';
+import { tva } from '@gluestack-ui/nativewind-utils/tva';
+import { withStates } from '@gluestack-ui/nativewind-utils/withStates';
+import { withStyleContextAndStates } from '@gluestack-ui/nativewind-utils/withStyleContextAndStates';
import {
- AnimatePresence,
- AnimatedPressable,
- AnimatedView,
-} from '@gluestack-style/animation-resolver';
-import { styled, AsForwarder } from '@gluestack-style/react';
-import { createActionsheet } from '@gluestack-ui/actionsheet';
+ withStyleContext,
+ useStyleContext,
+} from '@gluestack-ui/nativewind-utils/withStyleContext';
+import type { VariantProps } from '@gluestack-ui/nativewind-utils';
import { createSelect } from '@gluestack-ui/select';
-import { TextInput } from 'react-native';
+import { cssInterop } from '@gluestack-ui/nativewind-utils/cssInterop';
import {
- Pressable,
- View,
- Text,
- ScrollView,
- VirtualizedList,
- FlatList,
- SectionList,
-} from 'react-native';
-
-const StyledRoot = styled(View, {
- width: '$full',
- height: '$full',
- _web: {
- pointerEvents: 'none',
+ Actionsheet,
+ ActionsheetContent,
+ ActionsheetItem,
+ ActionsheetItemText,
+ ActionsheetDragIndicator,
+ ActionsheetDragIndicatorWrapper,
+ ActionsheetBackdrop,
+ ActionsheetScrollView,
+ ActionsheetVirtualizedList,
+ ActionsheetFlatList,
+ ActionsheetSectionList,
+ ActionsheetSectionHeaderText,
+} from './select-actionsheet';
+
+import { Pressable, View, TextInput, Platform } from 'react-native';
+
+/** Select Components */
+
+const selectIconStyle = tva({
+ base: 'text-background-500',
+ parentVariants: {
+ size: {
+ '2xs': 'h-3 w-3',
+ 'xs': 'h-3.5 w-3.5',
+ 'sm': 'h-4 w-4',
+ 'md': 'h-[18px] w-[18px]',
+ 'lg': 'h-5 w-5',
+ 'xl': 'h-6 w-6',
+ },
},
});
-const StyledContent = styled(
- AnimatedView,
- {
- alignItems: 'center',
- borderTopLeftRadius: '$3xl',
- borderTopRightRadius: '$3xl',
- h: '$full',
- p: '$2',
- bg: '$background0',
-
- _sectionHeaderBackground: {
- bg: '$background0',
- },
-
- defaultProps: {
- hardShadow: '5',
+const selectStyle = tva({
+ base: '',
+ variants: {
+ size: {
+ xl: '',
+ lg: '',
+ md: '',
+ sm: '',
},
-
- _web: {
- userSelect: 'none',
- pointerEvents: 'auto',
+ variant: {
+ underlined: '',
+ outline: '',
+ rounded: '',
},
},
- {
- descendantStyle: ['_sectionHeaderBackground'],
- }
-);
-
-const StyledItem = styled(
- Pressable,
- {
- 'p': '$3',
- 'flexDirection': 'row',
- 'alignItems': 'center',
- 'rounded': '$sm',
- 'w': '$full',
-
- ':disabled': {
- opacity: 0.4,
- _web: {
- // @ts-ignore
- pointerEvents: 'all !important',
- cursor: 'not-allowed',
- },
- },
-
- ':hover': {
- bg: '$background50',
- },
-
- ':active': {
- bg: '$background100',
- },
+});
- ':focus': {
- bg: '$background100',
+const selectTriggerStyle = tva({
+ base: 'border border-background-300 rounded flex-row items-center overflow-hidden data-[hover=true]:border-outline-400 data-[focus=true]:border-primary-700 data-[disabled=true]:opacity-40 data-[disabled=true]:data-[hover=true]:border-background-300',
+ parentVariants: {
+ size: {
+ xl: 'h-12',
+ lg: 'h-11',
+ md: 'h-10',
+ sm: 'h-9',
},
-
- '_web': {
- ':focusVisible': {
- bg: '$background100',
- },
+ variant: {
+ underlined:
+ 'border-0 border-b rounded-none data-[hover=true]:border-primary-700 data-[focus=true]:border-primary-700 data-[focus=true]:web:shadow-[inset_0_-1px_0_0] data-[focus=true]:web:shadow-primary-700 data-[invalid=true]:border-error-700 data-[invalid=true]:web:shadow-error-700',
+ outline:
+ 'data-[focus=true]:border-primary-700 data-[focus=true]:web:shadow-[inset_0_0_0_1px] data-[focus=true]:data-[hover=true]:web:shadow-primary-600 data-[invalid=true]:web:shadow-[inset_0_0_0_1px] data-[invalid=true]:border-error-700 data-[invalid=true]:web:shadow-error-700 data-[invalid=true]:data-[hover=true]:border-error-700',
+ rounded:
+ 'rounded-full data-[focus=true]:border-primary-700 data-[focus=true]:web:shadow-[inset_0_0_0_1px] data-[focus=true]:web:shadow-primary-700 data-[invalid=true]:border-error-700 data-[invalid=true]:web:shadow-error-700',
},
},
- {
- descendantStyle: ['_text', '_icon'],
- }
-);
-
-const StyledItemText = styled(
- Text,
- {
- mx: '$2',
- props: {
- size: 'md',
- },
- color: '$text800',
- },
- {
- ancestorStyle: ['_text'],
- }
-);
-
-const StyledDragIndicator = styled(View, {
- w: '$16',
- h: '$1',
- bg: '$background400',
- rounded: '$full',
-});
-
-const StyledDragIndicatorWrapper = styled(View, {
- py: '$1',
- w: '$full',
- alignItems: 'center',
-});
-
-const StyledBackdrop = styled(AnimatedPressable, {
- ':initial': {
- opacity: 0,
- },
-
- ':animate': {
- opacity: 0.5,
- },
-
- ':exit': {
- opacity: 0,
- },
-
- 'position': 'absolute',
- 'left': 0,
- 'top': 0,
- 'right': 0,
- 'bottom': 0,
- 'bg': '$background950',
-
- '_web': {
- cursor: 'default',
- pointerEvents: 'auto',
- },
-});
-
-const StyledScrollView = styled(ScrollView, {
- w: '$full',
- h: 'auto',
-});
-
-const StyledVirtualizedList = styled(VirtualizedList, {
- w: '$full',
- h: 'auto',
-});
-
-const StyledFlatList = styled(FlatList, {
- w: '$full',
- h: 'auto',
});
-const StyledSectionList = styled(SectionList, {
- w: '$full',
- h: 'auto',
-});
-
-const StyledSectionHeaderText = styled(H4, {
- letterSpacing: '$sm',
- fontWeight: '$bold',
- fontFamily: '$heading',
-
- // Overrides expo-html default styling
- marginVertical: 0,
-
- variants: {
- isTruncated: {
- true: {
- props: {
- // @ts-ignore
- numberOfLines: 1,
- ellipsizeMode: 'tail',
- },
- },
- },
- bold: {
- true: {
- fontWeight: '$bold',
- },
- },
- underline: {
- true: {
- textDecorationLine: 'underline',
- },
- },
- strikeThrough: {
- true: {
- textDecorationLine: 'line-through',
- },
- },
+const selectInputStyle = tva({
+ base: 'py-auto px-3 placeholder:text-typography-500 flex-1 web:w-full h-full text-typography-900 pointer-events-none web:outline-none',
+ parentVariants: {
size: {
- '5xl': {
- //@ts-ignore
- props: { as: H1 },
- fontSize: '$6xl',
- },
- '4xl': {
- //@ts-ignore
- props: { as: H1 },
- fontSize: '$5xl',
- },
-
- '3xl': {
- //@ts-ignore
- props: { as: H1 },
- fontSize: '$4xl',
- },
-
- '2xl': {
- //@ts-ignore
- props: { as: H2 },
- fontSize: '$3xl',
- },
-
- 'xl': {
- //@ts-ignore
- props: { as: H3 },
- fontSize: '$2xl',
- },
-
- 'lg': {
- //@ts-ignore
- props: { as: H4 },
- fontSize: '$xl',
- },
-
- 'md': {
- //@ts-ignore
- props: { as: H5 },
- fontSize: '$lg',
- },
-
- 'sm': {
- //@ts-ignore
- props: { as: H6 },
- fontSize: '$md',
- },
-
- 'xs': {
- //@ts-ignore
- props: { as: H6 },
- fontSize: '$sm',
- },
+ xl: 'text-xl leading-[0px]',
+ lg: 'text-lg leading-[0px]',
+ md: 'text-base leading-[0px]',
+ sm: 'text-sm leading-[0px]',
},
- sub: {
- true: {
- fontSize: '$xs',
- },
- },
- italic: {
- true: {
- fontStyle: 'italic',
- },
- },
- highlight: {
- true: {
- bg: '$yellow500',
- },
+ variant: {
+ underlined: 'px-0',
+ outline: '',
+ rounded: 'px-4',
},
},
- color: '$text500',
- props: { size: 'xs' },
- textTransform: 'uppercase',
- p: '$3',
});
-const StyledIcon = styled(
- AsForwarder,
+const UISelect = createSelect(
{
- variants: {
- size: {
- '2xs': {
- h: '$3',
- w: '$3',
- props: {
- // @ts-ignore
- size: 12,
- },
- },
- 'xs': {
- h: '$3.5',
- w: '$3.5',
- props: {
- //@ts-ignore
- size: 14,
- },
- },
- 'sm': {
- h: '$4',
- w: '$4',
- props: {
- //@ts-ignore
- size: 16,
- },
- },
- 'md': {
- h: '$4.5',
- w: '$4.5',
- props: {
- //@ts-ignore
- size: 18,
- },
- },
- 'lg': {
- h: '$5',
- w: '$5',
- props: {
- //@ts-ignore
- size: 20,
- },
- },
- 'xl': {
- h: '$6',
- w: '$6',
- props: {
- //@ts-ignore
- size: 24,
- },
- },
- },
- },
- props: {
- size: 'sm',
- fill: 'none',
- },
-
- color: '$background500',
+ Root:
+ Platform.OS === 'web'
+ ? withStyleContext(View)
+ : withStyleContextAndStates(View),
+ // @ts-ignore
+ Trigger: Platform.OS === 'web' ? Pressable : withStates(Pressable),
+ Input: TextInput,
+ Icon: View,
},
{
- componentName: 'BaseIcon',
- resolveProps: ['stroke', 'fill'],
- } as const,
- {
- propertyTokenMap: {
- stroke: 'colors',
- fill: 'colors',
- },
+ Portal: Actionsheet,
+ Backdrop: ActionsheetBackdrop,
+ Content: ActionsheetContent,
+ DragIndicator: ActionsheetDragIndicator,
+ DragIndicatorWrapper: ActionsheetDragIndicatorWrapper,
+ Item: ActionsheetItem,
+ ItemText: ActionsheetItemText,
+ ScrollView: ActionsheetScrollView,
+ VirtualizedList: ActionsheetVirtualizedList,
+ FlatList: ActionsheetFlatList,
+ SectionList: ActionsheetSectionList,
+ SectionHeaderText: ActionsheetSectionHeaderText,
}
);
-const StyledSelectRoot = styled(View, {});
-
-const StyledSelectTrigger = styled(
- Pressable,
- {
- 'borderWidth': 1,
- 'borderColor': '$background300',
- 'borderRadius': '$sm',
- 'flexDirection': 'row',
- 'overflow': 'hidden',
- 'alignItems': 'center',
-
- ':hover': {
- borderColor: '$border400',
- },
-
- ':focus': {
- borderColor: '$primary700',
- },
-
- ':disabled': {
- 'opacity': 0.4,
- ':hover': {
- borderColor: '$background300',
- },
- },
-
- '_input': {
- py: 'auto',
- px: '$3',
- },
-
- '_icon': {
- color: '$background500',
- },
-
- 'variants': {
- size: {
- xl: {
- h: '$12',
- _input: {
- fontSize: '$xl',
- },
- _icon: {
- h: '$6',
- w: '$6',
- },
- },
- lg: {
- h: '$11',
- _input: {
- fontSize: '$lg',
- },
- _icon: {
- h: '$5',
- w: '$5',
- },
- },
- md: {
- h: '$10',
- _input: {
- fontSize: '$md',
- },
- _icon: {
- h: '$4',
- w: '$4',
- },
- },
- sm: {
- h: '$9',
- _input: {
- fontSize: '$sm',
- },
- _icon: {
- h: '$3.5',
- w: '$3.5',
- },
- },
- },
- variant: {
- underlined: {
- '_input': {
- _web: {
- outlineWidth: 0,
- outline: 'none',
- },
- px: '$0',
- },
-
- 'borderWidth': 0,
- 'borderRadius': 0,
- 'borderBottomWidth': '$1',
-
- ':focus': {
- 'borderColor': '$primary700',
- '_web': {
- boxShadow: 'inset 0 -1px 0 0 $primary700',
- },
- ':hover': {
- borderColor: '$primary700',
- _web: {
- boxShadow: 'inset 0 -1px 0 0 $primary600',
- },
- },
- },
-
- ':invalid': {
- 'borderBottomWidth': 2,
- 'borderBottomColor': '$error700',
- '_web': {
- boxShadow: 'inset 0 -1px 0 0 $error700',
- },
- ':hover': {
- borderBottomColor: '$error700',
- },
- ':focus': {
- 'borderBottomColor': '$error700',
- ':hover': {
- borderBottomColor: '$error700',
- _web: {
- boxShadow: 'inset 0 -1px 0 0 $error700',
- },
- },
- },
- ':disabled': {
- ':hover': {
- borderBottomColor: '$error700',
- _web: {
- boxShadow: 'inset 0 -1px 0 0 $error700',
- },
- },
- },
- },
- },
- outline: {
- '_input': {
- _web: {
- outlineWidth: 0,
- outline: 'none',
- },
- },
-
- ':focus': {
- 'borderColor': '$primary700',
- '_web': {
- boxShadow: 'inset 0 0 0 1px $primary700',
- },
- ':hover': {
- borderColor: '$primary700',
- _web: {
- boxShadow: 'inset 0 0 0 1px $primary600',
- },
- },
- },
-
- ':invalid': {
- 'borderColor': '$error700',
- '_web': {
- boxShadow: 'inset 0 0 0 1px $error700',
- },
- ':hover': {
- borderColor: '$error700',
- },
- ':focus': {
- 'borderColor': '$error700',
- ':hover': {
- borderColor: '$error700',
- _web: {
- boxShadow: 'inset 0 0 0 1px $error700',
- },
- },
- },
- ':disabled': {
- ':hover': {
- borderColor: '$error700',
- _web: {
- boxShadow: 'inset 0 0 0 1px $error700',
- },
- },
- },
- },
- },
- rounded: {
- 'borderRadius': 999,
-
- '_input': {
- px: '$4',
- _web: {
- outlineWidth: 0,
- outline: 'none',
- },
- },
-
- ':focus': {
- 'borderColor': '$primary700',
- '_web': {
- boxShadow: 'inset 0 0 0 1px $primary700',
- },
- ':hover': {
- borderColor: '$primary700',
- _web: {
- boxShadow: 'inset 0 0 0 1px $primary600',
- },
- },
- },
+cssInterop(UISelect, { className: 'style' });
+cssInterop(UISelect.Input, { className: 'style' });
+cssInterop(UISelect.Trigger, { className: 'style' });
+cssInterop(UISelect.Icon, { className: 'style' });
+
+type ISelectProps = VariantProps &
+ React.ComponentProps;
+
+const Select = React.forwardRef(
+ (
+ {
+ className,
+ size = 'md',
+ variant = 'outline',
+ ...props
+ }: ISelectProps & { className?: string },
+ ref?: any
+ ) => {
+ return (
+
+ );
+ }
+);
- ':invalid': {
- 'borderColor': '$error700',
- '_web': {
- boxShadow: 'inset 0 0 0 1px $error700',
- },
- ':hover': {
- borderColor: '$error700',
- },
- ':focus': {
- 'borderColor': '$error700',
- ':hover': {
- borderColor: '$error700',
- _web: {
- boxShadow: 'inset 0 0 0 1px $error700',
- },
- },
- },
- ':disabled': {
- ':hover': {
- borderColor: '$error700',
- _web: {
- boxShadow: 'inset 0 0 0 1px $error700',
- },
- },
- },
+type ISelectTriggerProps = VariantProps &
+ React.ComponentProps;
+
+const SelectTrigger = React.forwardRef(
+ (
+ { className, ...props }: ISelectTriggerProps & { className?: string },
+ ref?: any
+ ) => {
+ const { size: parentSize, variant: parentVariant } = useStyleContext();
+ return (
+
+ );
}
);
-const StyledSelectInput = styled(
- TextInput,
- {
- _web: {
- w: '$full',
- },
-
- pointerEvents: 'none',
- flex: 1,
- h: '$full',
- color: '$text900',
-
- props: {
- placeholderTextColor: '$text500',
- },
- },
- {
- ancestorStyle: ['_input'],
- resolveProps: ['placeholderTextColor'],
- },
- {
- propertyTokenMap: {
- placeholderTextColor: 'colors',
- },
+type ISelectInputProps = VariantProps &
+ React.ComponentProps;
+
+const SelectInput = React.forwardRef(
+ (
+ { className, ...props }: ISelectInputProps & { className?: string },
+ ref?: any
+ ) => {
+ const { size: parentSize, variant: parentVariant } = useStyleContext();
+ return (
+
+ );
}
);
-const Actionsheet = createActionsheet({
- Root: StyledRoot,
- Content: StyledContent,
- Item: StyledItem,
- ItemText: StyledItemText,
- DragIndicator: StyledDragIndicator,
- IndicatorWrapper: StyledDragIndicatorWrapper,
- Backdrop: StyledBackdrop,
- ScrollView: StyledScrollView,
- VirtualizedList: StyledVirtualizedList,
- FlatList: StyledFlatList,
- SectionList: StyledSectionList,
- SectionHeaderText: StyledSectionHeaderText,
- Icon: StyledIcon,
- AnimatePresence: AnimatePresence,
-});
-
-export const Select = createSelect(
- {
- Root: StyledSelectRoot,
- Trigger: StyledSelectTrigger,
- Input: StyledSelectInput,
- Icon: StyledIcon,
- },
- {
- Portal: Actionsheet,
- Backdrop: Actionsheet.Backdrop,
- Content: Actionsheet.Content,
- DragIndicator: Actionsheet.DragIndicator,
- DragIndicatorWrapper: Actionsheet.DragIndicatorWrapper,
- Item: Actionsheet.Item,
- ItemText: Actionsheet.ItemText,
- ScrollView: Actionsheet.ScrollView,
- VirtualizedList: Actionsheet.VirtualizedList,
- FlatList: Actionsheet.FlatList,
- SectionList: Actionsheet.SectionList,
- SectionHeaderText: Actionsheet.SectionHeaderText,
+type ISelectIcon = VariantProps &
+ React.ComponentProps;
+
+const SelectIcon = React.forwardRef(
+ (
+ {
+ className,
+ as: AsComp,
+ size,
+ // @ts-ignore
+ fill = 'none',
+ ...props
+ }: ISelectIcon & { as?: any },
+ ref?: any
+ ) => {
+ const { size: parentSize } = useStyleContext();
+ if (AsComp) {
+ return (
+
+
+
+ );
+ }
+ return (
+
+ );
}
);
-export const SelectTrigger = Select.Trigger;
-export const SelectInput = Select.Input;
-export const SelectIcon = Select.Icon;
-export const SelectPortal = Select.Portal;
-export const SelectBackdrop = Select.Backdrop;
-export const SelectContent = Select.Content;
-export const SelectDragIndicator = Select.DragIndicator;
-export const SelectDragIndicatorWrapper = Select.DragIndicatorWrapper;
-export const SelectItem = Select.Item;
-export const SelectItemText = Select.ItemText;
-export const SelectScrollView = Select.ScrollView;
-export const SelectVirtualizedList = Select.VirtualizedList;
-export const SelectFlatList = Select.FlatList;
-export const SelectSectionList = Select.SectionList;
-export const SelectSectionHeaderText = Select.SectionHeaderText;
+
+Select.displayName = 'Select';
+SelectTrigger.displayName = 'SelectTrigger';
+SelectInput.displayName = 'SelectInput';
+SelectIcon.displayName = 'SelectIcon';
+
+// Actionsheet Components
+const SelectPortal = UISelect.Portal;
+const SelectBackdrop = UISelect.Backdrop;
+const SelectContent = UISelect.Content;
+const SelectDragIndicator = UISelect.DragIndicator;
+const SelectDragIndicatorWrapper = UISelect.DragIndicatorWrapper;
+const SelectItem = UISelect.Item;
+const SelectItemText = UISelect.ItemText;
+const SelectScrollView = UISelect.ScrollView;
+const SelectVirtualizedList = UISelect.VirtualizedList;
+const SelectFlatList = UISelect.FlatList;
+const SelectSectionList = UISelect.SectionList;
+const SelectSectionHeaderText = UISelect.SectionHeaderText;
+
+export {
+ Select,
+ SelectTrigger,
+ SelectInput,
+ SelectIcon,
+ SelectPortal,
+ SelectBackdrop,
+ SelectContent,
+ SelectDragIndicator,
+ SelectDragIndicatorWrapper,
+ SelectItem,
+ SelectItemText,
+ SelectScrollView,
+ SelectVirtualizedList,
+ SelectFlatList,
+ SelectSectionList,
+ SelectSectionHeaderText,
+};
diff --git a/example/storybook-nativewind/src/core-components/nativewind/select/select-actionsheet.tsx b/example/storybook-nativewind/src/core-components/nativewind/select/select-actionsheet.tsx
new file mode 100644
index 0000000000..a881d1d5a1
--- /dev/null
+++ b/example/storybook-nativewind/src/core-components/nativewind/select/select-actionsheet.tsx
@@ -0,0 +1,515 @@
+import { H4 } from '@expo/html-elements';
+import { createActionsheet } from '@gluestack-ui/actionsheet';
+import {
+ Pressable,
+ View,
+ Text,
+ ScrollView,
+ VirtualizedList,
+ FlatList,
+ SectionList,
+ Platform,
+} from 'react-native';
+
+import { tva } from '@gluestack-ui/nativewind-utils/tva';
+import type { VariantProps } from '@gluestack-ui/nativewind-utils';
+import { withStyleContext } from '@gluestack-ui/nativewind-utils/withStyleContext';
+import { withStyleContextAndStates } from '@gluestack-ui/nativewind-utils/withStyleContextAndStates';
+import { cssInterop } from '@gluestack-ui/nativewind-utils/cssInterop';
+import {
+ Motion,
+ AnimatePresence,
+ createMotionAnimatedComponent,
+} from '@legendapp/motion';
+
+import React from 'react';
+
+const AnimatedPressable = createMotionAnimatedComponent(Pressable);
+export const UIActionsheet = createActionsheet({
+ Root: View,
+ Content: withStyleContext(Motion.View),
+ // @ts-ignore
+ Item:
+ Platform.OS === 'web'
+ ? withStyleContext(Pressable)
+ : withStyleContextAndStates(Pressable),
+ ItemText: Text,
+ DragIndicator: View,
+ IndicatorWrapper: View,
+ Backdrop: AnimatedPressable,
+ ScrollView: ScrollView,
+ VirtualizedList: VirtualizedList,
+ FlatList: FlatList,
+ SectionList: SectionList,
+ SectionHeaderText: H4,
+ Icon: View,
+ AnimatePresence: AnimatePresence,
+});
+
+cssInterop(UIActionsheet, { className: 'style' });
+cssInterop(UIActionsheet.Content, { className: 'style' });
+cssInterop(UIActionsheet.Item, { className: 'style' });
+cssInterop(UIActionsheet.ItemText, { className: 'style' });
+cssInterop(UIActionsheet.DragIndicator, { className: 'style' });
+cssInterop(UIActionsheet.DragIndicatorWrapper, { className: 'style' });
+cssInterop(UIActionsheet.Backdrop, { className: 'style' });
+cssInterop(UIActionsheet.ScrollView, { className: 'style' });
+cssInterop(UIActionsheet.VirtualizedList, { className: 'style' });
+cssInterop(UIActionsheet.FlatList, { className: 'style' });
+cssInterop(UIActionsheet.SectionList, { className: 'style' });
+cssInterop(UIActionsheet.SectionHeaderText, { className: 'style' });
+cssInterop(UIActionsheet.Icon, { className: 'style' });
+
+const actionsheetStyle = tva({ base: 'w-full h-full web:pointer-events-none' });
+
+const actionsheetContentStyle = tva({
+ base: 'items-center rounded-tl-3xl rounded-tr-3xl p-2 bg-background-0 web:pointer-events-auto web:select-none shadow-lg',
+});
+
+const actionsheetItemStyle = tva({
+ base: 'w-full flex-row items-center p-3 rounded-sm data-[disabled=true]:opacity-40 data-[disabled=true]:web:pointer-events-auto data-[disabled=true]:web:cursor-not-allowed hover:bg-background-50 active:bg-background-100 data-[focus=true]:bg-background-100 web:data-[focus-visible=true]:bg-background-100 data-[checked=true]:bg-background-100',
+});
+
+const actionsheetItemTextStyle = tva({
+ base: 'text-typography-700 font-normal font-body tracking-md text-left mx-2',
+ variants: {
+ isTruncated: {
+ true: '',
+ },
+ bold: {
+ true: 'font-bold',
+ },
+ underline: {
+ true: 'underline',
+ },
+ strikeThrough: {
+ true: 'line-through',
+ },
+ size: {
+ '2xs': 'text-2xs',
+ 'xs': 'text-xs',
+ 'sm': 'text-sm',
+ 'md': 'text-md',
+ 'lg': 'text-lg',
+ 'xl': 'text-xl',
+ '2xl': 'text-2xl',
+ '3xl': 'text-3xl',
+ '4xl': 'text-4xl',
+ '5xl': 'text-5xl',
+ '6xl': 'text-6xl',
+ },
+ },
+ defaultVariants: {
+ size: 'md',
+ },
+});
+
+const actionsheetDragIndicatorStyle = tva({
+ base: 'w-16 h-1 bg-background-400 rounded-full',
+});
+
+const actionsheetDragIndicatorWrapperStyle = tva({
+ base: 'w-full py-1 items-center',
+});
+
+const actionsheetBackdropStyle = tva({
+ base: 'absolute left-0 top-0 right-0 bottom-0 bg-background-dark web:cursor-default web:pointer-events-auto',
+});
+
+const actionsheetScrollViewStyle = tva({
+ base: 'w-full h-auto',
+});
+
+const actionsheetVirtualizedListStyle = tva({
+ base: 'w-full h-auto',
+});
+
+const actionsheetFlatListStyle = tva({
+ base: 'w-full h-auto',
+});
+
+const actionsheetSectionListStyle = tva({
+ base: 'w-full h-auto',
+});
+
+const actionsheetSectionHeaderTextStyle = tva({
+ base: 'leading-5 font-bold font-heading my-0 text-typography-500 p-3 uppercase',
+ variants: {
+ isTruncated: {
+ true: '',
+ },
+ bold: {
+ true: 'font-bold',
+ },
+ underline: {
+ true: 'underline',
+ },
+ strikeThrough: {
+ true: 'line-through',
+ },
+ size: {
+ '5xl': 'text-5xl',
+ '4xl': 'text-4xl',
+ '3xl': 'text-3xl',
+ '2xl': 'text-2xl',
+ 'xl': 'text-xl',
+ 'lg': 'text-lg',
+ 'md': 'text-md',
+ 'sm': 'text-sm',
+ 'xs': 'text-xs',
+ },
+
+ sub: {
+ true: 'text-xs',
+ },
+ italic: {
+ true: 'italic',
+ },
+ highlight: {
+ true: 'bg-yellow500',
+ },
+ },
+ defaultVariants: {
+ size: 'xs',
+ },
+});
+
+const actionsheetIconStyle = tva({
+ base: 'text-typography-900',
+ variants: {
+ size: {
+ '2xs': 'h-3 w-3',
+ 'xs': 'h-3.5 w-3.5',
+ 'sm': 'h-4 w-4',
+ 'md': 'w-4 h-4',
+ 'lg': 'h-5 w-5',
+ 'xl': 'h-6 w-6',
+ },
+ },
+});
+
+type IActionsheetProps = VariantProps &
+ React.ComponentProps;
+
+type IActionsheetContentProps = VariantProps &
+ React.ComponentProps;
+
+type IActionsheetItemProps = VariantProps &
+ React.ComponentProps;
+
+type IActionsheetItemTextProps = VariantProps &
+ React.ComponentProps;
+
+type IActionsheetDragIndicatorProps = VariantProps<
+ typeof actionsheetDragIndicatorStyle
+> &
+ React.ComponentProps;
+
+type IActionsheetDragIndicatorWrapperProps = VariantProps<
+ typeof actionsheetDragIndicatorWrapperStyle
+> &
+ React.ComponentProps;
+
+type IActionsheetBackdropProps = VariantProps &
+ React.ComponentProps;
+
+type IActionsheetScrollViewProps = VariantProps<
+ typeof actionsheetScrollViewStyle
+> &
+ React.ComponentProps;
+
+type IActionsheetVirtualizedListProps = VariantProps<
+ typeof actionsheetVirtualizedListStyle
+> &
+ React.ComponentProps;
+
+type IActionsheetFlatListProps = VariantProps &
+ React.ComponentProps;
+
+type IActionsheetSectionListProps = VariantProps<
+ typeof actionsheetSectionListStyle
+> &
+ React.ComponentProps;
+
+type IActionsheetSectionHeaderTextProps = VariantProps<
+ typeof actionsheetSectionHeaderTextStyle
+> &
+ React.ComponentProps;
+
+type IActionsheetIconProps = VariantProps &
+ React.ComponentProps;
+
+const Actionsheet = React.forwardRef(
+ ({ className, ...props }: IActionsheetProps, ref?: any) => {
+ return (
+
+ );
+ }
+);
+
+const ActionsheetContent = React.forwardRef(
+ (
+ { className, ...props }: IActionsheetContentProps & { className?: string },
+ ref?: any
+ ) => {
+ return (
+
+ );
+ }
+);
+
+const ActionsheetItem = React.forwardRef(
+ ({ className, ...props }: IActionsheetItemProps, ref?: any) => {
+ return (
+
+ );
+ }
+);
+
+const ActionsheetItemText = React.forwardRef(
+ (
+ {
+ isTruncated,
+ bold,
+ underline,
+ strikeThrough,
+ size,
+ className,
+ ...props
+ }: IActionsheetItemTextProps,
+ ref?: any
+ ) => {
+ return (
+
+ );
+ }
+);
+
+const ActionsheetDragIndicator = React.forwardRef(
+ ({ className, ...props }: IActionsheetDragIndicatorProps, ref?: any) => {
+ return (
+
+ );
+ }
+);
+
+const ActionsheetDragIndicatorWrapper = React.forwardRef(
+ (
+ { className, ...props }: IActionsheetDragIndicatorWrapperProps,
+ ref?: any
+ ) => {
+ return (
+
+ );
+ }
+);
+
+const ActionsheetBackdrop = React.forwardRef(
+ (
+ { className, ...props }: IActionsheetBackdropProps & { className?: string },
+ ref?: any
+ ) => {
+ return (
+
+ );
+ }
+);
+
+const ActionsheetScrollView = React.forwardRef(
+ ({ className, ...props }: IActionsheetScrollViewProps, ref?: any) => {
+ return (
+
+ );
+ }
+);
+
+const ActionsheetVirtualizedList = React.forwardRef(
+ ({ className, ...props }: IActionsheetVirtualizedListProps, ref?: any) => {
+ return (
+
+ );
+ }
+);
+
+const ActionsheetFlatList = React.forwardRef(
+ ({ className, ...props }: IActionsheetFlatListProps, ref?: any) => {
+ return (
+
+ );
+ }
+);
+
+const ActionsheetSectionList = React.forwardRef(
+ ({ className, ...props }: IActionsheetSectionListProps, ref?: any) => {
+ return (
+
+ );
+ }
+);
+
+const ActionsheetSectionHeaderText = React.forwardRef(
+ (
+ {
+ className,
+ isTruncated,
+ bold,
+ underline,
+ strikeThrough,
+ size,
+ sub,
+ italic,
+ highlight,
+ ...props
+ }: IActionsheetSectionHeaderTextProps,
+ ref?: any
+ ) => {
+ return (
+
+ );
+ }
+);
+
+const ActionsheetIcon = React.forwardRef(
+ (
+ {
+ className,
+ as: AsComp,
+ size = 'sm',
+ ...props
+ }: IActionsheetIconProps & { as?: any },
+ ref?: any
+ ) => {
+ if (AsComp) {
+ return (
+
+ );
+ }
+ return (
+
+ );
+ }
+);
+
+export {
+ Actionsheet,
+ ActionsheetContent,
+ ActionsheetItem,
+ ActionsheetItemText,
+ ActionsheetDragIndicator,
+ ActionsheetDragIndicatorWrapper,
+ ActionsheetBackdrop,
+ ActionsheetScrollView,
+ ActionsheetVirtualizedList,
+ ActionsheetFlatList,
+ ActionsheetSectionList,
+ ActionsheetSectionHeaderText,
+ ActionsheetIcon,
+};
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 8bf46c68be..80fdd7dd9f 100644
--- a/example/storybook-nativewind/src/core-components/nativewind/slider/index.tsx
+++ b/example/storybook-nativewind/src/core-components/nativewind/slider/index.tsx
@@ -12,19 +12,18 @@ import { withStyleContextAndStates } from '@gluestack-ui/nativewind-utils/withSt
import { cssInterop } from '@gluestack-ui/nativewind-utils/cssInterop';
import { withStates } from '@gluestack-ui/nativewind-utils/withStates';
+const SCOPE = 'SLIDER';
export const UISlider = createSlider({
- // @ts-ignore
Root:
Platform.OS === 'web'
- ? withStyleContext(View)
- : withStyleContextAndStates(View),
+ ? withStyleContext(View, SCOPE)
+ : withStyleContextAndStates(View, SCOPE),
Thumb: Platform.OS === 'web' ? View : withStates(View),
Track: Pressable,
FilledTrack: Platform.OS === 'web' ? View : withStates(View),
ThumbInteraction: View,
});
-//@ts-ignore
cssInterop(UISlider, { className: 'style' });
cssInterop(UISlider.Thumb, { className: 'style' });
cssInterop(UISlider.Track, { className: 'style' });
@@ -162,7 +161,7 @@ export const Slider = React.forwardRef(
isReversed = false,
...props
}: any,
- ref
+ ref?: any
) => {
return (
{
- const { size: parentSize } = useStyleContext();
+ ({ className, size, ...props }: any, ref?: any) => {
+ const { size: parentSize } = useStyleContext(SCOPE);
return (
{
+ ({ className, ...props }: any, ref?: any) => {
const {
orientation: parentOrientation,
size: parentSize,
isReversed,
- } = useStyleContext();
+ } = useStyleContext(SCOPE);
return (
{
- const { orientation: parentOrientation } = useStyleContext();
+ ({ className, ...props }: any, ref?: any) => {
+ const { orientation: parentOrientation } = useStyleContext(SCOPE);
return (
&
const Switch = React.forwardRef(
(
{ className, size = 'md', ...props }: { className?: string } & ISwitchProps,
- ref
+ ref?: any
) => {
return (
&
VariantProps;
diff --git a/example/storybook-nativewind/src/core-components/nativewind/text/index.web.tsx b/example/storybook-nativewind/src/core-components/nativewind/text/index.web.tsx
new file mode 100644
index 0000000000..19834245dc
--- /dev/null
+++ b/example/storybook-nativewind/src/core-components/nativewind/text/index.web.tsx
@@ -0,0 +1,45 @@
+import React from 'react';
+import type { VariantProps } from '@gluestack-ui/nativewind-utils';
+import { textStyle } from './styles';
+
+type ITextProps = React.ComponentProps<'span'> & VariantProps;
+
+const Text = React.forwardRef(
+ (
+ {
+ className,
+ isTruncated,
+ bold,
+ underline,
+ strikeThrough,
+ size = 'md',
+ sub,
+ italic,
+ highlight,
+ ...props
+ }: { className?: string } & ITextProps,
+ ref?: any
+ ) => {
+ return (
+
+ );
+ }
+);
+
+Text.displayName = 'Text';
+
+export { Text };
diff --git a/example/storybook-nativewind/src/core-components/nativewind/text/styles.tsx b/example/storybook-nativewind/src/core-components/nativewind/text/styles.tsx
new file mode 100644
index 0000000000..5defa381ac
--- /dev/null
+++ b/example/storybook-nativewind/src/core-components/nativewind/text/styles.tsx
@@ -0,0 +1,41 @@
+import { tva } from '@gluestack-ui/nativewind-utils/tva';
+export const textStyle = tva({
+ base: 'text-typography-700 font-normal font-body web:font-sans web:tracking-sm web:my-0 web:bg-transparent web:border-0 web:box-border web:display-inline web:list-none web:margin-0 web:padding-0 web:position-relative web:text-start web:no-underline web:whitespace-pre-wrap web:word-wrap-break-word',
+
+ variants: {
+ isTruncated: {
+ true: 'web:truncate',
+ },
+ bold: {
+ true: 'font-bold',
+ },
+ underline: {
+ true: 'underline',
+ },
+ strikeThrough: {
+ true: 'line-through',
+ },
+ size: {
+ '2xs': 'text-2xs',
+ 'xs': 'text-xs',
+ 'sm': 'text-sm',
+ 'md': 'text-base',
+ 'lg': 'text-lg',
+ 'xl': 'text-xl',
+ '2xl': 'text-2xl',
+ '3xl': 'text-3xl',
+ '4xl': 'text-4xl',
+ '5xl': 'text-5xl',
+ '6xl': 'text-6xl',
+ },
+ sub: {
+ true: 'text-xs',
+ },
+ italic: {
+ true: 'italic',
+ },
+ highlight: {
+ true: 'bg-yellow-500',
+ },
+ },
+});
diff --git a/example/storybook-nativewind/src/core-components/nativewind/textarea/index.tsx b/example/storybook-nativewind/src/core-components/nativewind/textarea/index.tsx
index 1dd5b7216b..811dbf2d0d 100644
--- a/example/storybook-nativewind/src/core-components/nativewind/textarea/index.tsx
+++ b/example/storybook-nativewind/src/core-components/nativewind/textarea/index.tsx
@@ -11,13 +11,12 @@ import { withStyleContextAndStates } from '@gluestack-ui/nativewind-utils/withSt
import { cssInterop } from '@gluestack-ui/nativewind-utils/cssInterop';
import { withStates } from '@gluestack-ui/nativewind-utils/withStates';
import type { VariantProps } from '@gluestack-ui/nativewind-utils';
-
+const SCOPE = 'TEXTAREA';
const UITextarea = createTextarea({
- // @ts-ignore
Root:
Platform.OS === 'web'
- ? withStyleContext(View)
- : withStyleContextAndStates(View),
+ ? withStyleContext(View, SCOPE)
+ : withStyleContextAndStates(View, SCOPE),
Input: Platform.OS === 'web' ? TextInput : withStates(TextInput),
});
@@ -32,6 +31,12 @@ const textareaStyle = tva({
default:
'data-[focus=true]:border-primary-700 data-[focus=true]:web:ring-1 data-[focus=true]:web:ring-inset data-[focus=true]:web:ring-primary-700 data-[invalid=true]:border-error-700 data-[invalid=true]:web:ring-1 data-[invalid=true]:web:ring-inset data-[invalid=true]:web:ring-error-700 data-[invalid=true]:hover:border-error-700 data-[invalid=true]:data-[focus=true]:hover:border-primary-700 data-[invalid=true]:data-[focus=true]:hover:web:ring-1 data-[invalid=true]:data-[focus=true]:hover:web:ring-inset data-[invalid=true]:data-[focus=true]:hover:web:ring-primary-700 data-[invalid=true]:data-[disabled=true]:hover:border-error-700 data-[invalid=true]:data-[disabled=true]:hover:web:ring-1 data-[invalid=true]:data-[disabled=true]:hover:web:ring-inset data-[invalid=true]:data-[disabled=true]:hover:web:ring-error-700 ',
},
+ size: {
+ sm: '',
+ md: '',
+ lg: '',
+ xl: '',
+ },
},
});
@@ -58,7 +63,7 @@ const Textarea = React.forwardRef(
size = 'md',
...props
}: { className?: string } & ITextareaProps,
- ref
+ ref?: any
) => {
return (
&
const TextareaInput = React.forwardRef(
(
{ className, ...props }: { className?: string } & ITextareaInputProps,
- ref
+ ref?: any
) => {
- const { size: parentSize } = useStyleContext();
+ const { size: parentSize } = useStyleContext(SCOPE);
return (
{
return (
&
VariantProps;
diff --git a/example/storybook-nativewind/src/core-components/nativewind/vstack/index.web.tsx b/example/storybook-nativewind/src/core-components/nativewind/vstack/index.web.tsx
new file mode 100644
index 0000000000..4d52aae9c2
--- /dev/null
+++ b/example/storybook-nativewind/src/core-components/nativewind/vstack/index.web.tsx
@@ -0,0 +1,23 @@
+import React from 'react';
+import type { VariantProps } from '@gluestack-ui/nativewind-utils';
+
+import { vstackStyle } from './styles';
+
+type IVStackProps = React.ComponentProps<'div'> &
+ VariantProps;
+
+const VStack = React.forwardRef(
+ ({ className, space, reversed, ...props }: IVStackProps, ref?: any) => {
+ return (
+
+ );
+ }
+);
+
+VStack.displayName = 'VStack';
+
+export { VStack };
diff --git a/example/storybook-nativewind/src/core-components/nativewind/vstack/styles.tsx b/example/storybook-nativewind/src/core-components/nativewind/vstack/styles.tsx
new file mode 100644
index 0000000000..8e5601f77f
--- /dev/null
+++ b/example/storybook-nativewind/src/core-components/nativewind/vstack/styles.tsx
@@ -0,0 +1,19 @@
+import { tva } from '@gluestack-ui/nativewind-utils/tva';
+export const vstackStyle = tva({
+ base: 'web:flex flex-col',
+ variants: {
+ space: {
+ 'xs': 'gap-1',
+ 'sm': 'gap-2',
+ 'md': 'gap-3',
+ 'lg': 'gap-4',
+ 'xl': 'gap-5',
+ '2xl': 'gap-6',
+ '3xl': 'gap-7',
+ '4xl': 'gap-8',
+ },
+ reversed: {
+ true: 'flex-col-reverse',
+ },
+ },
+});
diff --git a/example/storybook-nativewind/src/core-components/themed/Wrapper.tsx b/example/storybook-nativewind/src/core-components/themed/Wrapper.tsx
index 05ad7427e5..22159937de 100644
--- a/example/storybook-nativewind/src/core-components/themed/Wrapper.tsx
+++ b/example/storybook-nativewind/src/core-components/themed/Wrapper.tsx
@@ -3,6 +3,8 @@ import React from 'react';
import { Box, Center } from '@gluestack-ui/themed';
import { StyledProvider, useColorMode } from '@gluestack-style/react';
import { createProvider } from '@gluestack-ui/provider';
+import { OverlayProvider } from '@gluestack-ui/overlay';
+import { ToastProvider } from '@gluestack-ui/toast';
const Provider = createProvider({ StyledProvider }) as any;
Provider.displayName = 'Provider';
@@ -20,7 +22,11 @@ const Wrapper = ({ children, ...props }: any) => {
}}
{...props}
>
- {children}
+
+
+ {children}
+
+
);
diff --git a/example/storybook-nativewind/src/core-components/themed/image/index.tsx b/example/storybook-nativewind/src/core-components/themed/image/index.tsx
index f971e2d95e..d808a0d390 100644
--- a/example/storybook-nativewind/src/core-components/themed/image/index.tsx
+++ b/example/storybook-nativewind/src/core-components/themed/image/index.tsx
@@ -53,6 +53,15 @@ const StyledRoot = styled(
size: 'md',
},
},
- {}
+ {
+ componentName: 'Image',
+ resolveProps: ['tintColor'],
+ } as const,
+ {
+ propertyTokenMap: {
+ tintColor: 'colors',
+ },
+ }
);
+
export const Image = createImage({ Root: StyledRoot });
diff --git a/example/storybook-nativewind/src/getting-started/figma-ui-kit/index.nw.stories.mdx b/example/storybook-nativewind/src/getting-started/figma-ui-kit/index.nw.stories.mdx
new file mode 100644
index 0000000000..f45c09d866
--- /dev/null
+++ b/example/storybook-nativewind/src/getting-started/figma-ui-kit/index.nw.stories.mdx
@@ -0,0 +1,35 @@
+---
+title: Figma UI Kit | gluestack-ui
+description: The Figma UI Kit provides a collection of ready-to-use UI components from the gluestack-ui library.
+---
+
+import { Canvas, Meta, Story } from '@storybook/addon-docs';
+
+
+
+# Figma UI Kit
+
+The [Figma UI Kit](https://www.figma.com/@gluestack) provides a collection of ready-to-use UI components from the gluestack-ui library. So you can directly use these components in Figma and design your app. The developers won’t have a chance to say this is not possible!
+
+## Auto-generated
+
+Yes, our Figma UI Kit is auto-generated from the storybook. This helps us maintain a single source of truth, providing design-development consistency which is very important if you are building at scale.
+
+## Customize with ease
+
+- **AutoLayout support** - AutoLayout is a powerful feature in Figma that helps you create responsive and flexible designs by automatically adjusting the layout and spacing of elements within frames. It's particularly useful for designing interfaces that need to adapt to various screen sizes or content changes.
+
+- **Color Tokens** - Color tokens in Figma refer to a systematic and organized way of managing and using colors within your design projects. They help maintain consistency and make it easier to update colors across your designs by defining a centralized set of color values that can be reused throughout your project. In this Figma UI Kit we have a beautiful palette around 4312 color tokens with alpha support, covering around 48 colors with its 10 hues.
+
+- **Text Tokens** - Text tokens in Figma, sometimes referred to as text styles or text components, allow you to define and manage a consistent set of text properties such as font, size, line spacing, color, and more. Text tokens help maintain a unified text style across your design project, making it easier to ensure consistency and make global updates when needed. In this Figma UI Kit, we have two major foundation components **Text** and **Heading**, along with its sizes and font weights.
+
+- **Shadow Tokens** - Shadow tokens in Figma, sometimes referred to as effect styles, allow you to define and manage Effects, like drop shadows, stroke, blur and even images as Styles. In this Figma UI Kit, we majorly have included two shadows, named **Hard** and **Soft** shadows.
+
+- **Components** - Components in Figma are reusable design elements that allow you to create consistent and efficient designs. Components can represent UI elements, icons, buttons, or any other visual elements that you want to reuse across your design projects. This Figma UI Kit, includes around 23 components along with its instances mapped in compound components.
+
+
+
+## Try it now
+
+Find the Figma UI Kit live [here](https://www.figma.com/community/file/1284424195134275844/gluestack-ui-v0-1-design-kit-auto-generated)!
+
diff --git a/example/storybook-nativewind/src/getting-started/figma-ui-kit/index.themed.stories.mdx b/example/storybook-nativewind/src/getting-started/figma-ui-kit/index.themed.stories.mdx
new file mode 100644
index 0000000000..f45c09d866
--- /dev/null
+++ b/example/storybook-nativewind/src/getting-started/figma-ui-kit/index.themed.stories.mdx
@@ -0,0 +1,35 @@
+---
+title: Figma UI Kit | gluestack-ui
+description: The Figma UI Kit provides a collection of ready-to-use UI components from the gluestack-ui library.
+---
+
+import { Canvas, Meta, Story } from '@storybook/addon-docs';
+
+
+
+# Figma UI Kit
+
+The [Figma UI Kit](https://www.figma.com/@gluestack) provides a collection of ready-to-use UI components from the gluestack-ui library. So you can directly use these components in Figma and design your app. The developers won’t have a chance to say this is not possible!
+
+## Auto-generated
+
+Yes, our Figma UI Kit is auto-generated from the storybook. This helps us maintain a single source of truth, providing design-development consistency which is very important if you are building at scale.
+
+## Customize with ease
+
+- **AutoLayout support** - AutoLayout is a powerful feature in Figma that helps you create responsive and flexible designs by automatically adjusting the layout and spacing of elements within frames. It's particularly useful for designing interfaces that need to adapt to various screen sizes or content changes.
+
+- **Color Tokens** - Color tokens in Figma refer to a systematic and organized way of managing and using colors within your design projects. They help maintain consistency and make it easier to update colors across your designs by defining a centralized set of color values that can be reused throughout your project. In this Figma UI Kit we have a beautiful palette around 4312 color tokens with alpha support, covering around 48 colors with its 10 hues.
+
+- **Text Tokens** - Text tokens in Figma, sometimes referred to as text styles or text components, allow you to define and manage a consistent set of text properties such as font, size, line spacing, color, and more. Text tokens help maintain a unified text style across your design project, making it easier to ensure consistency and make global updates when needed. In this Figma UI Kit, we have two major foundation components **Text** and **Heading**, along with its sizes and font weights.
+
+- **Shadow Tokens** - Shadow tokens in Figma, sometimes referred to as effect styles, allow you to define and manage Effects, like drop shadows, stroke, blur and even images as Styles. In this Figma UI Kit, we majorly have included two shadows, named **Hard** and **Soft** shadows.
+
+- **Components** - Components in Figma are reusable design elements that allow you to create consistent and efficient designs. Components can represent UI elements, icons, buttons, or any other visual elements that you want to reuse across your design projects. This Figma UI Kit, includes around 23 components along with its instances mapped in compound components.
+
+
+
+## Try it now
+
+Find the Figma UI Kit live [here](https://www.figma.com/community/file/1284424195134275844/gluestack-ui-v0-1-design-kit-auto-generated)!
+
diff --git a/example/storybook-nativewind/src/overview/Introduction/index.nw.stories.mdx b/example/storybook-nativewind/src/overview/Introduction/index.nw.stories.mdx
index 21e2016833..dea683df2e 100644
--- a/example/storybook-nativewind/src/overview/Introduction/index.nw.stories.mdx
+++ b/example/storybook-nativewind/src/overview/Introduction/index.nw.stories.mdx
@@ -19,7 +19,7 @@ import { Canvas, Meta, Story } from '@storybook/addon-docs';
- Full Customization: Tailor components to fit your project's needs by adjusting styles and behaviors.
->Note: This is not a component library as you cannot import components inside your application, to directly import components inside your application you can directly use [@gluestack-ui/themed](/ui/docs).
+>Note: This pattern uses [NativeWind](https://www.nativewind.dev/v4/overview) version 4.0.36. For styling guidelines, please refer to NativeWind [documentation](https://www.nativewind.dev/v4/overview).
## Community
diff --git a/example/storybook-nativewind/src/theme-configuration/customizing-theme/index.nw.stories.mdx b/example/storybook-nativewind/src/theme-configuration/customizing-theme/index.nw.stories.mdx
new file mode 100644
index 0000000000..7aa3bfca96
--- /dev/null
+++ b/example/storybook-nativewind/src/theme-configuration/customizing-theme/index.nw.stories.mdx
@@ -0,0 +1,71 @@
+---
+title: Customizing Theme
+
+description: Customizing the theme in gluestack-ui with nativewind involves defining a theme configuration and applying it using GluestackUIProvider, enabling you to style your application's visual elements according to your design preferences.
+
+showHeader: true
+---
+
+import { Canvas, Meta, Story } from '@storybook/addon-docs';
+import { CollapsibleCode } from '@gluestack/design-system';
+
+
+
+
+## Customizing Tokens
+
+gluestack-ui, integrated with Nativewind, seamlessly accommodates the default Tailwind CSS [theme](https://tailwindcss.com/docs/theme), allowing users to effortlessly expand and customize it to suit their needs.
+
+gluestack-ui with nativewind also ships with a set of handpicked default color palette tokens which are mapped seperately with each mode. For example, the default color palette for light mode is `light` and the default color palette for dark mode is `dark`.
+
+To customize tokens, follow these steps:
+
+1. Go to `gluestack-ui-provider/config.ts` file. Update or add new tokens as per your requirements.
+
+
+
+```jsx
+export const config = {
+ light: vars({
+
+ ... // other tokens
+ //updated '--color-primary-0' value
+ '--color-primary-0': '#C0C0C0',
+
+ /* Added a new background color for light mode */
+ '--color-background-new': '#BAE7FC',
+
+ }),
+ dark: vars({
+ ... // other tokens
+ /* Added a new background color for dark mode */
+ '--color-background-new': '#89D6FA',
+ }),
+};
+
+```
+
+
+2. In case you are adding a new color in your config file, you need to update it in the tailwind.config.js file as well.
+
+
+```jsx
+ theme: {
+ extend: {
+ colors: {
+ background: {
+ ... // other color values,
+ /* Added a new background color */
+ new: 'var(--color-background-new)',
+ },
+ },
+ },
+ plugins: [],
+ },
+```
+
+You can customize all the tokens in `config`. For a complete list of tokens and default values, please check [default Tokens](https://gluestack.io/ui/nativewind/docs/theme-configuration/default-tokens).
+
+By utilizing this approach, you can seamlessly modify the primary color tokens of the theme while maintaining the overall theme configuration intact.
+
+If you want to extend the default tailwind config and add fonts, breakpoints, border radius values, and more, please refer to the [tailwindcss](https://tailwindcss.com/docs/theme#customizing-the-default-theme) documentation.
\ No newline at end of file
diff --git a/example/storybook-nativewind/src/theme-configuration/customizing-theme/index.themed.stories.mdx b/example/storybook-nativewind/src/theme-configuration/customizing-theme/index.themed.stories.mdx
new file mode 100644
index 0000000000..f88f830148
--- /dev/null
+++ b/example/storybook-nativewind/src/theme-configuration/customizing-theme/index.themed.stories.mdx
@@ -0,0 +1,63 @@
+---
+title: Customizing Theme
+
+description: Customizing the theme in gluestack-ui with gluestack-style involves defining a theme configuration and applying it using GluestackUIProvider, enabling you to style your application's visual elements according to your design preferences.
+
+showHeader: true
+---
+
+import { Canvas, Meta, Story } from '@storybook/addon-docs';
+import { CollapsibleCode } from '@gluestack/design-system';
+
+
+
+
+## Customizing Tokens
+
+
+gluestack-ui with gluestack style ships with a default `config` which contains a set of already defined tokens which are mapped seperately with each mode.
+Customizing these tokens allows you to tailor the core design elements of the library to match your project's unique visual identity.
+
+To customize tokens, follow these steps:
+
+1. Go to `gluestack-ui-provider/config.ts` file. Update or add new tokens as per your requirements.
+
+
+
+```jsx
+
+
+export const config = createConfig({
+ // ... config
+ tokens: {
+ colors: {
+ // replacing primary color
+ primary0: '#ffffff',
+ primary50: '#a3fff4',
+ primary100: '#82fff0',
+ primary200: '#61ffed',
+ primary300: '#45fae5',
+ primary400: '#24f9e1',
+ primary500: '#17f3d9',
+ primary600: '#12e4cb',
+ primary700: '#17ccb7',
+ primary800: '#1ab5a3',
+ primary900: '#1c9f90',
+ primary950: '#000000',
+ ... // Other tokens
+ },
+ },
+});
+
+type Config = typeof config;
+
+declare module '@gluestack-style/react' {
+ interface ICustomConfig extends Config {}
+}
+
+```
+
+
+You can customize all the tokens in the `config`. For a complete list of tokens and default values, please check [default Tokens](https://gluestack.io/ui/gluestack-style/docs/theme-configuration/default-tokens).
+
+By utilizing this approach, you can seamlessly modify the primary color tokens of the theme while maintaining the overall theme configuration intact.
\ No newline at end of file
diff --git a/example/storybook-nativewind/src/theme-configuration/default-tokens/index.nw.stories.mdx b/example/storybook-nativewind/src/theme-configuration/default-tokens/index.nw.stories.mdx
new file mode 100644
index 0000000000..4b11f04490
--- /dev/null
+++ b/example/storybook-nativewind/src/theme-configuration/default-tokens/index.nw.stories.mdx
@@ -0,0 +1,27 @@
+---
+title: Default Tokens | gluestack-ui
+
+description: gluestack-ui with nativewind ships with default tokens that provide access to theme values and lets you build and customize your own themed components.
+
+pageTitle: Default Tokens
+
+pageDescription: gluestack-ui with nativewind ships with default tokens that provide access to theme values and lets you build and customize your own themed components.
+
+showHeader: true
+---
+
+import { Canvas, Meta, Story } from '@storybook/addon-docs';
+import { ColorPaletteComponent } from "../../components/docs-components/DefaultComponent.tsx"
+
+
+
+Theming in `@gluestack-ui with nativewind` is based on the [Styled System Theme Specification](https://github.com/system-ui/theme-specification).
+
+
+## Colors
+
+We recommend adding a palette that ranges from 50 to 900. Tools like [JSON Color Palette Generator](https://json-color-palette-generator.vercel.app), [Smart Swatch](https://smart-swatch.netlify.app/) or [Palx](https://palx.jxnblk.com/) are available to generate these palettes.
+
+Below are the default color palette tokens provided in the gluestack-ui default config.
+
+
\ No newline at end of file
diff --git a/example/storybook-nativewind/src/theme-configuration/default-tokens/index.themed.stories.mdx b/example/storybook-nativewind/src/theme-configuration/default-tokens/index.themed.stories.mdx
new file mode 100644
index 0000000000..48fa2af7ed
--- /dev/null
+++ b/example/storybook-nativewind/src/theme-configuration/default-tokens/index.themed.stories.mdx
@@ -0,0 +1,91 @@
+---
+title: Default Tokens
+
+description: gluestack-ui ships with default tokens that provide access to theme values and lets you build and customize your own themed components. It has colors, typography, size, opacity, shadows, breakpoints and more.
+
+pageTitle: Default Tokens
+
+pageDescription: gluestack-ui ships with default tokens that provide access to theme values and lets you build and customize your own themed components. It has colors, typography, size, opacity, shadows, breakpoints and more.
+showHeader: true
+---
+
+import { Canvas, Meta, Story } from '@storybook/addon-docs';
+import {
+ ColorPaletteComponent,
+ SpaceComponent,
+ OpacityComponent,
+ ShadowsComponent,
+ BorderWidthComponent,
+ RadiiComponent,
+} from '../../components/docs-components/DefaultComponentThemed.tsx';
+
+
+
+Theming in `@gluestack-ui with gluestack-style` is based on the [Styled System Theme Specification](https://github.com/system-ui/theme-specification).
+
+## Colors
+
+We recommend adding a palette that ranges from 50 to 900. Tools like [JSON Color Palette Generator](https://json-color-palette-generator.vercel.app), [Smart Swatch](https://smart-swatch.netlify.app/) or [Palx](https://palx.jxnblk.com/) are available to generate these palettes.
+
+
+
+## Typography
+
+To manage Typography options, the tokens object supports the following keys:
+
+- `fonts (font families)`
+- `fontSizes`
+- `fontWeights`
+- `lineHeights`
+- `letterSpacings`
+
+```jsx
+import { createConfig } from '../../core-components/themed/gluestack-ui-provider/config';
+import {config as defaultConfig } from '../../core-components/themed/gluestack-ui-provider/config';
+
+const config = createConfig({
+ ...defaultConfig,
+ tokens: {
+ ...defaultConfig.tokens,
+ fontSizes: {
+ ...defaultConfig.tokens.fontSizes,
+ newFontSize: 90,
+ },
+ ...// other tokens
+ },
+});
+```
+
+## Space
+
+The space key allows you to customize the global spacing and sizing scale for your project. By default these spacing value can be referenced by the padding, margin, and top, left, right, bottom, props.
+
+
+
+## Opacity
+
+You can define your opacity tokens or override existing ones using the `createConfig` function under the `tokens` section.
+
+
+
+## Shadows
+
+In `@gluestack-ui with gluestack-style` there are two types of shadows provided by default.
+
+> Note: In the context of dark mode design, it's important to recognize that elevation serves as the primary tool for expressing hierarchy. Unlike in light mode, where shadows are used for this purpose, dark themes prioritize surface illumination. The higher the elevation, the lighter the surfaces become, ultimately improving visibility and clarity.
+
+
+
+## Borders
+
+### border widths
+
+`borderWidths` tokens are used to define the border radius of an element. You can define your radii tokens or override existing ones using the `createConfig` function under the `tokens` section.
+
+
+
+### border radius
+
+`radii` tokens are used to define the border radius of an element. You can define your radii tokens or override existing ones using the `createConfig` function under the `tokens` section.
+
+
diff --git a/example/storybook-nativewind/tailwind.config.js b/example/storybook-nativewind/tailwind.config.js
index 54a93ef22f..d5e42b6e60 100644
--- a/example/storybook-nativewind/tailwind.config.js
+++ b/example/storybook-nativewind/tailwind.config.js
@@ -6,6 +6,18 @@ module.exports = {
'./src/core-components/**/**/*.{html,js,jsx,ts,tsx}',
'./src/components/**/*.{html,js,jsx,ts,tsx,mdx}',
],
+ safelist: [
+ 'gap-x-2',
+ 'gap-y-6',
+ 'pl-4',
+ 'flex-wrap',
+ 'mb-12',
+ 'basis-[10%]',
+ {
+ pattern:
+ /bg-(primary|secondary|tertiary|error|success|warning|muted|info|typography|outline|background)-(0|50|100|200|300|400|500|600|700|800|900|950|light|dark|white|gray|black)/,
+ },
+ ],
presets: [require('nativewind/preset')],
theme: {
extend: {
diff --git a/example/storybook-nativewind/tsconfig.json b/example/storybook-nativewind/tsconfig.json
index 53e2797e03..07457ecd2a 100644
--- a/example/storybook-nativewind/tsconfig.json
+++ b/example/storybook-nativewind/tsconfig.json
@@ -6,6 +6,20 @@
"@/components/ui/*": ["src/core-components/nativewind/*"],
"@gluestack-style/react": ["../../packages/styled/react/src"],
"@gluestack-ui/popover": ["../../packages/unstyled/popover/src"],
+ "@gluestack-ui/button": ["../../packages/unstyled/button/src"],
+ "@gluestack-ui/alert": ["../../packages/unstyled/alert/src"],
+ "@gluestack-ui/input": ["../../packages/unstyled/input/src"],
+ "@gluestack-ui/checkbox": ["../../packages/unstyled/checkbox/src"],
+ "@gluestack-ui/radio": ["../../packages/unstyled/radio/src"],
+ "@gluestack-ui/accordion": ["../../packages/unstyled/accordion/src"],
+ "@gluestack-ui/actionsheet": ["../../packages/unstyled/actionsheet/src"],
+ "@gluestack-ui/tooltip": ["../../packages/unstyled/tooltip/src"],
+ "@gluestack-ui/alert-dialog": [
+ "../../packages/unstyled/alert-dialog/src"
+ ],
+ "@gluestack-ui/menu": ["../../packages/unstyled/menu/src"],
+ "@gluestack-ui/textarea": ["../../packages/unstyled/textarea/src"],
+ "@gluestack-ui/link": ["../../packages/unstyled/link/src"],
"@gluestack-ui/nativewind-utils/tva": [
"../../packages/nativewind/utils/src/tva"
],
@@ -20,7 +34,8 @@
],
"@gluestack-ui/nativewind-utils/cssInterop": [
"../../packages/nativewind/utils/src/cssInterop"
- ]
+ ],
+ "tailwind.config": ["./tailwind.config.js"]
},
"emitDeclarationOnly": true,
"noEmit": false,
diff --git a/example/storybook/src/ui/theme-configuration/customizing-theme/EjectLibrary/index.stories.mdx b/example/storybook/src/ui/theme-configuration/customizing-theme/EjectLibrary/index.stories.mdx
index 451acadeca..b483c2c8a1 100644
--- a/example/storybook/src/ui/theme-configuration/customizing-theme/EjectLibrary/index.stories.mdx
+++ b/example/storybook/src/ui/theme-configuration/customizing-theme/EjectLibrary/index.stories.mdx
@@ -21,7 +21,7 @@ import { AppProvider, CodePreview, Text } from '@gluestack/design-system';
> Note: It is NOT RECOMMENDED to both eject theme & library in one project. It is RECOMMENDED to eject library as it provides maximum customization(theme & components), but if you want to customize only the theme, refer [here](/ui/docs/theme-configuration/customizing-theme/eject-theme).
-## Eject Library
+## Eject Components
Customizing components allows you to tailor the components according to your design system or guidelines to match your project's unique visual identity. To customize tokens and components, follow these steps:
diff --git a/packages/config/package.json b/packages/config/package.json
index 6c8714605b..d7282ab042 100644
--- a/packages/config/package.json
+++ b/packages/config/package.json
@@ -38,42 +38,42 @@
"@gluestack-style/animation-resolver": "1.0.4",
"@gluestack-style/legend-motion-animation-driver": "1.0.3",
"@gluestack-style/react": "1.0.52",
- "@gluestack-ui/accordion": "1.0.3",
- "@gluestack-ui/actionsheet": "0.2.40",
- "@gluestack-ui/alert": "0.1.12",
- "@gluestack-ui/alert-dialog": "0.1.27",
- "@gluestack-ui/avatar": "0.1.15",
- "@gluestack-ui/button": "1.0.3",
- "@gluestack-ui/checkbox": "0.1.26",
+ "@gluestack-ui/accordion": "1.0.4",
+ "@gluestack-ui/actionsheet": "0.2.41",
+ "@gluestack-ui/alert": "0.1.13",
+ "@gluestack-ui/alert-dialog": "0.1.28",
+ "@gluestack-ui/avatar": "0.1.16",
+ "@gluestack-ui/button": "1.0.4",
+ "@gluestack-ui/checkbox": "0.1.27",
"@gluestack-ui/divider": "0.1.8",
"@gluestack-ui/fab": "0.1.20",
- "@gluestack-ui/form-control": "0.1.16",
+ "@gluestack-ui/form-control": "0.1.17",
"@gluestack-ui/icon": "0.1.20",
"@gluestack-ui/image": "0.1.9",
- "@gluestack-ui/input": "0.1.27",
- "@gluestack-ui/link": "0.1.19",
- "@gluestack-ui/menu": "0.2.32",
+ "@gluestack-ui/input": "0.1.28",
+ "@gluestack-ui/link": "0.1.20",
+ "@gluestack-ui/menu": "0.2.33",
"@gluestack-ui/modal": "0.1.31",
"@gluestack-ui/overlay": "0.1.14",
"@gluestack-ui/popover": "0.1.34",
"@gluestack-ui/pressable": "0.1.16",
- "@gluestack-ui/progress": "0.1.13",
+ "@gluestack-ui/progress": "0.1.14",
"@gluestack-ui/provider": "0.1.12",
- "@gluestack-ui/radio": "0.1.27",
+ "@gluestack-ui/radio": "0.1.28",
"@gluestack-ui/select": "0.1.25",
"@gluestack-ui/slider": "0.1.23",
"@gluestack-ui/spinner": "0.1.14",
"@gluestack-ui/switch": "0.1.21",
"@gluestack-ui/tabs": "0.1.16",
- "@gluestack-ui/textarea": "0.1.20",
- "@gluestack-ui/themed": "1.1.17",
+ "@gluestack-ui/textarea": "0.1.21",
+ "@gluestack-ui/themed": "1.1.19",
"@gluestack-ui/toast": "1.0.4",
- "@gluestack-ui/tooltip": "0.1.29",
+ "@gluestack-ui/tooltip": "0.1.30",
"@legendapp/motion": "latest"
},
"peerDependencies": {
"@gluestack-style/react": ">=1.0",
- "@gluestack-ui/themed": ">=1.1.17"
+ "@gluestack-ui/themed": ">=1.1.19"
},
"release-it": {
"git": {
diff --git a/packages/nativewind/utils/context/index.d.ts b/packages/nativewind/utils/context/index.d.ts
index 2416ea120c..6a8942739c 100644
--- a/packages/nativewind/utils/context/index.d.ts
+++ b/packages/nativewind/utils/context/index.d.ts
@@ -1,3 +1,3 @@
///
export declare const ParentContext: import('react').Context<{}>;
-export declare const useStyleContext: () => any;
+export declare const useParentContext: () => any;
diff --git a/packages/nativewind/utils/context/index.js b/packages/nativewind/utils/context/index.js
index 65b06ca90e..b0693066f2 100644
--- a/packages/nativewind/utils/context/index.js
+++ b/packages/nativewind/utils/context/index.js
@@ -1,6 +1,6 @@
'use client';
import { createContext, useContext } from 'react';
export const ParentContext = createContext({});
-export const useStyleContext = () => {
+export const useParentContext = () => {
return useContext(ParentContext);
};
diff --git a/packages/nativewind/utils/context/index.ts b/packages/nativewind/utils/context/index.ts
index e4ff2de092..4151e67131 100644
--- a/packages/nativewind/utils/context/index.ts
+++ b/packages/nativewind/utils/context/index.ts
@@ -2,6 +2,6 @@
import { createContext, useContext } from 'react';
export const ParentContext = createContext({});
-export const useStyleContext = () => {
+export const useParentContext = () => {
return useContext(ParentContext) as any;
};
diff --git a/packages/nativewind/utils/package.json b/packages/nativewind/utils/package.json
index 62288eb823..5c775f8c8a 100644
--- a/packages/nativewind/utils/package.json
+++ b/packages/nativewind/utils/package.json
@@ -17,12 +17,13 @@
"main": "index.js",
"module": "index.js",
"types": "index.d.ts",
- "version": "1.0.2",
+ "version": "1.0.4",
"react-native": "src/index",
"source": "src/index",
"scripts": {
"prepare": "tsc",
"build": "tsc",
+ "remove": "rm -rf ../../../node_modules/react-native-css-interop",
"clean": "rm -rf lib",
"dev:web": "cd example/native && yarn web --clear",
"storybook": "cd example/native/storybook && yarn web"
diff --git a/packages/nativewind/utils/withStates/index.d.ts b/packages/nativewind/utils/withStates/index.d.ts
index 6f5812c966..fa6ef0b1f1 100644
--- a/packages/nativewind/utils/withStates/index.d.ts
+++ b/packages/nativewind/utils/withStates/index.d.ts
@@ -1,5 +1,4 @@
import React from 'react';
-export { useStyleContext } from '../context';
type WithStatesProps = {
className?: string;
states?: any;
@@ -9,3 +8,4 @@ export declare const withStates: (
) => React.ForwardRefExoticComponent<
React.PropsWithoutRef & React.RefAttributes
>;
+export {};
diff --git a/packages/nativewind/utils/withStates/index.js b/packages/nativewind/utils/withStates/index.js
index a7970d534f..3bde0c0e65 100644
--- a/packages/nativewind/utils/withStates/index.js
+++ b/packages/nativewind/utils/withStates/index.js
@@ -1,12 +1,11 @@
'use client';
import React from 'react';
import { extractDataClassName } from '../utils';
-export { useStyleContext } from '../context';
export const withStates = (Component) =>
React.forwardRef(({ states, className, ...props }, ref) => {
const classNamesFinal = React.useMemo(() => {
if (!className) return;
- extractDataClassName(className, states);
+ return extractDataClassName(className, states);
}, [className, states]);
return React.createElement(Component, {
className: classNamesFinal,
diff --git a/packages/nativewind/utils/withStates/index.tsx b/packages/nativewind/utils/withStates/index.tsx
index 7d3ead0bc2..983336ff12 100644
--- a/packages/nativewind/utils/withStates/index.tsx
+++ b/packages/nativewind/utils/withStates/index.tsx
@@ -1,7 +1,7 @@
'use client';
import React from 'react';
import { extractDataClassName } from '../utils';
-export { useStyleContext } from '../context';
+
type WithStatesProps = {
className?: string;
states?: any;
@@ -12,7 +12,7 @@ export const withStates = (Component: React.ComponentType) =>
({ states, className, ...props }: T & WithStatesProps, ref?: any) => {
const classNamesFinal = React.useMemo(() => {
if (!className) return;
- extractDataClassName(className, states);
+ return extractDataClassName(className, states);
}, [className, states]);
return (
diff --git a/packages/nativewind/utils/withStyleContext/index.d.ts b/packages/nativewind/utils/withStyleContext/index.d.ts
index e2ea322ab3..423f69f70e 100644
--- a/packages/nativewind/utils/withStyleContext/index.d.ts
+++ b/packages/nativewind/utils/withStyleContext/index.d.ts
@@ -1,11 +1,13 @@
import React from 'react';
-export { useStyleContext } from '../context';
type WithStyleContextProps = {
context?: any;
};
export declare const withStyleContext: (
- Component: React.ComponentType
+ Component: React.ComponentType,
+ scope?: string
) => React.ForwardRefExoticComponent<
React.PropsWithoutRef &
React.RefAttributes
>;
+export declare const useStyleContext: (scope?: string) => any;
+export {};
diff --git a/packages/nativewind/utils/withStyleContext/index.js b/packages/nativewind/utils/withStyleContext/index.js
index 0b6b9b6b06..986a4e50e6 100644
--- a/packages/nativewind/utils/withStyleContext/index.js
+++ b/packages/nativewind/utils/withStyleContext/index.js
@@ -1,13 +1,25 @@
'use client';
import React from 'react';
import { ParentContext } from '../context';
-export { useStyleContext } from '../context';
-export const withStyleContext = (Component) => {
+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: context },
+ { 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.tsx b/packages/nativewind/utils/withStyleContext/index.tsx
index 6f99c63466..ebce0f7a39 100644
--- a/packages/nativewind/utils/withStyleContext/index.tsx
+++ b/packages/nativewind/utils/withStyleContext/index.tsx
@@ -1,21 +1,34 @@
'use client';
import React from 'react';
import { ParentContext } from '../context';
-export { useStyleContext } from '../context';
-
+import { useParentContext } from '../context';
type WithStyleContextProps = {
context?: any;
};
export const withStyleContext = (
- Component: React.ComponentType
+ Component: React.ComponentType,
+ scope: string = 'Global'
) => {
return React.forwardRef(
({ context, ...props }: T & WithStyleContextProps, ref?: any) => {
+ let contextValues = {};
+ const parentContextValues = useParentContext();
+ if (parentContextValues[scope] !== undefined) {
+ parentContextValues[scope] = context;
+ contextValues = parentContextValues;
+ } else {
+ contextValues = { ...parentContextValues, [scope]: context };
+ }
return (
-
+
);
}
);
};
+
+export const useStyleContext = (scope: string = 'Global') => {
+ const parentContextValues = useParentContext();
+ return parentContextValues[scope];
+};
diff --git a/packages/nativewind/utils/withStyleContextAndStates/index.d.ts b/packages/nativewind/utils/withStyleContextAndStates/index.d.ts
index 57aa5a2a7d..fc48d865f3 100644
--- a/packages/nativewind/utils/withStyleContextAndStates/index.d.ts
+++ b/packages/nativewind/utils/withStyleContextAndStates/index.d.ts
@@ -1,13 +1,15 @@
import React from 'react';
-export { useStyleContext } from '../context';
type WithStyleContextProps = {
context?: any;
className?: string;
states?: any;
};
export declare const withStyleContextAndStates: (
- Component: React.ComponentType
+ Component: React.ComponentType,
+ scope?: string
) => React.ForwardRefExoticComponent<
React.PropsWithoutRef &
React.RefAttributes
>;
+export declare const useStyleContext: (scope?: string) => any;
+export {};
diff --git a/packages/nativewind/utils/withStyleContextAndStates/index.js b/packages/nativewind/utils/withStyleContextAndStates/index.js
index 6acde5282f..127c0c9536 100644
--- a/packages/nativewind/utils/withStyleContextAndStates/index.js
+++ b/packages/nativewind/utils/withStyleContextAndStates/index.js
@@ -2,16 +2,24 @@
import React from 'react';
import { extractDataClassName } from '../utils';
import { ParentContext } from '../context';
-export { useStyleContext } from '../context';
-export const withStyleContextAndStates = (Component) => {
+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: context },
+ { value: contextValues },
React.createElement(Component, {
className: classNamesFinal,
...props,
@@ -20,3 +28,7 @@ export const withStyleContextAndStates = (Component) => {
);
});
};
+export const useStyleContext = (scope = 'Global') => {
+ const parentContextValues = useParentContext();
+ return parentContextValues[scope];
+};
diff --git a/packages/nativewind/utils/withStyleContextAndStates/index.tsx b/packages/nativewind/utils/withStyleContextAndStates/index.tsx
index 91838c64d5..9e0a136811 100644
--- a/packages/nativewind/utils/withStyleContextAndStates/index.tsx
+++ b/packages/nativewind/utils/withStyleContextAndStates/index.tsx
@@ -2,7 +2,7 @@
import React from 'react';
import { extractDataClassName } from '../utils';
import { ParentContext } from '../context';
-export { useStyleContext } from '../context';
+import { useParentContext } from '../context';
type WithStyleContextProps = {
context?: any;
@@ -11,19 +11,30 @@ type WithStyleContextProps = {
};
export const withStyleContextAndStates = (
- Component: React.ComponentType
+ Component: React.ComponentType,
+ scope: string = 'Global'
) => {
return React.forwardRef(
(
{ context, className, states, ...props }: T & WithStyleContextProps,
ref?: any
) => {
+ 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: string = 'Global') => {
+ const parentContextValues = useParentContext();
+ return parentContextValues[scope];
+};
diff --git a/packages/themed/CHANGELOG.md b/packages/themed/CHANGELOG.md
index 45f6c69c22..76ebfbb318 100644
--- a/packages/themed/CHANGELOG.md
+++ b/packages/themed/CHANGELOG.md
@@ -1,5 +1,26 @@
# @gluestack-ui/themed
+## 1.1.19
+
+### Patch Changes
+
+- Updated dependencies
+ - @gluestack-ui/alert-dialog@0.1.28
+ - @gluestack-ui/form-control@0.1.17
+ - @gluestack-ui/actionsheet@0.2.41
+ - @gluestack-ui/accordion@1.0.4
+ - @gluestack-ui/checkbox@0.1.27
+ - @gluestack-ui/progress@0.1.14
+ - @gluestack-ui/textarea@0.1.21
+ - @gluestack-ui/tooltip@0.1.30
+ - @gluestack-ui/avatar@0.1.16
+ - @gluestack-ui/button@1.0.4
+ - @gluestack-ui/alert@0.1.13
+ - @gluestack-ui/input@0.1.28
+ - @gluestack-ui/radio@0.1.28
+ - @gluestack-ui/link@0.1.20
+ - @gluestack-ui/menu@0.2.33
+
## 1.1.17
### Patch Changes
diff --git a/packages/themed/package.json b/packages/themed/package.json
index 1d466333ac..6ca3276fd8 100644
--- a/packages/themed/package.json
+++ b/packages/themed/package.json
@@ -1,6 +1,6 @@
{
"name": "@gluestack-ui/themed",
- "version": "1.1.18",
+ "version": "1.1.19",
"main": "build/index.js",
"types": "build/index.d.ts",
"module": "build/index",
@@ -37,36 +37,36 @@
"@expo/html-elements": "latest",
"@gluestack-style/animation-resolver": "1.0.4",
"@gluestack-style/legend-motion-animation-driver": "1.0.3",
- "@gluestack-ui/accordion": "1.0.3",
- "@gluestack-ui/actionsheet": "0.2.40",
- "@gluestack-ui/alert": "0.1.12",
- "@gluestack-ui/alert-dialog": "0.1.27",
- "@gluestack-ui/avatar": "0.1.15",
- "@gluestack-ui/button": "1.0.3",
- "@gluestack-ui/checkbox": "0.1.26",
+ "@gluestack-ui/accordion": "1.0.4",
+ "@gluestack-ui/actionsheet": "0.2.41",
+ "@gluestack-ui/alert": "0.1.13",
+ "@gluestack-ui/alert-dialog": "0.1.28",
+ "@gluestack-ui/avatar": "0.1.16",
+ "@gluestack-ui/button": "1.0.4",
+ "@gluestack-ui/checkbox": "0.1.27",
"@gluestack-ui/divider": "0.1.8",
"@gluestack-ui/fab": "0.1.20",
- "@gluestack-ui/form-control": "0.1.16",
+ "@gluestack-ui/form-control": "0.1.17",
"@gluestack-ui/icon": "0.1.20",
"@gluestack-ui/image": "0.1.9",
- "@gluestack-ui/input": "0.1.27",
- "@gluestack-ui/link": "0.1.19",
- "@gluestack-ui/menu": "0.2.32",
+ "@gluestack-ui/input": "0.1.28",
+ "@gluestack-ui/link": "0.1.20",
+ "@gluestack-ui/menu": "0.2.33",
"@gluestack-ui/modal": "0.1.31",
"@gluestack-ui/overlay": "0.1.14",
"@gluestack-ui/popover": "0.1.34",
"@gluestack-ui/pressable": "0.1.16",
- "@gluestack-ui/progress": "0.1.13",
+ "@gluestack-ui/progress": "0.1.14",
"@gluestack-ui/provider": "0.1.12",
- "@gluestack-ui/radio": "0.1.27",
+ "@gluestack-ui/radio": "0.1.28",
"@gluestack-ui/select": "0.1.25",
"@gluestack-ui/slider": "0.1.23",
"@gluestack-ui/spinner": "0.1.14",
"@gluestack-ui/switch": "0.1.21",
"@gluestack-ui/tabs": "0.1.16",
- "@gluestack-ui/textarea": "0.1.20",
+ "@gluestack-ui/textarea": "0.1.21",
"@gluestack-ui/toast": "1.0.4",
- "@gluestack-ui/tooltip": "0.1.29",
+ "@gluestack-ui/tooltip": "0.1.30",
"@legendapp/motion": "latest"
},
"devDependencies": {
diff --git a/packages/themed/src/components/Image/styled-components/Root.tsx b/packages/themed/src/components/Image/styled-components/Root.tsx
index 0f9aa86bec..faaafa3d57 100644
--- a/packages/themed/src/components/Image/styled-components/Root.tsx
+++ b/packages/themed/src/components/Image/styled-components/Root.tsx
@@ -1,6 +1,16 @@
import { Image } from 'react-native';
import { styled } from '@gluestack-style/react';
-export default styled(Image, {}, {
- componentName: 'Image',
-} as const);
+export default styled(
+ Image,
+ {},
+ {
+ componentName: 'Image',
+ resolveProps: ['tintColor'],
+ } as const,
+ {
+ propertyTokenMap: {
+ tintColor: 'colors',
+ },
+ }
+);
diff --git a/packages/unstyled/accordion/CHANGELOG.md b/packages/unstyled/accordion/CHANGELOG.md
index ad8242ec87..351ae119fe 100644
--- a/packages/unstyled/accordion/CHANGELOG.md
+++ b/packages/unstyled/accordion/CHANGELOG.md
@@ -1,5 +1,11 @@
# @gluestack-ui/accordion
+## 1.0.4
+
+### Patch Changes
+
+- fix: ref typing issue
+
## 1.0.3
### Patch Changes
diff --git a/packages/unstyled/accordion/package.json b/packages/unstyled/accordion/package.json
index cb46b1191d..d6b822b753 100644
--- a/packages/unstyled/accordion/package.json
+++ b/packages/unstyled/accordion/package.json
@@ -15,7 +15,7 @@
"ios",
"nextjs"
],
- "version": "1.0.3",
+ "version": "1.0.4",
"main": "lib/commonjs/index",
"module": "lib/module/index",
"types": "lib/typescript/index.d.ts",
diff --git a/packages/unstyled/accordion/src/types.ts b/packages/unstyled/accordion/src/types.ts
index 6956bd9223..60a7333fb2 100644
--- a/packages/unstyled/accordion/src/types.ts
+++ b/packages/unstyled/accordion/src/types.ts
@@ -90,14 +90,28 @@ export type IAccordionComponentType<
IconProps,
TitleTextProps,
ContentTextProps
-> = React.ForwardRefExoticComponent & {
- Item: React.ForwardRefExoticComponent;
- Header: React.ForwardRefExoticComponent;
+> = React.ForwardRefExoticComponent<
+ AccordionProps & React.RefAttributes & IAccordionProps
+> & {
+ Item: React.ForwardRefExoticComponent<
+ ItemProps & React.RefAttributes & IAccordionItemProps
+ >;
+ Header: React.ForwardRefExoticComponent<
+ HeaderProps & React.RefAttributes
+ >;
Trigger: React.ForwardRefExoticComponent<
Omit & IAccordionTriggerProps
>;
- Content: React.ForwardRefExoticComponent;
- TitleText: React.ForwardRefExoticComponent;
- ContentText: React.ForwardRefExoticComponent;
- Icon: React.ForwardRefExoticComponent;
+ Content: React.ForwardRefExoticComponent<
+ ContentProps & React.RefAttributes
+ >;
+ TitleText: React.ForwardRefExoticComponent<
+ TitleTextProps & React.RefAttributes
+ >;
+ ContentText: React.ForwardRefExoticComponent<
+ ContentTextProps & React.RefAttributes
+ >;
+ Icon: React.ForwardRefExoticComponent<
+ IconProps & React.RefAttributes
+ >;
};
diff --git a/packages/unstyled/actionsheet/CHANGELOG.md b/packages/unstyled/actionsheet/CHANGELOG.md
index 56be37c4f4..a52f21e665 100644
--- a/packages/unstyled/actionsheet/CHANGELOG.md
+++ b/packages/unstyled/actionsheet/CHANGELOG.md
@@ -1,5 +1,11 @@
# @gluestack-ui/actionsheet
+## 0.2.41
+
+### Patch Changes
+
+- fix: ref typing issue
+
## 0.2.40
### Patch Changes
diff --git a/packages/unstyled/actionsheet/package.json b/packages/unstyled/actionsheet/package.json
index fa1841ed30..6fcb209a89 100644
--- a/packages/unstyled/actionsheet/package.json
+++ b/packages/unstyled/actionsheet/package.json
@@ -15,7 +15,7 @@
"ios",
"nextjs"
],
- "version": "0.2.40",
+ "version": "0.2.41",
"main": "lib/commonjs/index",
"module": "lib/module/index",
"types": "lib/typescript/index.d.ts",
diff --git a/packages/unstyled/actionsheet/src/types.ts b/packages/unstyled/actionsheet/src/types.ts
index 09f3e0c36b..06f7dd1378 100644
--- a/packages/unstyled/actionsheet/src/types.ts
+++ b/packages/unstyled/actionsheet/src/types.ts
@@ -60,23 +60,47 @@ export type IActionsheetComponentType<
SectionListProps,
SectionHeaderTextProps,
IconProps
-> = React.ForwardRefExoticComponent & {
+> = React.ForwardRefExoticComponent<
+ ActionsheetProps & React.RefAttributes & IActionsheetProps
+> & {
Content: React.ForwardRefExoticComponent<
- ContentProps & InterfaceActionsheetContentProps
+ ContentProps &
+ React.RefAttributes &
+ InterfaceActionsheetContentProps
>;
Item: React.ForwardRefExoticComponent<
- ItemProps & InterfaceActionsheetItemProps
+ ItemProps & InterfaceActionsheetItemProps & React.RefAttributes
+ >;
+ ItemText: React.ForwardRefExoticComponent<
+ React.RefAttributes & ItemTextProps
+ >;
+ DragIndicator: React.ForwardRefExoticComponent<
+ React.RefAttributes & DragIndicatorProps
+ >;
+ Backdrop: React.ForwardRefExoticComponent<
+ React.RefAttributes & BackdropProps
+ >;
+ DragIndicatorWrapper: React.ForwardRefExoticComponent<
+ React.RefAttributes & IndicatorWrapperProps
+ >;
+ ScrollView: React.ForwardRefExoticComponent<
+ React.RefAttributes & ScrollViewProps
+ >;
+ VirtualizedList: React.ForwardRefExoticComponent<
+ React.RefAttributes & VirtualizedListProps
+ >;
+ FlatList: React.ForwardRefExoticComponent<
+ React.RefAttributes & FlatListProps
+ >;
+ SectionList: React.ForwardRefExoticComponent<
+ React.RefAttributes & SectionListProps
+ >;
+ SectionHeaderText: React.ForwardRefExoticComponent<
+ React.RefAttributes & SectionHeaderTextProps
+ >;
+ Icon: React.ForwardRefExoticComponent<
+ React.RefAttributes & IconProps
>;
- ItemText: React.ForwardRefExoticComponent;
- DragIndicator: React.ForwardRefExoticComponent;
- Backdrop: React.ForwardRefExoticComponent;
- DragIndicatorWrapper: React.ForwardRefExoticComponent;
- ScrollView: React.ForwardRefExoticComponent;
- VirtualizedList: React.ForwardRefExoticComponent;
- FlatList: React.ForwardRefExoticComponent;
- SectionList: React.ForwardRefExoticComponent;
- SectionHeaderText: React.ForwardRefExoticComponent;
- Icon: React.ForwardRefExoticComponent;
};
export type IActionsheetProps = InterfaceActionsheetProps;
diff --git a/packages/unstyled/alert-dialog/CHANGELOG.md b/packages/unstyled/alert-dialog/CHANGELOG.md
index b4b79e179e..315e317bf2 100644
--- a/packages/unstyled/alert-dialog/CHANGELOG.md
+++ b/packages/unstyled/alert-dialog/CHANGELOG.md
@@ -1,5 +1,11 @@
# @gluestack-ui/alert-dialog
+## 0.1.28
+
+### Patch Changes
+
+- fix: ref typing issue
+
## 0.1.27
### Patch Changes
diff --git a/packages/unstyled/alert-dialog/package.json b/packages/unstyled/alert-dialog/package.json
index 9fc9813053..c22c85f855 100644
--- a/packages/unstyled/alert-dialog/package.json
+++ b/packages/unstyled/alert-dialog/package.json
@@ -15,7 +15,7 @@
"ios",
"nextjs"
],
- "version": "0.1.27",
+ "version": "0.1.28",
"main": "lib/commonjs/index",
"module": "lib/module/index",
"types": "lib/typescript/index.d.ts",
diff --git a/packages/unstyled/alert-dialog/src/types.ts b/packages/unstyled/alert-dialog/src/types.ts
index 2211df5065..4eb676508d 100644
--- a/packages/unstyled/alert-dialog/src/types.ts
+++ b/packages/unstyled/alert-dialog/src/types.ts
@@ -58,13 +58,28 @@ export type IAlertDialogComponentType<
StyledAlertDialogFooter,
StyledAlertDialogBody,
StyledAlertDialogBackdrop
-> = React.ForwardRefExoticComponent & {
- Content: React.ForwardRefExoticComponent;
- CloseButton: React.ForwardRefExoticComponent;
- Header: React.ForwardRefExoticComponent;
- Footer: React.ForwardRefExoticComponent;
- Body: React.ForwardRefExoticComponent;
- Backdrop: React.ForwardRefExoticComponent;
+> = React.ForwardRefExoticComponent<
+ React.RefAttributes & StyledAlertDialog & IAlertDialogProps
+> & {
+ Content: React.ForwardRefExoticComponent<
+ React.RefAttributes & StyledAlertDialogContent
+ >;
+ CloseButton: React.ForwardRefExoticComponent<
+ React.RefAttributes &
+ StyledAlertDialogCloseButton
+ >;
+ Header: React.ForwardRefExoticComponent<
+ React.RefAttributes & StyledAlertDialogHeader
+ >;
+ Footer: React.ForwardRefExoticComponent<
+ React.RefAttributes & StyledAlertDialogFooter
+ >;
+ Body: React.ForwardRefExoticComponent<
+ React.RefAttributes & StyledAlertDialogBody
+ >;
+ Backdrop: React.ForwardRefExoticComponent<
+ React.RefAttributes & StyledAlertDialogBackdrop
+ >;
};
export type IAlertDialogProps = InterfaceAlertDialogProps;
diff --git a/packages/unstyled/alert/CHANGELOG.md b/packages/unstyled/alert/CHANGELOG.md
index c1cd42645b..4aec899666 100644
--- a/packages/unstyled/alert/CHANGELOG.md
+++ b/packages/unstyled/alert/CHANGELOG.md
@@ -1,5 +1,11 @@
# @gluestack-ui/alert
+## 0.1.13
+
+### Patch Changes
+
+- fix: ref typing issue
+
## 0.1.8
### Patch Changes
diff --git a/packages/unstyled/alert/package.json b/packages/unstyled/alert/package.json
index a965bccb6d..3f706e9cb3 100644
--- a/packages/unstyled/alert/package.json
+++ b/packages/unstyled/alert/package.json
@@ -1,6 +1,6 @@
{
"name": "@gluestack-ui/alert",
- "version": "0.1.12",
+ "version": "0.1.13",
"main": "lib/commonjs/index",
"module": "lib/module/index",
"types": "lib/typescript/index.d.ts",
diff --git a/packages/unstyled/alert/src/types.ts b/packages/unstyled/alert/src/types.ts
index 724b10b652..3dda080817 100644
--- a/packages/unstyled/alert/src/types.ts
+++ b/packages/unstyled/alert/src/types.ts
@@ -5,9 +5,15 @@ export interface InterfaceAlertProps extends ViewProps {
}
export type IAlertComponentType =
- React.ForwardRefExoticComponent & {
- Text: React.ForwardRefExoticComponent;
- Icon: React.ForwardRefExoticComponent;
+ React.ForwardRefExoticComponent<
+ React.RefAttributes & StyledAlert & InterfaceAlertProps
+ > & {
+ Text: React.ForwardRefExoticComponent<
+ React.RefAttributes
+ >;
+ Icon: React.ForwardRefExoticComponent<
+ React.RefAttributes & StyledAlertIcon
+ >;
};
export type IAlertProps = InterfaceAlertProps;
diff --git a/packages/unstyled/avatar/CHANGELOG.md b/packages/unstyled/avatar/CHANGELOG.md
index 9b5791d301..959c762ebb 100644
--- a/packages/unstyled/avatar/CHANGELOG.md
+++ b/packages/unstyled/avatar/CHANGELOG.md
@@ -1,5 +1,11 @@
# @gluestack-ui/avatar
+## 0.1.16
+
+### Patch Changes
+
+- fix: ref typing issue
+
## 0.1.10
### Patch Changes
diff --git a/packages/unstyled/avatar/package.json b/packages/unstyled/avatar/package.json
index 8cefa0fef3..560d43c546 100644
--- a/packages/unstyled/avatar/package.json
+++ b/packages/unstyled/avatar/package.json
@@ -1,7 +1,7 @@
{
"name": "@gluestack-ui/avatar",
"description": "A universal headless avatar component for React Native, Next.js & React",
- "version": "0.1.15",
+ "version": "0.1.16",
"main": "lib/commonjs/index",
"module": "lib/module/index",
"types": "lib/typescript/index.d.ts",
diff --git a/packages/unstyled/avatar/src/types.ts b/packages/unstyled/avatar/src/types.ts
index 44ef9cc55b..396f3a5798 100644
--- a/packages/unstyled/avatar/src/types.ts
+++ b/packages/unstyled/avatar/src/types.ts
@@ -14,11 +14,21 @@ export type IAvatarComponentType<
GroupProps,
ImageProps,
FallbackTextProps
-> = React.ForwardRefExoticComponent & {
- Badge: React.ForwardRefExoticComponent;
- Group: React.ForwardRefExoticComponent;
- Image: React.ForwardRefExoticComponent;
- FallbackText: React.ForwardRefExoticComponent;
+> = React.ForwardRefExoticComponent<
+ IAvatarProps & AvatarProps & React.RefAttributes
+> & {
+ Badge: React.ForwardRefExoticComponent<
+ BadgeProps & React.RefAttributes
+ >;
+ Group: React.ForwardRefExoticComponent<
+ GroupProps & React.RefAttributes & IAvatarGroupProps
+ >;
+ Image: React.ForwardRefExoticComponent<
+ ImageProps & React.RefAttributes
+ >;
+ FallbackText: React.ForwardRefExoticComponent<
+ FallbackTextProps & React.RefAttributes
+ >;
};
export type IAvatarProps = InterfaceAvatarProps;
diff --git a/packages/unstyled/button/CHANGELOG.md b/packages/unstyled/button/CHANGELOG.md
index 5a370544ba..69af7a2193 100644
--- a/packages/unstyled/button/CHANGELOG.md
+++ b/packages/unstyled/button/CHANGELOG.md
@@ -1,5 +1,11 @@
# @gluestack-ui/button
+## 1.0.4
+
+### Patch Changes
+
+- fix: ref typing issue
+
## 1.0.3
### Patch Changes
diff --git a/packages/unstyled/button/package.json b/packages/unstyled/button/package.json
index 5a2d4c483e..d0bec96c22 100644
--- a/packages/unstyled/button/package.json
+++ b/packages/unstyled/button/package.json
@@ -1,6 +1,6 @@
{
"name": "@gluestack-ui/button",
- "version": "1.0.3",
+ "version": "1.0.4",
"main": "lib/commonjs/index",
"module": "lib/module/index",
"types": "lib/typescript/index.d.ts",
diff --git a/packages/unstyled/button/src/types.ts b/packages/unstyled/button/src/types.ts
index bce3a5b035..13f07dfe3d 100644
--- a/packages/unstyled/button/src/types.ts
+++ b/packages/unstyled/button/src/types.ts
@@ -52,11 +52,21 @@ export type IButtonComponentType<
SpinnerProps,
TextProps,
IconProps
-> = React.ForwardRefExoticComponent & {
- Group: React.ForwardRefExoticComponent;
- Spinner: React.ForwardRefExoticComponent;
- Text: React.ForwardRefExoticComponent;
- Icon: React.ForwardRefExoticComponent;
+> = React.ForwardRefExoticComponent<
+ React.RefAttributes & ButtonProps & IButtonProps
+> & {
+ Group: React.ForwardRefExoticComponent<
+ React.RefAttributes & GroupProps & IButtonGroupProps
+ >;
+ Spinner: React.ForwardRefExoticComponent<
+ SpinnerProps & React.RefAttributes
+ >;
+ Text: React.ForwardRefExoticComponent<
+ React.RefAttributes & TextProps
+ >;
+ Icon: React.ForwardRefExoticComponent<
+ React.RefAttributes & IconProps
+ >;
};
export type IButtonProps = InterfaceButtonProps;
diff --git a/packages/unstyled/checkbox/CHANGELOG.md b/packages/unstyled/checkbox/CHANGELOG.md
index 0ea1331c12..6c41cb60c5 100644
--- a/packages/unstyled/checkbox/CHANGELOG.md
+++ b/packages/unstyled/checkbox/CHANGELOG.md
@@ -1,5 +1,13 @@
# @gluestack-ui/checkbox
+## 0.1.27
+
+### Patch Changes
+
+- fix: ref typing issue
+- Updated dependencies
+ - @gluestack-ui/form-control@0.1.17
+
## 0.1.26
### Patch Changes
diff --git a/packages/unstyled/checkbox/package.json b/packages/unstyled/checkbox/package.json
index ea6b6476a6..9e754f0f7f 100644
--- a/packages/unstyled/checkbox/package.json
+++ b/packages/unstyled/checkbox/package.json
@@ -1,6 +1,6 @@
{
"name": "@gluestack-ui/checkbox",
- "version": "0.1.26",
+ "version": "0.1.27",
"main": "lib/commonjs/index",
"module": "lib/module/index",
"types": "lib/typescript/index.d.ts",
@@ -43,7 +43,7 @@
"typescript": "^4.7.4"
},
"dependencies": {
- "@gluestack-ui/form-control": "^0.1.16",
+ "@gluestack-ui/form-control": "^0.1.17",
"@gluestack-ui/utils": "^0.1.12",
"@react-aria/visually-hidden": "^3.8.6",
"@react-native-aria/checkbox": "^0.2.9",
diff --git a/packages/unstyled/checkbox/src/types.ts b/packages/unstyled/checkbox/src/types.ts
index 98cd63b7f6..c97e4eec82 100644
--- a/packages/unstyled/checkbox/src/types.ts
+++ b/packages/unstyled/checkbox/src/types.ts
@@ -24,11 +24,17 @@ export interface ICheckboxGroup {
}
export type ICheckboxComponentType =
- React.ForwardRefExoticComponent & {
- Indicator: React.ForwardRefExoticComponent;
- Icon: React.ForwardRefExoticComponent;
- Label: React.ForwardRefExoticComponent;
- Group: React.ForwardRefExoticComponent;
+ React.ForwardRefExoticComponent<
+ React.RefAttributes & Root & InterfaceCheckbox
+ > & {
+ Indicator: React.ForwardRefExoticComponent<
+ React.RefAttributes & Indicator
+ >;
+ Icon: React.ForwardRefExoticComponent & Icon>;
+ Label: React.ForwardRefExoticComponent & Label>;
+ Group: React.ForwardRefExoticComponent<
+ React.RefAttributes & Group & ICheckboxGroup
+ >;
};
export type ICheckboxProps = InterfaceCheckbox;
diff --git a/packages/unstyled/form-control/CHANGELOG.md b/packages/unstyled/form-control/CHANGELOG.md
index 1d51665de3..312ec510c9 100644
--- a/packages/unstyled/form-control/CHANGELOG.md
+++ b/packages/unstyled/form-control/CHANGELOG.md
@@ -1,5 +1,11 @@
# @gluestack-ui/form-control
+## 0.1.17
+
+### Patch Changes
+
+- fix: ref typing issue
+
## 0.1.16
### Patch Changes
diff --git a/packages/unstyled/form-control/package.json b/packages/unstyled/form-control/package.json
index 9b4344ac18..87eb6387b4 100644
--- a/packages/unstyled/form-control/package.json
+++ b/packages/unstyled/form-control/package.json
@@ -1,7 +1,7 @@
{
"name": "@gluestack-ui/form-control",
"description": "A universal headless form-control component for React Native, Next.js & React",
- "version": "0.1.16",
+ "version": "0.1.17",
"main": "lib/commonjs/index",
"module": "lib/module/index",
"types": "lib/typescript/index.d.ts",
diff --git a/packages/unstyled/input/CHANGELOG.md b/packages/unstyled/input/CHANGELOG.md
index 52c4ce3eb0..84f9e2da36 100644
--- a/packages/unstyled/input/CHANGELOG.md
+++ b/packages/unstyled/input/CHANGELOG.md
@@ -1,5 +1,13 @@
# @gluestack-ui/input
+## 0.1.28
+
+### Patch Changes
+
+- fix: ref typing issue
+- Updated dependencies
+ - @gluestack-ui/form-control@0.1.17
+
## 0.1.27
### Patch Changes
diff --git a/packages/unstyled/input/package.json b/packages/unstyled/input/package.json
index fc3f2411db..d5d9baed03 100644
--- a/packages/unstyled/input/package.json
+++ b/packages/unstyled/input/package.json
@@ -1,7 +1,7 @@
{
"name": "@gluestack-ui/input",
"description": "A universal headless input component for React Native, Next.js & React",
- "version": "0.1.27",
+ "version": "0.1.28",
"main": "lib/commonjs/index",
"module": "lib/module/index",
"types": "lib/typescript/index.d.ts",
@@ -29,7 +29,7 @@
"typescript": "^4.9.4"
},
"dependencies": {
- "@gluestack-ui/form-control": "^0.1.16",
+ "@gluestack-ui/form-control": "^0.1.17",
"@gluestack-ui/utils": "^0.1.12",
"@react-native-aria/focus": "^0.2.9",
"@react-native-aria/interactions": "0.2.13"
diff --git a/packages/unstyled/input/src/types.ts b/packages/unstyled/input/src/types.ts
index 02e617995e..950e8aaf97 100644
--- a/packages/unstyled/input/src/types.ts
+++ b/packages/unstyled/input/src/types.ts
@@ -52,10 +52,14 @@ export interface IInputProps {
}
export type IInputComponentType =
- React.ForwardRefExoticComponent & {
- Icon: React.ForwardRefExoticComponent;
- Slot: React.ForwardRefExoticComponent;
- Input: React.ForwardRefExoticComponent ;
+ React.ForwardRefExoticComponent<
+ React.RefAttributes & Root & IInputFieldProps
+ > & {
+ Icon: React.ForwardRefExoticComponent & Icon>;
+ Slot: React.ForwardRefExoticComponent & Slot>;
+ Input: React.ForwardRefExoticComponent<
+ React.RefAttributes & Input & IInputProps
+ >;
};
// export type InputProps = Partial;
diff --git a/packages/unstyled/link/CHANGELOG.md b/packages/unstyled/link/CHANGELOG.md
index b67ef139da..8c07540ec3 100644
--- a/packages/unstyled/link/CHANGELOG.md
+++ b/packages/unstyled/link/CHANGELOG.md
@@ -1,5 +1,11 @@
# @gluestack-ui/link
+## 0.1.20
+
+### Patch Changes
+
+- fix: ref typing issue
+
## 0.1.19
### Patch Changes
diff --git a/packages/unstyled/link/package.json b/packages/unstyled/link/package.json
index 7a62eeec39..2048dbf4ad 100644
--- a/packages/unstyled/link/package.json
+++ b/packages/unstyled/link/package.json
@@ -1,6 +1,6 @@
{
"name": "@gluestack-ui/link",
- "version": "0.1.19",
+ "version": "0.1.20",
"main": "lib/commonjs/index",
"module": "lib/module/index",
"types": "lib/typescript/index.d.ts",
diff --git a/packages/unstyled/link/src/types.ts b/packages/unstyled/link/src/types.ts
index b158069468..b91144442e 100644
--- a/packages/unstyled/link/src/types.ts
+++ b/packages/unstyled/link/src/types.ts
@@ -1,4 +1,5 @@
import type { MutableRefObject } from 'react';
+import React from 'react';
import type { GestureResponderEvent, ViewProps } from 'react-native';
export interface InterfaceLinkProps extends ViewProps {
@@ -29,5 +30,7 @@ export type IUseLinkProp = {
export type ILinkComponentType =
React.ForwardRefExoticComponent & {
- Text: React.ForwardRefExoticComponent;
+ Text: React.ForwardRefExoticComponent<
+ TextProps & React.RefAttributes
+ >;
};
diff --git a/packages/unstyled/menu/CHANGELOG.md b/packages/unstyled/menu/CHANGELOG.md
index 94c4800446..48a15bad50 100644
--- a/packages/unstyled/menu/CHANGELOG.md
+++ b/packages/unstyled/menu/CHANGELOG.md
@@ -1,5 +1,11 @@
# @gluestack-ui/menu
+## 0.2.33
+
+### Patch Changes
+
+- fix: ref typing issue
+
## 0.2.32
### Patch Changes
diff --git a/packages/unstyled/menu/package.json b/packages/unstyled/menu/package.json
index 7796623e57..48bb5b1827 100644
--- a/packages/unstyled/menu/package.json
+++ b/packages/unstyled/menu/package.json
@@ -15,7 +15,7 @@
"ios",
"nextjs"
],
- "version": "0.2.32",
+ "version": "0.2.33",
"main": "lib/commonjs/index",
"module": "lib/module/index",
"types": "lib/typescript/index.d.ts",
diff --git a/packages/unstyled/menu/src/types.ts b/packages/unstyled/menu/src/types.ts
index 36a8915f8d..5c200f070f 100644
--- a/packages/unstyled/menu/src/types.ts
+++ b/packages/unstyled/menu/src/types.ts
@@ -99,7 +99,13 @@ export interface IItemProp {
export type IMenuProps = InterfaceMenuProps;
export type IMenuComponentType =
- React.ForwardRefExoticComponent & {
- Item: React.ForwardRefExoticComponent- & IItemProp>;
- ItemLabel: React.ForwardRefExoticComponent
;
+ React.ForwardRefExoticComponent<
+ React.RefAttributes & Root & IMenuProps
+ > & {
+ Item: React.ForwardRefExoticComponent<
+ React.RefAttributes- & Item & ItemProps
- & IItemProp
+ >;
+ ItemLabel: React.ForwardRefExoticComponent<
+ React.RefAttributes
& Label
+ >;
};
diff --git a/packages/unstyled/progress/CHANGELOG.md b/packages/unstyled/progress/CHANGELOG.md
index ece2c1a3d1..ed207bb25b 100644
--- a/packages/unstyled/progress/CHANGELOG.md
+++ b/packages/unstyled/progress/CHANGELOG.md
@@ -1,5 +1,11 @@
# @gluestack-ui/progress
+## 0.1.14
+
+### Patch Changes
+
+- fix: ref typing issue
+
## 0.1.13
### Patch Changes
diff --git a/packages/unstyled/progress/package.json b/packages/unstyled/progress/package.json
index c918a0ac95..a0d371a561 100644
--- a/packages/unstyled/progress/package.json
+++ b/packages/unstyled/progress/package.json
@@ -15,7 +15,7 @@
"ios",
"nextjs"
],
- "version": "0.1.13",
+ "version": "0.1.14",
"main": "lib/commonjs/index",
"module": "lib/module/index",
"types": "lib/typescript/index.d.ts",
diff --git a/packages/unstyled/progress/src/types.ts b/packages/unstyled/progress/src/types.ts
index 8e1c5ebcf3..214fc3657a 100644
--- a/packages/unstyled/progress/src/types.ts
+++ b/packages/unstyled/progress/src/types.ts
@@ -18,8 +18,12 @@ export interface InterfaceProgressProps {
}
export type IProgressComponentType