@cratis/scene.blueprint.default 0.1.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 (558) hide show
  1. package/.storybook/main.ts +32 -0
  2. package/.storybook/preview.ts +20 -0
  3. package/ComponentName.ts +60 -0
  4. package/README.md +204 -0
  5. package/configuration/ColorScheme.ts +17 -0
  6. package/configuration/LayoutConfigProvider.tsx +182 -0
  7. package/configuration/LayoutConfigState.ts +46 -0
  8. package/configuration/LayoutMode.ts +50 -0
  9. package/configuration/MenuTheme.ts +24 -0
  10. package/configuration/index.ts +11 -0
  11. package/configuration/layoutConfigStorage.ts +102 -0
  12. package/configuration/layoutConfigTransitions.ts +150 -0
  13. package/configuration/layoutWrapperClasses.ts +68 -0
  14. package/defaultBlueprint.ts +66 -0
  15. package/defaultBlueprintComponents.ts +51 -0
  16. package/dist/cjs/ComponentName.js +33 -0
  17. package/dist/cjs/ComponentName.js.map +1 -0
  18. package/dist/cjs/configuration/ColorScheme.js +23 -0
  19. package/dist/cjs/configuration/ColorScheme.js.map +1 -0
  20. package/dist/cjs/configuration/LayoutConfigProvider.js +96 -0
  21. package/dist/cjs/configuration/LayoutConfigProvider.js.map +1 -0
  22. package/dist/cjs/configuration/LayoutMode.js +38 -0
  23. package/dist/cjs/configuration/LayoutMode.js.map +1 -0
  24. package/dist/cjs/configuration/MenuTheme.js +26 -0
  25. package/dist/cjs/configuration/MenuTheme.js.map +1 -0
  26. package/dist/cjs/configuration/layoutConfigStorage.js +85 -0
  27. package/dist/cjs/configuration/layoutConfigStorage.js.map +1 -0
  28. package/dist/cjs/configuration/layoutConfigTransitions.js +158 -0
  29. package/dist/cjs/configuration/layoutConfigTransitions.js.map +1 -0
  30. package/dist/cjs/configuration/layoutWrapperClasses.js +62 -0
  31. package/dist/cjs/configuration/layoutWrapperClasses.js.map +1 -0
  32. package/dist/cjs/defaultBlueprint.js +92 -0
  33. package/dist/cjs/defaultBlueprint.js.map +1 -0
  34. package/dist/cjs/defaultBlueprintComponents.js +54 -0
  35. package/dist/cjs/defaultBlueprintComponents.js.map +1 -0
  36. package/dist/cjs/gallery/GalleryScreenPreview.js +63 -0
  37. package/dist/cjs/gallery/GalleryScreenPreview.js.map +1 -0
  38. package/dist/cjs/gallery/TemplateSlotName.js +25 -0
  39. package/dist/cjs/gallery/TemplateSlotName.js.map +1 -0
  40. package/dist/cjs/gallery/applicationChrome.js +134 -0
  41. package/dist/cjs/gallery/applicationChrome.js.map +1 -0
  42. package/dist/cjs/gallery/authTemplates.js +234 -0
  43. package/dist/cjs/gallery/authTemplates.js.map +1 -0
  44. package/dist/cjs/gallery/componentNames.js +53 -0
  45. package/dist/cjs/gallery/componentNames.js.map +1 -0
  46. package/dist/cjs/gallery/composeScreen.js +99 -0
  47. package/dist/cjs/gallery/composeScreen.js.map +1 -0
  48. package/dist/cjs/gallery/dependencyComponentNames.js +72 -0
  49. package/dist/cjs/gallery/dependencyComponentNames.js.map +1 -0
  50. package/dist/cjs/gallery/dialogTemplates.js +161 -0
  51. package/dist/cjs/gallery/dialogTemplates.js.map +1 -0
  52. package/dist/cjs/gallery/elements.js +80 -0
  53. package/dist/cjs/gallery/elements.js.map +1 -0
  54. package/dist/cjs/gallery/navigation.js +129 -0
  55. package/dist/cjs/gallery/navigation.js.map +1 -0
  56. package/dist/cjs/gallery/nesting.js +129 -0
  57. package/dist/cjs/gallery/nesting.js.map +1 -0
  58. package/dist/cjs/gallery/previewProfile.js +68 -0
  59. package/dist/cjs/gallery/previewProfile.js.map +1 -0
  60. package/dist/cjs/gallery/resolveElementNames.js +63 -0
  61. package/dist/cjs/gallery/resolveElementNames.js.map +1 -0
  62. package/dist/cjs/gallery/screens.js +222 -0
  63. package/dist/cjs/gallery/screens.js.map +1 -0
  64. package/dist/cjs/gallery/statusTemplates.js +190 -0
  65. package/dist/cjs/gallery/statusTemplates.js.map +1 -0
  66. package/dist/cjs/gallery/supportTemplates.js +319 -0
  67. package/dist/cjs/gallery/supportTemplates.js.map +1 -0
  68. package/dist/cjs/gallery/widgets.js +94 -0
  69. package/dist/cjs/gallery/widgets.js.map +1 -0
  70. package/dist/cjs/gallery/workspaceTemplates.js +395 -0
  71. package/dist/cjs/gallery/workspaceTemplates.js.map +1 -0
  72. package/dist/cjs/index.js +220 -0
  73. package/dist/cjs/index.js.map +1 -0
  74. package/dist/cjs/layouts/LayoutName.js +19 -0
  75. package/dist/cjs/layouts/LayoutName.js.map +1 -0
  76. package/dist/cjs/layouts/SlotName.js +31 -0
  77. package/dist/cjs/layouts/SlotName.js.map +1 -0
  78. package/dist/cjs/layouts/appShell.js +160 -0
  79. package/dist/cjs/layouts/appShell.js.map +1 -0
  80. package/dist/cjs/layouts/defaultLayouts.js +20 -0
  81. package/dist/cjs/layouts/defaultLayouts.js.map +1 -0
  82. package/dist/cjs/layouts/flowBuilders.js +66 -0
  83. package/dist/cjs/layouts/flowBuilders.js.map +1 -0
  84. package/dist/cjs/layouts/fullPage.js +78 -0
  85. package/dist/cjs/layouts/fullPage.js.map +1 -0
  86. package/dist/cjs/layouts/shellComponents.js +29 -0
  87. package/dist/cjs/layouts/shellComponents.js.map +1 -0
  88. package/dist/cjs/package.json +3 -0
  89. package/dist/cjs/packageName.js +15 -0
  90. package/dist/cjs/packageName.js.map +1 -0
  91. package/dist/cjs/shell/AppShell.js +88 -0
  92. package/dist/cjs/shell/AppShell.js.map +1 -0
  93. package/dist/cjs/shell/Breadcrumb.js +33 -0
  94. package/dist/cjs/shell/Breadcrumb.js.map +1 -0
  95. package/dist/cjs/shell/ConfigPanel.js +128 -0
  96. package/dist/cjs/shell/ConfigPanel.js.map +1 -0
  97. package/dist/cjs/shell/Footer.js +28 -0
  98. package/dist/cjs/shell/Footer.js.map +1 -0
  99. package/dist/cjs/shell/FullPageShell.js +53 -0
  100. package/dist/cjs/shell/FullPageShell.js.map +1 -0
  101. package/dist/cjs/shell/LayoutModeSwitcher.js +58 -0
  102. package/dist/cjs/shell/LayoutModeSwitcher.js.map +1 -0
  103. package/dist/cjs/shell/Logo.js +44 -0
  104. package/dist/cjs/shell/Logo.js.map +1 -0
  105. package/dist/cjs/shell/Mask.js +34 -0
  106. package/dist/cjs/shell/Mask.js.map +1 -0
  107. package/dist/cjs/shell/Menu.js +36 -0
  108. package/dist/cjs/shell/Menu.js.map +1 -0
  109. package/dist/cjs/shell/MenuItem.js +65 -0
  110. package/dist/cjs/shell/MenuItem.js.map +1 -0
  111. package/dist/cjs/shell/PageHeader.js +43 -0
  112. package/dist/cjs/shell/PageHeader.js.map +1 -0
  113. package/dist/cjs/shell/RightPanel.js +30 -0
  114. package/dist/cjs/shell/RightPanel.js.map +1 -0
  115. package/dist/cjs/shell/Sidebar.js +51 -0
  116. package/dist/cjs/shell/Sidebar.js.map +1 -0
  117. package/dist/cjs/shell/ThemeOption.js +42 -0
  118. package/dist/cjs/shell/ThemeOption.js.map +1 -0
  119. package/dist/cjs/shell/ThemeSwitcher.js +50 -0
  120. package/dist/cjs/shell/ThemeSwitcher.js.map +1 -0
  121. package/dist/cjs/shell/Topbar.js +54 -0
  122. package/dist/cjs/shell/Topbar.js.map +1 -0
  123. package/dist/cjs/shell/UserMenu.js +68 -0
  124. package/dist/cjs/shell/UserMenu.js.map +1 -0
  125. package/dist/cjs/shell/elementProperties.js +56 -0
  126. package/dist/cjs/shell/elementProperties.js.map +1 -0
  127. package/dist/cjs/themes/LayoutThemeProvider.js +33 -0
  128. package/dist/cjs/themes/LayoutThemeProvider.js.map +1 -0
  129. package/dist/cjs/themes/blueprintThemeCompatibility.js +28 -0
  130. package/dist/cjs/themes/blueprintThemeCompatibility.js.map +1 -0
  131. package/dist/cjs/themes/dark.js +40 -0
  132. package/dist/cjs/themes/dark.js.map +1 -0
  133. package/dist/cjs/themes/defaultBlueprintThemes.js +19 -0
  134. package/dist/cjs/themes/defaultBlueprintThemes.js.map +1 -0
  135. package/dist/cjs/themes/light.js +43 -0
  136. package/dist/cjs/themes/light.js.map +1 -0
  137. package/dist/esm/ComponentName.d.ts +19 -0
  138. package/dist/esm/ComponentName.d.ts.map +1 -0
  139. package/dist/esm/ComponentName.js +31 -0
  140. package/dist/esm/ComponentName.js.map +1 -0
  141. package/dist/esm/configuration/ColorScheme.d.ts +6 -0
  142. package/dist/esm/configuration/ColorScheme.d.ts.map +1 -0
  143. package/dist/esm/configuration/ColorScheme.js +20 -0
  144. package/dist/esm/configuration/ColorScheme.js.map +1 -0
  145. package/dist/esm/configuration/LayoutConfigProvider.d.ts +29 -0
  146. package/dist/esm/configuration/LayoutConfigProvider.d.ts.map +1 -0
  147. package/dist/esm/configuration/LayoutConfigProvider.js +92 -0
  148. package/dist/esm/configuration/LayoutConfigProvider.js.map +1 -0
  149. package/dist/esm/configuration/LayoutConfigState.d.ts +14 -0
  150. package/dist/esm/configuration/LayoutConfigState.d.ts.map +1 -0
  151. package/dist/esm/configuration/LayoutConfigState.js +2 -0
  152. package/dist/esm/configuration/LayoutConfigState.js.map +1 -0
  153. package/dist/esm/configuration/LayoutMode.d.ts +12 -0
  154. package/dist/esm/configuration/LayoutMode.d.ts.map +1 -0
  155. package/dist/esm/configuration/LayoutMode.js +35 -0
  156. package/dist/esm/configuration/LayoutMode.js.map +1 -0
  157. package/dist/esm/configuration/MenuTheme.d.ts +7 -0
  158. package/dist/esm/configuration/MenuTheme.d.ts.map +1 -0
  159. package/dist/esm/configuration/MenuTheme.js +23 -0
  160. package/dist/esm/configuration/MenuTheme.js.map +1 -0
  161. package/dist/esm/configuration/index.d.ts +9 -0
  162. package/dist/esm/configuration/index.d.ts.map +1 -0
  163. package/dist/esm/configuration/index.js +9 -0
  164. package/dist/esm/configuration/index.js.map +1 -0
  165. package/dist/esm/configuration/layoutConfigStorage.d.ts +6 -0
  166. package/dist/esm/configuration/layoutConfigStorage.d.ts.map +1 -0
  167. package/dist/esm/configuration/layoutConfigStorage.js +81 -0
  168. package/dist/esm/configuration/layoutConfigStorage.js.map +1 -0
  169. package/dist/esm/configuration/layoutConfigTransitions.d.ts +22 -0
  170. package/dist/esm/configuration/layoutConfigTransitions.d.ts.map +1 -0
  171. package/dist/esm/configuration/layoutConfigTransitions.js +140 -0
  172. package/dist/esm/configuration/layoutConfigTransitions.js.map +1 -0
  173. package/dist/esm/configuration/layoutWrapperClasses.d.ts +4 -0
  174. package/dist/esm/configuration/layoutWrapperClasses.d.ts.map +1 -0
  175. package/dist/esm/configuration/layoutWrapperClasses.js +59 -0
  176. package/dist/esm/configuration/layoutWrapperClasses.js.map +1 -0
  177. package/dist/esm/defaultBlueprint.d.ts +5 -0
  178. package/dist/esm/defaultBlueprint.d.ts.map +1 -0
  179. package/dist/esm/defaultBlueprint.js +89 -0
  180. package/dist/esm/defaultBlueprint.js.map +1 -0
  181. package/dist/esm/defaultBlueprintComponents.d.ts +3 -0
  182. package/dist/esm/defaultBlueprintComponents.d.ts.map +1 -0
  183. package/dist/esm/defaultBlueprintComponents.js +52 -0
  184. package/dist/esm/defaultBlueprintComponents.js.map +1 -0
  185. package/dist/esm/for_AppShell/when_rendering_a_gallery_screen.d.ts +2 -0
  186. package/dist/esm/for_AppShell/when_rendering_a_gallery_screen.d.ts.map +1 -0
  187. package/dist/esm/for_AppShell/when_rendering_a_gallery_screen.js +60 -0
  188. package/dist/esm/for_AppShell/when_rendering_a_gallery_screen.js.map +1 -0
  189. package/dist/esm/for_LayoutConfigProvider/when_switching_mode_and_reloading.d.ts +2 -0
  190. package/dist/esm/for_LayoutConfigProvider/when_switching_mode_and_reloading.d.ts.map +1 -0
  191. package/dist/esm/for_LayoutConfigProvider/when_switching_mode_and_reloading.js +60 -0
  192. package/dist/esm/for_LayoutConfigProvider/when_switching_mode_and_reloading.js.map +1 -0
  193. package/dist/esm/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.d.ts +2 -0
  194. package/dist/esm/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.d.ts.map +1 -0
  195. package/dist/esm/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.js +26 -0
  196. package/dist/esm/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.js.map +1 -0
  197. package/dist/esm/for_defaultBlueprint/when_validating_the_bundle.d.ts +2 -0
  198. package/dist/esm/for_defaultBlueprint/when_validating_the_bundle.d.ts.map +1 -0
  199. package/dist/esm/for_defaultBlueprint/when_validating_the_bundle.js +32 -0
  200. package/dist/esm/for_defaultBlueprint/when_validating_the_bundle.js.map +1 -0
  201. package/dist/esm/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.d.ts +2 -0
  202. package/dist/esm/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.d.ts.map +1 -0
  203. package/dist/esm/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.js +40 -0
  204. package/dist/esm/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.js.map +1 -0
  205. package/dist/esm/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.d.ts +2 -0
  206. package/dist/esm/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.d.ts.map +1 -0
  207. package/dist/esm/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.js +27 -0
  208. package/dist/esm/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.js.map +1 -0
  209. package/dist/esm/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.d.ts +2 -0
  210. package/dist/esm/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.d.ts.map +1 -0
  211. package/dist/esm/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.js +41 -0
  212. package/dist/esm/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.js.map +1 -0
  213. package/dist/esm/for_galleryScreenTemplates/when_following_the_nesting_chain.d.ts +2 -0
  214. package/dist/esm/for_galleryScreenTemplates/when_following_the_nesting_chain.d.ts.map +1 -0
  215. package/dist/esm/for_galleryScreenTemplates/when_following_the_nesting_chain.js +31 -0
  216. package/dist/esm/for_galleryScreenTemplates/when_following_the_nesting_chain.js.map +1 -0
  217. package/dist/esm/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.d.ts +2 -0
  218. package/dist/esm/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.d.ts.map +1 -0
  219. package/dist/esm/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.js +33 -0
  220. package/dist/esm/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.js.map +1 -0
  221. package/dist/esm/for_galleryScreens/when_resolving_the_component_names_they_reference.d.ts +2 -0
  222. package/dist/esm/for_galleryScreens/when_resolving_the_component_names_they_reference.d.ts.map +1 -0
  223. package/dist/esm/for_galleryScreens/when_resolving_the_component_names_they_reference.js +44 -0
  224. package/dist/esm/for_galleryScreens/when_resolving_the_component_names_they_reference.js.map +1 -0
  225. package/dist/esm/for_layoutConfigStorage/when_restoring_a_persisted_configuration.d.ts +2 -0
  226. package/dist/esm/for_layoutConfigStorage/when_restoring_a_persisted_configuration.d.ts.map +1 -0
  227. package/dist/esm/for_layoutConfigStorage/when_restoring_a_persisted_configuration.js +60 -0
  228. package/dist/esm/for_layoutConfigStorage/when_restoring_a_persisted_configuration.js.map +1 -0
  229. package/dist/esm/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.d.ts +2 -0
  230. package/dist/esm/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.d.ts.map +1 -0
  231. package/dist/esm/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.js +28 -0
  232. package/dist/esm/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.js.map +1 -0
  233. package/dist/esm/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.d.ts +2 -0
  234. package/dist/esm/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.d.ts.map +1 -0
  235. package/dist/esm/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.js +38 -0
  236. package/dist/esm/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.js.map +1 -0
  237. package/dist/esm/for_layoutWrapperClasses/when_rendering_each_mode.d.ts +2 -0
  238. package/dist/esm/for_layoutWrapperClasses/when_rendering_each_mode.d.ts.map +1 -0
  239. package/dist/esm/for_layoutWrapperClasses/when_rendering_each_mode.js +39 -0
  240. package/dist/esm/for_layoutWrapperClasses/when_rendering_each_mode.js.map +1 -0
  241. package/dist/esm/for_navigation/when_aggregating_the_navigation_contributions.d.ts +2 -0
  242. package/dist/esm/for_navigation/when_aggregating_the_navigation_contributions.d.ts.map +1 -0
  243. package/dist/esm/for_navigation/when_aggregating_the_navigation_contributions.js +37 -0
  244. package/dist/esm/for_navigation/when_aggregating_the_navigation_contributions.js.map +1 -0
  245. package/dist/esm/gallery/ApplicationScreens.stories.d.ts +31 -0
  246. package/dist/esm/gallery/ApplicationScreens.stories.d.ts.map +1 -0
  247. package/dist/esm/gallery/ApplicationScreens.stories.js +29 -0
  248. package/dist/esm/gallery/ApplicationScreens.stories.js.map +1 -0
  249. package/dist/esm/gallery/FullPageScreens.stories.d.ts +28 -0
  250. package/dist/esm/gallery/FullPageScreens.stories.d.ts.map +1 -0
  251. package/dist/esm/gallery/FullPageScreens.stories.js +26 -0
  252. package/dist/esm/gallery/FullPageScreens.stories.js.map +1 -0
  253. package/dist/esm/gallery/GalleryScreenPreview.d.ts +12 -0
  254. package/dist/esm/gallery/GalleryScreenPreview.d.ts.map +1 -0
  255. package/dist/esm/gallery/GalleryScreenPreview.js +60 -0
  256. package/dist/esm/gallery/GalleryScreenPreview.js.map +1 -0
  257. package/dist/esm/gallery/NavigationEntry.d.ts +8 -0
  258. package/dist/esm/gallery/NavigationEntry.d.ts.map +1 -0
  259. package/dist/esm/gallery/NavigationEntry.js +2 -0
  260. package/dist/esm/gallery/NavigationEntry.js.map +1 -0
  261. package/dist/esm/gallery/TemplateSlotName.d.ts +11 -0
  262. package/dist/esm/gallery/TemplateSlotName.d.ts.map +1 -0
  263. package/dist/esm/gallery/TemplateSlotName.js +23 -0
  264. package/dist/esm/gallery/TemplateSlotName.js.map +1 -0
  265. package/dist/esm/gallery/applicationChrome.d.ts +8 -0
  266. package/dist/esm/gallery/applicationChrome.d.ts.map +1 -0
  267. package/dist/esm/gallery/applicationChrome.js +131 -0
  268. package/dist/esm/gallery/applicationChrome.js.map +1 -0
  269. package/dist/esm/gallery/authTemplates.d.ts +9 -0
  270. package/dist/esm/gallery/authTemplates.d.ts.map +1 -0
  271. package/dist/esm/gallery/authTemplates.js +226 -0
  272. package/dist/esm/gallery/authTemplates.js.map +1 -0
  273. package/dist/esm/gallery/componentNames.d.ts +4 -0
  274. package/dist/esm/gallery/componentNames.d.ts.map +1 -0
  275. package/dist/esm/gallery/componentNames.js +50 -0
  276. package/dist/esm/gallery/componentNames.js.map +1 -0
  277. package/dist/esm/gallery/composeScreen.d.ts +5 -0
  278. package/dist/esm/gallery/composeScreen.d.ts.map +1 -0
  279. package/dist/esm/gallery/composeScreen.js +95 -0
  280. package/dist/esm/gallery/composeScreen.js.map +1 -0
  281. package/dist/esm/gallery/dependencyComponentNames.d.ts +4 -0
  282. package/dist/esm/gallery/dependencyComponentNames.d.ts.map +1 -0
  283. package/dist/esm/gallery/dependencyComponentNames.js +68 -0
  284. package/dist/esm/gallery/dependencyComponentNames.js.map +1 -0
  285. package/dist/esm/gallery/dialogTemplates.d.ts +6 -0
  286. package/dist/esm/gallery/dialogTemplates.d.ts.map +1 -0
  287. package/dist/esm/gallery/dialogTemplates.js +156 -0
  288. package/dist/esm/gallery/dialogTemplates.js.map +1 -0
  289. package/dist/esm/gallery/elements.d.ts +7 -0
  290. package/dist/esm/gallery/elements.d.ts.map +1 -0
  291. package/dist/esm/gallery/elements.js +74 -0
  292. package/dist/esm/gallery/elements.js.map +1 -0
  293. package/dist/esm/gallery/index.d.ts +20 -0
  294. package/dist/esm/gallery/index.d.ts.map +1 -0
  295. package/dist/esm/gallery/index.js +20 -0
  296. package/dist/esm/gallery/index.js.map +1 -0
  297. package/dist/esm/gallery/navigation.d.ts +9 -0
  298. package/dist/esm/gallery/navigation.d.ts.map +1 -0
  299. package/dist/esm/gallery/navigation.js +122 -0
  300. package/dist/esm/gallery/navigation.js.map +1 -0
  301. package/dist/esm/gallery/nesting.d.ts +6 -0
  302. package/dist/esm/gallery/nesting.d.ts.map +1 -0
  303. package/dist/esm/gallery/nesting.js +124 -0
  304. package/dist/esm/gallery/nesting.js.map +1 -0
  305. package/dist/esm/gallery/previewProfile.d.ts +6 -0
  306. package/dist/esm/gallery/previewProfile.d.ts.map +1 -0
  307. package/dist/esm/gallery/previewProfile.js +64 -0
  308. package/dist/esm/gallery/previewProfile.js.map +1 -0
  309. package/dist/esm/gallery/resolveElementNames.d.ts +4 -0
  310. package/dist/esm/gallery/resolveElementNames.d.ts.map +1 -0
  311. package/dist/esm/gallery/resolveElementNames.js +61 -0
  312. package/dist/esm/gallery/resolveElementNames.js.map +1 -0
  313. package/dist/esm/gallery/screens.d.ts +5 -0
  314. package/dist/esm/gallery/screens.d.ts.map +1 -0
  315. package/dist/esm/gallery/screens.js +218 -0
  316. package/dist/esm/gallery/screens.js.map +1 -0
  317. package/dist/esm/gallery/statusTemplates.d.ts +7 -0
  318. package/dist/esm/gallery/statusTemplates.d.ts.map +1 -0
  319. package/dist/esm/gallery/statusTemplates.js +184 -0
  320. package/dist/esm/gallery/statusTemplates.js.map +1 -0
  321. package/dist/esm/gallery/supportTemplates.d.ts +8 -0
  322. package/dist/esm/gallery/supportTemplates.d.ts.map +1 -0
  323. package/dist/esm/gallery/supportTemplates.js +312 -0
  324. package/dist/esm/gallery/supportTemplates.js.map +1 -0
  325. package/dist/esm/gallery/widgets.d.ts +12 -0
  326. package/dist/esm/gallery/widgets.d.ts.map +1 -0
  327. package/dist/esm/gallery/widgets.js +86 -0
  328. package/dist/esm/gallery/widgets.js.map +1 -0
  329. package/dist/esm/gallery/workspaceTemplates.d.ts +8 -0
  330. package/dist/esm/gallery/workspaceTemplates.d.ts.map +1 -0
  331. package/dist/esm/gallery/workspaceTemplates.js +388 -0
  332. package/dist/esm/gallery/workspaceTemplates.js.map +1 -0
  333. package/dist/esm/index.d.ts +10 -0
  334. package/dist/esm/index.d.ts.map +1 -0
  335. package/dist/esm/index.js +60 -0
  336. package/dist/esm/index.js.map +1 -0
  337. package/dist/esm/layouts/LayoutName.d.ts +5 -0
  338. package/dist/esm/layouts/LayoutName.d.ts.map +1 -0
  339. package/dist/esm/layouts/LayoutName.js +17 -0
  340. package/dist/esm/layouts/LayoutName.js.map +1 -0
  341. package/dist/esm/layouts/SlotName.d.ts +12 -0
  342. package/dist/esm/layouts/SlotName.d.ts.map +1 -0
  343. package/dist/esm/layouts/SlotName.js +29 -0
  344. package/dist/esm/layouts/SlotName.js.map +1 -0
  345. package/dist/esm/layouts/appShell.d.ts +8 -0
  346. package/dist/esm/layouts/appShell.d.ts.map +1 -0
  347. package/dist/esm/layouts/appShell.js +153 -0
  348. package/dist/esm/layouts/appShell.js.map +1 -0
  349. package/dist/esm/layouts/defaultLayouts.d.ts +3 -0
  350. package/dist/esm/layouts/defaultLayouts.d.ts.map +1 -0
  351. package/dist/esm/layouts/defaultLayouts.js +18 -0
  352. package/dist/esm/layouts/defaultLayouts.js.map +1 -0
  353. package/dist/esm/layouts/flowBuilders.d.ts +6 -0
  354. package/dist/esm/layouts/flowBuilders.d.ts.map +1 -0
  355. package/dist/esm/layouts/flowBuilders.js +61 -0
  356. package/dist/esm/layouts/flowBuilders.js.map +1 -0
  357. package/dist/esm/layouts/fullPage.d.ts +6 -0
  358. package/dist/esm/layouts/fullPage.d.ts.map +1 -0
  359. package/dist/esm/layouts/fullPage.js +73 -0
  360. package/dist/esm/layouts/fullPage.js.map +1 -0
  361. package/dist/esm/layouts/index.d.ts +8 -0
  362. package/dist/esm/layouts/index.d.ts.map +1 -0
  363. package/dist/esm/layouts/index.js +8 -0
  364. package/dist/esm/layouts/index.js.map +1 -0
  365. package/dist/esm/layouts/shellComponents.d.ts +3 -0
  366. package/dist/esm/layouts/shellComponents.d.ts.map +1 -0
  367. package/dist/esm/layouts/shellComponents.js +27 -0
  368. package/dist/esm/layouts/shellComponents.js.map +1 -0
  369. package/dist/esm/package.json +3 -0
  370. package/dist/esm/packageName.d.ts +2 -0
  371. package/dist/esm/packageName.d.ts.map +1 -0
  372. package/dist/esm/packageName.js +13 -0
  373. package/dist/esm/packageName.js.map +1 -0
  374. package/dist/esm/shell/AppShell.d.ts +3 -0
  375. package/dist/esm/shell/AppShell.d.ts.map +1 -0
  376. package/dist/esm/shell/AppShell.js +86 -0
  377. package/dist/esm/shell/AppShell.js.map +1 -0
  378. package/dist/esm/shell/Breadcrumb.d.ts +3 -0
  379. package/dist/esm/shell/Breadcrumb.d.ts.map +1 -0
  380. package/dist/esm/shell/Breadcrumb.js +31 -0
  381. package/dist/esm/shell/Breadcrumb.js.map +1 -0
  382. package/dist/esm/shell/ConfigPanel.d.ts +3 -0
  383. package/dist/esm/shell/ConfigPanel.d.ts.map +1 -0
  384. package/dist/esm/shell/ConfigPanel.js +126 -0
  385. package/dist/esm/shell/ConfigPanel.js.map +1 -0
  386. package/dist/esm/shell/Footer.d.ts +3 -0
  387. package/dist/esm/shell/Footer.d.ts.map +1 -0
  388. package/dist/esm/shell/Footer.js +26 -0
  389. package/dist/esm/shell/Footer.js.map +1 -0
  390. package/dist/esm/shell/FullPageShell.d.ts +3 -0
  391. package/dist/esm/shell/FullPageShell.d.ts.map +1 -0
  392. package/dist/esm/shell/FullPageShell.js +51 -0
  393. package/dist/esm/shell/FullPageShell.js.map +1 -0
  394. package/dist/esm/shell/LayoutModeSwitcher.d.ts +3 -0
  395. package/dist/esm/shell/LayoutModeSwitcher.d.ts.map +1 -0
  396. package/dist/esm/shell/LayoutModeSwitcher.js +56 -0
  397. package/dist/esm/shell/LayoutModeSwitcher.js.map +1 -0
  398. package/dist/esm/shell/LayoutModes.stories.d.ts +29 -0
  399. package/dist/esm/shell/LayoutModes.stories.d.ts.map +1 -0
  400. package/dist/esm/shell/LayoutModes.stories.js +43 -0
  401. package/dist/esm/shell/LayoutModes.stories.js.map +1 -0
  402. package/dist/esm/shell/Logo.d.ts +3 -0
  403. package/dist/esm/shell/Logo.d.ts.map +1 -0
  404. package/dist/esm/shell/Logo.js +42 -0
  405. package/dist/esm/shell/Logo.js.map +1 -0
  406. package/dist/esm/shell/Mask.d.ts +3 -0
  407. package/dist/esm/shell/Mask.d.ts.map +1 -0
  408. package/dist/esm/shell/Mask.js +31 -0
  409. package/dist/esm/shell/Mask.js.map +1 -0
  410. package/dist/esm/shell/Menu.d.ts +3 -0
  411. package/dist/esm/shell/Menu.d.ts.map +1 -0
  412. package/dist/esm/shell/Menu.js +34 -0
  413. package/dist/esm/shell/Menu.js.map +1 -0
  414. package/dist/esm/shell/MenuItem.d.ts +3 -0
  415. package/dist/esm/shell/MenuItem.d.ts.map +1 -0
  416. package/dist/esm/shell/MenuItem.js +63 -0
  417. package/dist/esm/shell/MenuItem.js.map +1 -0
  418. package/dist/esm/shell/PageHeader.d.ts +3 -0
  419. package/dist/esm/shell/PageHeader.d.ts.map +1 -0
  420. package/dist/esm/shell/PageHeader.js +41 -0
  421. package/dist/esm/shell/PageHeader.js.map +1 -0
  422. package/dist/esm/shell/RightPanel.d.ts +3 -0
  423. package/dist/esm/shell/RightPanel.d.ts.map +1 -0
  424. package/dist/esm/shell/RightPanel.js +28 -0
  425. package/dist/esm/shell/RightPanel.js.map +1 -0
  426. package/dist/esm/shell/Sidebar.d.ts +3 -0
  427. package/dist/esm/shell/Sidebar.d.ts.map +1 -0
  428. package/dist/esm/shell/Sidebar.js +49 -0
  429. package/dist/esm/shell/Sidebar.js.map +1 -0
  430. package/dist/esm/shell/ThemeOption.d.ts +10 -0
  431. package/dist/esm/shell/ThemeOption.d.ts.map +1 -0
  432. package/dist/esm/shell/ThemeOption.js +39 -0
  433. package/dist/esm/shell/ThemeOption.js.map +1 -0
  434. package/dist/esm/shell/ThemeSwitcher.d.ts +3 -0
  435. package/dist/esm/shell/ThemeSwitcher.d.ts.map +1 -0
  436. package/dist/esm/shell/ThemeSwitcher.js +48 -0
  437. package/dist/esm/shell/ThemeSwitcher.js.map +1 -0
  438. package/dist/esm/shell/Topbar.d.ts +3 -0
  439. package/dist/esm/shell/Topbar.d.ts.map +1 -0
  440. package/dist/esm/shell/Topbar.js +52 -0
  441. package/dist/esm/shell/Topbar.js.map +1 -0
  442. package/dist/esm/shell/UserMenu.d.ts +3 -0
  443. package/dist/esm/shell/UserMenu.d.ts.map +1 -0
  444. package/dist/esm/shell/UserMenu.js +66 -0
  445. package/dist/esm/shell/UserMenu.js.map +1 -0
  446. package/dist/esm/shell/elementProperties.d.ts +9 -0
  447. package/dist/esm/shell/elementProperties.d.ts.map +1 -0
  448. package/dist/esm/shell/elementProperties.js +48 -0
  449. package/dist/esm/shell/elementProperties.js.map +1 -0
  450. package/dist/esm/shell/index.d.ts +19 -0
  451. package/dist/esm/shell/index.d.ts.map +1 -0
  452. package/dist/esm/shell/index.js +19 -0
  453. package/dist/esm/shell/index.js.map +1 -0
  454. package/dist/esm/themes/LayoutThemeProvider.d.ts +9 -0
  455. package/dist/esm/themes/LayoutThemeProvider.d.ts.map +1 -0
  456. package/dist/esm/themes/LayoutThemeProvider.js +31 -0
  457. package/dist/esm/themes/LayoutThemeProvider.js.map +1 -0
  458. package/dist/esm/themes/Theming.stories.d.ts +21 -0
  459. package/dist/esm/themes/Theming.stories.d.ts.map +1 -0
  460. package/dist/esm/themes/Theming.stories.js +54 -0
  461. package/dist/esm/themes/Theming.stories.js.map +1 -0
  462. package/dist/esm/themes/blueprintThemeCompatibility.d.ts +2 -0
  463. package/dist/esm/themes/blueprintThemeCompatibility.d.ts.map +1 -0
  464. package/dist/esm/themes/blueprintThemeCompatibility.js +26 -0
  465. package/dist/esm/themes/blueprintThemeCompatibility.js.map +1 -0
  466. package/dist/esm/themes/dark.d.ts +3 -0
  467. package/dist/esm/themes/dark.d.ts.map +1 -0
  468. package/dist/esm/themes/dark.js +38 -0
  469. package/dist/esm/themes/dark.js.map +1 -0
  470. package/dist/esm/themes/defaultBlueprintThemes.d.ts +3 -0
  471. package/dist/esm/themes/defaultBlueprintThemes.d.ts.map +1 -0
  472. package/dist/esm/themes/defaultBlueprintThemes.js +17 -0
  473. package/dist/esm/themes/defaultBlueprintThemes.js.map +1 -0
  474. package/dist/esm/themes/index.d.ts +6 -0
  475. package/dist/esm/themes/index.d.ts.map +1 -0
  476. package/dist/esm/themes/index.js +6 -0
  477. package/dist/esm/themes/index.js.map +1 -0
  478. package/dist/esm/themes/light.d.ts +3 -0
  479. package/dist/esm/themes/light.d.ts.map +1 -0
  480. package/dist/esm/themes/light.js +41 -0
  481. package/dist/esm/themes/light.js.map +1 -0
  482. package/dist/esm/tsconfig.tsbuildinfo +1 -0
  483. package/for_AppShell/when_rendering_a_gallery_screen.tsx +76 -0
  484. package/for_LayoutConfigProvider/when_switching_mode_and_reloading.tsx +77 -0
  485. package/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.ts +42 -0
  486. package/for_defaultBlueprint/when_validating_the_bundle.ts +43 -0
  487. package/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.ts +50 -0
  488. package/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.ts +36 -0
  489. package/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.ts +53 -0
  490. package/for_galleryScreenTemplates/when_following_the_nesting_chain.ts +41 -0
  491. package/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.ts +44 -0
  492. package/for_galleryScreens/when_resolving_the_component_names_they_reference.ts +60 -0
  493. package/for_layoutConfigStorage/when_restoring_a_persisted_configuration.ts +76 -0
  494. package/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.ts +44 -0
  495. package/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.ts +61 -0
  496. package/for_layoutWrapperClasses/when_rendering_each_mode.ts +63 -0
  497. package/for_navigation/when_aggregating_the_navigation_contributions.ts +50 -0
  498. package/gallery/ApplicationScreens.stories.tsx +70 -0
  499. package/gallery/FullPageScreens.stories.tsx +60 -0
  500. package/gallery/GalleryScreenPreview.tsx +68 -0
  501. package/gallery/NavigationEntry.ts +27 -0
  502. package/gallery/TemplateSlotName.ts +36 -0
  503. package/gallery/applicationChrome.ts +110 -0
  504. package/gallery/authTemplates.ts +161 -0
  505. package/gallery/componentNames.ts +55 -0
  506. package/gallery/composeScreen.ts +95 -0
  507. package/gallery/dependencyComponentNames.ts +64 -0
  508. package/gallery/dialogTemplates.ts +79 -0
  509. package/gallery/elements.ts +65 -0
  510. package/gallery/index.ts +22 -0
  511. package/gallery/navigation.ts +71 -0
  512. package/gallery/nesting.ts +82 -0
  513. package/gallery/previewProfile.ts +59 -0
  514. package/gallery/resolveElementNames.ts +55 -0
  515. package/gallery/screens.ts +111 -0
  516. package/gallery/statusTemplates.ts +118 -0
  517. package/gallery/supportTemplates.ts +164 -0
  518. package/gallery/widgets.ts +63 -0
  519. package/gallery/workspaceTemplates.ts +198 -0
  520. package/index.ts +12 -0
  521. package/layouts/LayoutName.ts +18 -0
  522. package/layouts/SlotName.ts +44 -0
  523. package/layouts/appShell.ts +106 -0
  524. package/layouts/defaultLayouts.ts +15 -0
  525. package/layouts/flowBuilders.ts +49 -0
  526. package/layouts/fullPage.ts +48 -0
  527. package/layouts/index.ts +10 -0
  528. package/layouts/shellComponents.ts +28 -0
  529. package/package.json +68 -0
  530. package/packageName.ts +12 -0
  531. package/shell/AppShell.tsx +66 -0
  532. package/shell/Breadcrumb.tsx +31 -0
  533. package/shell/ConfigPanel.tsx +105 -0
  534. package/shell/Footer.tsx +23 -0
  535. package/shell/FullPageShell.tsx +41 -0
  536. package/shell/LayoutModeSwitcher.tsx +50 -0
  537. package/shell/LayoutModes.stories.tsx +83 -0
  538. package/shell/Logo.tsx +30 -0
  539. package/shell/Mask.tsx +29 -0
  540. package/shell/Menu.tsx +26 -0
  541. package/shell/MenuItem.tsx +39 -0
  542. package/shell/PageHeader.tsx +28 -0
  543. package/shell/RightPanel.tsx +23 -0
  544. package/shell/Sidebar.tsx +45 -0
  545. package/shell/ThemeOption.ts +60 -0
  546. package/shell/ThemeSwitcher.tsx +42 -0
  547. package/shell/Topbar.tsx +49 -0
  548. package/shell/UserMenu.tsx +53 -0
  549. package/shell/elementProperties.ts +64 -0
  550. package/shell/index.ts +21 -0
  551. package/shell/layout.css +821 -0
  552. package/themes/LayoutThemeProvider.tsx +41 -0
  553. package/themes/Theming.stories.tsx +89 -0
  554. package/themes/blueprintThemeCompatibility.ts +19 -0
  555. package/themes/dark.ts +38 -0
  556. package/themes/defaultBlueprintThemes.ts +14 -0
  557. package/themes/index.ts +8 -0
  558. package/themes/light.ts +41 -0
@@ -0,0 +1,82 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { ScreenTemplate } from '@cratis/scene.model';
5
+ import { ComponentName } from '../ComponentName';
6
+ import { SlotName, column, slotLeaf } from '../layouts';
7
+ import { TemplateSlotName } from './TemplateSlotName';
8
+ import { button, externalComponent } from './elements';
9
+ import { pageHeader } from './widgets';
10
+
11
+ /**
12
+ * A worked three-level chain, from the application layout down to a slice.
13
+ *
14
+ * The nesting rule is one rule applied at every depth: a template names, in `fitsSlot`, a slot declared by
15
+ * whatever contains it. A module's template fits the application layout's `content`; a feature's template
16
+ * fits a slot the module's template declares; a slice's fits one the feature's declares. Nothing here is a
17
+ * special case for a particular level - which is exactly why the hierarchy can be arbitrarily deep without
18
+ * a second mechanism.
19
+ *
20
+ * These three exist to make that concrete and to be asserted by a spec, because "it composes recursively"
21
+ * is the kind of claim that is true in a design document and wrong in the code.
22
+ */
23
+
24
+ /**
25
+ * Module level: fits the application shell's `content` slot.
26
+ *
27
+ * It brings its own header - a module always has a name and a description - and offers a body for the
28
+ * feature inside it plus an optional side panel.
29
+ */
30
+ export const moduleWorkspaceTemplate: ScreenTemplate = {
31
+ name: 'ModuleWorkspace',
32
+ fitsSlot: SlotName.Content,
33
+ slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.SidePanel }],
34
+ content: {
35
+ [TemplateSlotName.Header]: [pageHeader('module-header', 'Operations', 'Everything the operations module owns')],
36
+ },
37
+ displayName: 'Module workspace',
38
+ description: 'Module level: fits the application layout content slot and offers a body for one feature.',
39
+ };
40
+
41
+ /**
42
+ * Feature level: fits the module workspace's `body` slot.
43
+ *
44
+ * It brings a toolbar, because a feature is where actions belong - a module is a grouping, a slice is one
45
+ * behavior, and the feature in between is what a user thinks of as a screen with buttons on it.
46
+ */
47
+ export const featureSectionTemplate: ScreenTemplate = {
48
+ name: 'FeatureSection',
49
+ fitsSlot: TemplateSlotName.Body,
50
+ slots: [{ name: TemplateSlotName.Toolbar }, { name: TemplateSlotName.Body }],
51
+ content: {
52
+ [TemplateSlotName.Toolbar]: [
53
+ button('feature-new', 'New', { severity: 'primary', icon: 'pi pi-plus' }),
54
+ button('feature-export', 'Export', { severity: 'secondary', icon: 'pi pi-download' }),
55
+ ],
56
+ },
57
+ displayName: 'Feature section',
58
+ description: 'Feature level: fits a module workspace body slot and brings the action toolbar.',
59
+ };
60
+
61
+ /**
62
+ * Slice level: fits the feature section's `body` slot.
63
+ *
64
+ * The end of the chain, and deliberately the thinnest thing in it - one behavior's surface, with somewhere
65
+ * to put it and somewhere to put its actions.
66
+ */
67
+ export const sliceSectionTemplate: ScreenTemplate = {
68
+ name: 'SliceSection',
69
+ fitsSlot: TemplateSlotName.Body,
70
+ slots: [{ name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],
71
+ arrangement: {
72
+ root: column([slotLeaf(TemplateSlotName.Body, { grow: 1 }), slotLeaf(TemplateSlotName.Actions)]),
73
+ },
74
+ content: {
75
+ [TemplateSlotName.Body]: [externalComponent('slice-body', ComponentName.PageHeader, { title: 'Adjustment', subtitle: 'One behavior, one surface' })],
76
+ },
77
+ displayName: 'Slice section',
78
+ description: 'Slice level: fits a feature section body slot and hosts one behavior.',
79
+ };
80
+
81
+ /** The chain, outermost first - what a spec walks to prove `fitsSlot` resolves at every level. */
82
+ export const nestingChainTemplates: ScreenTemplate[] = [moduleWorkspaceTemplate, featureSectionTemplate, sliceSectionTemplate];
@@ -0,0 +1,59 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { UiProfile } from '@cratis/scene.model';
5
+ import { PackageCatalog } from '@cratis/scene.engine';
6
+ import { ComponentName } from '../ComponentName';
7
+ import { defaultBlueprintName } from '../packageName';
8
+ import { coreComponentNames, cratisComponentsNames, primeReactComponentNames } from './dependencyComponentNames';
9
+
10
+ /**
11
+ * The profile the gallery is previewed against.
12
+ *
13
+ * `core` is listed explicitly rather than left to `effectivePackages` to prepend, because a theme's
14
+ * compatibility is checked against exactly what the profile declares - and a profile that leans on the
15
+ * implicit fallback would make a theme look incompatible with a package the profile never admitted to
16
+ * using. Declaration order is ascending priority, so this blueprint's own names win over the component
17
+ * libraries', which is what lets it provide a `breadcrumb` of its own without hiding PrimeReact's.
18
+ */
19
+ export const galleryProfile: UiProfile = {
20
+ name: 'Gallery',
21
+ targetPlatform: 'web',
22
+ packages: ['core', 'PrimeReact', 'Cratis.Components', defaultBlueprintName],
23
+ };
24
+
25
+ /**
26
+ * The profile a *preview* resolves against, when only some of those packages are actually loaded.
27
+ *
28
+ * Same four packages, different order, and the difference is deliberate. This blueprint takes no npm
29
+ * dependency on PrimeReact's or Cratis Components' bundles - a blueprint declares its dependencies in its
30
+ * manifest, not in its bundler graph - so a preview run from this package has `core` and this blueprint
31
+ * implemented and nothing else. Ranking `core` above the two libraries means `text`, `button` and `card`
32
+ * resolve to something that exists, and the preview shows real content instead of a wall of placeholders.
33
+ *
34
+ * Names only the libraries declare - `dataTable`, `timeline`, `tag` - still resolve to them, find no
35
+ * implementation, and render as `UnresolvedComponent`'s dashed box naming what is missing. That is the
36
+ * right outcome rather than a papered-over one: previewing a blueprint against half a profile *should*
37
+ * look visibly incomplete. A host with all four bundles loaded uses {@link galleryProfile} and sees the
38
+ * real widgets.
39
+ */
40
+ export const galleryPreviewProfile: UiProfile = {
41
+ name: 'Gallery preview',
42
+ targetPlatform: 'web',
43
+ packages: ['PrimeReact', 'Cratis.Components', 'core', defaultBlueprintName],
44
+ };
45
+
46
+ /**
47
+ * The component catalog the gallery resolves against.
48
+ *
49
+ * This blueprint's own entry is its real declared component list; the other three are the subsets it
50
+ * borrows, each name checked against the owning package's own manifest (see `dependencyComponentNames.ts`).
51
+ * A host that has all four packages loaded should build this from their manifests instead - the shape is
52
+ * the same, and anything that has drifted then fails this blueprint's specs rather than a preview.
53
+ */
54
+ export const galleryComponentCatalog: PackageCatalog = {
55
+ core: coreComponentNames,
56
+ PrimeReact: primeReactComponentNames,
57
+ 'Cratis.Components': cratisComponentsNames,
58
+ [defaultBlueprintName]: Object.values(ComponentName),
59
+ };
@@ -0,0 +1,55 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { ContentControl, ExternalComponent, ItemsControl, Panel, SceneElement, UiProfile } from '@cratis/scene.model';
5
+ import { PackageCatalog, isContentControl, isExternalComponent, isItemsControl, isPanel, resolveComponentName } from '@cratis/scene.engine';
6
+ import { componentRegistryKey } from '@cratis/scene.react';
7
+
8
+ /**
9
+ * Rewrites an element tree's bare component names into the keys the React registry is keyed by.
10
+ *
11
+ * The renderer looks a component up by `element.componentName` against a registry keyed by
12
+ * `componentRegistryKey(package, name)`, so something has to resolve bare names against the active profile
13
+ * first. Wiring that into the renderer proper is Stage's job and does not exist yet; this is the small
14
+ * local version that lets the gallery boot through the *real* engine and the *real* registry today rather
15
+ * than waiting for it.
16
+ *
17
+ * A name nothing declares is left exactly as written. That is deliberate: the renderer then falls back to
18
+ * `UnresolvedComponent` and shows a dashed red box naming the component, which is far more useful than a
19
+ * throw from inside a tree walk.
20
+ *
21
+ * @param element The tree to rewrite.
22
+ * @param profile The profile whose package priority decides which package wins a bare name.
23
+ * @param catalog Each active package's declared component names.
24
+ * @returns A new tree; the original is untouched.
25
+ */
26
+ export function resolveElementComponentNames(element: SceneElement, profile: UiProfile, catalog: PackageCatalog): SceneElement {
27
+ if (isExternalComponent(element)) {
28
+ const resolution = resolveComponentName(element.componentName, profile, catalog);
29
+ const resolved: ExternalComponent = {
30
+ ...element,
31
+ componentName: resolution ? componentRegistryKey(resolution.package, resolution.name) : element.componentName,
32
+ slots: Object.fromEntries(
33
+ Object.entries(element.slots).map(([name, children]) => [name, children.map(child => resolveElementComponentNames(child, profile, catalog))]),
34
+ ),
35
+ };
36
+ return resolved;
37
+ }
38
+
39
+ if (isContentControl(element)) {
40
+ const contentControl: ContentControl = { ...element, content: resolveElementComponentNames(element.content, profile, catalog) };
41
+ return contentControl;
42
+ }
43
+
44
+ if (isItemsControl(element)) {
45
+ const itemsControl: ItemsControl = { ...element, itemTemplate: resolveElementComponentNames(element.itemTemplate, profile, catalog) };
46
+ return itemsControl;
47
+ }
48
+
49
+ if (isPanel(element)) {
50
+ const panel: Panel = { ...element, children: element.children.map(child => resolveElementComponentNames(child, profile, catalog)) };
51
+ return panel;
52
+ }
53
+
54
+ return element;
55
+ }
@@ -0,0 +1,111 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { Layout, Screen, ScreenTemplate } from '@cratis/scene.model';
5
+ import { LayoutName, appShellLayout, fullPageLayout } from '../layouts';
6
+ import { BreadcrumbEntry, applicationChrome, fullPageChrome } from './applicationChrome';
7
+ import { nestScreenTemplates, templateContentInLayout } from './composeScreen';
8
+ import { authTemplates } from './authTemplates';
9
+ import { navigationContributions } from './navigation';
10
+ import { nestingChainTemplates } from './nesting';
11
+ import { statusTemplates } from './statusTemplates';
12
+ import { supportTemplates } from './supportTemplates';
13
+ import { workspaceTemplates } from './workspaceTemplates';
14
+
15
+ /**
16
+ * The screen templates this blueprint provides.
17
+ *
18
+ * Ten shapes for inside the application shell, ten for the full-page shell, and the three-level nesting
19
+ * chain that demonstrates how `fitsSlot` composes. The list is what the manifest's `screenTemplates` names
20
+ * and what the bundle provides; `validatePackageBundle` proves the two agree.
21
+ */
22
+ export const galleryScreenTemplates: ScreenTemplate[] = [
23
+ ...workspaceTemplates,
24
+ ...supportTemplates,
25
+ ...authTemplates,
26
+ ...statusTemplates,
27
+ ...nestingChainTemplates,
28
+ ];
29
+
30
+ /** Which layout each template renders inside - the application shell unless it is one of the chrome-less screens. */
31
+ const fullPageTemplateNames = new Set([...authTemplates, ...statusTemplates].map(template => template.name));
32
+
33
+ /** The trail shown above each application-shell screen. */
34
+ const breadcrumbs: Record<string, BreadcrumbEntry[]> = {
35
+ Dashboard: [{ label: 'Dashboard' }],
36
+ CrudList: [{ label: 'Catalog', targetScreen: 'Dashboard' }, { label: 'Products' }],
37
+ DetailView: [{ label: 'Catalog', targetScreen: 'Dashboard' }, { label: 'Products', targetScreen: 'CrudList' }, { label: 'Bamboo Watch' }],
38
+ FormPage: [{ label: 'Catalog', targetScreen: 'Dashboard' }, { label: 'Products', targetScreen: 'CrudList' }, { label: 'New product' }],
39
+ Empty: [{ label: 'Catalog', targetScreen: 'Dashboard' }, { label: 'Products' }],
40
+ Documentation: [{ label: 'Support', targetScreen: 'Dashboard' }, { label: 'Documentation' }],
41
+ ProfileSettings: [{ label: 'Administration', targetScreen: 'Dashboard' }, { label: 'Your profile' }],
42
+ UserManagement: [{ label: 'Administration', targetScreen: 'Dashboard' }, { label: 'Users' }],
43
+ Invoice: [{ label: 'Billing', targetScreen: 'Dashboard' }, { label: 'INV-2043' }],
44
+ Help: [{ label: 'Support', targetScreen: 'Dashboard' }, { label: 'Help' }],
45
+ ModuleWorkspace: [{ label: 'Operations' }],
46
+ FeatureSection: [{ label: 'Operations', targetScreen: 'ModuleWorkspace' }, { label: 'Adjustments' }],
47
+ SliceSection: [
48
+ { label: 'Operations', targetScreen: 'ModuleWorkspace' },
49
+ { label: 'Adjustments', targetScreen: 'FeatureSection' },
50
+ { label: 'Record an adjustment' },
51
+ ],
52
+ };
53
+
54
+ /**
55
+ * Builds the {@link Screen} that instantiates one template.
56
+ *
57
+ * A screen is an instance, not a shape: it names the layout it renders in, the template it fills, the
58
+ * content that fills it, and what it contributes elsewhere. Everything structural comes from the template,
59
+ * which is why adding a screen is a handful of lines rather than another copy of the chrome.
60
+ */
61
+ function screenFor(template: ScreenTemplate): Screen {
62
+ const isFullPage = fullPageTemplateNames.has(template.name);
63
+ const layout: Layout = isFullPage ? fullPageLayout : appShellLayout;
64
+ const chrome = isFullPage ? fullPageChrome() : applicationChrome(template.name, breadcrumbs[template.name] ?? [{ label: template.displayName ?? template.name }]);
65
+ const placeable = nestScreenTemplates(containmentChainFor(template));
66
+
67
+ return {
68
+ name: template.name,
69
+ layout: isFullPage ? LayoutName.FullPage : LayoutName.AppShell,
70
+ screenTemplate: template.name,
71
+ slotContent: mergeSlotContent(chrome, templateContentInLayout(placeable, layout)),
72
+ forms: [],
73
+ contributions: isFullPage ? [] : navigationContributions,
74
+ };
75
+ }
76
+
77
+ /**
78
+ * The chain of templates a screen renders through, outermost first.
79
+ *
80
+ * Almost every template fits the layout's own `content` slot, so its chain is just itself. The three
81
+ * nesting-chain templates are the exception, and the only ones that need the walk - which is the honest
82
+ * version of the story: nesting exists for the applications that need it, and costs nothing for the ones
83
+ * that do not.
84
+ */
85
+ function containmentChainFor(template: ScreenTemplate): ScreenTemplate[] {
86
+ const depth = nestingChainTemplates.findIndex(candidate => candidate.name === template.name);
87
+ return depth < 0 ? [template] : nestingChainTemplates.slice(0, depth + 1);
88
+ }
89
+
90
+ function mergeSlotContent(chrome: Record<string, Screen['slotContent'][string]>, content: Record<string, Screen['slotContent'][string]>): Screen['slotContent'] {
91
+ const merged: Screen['slotContent'] = { ...chrome };
92
+ for (const [slotName, elements] of Object.entries(content)) {
93
+ merged[slotName] = [...(merged[slotName] ?? []), ...elements];
94
+ }
95
+
96
+ return merged;
97
+ }
98
+
99
+ /**
100
+ * The gallery: one screen per template, ready to boot through the real engine.
101
+ *
102
+ * These exist so a preview is a working miniature application rather than a set of pictures - the same
103
+ * `Screen` shape Stage produces, put through the same `Scene.Engine` and `Scene.React`, with no separate
104
+ * preview pipeline and nothing mocked.
105
+ */
106
+ export const galleryScreens: Screen[] = galleryScreenTemplates.map(screenFor);
107
+
108
+ /** One gallery screen by name, for a story or a host that boots a specific one. */
109
+ export function galleryScreen(name: string): Screen | undefined {
110
+ return galleryScreens.find(screen => screen.name === name);
111
+ }
@@ -0,0 +1,118 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { ScreenTemplate } from '@cratis/scene.model';
5
+ import { ComponentName } from '../ComponentName';
6
+ import { SlotName } from '../layouts';
7
+ import { TemplateSlotName } from './TemplateSlotName';
8
+ import { button, card, externalComponent, panel, text } from './elements';
9
+ import { widget } from './widgets';
10
+
11
+ /**
12
+ * The four screens that are not part of anyone's plan: a server error, a refusal, a wrong address, and the
13
+ * page that has to sell the product before any of the others exist.
14
+ *
15
+ * They use the full-page layout for the same reason the sign-in screens do - none of them has navigation
16
+ * to render - and they matter more than their frequency suggests. An error page is the screen most likely
17
+ * to be someone's first impression of how carefully an application was built.
18
+ */
19
+
20
+ /** Something broke on our side. */
21
+ export const errorTemplate: ScreenTemplate = {
22
+ name: 'Error',
23
+ fitsSlot: SlotName.Content,
24
+ slots: [{ name: TemplateSlotName.Body }],
25
+ content: {
26
+ [TemplateSlotName.Body]: [
27
+ card('error-card', [
28
+ externalComponent('error-tag', 'tag', { value: '500', severity: 'danger' }),
29
+ text('error-title', 'Something went wrong on our side'),
30
+ text('error-message', 'The team has been told. Try again in a moment - nothing you were working on was lost.'),
31
+ panel('error-actions', [
32
+ button('error-retry', 'Try again', { severity: 'primary' }),
33
+ button('error-home', 'Back to the dashboard', { severity: 'secondary', targetScreen: 'Dashboard' }),
34
+ ]),
35
+ ]),
36
+ ],
37
+ },
38
+ displayName: 'Error',
39
+ description: 'A server-side failure, said plainly, with a way onward.',
40
+ };
41
+
42
+ /** Signed in, and still not allowed. */
43
+ export const accessDeniedTemplate: ScreenTemplate = {
44
+ name: 'AccessDenied',
45
+ fitsSlot: SlotName.Content,
46
+ slots: [{ name: TemplateSlotName.Body }],
47
+ content: {
48
+ [TemplateSlotName.Body]: [
49
+ card('denied-card', [
50
+ externalComponent('denied-tag', 'tag', { value: '403', severity: 'warning' }),
51
+ text('denied-title', 'You do not have access to this'),
52
+ text('denied-message', 'Your account is signed in, but it is not allowed here. An administrator can change that.'),
53
+ panel('denied-actions', [
54
+ button('denied-request', 'Request access', { severity: 'primary' }),
55
+ button('denied-home', 'Back to the dashboard', { severity: 'secondary', targetScreen: 'Dashboard' }),
56
+ ]),
57
+ ]),
58
+ ],
59
+ },
60
+ displayName: 'Access denied',
61
+ description: 'A refusal that distinguishes "not signed in" from "not allowed".',
62
+ };
63
+
64
+ /** No such address. */
65
+ export const notFoundTemplate: ScreenTemplate = {
66
+ name: 'NotFound',
67
+ fitsSlot: SlotName.Content,
68
+ slots: [{ name: TemplateSlotName.Body }],
69
+ content: {
70
+ [TemplateSlotName.Body]: [
71
+ card('not-found-card', [
72
+ externalComponent('not-found-tag', 'tag', { value: '404', severity: 'info' }),
73
+ text('not-found-title', 'That page is not here'),
74
+ text('not-found-message', 'The link may be old, or the thing it pointed at may have been removed.'),
75
+ externalComponent('not-found-search', 'inputText', { placeholder: 'Search instead' }),
76
+ button('not-found-home', 'Back to the dashboard', { severity: 'secondary', targetScreen: 'Dashboard' }),
77
+ ]),
78
+ ],
79
+ },
80
+ displayName: 'Not found',
81
+ description: 'A wrong address, with a search box rather than a dead end.',
82
+ };
83
+
84
+ /** The page that has to do the selling. */
85
+ export const landingTemplate: ScreenTemplate = {
86
+ name: 'Landing',
87
+ fitsSlot: SlotName.Content,
88
+ slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],
89
+ content: {
90
+ [TemplateSlotName.Header]: [
91
+ panel('landing-nav', [
92
+ externalComponent('landing-logo', ComponentName.Logo, { label: 'Contoso', initials: 'C' }),
93
+ button('landing-signin', 'Sign in', { severity: 'secondary', targetScreen: 'Login' }),
94
+ button('landing-start', 'Start free', { severity: 'primary', targetScreen: 'Register' }),
95
+ ]),
96
+ ],
97
+ [TemplateSlotName.Body]: [
98
+ card('landing-hero', [
99
+ text('landing-headline', 'Ship the shell on day one'),
100
+ text('landing-subhead', 'Eight menu modes, twenty screen templates and two themes, in one blueprint an application picks once.'),
101
+ button('landing-cta', 'Start free', { severity: 'primary', targetScreen: 'Register' }),
102
+ ]),
103
+ widget('landing-feature-modes', 'Every mode people expect', [text('landing-modes-text', 'Static, overlay, slim, slim+, compact, horizontal, reveal and drawer.')]),
104
+ widget('landing-feature-themes', 'Themeable to the token', [text('landing-themes-text', 'Ten semantic tokens define the whole shell. Swap them and everything follows.')]),
105
+ widget('landing-feature-templates', 'The pages you were going to build anyway', [
106
+ text('landing-templates-text', 'Dashboard, list, detail, form, invoice, settings, help - and every screen around signing in.'),
107
+ ]),
108
+ ],
109
+ [TemplateSlotName.Actions]: [
110
+ panel('landing-footer', [text('landing-copyright', '© Contoso'), button('landing-contact', 'Talk to us', { severity: 'secondary' })]),
111
+ ],
112
+ },
113
+ displayName: 'Landing',
114
+ description: 'The marketing front door, with its own navigation because it has no application chrome.',
115
+ };
116
+
117
+ /** The four status and marketing templates. */
118
+ export const statusTemplates: ScreenTemplate[] = [errorTemplate, accessDeniedTemplate, notFoundTemplate, landingTemplate];
@@ -0,0 +1,164 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { ScreenTemplate } from '@cratis/scene.model';
5
+ import { SlotName } from '../layouts';
6
+ import { TemplateSlotName } from './TemplateSlotName';
7
+ import { button, card, externalComponent, text } from './elements';
8
+ import { field, formActions, pageHeader, table, widget } from './widgets';
9
+
10
+ /**
11
+ * The five shapes an application needs that are not the CRUD loop: documentation, the signed-in user's own
12
+ * settings, user administration, a printable document, and help.
13
+ *
14
+ * They are in the set because leaving them out is what makes a template line feel thin. Every real
15
+ * application grows all five, and the ones that were never designed are the ones that end up looking like
16
+ * a different product.
17
+ */
18
+
19
+ /** Documentation: a table of contents beside prose. */
20
+ export const documentationTemplate: ScreenTemplate = {
21
+ name: 'Documentation',
22
+ fitsSlot: SlotName.Content,
23
+ slots: [{ name: TemplateSlotName.SidePanel }, { name: TemplateSlotName.Body }],
24
+ content: {
25
+ [TemplateSlotName.SidePanel]: [
26
+ widget('docs-toc', 'On this page', [
27
+ text('docs-toc-1', 'Getting started'),
28
+ text('docs-toc-2', 'Configuring the shell'),
29
+ text('docs-toc-3', 'Themes'),
30
+ text('docs-toc-4', 'Publishing a blueprint'),
31
+ ]),
32
+ ],
33
+ [TemplateSlotName.Body]: [
34
+ pageHeader('docs-header', 'Getting started', 'Everything you need to run the blueprint locally'),
35
+ card('docs-body', [
36
+ text('docs-intro', 'Install the blueprint, add it to a ui profile, and pick a layout. The shell reads its mode from the configurator and remembers it.'),
37
+ externalComponent('docs-note', 'message', { severity: 'info', text: 'The shell needs its stylesheet imported once, at the host.' }),
38
+ ]),
39
+ ],
40
+ },
41
+ displayName: 'Documentation',
42
+ description: 'Prose with a table of contents beside it.',
43
+ };
44
+
45
+ /** Profile settings: the signed-in user editing their own account. */
46
+ export const profileSettingsTemplate: ScreenTemplate = {
47
+ name: 'ProfileSettings',
48
+ fitsSlot: SlotName.Content,
49
+ slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],
50
+ content: {
51
+ [TemplateSlotName.Header]: [pageHeader('profile-header', 'Your profile', 'How you appear to everyone else in the workspace')],
52
+ [TemplateSlotName.Body]: [
53
+ card('profile-identity', [
54
+ externalComponent('profile-avatar', 'avatar', { label: 'AN', size: 'large', shape: 'circle' }),
55
+ field('profile-name', 'Display name', 'inputText', { value: 'Amelia Nyquist' }),
56
+ field('profile-email', 'Email', 'inputText', { value: 'amelia@contoso.com' }),
57
+ externalComponent('profile-photo', 'image', { alt: 'Your current photo' }),
58
+ button('profile-photo-change', 'Change photo', { severity: 'secondary' }),
59
+ ]),
60
+ card('profile-security', [
61
+ field('profile-current', 'Current password', 'password', {}),
62
+ field('profile-new', 'New password', 'password', { feedback: true }),
63
+ field('profile-notify', 'Email me about mentions', 'checkbox', { checked: true }),
64
+ ]),
65
+ ],
66
+ [TemplateSlotName.Actions]: [formActions('profile-actions', 'Save changes')],
67
+ },
68
+ displayName: 'Profile settings',
69
+ description: 'The signed-in user editing their own name, photo, password and notifications.',
70
+ };
71
+
72
+ /** User management: administering everybody else. */
73
+ export const userManagementTemplate: ScreenTemplate = {
74
+ name: 'UserManagement',
75
+ fitsSlot: SlotName.Content,
76
+ slots: [{ name: TemplateSlotName.Toolbar }, { name: TemplateSlotName.Body }],
77
+ content: {
78
+ [TemplateSlotName.Toolbar]: [
79
+ pageHeader('users-header', 'Users', '34 people, 3 pending invitations', [button('users-invite', 'Invite people', { severity: 'primary', icon: 'pi pi-user-plus' })]),
80
+ ],
81
+ [TemplateSlotName.Body]: [
82
+ table(
83
+ 'users-table',
84
+ [
85
+ { field: 'name', header: 'Name' },
86
+ { field: 'email', header: 'Email' },
87
+ { field: 'role', header: 'Role' },
88
+ { field: 'status', header: 'Status' },
89
+ { field: 'lastSeen', header: 'Last seen' },
90
+ ],
91
+ [
92
+ { name: 'Amelia Nyquist', email: 'amelia@contoso.com', role: 'Owner', status: 'Active', lastSeen: '2 minutes ago' },
93
+ { name: 'Bjørn Holt', email: 'bjorn@contoso.com', role: 'Administrator', status: 'Active', lastSeen: 'Yesterday' },
94
+ { name: 'Chidi Okafor', email: 'chidi@contoso.com', role: 'Editor', status: 'Active', lastSeen: '3 days ago' },
95
+ { name: 'Dana Whitfield', email: 'dana@contoso.com', role: 'Viewer', status: 'Invited', lastSeen: 'Never' },
96
+ ],
97
+ ),
98
+ ],
99
+ },
100
+ displayName: 'User management',
101
+ description: 'The people table, with roles, status and an invitation action.',
102
+ };
103
+
104
+ /** Invoice: a printable document, which is a different shape from a screen. */
105
+ export const invoiceTemplate: ScreenTemplate = {
106
+ name: 'Invoice',
107
+ fitsSlot: SlotName.Content,
108
+ slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],
109
+ content: {
110
+ [TemplateSlotName.Header]: [
111
+ pageHeader('invoice-header', 'Invoice INV-2043', 'Issued 4 March · Due 3 April', [button('invoice-print', 'Print', { severity: 'secondary', icon: 'pi pi-print' })]),
112
+ ],
113
+ [TemplateSlotName.Body]: [
114
+ card('invoice-parties', [
115
+ text('invoice-from', 'From: Contoso Ltd, 4 Chandler Street, Dublin'),
116
+ text('invoice-to', 'To: Northwind Traders, 18 Quay Road, Cork'),
117
+ ]),
118
+ table(
119
+ 'invoice-lines',
120
+ [
121
+ { field: 'description', header: 'Description' },
122
+ { field: 'quantity', header: 'Quantity' },
123
+ { field: 'unitPrice', header: 'Unit price' },
124
+ { field: 'amount', header: 'Amount' },
125
+ ],
126
+ [
127
+ { description: 'Bamboo Watch', quantity: 12, unitPrice: '$65.00', amount: '$780.00' },
128
+ { description: 'Blue Band', quantity: 4, unitPrice: '$79.00', amount: '$316.00' },
129
+ { description: 'Expedited shipping', quantity: 1, unitPrice: '$144.00', amount: '$144.00' },
130
+ ],
131
+ ),
132
+ card('invoice-total', [text('invoice-subtotal', 'Subtotal: $1,240.00'), text('invoice-vat', 'VAT (23%): $285.20'), text('invoice-due', 'Total due: $1,525.20')]),
133
+ ],
134
+ [TemplateSlotName.Actions]: [formActions('invoice-actions', 'Mark as paid', 'Send reminder')],
135
+ },
136
+ displayName: 'Invoice',
137
+ description: 'A printable document: parties, line items and totals.',
138
+ };
139
+
140
+ /** Help: the answers, and a way to ask when they are not there. */
141
+ export const helpTemplate: ScreenTemplate = {
142
+ name: 'Help',
143
+ fitsSlot: SlotName.Content,
144
+ slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.SidePanel }],
145
+ content: {
146
+ [TemplateSlotName.Header]: [pageHeader('help-header', 'Help', 'Search the answers, or ask us directly')],
147
+ [TemplateSlotName.Body]: [
148
+ externalComponent('help-search', 'inputText', { placeholder: 'Search help' }),
149
+ widget('help-popular', 'Popular answers', [
150
+ text('help-1', 'How do I invite someone to the workspace?'),
151
+ text('help-2', 'Why can I not see the sidebar on my phone?'),
152
+ text('help-3', 'How do I change the theme?'),
153
+ ]),
154
+ ],
155
+ [TemplateSlotName.SidePanel]: [
156
+ widget('help-contact', 'Still stuck?', [text('help-contact-text', 'We answer within one working day.'), button('help-contact-button', 'Contact support', { severity: 'primary' })]),
157
+ ],
158
+ },
159
+ displayName: 'Help',
160
+ description: 'Searchable answers with a route to a human.',
161
+ };
162
+
163
+ /** The five support templates. */
164
+ export const supportTemplates: ScreenTemplate[] = [documentationTemplate, profileSettingsTemplate, userManagementTemplate, invoiceTemplate, helpTemplate];
@@ -0,0 +1,63 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { SceneElement } from '@cratis/scene.model';
5
+ import { ComponentName } from '../ComponentName';
6
+ import { button, card, externalComponent, panel, text } from './elements';
7
+
8
+ /**
9
+ * The repeated pieces the gallery's screen templates are built from.
10
+ *
11
+ * The gallery only earns its place if a preview shows something that looks like an application - a
12
+ * dashboard with four stat cards over two columns of larger widgets, a list with real columns and real
13
+ * rows. Seeded content that says "Lorem ipsum" proves the renderer runs and nothing else. These builders
14
+ * are what keep twenty templates' worth of realistic content from becoming twenty pages of literals.
15
+ */
16
+
17
+ /** A screen's title, subtitle and actions - the furniture every template starts with. */
18
+ export function pageHeader(id: string, title: string, subtitle: string, actions: SceneElement[] = []): SceneElement {
19
+ return externalComponent(id, ComponentName.PageHeader, { title, subtitle }, { actions });
20
+ }
21
+
22
+ /**
23
+ * One of the four figures across the top of a dashboard - the composition Sakai's dashboard opens with,
24
+ * and the one every template in the line has copied since.
25
+ */
26
+ export function statCard(id: string, label: string, value: string, delta: string, icon: string): SceneElement {
27
+ return card(id, [text(`${id}-label`, label), text(`${id}-value`, value), text(`${id}-delta`, delta)], { icon, variant: 'stat' });
28
+ }
29
+
30
+ /** A titled surface holding a widget's content. */
31
+ export function widget(id: string, title: string, content: SceneElement[]): SceneElement {
32
+ return card(id, [text(`${id}-title`, title), ...content], { title });
33
+ }
34
+
35
+ /** A table with real columns and real rows, so a list template looks like a list. */
36
+ export function table(id: string, columns: { field: string; header: string }[], rows: Record<string, unknown>[]): SceneElement {
37
+ return externalComponent(
38
+ id,
39
+ 'dataTable',
40
+ { value: rows, dataKey: columns[0]?.field ?? 'id', paginator: rows.length > 8, rows: 8 },
41
+ { columns: columns.map(column => externalComponent(`${id}-${column.field}`, 'column', { field: column.field, header: column.header, sortable: true })) },
42
+ );
43
+ }
44
+
45
+ /** One labeled input in a form template. */
46
+ export function field(id: string, label: string, componentName: string, properties: Record<string, unknown> = {}): SceneElement {
47
+ return panel(id, [text(`${id}-label`, label), externalComponent(`${id}-input`, componentName, properties)]);
48
+ }
49
+
50
+ /** A row of buttons closing a form. */
51
+ export function formActions(id: string, confirmLabel: string, cancelLabel = 'Cancel'): SceneElement {
52
+ return panel(id, [button(`${id}-confirm`, confirmLabel, { severity: 'primary' }), button(`${id}-cancel`, cancelLabel, { severity: 'secondary' })]);
53
+ }
54
+
55
+ /** The empty state a list shows before anything exists - the designed one, never a build-time apology. */
56
+ export function emptyState(id: string, title: string, message: string, actionLabel: string): SceneElement {
57
+ return card(id, [
58
+ externalComponent(`${id}-icon`, 'image', { alt: title }),
59
+ text(`${id}-title`, title),
60
+ text(`${id}-message`, message),
61
+ button(`${id}-action`, actionLabel, { severity: 'primary' }),
62
+ ]);
63
+ }