@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,198 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import { ScreenTemplate, WidthSizeClass } from '@cratis/scene.model';
|
|
5
|
+
import { SlotName, column, grid, slotLeaf } from '../layouts';
|
|
6
|
+
import { TemplateSlotName } from './TemplateSlotName';
|
|
7
|
+
import { button, card, externalComponent, text } from './elements';
|
|
8
|
+
import { emptyState, field, formActions, pageHeader, statCard, table, widget } from './widgets';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The five workhorse shapes inside an application shell: a dashboard, a list, a detail, a form and the
|
|
12
|
+
* designed empty state.
|
|
13
|
+
*
|
|
14
|
+
* Every one fits the layout's `content` slot, and every one carries realistic seeded content rather than
|
|
15
|
+
* placeholder text. A gallery whose dashboard shows four boxes labeled "Card" proves the renderer runs; a
|
|
16
|
+
* gallery whose dashboard shows revenue, orders, customers and a real table proves the blueprint is worth
|
|
17
|
+
* starting an application from.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The dashboard: four figures across the top, then two columns of larger widgets.
|
|
22
|
+
*
|
|
23
|
+
* This is Sakai's composition, and the reason to copy it is that it is the arrangement people already read
|
|
24
|
+
* fluently - the eye takes the row of numbers first and then settles into the detail.
|
|
25
|
+
*
|
|
26
|
+
* Its own arrangement collapses the two columns into one at a compact width, because a two-column widget
|
|
27
|
+
* grid on a phone is two columns of unreadable slivers.
|
|
28
|
+
*/
|
|
29
|
+
export const dashboardTemplate: ScreenTemplate = {
|
|
30
|
+
name: 'Dashboard',
|
|
31
|
+
fitsSlot: SlotName.Content,
|
|
32
|
+
slots: [{ name: TemplateSlotName.Stats }, { name: TemplateSlotName.Primary }, { name: TemplateSlotName.Secondary }],
|
|
33
|
+
arrangement: {
|
|
34
|
+
root: column([slotLeaf(TemplateSlotName.Stats), grid([slotLeaf(TemplateSlotName.Primary, { span: 2 }), slotLeaf(TemplateSlotName.Secondary)], 3, 16)]),
|
|
35
|
+
overrides: [
|
|
36
|
+
{
|
|
37
|
+
width: WidthSizeClass.Compact,
|
|
38
|
+
root: column([slotLeaf(TemplateSlotName.Stats), slotLeaf(TemplateSlotName.Primary), slotLeaf(TemplateSlotName.Secondary)], 16),
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
content: {
|
|
43
|
+
[TemplateSlotName.Stats]: [
|
|
44
|
+
statCard('stat-revenue', 'Revenue', '$284,120', '+12.4% this month', 'pi pi-dollar'),
|
|
45
|
+
statCard('stat-orders', 'Orders', '1,842', '+3.1% this month', 'pi pi-shopping-cart'),
|
|
46
|
+
statCard('stat-customers', 'Customers', '9,410', '+128 new', 'pi pi-users'),
|
|
47
|
+
statCard('stat-open', 'Open tickets', '17', '-4 since Monday', 'pi pi-inbox'),
|
|
48
|
+
],
|
|
49
|
+
[TemplateSlotName.Primary]: [
|
|
50
|
+
widget('widget-revenue', 'Revenue over time', [
|
|
51
|
+
table(
|
|
52
|
+
'revenue-table',
|
|
53
|
+
[
|
|
54
|
+
{ field: 'month', header: 'Month' },
|
|
55
|
+
{ field: 'revenue', header: 'Revenue' },
|
|
56
|
+
{ field: 'change', header: 'Change' },
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
{ month: 'March', revenue: '$284,120', change: '+12.4%' },
|
|
60
|
+
{ month: 'February', revenue: '$252,780', change: '+4.1%' },
|
|
61
|
+
{ month: 'January', revenue: '$242,830', change: '-1.8%' },
|
|
62
|
+
{ month: 'December', revenue: '$247,290', change: '+9.6%' },
|
|
63
|
+
],
|
|
64
|
+
),
|
|
65
|
+
]),
|
|
66
|
+
widget('widget-orders', 'Recent orders', [
|
|
67
|
+
table(
|
|
68
|
+
'orders-table',
|
|
69
|
+
[
|
|
70
|
+
{ field: 'reference', header: 'Reference' },
|
|
71
|
+
{ field: 'customer', header: 'Customer' },
|
|
72
|
+
{ field: 'total', header: 'Total' },
|
|
73
|
+
{ field: 'status', header: 'Status' },
|
|
74
|
+
],
|
|
75
|
+
[
|
|
76
|
+
{ reference: 'ORD-4192', customer: 'Northwind Traders', total: '$1,240.00', status: 'Shipped' },
|
|
77
|
+
{ reference: 'ORD-4191', customer: 'Contoso Ltd', total: '$318.50', status: 'Packing' },
|
|
78
|
+
{ reference: 'ORD-4188', customer: 'Fabrikam', total: '$2,980.00', status: 'Awaiting payment' },
|
|
79
|
+
{ reference: 'ORD-4184', customer: 'Adventure Works', total: '$76.20', status: 'Shipped' },
|
|
80
|
+
],
|
|
81
|
+
),
|
|
82
|
+
]),
|
|
83
|
+
],
|
|
84
|
+
[TemplateSlotName.Secondary]: [
|
|
85
|
+
widget('widget-activity', 'Activity', [externalComponent('activity-timeline', 'timeline', { align: 'left' })]),
|
|
86
|
+
widget('widget-capacity', 'Warehouse capacity', [externalComponent('capacity-bar', 'progressBar', { value: 68 })]),
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
displayName: 'Dashboard',
|
|
90
|
+
description: 'Four stat cards over two columns of widgets - the composition every template line opens with.',
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
/** The list: a filter toolbar, a real table, and the row actions a list needs. */
|
|
94
|
+
export const crudListTemplate: ScreenTemplate = {
|
|
95
|
+
name: 'CrudList',
|
|
96
|
+
fitsSlot: SlotName.Content,
|
|
97
|
+
slots: [{ name: TemplateSlotName.Toolbar }, { name: TemplateSlotName.Body }],
|
|
98
|
+
content: {
|
|
99
|
+
[TemplateSlotName.Toolbar]: [
|
|
100
|
+
pageHeader('crud-header', 'Products', '412 products across 9 categories', [
|
|
101
|
+
button('crud-new', 'New product', { severity: 'primary', icon: 'pi pi-plus' }),
|
|
102
|
+
button('crud-import', 'Import', { severity: 'secondary', icon: 'pi pi-upload' }),
|
|
103
|
+
]),
|
|
104
|
+
externalComponent('crud-search', 'inputText', { placeholder: 'Search products' }),
|
|
105
|
+
],
|
|
106
|
+
[TemplateSlotName.Body]: [
|
|
107
|
+
table(
|
|
108
|
+
'products-table',
|
|
109
|
+
[
|
|
110
|
+
{ field: 'code', header: 'Code' },
|
|
111
|
+
{ field: 'name', header: 'Name' },
|
|
112
|
+
{ field: 'category', header: 'Category' },
|
|
113
|
+
{ field: 'price', header: 'Price' },
|
|
114
|
+
{ field: 'stock', header: 'In stock' },
|
|
115
|
+
],
|
|
116
|
+
[
|
|
117
|
+
{ code: 'P-1001', name: 'Bamboo Watch', category: 'Accessories', price: '$65.00', stock: 24 },
|
|
118
|
+
{ code: 'P-1002', name: 'Black Watch', category: 'Accessories', price: '$72.00', stock: 61 },
|
|
119
|
+
{ code: 'P-1003', name: 'Blue Band', category: 'Fitness', price: '$79.00', stock: 2 },
|
|
120
|
+
{ code: 'P-1004', name: 'Blue T-Shirt', category: 'Clothing', price: '$29.00', stock: 25 },
|
|
121
|
+
{ code: 'P-1005', name: 'Bracelet', category: 'Accessories', price: '$15.00', stock: 73 },
|
|
122
|
+
],
|
|
123
|
+
),
|
|
124
|
+
],
|
|
125
|
+
},
|
|
126
|
+
displayName: 'List',
|
|
127
|
+
description: 'A searchable table with a header, primary action and row data.',
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
/** The detail: a summary panel beside the record's own sections. */
|
|
131
|
+
export const detailViewTemplate: ScreenTemplate = {
|
|
132
|
+
name: 'DetailView',
|
|
133
|
+
fitsSlot: SlotName.Content,
|
|
134
|
+
slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.SidePanel }],
|
|
135
|
+
content: {
|
|
136
|
+
[TemplateSlotName.Header]: [
|
|
137
|
+
pageHeader('detail-header', 'Bamboo Watch', 'P-1001 · Accessories', [
|
|
138
|
+
button('detail-edit', 'Edit', { severity: 'primary', icon: 'pi pi-pencil' }),
|
|
139
|
+
button('detail-archive', 'Archive', { severity: 'secondary', icon: 'pi pi-inbox' }),
|
|
140
|
+
]),
|
|
141
|
+
],
|
|
142
|
+
[TemplateSlotName.Body]: [
|
|
143
|
+
widget('detail-description', 'Description', [
|
|
144
|
+
text('detail-description-text', 'A bamboo-cased watch with a sapphire face and a recycled steel strap.'),
|
|
145
|
+
]),
|
|
146
|
+
widget('detail-history', 'Price history', [externalComponent('detail-history-timeline', 'timeline', { align: 'left' })]),
|
|
147
|
+
],
|
|
148
|
+
[TemplateSlotName.SidePanel]: [
|
|
149
|
+
widget('detail-summary', 'Summary', [
|
|
150
|
+
text('detail-stock', 'In stock: 24'),
|
|
151
|
+
text('detail-reserved', 'Reserved: 3'),
|
|
152
|
+
externalComponent('detail-status', 'tag', { value: 'Active', severity: 'success' }),
|
|
153
|
+
]),
|
|
154
|
+
],
|
|
155
|
+
},
|
|
156
|
+
displayName: 'Detail',
|
|
157
|
+
description: 'One record: a header with actions, its sections, and a summary panel.',
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
/** The form: fields, grouped, with the actions that close them. */
|
|
161
|
+
export const formPageTemplate: ScreenTemplate = {
|
|
162
|
+
name: 'FormPage',
|
|
163
|
+
fitsSlot: SlotName.Content,
|
|
164
|
+
slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],
|
|
165
|
+
content: {
|
|
166
|
+
[TemplateSlotName.Header]: [pageHeader('form-header', 'New product', 'Everything marked with an asterisk is required')],
|
|
167
|
+
[TemplateSlotName.Body]: [
|
|
168
|
+
card('form-card', [
|
|
169
|
+
field('form-name', 'Name', 'inputText', { placeholder: 'Bamboo Watch' }),
|
|
170
|
+
field('form-code', 'Code', 'inputText', { placeholder: 'P-1001' }),
|
|
171
|
+
field('form-category', 'Category', 'dropdown', { options: ['Accessories', 'Clothing', 'Fitness'] }),
|
|
172
|
+
field('form-price', 'Price', 'inputNumber', { mode: 'currency', currency: 'USD' }),
|
|
173
|
+
field('form-available', 'Available from', 'calendar', {}),
|
|
174
|
+
field('form-notes', 'Notes', 'inputTextarea', { rows: 4 }),
|
|
175
|
+
]),
|
|
176
|
+
],
|
|
177
|
+
[TemplateSlotName.Actions]: [formActions('form-actions', 'Create product')],
|
|
178
|
+
},
|
|
179
|
+
displayName: 'Form',
|
|
180
|
+
description: 'A grouped form with the field types an application actually uses.',
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
/** The empty state: what a list looks like before anything exists, designed rather than apologized for. */
|
|
184
|
+
export const emptyTemplate: ScreenTemplate = {
|
|
185
|
+
name: 'Empty',
|
|
186
|
+
fitsSlot: SlotName.Content,
|
|
187
|
+
slots: [{ name: TemplateSlotName.Body }],
|
|
188
|
+
content: {
|
|
189
|
+
[TemplateSlotName.Body]: [
|
|
190
|
+
emptyState('empty-state', 'No products yet', 'Products you create will show up here, with their stock and pricing.', 'Create the first product'),
|
|
191
|
+
],
|
|
192
|
+
},
|
|
193
|
+
displayName: 'Empty state',
|
|
194
|
+
description: 'The designed empty state for a list that has nothing in it yet.',
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
/** The five workspace templates. */
|
|
198
|
+
export const workspaceTemplates: ScreenTemplate[] = [dashboardTemplate, crudListTemplate, detailViewTemplate, formPageTemplate, emptyTemplate];
|
package/index.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
export * from './packageName';
|
|
5
|
+
export * from './ComponentName';
|
|
6
|
+
export * from './configuration';
|
|
7
|
+
export * from './layouts';
|
|
8
|
+
export * from './gallery';
|
|
9
|
+
export * from './shell';
|
|
10
|
+
export * from './themes';
|
|
11
|
+
export * from './defaultBlueprintComponents';
|
|
12
|
+
export * from './defaultBlueprint';
|
|
@@ -0,0 +1,18 @@
|
|
|
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 application shells this package provides.
|
|
6
|
+
*
|
|
7
|
+
* Only true application-level shells are layouts. Everything else this package ships - dashboards, CRUD
|
|
8
|
+
* lists, sign-in screens - is a page or dialog template that *fits into* one of these, not a layout of its
|
|
9
|
+
* own. Keeping the distinction in the type means the manifest's `layouts` list cannot quietly grow into a
|
|
10
|
+
* catalog of pages.
|
|
11
|
+
*/
|
|
12
|
+
export enum LayoutName {
|
|
13
|
+
/** Topbar, sidebar, breadcrumb, content, footer and an optional right panel - the shell an application signs in to. */
|
|
14
|
+
AppShell = 'AppShell',
|
|
15
|
+
|
|
16
|
+
/** No chrome at all: content, an optional branding aside, and the configurator. */
|
|
17
|
+
FullPage = 'FullPage',
|
|
18
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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 regions this package's layouts expose.
|
|
6
|
+
*
|
|
7
|
+
* These are the names a {@link Layout}'s {@link Slot}s carry, the keys a page template's content is
|
|
8
|
+
* filed under, and the keys the shell components read out of their `slots` prop - one enum for all three,
|
|
9
|
+
* because a slot filled under a name the shell never reads renders nothing at all and reports nothing
|
|
10
|
+
* either. That silent failure is exactly what a shared vocabulary prevents.
|
|
11
|
+
*
|
|
12
|
+
* The set follows PrimeTek's template line: Sakai establishes topbar/sidebar/menu/content/footer, and the
|
|
13
|
+
* premium templates (Diamond, Atlantis, Freya, Apollo, Ultima, Avalon, Verona) add breadcrumb and a right
|
|
14
|
+
* panel. Both are exposed here, because a layout package that only covers the free template's regions
|
|
15
|
+
* forces anyone wanting the others to fork it.
|
|
16
|
+
*/
|
|
17
|
+
export enum SlotName {
|
|
18
|
+
/** The fixed strip across the top: brand, the sidebar toggle, and per-screen actions. */
|
|
19
|
+
Topbar = 'topbar',
|
|
20
|
+
|
|
21
|
+
/** The sidebar's own chrome - its header, brand and pin button. */
|
|
22
|
+
Sidebar = 'sidebar',
|
|
23
|
+
|
|
24
|
+
/** The navigation itself, so a screen can replace the menu without replacing the sidebar around it. */
|
|
25
|
+
Menu = 'menu',
|
|
26
|
+
|
|
27
|
+
/** The trail above the content. */
|
|
28
|
+
Breadcrumb = 'breadcrumb',
|
|
29
|
+
|
|
30
|
+
/** The screen itself. The only slot every layout declares. */
|
|
31
|
+
Content = 'content',
|
|
32
|
+
|
|
33
|
+
/** The strip below the content. */
|
|
34
|
+
Footer = 'footer',
|
|
35
|
+
|
|
36
|
+
/** The optional inspector panel down the right-hand edge. */
|
|
37
|
+
RightPanel = 'rightPanel',
|
|
38
|
+
|
|
39
|
+
/** The floating configurator. Present in both shells, because a full-page screen still has to be themeable. */
|
|
40
|
+
ConfigPanel = 'configPanel',
|
|
41
|
+
|
|
42
|
+
/** The branding half of a full-page screen's split - the panel a login form sits beside. */
|
|
43
|
+
Aside = 'aside',
|
|
44
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
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 { FlowArrangement, HeightSizeClass, Layout, WidthSizeClass } from '@cratis/scene.model';
|
|
5
|
+
import { LayoutName } from './LayoutName';
|
|
6
|
+
import { SlotName } from './SlotName';
|
|
7
|
+
import { column, row, slotLeaf } from './flowBuilders';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The tree at a regular width and height: a topbar across the top, the sidebar column beside the main
|
|
11
|
+
* column, an optional right panel down the edge, and the configurator floating over all of it.
|
|
12
|
+
*/
|
|
13
|
+
export const appShellRegularRoot = column([
|
|
14
|
+
slotLeaf(SlotName.Topbar),
|
|
15
|
+
row(
|
|
16
|
+
[
|
|
17
|
+
column([slotLeaf(SlotName.Sidebar), slotLeaf(SlotName.Menu, { grow: 1 })]),
|
|
18
|
+
column([slotLeaf(SlotName.Breadcrumb), slotLeaf(SlotName.Content, { grow: 1 }), slotLeaf(SlotName.Footer)], 0, { grow: 1 }),
|
|
19
|
+
slotLeaf(SlotName.RightPanel),
|
|
20
|
+
],
|
|
21
|
+
0,
|
|
22
|
+
{ grow: 1 },
|
|
23
|
+
),
|
|
24
|
+
slotLeaf(SlotName.ConfigPanel),
|
|
25
|
+
]);
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The tree at a compact width: the sidebar and the right panel leave the flow entirely.
|
|
29
|
+
*
|
|
30
|
+
* They leave rather than shrink because there is no width at which an 18rem panel and a 20rem panel both
|
|
31
|
+
* fit beside content on a phone. The sidebar is still rendered - off-canvas, over the content, behind the
|
|
32
|
+
* mask - but it no longer *occupies* anything, and that is a fact about the arrangement, not about CSS.
|
|
33
|
+
*/
|
|
34
|
+
export const appShellCompactWidthRoot = column([
|
|
35
|
+
slotLeaf(SlotName.Topbar),
|
|
36
|
+
column([slotLeaf(SlotName.Breadcrumb), slotLeaf(SlotName.Content, { grow: 1 }), slotLeaf(SlotName.Footer)], 0, { grow: 1 }),
|
|
37
|
+
slotLeaf(SlotName.ConfigPanel),
|
|
38
|
+
]);
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The tree at a compact height: the breadcrumb and the footer go.
|
|
42
|
+
*
|
|
43
|
+
* A landscape phone has room across but almost none down, and two horizontal strips of chrome eat most of
|
|
44
|
+
* what is left. Dropping them is the height axis earning its place in the size-class matrix - width alone
|
|
45
|
+
* cannot express it.
|
|
46
|
+
*/
|
|
47
|
+
export const appShellCompactHeightRoot = column([
|
|
48
|
+
slotLeaf(SlotName.Topbar),
|
|
49
|
+
row(
|
|
50
|
+
[column([slotLeaf(SlotName.Sidebar), slotLeaf(SlotName.Menu, { grow: 1 })]), slotLeaf(SlotName.Content, { grow: 1 }), slotLeaf(SlotName.RightPanel)],
|
|
51
|
+
0,
|
|
52
|
+
{ grow: 1 },
|
|
53
|
+
),
|
|
54
|
+
slotLeaf(SlotName.ConfigPanel),
|
|
55
|
+
]);
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The tree when both axes are compact - a phone in landscape: nothing but the topbar, the content and the
|
|
59
|
+
* configurator.
|
|
60
|
+
*
|
|
61
|
+
* This override exists to be *more specific* than the two single-axis ones. `evaluateFlowArrangement`
|
|
62
|
+
* scores an override by how many axes it targets, so without this one a landscape phone would pick
|
|
63
|
+
* whichever single-axis override was declared last and keep a footer it has no room for.
|
|
64
|
+
*/
|
|
65
|
+
export const appShellCompactRoot = column([
|
|
66
|
+
slotLeaf(SlotName.Topbar),
|
|
67
|
+
slotLeaf(SlotName.Content, { grow: 1 }),
|
|
68
|
+
slotLeaf(SlotName.ConfigPanel),
|
|
69
|
+
]);
|
|
70
|
+
|
|
71
|
+
/** The arrangement of the {@link appShellLayout}'s own slots, with one override per size-class combination that changes it. */
|
|
72
|
+
export const appShellArrangement: FlowArrangement = {
|
|
73
|
+
root: appShellRegularRoot,
|
|
74
|
+
overrides: [
|
|
75
|
+
{ width: WidthSizeClass.Compact, root: appShellCompactWidthRoot },
|
|
76
|
+
{ height: HeightSizeClass.Compact, root: appShellCompactHeightRoot },
|
|
77
|
+
{ width: WidthSizeClass.Compact, height: HeightSizeClass.Compact, root: appShellCompactRoot },
|
|
78
|
+
],
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* The application shell layout.
|
|
83
|
+
*
|
|
84
|
+
* This is the *application-level* structure - the base navigational look an application picks once and
|
|
85
|
+
* every page then lives inside. The regions are the ones PrimeTek's template line settled on: Sakai
|
|
86
|
+
* establishes topbar, sidebar, menu, content and footer, and the premium templates add the breadcrumb and
|
|
87
|
+
* the right panel. Both sets are here, because a layout package covering only the free template's regions
|
|
88
|
+
* forces a fork on anyone who wants the others.
|
|
89
|
+
*
|
|
90
|
+
* The slots carry no arrangement of their own: how a screen's content is arranged *inside* a slot is that
|
|
91
|
+
* page template's business, and a layout that dictated it would stop being a shell.
|
|
92
|
+
*/
|
|
93
|
+
export const appShellLayout: Layout = {
|
|
94
|
+
name: LayoutName.AppShell,
|
|
95
|
+
slots: [
|
|
96
|
+
{ name: SlotName.Topbar },
|
|
97
|
+
{ name: SlotName.Sidebar },
|
|
98
|
+
{ name: SlotName.Menu },
|
|
99
|
+
{ name: SlotName.Breadcrumb },
|
|
100
|
+
{ name: SlotName.Content },
|
|
101
|
+
{ name: SlotName.Footer },
|
|
102
|
+
{ name: SlotName.RightPanel },
|
|
103
|
+
{ name: SlotName.ConfigPanel },
|
|
104
|
+
],
|
|
105
|
+
arrangement: appShellArrangement,
|
|
106
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import { Layout } from '@cratis/scene.model';
|
|
5
|
+
import { appShellLayout } from './appShell';
|
|
6
|
+
import { fullPageLayout } from './fullPage';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The layouts this package provides.
|
|
10
|
+
*
|
|
11
|
+
* Two, and deliberately only two - every application shell worth having is one of these, and everything
|
|
12
|
+
* else this package ships is a page or dialog template that fits *into* one of them. The list is what the
|
|
13
|
+
* manifest's `layouts` names and what the bundle provides, which is what `validatePackageBundle` proves.
|
|
14
|
+
*/
|
|
15
|
+
export const defaultLayouts: Layout[] = [appShellLayout, fullPageLayout];
|
|
@@ -0,0 +1,49 @@
|
|
|
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 { FlowColumn, FlowContainerKind, FlowGrid, FlowNode, FlowRow, FlowSlotLeaf } from '@cratis/scene.model';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Small constructors for the `flow` primitives a layout's macro arrangement is built from.
|
|
8
|
+
*
|
|
9
|
+
* They exist because the primitives are structural interfaces with required members (`gap` and
|
|
10
|
+
* `children` on every container), so writing a tree as object literals buries the shape under
|
|
11
|
+
* boilerplate - and a layout tree is a thing to be read, not decoded. These keep the declarations in
|
|
12
|
+
* `appShell.ts` and `fullPage.ts` down to the structure itself.
|
|
13
|
+
*
|
|
14
|
+
* Each container carries its {@link FlowContainerKind}, which is what lets a renderer tell a row from a
|
|
15
|
+
* column - they are otherwise the same shape, and TypeScript has no runtime types to test. These builders
|
|
16
|
+
* set it, so a declaration site never has to repeat it and can never get it wrong.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A leaf positioning one of the containing layout's or screen template's own named slots.
|
|
21
|
+
*
|
|
22
|
+
* Takes a plain string rather than one enum, because a layout arranges {@link SlotName}s while a screen
|
|
23
|
+
* template arranges its own vocabulary - and the same builder has to serve both. That every leaf names a
|
|
24
|
+
* slot its container actually declares is checked by a spec rather than by the type, since no type can
|
|
25
|
+
* express "one of whatever this particular container declared".
|
|
26
|
+
*/
|
|
27
|
+
export function slotLeaf(slotName: string, node: FlowNode = {}): FlowSlotLeaf {
|
|
28
|
+
return { ...node, slotName };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** A container arranging its children horizontally. */
|
|
32
|
+
export function row(children: FlowNode[], gap = 0, node: FlowNode = {}): FlowRow {
|
|
33
|
+
return { ...node, gap, children, kind: FlowContainerKind.Row };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** A container arranging its children vertically. */
|
|
37
|
+
export function column(children: FlowNode[], gap = 0, node: FlowNode = {}): FlowColumn {
|
|
38
|
+
return { ...node, gap, children, kind: FlowContainerKind.Column };
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* A container arranging its children in a grid.
|
|
43
|
+
*
|
|
44
|
+
* `columns` is always set rather than left to the renderer - a grid that does not say how many tracks it
|
|
45
|
+
* has leaves the renderer guessing at the one thing the author cared about.
|
|
46
|
+
*/
|
|
47
|
+
export function grid(children: FlowNode[], columns: number, gap = 0, node: FlowNode = {}): FlowGrid {
|
|
48
|
+
return { ...node, gap, children, columns, kind: FlowContainerKind.Grid };
|
|
49
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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 { FlowArrangement, Layout, WidthSizeClass } from '@cratis/scene.model';
|
|
5
|
+
import { LayoutName } from './LayoutName';
|
|
6
|
+
import { SlotName } from './SlotName';
|
|
7
|
+
import { column, row, slotLeaf } from './flowBuilders';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The tree at a regular width: the branding aside beside the content, with the configurator over both.
|
|
11
|
+
*
|
|
12
|
+
* The split is the shape every premium PrimeTek sign-in page uses - a colored branding half and a form
|
|
13
|
+
* half - and it is the reason `aside` is a slot rather than something a screen paints inside `content`.
|
|
14
|
+
*/
|
|
15
|
+
export const fullPageRegularRoot = column([row([slotLeaf(SlotName.Aside), slotLeaf(SlotName.Content, { grow: 1 })], 0, { grow: 1 }), slotLeaf(SlotName.ConfigPanel)]);
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The tree at a compact width: the branding aside leaves the flow.
|
|
19
|
+
*
|
|
20
|
+
* On a phone the aside would take 40% of the width from the only thing that matters on a sign-in screen,
|
|
21
|
+
* which is the form. It drops out rather than stacking above it, because a sign-in form pushed below the
|
|
22
|
+
* fold by decoration is the worst possible first screen.
|
|
23
|
+
*/
|
|
24
|
+
export const fullPageCompactWidthRoot = column([slotLeaf(SlotName.Content, { grow: 1 }), slotLeaf(SlotName.ConfigPanel)]);
|
|
25
|
+
|
|
26
|
+
/** The arrangement of the {@link fullPageLayout}'s own slots. */
|
|
27
|
+
export const fullPageArrangement: FlowArrangement = {
|
|
28
|
+
root: fullPageRegularRoot,
|
|
29
|
+
overrides: [{ width: WidthSizeClass.Compact, root: fullPageCompactWidthRoot }],
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The chrome-less layout.
|
|
34
|
+
*
|
|
35
|
+
* Sign-in, register, forgotten password, verification, lock, error, access-denied, not-found and landing
|
|
36
|
+
* screens all use this rather than a stripped-down application shell, and that split is structural in
|
|
37
|
+
* every PrimeTek template for a reason worth repeating: none of those screens has navigation state, a
|
|
38
|
+
* sidebar to remember or a breadcrumb to place, so hanging them off the application shell would mean every
|
|
39
|
+
* one of the eight modes needs an answer for a page with no menu.
|
|
40
|
+
*
|
|
41
|
+
* The configurator stays, because the sign-in page is very often the first page anyone sees and it still
|
|
42
|
+
* has to honor the chosen theme.
|
|
43
|
+
*/
|
|
44
|
+
export const fullPageLayout: Layout = {
|
|
45
|
+
name: LayoutName.FullPage,
|
|
46
|
+
slots: [{ name: SlotName.Aside }, { name: SlotName.Content }, { name: SlotName.ConfigPanel }],
|
|
47
|
+
arrangement: fullPageArrangement,
|
|
48
|
+
};
|
package/layouts/index.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
export * from './SlotName';
|
|
5
|
+
export * from './LayoutName';
|
|
6
|
+
export * from './flowBuilders';
|
|
7
|
+
export * from './shellComponents';
|
|
8
|
+
export * from './appShell';
|
|
9
|
+
export * from './fullPage';
|
|
10
|
+
export * from './defaultLayouts';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import { ComponentName } from '../ComponentName';
|
|
5
|
+
import { LayoutName } from './LayoutName';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Which component renders which layout.
|
|
9
|
+
*
|
|
10
|
+
* A {@link Layout} is data - named slots and an arrangement - and says nothing about how it is drawn. This
|
|
11
|
+
* is the one place that pairing lives, so a host holding a screen and its layout name can find the shell
|
|
12
|
+
* to render it in without hardcoding the answer, and a spec can prove every layout the blueprint declares
|
|
13
|
+
* actually has one.
|
|
14
|
+
*/
|
|
15
|
+
const shellComponents: Record<LayoutName, ComponentName> = {
|
|
16
|
+
[LayoutName.AppShell]: ComponentName.AppShell,
|
|
17
|
+
[LayoutName.FullPage]: ComponentName.FullPageShell,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The component that renders a layout.
|
|
22
|
+
*
|
|
23
|
+
* @param layoutName The layout's name.
|
|
24
|
+
* @returns The bare component name, or `undefined` when the layout is not one of this blueprint's.
|
|
25
|
+
*/
|
|
26
|
+
export function shellComponentForLayout(layoutName: string): ComponentName | undefined {
|
|
27
|
+
return shellComponents[layoutName as LayoutName];
|
|
28
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cratis/scene.blueprint.default",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "The default blueprint: application shell layouts, the screen and dialog templates that go inside them, the components that fill their slots, and two themes.",
|
|
5
|
+
"author": "Cratis",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/Cratis/Scene.git"
|
|
10
|
+
},
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"**/*.ts",
|
|
17
|
+
"**/*.tsx",
|
|
18
|
+
"shell/layout.css"
|
|
19
|
+
],
|
|
20
|
+
"main": "dist/cjs/index.js",
|
|
21
|
+
"module": "dist/esm/index.js",
|
|
22
|
+
"types": "dist/esm/index.d.ts",
|
|
23
|
+
"exports": {
|
|
24
|
+
"./package.json": "./package.json",
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/esm/index.d.ts",
|
|
27
|
+
"require": "./dist/cjs/index.js",
|
|
28
|
+
"import": "./dist/esm/index.js"
|
|
29
|
+
},
|
|
30
|
+
"./styles": "./shell/layout.css",
|
|
31
|
+
"./styles.css": "./shell/layout.css"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"prepare": "yarn g:build",
|
|
35
|
+
"clean": "yarn g:clean",
|
|
36
|
+
"build": "yarn g:build",
|
|
37
|
+
"lint": "yarn g:lint",
|
|
38
|
+
"lint:ci": "yarn g:lint:ci",
|
|
39
|
+
"test": "yarn g:test",
|
|
40
|
+
"ci": "yarn g:ci",
|
|
41
|
+
"up": "yarn g:up",
|
|
42
|
+
"dev": "storybook dev -p 6006",
|
|
43
|
+
"build-storybook": "storybook build"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@cratis/scene.engine": "0.1.0",
|
|
47
|
+
"@cratis/scene.model": "0.1.0",
|
|
48
|
+
"@cratis/scene.react": "0.1.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@cratis/scene.engine": "0.1.0",
|
|
52
|
+
"@cratis/scene.model": "0.1.0",
|
|
53
|
+
"@cratis/scene.react": "0.1.0",
|
|
54
|
+
"@storybook/addon-links": "^10.4.1",
|
|
55
|
+
"@storybook/react": "^10.4.1",
|
|
56
|
+
"@storybook/react-vite": "^10.4.1",
|
|
57
|
+
"primeicons": "^7.0.0",
|
|
58
|
+
"primereact": "10.9.8",
|
|
59
|
+
"react": "^19.2.6",
|
|
60
|
+
"react-dom": "^19.2.6",
|
|
61
|
+
"storybook": "^10.4.1"
|
|
62
|
+
},
|
|
63
|
+
"peerDependencies": {
|
|
64
|
+
"primereact": "^10.9.0",
|
|
65
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
66
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
67
|
+
}
|
|
68
|
+
}
|
package/packageName.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
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 name this blueprint is known by inside a `ui profile`.
|
|
6
|
+
*
|
|
7
|
+
* It is not the npm package name: a profile lists Scene package names, a theme declares compatibility
|
|
8
|
+
* with them, and `componentRegistryKey` builds every registry key from this. It therefore lives on its own
|
|
9
|
+
* rather than inside the manifest, so the registry can key off it without importing the manifest that
|
|
10
|
+
* describes the registry.
|
|
11
|
+
*/
|
|
12
|
+
export const defaultBlueprintName = 'Cratis.Blueprint.Default';
|