diff --git a/packages/react/components/Modal/index.mjs b/packages/react/components/Modal/index.mjs index f6678774849..d9a1b527751 100644 --- a/packages/react/components/Modal/index.mjs +++ b/packages/react/components/Modal/index.mjs @@ -12,17 +12,19 @@ const slideClasses = { /** * This component wraps modal content, making sure the layout is ok and handling transitions * - * @param {object} props - All React props - * @param {array} children - Content to render inside the modal - * @param {string} flex - Flexbox direction (row or col) - * @param {string} justify - Flexbox justify value - * @param {string} items - Flexbox items value - * @param {string} bg - Background - * @param {string} bgOpacity - Background opacity - * @param {bool} bare - Set true to not handle layout - * @param {bool} keepOpenOnClick - Set to true to prevent a click in the modal content to close the modal - * @param {string} slideFrom - Direction to slide in from - * @param {bool} fullWidth - Set to true to not constrain the width + * @component + * @param {object} props - All component props + * @param {JSX.Element} props.children - The component children, will be rendered inside the mini tip + * @param {string} [props.flex = row] - Flexbox direction (row or col) + * @param {string} [props.justify = center] - Flexbox justify value + * @param {string} [props.items = center] - Flexbox items value + * @param {string} [props.bg = neutral] - Background color (one of the DaisyUI named colors) + * @param {string} [props.bgOpacity = 70] - Background opacity + * @param {bool} [props.bare = false] - Set true to not handle layout within the wrapper + * @param {bool} [keepOpenOnClick = false] - Set to true to prevent a click in the modal content from closing the modal + * @param {string} [slideFrom = left] - Direction to slide in from on mobile + * @param {bool} [fullWidth = false] - Set to true to not constrain the width + * @returns {JSX.Element} */ export const ModalWrapper = ({ children = null, diff --git a/packages/react/mkdocs.sh b/packages/react/mkdocs.sh index 4955731102d..edc1f9764b8 100755 --- a/packages/react/mkdocs.sh +++ b/packages/react/mkdocs.sh @@ -22,3 +22,4 @@ jsdoc -c jsdoc.json components/LineDrawing/* > ../../sites/dev/prebuild/jsdoc/re 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/Mini/* > ../../sites/dev/prebuild/jsdoc/react/components/mini.json +jsdoc -c jsdoc.json components/Modal/* > ../../sites/dev/prebuild/jsdoc/react/components/modal.json diff --git a/sites/dev/docs/reference/packages/react/components/modal/_examples.js b/sites/dev/docs/reference/packages/react/components/modal/_examples.js new file mode 100644 index 00000000000..f1c44a61420 --- /dev/null +++ b/sites/dev/docs/reference/packages/react/components/modal/_examples.js @@ -0,0 +1,73 @@ +import React, { useContext } from 'react' +import { ModalContext } from '@freesewing/react/context/Modal' +import { ModalWrapper } from '@freesewing/react/components/Modal' +import { MiniTip } from '@freesewing/react/components/Mini' + +export const ModalWrapperExample = () => { + const { setModal, clearModal } = useContext(ModalContext) + + return ( +
+ + + + + + + + + + +
+ ) +} + +const Content = () => ( + <> +
+

Title 1

+

Some modal content here

+
+
+

Title 2

+

Some modal content here

+
+
+

Title 3

+

Some modal content here

+
+ +) diff --git a/sites/dev/docs/reference/packages/react/components/modal/readme.mdx b/sites/dev/docs/reference/packages/react/components/modal/readme.mdx index 07559473e1e..ff533885b81 100644 --- a/sites/dev/docs/reference/packages/react/components/modal/readme.mdx +++ b/sites/dev/docs/reference/packages/react/components/modal/readme.mdx @@ -2,6 +2,20 @@ title: Modal --- -:::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.modal.mjs' +import { ModalWrapperExample } from './_examples.js' + + + + +The __Modal component family provides the following components: + +- [ModalWrapper](#modalwrapper) + +## ModalWrapper + + + +