-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from magicspon/dev
Dev
- Loading branch information
Showing
43 changed files
with
1,205 additions
and
275 deletions.
There are no files selected for viewing
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 @@ | ||
--- | ||
'eslint-config-custom': major | ||
'tailwind-config': major | ||
'tsconfig': major | ||
'utils': major | ||
'ui': major | ||
'cms': major | ||
'web': major | ||
--- | ||
|
||
Primitive storybooks and code gen tools |
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
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
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 |
---|---|---|
@@ -1,3 +1 @@ | ||
module.exports = { | ||
extends: ['@commitlint/config-conventional'], | ||
} | ||
module.exports = { extends: ['gitmoji'] } |
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
export * from './usePrevious' |
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,9 @@ | ||
import * as React from 'react' | ||
|
||
export function usePrevious<T>(value: T): T | undefined { | ||
const ref = React.useRef<T>() | ||
React.useEffect(() => { | ||
ref.current = value | ||
}, [value]) | ||
return ref.current | ||
} |
39 changes: 39 additions & 0 deletions
39
packages/ui/src/primitives/Accordion/Accordion.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,39 @@ | ||
import * as React from 'react' | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
import * as Accordion from '.' | ||
|
||
const meta = { | ||
title: 'primitives/Accordion', | ||
component: Accordion.Root, | ||
parameters: { | ||
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout | ||
layout: 'centered', | ||
}, | ||
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs | ||
tags: ['autodocs'], | ||
// More on argTypes: https://storybook.js.org/docs/api/argtypes | ||
argTypes: {}, | ||
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args | ||
args: {}, | ||
} satisfies Meta<typeof Accordion.Root> | ||
|
||
export default meta | ||
type Story = StoryObj<typeof meta> | ||
|
||
export const Primary: Story = { | ||
args: { | ||
type: 'single', | ||
}, | ||
render: () => ( | ||
<Accordion.Root type="single"> | ||
<Accordion.Item value="a"> | ||
<Accordion.Trigger>Item</Accordion.Trigger> | ||
<Accordion.Content>Hello</Accordion.Content> | ||
</Accordion.Item> | ||
<Accordion.Item value="b"> | ||
<Accordion.Trigger>Item</Accordion.Trigger> | ||
<Accordion.Content>Hello</Accordion.Content> | ||
</Accordion.Item> | ||
</Accordion.Root> | ||
), | ||
} |
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 * as React from 'react' | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
import * as Alert from '.' | ||
|
||
const meta = { | ||
title: 'primitives/Alert', | ||
component: Alert.Root, | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
tags: ['autodocs'], | ||
argTypes: {}, | ||
args: {}, | ||
} satisfies Meta<typeof Alert.Root> | ||
|
||
export default meta | ||
type Story = StoryObj<typeof meta> | ||
|
||
export const Primary: Story = { | ||
args: {}, | ||
render: () => ( | ||
<Alert.Root> | ||
<Alert.Title>Hello</Alert.Title> | ||
<Alert.Description> | ||
<p>Ah chucks</p> | ||
</Alert.Description> | ||
</Alert.Root> | ||
), | ||
} |
36 changes: 36 additions & 0 deletions
36
packages/ui/src/primitives/AlertDialog/AlertDialog.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,36 @@ | ||
import * as React from 'react' | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
import * as AlertDialog from '.' | ||
|
||
const meta = { | ||
title: 'primitives/AlertDialog', | ||
component: AlertDialog.Root, | ||
parameters: { | ||
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout | ||
layout: 'centered', | ||
}, | ||
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs | ||
tags: ['autodocs'], | ||
// More on argTypes: https://storybook.js.org/docs/api/argtypes | ||
argTypes: {}, | ||
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args | ||
args: {}, | ||
} satisfies Meta<typeof AlertDialog.Root> | ||
|
||
export default meta | ||
type Story = StoryObj<typeof meta> | ||
|
||
export const Primary: Story = { | ||
args: {}, | ||
render: () => ( | ||
<AlertDialog.Root> | ||
<AlertDialog.Trigger>Item</AlertDialog.Trigger> | ||
<AlertDialog.Content> | ||
<AlertDialog.Title>Item</AlertDialog.Title> | ||
<AlertDialog.Description>Hello</AlertDialog.Description> | ||
<AlertDialog.Cancel>Cancel</AlertDialog.Cancel> | ||
<AlertDialog.Action>Action</AlertDialog.Action> | ||
</AlertDialog.Content> | ||
</AlertDialog.Root> | ||
), | ||
} |
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,28 @@ | ||
import { Badge } from '.' | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
|
||
const meta = { | ||
title: 'primitives/Badge', | ||
component: Badge, | ||
parameters: { | ||
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout | ||
layout: 'centered', | ||
}, | ||
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs | ||
tags: ['autodocs'], | ||
// More on argTypes: https://storybook.js.org/docs/api/argtypes | ||
argTypes: {}, | ||
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args | ||
args: {}, | ||
} satisfies Meta<typeof Badge> | ||
|
||
export default meta | ||
type Story = StoryObj<typeof meta> | ||
|
||
export const Primary: Story = { | ||
args: { | ||
children: 'Hello world', | ||
variant: 'default', | ||
// type: 'Badge', | ||
}, | ||
} |
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
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,52 @@ | ||
import * as React from 'react' | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
import * as Carousel from '.' | ||
|
||
const meta = { | ||
title: 'primitives/Carousel', | ||
component: Carousel.Root, | ||
parameters: { | ||
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout | ||
layout: 'centered', | ||
}, | ||
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs | ||
tags: ['autodocs'], | ||
// More on argTypes: https://storybook.js.org/docs/api/argtypes | ||
argTypes: {}, | ||
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args | ||
args: {}, | ||
} satisfies Meta<typeof Carousel.Root> | ||
|
||
export default meta | ||
type Story = StoryObj<typeof meta> | ||
|
||
export const Primary: Story = { | ||
args: { | ||
options: {}, | ||
}, | ||
render: () => ( | ||
<Carousel.Root | ||
options={{ | ||
active: true, | ||
axis: 'x', | ||
align: 'center', | ||
slidesToScroll: 1, | ||
}} | ||
> | ||
<Carousel.Prev>Prev</Carousel.Prev> | ||
<Carousel.Next>Next</Carousel.Next> | ||
<Carousel.Viewport> | ||
<Carousel.Item className="w-full flex-shrink-0">A</Carousel.Item> | ||
<Carousel.Item className="w-full flex-shrink-0">B</Carousel.Item> | ||
<Carousel.Item className="w-full flex-shrink-0">C</Carousel.Item> | ||
<Carousel.Item className="w-full flex-shrink-0">D</Carousel.Item> | ||
</Carousel.Viewport> | ||
<Carousel.Dots> | ||
<Carousel.Dot index={0}>Dot</Carousel.Dot> | ||
<Carousel.Dot index={1}>Dot</Carousel.Dot> | ||
<Carousel.Dot index={2}>Dot</Carousel.Dot> | ||
<Carousel.Dot index={3}>Dot</Carousel.Dot> | ||
</Carousel.Dots> | ||
</Carousel.Root> | ||
), | ||
} |
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
31 changes: 31 additions & 0 deletions
31
packages/ui/src/primitives/Collapsible/Collapsible.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 * as React from 'react' | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
import * as Collapsible from '.' | ||
|
||
const meta = { | ||
title: 'primitives/Collapsible', | ||
component: Collapsible.Root, | ||
parameters: { | ||
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout | ||
layout: 'centered', | ||
}, | ||
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs | ||
tags: ['autodocs'], | ||
// More on argTypes: https://storybook.js.org/docs/api/argtypes | ||
argTypes: {}, | ||
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args | ||
args: {}, | ||
} satisfies Meta<typeof Collapsible.Root> | ||
|
||
export default meta | ||
type Story = StoryObj<typeof meta> | ||
|
||
export const Primary: Story = { | ||
args: {}, | ||
render: () => ( | ||
<Collapsible.Root> | ||
<Collapsible.Trigger>Item</Collapsible.Trigger> | ||
<Collapsible.Content>Hello</Collapsible.Content> | ||
</Collapsible.Root> | ||
), | ||
} |
Oops, something went wrong.