{"name":"@theme-ui/mdx","version":"0.15.0-develop.26","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.26","@theme-ui/css":"^0.15.0-develop.26"},"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.26"},"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.26","_integrity":"sha512-NpeGaML5GBuGWa6FOxyNFx+pZUyH4gl4CpfI4bJlmNcrNxXf7DIUiHLbnQMk4oXQD6Wlou2DeIo9a+PqXOMQHQ==","_resolved":"/private/var/folders/78/vkx7my5x2zj3jk033zslz_c00000gp/T/458ebe588e216b09d69531248429f1b9/theme-ui-mdx-0.15.0-develop.26.tgz","_from":"file:theme-ui-mdx-0.15.0-develop.26.tgz","_nodeVersion":"18.9.0","_npmVersion":"8.19.1","dist":{"integrity":"sha512-NpeGaML5GBuGWa6FOxyNFx+pZUyH4gl4CpfI4bJlmNcrNxXf7DIUiHLbnQMk4oXQD6Wlou2DeIo9a+PqXOMQHQ==","shasum":"d53c6ca67cae2ca280450b56156200bb95cc1ba5","tarball":"http://registry-npm.ywwl.com/@theme-ui/mdx/download/@theme-ui/mdx-0.15.0-develop.26.tgz","fileCount":16,"unpackedSize":25225,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEkcZ0LRct7petkse0PnyPtrCqnfDEeotW7UqKhRXnqBAiEA60r4/ZHGfSO6D3t6IVl//UE4lFQVMvG1AH0PCGCMfKk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjIOuTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmogYQ/+NFtR0mQPwxv/0qo8jgTZ0cBMEazdH67erqpAKG+Z6FMhd6yE\r\n8uuImpjlKcCBjy3y52iQQUSjDToJigW3fZiJYPNt0xJPfHktnsZYdN8MJkMl\r\nVOa6t7g9v3BFdhiOOdMhzobjTXU1ztgecPLJfilTOnMfMwKgTcHADEBv3EHn\r\nsStVrujsn9BF+Z1BPrUcjUdqk97Cl9pukk1W8+JrHp/5+Q1ig0+dIu/EcBKx\r\nWOb5cbHQ+rCdIK1SukInWlaJqZZ6k76rqi/x9bBf1Xyg8l09yNDl9GY2Nezp\r\nCi7BIvbp4NITdxzjdpOZ5Ba5ngO1PuN41lsIJItCNYBj/lDbYstNyLJ2+k8l\r\nPqS7EXyEOxQIxJltowNIy7kkXBfhdOw2GfoM6eqUr9pB00Se/oZW+R5negqn\r\nyaWJuR2Upj5P3a1qTnFdQzeUkMepRBMr1t3vYWclTjf07QyDIHnj0r1rKu+S\r\nzugqRAR0YoK769n42nstlXx8Ozph60gXd/S7jkOA7FE7nssbPDfkPUwg29T5\r\nNNvMXA/bVdVPfV9Srmni/K66EanS+D/aLdZ01Tu6lU00xuGcELtEQ3+8fZGK\r\nZXKa305rrnPwsW7ir38ubEpwM1kPIRdVDJDIhCg2sBvjVlEtyYi/Wgbt5lc8\r\nJZKzmXaC7XuuxshED9xAByilGNbUamahRS4=\r\n=bFgq\r\n-----END PGP SIGNATURE-----\r\n","size":8039,"noattachment":false,"key":"/@theme-ui/mdx/-/@theme-ui/mdx-0.15.0-develop.26.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.26_1663101842828_0.3583471666363238"},"_hasShrinkwrap":false,"publish_time":1663101842998,"_cnpm_publish_time":1663101842998,"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"}}