@qwickapps/react-framework 1.3.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/LICENSE +44 -0
- package/README.md +794 -0
- package/dist/components/AccessibilityChecker.d.ts +12 -0
- package/dist/components/AccessibilityChecker.d.ts.map +1 -0
- package/dist/components/Html.d.ts +48 -0
- package/dist/components/Html.d.ts.map +1 -0
- package/dist/components/Logo.d.ts +79 -0
- package/dist/components/Logo.d.ts.map +1 -0
- package/dist/components/Markdown.d.ts +47 -0
- package/dist/components/Markdown.d.ts.map +1 -0
- package/dist/components/QwickApp.d.ts +56 -0
- package/dist/components/QwickApp.d.ts.map +1 -0
- package/dist/components/QwickAppsLogo.d.ts +25 -0
- package/dist/components/QwickAppsLogo.d.ts.map +1 -0
- package/dist/components/ResponsiveMenu.d.ts +38 -0
- package/dist/components/ResponsiveMenu.d.ts.map +1 -0
- package/dist/components/SafeSpan.d.ts +23 -0
- package/dist/components/SafeSpan.d.ts.map +1 -0
- package/dist/components/Scaffold.d.ts +57 -0
- package/dist/components/Scaffold.d.ts.map +1 -0
- package/dist/components/blocks/Article.d.ts +23 -0
- package/dist/components/blocks/Article.d.ts.map +1 -0
- package/dist/components/blocks/CardListGrid.d.ts +23 -0
- package/dist/components/blocks/CardListGrid.d.ts.map +1 -0
- package/dist/components/blocks/Code.d.ts +21 -0
- package/dist/components/blocks/Code.d.ts.map +1 -0
- package/dist/components/blocks/Content.d.ts +24 -0
- package/dist/components/blocks/Content.d.ts.map +1 -0
- package/dist/components/blocks/CoverImageHeader.d.ts +44 -0
- package/dist/components/blocks/CoverImageHeader.d.ts.map +1 -0
- package/dist/components/blocks/FeatureCard.d.ts +66 -0
- package/dist/components/blocks/FeatureCard.d.ts.map +1 -0
- package/dist/components/blocks/FeatureGrid.d.ts +48 -0
- package/dist/components/blocks/FeatureGrid.d.ts.map +1 -0
- package/dist/components/blocks/Footer.d.ts +56 -0
- package/dist/components/blocks/Footer.d.ts.map +1 -0
- package/dist/components/blocks/HeroBlock.d.ts +33 -0
- package/dist/components/blocks/HeroBlock.d.ts.map +1 -0
- package/dist/components/blocks/PageBannerHeader.d.ts +30 -0
- package/dist/components/blocks/PageBannerHeader.d.ts.map +1 -0
- package/dist/components/blocks/ProductCard.d.ts +57 -0
- package/dist/components/blocks/ProductCard.d.ts.map +1 -0
- package/dist/components/blocks/Section.d.ts +40 -0
- package/dist/components/blocks/Section.d.ts.map +1 -0
- package/dist/components/blocks/index.d.ts +37 -0
- package/dist/components/blocks/index.d.ts.map +1 -0
- package/dist/components/buttons/Button.d.ts +38 -0
- package/dist/components/buttons/Button.d.ts.map +1 -0
- package/dist/components/buttons/PaletteSwitcher.d.ts +24 -0
- package/dist/components/buttons/PaletteSwitcher.d.ts.map +1 -0
- package/dist/components/buttons/ThemeSwitcher.d.ts +24 -0
- package/dist/components/buttons/ThemeSwitcher.d.ts.map +1 -0
- package/dist/components/buttons/index.d.ts +11 -0
- package/dist/components/buttons/index.d.ts.map +1 -0
- package/dist/components/forms/FormBlock.d.ts +45 -0
- package/dist/components/forms/FormBlock.d.ts.map +1 -0
- package/dist/components/forms/index.d.ts +8 -0
- package/dist/components/forms/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +32 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/input/ChoiceInputField.d.ts +30 -0
- package/dist/components/input/ChoiceInputField.d.ts.map +1 -0
- package/dist/components/input/HtmlInputField.d.ts +29 -0
- package/dist/components/input/HtmlInputField.d.ts.map +1 -0
- package/dist/components/input/SelectInputField.d.ts +29 -0
- package/dist/components/input/SelectInputField.d.ts.map +1 -0
- package/dist/components/input/TextField.d.ts +18 -0
- package/dist/components/input/TextField.d.ts.map +1 -0
- package/dist/components/input/TextInputField.d.ts +32 -0
- package/dist/components/input/TextInputField.d.ts.map +1 -0
- package/dist/components/input/index.d.ts +17 -0
- package/dist/components/input/index.d.ts.map +1 -0
- package/dist/components/layout/GridCell.d.ts +16 -0
- package/dist/components/layout/GridCell.d.ts.map +1 -0
- package/dist/components/layout/GridCellWrapper.d.ts +46 -0
- package/dist/components/layout/GridCellWrapper.d.ts.map +1 -0
- package/dist/components/layout/GridLayout.d.ts +38 -0
- package/dist/components/layout/GridLayout.d.ts.map +1 -0
- package/dist/components/layout/index.d.ts +12 -0
- package/dist/components/layout/index.d.ts.map +1 -0
- package/dist/components/menu/Menu.d.ts +1 -0
- package/dist/components/menu/Menu.d.ts.map +1 -0
- package/dist/components/menu/MenuItem.d.ts +31 -0
- package/dist/components/menu/MenuItem.d.ts.map +1 -0
- package/dist/components/menu/index.d.ts +7 -0
- package/dist/components/menu/index.d.ts.map +1 -0
- package/dist/components/pages/FormPage.d.ts +66 -0
- package/dist/components/pages/FormPage.d.ts.map +1 -0
- package/dist/components/pages/Page.d.ts +124 -0
- package/dist/components/pages/Page.d.ts.map +1 -0
- package/dist/components/pages/index.d.ts +11 -0
- package/dist/components/pages/index.d.ts.map +1 -0
- package/dist/contexts/DataContext.d.ts +139 -0
- package/dist/contexts/DataContext.d.ts.map +1 -0
- package/dist/contexts/DimensionsContext.d.ts +42 -0
- package/dist/contexts/DimensionsContext.d.ts.map +1 -0
- package/dist/contexts/PaletteContext.d.ts +53 -0
- package/dist/contexts/PaletteContext.d.ts.map +1 -0
- package/dist/contexts/QwickAppContext.d.ts +71 -0
- package/dist/contexts/QwickAppContext.d.ts.map +1 -0
- package/dist/contexts/ThemeContext.d.ts +65 -0
- package/dist/contexts/ThemeContext.d.ts.map +1 -0
- package/dist/contexts/index.d.ts +9 -0
- package/dist/contexts/index.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +10 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/useBaseProps.d.ts +101 -0
- package/dist/hooks/useBaseProps.d.ts.map +1 -0
- package/dist/hooks/useDataBinding.d.ts +22 -0
- package/dist/hooks/useDataBinding.d.ts.map +1 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.css +1 -0
- package/dist/index.esm.js +24143 -0
- package/dist/index.js +24245 -0
- package/dist/palettes/PaletteAutumn.d.ts +10 -0
- package/dist/palettes/PaletteAutumn.d.ts.map +1 -0
- package/dist/palettes/PaletteCosmic.d.ts +10 -0
- package/dist/palettes/PaletteCosmic.d.ts.map +1 -0
- package/dist/palettes/PaletteDefault.d.ts +10 -0
- package/dist/palettes/PaletteDefault.d.ts.map +1 -0
- package/dist/palettes/PaletteOcean.d.ts +10 -0
- package/dist/palettes/PaletteOcean.d.ts.map +1 -0
- package/dist/palettes/PaletteSpring.d.ts +10 -0
- package/dist/palettes/PaletteSpring.d.ts.map +1 -0
- package/dist/palettes/PaletteWinter.d.ts +10 -0
- package/dist/palettes/PaletteWinter.d.ts.map +1 -0
- package/dist/palettes/index.d.ts +13 -0
- package/dist/palettes/index.d.ts.map +1 -0
- package/dist/schemas/ActionSchema.d.ts +21 -0
- package/dist/schemas/ActionSchema.d.ts.map +1 -0
- package/dist/schemas/ArticleSchema.d.ts +13 -0
- package/dist/schemas/ArticleSchema.d.ts.map +1 -0
- package/dist/schemas/Builders.d.ts +7 -0
- package/dist/schemas/Builders.d.ts.map +1 -0
- package/dist/schemas/ButtonSchema.d.ts +19 -0
- package/dist/schemas/ButtonSchema.d.ts.map +1 -0
- package/dist/schemas/CardListGridSchema.d.ts +17 -0
- package/dist/schemas/CardListGridSchema.d.ts.map +1 -0
- package/dist/schemas/ChoiceInputFieldSchema.d.ts +18 -0
- package/dist/schemas/ChoiceInputFieldSchema.d.ts.map +1 -0
- package/dist/schemas/CodeSchema.d.ts +18 -0
- package/dist/schemas/CodeSchema.d.ts.map +1 -0
- package/dist/schemas/ContentSchema.d.ts +20 -0
- package/dist/schemas/ContentSchema.d.ts.map +1 -0
- package/dist/schemas/CoverImageHeaderSchema.d.ts +28 -0
- package/dist/schemas/CoverImageHeaderSchema.d.ts.map +1 -0
- package/dist/schemas/FeatureCardSchema.d.ts +28 -0
- package/dist/schemas/FeatureCardSchema.d.ts.map +1 -0
- package/dist/schemas/FeatureGridSchema.d.ts +17 -0
- package/dist/schemas/FeatureGridSchema.d.ts.map +1 -0
- package/dist/schemas/FeatureItemSchema.d.ts +16 -0
- package/dist/schemas/FeatureItemSchema.d.ts.map +1 -0
- package/dist/schemas/FooterItemSchema.d.ts +15 -0
- package/dist/schemas/FooterItemSchema.d.ts.map +1 -0
- package/dist/schemas/FooterSchema.d.ts +20 -0
- package/dist/schemas/FooterSchema.d.ts.map +1 -0
- package/dist/schemas/FooterSectionSchema.d.ts +15 -0
- package/dist/schemas/FooterSectionSchema.d.ts.map +1 -0
- package/dist/schemas/FormBlockSchema.d.ts +19 -0
- package/dist/schemas/FormBlockSchema.d.ts.map +1 -0
- package/dist/schemas/HeaderActionSchema.d.ts +17 -0
- package/dist/schemas/HeaderActionSchema.d.ts.map +1 -0
- package/dist/schemas/HeroBlockSchema.d.ts +22 -0
- package/dist/schemas/HeroBlockSchema.d.ts.map +1 -0
- package/dist/schemas/HtmlInputFieldSchema.d.ts +18 -0
- package/dist/schemas/HtmlInputFieldSchema.d.ts.map +1 -0
- package/dist/schemas/MetadataItemSchema.d.ts +13 -0
- package/dist/schemas/MetadataItemSchema.d.ts.map +1 -0
- package/dist/schemas/PageBannerHeaderSchema.d.ts +28 -0
- package/dist/schemas/PageBannerHeaderSchema.d.ts.map +1 -0
- package/dist/schemas/PaletteSwitcherSchema.d.ts +16 -0
- package/dist/schemas/PaletteSwitcherSchema.d.ts.map +1 -0
- package/dist/schemas/ProductCardSchema.d.ts +39 -0
- package/dist/schemas/ProductCardSchema.d.ts.map +1 -0
- package/dist/schemas/SafeSpanSchema.d.ts +13 -0
- package/dist/schemas/SafeSpanSchema.d.ts.map +1 -0
- package/dist/schemas/SectionSchema.d.ts +17 -0
- package/dist/schemas/SectionSchema.d.ts.map +1 -0
- package/dist/schemas/SelectInputFieldSchema.d.ts +27 -0
- package/dist/schemas/SelectInputFieldSchema.d.ts.map +1 -0
- package/dist/schemas/TextInputFieldSchema.d.ts +22 -0
- package/dist/schemas/TextInputFieldSchema.d.ts.map +1 -0
- package/dist/schemas/ThemeSwitcherSchema.d.ts +19 -0
- package/dist/schemas/ThemeSwitcherSchema.d.ts.map +1 -0
- package/dist/schemas/index.d.ts +33 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/types.d.ts +7 -0
- package/dist/schemas/types.d.ts.map +1 -0
- package/dist/templates/TemplateResolver.d.ts +52 -0
- package/dist/templates/TemplateResolver.d.ts.map +1 -0
- package/dist/templates/index.d.ts +7 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/tests/ConsoleWarningTest.d.ts +5 -0
- package/dist/tests/ConsoleWarningTest.d.ts.map +1 -0
- package/dist/tests/StorageKeyTest.d.ts +6 -0
- package/dist/tests/StorageKeyTest.d.ts.map +1 -0
- package/dist/tests/ThemeStorageKeyTest.d.ts +6 -0
- package/dist/tests/ThemeStorageKeyTest.d.ts.map +1 -0
- package/dist/types/CacheProvider.d.ts +18 -0
- package/dist/types/CacheProvider.d.ts.map +1 -0
- package/dist/types/ContentProxy.d.ts +47 -0
- package/dist/types/ContentProxy.d.ts.map +1 -0
- package/dist/types/DataBinding.d.ts +7 -0
- package/dist/types/DataBinding.d.ts.map +1 -0
- package/dist/types/DataProvider.d.ts +7 -0
- package/dist/types/DataProvider.d.ts.map +1 -0
- package/dist/types/DataTypes.d.ts +185 -0
- package/dist/types/DataTypes.d.ts.map +1 -0
- package/dist/types/TemplateProvider.d.ts +10 -0
- package/dist/types/TemplateProvider.d.ts.map +1 -0
- package/dist/types/TemplateResolver.d.ts +23 -0
- package/dist/types/TemplateResolver.d.ts.map +1 -0
- package/dist/types/index.d.ts +81 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/utils/breakpoints.d.ts +35 -0
- package/dist/utils/breakpoints.d.ts.map +1 -0
- package/dist/utils/customPaletteManager.d.ts +8 -0
- package/dist/utils/customPaletteManager.d.ts.map +1 -0
- package/dist/utils/dimensions.d.ts +34 -0
- package/dist/utils/dimensions.d.ts.map +1 -0
- package/dist/utils/htmlTransform.d.ts +44 -0
- package/dist/utils/htmlTransform.d.ts.map +1 -0
- package/dist/utils/index.d.ts +15 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +14 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/paletteUtils.d.ts +38 -0
- package/dist/utils/paletteUtils.d.ts.map +1 -0
- package/dist/utils/persistenceUtils.d.ts +31 -0
- package/dist/utils/persistenceUtils.d.ts.map +1 -0
- package/dist/utils/reactUtils.d.ts +24 -0
- package/dist/utils/reactUtils.d.ts.map +1 -0
- package/dist/utils/spacing.d.ts +34 -0
- package/dist/utils/spacing.d.ts.map +1 -0
- package/dist/utils/themePerformanceMonitor.d.ts +32 -0
- package/dist/utils/themePerformanceMonitor.d.ts.map +1 -0
- package/dist/utils/themeUtils.d.ts +27 -0
- package/dist/utils/themeUtils.d.ts.map +1 -0
- package/package.json +141 -0
- package/src/__tests__/components/Logo.test.js +172 -0
- package/src/__tests__/contexts/DataContext.test.js +505 -0
- package/src/__tests__/contexts/PaletteContext.test.js +115 -0
- package/src/__tests__/contexts/ThemeContext.test.js +123 -0
- package/src/__tests__/utils/paletteUtils.test.js +142 -0
- package/src/__tests__/utils/themeUtils.test.js +142 -0
- package/src/components/AccessibilityChecker.tsx +264 -0
- package/src/components/Html.tsx +191 -0
- package/src/components/Logo.css +217 -0
- package/src/components/Logo.tsx +370 -0
- package/src/components/Markdown.tsx +191 -0
- package/src/components/QwickApp.css +257 -0
- package/src/components/QwickApp.tsx +157 -0
- package/src/components/QwickAppsLogo.tsx +77 -0
- package/src/components/ResponsiveMenu.css +416 -0
- package/src/components/ResponsiveMenu.tsx +310 -0
- package/src/components/SafeSpan.tsx +128 -0
- package/src/components/Scaffold.css +541 -0
- package/src/components/Scaffold.tsx +463 -0
- package/src/components/__tests__/Article.test.tsx +419 -0
- package/src/components/__tests__/Button.test.tsx +702 -0
- package/src/components/__tests__/CardListGrid.test.tsx +478 -0
- package/src/components/__tests__/ChoiceInputField.test.tsx +864 -0
- package/src/components/__tests__/Code.test.tsx +595 -0
- package/src/components/__tests__/Content.integration.test.tsx +193 -0
- package/src/components/__tests__/Content.test.tsx +504 -0
- package/src/components/__tests__/CoverImageHeader.test.tsx +456 -0
- package/src/components/__tests__/FeatureCard.integration.test.tsx +384 -0
- package/src/components/__tests__/FeatureGrid.integration.test.tsx +364 -0
- package/src/components/__tests__/FeatureGrid.test.tsx +494 -0
- package/src/components/__tests__/Footer.test.tsx +544 -0
- package/src/components/__tests__/FormBlock.test.tsx +857 -0
- package/src/components/__tests__/HeroBlock.integration.test.tsx +272 -0
- package/src/components/__tests__/HeroBlock.test.tsx +463 -0
- package/src/components/__tests__/Html.test.tsx +174 -0
- package/src/components/__tests__/HtmlInputField.test.tsx +856 -0
- package/src/components/__tests__/Markdown.test.tsx +233 -0
- package/src/components/__tests__/PageBannerHeader.test.tsx +614 -0
- package/src/components/__tests__/PaletteSwitcher.test.tsx +864 -0
- package/src/components/__tests__/ProductCard.test.tsx +377 -0
- package/src/components/__tests__/SafeSpan.integration.test.tsx +123 -0
- package/src/components/__tests__/SafeSpan.simple.test.tsx +65 -0
- package/src/components/__tests__/SafeSpan.test.tsx +388 -0
- package/src/components/__tests__/Section.integration.test.tsx +288 -0
- package/src/components/__tests__/Section.test.tsx +494 -0
- package/src/components/__tests__/SelectInputField.test.tsx +886 -0
- package/src/components/__tests__/TextInputField.test.tsx +749 -0
- package/src/components/__tests__/ThemeSwitcher.test.tsx +777 -0
- package/src/components/blocks/Article.tsx +194 -0
- package/src/components/blocks/CardListGrid.tsx +132 -0
- package/src/components/blocks/Code.tsx +313 -0
- package/src/components/blocks/Content.tsx +265 -0
- package/src/components/blocks/CoverImageHeader.css +17 -0
- package/src/components/blocks/CoverImageHeader.tsx +435 -0
- package/src/components/blocks/FeatureCard.tsx +321 -0
- package/src/components/blocks/FeatureGrid.tsx +147 -0
- package/src/components/blocks/Footer.tsx +343 -0
- package/src/components/blocks/HeroBlock.tsx +280 -0
- package/src/components/blocks/PageBannerHeader.tsx +471 -0
- package/src/components/blocks/ProductCard.tsx +472 -0
- package/src/components/blocks/Section.tsx +209 -0
- package/src/components/blocks/index.ts +37 -0
- package/src/components/buttons/Button.tsx +233 -0
- package/src/components/buttons/PaletteSwitcher.tsx +268 -0
- package/src/components/buttons/ThemeSwitcher.tsx +283 -0
- package/src/components/buttons/index.ts +11 -0
- package/src/components/forms/FormBlock.tsx +291 -0
- package/src/components/forms/index.ts +7 -0
- package/src/components/index.ts +37 -0
- package/src/components/input/ChoiceInputField.tsx +188 -0
- package/src/components/input/HtmlInputField.tsx +326 -0
- package/src/components/input/SelectInputField.tsx +197 -0
- package/src/components/input/TextField.tsx +47 -0
- package/src/components/input/TextInputField.tsx +144 -0
- package/src/components/input/index.ts +17 -0
- package/src/components/layout/GridCell.tsx +46 -0
- package/src/components/layout/GridCellWrapper.tsx +87 -0
- package/src/components/layout/GridLayout.tsx +169 -0
- package/src/components/layout/index.ts +13 -0
- package/src/components/menu/Menu.tsx +0 -0
- package/src/components/menu/MenuItem.tsx +32 -0
- package/src/components/menu/index.ts +6 -0
- package/src/components/pages/FormPage.tsx +108 -0
- package/src/components/pages/Page.css +460 -0
- package/src/components/pages/Page.tsx +345 -0
- package/src/components/pages/index.ts +11 -0
- package/src/contexts/DataContext.tsx +355 -0
- package/src/contexts/DimensionsContext.tsx +154 -0
- package/src/contexts/PaletteContext.tsx +217 -0
- package/src/contexts/QwickAppContext.tsx +95 -0
- package/src/contexts/ThemeContext.tsx +376 -0
- package/src/contexts/index.ts +9 -0
- package/src/hooks/__tests__/useDataBinding.test.tsx.disabled +229 -0
- package/src/hooks/index.ts +11 -0
- package/src/hooks/useBaseProps.ts +267 -0
- package/src/hooks/useDataBinding.ts +77 -0
- package/src/index.ts +23 -0
- package/src/palettes/PaletteAutumn.css +172 -0
- package/src/palettes/PaletteAutumn.ts +16 -0
- package/src/palettes/PaletteCosmic.css +172 -0
- package/src/palettes/PaletteCosmic.ts +16 -0
- package/src/palettes/PaletteDefault.css +178 -0
- package/src/palettes/PaletteDefault.ts +17 -0
- package/src/palettes/PaletteOcean.css +172 -0
- package/src/palettes/PaletteOcean.ts +16 -0
- package/src/palettes/PaletteSpring.css +160 -0
- package/src/palettes/PaletteSpring.ts +16 -0
- package/src/palettes/PaletteWinter.css +172 -0
- package/src/palettes/PaletteWinter.ts +16 -0
- package/src/palettes/index.css +12 -0
- package/src/palettes/index.ts +29 -0
- package/src/schemas/ActionSchema.ts +140 -0
- package/src/schemas/ArticleSchema.ts +35 -0
- package/src/schemas/ButtonSchema.ts +99 -0
- package/src/schemas/CardListGridSchema.ts +102 -0
- package/src/schemas/ChoiceInputFieldSchema.ts +89 -0
- package/src/schemas/CodeSchema.ts +88 -0
- package/src/schemas/ContentSchema.ts +128 -0
- package/src/schemas/CoverImageHeaderSchema.ts +208 -0
- package/src/schemas/FeatureCardSchema.ts +161 -0
- package/src/schemas/FeatureGridSchema.ts +87 -0
- package/src/schemas/FeatureItemSchema.ts +68 -0
- package/src/schemas/FooterItemSchema.ts +57 -0
- package/src/schemas/FooterSchema.ts +116 -0
- package/src/schemas/FooterSectionSchema.ts +50 -0
- package/src/schemas/FormBlockSchema.ts +102 -0
- package/src/schemas/HeaderActionSchema.ts +83 -0
- package/src/schemas/HeroBlockSchema.ts +149 -0
- package/src/schemas/HtmlInputFieldSchema.ts +88 -0
- package/src/schemas/MetadataItemSchema.ts +35 -0
- package/src/schemas/PageBannerHeaderSchema.ts +206 -0
- package/src/schemas/PaletteSwitcherSchema.ts +66 -0
- package/src/schemas/ProductCardSchema.ts +264 -0
- package/src/schemas/SafeSpanSchema.ts +36 -0
- package/src/schemas/SectionSchema.ts +106 -0
- package/src/schemas/SelectInputFieldSchema.ts +137 -0
- package/src/schemas/TextInputFieldSchema.ts +129 -0
- package/src/schemas/ThemeSwitcherSchema.ts +97 -0
- package/src/schemas/__tests__/builders.test.ts +313 -0
- package/src/schemas/index.ts +34 -0
- package/src/setupTests.js +60 -0
- package/src/stories/Article.stories.tsx +549 -0
- package/src/stories/Button.stories.tsx +498 -0
- package/src/stories/CardListGrid.stories.tsx +539 -0
- package/src/stories/ChoiceInputField.stories.tsx +591 -0
- package/src/stories/Code.stories.tsx +711 -0
- package/src/stories/Content.stories.tsx +463 -0
- package/src/stories/CoverImageHeader.stories.tsx +794 -0
- package/src/stories/DataBinding.advanced.stories.tsx +548 -0
- package/src/stories/DataBinding.stories.tsx +452 -0
- package/src/stories/DataProvider.stories.tsx +1361 -0
- package/src/stories/FeatureCard.stories.tsx +642 -0
- package/src/stories/FeatureGrid.stories.tsx +669 -0
- package/src/stories/Footer.stories.tsx +724 -0
- package/src/stories/FormBlock.stories.tsx +834 -0
- package/src/stories/HeroBlock.stories.tsx +442 -0
- package/src/stories/Html.stories.tsx +264 -0
- package/src/stories/HtmlInputField.stories.tsx +558 -0
- package/src/stories/Introduction.stories.tsx +721 -0
- package/src/stories/LayoutBlocks.stories.tsx +382 -0
- package/src/stories/LayoutSystem.stories.tsx +253 -0
- package/src/stories/Logo.stories.tsx +400 -0
- package/src/stories/Markdown.stories.tsx +349 -0
- package/src/stories/Page.stories.tsx +762 -0
- package/src/stories/PageBannerHeader.stories.tsx +949 -0
- package/src/stories/PaletteSwitcher.stories.tsx +156 -0
- package/src/stories/ProductCard.stories.tsx +504 -0
- package/src/stories/QwickApp.stories.tsx +461 -0
- package/src/stories/ResponsiveMenu.stories.tsx +299 -0
- package/src/stories/SafeSpan.stories.tsx +612 -0
- package/src/stories/Section.stories.tsx +613 -0
- package/src/stories/SelectInputField.stories.tsx +605 -0
- package/src/stories/TextInputField.stories.tsx +526 -0
- package/src/stories/ThemeSwitcher.stories.tsx +170 -0
- package/src/stories/form/FormComponents.stories.tsx +588 -0
- package/src/templates/TemplateResolver.ts +156 -0
- package/src/templates/index.ts +6 -0
- package/src/tests/ConsoleWarningTest.tsx +30 -0
- package/src/tests/StorageKeyTest.tsx +110 -0
- package/src/tests/ThemeStorageKeyTest.tsx +114 -0
- package/src/types/CacheProvider.ts +14 -0
- package/src/types/ContentProxy.ts +99 -0
- package/src/types/DataTypes.ts +196 -0
- package/src/types/TemplateProvider.ts +9 -0
- package/src/types/TemplateResolver.ts +26 -0
- package/src/types/index.ts +99 -0
- package/src/utils/__tests__/createDataDrivenComponent.test.tsx.disabled +193 -0
- package/src/utils/__tests__/htmlTransform.test.tsx +255 -0
- package/src/utils/breakpoints.ts +87 -0
- package/src/utils/customPaletteManager.js +214 -0
- package/src/utils/dimensions.ts +147 -0
- package/src/utils/htmlTransform.tsx +323 -0
- package/src/utils/index.ts +16 -0
- package/src/utils/logger.ts +28 -0
- package/src/utils/paletteUtils.ts +78 -0
- package/src/utils/persistenceUtils.ts +107 -0
- package/src/utils/reactUtils.tsx +37 -0
- package/src/utils/spacing.ts +155 -0
- package/src/utils/themePerformanceMonitor.js +113 -0
- package/src/utils/themeUtils.ts +67 -0
|
@@ -0,0 +1,613 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Section Component Stories - Layout containers with data binding support
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { Box, Typography } from '@mui/material';
|
|
8
|
+
import { JsonDataProvider } from '@qwickapps/schema';
|
|
9
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
10
|
+
import QwickApp from '../components/QwickApp';
|
|
11
|
+
import { Code } from '../components/blocks';
|
|
12
|
+
import Section from '../components/blocks/Section';
|
|
13
|
+
|
|
14
|
+
// Sample CMS data for data binding stories
|
|
15
|
+
const sampleCmsData = {
|
|
16
|
+
'pages.home.intro-section': [
|
|
17
|
+
{
|
|
18
|
+
background: 'var(--theme-primary)',
|
|
19
|
+
color: 'var(--theme-on-primary)',
|
|
20
|
+
padding: 'large',
|
|
21
|
+
contentMaxWidth: 'lg',
|
|
22
|
+
component: 'section'
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
'content.feature-section': [
|
|
26
|
+
{
|
|
27
|
+
background: '#f8f9fa',
|
|
28
|
+
color: '#212529',
|
|
29
|
+
padding: 'medium',
|
|
30
|
+
contentMaxWidth: 'xl',
|
|
31
|
+
component: 'article'
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
'layouts.hero-section': [
|
|
35
|
+
{
|
|
36
|
+
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
|
37
|
+
color: '#ffffff',
|
|
38
|
+
padding: 'extra-large',
|
|
39
|
+
contentMaxWidth: 'false',
|
|
40
|
+
component: 'main'
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
'layouts.minimal-section': [
|
|
44
|
+
{
|
|
45
|
+
background: '#ffffff',
|
|
46
|
+
color: '#333333',
|
|
47
|
+
padding: 'none',
|
|
48
|
+
contentMaxWidth: 'md',
|
|
49
|
+
component: 'div'
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
'marketing.cta-section': [
|
|
53
|
+
{
|
|
54
|
+
background: '#e3f2fd',
|
|
55
|
+
color: '#1565c0',
|
|
56
|
+
padding: 'large',
|
|
57
|
+
contentMaxWidth: 'lg',
|
|
58
|
+
component: 'section'
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
'company.about-section': [
|
|
62
|
+
{
|
|
63
|
+
background: 'var(--theme-secondary)',
|
|
64
|
+
color: 'var(--theme-on-secondary)',
|
|
65
|
+
padding: 'medium',
|
|
66
|
+
contentMaxWidth: 'md',
|
|
67
|
+
component: 'section'
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const dataProvider = new JsonDataProvider({ data: sampleCmsData });
|
|
73
|
+
|
|
74
|
+
const meta = {
|
|
75
|
+
title: 'Components/Section',
|
|
76
|
+
component: Section,
|
|
77
|
+
parameters: {
|
|
78
|
+
layout: 'fullscreen',
|
|
79
|
+
docs: {
|
|
80
|
+
description: {
|
|
81
|
+
component: `Section is a foundational layout container component that supports both traditional props and data binding through dataSource.
|
|
82
|
+
|
|
83
|
+
**Key Features:**
|
|
84
|
+
- **Theme-Aware Backgrounds**: Support for CSS colors, gradients, and theme variables
|
|
85
|
+
- **Responsive Spacing**: Six padding presets from none to extra-large
|
|
86
|
+
- **Container Control**: Customizable max width with responsive breakpoints
|
|
87
|
+
- **Semantic HTML**: Choose appropriate HTML elements (section, article, main, div)
|
|
88
|
+
- **Data Binding**: Full CMS integration through dataSource prop
|
|
89
|
+
- **Grid Integration**: Works with QwickApps grid system
|
|
90
|
+
|
|
91
|
+
**Perfect For:**
|
|
92
|
+
- Page section containers and layout organization
|
|
93
|
+
- Content areas with consistent spacing and styling
|
|
94
|
+
- Theme-based background and text color management
|
|
95
|
+
- Responsive content width control
|
|
96
|
+
- Semantic HTML structure for accessibility`,
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
tags: ['autodocs'],
|
|
101
|
+
} satisfies Meta<typeof Section>;
|
|
102
|
+
|
|
103
|
+
export default meta;
|
|
104
|
+
type Story = StoryObj<typeof meta>;
|
|
105
|
+
|
|
106
|
+
// Traditional Usage Examples
|
|
107
|
+
export const BasicSection: Story = {
|
|
108
|
+
render: () => (
|
|
109
|
+
<QwickApp appId="section-basic" appName='Basic Section'>
|
|
110
|
+
<Section
|
|
111
|
+
background="#f5f5f5"
|
|
112
|
+
color="#333333"
|
|
113
|
+
padding="medium"
|
|
114
|
+
contentMaxWidth="lg"
|
|
115
|
+
component="section"
|
|
116
|
+
>
|
|
117
|
+
<Typography variant="h4" gutterBottom>
|
|
118
|
+
Basic Section Container
|
|
119
|
+
</Typography>
|
|
120
|
+
<Typography variant="body1">
|
|
121
|
+
This is a basic section with custom background color, standard padding, and responsive content width.
|
|
122
|
+
</Typography>
|
|
123
|
+
</Section>
|
|
124
|
+
</QwickApp>
|
|
125
|
+
),
|
|
126
|
+
parameters: {
|
|
127
|
+
docs: {
|
|
128
|
+
description: {
|
|
129
|
+
story: 'Basic Section with traditional props - background color, padding, and content width control.',
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export const PaddingVariants: Story = {
|
|
136
|
+
render: () => (
|
|
137
|
+
<QwickApp appId="section-padding" appName='Section Padding Variants'>
|
|
138
|
+
<Box>
|
|
139
|
+
|
|
140
|
+
<Section background="#e3f2fd" padding="none" contentMaxWidth="lg">
|
|
141
|
+
<Typography variant="h6">No Padding Section</Typography>
|
|
142
|
+
<Typography variant="body2">Compact section with no vertical spacing (0px)</Typography>
|
|
143
|
+
</Section>
|
|
144
|
+
|
|
145
|
+
<Section background="#f3e5f5" padding="tiny" contentMaxWidth="lg">
|
|
146
|
+
<Typography variant="h6">Tiny Padding Section</Typography>
|
|
147
|
+
<Typography variant="body2">Minimal spacing section (8px vertical)</Typography>
|
|
148
|
+
</Section>
|
|
149
|
+
|
|
150
|
+
<Section background="#e8f5e8" padding="small" contentMaxWidth="lg">
|
|
151
|
+
<Typography variant="h6">Small Padding Section</Typography>
|
|
152
|
+
<Typography variant="body2">Small spacing section (16px vertical)</Typography>
|
|
153
|
+
</Section>
|
|
154
|
+
|
|
155
|
+
<Section background="#fff3e0" padding="medium" contentMaxWidth="lg">
|
|
156
|
+
<Typography variant="h6">Medium Padding Section (Default)</Typography>
|
|
157
|
+
<Typography variant="body2">Standard spacing section (32px vertical)</Typography>
|
|
158
|
+
</Section>
|
|
159
|
+
|
|
160
|
+
<Section background="#fce4ec" padding="large" contentMaxWidth="lg">
|
|
161
|
+
<Typography variant="h6">Large Padding Section</Typography>
|
|
162
|
+
<Typography variant="body2">Generous spacing section (64px vertical)</Typography>
|
|
163
|
+
</Section>
|
|
164
|
+
|
|
165
|
+
<Section background="#e0f2f1" padding="extra-large" contentMaxWidth="lg">
|
|
166
|
+
<Typography variant="h6">Extra Large Padding Section</Typography>
|
|
167
|
+
<Typography variant="body2">Maximum spacing section (96px vertical)</Typography>
|
|
168
|
+
</Section>
|
|
169
|
+
|
|
170
|
+
</Box>
|
|
171
|
+
</QwickApp>
|
|
172
|
+
),
|
|
173
|
+
parameters: {
|
|
174
|
+
docs: {
|
|
175
|
+
description: {
|
|
176
|
+
story: 'All available padding variants: none (0px), tiny (8px), small (16px), medium (32px), large (64px), extra-large (96px).',
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
export const ContentWidthVariants: Story = {
|
|
183
|
+
render: () => (
|
|
184
|
+
<QwickApp appId="section-widths" appName='Section Content Width Variants'>
|
|
185
|
+
<Box>
|
|
186
|
+
|
|
187
|
+
<Section background="#f5f5f5" padding="medium" contentMaxWidth="xs">
|
|
188
|
+
<Typography variant="h6" gutterBottom>XS Max Width</Typography>
|
|
189
|
+
<Typography variant="body2">Extra small container width (444px max)</Typography>
|
|
190
|
+
</Section>
|
|
191
|
+
|
|
192
|
+
<Section background="#e3f2fd" padding="medium" contentMaxWidth="sm">
|
|
193
|
+
<Typography variant="h6" gutterBottom>SM Max Width</Typography>
|
|
194
|
+
<Typography variant="body2">Small container width (600px max)</Typography>
|
|
195
|
+
</Section>
|
|
196
|
+
|
|
197
|
+
<Section background="#f3e5f5" padding="medium" contentMaxWidth="md">
|
|
198
|
+
<Typography variant="h6" gutterBottom>MD Max Width</Typography>
|
|
199
|
+
<Typography variant="body2">Medium container width (900px max)</Typography>
|
|
200
|
+
</Section>
|
|
201
|
+
|
|
202
|
+
<Section background="#e8f5e8" padding="medium" contentMaxWidth="lg">
|
|
203
|
+
<Typography variant="h6" gutterBottom>LG Max Width (Default)</Typography>
|
|
204
|
+
<Typography variant="body2">Large container width (1200px max)</Typography>
|
|
205
|
+
</Section>
|
|
206
|
+
|
|
207
|
+
<Section background="#fff3e0" padding="medium" contentMaxWidth="xl">
|
|
208
|
+
<Typography variant="h6" gutterBottom>XL Max Width</Typography>
|
|
209
|
+
<Typography variant="body2">Extra large container width (1536px max)</Typography>
|
|
210
|
+
</Section>
|
|
211
|
+
|
|
212
|
+
<Section background="#fce4ec" padding="medium" contentMaxWidth={false as any}>
|
|
213
|
+
<Typography variant="h6" gutterBottom>Full Width (No Max Width)</Typography>
|
|
214
|
+
<Typography variant="body2">Full width container with no maximum width constraint</Typography>
|
|
215
|
+
</Section>
|
|
216
|
+
|
|
217
|
+
</Box>
|
|
218
|
+
</QwickApp>
|
|
219
|
+
),
|
|
220
|
+
parameters: {
|
|
221
|
+
docs: {
|
|
222
|
+
description: {
|
|
223
|
+
story: 'Content width options: xs, sm, md, lg (default), xl, and false for full width.',
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
export const SemanticElements: Story = {
|
|
230
|
+
render: () => (
|
|
231
|
+
<QwickApp appId="section-semantic" appName='Section Semantic Elements'>
|
|
232
|
+
<Box>
|
|
233
|
+
|
|
234
|
+
<Section background="#e3f2fd" padding="medium" component="main">
|
|
235
|
+
<Typography variant="h5" gutterBottom>Main Element</Typography>
|
|
236
|
+
<Typography variant="body1">
|
|
237
|
+
Use <main> for the primary content area of the page
|
|
238
|
+
</Typography>
|
|
239
|
+
</Section>
|
|
240
|
+
|
|
241
|
+
<Section background="#f3e5f5" padding="medium" component="section">
|
|
242
|
+
<Typography variant="h5" gutterBottom>Section Element (Default)</Typography>
|
|
243
|
+
<Typography variant="body1">
|
|
244
|
+
Use <section> for thematic groupings of content
|
|
245
|
+
</Typography>
|
|
246
|
+
</Section>
|
|
247
|
+
|
|
248
|
+
<Section background="#e8f5e8" padding="medium" component="article">
|
|
249
|
+
<Typography variant="h5" gutterBottom>Article Element</Typography>
|
|
250
|
+
<Typography variant="body1">
|
|
251
|
+
Use <article> for standalone, reusable content
|
|
252
|
+
</Typography>
|
|
253
|
+
</Section>
|
|
254
|
+
|
|
255
|
+
<Section background="#fff3e0" padding="medium" component="div">
|
|
256
|
+
<Typography variant="h5" gutterBottom>Div Element</Typography>
|
|
257
|
+
<Typography variant="body1">
|
|
258
|
+
Use <div> for non-semantic containers and styling
|
|
259
|
+
</Typography>
|
|
260
|
+
</Section>
|
|
261
|
+
|
|
262
|
+
</Box>
|
|
263
|
+
</QwickApp>
|
|
264
|
+
),
|
|
265
|
+
parameters: {
|
|
266
|
+
docs: {
|
|
267
|
+
description: {
|
|
268
|
+
story: 'Semantic HTML elements: main, section (default), article, and div for appropriate content structure.',
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
// Data Binding Examples
|
|
275
|
+
export const DataBindingBasic: Story = {
|
|
276
|
+
render: () => (
|
|
277
|
+
<QwickApp appId="section-data-binding" appName='Section Data Binding' dataSource={{ dataProvider }}>
|
|
278
|
+
<Box>
|
|
279
|
+
|
|
280
|
+
<Box sx={{ p: 4, backgroundColor: 'background.paper' }}>
|
|
281
|
+
<Typography variant="h5" gutterBottom>📊 Data-Driven Section</Typography>
|
|
282
|
+
<Typography variant="body1" sx={{ mb: 3, opacity: 0.8 }}>
|
|
283
|
+
Section components can be driven entirely by CMS data using the dataSource prop.
|
|
284
|
+
</Typography>
|
|
285
|
+
|
|
286
|
+
<Code title="Usage" language="tsx">{`<Section dataSource="pages.home.intro-section">
|
|
287
|
+
<YourContent />
|
|
288
|
+
</Section>`}</Code>
|
|
289
|
+
|
|
290
|
+
<Code title="Data Structure" language="json">{JSON.stringify(sampleCmsData['pages.home.intro-section'][0], null, 2)}</Code>
|
|
291
|
+
</Box>
|
|
292
|
+
|
|
293
|
+
<Section dataSource="pages.home.intro-section">
|
|
294
|
+
<Typography variant="h4" gutterBottom>
|
|
295
|
+
Welcome to QwickApps React Framework
|
|
296
|
+
</Typography>
|
|
297
|
+
<Typography variant="h6" sx={{ opacity: 0.9 }}>
|
|
298
|
+
This section is entirely configured through CMS data with primary theme background,
|
|
299
|
+
large padding, and responsive content width.
|
|
300
|
+
</Typography>
|
|
301
|
+
</Section>
|
|
302
|
+
|
|
303
|
+
</Box>
|
|
304
|
+
</QwickApp>
|
|
305
|
+
),
|
|
306
|
+
parameters: {
|
|
307
|
+
docs: {
|
|
308
|
+
description: {
|
|
309
|
+
story: 'Section with data binding - all styling resolved from CMS data through dataSource.',
|
|
310
|
+
},
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
export const DataBindingAdvanced: Story = {
|
|
316
|
+
render: () => (
|
|
317
|
+
<QwickApp appId="section-data-advanced" appName='Advanced Section Data Binding' dataSource={{ dataProvider }}>
|
|
318
|
+
<Box>
|
|
319
|
+
|
|
320
|
+
<Box sx={{ p: 4, backgroundColor: 'background.paper' }}>
|
|
321
|
+
<Typography variant="h5" gutterBottom>🎯 Multiple Data Sources</Typography>
|
|
322
|
+
<Typography variant="body1" sx={{ mb: 3, opacity: 0.8 }}>
|
|
323
|
+
Different Section components can pull from different data sources with varying configurations.
|
|
324
|
+
</Typography>
|
|
325
|
+
|
|
326
|
+
<Code title="Multiple Data Sources" language="tsx">{`{/* Hero with gradient background */}
|
|
327
|
+
<Section dataSource="layouts.hero-section">
|
|
328
|
+
<HeroContent />
|
|
329
|
+
</Section>
|
|
330
|
+
|
|
331
|
+
{/* Feature section with light background */}
|
|
332
|
+
<Section dataSource="content.feature-section">
|
|
333
|
+
<FeatureContent />
|
|
334
|
+
</Section>
|
|
335
|
+
|
|
336
|
+
{/* Minimal section with no padding */}
|
|
337
|
+
<Section dataSource="layouts.minimal-section">
|
|
338
|
+
<CompactContent />
|
|
339
|
+
</Section>`}</Code>
|
|
340
|
+
</Box>
|
|
341
|
+
|
|
342
|
+
{/* Hero Section */}
|
|
343
|
+
<Section dataSource="layouts.hero-section">
|
|
344
|
+
<Box sx={{ textAlign: 'center' }}>
|
|
345
|
+
<Typography variant="h2" gutterBottom sx={{ fontWeight: 'bold' }}>
|
|
346
|
+
Revolutionary Framework
|
|
347
|
+
</Typography>
|
|
348
|
+
<Typography variant="h5" sx={{ opacity: 0.9, maxWidth: '600px', mx: 'auto' }}>
|
|
349
|
+
Full-width gradient background with extra-large padding and dramatic typography
|
|
350
|
+
</Typography>
|
|
351
|
+
</Box>
|
|
352
|
+
</Section>
|
|
353
|
+
|
|
354
|
+
{/* Feature Section */}
|
|
355
|
+
<Section dataSource="content.feature-section">
|
|
356
|
+
<Typography variant="h4" gutterBottom>
|
|
357
|
+
Feature Highlights
|
|
358
|
+
</Typography>
|
|
359
|
+
<Typography variant="body1" sx={{ fontSize: '1.1rem', lineHeight: 1.6 }}>
|
|
360
|
+
This article section uses a light background with extended content width,
|
|
361
|
+
perfect for detailed feature descriptions and technical content.
|
|
362
|
+
</Typography>
|
|
363
|
+
</Section>
|
|
364
|
+
|
|
365
|
+
{/* Minimal Section */}
|
|
366
|
+
<Section dataSource="layouts.minimal-section">
|
|
367
|
+
<Typography variant="h6" gutterBottom>
|
|
368
|
+
Minimal Design Section
|
|
369
|
+
</Typography>
|
|
370
|
+
<Typography variant="body2">
|
|
371
|
+
Clean, no-padding section with medium content width for compact layouts
|
|
372
|
+
</Typography>
|
|
373
|
+
</Section>
|
|
374
|
+
|
|
375
|
+
</Box>
|
|
376
|
+
</QwickApp>
|
|
377
|
+
),
|
|
378
|
+
parameters: {
|
|
379
|
+
docs: {
|
|
380
|
+
description: {
|
|
381
|
+
story: 'Advanced data binding with multiple data sources showcasing different section configurations.',
|
|
382
|
+
},
|
|
383
|
+
},
|
|
384
|
+
},
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
export const DataBindingWithFallback: Story = {
|
|
388
|
+
render: () => (
|
|
389
|
+
<QwickApp appId="section-fallback" appName='Section Data Binding with Fallback' dataSource={{ dataProvider }}>
|
|
390
|
+
<Box>
|
|
391
|
+
|
|
392
|
+
<Box sx={{ p: 4, backgroundColor: 'background.paper' }}>
|
|
393
|
+
<Typography variant="h5" gutterBottom>🛡️ Fallback Support</Typography>
|
|
394
|
+
<Typography variant="body1" sx={{ mb: 3, opacity: 0.8 }}>
|
|
395
|
+
Section components gracefully handle missing data sources with fallback props.
|
|
396
|
+
</Typography>
|
|
397
|
+
|
|
398
|
+
<Code title="Fallback Usage" language="tsx">{`<Section
|
|
399
|
+
dataSource="nonexistent.section"
|
|
400
|
+
background="#f9f9f9"
|
|
401
|
+
padding="small"
|
|
402
|
+
contentMaxWidth="md"
|
|
403
|
+
>
|
|
404
|
+
<FallbackContent />
|
|
405
|
+
</Section>`}</Code>
|
|
406
|
+
</Box>
|
|
407
|
+
|
|
408
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 4 }}>
|
|
409
|
+
<Box>
|
|
410
|
+
<Typography variant="h6" gutterBottom>Missing Data Source (Fallback)</Typography>
|
|
411
|
+
<Section
|
|
412
|
+
dataSource="nonexistent.section"
|
|
413
|
+
background="#f9f9f9"
|
|
414
|
+
color="#333333"
|
|
415
|
+
padding="small"
|
|
416
|
+
contentMaxWidth="md"
|
|
417
|
+
component="section"
|
|
418
|
+
>
|
|
419
|
+
<Typography variant="h6" gutterBottom>
|
|
420
|
+
Fallback Section Content
|
|
421
|
+
</Typography>
|
|
422
|
+
<Typography variant="body2">
|
|
423
|
+
This section uses fallback props when the dataSource doesn't exist.
|
|
424
|
+
</Typography>
|
|
425
|
+
</Section>
|
|
426
|
+
</Box>
|
|
427
|
+
<Box>
|
|
428
|
+
<Typography variant="h6" gutterBottom>Valid Data Source</Typography>
|
|
429
|
+
<Section dataSource="marketing.cta-section">
|
|
430
|
+
<Typography variant="h6" gutterBottom>
|
|
431
|
+
CTA Section from Data
|
|
432
|
+
</Typography>
|
|
433
|
+
<Typography variant="body2">
|
|
434
|
+
This section loads successfully from the CMS data source.
|
|
435
|
+
</Typography>
|
|
436
|
+
</Section>
|
|
437
|
+
</Box>
|
|
438
|
+
</Box>
|
|
439
|
+
|
|
440
|
+
</Box>
|
|
441
|
+
</QwickApp>
|
|
442
|
+
),
|
|
443
|
+
parameters: {
|
|
444
|
+
docs: {
|
|
445
|
+
description: {
|
|
446
|
+
story: 'Section with fallback props when dataSource is missing or unavailable.',
|
|
447
|
+
},
|
|
448
|
+
},
|
|
449
|
+
},
|
|
450
|
+
};
|
|
451
|
+
|
|
452
|
+
export const ThemeIntegration: Story = {
|
|
453
|
+
render: () => (
|
|
454
|
+
<QwickApp appId="section-theme" appName='Section Theme Integration'>
|
|
455
|
+
<Box>
|
|
456
|
+
|
|
457
|
+
<Box sx={{ p: 4, backgroundColor: 'background.paper' }}>
|
|
458
|
+
<Typography variant="h5" gutterBottom>🎨 Theme Integration</Typography>
|
|
459
|
+
<Typography variant="body1" sx={{ mb: 3, opacity: 0.8 }}>
|
|
460
|
+
Sections support both CSS colors and theme variables for consistent branding.
|
|
461
|
+
</Typography>
|
|
462
|
+
</Box>
|
|
463
|
+
|
|
464
|
+
<Section background="var(--theme-primary)" color="var(--theme-on-primary)" padding="large">
|
|
465
|
+
<Typography variant="h4" gutterBottom>
|
|
466
|
+
Primary Theme Section
|
|
467
|
+
</Typography>
|
|
468
|
+
<Typography variant="body1" sx={{ opacity: 0.9 }}>
|
|
469
|
+
Using theme variables ensures consistency with your application's color system
|
|
470
|
+
</Typography>
|
|
471
|
+
</Section>
|
|
472
|
+
|
|
473
|
+
<Section background="var(--theme-secondary)" color="var(--theme-on-secondary)" padding="large">
|
|
474
|
+
<Typography variant="h4" gutterBottom>
|
|
475
|
+
Secondary Theme Section
|
|
476
|
+
</Typography>
|
|
477
|
+
<Typography variant="body1" sx={{ opacity: 0.9 }}>
|
|
478
|
+
Secondary theme colors work perfectly for supporting content areas
|
|
479
|
+
</Typography>
|
|
480
|
+
</Section>
|
|
481
|
+
|
|
482
|
+
<Section background="#2c3e50" color="#ecf0f1" padding="large">
|
|
483
|
+
<Typography variant="h4" gutterBottom>
|
|
484
|
+
Custom Color Section
|
|
485
|
+
</Typography>
|
|
486
|
+
<Typography variant="body1" sx={{ opacity: 0.9 }}>
|
|
487
|
+
Direct CSS colors provide full customization when needed
|
|
488
|
+
</Typography>
|
|
489
|
+
</Section>
|
|
490
|
+
|
|
491
|
+
</Box>
|
|
492
|
+
</QwickApp>
|
|
493
|
+
),
|
|
494
|
+
parameters: {
|
|
495
|
+
docs: {
|
|
496
|
+
description: {
|
|
497
|
+
story: 'Theme integration examples showing theme variables and custom CSS colors.',
|
|
498
|
+
},
|
|
499
|
+
},
|
|
500
|
+
},
|
|
501
|
+
};
|
|
502
|
+
|
|
503
|
+
export const RealWorldExample: Story = {
|
|
504
|
+
render: () => (
|
|
505
|
+
<QwickApp appId="section-real-world" appName='Real World Section Example' dataSource={{ dataProvider }}>
|
|
506
|
+
<Box>
|
|
507
|
+
|
|
508
|
+
{/* Hero Section - Data Driven */}
|
|
509
|
+
<Section dataSource="layouts.hero-section">
|
|
510
|
+
<Box sx={{ textAlign: 'center' }}>
|
|
511
|
+
<Typography variant="h1" gutterBottom sx={{
|
|
512
|
+
fontSize: { xs: '2.5rem', md: '3.5rem' },
|
|
513
|
+
fontWeight: 'bold',
|
|
514
|
+
mb: 3
|
|
515
|
+
}}>
|
|
516
|
+
Build Apps 10x Faster
|
|
517
|
+
</Typography>
|
|
518
|
+
<Typography variant="h5" sx={{
|
|
519
|
+
opacity: 0.9,
|
|
520
|
+
maxWidth: '700px',
|
|
521
|
+
mx: 'auto',
|
|
522
|
+
lineHeight: 1.4
|
|
523
|
+
}}>
|
|
524
|
+
The most developer-friendly React framework that turns complex UI development into pure joy
|
|
525
|
+
</Typography>
|
|
526
|
+
</Box>
|
|
527
|
+
</Section>
|
|
528
|
+
|
|
529
|
+
{/* Feature Section - Data Driven */}
|
|
530
|
+
<Section dataSource="content.feature-section">
|
|
531
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: { xs: '1fr', md: '1fr 1fr 1fr' }, gap: 4 }}>
|
|
532
|
+
<Box>
|
|
533
|
+
<Typography variant="h6" gutterBottom sx={{ color: 'primary.main' }}>
|
|
534
|
+
⚡ Lightning Fast
|
|
535
|
+
</Typography>
|
|
536
|
+
<Typography variant="body1">
|
|
537
|
+
Optimized build system and runtime performance for instant user experiences
|
|
538
|
+
</Typography>
|
|
539
|
+
</Box>
|
|
540
|
+
<Box>
|
|
541
|
+
<Typography variant="h6" gutterBottom sx={{ color: 'primary.main' }}>
|
|
542
|
+
🎨 Beautiful UI
|
|
543
|
+
</Typography>
|
|
544
|
+
<Typography variant="body1">
|
|
545
|
+
Professional components and layouts that work perfectly out of the box
|
|
546
|
+
</Typography>
|
|
547
|
+
</Box>
|
|
548
|
+
<Box>
|
|
549
|
+
<Typography variant="h6" gutterBottom sx={{ color: 'primary.main' }}>
|
|
550
|
+
📱 Mobile First
|
|
551
|
+
</Typography>
|
|
552
|
+
<Typography variant="body1">
|
|
553
|
+
Responsive design principles built into every component and layout
|
|
554
|
+
</Typography>
|
|
555
|
+
</Box>
|
|
556
|
+
</Box>
|
|
557
|
+
</Section>
|
|
558
|
+
|
|
559
|
+
{/* CTA Section - Traditional Props */}
|
|
560
|
+
<Section
|
|
561
|
+
background="linear-gradient(45deg, #2196F3, #21CBF3)"
|
|
562
|
+
color="#ffffff"
|
|
563
|
+
padding="large"
|
|
564
|
+
contentMaxWidth="md"
|
|
565
|
+
component="section"
|
|
566
|
+
>
|
|
567
|
+
<Box sx={{ textAlign: 'center' }}>
|
|
568
|
+
<Typography variant="h3" gutterBottom sx={{ fontWeight: 'bold' }}>
|
|
569
|
+
Ready to Get Started?
|
|
570
|
+
</Typography>
|
|
571
|
+
<Typography variant="h6" sx={{ opacity: 0.9, mb: 4 }}>
|
|
572
|
+
Join thousands of developers building amazing applications
|
|
573
|
+
</Typography>
|
|
574
|
+
<Box sx={{ display: 'flex', gap: 2, justifyContent: 'center', flexWrap: 'wrap' }}>
|
|
575
|
+
<Typography
|
|
576
|
+
component="div"
|
|
577
|
+
sx={{
|
|
578
|
+
px: 4,
|
|
579
|
+
py: 1.5,
|
|
580
|
+
backgroundColor: 'rgba(255,255,255,0.2)',
|
|
581
|
+
borderRadius: 2,
|
|
582
|
+
fontWeight: 'bold'
|
|
583
|
+
}}
|
|
584
|
+
>
|
|
585
|
+
Get Started Free
|
|
586
|
+
</Typography>
|
|
587
|
+
<Typography
|
|
588
|
+
component="div"
|
|
589
|
+
sx={{
|
|
590
|
+
px: 4,
|
|
591
|
+
py: 1.5,
|
|
592
|
+
border: '2px solid rgba(255,255,255,0.5)',
|
|
593
|
+
borderRadius: 2,
|
|
594
|
+
fontWeight: 'bold'
|
|
595
|
+
}}
|
|
596
|
+
>
|
|
597
|
+
View Documentation
|
|
598
|
+
</Typography>
|
|
599
|
+
</Box>
|
|
600
|
+
</Box>
|
|
601
|
+
</Section>
|
|
602
|
+
|
|
603
|
+
</Box>
|
|
604
|
+
</QwickApp>
|
|
605
|
+
),
|
|
606
|
+
parameters: {
|
|
607
|
+
docs: {
|
|
608
|
+
description: {
|
|
609
|
+
story: 'Real-world example combining data-driven Sections with traditional usage for complete page layouts.',
|
|
610
|
+
},
|
|
611
|
+
},
|
|
612
|
+
},
|
|
613
|
+
};
|