{"name":"@theme-ui/mdx","version":"0.15.0-develop.27","source":"src/index.ts","main":"dist/theme-ui-mdx.cjs.js","module":"dist/theme-ui-mdx.esm.js","sideEffects":false,"dependencies":{"@theme-ui/core":"^v0.15.0-develop.27","@theme-ui/css":"^v0.15.0-develop.27"},"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":"^v0.15.0-develop.27"},"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.27","_integrity":"sha512-C8DkPsV4Ra7awfohc0Jl23XMS86lBtOn2JAMt8DnkgDTGRazL/rBacrzihADB08FzFRtA91wbUK5voKMCFNpcw==","_resolved":"/private/var/folders/78/vkx7my5x2zj3jk033zslz_c00000gp/T/636a2ab9e5df7e0e19de8efdc8df5fc4/theme-ui-mdx-v0.15.0-develop.27.tgz","_from":"file:theme-ui-mdx-v0.15.0-develop.27.tgz","_nodeVersion":"18.9.0","_npmVersion":"8.19.1","dist":{"integrity":"sha512-C8DkPsV4Ra7awfohc0Jl23XMS86lBtOn2JAMt8DnkgDTGRazL/rBacrzihADB08FzFRtA91wbUK5voKMCFNpcw==","shasum":"a84ecc6ef3aa702b41256d6c7581ef474419afba","tarball":"http://registry-npm.ywwl.com/@theme-ui/mdx/download/@theme-ui/mdx-0.15.0-develop.27.tgz","fileCount":23,"unpackedSize":37077,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVVsykKSzCAfqb7wufyzWb4GssQHTjPSa0JEUXjtpnrwIgGSZTr1Zyd9osB30Vj9qIdLKCt6iDj6WfzcDrRIhM/9U="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJ0gyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrCbRAAlYrHUBS4O4xzx03QmXZJ+ToQn5SeR35tevdYlMfSULCp2wYN\r\nqFMhuNHFWpRQQjWf4v+U4oRq1nMUR9N0/3wZuWFpOZRgU8ILC0nP6ux4Tja2\r\n1nQhrNLPJpof/Ise8EhUUz6zhFbEeW1asyyHT+66qnC5O82n02sbDBx2YU05\r\nCmXq7FCPiE9i2086i9pNOiFWQ4be6V3yuLwDhPrfq+3xF8lU9hXFOG1DhsjL\r\noS3m9aZWBNwGdwu2GxrBgKlccgf/W+OAfWjdIVL6qqHHrWKIYE20WbuZwt9c\r\nq0sZvgIWxmgduDk6SoKVKStY65fuPlVr9OmalS5TEX2A4kjGUziwo588Utb8\r\nIiY0DPDK0ZvBThktHEvWhJQGzilwIN0f2QlNMNeLsbwb4lVf4+uMAbu92u/G\r\n9uYlcjJeoipGZFR1pREArch8fdPrie8j1TiI1UCa8/8sywBpMTiUr4r3PeoC\r\no0S1EasEgQZZiAakA0p1127XFatYY0K6X50BoFJnJCH+0gjqPkzligEcp2kd\r\nt+q2Bptv9I9bw3ByemD+YkDv1oAEZmN6MhPAm2f3tDeCZO+qB4RtcN2ZdGiD\r\nIi/jqszxS6Q3/T+f60GoyL35uv8DiE10vacwOW19J1zf95w1EDdnFYWk5EnK\r\nO8rQTcYO3nXKH7dDoM7y3C0+2rAA8tkn1Qg=\r\n=IRkx\r\n-----END PGP SIGNATURE-----\r\n","size":9244,"noattachment":false,"key":"/@theme-ui/mdx/-/@theme-ui/mdx-0.15.0-develop.27.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.27_1663518770191_0.3134815790004273"},"_hasShrinkwrap":false,"publish_time":1663518770431,"_cnpm_publish_time":1663518770431,"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"}}