{"name":"@theme-ui/mdx","version":"0.8.4","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.8.4","@theme-ui/css":"0.8.4"},"devDependencies":{"react":"^17.0.1"},"peerDependencies":{"react":"^16.14.0 || ^17.0.0"},"author":{"name":"Brent Jackson"},"repository":{"type":"git","url":"git+https://github.com/system-ui/theme-ui.git"},"license":"MIT","publishConfig":{"access":"public"},"gitHead":"a4ddcc49e5bf62daa439e487cfb540841755eec8","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.8.4","_nodeVersion":"14.16.1","_npmVersion":"lerna/4.0.0/node@v14.16.1+x64 (linux)","dist":{"integrity":"sha512-pI2XalkIV+Ky2q/y+RBuHi9fBxzCECXZDSMYH98FExO3C6X5sdPDJ1u9kDKgbqJxUxTBQlZKSvU+fG9hjN3oQQ==","shasum":"86bee495402216f65bd3244303f2248d91ca90d0","tarball":"http://registry-npm.ywwl.com/@theme-ui/mdx/download/@theme-ui/mdx-0.8.4.tgz","fileCount":12,"unpackedSize":33609,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglF1dCRA9TVsSAnZWagAAtzoP/RNzo3uRXwC5JMypGuTX\nvY43t/TmBVeAcxrQxf7WnqFoUTdTWtfHgfbuGGNQsTPx5Kuzk3XqpSrOvwAh\nm2euPkfdsJCPZ86qfCYsdu2q2FkJSxCi6JDHy9K3ACBPY2+zstn8DCbVzjHL\nkhYuInywLiiglwjMfg5zhDTG1LIoEoeNe/5hHE6WLrZYMNvyanIURbNT7VMi\npFUUnSJVVJQWvQ/zaBwpbICH6Lmo/zVqgueVjYsuBN9nd2/A7CCOKKVTUL8w\n9mj3En4toODpld3HyIrJywiMjL7OfYi1A/J4TwnSW3ZH0bUoMsPzTF4wruiZ\nIOvpNK3VmiUyuRAaID3UNDTG8XotmtQb9I4gjYn07Guv0Hr//DjPehMrfOGC\n5stlOoMDzYYc97mx7//RRc44t8PjeBRuukO4w0/GLhycOh0gpiTYTkIrxNr6\nIKwQad02dCE4u3O6nHxXiFL230SYqvNSm3r2XsO9L3ONKYEo0finjdMhaOI9\nrT+bjcoquI3fkThSYYRphUBKsb7/9w2mFmE54ARWBYxUrJtWRrWsTDnkXHZN\nLzrR5AezM4mKXSBJZK8KPrYUJ3nT8Kdm0zGbhAPZILeu09yjLWKC2KAzyyau\ngkk1rc4MfW4UFja83NNQ1JSa3BjisXCsSbx2FwMc1avSfFx/n4srvHO29pAD\n9Apl\r\n=L8Ep\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxph2lTyaiHJ0HIo+2v/YOs26uvoL8ywQXLZJlvtetnQIhAPUxGr8Rti/qtWur6omtIHJsclnNUWZEVLHl1PUmAwA1"}],"size":7067,"noattachment":false,"key":"/@theme-ui/mdx/-/@theme-ui/mdx-0.8.4.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.8.4_1620335964678_0.25907697517596096"},"_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":1620335964807,"_cnpm_publish_time":1620335964807,"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"}}