[react] feat: Added docs for components/Xray
This commit is contained in:
parent
5e5d3a0270
commit
0a345b3347
5 changed files with 64 additions and 7 deletions
|
@ -17,7 +17,7 @@ import { getId, getProps, withinPartBounds, translateStrings } from './utils.mjs
|
|||
import { Link as WebLink } from '@freesewing/react/components/Link'
|
||||
|
||||
/**
|
||||
* Default pattern components that you can override
|
||||
* Default Pattern components that you can override
|
||||
*
|
||||
* @public
|
||||
* @constant
|
||||
|
@ -45,7 +45,7 @@ const defaultComponents = {
|
|||
* @param {JSX.Element} props.children - The component children, if they are set, we will not render any stacks
|
||||
* @param {string} [props.className = 'freesewing pattern'] - SVG classes to set on the SVG element
|
||||
* @param {object} [props.components = {}] - Any custom components to use in the pattern
|
||||
* @param {object} [props.string = {}] - Strings to use for translation
|
||||
* @param {object} [props.strings = {}] - Strings to use for translation
|
||||
* @param {object} props.renderProps - The pattern's renderProps as generated by FreeSewing core
|
||||
* @returns {JSX.Element}
|
||||
*/
|
||||
|
|
|
@ -3,14 +3,30 @@ import { defaultComponents as patternComponents } from '@freesewing/react/compon
|
|||
import { PointXray } from './point.mjs'
|
||||
import { PathXray } from './path.mjs'
|
||||
|
||||
/*
|
||||
* Allow people to override these components
|
||||
/**
|
||||
* Default Xray components that you can override
|
||||
*
|
||||
* @public
|
||||
* @constant
|
||||
*/
|
||||
const defaultComponents = {
|
||||
Point: PointXray,
|
||||
Path: PathXray,
|
||||
}
|
||||
|
||||
/**
|
||||
* A component to code-highlight JSON data
|
||||
*
|
||||
* @component
|
||||
* @param {object} props - All component props
|
||||
* @param {JSX.Element} props.children - The component children, if they are set, we will not render any stacks
|
||||
* @param {string} [props.className = 'freesewing pattern'] - SVG classes to set on the SVG element
|
||||
* @param {object} [props.components = {}] - Any custom components to use in the pattern
|
||||
* @param {object} [props.drillProps = {}] - Any additional props to pass down
|
||||
* @param {object} [props.strings = {}] - Strings to use for translation
|
||||
* @param {object} props.renderProps - The pattern's renderProps as generated by FreeSewing core
|
||||
* @returns {JSX.Element}
|
||||
*/
|
||||
export const Xray = forwardRef((props, ref) => {
|
||||
if (!props.renderProps) return null
|
||||
|
||||
|
|
|
@ -41,3 +41,4 @@ jsdoc -c jsdoc.json components/Table/* > ../../sites/dev/prebuild/jsdoc/react/co
|
|||
jsdoc -c jsdoc.json components/Time/* > ../../sites/dev/prebuild/jsdoc/react/components/time.json
|
||||
jsdoc -c jsdoc.json components/Uuid/* > ../../sites/dev/prebuild/jsdoc/react/components/uuid.json
|
||||
jsdoc -c jsdoc.json components/Ux/* > ../../sites/dev/prebuild/jsdoc/react/components/ux.json
|
||||
jsdoc -c jsdoc.json components/Xray/* > ../../sites/dev/prebuild/jsdoc/react/components/xray.json
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue