@nanisoft/prism-llms 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/README.md +88 -0
  2. package/THIRD-PARTY-NOTICES.md +48 -0
  3. package/dist/data.json +4037 -386
  4. package/dist/demo-graph.d.ts +21 -12
  5. package/dist/demo-graph.js +37 -21
  6. package/dist/extractor.d.ts +24 -17
  7. package/dist/extractor.js +299 -156
  8. package/dist/index.d.ts +12 -7
  9. package/dist/index.js +9 -7
  10. package/dist/llms-full.txt +8248 -2013
  11. package/dist/llms.txt +98 -93
  12. package/dist/markdown.d.ts +69 -23
  13. package/dist/markdown.js +131 -72
  14. package/dist/md/blocks/app-shell-01.md +135 -0
  15. package/dist/md/blocks/auth-form-01.md +135 -0
  16. package/dist/md/blocks/cta-01.md +88 -0
  17. package/dist/md/blocks/data-table-01.md +196 -0
  18. package/dist/md/blocks/feature-grid-01.md +92 -0
  19. package/dist/md/blocks/hero-01.md +90 -0
  20. package/dist/md/blocks/instrument-panel-01.md +109 -0
  21. package/dist/md/blocks/logo-strip-01.md +97 -0
  22. package/dist/md/blocks/note-grid-01.md +98 -0
  23. package/dist/md/blocks/page-header-01.md +97 -0
  24. package/dist/md/blocks/pricing-01.md +91 -0
  25. package/dist/md/blocks/process-rail-01.md +106 -0
  26. package/dist/md/blocks/product-grid-01.md +107 -0
  27. package/dist/md/blocks/settings-panel-01.md +146 -0
  28. package/dist/md/blocks/site-footer.md +103 -11
  29. package/dist/md/blocks/site-header.md +107 -11
  30. package/dist/md/blocks/stack-grid-01.md +108 -0
  31. package/dist/md/blocks/stats-01.md +89 -0
  32. package/dist/md/blocks/status-ledger-01.md +121 -0
  33. package/dist/md/changelogs/prism-llms.md +244 -0
  34. package/dist/md/changelogs/prism-mcp-server.md +95 -0
  35. package/dist/md/changelogs/prism-tokens.md +126 -0
  36. package/dist/md/changelogs/prism-ui.md +467 -0
  37. package/dist/md/components/accordion.md +108 -0
  38. package/dist/md/components/alert.md +90 -7
  39. package/dist/md/components/avatar.md +89 -7
  40. package/dist/md/components/badge.md +74 -7
  41. package/dist/md/components/breadcrumb.md +84 -7
  42. package/dist/md/components/button.md +90 -7
  43. package/dist/md/components/card.md +90 -7
  44. package/dist/md/components/checkbox.md +101 -7
  45. package/dist/md/components/cta-link.md +98 -0
  46. package/dist/md/components/diagram.md +124 -0
  47. package/dist/md/components/dialog.md +128 -0
  48. package/dist/md/components/dropdown-menu.md +125 -0
  49. package/dist/md/components/fact-list.md +85 -0
  50. package/dist/md/components/field.md +116 -0
  51. package/dist/md/components/input.md +86 -7
  52. package/dist/md/components/kbd.md +77 -0
  53. package/dist/md/components/pagination.md +95 -7
  54. package/dist/md/components/popover.md +95 -7
  55. package/dist/md/components/product-mark.md +114 -0
  56. package/dist/md/components/product-switcher.md +88 -0
  57. package/dist/md/components/progress.md +88 -7
  58. package/dist/md/components/prose.md +91 -0
  59. package/dist/md/components/radio-group.md +111 -0
  60. package/dist/md/components/section.md +91 -0
  61. package/dist/md/components/select.md +143 -7
  62. package/dist/md/components/separator.md +77 -0
  63. package/dist/md/components/skeleton.md +71 -7
  64. package/dist/md/components/slider.md +90 -7
  65. package/dist/md/components/switch.md +104 -7
  66. package/dist/md/components/table.md +104 -7
  67. package/dist/md/components/tabs.md +105 -7
  68. package/dist/md/components/textarea.md +101 -0
  69. package/dist/md/components/tooltip.md +95 -7
  70. package/dist/md/components/typography.md +82 -7
  71. package/dist/md/content/about-content.md +36 -0
  72. package/dist/md/content/audience.md +43 -0
  73. package/dist/md/content/glossary.md +69 -0
  74. package/dist/md/content/product-vocabulary.md +53 -0
  75. package/dist/md/content/voice.md +52 -0
  76. package/dist/md/content/writing-mechanics.md +58 -0
  77. package/dist/md/foundation/colors.md +10 -0
  78. package/dist/md/foundation/iconography.md +14 -0
  79. package/dist/md/foundation/motion.md +10 -0
  80. package/dist/md/foundation/radii.md +9 -0
  81. package/dist/md/foundation/shadows.md +9 -0
  82. package/dist/md/foundation/spacings.md +8 -0
  83. package/dist/md/foundation/typography.md +9 -0
  84. package/dist/md/foundation/variables.md +9 -0
  85. package/dist/md/overview/architecture.md +76 -0
  86. package/dist/md/overview/brand.md +41 -0
  87. package/dist/md/overview/composition.md +77 -0
  88. package/dist/md/overview/quickstart.md +97 -0
  89. package/dist/md/overview/theming.md +89 -0
  90. package/dist/md/overview/using-llms.md +83 -0
  91. package/dist/md/pages/auth-page.md +149 -0
  92. package/dist/md/pages/blog-post-page.md +136 -0
  93. package/dist/md/pages/dashboard-page.md +241 -0
  94. package/dist/md/pages/docs-shell.md +210 -15
  95. package/dist/md/pages/marketing-page.md +199 -0
  96. package/dist/md/pages/not-found-page.md +105 -0
  97. package/dist/md/pages/settings-page.md +206 -0
  98. package/dist/prism-skill.md +50 -0
  99. package/dist/store.d.ts +203 -0
  100. package/dist/store.js +317 -0
  101. package/package.json +29 -26
  102. package/dist/demo-graph.d.ts.map +0 -1
  103. package/dist/demo-graph.js.map +0 -1
  104. package/dist/extractor.d.ts.map +0 -1
  105. package/dist/extractor.js.map +0 -1
  106. package/dist/index.d.ts.map +0 -1
  107. package/dist/index.js.map +0 -1
  108. package/dist/markdown.d.ts.map +0 -1
  109. package/dist/markdown.js.map +0 -1
  110. package/dist/md/blocks/component-demo.md +0 -19
  111. package/dist/md/blocks/page-header.md +0 -19
  112. package/dist/md/components/affix.md +0 -14
  113. package/dist/md/components/anchor.md +0 -14
  114. package/dist/md/components/auto-complete.md +0 -14
  115. package/dist/md/components/back-top.md +0 -14
  116. package/dist/md/components/border-beam.md +0 -14
  117. package/dist/md/components/calendar.md +0 -14
  118. package/dist/md/components/carousel.md +0 -14
  119. package/dist/md/components/cascader.md +0 -14
  120. package/dist/md/components/col.md +0 -14
  121. package/dist/md/components/collapse.md +0 -14
  122. package/dist/md/components/color-picker.md +0 -14
  123. package/dist/md/components/date-picker.md +0 -14
  124. package/dist/md/components/descriptions.md +0 -14
  125. package/dist/md/components/display-title.md +0 -20
  126. package/dist/md/components/divider.md +0 -14
  127. package/dist/md/components/drawer.md +0 -14
  128. package/dist/md/components/dropdown.md +0 -14
  129. package/dist/md/components/empty.md +0 -14
  130. package/dist/md/components/flex.md +0 -14
  131. package/dist/md/components/float-button.md +0 -14
  132. package/dist/md/components/form.md +0 -14
  133. package/dist/md/components/grid.md +0 -14
  134. package/dist/md/components/image.md +0 -14
  135. package/dist/md/components/input-number.md +0 -14
  136. package/dist/md/components/layout.md +0 -14
  137. package/dist/md/components/list.md +0 -14
  138. package/dist/md/components/listy.md +0 -14
  139. package/dist/md/components/masonry.md +0 -14
  140. package/dist/md/components/mentions.md +0 -14
  141. package/dist/md/components/menu.md +0 -14
  142. package/dist/md/components/modal.md +0 -14
  143. package/dist/md/components/popconfirm.md +0 -14
  144. package/dist/md/components/qrcode.md +0 -14
  145. package/dist/md/components/radio.md +0 -14
  146. package/dist/md/components/rate.md +0 -14
  147. package/dist/md/components/result.md +0 -14
  148. package/dist/md/components/row.md +0 -14
  149. package/dist/md/components/segmented.md +0 -14
  150. package/dist/md/components/space.md +0 -14
  151. package/dist/md/components/spin.md +0 -14
  152. package/dist/md/components/splitter.md +0 -14
  153. package/dist/md/components/statistic.md +0 -14
  154. package/dist/md/components/steps.md +0 -14
  155. package/dist/md/components/tag.md +0 -14
  156. package/dist/md/components/time-picker.md +0 -14
  157. package/dist/md/components/timeline.md +0 -14
  158. package/dist/md/components/tour.md +0 -14
  159. package/dist/md/components/transfer.md +0 -14
  160. package/dist/md/components/tree-select.md +0 -14
  161. package/dist/md/components/tree.md +0 -14
  162. package/dist/md/components/upload.md +0 -14
  163. package/dist/md/components/watermark.md +0 -14
  164. package/dist/md/docs/brand.md +0 -41
  165. package/dist/md/pages/blog-layout.md +0 -19
  166. package/dist/md/theme/blue-dark.md +0 -127
  167. package/dist/md/theme/blue-light.md +0 -129
  168. package/dist/md/theme/green-dark.md +0 -127
  169. package/dist/md/theme/green-light.md +0 -129
  170. package/dist/md/theme/lavender-dark.md +0 -127
  171. package/dist/md/theme/lavender-light.md +0 -129
  172. package/dist/md/theme/peach-dark.md +0 -127
  173. package/dist/md/theme/peach-light.md +0 -129
  174. package/dist/md/theme/rose-dark.md +0 -127
  175. package/dist/md/theme/rose-light.md +0 -129
