-
Notifications
You must be signed in to change notification settings - Fork 23
feat: added storybook ui components #434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
5341e6a
ba2a8d7
c5fedbf
5e86113
ab3adc6
2bdbfcd
10b7e3b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| '@cypherock/cysync-ui': patch | ||
| '@cypherock/cysync-desktop': patch | ||
| --- | ||
|
|
||
| added and updated storybook ui components |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import type { StoryObj, Meta } from '@storybook/react'; | ||
| import React from 'react'; | ||
|
|
||
| import { Chip } from '../../components'; | ||
|
|
||
| const meta: Meta<typeof Chip> = { | ||
| component: Chip, | ||
| tags: ['autodocs'], | ||
| }; | ||
|
|
||
| export default meta; | ||
|
|
||
| type Story = StoryObj<typeof meta>; | ||
|
|
||
| export const Default: Story = { | ||
| args: { | ||
| children: <span style={{ color: 'white' }}>Chip Box</span>, | ||
| p: 2, | ||
| }, | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| import type { Meta, StoryObj } from '@storybook/react'; | ||
| import React from 'react'; | ||
|
|
||
| import { Container } from '../../components/atoms'; | ||
|
|
||
| const meta: Meta<typeof Container> = { | ||
| component: Container, | ||
| tags: ['autodocs'], | ||
| }; | ||
|
|
||
| export default meta; | ||
|
|
||
| type Story = StoryObj<typeof meta>; | ||
|
|
||
| export const Default: Story = { | ||
| args: { | ||
| $noFlex: true, | ||
| size: 'lg', | ||
| $bgColor: 'white', | ||
| p: '10', | ||
| children: ( | ||
| <> | ||
| <div>This is the first container</div> | ||
| <div>This is the second container</div> | ||
| </> | ||
| ), | ||
| }, | ||
| }; | ||
|
|
||
| export const FlexGapContainer: Story = { | ||
| args: { | ||
| ...Default.args, | ||
| $noFlex: false, | ||
| gap: 32, | ||
| }, | ||
| }; | ||
|
irshadjsr21 marked this conversation as resolved.
|
||
|
|
||
| export const RoundedContainer: Story = { | ||
| args: { | ||
| ...Default.args, | ||
| p: '16', | ||
| $borderRadius: 8, | ||
| $width: '100%', | ||
| }, | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import type { Meta, StoryObj } from '@storybook/react'; | ||
|
|
||
| import { InformationBox } from '../../components/atoms'; | ||
|
|
||
| const meta: Meta<typeof InformationBox> = { | ||
| component: InformationBox, | ||
| tags: ['autodocs'], | ||
| }; | ||
|
|
||
| export default meta; | ||
|
|
||
| type Story = StoryObj<typeof meta>; | ||
|
|
||
| export const Default: Story = { | ||
| args: { | ||
| $backgroundColor: undefined, | ||
| $borderColor: undefined, | ||
| rightImage: undefined, | ||
| text: 'This is the info box', | ||
| }, | ||
| }; | ||
|
Comment on lines
+14
to
+21
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need more variants for this. With images |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import type { Meta, StoryObj } from '@storybook/react'; | ||
|
|
||
| import { NoSearchResult } from '../../components/atoms'; | ||
|
|
||
| const meta: Meta<typeof NoSearchResult> = { | ||
| component: NoSearchResult, | ||
| tags: ['autodocs'], | ||
| }; | ||
|
|
||
| export default meta; | ||
|
|
||
| type Story = StoryObj<typeof meta>; | ||
|
|
||
| export const Default: Story = { | ||
| args: { | ||
| subText: 'Go to Home', | ||
| searchText: 'Result not found', | ||
| text: 'text', | ||
| }, | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import type { Meta, StoryObj } from '@storybook/react'; | ||
|
|
||
| import { ShowMore } from '../../components/atoms'; | ||
|
|
||
| const meta: Meta<typeof ShowMore> = { | ||
| component: ShowMore, | ||
| tags: ['autodocs'], | ||
| }; | ||
|
|
||
| export default meta; | ||
|
|
||
| type Story = StoryObj<typeof meta>; | ||
|
|
||
| export const Default: Story = { | ||
| args: { | ||
| text: 'Show More', | ||
| }, | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import type { Meta, StoryObj } from '@storybook/react'; | ||
|
|
||
| import { SummaryContainer } from '../../components/atoms'; | ||
|
|
||
| const meta: Meta<typeof SummaryContainer> = { | ||
| component: SummaryContainer, | ||
| tags: ['autodocs'], | ||
| }; | ||
|
|
||
| export default meta; | ||
|
|
||
| type Story = StoryObj<typeof meta>; | ||
|
|
||
| export const Default: Story = { | ||
| args: { | ||
| margin: undefined, | ||
| leftComponent: undefined, | ||
| rightComponent: undefined, | ||
| }, | ||
| }; | ||
|
Comment on lines
+14
to
+20
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This displays empty component
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,4 +11,8 @@ export default meta; | |
|
|
||
| type Story = StoryObj<typeof meta>; | ||
|
|
||
| export const Default: Story = {}; | ||
| export const Default: Story = { | ||
| args: { | ||
| children: 'tag 1', | ||
| }, | ||
| }; | ||
|
Comment on lines
+14
to
+18
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs more variants |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import type { Meta, StoryObj } from '@storybook/react'; | ||
| import React from 'react'; | ||
|
|
||
| import { Tooltip } from '../../components/atoms/Tooltip'; | ||
|
|
||
| const meta: Meta<typeof Tooltip> = { | ||
| component: Tooltip, | ||
| tags: ['autodocs'], | ||
| }; | ||
|
|
||
| export default meta; | ||
|
|
||
| type Story = StoryObj<typeof meta>; | ||
|
|
||
| export const Default: Story = { | ||
| args: { | ||
| isActive: true, | ||
| text: undefined, | ||
| children: <span>Base Comp</span>, | ||
| }, | ||
| }; | ||
|
|
||
| export const TopTooltip: Story = { | ||
| args: { | ||
| ...Default.args, | ||
| tooltipPlacement: 'top', | ||
| }, | ||
| }; | ||
|
|
||
| export const BottomTooltip: Story = { | ||
| args: { | ||
| ...Default.args, | ||
| tooltipPlacement: 'bottom', | ||
| }, | ||
| }; | ||
|
Comment on lines
+15
to
+35
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The tooltip is not visible |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import type { Meta, StoryObj } from '@storybook/react'; | ||
|
|
||
| import { VerticalLine } from '../../components/atoms'; | ||
|
|
||
| const meta: Meta<typeof VerticalLine> = { | ||
| component: VerticalLine, | ||
| tags: ['autodocs'], | ||
| }; | ||
|
|
||
| export default meta; | ||
|
|
||
| type Story = StoryObj<typeof meta>; | ||
|
|
||
| export const Default: Story = { | ||
| args: { | ||
| $borderStyle: 'dotted', | ||
| height: 40, | ||
| }, | ||
| }; | ||
|
Comment on lines
+14
to
+19
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs more variants |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import type { Meta, StoryObj } from '@storybook/react'; | ||
|
|
||
| import { Video } from '../../components/atoms'; | ||
|
|
||
| const meta: Meta<typeof Video> = { | ||
| component: Video, | ||
| tags: ['autodocs'], | ||
| }; | ||
|
|
||
| export default meta; | ||
|
|
||
| type Story = StoryObj<typeof meta>; | ||
|
|
||
| export const Default: Story = { | ||
| args: { | ||
| autoPlay: true, | ||
| loop: true, | ||
| controls: true, | ||
| $aspectRatio: 'auto', | ||
| src: 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4', | ||
| }, | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| import type { Meta, StoryObj } from '@storybook/react'; | ||
| import React from 'react'; | ||
|
|
||
| import { AccordionContent } from '../../components'; | ||
|
|
||
| const meta: Meta<typeof AccordionContent> = { | ||
| component: AccordionContent, | ||
| tags: ['autodocs'], | ||
| }; | ||
|
|
||
| export default meta; | ||
|
|
||
| type Story = StoryObj<typeof meta>; | ||
|
|
||
| export const Info: Story = { | ||
| args: { | ||
| id: 'Accordion', | ||
| items: [ | ||
| { | ||
| component: <span>First</span>, | ||
| width: 50, | ||
| padding: 8, | ||
| paddingLeft: '20', | ||
| }, | ||
| { | ||
| component: <span>Second</span>, | ||
| width: 50, | ||
| padding: 8, | ||
| paddingLeft: '20', | ||
| }, | ||
| { | ||
| component: <span>Third</span>, | ||
| width: 50, | ||
| padding: 8, | ||
| paddingLeft: '20', | ||
| }, | ||
| ], | ||
| headers: ['Head1', 'Head2', 'Head3'], | ||
| }, | ||
| }; |

Uh oh!
There was an error while loading. Please reload this page.