{"name":"@theme-ui/mdx","version":"0.15.0-develop.30","source":"src/index.ts","main":"dist/theme-ui-mdx.cjs.js","module":"dist/theme-ui-mdx.esm.js","sideEffects":false,"dependencies":{"@theme-ui/core":"^0.15.0-develop.30","@theme-ui/css":"^0.15.0-develop.30"},"peerDependencies":{"@emotion/react":"^11","react":">=18","@types/mdx":"^2.0.2"},"devDependencies":{"@mdx-js/mdx-v2":"npm:@mdx-js/mdx@^2.1.2","@mdx-js/react-v2":"npm:@mdx-js/react@^2.1.2","@types/mdx":"^2.0.2","react":"^18.1.0","remark-gfm":"^3.0.1","@babel/core":"^7","@types/react":"^18","@theme-ui/test-utils":"^0.15.0-develop.30"},"author":{"name":"Brent Jackson"},"repository":{"type":"git","url":"git+https://github.com/system-ui/theme-ui.git"},"license":"MIT","publishConfig":{"access":"public"},"gitHead":"621199460fa3bdb0100748441e62517b7529b8c8","scripts":{},"types":"./dist/theme-ui-mdx.cjs.d.ts","readme":"# @theme-ui/mdx\n\nMDX utilities for Theme UI\n\nhttps://theme-ui.com\n\n```sh\nnpm i @theme-ui/mdx\n```\n\n## API\n\n### `useThemedStylesWithMdx`\n\nWraps an object of components provided to `MDXProvider` with styles from\n`theme.styles`.\n\n_example usage:_\n\n```tsx\nimport {\n  MDXProvider,\n  useMDXComponents,\n  Components as MDXComponents,\n  MergeComponents as MergeMDXComponents,\n} from '@mdx-js/react'\nimport { useThemedStylesWithMdx } from '@theme-ui/mdx'\nimport { ThemeProvider, Theme } from 'theme-ui'\n\ninterface MyProviderProps {\n  theme: Theme\n  components?: MDXComponents | MergeMDXComponents\n  children: React.ReactNode\n}\nfunction MyProvider({ theme, components, children }: MyProviderProps) {\n  const componentsWithStyles = useThemedStylesWithMdx(\n    useMDXComponents(components)\n  )\n\n  return (\n    <ThemeProvider theme={theme}>\n      <MDXProvider components={componentsWithStyles}>{children}</MDXProvider>\n    </ThemeProvider>\n  )\n}\n```\n\n### `Themed`\n\nUse the `Themed` components dict to render UI with styles from\n[`theme.styles`](https://theme-ui.com/theming#styles) _outside_ of MDX. Useful\nfor consistent styling in components meant for embedding in MDX.\n\nFor example, if you'd like to reuse heading styles in a React component, you can\nuse the `Themed.h1` component to render an `<h1>` element with styles from\n`theme.styles.h1`.\n\n```tsx\nimport type { ComponentPropsWithoutRef } from 'react'\nimport { Themed } from '@theme-ui/mdx'\n\nconst createHeadingWithLink =\n  (Level: 'h2' | 'h3' | 'h4' | 'h5' | 'h6') =>\n  (props: ComponentPropsWithoutRef<'h2'>) =>\n    (\n      <Level {...props}>\n        {props.id && (\n          <a\n            href={`#${props.id}`}\n            sx={{\n              color: 'inherit',\n              textDecoration: 'none',\n              ':hover': {\n                textDecoration: 'underline',\n              },\n            }}\n          >\n            {props.children}\n          </a>\n        )}\n      </Level>\n    )\n\nexport const components = {\n  h2: createHeadingWithLink('h2'),\n  h3: createHeadingWithLink('h3'),\n  h4: createHeadingWithLink('h4'),\n  h5: createHeadingWithLink('h5'),\n  h6: createHeadingWithLink('h6'),\n}\n```\n\n---\n\n**Other exports**\n\n- `themed`\n- `defaultMdxComponents`\n","readmeFilename":"README.md","description":"MDX utilities for Theme UI","bugs":{"url":"https://github.com/system-ui/theme-ui/issues"},"homepage":"https://github.com/system-ui/theme-ui#readme","_id":"@theme-ui/mdx@0.15.0-develop.30","_integrity":"sha512-XIQRhR/GeJ9gUPI+B90WZpk+OJ3TZJ02nnIRxHHOa0lzZ4vIoZ0BHpaStMrJaBOcWg32NiHyi2WPUJSFncrQtA==","_resolved":"/private/var/folders/78/vkx7my5x2zj3jk033zslz_c00000gp/T/5b00d4314de0ed2d2a2ca8490e69668b/theme-ui-mdx-0.15.0-develop.30.tgz","_from":"file:theme-ui-mdx-0.15.0-develop.30.tgz","_nodeVersion":"18.9.0","_npmVersion":"8.19.1","dist":{"integrity":"sha512-XIQRhR/GeJ9gUPI+B90WZpk+OJ3TZJ02nnIRxHHOa0lzZ4vIoZ0BHpaStMrJaBOcWg32NiHyi2WPUJSFncrQtA==","shasum":"29b7973532ec2baf75dea15aff6b904fd40939d1","tarball":"http://registry-npm.ywwl.com/@theme-ui/mdx/download/@theme-ui/mdx-0.15.0-develop.30.tgz","fileCount":23,"unpackedSize":37073,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC43kLfmEY61VwrsUQdj97aguxbt/2rI7oak4UNpLERFgIhAKijvta5PgQmmoYlnvcYSwU7hve/qUd/vvFsRsABgNZb"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJ1OCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpdTg//bVRNmhxrqL7dYSQJriK14WOJwqg6zyXQFRTrJj554e5Qk28s\r\ndVwnTr+Nj7wK8Ka+1mDuqFWcpVee1VA7wO4cTfr+6A5LSZcEEc6ws9hoogDd\r\nIIf0QjZiZD4fD9ilgbHmXBuLW4u3SZnoEqtLyrPX+iS6zWPPXDrJMdtXDeiV\r\nQTfcUutfHBbrsdhDa28/wDLT3/uK3/JZMqi+E1NjKrKJM4pEfS3d8K4f25pb\r\n/uxjojilfPB1bUW6HioLPnREoqr1QUmuq/ghhVnUfAoQgCi09sb+gNB1wl/I\r\nPzr+MdlxDNlq5BZ8JOu9/XV8ntNpJPfuqXhZtkkZEj5PTz/DUb35ZQ1/UiuA\r\nE2yKQ8kzmCph8ZFSZhxLVd7a17YjbpWWk8ME5UXiRa27gQCut/ae+uzl4Fxk\r\nlutiuaNpCm8/RtLXvMSXmPpqooQ+DpxcEyBo5r1MyIGaYXL+rOq4hZLHxD3U\r\n7A7PRzGwHigAtmwqUT2FcqgMK0PX16eOYMQ1eLiySaYmBXRZmdbiEChc1tND\r\nn3PPIzA7y+TFs06GgvjjaY6+GSn59KhFqMWOfQGaaR3CbLFSBaCYRnbyi78Z\r\nNEYKvVqEmKBw/I9+xfv/VtbffvvjIfU+Aarnw6802mNBTa6lD2Np3n5an5CE\r\nYY1Wyqohl5GKeh6WyHmVQ4K27LtiXTVCymc=\r\n=Pr+l\r\n-----END PGP SIGNATURE-----\r\n","size":9245,"noattachment":false,"key":"/@theme-ui/mdx/-/@theme-ui/mdx-0.15.0-develop.30.tgz"},"_npmUser":{"name":"hasparus","email":"hasparus@gmail.com"},"directories":{},"maintainers":[{"name":"jxnblk","email":"jxnblk@gmail.com"},{"name":"johno","email":"johnotander@gmail.com"},{"name":"hasparus","email":"hasparus@gmail.com"},{"name":"lachlanjc","email":"lachlanjc@hey.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mdx_0.15.0-develop.30_1663521666638_0.19352395211737683"},"_hasShrinkwrap":false,"publish_time":1663521666785,"_cnpm_publish_time":1663521666785,"dist-tags":{"canary":"0.16.2-scale-tuples.0","develop":"0.17.2-develop.1","highlight":"0.4.0-highlight.0","latest":"0.17.4","next":"0.6.0-alpha.8"}}