@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,66 @@
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 { ReactNode } from 'react';
5
+ import { RegisteredComponentProps } from '@cratis/scene.react';
6
+ import { LayoutConfigProvider, isPointerRevealMode, useLayoutConfig, useOptionalLayoutConfig } from '../configuration';
7
+ import { SlotName } from '../layouts';
8
+ import { LayoutMask } from './Mask';
9
+
10
+ /**
11
+ * The application shell: the `AppShell` layout's slots, positioned.
12
+ *
13
+ * This owns the positioned boxes - the fixed topbar, the sliding sidebar panel, the pushed main column -
14
+ * while the components filling the slots own what goes inside them. Splitting it there is what lets a
15
+ * screen replace the entire menu without knowing anything about how `reveal` mode translates the panel it
16
+ * lives in.
17
+ *
18
+ * It puts a {@link LayoutConfigProvider} around itself when a host has not, because a gallery preview
19
+ * hands the renderer one `appShell` element and nothing else, and the shell still has to be able to
20
+ * switch modes.
21
+ */
22
+ export function AppShell({ element, slots }: RegisteredComponentProps) {
23
+ const surface = <AppShellSurface elementId={element.id} slots={slots} />;
24
+ return useOptionalLayoutConfig() ? surface : <LayoutConfigProvider>{surface}</LayoutConfigProvider>;
25
+ }
26
+
27
+ interface AppShellSurfaceProps {
28
+ elementId: string;
29
+ slots: Record<string, ReactNode[]>;
30
+ }
31
+
32
+ function AppShellSurface({ elementId, slots }: AppShellSurfaceProps) {
33
+ const { config, effectiveMode, wrapperClasses, setSidebarRevealed } = useLayoutConfig();
34
+ const revealsOnPointer = isPointerRevealMode(effectiveMode);
35
+ const hasSidebar = filled(slots, SlotName.Sidebar) || filled(slots, SlotName.Menu);
36
+
37
+ return (
38
+ <div className={wrapperClasses.join(' ')} data-scene-id={elementId} data-layout-mode={config.mode}>
39
+ {filled(slots, SlotName.Topbar) && <header className='layout-topbar'>{slots[SlotName.Topbar]}</header>}
40
+
41
+ {hasSidebar && (
42
+ <aside
43
+ className='layout-sidebar'
44
+ onMouseEnter={revealsOnPointer ? () => setSidebarRevealed(true) : undefined}
45
+ onMouseLeave={revealsOnPointer ? () => setSidebarRevealed(false) : undefined}>
46
+ {slots[SlotName.Sidebar]}
47
+ {slots[SlotName.Menu]}
48
+ </aside>
49
+ )}
50
+
51
+ <div className='layout-main'>
52
+ {filled(slots, SlotName.Breadcrumb) && <div className='layout-breadcrumb'>{slots[SlotName.Breadcrumb]}</div>}
53
+ <main className='layout-content'>{slots[SlotName.Content]}</main>
54
+ {filled(slots, SlotName.Footer) && <footer className='layout-footer'>{slots[SlotName.Footer]}</footer>}
55
+ </div>
56
+
57
+ {filled(slots, SlotName.RightPanel) && <aside className='layout-right-panel'>{slots[SlotName.RightPanel]}</aside>}
58
+ {slots[SlotName.ConfigPanel]}
59
+ <LayoutMask />
60
+ </div>
61
+ );
62
+ }
63
+
64
+ function filled(slots: Record<string, ReactNode[]>, name: SlotName): boolean {
65
+ return (slots[name]?.length ?? 0) > 0;
66
+ }
@@ -0,0 +1,31 @@
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 { BreadCrumb } from 'primereact/breadcrumb';
5
+ import { MenuItem as PrimeMenuItem } from 'primereact/menuitem';
6
+ import { RegisteredComponentProps } from '@cratis/scene.react';
7
+ import { readOptionalString, readRecords, recordString } from './elementProperties';
8
+
9
+ /**
10
+ * The trail above the content.
11
+ *
12
+ * PrimeReact's own `BreadCrumb` does the rendering rather than hand-written markup, because a breadcrumb
13
+ * is an ordinary component with no layout-mode behavior at all - it looks the same in every one of the
14
+ * eight modes. The shell only writes CSS where PrimeReact 10 genuinely has no answer, and this is not one
15
+ * of those places.
16
+ */
17
+ export function Breadcrumb({ element }: RegisteredComponentProps) {
18
+ const home = readOptionalString(element, 'homeTargetScreen');
19
+ const model = readRecords(element, 'items').map(
20
+ (item): PrimeMenuItem => ({
21
+ label: recordString(item, 'label'),
22
+ url: recordString(item, 'targetScreen') ? `#/${recordString(item, 'targetScreen')}` : undefined,
23
+ }),
24
+ );
25
+
26
+ return (
27
+ <div data-scene-id={element.id}>
28
+ <BreadCrumb model={model} home={home ? { icon: 'pi pi-home', url: `#/${home}` } : undefined} />
29
+ </div>
30
+ );
31
+ }
@@ -0,0 +1,105 @@
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 { useState } from 'react';
5
+ import { Button } from 'primereact/button';
6
+ import { Sidebar } from 'primereact/sidebar';
7
+ import { RegisteredComponentProps } from '@cratis/scene.react';
8
+ import { ColorScheme, MenuTheme, colorSchemes, menuThemes, useLayoutConfig } from '../configuration';
9
+ import { LayoutModeSwitcher } from './LayoutModeSwitcher';
10
+ import { ThemeSwitcher } from './ThemeSwitcher';
11
+ import { readBoolean, readString } from './elementProperties';
12
+
13
+ /** What each color scheme is called in the configurator. */
14
+ const colorSchemeLabels: Record<ColorScheme, string> = {
15
+ [ColorScheme.Light]: 'Light',
16
+ [ColorScheme.Dark]: 'Dark',
17
+ };
18
+
19
+ /** What each menu theme is called in the configurator. */
20
+ const menuThemeLabels: Record<MenuTheme, string> = {
21
+ [MenuTheme.Light]: 'Light',
22
+ [MenuTheme.Dark]: 'Dark',
23
+ [MenuTheme.Primary]: 'Primary',
24
+ };
25
+
26
+ /**
27
+ * The floating configurator.
28
+ *
29
+ * The axes are the ones the modern PrimeTek templates expose - color scheme, menu mode, menu theme and
30
+ * theme - because those are the four choices that actually change how an application feels, and a
31
+ * configurator with more knobs than that becomes a settings screen nobody finishes reading.
32
+ *
33
+ * The panel itself is PrimeReact 10's `Sidebar`, which is an overlay drawer rather than an app-shell
34
+ * sidebar - this is the one use it was designed for. (v11 renames it `Drawer` precisely to stop the
35
+ * confusion, and gives the app-shell role to a new `Sidebar`.)
36
+ */
37
+ export function ConfigPanel({ element, slots }: RegisteredComponentProps) {
38
+ const [isVisible, setIsVisible] = useState(false);
39
+ const { config, setColorScheme, setMenuTheme } = useLayoutConfig();
40
+ const title = readString(element, 'title', 'Settings');
41
+ const showsMenuTheme = readBoolean(element, 'showMenuTheme', true);
42
+ const showsMode = readBoolean(element, 'showLayoutMode', true);
43
+
44
+ return (
45
+ <>
46
+ <Button
47
+ type='button'
48
+ rounded
49
+ icon='pi pi-cog'
50
+ className='layout-config-button'
51
+ aria-label={title}
52
+ data-scene-id={element.id}
53
+ onClick={() => setIsVisible(true)}
54
+ />
55
+ <Sidebar visible={isVisible} position='right' header={title} onHide={() => setIsVisible(false)}>
56
+ <div className='layout-config-panel'>
57
+ <div>
58
+ <h3 className='layout-config-section-title'>Color scheme</h3>
59
+ <div className='layout-config-options' role='group' aria-label='Color scheme'>
60
+ {colorSchemes.map(scheme => (
61
+ <button
62
+ key={scheme}
63
+ type='button'
64
+ className='layout-config-option'
65
+ aria-pressed={config.colorScheme === scheme}
66
+ onClick={() => setColorScheme(scheme)}>
67
+ {colorSchemeLabels[scheme]}
68
+ </button>
69
+ ))}
70
+ </div>
71
+ </div>
72
+
73
+ <ThemeSwitcher
74
+ element={{ ...element, id: `${element.id}-theme`, properties: { ...element.properties, label: 'Theme' } }}
75
+ slots={{}}
76
+ />
77
+
78
+ {showsMode && (
79
+ <LayoutModeSwitcher element={{ ...element, id: `${element.id}-mode`, properties: { label: 'Menu mode' } }} slots={{}} />
80
+ )}
81
+
82
+ {showsMenuTheme && (
83
+ <div>
84
+ <h3 className='layout-config-section-title'>Menu theme</h3>
85
+ <div className='layout-config-options' role='group' aria-label='Menu theme'>
86
+ {menuThemes.map(menuTheme => (
87
+ <button
88
+ key={menuTheme}
89
+ type='button'
90
+ className='layout-config-option'
91
+ aria-pressed={config.menuTheme === menuTheme}
92
+ onClick={() => setMenuTheme(menuTheme)}>
93
+ {menuThemeLabels[menuTheme]}
94
+ </button>
95
+ ))}
96
+ </div>
97
+ </div>
98
+ )}
99
+
100
+ {slots.content}
101
+ </div>
102
+ </Sidebar>
103
+ </>
104
+ );
105
+ }
@@ -0,0 +1,23 @@
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 { RegisteredComponentProps } from '@cratis/scene.react';
5
+ import { readString } from './elementProperties';
6
+
7
+ /**
8
+ * The strip below the content.
9
+ *
10
+ * Kept as its own slot rather than folded into the content because it is application chrome, not part of
11
+ * a screen: the same footer is on every page, and a screen that had to render it would have to remember
12
+ * to.
13
+ */
14
+ export function Footer({ element, slots }: RegisteredComponentProps) {
15
+ const text = readString(element, 'text');
16
+
17
+ return (
18
+ <>
19
+ <span data-scene-id={element.id}>{text}</span>
20
+ {slots.content}
21
+ </>
22
+ );
23
+ }
@@ -0,0 +1,41 @@
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 { ReactNode } from 'react';
5
+ import { RegisteredComponentProps } from '@cratis/scene.react';
6
+ import { LayoutConfigProvider, useOptionalLayoutConfig } from '../configuration';
7
+ import { SlotName } from '../layouts';
8
+
9
+ /**
10
+ * The chrome-less shell: content, an optional branding aside, and the configurator.
11
+ *
12
+ * Login, register, password reset, verification, lock, error, access-denied, not-found and landing screens
13
+ * all render here rather than in a stripped-down application shell. That split is structural in every
14
+ * PrimeTek template, and for a good reason: those screens have no navigation state to hold, no sidebar to
15
+ * remember, and no breadcrumb to place, so hanging them off the application shell means every one of the
16
+ * eight modes has to have an answer for a page that has no menu.
17
+ *
18
+ * The configurator stays, because a sign-in page still has to honor the chosen theme - it is very often
19
+ * the first page anyone sees.
20
+ */
21
+ export function FullPageShell({ element, slots }: RegisteredComponentProps) {
22
+ const surface = <FullPageSurface elementId={element.id} slots={slots} />;
23
+ return useOptionalLayoutConfig() ? surface : <LayoutConfigProvider>{surface}</LayoutConfigProvider>;
24
+ }
25
+
26
+ interface FullPageSurfaceProps {
27
+ elementId: string;
28
+ slots: Record<string, ReactNode[]>;
29
+ }
30
+
31
+ function FullPageSurface({ elementId, slots }: FullPageSurfaceProps) {
32
+ const hasAside = (slots[SlotName.Aside]?.length ?? 0) > 0;
33
+
34
+ return (
35
+ <div className='layout-full-page' data-scene-id={elementId}>
36
+ {hasAside && <aside className='layout-full-page-aside'>{slots[SlotName.Aside]}</aside>}
37
+ <main className='layout-full-page-content'>{slots[SlotName.Content]}</main>
38
+ {slots[SlotName.ConfigPanel]}
39
+ </div>
40
+ );
41
+ }
@@ -0,0 +1,50 @@
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 { RegisteredComponentProps } from '@cratis/scene.react';
5
+ import { LayoutMode, layoutModes, useLayoutConfig } from '../configuration';
6
+ import { readString } from './elementProperties';
7
+
8
+ /** What each mode is called in the configurator - the same names the PrimeTek template line uses. */
9
+ const modeLabels: Record<LayoutMode, string> = {
10
+ [LayoutMode.Static]: 'Static',
11
+ [LayoutMode.Overlay]: 'Overlay',
12
+ [LayoutMode.Slim]: 'Slim',
13
+ [LayoutMode.SlimPlus]: 'Slim+',
14
+ [LayoutMode.Compact]: 'Compact',
15
+ [LayoutMode.Horizontal]: 'Horizontal',
16
+ [LayoutMode.Reveal]: 'Reveal',
17
+ [LayoutMode.Drawer]: 'Drawer',
18
+ };
19
+
20
+ /**
21
+ * Switches between the layout modes.
22
+ *
23
+ * Below the mobile breakpoint every button is disabled and the panel says why, rather than the picker
24
+ * disappearing. A control that vanishes reads as a bug; a disabled control with a sentence next to it
25
+ * reads as a decision - and the choice is still recorded and still there when the window grows again.
26
+ */
27
+ export function LayoutModeSwitcher({ element }: RegisteredComponentProps) {
28
+ const { config, setMode } = useLayoutConfig();
29
+ const label = readString(element, 'label', 'Menu mode');
30
+
31
+ return (
32
+ <div data-scene-id={element.id}>
33
+ <h3 className='layout-config-section-title'>{label}</h3>
34
+ <div className='layout-config-options' role='group' aria-label={label}>
35
+ {layoutModes.map(mode => (
36
+ <button
37
+ key={mode}
38
+ type='button'
39
+ className='layout-config-option'
40
+ disabled={config.isMobile}
41
+ aria-pressed={config.mode === mode}
42
+ onClick={() => setMode(mode)}>
43
+ {modeLabels[mode]}
44
+ </button>
45
+ ))}
46
+ </div>
47
+ {config.isMobile && <p className='layout-config-note'>Below 991px every mode renders off-canvas, so the choice is kept but not applied.</p>}
48
+ </div>
49
+ );
50
+ }
@@ -0,0 +1,83 @@
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 type { Meta, StoryObj } from '@storybook/react';
5
+ import { expect, userEvent, within } from 'storybook/test';
6
+ import { LayoutMode, MenuTheme } from '../configuration';
7
+ import { GalleryScreenPreview } from '../gallery';
8
+
9
+ /**
10
+ * One story per layout mode, all showing the same dashboard.
11
+ *
12
+ * Showing the *same* screen in every mode is the point: the difference between a docked sidebar, an icon
13
+ * rail, a horizontal strip and a panel that slides in on hover is entirely in the wrapper class and the
14
+ * stylesheet, and nothing about the screen changes. A story per mode is how that claim stays true.
15
+ */
16
+ const meta = {
17
+ title: 'Blueprint/Layout modes',
18
+ component: GalleryScreenPreview,
19
+ parameters: {
20
+ layout: 'fullscreen',
21
+ docs: {
22
+ description: {
23
+ component:
24
+ 'The eight menu modes, each rendering the same dashboard. Below 991px every one of them is forced off-canvas - resize the preview to see it.',
25
+ },
26
+ },
27
+ },
28
+ tags: ['autodocs'],
29
+ } satisfies Meta<typeof GalleryScreenPreview>;
30
+
31
+ export default meta;
32
+
33
+ type Story = StoryObj<typeof meta>;
34
+
35
+ function inMode(mode: LayoutMode, extra: Record<string, unknown> = {}): Story['args'] {
36
+ return { screenName: 'Dashboard', initialConfig: { mode, ...extra } };
37
+ }
38
+
39
+ /** The sidebar is docked and the content is pushed by a matching margin. */
40
+ export const Static: Story = { args: inMode(LayoutMode.Static) };
41
+
42
+ /** The sidebar is parked off-canvas; the topbar toggle floats it over the content behind the mask. */
43
+ export const Overlay: Story = { args: inMode(LayoutMode.Overlay) };
44
+
45
+ /** An icon-only rail with circular buttons; submenus pop out beside it. */
46
+ export const Slim: Story = { args: inMode(LayoutMode.Slim) };
47
+
48
+ /** The same rail, wider, with each label stacked under its icon. */
49
+ export const SlimPlus: Story = { args: inMode(LayoutMode.SlimPlus) };
50
+
51
+ /** The icon rail again, with square buttons and a topbar shifted by the rail width. */
52
+ export const Compact: Story = { args: inMode(LayoutMode.Compact) };
53
+
54
+ /** The sidebar stops being a sidebar and flows into the topbar as a row. */
55
+ export const Horizontal: Story = { args: inMode(LayoutMode.Horizontal) };
56
+
57
+ /** A full panel parked off-left behind a strip of icons - hover slides it in over the content. */
58
+ export const Reveal: Story = { args: inMode(LayoutMode.Reveal) };
59
+
60
+ /** A collapsed rail that grows its width on hover, and can be pinned open. */
61
+ export const Drawer: Story = { args: inMode(LayoutMode.Drawer) };
62
+
63
+ /** A pinned drawer, which pushes the content out to the full sidebar width instead of covering it. */
64
+ export const DrawerAnchored: Story = { args: inMode(LayoutMode.Drawer, { isSidebarAnchored: true, isSidebarRevealed: true }) };
65
+
66
+ /** A dark sidebar against a light page - the most common brand customization in the template line. */
67
+ export const DarkMenu: Story = { args: inMode(LayoutMode.Static, { menuTheme: MenuTheme.Dark }) };
68
+
69
+ /** The topbar toggle opens and closes the sidebar, and the wrapper class follows it. */
70
+ export const Interactive: Story = {
71
+ args: inMode(LayoutMode.Static),
72
+ play: async ({ canvasElement }) => {
73
+ const canvas = within(canvasElement);
74
+ const wrapper = canvasElement.querySelector('.layout-wrapper')!;
75
+ await expect(wrapper.className).not.toContain('layout-static-inactive');
76
+
77
+ await userEvent.click(canvas.getByRole('button', { name: 'Close the menu' }));
78
+ await expect(canvasElement.querySelector('.layout-wrapper')!.className).toContain('layout-static-inactive');
79
+
80
+ await userEvent.click(canvas.getByRole('button', { name: 'Open the menu' }));
81
+ await expect(canvasElement.querySelector('.layout-wrapper')!.className).not.toContain('layout-static-inactive');
82
+ },
83
+ };
package/shell/Logo.tsx ADDED
@@ -0,0 +1,30 @@
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 { RegisteredComponentProps } from '@cratis/scene.react';
5
+ import { useSceneTheme } from '@cratis/scene.react';
6
+ import { readOptionalString, readString } from './elementProperties';
7
+
8
+ /**
9
+ * The brand mark.
10
+ *
11
+ * This is the one place in the shell that reads the active theme directly rather than through a token,
12
+ * because picking between a light-background and a dark-background logo asset is a decision no CSS custom
13
+ * property can express - the two are different files. `useSceneTheme` exists for exactly this case.
14
+ */
15
+ export function Logo({ element }: RegisteredComponentProps) {
16
+ const theme = useSceneTheme();
17
+ const label = readString(element, 'label', 'Cratis');
18
+ const initials = readString(element, 'initials', label.slice(0, 1).toUpperCase());
19
+ const lightSource = readOptionalString(element, 'lightImageUrl');
20
+ const darkSource = readOptionalString(element, 'darkImageUrl');
21
+ const source = theme?.isDark ? darkSource ?? lightSource : lightSource ?? darkSource;
22
+ const targetScreen = readString(element, 'targetScreen', 'Dashboard');
23
+
24
+ return (
25
+ <a className='layout-logo' href={`#/${targetScreen}`} data-scene-id={element.id}>
26
+ {source ? <img src={source} alt={label} height={28} /> : <span className='layout-logo-mark'>{initials}</span>}
27
+ <span>{label}</span>
28
+ </a>
29
+ );
30
+ }
package/shell/Mask.tsx ADDED
@@ -0,0 +1,29 @@
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 { useLayoutConfig } from '../configuration';
5
+
6
+ /**
7
+ * The scrim behind a floating sidebar.
8
+ *
9
+ * It is a `button` rather than a `div` because its only job is to close the sidebar, and a click target
10
+ * that is not focusable or reachable from the keyboard traps anyone not using a mouse behind an open
11
+ * overlay with no way out. It renders nothing at all when no sidebar is floating, so it never sits
12
+ * invisibly over the page swallowing clicks.
13
+ */
14
+ export function LayoutMask() {
15
+ const { isMaskVisible, setSidebarOpen } = useLayoutConfig();
16
+ if (!isMaskVisible) {
17
+ return undefined;
18
+ }
19
+
20
+ return <button type='button' className='layout-mask' aria-label='Close the menu' onClick={() => setSidebarOpen(false)} />;
21
+ }
22
+
23
+ /**
24
+ * The `mask` component, for a template that wants to place the scrim itself rather than let
25
+ * {@link AppShell} do it.
26
+ */
27
+ export function Mask() {
28
+ return <LayoutMask />;
29
+ }
package/shell/Menu.tsx ADDED
@@ -0,0 +1,26 @@
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 { RegisteredComponentProps } from '@cratis/scene.react';
5
+ import { readString } from './elementProperties';
6
+
7
+ /**
8
+ * A navigation list.
9
+ *
10
+ * One markup shape - a `nav` around a `ul` of {@link MenuItem}s - serves every mode; the difference
11
+ * between a docked list, a circular icon rail, a stacked label rail and a horizontal strip with drop-down
12
+ * submenus is entirely in the stylesheet. That is the point of the mode class vocabulary: the menu does
13
+ * not know which mode it is in, so a screen's navigation cannot be written for one mode and broken in
14
+ * another.
15
+ */
16
+ export function Menu({ element, slots }: RegisteredComponentProps) {
17
+ const title = readString(element, 'title');
18
+ const label = readString(element, 'label', 'Main');
19
+
20
+ return (
21
+ <nav data-scene-id={element.id} aria-label={label}>
22
+ {title && <div className='layout-menu-section-title'>{title}</div>}
23
+ <ul className='layout-menu'>{slots.items}</ul>
24
+ </nav>
25
+ );
26
+ }
@@ -0,0 +1,39 @@
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 { RegisteredComponentProps } from '@cratis/scene.react';
5
+ import { readBoolean, readOptionalString, readString } from './elementProperties';
6
+
7
+ /**
8
+ * One entry in a navigation list, optionally with a submenu.
9
+ *
10
+ * Its properties are deliberately the {@link NavigationItem} contract - `label`, `targetScreen`,
11
+ * `routeParameterBindings`, `order`, `group` - so the very same element can be handed to the
12
+ * `Navigation` contribution point and read back by `extractNavigationItem`. A screen therefore declares
13
+ * its navigation once and gets both the sidebar entry and the aggregated navigation for free, instead of
14
+ * maintaining a menu and a contribution that drift apart.
15
+ *
16
+ * The route is rendered as a hash route against the target screen's name. A host with a real router
17
+ * renders the shell inside it and rewrites these; hashes keep the gallery navigable with no router at all,
18
+ * which is what a preview needs.
19
+ */
20
+ export function MenuItem({ element, slots }: RegisteredComponentProps) {
21
+ const label = readString(element, 'label');
22
+ const icon = readOptionalString(element, 'icon');
23
+ const badge = readOptionalString(element, 'badge');
24
+ const targetScreen = readOptionalString(element, 'targetScreen');
25
+ const isActive = readBoolean(element, 'isActive');
26
+ const hasSubmenu = (slots.items?.length ?? 0) > 0;
27
+
28
+ return (
29
+ <li className='layout-menu-item' data-scene-id={element.id} data-active={isActive} data-target-screen={targetScreen}>
30
+ <a className='layout-menu-link' href={targetScreen ? `#/${targetScreen}` : undefined} aria-current={isActive ? 'page' : undefined}>
31
+ {icon && <i className={`layout-menu-icon ${icon}`} aria-hidden='true' />}
32
+ <span className='layout-menu-label'>{label}</span>
33
+ {badge && <span className='layout-menu-badge'>{badge}</span>}
34
+ {hasSubmenu && <i className='pi pi-angle-down' aria-hidden='true' />}
35
+ </a>
36
+ {hasSubmenu && <ul className='layout-submenu'>{slots.items}</ul>}
37
+ </li>
38
+ );
39
+ }
@@ -0,0 +1,28 @@
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 { RegisteredComponentProps } from '@cratis/scene.react';
5
+ import { readString } from './elementProperties';
6
+
7
+ /**
8
+ * A screen's title, subtitle and actions.
9
+ *
10
+ * This belongs to the layout package rather than to each screen because it is the one piece of page
11
+ * furniture every page template repeats. Centralizing it means the title/actions relationship is spaced
12
+ * and aligned identically across the whole page set, which is most of what makes a template set look like
13
+ * one product rather than twenty pages.
14
+ */
15
+ export function PageHeader({ element, slots }: RegisteredComponentProps) {
16
+ const title = readString(element, 'title');
17
+ const subtitle = readString(element, 'subtitle');
18
+
19
+ return (
20
+ <div className='layout-page-header' data-scene-id={element.id}>
21
+ <div>
22
+ <h1 className='layout-page-header-title'>{title}</h1>
23
+ {subtitle && <p className='layout-page-header-subtitle'>{subtitle}</p>}
24
+ </div>
25
+ {(slots.actions?.length ?? 0) > 0 && <div className='layout-page-header-actions'>{slots.actions}</div>}
26
+ </div>
27
+ );
28
+ }
@@ -0,0 +1,23 @@
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 { RegisteredComponentProps } from '@cratis/scene.react';
5
+ import { readString } from './elementProperties';
6
+
7
+ /**
8
+ * The inspector panel down the right-hand edge.
9
+ *
10
+ * Sakai has no right panel; the premium PrimeTek templates all do, and it is where activity feeds, recent
11
+ * items and inline help live. It is exposed as a slot the shell simply does not render when nothing fills
12
+ * it, so a screen pays nothing for a region it does not use.
13
+ */
14
+ export function RightPanel({ element, slots }: RegisteredComponentProps) {
15
+ const title = readString(element, 'title');
16
+
17
+ return (
18
+ <section data-scene-id={element.id} aria-label={title || 'Panel'}>
19
+ {title && <h2 className='layout-page-header-title'>{title}</h2>}
20
+ {slots.content}
21
+ </section>
22
+ );
23
+ }
@@ -0,0 +1,45 @@
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 { Button } from 'primereact/button';
5
+ import { RegisteredComponentProps } from '@cratis/scene.react';
6
+ import { isPointerRevealMode, useLayoutConfig } from '../configuration';
7
+ import { readString } from './elementProperties';
8
+
9
+ /**
10
+ * The sidebar's own chrome, inside the panel {@link AppShell} positions.
11
+ *
12
+ * The panel and its contents are deliberately different components. Everything about *where* the sidebar
13
+ * is - translated off-canvas, collapsed to a rail, growing on hover - belongs to the mode and therefore to
14
+ * the shell; everything about *what is in it* belongs to the screen. A template can replace this header
15
+ * wholesale without any of the mode CSS noticing.
16
+ *
17
+ * The pin button only appears in `reveal` and `drawer`, the two modes where the sidebar answers to the
18
+ * pointer and therefore needs a way to be made to stay.
19
+ */
20
+ export function Sidebar({ element, slots }: RegisteredComponentProps) {
21
+ const { effectiveMode, config, toggleSidebarAnchor } = useLayoutConfig();
22
+ const title = readString(element, 'title');
23
+ const isPinnable = isPointerRevealMode(effectiveMode);
24
+
25
+ return (
26
+ <>
27
+ <div className='layout-sidebar-header' data-scene-id={element.id}>
28
+ {slots.logo}
29
+ {title && <span className='layout-sidebar-title'>{title}</span>}
30
+ {isPinnable && (
31
+ <Button
32
+ type='button'
33
+ text
34
+ rounded
35
+ icon={config.isSidebarAnchored ? 'pi pi-lock' : 'pi pi-lock-open'}
36
+ aria-label={config.isSidebarAnchored ? 'Unpin the menu' : 'Pin the menu open'}
37
+ aria-pressed={config.isSidebarAnchored}
38
+ onClick={toggleSidebarAnchor}
39
+ />
40
+ )}
41
+ </div>
42
+ {slots.content}
43
+ </>
44
+ );
45
+ }