@@ -1,24 +1,33 @@
1
1
  /**
2
- * The demo contract (ticket 16 check invariant 2, ticket 12 §2): each example
3
- * is one self-contained `.tsx` — default-exported component, importing only
4
- * from `@nanisoft/prism-ui/*` and `react`, no relative imports. This module is
5
- * the contract's single enforcement point: the generator reuses the import
6
- * scan for `## Blocks` / `## Pages` cross-refs, the check reuses the validator.
2
+ * The demo contract.
3
+ *
4
+ * Each example is one self-contained `.tsx`: a default export that imports only
5
+ * from `@nanisoft/prism-ui/*`, `react` or `lucide-react`, and never from a
6
+ * relative path. `lucide-react` is allowed because the public Block API surfaces
7
+ * its `LucideIcon` type (a demo that composes a Block must pass an icon), so the
8
+ * example a consumer copies has to name the same import.
9
+ *
10
+ * This module is the contract's single enforcement point: the generator reuses
11
+ * the import scan for its composition and cross-references, and the check
12
+ * reuses the validator.
7
13
  */
8
14
  export interface DemoViolation {
9
15
  readonly file: string;
10
16
  readonly reason: string;
11
17
  }
12
18
  /**
13
- * Validate one demo's source against the self-contained contract. Returns the
14
- * violations (empty = compliant): non-allowlisted or relative imports, and a
15
- * missing default export.
19
+ * Validate one demo's source. Returns the violations (empty means compliant):
20
+ * a relative or non-allowlisted import, or a missing default export.
16
21
  */
