@qwickapps/react-framework 1.4.1 → 1.4.2
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/QUICK_START_GUIDE.md +82 -0
- package/README.md +221 -21
- package/dist/components/Html.d.ts.map +1 -1
- package/dist/components/Markdown.d.ts +1 -2
- package/dist/components/Markdown.d.ts.map +1 -1
- package/dist/components/SafeSpan.d.ts +1 -2
- package/dist/components/SafeSpan.d.ts.map +1 -1
- package/dist/components/base/Container.d.ts +32 -0
- package/dist/components/base/Container.d.ts.map +1 -0
- package/dist/components/base/ContainerView.d.ts +65 -0
- package/dist/components/base/ContainerView.d.ts.map +1 -0
- package/dist/components/base/ModelView.d.ts +37 -46
- package/dist/components/base/ModelView.d.ts.map +1 -1
- package/dist/components/base/index.d.ts +3 -2
- package/dist/components/base/index.d.ts.map +1 -1
- package/dist/components/blocks/Article.d.ts +1 -2
- package/dist/components/blocks/Article.d.ts.map +1 -1
- package/dist/components/blocks/Code-factory.d.ts +22 -0
- package/dist/components/blocks/Code-factory.d.ts.map +1 -0
- package/dist/components/blocks/Code-old.d.ts +31 -0
- package/dist/components/blocks/Code-old.d.ts.map +1 -0
- package/dist/components/blocks/Code.d.ts +30 -18
- package/dist/components/blocks/Code.d.ts.map +1 -1
- package/dist/components/blocks/HeroBlock.d.ts +1 -2
- package/dist/components/blocks/HeroBlock.d.ts.map +1 -1
- package/dist/components/blocks/Image.d.ts +1 -2
- package/dist/components/blocks/Image.d.ts.map +1 -1
- package/dist/components/blocks/Section.d.ts +1 -2
- package/dist/components/blocks/Section.d.ts.map +1 -1
- package/dist/components/blocks/Text.d.ts +35 -27
- package/dist/components/blocks/Text.d.ts.map +1 -1
- package/dist/components/buttons/Button.d.ts +1 -2
- package/dist/components/buttons/Button.d.ts.map +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/input/ChoiceInputField.d.ts +1 -2
- package/dist/components/input/ChoiceInputField.d.ts.map +1 -1
- package/dist/components/input/HtmlInputField.d.ts +1 -2
- package/dist/components/input/HtmlInputField.d.ts.map +1 -1
- package/dist/components/input/SelectInputField.d.ts +1 -2
- package/dist/components/input/SelectInputField.d.ts.map +1 -1
- package/dist/components/pages/Page.d.ts +29 -47
- package/dist/components/pages/Page.d.ts.map +1 -1
- package/dist/components/pages/index.d.ts +2 -3
- package/dist/components/pages/index.d.ts.map +1 -1
- package/dist/components/shared/createSerializableView.d.ts +68 -0
- package/dist/components/shared/createSerializableView.d.ts.map +1 -0
- package/dist/components/shared/viewProps.d.ts +37 -0
- package/dist/components/shared/viewProps.d.ts.map +1 -0
- package/dist/index.esm.js +21782 -22580
- package/dist/index.js +21782 -22579
- package/dist/qa/ConsoleWarningTest.d.ts +5 -0
- package/dist/qa/ConsoleWarningTest.d.ts.map +1 -0
- package/dist/qa/StorageKeyTest.d.ts +6 -0
- package/dist/qa/StorageKeyTest.d.ts.map +1 -0
- package/dist/qa/ThemeStorageKeyTest.d.ts +6 -0
- package/dist/qa/ThemeStorageKeyTest.d.ts.map +1 -0
- package/dist/schemas/CodeSchema.d.ts +2 -2
- package/dist/schemas/CodeSchema.d.ts.map +1 -1
- package/dist/schemas/ContainerSchema.d.ts +12 -0
- package/dist/schemas/ContainerSchema.d.ts.map +1 -0
- package/dist/schemas/PageTemplateSchema.d.ts +3 -3
- package/dist/schemas/PageTemplateSchema.d.ts.map +1 -1
- package/dist/schemas/ViewModelSchema.d.ts +46 -6
- package/dist/schemas/ViewModelSchema.d.ts.map +1 -1
- package/dist/schemas/ViewSchema.d.ts +65 -0
- package/dist/schemas/ViewSchema.d.ts.map +1 -0
- package/dist/schemas/index.d.ts +1 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/transformers/ComponentTransformer.d.ts +27 -15
- package/dist/schemas/transformers/ComponentTransformer.d.ts.map +1 -1
- package/dist/schemas/transformers/ReactNodeTransformer.d.ts.map +1 -1
- package/dist/schemas/transformers/registry.d.ts +3 -0
- package/dist/schemas/transformers/registry.d.ts.map +1 -1
- package/dist/src/__tests__/schemas/transformers/MockSerializableComponent.d.ts +66 -0
- package/dist/src/__tests__/schemas/transformers/MockSerializableComponent.d.ts.map +1 -0
- package/dist/src/components/AccessibilityChecker.d.ts +12 -0
- package/dist/src/components/AccessibilityChecker.d.ts.map +1 -0
- package/dist/src/components/AccessibilityProvider.d.ts +64 -0
- package/dist/src/components/AccessibilityProvider.d.ts.map +1 -0
- package/dist/src/components/Breadcrumbs.d.ts +39 -0
- package/dist/src/components/Breadcrumbs.d.ts.map +1 -0
- package/dist/src/components/ErrorBoundary.d.ts +46 -0
- package/dist/src/components/ErrorBoundary.d.ts.map +1 -0
- package/dist/src/components/Html.d.ts +58 -0
- package/dist/src/components/Html.d.ts.map +1 -0
- package/dist/src/components/Logo.d.ts +56 -0
- package/dist/src/components/Logo.d.ts.map +1 -0
- package/dist/src/components/Markdown.d.ts +51 -0
- package/dist/src/components/Markdown.d.ts.map +1 -0
- package/dist/src/components/QwickApp.d.ts +69 -0
- package/dist/src/components/QwickApp.d.ts.map +1 -0
- package/dist/src/components/QwickAppsLogo.d.ts +25 -0
- package/dist/src/components/QwickAppsLogo.d.ts.map +1 -0
- package/dist/src/components/QwickIcon.d.ts +23 -0
- package/dist/src/components/QwickIcon.d.ts.map +1 -0
- package/dist/src/components/ResponsiveMenu.d.ts +38 -0
- package/dist/src/components/ResponsiveMenu.d.ts.map +1 -0
- package/dist/src/components/SafeSpan.d.ts +29 -0
- package/dist/src/components/SafeSpan.d.ts.map +1 -0
- package/dist/src/components/Scaffold.d.ts +57 -0
- package/dist/src/components/Scaffold.d.ts.map +1 -0
- package/dist/src/components/base/Container.d.ts +33 -0
- package/dist/src/components/base/Container.d.ts.map +1 -0
- package/dist/src/components/base/ModelView.d.ts +92 -0
- package/dist/src/components/base/ModelView.d.ts.map +1 -0
- package/dist/src/components/base/index.d.ts +12 -0
- package/dist/src/components/base/index.d.ts.map +1 -0
- package/dist/src/components/blocks/Article.d.ts +32 -0
- package/dist/src/components/blocks/Article.d.ts.map +1 -0
- package/dist/src/components/blocks/CardListGrid.d.ts +23 -0
- package/dist/src/components/blocks/CardListGrid.d.ts.map +1 -0
- package/dist/src/components/blocks/Code.d.ts +37 -0
- package/dist/src/components/blocks/Code.d.ts.map +1 -0
- package/dist/src/components/blocks/Content.d.ts +24 -0
- package/dist/src/components/blocks/Content.d.ts.map +1 -0
- package/dist/src/components/blocks/CoverImageHeader.d.ts +44 -0
- package/dist/src/components/blocks/CoverImageHeader.d.ts.map +1 -0
- package/dist/src/components/blocks/FeatureCard.d.ts +66 -0
- package/dist/src/components/blocks/FeatureCard.d.ts.map +1 -0
- package/dist/src/components/blocks/FeatureGrid.d.ts +48 -0
- package/dist/src/components/blocks/FeatureGrid.d.ts.map +1 -0
- package/dist/src/components/blocks/Footer.d.ts +56 -0
- package/dist/src/components/blocks/Footer.d.ts.map +1 -0
- package/dist/src/components/blocks/HeroBlock.d.ts +55 -0
- package/dist/src/components/blocks/HeroBlock.d.ts.map +1 -0
- package/dist/src/components/blocks/Image.d.ts +40 -0
- package/dist/src/components/blocks/Image.d.ts.map +1 -0
- package/dist/src/components/blocks/PageBannerHeader.d.ts +30 -0
- package/dist/src/components/blocks/PageBannerHeader.d.ts.map +1 -0
- package/dist/src/components/blocks/ProductCard.d.ts +57 -0
- package/dist/src/components/blocks/ProductCard.d.ts.map +1 -0
- package/dist/src/components/blocks/Section.d.ts +45 -0
- package/dist/src/components/blocks/Section.d.ts.map +1 -0
- package/dist/src/components/blocks/Text.d.ts +34 -0
- package/dist/src/components/blocks/Text.d.ts.map +1 -0
- package/dist/src/components/blocks/index.d.ts +41 -0
- package/dist/src/components/blocks/index.d.ts.map +1 -0
- package/dist/src/components/buttons/Button.d.ts +41 -0
- package/dist/src/components/buttons/Button.d.ts.map +1 -0
- package/dist/src/components/buttons/PaletteSwitcher.d.ts +24 -0
- package/dist/src/components/buttons/PaletteSwitcher.d.ts.map +1 -0
- package/dist/src/components/buttons/ThemeSwitcher.d.ts +24 -0
- package/dist/src/components/buttons/ThemeSwitcher.d.ts.map +1 -0
- package/dist/src/components/buttons/index.d.ts +11 -0
- package/dist/src/components/buttons/index.d.ts.map +1 -0
- package/dist/src/components/forms/FormBlock.d.ts +51 -0
- package/dist/src/components/forms/FormBlock.d.ts.map +1 -0
- package/dist/src/components/forms/index.d.ts +8 -0
- package/dist/src/components/forms/index.d.ts.map +1 -0
- package/dist/src/components/index.d.ts +41 -0
- package/dist/src/components/index.d.ts.map +1 -0
- package/dist/src/components/input/ChoiceInputField.d.ts +29 -0
- package/dist/src/components/input/ChoiceInputField.d.ts.map +1 -0
- package/dist/src/components/input/HtmlInputField.d.ts +33 -0
- package/dist/src/components/input/HtmlInputField.d.ts.map +1 -0
- package/dist/src/components/input/SelectInputField.d.ts +31 -0
- package/dist/src/components/input/SelectInputField.d.ts.map +1 -0
- package/dist/src/components/input/SwitchInputField.d.ts +27 -0
- package/dist/src/components/input/SwitchInputField.d.ts.map +1 -0
- package/dist/src/components/input/TextField.d.ts +18 -0
- package/dist/src/components/input/TextField.d.ts.map +1 -0
- package/dist/src/components/input/TextInputField.d.ts +34 -0
- package/dist/src/components/input/TextInputField.d.ts.map +1 -0
- package/dist/src/components/input/index.d.ts +19 -0
- package/dist/src/components/input/index.d.ts.map +1 -0
- package/dist/src/components/layout/CollapsibleLayout/CollapsibleLayout.d.ts +34 -0
- package/dist/src/components/layout/CollapsibleLayout/CollapsibleLayout.d.ts.map +1 -0
- package/dist/src/components/layout/CollapsibleLayout/index.d.ts +9 -0
- package/dist/src/components/layout/CollapsibleLayout/index.d.ts.map +1 -0
- package/dist/src/components/layout/GridCell.d.ts +32 -0
- package/dist/src/components/layout/GridCell.d.ts.map +1 -0
- package/dist/src/components/layout/GridCellWrapper.d.ts +46 -0
- package/dist/src/components/layout/GridCellWrapper.d.ts.map +1 -0
- package/dist/src/components/layout/GridLayout.d.ts +50 -0
- package/dist/src/components/layout/GridLayout.d.ts.map +1 -0
- package/dist/src/components/layout/index.d.ts +14 -0
- package/dist/src/components/layout/index.d.ts.map +1 -0
- package/dist/src/components/menu/Menu.d.ts +1 -0
- package/dist/src/components/menu/Menu.d.ts.map +1 -0
- package/dist/src/components/menu/MenuItem.d.ts +31 -0
- package/dist/src/components/menu/MenuItem.d.ts.map +1 -0
- package/dist/src/components/menu/index.d.ts +7 -0
- package/dist/src/components/menu/index.d.ts.map +1 -0
- package/dist/src/components/pages/FormPage.d.ts +66 -0
- package/dist/src/components/pages/FormPage.d.ts.map +1 -0
- package/dist/src/components/pages/Page.d.ts +68 -0
- package/dist/src/components/pages/Page.d.ts.map +1 -0
- package/dist/src/components/pages/index.d.ts +10 -0
- package/dist/src/components/pages/index.d.ts.map +1 -0
- package/dist/src/components/shared/createSerializableView.d.ts +81 -0
- package/dist/src/components/shared/createSerializableView.d.ts.map +1 -0
- package/dist/src/components/shared/viewProps.d.ts +37 -0
- package/dist/src/components/shared/viewProps.d.ts.map +1 -0
- package/dist/src/config/AppConfig.d.ts +49 -0
- package/dist/src/config/AppConfig.d.ts.map +1 -0
- package/dist/src/config/AppConfigBuilder.d.ts +75 -0
- package/dist/src/config/AppConfigBuilder.d.ts.map +1 -0
- package/dist/src/config/index.d.ts +13 -0
- package/dist/src/config/index.d.ts.map +1 -0
- package/dist/src/config/types.d.ts +130 -0
- package/dist/src/config/types.d.ts.map +1 -0
- package/dist/src/config.d.ts +15 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/contexts/DataContext.d.ts +139 -0
- package/dist/src/contexts/DataContext.d.ts.map +1 -0
- package/dist/src/contexts/DimensionsContext.d.ts +42 -0
- package/dist/src/contexts/DimensionsContext.d.ts.map +1 -0
- package/dist/src/contexts/PaletteContext.d.ts +53 -0
- package/dist/src/contexts/PaletteContext.d.ts.map +1 -0
- package/dist/src/contexts/PrintModeContext.d.ts +27 -0
- package/dist/src/contexts/PrintModeContext.d.ts.map +1 -0
- package/dist/src/contexts/QwickAppContext.d.ts +71 -0
- package/dist/src/contexts/QwickAppContext.d.ts.map +1 -0
- package/dist/src/contexts/ThemeContext.d.ts +65 -0
- package/dist/src/contexts/ThemeContext.d.ts.map +1 -0
- package/dist/src/contexts/index.d.ts +11 -0
- package/dist/src/contexts/index.d.ts.map +1 -0
- package/dist/src/hooks/index.d.ts +12 -0
- package/dist/src/hooks/index.d.ts.map +1 -0
- package/dist/src/hooks/useBaseProps.d.ts +101 -0
- package/dist/src/hooks/useBaseProps.d.ts.map +1 -0
- package/dist/src/hooks/useDataBinding.d.ts +22 -0
- package/dist/src/hooks/useDataBinding.d.ts.map +1 -0
- package/dist/src/hooks/usePrintMode.d.ts +39 -0
- package/dist/src/hooks/usePrintMode.d.ts.map +1 -0
- package/dist/src/index.d.ts +9 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/palettes/PaletteAutumn.d.ts +10 -0
- package/dist/src/palettes/PaletteAutumn.d.ts.map +1 -0
- package/dist/src/palettes/PaletteCosmic.d.ts +10 -0
- package/dist/src/palettes/PaletteCosmic.d.ts.map +1 -0
- package/dist/src/palettes/PaletteDefault.d.ts +10 -0
- package/dist/src/palettes/PaletteDefault.d.ts.map +1 -0
- package/dist/src/palettes/PaletteOcean.d.ts +10 -0
- package/dist/src/palettes/PaletteOcean.d.ts.map +1 -0
- package/dist/src/palettes/PaletteSpring.d.ts +10 -0
- package/dist/src/palettes/PaletteSpring.d.ts.map +1 -0
- package/dist/src/palettes/PaletteWinter.d.ts +10 -0
- package/dist/src/palettes/PaletteWinter.d.ts.map +1 -0
- package/dist/src/palettes/index.d.ts +13 -0
- package/dist/src/palettes/index.d.ts.map +1 -0
- package/dist/src/schemas/ActionSchema.d.ts +21 -0
- package/dist/src/schemas/ActionSchema.d.ts.map +1 -0
- package/dist/src/schemas/ArticleSchema.d.ts +13 -0
- package/dist/src/schemas/ArticleSchema.d.ts.map +1 -0
- package/dist/src/schemas/ButtonSchema.d.ts +19 -0
- package/dist/src/schemas/ButtonSchema.d.ts.map +1 -0
- package/dist/src/schemas/CardListGridSchema.d.ts +17 -0
- package/dist/src/schemas/CardListGridSchema.d.ts.map +1 -0
- package/dist/src/schemas/ChoiceInputFieldSchema.d.ts +18 -0
- package/dist/src/schemas/ChoiceInputFieldSchema.d.ts.map +1 -0
- package/dist/src/schemas/CodeSchema.d.ts +18 -0
- package/dist/src/schemas/CodeSchema.d.ts.map +1 -0
- package/dist/src/schemas/CollapsibleLayoutSchema.d.ts +32 -0
- package/dist/src/schemas/CollapsibleLayoutSchema.d.ts.map +1 -0
- package/dist/src/schemas/ContainerSchema.d.ts +12 -0
- package/dist/src/schemas/ContainerSchema.d.ts.map +1 -0
- package/dist/src/schemas/ContentSchema.d.ts +21 -0
- package/dist/src/schemas/ContentSchema.d.ts.map +1 -0
- package/dist/src/schemas/CoverImageHeaderSchema.d.ts +28 -0
- package/dist/src/schemas/CoverImageHeaderSchema.d.ts.map +1 -0
- package/dist/src/schemas/FeatureCardSchema.d.ts +28 -0
- package/dist/src/schemas/FeatureCardSchema.d.ts.map +1 -0
- package/dist/src/schemas/FeatureGridSchema.d.ts +17 -0
- package/dist/src/schemas/FeatureGridSchema.d.ts.map +1 -0
- package/dist/src/schemas/FeatureItemSchema.d.ts +16 -0
- package/dist/src/schemas/FeatureItemSchema.d.ts.map +1 -0
- package/dist/src/schemas/FooterItemSchema.d.ts +15 -0
- package/dist/src/schemas/FooterItemSchema.d.ts.map +1 -0
- package/dist/src/schemas/FooterSchema.d.ts +20 -0
- package/dist/src/schemas/FooterSchema.d.ts.map +1 -0
- package/dist/src/schemas/FooterSectionSchema.d.ts +15 -0
- package/dist/src/schemas/FooterSectionSchema.d.ts.map +1 -0
- package/dist/src/schemas/FormBlockSchema.d.ts +19 -0
- package/dist/src/schemas/FormBlockSchema.d.ts.map +1 -0
- package/dist/src/schemas/GridCellSchema.d.ts +23 -0
- package/dist/src/schemas/GridCellSchema.d.ts.map +1 -0
- package/dist/src/schemas/GridLayoutSchema.d.ts +21 -0
- package/dist/src/schemas/GridLayoutSchema.d.ts.map +1 -0
- package/dist/src/schemas/HeaderActionSchema.d.ts +17 -0
- package/dist/src/schemas/HeaderActionSchema.d.ts.map +1 -0
- package/dist/src/schemas/HeroBlockSchema.d.ts +22 -0
- package/dist/src/schemas/HeroBlockSchema.d.ts.map +1 -0
- package/dist/src/schemas/HtmlInputFieldSchema.d.ts +18 -0
- package/dist/src/schemas/HtmlInputFieldSchema.d.ts.map +1 -0
- package/dist/src/schemas/HtmlSchema.d.ts +14 -0
- package/dist/src/schemas/HtmlSchema.d.ts.map +1 -0
- package/dist/src/schemas/ImageSchema.d.ts +32 -0
- package/dist/src/schemas/ImageSchema.d.ts.map +1 -0
- package/dist/src/schemas/LogoSchema.d.ts +35 -0
- package/dist/src/schemas/LogoSchema.d.ts.map +1 -0
- package/dist/src/schemas/MarkdownSchema.d.ts +14 -0
- package/dist/src/schemas/MarkdownSchema.d.ts.map +1 -0
- package/dist/src/schemas/MetadataItemSchema.d.ts +13 -0
- package/dist/src/schemas/MetadataItemSchema.d.ts.map +1 -0
- package/dist/src/schemas/PageBannerHeaderSchema.d.ts +28 -0
- package/dist/src/schemas/PageBannerHeaderSchema.d.ts.map +1 -0
- package/dist/src/schemas/PageTemplateSchema.d.ts +31 -0
- package/dist/src/schemas/PageTemplateSchema.d.ts.map +1 -0
- package/dist/src/schemas/PaletteSwitcherSchema.d.ts +16 -0
- package/dist/src/schemas/PaletteSwitcherSchema.d.ts.map +1 -0
- package/dist/src/schemas/PrintConfigSchema.d.ts +31 -0
- package/dist/src/schemas/PrintConfigSchema.d.ts.map +1 -0
- package/dist/src/schemas/ProductCardSchema.d.ts +39 -0
- package/dist/src/schemas/ProductCardSchema.d.ts.map +1 -0
- package/dist/src/schemas/SafeSpanSchema.d.ts +13 -0
- package/dist/src/schemas/SafeSpanSchema.d.ts.map +1 -0
- package/dist/src/schemas/SectionSchema.d.ts +16 -0
- package/dist/src/schemas/SectionSchema.d.ts.map +1 -0
- package/dist/src/schemas/SelectInputFieldSchema.d.ts +27 -0
- package/dist/src/schemas/SelectInputFieldSchema.d.ts.map +1 -0
- package/dist/src/schemas/SwitchInputFieldSchema.d.ts +18 -0
- package/dist/src/schemas/SwitchInputFieldSchema.d.ts.map +1 -0
- package/dist/src/schemas/TextInputFieldSchema.d.ts +22 -0
- package/dist/src/schemas/TextInputFieldSchema.d.ts.map +1 -0
- package/dist/src/schemas/TextSchema.d.ts +37 -0
- package/dist/src/schemas/TextSchema.d.ts.map +1 -0
- package/dist/src/schemas/ThemeSwitcherSchema.d.ts +19 -0
- package/dist/src/schemas/ThemeSwitcherSchema.d.ts.map +1 -0
- package/dist/src/schemas/ViewSchema.d.ts +66 -0
- package/dist/src/schemas/ViewSchema.d.ts.map +1 -0
- package/dist/src/schemas/index.d.ts +47 -0
- package/dist/src/schemas/index.d.ts.map +1 -0
- package/dist/src/schemas/transformers/ComponentTransformer.d.ts +128 -0
- package/dist/src/schemas/transformers/ComponentTransformer.d.ts.map +1 -0
- package/dist/src/schemas/transformers/ReactNodeTransformer.d.ts +53 -0
- package/dist/src/schemas/transformers/ReactNodeTransformer.d.ts.map +1 -0
- package/dist/src/schemas/transformers/registry.d.ts +18 -0
- package/dist/src/schemas/transformers/registry.d.ts.map +1 -0
- package/dist/src/schemas/types/Serializable.d.ts +46 -0
- package/dist/src/schemas/types/Serializable.d.ts.map +1 -0
- package/dist/src/stories/_templates/SerializationTemplate.d.ts +44 -0
- package/dist/src/stories/_templates/SerializationTemplate.d.ts.map +1 -0
- package/dist/src/templates/TemplateResolver.d.ts +52 -0
- package/dist/src/templates/TemplateResolver.d.ts.map +1 -0
- package/dist/src/templates/index.d.ts +7 -0
- package/dist/src/templates/index.d.ts.map +1 -0
- package/dist/src/types/CacheProvider.d.ts +18 -0
- package/dist/src/types/CacheProvider.d.ts.map +1 -0
- package/dist/src/types/CollapsibleLayout.d.ts +142 -0
- package/dist/src/types/CollapsibleLayout.d.ts.map +1 -0
- package/dist/src/types/ContentProxy.d.ts +47 -0
- package/dist/src/types/ContentProxy.d.ts.map +1 -0
- package/dist/src/types/DataTypes.d.ts +185 -0
- package/dist/src/types/DataTypes.d.ts.map +1 -0
- package/dist/src/types/TemplateProvider.d.ts +10 -0
- package/dist/src/types/TemplateProvider.d.ts.map +1 -0
- package/dist/src/types/TemplateResolver.d.ts +23 -0
- package/dist/src/types/TemplateResolver.d.ts.map +1 -0
- package/dist/src/types/index.d.ts +82 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/src/utils/breakpoints.d.ts +35 -0
- package/dist/src/utils/breakpoints.d.ts.map +1 -0
- package/dist/src/utils/cssUtils.d.ts +17 -0
- package/dist/src/utils/cssUtils.d.ts.map +1 -0
- package/dist/src/utils/customPaletteManager.d.ts +8 -0
- package/dist/src/utils/customPaletteManager.d.ts.map +1 -0
- package/dist/src/utils/dimensions.d.ts +34 -0
- package/dist/src/utils/dimensions.d.ts.map +1 -0
- package/dist/src/utils/htmlTransform.d.ts +44 -0
- package/dist/src/utils/htmlTransform.d.ts.map +1 -0
- package/dist/src/utils/index.d.ts +16 -0
- package/dist/src/utils/index.d.ts.map +1 -0
- package/dist/src/utils/logger.d.ts +26 -0
- package/dist/src/utils/logger.d.ts.map +1 -0
- package/dist/src/utils/paletteUtils.d.ts +38 -0
- package/dist/src/utils/paletteUtils.d.ts.map +1 -0
- package/dist/src/utils/persistenceUtils.d.ts +31 -0
- package/dist/src/utils/persistenceUtils.d.ts.map +1 -0
- package/dist/src/utils/reactUtils.d.ts +33 -0
- package/dist/src/utils/reactUtils.d.ts.map +1 -0
- package/dist/src/utils/spacing.d.ts +34 -0
- package/dist/src/utils/spacing.d.ts.map +1 -0
- package/dist/src/utils/themePerformanceMonitor.d.ts +32 -0
- package/dist/src/utils/themePerformanceMonitor.d.ts.map +1 -0
- package/dist/src/utils/themeUtils.d.ts +27 -0
- package/dist/src/utils/themeUtils.d.ts.map +1 -0
- package/dist/utils/cssUtils.d.ts +17 -0
- package/dist/utils/cssUtils.d.ts.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +5 -2
- package/scripts/bundle-css.cjs +27 -0
- package/scripts/create-project.sh +28 -0
- package/scripts/create-qwickapps-project.js +284 -0
- package/src/__tests__/components/base/Container.test.tsx +966 -0
- package/src/__tests__/schemas/PageTemplateSchema.test.ts +1 -1
- package/src/__tests__/schemas/ViewSchema.test.ts +805 -0
- package/src/__tests__/schemas/builders.test.ts +2 -2
- package/src/__tests__/schemas/transformers/ComponentTransformer.test.ts +19 -19
- package/src/__tests__/schemas/transformers/CrossBrowserCompatibility.test.ts +13 -13
- package/src/__tests__/schemas/transformers/SerializationErrorHandling.test.ts +39 -39
- package/src/__tests__/schemas/transformers/SerializationPerformance.test.ts +14 -14
- package/src/__tests__/schemas/transformers/TestAutomation.test.ts +8 -8
- package/src/__tests__/schemas/transformers/nested-serialization.test.tsx +181 -0
- package/src/__tests__/schemas/transformers/round-trip-component-serialization.test.tsx +458 -0
- package/src/__tests__/test_image_accessibility.test.tsx +226 -0
- package/src/__tests__/utils/optional-logging.test.ts +3 -3
- package/src/components/Html.tsx +24 -15
- package/src/components/Logo.tsx +2 -2
- package/src/components/Markdown.tsx +2 -7
- package/src/components/SafeSpan.tsx +2 -7
- package/src/components/base/Container.tsx +61 -0
- package/src/components/base/ModelView.tsx +225 -91
- package/src/components/base/index.ts +3 -2
- package/src/components/blocks/Article.tsx +2 -7
- package/src/components/blocks/CardListGrid.tsx +2 -2
- package/src/components/blocks/Code.tsx +91 -179
- package/src/components/blocks/Content.tsx +2 -2
- package/src/components/blocks/CoverImageHeader.tsx +2 -2
- package/src/components/blocks/HeroBlock.tsx +54 -146
- package/src/components/blocks/Image.tsx +82 -196
- package/src/components/blocks/PageBannerHeader.tsx +2 -2
- package/src/components/blocks/Section.tsx +79 -181
- package/src/components/blocks/Text.tsx +100 -198
- package/src/components/buttons/Button.tsx +85 -183
- package/src/components/buttons/PaletteSwitcher.tsx +2 -2
- package/src/components/buttons/ThemeSwitcher.tsx +2 -2
- package/src/components/forms/FormBlock.tsx +2 -2
- package/src/components/index.ts +5 -0
- package/src/components/input/ChoiceInputField.tsx +76 -160
- package/src/components/input/HtmlInputField.tsx +141 -264
- package/src/components/input/SelectInputField.tsx +48 -153
- package/src/components/input/SwitchInputField.tsx +41 -139
- package/src/components/input/TextInputField.tsx +39 -116
- package/src/components/layout/GridCell.tsx +36 -122
- package/src/components/layout/GridLayout.tsx +55 -127
- package/src/components/pages/Page.tsx +268 -276
- package/src/components/pages/index.ts +2 -3
- package/src/components/shared/createSerializableView.tsx +280 -0
- package/src/components/shared/viewProps.ts +207 -0
- package/src/config/__tests__/AppConfigBuilder.test.ts +2 -2
- package/src/contexts/DataContext.tsx +1 -1
- package/src/schemas/ButtonSchema.ts +3 -2
- package/src/schemas/CardListGridSchema.ts +3 -2
- package/src/schemas/ChoiceInputFieldSchema.ts +3 -2
- package/src/schemas/CodeSchema.ts +8 -6
- package/src/schemas/ContainerSchema.ts +25 -0
- package/src/schemas/FeatureCardSchema.ts +1 -1
- package/src/schemas/FormBlockSchema.ts +3 -2
- package/src/schemas/GridCellSchema.ts +4 -10
- package/src/schemas/GridLayoutSchema.ts +8 -14
- package/src/schemas/HeroBlockSchema.ts +3 -2
- package/src/schemas/HtmlInputFieldSchema.ts +3 -2
- package/src/schemas/ImageSchema.ts +3 -2
- package/src/schemas/PageTemplateSchema.ts +5 -5
- package/src/schemas/SectionSchema.ts +4 -12
- package/src/schemas/SelectInputFieldSchema.ts +3 -2
- package/src/schemas/SwitchInputFieldSchema.ts +2 -2
- package/src/schemas/TextInputFieldSchema.ts +3 -2
- package/src/schemas/ViewSchema.ts +570 -0
- package/src/schemas/index.ts +1 -1
- package/src/schemas/transformers/ComponentTransformer.ts +185 -163
- package/src/schemas/transformers/ReactNodeTransformer.ts +31 -28
- package/src/schemas/transformers/registry.ts +17 -10
- package/src/stories/Button.stories.tsx +24 -0
- package/src/stories/ChoiceInputField.stories.tsx +28 -1
- package/src/stories/Code.stories.tsx +61 -1
- package/src/stories/Container.stories.tsx +954 -0
- package/src/stories/FormBlock.stories.tsx +54 -0
- package/src/stories/FormComponents.stories.tsx +8 -13
- package/src/stories/GridCell.stories.tsx +23 -64
- package/src/stories/GridLayout.stories.tsx +22 -47
- package/src/stories/HeroBlock.stories.tsx +28 -0
- package/src/stories/HtmlInputField.stories.tsx +23 -1
- package/src/stories/Image.stories.tsx +45 -233
- package/src/stories/Markdown.stories.tsx +1 -1
- package/src/stories/Section.stories.tsx +38 -4
- package/src/stories/SelectInputField.stories.tsx +26 -1
- package/src/stories/Text.stories.tsx +22 -54
- package/src/stories/TextInputField.stories.tsx +24 -1
- package/src/stories/_templates/SerializationTemplate.tsx +165 -0
- package/src/templates/TemplateResolver.ts +2 -2
- package/src/types/CollapsibleLayout.ts +2 -2
- package/src/utils/cssUtils.ts +49 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/logger.ts +13 -13
- package/src/__tests__/components/base/ModelView.test.tsx +0 -220
- package/src/__tests__/schemas/ViewModelSchema.test.ts +0 -80
- package/src/components/blocks/Code.md +0 -529
- package/src/schemas/README.md +0 -661
- package/src/schemas/ViewModelSchema.ts +0 -115
- package/src/tests/ConsoleWarningTest.tsx +0 -30
- package/src/tests/StorageKeyTest.tsx +0 -110
- package/src/tests/ThemeStorageKeyTest.tsx +0 -114
|
@@ -0,0 +1,954 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Container Component Stories - Comprehensive ViewSchema prop showcase
|
|
3
|
+
*
|
|
4
|
+
* This story demonstrates the new Container component that replaces the
|
|
5
|
+
* abstract ModelView class with a concrete React component using ViewSchema
|
|
6
|
+
* as its props interface.
|
|
7
|
+
*
|
|
8
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { Alert, Box, Paper, Typography } from '@mui/material';
|
|
12
|
+
import { JsonDataProvider } from '@qwickapps/schema';
|
|
13
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
14
|
+
import React from 'react';
|
|
15
|
+
import { Container } from '../components/base/Container';
|
|
16
|
+
import { makeSerializationStory } from './_templates/SerializationTemplate';
|
|
17
|
+
import { Code, Text } from '../components/blocks';
|
|
18
|
+
import { Button } from '../components/buttons/Button';
|
|
19
|
+
import QwickApp from '../components/QwickApp';
|
|
20
|
+
import { ComponentTransformer } from '../schemas/transformers/ComponentTransformer';
|
|
21
|
+
import {registerSerializableComponents} from '../schemas/transformers/registry';
|
|
22
|
+
|
|
23
|
+
console.log('Registering serializable components for stories...', registerSerializableComponents);
|
|
24
|
+
// Sample data for comprehensive demonstrations
|
|
25
|
+
const sampleData = {
|
|
26
|
+
'functional-modelview': {
|
|
27
|
+
'basic-card': {
|
|
28
|
+
span: '6',
|
|
29
|
+
padding: 'medium',
|
|
30
|
+
background: '#f5f5f5',
|
|
31
|
+
className: 'basic-card-example'
|
|
32
|
+
},
|
|
33
|
+
'responsive-grid': {
|
|
34
|
+
xs: '12',
|
|
35
|
+
sm: '8',
|
|
36
|
+
md: '6',
|
|
37
|
+
lg: '4',
|
|
38
|
+
xl: '3',
|
|
39
|
+
padding: 'large',
|
|
40
|
+
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
|
41
|
+
textAlign: 'center'
|
|
42
|
+
},
|
|
43
|
+
'styled-container': {
|
|
44
|
+
span: '8',
|
|
45
|
+
padding: 'huge',
|
|
46
|
+
margin: 'medium',
|
|
47
|
+
width: '100%',
|
|
48
|
+
height: '200px',
|
|
49
|
+
background: 'primary.main',
|
|
50
|
+
backgroundGradient: 'linear-gradient(45deg, #2196F3 30%, #21CBF3 90%)',
|
|
51
|
+
textAlign: 'center',
|
|
52
|
+
className: 'styled-container',
|
|
53
|
+
'data-testid': 'styled-container-test'
|
|
54
|
+
},
|
|
55
|
+
'interactive-element': {
|
|
56
|
+
span: '10',
|
|
57
|
+
padding: 'large',
|
|
58
|
+
background: 'background.paper',
|
|
59
|
+
onClick: 'function(event) { alert("Container clicked!"); console.log("Click event:", event); }',
|
|
60
|
+
onMouseEnter: 'function(event) { event.target.style.transform = "scale(1.02)"; }',
|
|
61
|
+
onMouseLeave: 'function(event) { event.target.style.transform = "scale(1)"; }',
|
|
62
|
+
'aria-label': 'Interactive ModelView container',
|
|
63
|
+
role: 'button',
|
|
64
|
+
'data-testid': 'interactive-modelview'
|
|
65
|
+
},
|
|
66
|
+
'accessibility-example': {
|
|
67
|
+
span: '12',
|
|
68
|
+
padding: 'medium',
|
|
69
|
+
background: 'info.light',
|
|
70
|
+
id: 'accessibility-demo',
|
|
71
|
+
role: 'region',
|
|
72
|
+
'aria-label': 'Accessibility demonstration section',
|
|
73
|
+
'aria-describedby': 'accessibility-description',
|
|
74
|
+
'data-testid': 'accessibility-container'
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const dataProvider = new JsonDataProvider({ data: sampleData });
|
|
80
|
+
|
|
81
|
+
const meta = {
|
|
82
|
+
title: 'Components/Container',
|
|
83
|
+
component: Container,
|
|
84
|
+
parameters: {
|
|
85
|
+
layout: 'padded',
|
|
86
|
+
docs: {
|
|
87
|
+
description: {
|
|
88
|
+
component: `Container is the concrete implementation of the ViewSchema that replaces the abstract ModelView class pattern with a direct React component.
|
|
89
|
+
|
|
90
|
+
**Key Features:**
|
|
91
|
+
- **ViewSchema Props**: Direct support for all ViewSchema properties
|
|
92
|
+
- **Grid Layout**: Full responsive breakpoint system (xs, sm, md, lg, xl) with span support
|
|
93
|
+
- **Dimension Control**: T-shirt sizing and CSS values for width, height, min/max variants
|
|
94
|
+
- **Spacing System**: T-shirt sized padding and margin with directional control
|
|
95
|
+
- **Background Options**: Colors, gradients, images with theme integration
|
|
96
|
+
- **Style Integration**: className, sx props, and inline styles with JSON parsing
|
|
97
|
+
- **Accessibility**: Complete ARIA support and semantic HTML attributes
|
|
98
|
+
- **Event Handlers**: String-to-function conversion for onClick, onMouseEnter, etc.
|
|
99
|
+
- **Data Binding**: Full CMS integration through dataSource prop
|
|
100
|
+
- **Serialization**: Complete toJson/fromJson support for dynamic UIs
|
|
101
|
+
|
|
102
|
+
**Architecture:**
|
|
103
|
+
- Uses ViewSchema as the props interface
|
|
104
|
+
- Integrates with existing useBaseProps utility
|
|
105
|
+
- Converts string props to appropriate React prop types
|
|
106
|
+
- Handles event string evaluation safely
|
|
107
|
+
- Supports children rendering and data binding
|
|
108
|
+
- Maintains backward compatibility with ModelView patterns
|
|
109
|
+
|
|
110
|
+
**Perfect For:**
|
|
111
|
+
- Container components with comprehensive styling needs
|
|
112
|
+
- Data-driven UI components loaded from CMS
|
|
113
|
+
- Responsive grid layouts with complex styling requirements
|
|
114
|
+
- Components requiring full accessibility and semantic markup
|
|
115
|
+
- Serializable UI elements for dynamic page generation`,
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
tags: ['autodocs'],
|
|
120
|
+
argTypes: {
|
|
121
|
+
// Grid Props
|
|
122
|
+
span: {
|
|
123
|
+
control: { type: 'select', options: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', 'auto', 'grow'] },
|
|
124
|
+
description: 'Grid column span (1-12, auto, or grow)',
|
|
125
|
+
},
|
|
126
|
+
xs: {
|
|
127
|
+
control: { type: 'select', options: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', 'auto'] },
|
|
128
|
+
description: 'Grid columns on extra small screens',
|
|
129
|
+
},
|
|
130
|
+
sm: {
|
|
131
|
+
control: { type: 'select', options: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', 'auto'] },
|
|
132
|
+
description: 'Grid columns on small screens',
|
|
133
|
+
},
|
|
134
|
+
md: {
|
|
135
|
+
control: { type: 'select', options: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', 'auto'] },
|
|
136
|
+
description: 'Grid columns on medium screens',
|
|
137
|
+
},
|
|
138
|
+
lg: {
|
|
139
|
+
control: { type: 'select', options: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', 'auto'] },
|
|
140
|
+
description: 'Grid columns on large screens',
|
|
141
|
+
},
|
|
142
|
+
xl: {
|
|
143
|
+
control: { type: 'select', options: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', 'auto'] },
|
|
144
|
+
description: 'Grid columns on extra large screens',
|
|
145
|
+
},
|
|
146
|
+
// Dimension Props
|
|
147
|
+
width: {
|
|
148
|
+
control: 'text',
|
|
149
|
+
description: 'Width (t-shirt sizes, CSS values, breakpoints)',
|
|
150
|
+
},
|
|
151
|
+
height: {
|
|
152
|
+
control: 'text',
|
|
153
|
+
description: 'Height (t-shirt sizes, CSS values)',
|
|
154
|
+
},
|
|
155
|
+
// Spacing Props
|
|
156
|
+
padding: {
|
|
157
|
+
control: { type: 'select', options: ['none', 'tiny', 'small', 'medium', 'large', 'huge'] },
|
|
158
|
+
description: 'Internal spacing for all sides',
|
|
159
|
+
},
|
|
160
|
+
margin: {
|
|
161
|
+
control: { type: 'select', options: ['none', 'tiny', 'small', 'medium', 'large', 'huge'] },
|
|
162
|
+
description: 'External spacing for all sides',
|
|
163
|
+
},
|
|
164
|
+
// Background Props
|
|
165
|
+
background: {
|
|
166
|
+
control: 'text',
|
|
167
|
+
description: 'Background color, theme path, or CSS value',
|
|
168
|
+
},
|
|
169
|
+
backgroundGradient: {
|
|
170
|
+
control: 'text',
|
|
171
|
+
description: 'CSS gradient for background',
|
|
172
|
+
},
|
|
173
|
+
backgroundImage: {
|
|
174
|
+
control: 'text',
|
|
175
|
+
description: 'Background image URL',
|
|
176
|
+
},
|
|
177
|
+
// Style Props
|
|
178
|
+
className: {
|
|
179
|
+
control: 'text',
|
|
180
|
+
description: 'Additional CSS class names',
|
|
181
|
+
},
|
|
182
|
+
textAlign: {
|
|
183
|
+
control: { type: 'select', options: ['left', 'center', 'right', 'justify'] },
|
|
184
|
+
description: 'Text alignment within component',
|
|
185
|
+
},
|
|
186
|
+
// HTML Attributes
|
|
187
|
+
id: {
|
|
188
|
+
control: 'text',
|
|
189
|
+
description: 'HTML element ID',
|
|
190
|
+
},
|
|
191
|
+
role: {
|
|
192
|
+
control: 'text',
|
|
193
|
+
description: 'ARIA role for accessibility',
|
|
194
|
+
},
|
|
195
|
+
'aria-label': {
|
|
196
|
+
control: 'text',
|
|
197
|
+
description: 'ARIA label for screen readers',
|
|
198
|
+
},
|
|
199
|
+
'data-testid': {
|
|
200
|
+
control: 'text',
|
|
201
|
+
description: 'Test automation identifier',
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
decorators: [
|
|
205
|
+
(Story) => (
|
|
206
|
+
<div style={{
|
|
207
|
+
width: '100%',
|
|
208
|
+
minHeight: '200px',
|
|
209
|
+
display: 'grid',
|
|
210
|
+
gridTemplateColumns: 'repeat(12, 1fr)',
|
|
211
|
+
gap: '16px',
|
|
212
|
+
padding: '16px',
|
|
213
|
+
backgroundColor: '#f8f9fa'
|
|
214
|
+
}}>
|
|
215
|
+
<Story />
|
|
216
|
+
</div>
|
|
217
|
+
),
|
|
218
|
+
],
|
|
219
|
+
} satisfies Meta<typeof Container>;
|
|
220
|
+
|
|
221
|
+
export default meta;
|
|
222
|
+
type Story = StoryObj<typeof meta>;
|
|
223
|
+
|
|
224
|
+
// === BASIC USAGE STORIES ===
|
|
225
|
+
|
|
226
|
+
export const BasicContainer: Story = {
|
|
227
|
+
args: {
|
|
228
|
+
span: 6,
|
|
229
|
+
padding: 'medium',
|
|
230
|
+
background: '#ffffff',
|
|
231
|
+
className: 'basic-container',
|
|
232
|
+
},
|
|
233
|
+
render: (args) => (
|
|
234
|
+
<Container {...args}>
|
|
235
|
+
<Typography variant="h5" gutterBottom>Basic Container</Typography>
|
|
236
|
+
<Typography variant="body1">
|
|
237
|
+
This is a basic container using Container with span=6, medium padding,
|
|
238
|
+
and white background. It demonstrates the simplest usage pattern.
|
|
239
|
+
</Typography>
|
|
240
|
+
</Container>
|
|
241
|
+
),
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
export const WithComplexChildren: Story = {
|
|
245
|
+
args: {
|
|
246
|
+
span: 8,
|
|
247
|
+
padding: 'large',
|
|
248
|
+
background: 'background.paper',
|
|
249
|
+
className: 'complex-children-container',
|
|
250
|
+
},
|
|
251
|
+
render: (args) => (
|
|
252
|
+
<Container {...args}>
|
|
253
|
+
<Typography variant="h4" gutterBottom color="primary">
|
|
254
|
+
Complex Content Example
|
|
255
|
+
</Typography>
|
|
256
|
+
<Typography variant="body1" sx={{ mb: 2 }}>
|
|
257
|
+
Container can contain any React children including other components:
|
|
258
|
+
</Typography>
|
|
259
|
+
|
|
260
|
+
<Box sx={{ display: 'flex', gap: 2, mb: 3, flexWrap: 'wrap' }}>
|
|
261
|
+
<Button label="Primary Action" variant="primary" onClick={() => alert('Button clicked!')} />
|
|
262
|
+
<Button label="Secondary" variant="outlined" onClick={() => alert('Secondary clicked!')} />
|
|
263
|
+
</Box>
|
|
264
|
+
|
|
265
|
+
<Code language="jsx" title="JSX Usage">
|
|
266
|
+
{`<Container span="8" padding="large" background="background.paper">
|
|
267
|
+
<Typography variant="h4">Title</Typography>
|
|
268
|
+
<Button label="Action" variant="primary" />
|
|
269
|
+
<Code>/* Code blocks */</Code>
|
|
270
|
+
</Container>`}
|
|
271
|
+
</Code>
|
|
272
|
+
</Container>
|
|
273
|
+
),
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
// === GRID LAYOUT STORIES ===
|
|
277
|
+
|
|
278
|
+
export const GridLayoutShowcase: Story = {
|
|
279
|
+
render: () => (
|
|
280
|
+
<QwickApp appId="functional-modelview-grid" appName="Container Grid Layout">
|
|
281
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: 'repeat(12, 1fr)', gap: 2, width: '100%' }}>
|
|
282
|
+
|
|
283
|
+
{/* Title */}
|
|
284
|
+
<Container span={12} padding="medium" background="primary.main" textAlign="center">
|
|
285
|
+
<Typography variant="h4" color="primary.contrastText">Grid Layout Examples</Typography>
|
|
286
|
+
<Typography variant="body1" color="primary.contrastText">
|
|
287
|
+
Demonstrating various span and responsive breakpoint configurations
|
|
288
|
+
</Typography>
|
|
289
|
+
</Container>
|
|
290
|
+
|
|
291
|
+
{/* Fixed Span Examples */}
|
|
292
|
+
<Container span={3} padding="small" background="#e3f2fd" textAlign="center">
|
|
293
|
+
<Typography variant="h6">Span 3</Typography>
|
|
294
|
+
<Typography variant="body2">25% width</Typography>
|
|
295
|
+
</Container>
|
|
296
|
+
|
|
297
|
+
<Container span={6} padding="small" background="#e8f5e8" textAlign="center">
|
|
298
|
+
<Typography variant="h6">Span 6</Typography>
|
|
299
|
+
<Typography variant="body2">50% width</Typography>
|
|
300
|
+
</Container>
|
|
301
|
+
|
|
302
|
+
<Container span={3} padding="small" background="#fff3e0" textAlign="center">
|
|
303
|
+
<Typography variant="h6">Span 3</Typography>
|
|
304
|
+
<Typography variant="body2">25% width</Typography>
|
|
305
|
+
</Container>
|
|
306
|
+
|
|
307
|
+
{/* Auto and Grow Examples */}
|
|
308
|
+
<Container span="auto" padding="small" background="#f3e5f5" textAlign="center">
|
|
309
|
+
<Typography variant="h6">Span Auto</Typography>
|
|
310
|
+
<Typography variant="body2">Auto-sized</Typography>
|
|
311
|
+
</Container>
|
|
312
|
+
|
|
313
|
+
<Container span="grow" padding="small" background="#e0f2f1" textAlign="center">
|
|
314
|
+
<Typography variant="h6">Span Grow</Typography>
|
|
315
|
+
<Typography variant="body2">Fills remaining space</Typography>
|
|
316
|
+
</Container>
|
|
317
|
+
|
|
318
|
+
</Box>
|
|
319
|
+
</QwickApp>
|
|
320
|
+
),
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
export const ResponsiveBreakpoints: Story = {
|
|
324
|
+
render: () => (
|
|
325
|
+
<QwickApp appId="functional-modelview-responsive" appName="Container Responsive">
|
|
326
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: 'repeat(12, 1fr)', gap: 2, width: '100%' }}>
|
|
327
|
+
|
|
328
|
+
<Container span={12} padding="medium" background="info.main" textAlign="center">
|
|
329
|
+
<Typography variant="h4" color="info.contrastText">Responsive Breakpoints</Typography>
|
|
330
|
+
<Typography variant="body1" color="info.contrastText">
|
|
331
|
+
Resize your browser to see responsive behavior
|
|
332
|
+
</Typography>
|
|
333
|
+
</Container>
|
|
334
|
+
|
|
335
|
+
<Container
|
|
336
|
+
xs={12}
|
|
337
|
+
sm={8}
|
|
338
|
+
md={6}
|
|
339
|
+
lg={4}
|
|
340
|
+
xl={3}
|
|
341
|
+
padding="medium"
|
|
342
|
+
background="#ffebee"
|
|
343
|
+
textAlign="center"
|
|
344
|
+
>
|
|
345
|
+
<Typography variant="h6" color="error.dark">Responsive Card 1</Typography>
|
|
346
|
+
<Typography variant="body2">
|
|
347
|
+
xs:12 → sm:8 → md:6 → lg:4 → xl:3
|
|
348
|
+
</Typography>
|
|
349
|
+
</Container>
|
|
350
|
+
|
|
351
|
+
<Container
|
|
352
|
+
xs={12}
|
|
353
|
+
sm={4}
|
|
354
|
+
md={6}
|
|
355
|
+
lg={8}
|
|
356
|
+
xl={9}
|
|
357
|
+
padding="medium"
|
|
358
|
+
background="#e8f5e8"
|
|
359
|
+
textAlign="center"
|
|
360
|
+
>
|
|
361
|
+
<Typography variant="h6" color="success.dark">Responsive Card 2</Typography>
|
|
362
|
+
<Typography variant="body2">
|
|
363
|
+
xs:12 → sm:4 → md:6 → lg:8 → xl:9
|
|
364
|
+
</Typography>
|
|
365
|
+
</Container>
|
|
366
|
+
|
|
367
|
+
</Box>
|
|
368
|
+
</QwickApp>
|
|
369
|
+
),
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
// === DIMENSION STORIES ===
|
|
373
|
+
|
|
374
|
+
export const DimensionExamples: Story = {
|
|
375
|
+
render: () => (
|
|
376
|
+
<QwickApp appId="functional-modelview-dimensions" appName="Container Dimensions">
|
|
377
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: 'repeat(12, 1fr)', gap: 2, width: '100%' }}>
|
|
378
|
+
|
|
379
|
+
<Container span={12} padding="medium" background="secondary.main" textAlign="center">
|
|
380
|
+
<Typography variant="h4" color="secondary.contrastText">Dimension Control Examples</Typography>
|
|
381
|
+
<Typography variant="body1" color="secondary.contrastText">
|
|
382
|
+
T-shirt sizes, CSS values, and responsive dimensions
|
|
383
|
+
</Typography>
|
|
384
|
+
</Container>
|
|
385
|
+
|
|
386
|
+
{/* T-shirt Sizes */}
|
|
387
|
+
<Container span={4} width="small" height="small" padding="small" background="#f3e5f5" textAlign="center">
|
|
388
|
+
<Typography variant="h6">Small Size</Typography>
|
|
389
|
+
<Typography variant="body2">width: small, height: small</Typography>
|
|
390
|
+
</Container>
|
|
391
|
+
|
|
392
|
+
<Container span={4} width="medium" height="medium" padding="small" background="#e3f2fd" textAlign="center">
|
|
393
|
+
<Typography variant="h6">Medium Size</Typography>
|
|
394
|
+
<Typography variant="body2">width: medium, height: medium</Typography>
|
|
395
|
+
</Container>
|
|
396
|
+
|
|
397
|
+
<Container span={4} width="large" height="large" padding="small" background="#e8f5e8" textAlign="center">
|
|
398
|
+
<Typography variant="h6">Large Size</Typography>
|
|
399
|
+
<Typography variant="body2">width: large, height: large</Typography>
|
|
400
|
+
</Container>
|
|
401
|
+
|
|
402
|
+
{/* CSS Values */}
|
|
403
|
+
<Container span={6} width="300px" height="120px" padding="medium" background="#fff3e0" textAlign="center">
|
|
404
|
+
<Typography variant="h6">Fixed Dimensions</Typography>
|
|
405
|
+
<Typography variant="body2">width: 300px, height: 120px</Typography>
|
|
406
|
+
</Container>
|
|
407
|
+
|
|
408
|
+
<Container span={6} width="100%" minHeight="120px" maxHeight="200px" padding="medium" background="#ffebee" textAlign="center">
|
|
409
|
+
<Typography variant="h6">Constrained Dimensions</Typography>
|
|
410
|
+
<Typography variant="body2">width: 100%, minHeight: 120px, maxHeight: 200px</Typography>
|
|
411
|
+
</Container>
|
|
412
|
+
|
|
413
|
+
</Box>
|
|
414
|
+
</QwickApp>
|
|
415
|
+
),
|
|
416
|
+
};
|
|
417
|
+
|
|
418
|
+
// === SPACING STORIES ===
|
|
419
|
+
|
|
420
|
+
export const SpacingExamples: Story = {
|
|
421
|
+
render: () => (
|
|
422
|
+
<QwickApp appId="functional-modelview-spacing" appName="Container Spacing">
|
|
423
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: 'repeat(12, 1fr)', gap: 2, width: '100%' }}>
|
|
424
|
+
|
|
425
|
+
<Container span={12} padding="medium" background="success.main" textAlign="center">
|
|
426
|
+
<Typography variant="h4" color="success.contrastText">Spacing System Examples</Typography>
|
|
427
|
+
<Typography variant="body1" color="success.contrastText">
|
|
428
|
+
T-shirt sized padding and margin with directional control
|
|
429
|
+
</Typography>
|
|
430
|
+
</Container>
|
|
431
|
+
|
|
432
|
+
{/* Padding Examples */}
|
|
433
|
+
<Container span={4} padding="tiny" background="#e3f2fd" textAlign="center">
|
|
434
|
+
<Typography variant="h6" sx={{ border: '1px dashed #2196F3' }}>Tiny Padding</Typography>
|
|
435
|
+
</Container>
|
|
436
|
+
|
|
437
|
+
<Container span={4} padding="medium" background="#e8f5e8" textAlign="center">
|
|
438
|
+
<Typography variant="h6" sx={{ border: '1px dashed #4CAF50' }}>Medium Padding</Typography>
|
|
439
|
+
</Container>
|
|
440
|
+
|
|
441
|
+
<Container span={4} padding="huge" background="#fff3e0" textAlign="center">
|
|
442
|
+
<Typography variant="h6" sx={{ border: '1px dashed #FF9800' }}>Huge Padding</Typography>
|
|
443
|
+
</Container>
|
|
444
|
+
|
|
445
|
+
{/* Directional Spacing */}
|
|
446
|
+
<Container span={6} paddingTop="large" paddingBottom="small" paddingX="medium" background="#f3e5f5" textAlign="center">
|
|
447
|
+
<Typography variant="h6">Directional Padding</Typography>
|
|
448
|
+
<Typography variant="body2">paddingTop: large, paddingBottom: small, paddingX: medium</Typography>
|
|
449
|
+
</Container>
|
|
450
|
+
|
|
451
|
+
<Container span={6} margin="large" padding="medium" background="#e0f2f1">
|
|
452
|
+
<Typography variant="h6" textAlign="center">With Margin</Typography>
|
|
453
|
+
<Typography variant="body2" textAlign="center">margin: large, padding: medium</Typography>
|
|
454
|
+
</Container>
|
|
455
|
+
|
|
456
|
+
</Box>
|
|
457
|
+
</QwickApp>
|
|
458
|
+
),
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
// === BACKGROUND STORIES ===
|
|
462
|
+
|
|
463
|
+
export const BackgroundExamples: Story = {
|
|
464
|
+
render: () => (
|
|
465
|
+
<QwickApp appId="functional-modelview-backgrounds" appName="Container Backgrounds">
|
|
466
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: 'repeat(12, 1fr)', gap: 2, width: '100%' }}>
|
|
467
|
+
|
|
468
|
+
<Container span={12} padding="medium" background="error.main" textAlign="center">
|
|
469
|
+
<Typography variant="h4" color="error.contrastText">Background Examples</Typography>
|
|
470
|
+
<Typography variant="body1" color="error.contrastText">
|
|
471
|
+
Colors, gradients, images, and theme integration
|
|
472
|
+
</Typography>
|
|
473
|
+
</Container>
|
|
474
|
+
|
|
475
|
+
{/* Solid Colors */}
|
|
476
|
+
<Container span={4} padding="large" background="#FF5722" textAlign="center">
|
|
477
|
+
<Typography variant="h6" color="white">Hex Color</Typography>
|
|
478
|
+
<Typography variant="body2" color="white">#FF5722</Typography>
|
|
479
|
+
</Container>
|
|
480
|
+
|
|
481
|
+
<Container span={4} padding="large" background="primary.light" textAlign="center">
|
|
482
|
+
<Typography variant="h6" color="primary.contrastText">Theme Color</Typography>
|
|
483
|
+
<Typography variant="body2" color="primary.contrastText">primary.light</Typography>
|
|
484
|
+
</Container>
|
|
485
|
+
|
|
486
|
+
<Container span={4} padding="large" background="rgba(76, 175, 80, 0.2)" textAlign="center">
|
|
487
|
+
<Typography variant="h6">RGBA Color</Typography>
|
|
488
|
+
<Typography variant="body2">rgba(76, 175, 80, 0.2)</Typography>
|
|
489
|
+
</Container>
|
|
490
|
+
|
|
491
|
+
{/* Gradients */}
|
|
492
|
+
<Container
|
|
493
|
+
span={6}
|
|
494
|
+
padding="large"
|
|
495
|
+
backgroundGradient="linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)"
|
|
496
|
+
textAlign="center"
|
|
497
|
+
>
|
|
498
|
+
<Typography variant="h6" color="white">Linear Gradient</Typography>
|
|
499
|
+
<Typography variant="body2" color="white">45deg, pink to orange</Typography>
|
|
500
|
+
</Container>
|
|
501
|
+
|
|
502
|
+
<Container
|
|
503
|
+
span={6}
|
|
504
|
+
padding="large"
|
|
505
|
+
backgroundGradient="radial-gradient(circle, #667eea 0%, #764ba2 100%)"
|
|
506
|
+
textAlign="center"
|
|
507
|
+
>
|
|
508
|
+
<Typography variant="h6" color="white">Radial Gradient</Typography>
|
|
509
|
+
<Typography variant="body2" color="white">blue to purple radial</Typography>
|
|
510
|
+
</Container>
|
|
511
|
+
|
|
512
|
+
</Box>
|
|
513
|
+
</QwickApp>
|
|
514
|
+
),
|
|
515
|
+
};
|
|
516
|
+
|
|
517
|
+
// === STYLE INTEGRATION STORIES ===
|
|
518
|
+
|
|
519
|
+
export const StyleIntegrationExamples: Story = {
|
|
520
|
+
render: () => (
|
|
521
|
+
<QwickApp appId="functional-modelview-styles" appName="Container Styling">
|
|
522
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: 'repeat(12, 1fr)', gap: 2, width: '100%' }}>
|
|
523
|
+
|
|
524
|
+
<Container span={12} padding="medium" background="warning.main" textAlign="center">
|
|
525
|
+
<Typography variant="h4" color="warning.contrastText">Style Integration Examples</Typography>
|
|
526
|
+
<Typography variant="body1" color="warning.contrastText">
|
|
527
|
+
className, sx props, and inline styles with JSON parsing
|
|
528
|
+
</Typography>
|
|
529
|
+
</Container>
|
|
530
|
+
|
|
531
|
+
{/* className Example */}
|
|
532
|
+
<Container
|
|
533
|
+
span={4}
|
|
534
|
+
padding="medium"
|
|
535
|
+
className="custom-class-example"
|
|
536
|
+
background="#f5f5f5"
|
|
537
|
+
textAlign="center"
|
|
538
|
+
>
|
|
539
|
+
<Typography variant="h6">CSS Classes</Typography>
|
|
540
|
+
<Typography variant="body2">className: "custom-class-example"</Typography>
|
|
541
|
+
</Container>
|
|
542
|
+
|
|
543
|
+
{/* sx prop Example (JSON string) */}
|
|
544
|
+
<Container
|
|
545
|
+
span={4}
|
|
546
|
+
padding="medium"
|
|
547
|
+
sx={{ border: "2px solid #2196F3", borderRadius: "8px", backgroundColor: "#e3f2fd" }}
|
|
548
|
+
textAlign="center"
|
|
549
|
+
>
|
|
550
|
+
<Typography variant="h6">MUI SX Props</Typography>
|
|
551
|
+
<Typography variant="body2">sx: JSON string with MUI styling</Typography>
|
|
552
|
+
</Container>
|
|
553
|
+
|
|
554
|
+
{/* Inline styles Example (JSON string) */}
|
|
555
|
+
<Container
|
|
556
|
+
span={4}
|
|
557
|
+
padding="medium"
|
|
558
|
+
style={{ border: "3px dashed #FF9800", backgroundColor: "#fff3e0", borderRadius: "12px" }}
|
|
559
|
+
textAlign="center"
|
|
560
|
+
>
|
|
561
|
+
<Typography variant="h6">Inline Styles</Typography>
|
|
562
|
+
<Typography variant="body2">style: JSON string with CSS</Typography>
|
|
563
|
+
</Container>
|
|
564
|
+
|
|
565
|
+
{/* Text Alignment Examples */}
|
|
566
|
+
<Container span={3} padding="medium" background="#f3e5f5" textAlign="left">
|
|
567
|
+
<Typography variant="h6">Left Align</Typography>
|
|
568
|
+
<Typography variant="body2">textAlign: "left"</Typography>
|
|
569
|
+
</Container>
|
|
570
|
+
|
|
571
|
+
<Container span={3} padding="medium" background="#e8f5e8" textAlign="center">
|
|
572
|
+
<Typography variant="h6">Center Align</Typography>
|
|
573
|
+
<Typography variant="body2">textAlign: "center"</Typography>
|
|
574
|
+
</Container>
|
|
575
|
+
|
|
576
|
+
<Container span={3} padding="medium" background="#e3f2fd" textAlign="right">
|
|
577
|
+
<Typography variant="h6">Right Align</Typography>
|
|
578
|
+
<Typography variant="body2">textAlign: "right"</Typography>
|
|
579
|
+
</Container>
|
|
580
|
+
|
|
581
|
+
<Container span={3} padding="medium" background="#ffebee" textAlign="justify">
|
|
582
|
+
<Typography variant="h6">Justify</Typography>
|
|
583
|
+
<Typography variant="body2">textAlign: "justify" - This longer text demonstrates justified alignment behavior when there is enough content to wrap across multiple lines.</Typography>
|
|
584
|
+
</Container>
|
|
585
|
+
|
|
586
|
+
</Box>
|
|
587
|
+
</QwickApp>
|
|
588
|
+
),
|
|
589
|
+
};
|
|
590
|
+
|
|
591
|
+
// === INTERACTIVE STORIES ===
|
|
592
|
+
|
|
593
|
+
export const InteractiveExamples: Story = {
|
|
594
|
+
render: () => (
|
|
595
|
+
<QwickApp appId="functional-modelview-interactive" appName="Container Interactive">
|
|
596
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: 'repeat(12, 1fr)', gap: 2, width: '100%' }}>
|
|
597
|
+
|
|
598
|
+
<Container span={12} padding="medium" background="info.dark" textAlign="center">
|
|
599
|
+
<Typography variant="h4" color="info.contrastText">Interactive Event Handlers</Typography>
|
|
600
|
+
<Typography variant="body1" color="info.contrastText">
|
|
601
|
+
String-to-function conversion for onClick, onMouseEnter, onMouseLeave, onFocus, onBlur
|
|
602
|
+
</Typography>
|
|
603
|
+
</Container>
|
|
604
|
+
|
|
605
|
+
{/* Click Handler Example */}
|
|
606
|
+
<Container
|
|
607
|
+
span={4}
|
|
608
|
+
padding="large"
|
|
609
|
+
background="primary.light"
|
|
610
|
+
textAlign="center"
|
|
611
|
+
onClick={(event) => { alert("Container clicked! Target: " + (event.target as HTMLElement).tagName); console.log("Click event details:", event); }}
|
|
612
|
+
style={{ cursor: "pointer", transition: "transform 0.2s" }}>
|
|
613
|
+
<Typography variant="h6" color="primary.contrastText">Click Handler</Typography>
|
|
614
|
+
<Typography variant="body2" color="primary.contrastText">Click me to trigger alert</Typography>
|
|
615
|
+
</Container>
|
|
616
|
+
|
|
617
|
+
{/* Hover Effects */}
|
|
618
|
+
<Container
|
|
619
|
+
span={4}
|
|
620
|
+
padding="large"
|
|
621
|
+
background="success.light"
|
|
622
|
+
textAlign="center"
|
|
623
|
+
onMouseEnter={function (event) {
|
|
624
|
+
const target = event.target as HTMLElement;
|
|
625
|
+
target.style.transform = "scale(1.05)";
|
|
626
|
+
target.style.boxShadow = "0 8px 16px rgba(0,0,0,0.2)";
|
|
627
|
+
}}
|
|
628
|
+
onMouseLeave={function (event) {
|
|
629
|
+
const target = event.target as HTMLElement;
|
|
630
|
+
target.style.transform = "scale(1)";
|
|
631
|
+
target.style.boxShadow = "none";
|
|
632
|
+
}}
|
|
633
|
+
style={{ cursor: "pointer", transition: "all 0.3s ease" }}>
|
|
634
|
+
<Typography variant="h6" color="success.contrastText">Hover Effects</Typography>
|
|
635
|
+
<Typography variant="body2" color="success.contrastText">Hover for scale and shadow</Typography>
|
|
636
|
+
</Container>
|
|
637
|
+
|
|
638
|
+
{/* Focus/Blur Handlers */}
|
|
639
|
+
<Container
|
|
640
|
+
span={4}
|
|
641
|
+
padding="large"
|
|
642
|
+
background="warning.light"
|
|
643
|
+
textAlign="center"
|
|
644
|
+
onFocus={function (event) { event.target.style.outline = "3px solid #FF9800"; console.log("Container focused"); }}
|
|
645
|
+
onBlur={function (event) { event.target.style.outline = "none"; console.log("Container blurred"); }}
|
|
646
|
+
style={{ cursor: "pointer" }}
|
|
647
|
+
>
|
|
648
|
+
<Typography variant="h6" color="warning.contrastText">Focus/Blur</Typography>
|
|
649
|
+
<Typography variant="body2" color="warning.contrastText">Tab to focus, click elsewhere to blur</Typography>
|
|
650
|
+
</Container>
|
|
651
|
+
|
|
652
|
+
{/* Complex Interactive Example */}
|
|
653
|
+
<Container
|
|
654
|
+
span={12}
|
|
655
|
+
padding="large"
|
|
656
|
+
background="gradient.primary"
|
|
657
|
+
textAlign="center"
|
|
658
|
+
onClick={(event) => { const colors = ["#FF5722", "#E91E63", "#9C27B0", "#673AB7", "#3F51B5", "#2196F3", "#00BCD4", "#009688", "#4CAF50", "#8BC34A", "#CDDC39", "#FFC107", "#FF9800"]; (event.target as HTMLElement).style.background = colors[Math.floor(Math.random() * colors.length)]; }}
|
|
659
|
+
onMouseEnter={(event) => {
|
|
660
|
+
const target = event.target as HTMLElement;
|
|
661
|
+
target.style.transform = "scale(1.02)";
|
|
662
|
+
target.style.filter = "brightness(1.1)";
|
|
663
|
+
}}
|
|
664
|
+
onMouseLeave={(event) => {
|
|
665
|
+
const target = event.target as HTMLElement;
|
|
666
|
+
target.style.transform = "scale(1)";
|
|
667
|
+
target.style.filter = "brightness(1)";
|
|
668
|
+
}}
|
|
669
|
+
style={{ cursor: "pointer", transition: "all 0.3s ease", background: "linear-gradient(45deg, #667eea 0%, #764ba2 100%)" }}
|
|
670
|
+
>
|
|
671
|
+
<Typography variant="h5" color="white" gutterBottom>Complex Interactive Example</Typography>
|
|
672
|
+
<Typography variant="body1" color="white">
|
|
673
|
+
Hover for effects, click to change background color randomly!
|
|
674
|
+
This demonstrates complex event handlers with multiple effects.
|
|
675
|
+
</Typography>
|
|
676
|
+
</Container>
|
|
677
|
+
|
|
678
|
+
</Box>
|
|
679
|
+
</QwickApp>
|
|
680
|
+
),
|
|
681
|
+
};
|
|
682
|
+
|
|
683
|
+
// === ACCESSIBILITY STORIES ===
|
|
684
|
+
|
|
685
|
+
export const AccessibilityExamples: Story = {
|
|
686
|
+
render: () => (
|
|
687
|
+
<QwickApp appId="functional-modelview-accessibility" appName="Container Accessibility">
|
|
688
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: 'repeat(12, 1fr)', gap: 2, width: '100%' }}>
|
|
689
|
+
|
|
690
|
+
<Container span={12} padding="medium" background="secondary.dark" textAlign="center">
|
|
691
|
+
<Typography variant="h4" color="secondary.contrastText">Accessibility Examples</Typography>
|
|
692
|
+
<Typography variant="body1" color="secondary.contrastText">
|
|
693
|
+
ARIA properties, semantic roles, and testing attributes
|
|
694
|
+
</Typography>
|
|
695
|
+
</Container>
|
|
696
|
+
|
|
697
|
+
{/* ARIA Label and Role */}
|
|
698
|
+
<Container
|
|
699
|
+
span={6}
|
|
700
|
+
padding="large"
|
|
701
|
+
background="info.light"
|
|
702
|
+
textAlign="center"
|
|
703
|
+
role="region"
|
|
704
|
+
aria-label="Main content area for accessibility demonstration"
|
|
705
|
+
id="main-content-area"
|
|
706
|
+
>
|
|
707
|
+
<Typography variant="h6">ARIA Region</Typography>
|
|
708
|
+
<Typography variant="body2">
|
|
709
|
+
role="region", aria-label="Main content area..."
|
|
710
|
+
</Typography>
|
|
711
|
+
</Container>
|
|
712
|
+
|
|
713
|
+
{/* Button Role with Click Handler */}
|
|
714
|
+
<Container
|
|
715
|
+
span={6}
|
|
716
|
+
padding="large"
|
|
717
|
+
background="success.light"
|
|
718
|
+
textAlign="center"
|
|
719
|
+
role="button"
|
|
720
|
+
aria-label="Interactive button that shows an alert"
|
|
721
|
+
onClick={() => { alert("Accessible button activated!"); }}
|
|
722
|
+
|
|
723
|
+
// onKeyDown={(event) => { if (event.key === "Enter" || event.key === " ") { event.preventDefault(); alert("Accessible button activated via keyboard!"); } }}
|
|
724
|
+
|
|
725
|
+
style={{ cursor: "pointer" }}
|
|
726
|
+
>
|
|
727
|
+
<Typography variant="h6" color="success.contrastText">Accessible Button</Typography>
|
|
728
|
+
<Typography variant="body2" color="success.contrastText">
|
|
729
|
+
role="button", keyboard accessible
|
|
730
|
+
</Typography>
|
|
731
|
+
</Container>
|
|
732
|
+
|
|
733
|
+
{/* Described By Relationship */}
|
|
734
|
+
<Container
|
|
735
|
+
span={8}
|
|
736
|
+
padding="medium"
|
|
737
|
+
background="warning.light"
|
|
738
|
+
textAlign="center"
|
|
739
|
+
aria-labelledby="form-title"
|
|
740
|
+
aria-describedby="form-description"
|
|
741
|
+
>
|
|
742
|
+
<Typography id="form-title" variant="h6" color="warning.contrastText">
|
|
743
|
+
Form Container
|
|
744
|
+
</Typography>
|
|
745
|
+
<Typography variant="body2" color="warning.contrastText" sx={{ mb: 2 }}>
|
|
746
|
+
aria-labelledby="form-title", aria-describedby="form-description"
|
|
747
|
+
</Typography>
|
|
748
|
+
|
|
749
|
+
<Box sx={{ textAlign: 'left' }}>
|
|
750
|
+
<Typography variant="body2">Sample form content would go here</Typography>
|
|
751
|
+
</Box>
|
|
752
|
+
</Container>
|
|
753
|
+
|
|
754
|
+
<Container span={4} padding="medium" background="grey.100">
|
|
755
|
+
<Typography id="form-description" variant="body2">
|
|
756
|
+
This description is linked to the form container via aria-describedby,
|
|
757
|
+
providing additional context for screen readers.
|
|
758
|
+
</Typography>
|
|
759
|
+
</Container>
|
|
760
|
+
|
|
761
|
+
{/* Test Automation Support */}
|
|
762
|
+
<Container
|
|
763
|
+
span={12}
|
|
764
|
+
padding="large"
|
|
765
|
+
background="error.light"
|
|
766
|
+
textAlign="center"
|
|
767
|
+
data-testid="automation-test-container"
|
|
768
|
+
id="test-container"
|
|
769
|
+
className="test-automation-example"
|
|
770
|
+
>
|
|
771
|
+
<Typography variant="h6" color="error.contrastText" gutterBottom>
|
|
772
|
+
Test Automation Support
|
|
773
|
+
</Typography>
|
|
774
|
+
<Typography variant="body2" color="error.contrastText">
|
|
775
|
+
data-testid="automation-test-container", id="test-container", className="test-automation-example"
|
|
776
|
+
</Typography>
|
|
777
|
+
<Typography variant="body2" color="error.contrastText" sx={{ mt: 1, opacity: 0.9 }}>
|
|
778
|
+
These attributes make the component easy to target in automated tests
|
|
779
|
+
</Typography>
|
|
780
|
+
</Container>
|
|
781
|
+
|
|
782
|
+
</Box>
|
|
783
|
+
</QwickApp>
|
|
784
|
+
),
|
|
785
|
+
};
|
|
786
|
+
|
|
787
|
+
// === DATA BINDING STORIES ===
|
|
788
|
+
|
|
789
|
+
export const DataBindingBasic: Story = {
|
|
790
|
+
render: () => (
|
|
791
|
+
<QwickApp appId="functional-modelview-data-basic" appName="Container Data Binding" dataSource={{ dataProvider }}>
|
|
792
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: 'repeat(12, 1fr)', gap: 2, width: '100%' }}>
|
|
793
|
+
|
|
794
|
+
<Container span={12} padding="medium" background="primary.main" textAlign="center">
|
|
795
|
+
<Typography variant="h4" color="primary.contrastText">Data Binding Examples</Typography>
|
|
796
|
+
<Typography variant="body1" color="primary.contrastText">
|
|
797
|
+
Loading configuration from CMS data sources
|
|
798
|
+
</Typography>
|
|
799
|
+
</Container>
|
|
800
|
+
|
|
801
|
+
<Container span={6} padding="medium" background="background.paper">
|
|
802
|
+
<Typography variant="h6" gutterBottom>Basic Data Binding Usage</Typography>
|
|
803
|
+
<Code language="tsx" title="Component Usage">
|
|
804
|
+
{`<Container dataSource="functional-modelview.basic-card">
|
|
805
|
+
<Typography variant="h6">CMS-Driven Content</Typography>
|
|
806
|
+
<Typography variant="body2">
|
|
807
|
+
Configuration loaded from data source
|
|
808
|
+
</Typography>
|
|
809
|
+
</Container>`}
|
|
810
|
+
</Code>
|
|
811
|
+
|
|
812
|
+
<Typography variant="h6" gutterBottom sx={{ mt: 3 }}>Data Structure</Typography>
|
|
813
|
+
<Code language="json">
|
|
814
|
+
{JSON.stringify(sampleData['functional-modelview']['basic-card'], null, 2)}
|
|
815
|
+
</Code>
|
|
816
|
+
</Container>
|
|
817
|
+
|
|
818
|
+
<Container dataSource="functional-modelview.basic-card">
|
|
819
|
+
<Typography variant="h6" color="primary" gutterBottom>CMS-Driven Container</Typography>
|
|
820
|
+
<Typography variant="body2">
|
|
821
|
+
This container's span, padding, background, and className are all loaded
|
|
822
|
+
from the CMS data source "functional-modelview.basic-card".
|
|
823
|
+
</Typography>
|
|
824
|
+
<Typography variant="body2" sx={{ mt: 1, fontStyle: 'italic' }}>
|
|
825
|
+
The styling you see here comes entirely from the JSON data structure.
|
|
826
|
+
</Typography>
|
|
827
|
+
</Container>
|
|
828
|
+
|
|
829
|
+
</Box>
|
|
830
|
+
</QwickApp>
|
|
831
|
+
),
|
|
832
|
+
};
|
|
833
|
+
|
|
834
|
+
export const DataBindingAdvanced: Story = {
|
|
835
|
+
render: () => (
|
|
836
|
+
<QwickApp appId="functional-modelview-data-advanced" appName="Container Advanced Data Binding" dataSource={{ dataProvider }}>
|
|
837
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: 'repeat(12, 1fr)', gap: 2, width: '100%' }}>
|
|
838
|
+
|
|
839
|
+
<Container span={12} padding="large" background="secondary.main" textAlign="center">
|
|
840
|
+
<Typography variant="h4" color="secondary.contrastText">Advanced Data Binding Scenarios</Typography>
|
|
841
|
+
<Typography variant="body1" color="secondary.contrastText">
|
|
842
|
+
Complex configurations with responsive design and interactions
|
|
843
|
+
</Typography>
|
|
844
|
+
</Container>
|
|
845
|
+
|
|
846
|
+
{/* Responsive Grid from Data */}
|
|
847
|
+
<Container dataSource="functional-modelview.responsive-grid">
|
|
848
|
+
<Typography variant="h5" color="white" gutterBottom>Responsive Grid Card</Typography>
|
|
849
|
+
<Typography variant="body1" color="white" sx={{ mb: 2 }}>
|
|
850
|
+
All responsive breakpoints, gradient background, and centering loaded from CMS data.
|
|
851
|
+
</Typography>
|
|
852
|
+
<Code language="json" title="Data Source">
|
|
853
|
+
{JSON.stringify(sampleData['functional-modelview']['responsive-grid'], null, 2)}
|
|
854
|
+
</Code>
|
|
855
|
+
</Container>
|
|
856
|
+
|
|
857
|
+
{/* Styled Container from Data */}
|
|
858
|
+
<Container dataSource="functional-modelview.styled-container">
|
|
859
|
+
<Typography variant="h5" color="white" gutterBottom>Styled Container</Typography>
|
|
860
|
+
<Typography variant="body1" color="white">
|
|
861
|
+
Complex styling with dimensions, spacing, gradients, and test attributes from data.
|
|
862
|
+
</Typography>
|
|
863
|
+
</Container>
|
|
864
|
+
|
|
865
|
+
{/* Interactive Element from Data */}
|
|
866
|
+
<Container dataSource="functional-modelview.interactive-element">
|
|
867
|
+
<Typography variant="h6" gutterBottom>Interactive Element</Typography>
|
|
868
|
+
<Typography variant="body2" sx={{ mb: 2 }}>
|
|
869
|
+
Click handlers, hover effects, ARIA properties, and semantic role - all from CMS data.
|
|
870
|
+
</Typography>
|
|
871
|
+
<Alert severity="info">
|
|
872
|
+
Event handlers are safely evaluated from string functions in the data source.
|
|
873
|
+
This enables dynamic behavior configuration through CMS.
|
|
874
|
+
</Alert>
|
|
875
|
+
</Container>
|
|
876
|
+
|
|
877
|
+
{/* Accessibility Example from Data */}
|
|
878
|
+
<Container dataSource="functional-modelview.accessibility-example">
|
|
879
|
+
<Typography variant="h6" color="info.contrastText" gutterBottom>
|
|
880
|
+
Accessibility Configuration
|
|
881
|
+
</Typography>
|
|
882
|
+
<Typography variant="body2" color="info.contrastText">
|
|
883
|
+
Complete accessibility setup loaded from data source including:
|
|
884
|
+
</Typography>
|
|
885
|
+
<ul style={{ color: 'white', marginTop: '8px' }}>
|
|
886
|
+
<li>Semantic role attribute</li>
|
|
887
|
+
<li>ARIA label for screen readers</li>
|
|
888
|
+
<li>ARIA described-by relationships</li>
|
|
889
|
+
<li>Test automation identifiers</li>
|
|
890
|
+
</ul>
|
|
891
|
+
</Container>
|
|
892
|
+
|
|
893
|
+
</Box>
|
|
894
|
+
</QwickApp>
|
|
895
|
+
),
|
|
896
|
+
};
|
|
897
|
+
|
|
898
|
+
// === PLAYGROUND STORY ===
|
|
899
|
+
|
|
900
|
+
export const Playground: Story = {
|
|
901
|
+
args: {
|
|
902
|
+
span: 6,
|
|
903
|
+
padding: 'medium',
|
|
904
|
+
background: '#ffffff',
|
|
905
|
+
textAlign: 'center',
|
|
906
|
+
className: 'playground-example',
|
|
907
|
+
},
|
|
908
|
+
render: (args) => (
|
|
909
|
+
<Container {...args}>
|
|
910
|
+
<Typography variant="h5" gutterBottom>Interactive Playground</Typography>
|
|
911
|
+
<Typography variant="body1" sx={{ mb: 2 }}>
|
|
912
|
+
Use the Controls panel below to experiment with all ViewSchema properties.
|
|
913
|
+
This playground lets you test different combinations of:
|
|
914
|
+
</Typography>
|
|
915
|
+
<ul style={{ textAlign: 'left', margin: '16px 0' }}>
|
|
916
|
+
<li>Grid layout (span and responsive breakpoints)</li>
|
|
917
|
+
<li>Dimensions (width, height, constraints)</li>
|
|
918
|
+
<li>Spacing (padding, margin with t-shirt sizes)</li>
|
|
919
|
+
<li>Backgrounds (colors, gradients, images)</li>
|
|
920
|
+
<li>Styling (className, textAlign)</li>
|
|
921
|
+
<li>Accessibility attributes</li>
|
|
922
|
+
</ul>
|
|
923
|
+
<Typography variant="body2" sx={{ fontStyle: 'italic' }}>
|
|
924
|
+
Modify the controls to see real-time changes to this component!
|
|
925
|
+
</Typography>
|
|
926
|
+
</Container>
|
|
927
|
+
),
|
|
928
|
+
};
|
|
929
|
+
|
|
930
|
+
/**
|
|
931
|
+
* SerializationDemo - Demonstrates container component serialization with children
|
|
932
|
+
*/
|
|
933
|
+
export const SerializationDemo: StoryObj<typeof Container> = {
|
|
934
|
+
render: makeSerializationStory(() => (
|
|
935
|
+
<Container
|
|
936
|
+
background="linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)"
|
|
937
|
+
padding="large"
|
|
938
|
+
textAlign="center"
|
|
939
|
+
sx={{ borderRadius: '8px', boxShadow: 3 }}
|
|
940
|
+
>
|
|
941
|
+
<Text content="Container with Serializable Children" variant="h5" />
|
|
942
|
+
<Text content="This container demonstrates serialization with nested registered components." variant="body1" />
|
|
943
|
+
<Button label="Nested Button" variant="outlined" />
|
|
944
|
+
<Text content="All children are registered components that serialize correctly." variant="caption" />
|
|
945
|
+
</Container>
|
|
946
|
+
)),
|
|
947
|
+
parameters: {
|
|
948
|
+
docs: {
|
|
949
|
+
description: {
|
|
950
|
+
story: 'Shows how Container components with nested children are serialized and deserialized. Uses only registered components (Text, Button) to ensure proper serialization.',
|
|
951
|
+
},
|
|
952
|
+
},
|
|
953
|
+
},
|
|
954
|
+
};
|