@urbicon-ui/design-content 6.1.8

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 (111) hide show
  1. package/README.md +54 -0
  2. package/content/auth/components/account-settings/llm.txt +33 -0
  3. package/content/auth/components/forgot-password-page/llm.txt +25 -0
  4. package/content/auth/components/invitation-manager/llm.txt +28 -0
  5. package/content/auth/components/login-page/llm.txt +34 -0
  6. package/content/auth/components/notification-badge/llm.txt +21 -0
  7. package/content/auth/components/notification-center/llm.txt +33 -0
  8. package/content/auth/components/notification-listener/llm.txt +24 -0
  9. package/content/auth/components/passkey-manager/llm.txt +27 -0
  10. package/content/auth/components/push-permission-prompt/llm.txt +32 -0
  11. package/content/auth/components/register-page/llm.txt +35 -0
  12. package/content/auth/components/reset-password-page/llm.txt +26 -0
  13. package/content/auth/components/session-manager/llm.txt +32 -0
  14. package/content/auth/components/two-factor-manager/llm.txt +40 -0
  15. package/content/auth/components/verify-email-page/llm.txt +25 -0
  16. package/content/blocks/components/area-chart/llm.txt +46 -0
  17. package/content/blocks/components/bar-chart/llm.txt +44 -0
  18. package/content/blocks/components/calendar/llm.txt +105 -0
  19. package/content/blocks/components/chart-frame/llm.txt +38 -0
  20. package/content/blocks/components/command-palette/llm.txt +60 -0
  21. package/content/blocks/components/composition-bar/llm.txt +69 -0
  22. package/content/blocks/components/currency-input/llm.txt +65 -0
  23. package/content/blocks/components/date-picker/llm.txt +90 -0
  24. package/content/blocks/components/donut-chart/llm.txt +45 -0
  25. package/content/blocks/components/empty-state/llm.txt +43 -0
  26. package/content/blocks/components/file-upload/llm.txt +76 -0
  27. package/content/blocks/components/guide/llm.txt +49 -0
  28. package/content/blocks/components/guide-article/llm.txt +30 -0
  29. package/content/blocks/components/guide-beacon/llm.txt +38 -0
  30. package/content/blocks/components/guide-hint/llm.txt +41 -0
  31. package/content/blocks/components/guide-marker/llm.txt +36 -0
  32. package/content/blocks/components/guide-mention/llm.txt +31 -0
  33. package/content/blocks/components/guide-panel/llm.txt +42 -0
  34. package/content/blocks/components/guide-provider/llm.txt +31 -0
  35. package/content/blocks/components/line-chart/llm.txt +45 -0
  36. package/content/blocks/components/locale-switcher/llm.txt +44 -0
  37. package/content/blocks/components/planner/llm.txt +68 -0
  38. package/content/blocks/components/sankey/llm.txt +72 -0
  39. package/content/blocks/components/sidebar-layout/llm.txt +87 -0
  40. package/content/blocks/components/sparkline/llm.txt +33 -0
  41. package/content/blocks/components/theme-switcher/llm.txt +40 -0
  42. package/content/blocks/primitives/accordion/llm.txt +57 -0
  43. package/content/blocks/primitives/alert/llm.txt +54 -0
  44. package/content/blocks/primitives/avatar/llm.txt +61 -0
  45. package/content/blocks/primitives/badge/llm.txt +60 -0
  46. package/content/blocks/primitives/breadcrumb/llm.txt +47 -0
  47. package/content/blocks/primitives/button/llm.txt +80 -0
  48. package/content/blocks/primitives/button-group/llm.txt +65 -0
  49. package/content/blocks/primitives/card/llm.txt +68 -0
  50. package/content/blocks/primitives/checkbox/llm.txt +61 -0
  51. package/content/blocks/primitives/collapsible/llm.txt +66 -0
  52. package/content/blocks/primitives/combobox/llm.txt +86 -0
  53. package/content/blocks/primitives/confirm-dialog/llm.txt +47 -0
  54. package/content/blocks/primitives/dialog/llm.txt +59 -0
  55. package/content/blocks/primitives/drawer/llm.txt +54 -0
  56. package/content/blocks/primitives/form-field/llm.txt +43 -0
  57. package/content/blocks/primitives/input/llm.txt +73 -0
  58. package/content/blocks/primitives/menu/llm.txt +81 -0
  59. package/content/blocks/primitives/pagination/llm.txt +68 -0
  60. package/content/blocks/primitives/popover/llm.txt +72 -0
  61. package/content/blocks/primitives/progress/llm.txt +55 -0
  62. package/content/blocks/primitives/radio-group/llm.txt +53 -0
  63. package/content/blocks/primitives/segment-group/llm.txt +51 -0
  64. package/content/blocks/primitives/select/llm.txt +130 -0
  65. package/content/blocks/primitives/separator/llm.txt +45 -0
  66. package/content/blocks/primitives/sidebar/llm.txt +79 -0
  67. package/content/blocks/primitives/skeleton/llm.txt +54 -0
  68. package/content/blocks/primitives/slider/llm.txt +82 -0
  69. package/content/blocks/primitives/spinner/llm.txt +46 -0
  70. package/content/blocks/primitives/stepper/llm.txt +60 -0
  71. package/content/blocks/primitives/tab/llm.txt +72 -0
  72. package/content/blocks/primitives/textarea/llm.txt +61 -0
  73. package/content/blocks/primitives/toast/llm.txt +45 -0
  74. package/content/blocks/primitives/toggle/llm.txt +62 -0
  75. package/content/blocks/primitives/toolbar/llm.txt +60 -0
  76. package/content/blocks/primitives/tooltip/llm.txt +54 -0
  77. package/content/component-catalog.json +5010 -0
  78. package/content/design-system/patterns/dashboard.md +55 -0
  79. package/content/design-system/patterns/form-page.md +69 -0
  80. package/content/design-system/patterns/onboarding-guide.md +50 -0
  81. package/content/design-system/patterns/planning-board.md +46 -0
  82. package/content/design-system/patterns/settings-page.md +48 -0
  83. package/content/design-system/patterns/tab-navigation.md +136 -0
  84. package/content/design-system/principles.md +260 -0
  85. package/content/docs/components/api-reference/llm.txt +32 -0
  86. package/content/docs/components/code-example/llm.txt +44 -0
  87. package/content/docs/components/code-panel/llm.txt +26 -0
  88. package/content/docs/components/docs-layout/llm.txt +61 -0
  89. package/content/docs/components/info-card/llm.txt +31 -0
  90. package/content/docs/components/playground-configurator/llm.txt +49 -0
  91. package/content/docs/components/section/llm.txt +46 -0
  92. package/content/docs/components/table-of-contents/llm.txt +48 -0
  93. package/content/docs/components/types-reference/llm.txt +38 -0
  94. package/content/guides/llms-full-template.md +1019 -0
  95. package/content/icons.json +4834 -0
  96. package/content/meta.json +5 -0
  97. package/content/table/table/llm.txt +110 -0
  98. package/content/verbs/adopt.md +33 -0
  99. package/content/verbs/audit.md +29 -0
  100. package/content/verbs/compose.md +38 -0
  101. package/content/verbs/critique.md +27 -0
  102. package/content/verbs/fix.md +29 -0
  103. package/content/verbs/migrate.md +30 -0
  104. package/content/verbs/onboard.md +33 -0
  105. package/content/verbs/polish.md +25 -0
  106. package/content/verbs/redesign.md +29 -0
  107. package/content/verbs/retheme.md +29 -0
  108. package/package.json +45 -0
  109. package/src/content-loader.test.ts +78 -0
  110. package/src/content-loader.ts +97 -0
  111. package/src/index.ts +23 -0
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Package-relative locator for the bundled Urbicon UI design knowledge.
3
+ *
4
+ * The bundle (`../content/`, produced at build/publish time by docs-gen's content
5
+ * emitter) ships INSIDE this package, so every consumer — the remote MCP server,
6
+ * the `urbicon` CLI, a CI hook — resolves it from its own install location
7
+ * (`node_modules/@urbicon-ui/design-content/content/`) with no sibling-path
8
+ * assumptions. This replaces the MCP server's former resolution out to
9
+ * `apps/docs/static/` + `design-system/`, which only worked inside a full monorepo
10
+ * checkout and left a published server empty (see DESIGN-MCP-V2 §A.0/2, A.2).
11
+ *
12
+ * `URBICON_CONTENT_DIR` overrides the base — for monorepo dev/tests pointing at a
13
+ * freshly generated bundle, or to serve an alternate content set. The bundle is
14
+ * git-ignored in dev and regenerated by `docs:gen:all`/`build`.
15
+ */
16
+
17
+ import { readFile } from 'node:fs/promises';
18
+ import { dirname, normalize, resolve } from 'node:path';
19
+ import { fileURLToPath } from 'node:url';
20
+
21
+ const moduleDir = dirname(fileURLToPath(import.meta.url));
22
+
23
+ /** The bundle directory: `<package>/content`, or the `URBICON_CONTENT_DIR` override. */
24
+ export function getContentDir(): string {
25
+ return process.env.URBICON_CONTENT_DIR ?? resolve(moduleDir, '..', 'content');
26
+ }
27
+
28
+ /** The assembled component catalog (components + recipes + tags). */
29
+ export function getCatalogPath(): string {
30
+ return resolve(getContentDir(), 'component-catalog.json');
31
+ }
32
+
33
+ /** The design-system copy: `principles.md` + `patterns/*.md`. */
34
+ export function getDesignSystemDir(): string {
35
+ return resolve(getContentDir(), 'design-system');
36
+ }
37
+
38
+ /** The verb-recipe copy: `<verb>.md` per design verb (DESIGN-MCP-V2 §8). */
39
+ export function getVerbsDir(): string {
40
+ return resolve(getContentDir(), 'verbs');
41
+ }
42
+
43
+ /** The `llms-full` template that backs the guide resources. */
44
+ export function getTemplatePath(): string {
45
+ return resolve(getContentDir(), 'guides', 'llms-full-template.md');
46
+ }
47
+
48
+ /** The parsed icon metadata (name → label/categories/keywords). */
49
+ export function getIconsPath(): string {
50
+ return resolve(getContentDir(), 'icons.json');
51
+ }
52
+
53
+ /**
54
+ * Valid component slug: lowercase alphanumeric segments joined by single hyphens.
55
+ * Guards the path join below, since the slug reaches us from tool input.
56
+ */
57
+ const SAFE_SLUG = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
58
+
59
+ /**
60
+ * Resolve a component's `llm.txt` inside the bundle, under its catalog `group`
61
+ * (e.g. `blocks/primitives`). Rejects unsafe slugs and any path that would escape
62
+ * the content dir — the slug is the one part of this path that is caller-supplied.
63
+ */
64
+ export function getComponentLlmPath(group: string, slug: string): string {
65
+ if (!SAFE_SLUG.test(slug)) {
66
+ throw new Error(`Invalid component slug: "${slug}"`);
67
+ }
68
+
69
+ const resolved = resolve(getContentDir(), group, slug, 'llm.txt');
70
+ const base = normalize(getContentDir());
71
+
72
+ if (!resolved.startsWith(base)) {
73
+ throw new Error(`Path traversal blocked for slug: "${slug}"`);
74
+ }
75
+
76
+ return resolved;
77
+ }
78
+
79
+ /** Build provenance for the bundle (the version stamp surfaced in DESIGN-MCP-V2 Anhang B). */
80
+ export interface ContentMeta {
81
+ /** The `@urbicon-ui/*` release this bundle was built from. */
82
+ version: string;
83
+ /** ISO-8601 timestamp of the build. */
84
+ builtAt: string;
85
+ /** Short fingerprint of the bundled catalog content. */
86
+ contentHash: string;
87
+ }
88
+
89
+ /** Read the bundle's `meta.json`, or null when the bundle has not been generated yet. */
90
+ export async function loadContentMeta(): Promise<ContentMeta | null> {
91
+ try {
92
+ const raw = await readFile(resolve(getContentDir(), 'meta.json'), 'utf-8');
93
+ return JSON.parse(raw) as ContentMeta;
94
+ } catch {
95
+ return null;
96
+ }
97
+ }
package/src/index.ts ADDED
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Public API of `@urbicon-ui/design-content` — the version-pinned bundle of Urbicon
3
+ * UI design knowledge (component catalog, per-component `llm.txt`, design-system
4
+ * principles + patterns, guide template, icon metadata) plus a package-relative
5
+ * locator for it. The deterministic engine (linter/manifest/rubric) lives in
6
+ * `@urbicon-ui/design-engine`; this package is the Knowledge plane (DESIGN-MCP-V2 §4).
7
+ *
8
+ * Consumers (the remote MCP server, the `urbicon` CLI) read the bundle through these
9
+ * path helpers, so the content travels with the package — version-coherent and free
10
+ * of monorepo sibling-path assumptions.
11
+ */
12
+
13
+ export type { ContentMeta } from './content-loader.js';
14
+ export {
15
+ getCatalogPath,
16
+ getComponentLlmPath,
17
+ getContentDir,
18
+ getDesignSystemDir,
19
+ getIconsPath,
20
+ getTemplatePath,
21
+ getVerbsDir,
22
+ loadContentMeta
23
+ } from './content-loader.js';