17
22
  export declare function validateDemoSource(source: string): DemoViolation[];
23
+ export interface PrismImport {
24
+ readonly specifier: string;
25
+ readonly names: readonly string[];
26
+ }
18
27
  /**
19
- * The prism-ui export names a demo imports (for `## Blocks` / `## Pages`
20
- * cross-refs). Returns catalog names — the pre-alias original — and skips
21
- * type-only specifiers, which reference supporting types, not items.
28
+ * The prism-ui bindings a demo imports, with their module specifier. Type-only
29
+ * specifiers reference supporting types, not runtime items.
22
30
  */
31
+ export declare function scanPrismImportsWithSource(source: string): PrismImport[];
32
+ /** The prism-ui value export names a demo imports, sorted and de-duplicated. */
23
33
  export declare function scanPrismImports(source: string): string[];
24
- //# sourceMappingURL=demo-graph.d.ts.map
@@ -1,16 +1,21 @@
1
1
  /**
2
- * The demo contract (ticket 16 check invariant 2, ticket 12 §2): each example
3
- * is one self-contained `.tsx` — default-exported component, importing only
4
- * from `@nanisoft/prism-ui/*` and `react`, no relative imports. This module is
5
- * the contract's single enforcement point: the generator reuses the import
6
- * scan for `## Blocks` / `## Pages` cross-refs, the check reuses the validator.
2
+ * The demo contract.
3
+ *
4
+ * Each example is one self-contained `.tsx`: a default export that imports only
5
+ * from `@nanisoft/prism-ui/*`, `react` or `lucide-react`, and never from a
6
+ * relative path. `lucide-react` is allowed because the public Block API surfaces
7
+ * its `LucideIcon` type (a demo that composes a Block must pass an icon), so the
8
+ * example a consumer copies has to name the same import.
9
+ *
10
+ * This module is the contract's single enforcement point: the generator reuses
11
+ * the import scan for its composition and cross-references, and the check
12
+ * reuses the validator.
7
13
  */
