@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,442 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HeroBlock Component Stories - Hero sections 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 HeroBlock from '../components/blocks/HeroBlock';
|
|
13
|
+
import { DataProvider } from '../contexts/DataContext';
|
|
14
|
+
|
|
15
|
+
// Sample CMS data for data binding stories
|
|
16
|
+
const sampleCmsData = {
|
|
17
|
+
'heroes': {
|
|
18
|
+
'home': {
|
|
19
|
+
title: 'Build Apps 10x Faster with QwickApps',
|
|
20
|
+
subtitle: 'The most developer-friendly React framework that turns complex UI development into a joy. Build production-ready applications in hours, not weeks.',
|
|
21
|
+
backgroundGradient: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
|
22
|
+
actions: [
|
|
23
|
+
{ label: 'Get Started Free', variant: 'primary', buttonSize: 'large' },
|
|
24
|
+
{ label: 'Watch Demo', variant: 'outlined', buttonSize: 'large', icon: '▶️' }
|
|
25
|
+
],
|
|
26
|
+
textAlign: 'center',
|
|
27
|
+
blockHeight: 'large',
|
|
28
|
+
overlayOpacity: 0.6
|
|
29
|
+
},
|
|
30
|
+
'product-launch': {
|
|
31
|
+
title: '🚀 Revolutionary New Framework',
|
|
32
|
+
subtitle: 'Skip months of boilerplate setup. Focus on what makes your application unique.',
|
|
33
|
+
backgroundImage: 'https://images.unsplash.com/photo-1558618666-fcd25c85cd64?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80',
|
|
34
|
+
actions: [
|
|
35
|
+
{ label: 'Launch Now', variant: 'primary', buttonSize: 'large' },
|
|
36
|
+
{ label: 'View Features', variant: 'text', buttonSize: 'large' }
|
|
37
|
+
],
|
|
38
|
+
textAlign: 'center',
|
|
39
|
+
blockHeight: 'viewport',
|
|
40
|
+
overlayOpacity: 0.7
|
|
41
|
+
},
|
|
42
|
+
'about': {
|
|
43
|
+
title: 'Empowering Developers Worldwide',
|
|
44
|
+
subtitle: 'Our mission is to make web development accessible, enjoyable, and productive for everyone.',
|
|
45
|
+
backgroundColor: 'primary',
|
|
46
|
+
actions: [
|
|
47
|
+
{ label: 'Our Story', variant: 'secondary', buttonSize: 'medium' },
|
|
48
|
+
{ label: 'Join Team', variant: 'outlined', buttonSize: 'medium' }
|
|
49
|
+
],
|
|
50
|
+
textAlign: 'left',
|
|
51
|
+
blockHeight: 'medium'
|
|
52
|
+
},
|
|
53
|
+
'minimal': {
|
|
54
|
+
title: 'Simple. Powerful. Elegant.',
|
|
55
|
+
subtitle: 'Everything you need, nothing you don\'t.',
|
|
56
|
+
backgroundColor: 'surface',
|
|
57
|
+
blockHeight: 'small',
|
|
58
|
+
textAlign: 'center'
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const dataProvider = new JsonDataProvider({ data: sampleCmsData });
|
|
64
|
+
|
|
65
|
+
const meta = {
|
|
66
|
+
title: 'Blocks/HeroBlock',
|
|
67
|
+
component: HeroBlock,
|
|
68
|
+
parameters: {
|
|
69
|
+
layout: 'fullscreen',
|
|
70
|
+
docs: {
|
|
71
|
+
description: {
|
|
72
|
+
component: `HeroBlock is a powerful full-width hero section component that supports both traditional props and data binding through dataSource.
|
|
73
|
+
|
|
74
|
+
**Key Features:**
|
|
75
|
+
- **Flexible Backgrounds**: Support for images, gradients, and theme colors
|
|
76
|
+
- **Responsive Typography**: Automatically scales from mobile to desktop
|
|
77
|
+
- **Action Buttons**: Built-in support for multiple call-to-action buttons
|
|
78
|
+
- **Height Variants**: Small, medium, large, and full viewport options
|
|
79
|
+
- **Text Alignment**: Left, center, or right alignment options
|
|
80
|
+
- **Data Binding**: Full CMS integration through dataSource prop
|
|
81
|
+
- **Overlay Control**: Customizable overlay opacity for background images
|
|
82
|
+
|
|
83
|
+
**Perfect For:**
|
|
84
|
+
- Landing page heroes and primary messaging
|
|
85
|
+
- Product launch announcements
|
|
86
|
+
- Marketing campaigns and promotions
|
|
87
|
+
- About pages and company messaging
|
|
88
|
+
- Feature highlights and value propositions`,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
tags: ['autodocs'],
|
|
93
|
+
} satisfies Meta<typeof HeroBlock>;
|
|
94
|
+
|
|
95
|
+
export default meta;
|
|
96
|
+
type Story = StoryObj<typeof meta>;
|
|
97
|
+
|
|
98
|
+
// Traditional Usage Examples
|
|
99
|
+
export const BasicHero: Story = {
|
|
100
|
+
render: () => (
|
|
101
|
+
<QwickApp appId="heroblock-basic" appName='Basic HeroBlock'>
|
|
102
|
+
<HeroBlock
|
|
103
|
+
title="Welcome to Our Platform"
|
|
104
|
+
subtitle="Build amazing applications with our comprehensive toolkit"
|
|
105
|
+
backgroundColor="primary"
|
|
106
|
+
textAlign="center"
|
|
107
|
+
blockHeight="medium"
|
|
108
|
+
actions={[
|
|
109
|
+
{ label: 'Get Started', variant: 'primary', buttonSize: 'large' },
|
|
110
|
+
{ label: 'Learn More', variant: 'outlined', buttonSize: 'large' }
|
|
111
|
+
]}
|
|
112
|
+
/>
|
|
113
|
+
</QwickApp>
|
|
114
|
+
),
|
|
115
|
+
parameters: {
|
|
116
|
+
docs: {
|
|
117
|
+
description: {
|
|
118
|
+
story: 'Basic HeroBlock with traditional props - title, subtitle, actions, and theme background.',
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export const BackgroundVariants: Story = {
|
|
125
|
+
render: () => (
|
|
126
|
+
<QwickApp appId="heroblock-backgrounds" appName='HeroBlock Backgrounds'>
|
|
127
|
+
<Box sx={{ '& > *:not(:last-child)': { mb: 2 } }}>
|
|
128
|
+
|
|
129
|
+
<HeroBlock
|
|
130
|
+
title="Gradient Background Hero"
|
|
131
|
+
subtitle="Beautiful gradients create visual impact"
|
|
132
|
+
backgroundGradient="linear-gradient(135deg, #667eea 0%, #764ba2 100%)"
|
|
133
|
+
blockHeight="medium"
|
|
134
|
+
actions={[{ label: 'Explore', variant: 'primary', buttonSize: 'large' }]}
|
|
135
|
+
/>
|
|
136
|
+
|
|
137
|
+
<HeroBlock
|
|
138
|
+
title="Image Background Hero"
|
|
139
|
+
subtitle="High-quality images with customizable overlay"
|
|
140
|
+
backgroundImage="https://images.unsplash.com/photo-1558618666-fcd25c85cd64?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80"
|
|
141
|
+
overlayOpacity={0.6}
|
|
142
|
+
blockHeight="medium"
|
|
143
|
+
actions={[{ label: 'Discover', variant: 'primary', buttonSize: 'large' }]}
|
|
144
|
+
/>
|
|
145
|
+
|
|
146
|
+
<HeroBlock
|
|
147
|
+
title="Theme Color Background"
|
|
148
|
+
subtitle="Consistent with your application theme"
|
|
149
|
+
backgroundColor="secondary"
|
|
150
|
+
blockHeight="medium"
|
|
151
|
+
actions={[{ label: 'Continue', variant: 'primary', buttonSize: 'large' }]}
|
|
152
|
+
/>
|
|
153
|
+
|
|
154
|
+
</Box>
|
|
155
|
+
</QwickApp>
|
|
156
|
+
),
|
|
157
|
+
parameters: {
|
|
158
|
+
docs: {
|
|
159
|
+
description: {
|
|
160
|
+
story: 'Different background options: gradients, images with overlay, and theme colors.',
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
export const HeightVariants: Story = {
|
|
167
|
+
render: () => (
|
|
168
|
+
<QwickApp appId="heroblock-heights" appName='HeroBlock Heights'>
|
|
169
|
+
<Box sx={{ '& > *:not(:last-child)': { mb: 1 } }}>
|
|
170
|
+
|
|
171
|
+
<HeroBlock
|
|
172
|
+
title="Small Height Hero"
|
|
173
|
+
subtitle="Compact hero for minimal messaging"
|
|
174
|
+
backgroundColor="primary"
|
|
175
|
+
blockHeight="small"
|
|
176
|
+
textAlign="center"
|
|
177
|
+
/>
|
|
178
|
+
|
|
179
|
+
<HeroBlock
|
|
180
|
+
title="Medium Height Hero (Default)"
|
|
181
|
+
subtitle="Balanced height for most use cases"
|
|
182
|
+
backgroundColor="secondary"
|
|
183
|
+
blockHeight="medium"
|
|
184
|
+
textAlign="center"
|
|
185
|
+
/>
|
|
186
|
+
|
|
187
|
+
<HeroBlock
|
|
188
|
+
title="Large Height Hero"
|
|
189
|
+
subtitle="Expansive hero for maximum impact"
|
|
190
|
+
backgroundGradient="linear-gradient(45deg, #2196F3, #21CBF3)"
|
|
191
|
+
blockHeight="large"
|
|
192
|
+
textAlign="center"
|
|
193
|
+
/>
|
|
194
|
+
|
|
195
|
+
<Box sx={{ height: '50vh', overflow: 'hidden' }}>
|
|
196
|
+
<HeroBlock
|
|
197
|
+
title="Viewport Height Hero"
|
|
198
|
+
subtitle="Full-screen dramatic effect"
|
|
199
|
+
backgroundGradient="linear-gradient(135deg, #667eea 0%, #764ba2 100%)"
|
|
200
|
+
blockHeight="viewport"
|
|
201
|
+
textAlign="center"
|
|
202
|
+
/>
|
|
203
|
+
</Box>
|
|
204
|
+
|
|
205
|
+
</Box>
|
|
206
|
+
</QwickApp>
|
|
207
|
+
),
|
|
208
|
+
parameters: {
|
|
209
|
+
docs: {
|
|
210
|
+
description: {
|
|
211
|
+
story: 'Available height options: small (300px), medium (400px), large (600px), and viewport (100vh).',
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
export const TextAlignment: Story = {
|
|
218
|
+
render: () => (
|
|
219
|
+
<QwickApp appId="heroblock-alignment" appName='HeroBlock Text Alignment'>
|
|
220
|
+
<Box sx={{ '& > *:not(:last-child)': { mb: 2 } }}>
|
|
221
|
+
|
|
222
|
+
<HeroBlock
|
|
223
|
+
title="Left Aligned Hero"
|
|
224
|
+
subtitle="Content-heavy heroes work well with left alignment"
|
|
225
|
+
backgroundColor="surface"
|
|
226
|
+
textAlign="left"
|
|
227
|
+
blockHeight="medium"
|
|
228
|
+
actions={[{ label: 'Read More', variant: 'primary' }]}
|
|
229
|
+
/>
|
|
230
|
+
|
|
231
|
+
<HeroBlock
|
|
232
|
+
title="Center Aligned Hero"
|
|
233
|
+
subtitle="Traditional center alignment for maximum impact"
|
|
234
|
+
backgroundGradient="linear-gradient(45deg, #2196F3, #21CBF3)"
|
|
235
|
+
textAlign="center"
|
|
236
|
+
blockHeight="medium"
|
|
237
|
+
actions={[{ label: 'Get Started', variant: 'primary' }]}
|
|
238
|
+
/>
|
|
239
|
+
|
|
240
|
+
<HeroBlock
|
|
241
|
+
title="Right Aligned Hero"
|
|
242
|
+
subtitle="Unique visual balance with right alignment"
|
|
243
|
+
backgroundColor="secondary"
|
|
244
|
+
textAlign="right"
|
|
245
|
+
blockHeight="medium"
|
|
246
|
+
actions={[{ label: 'Learn More', variant: 'primary' }]}
|
|
247
|
+
/>
|
|
248
|
+
|
|
249
|
+
</Box>
|
|
250
|
+
</QwickApp>
|
|
251
|
+
),
|
|
252
|
+
parameters: {
|
|
253
|
+
docs: {
|
|
254
|
+
description: {
|
|
255
|
+
story: 'Text alignment options: left (content-heavy), center (traditional), right (unique balance).',
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
// Data Binding Examples
|
|
262
|
+
export const DataBindingBasic: Story = {
|
|
263
|
+
render: () => (
|
|
264
|
+
<QwickApp appId="heroblock-data-binding" appName='HeroBlock Data Binding'>
|
|
265
|
+
<DataProvider dataSource={{ dataProvider }}>
|
|
266
|
+
<Box>
|
|
267
|
+
|
|
268
|
+
<Box sx={{ p: 4, backgroundColor: 'background.paper' }}>
|
|
269
|
+
<Typography variant="h5" gutterBottom>📊 Data-Driven HeroBlock</Typography>
|
|
270
|
+
<Typography variant="body1" sx={{ mb: 3, opacity: 0.8 }}>
|
|
271
|
+
HeroBlock components can be driven entirely by CMS data using the dataSource prop.
|
|
272
|
+
</Typography>
|
|
273
|
+
|
|
274
|
+
<Code title="Usage" language="tsx">{`<HeroBlock dataSource="heroes.home" />`}</Code>
|
|
275
|
+
|
|
276
|
+
<Code title="Data Structure" language="json">{JSON.stringify(sampleCmsData.heroes.home, null, 2)}</Code>
|
|
277
|
+
</Box>
|
|
278
|
+
|
|
279
|
+
<HeroBlock dataSource="heroes.home" />
|
|
280
|
+
|
|
281
|
+
</Box>
|
|
282
|
+
</DataProvider>
|
|
283
|
+
</QwickApp>
|
|
284
|
+
),
|
|
285
|
+
parameters: {
|
|
286
|
+
docs: {
|
|
287
|
+
description: {
|
|
288
|
+
story: 'HeroBlock with data binding - all props resolved from CMS data through dataSource.',
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
export const DataBindingAdvanced: Story = {
|
|
295
|
+
render: () => (
|
|
296
|
+
<QwickApp appId="heroblock-data-advanced" appName='Advanced HeroBlock Data Binding'>
|
|
297
|
+
<DataProvider dataSource={{ dataProvider }}>
|
|
298
|
+
<Box>
|
|
299
|
+
|
|
300
|
+
<Box sx={{ p: 4, backgroundColor: 'background.paper' }}>
|
|
301
|
+
<Typography variant="h5" gutterBottom>🎯 Multiple Data Sources</Typography>
|
|
302
|
+
<Typography variant="body1" sx={{ mb: 3, opacity: 0.8 }}>
|
|
303
|
+
Different HeroBlock components can pull from different data sources with varying configurations.
|
|
304
|
+
</Typography>
|
|
305
|
+
</Box>
|
|
306
|
+
|
|
307
|
+
{/* Product Launch Hero */}
|
|
308
|
+
<HeroBlock dataSource="heroes.product-launch" />
|
|
309
|
+
|
|
310
|
+
{/* About Hero */}
|
|
311
|
+
<HeroBlock dataSource="heroes.about" />
|
|
312
|
+
|
|
313
|
+
{/* Minimal Hero */}
|
|
314
|
+
<HeroBlock dataSource="heroes.minimal" />
|
|
315
|
+
|
|
316
|
+
</Box>
|
|
317
|
+
</DataProvider>
|
|
318
|
+
</QwickApp>
|
|
319
|
+
),
|
|
320
|
+
parameters: {
|
|
321
|
+
docs: {
|
|
322
|
+
description: {
|
|
323
|
+
story: 'Advanced data binding with multiple data sources showcasing different hero styles and configurations.',
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
},
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
export const DataBindingWithFallback: Story = {
|
|
330
|
+
render: () => (
|
|
331
|
+
<QwickApp appId="heroblock-fallback" appName='HeroBlock Data Binding with Fallback'>
|
|
332
|
+
<DataProvider dataSource={{ dataProvider }}>
|
|
333
|
+
<Box>
|
|
334
|
+
|
|
335
|
+
<Box sx={{ p: 4, backgroundColor: 'background.paper' }}>
|
|
336
|
+
<Typography variant="h5" gutterBottom>🛡️ Fallback Support</Typography>
|
|
337
|
+
<Typography variant="body1" sx={{ mb: 3, opacity: 0.8 }}>
|
|
338
|
+
HeroBlock components gracefully handle missing data sources with fallback props.
|
|
339
|
+
</Typography>
|
|
340
|
+
|
|
341
|
+
<Code title="Fallback Usage" language="tsx">{`<HeroBlock
|
|
342
|
+
dataSource="nonexistent.hero"
|
|
343
|
+
title="Fallback Hero Title"
|
|
344
|
+
subtitle="Shows when data source is missing"
|
|
345
|
+
backgroundColor="default"
|
|
346
|
+
/>`}</Code>
|
|
347
|
+
</Box>
|
|
348
|
+
|
|
349
|
+
<HeroBlock
|
|
350
|
+
dataSource="nonexistent.hero"
|
|
351
|
+
title="Fallback Hero Content"
|
|
352
|
+
subtitle="This hero appears when the dataSource doesn't exist, ensuring your page never breaks"
|
|
353
|
+
backgroundColor="default"
|
|
354
|
+
blockHeight="medium"
|
|
355
|
+
textAlign="center"
|
|
356
|
+
actions={[
|
|
357
|
+
{ label: 'Fallback Action', variant: 'primary' }
|
|
358
|
+
]}
|
|
359
|
+
/>
|
|
360
|
+
|
|
361
|
+
</Box>
|
|
362
|
+
</DataProvider>
|
|
363
|
+
</QwickApp>
|
|
364
|
+
),
|
|
365
|
+
parameters: {
|
|
366
|
+
docs: {
|
|
367
|
+
description: {
|
|
368
|
+
story: 'HeroBlock with fallback props when dataSource is missing or unavailable.',
|
|
369
|
+
},
|
|
370
|
+
},
|
|
371
|
+
},
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
export const RealWorldExample: Story = {
|
|
375
|
+
render: () => (
|
|
376
|
+
<QwickApp appId="heroblock-real-world" appName='Real World HeroBlock Example'>
|
|
377
|
+
<DataProvider dataSource={{ dataProvider }}>
|
|
378
|
+
<Box>
|
|
379
|
+
|
|
380
|
+
{/* Main Hero - Data Driven */}
|
|
381
|
+
<HeroBlock dataSource="heroes.home" />
|
|
382
|
+
|
|
383
|
+
{/* Product Launch Hero - Data Driven */}
|
|
384
|
+
<HeroBlock dataSource="heroes.product-launch">
|
|
385
|
+
<Typography sx={{
|
|
386
|
+
mt: 3,
|
|
387
|
+
fontSize: '1.1rem',
|
|
388
|
+
maxWidth: '600px',
|
|
389
|
+
opacity: 0.9,
|
|
390
|
+
fontWeight: 500
|
|
391
|
+
}}>
|
|
392
|
+
Join thousands of developers who have already transformed their workflow
|
|
393
|
+
</Typography>
|
|
394
|
+
</HeroBlock>
|
|
395
|
+
|
|
396
|
+
{/* About Hero - Traditional Props with Custom Content */}
|
|
397
|
+
<HeroBlock
|
|
398
|
+
title="Ready to Get Started?"
|
|
399
|
+
subtitle="Join our community and start building amazing applications today"
|
|
400
|
+
backgroundColor="primary"
|
|
401
|
+
blockHeight="medium"
|
|
402
|
+
textAlign="center"
|
|
403
|
+
actions={[
|
|
404
|
+
{ label: 'Create Account', variant: 'primary', buttonSize: 'large' },
|
|
405
|
+
{ label: 'Browse Examples', variant: 'text', buttonSize: 'large' }
|
|
406
|
+
]}
|
|
407
|
+
>
|
|
408
|
+
<Box sx={{
|
|
409
|
+
mt: 4,
|
|
410
|
+
display: 'flex',
|
|
411
|
+
justifyContent: 'center',
|
|
412
|
+
gap: 4,
|
|
413
|
+
flexWrap: 'wrap',
|
|
414
|
+
opacity: 0.9
|
|
415
|
+
}}>
|
|
416
|
+
<Box sx={{ textAlign: 'center' }}>
|
|
417
|
+
<Typography variant="h4" sx={{ fontWeight: 'bold' }}>10k+</Typography>
|
|
418
|
+
<Typography>Developers</Typography>
|
|
419
|
+
</Box>
|
|
420
|
+
<Box sx={{ textAlign: 'center' }}>
|
|
421
|
+
<Typography variant="h4" sx={{ fontWeight: 'bold' }}>500+</Typography>
|
|
422
|
+
<Typography>Companies</Typography>
|
|
423
|
+
</Box>
|
|
424
|
+
<Box sx={{ textAlign: 'center' }}>
|
|
425
|
+
<Typography variant="h4" sx={{ fontWeight: 'bold' }}>99.9%</Typography>
|
|
426
|
+
<Typography>Uptime</Typography>
|
|
427
|
+
</Box>
|
|
428
|
+
</Box>
|
|
429
|
+
</HeroBlock>
|
|
430
|
+
|
|
431
|
+
</Box>
|
|
432
|
+
</DataProvider>
|
|
433
|
+
</QwickApp>
|
|
434
|
+
),
|
|
435
|
+
parameters: {
|
|
436
|
+
docs: {
|
|
437
|
+
description: {
|
|
438
|
+
story: 'Real-world example combining data-driven HeroBlocks with traditional usage and custom child content.',
|
|
439
|
+
},
|
|
440
|
+
},
|
|
441
|
+
},
|
|
442
|
+
};
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Html Component Stories
|
|
3
|
+
*
|
|
4
|
+
* Demonstrates HTML transformation capabilities of the Html component.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
8
|
+
import { Html } from '../components/Html';
|
|
9
|
+
|
|
10
|
+
const meta: Meta<typeof Html> = {
|
|
11
|
+
title: 'Components/Html',
|
|
12
|
+
component: Html,
|
|
13
|
+
parameters: {
|
|
14
|
+
layout: 'centered',
|
|
15
|
+
docs: {
|
|
16
|
+
description: {
|
|
17
|
+
component: 'The Html component transforms HTML strings into Framework components using configurable transformation rules. Perfect for rendering dynamic HTML content from data sources with Framework component styling.',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
tags: ['autodocs'],
|
|
22
|
+
argTypes: {
|
|
23
|
+
children: {
|
|
24
|
+
control: 'text',
|
|
25
|
+
description: 'HTML content as string',
|
|
26
|
+
},
|
|
27
|
+
stripHeaders: {
|
|
28
|
+
control: 'boolean',
|
|
29
|
+
description: 'Whether to strip header elements (useful for articles)',
|
|
30
|
+
},
|
|
31
|
+
sanitize: {
|
|
32
|
+
control: 'boolean',
|
|
33
|
+
description: 'Whether to sanitize HTML content',
|
|
34
|
+
},
|
|
35
|
+
placeholder: {
|
|
36
|
+
control: 'text',
|
|
37
|
+
description: 'Fallback content when HTML is empty',
|
|
38
|
+
},
|
|
39
|
+
component: {
|
|
40
|
+
control: 'text',
|
|
41
|
+
description: 'Container element type',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export default meta;
|
|
47
|
+
type Story = StoryObj<typeof Html>;
|
|
48
|
+
|
|
49
|
+
export const BasicContent: Story = {
|
|
50
|
+
args: {
|
|
51
|
+
children: '<h2>Welcome to QwickApps</h2><p>This is a <strong>basic example</strong> of HTML content being transformed into Framework components.</p><p>Notice how the styling automatically matches the theme.</p>',
|
|
52
|
+
},
|
|
53
|
+
parameters: {
|
|
54
|
+
docs: {
|
|
55
|
+
description: {
|
|
56
|
+
story: 'Basic HTML content with headings and paragraphs. The component automatically applies Framework styling.',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const CodeBlocks: Story = {
|
|
63
|
+
args: {
|
|
64
|
+
children: `
|
|
65
|
+
<h3>Code Transformation Examples</h3>
|
|
66
|
+
<p>Here's a JavaScript code block:</p>
|
|
67
|
+
<pre><code class="language-javascript">
|
|
68
|
+
function greet(name) {
|
|
69
|
+
console.log(\`Hello, \${name}!\`);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
greet("World");
|
|
73
|
+
</code></pre>
|
|
74
|
+
<p>And here's some inline <code>const x = 42</code> code.</p>
|
|
75
|
+
<p>Multi-line code blocks are transformed too:</p>
|
|
76
|
+
<code>
|
|
77
|
+
const users = [
|
|
78
|
+
{ name: "Alice", age: 30 },
|
|
79
|
+
{ name: "Bob", age: 25 }
|
|
80
|
+
];
|
|
81
|
+
</code>
|
|
82
|
+
`,
|
|
83
|
+
},
|
|
84
|
+
parameters: {
|
|
85
|
+
docs: {
|
|
86
|
+
description: {
|
|
87
|
+
story: 'Code blocks are automatically transformed into the Framework Code component with syntax highlighting and copy functionality.',
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export const BlogSections: Story = {
|
|
94
|
+
args: {
|
|
95
|
+
children: `
|
|
96
|
+
<section class="blog-section" data-padding="large">
|
|
97
|
+
<h2>Introduction</h2>
|
|
98
|
+
<p>This section demonstrates how blog sections are transformed into Framework Section components.</p>
|
|
99
|
+
</section>
|
|
100
|
+
|
|
101
|
+
<section class="blog-section" data-padding="medium">
|
|
102
|
+
<h2>Features</h2>
|
|
103
|
+
<ul>
|
|
104
|
+
<li>Automatic spacing control via data-padding</li>
|
|
105
|
+
<li>Section titles become Typography components</li>
|
|
106
|
+
<li>Content is properly contained and styled</li>
|
|
107
|
+
</ul>
|
|
108
|
+
</section>
|
|
109
|
+
`,
|
|
110
|
+
},
|
|
111
|
+
parameters: {
|
|
112
|
+
docs: {
|
|
113
|
+
description: {
|
|
114
|
+
story: 'Blog sections with class="blog-section" are transformed into Framework Section components with configurable padding.',
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export const InteractiveElements: Story = {
|
|
121
|
+
args: {
|
|
122
|
+
children: `
|
|
123
|
+
<h3>Interactive Elements</h3>
|
|
124
|
+
<p>Buttons are transformed into Framework Button components:</p>
|
|
125
|
+
<button data-variant="contained">Primary Action</button>
|
|
126
|
+
<button data-variant="outlined">Secondary Action</button>
|
|
127
|
+
<button disabled>Disabled Button</button>
|
|
128
|
+
|
|
129
|
+
<p>Other elements maintain their HTML structure but get Framework styling:</p>
|
|
130
|
+
<blockquote>
|
|
131
|
+
This is a blockquote that will be styled according to the current theme.
|
|
132
|
+
</blockquote>
|
|
133
|
+
`,
|
|
134
|
+
},
|
|
135
|
+
parameters: {
|
|
136
|
+
docs: {
|
|
137
|
+
description: {
|
|
138
|
+
story: 'Interactive elements like buttons are transformed into Framework components while maintaining their functionality.',
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export const HeaderStripping: Story = {
|
|
145
|
+
args: {
|
|
146
|
+
children: `
|
|
147
|
+
<header class="blog-header">
|
|
148
|
+
<h1>Article Title</h1>
|
|
149
|
+
<p>This header will be stripped when stripHeaders=true</p>
|
|
150
|
+
</header>
|
|
151
|
+
|
|
152
|
+
<h1>Standalone H1</h1>
|
|
153
|
+
<p>This standalone H1 will also be removed when stripHeaders=true</p>
|
|
154
|
+
|
|
155
|
+
<h2>Main Content</h2>
|
|
156
|
+
<p>This content will always be preserved.</p>
|
|
157
|
+
`,
|
|
158
|
+
stripHeaders: true,
|
|
159
|
+
},
|
|
160
|
+
parameters: {
|
|
161
|
+
docs: {
|
|
162
|
+
description: {
|
|
163
|
+
story: 'When stripHeaders is enabled, blog headers and standalone H1 elements are removed. Useful for articles where headers are handled separately.',
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
export const EmptyContent: Story = {
|
|
170
|
+
args: {
|
|
171
|
+
children: '',
|
|
172
|
+
placeholder: 'No content available at this time.',
|
|
173
|
+
},
|
|
174
|
+
parameters: {
|
|
175
|
+
docs: {
|
|
176
|
+
description: {
|
|
177
|
+
story: 'When no content is provided, a placeholder message can be shown with appropriate styling.',
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
export const CustomContainer: Story = {
|
|
184
|
+
args: {
|
|
185
|
+
children: '<h2>Article Title</h2><p>This content is rendered inside an article element instead of the default div.</p>',
|
|
186
|
+
component: 'article',
|
|
187
|
+
},
|
|
188
|
+
parameters: {
|
|
189
|
+
docs: {
|
|
190
|
+
description: {
|
|
191
|
+
story: 'The container element can be customized using the component prop.',
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
export const ComplexContent: Story = {
|
|
198
|
+
args: {
|
|
199
|
+
children: `
|
|
200
|
+
<article>
|
|
201
|
+
<h1>Complete Article Example</h1>
|
|
202
|
+
|
|
203
|
+
<section class="blog-section" data-padding="large">
|
|
204
|
+
<h2>Introduction</h2>
|
|
205
|
+
<p>This is a comprehensive example showing various HTML elements being transformed.</p>
|
|
206
|
+
|
|
207
|
+
<pre><code class="language-typescript">
|
|
208
|
+
interface HtmlProps {
|
|
209
|
+
children: string;
|
|
210
|
+
transformConfig?: TransformConfig;
|
|
211
|
+
stripHeaders?: boolean;
|
|
212
|
+
sanitize?: boolean;
|
|
213
|
+
}
|
|
214
|
+
</code></pre>
|
|
215
|
+
</section>
|
|
216
|
+
|
|
217
|
+
<section class="blog-section" data-padding="medium">
|
|
218
|
+
<h2>Key Features</h2>
|
|
219
|
+
<ul>
|
|
220
|
+
<li><strong>Code Highlighting:</strong> Automatic syntax highlighting for code blocks</li>
|
|
221
|
+
<li><strong>Button Components:</strong> HTML buttons become Framework buttons</li>
|
|
222
|
+
<li><strong>Section Management:</strong> Blog sections get proper spacing and layout</li>
|
|
223
|
+
<li><strong>Theme Integration:</strong> All content respects the current theme</li>
|
|
224
|
+
</ul>
|
|
225
|
+
|
|
226
|
+
<p>Try these interactive elements:</p>
|
|
227
|
+
<button data-variant="contained">Get Started</button>
|
|
228
|
+
<button data-variant="outlined">Learn More</button>
|
|
229
|
+
</section>
|
|
230
|
+
|
|
231
|
+
<blockquote>
|
|
232
|
+
<p>"The Html component makes it easy to render dynamic content while maintaining consistent Framework styling and behavior."</p>
|
|
233
|
+
</blockquote>
|
|
234
|
+
</article>
|
|
235
|
+
`,
|
|
236
|
+
},
|
|
237
|
+
parameters: {
|
|
238
|
+
docs: {
|
|
239
|
+
description: {
|
|
240
|
+
story: 'A complex example demonstrating multiple transformation rules working together in a single HTML document.',
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
export const SanitizedContent: Story = {
|
|
247
|
+
args: {
|
|
248
|
+
children: `
|
|
249
|
+
<h3>Sanitized Content Example</h3>
|
|
250
|
+
<p>This content includes potentially dangerous elements that are sanitized:</p>
|
|
251
|
+
<script>alert('This would be dangerous!');</script>
|
|
252
|
+
<p onclick="alert('Click handler')">This paragraph has an onclick handler that will be removed.</p>
|
|
253
|
+
<p>But this <strong>safe content</strong> is preserved perfectly.</p>
|
|
254
|
+
<p>Links are also handled safely: <a href="https://qwickapps.com">Visit QwickApps</a></p>
|
|
255
|
+
`,
|
|
256
|
+
},
|
|
257
|
+
parameters: {
|
|
258
|
+
docs: {
|
|
259
|
+
description: {
|
|
260
|
+
story: 'HTML content is automatically sanitized to remove dangerous elements and attributes while preserving safe content.',
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
};
|