{"name":"@theme-ui/mdx","version":"0.13.1","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.13.1","@theme-ui/css":"0.13.1"},"devDependencies":{"react":"^17.0.1"},"peerDependencies":{"@emotion/react":"^11","@emotion/styled":"^11","@mdx-js/react":"^1 || ^2","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":"993f6970a62151908b0d94cad404d0791bc307be","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.13.1","_nodeVersion":"14.18.2","_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","dist":{"integrity":"sha512-P4jtqB9iJQcy0qiD4c30QVYEMxvPwhfegPte/ifcOr8NR4dO/gTP9jkbGN7DgXGvIkNitzCNZjjrQT9IcbPAJg==","shasum":"23fe6e42352038bb516cca2fc2539177127a60a3","tarball":"http://registry-npm.ywwl.com/@theme-ui/mdx/download/@theme-ui/mdx-0.13.1.tgz","fileCount":12,"unpackedSize":28558,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh1W1QCRA9TVsSAnZWagAA6vMQAKSpFx/mTtPSYFYE1mky\nsm9EUYHTNXJwLhOtWnmCQCw5v9b9xp643U7T1ETZd2qrA++MqQZpO/NJZtOg\nWeZ9Y8MmqF6L6fkTmjjyC8V/z7gMwgNbsnlS+zXMvYEb6t29qBAnMUwMUrHq\n18kzPOMhQvn0VG0LLmITIjI0PlYbMo3+MyLT5wSlbRwO7OTeY0vYlJ9TDF4G\norXU5RggDHWy/0m+Xct1xjv6YT2DMS68VgX/QbFGVeD4Z+UMJyHU4AZWF5b8\nUzA7qnO8/kOOTkCIvItlGZjj54FKDvFKje2M0MxgnAHp2xci8TP94GFXqWw/\nkGpS89j44s9SMgtDxzhrS/C5R6qvBE9yLefV7xfC4KbCqpbBKTj/qEgnDAPc\nBvsWCijXV1AHKkXc4yBSOz558m4ba6kCO7EA9rhKNcCODp4xZRvbNDpKup8p\nTXDb125lY2HJdOW4yrl2fSLhfNz2df0lo4fx0PAcQANT00y1xkUUl4tcwS9r\nvYhHBtzqxgYBe3kLbn5mvqs6XOeNBcdkXhTi085uDIgLfv28wyRWgRqgfccw\nCMO+YgibfiV3X+kwV4ygGzK457dJCXOL9LYN/QkzMca0NSN06t4qc/bnm/Jy\nRy/8GXmFn4aPeCRejVOtwoVAwEpzXl3q9kCkJ6aLYpR0eWtIaU1FLS46lSQP\nc4cq\r\n=GvEj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIChRJMWMPPevri6HJ4EcQg5ExADlRhLRcdvLmXweTkoRAiEA3EQNWYJStogz8L6lvGi65SZYDfZlCI8lkmOZADwJGgE="}],"size":7013,"noattachment":false,"key":"/@theme-ui/mdx/-/@theme-ui/mdx-0.13.1.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.13.1_1641377104805_0.6085390229095129"},"_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":1641377104942,"_cnpm_publish_time":1641377104942,"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"}}