8
14
  /** Module specifiers a demo may import. Everything else fails the contract. */
9
- const ALLOWED_IMPORTS = [/^@nanisoft\/prism-ui(\/[\w.-]+)*$/, /^react$/];
15
+ const ALLOWED_IMPORTS = [/^@nanisoft\/prism-ui(\/[\w.-]+)*$/, /^react$/, /^lucide-react$/];
10
16
  /**
11
- * Validate one demo's source against the self-contained contract. Returns the
12
- * violations (empty = compliant): non-allowlisted or relative imports, and a
13
- * missing default export.
17
+ * Validate one demo's source. Returns the violations (empty means compliant):
18
+ * a relative or non-allowlisted import, or a missing default export.
14
19
  */
15
20
  export function validateDemoSource(source) {
16
21
  const violations = [];
@@ -23,34 +28,45 @@ export function validateDemoSource(source) {
23
28
  violations.push({
24
29
  file: '',
25
30
  reason: specifier.startsWith('.')
26
- ? `relative import '${specifier}' — demos must be self-contained`
27
- : `import from '${specifier}' — demos import only from '@nanisoft/prism-ui/*' and 'react'`,
31
+ ? `relative import '${specifier}': demos must be self-contained`
32
+ : `import from '${specifier}': demos import only from '@nanisoft/prism-ui/*', 'react' and 'lucide-react'`,
28
33
  });
29
34
  }
30
35
  if (!/export\s+default/.test(source)) {
31
- violations.push({ file: '', reason: 'no default export — each demo default-exports its example component' });
36
+ violations.push({ file: '', reason: 'no default export: each demo default-exports its example' });
32
37
  }
33
38
  return violations;
34
39
  }
35
40
  /**
36
- * The prism-ui export names a demo imports (for `## Blocks` / `## Pages`
37
- * cross-refs). Returns catalog names — the pre-alias original — and skips
38
- * type-only specifiers, which reference supporting types, not items.
41
+ * The prism-ui bindings a demo imports, with their module specifier. Type-only
42
+ * specifiers reference supporting types, not runtime items.
39
43
  */
