迁移资产管理页签:三类资产卡/搜索筛选批量/AI 生成台抽屉;CardRow 皮肤抽为 CARD_ROW,SectionTitle/FilePick 支持 title
parent
1ea2c97827
commit
8d5e1b59af
|
|
@ -205,11 +205,13 @@ export function Check({ checked, onChange, children, disabled, className, title
|
|||
* 结果同一行里 chip 31px、上传 26px、按钮 38px 三种高度混在一起;
|
||||
* 这里并进 --ctl-h 体系,容器决定档位,页面不再调 padding。
|
||||
*/
|
||||
export function FilePick({ label, accept, multiple, onFiles, className }: {
|
||||
export function FilePick({ label, accept, multiple, onFiles, className, title }: {
|
||||
label: ReactNode; accept?: string; multiple?: boolean; onFiles: (files: File[]) => void; className?: string
|
||||
/** 悬浮说明「选出来的文件会落到哪里」:一页里上传点越多越需要这句话 */
|
||||
title?: string
|
||||
}) {
|
||||
return (
|
||||
<label className={cn('inline-flex h-(--ctl-h) flex-row items-center justify-center gap-[5px] m-0 cursor-pointer '
|
||||
<label title={title} className={cn('inline-flex h-(--ctl-h) flex-row items-center justify-center gap-[5px] m-0 cursor-pointer '
|
||||
+ 'rounded-chip border border-line-strong bg-hover px-[9px] text-tiny leading-[1.2] text-ink-2 '
|
||||
+ 'whitespace-nowrap shrink-0 hover:bg-raise hover:text-ink', className)}>
|
||||
{label}
|
||||
|
|
|
|||
|
|
@ -40,10 +40,17 @@ export function Eyebrow({ children, className }: { children: ReactNode; classNam
|
|||
return <div className={cn('text-tiny tracking-[1.6px] text-muted font-bold', className)}>{children}</div>
|
||||
}
|
||||
|
||||
/** 小标题 + 右侧动作(.small-label / .sect-act:增删按钮一律贴在标题行右端) */
|
||||
export function SectionTitle({ children, action, className }: { children: ReactNode; action?: ReactNode; className?: string }) {
|
||||
/**
|
||||
* 小标题 + 右侧动作(.small-label / .sect-act:增删按钮一律贴在标题行右端)。
|
||||
*
|
||||
* title 给整行挂悬浮解释:旧站把提示写在标题 h2 上,标题后面不拖一长串灰字,
|
||||
* 窄屏也就不会因为一句说明把动作按钮挤到下一行。
|
||||
*/
|
||||
export function SectionTitle({ children, action, className, title }: {
|
||||
children: ReactNode; action?: ReactNode; className?: string; title?: string
|
||||
}) {
|
||||
return (
|
||||
<div className={cn('flex items-center gap-2 flex-wrap text-tiny text-faint tracking-[.6px] font-bold mt-[14px] mb-2', className)}>
|
||||
<div title={title} className={cn('flex items-center gap-2 flex-wrap text-tiny text-faint tracking-[.6px] font-bold mt-[14px] mb-2', className)}>
|
||||
<span>{children}</span>
|
||||
{action && <span className="ml-auto inline-flex items-center gap-2 [--ctl-h:var(--ctl-h-md)]">{action}</span>}
|
||||
</div>
|
||||
|
|
@ -153,15 +160,26 @@ export function ExtLink({ href, children, className, download }: { href: string;
|
|||
return <a href={href} download={download} target="_blank" rel="noreferrer" className={cn('text-success text-caption no-underline hover:underline', className)}>{children}</a>
|
||||
}
|
||||
|
||||
/**
|
||||
* 卡片行皮肤(.cardrow)。
|
||||
* 单独导出类名常量:资产管理那张卡要在正文左边插勾选框和头像,套不进
|
||||
* CardRow 的「标题 + 正文 + 右侧动作」三段式,但它必须是同一条分隔线、
|
||||
* 同一套字号,否则两种卡片并排就能看出是两套东西。
|
||||
*/
|
||||
export const CARD_ROW = 'flex justify-between gap-3 items-start py-3 min-w-0 '
|
||||
+ 'border-b border-active last:border-b-0 '
|
||||
+ '[&_h4]:m-0 [&_h4]:mb-1 [&_h4]:text-[12.5px] [&_h4]:font-semibold [&_h4]:text-ink '
|
||||
+ '[&_p]:m-[3px]_0 [&_p]:text-caption [&_p]:text-muted [&_p]:leading-[1.55]'
|
||||
|
||||
/** 卡片行(.cardrow):标题 + 说明 + 右侧动作,列表里重复项的统一骨架 */
|
||||
export function CardRow({ title, children, right, className, tone = 'border' }: {
|
||||
title?: ReactNode; children?: ReactNode; right?: ReactNode; className?: string; tone?: 'border' | 'plain'
|
||||
}) {
|
||||
return (
|
||||
<div className={cn('flex justify-between gap-3 items-start py-3', tone === 'border' && 'border-b border-active last:border-b-0', className)}>
|
||||
<div className={cn(CARD_ROW, tone === 'plain' && 'border-b-0', className)}>
|
||||
<div className="min-w-0 flex-1">
|
||||
{title && <h4 className="m-0 mb-1 text-[12.5px] font-semibold">{title}</h4>}
|
||||
{children && <div className="[&_p]:m-[3px]_0 [&_p]:text-caption [&_p]:text-muted [&_p]:leading-[1.55]">{children}</div>}
|
||||
{title && <h4>{title}</h4>}
|
||||
{children && <div>{children}</div>}
|
||||
</div>
|
||||
{right && <div className="flex items-center gap-2 shrink-0 [--ctl-h:var(--ctl-h-md)]">{right}</div>}
|
||||
</div>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue