@tramo-digital/types 0.0.0

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 (212) hide show
  1. package/README.md +220 -0
  2. package/dist/CHANGELOG.md +31 -0
  3. package/dist/README.md +220 -0
  4. package/dist/package.json +42 -0
  5. package/dist/src/base/component.d.ts +75 -0
  6. package/dist/src/base/component.d.ts.map +1 -0
  7. package/dist/src/base/component.js +1 -0
  8. package/dist/src/base/data-loader.d.ts +110 -0
  9. package/dist/src/base/data-loader.d.ts.map +1 -0
  10. package/dist/src/base/data-loader.js +1 -0
  11. package/dist/src/base/design-tokens.d.ts +189 -0
  12. package/dist/src/base/design-tokens.d.ts.map +1 -0
  13. package/dist/src/base/design-tokens.js +58 -0
  14. package/dist/src/base/index.d.ts +4 -0
  15. package/dist/src/base/index.d.ts.map +1 -0
  16. package/dist/src/base/index.js +3 -0
  17. package/dist/src/index.d.ts +5 -0
  18. package/dist/src/index.d.ts.map +1 -0
  19. package/dist/src/index.js +4 -0
  20. package/dist/src/models/compositions/accordion.d.ts +43 -0
  21. package/dist/src/models/compositions/accordion.d.ts.map +1 -0
  22. package/dist/src/models/compositions/accordion.js +1 -0
  23. package/dist/src/models/compositions/banner.d.ts +36 -0
  24. package/dist/src/models/compositions/banner.d.ts.map +1 -0
  25. package/dist/src/models/compositions/banner.js +1 -0
  26. package/dist/src/models/compositions/carousel.d.ts +13 -0
  27. package/dist/src/models/compositions/carousel.d.ts.map +1 -0
  28. package/dist/src/models/compositions/carousel.js +1 -0
  29. package/dist/src/models/compositions/collage.d.ts +39 -0
  30. package/dist/src/models/compositions/collage.d.ts.map +1 -0
  31. package/dist/src/models/compositions/collage.js +1 -0
  32. package/dist/src/models/compositions/content-grid.d.ts +44 -0
  33. package/dist/src/models/compositions/content-grid.d.ts.map +1 -0
  34. package/dist/src/models/compositions/content-grid.js +1 -0
  35. package/dist/src/models/compositions/faq.d.ts +42 -0
  36. package/dist/src/models/compositions/faq.d.ts.map +1 -0
  37. package/dist/src/models/compositions/faq.js +1 -0
  38. package/dist/src/models/compositions/footer.d.ts +135 -0
  39. package/dist/src/models/compositions/footer.d.ts.map +1 -0
  40. package/dist/src/models/compositions/footer.js +1 -0
  41. package/dist/src/models/compositions/header.d.ts +98 -0
  42. package/dist/src/models/compositions/header.d.ts.map +1 -0
  43. package/dist/src/models/compositions/header.js +1 -0
  44. package/dist/src/models/compositions/hero-enhanced.d.ts +27 -0
  45. package/dist/src/models/compositions/hero-enhanced.d.ts.map +1 -0
  46. package/dist/src/models/compositions/hero-enhanced.js +1 -0
  47. package/dist/src/models/compositions/hero.d.ts +62 -0
  48. package/dist/src/models/compositions/hero.d.ts.map +1 -0
  49. package/dist/src/models/compositions/hero.js +1 -0
  50. package/dist/src/models/compositions/link-group.d.ts +93 -0
  51. package/dist/src/models/compositions/link-group.d.ts.map +1 -0
  52. package/dist/src/models/compositions/link-group.js +1 -0
  53. package/dist/src/models/compositions/media-quote.d.ts +48 -0
  54. package/dist/src/models/compositions/media-quote.d.ts.map +1 -0
  55. package/dist/src/models/compositions/media-quote.js +1 -0
  56. package/dist/src/models/compositions/media-split.d.ts +37 -0
  57. package/dist/src/models/compositions/media-split.d.ts.map +1 -0
  58. package/dist/src/models/compositions/media-split.js +1 -0
  59. package/dist/src/models/compositions/media-text.d.ts +42 -0
  60. package/dist/src/models/compositions/media-text.d.ts.map +1 -0
  61. package/dist/src/models/compositions/media-text.js +1 -0
  62. package/dist/src/models/compositions/quote-banner.d.ts +66 -0
  63. package/dist/src/models/compositions/quote-banner.d.ts.map +1 -0
  64. package/dist/src/models/compositions/quote-banner.js +1 -0
  65. package/dist/src/models/compositions/quote-section.d.ts +63 -0
  66. package/dist/src/models/compositions/quote-section.d.ts.map +1 -0
  67. package/dist/src/models/compositions/quote-section.js +1 -0
  68. package/dist/src/models/compositions/statement-section.d.ts +49 -0
  69. package/dist/src/models/compositions/statement-section.d.ts.map +1 -0
  70. package/dist/src/models/compositions/statement-section.js +1 -0
  71. package/dist/src/models/compositions/tabs.d.ts +84 -0
  72. package/dist/src/models/compositions/tabs.d.ts.map +1 -0
  73. package/dist/src/models/compositions/tabs.js +1 -0
  74. package/dist/src/models/index.d.ts +54 -0
  75. package/dist/src/models/index.d.ts.map +1 -0
  76. package/dist/src/models/index.js +57 -0
  77. package/dist/src/models/layout/container.d.ts +17 -0
  78. package/dist/src/models/layout/container.d.ts.map +1 -0
  79. package/dist/src/models/layout/container.js +1 -0
  80. package/dist/src/models/layout/drawer.d.ts +31 -0
  81. package/dist/src/models/layout/drawer.d.ts.map +1 -0
  82. package/dist/src/models/layout/drawer.js +1 -0
  83. package/dist/src/models/layout/grid.d.ts +137 -0
  84. package/dist/src/models/layout/grid.d.ts.map +1 -0
  85. package/dist/src/models/layout/grid.js +1 -0
  86. package/dist/src/models/layout/index.d.ts +5 -0
  87. package/dist/src/models/layout/index.d.ts.map +1 -0
  88. package/dist/src/models/layout/index.js +4 -0
  89. package/dist/src/models/layout/stack.d.ts +21 -0
  90. package/dist/src/models/layout/stack.d.ts.map +1 -0
  91. package/dist/src/models/layout/stack.js +1 -0
  92. package/dist/src/models/patterns/author.d.ts +23 -0
  93. package/dist/src/models/patterns/author.d.ts.map +1 -0
  94. package/dist/src/models/patterns/author.js +1 -0
  95. package/dist/src/models/patterns/breadcrumb.d.ts +31 -0
  96. package/dist/src/models/patterns/breadcrumb.d.ts.map +1 -0
  97. package/dist/src/models/patterns/breadcrumb.js +1 -0
  98. package/dist/src/models/patterns/button.d.ts +99 -0
  99. package/dist/src/models/patterns/button.d.ts.map +1 -0
  100. package/dist/src/models/patterns/button.js +1 -0
  101. package/dist/src/models/patterns/card.d.ts +42 -0
  102. package/dist/src/models/patterns/card.d.ts.map +1 -0
  103. package/dist/src/models/patterns/card.js +1 -0
  104. package/dist/src/models/patterns/content.d.ts +96 -0
  105. package/dist/src/models/patterns/content.d.ts.map +1 -0
  106. package/dist/src/models/patterns/content.js +1 -0
  107. package/dist/src/models/patterns/form-group.d.ts +55 -0
  108. package/dist/src/models/patterns/form-group.d.ts.map +1 -0
  109. package/dist/src/models/patterns/form-group.js +1 -0
  110. package/dist/src/models/patterns/navigation.d.ts +62 -0
  111. package/dist/src/models/patterns/navigation.d.ts.map +1 -0
  112. package/dist/src/models/patterns/navigation.js +1 -0
  113. package/dist/src/models/patterns/strip-banner.d.ts +75 -0
  114. package/dist/src/models/patterns/strip-banner.d.ts.map +1 -0
  115. package/dist/src/models/patterns/strip-banner.js +1 -0
  116. package/dist/src/models/patterns/teaser.d.ts +88 -0
  117. package/dist/src/models/patterns/teaser.d.ts.map +1 -0
  118. package/dist/src/models/patterns/teaser.js +1 -0
  119. package/dist/src/models/patterns/text-link.d.ts +59 -0
  120. package/dist/src/models/patterns/text-link.d.ts.map +1 -0
  121. package/dist/src/models/patterns/text-link.js +1 -0
  122. package/dist/src/models/primitives/avatar.d.ts +24 -0
  123. package/dist/src/models/primitives/avatar.d.ts.map +1 -0
  124. package/dist/src/models/primitives/avatar.js +1 -0
  125. package/dist/src/models/primitives/badge.d.ts +24 -0
  126. package/dist/src/models/primitives/badge.d.ts.map +1 -0
  127. package/dist/src/models/primitives/badge.js +1 -0
  128. package/dist/src/models/primitives/checkbox.d.ts +69 -0
  129. package/dist/src/models/primitives/checkbox.d.ts.map +1 -0
  130. package/dist/src/models/primitives/checkbox.js +1 -0
  131. package/dist/src/models/primitives/frame.d.ts +11 -0
  132. package/dist/src/models/primitives/frame.d.ts.map +1 -0
  133. package/dist/src/models/primitives/frame.js +1 -0
  134. package/dist/src/models/primitives/icon.d.ts +21 -0
  135. package/dist/src/models/primitives/icon.d.ts.map +1 -0
  136. package/dist/src/models/primitives/icon.js +1 -0
  137. package/dist/src/models/primitives/image.d.ts +33 -0
  138. package/dist/src/models/primitives/image.d.ts.map +1 -0
  139. package/dist/src/models/primitives/image.js +1 -0
  140. package/dist/src/models/primitives/input.d.ts +94 -0
  141. package/dist/src/models/primitives/input.d.ts.map +1 -0
  142. package/dist/src/models/primitives/input.js +1 -0
  143. package/dist/src/models/primitives/interface-icon.d.ts +20 -0
  144. package/dist/src/models/primitives/interface-icon.d.ts.map +1 -0
  145. package/dist/src/models/primitives/interface-icon.js +1 -0
  146. package/dist/src/models/primitives/list.d.ts +58 -0
  147. package/dist/src/models/primitives/list.d.ts.map +1 -0
  148. package/dist/src/models/primitives/list.js +1 -0
  149. package/dist/src/models/primitives/loader.d.ts +23 -0
  150. package/dist/src/models/primitives/loader.d.ts.map +1 -0
  151. package/dist/src/models/primitives/loader.js +1 -0
  152. package/dist/src/models/primitives/logo.d.ts +28 -0
  153. package/dist/src/models/primitives/logo.d.ts.map +1 -0
  154. package/dist/src/models/primitives/logo.js +1 -0
  155. package/dist/src/models/primitives/overlay.d.ts +29 -0
  156. package/dist/src/models/primitives/overlay.d.ts.map +1 -0
  157. package/dist/src/models/primitives/overlay.js +1 -0
  158. package/dist/src/models/primitives/radio.d.ts +71 -0
  159. package/dist/src/models/primitives/radio.d.ts.map +1 -0
  160. package/dist/src/models/primitives/radio.js +1 -0
  161. package/dist/src/models/primitives/select.d.ts +62 -0
  162. package/dist/src/models/primitives/select.d.ts.map +1 -0
  163. package/dist/src/models/primitives/select.js +1 -0
  164. package/dist/src/models/primitives/separator.d.ts +20 -0
  165. package/dist/src/models/primitives/separator.d.ts.map +1 -0
  166. package/dist/src/models/primitives/separator.js +1 -0
  167. package/dist/src/models/primitives/text-block.d.ts +25 -0
  168. package/dist/src/models/primitives/text-block.d.ts.map +1 -0
  169. package/dist/src/models/primitives/text-block.js +1 -0
  170. package/dist/src/models/primitives/text-body.d.ts +40 -0
  171. package/dist/src/models/primitives/text-body.d.ts.map +1 -0
  172. package/dist/src/models/primitives/text-body.js +1 -0
  173. package/dist/src/models/primitives/text-display.d.ts +40 -0
  174. package/dist/src/models/primitives/text-display.d.ts.map +1 -0
  175. package/dist/src/models/primitives/text-display.js +1 -0
  176. package/dist/src/models/primitives/text-eyebrow.d.ts +40 -0
  177. package/dist/src/models/primitives/text-eyebrow.d.ts.map +1 -0
  178. package/dist/src/models/primitives/text-eyebrow.js +1 -0
  179. package/dist/src/models/primitives/text-heading.d.ts +22 -0
  180. package/dist/src/models/primitives/text-heading.d.ts.map +1 -0
  181. package/dist/src/models/primitives/text-heading.js +1 -0
  182. package/dist/src/models/primitives/text-quote.d.ts +32 -0
  183. package/dist/src/models/primitives/text-quote.d.ts.map +1 -0
  184. package/dist/src/models/primitives/text-quote.js +1 -0
  185. package/dist/src/models/primitives/textarea.d.ts +60 -0
  186. package/dist/src/models/primitives/textarea.d.ts.map +1 -0
  187. package/dist/src/models/primitives/textarea.js +1 -0
  188. package/dist/src/models/primitives/toggle.d.ts +95 -0
  189. package/dist/src/models/primitives/toggle.d.ts.map +1 -0
  190. package/dist/src/models/primitives/toggle.js +1 -0
  191. package/dist/src/models/primitives/video.d.ts +39 -0
  192. package/dist/src/models/primitives/video.d.ts.map +1 -0
  193. package/dist/src/models/primitives/video.js +1 -0
  194. package/dist/src/pages/index.d.ts +2 -0
  195. package/dist/src/pages/index.d.ts.map +1 -0
  196. package/dist/src/pages/index.js +1 -0
  197. package/dist/src/pages/page-document.d.ts +62 -0
  198. package/dist/src/pages/page-document.d.ts.map +1 -0
  199. package/dist/src/pages/page-document.js +8 -0
  200. package/dist/src/schema/index.d.ts +68 -0
  201. package/dist/src/schema/index.d.ts.map +1 -0
  202. package/dist/src/schema/index.js +2 -0
  203. package/dist/src/utils/helpers.d.ts +87 -0
  204. package/dist/src/utils/helpers.d.ts.map +1 -0
  205. package/dist/src/utils/helpers.js +1 -0
  206. package/dist/src/utils/index.d.ts +3 -0
  207. package/dist/src/utils/index.d.ts.map +1 -0
  208. package/dist/src/utils/index.js +1 -0
  209. package/dist/src/utils/string.d.ts +66 -0
  210. package/dist/src/utils/string.d.ts.map +1 -0
  211. package/dist/src/utils/string.js +7 -0
  212. package/package.json +40 -0
@@ -0,0 +1,95 @@
1
+ import type { BaseComponentModel } from '../../base/component.js';
2
+ export type ToggleSize = 'sm' | 'md' | 'lg';
3
+ export interface ToggleData {
4
+ /** Input name attribute */
5
+ name: string;
6
+ /** Visible label text */
7
+ label?: string;
8
+ /** Whether the toggle is active (true) or inactive (false) */
9
+ checked?: boolean;
10
+ /** Default checked state for uncontrolled usage */
11
+ defaultChecked?: boolean;
12
+ /** Value submitted with the form when checked */
13
+ value?: string;
14
+ /** Whether the toggle is disabled */
15
+ disabled?: boolean;
16
+ /** Whether the toggle is required */
17
+ required?: boolean;
18
+ /** Validation error message */
19
+ errorMessage?: string;
20
+ /** Responsive sizing tier */
21
+ size?: ToggleSize;
22
+ /** Optional icon name to display inside thumb when checked is true */
23
+ activeIcon?: string;
24
+ /** Optional icon name to display inside thumb when checked is false */
25
+ inactiveIcon?: string;
26
+ /** Screen reader label when visible label is not provided */
27
+ ariaLabel?: string;
28
+ }
29
+ export interface ToggleEvents {
30
+ onChange?: (checked: boolean, event?: unknown) => void;
31
+ onFocus?: (event?: unknown) => void;
32
+ onBlur?: (event?: unknown) => void;
33
+ }
34
+ export interface ToggleTokens {
35
+ sizing?: {
36
+ trackWidth?: {
37
+ sm?: string;
38
+ md?: string;
39
+ lg?: string;
40
+ };
41
+ trackHeight?: {
42
+ sm?: string;
43
+ md?: string;
44
+ lg?: string;
45
+ };
46
+ thumbSize?: {
47
+ sm?: string;
48
+ md?: string;
49
+ lg?: string;
50
+ };
51
+ iconSize?: {
52
+ sm?: string;
53
+ md?: string;
54
+ lg?: string;
55
+ };
56
+ };
57
+ color?: {
58
+ trackActive?: {
59
+ default?: string;
60
+ };
61
+ trackInactive?: {
62
+ default?: string;
63
+ };
64
+ thumb?: {
65
+ default?: string;
66
+ };
67
+ iconActiveTarget?: {
68
+ default?: string;
69
+ };
70
+ iconInactiveTarget?: {
71
+ default?: string;
72
+ };
73
+ border?: {
74
+ default?: string;
75
+ };
76
+ focusRing?: {
77
+ default?: string;
78
+ };
79
+ };
80
+ borderRadius?: {
81
+ track?: {
82
+ default?: string;
83
+ };
84
+ thumb?: {
85
+ default?: string;
86
+ };
87
+ };
88
+ opacity?: {
89
+ disabled?: {
90
+ default?: string;
91
+ };
92
+ };
93
+ }
94
+ export type ToggleModel = BaseComponentModel<'Toggle', ToggleData, ToggleEvents, ToggleTokens>;
95
+ //# sourceMappingURL=toggle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../../../src/models/primitives/toggle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5C,MAAM,WAAW,UAAU;IACzB,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,yBAAyB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mDAAmD;IACnD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+BAA+B;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6BAA6B;IAC7B,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACvD,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,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,EAAE,MAAM,CAAA;SAAE,CAAC;KAClC,CAAC;IACF,YAAY,CAAC,EAAE;QACb,KAAK,CAAC,EAAE;YAAE,OAAO,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QAC7B,KAAK,CAAC,EAAE;YAAE,OAAO,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KAC9B,CAAC;IACF,OAAO,CAAC,EAAE;QACR,QAAQ,CAAC,EAAE;YAAE,OAAO,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KACjC,CAAC;CACH;AAED,MAAM,MAAM,WAAW,GAAG,kBAAkB,CAC1C,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,YAAY,CACb,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,39 @@
1
+ import type { BaseComponentModel } from '../../base/component.js';
2
+ export interface VideoData {
3
+ src: string;
4
+ poster?: string;
5
+ alt?: string;
6
+ type?: string;
7
+ autoPlay?: boolean;
8
+ loop?: boolean;
9
+ muted?: boolean;
10
+ playsInline?: boolean;
11
+ controls?: boolean;
12
+ width?: number;
13
+ height?: number;
14
+ sources?: {
15
+ mobile?: string;
16
+ tablet?: string;
17
+ desktop?: string;
18
+ desktopxl?: string;
19
+ };
20
+ captionTrack?: {
21
+ src: string;
22
+ srclang?: string;
23
+ label?: string;
24
+ };
25
+ }
26
+ export interface VideoTokens {
27
+ border?: {
28
+ borderRadius?: {
29
+ default: string;
30
+ };
31
+ };
32
+ }
33
+ export interface VideoEvents {
34
+ onPlay?: () => void;
35
+ onPause?: () => void;
36
+ onEnded?: () => void;
37
+ }
38
+ export type VideoModel = BaseComponentModel<'Video', VideoData, VideoEvents, VideoTokens>;
39
+ //# sourceMappingURL=video.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../../../../src/models/primitives/video.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,MA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"index.d.ts","sourceRoot":"","sources":["../../../src/pages/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './page-document.js';
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Open DS Page Document Types
3
+ *
4
+ * Canonical output types for the page-composer agent.
5
+ * A PageDocument is the structured JSON representation of a full page,
6
+ * analogous to AEM's jcr:content node tree adapted to Open DS conventions.
7
+ */
8
+ /**
9
+ * Represents a single content section on a page.
10
+ * Maps directly to a scaffold component instance.
11
+ * Analogous to AEM's jcr:content node (resourceType + properties).
12
+ */
13
+ export interface PageSection {
14
+ /** Unique section identifier (slug, used as React key and anchor) */
15
+ id: string;
16
+ /** Discriminated type — matches the scaffold component name ('Hero', 'Faq', 'Banner', …) */
17
+ _type: string;
18
+ /** Display order (0-indexed, ascending) */
19
+ order: number;
20
+ /** Component data matching the corresponding ${Name}Data interface */
21
+ data: Record<string, unknown>;
22
+ /** Optional token overrides for this section */
23
+ tokens?: Record<string, unknown>;
24
+ /** Color palette for this section */
25
+ colorPalette?: 'light' | 'dark';
26
+ /** Whether this section is hidden from the rendered output */
27
+ hidden?: boolean;
28
+ /** Nested sections (e.g., items inside Accordion or Carousel) */
29
+ children?: PageSection[];
30
+ }
31
+ /** Top-level page metadata (mirrors AEM cq:PageContent properties) */
32
+ export interface PageMeta {
33
+ /** URL slug */
34
+ path: string;
35
+ /** Browser <title> */
36
+ title: string;
37
+ /** Meta description */
38
+ description?: string;
39
+ /** OG image URL */
40
+ ogImage?: string;
41
+ /** Default color palette applied to all sections unless overridden */
42
+ colorPalette?: 'light' | 'dark';
43
+ /** Human-readable page template identifier */
44
+ template?: 'landing' | 'article' | 'product' | 'generic';
45
+ }
46
+ /**
47
+ * Top-level page document — the canonical output of the page composer agent.
48
+ * Serializable to JSON; stored in conversation history; rendered to React TSX
49
+ * by the code renderer.
50
+ */
51
+ export interface PageDocument {
52
+ /** Schema version for forward compatibility */
53
+ _version: '1.0';
54
+ /** Page metadata */
55
+ meta: PageMeta;
56
+ /**
57
+ * Ordered list of page sections.
58
+ * Sections are rendered top-to-bottom in ascending `order` value.
59
+ */
60
+ sections: PageSection[];
61
+ }
62
+ //# sourceMappingURL=page-document.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page-document.d.ts","sourceRoot":"","sources":["../../../src/pages/page-document.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,qEAAqE;IACrE,EAAE,EAAE,MAAM,CAAC;IACX,4FAA4F;IAC5F,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,qCAAqC;IACrC,YAAY,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAChC,8DAA8D;IAC9D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;CAC1B;AAED,sEAAsE;AACtE,MAAM,WAAW,QAAQ;IACvB,eAAe;IACf,IAAI,EAAE,MAAM,CAAC;IACb,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sEAAsE;IACtE,YAAY,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAChC,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;CAC1D;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,+CAA+C;IAC/C,QAAQ,EAAE,KAAK,CAAC;IAChB,oBAAoB;IACpB,IAAI,EAAE,QAAQ,CAAC;IACf;;;OAGG;IACH,QAAQ,EAAE,WAAW,EAAE,CAAC;CACzB"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Open DS Page Document Types
3
+ *
4
+ * Canonical output types for the page-composer agent.
5
+ * A PageDocument is the structured JSON representation of a full page,
6
+ * analogous to AEM's jcr:content node tree adapted to Open DS conventions.
7
+ */
8
+ export {};
@@ -0,0 +1,68 @@
1
+ /** The Standard Schema interface. */
2
+ export interface StandardSchemaV1<Input = unknown, Output = Input> {
3
+ /** The Standard Schema properties. */
4
+ readonly '~standard': StandardSchemaV1.Props<Input, Output>;
5
+ }
6
+ export declare namespace StandardSchemaV1 {
7
+ /** The Standard Schema properties interface. */
8
+ interface Props<Input = unknown, Output = Input> {
9
+ /** The version number of the standard. */
10
+ readonly version: 1;
11
+ /** The vendor name of the schema library. */
12
+ readonly vendor: string;
13
+ /** Validates unknown input values. */
14
+ readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
15
+ /** Inferred types associated with the schema. */
16
+ readonly types?: Types<Input, Output> | undefined;
17
+ }
18
+ /** The result interface of the validate function. */
19
+ type Result<Output> = SuccessResult<Output> | FailureResult;
20
+ /** The result interface if validation succeeds. */
21
+ interface SuccessResult<Output> {
22
+ /** The typed output value. */
23
+ readonly value: Output;
24
+ /** The non-existent issues. */
25
+ readonly issues?: undefined;
26
+ }
27
+ /** The result interface if validation fails. */
28
+ interface FailureResult {
29
+ /** The issues of failed validation. */
30
+ readonly issues: ReadonlyArray<Issue>;
31
+ }
32
+ /** The issue interface of the failure output. */
33
+ interface Issue {
34
+ /** The error message of the issue. */
35
+ readonly message: string;
36
+ /** The path of the issue, if any. */
37
+ readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
38
+ }
39
+ /** The path segment interface of the issue. */
40
+ interface PathSegment {
41
+ /** The key representing a path segment. */
42
+ readonly key: PropertyKey;
43
+ }
44
+ /** The Standard Schema types interface. */
45
+ interface Types<Input = unknown, Output = Input> {
46
+ /** The input type of the schema. */
47
+ readonly input: Input;
48
+ /** The output type of the schema. */
49
+ readonly output: Output;
50
+ }
51
+ /** Infers the input type of a Standard Schema. */
52
+ type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema['~standard']['types']>['input'];
53
+ /** Infers the output type of a Standard Schema. */
54
+ type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema['~standard']['types']>['output'];
55
+ }
56
+ /**
57
+ * Utility type to extract the data type from a component with schema validation
58
+ */
59
+ export type ExtractSchemaOutput<T> = T extends {
60
+ schema: StandardSchemaV1<any, infer Output>;
61
+ } ? Output : never;
62
+ /**
63
+ * Utility type to extract the input type from a component with schema validation
64
+ */
65
+ export type ExtractSchemaInput<T> = T extends {
66
+ schema: StandardSchemaV1<infer Input, any>;
67
+ } ? Input : never;
68
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schema/index.ts"],"names":[],"mappings":"AAEA,qCAAqC;AACrC,MAAM,WAAW,gBAAgB,CAAC,KAAK,GAAG,OAAO,EAAE,MAAM,GAAG,KAAK;IAC/D,sCAAsC;IACtC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;CAC7D;AAED,MAAM,CAAC,OAAO,WAAW,gBAAgB,CAAC;IACxC,gDAAgD;IAChD,UAAiB,KAAK,CAAC,KAAK,GAAG,OAAO,EAAE,MAAM,GAAG,KAAK;QACpD,0CAA0C;QAC1C,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;QACpB,6CAA6C;QAC7C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,sCAAsC;QACtC,QAAQ,CAAC,QAAQ,EAAE,CACjB,KAAK,EAAE,OAAO,KACX,MAAM,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MA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B,IAAI,WAAW,CACpE,MAAM,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAC7B,CAAC,QAAQ,CAAC,CAAC;CACb;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,SAAS;IAC7C,MAAM,EAAE,gBAAgB,CAAC,GAAG,EAAE,MAAM,MAAM,CAAC,CAAC;CAC7C,GACG,MAAM,GACN,KAAK,CAAC;AAEV;;GAEG;AACH,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI,CAAC,SAAS;IAC5C,MAAM,EAAE,gBAAgB,CAAC,MAAM,KAAK,EAAE,GAAG,CAAC,CAAC;CAC5C,GACG,KAAK,GACL,KAAK,CAAC"}
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @typescript-eslint/no-namespace */
2
+ export {};
@@ -0,0 +1,87 @@
1
+ import type { ToSnakeCase } from './string.ts';
2
+ /**
3
+ * Helper Utility Types
4
+ *
5
+ * Provides commonly used utility types for component model operations.
6
+ */
7
+ /**
8
+ * Generates component type identifier from component name
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * type ButtonType = ComponentType<'Button'>; // 'button'
13
+ * type GridType = ComponentType<'GridContainer'>; // 'grid_container'
14
+ * ```
15
+ */
16
+ export type ComponentType<TName extends string> = ToSnakeCase<TName>;
17
+ /**
18
+ * Extracts the component name from a component model type
19
+ *
20
+ * @example
21
+ * ```typescript
22
+ * type Name = ExtractComponentName<{ name: 'Button'; type: 'button' }>; // 'Button'
23
+ * ```
24
+ */
25
+ export type ExtractComponentName<T> = T extends {
26
+ name: infer N;
27
+ } ? N extends string ? N : never : never;
28
+ /**
29
+ * Extracts the component type from a component model type
30
+ *
31
+ * @example
32
+ * ```typescript
33
+ * type Type = ExtractComponentType<{ name: 'Button'; type: 'button' }>; // 'button'
34
+ * ```
35
+ */
36
+ export type ExtractComponentType<T> = T extends {
37
+ type: infer Type;
38
+ } ? Type extends string ? Type : never : never;
39
+ /**
40
+ * Creates a union of all component names from a model union
41
+ *
42
+ * @example
43
+ * ```typescript
44
+ * type Names = ComponentNames<ButtonModel | HeroModel>; // 'Button' | 'Hero'
45
+ * ```
46
+ */
47
+ export type ComponentNames<T> = ExtractComponentName<T>;
48
+ /**
49
+ * Creates a union of all component types from a model union
50
+ *
51
+ * @example
52
+ * ```typescript
53
+ * type Types = ComponentTypes<ButtonModel | HeroModel>; // 'button' | 'hero'
54
+ * ```
55
+ */
56
+ export type ComponentTypes<T> = ExtractComponentType<T>;
57
+ /**
58
+ * Filters component models by their category/type pattern
59
+ *
60
+ * @example
61
+ * ```typescript
62
+ * type primitives = FilterByType<AllModels, `${string}`>; // All single-word types
63
+ * type Layouts = FilterByType<AllModels, `${string}_${string}`>; // Multi-word types
64
+ * ```
65
+ */
66
+ export type FilterByType<T, Pattern extends string> = T extends {
67
+ type: Pattern;
68
+ } ? T : never;
69
+ /**
70
+ * Makes specified properties optional while keeping others required
71
+ *
72
+ * @example
73
+ * ```typescript
74
+ * type PartialButton = PartialBy<ButtonModel, 'variant' | 'size'>; // variant and size optional
75
+ * ```
76
+ */
77
+ export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
78
+ /**
79
+ * Makes specified properties required while keeping others as-is
80
+ *
81
+ * @example
82
+ * ```typescript
83
+ * type RequiredButton = RequiredBy<Partial<ButtonModel>, 'name' | 'type'>; // name and type required
84
+ * ```
85
+ */
86
+ export type RequiredBy<T, K extends keyof T> = T & Required<Pick<T, K>>;
87
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;GAIG;AAEH;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,CAAC,KAAK,SAAS,MAAM,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC;AAErE;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC,CAAA;CAAE,GAC7D,CAAC,SAAS,MAAM,GACd,CAAC,GACD,KAAK,GACP,KAAK,CAAC;AAEV;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,IAAI,CAAA;CAAE,GAChE,IAAI,SAAS,MAAM,GACjB,IAAI,GACJ,KAAK,GACP,KAAK,CAAC;AAEV;;;;;;;GAOG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,oBAAoB,CAAC,CAAC,CAAC,CAAC;AAExD;;;;;;;GAOG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,oBAAoB,CAAC,CAAC,CAAC,CAAC;AAExD;;;;;;;;GAQG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,OAAO,SAAS,MAAM,IAAI,CAAC,SAAS;IAC9D,IAAI,EAAE,OAAO,CAAC;CACf,GACG,CAAC,GACD,KAAK,CAAC;AAEV;;;;;;;GAOG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAE/E;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export type { ToSnakeCase, ToPascalCase, KebabToPascal, ExtractStrings, IsPascalCase, PascalCaseName, } from './string.js';
2
+ export type { ComponentType, ExtractComponentName, ComponentNames, ComponentTypes, FilterByType, PartialBy, RequiredBy, } from './helpers.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,WAAW,EACX,YAAY,EACZ,aAAa,EACb,cAAc,EACd,YAAY,EACZ,cAAc,GACf,MAAM,aAAa,CAAC;AAGrB,YAAY,EACV,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,YAAY,EACZ,SAAS,EACT,UAAU,GACX,MAAM,cAAc,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,66 @@
1
+ /**
2
+ * String Utility Types
3
+ *
4
+ * Provides TypeScript utility types for string manipulation,
5
+ * particularly for converting between naming conventions and validation.
6
+ */
7
+ /**
8
+ * Validates that a string follows PascalCase convention
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * type Valid1 = IsPascalCase<'Button'>; // true
13
+ * type Valid2 = IsPascalCase<'GridContainer'>; // true
14
+ * type Valid3 = IsPascalCase<'AccordionItem'>; // true
15
+ * type Invalid1 = IsPascalCase<'button'>; // false
16
+ * type Invalid2 = IsPascalCase<'gridContainer'>; // false
17
+ * type Invalid3 = IsPascalCase<'grid_container'>; // false
18
+ * ```
19
+ */
20
+ export type IsPascalCase<T extends string> = T extends `${infer First}${infer Rest}` ? First extends Uppercase<First> ? First extends Lowercase<First> ? false : Rest extends '' ? true : Rest extends `${infer Second}${string}` ? Second extends '_' | '-' | ' ' ? false : true : true : false : false;
21
+ /**
22
+ * Enforces PascalCase naming convention for component names
23
+ *
24
+ * @example
25
+ * ```typescript
26
+ * type ButtonName = PascalCaseName<'Button'>; // 'Button'
27
+ * type GridName = PascalCaseName<'GridContainer'>; // 'GridContainer'
28
+ * type InvalidName = PascalCaseName<'button'>; // never (compilation error)
29
+ * ```
30
+ */
31
+ export type PascalCaseName<T extends string> = IsPascalCase<T> extends true ? T : never;
32
+ /**
33
+ * Converts PascalCase strings to snake_case
34
+ *
35
+ * @example
36
+ * ```typescript
37
+ * type ButtonType = ToSnakeCase<'Button'>; // 'button'
38
+ * type GridType = ToSnakeCase<'GridContainer'>; // 'grid_container'
39
+ * type ItemType = ToSnakeCase<'AccordionItem'>; // 'accordion_item'
40
+ * ```
41
+ */
42
+ export type ToSnakeCase<T extends string> = T extends `${infer First}${infer Rest}` ? Rest extends '' ? Lowercase<First> : Rest extends `${infer Second}${infer Remaining}` ? Second extends Uppercase<Second> ? `${Lowercase<First>}_${ToSnakeCase<`${Second}${Remaining}`>}` : `${Lowercase<First>}${ToSnakeCase<`${Second}${Remaining}`>}` : Lowercase<T> : Lowercase<T>;
43
+ /**
44
+ * Converts snake_case strings to PascalCase
45
+ *
46
+ * @example
47
+ * ```typescript
48
+ * type ButtonName = ToPascalCase<'button'>; // 'Button'
49
+ * type GridName = ToPascalCase<'grid_container'>; // 'GridContainer'
50
+ * ```
51
+ */
52
+ export type ToPascalCase<T extends string> = T extends `${infer First}_${infer Rest}` ? `${Capitalize<First>}${ToPascalCase<Rest>}` : Capitalize<T>;
53
+ /**
54
+ * Converts kebab-case strings to PascalCase
55
+ *
56
+ * @example
57
+ * ```typescript
58
+ * type ComponentName = KebabToPascal<'hero-banner'>; // 'HeroBanner'
59
+ * ```
60
+ */
61
+ export type KebabToPascal<T extends string> = T extends `${infer First}-${infer Rest}` ? `${Capitalize<First>}${KebabToPascal<Rest>}` : Capitalize<T>;
62
+ /**
63
+ * String for creating labeled tuples using extractStrings
64
+ */
65
+ export type ExtractStrings<T extends readonly string[]> = T[number] extends string ? T[number] : never;
66
+ //# sourceMappingURL=string.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../src/utils/string.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,IACvC,CAAC,SAAS,GAAG,MAAM,KA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,CAAC,CAAC,CAAC;AAEpB;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,MAAM,IACxC,CAAC,SAAS,GAAG,MAAM,KAAK,IAAI,MAAM,IAAI,EAAE,GACpC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,aAAa,CAAC,IAAI,CAAC,EAAE,GAC5C,UAAU,CAAC,CAAC,CAAC,CAAC;AAEpB;;GAEG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,SAAS,MAAM,EAAE,IACpD,CAAC,CAAC,MAAM,CAAC,SAAS,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * String Utility Types
3
+ *
4
+ * Provides TypeScript utility types for string manipulation,
5
+ * particularly for converting between naming conventions and validation.
6
+ */
7
+ export {};
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@tramo-digital/types",
3
+ "version": "0.0.0",
4
+ "description": "tramo.digital - types",
5
+ "type": "module",
6
+ "types": "./dist/src/index.d.ts",
7
+ "author": "carlosp0veda",
8
+ "license": "MIT",
9
+ "exports": {
10
+ "./package.json": "./package.json",
11
+ ".": {
12
+ "types": "./dist/src/index.d.ts",
13
+ "import": "./dist/src/index.d.ts",
14
+ "require": "./dist/src/index.d.ts"
15
+ }
16
+ },
17
+ "dependencies": {
18
+ "tslib": "^2.3.0"
19
+ },
20
+ "devDependencies": {
21
+ "typescript": "^5.8.3"
22
+ },
23
+ "scripts": {
24
+ "build": "tsc -b .",
25
+ "publish": "pnpm publish",
26
+ "publish-local": "npm publish --registry http://localhost:4873 --access public"
27
+ },
28
+ "files": [
29
+ "dist",
30
+ "!**/*.tsbuildinfo"
31
+ ],
32
+ "engines": {
33
+ "node": ">=18.0.0",
34
+ "pnpm": ">=9.0.0"
35
+ },
36
+ "volta": {
37
+ "node": "22.16.0",
38
+ "pnpm": "10.4.0"
39
+ }
40
+ }