diff --git a/packages/react/components/Heading/index.mjs b/packages/react/components/Heading/index.mjs index 5d9e4a159bd..80eac07d0ff 100644 --- a/packages/react/components/Heading/index.mjs +++ b/packages/react/components/Heading/index.mjs @@ -1,37 +1,122 @@ import React from 'react' +/** + * A component to renderd a styled H1 tag. + * + * Because of the TailwindCSS reset, common tags are unstyled. + * When you need to render a H1 tag outside of a context where it is + * automatically styled (such as inside markdown) you can use this. + * Alternatively, you can wrap your content in div.prose which will apply the + * styles in CSS. + * + * @component + * @param {object} props - All component props + * @param {JSX.element} props.children - The component children + * @returns {JSX.Element} + */ export const H1 = ({ children }) => (

{children}

) +/** + * A component to renderd a styled H2 tag. + * + * Because of the TailwindCSS reset, common tags are unstyled. + * When you need to render a H2 tag outside of a context where it is + * automatically styled (such as inside markdown) you can use this. + * Alternatively, you can wrap your content in div.prose which will apply the + * styles in CSS. + * + * @component + * @param {object} props - All component props + * @param {JSX.element} props.children - The component children + * @returns {JSX.Element} + */ export const H2 = ({ children }) => (

{children}

) +/** + * A component to renderd a styled H3 tag. + * + * Because of the TailwindCSS reset, common tags are unstyled. + * When you need to render a H3 tag outside of a context where it is + * automatically styled (such as inside markdown) you can use this. + * Alternatively, you can wrap your content in div.prose which will apply the + * styles in CSS. + * + * @component + * @param {object} props - All component props + * @param {JSX.element} props.children - The component children + * @returns {JSX.Element} + */ export const H3 = ({ children }) => (

{children}

) +/** + * A component to renderd a styled H4 tag. + * + * Because of the TailwindCSS reset, common tags are unstyled. + * When you need to render a H4 tag outside of a context where it is + * automatically styled (such as inside markdown) you can use this. + * Alternatively, you can wrap your content in div.prose which will apply the + * styles in CSS. + * + * @component + * @param {object} props - All component props + * @param {JSX.element} props.children - The component children + * @returns {JSX.Element} + */ export const H4 = ({ children }) => (

{children}

) +/** + * A component to renderd a styled H5 tag. + * + * Because of the TailwindCSS reset, common tags are unstyled. + * When you need to render a H5 tag outside of a context where it is + * automatically styled (such as inside markdown) you can use this. + * Alternatively, you can wrap your content in div.prose which will apply the + * styles in CSS. + * + * @component + * @param {object} props - All component props + * @param {JSX.element} props.children - The component children + * @returns {JSX.Element} + */ export const H5 = ({ children }) => (
{children}
) +/** + * A component to renderd a styled H6 tag. + * + * Because of the TailwindCSS reset, common tags are unstyled. + * When you need to render a H6 tag outside of a context where it is + * automatically styled (such as inside markdown) you can use this. + * Alternatively, you can wrap your content in div.prose which will apply the + * styles in CSS. + * + * @component + * @param {object} props - All component props + * @param {JSX.element} props.children - The component children + * @returns {JSX.Element} + */ export const H6 = ({ children }) => (
{children}
) + diff --git a/packages/react/mkdocs.sh b/packages/react/mkdocs.sh index 4f1e3e431c0..5417b2685f8 100755 --- a/packages/react/mkdocs.sh +++ b/packages/react/mkdocs.sh @@ -11,3 +11,4 @@ jsdoc -c jsdoc.json components/CuratedSet/* > ../../sites/dev/prebuild/jsdoc/rea jsdoc -c jsdoc.json components/Docusaurus/* > ../../sites/dev/prebuild/jsdoc/react/components/docusaurus.json jsdoc -c jsdoc.json components/Echart/* > ../../sites/dev/prebuild/jsdoc/react/components/echart.json jsdoc -c jsdoc.json components/Editor/* > ../../sites/dev/prebuild/jsdoc/react/components/editor.json +jsdoc -c jsdoc.json components/Heading/* > ../../sites/dev/prebuild/jsdoc/react/components/heading.json diff --git a/sites/dev/docs/reference/packages/react/components/heading/_examples.js b/sites/dev/docs/reference/packages/react/components/heading/_examples.js new file mode 100644 index 00000000000..90a684c5d8a --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/heading/_examples.js @@ -0,0 +1,17 @@ +import React from 'react' +import { + H1, + H2, + H3, + H4, + H5, + H6, +} from '@freesewing/react/components/Heading' + +export const H1Example = () =>

This is H1

+export const H2Example = () =>

This is H2

+export const H3Example = () =>

This is H3

+export const H4Example = () =>

This is H4

+export const H5Example = () =>
This is H5
+export const H6Example = () =>
This is H6
+ diff --git a/sites/dev/docs/reference/packages/react/components/heading/readme.mdx b/sites/dev/docs/reference/packages/react/components/heading/readme.mdx index 30b79fe345c..10b819bdc54 100644 --- a/sites/dev/docs/reference/packages/react/components/heading/readme.mdx +++ b/sites/dev/docs/reference/packages/react/components/heading/readme.mdx @@ -2,6 +2,53 @@ title: Heading --- -:::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 { + jsdocH1, + jsdocH2, + jsdocH3, + jsdocH4, + jsdocH5, + jsdocH6, +} from '@site/prebuild/jsdoc/components.heading.mjs' +import { + H1Example, + H2Example, + H3Example, + H4Example, + H5Example, + H6Example, +} from './_examples.js' + + + +The **Button** component family provides the following components: + +- [H1](#h1) +- [H2](#h2) +- [H3](#h3) +- [H4](#h4) +- [H5](#h5) +- [H6](#h6) + +## H1 + + +## H2 + + +## H3 + + +## H4 + + +## H5 + + +## H6 + + + +