chore(ui): TSDoc updates to UI package (#13246)
This commit is contained in:
@@ -21,11 +21,29 @@ import { CalendarButton } from "./calendar-button"
|
|||||||
import { CalendarGrid } from "./calendar-grid"
|
import { CalendarGrid } from "./calendar-grid"
|
||||||
|
|
||||||
interface CalendarValueProps {
|
interface CalendarValueProps {
|
||||||
|
/**
|
||||||
|
* The currently selected date.
|
||||||
|
*/
|
||||||
value?: Date | null
|
value?: Date | null
|
||||||
|
/**
|
||||||
|
* The date that is selected when the calendar first mounts (uncontrolled).
|
||||||
|
*/
|
||||||
defaultValue?: Date | null
|
defaultValue?: Date | null
|
||||||
|
/**
|
||||||
|
* A function that is triggered when the selected date changes.
|
||||||
|
*/
|
||||||
onChange?: (value: Date | null) => void
|
onChange?: (value: Date | null) => void
|
||||||
|
/**
|
||||||
|
* A function that determines whether a date is unavailable for selection.
|
||||||
|
*/
|
||||||
isDateUnavailable?: (date: Date) => boolean
|
isDateUnavailable?: (date: Date) => boolean
|
||||||
|
/**
|
||||||
|
* The minimum date that can be selected.
|
||||||
|
*/
|
||||||
minValue?: Date
|
minValue?: Date
|
||||||
|
/**
|
||||||
|
* The maximum date that can be selected.
|
||||||
|
*/
|
||||||
maxValue?: Date
|
maxValue?: Date
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,6 +54,8 @@ interface CalendarProps
|
|||||||
/**
|
/**
|
||||||
* Calendar component used to select a date.
|
* Calendar component used to select a date.
|
||||||
* Its props are based on [React Aria Calendar](https://react-spectrum.adobe.com/react-aria/Calendar.html#calendar-1).
|
* Its props are based on [React Aria Calendar](https://react-spectrum.adobe.com/react-aria/Calendar.html#calendar-1).
|
||||||
|
*
|
||||||
|
* @excludeExternal
|
||||||
*/
|
*/
|
||||||
const Calendar = (props: CalendarProps) => {
|
const Calendar = (props: CalendarProps) => {
|
||||||
const [value, setValue] = React.useState<CalendarDate | null | undefined>(
|
const [value, setValue] = React.useState<CalendarDate | null | undefined>(
|
||||||
|
|||||||
@@ -54,7 +54,18 @@ const CurrencyInput = React.forwardRef<HTMLInputElement, CurrencyInputProps>(
|
|||||||
* The currency code to show in the input.
|
* The currency code to show in the input.
|
||||||
*/
|
*/
|
||||||
code,
|
code,
|
||||||
|
/**
|
||||||
|
* Whether the input is disabled.
|
||||||
|
*
|
||||||
|
* @keep
|
||||||
|
* @defaultValue false
|
||||||
|
*/
|
||||||
disabled,
|
disabled,
|
||||||
|
/**
|
||||||
|
* A function that is triggered when the input is invalid.
|
||||||
|
*
|
||||||
|
* @keep
|
||||||
|
*/
|
||||||
onInvalid,
|
onInvalid,
|
||||||
className,
|
className,
|
||||||
...props
|
...props
|
||||||
|
|||||||
@@ -93,8 +93,19 @@ const Content = React.forwardRef<
|
|||||||
(
|
(
|
||||||
{
|
{
|
||||||
className,
|
className,
|
||||||
|
/**
|
||||||
|
* The space in pixels between the dropdown menu and its trigger element.
|
||||||
|
*/
|
||||||
sideOffset = 8,
|
sideOffset = 8,
|
||||||
|
/**
|
||||||
|
* The distance in pixels from the boundary edges where collision detection should occur.
|
||||||
|
*/
|
||||||
collisionPadding = 8,
|
collisionPadding = 8,
|
||||||
|
/**
|
||||||
|
* The alignment of the dropdown menu relative to its trigger element.
|
||||||
|
*
|
||||||
|
* @defaultValue center
|
||||||
|
*/
|
||||||
align = "center",
|
align = "center",
|
||||||
...props
|
...props
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import { clx } from "@/utils/clx"
|
|||||||
/**
|
/**
|
||||||
* This component is based on the [Radix UI Tabs](https://radix-ui.com/primitives/docs/components/tabs) primitves.
|
* This component is based on the [Radix UI Tabs](https://radix-ui.com/primitives/docs/components/tabs) primitves.
|
||||||
*
|
*
|
||||||
* @excludeExternal
|
|
||||||
*/
|
*/
|
||||||
const ProgressTabsRoot = (props: RadixTabs.TabsProps) => {
|
const ProgressTabsRoot = (props: RadixTabs.TabsProps) => {
|
||||||
return <RadixTabs.Root {...props} />
|
return <RadixTabs.Root {...props} />
|
||||||
|
|||||||
@@ -79,10 +79,29 @@ interface ChoiceBoxProps
|
|||||||
description: string
|
description: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This component is based on the [Radix UI Radio Group Item](https://www.radix-ui.com/primitives/docs/components/radio-group#item) primitives.
|
||||||
|
*/
|
||||||
const ChoiceBox = React.forwardRef<
|
const ChoiceBox = React.forwardRef<
|
||||||
React.ElementRef<typeof RadixRadioGroup.Item>,
|
React.ElementRef<typeof RadixRadioGroup.Item>,
|
||||||
ChoiceBoxProps
|
ChoiceBoxProps
|
||||||
>(({ className, id, label, description, ...props }, ref) => {
|
>(({
|
||||||
|
className,
|
||||||
|
id,
|
||||||
|
/**
|
||||||
|
* The label for the radio button.
|
||||||
|
*/
|
||||||
|
label,
|
||||||
|
/**
|
||||||
|
* The description for the radio button.
|
||||||
|
*/
|
||||||
|
description,
|
||||||
|
/**
|
||||||
|
* The value of the radio button.
|
||||||
|
*/
|
||||||
|
value,
|
||||||
|
...props
|
||||||
|
}: ChoiceBoxProps, ref) => {
|
||||||
const generatedId = React.useId()
|
const generatedId = React.useId()
|
||||||
|
|
||||||
if (!id) {
|
if (!id) {
|
||||||
@@ -102,6 +121,7 @@ const ChoiceBox = React.forwardRef<
|
|||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
{...props}
|
{...props}
|
||||||
|
value={value}
|
||||||
id={id}
|
id={id}
|
||||||
aria-describedby={descriptionId}
|
aria-describedby={descriptionId}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -23,19 +23,60 @@ interface TooltipProps
|
|||||||
* @excludeExternal
|
* @excludeExternal
|
||||||
*/
|
*/
|
||||||
const Tooltip = ({
|
const Tooltip = ({
|
||||||
|
/**
|
||||||
|
* The element to trigger the tooltip.
|
||||||
|
*
|
||||||
|
* @keep
|
||||||
|
*/
|
||||||
children,
|
children,
|
||||||
|
/**
|
||||||
|
* The content to display in the tooltip.
|
||||||
|
*/
|
||||||
content,
|
content,
|
||||||
|
/**
|
||||||
|
* Whether the tooltip is currently open.
|
||||||
|
*
|
||||||
|
* @keep
|
||||||
|
*/
|
||||||
open,
|
open,
|
||||||
|
/**
|
||||||
|
* Whether the tooltip is open by default.
|
||||||
|
*
|
||||||
|
* @keep
|
||||||
|
*/
|
||||||
defaultOpen,
|
defaultOpen,
|
||||||
|
/**
|
||||||
|
* A function that is called when the tooltip's open state changes.
|
||||||
|
*
|
||||||
|
* @keep
|
||||||
|
*/
|
||||||
onOpenChange,
|
onOpenChange,
|
||||||
|
/**
|
||||||
|
* The time in milliseconds to delay the tooltip's appearance.
|
||||||
|
*
|
||||||
|
* @keep
|
||||||
|
*/
|
||||||
delayDuration,
|
delayDuration,
|
||||||
/**
|
/**
|
||||||
* The maximum width of the tooltip.
|
* The maximum width of the tooltip.
|
||||||
*/
|
*/
|
||||||
maxWidth = 220,
|
maxWidth = 220,
|
||||||
className,
|
className,
|
||||||
|
/**
|
||||||
|
* The side to position the tooltip.
|
||||||
|
*
|
||||||
|
* @defaultValue top
|
||||||
|
*/
|
||||||
side,
|
side,
|
||||||
|
/**
|
||||||
|
* The distance in pixels between the tooltip and its trigger.
|
||||||
|
*
|
||||||
|
* @keep
|
||||||
|
*/
|
||||||
sideOffset = 8,
|
sideOffset = 8,
|
||||||
|
/**
|
||||||
|
* A function that is triggered when the tooltip is clicked.
|
||||||
|
*/
|
||||||
onClick,
|
onClick,
|
||||||
...props
|
...props
|
||||||
}: TooltipProps) => {
|
}: TooltipProps) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user