Fix pair editor container

This commit is contained in:
Gregory Schier
2023-03-20 01:18:44 -07:00
parent e54e88f46d
commit 63decdef8b
3 changed files with 66 additions and 55 deletions

View File

@@ -263,9 +263,9 @@ const FormRow = memo(function FormRow({
/>
<div
className={classNames(
'grid gap-2 items-center',
'@xs:!grid-rows-1 @sm:!grid-cols-[minmax(0,1fr)_minmax(0,1fr)]',
'grid-cols-1 grid-rows-2',
'grid items-center',
'@xs:gap-2 @xs:!grid-rows-1 @xs:!grid-cols-[minmax(0,1fr)_minmax(0,1fr)]',
'gap-0.5 grid-cols-1 grid-rows-2',
)}
>
<Input

View File

@@ -5,11 +5,15 @@ import type { ReactNode } from 'react';
interface Props {
children: ReactNode;
className?: string;
type?: S.ScrollAreaProps['type'];
}
export function ScrollArea({ children, className }: Props) {
export function ScrollArea({ children, className, type }: Props) {
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>
<ScrollBar orientation="vertical" />
<ScrollBar orientation="horizontal" />

View File

@@ -6,6 +6,7 @@ import { Button } from '../Button';
import type { DropdownMenuRadioItem, DropdownMenuRadioProps } from '../Dropdown';
import { DropdownMenuRadio, DropdownMenuTrigger } from '../Dropdown';
import { Icon } from '../Icon';
import { ScrollArea } from '../ScrollArea';
import { HStack } from '../Stacks';
import './Tabs.css';
@@ -47,8 +48,9 @@ export const Tabs = memo(function Tabs({
>
<T.List
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}>
{tabs.map((t) => {
const isActive = t.value === value;
@@ -84,7 +86,9 @@ export const Tabs = memo(function Tabs({
color="custom"
size="sm"
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 ?? ''}
@@ -99,7 +103,9 @@ export const Tabs = memo(function Tabs({
color="custom"
size="sm"
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}
@@ -109,6 +115,7 @@ export const Tabs = memo(function Tabs({
}
})}
</HStack>
</ScrollArea>
</T.List>
{children}
</T.Root>