{"name":"@theme-ui/mdx","version":"0.14.5","source":"src/index.ts","main":"dist/theme-ui-mdx.cjs.js","module":"dist/theme-ui-mdx.esm.js","sideEffects":false,"scripts":{},"dependencies":{"@theme-ui/core":"0.14.5","@theme-ui/css":"0.14.5"},"devDependencies":{"react":"^17.0.1"},"peerDependencies":{"@emotion/react":"^11","@mdx-js/react":"^1 || ^2","react":">16"},"author":{"name":"Brent Jackson"},"repository":{"type":"git","url":"git+https://github.com/system-ui/theme-ui.git"},"license":"MIT","publishConfig":{"access":"public"},"gitHead":"83efd124b50563f6b814b6410ec96a9442f32729","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.14.5","_nodeVersion":"14.19.1","_npmVersion":"lerna/4.0.0/node@v14.19.1+x64 (linux)","dist":{"integrity":"sha512-iYYsvo6TZAxc9frXJWUijEYLmZltbsv3xFfBptA2iaw8iDj/Aw2ggtHpVyGVXGAgS09vfgH+ebFuzup61ADdDw==","shasum":"a462cf378d5a8ef4a03369a75e3b258bbab6d566","tarball":"http://registry-npm.ywwl.com/@theme-ui/mdx/download/@theme-ui/mdx-0.14.5.tgz","fileCount":12,"unpackedSize":24842,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCVsXz3Ul8XxzxrytW5NIqybHO70Pxo4IjmY2bACvyEIgIgXG9Js1q3v6QVGXxnZNIVbeIBxvhNVWQW9mXyUshMk/o="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJibZkwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq50g/+NJWEehE5DcOEIcAL4NLNlikzE+1hAGz5jGyc6GigWculXz1Z\r\nLEV9kHidEjl8EARvpevn2q27/jBLivXNIlAKtioGtjRQ2k4rkcRIpakZEhuw\r\nont4RsqsbVPH4C3AuqZq3PNLFCGX41DLA8MCUC1LcsQq8+W+44nzk2mMv1NX\r\nHEPtdaNYcUqLgFkvn2euCdMXs0fG8njxC1IE5x15HLe0eO6UM732JTrCZTLN\r\nPELD+ElzjL5dTrn8NqQb7cEeB7IeTPNSWy/qcKgP2Z7UCh1Id8rrXMMpwuUs\r\nJ0gFuyWIeMHXfbQfYFn7SEdzNdPyobL+RlJrSGH/iL0Au+rdMDNrUJVWjupV\r\ndVBq0rEIQebUl8eaExmJ0r3xbnPEcRHh38GfnAkN8DVIl4SQG3nX4PL4cYVF\r\nQy6r50vr3MoIehRZQ3eO0SW1mnTsHjZJsqX4AxrN7aALx93DPVANx9/GgwJZ\r\ntuXFJUChJiMHgw0Q8yjnwhI6pabicbhBKSbAL+IcNissSoLbgqmJqKO7MHDh\r\nACEC8LBmZXVIwu0SmxwPAbkBF6CXhSU3eppQpSOBdCnQjgwtN3tRg4h8fUca\r\nEQMjJ3axl0qZfrTmpx6BlpBUF0Vxt0XHq4DMymubde8WrT9+qommJol5z5oi\r\nmPOOrp7O9och3Dnz7s2bb4A/l5Q0H15BDpI=\r\n=x9wT\r\n-----END PGP SIGNATURE-----\r\n","size":6216,"noattachment":false,"key":"/@theme-ui/mdx/-/@theme-ui/mdx-0.14.5.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.14.5_1651349807987_0.11899593911863926"},"_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":1651349808166,"_cnpm_publish_time":1651349808166,"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"}}