{"name":"@theme-ui/mdx","version":"0.17.0","author":{"name":"Brent Jackson"},"license":"MIT","_id":"@theme-ui/mdx@0.17.0","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"}],"homepage":"https://github.com/system-ui/theme-ui#readme","bugs":{"url":"https://github.com/system-ui/theme-ui/issues"},"dist":{"shasum":"4024d14fabef0682a5ecab033eaa26c54ad7c85d","tarball":"http://registry-npm.ywwl.com/@theme-ui/mdx/download/@theme-ui/mdx-0.17.0.tgz","fileCount":22,"integrity":"sha512-pBOWMz3dHzc5dJDm/axzjDBHuU7g9NihrmQXRX6jZNNH8jjLZRu8JGW8Msavm9nczqYIOHSjb6/kv5zuXyFHNg==","signatures":[{"sig":"MEUCIQDCm5s2gak4HkQW/uKP7AcZ0A08DXHKLwU1ZgSJ836swgIgO05Q3hNWPv96Kq+1cxEOf29smaFUQxGJIGXYLFQkYX0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":34162,"size":9039,"noattachment":false,"key":"/@theme-ui/mdx/-/@theme-ui/mdx-0.17.0.tgz"},"main":"dist/theme-ui-mdx.cjs.js","_from":"file:theme-ui-mdx-0.17.0.tgz","types":"./dist/theme-ui-mdx.cjs.d.ts","module":"dist/theme-ui-mdx.esm.js","source":"src/index.ts","gitHead":"621199460fa3bdb0100748441e62517b7529b8c8","scripts":{},"_npmUser":{"name":"hasparus","email":"hasparus@gmail.com"},"_resolved":"/tmp/8f484fd408436e9de5bb7c08358831f2/theme-ui-mdx-0.17.0.tgz","_integrity":"sha512-pBOWMz3dHzc5dJDm/axzjDBHuU7g9NihrmQXRX6jZNNH8jjLZRu8JGW8Msavm9nczqYIOHSjb6/kv5zuXyFHNg==","repository":{"url":"git+https://github.com/system-ui/theme-ui.git","type":"git"},"_npmVersion":"10.8.2","description":"[MDX](https://mdxjs.com) utilities for [Theme UI](https://theme-ui.com)","directories":{},"sideEffects":false,"_nodeVersion":"20.18.0","dependencies":{"@theme-ui/css":"^0.17.0","@theme-ui/core":"^0.17.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"react":"^18.1.0","@types/mdx":"^2.0.5","@mdx-js/mdx":"^2.3.0","@types/react":"^18.2.12","remark-gfm-3":"npm:remark-gfm@3.0.1","@mdx-js/react":"^2.3.0","@emotion/react":"^11.13.3","@theme-ui/test-utils":"^0.17.0"},"peerDependencies":{"react":">=18","@types/mdx":"^2.0.2","@emotion/react":"^11.13.3"},"_npmOperationalInternal":{"tmp":"tmp/mdx_0.17.0_1729271481799_0.7465479778839199","host":"s3://npm-registry-packages"},"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":1729271482036,"_cnpm_publish_time":1729271482036,"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"}}