{"name":"@theme-ui/mdx","version":"0.3.4","main":"dist/index.js","module":"dist/index.esm.js","sideEffects":false,"scripts":{"prepare":"microbundle --no-compress","watch":"microbundle watch --no-compress"},"dependencies":{"@emotion/core":"^10.0.0","@emotion/styled":"^10.0.0","@mdx-js/react":"^1.0.0"},"peerDependencies":{"@theme-ui/core":"*","@theme-ui/css":"*","react":"^16.11.0"},"author":{"name":"Brent Jackson"},"repository":{"type":"git","url":"git+https://github.com/system-ui/theme-ui.git"},"license":"MIT","publishConfig":{"access":"public"},"gitHead":"7840f829dea27b554c5cd1cb00470770fceca2eb","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.3.4","_nodeVersion":"14.10.1","_npmVersion":"lerna/3.20.2/node@v14.10.1+x64 (linux)","_npmUser":{"name":"hasparus","email":"hasparus@gmail.com"},"dist":{"integrity":"sha512-9e+CzeIYfzpOPexcDD0zZl7mub0qQ88CrnQ8T7ofoQ48lH2HrUB9prMMK/CLACpCsNe4IG/KYZmPlMX3CzTPGA==","shasum":"54f3ac3a56968400ebcc49a49a5cc4662bb384b0","tarball":"http://registry-npm.ywwl.com/@theme-ui/mdx/download/@theme-ui/mdx-0.3.4.tgz","fileCount":14,"unpackedSize":30406,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfuC0WCRA9TVsSAnZWagAAqTUP/2ijKUsicYwkqSYAHSNX\nr02zlKqMce/p5bIKf8KLR3dW7K4GWUL9Sk2o1slVbNdiYqor0TnZLl3qToi/\nM86E8VIyISbexru9vuLXMuNZSKD+vaFZG8C+lzyLLDwzwpCAjbLwCpPU4PuJ\nyBWZhgfips9gCcgWzEvn6GBv4bAH6kaNLS6owA4Z7+xav5+ll+H530VdQ9Oh\nqcvO4EyE1gXonkIA7y+ay0rQqlg7aBedSbr87KOw2uTvUzmW0fnqiMZUOcRo\n4TA9tqoVZmG5lB8q2rp4kCd5DjHtMWaN4PqWy0Xij1w7Q79aJ4DduhAPjWyk\nADJNvA0OztxN6osfhwIf8sIXtBmYwOFYL+nelmmYgK2UwDKW6RylPryGrMxF\nKKCQiGt4gUnyfHM5aoUPUwN2r07gWRQR7jN6OZZknY1JQslpgCBJCJpUmBHV\nBghJN+0wAZhW8wATa8eW4pPKWiR6djKVoX6gMwkpcm49CvneHYlAD++AgO5l\nAuEeIatAgIqDVfpxIcK6jI1bj4c0en+nWNAgpaWzx33wRjNOpEmfeJ8f1VAQ\nCPYTKJRRLYjb6L/g3lSX7gF4zbqafHS7psPTSeyrIcc7Ia0uzlSSF2CshOTp\nMKC1mqocZ7YuqC2kpmqeHNG6okmb1eGWzIJWpEhdjy6o/Bd4/nf12k36D1Ey\nLg6y\r\n=wa/e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIExe605bVkvMUYl7O7PDz25w3LDIuvXpvUzZH54sv+uZAiEAgDx5FLjwvNvAn5yRcuMmtnAJhAEXYzyGjX9C/KvWSZw="}],"size":6968,"noattachment":false,"key":"/@theme-ui/mdx/-/@theme-ui/mdx-0.3.4.tgz"},"directories":{},"maintainers":[{"name":"hasparus","email":"hasparus@gmail.com"},{"name":"johno","email":"johnotander@gmail.com"},{"name":"jxnblk","email":"jxnblk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mdx_0.3.4_1605905686097_0.2732188343425781"},"_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":1605905686213,"_cnpm_publish_time":1605905686213,"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"}}