diff --git a/src/components/combobox.tsx b/src/components/combobox.tsx deleted file mode 100644 index 41bd747f..00000000 --- a/src/components/combobox.tsx +++ /dev/null @@ -1,75 +0,0 @@ -'use client' - -import * as React from 'react' -import { Check, ChevronsUpDown } from 'lucide-react' - -import { cn } from '@/lib/utils' -import { Button } from '@/components/ui/button' -import { - Command, - CommandEmpty, - CommandGroup, - CommandInput, - CommandItem -} from '@/components/ui/command' -import { - Popover, - PopoverContent, - PopoverTrigger -} from '@/components/ui/popover' - -const cloud = [ - { - value: 'aws', - label: 'AWS' - } -] - -export function Combobox() { - const [open, setOpen] = React.useState(false) - const [value, setValue] = React.useState('') - - return ( - - - - - - - - Nothing was found. - - {cloud.map((cloud) => ( - { - setValue(currentValue === value ? '' : currentValue) - setOpen(false) - }} - > - - {cloud.label} - - ))} - - - - - ) -} diff --git a/src/components/ui/collapsible/collapsible.mdx b/src/components/ui/collapsible/collapsible.mdx new file mode 100644 index 00000000..85c42d9c --- /dev/null +++ b/src/components/ui/collapsible/collapsible.mdx @@ -0,0 +1,16 @@ +import { Meta, Controls, Primary, Canvas } from '@storybook/blocks' +import * as Story from './collapsible.stories' + + + +# Collapsible + +An interactive component which expands/collapses a panel. \ +[Docs](https://www.radix-ui.com/primitives/docs/components/collapsible) + +### Primary + + + + + diff --git a/src/components/ui/collapsible/collapsible.stories.tsx b/src/components/ui/collapsible/collapsible.stories.tsx new file mode 100644 index 00000000..757ab736 --- /dev/null +++ b/src/components/ui/collapsible/collapsible.stories.tsx @@ -0,0 +1,50 @@ +import { Meta, StoryObj } from '@storybook/react' +import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '.' +import React from 'react' +import { Button } from '../button' +import { ChevronsUpDown } from 'lucide-react' + +const meta: Meta> = { + title: 'Primitives/Collapsible', + component: Collapsible, + argTypes: {} +} + +export default meta + +export const Primary: StoryObj = { + render: () => { + const [isOpen, setIsOpen] = React.useState(false) + + return ( + +
+

+ @peduarte starred 3 repositories +

