-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'malj/2679' into staging
- Loading branch information
Showing
16 changed files
with
233 additions
and
161 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
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 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
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,37 @@ | ||
import { forwardRef } from 'react' | ||
import * as RadixTabs from '@radix-ui/react-tabs' | ||
import envisTwMerge from '../../twMerge' | ||
|
||
export type TabProps = RadixTabs.TabsTriggerProps | ||
|
||
export const Tab = forwardRef<HTMLButtonElement, TabProps>(function Tab({ children, className = '', ...rest }, ref) { | ||
return ( | ||
<RadixTabs.Trigger | ||
ref={ref} | ||
className={envisTwMerge( | ||
`text-slate-80 | ||
dark:text-white-100 | ||
bg-transparent | ||
py-2 | ||
pl-3 | ||
pr-8 | ||
border-0 | ||
hover:underline | ||
underline-offset-2 | ||
decoration-1 | ||
border-slate-80 | ||
dark:border-white-100 | ||
hover:cursor-pointer | ||
data-active:font-medium | ||
data-active:border-b-2 | ||
focus:envis-outline | ||
dark:focus:envis-outline-invert | ||
`, | ||
className, | ||
)} | ||
{...rest} | ||
> | ||
{children} | ||
</RadixTabs.Trigger> | ||
) | ||
}) |
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,19 @@ | ||
import { forwardRef } from 'react' | ||
import * as RadixTabs from '@radix-ui/react-tabs' | ||
import envisTwMerge from '../../twMerge' | ||
|
||
export type TabListProps = { | ||
/* Provides a label that describes the purpose of the set of tabs. */ | ||
'aria-label': string | ||
} & RadixTabs.TabsListProps | ||
|
||
export const TabList = forwardRef<HTMLDivElement, TabListProps>(function TabList( | ||
{ 'aria-label': ariaLabel, children, className = '', ...rest }, | ||
ref, | ||
) { | ||
return ( | ||
<RadixTabs.List ref={ref} className={envisTwMerge(`flex flex-wrap`, className)} aria-label={ariaLabel} {...rest}> | ||
{children} | ||
</RadixTabs.List> | ||
) | ||
}) |
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,23 @@ | ||
import { forwardRef } from 'react' | ||
import * as RadixTabs from '@radix-ui/react-tabs' | ||
import envisTwMerge from '../../twMerge' | ||
|
||
export type TabPanelProps = RadixTabs.TabsContentProps | ||
|
||
export const TabPanel = forwardRef<HTMLDivElement, TabPanelProps>(function TabPanel( | ||
{ className = '', children, ...rest }, | ||
ref, | ||
) { | ||
return ( | ||
<RadixTabs.Content | ||
ref={ref} | ||
className={envisTwMerge( | ||
`focus-visible:envis-outline dark:focus-visible:envis-outline-invert outline-offset-4`, | ||
className, | ||
)} | ||
{...rest} | ||
> | ||
{children} | ||
</RadixTabs.Content> | ||
) | ||
}) |
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,12 +1,12 @@ | ||
import { forwardRef } from 'react' | ||
import { Tabs as CTabs, TabsProps as CTabsProps } from '@chakra-ui/react' | ||
import * as RadixTabs from '@radix-ui/react-tabs' | ||
|
||
export type TabsProps = CTabsProps | ||
export type TabsProps = RadixTabs.TabsProps | ||
|
||
export const Tabs = forwardRef<HTMLDivElement, TabsProps>(function Tabs({ children, ...rest }, ref) { | ||
return ( | ||
<CTabs ref={ref} {...rest}> | ||
<RadixTabs.Root ref={ref} {...rest}> | ||
{children} | ||
</CTabs> | ||
</RadixTabs.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
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
Oops, something went wrong.