dify/packages/dify-ui/src/fieldset/index.tsx
yyh 04d62867af
feat(dify-ui): add shared form primitives (#36334)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-05-19 05:38:57 +00:00

42 lines
860 B
TypeScript

'use client'
import type { Fieldset as BaseFieldsetNS } from '@base-ui/react/fieldset'
import { Fieldset as BaseFieldset } from '@base-ui/react/fieldset'
import { cn } from '../cn'
export type FieldsetRootProps
= Omit<BaseFieldsetNS.Root.Props, 'className'>
& {
className?: string
}
export function FieldsetRoot({
className,
...props
}: FieldsetRootProps) {
return (
<BaseFieldset.Root
className={cn('m-0 min-w-0 border-0 p-0', className)}
{...props}
/>
)
}
export type FieldsetLegendProps
= Omit<BaseFieldsetNS.Legend.Props, 'className'>
& {
className?: string
}
export function FieldsetLegend({
className,
...props
}: FieldsetLegendProps) {
return (
<BaseFieldset.Legend
className={cn('mb-1 py-1 text-text-secondary system-sm-medium', className)}
{...props}
/>
)
}