{"_id":"@afterauth/markdoc-primitives","name":"@afterauth/markdoc-primitives","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@afterauth/markdoc-primitives","version":"0.1.0","type":"module","description":"Markdoc-first portable content primitives for AfterAuth","author":{"name":"AfterAuth"},"license":"MIT","sideEffects":["*.css"],"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./markdoc":{"types":"./dist/markdoc/index.d.ts","import":"./dist/markdoc/index.js"},"./markdoc/server":{"types":"./dist/markdoc/render.d.ts","import":"./dist/markdoc/render.js"},"./styles.css":"./dist/styles.css"},"scripts":{"build":"tsc -p tsconfig.json && node scripts/build-css.mjs","prepare":"tsc -p tsconfig.json && node scripts/build-css.mjs","typecheck":"tsc -p tsconfig.json --noEmit","test":"vitest run"},"dependencies":{"@markdoc/markdoc":"^0.5.7","mermaid":"^11.15.0"},"peerDependencies":{"react":">=18"},"devDependencies":{"@types/react":"19.2.17","@types/react-dom":"19.2.3","react":"19.2.7","react-dom":"19.2.7","typescript":"5.9.3","vitest":"4.1.8"},"publishConfig":{"access":"public"},"gitHead":"bc43ab8c26cbb756c2e180e4799f3e672d140dba","_id":"@afterauth/markdoc-primitives@0.1.0","_nodeVersion":"25.6.0","_npmVersion":"11.10.0","dist":{"integrity":"sha512-0EqpJvL+5Zr/CC1CW15fDIE7/5+2dBZHlGw6xhmqv1u0LtLZmlapnF8Y6GW8R08saFPfJdYs+x7kXrvAtNnlVA==","shasum":"9f7d6d203b7c0f8708409f5841a0e7fac71d917b","tarball":"https://registry.npmjs.org/@afterauth/markdoc-primitives/-/markdoc-primitives-0.1.0.tgz","fileCount":96,"unpackedSize":193234,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHiioWaFaZn3PvzFS9MuTA0On6Ssc9qgE5M0zNM2+1bcAiEA6eeO7/sSE0GkQo2QMWDhxQdz1ZaLa+eBVrP60HbEMdk="}]},"_npmUser":{"name":"afterauth","email":"afterauth@gmail.com"},"directories":{},"maintainers":[{"name":"afterauth","email":"afterauth@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/markdoc-primitives_0.1.0_1781499743382_0.5819804711568564"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-15T05:02:23.181Z","0.1.0":"2026-06-15T05:02:23.597Z","modified":"2026-06-15T05:02:23.862Z"},"maintainers":[{"name":"afterauth","email":"afterauth@gmail.com"}],"description":"Markdoc-first portable content primitives for AfterAuth","author":{"name":"AfterAuth"},"license":"MIT","readme":"# @afterauth/markdoc-primitives\n\nPortable, themeable React content primitives from AfterAuth. The first release\nships the `Disclosure` primitive — an admonition-style, GitHub-flavored callout\nthat doubles as a collapsible FAQ item.\n\nThe components carry no framework runtime: React is a peer dependency and there\nare no Next.js imports, so the package drops into any React app.\n\n## Install\n\n```bash\nnpm i @afterauth/markdoc-primitives\n# react >= 18 must already be installed (peer dependency)\n```\n\n## Use\n\nImport the stylesheet once at a single boundary (root layout or app entry), then\nrender the component anywhere:\n\n```tsx\nimport \"@afterauth/markdoc-primitives/styles.css\";\nimport { Disclosure } from \"@afterauth/markdoc-primitives\";\n\nexport function Faq() {\n  return (\n    <>\n      <Disclosure title=\"Is access really earned?\" variant=\"question\" defaultOpen>\n        <p>Yes — the first item opens by default; the rest stay collapsed.</p>\n      </Disclosure>\n      <Disclosure title=\"What does it cost?\" variant=\"question\">\n        <p>Collapsed until the reader opens it.</p>\n      </Disclosure>\n    </>\n  );\n}\n```\n\n### Props\n\n| Prop          | Type                                              | Default        | Notes                                  |\n| ------------- | ------------------------------------------------- | -------------- | -------------------------------------- |\n| `title`       | `string`                                          | —              | Summary text (required).               |\n| `variant`     | `PostCalloutVariant`                              | `\"field-note\"` | Accent + icon. `\"question\"` for FAQs.  |\n| `defaultOpen` | `boolean`                                         | `false`        | Open on first render.                  |\n| `open`        | `boolean`                                         | —              | Controlled override of `defaultOpen`.  |\n| `spacing`     | `\"normal\" \\| \"compact\"`                           | `\"normal\"`     | `\"compact\"` tightens FAQ stacks.       |\n| `mode`        | `\"auto\" \\| \"light\" \\| \"dark\"`                     | `\"auto\"`       | Pin a token mode on the subtree.       |\n\n## Theming\n\nEvery visible value resolves through an `--aap-*` token that reads a **host\ntoken** first and falls back to a baked default. To theme the primitives to your\npalette, define the host tokens (on `:root`, `body`, or any wrapper):\n\n```css\n:root {\n  --callout-question: #2d5bff;        /* accent */\n  --callout-question-tint: #eef2ff;   /* panel fill */\n  --ink: #0e1116;                     /* summary text */\n  --font-mono: \"Berkeley Mono\", ui-monospace, monospace;\n}\n```\n\nWhen a host token is defined it wins automatically — the fallback only applies\nwhen it is undefined, so the package never clobbers your `:root` and there is no\nimport-order war. With no host tokens at all, light defaults render standalone.\n\nOverridable host tokens: `--callout-{default,note,tip,question,important,warning,caution}`\nand their `-tint` variants, `--border`, `--border-strong`, `--paper`,\n`--paper-2`, `--ink`, `--slate-2`, `--slate-3`, `--blueprint-ring`,\n`--font-mono`. For dark mode, supply dark values for these tokens under your own\ndark selector.\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-484d43413e4447ec57c01289e9ac036a"}