@tekton-ui/core 0.2.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 (254) hide show
  1. package/README.md +758 -0
  2. package/dist/blueprint.d.ts +44 -0
  3. package/dist/blueprint.d.ts.map +1 -0
  4. package/dist/blueprint.js +163 -0
  5. package/dist/blueprint.js.map +1 -0
  6. package/dist/component-schemas.d.ts +78 -0
  7. package/dist/component-schemas.d.ts.map +1 -0
  8. package/dist/component-schemas.js +1037 -0
  9. package/dist/component-schemas.js.map +1 -0
  10. package/dist/css-generator.d.ts +42 -0
  11. package/dist/css-generator.d.ts.map +1 -0
  12. package/dist/css-generator.js +339 -0
  13. package/dist/css-generator.js.map +1 -0
  14. package/dist/icon-library.d.ts +109 -0
  15. package/dist/icon-library.d.ts.map +1 -0
  16. package/dist/icon-library.js +204 -0
  17. package/dist/icon-library.js.map +1 -0
  18. package/dist/index.d.ts +36 -0
  19. package/dist/index.d.ts.map +1 -0
  20. package/dist/index.js +51 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/layout-css-generator.d.ts +158 -0
  23. package/dist/layout-css-generator.d.ts.map +1 -0
  24. package/dist/layout-css-generator.js +901 -0
  25. package/dist/layout-css-generator.js.map +1 -0
  26. package/dist/layout-resolver.d.ts +92 -0
  27. package/dist/layout-resolver.d.ts.map +1 -0
  28. package/dist/layout-resolver.js +275 -0
  29. package/dist/layout-resolver.js.map +1 -0
  30. package/dist/layout-tokens/index.d.ts +16 -0
  31. package/dist/layout-tokens/index.d.ts.map +1 -0
  32. package/dist/layout-tokens/index.js +16 -0
  33. package/dist/layout-tokens/index.js.map +1 -0
  34. package/dist/layout-tokens/keyboard.d.ts +254 -0
  35. package/dist/layout-tokens/keyboard.d.ts.map +1 -0
  36. package/dist/layout-tokens/keyboard.js +407 -0
  37. package/dist/layout-tokens/keyboard.js.map +1 -0
  38. package/dist/layout-tokens/mobile-shells.d.ts +78 -0
  39. package/dist/layout-tokens/mobile-shells.d.ts.map +1 -0
  40. package/dist/layout-tokens/mobile-shells.js +635 -0
  41. package/dist/layout-tokens/mobile-shells.js.map +1 -0
  42. package/dist/layout-tokens/pages.d.ts +100 -0
  43. package/dist/layout-tokens/pages.d.ts.map +1 -0
  44. package/dist/layout-tokens/pages.js +576 -0
  45. package/dist/layout-tokens/pages.js.map +1 -0
  46. package/dist/layout-tokens/responsive.d.ts +109 -0
  47. package/dist/layout-tokens/responsive.d.ts.map +1 -0
  48. package/dist/layout-tokens/responsive.js +167 -0
  49. package/dist/layout-tokens/responsive.js.map +1 -0
  50. package/dist/layout-tokens/safe-area.d.ts +156 -0
  51. package/dist/layout-tokens/safe-area.d.ts.map +1 -0
  52. package/dist/layout-tokens/safe-area.js +316 -0
  53. package/dist/layout-tokens/safe-area.js.map +1 -0
  54. package/dist/layout-tokens/sections-advanced.d.ts +277 -0
  55. package/dist/layout-tokens/sections-advanced.d.ts.map +1 -0
  56. package/dist/layout-tokens/sections-advanced.js +593 -0
  57. package/dist/layout-tokens/sections-advanced.js.map +1 -0
  58. package/dist/layout-tokens/sections.d.ts +137 -0
  59. package/dist/layout-tokens/sections.d.ts.map +1 -0
  60. package/dist/layout-tokens/sections.js +694 -0
  61. package/dist/layout-tokens/sections.js.map +1 -0
  62. package/dist/layout-tokens/shells.d.ts +77 -0
  63. package/dist/layout-tokens/shells.d.ts.map +1 -0
  64. package/dist/layout-tokens/shells.js +408 -0
  65. package/dist/layout-tokens/shells.js.map +1 -0
  66. package/dist/layout-tokens/touch-target.d.ts +119 -0
  67. package/dist/layout-tokens/touch-target.d.ts.map +1 -0
  68. package/dist/layout-tokens/touch-target.js +156 -0
  69. package/dist/layout-tokens/touch-target.js.map +1 -0
  70. package/dist/layout-tokens/types.d.ts +632 -0
  71. package/dist/layout-tokens/types.d.ts.map +1 -0
  72. package/dist/layout-tokens/types.js +49 -0
  73. package/dist/layout-tokens/types.js.map +1 -0
  74. package/dist/layout-validation.d.ts +1547 -0
  75. package/dist/layout-validation.d.ts.map +1 -0
  76. package/dist/layout-validation.js +628 -0
  77. package/dist/layout-validation.js.map +1 -0
  78. package/dist/render.d.ts +23 -0
  79. package/dist/render.d.ts.map +1 -0
  80. package/dist/render.js +244 -0
  81. package/dist/render.js.map +1 -0
  82. package/dist/schema-validation.d.ts +208 -0
  83. package/dist/schema-validation.d.ts.map +1 -0
  84. package/dist/schema-validation.js +205 -0
  85. package/dist/schema-validation.js.map +1 -0
  86. package/dist/screen-generation/generators/css-in-js-generator.d.ts +82 -0
  87. package/dist/screen-generation/generators/css-in-js-generator.d.ts.map +1 -0
  88. package/dist/screen-generation/generators/css-in-js-generator.js +335 -0
  89. package/dist/screen-generation/generators/css-in-js-generator.js.map +1 -0
  90. package/dist/screen-generation/generators/index.d.ts +13 -0
  91. package/dist/screen-generation/generators/index.d.ts.map +1 -0
  92. package/dist/screen-generation/generators/index.js +32 -0
  93. package/dist/screen-generation/generators/index.js.map +1 -0
  94. package/dist/screen-generation/generators/react-generator.d.ts +100 -0
  95. package/dist/screen-generation/generators/react-generator.d.ts.map +1 -0
  96. package/dist/screen-generation/generators/react-generator.js +379 -0
  97. package/dist/screen-generation/generators/react-generator.js.map +1 -0
  98. package/dist/screen-generation/generators/tailwind-generator.d.ts +105 -0
  99. package/dist/screen-generation/generators/tailwind-generator.d.ts.map +1 -0
  100. package/dist/screen-generation/generators/tailwind-generator.js +355 -0
  101. package/dist/screen-generation/generators/tailwind-generator.js.map +1 -0
  102. package/dist/screen-generation/generators/types.d.ts +136 -0
  103. package/dist/screen-generation/generators/types.d.ts.map +1 -0
  104. package/dist/screen-generation/generators/types.js +18 -0
  105. package/dist/screen-generation/generators/types.js.map +1 -0
  106. package/dist/screen-generation/generators/utils.d.ts +187 -0
  107. package/dist/screen-generation/generators/utils.d.ts.map +1 -0
  108. package/dist/screen-generation/generators/utils.js +312 -0
  109. package/dist/screen-generation/generators/utils.js.map +1 -0
  110. package/dist/screen-generation/index.d.ts +14 -0
  111. package/dist/screen-generation/index.d.ts.map +1 -0
  112. package/dist/screen-generation/index.js +33 -0
  113. package/dist/screen-generation/index.js.map +1 -0
  114. package/dist/screen-generation/resolver/component-resolver.d.ts +157 -0
  115. package/dist/screen-generation/resolver/component-resolver.d.ts.map +1 -0
  116. package/dist/screen-generation/resolver/component-resolver.js +295 -0
  117. package/dist/screen-generation/resolver/component-resolver.js.map +1 -0
  118. package/dist/screen-generation/resolver/index.d.ts +10 -0
  119. package/dist/screen-generation/resolver/index.d.ts.map +1 -0
  120. package/dist/screen-generation/resolver/index.js +46 -0
  121. package/dist/screen-generation/resolver/index.js.map +1 -0
  122. package/dist/screen-generation/resolver/layout-resolver.d.ts +155 -0
  123. package/dist/screen-generation/resolver/layout-resolver.d.ts.map +1 -0
  124. package/dist/screen-generation/resolver/layout-resolver.js +193 -0
  125. package/dist/screen-generation/resolver/layout-resolver.js.map +1 -0
  126. package/dist/screen-generation/resolver/screen-resolver.d.ts +174 -0
  127. package/dist/screen-generation/resolver/screen-resolver.d.ts.map +1 -0
  128. package/dist/screen-generation/resolver/screen-resolver.js +373 -0
  129. package/dist/screen-generation/resolver/screen-resolver.js.map +1 -0
  130. package/dist/screen-generation/resolver/token-resolver.d.ts +170 -0
  131. package/dist/screen-generation/resolver/token-resolver.d.ts.map +1 -0
  132. package/dist/screen-generation/resolver/token-resolver.js +260 -0
  133. package/dist/screen-generation/resolver/token-resolver.js.map +1 -0
  134. package/dist/screen-generation/types.d.ts +116 -0
  135. package/dist/screen-generation/types.d.ts.map +1 -0
  136. package/dist/screen-generation/types.js +33 -0
  137. package/dist/screen-generation/types.js.map +1 -0
  138. package/dist/screen-generation/validators.d.ts +286 -0
  139. package/dist/screen-generation/validators.d.ts.map +1 -0
  140. package/dist/screen-generation/validators.js +323 -0
  141. package/dist/screen-generation/validators.js.map +1 -0
  142. package/dist/screen-templates/__tests__/registry.test.d.ts +6 -0
  143. package/dist/screen-templates/__tests__/registry.test.d.ts.map +1 -0
  144. package/dist/screen-templates/__tests__/registry.test.js +247 -0
  145. package/dist/screen-templates/__tests__/registry.test.js.map +1 -0
  146. package/dist/screen-templates/__tests__/templates.test.d.ts +6 -0
  147. package/dist/screen-templates/__tests__/templates.test.d.ts.map +1 -0
  148. package/dist/screen-templates/__tests__/templates.test.js +179 -0
  149. package/dist/screen-templates/__tests__/templates.test.js.map +1 -0
  150. package/dist/screen-templates/index.d.ts +39 -0
  151. package/dist/screen-templates/index.d.ts.map +1 -0
  152. package/dist/screen-templates/index.js +79 -0
  153. package/dist/screen-templates/index.js.map +1 -0
  154. package/dist/screen-templates/registry.d.ts +177 -0
  155. package/dist/screen-templates/registry.d.ts.map +1 -0
  156. package/dist/screen-templates/registry.js +274 -0
  157. package/dist/screen-templates/registry.js.map +1 -0
  158. package/dist/screen-templates/templates/account/index.d.ts +6 -0
  159. package/dist/screen-templates/templates/account/index.d.ts.map +1 -0
  160. package/dist/screen-templates/templates/account/index.js +6 -0
  161. package/dist/screen-templates/templates/account/index.js.map +1 -0
  162. package/dist/screen-templates/templates/account/profile.d.ts +23 -0
  163. package/dist/screen-templates/templates/account/profile.d.ts.map +1 -0
  164. package/dist/screen-templates/templates/account/profile.js +249 -0
  165. package/dist/screen-templates/templates/account/profile.js.map +1 -0
  166. package/dist/screen-templates/templates/auth/forgot-password.d.ts +23 -0
  167. package/dist/screen-templates/templates/auth/forgot-password.d.ts.map +1 -0
  168. package/dist/screen-templates/templates/auth/forgot-password.js +203 -0
  169. package/dist/screen-templates/templates/auth/forgot-password.js.map +1 -0
  170. package/dist/screen-templates/templates/auth/index.d.ts +9 -0
  171. package/dist/screen-templates/templates/auth/index.d.ts.map +1 -0
  172. package/dist/screen-templates/templates/auth/index.js +9 -0
  173. package/dist/screen-templates/templates/auth/index.js.map +1 -0
  174. package/dist/screen-templates/templates/auth/login.d.ts +24 -0
  175. package/dist/screen-templates/templates/auth/login.d.ts.map +1 -0
  176. package/dist/screen-templates/templates/auth/login.js +254 -0
  177. package/dist/screen-templates/templates/auth/login.js.map +1 -0
  178. package/dist/screen-templates/templates/auth/signup.d.ts +24 -0
  179. package/dist/screen-templates/templates/auth/signup.d.ts.map +1 -0
  180. package/dist/screen-templates/templates/auth/signup.js +315 -0
  181. package/dist/screen-templates/templates/auth/signup.js.map +1 -0
  182. package/dist/screen-templates/templates/auth/verification.d.ts +23 -0
  183. package/dist/screen-templates/templates/auth/verification.d.ts.map +1 -0
  184. package/dist/screen-templates/templates/auth/verification.js +239 -0
  185. package/dist/screen-templates/templates/auth/verification.js.map +1 -0
  186. package/dist/screen-templates/templates/feedback/confirmation.d.ts +9 -0
  187. package/dist/screen-templates/templates/feedback/confirmation.d.ts.map +1 -0
  188. package/dist/screen-templates/templates/feedback/confirmation.js +107 -0
  189. package/dist/screen-templates/templates/feedback/confirmation.js.map +1 -0
  190. package/dist/screen-templates/templates/feedback/empty.d.ts +9 -0
  191. package/dist/screen-templates/templates/feedback/empty.d.ts.map +1 -0
  192. package/dist/screen-templates/templates/feedback/empty.js +90 -0
  193. package/dist/screen-templates/templates/feedback/empty.js.map +1 -0
  194. package/dist/screen-templates/templates/feedback/error.d.ts +9 -0
  195. package/dist/screen-templates/templates/feedback/error.d.ts.map +1 -0
  196. package/dist/screen-templates/templates/feedback/error.js +99 -0
  197. package/dist/screen-templates/templates/feedback/error.js.map +1 -0
  198. package/dist/screen-templates/templates/feedback/index.d.ts +10 -0
  199. package/dist/screen-templates/templates/feedback/index.d.ts.map +1 -0
  200. package/dist/screen-templates/templates/feedback/index.js +10 -0
  201. package/dist/screen-templates/templates/feedback/index.js.map +1 -0
  202. package/dist/screen-templates/templates/feedback/loading.d.ts +9 -0
  203. package/dist/screen-templates/templates/feedback/loading.d.ts.map +1 -0
  204. package/dist/screen-templates/templates/feedback/loading.js +77 -0
  205. package/dist/screen-templates/templates/feedback/loading.js.map +1 -0
  206. package/dist/screen-templates/templates/feedback/success.d.ts +9 -0
  207. package/dist/screen-templates/templates/feedback/success.d.ts.map +1 -0
  208. package/dist/screen-templates/templates/feedback/success.js +99 -0
  209. package/dist/screen-templates/templates/feedback/success.js.map +1 -0
  210. package/dist/screen-templates/templates/home/index.d.ts +6 -0
  211. package/dist/screen-templates/templates/home/index.d.ts.map +1 -0
  212. package/dist/screen-templates/templates/home/index.js +6 -0
  213. package/dist/screen-templates/templates/home/index.js.map +1 -0
  214. package/dist/screen-templates/templates/home/landing.d.ts +24 -0
  215. package/dist/screen-templates/templates/home/landing.d.ts.map +1 -0
  216. package/dist/screen-templates/templates/home/landing.js +197 -0
  217. package/dist/screen-templates/templates/home/landing.js.map +1 -0
  218. package/dist/screen-templates/templates/settings/index.d.ts +6 -0
  219. package/dist/screen-templates/templates/settings/index.d.ts.map +1 -0
  220. package/dist/screen-templates/templates/settings/index.js +6 -0
  221. package/dist/screen-templates/templates/settings/index.js.map +1 -0
  222. package/dist/screen-templates/templates/settings/preferences.d.ts +24 -0
  223. package/dist/screen-templates/templates/settings/preferences.d.ts.map +1 -0
  224. package/dist/screen-templates/templates/settings/preferences.js +265 -0
  225. package/dist/screen-templates/templates/settings/preferences.js.map +1 -0
  226. package/dist/screen-templates/types.d.ts +229 -0
  227. package/dist/screen-templates/types.d.ts.map +1 -0
  228. package/dist/screen-templates/types.js +7 -0
  229. package/dist/screen-templates/types.js.map +1 -0
  230. package/dist/theme-v2.d.ts +228 -0
  231. package/dist/theme-v2.d.ts.map +1 -0
  232. package/dist/theme-v2.js +158 -0
  233. package/dist/theme-v2.js.map +1 -0
  234. package/dist/theme.d.ts +60 -0
  235. package/dist/theme.d.ts.map +1 -0
  236. package/dist/theme.js +76 -0
  237. package/dist/theme.js.map +1 -0
  238. package/dist/token-resolver.d.ts +69 -0
  239. package/dist/token-resolver.d.ts.map +1 -0
  240. package/dist/token-resolver.js +122 -0
  241. package/dist/token-resolver.js.map +1 -0
  242. package/dist/token-validation.d.ts +432 -0
  243. package/dist/token-validation.d.ts.map +1 -0
  244. package/dist/token-validation.js +140 -0
  245. package/dist/token-validation.js.map +1 -0
  246. package/dist/tokens.d.ts +158 -0
  247. package/dist/tokens.d.ts.map +1 -0
  248. package/dist/tokens.js +10 -0
  249. package/dist/tokens.js.map +1 -0
  250. package/dist/types.d.ts +77 -0
  251. package/dist/types.d.ts.map +1 -0
  252. package/dist/types.js +7 -0
  253. package/dist/types.js.map +1 -0
  254. package/package.json +53 -0