+ + + +
+
+ @radix-ui/primitives +
+ +
+ @radix-ui/colors +
+
+ @stitches/react +
+
+
+ ) + } +} diff --git a/src/components/ui/collapsible.tsx b/src/components/ui/collapsible/index.tsx similarity index 100% rename from src/components/ui/collapsible.tsx rename to src/components/ui/collapsible/index.tsx diff --git a/src/components/ui/combobox/combobox.mdx b/src/components/ui/combobox/combobox.mdx new file mode 100644 index 00000000..1835ca26 --- /dev/null +++ b/src/components/ui/combobox/combobox.mdx @@ -0,0 +1,16 @@ +import { Meta, Controls, Primary, Canvas } from '@storybook/blocks' +import * as Story from './combobox.stories' + + + +# Combobox + +Autocomplete input and command palette with a list of suggestions. \ +The Combobox is built using a composition of the [Popover](/docs/primitives-popover--docs) and the [Command](/docs/primitives-command--docs) components. + +### Primary + + + + + diff --git a/src/components/ui/combobox/combobox.stories.tsx b/src/components/ui/combobox/combobox.stories.tsx new file mode 100644 index 00000000..929b6f4f --- /dev/null +++ b/src/components/ui/combobox/combobox.stories.tsx @@ -0,0 +1,98 @@ +import { Meta, StoryObj } from '@storybook/react' +import { Popover, PopoverContent, PopoverTrigger } from '../popover' +import React from 'react' +import { Button } from '../button' +import { Check, ChevronsUpDown } from 'lucide-react' +import { + Command, + CommandEmpty, + CommandGroup, + CommandInput, + CommandItem, + CommandList +} from '../command' +import { cn } from '@/lib/utils' + +const meta: Meta = { + title: 'Primitives/Combobox', + component: Popover, + argTypes: {} +} + +export default meta + +const frameworks = [ + { + value: 'next.js', + label: 'Next.js' + }, + { + value: 'sveltekit', + label: 'SvelteKit' + }, + { + value: 'nuxt.js', + label: 'Nuxt.js' + }, + { + value: 'remix', + label: 'Remix' + }, + { + value: 'astro', + label: 'Astro' + } +] + +export const Primary: StoryObj = { + render: () => { + const [open, setOpen] = React.useState(false) + const [value, setValue] = React.useState('') + + return ( + + + + + + + + + No framework found. + + {frameworks.map((framework) => ( + { + setValue(currentValue === value ? '' : currentValue) + setOpen(false) + }} + > + {framework.label} + + + ))} + + + + + + ) + } +} diff --git a/src/components/ui/command/command.mdx b/src/components/ui/command/command.mdx new file mode 100644 index 00000000..f9b86ee8 --- /dev/null +++ b/src/components/ui/command/command.mdx @@ -0,0 +1,16 @@ +import { Meta, Controls, Primary, Canvas } from '@storybook/blocks' +import * as Story from './command.stories' + + + +# Command + +Fast, composable, unstyled command menu for React. \ +[Docs](https://cmdk.paco.me/) + +### Primary + + + + + diff --git a/src/components/ui/command/command.stories.tsx b/src/components/ui/command/command.stories.tsx new file mode 100644 index 00000000..1cf5f9ad --- /dev/null +++ b/src/components/ui/command/command.stories.tsx @@ -0,0 +1,70 @@ +import { Meta, StoryObj } from '@storybook/react' +import { + Command, + CommandEmpty, + CommandGroup, + CommandInput, + CommandItem, + CommandList, + CommandSeparator, + CommandShortcut +} from '.' +import { + Calendar, + Smile, + Calculator, + User, + CreditCard, + Settings +} from 'lucide-react' + +const meta: Meta = { + title: 'Primitives/Command', + component: Command, + argTypes: {} +} + +export default meta + +export const Primary: StoryObj = { + render: (args) => ( + + + + No results found. + + + + Calendar + + + + Search Emoji + + + + Calculator + + + + + + + Profile + ⌘P + + + + Billing + ⌘B + + + + Settings + ⌘S + + + + + ) +} diff --git a/src/components/ui/command.tsx b/src/components/ui/command/index.tsx similarity index 100% rename from src/components/ui/command.tsx rename to src/components/ui/command/index.tsx diff --git a/src/components/ui/popover/popover.mdx b/src/components/ui/popover/popover.mdx index cf9574be..3299eccc 100644 --- a/src/components/ui/popover/popover.mdx +++ b/src/components/ui/popover/popover.mdx @@ -5,7 +5,8 @@ import * as Story from './popover.stories' # Popover -Displays rich content in a portal, triggered by a button. +Displays rich content in a portal, triggered by a button. \ +[Docs](https://www.radix-ui.com/primitives/docs/components/popover) ### Primary diff --git a/src/components/ui/separator.tsx b/src/components/ui/separator/index.tsx similarity index 100% rename from src/components/ui/separator.tsx rename to src/components/ui/separator/index.tsx diff --git a/src/components/ui/separator/separator.mdx b/src/components/ui/separator/separator.mdx new file mode 100644 index 00000000..85363e8c --- /dev/null +++ b/src/components/ui/separator/separator.mdx @@ -0,0 +1,16 @@ +import { Meta, Controls, Primary, Canvas } from '@storybook/blocks' +import * as Story from './separator.stories' + + + +# Separator + +Visually or semantically separates content. \ +[Docs](https://www.radix-ui.com/primitives/docs/components/separator) + +### Primary + + + + + diff --git a/src/components/ui/separator/separator.stories.tsx b/src/components/ui/separator/separator.stories.tsx new file mode 100644 index 00000000..c5c9f8d9 --- /dev/null +++ b/src/components/ui/separator/separator.stories.tsx @@ -0,0 +1,31 @@ +import { Meta, StoryObj } from '@storybook/react' +import { Separator } from '.' + +const meta: Meta> = { + title: 'Primitives/Separator', + component: Separator, + argTypes: {} +} + +export default meta + +export const Primary: StoryObj = { + render: () => ( +
+
+

Radix Primitives

+

+ An open-source UI component library. +

+
+ +
+
Blog
+ +
Docs
+ +
Source
+
+
+ ) +} diff --git a/src/components/ui/skeleton.tsx b/src/components/ui/skeleton/index.tsx similarity index 100% rename from src/components/ui/skeleton.tsx rename to src/components/ui/skeleton/index.tsx diff --git a/src/components/ui/skeleton/skeleton.mdx b/src/components/ui/skeleton/skeleton.mdx new file mode 100644 index 00000000..bfefac92 --- /dev/null +++ b/src/components/ui/skeleton/skeleton.mdx @@ -0,0 +1,19 @@ +import { Meta, Controls, Primary, Canvas } from '@storybook/blocks' +import * as Story from './skeleton.stories' + + + +# Skeleton + +Use to show a placeholder while content is loading. + +### Primary + + + +### Example + + + + + diff --git a/src/components/ui/skeleton/skeleton.stories.tsx b/src/components/ui/skeleton/skeleton.stories.tsx new file mode 100644 index 00000000..6d93dd06 --- /dev/null +++ b/src/components/ui/skeleton/skeleton.stories.tsx @@ -0,0 +1,27 @@ +import { Meta, StoryObj } from '@storybook/react' +import { Skeleton } from '.' + +const meta: Meta> = { + title: 'Primitives/Skeleton', + component: Skeleton, + argTypes: {} +} + +export default meta + +export const Primary: StoryObj> = { + render: (args) => +} + +export const Example: StoryObj> = { + render: (args) => ( +
+ +
+ + + +
+
+ ) +}