Fix pair editor container

This commit is contained in:
Gregory Schier
2023-03-20 01:18:44 -07:00
parent b487938ffb
commit c5b50c10f4
3 changed files with 66 additions and 55 deletions
+3 -3
View File
@@ -263,9 +263,9 @@ const FormRow = memo(function FormRow({
/> />
<div <div
className={classNames( className={classNames(
'grid gap-2 items-center', 'grid items-center',
'@xs:!grid-rows-1 @sm:!grid-cols-[minmax(0,1fr)_minmax(0,1fr)]', '@xs:gap-2 @xs:!grid-rows-1 @xs:!grid-cols-[minmax(0,1fr)_minmax(0,1fr)]',
'grid-cols-1 grid-rows-2', 'gap-0.5 grid-cols-1 grid-rows-2',
)} )}
> >
<Input <Input
+6 -2
View File
@@ -5,11 +5,15 @@ import type { ReactNode } from 'react';
interface Props { interface Props {
children: ReactNode; children: ReactNode;
className?: string; className?: string;
type?: S.ScrollAreaProps['type'];
} }
export function ScrollArea({ children, className }: Props) { export function ScrollArea({ children, className, type }: Props) {
return ( return (
<S.Root className={classnames(className, 'group/scroll overflow-hidden')} type="hover"> <S.Root
className={classnames(className, 'group/scroll overflow-hidden')}
type={type ?? 'hover'}
>
<S.Viewport className="h-full w-full">{children}</S.Viewport> <S.Viewport className="h-full w-full">{children}</S.Viewport>
<ScrollBar orientation="vertical" /> <ScrollBar orientation="vertical" />
<ScrollBar orientation="horizontal" /> <ScrollBar orientation="horizontal" />
+10 -3
View File
@@ -6,6 +6,7 @@ import { Button } from '../Button';
import type { DropdownMenuRadioItem, DropdownMenuRadioProps } from '../Dropdown'; import type { DropdownMenuRadioItem, DropdownMenuRadioProps } from '../Dropdown';
import { DropdownMenuRadio, DropdownMenuTrigger } from '../Dropdown'; import { DropdownMenuRadio, DropdownMenuTrigger } from '../Dropdown';
import { Icon } from '../Icon'; import { Icon } from '../Icon';
import { ScrollArea } from '../ScrollArea';
import { HStack } from '../Stacks'; import { HStack } from '../Stacks';
import './Tabs.css'; import './Tabs.css';
@@ -47,8 +48,9 @@ export const Tabs = memo(function Tabs({
> >
<T.List <T.List
aria-label={label} aria-label={label}
className={classnames(tabListClassName, 'h-auto flex items-center overflow-x-auto pb-1')} className={classnames(tabListClassName, 'h-auto flex items-center pb-1')}
> >
<ScrollArea>
<HStack space={1}> <HStack space={1}>
{tabs.map((t) => { {tabs.map((t) => {
const isActive = t.value === value; const isActive = t.value === value;
@@ -84,7 +86,9 @@ export const Tabs = memo(function Tabs({
color="custom" color="custom"
size="sm" size="sm"
className={classnames( className={classnames(
isActive ? 'bg-gray-100 text-gray-900' : 'text-gray-600 hover:text-gray-900', isActive
? 'bg-gray-100 text-gray-900'
: 'text-gray-600 hover:text-gray-900',
)} )}
> >
{t.options.items.find((i) => i.value === t.options?.value)?.label ?? ''} {t.options.items.find((i) => i.value === t.options?.value)?.label ?? ''}
@@ -99,7 +103,9 @@ export const Tabs = memo(function Tabs({
color="custom" color="custom"
size="sm" size="sm"
className={classnames( className={classnames(
isActive ? 'bg-gray-100 text-gray-900' : 'text-gray-600 hover:text-gray-900', isActive
? 'bg-gray-100 text-gray-900'
: 'text-gray-600 hover:text-gray-900',
)} )}
> >
{t.label} {t.label}
@@ -109,6 +115,7 @@ export const Tabs = memo(function Tabs({
} }
})} })}
</HStack> </HStack>
</ScrollArea>
</T.List> </T.List>
{children} {children}
</T.Root> </T.Root>