@@ -0,0 +1,155 @@
1
+ /**
2
+ * @tekton-ui/core - Screen Layout Resolver
3
+ * Wrapper for layout resolution with screen-specific context
4
+ * [SPEC-LAYOUT-002] [PHASE-2]
5
+ */
6
+ import type { ResolvedLayout } from '../../layout-resolver.js';
7
+ /**
8
+ * Layout resolution context for screen generation
9
+ * Provides additional context for error messages and debugging
10
+ */
11
+ export interface LayoutContext {
12
+ /** Screen ID requesting the layout */
13
+ screenId: string;
14
+ /** Layout type being resolved */
15
+ layoutType: 'shell' | 'page' | 'section';
16
+ /** Additional metadata for debugging */
17
+ meta?: {
18
+ /** Section ID (if resolving section pattern) */
19
+ sectionId?: string;
20
+ /** Section index in screen (if resolving section pattern) */
21
+ sectionIndex?: number;
22
+ };
23
+ }
24
+ /**
25
+ * Resolve shell layout with screen context
26
+ *
27
+ * Wraps core resolveLayout() with enhanced error messages
28
+ * specific to screen generation context.
29
+ *
30
+ * @param shellId - Shell token ID (e.g., "shell.web.dashboard")
31
+ * @param context - Screen resolution context
32
+ * @returns Resolved shell layout
33
+ * @throws Error with helpful message if shell not found
34
+ *
35
+ * @example
36
+ * ```typescript
37
+ * const context = {
38
+ * screenId: 'dashboard-screen',
39
+ * layoutType: 'shell'
40
+ * };
41
+ *
42
+ * const shell = resolveShell('shell.web.dashboard', context);
43
+ * console.log(shell.shell?.description);
44
+ * ```
45
+ */
46
+ export declare function resolveShell(shellId: string, context: LayoutContext): ResolvedLayout;
47
+ /**
48
+ * Resolve page layout with screen context
49
+ *
50
+ * Wraps core resolveLayout() with enhanced error messages
51
+ * specific to screen generation context.
52
+ *
53
+ * @param pageId - Page layout token ID (e.g., "page.dashboard")
54
+ * @param context - Screen resolution context
55
+ * @returns Resolved page layout with sections
56
+ * @throws Error with helpful message if page not found
57
+ *
58
+ * @example
59
+ * ```typescript
60
+ * const context = {
61
+ * screenId: 'dashboard-screen',
62
+ * layoutType: 'page'
63
+ * };
64
+ *
65
+ * const page = resolvePage('page.dashboard', context);
66
+ * console.log(page.page?.purpose);
67
+ * console.log(page.sections.length);
68
+ * ```
69
+ */
70
+ export declare function resolvePage(pageId: string, context: LayoutContext): ResolvedLayout;
71
+ /**
72
+ * Resolve section pattern with screen context
73
+ *
74
+ * Wraps core resolveLayout() with enhanced error messages
75
+ * specific to screen generation context.
76
+ *
77
+ * @param sectionId - Section pattern token ID (e.g., "section.grid-4")
78
+ * @param context - Screen resolution context with section metadata
79
+ * @returns Resolved section pattern
80
+ * @throws Error with helpful message if section not found
81
+ *
82
+ * @example
83
+ * ```typescript
84
+ * const context = {
85
+ * screenId: 'dashboard-screen',
86
+ * layoutType: 'section',
87
+ * meta: {
88
+ * sectionId: 'stats',
89
+ * sectionIndex: 0
90
+ * }
91
+ * };
92
+ *
93
+ * const section = resolveSection('section.grid-4', context);
94
+ * console.log(section.sections[0].type);
95
+ * ```
96
+ */
97
+ export declare function resolveSection(sectionId: string, context: LayoutContext): ResolvedLayout;
98
+ /**
99
+ * Validate shell token ID format
100
+ *
101
+ * @param shellId - Shell token ID to validate
102
+ * @returns True if valid shell token format
103
+ *
104
+ * @example
105
+ * ```typescript
106
+ * isValidShellToken('shell.web.dashboard'); // → true
107
+ * isValidShellToken('page.dashboard'); // → false
108
+ * isValidShellToken('invalid'); // → false
109
+ * ```
110
+ */
111
+ export declare function isValidShellToken(shellId: string): boolean;
112
+ /**
113
+ * Validate page layout token ID format
114
+ *
115
+ * @param pageId - Page layout token ID to validate
116
+ * @returns True if valid page layout token format
117
+ *
118
+ * @example
119
+ * ```typescript
120
+ * isValidPageToken('page.dashboard'); // → true
121
+ * isValidPageToken('shell.web.dashboard'); // → false
122
+ * isValidPageToken('invalid'); // → false
123
+ * ```
124
+ */
125
+ export declare function isValidPageToken(pageId: string): boolean;
126
+ /**
127
+ * Validate section pattern token ID format
128
+ *
129
+ * @param sectionId - Section pattern token ID to validate
130
+ * @returns True if valid section pattern token format
131
+ *
132
+ * @example
133
+ * ```typescript
134
+ * isValidSectionToken('section.grid-4'); // → true
135
+ * isValidSectionToken('page.dashboard'); // → false
136
+ * isValidSectionToken('invalid'); // → false
137
+ * ```
138
+ */
139
+ export declare function isValidSectionToken(sectionId: string): boolean;
140
+ /**
141
+ * Parse layout ID to determine its type
142
+ *
143
+ * @param layoutId - Layout ID to parse
144
+ * @returns Layout type or undefined if invalid
145
+ *
146
+ * @example
147
+ * ```typescript
148
+ * parseLayoutType('shell.web.dashboard'); // → 'shell'
149
+ * parseLayoutType('page.dashboard'); // → 'page'
150
+ * parseLayoutType('section.grid-4'); // → 'section'
151
+ * parseLayoutType('invalid'); // → undefined
152
+ * ```
153
+ */
154
+ export declare function parseLayoutType(layoutId: string): 'shell' | 'page' | 'section' | undefined;
155
+ //# sourceMappingURL=layout-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout-resolver.d.ts","sourceRoot":"","sources":["../../../src/screen-generation/resolver/layout-resolver.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAM/D;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;IAEjB,iCAAiC;IACjC,UAAU,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;IAEzC,wCAAwC;IACxC,IAAI,CAAC,EAAE;QACL,gDAAgD;QAChD,SAAS,CAAC,EAAE,MAAM,CAAC;QAEnB,6DAA6D;QAC7D,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAMD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,cAAc,CAYpF;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,cAAc,CAYlF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,cAAc,CAkBxF;AAMD;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAE9D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAS1F"}
@@ -0,0 +1,193 @@
1
+ /**
2
+ * @tekton-ui/core - Screen Layout Resolver
3
+ * Wrapper for layout resolution with screen-specific context
4
+ * [SPEC-LAYOUT-002] [PHASE-2]
5
+ */
6
+ import { resolveLayout as coreResolveLayout } from '../../layout-resolver.js';
7
+ // ============================================================================
8
+ // Core Resolution Functions
9
+ // ============================================================================
10
+ /**
11
+ * Resolve shell layout with screen context
12
+ *
13
+ * Wraps core resolveLayout() with enhanced error messages
14
+ * specific to screen generation context.
15
+ *
16
+ * @param shellId - Shell token ID (e.g., "shell.web.dashboard")
17
+ * @param context - Screen resolution context
18
+ * @returns Resolved shell layout
19
+ * @throws Error with helpful message if shell not found
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * const context = {
24
+ * screenId: 'dashboard-screen',
25
+ * layoutType: 'shell'
26
+ * };
27
+ *
28
+ * const shell = resolveShell('shell.web.dashboard', context);
29
+ * console.log(shell.shell?.description);
30
+ * ```
31
+ */
32
+ export function resolveShell(shellId, context) {
33
+ try {
34
+ return coreResolveLayout(shellId);
35
+ }
36
+ catch (error) {
37
+ throw new Error(`Failed to resolve shell '${shellId}' for screen '${context.screenId}': ${error instanceof Error ? error.message : String(error)}\n\n` +
38
+ `Available shells: shell.web.dashboard, shell.web.settings, shell.web.admin, ` +
39
+ `shell.mobile.bottom-nav, shell.mobile.tabs`);
40
+ }
41
+ }
42
+ /**
43
+ * Resolve page layout with screen context
44
+ *
45
+ * Wraps core resolveLayout() with enhanced error messages
46
+ * specific to screen generation context.
47
+ *
48
+ * @param pageId - Page layout token ID (e.g., "page.dashboard")
49
+ * @param context - Screen resolution context
50
+ * @returns Resolved page layout with sections
51
+ * @throws Error with helpful message if page not found
52
+ *
53
+ * @example
54
+ * ```typescript
55
+ * const context = {
56
+ * screenId: 'dashboard-screen',
57
+ * layoutType: 'page'
58
+ * };
59
+ *
60
+ * const page = resolvePage('page.dashboard', context);
61
+ * console.log(page.page?.purpose);
62
+ * console.log(page.sections.length);
63
+ * ```
64
+ */
65
+ export function resolvePage(pageId, context) {
66
+ try {
67
+ return coreResolveLayout(pageId);
68
+ }
69
+ catch (error) {
70
+ throw new Error(`Failed to resolve page '${pageId}' for screen '${context.screenId}': ${error instanceof Error ? error.message : String(error)}\n\n` +
71
+ `Available pages: page.dashboard, page.detail, page.list, page.settings, page.form, ` +
72
+ `page.auth, page.error, page.landing`);
73
+ }
74
+ }
75
+ /**
76
+ * Resolve section pattern with screen context
77
+ *
78
+ * Wraps core resolveLayout() with enhanced error messages
79
+ * specific to screen generation context.
80
+ *
81
+ * @param sectionId - Section pattern token ID (e.g., "section.grid-4")
82
+ * @param context - Screen resolution context with section metadata
83
+ * @returns Resolved section pattern
84
+ * @throws Error with helpful message if section not found
85
+ *
86
+ * @example
87
+ * ```typescript
88
+ * const context = {
89
+ * screenId: 'dashboard-screen',
90
+ * layoutType: 'section',
91
+ * meta: {
92
+ * sectionId: 'stats',
93
+ * sectionIndex: 0
94
+ * }
95
+ * };
96
+ *
97
+ * const section = resolveSection('section.grid-4', context);
98
+ * console.log(section.sections[0].type);
99
+ * ```
100
+ */
101
+ export function resolveSection(sectionId, context) {
102
+ try {
103
+ return coreResolveLayout(sectionId);
104
+ }
105
+ catch (error) {
106
+ const sectionInfo = context.meta?.sectionId
107
+ ? ` (section '${context.meta.sectionId}' at index ${context.meta.sectionIndex})`
108
+ : '';
109
+ throw new Error(`Failed to resolve section '${sectionId}' for screen '${context.screenId}'${sectionInfo}: ${error instanceof Error ? error.message : String(error)}\n\n` +
110
+ `Available sections: section.grid-2, section.grid-3, section.grid-4, section.grid-auto, ` +
111
+ `section.split-30-70, section.split-50-50, section.split-70-30, ` +
112
+ `section.stack-start, section.stack-center, section.stack-end, ` +
113
+ `section.sidebar-left, section.sidebar-right, section.container`);
114
+ }
115
+ }
116
+ // ============================================================================
117
+ // Validation Utilities
118
+ // ============================================================================
119
+ /**
120
+ * Validate shell token ID format
121
+ *
122
+ * @param shellId - Shell token ID to validate
123
+ * @returns True if valid shell token format
124
+ *
125
+ * @example
126
+ * ```typescript
127
+ * isValidShellToken('shell.web.dashboard'); // → true
128
+ * isValidShellToken('page.dashboard'); // → false
129
+ * isValidShellToken('invalid'); // → false
130
+ * ```
131
+ */
132
+ export function isValidShellToken(shellId) {
133
+ return shellId.startsWith('shell.') && shellId.split('.').length >= 3;
134
+ }
135
+ /**
136
+ * Validate page layout token ID format
137
+ *
138
+ * @param pageId - Page layout token ID to validate
139
+ * @returns True if valid page layout token format
140
+ *
141
+ * @example
142
+ * ```typescript
143
+ * isValidPageToken('page.dashboard'); // → true
144
+ * isValidPageToken('shell.web.dashboard'); // → false
145
+ * isValidPageToken('invalid'); // → false
146
+ * ```
147
+ */
148
+ export function isValidPageToken(pageId) {
149
+ return pageId.startsWith('page.') && pageId.split('.').length >= 2;
150
+ }
151
+ /**
152
+ * Validate section pattern token ID format
153
+ *
154
+ * @param sectionId - Section pattern token ID to validate
155
+ * @returns True if valid section pattern token format
156
+ *
157
+ * @example
158
+ * ```typescript
159
+ * isValidSectionToken('section.grid-4'); // → true
160
+ * isValidSectionToken('page.dashboard'); // → false
161
+ * isValidSectionToken('invalid'); // → false
162
+ * ```
163
+ */
164
+ export function isValidSectionToken(sectionId) {
165
+ return sectionId.startsWith('section.') && sectionId.split('.').length >= 2;
166
+ }
167
+ /**
168
+ * Parse layout ID to determine its type
169
+ *
170
+ * @param layoutId - Layout ID to parse
171
+ * @returns Layout type or undefined if invalid
172
+ *
173
+ * @example
174
+ * ```typescript
175
+ * parseLayoutType('shell.web.dashboard'); // → 'shell'
176
+ * parseLayoutType('page.dashboard'); // → 'page'
177
+ * parseLayoutType('section.grid-4'); // → 'section'
178
+ * parseLayoutType('invalid'); // → undefined
179
+ * ```
180
+ */
181
+ export function parseLayoutType(layoutId) {
182
+ if (isValidShellToken(layoutId)) {
183
+ return 'shell';
184
+ }
185
+ else if (isValidPageToken(layoutId)) {
186
+ return 'page';
187
+ }
188
+ else if (isValidSectionToken(layoutId)) {
189
+ return 'section';
190
+ }
191
+ return undefined;
192
+ }
193
+ //# sourceMappingURL=layout-resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout-resolver.js","sourceRoot":"","sources":["../../../src/screen-generation/resolver/layout-resolver.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,174 @@
1
+ /**
2
+ * @tekton-ui/core - Screen Resolver
3
+ * Main entry point for resolving screen definitions to complete screen structures
4
+ * [SPEC-LAYOUT-002] [PHASE-2]
5
+ */
6
+ import type { ScreenDefinition, ScreenMeta } from '../types.js';
7
+ import type { ResolvedLayout } from '../../layout-resolver.js';
8
+ import { type ResolvedComponent } from './component-resolver.js';
9
+ /**
10
+ * Resolved section with layout and components
11
+ * Complete section ready for rendering
12
+ */
13
+ export interface ResolvedSection {
14
+ /** Section identifier */
15
+ id: string;
16
+ /** Resolved section pattern layout */
17
+ layout: ResolvedLayout;
18
+ /** Resolved components within section */
19
+ components: ResolvedComponent[];
20
+ /** CSS variables generated from section layout */
21
+ cssVariables: Record<string, string>;
22
+ }
23
+ /**
24
+ * Component tree node for hierarchical structure
25
+ * Represents the component hierarchy within the screen
26
+ */
27
+ export interface ComponentTreeNode {
28
+ /** Component type */
29
+ type: string;
30
+ /** Component slot assignment */
31
+ slot?: string;
32
+ /** Child nodes */
33
+ children?: ComponentTreeNode[];
34
+ }
35
+ /**
36
+ * Component tree structure
37
+ * Root-level component organization
38
+ */
39
+ export interface ComponentTree {
40
+ /** Root component nodes organized by section */
41
+ sections: {
42
+ /** Section ID */
43
+ sectionId: string;
44
+ /** Components in this section */
45
+ components: ComponentTreeNode[];
46
+ }[];
47
+ }
48
+ /**
49
+ * Complete resolved screen structure
50
+ * Ready for rendering with all layouts, components, and tokens resolved
51
+ */
52
+ export interface ResolvedScreen {
53
+ /** Screen identifier */
54
+ id: string;
55
+ /** Screen name */
56
+ name: string;
57
+ /** Optional screen description */
58
+ description?: string;
59
+ /** Resolved shell layout */
60
+ shell: ResolvedLayout;
61
+ /** Resolved page layout */
62
+ page: ResolvedLayout;
63
+ /** Resolved sections with layouts and components */
64
+ sections: ResolvedSection[];
65
+ /** Global CSS variables from all layouts */
66
+ cssVariables: Record<string, string>;
67
+ /** Component tree structure */
68
+ componentTree: ComponentTree;
69
+ /** Screen metadata */
70
+ meta?: ScreenMeta;
71
+ /** Theme ID used for resolution */
72
+ themeId: string;
73
+ }
74
+ /**
75
+ * Clear screen resolution cache
76
+ * Useful for testing or when screen definitions change
77
+ *
78
+ * @example
79
+ * ```typescript
80
+ * clearScreenCache();
81
+ * ```
82
+ */
83
+ export declare function clearScreenCache(): void;
84
+ /**
85
+ * Resolve screen definition to complete resolved screen structure
86
+ *
87
+ * Main entry point for screen resolution. Performs complete resolution:
88
+ * 1. Validate screen definition
89
+ * 2. Resolve shell layout
90
+ * 3. Resolve page layout
91
+ * 4. Resolve all sections with layouts and components
92
+ * 5. Generate global CSS variables
93
+ * 6. Build component tree
94
+ *
95
+ * Performance: <5ms for typical screen resolution (cached after first call)
96
+ *
97
+ * @param screen - Screen definition to resolve
98
+ * @returns Complete resolved screen structure
99
+ * @throws Error if resolution fails at any stage
100
+ *
101
+ * @example
102
+ * ```typescript
103
+ * const screen = {
104
+ * id: 'dashboard-screen',
105
+ * name: 'Dashboard',
106
+ * shell: 'shell.web.dashboard',
107
+ * page: 'page.dashboard',
108
+ * themeId: 'default',
109
+ * sections: [
110
+ * {
111
+ * id: 'stats',
112
+ * pattern: 'section.grid-4',
113
+ * components: [
114
+ * { type: 'Card', props: { children: 'Stats' } }
115
+ * ]
116
+ * }
117
+ * ]
118
+ * };
119
+ *
120
+ * const resolved = resolveScreen(screen);
121
+ * console.log(resolved.shell.shell?.description);
122
+ * console.log(resolved.sections[0].components[0].tokenBindings);
123
+ * ```
124
+ */
125
+ export declare function resolveScreen(screen: ScreenDefinition): ResolvedScreen;
126
+ /**
127
+ * Validate resolved screen structure
128
+ *
129
+ * Checks:
130
+ * - Shell layout is present
131
+ * - Page layout is present
132
+ * - All sections have layouts and components
133
+ * - CSS variables are generated
134
+ * - Component tree is built
135
+ *
136
+ * @param resolved - Resolved screen to validate
137
+ * @returns True if valid, false otherwise
138
+ *
139
+ * @example
140
+ * ```typescript
141
+ * const resolved = resolveScreen(screenDefinition);
142
+ * if (isValidResolvedScreen(resolved)) {
143
+ * // Ready to render
144
+ * }
145
+ * ```
146
+ */
147
+ export declare function isValidResolvedScreen(resolved: unknown): resolved is ResolvedScreen;
148
+ /**
149
+ * Get screen resolution statistics
150
+ *
151
+ * Provides insights into resolved screen structure:
152
+ * - Total component count
153
+ * - Component types used
154
+ * - Section count
155
+ * - CSS variable count
156
+ *
157
+ * @param resolved - Resolved screen
158
+ * @returns Statistics object
159
+ *
160
+ * @example
161
+ * ```typescript
162
+ * const resolved = resolveScreen(screenDefinition);
163
+ * const stats = getScreenStats(resolved);
164
+ * console.log(`Components: ${stats.componentCount}`);
165
+ * console.log(`CSS Variables: ${stats.cssVariableCount}`);
166
+ * ```
167
+ */
168
+ export declare function getScreenStats(resolved: ResolvedScreen): {
169
+ componentCount: number;
170
+ componentTypes: Set<string>;
171
+ sectionCount: number;
172
+ cssVariableCount: number;
173
+ };
174
+ //# sourceMappingURL=screen-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"screen-resolver.d.ts","sourceRoot":"","sources":["../../../src/screen-generation/resolver/screen-resolver.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAqB,UAAU,EAAE,MAAM,aAAa,CAAC;AACnF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAO/D,OAAO,EAEL,KAAK,iBAAiB,EAEvB,MAAM,yBAAyB,CAAC;AAOjC;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,yBAAyB;IACzB,EAAE,EAAE,MAAM,CAAC;IAEX,sCAAsC;IACtC,MAAM,EAAE,cAAc,CAAC;IAEvB,yCAAyC;IACzC,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAEhC,kDAAkD;IAClD,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IAEb,gCAAgC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,kBAAkB;IAClB,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAC;CAChC;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,gDAAgD;IAChD,QAAQ,EAAE;QACR,iBAAiB;QACjB,SAAS,EAAE,MAAM,CAAC;QAElB,iCAAiC;QACjC,UAAU,EAAE,iBAAiB,EAAE,CAAC;KACjC,EAAE,CAAC;CACL;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAC;IAEX,kBAAkB;IAClB,IAAI,EAAE,MAAM,CAAC;IAEb,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,4BAA4B;IAC5B,KAAK,EAAE,cAAc,CAAC;IAEtB,2BAA2B;IAC3B,IAAI,EAAE,cAAc,CAAC;IAErB,oDAAoD;IACpD,QAAQ,EAAE,eAAe,EAAE,CAAC;IAE5B,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAErC,+BAA+B;IAC/B,aAAa,EAAE,aAAa,CAAC;IAE7B,sBAAsB;IACtB,IAAI,CAAC,EAAE,UAAU,CAAC;IAElB,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;CACjB;AAYD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC;AAwLD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,gBAAgB,GAAG,cAAc,CAgGtE;AAMD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,cAAc,CAqBnF;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,cAAc,GAAG;IACxD,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAsBA"}