forked from asyncapi/studio
-
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.
- Loading branch information
1 parent
a428b15
commit 5f17030
Showing
8 changed files
with
171 additions
and
2 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,29 @@ | ||
import React from 'react'; | ||
import { Meta } from '@storybook/react'; | ||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@asyncapi/studio-ui' | ||
|
||
const meta: Meta = { | ||
component: Tabs, | ||
parameters: { | ||
layout: 'centered', | ||
backgrounds: { | ||
default: 'dark' | ||
} | ||
} | ||
} | ||
|
||
export default meta | ||
|
||
|
||
export const Default = { | ||
render: () => ( <Tabs defaultValue="visual_editor"> | ||
<TabsList> | ||
<TabsTrigger value="visual_editor">Visual Editor</TabsTrigger> | ||
<TabsTrigger value="code_editor">Code Editor</TabsTrigger> | ||
<TabsTrigger value="examples">Examples</TabsTrigger> | ||
</TabsList> | ||
<TabsContent value="visual_editor">Visual Editor Layout</TabsContent> | ||
<TabsContent value="code_editor">Code Editor Layout</TabsContent> | ||
<TabsContent value="examples">Examples Layout</TabsContent> | ||
</Tabs>) | ||
} |
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,29 @@ | ||
"use client" | ||
|
||
import * as React from "react" | ||
import * as SeparatorPrimitive from "@radix-ui/react-separator" | ||
|
||
import { cn } from "@asyncapi/studio-utils" | ||
|
||
const Separator = React.forwardRef< | ||
React.ElementRef<typeof SeparatorPrimitive.Root>, | ||
React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root> | ||
>( | ||
( | ||
{ className, orientation = "horizontal", decorative = true, ...props }, | ||
ref | ||
) => ( | ||
<SeparatorPrimitive.Root | ||
ref={ref} | ||
decorative={decorative} | ||
orientation={orientation} | ||
className={cn( | ||
"shrink-0 bg-gray-800 h-full w-[1px]", orientation === "horizontal" && "h-[1px] w-full", className | ||
)} | ||
{...props} | ||
/> | ||
) | ||
) | ||
Separator.displayName = SeparatorPrimitive.Root.displayName | ||
|
||
export { Separator } |
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,58 @@ | ||
"use client" | ||
|
||
import * as React from "react" | ||
import * as TabsPrimitive from "@radix-ui/react-tabs" | ||
import { cn } from "@asyncapi/studio-utils" | ||
import { Separator } from './Separator' | ||
|
||
const Tabs = TabsPrimitive.Root | ||
|
||
const TabsList = React.forwardRef< | ||
React.ElementRef<typeof TabsPrimitive.List>, | ||
React.ComponentPropsWithoutRef<typeof TabsPrimitive.List> | ||
>(({ className, ...props }, ref) => ( | ||
<div className='w-fit'> | ||
<TabsPrimitive.List | ||
ref={ref} | ||
className={cn( | ||
"inline-flex gap-3 h-7 rounded-md p-l-1 text-gray-500 font-medium", | ||
className | ||
)} | ||
{...props} | ||
/> | ||
<Separator orientation='horizontal' /> | ||
</div> | ||
)) | ||
TabsList.displayName = TabsPrimitive.List.displayName | ||
|
||
const TabsTrigger = React.forwardRef< | ||
React.ElementRef<typeof TabsPrimitive.Trigger>, | ||
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger> | ||
>(({ className, ...props }, ref) => ( | ||
<TabsPrimitive.Trigger | ||
ref={ref} | ||
className={cn( | ||
"inline-flex text-gray-500 items-center justify-center whitespace-nowrap rounded-sm py-1.5 text-sm transition-all focus-visible:outline-none focus-visible:ring-gray-950 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:text-gray-300 data-[state=active]:shadow-sm", | ||
className | ||
)} | ||
{...props} | ||
/> | ||
)) | ||
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName | ||
|
||
const TabsContent = React.forwardRef< | ||
React.ElementRef<typeof TabsPrimitive.Content>, | ||
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content> | ||
>(({ className, ...props }, ref) => ( | ||
<TabsPrimitive.Content | ||
ref={ref} | ||
className={cn( | ||
"mt-2 focus-visible:outline-none text-gray-500", | ||
className | ||
)} | ||
{...props} | ||
/> | ||
)) | ||
TabsContent.displayName = TabsPrimitive.Content.displayName | ||
|
||
export { Tabs, TabsList, TabsTrigger, TabsContent } |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.