diff --git a/README.md b/README.md
index 07842695e3..a8aa9aff31 100644
--- a/README.md
+++ b/README.md
@@ -64,4 +64,4 @@ We welcome contributions to the `gluestack-ui`. If you have an idea for a new co
## License
-Licensed under the MIT License, Copyright © 2023 GeekyAnts. See [LICENSE](https://github.com/gluestack/gluestack-ui/blob/main/LICENSE) for more information.
+Licensed under the MIT License, Copyright © 2024 GeekyAnts. See [LICENSE](https://github.com/gluestack/gluestack-ui/blob/main/LICENSE) for more information.
diff --git a/example/storybook-nativewind/package.json b/example/storybook-nativewind/package.json
index 372f2b6132..38d8d7cbab 100644
--- a/example/storybook-nativewind/package.json
+++ b/example/storybook-nativewind/package.json
@@ -32,7 +32,7 @@
"@gluestack-style/animation-resolver": "^1.0.4",
"@gluestack-style/react": "^1.0.57",
"@gluestack-ui/config": "^1.1.19",
- "@gluestack-ui/themed": "^1.1.51",
+ "@gluestack-ui/themed": "^1.1.54",
"@gluestack/design-system": "^0.5.36",
"@gorhom/bottom-sheet": "^5.0.0-alpha.10",
"@legendapp/motion": "^2.2.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 e3677ac1e5..1c8d737ebe 100644
--- a/example/storybook-nativewind/src/components/Actionsheet/index.nw.stories.mdx
+++ b/example/storybook-nativewind/src/components/Actionsheet/index.nw.stories.mdx
@@ -435,6 +435,24 @@ It inherits all the properties of React Native's [View](https://reactnative.dev/
+
+
+
+ preventScroll
+
+
+
+ boolean
+
+
+ true
+
+
+
+ {`If true, scroll will be prevented when the Actionsheet is open.`}
+
+
+
diff --git a/example/storybook-nativewind/src/components/Badge/index.nw.stories.mdx b/example/storybook-nativewind/src/components/Badge/index.nw.stories.mdx
index 28f8a07abd..2e07217207 100644
--- a/example/storybook-nativewind/src/components/Badge/index.nw.stories.mdx
+++ b/example/storybook-nativewind/src/components/Badge/index.nw.stories.mdx
@@ -92,7 +92,7 @@ This is an illustration of **Badge** component.
action: {
control: 'select',
options: ['error', 'warning', 'success', 'info', 'muted'],
- default: 'success',
+ default: 'muted',
},
},
}}
diff --git a/example/storybook-nativewind/src/components/FormControl/FormControl.stories.tsx b/example/storybook-nativewind/src/components/FormControl/FormControl.stories.tsx
index 77a1bf5a88..7dd82cee61 100644
--- a/example/storybook-nativewind/src/components/FormControl/FormControl.stories.tsx
+++ b/example/storybook-nativewind/src/components/FormControl/FormControl.stories.tsx
@@ -28,8 +28,8 @@ const FormControlMeta: ComponentMeta = {
},
},
args: {
- isInvalid: true,
- isRequired: true,
+ isInvalid: false,
+ isRequired: false,
isDisabled: false,
size: 'md',
},
diff --git a/example/storybook-nativewind/src/components/FormControl/FormControl.tsx b/example/storybook-nativewind/src/components/FormControl/FormControl.tsx
index 9a2616c0e2..3f49d37c10 100644
--- a/example/storybook-nativewind/src/components/FormControl/FormControl.tsx
+++ b/example/storybook-nativewind/src/components/FormControl/FormControl.tsx
@@ -9,36 +9,60 @@ import {
FormControlErrorIcon,
FormControlErrorText,
} from '@/components/ui/form-control';
-import { AlertCircleIcon } from 'lucide-react-native';
+import { AlertCircleIcon } from '@/components/ui/icon';
import { Input, InputField } from '@/components/ui/input';
+import { Button, ButtonText } from '@/components/ui/button';
+import { VStack } from '@/components/ui/vstack';
+
+const FormControlBasic = ({ isInvalid: propsIsInvalid, ...props }: any) => {
+ const [isInvalid, setIsInvalid] = React.useState(propsIsInvalid);
+ const [inputValue, setInputValue] = React.useState('12345');
+
+ const handleSubmit = () => {
+ if (inputValue.length < 6) {
+ setIsInvalid(true);
+ } else {
+ setIsInvalid(false);
+ }
+ };
+
+ React.useEffect(() => {
+ setIsInvalid(propsIsInvalid);
+ }, [propsIsInvalid]);
-const FormControlBasic = ({ ...props }: any) => {
return (
-
-
- Password
-
-
-
-
-
-
-
- Must be atleast 6 characters.
-
-
-
-
-
-
- Atleast 6 characters are required.
-
-
-
+
+
+
+ Password
+
+
+ setInputValue(text)}
+ />
+
+
+
+
+ Must be atleast 6 characters.
+
+
+
+
+
+
+ Atleast 6 characters are required.
+
+
+
+
+
+
);
};
diff --git a/example/storybook-nativewind/src/components/FormControl/index.nw.stories.mdx b/example/storybook-nativewind/src/components/FormControl/index.nw.stories.mdx
index 436da8366b..f3b3e4c2d1 100644
--- a/example/storybook-nativewind/src/components/FormControl/index.nw.stories.mdx
+++ b/example/storybook-nativewind/src/components/FormControl/index.nw.stories.mdx
@@ -93,40 +93,57 @@ This is an illustration of **FormControl** component.
-
-
- Password
-
-
-
-
-
-
- Must be at least 6 characters.
-
-
-
-
-
- At least 6 characters are required.
-
-
-
-
+ function App () {
+ const [isInvalid, setIsInvalid] = React.useState(false);
+ const [inputValue, setInputValue] = React.useState('12345');
+ const handleSubmit = () => {
+ if (inputValue.length < 6) {
+ setIsInvalid(true);
+ } else {
+ setIsInvalid(false);
+ }
+ };
+ return (
+
+
+
+ Password
+
+
+ setInputValue(text)}
+ />
+
+
+
+ Must be atleast 6 characters.
+
+
+
+
+
+ Atleast 6 characters are required.
+
+
+
+
+
+ );
+ };
`,
transformCode: (code) => {
- return transformedCode(code);
+ return transformedCode(code, 'function', 'App');
},
scope: {
Wrapper,
@@ -138,13 +155,33 @@ This is an illustration of **FormControl** component.
FormControlError,
FormControlErrorIcon,
FormControlErrorText,
- Icon,
+ useState,
Input,
InputField,
AlertCircleIcon,
- Box,
+ Button,
+ ButtonText,
+ VStack,
+ },
+ argsType: {
+ size: {
+ control: 'select',
+ options: ['sm', 'md', 'lg'],
+ default: 'md',
+ },
+ isDisabled: {
+ control: 'boolean',
+ default: false,
+ },
+ isReadOnly: {
+ control: 'boolean',
+ default: false,
+ },
+ isRequired: {
+ control: 'boolean',
+ default: false,
+ },
},
- argsType: {},
}}
/>
@@ -460,150 +497,62 @@ The Radio Component can be incorporated within the FormControl.
/>
-#### Form Control with Input
+#### Form Control with Checkbox
-The Input Component can be incorporated within the FormControl.
+The Checkbox Component can be incorporated within the FormControl.
-
-
- Password
+ function App() {
+ const [values, setValues] = React.useState(['bits']);
+ return (
+
+
+ Sign up for newsletters
-
-
-
+ {
+ setValues(keys);
+ }}
+ >
+
+
+
+
+
+ Daily Bits
+
+
+
+
+
+ Event Updates
+
+
+
+
+
+ Sponsorship
+
+
+
- Must be at least 6 characters.
+ Subscribe to newsletters for updates
-
-
-
- At least 6 characters are required.
-
-
-
- `,
- transformCode: (code) => {
- return transformedCode(code);
- },
- scope: {
- Wrapper,
- FormControl,
- FormControlLabel,
- FormControlLabelText,
- FormControlHelper,
- FormControlHelperText,
- FormControlError,
- FormControlErrorIcon,
- FormControlErrorText,
- Icon,
- Input,
- InputField,
- AlertCircleIcon,
- Box,
- },
- argsType: {
- size: {
- control: 'select',
- options: ['sm', 'md', 'lg'],
- default: 'md',
- },
- isDisabled: {
- control: 'boolean',
- default: false,
- },
- isInvalid: {
- control: 'boolean',
- default: false,
- },
- isReadOnly: {
- control: 'boolean',
- default: false,
- },
- isRequired: {
- control: 'boolean',
- default: false,
- },
- },
- }}
- />
-
-
-#### Form Control with Checkbox
-
-The Checkbox Component can be incorporated within the FormControl.
-
-
-
-
-
- Sign up for newsletters
-
-
-
-
-
-
-
-
-
-
-
- Daily Bits
-
-
-
-
-
-
-
-
-
- Event Updates
-
-
-
-
-
-
-
-
-
- Sponsorship
-
-
-
-
-
-
- Subscribe to newsletters for updates
-
-
-
+ );
+ }
`,
transformCode: (code) => {
- return transformedCode(code);
+ return transformedCode(code, 'function', 'App');
},
scope: {
Wrapper,
@@ -615,6 +564,7 @@ The Checkbox Component can be incorporated within the FormControl.
FormControlError,
FormControlErrorIcon,
FormControlErrorText,
+ useState,
Icon,
Checkbox,
CheckboxGroup,
diff --git a/example/storybook-nativewind/src/components/Grid/index.nw.stories.mdx b/example/storybook-nativewind/src/components/Grid/index.nw.stories.mdx
index 6530e15837..5f210df1da 100644
--- a/example/storybook-nativewind/src/components/Grid/index.nw.stories.mdx
+++ b/example/storybook-nativewind/src/components/Grid/index.nw.stories.mdx
@@ -171,6 +171,7 @@ export default () => (
> Note: Our responsive grid component is based on a 12-column grid layout. It follows the CSS **grid system** on the web and **flexbox layout** on native devices. Since the grid layout is only supported on the web, passing the grid-cols and col-span classNames inside _extra is **recommended** for the grid component to work effortlessly on both web and native. Our grid component currently does not support rowSpan.
+> Note: The immediate parent of **GridItem** must be **Grid**. There should be no higher-order component (HOC) between them.
### Component Props
diff --git a/example/storybook-nativewind/src/components/Input/Input.tsx b/example/storybook-nativewind/src/components/Input/Input.tsx
index af86797b8c..3be83cf870 100644
--- a/example/storybook-nativewind/src/components/Input/Input.tsx
+++ b/example/storybook-nativewind/src/components/Input/Input.tsx
@@ -8,8 +8,8 @@ const InputBasic = ({ ...props }: any) => {
return (
{
- setValue(e.nativeEvent.text);
+ onChangeText={(text) => {
+ setValue(text);
}}
value={value}
placeholder="Enter Text here"
diff --git a/example/storybook-nativewind/src/components/Input/InputIcon.tsx b/example/storybook-nativewind/src/components/Input/InputIcon.tsx
index 37ed7ab660..a097674ac2 100644
--- a/example/storybook-nativewind/src/components/Input/InputIcon.tsx
+++ b/example/storybook-nativewind/src/components/Input/InputIcon.tsx
@@ -18,8 +18,8 @@ const InputWithIcon = ({ ...props }: any) => {
{
- setValue(e.nativeEvent.text);
+ onChangeText={(text) => {
+ setValue(text);
}}
value={value}
placeholder="Enter Text here"
@@ -31,8 +31,8 @@ const InputWithIcon = ({ ...props }: any) => {
{
- setValue(e.nativeEvent.text);
+ onChangeText={(text) => {
+ setValue(text);
}}
value={value}
placeholder="Enter Text here"
@@ -44,8 +44,8 @@ const InputWithIcon = ({ ...props }: any) => {
{
- setValue(e.nativeEvent.text);
+ onChangeText={(text) => {
+ setValue(text);
}}
value={value}
placeholder="Enter Text here"
@@ -57,8 +57,8 @@ const InputWithIcon = ({ ...props }: any) => {
{
- setValue(e.nativeEvent.text);
+ onChangeText={(text) => {
+ setValue(text);
}}
value={value}
placeholder="Enter Text here"
diff --git a/example/storybook-nativewind/src/components/Menu/index.nw.stories.mdx b/example/storybook-nativewind/src/components/Menu/index.nw.stories.mdx
index 29251dfcb1..59c290efa5 100644
--- a/example/storybook-nativewind/src/components/Menu/index.nw.stories.mdx
+++ b/example/storybook-nativewind/src/components/Menu/index.nw.stories.mdx
@@ -209,6 +209,8 @@ export default () => (
);
```
+> Note: The immediate parent of **MenuItem** must be **Menu**. There should be no higher-order component (HOC) between them.
+
### Component Props
This section provides a comprehensive reference list for the component props, detailing descriptions, properties, types, and default behavior for easy project integration.
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 303efbeff7..1612355c78 100644
--- a/example/storybook-nativewind/src/components/Modal/index.nw.stories.mdx
+++ b/example/storybook-nativewind/src/components/Modal/index.nw.stories.mdx
@@ -73,10 +73,9 @@ This is an illustration of **Modal** component.
code: `
function App(){
const [showModal, setShowModal] = React.useState(false);
- const ref = React.useRef(null);
return (
-
);
};
diff --git a/example/storybook-nativewind/src/extra-components/nativewind/Demos/HStackDemo.tsx b/example/storybook-nativewind/src/extra-components/nativewind/Demos/HStackDemo.tsx
index 8d7c70939c..a2935570f8 100644
--- a/example/storybook-nativewind/src/extra-components/nativewind/Demos/HStackDemo.tsx
+++ b/example/storybook-nativewind/src/extra-components/nativewind/Demos/HStackDemo.tsx
@@ -3,7 +3,7 @@ import { Box, HStack } from '../../../core-components/nativewind';
const HStackDemo = () => {
return (
-
+
diff --git a/example/storybook-nativewind/src/extra-components/nativewind/Demos/HeadingDemo.tsx b/example/storybook-nativewind/src/extra-components/nativewind/Demos/HeadingDemo.tsx
index 7bc66824f7..1bbda1762f 100644
--- a/example/storybook-nativewind/src/extra-components/nativewind/Demos/HeadingDemo.tsx
+++ b/example/storybook-nativewind/src/extra-components/nativewind/Demos/HeadingDemo.tsx
@@ -1,7 +1,8 @@
import React from 'react';
import { Heading } from '../../../core-components/nativewind';
+
const HeadingDemo = () => {
- return I am a Heading;
+ return I am a Heading.;
};
export default HeadingDemo;
diff --git a/example/storybook-nativewind/src/extra-components/nativewind/Demos/InputDemo.tsx b/example/storybook-nativewind/src/extra-components/nativewind/Demos/InputDemo.tsx
index d803bb3cd1..1975cbab78 100644
--- a/example/storybook-nativewind/src/extra-components/nativewind/Demos/InputDemo.tsx
+++ b/example/storybook-nativewind/src/extra-components/nativewind/Demos/InputDemo.tsx
@@ -1,5 +1,5 @@
-import { Input, InputField } from '../../../core-components/nativewind';
import React from 'react';
+import { Input, InputField } from '../../../core-components/nativewind';
const InputDemo = () => {
return (
diff --git a/example/storybook-nativewind/src/extra-components/nativewind/Demos/ModalDemo.tsx b/example/storybook-nativewind/src/extra-components/nativewind/Demos/ModalDemo.tsx
index 97cbf428e5..dda0efb133 100644
--- a/example/storybook-nativewind/src/extra-components/nativewind/Demos/ModalDemo.tsx
+++ b/example/storybook-nativewind/src/extra-components/nativewind/Demos/ModalDemo.tsx
@@ -1,3 +1,5 @@
+import React from 'react';
+import { OverlayProvider } from '@gluestack-ui/overlay';
import {
Heading,
ModalBackdrop,
@@ -13,12 +15,11 @@ import {
Text,
ModalFooter,
} from '../../../core-components/nativewind';
-import React, { useState } from 'react';
-import { OverlayProvider } from '@gluestack-ui/overlay';
const ModalDemo = () => {
- const [showModal, setShowModal] = useState(false);
+ const [showModal, setShowModal] = React.useState(false);
const ref = React.useRef(null);
+
return (
setShowModal(true)} ref={ref}>
diff --git a/example/storybook-nativewind/src/extra-components/nativewind/Demos/PressableDemo.tsx b/example/storybook-nativewind/src/extra-components/nativewind/Demos/PressableDemo.tsx
index 61312fddaa..679fec55c9 100644
--- a/example/storybook-nativewind/src/extra-components/nativewind/Demos/PressableDemo.tsx
+++ b/example/storybook-nativewind/src/extra-components/nativewind/Demos/PressableDemo.tsx
@@ -1,9 +1,10 @@
-import { Pressable, Text } from '../../../core-components/nativewind';
import React from 'react';
+import { Pressable, Text } from '../../../core-components/nativewind';
const PressableDemo = () => {
return (
console.log('Hello')}
className="p-5 bg-primary-500"
>
diff --git a/example/storybook-nativewind/src/extra-components/nativewind/Demos/ProgressDemo.tsx b/example/storybook-nativewind/src/extra-components/nativewind/Demos/ProgressDemo.tsx
index 64523b55f6..95376dae6d 100644
--- a/example/storybook-nativewind/src/extra-components/nativewind/Demos/ProgressDemo.tsx
+++ b/example/storybook-nativewind/src/extra-components/nativewind/Demos/ProgressDemo.tsx
@@ -3,9 +3,10 @@ import {
Progress,
ProgressFilledTrack,
} from '../../../core-components/nativewind';
+
const ProgressDemo = () => {
return (
-