File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ import { Label } from "~ui/input/label/Label"
2+ import { LabelAsterix } from "~ui/input/label/LabelAsterix"
3+ import type { MayHaveChildren } from "~ui/utils/MayHaveChildren"
4+ import { classMerge } from "~ui/utils/classMerge"
5+
6+ export interface Label2Props extends MayHaveChildren {
7+ title : string
8+ subtitle ?: string
9+ required ?: boolean
10+ labelClass ?: string
11+ disabled ?: boolean
12+ id ?: string
13+ }
14+
15+ export interface Label2PropsFor extends Label2Props {
16+ forId : string
17+ }
18+
19+ export function LabelWithSubtitle ( p : Label2PropsFor ) {
20+ return (
21+ < Label class = { classMerge ( "flex items-end" , p . labelClass ) } for = { p . forId } id = { p . id } >
22+ < span > { p . title } </ span >
23+ { p . required && < LabelAsterix /> }
24+ { p . subtitle && (
25+ < >
26+ < br />
27+ < span class = { "font-normal whitespace-normal" } > { p . subtitle } </ span >
28+ </ >
29+ ) }
30+ { p . children }
31+ </ Label >
32+ )
33+ }
You can’t perform that action at this time.
0 commit comments