40
- export function scanPrismImports(source) {
41
- const names = new Set();
42
- const importPattern = /(?:^|\n)\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+["']@nanisoft\/prism-ui[^"']*["']/g;
44
+ export function scanPrismImportsWithSource(source) {
45
+ const found = [];
46
+ const importPattern = /(?:^|\n)\s*import\s+(type\s+)?\{([^}]*)\}\s+from\s+["'](@nanisoft\/prism-ui[^"']*)["']/g;
43
47
  let match;
44
48
  while ((match = importPattern.exec(source)) !== null) {
45
- for (const raw of (match[1] ?? '').split(',')) {
49
+ if (match[1])
50
+ continue;
51
+ const names = [];
52
+ for (const raw of (match[2] ?? '').split(',')) {
46
53
  const trimmed = raw.trim();
47
54
  if (!trimmed || trimmed.startsWith('type '))
48
55
  continue;
49
56
  const name = trimmed.split(/\s+as\s+/)[0]?.trim();
50
57
  if (name)
51
- names.add(name);
58
+ names.push(name);
52
59
  }
60
+ found.push({ specifier: match[3] ?? '', names });
61
+ }
62
+ return found;
63
+ }
64
+ /** The prism-ui value export names a demo imports, sorted and de-duplicated. */
65
+ export function scanPrismImports(source) {
66
+ const names = new Set();
67
+ for (const binding of scanPrismImportsWithSource(source)) {
68
+ for (const name of binding.names)
69
+ names.add(name);
53
70
  }
54
71
  return [...names].sort();
55
72
  }
56
- //# sourceMappingURL=demo-graph.js.map
@@ -1,17 +1,22 @@
1
1
  /**
2
- * The one props extractor (tickets 12/16): reads prism-ui's built `.d.ts`
3
- * surface — TSDoc preserved — and returns the Prism-added props. Homed here
4
- * and exported (`@nanisoft/prism-llms/extractor`) for the site's API tables;
5
- * one extractor, two consumers. Runs after `^build`, so it reads declarations,
6
- * never TS source.
2
+ * The one props extractor.
7
3
  *
8
- * Deliberately compiler-API-free: TypeScript 7 (this repo's compiler) no
9
- * longer ships the JS compiler API, and ADR-0003 already accepts cosmetic
10
- * fidelity risk on gnarly unions. This is a small structural scanner for the
11
- * declaration shape prism-ui emits — `export interface XProps [extends Y]`
12
- * with JSDoc-carried descriptions. Pass-through re-exports never match, and
13
- * that absence IS the Extends seam (ADR-0004): no extracted props means the
14
- * item is "antd X, unchanged".
4
+ * It reads `@nanisoft/prism-ui`'s emitted declarations, never its TypeScript
5
+ * source, and it is deliberately compiler-API-free: a small structural scanner
6
+ * for the declaration shapes this repository emits. Ticket 12 section 2 fixes
7
+ * the seam at the emitted `.d.ts`, so a compiler bump cannot break the corpus.
8
+ *
9
+ * The shapes it understands:
10
+ * - a named props type (`export type XProps = { ... }` or
11
+ * `export interface XProps extends Y { ... }`), referenced by a function;
12
+ * - an inline props object on the function parameter;
13
+ * - `ComponentProps<'tag'>`, recorded as an inherited base rather than
14
+ * expanded, so a native-backed component reports its element;
15
+ * - `VariantProps<typeof recipe>`, expanded from the emitted `cva` declaration
16
+ * into the recipe's `variant` and `size` rows.
17
+ *
18
+ * One extractor, two renderers: the corpus's `## Props` definition list and the
19
+ * site's API reference table. There is no second extraction.
15
20
  */
16
21
  export interface ExtractedProp {
17
22
  readonly name: string;
@@ -24,14 +29,16 @@ export interface ExtractedProp {
24
29
  readonly defaultValue?: string;
25
30
  }
26
31
  export interface ExtractedInterface {
32
+ /** The public export name this interface describes. */
27
33
  readonly typeName: string;
28
- /** The type this interface extends, when declared (e.g. `TitleProps`). */
34
+ /** The inherited base, when the annotation is not wholly Prism-authored. */
29
35
  readonly extendsType?: string;
30
36
  readonly props: readonly ExtractedProp[];
31
37
  }
38
+ /** Extract every exported `*Props` interface from a declaration, in source order. */
39
+ export declare function extractProps(source: string): ExtractedInterface[];
32
40
  /**
33
- * Extract every exported `*Props` interface from a `.d.ts` source, in source
34
- * order. Returns an empty array for re-export-only files (pass-throughs).
41
+ * Extract the props of the named exports from one declaration file's text.
42
+ * Exports with no declaration are reported with an empty prop list.
35
43
  */
36
- export declare function extractProps(source: string): ExtractedInterface[];
37
- //# sourceMappingURL=extractor.d.ts.map
44
+ export declare function extractExports(source: string, exportNames: readonly string[]): ExtractedInterface[];