ui bug fixers
This commit is contained in:
@@ -35,7 +35,8 @@ type Props = {
|
||||
labels: string[]
|
||||
datasets: Array<{
|
||||
label?: string
|
||||
data: number[]
|
||||
/** `null` leaves an empty slot — used to pad the axis so a few bars sit at the start. */
|
||||
data: (number | null)[]
|
||||
backgroundColor?: string | string[]
|
||||
}>
|
||||
/** Container height in px — defaults to the original 260 so existing callers are unaffected. */
|
||||
|
||||
@@ -4,7 +4,13 @@ import * as React from "react"
|
||||
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
function Label({ className, ...props }: React.ComponentProps<"label">) {
|
||||
/** `required` appends a red asterisk to mark a mandatory field. */
|
||||
function Label({
|
||||
className,
|
||||
required,
|
||||
children,
|
||||
...props
|
||||
}: React.ComponentProps<"label"> & { required?: boolean }) {
|
||||
return (
|
||||
<label
|
||||
data-slot="label"
|
||||
@@ -13,7 +19,14 @@ function Label({ className, ...props }: React.ComponentProps<"label">) {
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
>
|
||||
{children}
|
||||
{required && (
|
||||
<span aria-hidden="true" className="-ml-1 text-destructive">
|
||||
*
|
||||
</span>
|
||||
)}
|
||||
</label>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user