1
0
Fork 0

feat(dev): Added react docs for Pattern + refactor

This adds support for not only documenating components, but also
constants and functions that may be exported next to components.
This commit is contained in:
joostdecock 2025-05-25 16:29:57 +02:00
parent d0baf7cece
commit 22a89f12d3
50 changed files with 1816 additions and 669 deletions

View file

@ -2,6 +2,21 @@
import React from 'react'
import { forwardRef } from 'react'
/**
* A component to render an SVG tag to hold a FreeSewing pattern
*
* @component
* @param {object} props - All component props
* @param {JSX.Element} props.children - The component children, will be rendered inside the SVG tag
* @param {strign} [props.className = 'freesewing pattern'] - The CSS classes to apply to the SVG tag
* @param {string} [props.embed = true] - Set this to false to output SVG suitable for printing rather than auto-scaled SVG
* @param {number} props.heigth - The pattern height in mm
* @param {string} [props.locale = en] - The locale/language to use
* @param {object} [props.style = {}] - Any additional style to apply to the SVG tag
* @param {object} [props.viewBox = false] - Set this to use a custom viewBox attribute rather than the default 0 0 width height
* @param {number} props.width - The pattern width in mm
* @returns {JSX.Element}
*/
export const Svg = forwardRef(
(
{