{"name":"@theme-ui/mdx","version":"0.11.2","source":"src/index.ts","main":"dist/theme-ui-mdx.cjs.js","module":"dist/theme-ui-mdx.esm.js","sideEffects":false,"scripts":{},"dependencies":{"@emotion/react":"^11.1.1","@emotion/styled":"^11.0.0","@mdx-js/react":"^1.6.22","@theme-ui/core":"0.11.2","@theme-ui/css":"0.11.2"},"devDependencies":{"react":"^17.0.1"},"peerDependencies":{"react":"^16 || ^17"},"author":{"name":"Brent Jackson"},"repository":{"type":"git","url":"git+https://github.com/system-ui/theme-ui.git"},"license":"MIT","publishConfig":{"access":"public"},"gitHead":"1d78df4564b232add00a1b40d7b1f204365c01a6","description":"MDX component context 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.11.2","_nodeVersion":"14.17.6","_npmVersion":"lerna/4.0.0/node@v14.17.6+x64 (linux)","dist":{"integrity":"sha512-FDMLBm5nfW1gTXZtE57BqcFZ3CQeY7D8q/xwV4Rs0IFoG0oqTErBuff99uqo31hO6XY2txMcEP9cxerAbNQFgQ==","shasum":"61cb9894afb3e92e642e608789e6093efa296407","tarball":"http://registry-npm.ywwl.com/@theme-ui/mdx/download/@theme-ui/mdx-0.11.2.tgz","fileCount":12,"unpackedSize":26453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOI8hCRA9TVsSAnZWagAAsMAP+QE9oHJ6vMTDPaLTDN0V\nzE91Ohy3y89DE9mkT1WIBNCHlpSeItOgTRn5qeuBP/MRdAwN6yak9MkE7egg\nHeVOHYoaylq6aJyeaGwsIEEyVxoGMxCVvVNvqg8kmSzw26qN6YGg5H4Z/BTP\nc30OuUuN4G18pOtKcKZj06kUKwh1fuIhOZvlGnTrBe6ThxUPz+QMQE27xPyj\nL/eDl1QbJBjLdWla7DXqrnmNwBlbm3275ePIGLWS5rjkWGGkfYBKjjxNO0SG\n65mjb4SSuoLlwUR6Q297f928MVuqOArhoNsqpJ96+2TLQvWk0f/ehRfEsNEQ\nZqT9tDWM0DlHR7GpPpVcn/FkbPcD+rKcoeoUrxNont/L3YnETKgoihs2hRvB\naP0O60Agl5MOpLSyOAOs1LKEpdGvqNRmtxuzTSTf6FoI6ssiaRKUQYOXpfqd\npe3QH+vsu0CX9vHQQ/TyC9MLWrkaXhA4ikDtrKaSKm/XbRSQxuFuTVg1mRzo\nBQ3d2T6gLktZrI7Km2l/ndf64ecS3UN3ELdd0KCICbpBRavjOJNKibjOrbyd\nKz8hmjE9+9SXEpd8vCbZ2zzw6K5gH4f+LOdHY6bksSq2Eg4K95P+i/ykoaW4\nKWMov1qBRg6CHnwwvI6ZD2CDHnnQjQXkjbKPUGFW6SZgkENE+auWRqt0zSul\nSSJF\r\n=9JCi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDHn6upCseLWxiGGAUPL5lhRrbDbjtRd4nb+PXeiTe3WAiEAi6WiC3NIDvxdJH6sLaL0jFqQ/Brr/unO7mjVFVv+whY="}],"size":6470,"noattachment":false,"key":"/@theme-ui/mdx/-/@theme-ui/mdx-0.11.2.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.11.2_1631096609732_0.2545031196415777"},"_hasShrinkwrap":false,"readme":"# @theme-ui/mdx\n\n[MDX](https://mdxjs.com) utilities for [Theme UI](https://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 { ThemeUIProvider, 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    <ThemeUIProvider theme={theme}>\n      <MDXProvider components={componentsWithStyles}>{children}</MDXProvider>\n    </ThemeUIProvider>\n  )\n}\n```\n\n### `Themed`\n\nUse the [`Themed` components dictionary](https://theme-ui.com/mdx/themed) to\nrender UI with styles from [`theme.styles`](https://theme-ui.com/theming#styles)\n_outside_ of MDX. These are primarily meant as a mechanism to use styles defined\nin a `theme` object outside of MDX, which can then be embedded in JSX>\n\n```jsx\n// picks up styles from `theme.styles.h1`\n<Themed.h1 />\n```\n\nIf you’re looking to automatically hyperlink headings in MDX, check out the\n[linked headings guide](https://theme-ui.com/mdx/linked-headings).)\n\n---\n\n**Other exports**\n\n- `themed`\n- `defaultMdxComponents`\n","publish_time":1631096609858,"_cnpm_publish_time":1631096609858,"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"}}