fix: improve TSDoc comments for BackgroundProps

This commit is contained in:
Dimitri POSTOLOV
2025-03-24 20:24:06 +01:00
parent 637d7b2ee7
commit a6604eb2c6
@@ -16,6 +16,7 @@ export enum BackgroundVariant {
* @expand * @expand
*/ */
export type BackgroundProps = { export type BackgroundProps = {
/** When multiple backgrounds are present on the page, each one should have a unique id. */
id?: string; id?: string;
/** Color of the pattern */ /** Color of the pattern */
color?: string; color?: string;
@@ -25,16 +26,31 @@ export type BackgroundProps = {
className?: string; className?: string;
/** Class applied to the pattern */ /** Class applied to the pattern */
patternClassName?: string; patternClassName?: string;
/** Gap between repetitions of the pattern */ /**
* The gap between patterns. Passing in a tuple allows you to control the x and y gap
* independently.
* @default '28'
*/
gap?: number | [number, number]; gap?: number | [number, number];
/** Size of a single pattern element */ /**
* The radius of each dot or the size of each rectangle if `BackgroundVariant.Dots` or
* `BackgroundVariant.Cross` is used. This defaults to 1 or 6 respectively, or ignored if
* `BackgroundVariant.Lines` is used.
*/
size?: number; size?: number;
/** Offset of the pattern */ /**
* Offset of the pattern
* @default 2
*/
offset?: number | [number, number]; offset?: number | [number, number];
/** Line width of the Line pattern */ /**
* The stroke thickness used when drawing the pattern.
* @default 1
*/
lineWidth?: number; lineWidth?: number;
/** /**
* Variant of the pattern * Variant of the pattern
* @default BackgroundVariant.Dots
* @example BackgroundVariant.Lines, BackgroundVariant.Dots, BackgroundVariant.Cross * @example BackgroundVariant.Lines, BackgroundVariant.Dots, BackgroundVariant.Cross
* 'lines', 'dots', 'cross' * 'lines', 'dots', 'cross'
*/ */