-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: updated gluestack-ui storybook examples
- Loading branch information
Showing
53 changed files
with
1,581 additions
and
241 deletions.
There are no files selected for viewing
51 changes: 0 additions & 51 deletions
51
baseProject/config/storybook/gluestackStories/Button.stories.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
43 changes: 0 additions & 43 deletions
43
baseProject/config/storybook/gluestackStories/Checkbox.stories.ts
This file was deleted.
Oops, something went wrong.
37 changes: 0 additions & 37 deletions
37
baseProject/config/storybook/gluestackStories/Checkbox.tsx
This file was deleted.
Oops, something went wrong.
Binary file added
BIN
+10.4 KB
baseProject/config/storybook/gluestackStories/Feedback/Progress/Progress.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions
25
baseProject/config/storybook/gluestackStories/Feedback/Progress/Progress.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import type { Meta } from '@storybook/react'; | ||
import Progress from './Progress'; | ||
|
||
const ProgressMeta: Meta<typeof Progress> = { | ||
title: 'FEEDBACK/Progress', | ||
component: Progress, | ||
// metaInfo is required for figma generation | ||
// @ts-ignore | ||
metaInfo: { | ||
componentDescription: `The Progress component is designed to display the progress of a task that involves multiple steps and takes some time to complete.`, | ||
}, | ||
argTypes: { | ||
value: { | ||
type: 'number', | ||
defaultValue: '50', | ||
}, | ||
}, | ||
args: { | ||
value: 48, | ||
}, | ||
}; | ||
|
||
export default ProgressMeta; | ||
|
||
export { Progress }; |
33 changes: 33 additions & 0 deletions
33
baseProject/config/storybook/gluestackStories/Feedback/Progress/Progress.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from 'react'; | ||
import { Progress, ProgressFilledTrack, VStack, Text, Heading, Center, HStack } from '@gluestack-ui/themed'; | ||
|
||
const ProgressBasic = ({ value = 50, ...props }: any) => { | ||
return ( | ||
<Center> | ||
<HStack justifyContent="space-between" width={268} my="$1"> | ||
<Text size="sm">Progress</Text> | ||
<Text size="sm">Hint</Text> | ||
</HStack> | ||
<Progress | ||
sx=\{{ | ||
w: 268, | ||
}} | ||
value={value} | ||
{...props} | ||
> | ||
<ProgressFilledTrack> | ||
<Text color="white" fontWeight="bold" alignSelf="center" mt="$1"> | ||
{value}% | ||
</Text> | ||
</ProgressFilledTrack> | ||
</Progress> | ||
</Center> | ||
); | ||
}; | ||
|
||
ProgressBasic.description = | ||
'This is a basic Progress component example. Progress components are used to show the progress of a task.'; | ||
|
||
export default ProgressBasic; | ||
|
||
export { Progress, ProgressFilledTrack, VStack, Text, Heading }; |
Binary file added
BIN
+14 KB
baseProject/config/storybook/gluestackStories/Feedback/Spinner/Spinner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions
16
baseProject/config/storybook/gluestackStories/Feedback/Spinner/Spinner.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type { Meta } from '@storybook/react'; | ||
import Spinner from './Spinner'; | ||
|
||
const SpinnerMeta: Meta<typeof Spinner> = { | ||
title: 'FEEDBACK/Spinner', | ||
component: Spinner, | ||
// metaInfo is required for figma generation | ||
// @ts-ignore | ||
metaInfo: { | ||
componentDescription: `Spinners are designed to give visual cues to users that an action is being processed or that a change or result is expected.`, | ||
}, | ||
}; | ||
|
||
export default SpinnerMeta; | ||
|
||
export { Spinner }; |
11 changes: 11 additions & 0 deletions
11
baseProject/config/storybook/gluestackStories/Feedback/Spinner/Spinner.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react'; | ||
import { Spinner, HStack, Text, VStack } from '@gluestack-ui/themed'; | ||
|
||
const SpinnerBasic = ({ ...props }) => <Spinner size={24} {...props} />; | ||
|
||
SpinnerBasic.description = | ||
'This is a basic Spinner component example. Spinners are used to show a loading state of a component or page.'; | ||
|
||
export default SpinnerBasic; | ||
|
||
export { Spinner, HStack, Text, VStack }; |
29 changes: 29 additions & 0 deletions
29
baseProject/config/storybook/gluestackStories/Feedback/Toast/Basic.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from 'react'; | ||
import { Button, ButtonText, Toast, ToastTitle, useToast } from '@gluestack-ui/themed'; | ||
|
||
const ToastPlacement = ({ placement = 'top', ...props }: any) => { | ||
const toast = useToast(); | ||
return ( | ||
<Button | ||
onPress={() => { | ||
toast.show({ | ||
placement: placement, | ||
render: ({ id }) => { | ||
return ( | ||
<Toast nativeID={`toast-${id}`} {...props}> | ||
<ToastTitle>Hello World Toast {id}</ToastTitle> | ||
</Toast> | ||
); | ||
}, | ||
}); | ||
}} | ||
> | ||
<ButtonText>Press Me</ButtonText> | ||
</Button> | ||
); | ||
}; | ||
|
||
ToastPlacement.description = | ||
'This is a basic Toast component example. Toasts are used to communicate a state that affects a system, feature or page'; | ||
|
||
export default ToastPlacement; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions
31
baseProject/config/storybook/gluestackStories/Feedback/Toast/Toast.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import type { Meta } from '@storybook/react'; | ||
import Toast from './Toast'; | ||
|
||
const ToastMeta: Meta<typeof Toast> = { | ||
title: 'FEEDBACK/Toast', | ||
component: Toast, | ||
// metaInfo is required for figma generation | ||
// @ts-ignore | ||
metaInfo: { | ||
componentDescription: `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.`, | ||
}, | ||
argTypes: { | ||
placement: { | ||
control: 'select', | ||
figmaIgnore: true, | ||
options: ['top', 'bottom'], | ||
}, | ||
action: { | ||
control: 'select', | ||
options: ['error', 'warning', 'success', 'info'], | ||
}, | ||
}, | ||
args: { | ||
placement: 'top', | ||
action: 'info', | ||
}, | ||
}; | ||
|
||
export default ToastMeta; | ||
|
||
export { Toast }; |
Oops, something went wrong.