{"name":"@theme-ui/mdx","version":"0.7.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.7.2","@theme-ui/css":"0.7.2"},"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":"0b8f53e8e88767910d41cab0c180123daf96aeb3","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.7.2","_nodeVersion":"14.16.1","_npmVersion":"lerna/4.0.0/node@v14.16.1+x64 (linux)","dist":{"integrity":"sha512-TS7cjn5GDdT+I86LKZhh0NQF31bNPH6bIpkhP6/8F1TsCV4bkYluh3E5e7VCyw+dN0eNN3zDALAXBut34ksHJA==","shasum":"7335f4ab3fa580496623ded963fbc8a0f808da81","tarball":"http://registry-npm.ywwl.com/@theme-ui/mdx/download/@theme-ui/mdx-0.7.2.tgz","fileCount":12,"unpackedSize":32488,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfcrOCRA9TVsSAnZWagAAeuEP/3rs9hlkkXXTMON0//Ec\ntOUbVpuNGURGcy4clobYiL8nlYGJAbsDklLdM49h1caL3f0e9glAsfpiPmcb\niADdZJ9OD2lvLLuErYbwqIKm9IrHlFS4QdTXSRlJITK8nVo3aAkqKPrf0y0o\nzNv2VPePyzYU0QB3iAAjlbRInie80Ef/A6hEO9gn8Mykje5znJZgoZnvxKaY\nQM/EfL3aXeFObE2NXWGzGCMDmEjPloSxU96vMopAYN9LD8KkZX4eSDsJzqe5\ntHjaBCPnEeUvliDSEewnQrV5FwxFsWNOZKVLzIp48Q2NKvLQlzdmmmf6VhrN\nxzphQPf4L79y3oKZmEXz47DCMLFhPi+0PokvKvfyVd0RX620vEdtsPOcTDvV\nUVLsrXCjtli3RE4rQOWV8C/aWCc3OrdM2anjFYrIOgxa7sh/cazxma4RMj0h\nDAmKf3dfnkA0470i1BCbWrM2VCntXKoG3+Dydcp3BtiGULrkOy/eglQDRg39\nAM/2h6lo9Y7sAthboasDcKmeXOkivfedRJQzjEkllQ+ieUN7G9sq8HpWUu0k\n1zU0+y6g0rOqbbptHEAzI71PeiVwHwAzNShnJBPc/tic8OYfSsNfrz5CtzN2\ntN+5sMm4+WfC9Fz/K4klCORNr8ZYSQO732bAGhiQ+r2BJ1Qa9kP4RjVqwLoR\n4i0e\r\n=Hzf+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEi4VzwmpIbRI42w5gCyURasmImY6c5DOvJVRT1NqhhDAiEAiCrwQmpBVv363Mbjqt3qcVx96uXtfR1mZ+vbq0rYsUE="}],"size":6933,"noattachment":false,"key":"/@theme-ui/mdx/-/@theme-ui/mdx-0.7.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.7.2_1618856654378_0.8922144844865907"},"_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":1618856654543,"_cnpm_publish_time":1618856654543,"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"}}