Move banner to ui package

This commit is contained in:
Gregory Schier
2026-03-12 19:18:13 -07:00
parent bc8a449b8a
commit d253d1605c
33 changed files with 34 additions and 48 deletions

View File

@@ -1,28 +0,0 @@
import classNames from 'classnames';
import type { ReactNode } from 'react';
export interface BannerProps {
children: ReactNode;
className?: string;
color?: 'primary' | 'secondary' | 'success' | 'notice' | 'warning' | 'danger' | 'info';
}
export function Banner({ children, className, color }: BannerProps) {
return (
<div className="w-auto grid grid-rows-1 max-h-full flex-0">
<div
className={classNames(
className,
color && 'bg-surface',
`x-theme-banner--${color}`,
'border border-border border-dashed',
'px-4 py-2 rounded-lg select-auto cursor-auto',
'overflow-auto text-text',
'mb-auto', // Don't stretch all the way down if the parent is in grid or flexbox
)}
>
{children}
</div>
</div>
);
}

View File

@@ -3,8 +3,8 @@ import { atom, useAtom } from 'jotai';
import type { HTMLAttributes, ReactNode } from 'react';
import { useMemo } from 'react';
import { atomWithKVStorage } from '../../lib/atoms/atomWithKVStorage';
import type { BannerProps } from './Banner';
import { Banner } from './Banner';
import type { BannerProps } from '@yaakapp-internal/ui';
import { Banner } from '@yaakapp-internal/ui';
interface Props extends HTMLAttributes<HTMLDetailsElement> {
summary: ReactNode;

View File

@@ -1,8 +1,8 @@
import type { Color } from '@yaakapp-internal/plugins';
import classNames from 'classnames';
import { useKeyValue } from '../../hooks/useKeyValue';
import type { BannerProps } from './Banner';
import { Banner } from './Banner';
import type { BannerProps } from '@yaakapp-internal/ui';
import { Banner } from '@yaakapp-internal/ui';
import { Button } from './Button';
import { HStack } from './Stacks';

View File

@@ -5,10 +5,9 @@ import { useCallback, useMemo, useRef, useState } from 'react';
import { useEventViewerKeyboard } from '../../hooks/useEventViewerKeyboard';
import { CopyIconButton } from '../CopyIconButton';
import { AutoScroller } from './AutoScroller';
import { Banner } from './Banner';
import { Button } from './Button';
import { Separator } from './Separator';
import { SplitLayout } from '@yaakapp-internal/ui';
import { Banner, SplitLayout } from '@yaakapp-internal/ui';
import { HStack } from './Stacks';
import { IconButton } from './IconButton';
import classNames from 'classnames';