From a6604eb2c6fd8608a4505160d4401da1ad7b01e9 Mon Sep 17 00:00:00 2001 From: Dimitri POSTOLOV Date: Mon, 24 Mar 2025 20:24:06 +0100 Subject: [PATCH 1/2] fix: improve TSDoc comments for `BackgroundProps` --- .../additional-components/Background/types.ts | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/packages/react/src/additional-components/Background/types.ts b/packages/react/src/additional-components/Background/types.ts index 50219e2d..d805a91c 100644 --- a/packages/react/src/additional-components/Background/types.ts +++ b/packages/react/src/additional-components/Background/types.ts @@ -16,6 +16,7 @@ export enum BackgroundVariant { * @expand */ export type BackgroundProps = { + /** When multiple backgrounds are present on the page, each one should have a unique id. */ id?: string; /** Color of the pattern */ color?: string; @@ -25,16 +26,31 @@ export type BackgroundProps = { className?: string; /** Class applied to the pattern */ 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]; - /** 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; - /** Offset of the pattern */ + /** + * Offset of the pattern + * @default 2 + */ offset?: number | [number, number]; - /** Line width of the Line pattern */ + /** + * The stroke thickness used when drawing the pattern. + * @default 1 + */ lineWidth?: number; /** * Variant of the pattern + * @default BackgroundVariant.Dots * @example BackgroundVariant.Lines, BackgroundVariant.Dots, BackgroundVariant.Cross * 'lines', 'dots', 'cross' */ From 0cdda42cdd1cd43d43d43c44e54b7b9f7a716ca9 Mon Sep 17 00:00:00 2001 From: Dimitri POSTOLOV Date: Mon, 24 Mar 2025 20:25:24 +0100 Subject: [PATCH 2/2] Create empty-swans-exercise.md --- .changeset/empty-swans-exercise.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/empty-swans-exercise.md diff --git a/.changeset/empty-swans-exercise.md b/.changeset/empty-swans-exercise.md new file mode 100644 index 00000000..8769d594 --- /dev/null +++ b/.changeset/empty-swans-exercise.md @@ -0,0 +1,5 @@ +--- +"@xyflow/react": patch +--- + +fix: improve TSDoc comments for `BackgroundProps`