@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.
- package/.storybook/main.ts +32 -0
- package/.storybook/preview.ts +20 -0
- package/ComponentName.ts +60 -0
- package/README.md +204 -0
- package/configuration/ColorScheme.ts +17 -0
- package/configuration/LayoutConfigProvider.tsx +182 -0
- package/configuration/LayoutConfigState.ts +46 -0
- package/configuration/LayoutMode.ts +50 -0
- package/configuration/MenuTheme.ts +24 -0
- package/configuration/index.ts +11 -0
- package/configuration/layoutConfigStorage.ts +102 -0
- package/configuration/layoutConfigTransitions.ts +150 -0
- package/configuration/layoutWrapperClasses.ts +68 -0
- package/defaultBlueprint.ts +66 -0
- package/defaultBlueprintComponents.ts +51 -0
- package/dist/cjs/ComponentName.js +33 -0
- package/dist/cjs/ComponentName.js.map +1 -0
- package/dist/cjs/configuration/ColorScheme.js +23 -0
- package/dist/cjs/configuration/ColorScheme.js.map +1 -0
- package/dist/cjs/configuration/LayoutConfigProvider.js +96 -0
- package/dist/cjs/configuration/LayoutConfigProvider.js.map +1 -0
- package/dist/cjs/configuration/LayoutMode.js +38 -0
- package/dist/cjs/configuration/LayoutMode.js.map +1 -0
- package/dist/cjs/configuration/MenuTheme.js +26 -0
- package/dist/cjs/configuration/MenuTheme.js.map +1 -0
- package/dist/cjs/configuration/layoutConfigStorage.js +85 -0
- package/dist/cjs/configuration/layoutConfigStorage.js.map +1 -0
- package/dist/cjs/configuration/layoutConfigTransitions.js +158 -0
- package/dist/cjs/configuration/layoutConfigTransitions.js.map +1 -0
- package/dist/cjs/configuration/layoutWrapperClasses.js +62 -0
- package/dist/cjs/configuration/layoutWrapperClasses.js.map +1 -0
- package/dist/cjs/defaultBlueprint.js +92 -0
- package/dist/cjs/defaultBlueprint.js.map +1 -0
- package/dist/cjs/defaultBlueprintComponents.js +54 -0
- package/dist/cjs/defaultBlueprintComponents.js.map +1 -0
- package/dist/cjs/gallery/GalleryScreenPreview.js +63 -0
- package/dist/cjs/gallery/GalleryScreenPreview.js.map +1 -0
- package/dist/cjs/gallery/TemplateSlotName.js +25 -0
- package/dist/cjs/gallery/TemplateSlotName.js.map +1 -0
- package/dist/cjs/gallery/applicationChrome.js +134 -0
- package/dist/cjs/gallery/applicationChrome.js.map +1 -0
- package/dist/cjs/gallery/authTemplates.js +234 -0
- package/dist/cjs/gallery/authTemplates.js.map +1 -0
- package/dist/cjs/gallery/componentNames.js +53 -0
- package/dist/cjs/gallery/componentNames.js.map +1 -0
- package/dist/cjs/gallery/composeScreen.js +99 -0
- package/dist/cjs/gallery/composeScreen.js.map +1 -0
- package/dist/cjs/gallery/dependencyComponentNames.js +72 -0
- package/dist/cjs/gallery/dependencyComponentNames.js.map +1 -0
- package/dist/cjs/gallery/dialogTemplates.js +161 -0
- package/dist/cjs/gallery/dialogTemplates.js.map +1 -0
- package/dist/cjs/gallery/elements.js +80 -0
- package/dist/cjs/gallery/elements.js.map +1 -0
- package/dist/cjs/gallery/navigation.js +129 -0
- package/dist/cjs/gallery/navigation.js.map +1 -0
- package/dist/cjs/gallery/nesting.js +129 -0
- package/dist/cjs/gallery/nesting.js.map +1 -0
- package/dist/cjs/gallery/previewProfile.js +68 -0
- package/dist/cjs/gallery/previewProfile.js.map +1 -0
- package/dist/cjs/gallery/resolveElementNames.js +63 -0
- package/dist/cjs/gallery/resolveElementNames.js.map +1 -0
- package/dist/cjs/gallery/screens.js +222 -0
- package/dist/cjs/gallery/screens.js.map +1 -0
- package/dist/cjs/gallery/statusTemplates.js +190 -0
- package/dist/cjs/gallery/statusTemplates.js.map +1 -0
- package/dist/cjs/gallery/supportTemplates.js +319 -0
- package/dist/cjs/gallery/supportTemplates.js.map +1 -0
- package/dist/cjs/gallery/widgets.js +94 -0
- package/dist/cjs/gallery/widgets.js.map +1 -0
- package/dist/cjs/gallery/workspaceTemplates.js +395 -0
- package/dist/cjs/gallery/workspaceTemplates.js.map +1 -0
- package/dist/cjs/index.js +220 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/layouts/LayoutName.js +19 -0
- package/dist/cjs/layouts/LayoutName.js.map +1 -0
- package/dist/cjs/layouts/SlotName.js +31 -0
- package/dist/cjs/layouts/SlotName.js.map +1 -0
- package/dist/cjs/layouts/appShell.js +160 -0
- package/dist/cjs/layouts/appShell.js.map +1 -0
- package/dist/cjs/layouts/defaultLayouts.js +20 -0
- package/dist/cjs/layouts/defaultLayouts.js.map +1 -0
- package/dist/cjs/layouts/flowBuilders.js +66 -0
- package/dist/cjs/layouts/flowBuilders.js.map +1 -0
- package/dist/cjs/layouts/fullPage.js +78 -0
- package/dist/cjs/layouts/fullPage.js.map +1 -0
- package/dist/cjs/layouts/shellComponents.js +29 -0
- package/dist/cjs/layouts/shellComponents.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/packageName.js +15 -0
- package/dist/cjs/packageName.js.map +1 -0
- package/dist/cjs/shell/AppShell.js +88 -0
- package/dist/cjs/shell/AppShell.js.map +1 -0
- package/dist/cjs/shell/Breadcrumb.js +33 -0
- package/dist/cjs/shell/Breadcrumb.js.map +1 -0
- package/dist/cjs/shell/ConfigPanel.js +128 -0
- package/dist/cjs/shell/ConfigPanel.js.map +1 -0
- package/dist/cjs/shell/Footer.js +28 -0
- package/dist/cjs/shell/Footer.js.map +1 -0
- package/dist/cjs/shell/FullPageShell.js +53 -0
- package/dist/cjs/shell/FullPageShell.js.map +1 -0
- package/dist/cjs/shell/LayoutModeSwitcher.js +58 -0
- package/dist/cjs/shell/LayoutModeSwitcher.js.map +1 -0
- package/dist/cjs/shell/Logo.js +44 -0
- package/dist/cjs/shell/Logo.js.map +1 -0
- package/dist/cjs/shell/Mask.js +34 -0
- package/dist/cjs/shell/Mask.js.map +1 -0
- package/dist/cjs/shell/Menu.js +36 -0
- package/dist/cjs/shell/Menu.js.map +1 -0
- package/dist/cjs/shell/MenuItem.js +65 -0
- package/dist/cjs/shell/MenuItem.js.map +1 -0
- package/dist/cjs/shell/PageHeader.js +43 -0
- package/dist/cjs/shell/PageHeader.js.map +1 -0
- package/dist/cjs/shell/RightPanel.js +30 -0
- package/dist/cjs/shell/RightPanel.js.map +1 -0
- package/dist/cjs/shell/Sidebar.js +51 -0
- package/dist/cjs/shell/Sidebar.js.map +1 -0
- package/dist/cjs/shell/ThemeOption.js +42 -0
- package/dist/cjs/shell/ThemeOption.js.map +1 -0
- package/dist/cjs/shell/ThemeSwitcher.js +50 -0
- package/dist/cjs/shell/ThemeSwitcher.js.map +1 -0
- package/dist/cjs/shell/Topbar.js +54 -0
- package/dist/cjs/shell/Topbar.js.map +1 -0
- package/dist/cjs/shell/UserMenu.js +68 -0
- package/dist/cjs/shell/UserMenu.js.map +1 -0
- package/dist/cjs/shell/elementProperties.js +56 -0
- package/dist/cjs/shell/elementProperties.js.map +1 -0
- package/dist/cjs/themes/LayoutThemeProvider.js +33 -0
- package/dist/cjs/themes/LayoutThemeProvider.js.map +1 -0
- package/dist/cjs/themes/blueprintThemeCompatibility.js +28 -0
- package/dist/cjs/themes/blueprintThemeCompatibility.js.map +1 -0
- package/dist/cjs/themes/dark.js +40 -0
- package/dist/cjs/themes/dark.js.map +1 -0
- package/dist/cjs/themes/defaultBlueprintThemes.js +19 -0
- package/dist/cjs/themes/defaultBlueprintThemes.js.map +1 -0
- package/dist/cjs/themes/light.js +43 -0
- package/dist/cjs/themes/light.js.map +1 -0
- package/dist/esm/ComponentName.d.ts +19 -0
- package/dist/esm/ComponentName.d.ts.map +1 -0
- package/dist/esm/ComponentName.js +31 -0
- package/dist/esm/ComponentName.js.map +1 -0
- package/dist/esm/configuration/ColorScheme.d.ts +6 -0
- package/dist/esm/configuration/ColorScheme.d.ts.map +1 -0
- package/dist/esm/configuration/ColorScheme.js +20 -0
- package/dist/esm/configuration/ColorScheme.js.map +1 -0
- package/dist/esm/configuration/LayoutConfigProvider.d.ts +29 -0
- package/dist/esm/configuration/LayoutConfigProvider.d.ts.map +1 -0
- package/dist/esm/configuration/LayoutConfigProvider.js +92 -0
- package/dist/esm/configuration/LayoutConfigProvider.js.map +1 -0
- package/dist/esm/configuration/LayoutConfigState.d.ts +14 -0
- package/dist/esm/configuration/LayoutConfigState.d.ts.map +1 -0
- package/dist/esm/configuration/LayoutConfigState.js +2 -0
- package/dist/esm/configuration/LayoutConfigState.js.map +1 -0
- package/dist/esm/configuration/LayoutMode.d.ts +12 -0
- package/dist/esm/configuration/LayoutMode.d.ts.map +1 -0
- package/dist/esm/configuration/LayoutMode.js +35 -0
- package/dist/esm/configuration/LayoutMode.js.map +1 -0
- package/dist/esm/configuration/MenuTheme.d.ts +7 -0
- package/dist/esm/configuration/MenuTheme.d.ts.map +1 -0
- package/dist/esm/configuration/MenuTheme.js +23 -0
- package/dist/esm/configuration/MenuTheme.js.map +1 -0
- package/dist/esm/configuration/index.d.ts +9 -0
- package/dist/esm/configuration/index.d.ts.map +1 -0
- package/dist/esm/configuration/index.js +9 -0
- package/dist/esm/configuration/index.js.map +1 -0
- package/dist/esm/configuration/layoutConfigStorage.d.ts +6 -0
- package/dist/esm/configuration/layoutConfigStorage.d.ts.map +1 -0
- package/dist/esm/configuration/layoutConfigStorage.js +81 -0
- package/dist/esm/configuration/layoutConfigStorage.js.map +1 -0
- package/dist/esm/configuration/layoutConfigTransitions.d.ts +22 -0
- package/dist/esm/configuration/layoutConfigTransitions.d.ts.map +1 -0
- package/dist/esm/configuration/layoutConfigTransitions.js +140 -0
- package/dist/esm/configuration/layoutConfigTransitions.js.map +1 -0
- package/dist/esm/configuration/layoutWrapperClasses.d.ts +4 -0
- package/dist/esm/configuration/layoutWrapperClasses.d.ts.map +1 -0
- package/dist/esm/configuration/layoutWrapperClasses.js +59 -0
- package/dist/esm/configuration/layoutWrapperClasses.js.map +1 -0
- package/dist/esm/defaultBlueprint.d.ts +5 -0
- package/dist/esm/defaultBlueprint.d.ts.map +1 -0
- package/dist/esm/defaultBlueprint.js +89 -0
- package/dist/esm/defaultBlueprint.js.map +1 -0
- package/dist/esm/defaultBlueprintComponents.d.ts +3 -0
- package/dist/esm/defaultBlueprintComponents.d.ts.map +1 -0
- package/dist/esm/defaultBlueprintComponents.js +52 -0
- package/dist/esm/defaultBlueprintComponents.js.map +1 -0
- package/dist/esm/for_AppShell/when_rendering_a_gallery_screen.d.ts +2 -0
- package/dist/esm/for_AppShell/when_rendering_a_gallery_screen.d.ts.map +1 -0
- package/dist/esm/for_AppShell/when_rendering_a_gallery_screen.js +60 -0
- package/dist/esm/for_AppShell/when_rendering_a_gallery_screen.js.map +1 -0
- package/dist/esm/for_LayoutConfigProvider/when_switching_mode_and_reloading.d.ts +2 -0
- package/dist/esm/for_LayoutConfigProvider/when_switching_mode_and_reloading.d.ts.map +1 -0
- package/dist/esm/for_LayoutConfigProvider/when_switching_mode_and_reloading.js +60 -0
- package/dist/esm/for_LayoutConfigProvider/when_switching_mode_and_reloading.js.map +1 -0
- package/dist/esm/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.d.ts +2 -0
- package/dist/esm/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.d.ts.map +1 -0
- package/dist/esm/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.js +26 -0
- package/dist/esm/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.js.map +1 -0
- package/dist/esm/for_defaultBlueprint/when_validating_the_bundle.d.ts +2 -0
- package/dist/esm/for_defaultBlueprint/when_validating_the_bundle.d.ts.map +1 -0
- package/dist/esm/for_defaultBlueprint/when_validating_the_bundle.js +32 -0
- package/dist/esm/for_defaultBlueprint/when_validating_the_bundle.js.map +1 -0
- package/dist/esm/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.d.ts +2 -0
- package/dist/esm/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.d.ts.map +1 -0
- package/dist/esm/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.js +40 -0
- package/dist/esm/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.js.map +1 -0
- package/dist/esm/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.d.ts +2 -0
- package/dist/esm/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.d.ts.map +1 -0
- package/dist/esm/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.js +27 -0
- package/dist/esm/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.js.map +1 -0
- package/dist/esm/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.d.ts +2 -0
- package/dist/esm/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.d.ts.map +1 -0
- package/dist/esm/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.js +41 -0
- package/dist/esm/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.js.map +1 -0
- package/dist/esm/for_galleryScreenTemplates/when_following_the_nesting_chain.d.ts +2 -0
- package/dist/esm/for_galleryScreenTemplates/when_following_the_nesting_chain.d.ts.map +1 -0
- package/dist/esm/for_galleryScreenTemplates/when_following_the_nesting_chain.js +31 -0
- package/dist/esm/for_galleryScreenTemplates/when_following_the_nesting_chain.js.map +1 -0
- package/dist/esm/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.d.ts +2 -0
- package/dist/esm/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.d.ts.map +1 -0
- package/dist/esm/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.js +33 -0
- package/dist/esm/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.js.map +1 -0
- package/dist/esm/for_galleryScreens/when_resolving_the_component_names_they_reference.d.ts +2 -0
- package/dist/esm/for_galleryScreens/when_resolving_the_component_names_they_reference.d.ts.map +1 -0
- package/dist/esm/for_galleryScreens/when_resolving_the_component_names_they_reference.js +44 -0
- package/dist/esm/for_galleryScreens/when_resolving_the_component_names_they_reference.js.map +1 -0
- package/dist/esm/for_layoutConfigStorage/when_restoring_a_persisted_configuration.d.ts +2 -0
- package/dist/esm/for_layoutConfigStorage/when_restoring_a_persisted_configuration.d.ts.map +1 -0
- package/dist/esm/for_layoutConfigStorage/when_restoring_a_persisted_configuration.js +60 -0
- package/dist/esm/for_layoutConfigStorage/when_restoring_a_persisted_configuration.js.map +1 -0
- package/dist/esm/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.d.ts +2 -0
- package/dist/esm/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.d.ts.map +1 -0
- package/dist/esm/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.js +28 -0
- package/dist/esm/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.js.map +1 -0
- package/dist/esm/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.d.ts +2 -0
- package/dist/esm/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.d.ts.map +1 -0
- package/dist/esm/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.js +38 -0
- package/dist/esm/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.js.map +1 -0
- package/dist/esm/for_layoutWrapperClasses/when_rendering_each_mode.d.ts +2 -0
- package/dist/esm/for_layoutWrapperClasses/when_rendering_each_mode.d.ts.map +1 -0
- package/dist/esm/for_layoutWrapperClasses/when_rendering_each_mode.js +39 -0
- package/dist/esm/for_layoutWrapperClasses/when_rendering_each_mode.js.map +1 -0
- package/dist/esm/for_navigation/when_aggregating_the_navigation_contributions.d.ts +2 -0
- package/dist/esm/for_navigation/when_aggregating_the_navigation_contributions.d.ts.map +1 -0
- package/dist/esm/for_navigation/when_aggregating_the_navigation_contributions.js +37 -0
- package/dist/esm/for_navigation/when_aggregating_the_navigation_contributions.js.map +1 -0
- package/dist/esm/gallery/ApplicationScreens.stories.d.ts +31 -0
- package/dist/esm/gallery/ApplicationScreens.stories.d.ts.map +1 -0
- package/dist/esm/gallery/ApplicationScreens.stories.js +29 -0
- package/dist/esm/gallery/ApplicationScreens.stories.js.map +1 -0
- package/dist/esm/gallery/FullPageScreens.stories.d.ts +28 -0
- package/dist/esm/gallery/FullPageScreens.stories.d.ts.map +1 -0
- package/dist/esm/gallery/FullPageScreens.stories.js +26 -0
- package/dist/esm/gallery/FullPageScreens.stories.js.map +1 -0
- package/dist/esm/gallery/GalleryScreenPreview.d.ts +12 -0
- package/dist/esm/gallery/GalleryScreenPreview.d.ts.map +1 -0
- package/dist/esm/gallery/GalleryScreenPreview.js +60 -0
- package/dist/esm/gallery/GalleryScreenPreview.js.map +1 -0
- package/dist/esm/gallery/NavigationEntry.d.ts +8 -0
- package/dist/esm/gallery/NavigationEntry.d.ts.map +1 -0
- package/dist/esm/gallery/NavigationEntry.js +2 -0
- package/dist/esm/gallery/NavigationEntry.js.map +1 -0
- package/dist/esm/gallery/TemplateSlotName.d.ts +11 -0
- package/dist/esm/gallery/TemplateSlotName.d.ts.map +1 -0
- package/dist/esm/gallery/TemplateSlotName.js +23 -0
- package/dist/esm/gallery/TemplateSlotName.js.map +1 -0
- package/dist/esm/gallery/applicationChrome.d.ts +8 -0
- package/dist/esm/gallery/applicationChrome.d.ts.map +1 -0
- package/dist/esm/gallery/applicationChrome.js +131 -0
- package/dist/esm/gallery/applicationChrome.js.map +1 -0
- package/dist/esm/gallery/authTemplates.d.ts +9 -0
- package/dist/esm/gallery/authTemplates.d.ts.map +1 -0
- package/dist/esm/gallery/authTemplates.js +226 -0
- package/dist/esm/gallery/authTemplates.js.map +1 -0
- package/dist/esm/gallery/componentNames.d.ts +4 -0
- package/dist/esm/gallery/componentNames.d.ts.map +1 -0
- package/dist/esm/gallery/componentNames.js +50 -0
- package/dist/esm/gallery/componentNames.js.map +1 -0
- package/dist/esm/gallery/composeScreen.d.ts +5 -0
- package/dist/esm/gallery/composeScreen.d.ts.map +1 -0
- package/dist/esm/gallery/composeScreen.js +95 -0
- package/dist/esm/gallery/composeScreen.js.map +1 -0
- package/dist/esm/gallery/dependencyComponentNames.d.ts +4 -0
- package/dist/esm/gallery/dependencyComponentNames.d.ts.map +1 -0
- package/dist/esm/gallery/dependencyComponentNames.js +68 -0
- package/dist/esm/gallery/dependencyComponentNames.js.map +1 -0
- package/dist/esm/gallery/dialogTemplates.d.ts +6 -0
- package/dist/esm/gallery/dialogTemplates.d.ts.map +1 -0
- package/dist/esm/gallery/dialogTemplates.js +156 -0
- package/dist/esm/gallery/dialogTemplates.js.map +1 -0
- package/dist/esm/gallery/elements.d.ts +7 -0
- package/dist/esm/gallery/elements.d.ts.map +1 -0
- package/dist/esm/gallery/elements.js +74 -0
- package/dist/esm/gallery/elements.js.map +1 -0
- package/dist/esm/gallery/index.d.ts +20 -0
- package/dist/esm/gallery/index.d.ts.map +1 -0
- package/dist/esm/gallery/index.js +20 -0
- package/dist/esm/gallery/index.js.map +1 -0
- package/dist/esm/gallery/navigation.d.ts +9 -0
- package/dist/esm/gallery/navigation.d.ts.map +1 -0
- package/dist/esm/gallery/navigation.js +122 -0
- package/dist/esm/gallery/navigation.js.map +1 -0
- package/dist/esm/gallery/nesting.d.ts +6 -0
- package/dist/esm/gallery/nesting.d.ts.map +1 -0
- package/dist/esm/gallery/nesting.js +124 -0
- package/dist/esm/gallery/nesting.js.map +1 -0
- package/dist/esm/gallery/previewProfile.d.ts +6 -0
- package/dist/esm/gallery/previewProfile.d.ts.map +1 -0
- package/dist/esm/gallery/previewProfile.js +64 -0
- package/dist/esm/gallery/previewProfile.js.map +1 -0
- package/dist/esm/gallery/resolveElementNames.d.ts +4 -0
- package/dist/esm/gallery/resolveElementNames.d.ts.map +1 -0
- package/dist/esm/gallery/resolveElementNames.js +61 -0
- package/dist/esm/gallery/resolveElementNames.js.map +1 -0
- package/dist/esm/gallery/screens.d.ts +5 -0
- package/dist/esm/gallery/screens.d.ts.map +1 -0
- package/dist/esm/gallery/screens.js +218 -0
- package/dist/esm/gallery/screens.js.map +1 -0
- package/dist/esm/gallery/statusTemplates.d.ts +7 -0
- package/dist/esm/gallery/statusTemplates.d.ts.map +1 -0
- package/dist/esm/gallery/statusTemplates.js +184 -0
- package/dist/esm/gallery/statusTemplates.js.map +1 -0
- package/dist/esm/gallery/supportTemplates.d.ts +8 -0
- package/dist/esm/gallery/supportTemplates.d.ts.map +1 -0
- package/dist/esm/gallery/supportTemplates.js +312 -0
- package/dist/esm/gallery/supportTemplates.js.map +1 -0
- package/dist/esm/gallery/widgets.d.ts +12 -0
- package/dist/esm/gallery/widgets.d.ts.map +1 -0
- package/dist/esm/gallery/widgets.js +86 -0
- package/dist/esm/gallery/widgets.js.map +1 -0
- package/dist/esm/gallery/workspaceTemplates.d.ts +8 -0
- package/dist/esm/gallery/workspaceTemplates.d.ts.map +1 -0
- package/dist/esm/gallery/workspaceTemplates.js +388 -0
- package/dist/esm/gallery/workspaceTemplates.js.map +1 -0
- package/dist/esm/index.d.ts +10 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +60 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/layouts/LayoutName.d.ts +5 -0
- package/dist/esm/layouts/LayoutName.d.ts.map +1 -0
- package/dist/esm/layouts/LayoutName.js +17 -0
- package/dist/esm/layouts/LayoutName.js.map +1 -0
- package/dist/esm/layouts/SlotName.d.ts +12 -0
- package/dist/esm/layouts/SlotName.d.ts.map +1 -0
- package/dist/esm/layouts/SlotName.js +29 -0
- package/dist/esm/layouts/SlotName.js.map +1 -0
- package/dist/esm/layouts/appShell.d.ts +8 -0
- package/dist/esm/layouts/appShell.d.ts.map +1 -0
- package/dist/esm/layouts/appShell.js +153 -0
- package/dist/esm/layouts/appShell.js.map +1 -0
- package/dist/esm/layouts/defaultLayouts.d.ts +3 -0
- package/dist/esm/layouts/defaultLayouts.d.ts.map +1 -0
- package/dist/esm/layouts/defaultLayouts.js +18 -0
- package/dist/esm/layouts/defaultLayouts.js.map +1 -0
- package/dist/esm/layouts/flowBuilders.d.ts +6 -0
- package/dist/esm/layouts/flowBuilders.d.ts.map +1 -0
- package/dist/esm/layouts/flowBuilders.js +61 -0
- package/dist/esm/layouts/flowBuilders.js.map +1 -0
- package/dist/esm/layouts/fullPage.d.ts +6 -0
- package/dist/esm/layouts/fullPage.d.ts.map +1 -0
- package/dist/esm/layouts/fullPage.js +73 -0
- package/dist/esm/layouts/fullPage.js.map +1 -0
- package/dist/esm/layouts/index.d.ts +8 -0
- package/dist/esm/layouts/index.d.ts.map +1 -0
- package/dist/esm/layouts/index.js +8 -0
- package/dist/esm/layouts/index.js.map +1 -0
- package/dist/esm/layouts/shellComponents.d.ts +3 -0
- package/dist/esm/layouts/shellComponents.d.ts.map +1 -0
- package/dist/esm/layouts/shellComponents.js +27 -0
- package/dist/esm/layouts/shellComponents.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/packageName.d.ts +2 -0
- package/dist/esm/packageName.d.ts.map +1 -0
- package/dist/esm/packageName.js +13 -0
- package/dist/esm/packageName.js.map +1 -0
- package/dist/esm/shell/AppShell.d.ts +3 -0
- package/dist/esm/shell/AppShell.d.ts.map +1 -0
- package/dist/esm/shell/AppShell.js +86 -0
- package/dist/esm/shell/AppShell.js.map +1 -0
- package/dist/esm/shell/Breadcrumb.d.ts +3 -0
- package/dist/esm/shell/Breadcrumb.d.ts.map +1 -0
- package/dist/esm/shell/Breadcrumb.js +31 -0
- package/dist/esm/shell/Breadcrumb.js.map +1 -0
- package/dist/esm/shell/ConfigPanel.d.ts +3 -0
- package/dist/esm/shell/ConfigPanel.d.ts.map +1 -0
- package/dist/esm/shell/ConfigPanel.js +126 -0
- package/dist/esm/shell/ConfigPanel.js.map +1 -0
- package/dist/esm/shell/Footer.d.ts +3 -0
- package/dist/esm/shell/Footer.d.ts.map +1 -0
- package/dist/esm/shell/Footer.js +26 -0
- package/dist/esm/shell/Footer.js.map +1 -0
- package/dist/esm/shell/FullPageShell.d.ts +3 -0
- package/dist/esm/shell/FullPageShell.d.ts.map +1 -0
- package/dist/esm/shell/FullPageShell.js +51 -0
- package/dist/esm/shell/FullPageShell.js.map +1 -0
- package/dist/esm/shell/LayoutModeSwitcher.d.ts +3 -0
- package/dist/esm/shell/LayoutModeSwitcher.d.ts.map +1 -0
- package/dist/esm/shell/LayoutModeSwitcher.js +56 -0
- package/dist/esm/shell/LayoutModeSwitcher.js.map +1 -0
- package/dist/esm/shell/LayoutModes.stories.d.ts +29 -0
- package/dist/esm/shell/LayoutModes.stories.d.ts.map +1 -0
- package/dist/esm/shell/LayoutModes.stories.js +43 -0
- package/dist/esm/shell/LayoutModes.stories.js.map +1 -0
- package/dist/esm/shell/Logo.d.ts +3 -0
- package/dist/esm/shell/Logo.d.ts.map +1 -0
- package/dist/esm/shell/Logo.js +42 -0
- package/dist/esm/shell/Logo.js.map +1 -0
- package/dist/esm/shell/Mask.d.ts +3 -0
- package/dist/esm/shell/Mask.d.ts.map +1 -0
- package/dist/esm/shell/Mask.js +31 -0
- package/dist/esm/shell/Mask.js.map +1 -0
- package/dist/esm/shell/Menu.d.ts +3 -0
- package/dist/esm/shell/Menu.d.ts.map +1 -0
- package/dist/esm/shell/Menu.js +34 -0
- package/dist/esm/shell/Menu.js.map +1 -0
- package/dist/esm/shell/MenuItem.d.ts +3 -0
- package/dist/esm/shell/MenuItem.d.ts.map +1 -0
- package/dist/esm/shell/MenuItem.js +63 -0
- package/dist/esm/shell/MenuItem.js.map +1 -0
- package/dist/esm/shell/PageHeader.d.ts +3 -0
- package/dist/esm/shell/PageHeader.d.ts.map +1 -0
- package/dist/esm/shell/PageHeader.js +41 -0
- package/dist/esm/shell/PageHeader.js.map +1 -0
- package/dist/esm/shell/RightPanel.d.ts +3 -0
- package/dist/esm/shell/RightPanel.d.ts.map +1 -0
- package/dist/esm/shell/RightPanel.js +28 -0
- package/dist/esm/shell/RightPanel.js.map +1 -0
- package/dist/esm/shell/Sidebar.d.ts +3 -0
- package/dist/esm/shell/Sidebar.d.ts.map +1 -0
- package/dist/esm/shell/Sidebar.js +49 -0
- package/dist/esm/shell/Sidebar.js.map +1 -0
- package/dist/esm/shell/ThemeOption.d.ts +10 -0
- package/dist/esm/shell/ThemeOption.d.ts.map +1 -0
- package/dist/esm/shell/ThemeOption.js +39 -0
- package/dist/esm/shell/ThemeOption.js.map +1 -0
- package/dist/esm/shell/ThemeSwitcher.d.ts +3 -0
- package/dist/esm/shell/ThemeSwitcher.d.ts.map +1 -0
- package/dist/esm/shell/ThemeSwitcher.js +48 -0
- package/dist/esm/shell/ThemeSwitcher.js.map +1 -0
- package/dist/esm/shell/Topbar.d.ts +3 -0
- package/dist/esm/shell/Topbar.d.ts.map +1 -0
- package/dist/esm/shell/Topbar.js +52 -0
- package/dist/esm/shell/Topbar.js.map +1 -0
- package/dist/esm/shell/UserMenu.d.ts +3 -0
- package/dist/esm/shell/UserMenu.d.ts.map +1 -0
- package/dist/esm/shell/UserMenu.js +66 -0
- package/dist/esm/shell/UserMenu.js.map +1 -0
- package/dist/esm/shell/elementProperties.d.ts +9 -0
- package/dist/esm/shell/elementProperties.d.ts.map +1 -0
- package/dist/esm/shell/elementProperties.js +48 -0
- package/dist/esm/shell/elementProperties.js.map +1 -0
- package/dist/esm/shell/index.d.ts +19 -0
- package/dist/esm/shell/index.d.ts.map +1 -0
- package/dist/esm/shell/index.js +19 -0
- package/dist/esm/shell/index.js.map +1 -0
- package/dist/esm/themes/LayoutThemeProvider.d.ts +9 -0
- package/dist/esm/themes/LayoutThemeProvider.d.ts.map +1 -0
- package/dist/esm/themes/LayoutThemeProvider.js +31 -0
- package/dist/esm/themes/LayoutThemeProvider.js.map +1 -0
- package/dist/esm/themes/Theming.stories.d.ts +21 -0
- package/dist/esm/themes/Theming.stories.d.ts.map +1 -0
- package/dist/esm/themes/Theming.stories.js +54 -0
- package/dist/esm/themes/Theming.stories.js.map +1 -0
- package/dist/esm/themes/blueprintThemeCompatibility.d.ts +2 -0
- package/dist/esm/themes/blueprintThemeCompatibility.d.ts.map +1 -0
- package/dist/esm/themes/blueprintThemeCompatibility.js +26 -0
- package/dist/esm/themes/blueprintThemeCompatibility.js.map +1 -0
- package/dist/esm/themes/dark.d.ts +3 -0
- package/dist/esm/themes/dark.d.ts.map +1 -0
- package/dist/esm/themes/dark.js +38 -0
- package/dist/esm/themes/dark.js.map +1 -0
- package/dist/esm/themes/defaultBlueprintThemes.d.ts +3 -0
- package/dist/esm/themes/defaultBlueprintThemes.d.ts.map +1 -0
- package/dist/esm/themes/defaultBlueprintThemes.js +17 -0
- package/dist/esm/themes/defaultBlueprintThemes.js.map +1 -0
- package/dist/esm/themes/index.d.ts +6 -0
- package/dist/esm/themes/index.d.ts.map +1 -0
- package/dist/esm/themes/index.js +6 -0
- package/dist/esm/themes/index.js.map +1 -0
- package/dist/esm/themes/light.d.ts +3 -0
- package/dist/esm/themes/light.d.ts.map +1 -0
- package/dist/esm/themes/light.js +41 -0
- package/dist/esm/themes/light.js.map +1 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -0
- package/for_AppShell/when_rendering_a_gallery_screen.tsx +76 -0
- package/for_LayoutConfigProvider/when_switching_mode_and_reloading.tsx +77 -0
- package/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.ts +42 -0
- package/for_defaultBlueprint/when_validating_the_bundle.ts +43 -0
- package/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.ts +50 -0
- package/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.ts +36 -0
- package/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.ts +53 -0
- package/for_galleryScreenTemplates/when_following_the_nesting_chain.ts +41 -0
- package/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.ts +44 -0
- package/for_galleryScreens/when_resolving_the_component_names_they_reference.ts +60 -0
- package/for_layoutConfigStorage/when_restoring_a_persisted_configuration.ts +76 -0
- package/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.ts +44 -0
- package/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.ts +61 -0
- package/for_layoutWrapperClasses/when_rendering_each_mode.ts +63 -0
- package/for_navigation/when_aggregating_the_navigation_contributions.ts +50 -0
- package/gallery/ApplicationScreens.stories.tsx +70 -0
- package/gallery/FullPageScreens.stories.tsx +60 -0
- package/gallery/GalleryScreenPreview.tsx +68 -0
- package/gallery/NavigationEntry.ts +27 -0
- package/gallery/TemplateSlotName.ts +36 -0
- package/gallery/applicationChrome.ts +110 -0
- package/gallery/authTemplates.ts +161 -0
- package/gallery/componentNames.ts +55 -0
- package/gallery/composeScreen.ts +95 -0
- package/gallery/dependencyComponentNames.ts +64 -0
- package/gallery/dialogTemplates.ts +79 -0
- package/gallery/elements.ts +65 -0
- package/gallery/index.ts +22 -0
- package/gallery/navigation.ts +71 -0
- package/gallery/nesting.ts +82 -0
- package/gallery/previewProfile.ts +59 -0
- package/gallery/resolveElementNames.ts +55 -0
- package/gallery/screens.ts +111 -0
- package/gallery/statusTemplates.ts +118 -0
- package/gallery/supportTemplates.ts +164 -0
- package/gallery/widgets.ts +63 -0
- package/gallery/workspaceTemplates.ts +198 -0
- package/index.ts +12 -0
- package/layouts/LayoutName.ts +18 -0
- package/layouts/SlotName.ts +44 -0
- package/layouts/appShell.ts +106 -0
- package/layouts/defaultLayouts.ts +15 -0
- package/layouts/flowBuilders.ts +49 -0
- package/layouts/fullPage.ts +48 -0
- package/layouts/index.ts +10 -0
- package/layouts/shellComponents.ts +28 -0
- package/package.json +68 -0
- package/packageName.ts +12 -0
- package/shell/AppShell.tsx +66 -0
- package/shell/Breadcrumb.tsx +31 -0
- package/shell/ConfigPanel.tsx +105 -0
- package/shell/Footer.tsx +23 -0
- package/shell/FullPageShell.tsx +41 -0
- package/shell/LayoutModeSwitcher.tsx +50 -0
- package/shell/LayoutModes.stories.tsx +83 -0
- package/shell/Logo.tsx +30 -0
- package/shell/Mask.tsx +29 -0
- package/shell/Menu.tsx +26 -0
- package/shell/MenuItem.tsx +39 -0
- package/shell/PageHeader.tsx +28 -0
- package/shell/RightPanel.tsx +23 -0
- package/shell/Sidebar.tsx +45 -0
- package/shell/ThemeOption.ts +60 -0
- package/shell/ThemeSwitcher.tsx +42 -0
- package/shell/Topbar.tsx +49 -0
- package/shell/UserMenu.tsx +53 -0
- package/shell/elementProperties.ts +64 -0
- package/shell/index.ts +21 -0
- package/shell/layout.css +821 -0
- package/themes/LayoutThemeProvider.tsx +41 -0
- package/themes/Theming.stories.tsx +89 -0
- package/themes/blueprintThemeCompatibility.ts +19 -0
- package/themes/dark.ts +38 -0
- package/themes/defaultBlueprintThemes.ts +14 -0
- package/themes/index.ts +8 -0
- package/themes/light.ts +41 -0
|
@@ -0,0 +1,61 @@
|
|
|
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 {
|
|
5
|
+
LayoutMode,
|
|
6
|
+
defaultLayoutConfigState,
|
|
7
|
+
effectiveLayoutMode,
|
|
8
|
+
isMobileWidth,
|
|
9
|
+
layoutModes,
|
|
10
|
+
layoutWrapperClasses,
|
|
11
|
+
mobileBreakpoint,
|
|
12
|
+
toggleSidebar,
|
|
13
|
+
withMobile,
|
|
14
|
+
withMode,
|
|
15
|
+
} from '../configuration';
|
|
16
|
+
|
|
17
|
+
describe('when the viewport crosses the mobile breakpoint', () => {
|
|
18
|
+
const desktop = withMode(defaultLayoutConfigState(), LayoutMode.Slim);
|
|
19
|
+
const mobile = withMobile(desktop, true);
|
|
20
|
+
const backToDesktop = withMobile(mobile, false);
|
|
21
|
+
|
|
22
|
+
it('should treat the breakpoint itself as mobile, matching the stylesheet', () => {
|
|
23
|
+
isMobileWidth(mobileBreakpoint).should.be.true;
|
|
24
|
+
isMobileWidth(mobileBreakpoint + 1).should.be.false;
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('should force every mode off-canvas below the breakpoint', () => {
|
|
28
|
+
for (const mode of layoutModes) {
|
|
29
|
+
effectiveLayoutMode(withMobile(withMode(desktop, mode), true)).should.equal(LayoutMode.Overlay);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('should keep the chosen mode rather than overwriting it', () => {
|
|
34
|
+
mobile.mode.should.equal(LayoutMode.Slim);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('should close the sidebar on the way in so the page is not covered on arrival', () => {
|
|
38
|
+
mobile.isSidebarOpen.should.be.false;
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('should mark the wrapper mobile', () => {
|
|
42
|
+
layoutWrapperClasses(mobile).should.contain('layout-mobile');
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('should mark the wrapper mobile-active once the sidebar is opened', () => {
|
|
46
|
+
layoutWrapperClasses(toggleSidebar(mobile)).should.contain('layout-mobile-active');
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('should restore the chosen mode on the way back out', () => {
|
|
50
|
+
effectiveLayoutMode(backToDesktop).should.equal(LayoutMode.Slim);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('should leave the state untouched when the regime has not actually changed', () => {
|
|
54
|
+
withMobile(mobile, true).should.equal(mobile);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it('should reopen a static sidebar on the way back out, since docked is its resting state', () => {
|
|
58
|
+
const staticMobile = withMobile(withMode(defaultLayoutConfigState(), LayoutMode.Static), true);
|
|
59
|
+
withMobile(staticMobile, false).isSidebarOpen.should.be.true;
|
|
60
|
+
});
|
|
61
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
LayoutMode,
|
|
6
|
+
defaultLayoutConfigState,
|
|
7
|
+
isLayoutMaskVisible,
|
|
8
|
+
layoutModes,
|
|
9
|
+
layoutWrapperClasses,
|
|
10
|
+
toggleSidebar,
|
|
11
|
+
withMobile,
|
|
12
|
+
withMode,
|
|
13
|
+
withSidebarAnchored,
|
|
14
|
+
withSidebarRevealed,
|
|
15
|
+
} from '../configuration';
|
|
16
|
+
|
|
17
|
+
describe('when rendering each mode', () => {
|
|
18
|
+
const started = defaultLayoutConfigState();
|
|
19
|
+
|
|
20
|
+
it('should always start with the wrapper class', () => {
|
|
21
|
+
layoutWrapperClasses(started)[0].should.equal('layout-wrapper');
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
for (const mode of layoutModes) {
|
|
25
|
+
it(`should put the '${mode}' mode class on the wrapper`, () => {
|
|
26
|
+
layoutWrapperClasses(withMode(started, mode)).should.contain(`layout-${mode}`);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
it('should mark a closed static sidebar inactive', () => {
|
|
31
|
+
layoutWrapperClasses(toggleSidebar(withMode(started, LayoutMode.Static))).should.contain('layout-static-inactive');
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('should not mark an open static sidebar inactive', () => {
|
|
35
|
+
layoutWrapperClasses(withMode(started, LayoutMode.Static)).should.not.contain('layout-static-inactive');
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('should mark an opened overlay sidebar active', () => {
|
|
39
|
+
layoutWrapperClasses(toggleSidebar(withMode(started, LayoutMode.Overlay))).should.contain('layout-overlay-active');
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('should mark a revealed sidebar active', () => {
|
|
43
|
+
layoutWrapperClasses(withSidebarRevealed(withMode(started, LayoutMode.Reveal), true)).should.contain('layout-sidebar-active');
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('should mark an anchored sidebar anchored', () => {
|
|
47
|
+
layoutWrapperClasses(withSidebarAnchored(withMode(started, LayoutMode.Drawer), true)).should.contain('layout-sidebar-anchored');
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('should not mark a static sidebar anchored, since only reveal and drawer answer to the pointer', () => {
|
|
51
|
+
layoutWrapperClasses(withSidebarAnchored(withMode(started, LayoutMode.Static), true)).should.not.contain('layout-sidebar-anchored');
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('should show the mask only while a floating sidebar is open', () => {
|
|
55
|
+
isLayoutMaskVisible(toggleSidebar(withMode(started, LayoutMode.Overlay))).should.be.true;
|
|
56
|
+
isLayoutMaskVisible(withMode(started, LayoutMode.Overlay)).should.be.false;
|
|
57
|
+
isLayoutMaskVisible(withMode(started, LayoutMode.Static)).should.be.false;
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it('should show the mask on mobile once the sidebar is opened, whatever the chosen mode', () => {
|
|
61
|
+
isLayoutMaskVisible(toggleSidebar(withMobile(withMode(started, LayoutMode.Horizontal), true))).should.be.true;
|
|
62
|
+
});
|
|
63
|
+
});
|
|
@@ -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 { NavigationItem } from '@cratis/scene.model';
|
|
5
|
+
import { aggregateContributions } from '@cratis/scene.engine';
|
|
6
|
+
import { extractNavigationItem } from '@cratis/scene.react';
|
|
7
|
+
import { galleryScreen, galleryScreenTemplates, navigationContributionPoint, navigationContributions, navigationEntries } from '../gallery';
|
|
8
|
+
|
|
9
|
+
describe('when aggregating the navigation contributions', () => {
|
|
10
|
+
const aggregated = aggregateContributions(navigationContributions, navigationContributionPoint);
|
|
11
|
+
const items = aggregated.map(extractNavigationItem).filter((item): item is NavigationItem => item !== undefined);
|
|
12
|
+
|
|
13
|
+
it('should aggregate one contribution per navigation entry', () => {
|
|
14
|
+
aggregated.should.have.lengthOf(navigationEntries.length);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('should extract every one of them as a navigation item', () => {
|
|
18
|
+
items.should.have.lengthOf(navigationEntries.length);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('should carry the label and target screen through the property bag unchanged', () => {
|
|
22
|
+
const dashboard = items.find(item => item.targetScreen === 'Dashboard');
|
|
23
|
+
dashboard!.label.should.equal('Dashboard');
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('should carry the group so an aggregated navigation can section itself', () => {
|
|
27
|
+
items.filter(item => item.group === undefined).should.be.empty;
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('should carry a route parameter bag rather than leaving it undefined', () => {
|
|
31
|
+
items.filter(item => item.routeParameterBindings === undefined).should.be.empty;
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('should point every entry at a screen template this blueprint provides', () => {
|
|
35
|
+
const provided = new Set(galleryScreenTemplates.map(template => template.name));
|
|
36
|
+
items.filter(item => !provided.has(item.targetScreen)).map(item => item.targetScreen).should.be.empty;
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('should point every entry at a screen the gallery actually ships', () => {
|
|
40
|
+
items.filter(item => galleryScreen(item.targetScreen) === undefined).map(item => item.targetScreen).should.be.empty;
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('should carry the contributions on every application-shell screen', () => {
|
|
44
|
+
galleryScreen('Dashboard')!.contributions.should.have.lengthOf(navigationEntries.length);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('should not carry navigation on a full-page screen, which has no navigation to render', () => {
|
|
48
|
+
galleryScreen('Login')!.contributions.should.be.empty;
|
|
49
|
+
});
|
|
50
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
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 { GalleryScreenPreview } from './GalleryScreenPreview';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Every screen template that renders inside the application shell, booted through the real engine.
|
|
9
|
+
*
|
|
10
|
+
* Each story resolves the screen's bare component names against the gallery profile and renders the result
|
|
11
|
+
* with `SceneElementView` and the real registry - the same path Studio's preview and a shipped application
|
|
12
|
+
* take. Nothing is rendered by calling a shell component directly, because a story that did would prove
|
|
13
|
+
* only that the component compiles.
|
|
14
|
+
*/
|
|
15
|
+
const meta = {
|
|
16
|
+
title: 'Blueprint/Application screens',
|
|
17
|
+
component: GalleryScreenPreview,
|
|
18
|
+
parameters: {
|
|
19
|
+
layout: 'fullscreen',
|
|
20
|
+
docs: {
|
|
21
|
+
description: {
|
|
22
|
+
component: 'The ten in-application screen templates plus the three-level nesting chain, each booted through the real engine as a screen.',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
tags: ['autodocs'],
|
|
27
|
+
} satisfies Meta<typeof GalleryScreenPreview>;
|
|
28
|
+
|
|
29
|
+
export default meta;
|
|
30
|
+
|
|
31
|
+
type Story = StoryObj<typeof meta>;
|
|
32
|
+
|
|
33
|
+
/** Four stat cards over two columns of widgets. */
|
|
34
|
+
export const Dashboard: Story = { args: { screenName: 'Dashboard' } };
|
|
35
|
+
|
|
36
|
+
/** A searchable product table with a header and a primary action. */
|
|
37
|
+
export const List: Story = { args: { screenName: 'CrudList' } };
|
|
38
|
+
|
|
39
|
+
/** One record: header, sections and a summary panel. */
|
|
40
|
+
export const Detail: Story = { args: { screenName: 'DetailView' } };
|
|
41
|
+
|
|
42
|
+
/** A grouped form covering the field types an application actually uses. */
|
|
43
|
+
export const Form: Story = { args: { screenName: 'FormPage' } };
|
|
44
|
+
|
|
45
|
+
/** The designed empty state for a list with nothing in it yet. */
|
|
46
|
+
export const Empty: Story = { args: { screenName: 'Empty' } };
|
|
47
|
+
|
|
48
|
+
/** Prose with a table of contents beside it. */
|
|
49
|
+
export const Documentation: Story = { args: { screenName: 'Documentation' } };
|
|
50
|
+
|
|
51
|
+
/** The signed-in user editing their own account. */
|
|
52
|
+
export const ProfileSettings: Story = { args: { screenName: 'ProfileSettings' } };
|
|
53
|
+
|
|
54
|
+
/** The people table, with roles and an invitation action. */
|
|
55
|
+
export const UserManagement: Story = { args: { screenName: 'UserManagement' } };
|
|
56
|
+
|
|
57
|
+
/** A printable document: parties, line items and totals. */
|
|
58
|
+
export const Invoice: Story = { args: { screenName: 'Invoice' } };
|
|
59
|
+
|
|
60
|
+
/** Searchable answers with a route to a human. */
|
|
61
|
+
export const Help: Story = { args: { screenName: 'Help' } };
|
|
62
|
+
|
|
63
|
+
/** Module level: a template fitting the application layout's content slot. */
|
|
64
|
+
export const ModuleWorkspace: Story = { args: { screenName: 'ModuleWorkspace' } };
|
|
65
|
+
|
|
66
|
+
/** Feature level: a template fitting a slot the module template declares. */
|
|
67
|
+
export const FeatureSection: Story = { args: { screenName: 'FeatureSection' } };
|
|
68
|
+
|
|
69
|
+
/** Slice level: three templates deep, still landing in the layout's content slot. */
|
|
70
|
+
export const SliceSection: Story = { args: { screenName: 'SliceSection' } };
|
|
@@ -0,0 +1,60 @@
|
|
|
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 { GalleryScreenPreview } from './GalleryScreenPreview';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Every screen template that renders in the chrome-less shell.
|
|
9
|
+
*
|
|
10
|
+
* These have no navigation, no breadcrumb and no sidebar - which is exactly why they use a different
|
|
11
|
+
* layout rather than a stripped-down application shell. The configurator is still there, because a sign-in
|
|
12
|
+
* page has to honor the chosen theme.
|
|
13
|
+
*/
|
|
14
|
+
const meta = {
|
|
15
|
+
title: 'Blueprint/Full-page screens',
|
|
16
|
+
component: GalleryScreenPreview,
|
|
17
|
+
parameters: {
|
|
18
|
+
layout: 'fullscreen',
|
|
19
|
+
docs: {
|
|
20
|
+
description: {
|
|
21
|
+
component: 'The ten chrome-less screens: everything around signing in, the three status pages, and the landing page.',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
tags: ['autodocs'],
|
|
26
|
+
} satisfies Meta<typeof GalleryScreenPreview>;
|
|
27
|
+
|
|
28
|
+
export default meta;
|
|
29
|
+
|
|
30
|
+
type Story = StoryObj<typeof meta>;
|
|
31
|
+
|
|
32
|
+
/** Email and password beside the branding panel. */
|
|
33
|
+
export const Login: Story = { args: { screenName: 'Login' } };
|
|
34
|
+
|
|
35
|
+
/** Account creation, with a strength meter and the terms checkbox. */
|
|
36
|
+
export const Register: Story = { args: { screenName: 'Register' } };
|
|
37
|
+
|
|
38
|
+
/** One field and one button. */
|
|
39
|
+
export const ForgotPassword: Story = { args: { screenName: 'ForgotPassword' } };
|
|
40
|
+
|
|
41
|
+
/** Where a reset link lands. */
|
|
42
|
+
export const NewPassword: Story = { args: { screenName: 'NewPassword' } };
|
|
43
|
+
|
|
44
|
+
/** The code step, with its progress indicator. */
|
|
45
|
+
export const Verification: Story = { args: { screenName: 'Verification' } };
|
|
46
|
+
|
|
47
|
+
/** One person, one password, nothing lost. */
|
|
48
|
+
export const LockScreen: Story = { args: { screenName: 'LockScreen' } };
|
|
49
|
+
|
|
50
|
+
/** A server-side failure, said plainly. */
|
|
51
|
+
export const Error: Story = { args: { screenName: 'Error' } };
|
|
52
|
+
|
|
53
|
+
/** Signed in, and still not allowed. */
|
|
54
|
+
export const AccessDenied: Story = { args: { screenName: 'AccessDenied' } };
|
|
55
|
+
|
|
56
|
+
/** A wrong address, with a search box rather than a dead end. */
|
|
57
|
+
export const NotFound: Story = { args: { screenName: 'NotFound' } };
|
|
58
|
+
|
|
59
|
+
/** The marketing front door, with navigation of its own. */
|
|
60
|
+
export const Landing: Story = { args: { screenName: 'Landing' } };
|
|
@@ -0,0 +1,68 @@
|
|
|
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 { useMemo } from 'react';
|
|
5
|
+
import { Theme } from '@cratis/scene.model';
|
|
6
|
+
import { ComponentRegistry, SceneElementView, coreComponents } from '@cratis/scene.react';
|
|
7
|
+
import { LayoutConfigProvider, LayoutConfigState } from '../configuration';
|
|
8
|
+
import { defaultBlueprintComponents } from '../defaultBlueprintComponents';
|
|
9
|
+
import { LayoutThemeProvider, defaultBlueprintThemes } from '../themes';
|
|
10
|
+
import { composeScreenElement } from './composeScreen';
|
|
11
|
+
import { galleryComponentCatalog, galleryPreviewProfile } from './previewProfile';
|
|
12
|
+
import { resolveElementComponentNames } from './resolveElementNames';
|
|
13
|
+
import { galleryScreen } from './screens';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The registry a preview resolves against when a host does not supply one: `core` plus this blueprint.
|
|
17
|
+
*
|
|
18
|
+
* Merged by hand rather than through `mergePackageRegistries`, because reaching for this blueprint's
|
|
19
|
+
* *bundle* here would be circular - the bundle is assembled from the gallery this file belongs to. Registry
|
|
20
|
+
* keys carry their package name, so merge order cannot cause a collision either way.
|
|
21
|
+
*/
|
|
22
|
+
export const galleryPreviewRegistry: ComponentRegistry = { ...coreComponents, ...defaultBlueprintComponents };
|
|
23
|
+
|
|
24
|
+
export interface GalleryScreenPreviewProps {
|
|
25
|
+
/** The name of the gallery screen to boot. */
|
|
26
|
+
screenName: string;
|
|
27
|
+
|
|
28
|
+
/** Configuration to start from - a story pinning a mode, or a host restoring a session. */
|
|
29
|
+
initialConfig?: Partial<LayoutConfigState>;
|
|
30
|
+
|
|
31
|
+
/** The themes the configurator may switch between. Defaults to the two this blueprint ships. */
|
|
32
|
+
themes?: Theme[];
|
|
33
|
+
|
|
34
|
+
/** The component registry to render against. Defaults to `core` plus this blueprint's own components. */
|
|
35
|
+
registry?: ComponentRegistry;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Boots one gallery screen through the real engine.
|
|
40
|
+
*
|
|
41
|
+
* Nothing here is a preview-only path: the screen is a real {@link Screen}, its element tree is resolved by
|
|
42
|
+
* the real `resolveComponentName`, and it is rendered by the real `SceneElementView` against the real
|
|
43
|
+
* registry. That is the point of shipping a gallery at all - a mockup proves that someone can draw a
|
|
44
|
+
* dashboard, and this proves the blueprint renders one.
|
|
45
|
+
*
|
|
46
|
+
* Component names belonging to packages the host has not loaded resolve but find no implementation, and
|
|
47
|
+
* come out as `UnresolvedComponent`'s dashed red box naming what is missing. That is the designed outcome:
|
|
48
|
+
* a preview of a blueprint against half a profile should look visibly incomplete rather than quietly
|
|
49
|
+
* wrong.
|
|
50
|
+
*/
|
|
51
|
+
export function GalleryScreenPreview({ screenName, initialConfig, themes = defaultBlueprintThemes, registry = galleryPreviewRegistry }: GalleryScreenPreviewProps) {
|
|
52
|
+
const element = useMemo(() => {
|
|
53
|
+
const screen = galleryScreen(screenName);
|
|
54
|
+
if (!screen) {
|
|
55
|
+
throw new Error(`The gallery has no screen named '${screenName}'.`);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return resolveElementComponentNames(composeScreenElement(screen), galleryPreviewProfile, galleryComponentCatalog);
|
|
59
|
+
}, [screenName]);
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<LayoutConfigProvider initialConfig={initialConfig} storage={null}>
|
|
63
|
+
<LayoutThemeProvider themes={themes}>
|
|
64
|
+
<SceneElementView element={element} registry={registry} resolveBinding={() => undefined} />
|
|
65
|
+
</LayoutThemeProvider>
|
|
66
|
+
</LayoutConfigProvider>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
/**
|
|
5
|
+
* One entry in the gallery's navigation.
|
|
6
|
+
*
|
|
7
|
+
* The fields are deliberately the ones {@link NavigationItem} carries, plus an icon. That is what lets a
|
|
8
|
+
* single declaration become both a sidebar entry and a `Navigation` contribution: the element built from
|
|
9
|
+
* it carries these values in its `properties` bag, `extractNavigationItem` reads them straight back out,
|
|
10
|
+
* and neither side has to be kept in step with the other by hand.
|
|
11
|
+
*/
|
|
12
|
+
export interface NavigationEntry {
|
|
13
|
+
/** What the entry is called. */
|
|
14
|
+
label: string;
|
|
15
|
+
|
|
16
|
+
/** The screen it navigates to. */
|
|
17
|
+
targetScreen: string;
|
|
18
|
+
|
|
19
|
+
/** A PrimeIcons class for the entry's icon. */
|
|
20
|
+
icon: string;
|
|
21
|
+
|
|
22
|
+
/** The section it belongs to, so the menu and an aggregated navigation group it the same way. */
|
|
23
|
+
group: string;
|
|
24
|
+
|
|
25
|
+
/** Where it sorts within its group. */
|
|
26
|
+
order: number;
|
|
27
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
/**
|
|
5
|
+
* The slots the gallery's screen templates offer to whatever they contain.
|
|
6
|
+
*
|
|
7
|
+
* Distinct from {@link SlotName}, which is the *layout's* vocabulary. A screen template declares its own
|
|
8
|
+
* slots, and a template nested inside it names one of these in `fitsSlot` - so the same name means
|
|
9
|
+
* different places at different depths, and that is fine: `fitsSlot` is always resolved against the direct
|
|
10
|
+
* parent, never globally.
|
|
11
|
+
*/
|
|
12
|
+
export enum TemplateSlotName {
|
|
13
|
+
/** A template's own title area. */
|
|
14
|
+
Header = 'header',
|
|
15
|
+
|
|
16
|
+
/** The main region a nested template fits into. */
|
|
17
|
+
Body = 'body',
|
|
18
|
+
|
|
19
|
+
/** An optional column beside the body. */
|
|
20
|
+
SidePanel = 'sidePanel',
|
|
21
|
+
|
|
22
|
+
/** The action strip above a body. */
|
|
23
|
+
Toolbar = 'toolbar',
|
|
24
|
+
|
|
25
|
+
/** Buttons belonging to a header or a form. */
|
|
26
|
+
Actions = 'actions',
|
|
27
|
+
|
|
28
|
+
/** The row of figures a dashboard opens with. */
|
|
29
|
+
Stats = 'stats',
|
|
30
|
+
|
|
31
|
+
/** The larger left-hand column of a dashboard. */
|
|
32
|
+
Primary = 'primary',
|
|
33
|
+
|
|
34
|
+
/** The narrower right-hand column of a dashboard. */
|
|
35
|
+
Secondary = 'secondary',
|
|
36
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import { SceneElement } from '@cratis/scene.model';
|
|
5
|
+
import { ComponentName } from '../ComponentName';
|
|
6
|
+
import { SlotName } from '../layouts';
|
|
7
|
+
import { defaultBlueprintThemes } from '../themes';
|
|
8
|
+
import { externalComponent } from './elements';
|
|
9
|
+
import { entriesInGroup, navigationElement, navigationGroups } from './navigation';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The chrome every screen in the application shell shares: the topbar, the sidebar, the menu, the footer
|
|
13
|
+
* and the configurator.
|
|
14
|
+
*
|
|
15
|
+
* It is built once, per screen, rather than repeated in twenty templates. A screen template describes what
|
|
16
|
+
* is *different* about a screen; if it also had to describe the topbar, then adding an item to the menu
|
|
17
|
+
* would mean editing twenty files, and nineteen of them would eventually be missed.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/** The brand mark, shared by the topbar and the sidebar header. */
|
|
21
|
+
function logo(id: string): SceneElement {
|
|
22
|
+
return externalComponent(id, ComponentName.Logo, { label: 'Contoso', initials: 'C', targetScreen: 'Dashboard' });
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** One menu section per navigation group, each holding that group's entries. */
|
|
26
|
+
function menuSections(activeScreen: string): SceneElement[] {
|
|
27
|
+
return navigationGroups.map(group =>
|
|
28
|
+
externalComponent(
|
|
29
|
+
`menu-${group.toLowerCase()}`,
|
|
30
|
+
ComponentName.Menu,
|
|
31
|
+
{ title: group, label: group },
|
|
32
|
+
{ items: entriesInGroup(group).map(entry => navigationElement(entry, activeScreen)) },
|
|
33
|
+
),
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** The configurator, offering the themes this blueprint ships. */
|
|
38
|
+
function configPanel(): SceneElement {
|
|
39
|
+
return externalComponent(ComponentName.ConfigPanel, ComponentName.ConfigPanel, {
|
|
40
|
+
title: 'Settings',
|
|
41
|
+
themes: defaultBlueprintThemes.map(theme => ({ name: theme.name, label: theme.name, isDark: theme.isDark ?? false })),
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** One trail entry: a label, and the screen it goes back to. */
|
|
46
|
+
export interface BreadcrumbEntry {
|
|
47
|
+
/** What the entry is called. */
|
|
48
|
+
label: string;
|
|
49
|
+
|
|
50
|
+
/** The screen it navigates back to, or undefined for the current page. */
|
|
51
|
+
targetScreen?: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The application shell's slot content for one screen.
|
|
56
|
+
*
|
|
57
|
+
* Only the breadcrumb and which menu entry is marked active differ from screen to screen - everything else
|
|
58
|
+
* is identical, which is the point of chrome.
|
|
59
|
+
*
|
|
60
|
+
* @param activeScreen The screen being rendered, so its menu entry is marked current.
|
|
61
|
+
* @param breadcrumb The trail above the content.
|
|
62
|
+
* @returns Slot content keyed by the {@link SlotName}s the `AppShell` layout declares.
|
|
63
|
+
*/
|
|
64
|
+
export function applicationChrome(activeScreen: string, breadcrumb: BreadcrumbEntry[]): Record<string, SceneElement[]> {
|
|
65
|
+
return {
|
|
66
|
+
[SlotName.Topbar]: [
|
|
67
|
+
externalComponent(
|
|
68
|
+
'topbar',
|
|
69
|
+
ComponentName.Topbar,
|
|
70
|
+
{},
|
|
71
|
+
{
|
|
72
|
+
logo: [logo('topbar-logo')],
|
|
73
|
+
end: [
|
|
74
|
+
externalComponent('topbar-user', ComponentName.UserMenu, {
|
|
75
|
+
name: 'Amelia Nyquist',
|
|
76
|
+
role: 'Owner',
|
|
77
|
+
initials: 'AN',
|
|
78
|
+
items: [
|
|
79
|
+
{ label: 'Your profile', icon: 'pi pi-user', targetScreen: 'ProfileSettings' },
|
|
80
|
+
{ label: 'Help', icon: 'pi pi-question-circle', targetScreen: 'Help' },
|
|
81
|
+
{ label: 'Lock', icon: 'pi pi-lock', targetScreen: 'LockScreen' },
|
|
82
|
+
],
|
|
83
|
+
}),
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
),
|
|
87
|
+
],
|
|
88
|
+
[SlotName.Sidebar]: [externalComponent('sidebar', ComponentName.Sidebar, { title: 'Contoso' }, { logo: [logo('sidebar-logo')] })],
|
|
89
|
+
[SlotName.Menu]: menuSections(activeScreen),
|
|
90
|
+
[SlotName.Breadcrumb]: [
|
|
91
|
+
externalComponent('breadcrumb', ComponentName.Breadcrumb, {
|
|
92
|
+
homeTargetScreen: 'Dashboard',
|
|
93
|
+
items: breadcrumb,
|
|
94
|
+
}),
|
|
95
|
+
],
|
|
96
|
+
[SlotName.Footer]: [externalComponent('footer', ComponentName.Footer, { text: '© Contoso · Built with Cratis Scene' })],
|
|
97
|
+
[SlotName.ConfigPanel]: [configPanel()],
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* The full-page shell's slot content: the configurator and nothing else.
|
|
103
|
+
*
|
|
104
|
+
* A sign-in screen has no navigation to render, but it does have to honor the chosen theme - it is very
|
|
105
|
+
* often the first page anyone sees, and arriving at a light sign-in page before a dark application is a
|
|
106
|
+
* jarring way to start.
|
|
107
|
+
*/
|
|
108
|
+
export function fullPageChrome(): Record<string, SceneElement[]> {
|
|
109
|
+
return { [SlotName.ConfigPanel]: [configPanel()] };
|
|
110
|
+
}
|