[react] feat: Added docs for components/Ux
This commit is contained in:
parent
d8705ecc75
commit
5e5d3a0270
4 changed files with 49 additions and 7 deletions
|
@ -1,8 +1,16 @@
|
|||
import React from 'react'
|
||||
import { CircleIcon } from '@freesewing/react/components/Icon'
|
||||
|
||||
/**
|
||||
* A component to display the UX (control) setting
|
||||
*
|
||||
* @component
|
||||
* @param {object} props - All component props
|
||||
* @param {number} [props.ux = 0] - The value of the ux/control setting
|
||||
* @returns {JSX.Element}
|
||||
*/
|
||||
export const Ux = ({ ux = 0 }) => (
|
||||
<div className="flex flex-row">
|
||||
<div className="tw:flex tw:flex-row">
|
||||
{[0, 1, 2, 3, 4].map((i) => (
|
||||
<CircleIcon
|
||||
key={i}
|
||||
|
@ -14,8 +22,14 @@ export const Ux = ({ ux = 0 }) => (
|
|||
</div>
|
||||
)
|
||||
|
||||
/**
|
||||
* A component to display a mini version of the UX (control) setting
|
||||
*
|
||||
* @component
|
||||
* @param {object} props - All component props
|
||||
* @param {number} [props.ux = 0] - The value of the ux/control setting
|
||||
* @returns {JSX.Element}
|
||||
*/
|
||||
export const UxMini = ({ ux = 0 }) => (
|
||||
<div className="flex flex-row">
|
||||
<CircleIcon className={`tw:w-6 tw:h-6 tw:stroke-secondary tw:fill-secondary/20`} label={ux} />
|
||||
</div>
|
||||
<CircleIcon className={`tw:w-6 tw:h-6 tw:stroke-secondary tw:fill-secondary/20`} label={ux} />
|
||||
)
|
||||
|
|
|
@ -40,3 +40,4 @@ jsdoc -c jsdoc.json components/Tab/* > ../../sites/dev/prebuild/jsdoc/react/comp
|
|||
jsdoc -c jsdoc.json components/Table/* > ../../sites/dev/prebuild/jsdoc/react/components/table.json
|
||||
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
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
import React from 'react'
|
||||
import { Ux, UxMini } from '@freesewing/react/components/Ux'
|
||||
|
||||
export const UxExample = () => <Ux ux={4} />
|
||||
export const UxMiniExample = () => <UxMini ux={4} />
|
|
@ -2,6 +2,28 @@
|
|||
title: Ux
|
||||
---
|
||||
|
||||
:::note
|
||||
This page is yet to be created
|
||||
:::
|
||||
import { DocusaurusDoc } from '@freesewing/react/components/Docusaurus'
|
||||
import { ComponentDocs } from '@site/src/components/component-docs.js'
|
||||
import * as jsdoc from '@site/prebuild/jsdoc/components.ux.mjs'
|
||||
import { UxExample, UxMiniExample } from './_examples.js'
|
||||
|
||||
<DocusaurusDoc>
|
||||
|
||||
- [Components](#components)
|
||||
|
||||
## Components
|
||||
|
||||
The **Ux** component family provides the following components:
|
||||
|
||||
- [Ux](#ux)
|
||||
- [UxMini](#uxmini)
|
||||
|
||||
### Ux
|
||||
|
||||
<ComponentDocs docs={jsdoc.jsdocUx} example={UxExample} />
|
||||
|
||||
### UxMini
|
||||
|
||||
<ComponentDocs docs={jsdoc.jsdocUxMini} example={UxMiniExample} />
|
||||
|
||||
</DocusaurusDoc>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue