[react] feat: Added docs for components/Mini
This commit is contained in:
parent
17619aebcb
commit
7317ff5dd8
4 changed files with 66 additions and 2 deletions
|
@ -1,6 +1,14 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { TipIcon, ChatIcon, WarningIcon } from '@freesewing/react/components/Icon'
|
import { TipIcon, ChatIcon, WarningIcon } from '@freesewing/react/components/Icon'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A component to display a mini tip
|
||||||
|
*
|
||||||
|
* @component
|
||||||
|
* @param {object} props - All component props
|
||||||
|
* @param {JSX.Element} props.children - The component children, will be rendered inside the mini tip
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
*/
|
||||||
export const MiniTip = ({ children }) => (
|
export const MiniTip = ({ children }) => (
|
||||||
<div className="tw:flex tw:flex-row tw:border tw:border-success tw:rounded">
|
<div className="tw:flex tw:flex-row tw:border tw:border-success tw:rounded">
|
||||||
<div className="tw:bg-success tw:text-success-content tw:p-1 tw:rounded-l tw:flex tw:flex-row tw:items-center">
|
<div className="tw:bg-success tw:text-success-content tw:p-1 tw:rounded-l tw:flex tw:flex-row tw:items-center">
|
||||||
|
@ -12,6 +20,14 @@ export const MiniTip = ({ children }) => (
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A component to display a mini note
|
||||||
|
*
|
||||||
|
* @component
|
||||||
|
* @param {object} props - All component props
|
||||||
|
* @param {JSX.Element} props.children - The component children, will be rendered inside the mini note
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
*/
|
||||||
export const MiniNote = ({ children }) => (
|
export const MiniNote = ({ children }) => (
|
||||||
<div className="tw:flex tw:flex-row tw:border tw:border-info tw:rounded">
|
<div className="tw:flex tw:flex-row tw:border tw:border-info tw:rounded">
|
||||||
<div className="tw:bg-info tw:text-info-content tw:p-1 tw:rounded-l tw:flex tw:flex-row tw:items-center">
|
<div className="tw:bg-info tw:text-info-content tw:p-1 tw:rounded-l tw:flex tw:flex-row tw:items-center">
|
||||||
|
@ -23,6 +39,14 @@ export const MiniNote = ({ children }) => (
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A component to display a mini warning
|
||||||
|
*
|
||||||
|
* @component
|
||||||
|
* @param {object} props - All component props
|
||||||
|
* @param {JSX.Element} props.children - The component children, will be rendered inside the mini warning
|
||||||
|
* @returns {JSX.Element}
|
||||||
|
*/
|
||||||
export const MiniWarning = ({ children }) => (
|
export const MiniWarning = ({ children }) => (
|
||||||
<div className="tw:flex tw:flex-row tw:border tw:border-warning tw:rounded">
|
<div className="tw:flex tw:flex-row tw:border tw:border-warning tw:rounded">
|
||||||
<div className="tw:bg-warning tw:text-warning-content tw:p-1 tw:rounded-l tw:flex tw:flex-row tw:items-center">
|
<div className="tw:bg-warning tw:text-warning-content tw:p-1 tw:rounded-l tw:flex tw:flex-row tw:items-center">
|
||||||
|
|
|
@ -21,3 +21,4 @@ jsdoc -c jsdoc.json components/Layout/* > ../../sites/dev/prebuild/jsdoc/react/c
|
||||||
jsdoc -c jsdoc.json components/LineDrawing/* > ../../sites/dev/prebuild/jsdoc/react/components/linedrawing.json
|
jsdoc -c jsdoc.json components/LineDrawing/* > ../../sites/dev/prebuild/jsdoc/react/components/linedrawing.json
|
||||||
jsdoc -c jsdoc.json components/Link/* > ../../sites/dev/prebuild/jsdoc/react/components/link.json
|
jsdoc -c jsdoc.json components/Link/* > ../../sites/dev/prebuild/jsdoc/react/components/link.json
|
||||||
jsdoc -c jsdoc.json components/Logo/* > ../../sites/dev/prebuild/jsdoc/react/components/logo.json
|
jsdoc -c jsdoc.json components/Logo/* > ../../sites/dev/prebuild/jsdoc/react/components/logo.json
|
||||||
|
jsdoc -c jsdoc.json components/Mini/* > ../../sites/dev/prebuild/jsdoc/react/components/mini.json
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
import React from 'react'
|
||||||
|
import { MiniNote, MiniTip, MiniWarning } from '@freesewing/react/components/Mini'
|
||||||
|
|
||||||
|
export const MiniNoteExample = () => <MiniNote>I am a note, a mini note</MiniNote>
|
||||||
|
export const MiniTipExample = () => <MiniTip>I am a tip, a mini tip</MiniTip>
|
||||||
|
export const MiniWarningExample = () => <MiniWarning>I am a warning, a mini warning</MiniWarning>
|
|
@ -2,6 +2,39 @@
|
||||||
title: Mini
|
title: Mini
|
||||||
---
|
---
|
||||||
|
|
||||||
:::note
|
import { DocusaurusDoc } from '@freesewing/react/components/Docusaurus'
|
||||||
This page is yet to be created
|
import { ComponentDocs } from '@site/src/components/component-docs.js'
|
||||||
|
import * as jsdoc from '@site/prebuild/jsdoc/components.mini.mjs'
|
||||||
|
import {
|
||||||
|
MiniNoteExample,
|
||||||
|
MiniTipExample,
|
||||||
|
MiniWarningExample,
|
||||||
|
} from './_examples.js'
|
||||||
|
|
||||||
|
|
||||||
|
<DocusaurusDoc>
|
||||||
|
|
||||||
|
The __Mini__ component family provides the following components:
|
||||||
|
|
||||||
|
- [MiniNote](#mininote)
|
||||||
|
- [MiniTip](#minitip)
|
||||||
|
- [MiniWarning](#miniwarning)
|
||||||
|
|
||||||
|
:::tip
|
||||||
|
These components are typically used when a
|
||||||
|
[Popout](/reference/packages/react/components/popout/) would take up too much
|
||||||
|
space.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
|
||||||
|
## MiniNote
|
||||||
|
<ComponentDocs docs={jsdoc.jsdocMiniNote} example={MiniNoteExample} />
|
||||||
|
|
||||||
|
## MiniTip
|
||||||
|
<ComponentDocs docs={jsdoc.jsdocMiniTip} example={MiniTipExample} />
|
||||||
|
|
||||||
|
## MiniWarning
|
||||||
|
<ComponentDocs docs={jsdoc.jsdocMiniWarning} example={MiniWarningExample} />
|
||||||
|
|
||||||
|
</DocusaurusDoc>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue