@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 @@
1
+ {"version":3,"file":"fullPage.js","sources":["../../../layouts/fullPage.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { FlowArrangement, Layout, WidthSizeClass } from '@cratis/scene.model';\nimport { LayoutName } from './LayoutName';\nimport { SlotName } from './SlotName';\nimport { column, row, slotLeaf } from './flowBuilders';\n\n/**\n * The tree at a regular width: the branding aside beside the content, with the configurator over both.\n *\n * The split is the shape every premium PrimeTek sign-in page uses - a colored branding half and a form\n * half - and it is the reason `aside` is a slot rather than something a screen paints inside `content`.\n */\nexport const fullPageRegularRoot = column([row([slotLeaf(SlotName.Aside), slotLeaf(SlotName.Content, { grow: 1 })], 0, { grow: 1 }), slotLeaf(SlotName.ConfigPanel)]);\n\n/**\n * The tree at a compact width: the branding aside leaves the flow.\n *\n * On a phone the aside would take 40% of the width from the only thing that matters on a sign-in screen,\n * which is the form. It drops out rather than stacking above it, because a sign-in form pushed below the\n * fold by decoration is the worst possible first screen.\n */\nexport const fullPageCompactWidthRoot = column([slotLeaf(SlotName.Content, { grow: 1 }), slotLeaf(SlotName.ConfigPanel)]);\n\n/** The arrangement of the {@link fullPageLayout}'s own slots. */\nexport const fullPageArrangement: FlowArrangement = {\n root: fullPageRegularRoot,\n overrides: [{ width: WidthSizeClass.Compact, root: fullPageCompactWidthRoot }],\n};\n\n/**\n * The chrome-less layout.\n *\n * Sign-in, register, forgotten password, verification, lock, error, access-denied, not-found and landing\n * screens all use this rather than a stripped-down application shell, and that split is structural in\n * every PrimeTek template for a reason worth repeating: none of those screens has navigation state, a\n * sidebar to remember or a breadcrumb to place, so hanging them off the application shell would mean every\n * one of the eight modes needs an answer for a page with no menu.\n *\n * The configurator stays, because the sign-in page is very often the first page anyone sees and it still\n * has to honor the chosen theme.\n */\nexport const fullPageLayout: Layout = {\n name: LayoutName.FullPage,\n slots: [{ name: SlotName.Aside }, { name: SlotName.Content }, { name: SlotName.ConfigPanel }],\n arrangement: fullPageArrangement,\n};\n"],"names":["fullPageRegularRoot","column","row","slotLeaf","SlotName","Aside","Content","grow","ConfigPanel","fullPageCompactWidthRoot","fullPageArrangement","root","overrides","width","WidthSizeClass","Compact","fullPageLayout","name","LayoutName","FullPage","slots","arrangement"],"mappings":";;;;;;;AAAA;AACA;AAOA;;;;;IAMO,MAAMA,mBAAAA,GAAsBC,mBAAAA,CAAO;IAACC,gBAAAA,CAAI;AAACC,QAAAA,qBAAAA,CAASC,kBAASC,KAAK,CAAA;QAAGF,qBAAAA,CAASC,iBAAAA,CAASE,OAAO,EAAE;YAAEC,IAAAA,EAAM;AAAE,SAAA;AAAG,KAAA,EAAE,CAAA,EAAG;QAAEA,IAAAA,EAAM;AAAE,KAAA,CAAA;AAAIJ,IAAAA,qBAAAA,CAASC,kBAASI,WAAW;CAAE;AAEpK;;;;;;IAOO,MAAMC,wBAAAA,GAA2BR,mBAAAA,CAAO;IAACE,qBAAAA,CAASC,iBAAAA,CAASE,OAAO,EAAE;QAAEC,IAAAA,EAAM;AAAE,KAAA,CAAA;AAAIJ,IAAAA,qBAAAA,CAASC,kBAASI,WAAW;CAAE;AAExH,kEACO,MAAME,mBAAAA,GAAuC;IAChDC,IAAAA,EAAMX,mBAAAA;IACNY,SAAAA,EAAW;AAAC,QAAA;AAAEC,YAAAA,KAAAA,EAAOC,2BAAeC,OAAO;YAAEJ,IAAAA,EAAMF;AAAyB;AAAE;AAClF;AAEA;;;;;;;;;;;UAYaO,cAAAA,GAAyB;AAClCC,IAAAA,IAAAA,EAAMC,sBAAWC,QAAQ;IACzBC,KAAAA,EAAO;AAAC,QAAA;AAAEH,YAAAA,IAAAA,EAAMb,kBAASC;AAAM,SAAA;AAAG,QAAA;AAAEY,YAAAA,IAAAA,EAAMb,kBAASE;AAAQ,SAAA;AAAG,QAAA;AAAEW,YAAAA,IAAAA,EAAMb,kBAASI;AAAY;AAAE,KAAA;IAC7Fa,WAAAA,EAAaX;AACjB;;;;;;;"}
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ var ComponentName = require('../ComponentName.js');
4
+ var LayoutName = require('./LayoutName.js');
5
+
6
+ // Copyright (c) Cratis. All rights reserved.
7
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
8
+ /**
9
+ * Which component renders which layout.
10
+ *
11
+ * A {@link Layout} is data - named slots and an arrangement - and says nothing about how it is drawn. This
12
+ * is the one place that pairing lives, so a host holding a screen and its layout name can find the shell
13
+ * to render it in without hardcoding the answer, and a spec can prove every layout the blueprint declares
14
+ * actually has one.
15
+ */ const shellComponents = {
16
+ [LayoutName.LayoutName.AppShell]: ComponentName.ComponentName.AppShell,
17
+ [LayoutName.LayoutName.FullPage]: ComponentName.ComponentName.FullPageShell
18
+ };
19
+ /**
20
+ * The component that renders a layout.
21
+ *
22
+ * @param layoutName The layout's name.
23
+ * @returns The bare component name, or `undefined` when the layout is not one of this blueprint's.
24
+ */ function shellComponentForLayout(layoutName) {
25
+ return shellComponents[layoutName];
26
+ }
27
+
28
+ exports.shellComponentForLayout = shellComponentForLayout;
29
+ //# sourceMappingURL=shellComponents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shellComponents.js","sources":["../../../layouts/shellComponents.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ComponentName } from '../ComponentName';\nimport { LayoutName } from './LayoutName';\n\n/**\n * Which component renders which layout.\n *\n * A {@link Layout} is data - named slots and an arrangement - and says nothing about how it is drawn. This\n * is the one place that pairing lives, so a host holding a screen and its layout name can find the shell\n * to render it in without hardcoding the answer, and a spec can prove every layout the blueprint declares\n * actually has one.\n */\nconst shellComponents: Record<LayoutName, ComponentName> = {\n [LayoutName.AppShell]: ComponentName.AppShell,\n [LayoutName.FullPage]: ComponentName.FullPageShell,\n};\n\n/**\n * The component that renders a layout.\n *\n * @param layoutName The layout's name.\n * @returns The bare component name, or `undefined` when the layout is not one of this blueprint's.\n */\nexport function shellComponentForLayout(layoutName: string): ComponentName | undefined {\n return shellComponents[layoutName as LayoutName];\n}\n"],"names":["shellComponents","LayoutName","AppShell","ComponentName","FullPage","FullPageShell","shellComponentForLayout","layoutName"],"mappings":";;;;;AAAA;AACA;AAKA;;;;;;;AAOC,IACD,MAAMA,eAAAA,GAAqD;AACvD,IAAA,CAACC,qBAAAA,CAAWC,QAAQ,GAAGC,4BAAcD,QAAQ;AAC7C,IAAA,CAACD,qBAAAA,CAAWG,QAAQ,GAAGD,4BAAcE;AACzC,CAAA;AAEA;;;;;IAMO,SAASC,uBAAAA,CAAwBC,UAAkB,EAAA;IACtD,OAAOP,eAAe,CAACO,UAAAA,CAAyB;AACpD;;;;"}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ // Copyright (c) Cratis. All rights reserved.
4
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
5
+ /**
6
+ * The name this blueprint is known by inside a `ui profile`.
7
+ *
8
+ * It is not the npm package name: a profile lists Scene package names, a theme declares compatibility
9
+ * with them, and `componentRegistryKey` builds every registry key from this. It therefore lives on its own
10
+ * rather than inside the manifest, so the registry can key off it without importing the manifest that
11
+ * describes the registry.
12
+ */ const defaultBlueprintName = 'Cratis.Blueprint.Default';
13
+
14
+ exports.defaultBlueprintName = defaultBlueprintName;
15
+ //# sourceMappingURL=packageName.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageName.js","sources":["../../packageName.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * The name this blueprint is known by inside a `ui profile`.\n *\n * It is not the npm package name: a profile lists Scene package names, a theme declares compatibility\n * with them, and `componentRegistryKey` builds every registry key from this. It therefore lives on its own\n * rather than inside the manifest, so the registry can key off it without importing the manifest that\n * describes the registry.\n */\nexport const defaultBlueprintName = 'Cratis.Blueprint.Default';\n"],"names":["defaultBlueprintName"],"mappings":";;AAAA;AACA;AAEA;;;;;;;IAQO,MAAMA,oBAAAA,GAAuB;;;;"}
@@ -0,0 +1,88 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var layoutConfigTransitions = require('../configuration/layoutConfigTransitions.js');
5
+ var LayoutConfigProvider = require('../configuration/LayoutConfigProvider.js');
6
+ var SlotName = require('../layouts/SlotName.js');
7
+ require('@cratis/scene.model');
8
+ require('../layouts/shellComponents.js');
9
+ require('../layouts/appShell.js');
10
+ require('../layouts/fullPage.js');
11
+ var Mask = require('./Mask.js');
12
+
13
+ // Copyright (c) Cratis. All rights reserved.
14
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
15
+ /**
16
+ * The application shell: the `AppShell` layout's slots, positioned.
17
+ *
18
+ * This owns the positioned boxes - the fixed topbar, the sliding sidebar panel, the pushed main column -
19
+ * while the components filling the slots own what goes inside them. Splitting it there is what lets a
20
+ * screen replace the entire menu without knowing anything about how `reveal` mode translates the panel it
21
+ * lives in.
22
+ *
23
+ * It puts a {@link LayoutConfigProvider} around itself when a host has not, because a gallery preview
24
+ * hands the renderer one `appShell` element and nothing else, and the shell still has to be able to
25
+ * switch modes.
26
+ */ function AppShell({ element, slots }) {
27
+ const surface = /*#__PURE__*/ jsxRuntime.jsx(AppShellSurface, {
28
+ elementId: element.id,
29
+ slots: slots
30
+ });
31
+ return LayoutConfigProvider.useOptionalLayoutConfig() ? surface : /*#__PURE__*/ jsxRuntime.jsx(LayoutConfigProvider.LayoutConfigProvider, {
32
+ children: surface
33
+ });
34
+ }
35
+ function AppShellSurface({ elementId, slots }) {
36
+ const { config, effectiveMode, wrapperClasses, setSidebarRevealed } = LayoutConfigProvider.useLayoutConfig();
37
+ const revealsOnPointer = layoutConfigTransitions.isPointerRevealMode(effectiveMode);
38
+ const hasSidebar = filled(slots, SlotName.SlotName.Sidebar) || filled(slots, SlotName.SlotName.Menu);
39
+ return /*#__PURE__*/ jsxRuntime.jsxs("div", {
40
+ className: wrapperClasses.join(' '),
41
+ "data-scene-id": elementId,
42
+ "data-layout-mode": config.mode,
43
+ children: [
44
+ filled(slots, SlotName.SlotName.Topbar) && /*#__PURE__*/ jsxRuntime.jsx("header", {
45
+ className: "layout-topbar",
46
+ children: slots[SlotName.SlotName.Topbar]
47
+ }),
48
+ hasSidebar && /*#__PURE__*/ jsxRuntime.jsxs("aside", {
49
+ className: "layout-sidebar",
50
+ onMouseEnter: revealsOnPointer ? ()=>setSidebarRevealed(true) : undefined,
51
+ onMouseLeave: revealsOnPointer ? ()=>setSidebarRevealed(false) : undefined,
52
+ children: [
53
+ slots[SlotName.SlotName.Sidebar],
54
+ slots[SlotName.SlotName.Menu]
55
+ ]
56
+ }),
57
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
58
+ className: "layout-main",
59
+ children: [
60
+ filled(slots, SlotName.SlotName.Breadcrumb) && /*#__PURE__*/ jsxRuntime.jsx("div", {
61
+ className: "layout-breadcrumb",
62
+ children: slots[SlotName.SlotName.Breadcrumb]
63
+ }),
64
+ /*#__PURE__*/ jsxRuntime.jsx("main", {
65
+ className: "layout-content",
66
+ children: slots[SlotName.SlotName.Content]
67
+ }),
68
+ filled(slots, SlotName.SlotName.Footer) && /*#__PURE__*/ jsxRuntime.jsx("footer", {
69
+ className: "layout-footer",
70
+ children: slots[SlotName.SlotName.Footer]
71
+ })
72
+ ]
73
+ }),
74
+ filled(slots, SlotName.SlotName.RightPanel) && /*#__PURE__*/ jsxRuntime.jsx("aside", {
75
+ className: "layout-right-panel",
76
+ children: slots[SlotName.SlotName.RightPanel]
77
+ }),
78
+ slots[SlotName.SlotName.ConfigPanel],
79
+ /*#__PURE__*/ jsxRuntime.jsx(Mask.LayoutMask, {})
80
+ ]
81
+ });
82
+ }
83
+ function filled(slots, name) {
84
+ return (slots[name]?.length ?? 0) > 0;
85
+ }
86
+
87
+ exports.AppShell = AppShell;
88
+ //# sourceMappingURL=AppShell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppShell.js","sources":["../../../shell/AppShell.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ReactNode } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { LayoutConfigProvider, isPointerRevealMode, useLayoutConfig, useOptionalLayoutConfig } from '../configuration';\nimport { SlotName } from '../layouts';\nimport { LayoutMask } from './Mask';\n\n/**\n * The application shell: the `AppShell` layout's slots, positioned.\n *\n * This owns the positioned boxes - the fixed topbar, the sliding sidebar panel, the pushed main column -\n * while the components filling the slots own what goes inside them. Splitting it there is what lets a\n * screen replace the entire menu without knowing anything about how `reveal` mode translates the panel it\n * lives in.\n *\n * It puts a {@link LayoutConfigProvider} around itself when a host has not, because a gallery preview\n * hands the renderer one `appShell` element and nothing else, and the shell still has to be able to\n * switch modes.\n */\nexport function AppShell({ element, slots }: RegisteredComponentProps) {\n const surface = <AppShellSurface elementId={element.id} slots={slots} />;\n return useOptionalLayoutConfig() ? surface : <LayoutConfigProvider>{surface}</LayoutConfigProvider>;\n}\n\ninterface AppShellSurfaceProps {\n elementId: string;\n slots: Record<string, ReactNode[]>;\n}\n\nfunction AppShellSurface({ elementId, slots }: AppShellSurfaceProps) {\n const { config, effectiveMode, wrapperClasses, setSidebarRevealed } = useLayoutConfig();\n const revealsOnPointer = isPointerRevealMode(effectiveMode);\n const hasSidebar = filled(slots, SlotName.Sidebar) || filled(slots, SlotName.Menu);\n\n return (\n <div className={wrapperClasses.join(' ')} data-scene-id={elementId} data-layout-mode={config.mode}>\n {filled(slots, SlotName.Topbar) && <header className='layout-topbar'>{slots[SlotName.Topbar]}</header>}\n\n {hasSidebar && (\n <aside\n className='layout-sidebar'\n onMouseEnter={revealsOnPointer ? () => setSidebarRevealed(true) : undefined}\n onMouseLeave={revealsOnPointer ? () => setSidebarRevealed(false) : undefined}>\n {slots[SlotName.Sidebar]}\n {slots[SlotName.Menu]}\n </aside>\n )}\n\n <div className='layout-main'>\n {filled(slots, SlotName.Breadcrumb) && <div className='layout-breadcrumb'>{slots[SlotName.Breadcrumb]}</div>}\n <main className='layout-content'>{slots[SlotName.Content]}</main>\n {filled(slots, SlotName.Footer) && <footer className='layout-footer'>{slots[SlotName.Footer]}</footer>}\n </div>\n\n {filled(slots, SlotName.RightPanel) && <aside className='layout-right-panel'>{slots[SlotName.RightPanel]}</aside>}\n {slots[SlotName.ConfigPanel]}\n <LayoutMask />\n </div>\n );\n}\n\nfunction filled(slots: Record<string, ReactNode[]>, name: SlotName): boolean {\n return (slots[name]?.length ?? 0) > 0;\n}\n"],"names":["AppShell","element","slots","surface","_jsx","AppShellSurface","elementId","id","useOptionalLayoutConfig","LayoutConfigProvider","config","effectiveMode","wrapperClasses","setSidebarRevealed","useLayoutConfig","revealsOnPointer","isPointerRevealMode","hasSidebar","filled","SlotName","Sidebar","Menu","_jsxs","div","className","join","data-scene-id","data-layout-mode","mode","Topbar","header","aside","onMouseEnter","undefined","onMouseLeave","Breadcrumb","main","Content","Footer","footer","RightPanel","ConfigPanel","LayoutMask","name","length"],"mappings":"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"}
@@ -0,0 +1,33 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var breadcrumb = require('primereact/breadcrumb');
5
+ var elementProperties = require('./elementProperties.js');
6
+
7
+ /**
8
+ * The trail above the content.
9
+ *
10
+ * PrimeReact's own `BreadCrumb` does the rendering rather than hand-written markup, because a breadcrumb
11
+ * is an ordinary component with no layout-mode behavior at all - it looks the same in every one of the
12
+ * eight modes. The shell only writes CSS where PrimeReact 10 genuinely has no answer, and this is not one
13
+ * of those places.
14
+ */ function Breadcrumb({ element }) {
15
+ const home = elementProperties.readOptionalString(element, 'homeTargetScreen');
16
+ const model = elementProperties.readRecords(element, 'items').map((item)=>({
17
+ label: elementProperties.recordString(item, 'label'),
18
+ url: elementProperties.recordString(item, 'targetScreen') ? `#/${elementProperties.recordString(item, 'targetScreen')}` : undefined
19
+ }));
20
+ return /*#__PURE__*/ jsxRuntime.jsx("div", {
21
+ "data-scene-id": element.id,
22
+ children: /*#__PURE__*/ jsxRuntime.jsx(breadcrumb.BreadCrumb, {
23
+ model: model,
24
+ home: home ? {
25
+ icon: 'pi pi-home',
26
+ url: `#/${home}`
27
+ } : undefined
28
+ })
29
+ });
30
+ }
31
+
32
+ exports.Breadcrumb = Breadcrumb;
33
+ //# sourceMappingURL=Breadcrumb.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Breadcrumb.js","sources":["../../../shell/Breadcrumb.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { BreadCrumb } from 'primereact/breadcrumb';\nimport { MenuItem as PrimeMenuItem } from 'primereact/menuitem';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { readOptionalString, readRecords, recordString } from './elementProperties';\n\n/**\n * The trail above the content.\n *\n * PrimeReact's own `BreadCrumb` does the rendering rather than hand-written markup, because a breadcrumb\n * is an ordinary component with no layout-mode behavior at all - it looks the same in every one of the\n * eight modes. The shell only writes CSS where PrimeReact 10 genuinely has no answer, and this is not one\n * of those places.\n */\nexport function Breadcrumb({ element }: RegisteredComponentProps) {\n const home = readOptionalString(element, 'homeTargetScreen');\n const model = readRecords(element, 'items').map(\n (item): PrimeMenuItem => ({\n label: recordString(item, 'label'),\n url: recordString(item, 'targetScreen') ? `#/${recordString(item, 'targetScreen')}` : undefined,\n }),\n );\n\n return (\n <div data-scene-id={element.id}>\n <BreadCrumb model={model} home={home ? { icon: 'pi pi-home', url: `#/${home}` } : undefined} />\n </div>\n );\n}\n"],"names":["Breadcrumb","element","home","readOptionalString","model","readRecords","map","item","label","recordString","url","undefined","_jsx","div","data-scene-id","id","BreadCrumb","icon"],"mappings":";;;;;;AAQA;;;;;;;AAOC,IACM,SAASA,UAAAA,CAAW,EAAEC,OAAO,EAA4B,EAAA;IAC5D,MAAMC,IAAAA,GAAOC,qCAAmBF,OAAAA,EAAS,kBAAA,CAAA;IACzC,MAAMG,KAAAA,GAAQC,8BAAYJ,OAAAA,EAAS,OAAA,CAAA,CAASK,GAAG,CAC3C,CAACC,QAAyB;AACtBC,YAAAA,KAAAA,EAAOC,+BAAaF,IAAAA,EAAM,OAAA,CAAA;YAC1BG,GAAAA,EAAKD,8BAAAA,CAAaF,MAAM,cAAA,CAAA,GAAkB,CAAC,EAAE,EAAEE,8BAAAA,CAAaF,IAAAA,EAAM,cAAA,CAAA,CAAA,CAAiB,GAAGI;SAC1F,CAAA,CAAA;AAGJ,IAAA,qBACIC,cAAA,CAACC,KAAAA,EAAAA;AAAIC,QAAAA,eAAAA,EAAeb,QAAQc,EAAE;AAC1B,QAAA,QAAA,gBAAAH,cAAA,CAACI,qBAAAA,EAAAA;YAAWZ,KAAAA,EAAOA,KAAAA;AAAOF,YAAAA,IAAAA,EAAMA,IAAAA,GAAO;gBAAEe,IAAAA,EAAM,YAAA;gBAAcP,GAAAA,EAAK,CAAC,EAAE,EAAER,IAAAA,CAAAA;aAAO,GAAIS;;;AAG9F;;;;"}
@@ -0,0 +1,128 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var react = require('react');
5
+ var button = require('primereact/button');
6
+ var sidebar = require('primereact/sidebar');
7
+ var ColorScheme = require('../configuration/ColorScheme.js');
8
+ var MenuTheme = require('../configuration/MenuTheme.js');
9
+ var LayoutConfigProvider = require('../configuration/LayoutConfigProvider.js');
10
+ var LayoutModeSwitcher = require('./LayoutModeSwitcher.js');
11
+ var ThemeSwitcher = require('./ThemeSwitcher.js');
12
+ var elementProperties = require('./elementProperties.js');
13
+
14
+ /** What each color scheme is called in the configurator. */ const colorSchemeLabels = {
15
+ [ColorScheme.ColorScheme.Light]: 'Light',
16
+ [ColorScheme.ColorScheme.Dark]: 'Dark'
17
+ };
18
+ /** What each menu theme is called in the configurator. */ const menuThemeLabels = {
19
+ [MenuTheme.MenuTheme.Light]: 'Light',
20
+ [MenuTheme.MenuTheme.Dark]: 'Dark',
21
+ [MenuTheme.MenuTheme.Primary]: 'Primary'
22
+ };
23
+ /**
24
+ * The floating configurator.
25
+ *
26
+ * The axes are the ones the modern PrimeTek templates expose - color scheme, menu mode, menu theme and
27
+ * theme - because those are the four choices that actually change how an application feels, and a
28
+ * configurator with more knobs than that becomes a settings screen nobody finishes reading.
29
+ *
30
+ * The panel itself is PrimeReact 10's `Sidebar`, which is an overlay drawer rather than an app-shell
31
+ * sidebar - this is the one use it was designed for. (v11 renames it `Drawer` precisely to stop the
32
+ * confusion, and gives the app-shell role to a new `Sidebar`.)
33
+ */ function ConfigPanel({ element, slots }) {
34
+ const [isVisible, setIsVisible] = react.useState(false);
35
+ const { config, setColorScheme, setMenuTheme } = LayoutConfigProvider.useLayoutConfig();
36
+ const title = elementProperties.readString(element, 'title', 'Settings');
37
+ const showsMenuTheme = elementProperties.readBoolean(element, 'showMenuTheme', true);
38
+ const showsMode = elementProperties.readBoolean(element, 'showLayoutMode', true);
39
+ return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
40
+ children: [
41
+ /*#__PURE__*/ jsxRuntime.jsx(button.Button, {
42
+ type: "button",
43
+ rounded: true,
44
+ icon: "pi pi-cog",
45
+ className: "layout-config-button",
46
+ "aria-label": title,
47
+ "data-scene-id": element.id,
48
+ onClick: ()=>setIsVisible(true)
49
+ }),
50
+ /*#__PURE__*/ jsxRuntime.jsx(sidebar.Sidebar, {
51
+ visible: isVisible,
52
+ position: "right",
53
+ header: title,
54
+ onHide: ()=>setIsVisible(false),
55
+ children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
56
+ className: "layout-config-panel",
57
+ children: [
58
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
59
+ children: [
60
+ /*#__PURE__*/ jsxRuntime.jsx("h3", {
61
+ className: "layout-config-section-title",
62
+ children: "Color scheme"
63
+ }),
64
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
65
+ className: "layout-config-options",
66
+ role: "group",
67
+ "aria-label": "Color scheme",
68
+ children: ColorScheme.colorSchemes.map((scheme)=>/*#__PURE__*/ jsxRuntime.jsx("button", {
69
+ type: "button",
70
+ className: "layout-config-option",
71
+ "aria-pressed": config.colorScheme === scheme,
72
+ onClick: ()=>setColorScheme(scheme),
73
+ children: colorSchemeLabels[scheme]
74
+ }, scheme))
75
+ })
76
+ ]
77
+ }),
78
+ /*#__PURE__*/ jsxRuntime.jsx(ThemeSwitcher.ThemeSwitcher, {
79
+ element: {
80
+ ...element,
81
+ id: `${element.id}-theme`,
82
+ properties: {
83
+ ...element.properties,
84
+ label: 'Theme'
85
+ }
86
+ },
87
+ slots: {}
88
+ }),
89
+ showsMode && /*#__PURE__*/ jsxRuntime.jsx(LayoutModeSwitcher.LayoutModeSwitcher, {
90
+ element: {
91
+ ...element,
92
+ id: `${element.id}-mode`,
93
+ properties: {
94
+ label: 'Menu mode'
95
+ }
96
+ },
97
+ slots: {}
98
+ }),
99
+ showsMenuTheme && /*#__PURE__*/ jsxRuntime.jsxs("div", {
100
+ children: [
101
+ /*#__PURE__*/ jsxRuntime.jsx("h3", {
102
+ className: "layout-config-section-title",
103
+ children: "Menu theme"
104
+ }),
105
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
106
+ className: "layout-config-options",
107
+ role: "group",
108
+ "aria-label": "Menu theme",
109
+ children: MenuTheme.menuThemes.map((menuTheme)=>/*#__PURE__*/ jsxRuntime.jsx("button", {
110
+ type: "button",
111
+ className: "layout-config-option",
112
+ "aria-pressed": config.menuTheme === menuTheme,
113
+ onClick: ()=>setMenuTheme(menuTheme),
114
+ children: menuThemeLabels[menuTheme]
115
+ }, menuTheme))
116
+ })
117
+ ]
118
+ }),
119
+ slots.content
120
+ ]
121
+ })
122
+ })
123
+ ]
124
+ });
125
+ }
126
+
127
+ exports.ConfigPanel = ConfigPanel;
128
+ //# sourceMappingURL=ConfigPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigPanel.js","sources":["../../../shell/ConfigPanel.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useState } from 'react';\nimport { Button } from 'primereact/button';\nimport { Sidebar } from 'primereact/sidebar';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { ColorScheme, MenuTheme, colorSchemes, menuThemes, useLayoutConfig } from '../configuration';\nimport { LayoutModeSwitcher } from './LayoutModeSwitcher';\nimport { ThemeSwitcher } from './ThemeSwitcher';\nimport { readBoolean, readString } from './elementProperties';\n\n/** What each color scheme is called in the configurator. */\nconst colorSchemeLabels: Record<ColorScheme, string> = {\n [ColorScheme.Light]: 'Light',\n [ColorScheme.Dark]: 'Dark',\n};\n\n/** What each menu theme is called in the configurator. */\nconst menuThemeLabels: Record<MenuTheme, string> = {\n [MenuTheme.Light]: 'Light',\n [MenuTheme.Dark]: 'Dark',\n [MenuTheme.Primary]: 'Primary',\n};\n\n/**\n * The floating configurator.\n *\n * The axes are the ones the modern PrimeTek templates expose - color scheme, menu mode, menu theme and\n * theme - because those are the four choices that actually change how an application feels, and a\n * configurator with more knobs than that becomes a settings screen nobody finishes reading.\n *\n * The panel itself is PrimeReact 10's `Sidebar`, which is an overlay drawer rather than an app-shell\n * sidebar - this is the one use it was designed for. (v11 renames it `Drawer` precisely to stop the\n * confusion, and gives the app-shell role to a new `Sidebar`.)\n */\nexport function ConfigPanel({ element, slots }: RegisteredComponentProps) {\n const [isVisible, setIsVisible] = useState(false);\n const { config, setColorScheme, setMenuTheme } = useLayoutConfig();\n const title = readString(element, 'title', 'Settings');\n const showsMenuTheme = readBoolean(element, 'showMenuTheme', true);\n const showsMode = readBoolean(element, 'showLayoutMode', true);\n\n return (\n <>\n <Button\n type='button'\n rounded\n icon='pi pi-cog'\n className='layout-config-button'\n aria-label={title}\n data-scene-id={element.id}\n onClick={() => setIsVisible(true)}\n />\n <Sidebar visible={isVisible} position='right' header={title} onHide={() => setIsVisible(false)}>\n <div className='layout-config-panel'>\n <div>\n <h3 className='layout-config-section-title'>Color scheme</h3>\n <div className='layout-config-options' role='group' aria-label='Color scheme'>\n {colorSchemes.map(scheme => (\n <button\n key={scheme}\n type='button'\n className='layout-config-option'\n aria-pressed={config.colorScheme === scheme}\n onClick={() => setColorScheme(scheme)}>\n {colorSchemeLabels[scheme]}\n </button>\n ))}\n </div>\n </div>\n\n <ThemeSwitcher\n element={{ ...element, id: `${element.id}-theme`, properties: { ...element.properties, label: 'Theme' } }}\n slots={{}}\n />\n\n {showsMode && (\n <LayoutModeSwitcher element={{ ...element, id: `${element.id}-mode`, properties: { label: 'Menu mode' } }} slots={{}} />\n )}\n\n {showsMenuTheme && (\n <div>\n <h3 className='layout-config-section-title'>Menu theme</h3>\n <div className='layout-config-options' role='group' aria-label='Menu theme'>\n {menuThemes.map(menuTheme => (\n <button\n key={menuTheme}\n type='button'\n className='layout-config-option'\n aria-pressed={config.menuTheme === menuTheme}\n onClick={() => setMenuTheme(menuTheme)}>\n {menuThemeLabels[menuTheme]}\n </button>\n ))}\n </div>\n </div>\n )}\n\n {slots.content}\n </div>\n </Sidebar>\n </>\n );\n}\n"],"names":["colorSchemeLabels","ColorScheme","Light","Dark","menuThemeLabels","MenuTheme","Primary","ConfigPanel","element","slots","isVisible","setIsVisible","useState","config","setColorScheme","setMenuTheme","useLayoutConfig","title","readString","showsMenuTheme","readBoolean","showsMode","_jsxs","_Fragment","_jsx","Button","type","rounded","icon","className","aria-label","data-scene-id","id","onClick","Sidebar","visible","position","header","onHide","div","h3","role","colorSchemes","map","scheme","button","aria-pressed","colorScheme","ThemeSwitcher","properties","label","LayoutModeSwitcher","menuThemes","menuTheme","content"],"mappings":"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"}
@@ -0,0 +1,28 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var elementProperties = require('./elementProperties.js');
5
+
6
+ // Copyright (c) Cratis. All rights reserved.
7
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
8
+ /**
9
+ * The strip below the content.
10
+ *
11
+ * Kept as its own slot rather than folded into the content because it is application chrome, not part of
12
+ * a screen: the same footer is on every page, and a screen that had to render it would have to remember
13
+ * to.
14
+ */ function Footer({ element, slots }) {
15
+ const text = elementProperties.readString(element, 'text');
16
+ return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
17
+ children: [
18
+ /*#__PURE__*/ jsxRuntime.jsx("span", {
19
+ "data-scene-id": element.id,
20
+ children: text
21
+ }),
22
+ slots.content
23
+ ]
24
+ });
25
+ }
26
+
27
+ exports.Footer = Footer;
28
+ //# sourceMappingURL=Footer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Footer.js","sources":["../../../shell/Footer.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { readString } from './elementProperties';\n\n/**\n * The strip below the content.\n *\n * Kept as its own slot rather than folded into the content because it is application chrome, not part of\n * a screen: the same footer is on every page, and a screen that had to render it would have to remember\n * to.\n */\nexport function Footer({ element, slots }: RegisteredComponentProps) {\n const text = readString(element, 'text');\n\n return (\n <>\n <span data-scene-id={element.id}>{text}</span>\n {slots.content}\n </>\n );\n}\n"],"names":["Footer","element","slots","text","readString","_jsxs","_Fragment","_jsx","span","data-scene-id","id","content"],"mappings":";;;;;AAAA;AACA;AAKA;;;;;;AAMC,IACM,SAASA,MAAAA,CAAO,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;IAC/D,MAAMC,IAAAA,GAAOC,6BAAWH,OAAAA,EAAS,MAAA,CAAA;IAEjC,qBACII,eAAA,CAAAC,mBAAA,EAAA;;0BACIC,cAAA,CAACC,MAAAA,EAAAA;AAAKC,gBAAAA,eAAAA,EAAeR,QAAQS,EAAE;AAAGP,gBAAAA,QAAAA,EAAAA;;AACjCD,YAAAA,KAAAA,CAAMS;;;AAGnB;;;;"}
@@ -0,0 +1,53 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var LayoutConfigProvider = require('../configuration/LayoutConfigProvider.js');
5
+ var SlotName = require('../layouts/SlotName.js');
6
+ require('@cratis/scene.model');
7
+ require('../layouts/shellComponents.js');
8
+ require('../layouts/appShell.js');
9
+ require('../layouts/fullPage.js');
10
+
11
+ // Copyright (c) Cratis. All rights reserved.
12
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
13
+ /**
14
+ * The chrome-less shell: content, an optional branding aside, and the configurator.
15
+ *
16
+ * Login, register, password reset, verification, lock, error, access-denied, not-found and landing screens
17
+ * all render here rather than in a stripped-down application shell. That split is structural in every
18
+ * PrimeTek template, and for a good reason: those screens have no navigation state to hold, no sidebar to
19
+ * remember, and no breadcrumb to place, so hanging them off the application shell means every one of the
20
+ * eight modes has to have an answer for a page that has no menu.
21
+ *
22
+ * The configurator stays, because a sign-in page still has to honor the chosen theme - it is very often
23
+ * the first page anyone sees.
24
+ */ function FullPageShell({ element, slots }) {
25
+ const surface = /*#__PURE__*/ jsxRuntime.jsx(FullPageSurface, {
26
+ elementId: element.id,
27
+ slots: slots
28
+ });
29
+ return LayoutConfigProvider.useOptionalLayoutConfig() ? surface : /*#__PURE__*/ jsxRuntime.jsx(LayoutConfigProvider.LayoutConfigProvider, {
30
+ children: surface
31
+ });
32
+ }
33
+ function FullPageSurface({ elementId, slots }) {
34
+ const hasAside = (slots[SlotName.SlotName.Aside]?.length ?? 0) > 0;
35
+ return /*#__PURE__*/ jsxRuntime.jsxs("div", {
36
+ className: "layout-full-page",
37
+ "data-scene-id": elementId,
38
+ children: [
39
+ hasAside && /*#__PURE__*/ jsxRuntime.jsx("aside", {
40
+ className: "layout-full-page-aside",
41
+ children: slots[SlotName.SlotName.Aside]
42
+ }),
43
+ /*#__PURE__*/ jsxRuntime.jsx("main", {
44
+ className: "layout-full-page-content",
45
+ children: slots[SlotName.SlotName.Content]
46
+ }),
47
+ slots[SlotName.SlotName.ConfigPanel]
48
+ ]
49
+ });
50
+ }
51
+
52
+ exports.FullPageShell = FullPageShell;
53
+ //# sourceMappingURL=FullPageShell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FullPageShell.js","sources":["../../../shell/FullPageShell.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ReactNode } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { LayoutConfigProvider, useOptionalLayoutConfig } from '../configuration';\nimport { SlotName } from '../layouts';\n\n/**\n * The chrome-less shell: content, an optional branding aside, and the configurator.\n *\n * Login, register, password reset, verification, lock, error, access-denied, not-found and landing screens\n * all render here rather than in a stripped-down application shell. That split is structural in every\n * PrimeTek template, and for a good reason: those screens have no navigation state to hold, no sidebar to\n * remember, and no breadcrumb to place, so hanging them off the application shell means every one of the\n * eight modes has to have an answer for a page that has no menu.\n *\n * The configurator stays, because a sign-in page still has to honor the chosen theme - it is very often\n * the first page anyone sees.\n */\nexport function FullPageShell({ element, slots }: RegisteredComponentProps) {\n const surface = <FullPageSurface elementId={element.id} slots={slots} />;\n return useOptionalLayoutConfig() ? surface : <LayoutConfigProvider>{surface}</LayoutConfigProvider>;\n}\n\ninterface FullPageSurfaceProps {\n elementId: string;\n slots: Record<string, ReactNode[]>;\n}\n\nfunction FullPageSurface({ elementId, slots }: FullPageSurfaceProps) {\n const hasAside = (slots[SlotName.Aside]?.length ?? 0) > 0;\n\n return (\n <div className='layout-full-page' data-scene-id={elementId}>\n {hasAside && <aside className='layout-full-page-aside'>{slots[SlotName.Aside]}</aside>}\n <main className='layout-full-page-content'>{slots[SlotName.Content]}</main>\n {slots[SlotName.ConfigPanel]}\n </div>\n );\n}\n"],"names":["FullPageShell","element","slots","surface","_jsx","FullPageSurface","elementId","id","useOptionalLayoutConfig","LayoutConfigProvider","hasAside","SlotName","Aside","length","_jsxs","div","className","data-scene-id","aside","main","Content","ConfigPanel"],"mappings":";;;;;;;;;;AAAA;AACA;AAOA;;;;;;;;;;;AAWC,IACM,SAASA,aAAAA,CAAc,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;AACtE,IAAA,MAAMC,wBAAUC,cAAA,CAACC,eAAAA,EAAAA;AAAgBC,QAAAA,SAAAA,EAAWL,QAAQM,EAAE;QAAEL,KAAAA,EAAOA;;IAC/D,OAAOM,4CAAAA,EAAAA,GAA4BL,wBAAUC,cAAA,CAACK,yCAAAA,EAAAA;AAAsBN,QAAAA,QAAAA,EAAAA;;AACxE;AAOA,SAASE,eAAAA,CAAgB,EAAEC,SAAS,EAAEJ,KAAK,EAAwB,EAAA;IAC/D,MAAMQ,QAAAA,GAAW,CAACR,KAAK,CAACS,iBAAAA,CAASC,KAAK,CAAC,EAAEC,MAAAA,IAAU,CAAA,IAAK,CAAA;AAExD,IAAA,qBACIC,eAAA,CAACC,KAAAA,EAAAA;QAAIC,SAAAA,EAAU,kBAAA;QAAmBC,eAAAA,EAAeX,SAAAA;;AAC5CI,YAAAA,QAAAA,kBAAYN,cAAA,CAACc,OAAAA,EAAAA;gBAAMF,SAAAA,EAAU,wBAAA;0BAA0Bd,KAAK,CAACS,iBAAAA,CAASC,KAAK;;0BAC5ER,cAAA,CAACe,MAAAA,EAAAA;gBAAKH,SAAAA,EAAU,0BAAA;0BAA4Bd,KAAK,CAACS,iBAAAA,CAASS,OAAO;;YACjElB,KAAK,CAACS,iBAAAA,CAASU,WAAW;;;AAGvC;;;;"}
@@ -0,0 +1,58 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var LayoutMode = require('../configuration/LayoutMode.js');
5
+ var LayoutConfigProvider = require('../configuration/LayoutConfigProvider.js');
6
+ var elementProperties = require('./elementProperties.js');
7
+
8
+ // Copyright (c) Cratis. All rights reserved.
9
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
10
+ /** What each mode is called in the configurator - the same names the PrimeTek template line uses. */ const modeLabels = {
11
+ [LayoutMode.LayoutMode.Static]: 'Static',
12
+ [LayoutMode.LayoutMode.Overlay]: 'Overlay',
13
+ [LayoutMode.LayoutMode.Slim]: 'Slim',
14
+ [LayoutMode.LayoutMode.SlimPlus]: 'Slim+',
15
+ [LayoutMode.LayoutMode.Compact]: 'Compact',
16
+ [LayoutMode.LayoutMode.Horizontal]: 'Horizontal',
17
+ [LayoutMode.LayoutMode.Reveal]: 'Reveal',
18
+ [LayoutMode.LayoutMode.Drawer]: 'Drawer'
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
+ */ function LayoutModeSwitcher({ element }) {
27
+ const { config, setMode } = LayoutConfigProvider.useLayoutConfig();
28
+ const label = elementProperties.readString(element, 'label', 'Menu mode');
29
+ return /*#__PURE__*/ jsxRuntime.jsxs("div", {
30
+ "data-scene-id": element.id,
31
+ children: [
32
+ /*#__PURE__*/ jsxRuntime.jsx("h3", {
33
+ className: "layout-config-section-title",
34
+ children: label
35
+ }),
36
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
37
+ className: "layout-config-options",
38
+ role: "group",
39
+ "aria-label": label,
40
+ children: LayoutMode.layoutModes.map((mode)=>/*#__PURE__*/ jsxRuntime.jsx("button", {
41
+ type: "button",
42
+ className: "layout-config-option",
43
+ disabled: config.isMobile,
44
+ "aria-pressed": config.mode === mode,
45
+ onClick: ()=>setMode(mode),
46
+ children: modeLabels[mode]
47
+ }, mode))
48
+ }),
49
+ config.isMobile && /*#__PURE__*/ jsxRuntime.jsx("p", {
50
+ className: "layout-config-note",
51
+ children: "Below 991px every mode renders off-canvas, so the choice is kept but not applied."
52
+ })
53
+ ]
54
+ });
55
+ }
56
+
57
+ exports.LayoutModeSwitcher = LayoutModeSwitcher;
58
+ //# sourceMappingURL=LayoutModeSwitcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LayoutModeSwitcher.js","sources":["../../../shell/LayoutModeSwitcher.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { LayoutMode, layoutModes, useLayoutConfig } from '../configuration';\nimport { readString } from './elementProperties';\n\n/** What each mode is called in the configurator - the same names the PrimeTek template line uses. */\nconst modeLabels: Record<LayoutMode, string> = {\n [LayoutMode.Static]: 'Static',\n [LayoutMode.Overlay]: 'Overlay',\n [LayoutMode.Slim]: 'Slim',\n [LayoutMode.SlimPlus]: 'Slim+',\n [LayoutMode.Compact]: 'Compact',\n [LayoutMode.Horizontal]: 'Horizontal',\n [LayoutMode.Reveal]: 'Reveal',\n [LayoutMode.Drawer]: 'Drawer',\n};\n\n/**\n * Switches between the layout modes.\n *\n * Below the mobile breakpoint every button is disabled and the panel says why, rather than the picker\n * disappearing. A control that vanishes reads as a bug; a disabled control with a sentence next to it\n * reads as a decision - and the choice is still recorded and still there when the window grows again.\n */\nexport function LayoutModeSwitcher({ element }: RegisteredComponentProps) {\n const { config, setMode } = useLayoutConfig();\n const label = readString(element, 'label', 'Menu mode');\n\n return (\n <div data-scene-id={element.id}>\n <h3 className='layout-config-section-title'>{label}</h3>\n <div className='layout-config-options' role='group' aria-label={label}>\n {layoutModes.map(mode => (\n <button\n key={mode}\n type='button'\n className='layout-config-option'\n disabled={config.isMobile}\n aria-pressed={config.mode === mode}\n onClick={() => setMode(mode)}>\n {modeLabels[mode]}\n </button>\n ))}\n </div>\n {config.isMobile && <p className='layout-config-note'>Below 991px every mode renders off-canvas, so the choice is kept but not applied.</p>}\n </div>\n );\n}\n"],"names":["modeLabels","LayoutMode","Static","Overlay","Slim","SlimPlus","Compact","Horizontal","Reveal","Drawer","LayoutModeSwitcher","element","config","setMode","useLayoutConfig","label","readString","_jsxs","div","data-scene-id","id","_jsx","h3","className","role","aria-label","layoutModes","map","mode","button","type","disabled","isMobile","aria-pressed","onClick","p"],"mappings":";;;;;;;AAAA;AACA;AAMA,sGACA,MAAMA,UAAAA,GAAyC;IAC3C,CAACC,qBAAAA,CAAWC,MAAM,GAAG,QAAA;IACrB,CAACD,qBAAAA,CAAWE,OAAO,GAAG,SAAA;IACtB,CAACF,qBAAAA,CAAWG,IAAI,GAAG,MAAA;IACnB,CAACH,qBAAAA,CAAWI,QAAQ,GAAG,OAAA;IACvB,CAACJ,qBAAAA,CAAWK,OAAO,GAAG,SAAA;IACtB,CAACL,qBAAAA,CAAWM,UAAU,GAAG,YAAA;IACzB,CAACN,qBAAAA,CAAWO,MAAM,GAAG,QAAA;IACrB,CAACP,qBAAAA,CAAWQ,MAAM,GAAG;AACzB,CAAA;AAEA;;;;;;AAMC,IACM,SAASC,kBAAAA,CAAmB,EAAEC,OAAO,EAA4B,EAAA;AACpE,IAAA,MAAM,EAAEC,MAAM,EAAEC,OAAO,EAAE,GAAGC,oCAAAA,EAAAA;IAC5B,MAAMC,KAAAA,GAAQC,4BAAAA,CAAWL,OAAAA,EAAS,OAAA,EAAS,WAAA,CAAA;AAE3C,IAAA,qBACIM,eAAA,CAACC,KAAAA,EAAAA;AAAIC,QAAAA,eAAAA,EAAeR,QAAQS,EAAE;;0BAC1BC,cAAA,CAACC,IAAAA,EAAAA;gBAAGC,SAAAA,EAAU,6BAAA;AAA+BR,gBAAAA,QAAAA,EAAAA;;0BAC7CM,cAAA,CAACH,KAAAA,EAAAA;gBAAIK,SAAAA,EAAU,uBAAA;gBAAwBC,IAAAA,EAAK,OAAA;gBAAQC,YAAAA,EAAYV,KAAAA;AAC3DW,gBAAAA,QAAAA,EAAAA,sBAAAA,CAAYC,GAAG,CAACC,CAAAA,IAAAA,iBACbP,cAAA,CAACQ,QAAAA,EAAAA;wBAEGC,IAAAA,EAAK,QAAA;wBACLP,SAAAA,EAAU,sBAAA;AACVQ,wBAAAA,QAAAA,EAAUnB,OAAOoB,QAAQ;wBACzBC,cAAAA,EAAcrB,MAAAA,CAAOgB,IAAI,KAAKA,IAAAA;AAC9BM,wBAAAA,OAAAA,EAAS,IAAMrB,OAAAA,CAAQe,IAAAA,CAAAA;AACtB5B,wBAAAA,QAAAA,EAAAA,UAAU,CAAC4B,IAAAA;AANPA,qBAAAA,EAAAA,IAAAA,CAAAA;;YAUhBhB,MAAAA,CAAOoB,QAAQ,kBAAIX,cAAA,CAACc,GAAAA,EAAAA;gBAAEZ,SAAAA,EAAU,oBAAA;AAAqB,gBAAA,QAAA,EAAA;;;;AAGlE;;;;"}
@@ -0,0 +1,44 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var scene_react = require('@cratis/scene.react');
5
+ var elementProperties = require('./elementProperties.js');
6
+
7
+ // Copyright (c) Cratis. All rights reserved.
8
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
9
+ /**
10
+ * The brand mark.
11
+ *
12
+ * This is the one place in the shell that reads the active theme directly rather than through a token,
13
+ * because picking between a light-background and a dark-background logo asset is a decision no CSS custom
14
+ * property can express - the two are different files. `useSceneTheme` exists for exactly this case.
15
+ */ function Logo({ element }) {
16
+ const theme = scene_react.useSceneTheme();
17
+ const label = elementProperties.readString(element, 'label', 'Cratis');
18
+ const initials = elementProperties.readString(element, 'initials', label.slice(0, 1).toUpperCase());
19
+ const lightSource = elementProperties.readOptionalString(element, 'lightImageUrl');
20
+ const darkSource = elementProperties.readOptionalString(element, 'darkImageUrl');
21
+ const source = theme?.isDark ? darkSource ?? lightSource : lightSource ?? darkSource;
22
+ const targetScreen = elementProperties.readString(element, 'targetScreen', 'Dashboard');
23
+ return /*#__PURE__*/ jsxRuntime.jsxs("a", {
24
+ className: "layout-logo",
25
+ href: `#/${targetScreen}`,
26
+ "data-scene-id": element.id,
27
+ children: [
28
+ source ? /*#__PURE__*/ jsxRuntime.jsx("img", {
29
+ src: source,
30
+ alt: label,
31
+ height: 28
32
+ }) : /*#__PURE__*/ jsxRuntime.jsx("span", {
33
+ className: "layout-logo-mark",
34
+ children: initials
35
+ }),
36
+ /*#__PURE__*/ jsxRuntime.jsx("span", {
37
+ children: label
38
+ })
39
+ ]
40
+ });
41
+ }
42
+
43
+ exports.Logo = Logo;
44
+ //# sourceMappingURL=Logo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Logo.js","sources":["../../../shell/Logo.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { useSceneTheme } from '@cratis/scene.react';\nimport { readOptionalString, readString } from './elementProperties';\n\n/**\n * The brand mark.\n *\n * This is the one place in the shell that reads the active theme directly rather than through a token,\n * because picking between a light-background and a dark-background logo asset is a decision no CSS custom\n * property can express - the two are different files. `useSceneTheme` exists for exactly this case.\n */\nexport function Logo({ element }: RegisteredComponentProps) {\n const theme = useSceneTheme();\n const label = readString(element, 'label', 'Cratis');\n const initials = readString(element, 'initials', label.slice(0, 1).toUpperCase());\n const lightSource = readOptionalString(element, 'lightImageUrl');\n const darkSource = readOptionalString(element, 'darkImageUrl');\n const source = theme?.isDark ? darkSource ?? lightSource : lightSource ?? darkSource;\n const targetScreen = readString(element, 'targetScreen', 'Dashboard');\n\n return (\n <a className='layout-logo' href={`#/${targetScreen}`} data-scene-id={element.id}>\n {source ? <img src={source} alt={label} height={28} /> : <span className='layout-logo-mark'>{initials}</span>}\n <span>{label}</span>\n </a>\n );\n}\n"],"names":["Logo","element","theme","useSceneTheme","label","readString","initials","slice","toUpperCase","lightSource","readOptionalString","darkSource","source","isDark","targetScreen","_jsxs","a","className","href","data-scene-id","id","_jsx","img","src","alt","height","span"],"mappings":";;;;;;AAAA;AACA;AAMA;;;;;;AAMC,IACM,SAASA,IAAAA,CAAK,EAAEC,OAAO,EAA4B,EAAA;AACtD,IAAA,MAAMC,KAAAA,GAAQC,yBAAAA,EAAAA;IACd,MAAMC,KAAAA,GAAQC,4BAAAA,CAAWJ,OAAAA,EAAS,OAAA,EAAS,QAAA,CAAA;IAC3C,MAAMK,QAAAA,GAAWD,6BAAWJ,OAAAA,EAAS,UAAA,EAAYG,MAAMG,KAAK,CAAC,CAAA,EAAG,CAAA,CAAA,CAAGC,WAAW,EAAA,CAAA;IAC9E,MAAMC,WAAAA,GAAcC,qCAAmBT,OAAAA,EAAS,eAAA,CAAA;IAChD,MAAMU,UAAAA,GAAaD,qCAAmBT,OAAAA,EAAS,cAAA,CAAA;AAC/C,IAAA,MAAMW,MAAAA,GAASV,KAAAA,EAAOW,MAAAA,GAASF,UAAAA,IAAcF,cAAcA,WAAAA,IAAeE,UAAAA;IAC1E,MAAMG,YAAAA,GAAeT,4BAAAA,CAAWJ,OAAAA,EAAS,cAAA,EAAgB,WAAA,CAAA;AAEzD,IAAA,qBACIc,eAAA,CAACC,GAAAA,EAAAA;QAAEC,SAAAA,EAAU,aAAA;QAAcC,IAAAA,EAAM,CAAC,EAAE,EAAEJ,YAAAA,CAAAA,CAAc;AAAEK,QAAAA,eAAAA,EAAelB,QAAQmB,EAAE;;AAC1ER,YAAAA,MAAAA,iBAASS,cAAA,CAACC,KAAAA,EAAAA;gBAAIC,GAAAA,EAAKX,MAAAA;gBAAQY,GAAAA,EAAKpB,KAAAA;gBAAOqB,MAAAA,EAAQ;+BAASJ,cAAA,CAACK,MAAAA,EAAAA;gBAAKT,SAAAA,EAAU,kBAAA;AAAoBX,gBAAAA,QAAAA,EAAAA;;0BAC7Fe,cAAA,CAACK,MAAAA,EAAAA;AAAMtB,gBAAAA,QAAAA,EAAAA;;;;AAGnB;;;;"}
@@ -0,0 +1,34 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var LayoutConfigProvider = require('../configuration/LayoutConfigProvider.js');
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
+ */ function LayoutMask() {
14
+ const { isMaskVisible, setSidebarOpen } = LayoutConfigProvider.useLayoutConfig();
15
+ if (!isMaskVisible) {
16
+ return undefined;
17
+ }
18
+ return /*#__PURE__*/ jsxRuntime.jsx("button", {
19
+ type: "button",
20
+ className: "layout-mask",
21
+ "aria-label": "Close the menu",
22
+ onClick: ()=>setSidebarOpen(false)
23
+ });
24
+ }
25
+ /**
26
+ * The `mask` component, for a template that wants to place the scrim itself rather than let
27
+ * {@link AppShell} do it.
28
+ */ function Mask() {
29
+ return /*#__PURE__*/ jsxRuntime.jsx(LayoutMask, {});
30
+ }
31
+
32
+ exports.LayoutMask = LayoutMask;
33
+ exports.Mask = Mask;
34
+ //# sourceMappingURL=Mask.js.map