@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,549 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Article Component Stories - HTML content transformer 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 { Code } from '../components/blocks';
|
|
11
|
+
import { Article } from '../components/blocks/Article';
|
|
12
|
+
import QwickApp from '../components/QwickApp';
|
|
13
|
+
|
|
14
|
+
// Sample HTML content for different use cases
|
|
15
|
+
const simpleArticleHtml = `
|
|
16
|
+
<h1>Getting Started with QwickApps React Framework</h1>
|
|
17
|
+
<p>Welcome to the QwickApps React Framework, a comprehensive React-based solution for building modern web applications. This guide will walk you through the basics of using our framework.</p>
|
|
18
|
+
|
|
19
|
+
<h2>Installation</h2>
|
|
20
|
+
<p>To get started, install the framework using npm:</p>
|
|
21
|
+
<pre><code class="language-bash">npm install @qwickapps/react-framework</code></pre>
|
|
22
|
+
|
|
23
|
+
<h2>Key Features</h2>
|
|
24
|
+
<ul>
|
|
25
|
+
<li>Component-based architecture</li>
|
|
26
|
+
<li>Built-in data binding</li>
|
|
27
|
+
<li>Responsive design system</li>
|
|
28
|
+
<li>TypeScript support</li>
|
|
29
|
+
</ul>
|
|
30
|
+
|
|
31
|
+
<p>For more information, visit our <a href="https://qwickapps.com">official website</a>.</p>
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
const codeExamplesHtml = `
|
|
35
|
+
<h1>Code Examples</h1>
|
|
36
|
+
<p>Here are some practical examples of using QwickApps React Framework components.</p>
|
|
37
|
+
|
|
38
|
+
<h2>Basic Component Usage</h2>
|
|
39
|
+
<p>Create a simple ProductCard component:</p>
|
|
40
|
+
<pre><code class="language-typescript">import { ProductCard } from '@qwickapps/react-framework';
|
|
41
|
+
|
|
42
|
+
const product = {
|
|
43
|
+
id: 'product-1',
|
|
44
|
+
name: 'Amazing Product',
|
|
45
|
+
description: 'This product will change your life',
|
|
46
|
+
price: '$99.99'
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
function MyApp() {
|
|
50
|
+
return (
|
|
51
|
+
<ProductCard product={product} variant="detailed" />
|
|
52
|
+
);
|
|
53
|
+
}</code></pre>
|
|
54
|
+
|
|
55
|
+
<h2>Data Binding Example</h2>
|
|
56
|
+
<p>Using data binding with CMS integration:</p>
|
|
57
|
+
<pre><code class="language-jsx"><QwickApp dataSource={dataProvider}>
|
|
58
|
+
<ProductCard dataSource="products.featured" />
|
|
59
|
+
</QwickApp></code></pre>
|
|
60
|
+
|
|
61
|
+
<p>You can also use inline code like <code>console.log('hello')</code> within paragraphs.</p>
|
|
62
|
+
|
|
63
|
+
<h2>Complex Multi-line Code</h2>
|
|
64
|
+
<code>
|
|
65
|
+
function complexFunction() {
|
|
66
|
+
const data = fetchData();
|
|
67
|
+
return processData(data);
|
|
68
|
+
}
|
|
69
|
+
</code>
|
|
70
|
+
`;
|
|
71
|
+
|
|
72
|
+
const blogSectionHtml = `
|
|
73
|
+
<header class="blog-header">
|
|
74
|
+
<h1>This Header Will Be Removed</h1>
|
|
75
|
+
<p>When skipHeader is true</p>
|
|
76
|
+
</header>
|
|
77
|
+
|
|
78
|
+
<h1>Advanced QwickApps Techniques</h1>
|
|
79
|
+
<p>Learn advanced patterns and best practices for building scalable applications.</p>
|
|
80
|
+
|
|
81
|
+
<section class="blog-section" data-padding="large">
|
|
82
|
+
<h2>Performance Optimization</h2>
|
|
83
|
+
<p>QwickApps includes several built-in optimizations to ensure your applications run smoothly.</p>
|
|
84
|
+
<pre><code class="language-typescript">// Lazy loading components
|
|
85
|
+
const LazyComponent = lazy(() => import('./MyComponent'));
|
|
86
|
+
|
|
87
|
+
function App() {
|
|
88
|
+
return (
|
|
89
|
+
<Suspense fallback={<div>Loading...</div>}>
|
|
90
|
+
<LazyComponent />
|
|
91
|
+
</Suspense>
|
|
92
|
+
);
|
|
93
|
+
}</code></pre>
|
|
94
|
+
</section>
|
|
95
|
+
|
|
96
|
+
<section class="blog-section" data-padding="medium">
|
|
97
|
+
<h2>State Management</h2>
|
|
98
|
+
<p>Effective state management strategies for complex applications.</p>
|
|
99
|
+
<ul>
|
|
100
|
+
<li>Use Context for shared state</li>
|
|
101
|
+
<li>Implement custom hooks for business logic</li>
|
|
102
|
+
<li>Consider external state libraries for complex needs</li>
|
|
103
|
+
</ul>
|
|
104
|
+
</section>
|
|
105
|
+
|
|
106
|
+
<p>These sections demonstrate the blog-section transformation feature.</p>
|
|
107
|
+
`;
|
|
108
|
+
|
|
109
|
+
const tutorialHtml = `
|
|
110
|
+
<h1>Complete Tutorial: Building a Dashboard</h1>
|
|
111
|
+
|
|
112
|
+
<div class="tutorial-intro">
|
|
113
|
+
<p><strong>What you'll learn:</strong> In this comprehensive tutorial, you'll build a complete dashboard application using QwickApps React Framework.</p>
|
|
114
|
+
<p><strong>Prerequisites:</strong> Basic knowledge of React and TypeScript</p>
|
|
115
|
+
<p><strong>Time required:</strong> Approximately 2 hours</p>
|
|
116
|
+
</div>
|
|
117
|
+
|
|
118
|
+
<h2>Step 1: Project Setup</h2>
|
|
119
|
+
<p>First, create a new QwickApps project:</p>
|
|
120
|
+
<pre><code class="language-bash">npx create-qwickapp my-dashboard
|
|
121
|
+
cd my-dashboard
|
|
122
|
+
npm start</code></pre>
|
|
123
|
+
|
|
124
|
+
<h2>Step 2: Create the Layout</h2>
|
|
125
|
+
<p>Set up the main dashboard layout with navigation:</p>
|
|
126
|
+
<pre><code class="language-tsx">import { GridLayout, Navigation } from '@qwickapps/react-framework';
|
|
127
|
+
|
|
128
|
+
export function DashboardLayout({ children }: { children: React.ReactNode }) {
|
|
129
|
+
return (
|
|
130
|
+
<div className="dashboard">
|
|
131
|
+
<Navigation items={navItems} />
|
|
132
|
+
<main className="dashboard-content">
|
|
133
|
+
<GridLayout columns={2} spacing="large">
|
|
134
|
+
{children}
|
|
135
|
+
</GridLayout>
|
|
136
|
+
</main>
|
|
137
|
+
</div>
|
|
138
|
+
);
|
|
139
|
+
}</code></pre>
|
|
140
|
+
|
|
141
|
+
<div class="tip-box">
|
|
142
|
+
<h3>💡 Pro Tip</h3>
|
|
143
|
+
<p>Use the <code>GridLayout</code> component for responsive layouts that automatically adapt to different screen sizes.</p>
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
<h2>Step 3: Add Data Visualization</h2>
|
|
147
|
+
<p>Integrate charts and data visualization components.</p>
|
|
148
|
+
|
|
149
|
+
<section class="blog-section">
|
|
150
|
+
<h2>Final Result</h2>
|
|
151
|
+
<p>Your completed dashboard will include:</p>
|
|
152
|
+
<ul>
|
|
153
|
+
<li>Responsive navigation</li>
|
|
154
|
+
<li>Interactive charts</li>
|
|
155
|
+
<li>Real-time data updates</li>
|
|
156
|
+
<li>Mobile-friendly design</li>
|
|
157
|
+
</ul>
|
|
158
|
+
</section>
|
|
159
|
+
`;
|
|
160
|
+
|
|
161
|
+
// Sample CMS data for data binding stories
|
|
162
|
+
const sampleCmsData = {
|
|
163
|
+
'articles': {
|
|
164
|
+
'simple': { title: 'Simple Article', html: simpleArticleHtml, skipHeader: false },
|
|
165
|
+
'code-examples': { title: 'Code Examples', html: codeExamplesHtml, skipHeader: false },
|
|
166
|
+
'blog-sections': { title: 'Blog Sections', html: blogSectionHtml, skipHeader: true },
|
|
167
|
+
'complete-tutorial': { title: 'Complete Tutorial', html: tutorialHtml, skipHeader: false },
|
|
168
|
+
'tutorial': { title: 'Tutorial Content', html: tutorialHtml, skipHeader: false },
|
|
169
|
+
'blog-post': { title: 'Blog Post', html: blogSectionHtml, skipHeader: true }
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
const dataProvider = new JsonDataProvider({ data: sampleCmsData });
|
|
174
|
+
|
|
175
|
+
const meta = {
|
|
176
|
+
title: 'Blocks/Article',
|
|
177
|
+
component: Article,
|
|
178
|
+
parameters: {
|
|
179
|
+
layout: 'padded',
|
|
180
|
+
docs: {
|
|
181
|
+
description: {
|
|
182
|
+
component: `Article is an intelligent HTML content transformer that automatically converts raw HTML into QwickApps React Framework components while preserving structure and styling.
|
|
183
|
+
|
|
184
|
+
**Key Features:**
|
|
185
|
+
- **Smart Code Block Detection**: Automatically transforms \`<pre><code>\` blocks into syntax-highlighted Code components
|
|
186
|
+
- **Blog Section Transformation**: Converts \`<section class="blog-section">\` into Section components with proper spacing
|
|
187
|
+
- **Header Stripping**: Optional removal of header elements for seamless integration with page layouts
|
|
188
|
+
- **HTML Structure Preservation**: Maintains all HTML attributes, classes, and structure
|
|
189
|
+
- **Data Binding**: Full CMS integration through dataSource prop
|
|
190
|
+
- **Safe Rendering**: Uses SafeSpan for secure HTML rendering
|
|
191
|
+
- **Responsive Typography**: Automatic styling for headings, paragraphs, and lists
|
|
192
|
+
|
|
193
|
+
**Perfect For:**
|
|
194
|
+
- Blog posts and articles from CMS systems
|
|
195
|
+
- Documentation and technical content
|
|
196
|
+
- Tutorial and guide content
|
|
197
|
+
- Legacy HTML content integration
|
|
198
|
+
- Markdown-to-HTML transformed content`,
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
tags: ['autodocs'],
|
|
203
|
+
} satisfies Meta<typeof Article>;
|
|
204
|
+
|
|
205
|
+
export default meta;
|
|
206
|
+
type Story = StoryObj<typeof Article>;
|
|
207
|
+
|
|
208
|
+
// Traditional Usage Examples
|
|
209
|
+
export const SimpleArticle: Story = {
|
|
210
|
+
render: () => (
|
|
211
|
+
<QwickApp appId="article-simple" appName='Simple Article'>
|
|
212
|
+
<Article html={simpleArticleHtml} />
|
|
213
|
+
</QwickApp>
|
|
214
|
+
),
|
|
215
|
+
parameters: {
|
|
216
|
+
docs: {
|
|
217
|
+
description: {
|
|
218
|
+
story: 'Basic article with headings, paragraphs, lists, and code blocks that get transformed into proper components.',
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
export const CodeExamples: Story = {
|
|
225
|
+
render: () => (
|
|
226
|
+
<QwickApp appId="article-code" appName='Article with Code Examples'>
|
|
227
|
+
<Article html={codeExamplesHtml} />
|
|
228
|
+
</QwickApp>
|
|
229
|
+
),
|
|
230
|
+
parameters: {
|
|
231
|
+
docs: {
|
|
232
|
+
description: {
|
|
233
|
+
story: 'Article featuring various code examples including syntax-highlighted blocks and inline code snippets.',
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
export const BlogSections: Story = {
|
|
240
|
+
render: () => (
|
|
241
|
+
<QwickApp appId="article-blog" appName='Article with Blog Sections'>
|
|
242
|
+
<Article html={blogSectionHtml} skipHeader={false} />
|
|
243
|
+
</QwickApp>
|
|
244
|
+
),
|
|
245
|
+
parameters: {
|
|
246
|
+
docs: {
|
|
247
|
+
description: {
|
|
248
|
+
story: 'Article with blog sections that get transformed into Section components with proper spacing and layout.',
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
export const HeaderSkipping: Story = {
|
|
255
|
+
render: () => (
|
|
256
|
+
<QwickApp appId="article-header-skip" appName='Article Header Skipping'>
|
|
257
|
+
<Box sx={{ '& > *:not(:last-child)': { mb: 4 } }}>
|
|
258
|
+
|
|
259
|
+
<Box>
|
|
260
|
+
<Typography variant="h6" gutterBottom>With Header (skipHeader: false)</Typography>
|
|
261
|
+
<Article html={blogSectionHtml} skipHeader={false} />
|
|
262
|
+
</Box>
|
|
263
|
+
|
|
264
|
+
<Box>
|
|
265
|
+
<Typography variant="h6" gutterBottom>Without Header (skipHeader: true)</Typography>
|
|
266
|
+
<Article html={blogSectionHtml} skipHeader={true} />
|
|
267
|
+
</Box>
|
|
268
|
+
|
|
269
|
+
</Box>
|
|
270
|
+
</QwickApp>
|
|
271
|
+
),
|
|
272
|
+
parameters: {
|
|
273
|
+
docs: {
|
|
274
|
+
description: {
|
|
275
|
+
story: 'Comparison showing how skipHeader removes header elements and the first h1 for seamless page integration.',
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
export const TutorialContent: Story = {
|
|
282
|
+
render: () => (
|
|
283
|
+
<QwickApp appId="article-tutorial" appName='Tutorial Article'>
|
|
284
|
+
<Article html={tutorialHtml} />
|
|
285
|
+
</QwickApp>
|
|
286
|
+
),
|
|
287
|
+
parameters: {
|
|
288
|
+
docs: {
|
|
289
|
+
description: {
|
|
290
|
+
story: 'Complex tutorial content with mixed HTML elements, code blocks, and structured sections.',
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
// Data Binding Examples
|
|
297
|
+
export const DataBindingBasic: Story = {
|
|
298
|
+
render: () => (
|
|
299
|
+
<QwickApp appId="article-data-binding" appName='Article Data Binding' dataSource={{ dataProvider }}>
|
|
300
|
+
<Box>
|
|
301
|
+
|
|
302
|
+
<Box sx={{ p: 4, backgroundColor: 'background.paper' }}>
|
|
303
|
+
<Typography variant="h5" gutterBottom>📊 Data-Driven Article</Typography>
|
|
304
|
+
<Typography variant="body1" sx={{ mb: 3, opacity: 0.8 }}>
|
|
305
|
+
Article components can be completely driven by CMS data, loading HTML content and configuration from your data source.
|
|
306
|
+
</Typography>
|
|
307
|
+
|
|
308
|
+
<Code title="Usage" language="tsx">{`<Article dataSource="articles.simple" />`}</Code>
|
|
309
|
+
|
|
310
|
+
<Code title="Data Structure" language="json">{JSON.stringify(sampleCmsData.articles.simple, null, 2)}</Code>
|
|
311
|
+
</Box>
|
|
312
|
+
|
|
313
|
+
<Article dataSource="articles.simple"/>
|
|
314
|
+
|
|
315
|
+
</Box>
|
|
316
|
+
</QwickApp>
|
|
317
|
+
),
|
|
318
|
+
parameters: {
|
|
319
|
+
docs: {
|
|
320
|
+
description: {
|
|
321
|
+
story: 'Article with data binding - HTML content and configuration resolved from CMS data through dataSource.',
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
},
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
export const DataBindingAdvanced: Story = {
|
|
328
|
+
render: () => (
|
|
329
|
+
<QwickApp appId="article-data-advanced" appName='Advanced Article Data Binding' dataSource={{ dataProvider }}>
|
|
330
|
+
<Box>
|
|
331
|
+
|
|
332
|
+
<Box sx={{ p: 4, backgroundColor: 'background.paper' }}>
|
|
333
|
+
<Typography variant="h5" gutterBottom>🎯 Multiple Article Types</Typography>
|
|
334
|
+
<Typography variant="body1" sx={{ mb: 3, opacity: 0.8 }}>
|
|
335
|
+
Different Article instances can load different content types from separate data sources with varying configurations.
|
|
336
|
+
</Typography>
|
|
337
|
+
</Box>
|
|
338
|
+
|
|
339
|
+
{/* Code Examples Article */}
|
|
340
|
+
<Box sx={{ mb: 4 }}>
|
|
341
|
+
<Typography variant="h4" gutterBottom>Code Examples</Typography>
|
|
342
|
+
<Article dataSource="articles.code-examples" />
|
|
343
|
+
</Box>
|
|
344
|
+
|
|
345
|
+
{/* Tutorial Article */}
|
|
346
|
+
<Box sx={{ mb: 4 }}>
|
|
347
|
+
<Typography variant="h4" gutterBottom>Tutorial Content</Typography>
|
|
348
|
+
<Article dataSource="articles.tutorial" />
|
|
349
|
+
</Box>
|
|
350
|
+
|
|
351
|
+
</Box>
|
|
352
|
+
</QwickApp>
|
|
353
|
+
),
|
|
354
|
+
parameters: {
|
|
355
|
+
docs: {
|
|
356
|
+
description: {
|
|
357
|
+
story: 'Advanced data binding with multiple article types showcasing different content structures and transformations.',
|
|
358
|
+
},
|
|
359
|
+
},
|
|
360
|
+
},
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
export const DataBindingWithFallback: Story = {
|
|
364
|
+
render: () => (
|
|
365
|
+
<QwickApp appId="article-fallback" appName='Article Data Binding with Fallback' dataSource={{ dataProvider }}>
|
|
366
|
+
<Box>
|
|
367
|
+
|
|
368
|
+
<Box sx={{ p: 4, backgroundColor: 'background.paper' }}>
|
|
369
|
+
<Typography variant="h5" gutterBottom>🛡️ Fallback Support</Typography>
|
|
370
|
+
<Typography variant="body1" sx={{ mb: 3, opacity: 0.8 }}>
|
|
371
|
+
Article components gracefully handle missing data sources with fallback HTML content.
|
|
372
|
+
</Typography>
|
|
373
|
+
|
|
374
|
+
<Code title="Fallback Usage" language="tsx">{`<Article
|
|
375
|
+
dataSource="nonexistent.article"
|
|
376
|
+
html={fallbackHtml}
|
|
377
|
+
skipHeader={true}
|
|
378
|
+
/>`}</Code>
|
|
379
|
+
</Box>
|
|
380
|
+
|
|
381
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 4 }}>
|
|
382
|
+
<Box>
|
|
383
|
+
<Typography variant="h6" gutterBottom>Missing Data Source (Fallback)</Typography>
|
|
384
|
+
<Article
|
|
385
|
+
dataSource="nonexistent.article"
|
|
386
|
+
html={simpleArticleHtml}
|
|
387
|
+
skipHeader={true}
|
|
388
|
+
/>
|
|
389
|
+
</Box>
|
|
390
|
+
<Box>
|
|
391
|
+
<Typography variant="h6" gutterBottom>Valid Data Source</Typography>
|
|
392
|
+
<Article dataSource="articles.simple" />
|
|
393
|
+
</Box>
|
|
394
|
+
</Box>
|
|
395
|
+
|
|
396
|
+
</Box>
|
|
397
|
+
</QwickApp>
|
|
398
|
+
),
|
|
399
|
+
parameters: {
|
|
400
|
+
docs: {
|
|
401
|
+
description: {
|
|
402
|
+
story: 'Article with fallback HTML when dataSource is missing or unavailable.',
|
|
403
|
+
},
|
|
404
|
+
},
|
|
405
|
+
},
|
|
406
|
+
};
|
|
407
|
+
|
|
408
|
+
export const ContentTransformations: Story = {
|
|
409
|
+
render: () => (
|
|
410
|
+
<QwickApp appId="article-transformations" appName='Article Content Transformations'>
|
|
411
|
+
<Box>
|
|
412
|
+
|
|
413
|
+
<Box sx={{ p: 4, backgroundColor: 'background.paper' }}>
|
|
414
|
+
<Typography variant="h5" gutterBottom>🔄 Transformation Showcase</Typography>
|
|
415
|
+
<Typography variant="body1" sx={{ mb: 3, opacity: 0.8 }}>
|
|
416
|
+
Demonstrates how Article intelligently transforms different HTML elements into QwickApps components.
|
|
417
|
+
</Typography>
|
|
418
|
+
</Box>
|
|
419
|
+
|
|
420
|
+
{/* Before/After Comparison */}
|
|
421
|
+
<Box sx={{ mb: 4 }}>
|
|
422
|
+
<Typography variant="h4" gutterBottom>Code Block Transformation</Typography>
|
|
423
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 4 }}>
|
|
424
|
+
<Box>
|
|
425
|
+
<Typography variant="h6" gutterBottom>Raw HTML Input</Typography>
|
|
426
|
+
<Code title="HTML" language="html">{`<pre><code class="language-javascript">
|
|
427
|
+
function greet(name) {
|
|
428
|
+
return \`Hello, \${name}!\`;
|
|
429
|
+
}
|
|
430
|
+
</code></pre>`}</Code>
|
|
431
|
+
</Box>
|
|
432
|
+
<Box>
|
|
433
|
+
<Typography variant="h6" gutterBottom>Transformed Output</Typography>
|
|
434
|
+
<pre><code className="language-javascript">{`function greet(name) {
|
|
435
|
+
return \`Hello, \${name}!\`;
|
|
436
|
+
}`}</code></pre>
|
|
437
|
+
</Box>
|
|
438
|
+
</Box>
|
|
439
|
+
</Box>
|
|
440
|
+
|
|
441
|
+
<Box sx={{ mb: 4 }}>
|
|
442
|
+
<Typography variant="h4" gutterBottom>Blog Section Transformation</Typography>
|
|
443
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 4 }}>
|
|
444
|
+
<Box>
|
|
445
|
+
<Typography variant="h6" gutterBottom>Raw HTML Input</Typography>
|
|
446
|
+
<Code title="HTML" language="html">{`<section class="blog-section">
|
|
447
|
+
<h2>Section Title</h2>
|
|
448
|
+
<p>Section content...</p>
|
|
449
|
+
</section>`}</Code>
|
|
450
|
+
</Box>
|
|
451
|
+
<Box>
|
|
452
|
+
<Typography variant="h6" gutterBottom>Transformed Output</Typography>
|
|
453
|
+
<Typography variant="body2" color="text.secondary">
|
|
454
|
+
→ Becomes Section component with proper spacing and Content wrapper
|
|
455
|
+
</Typography>
|
|
456
|
+
</Box>
|
|
457
|
+
</Box>
|
|
458
|
+
</Box>
|
|
459
|
+
|
|
460
|
+
</Box>
|
|
461
|
+
</QwickApp>
|
|
462
|
+
),
|
|
463
|
+
parameters: {
|
|
464
|
+
docs: {
|
|
465
|
+
description: {
|
|
466
|
+
story: 'Educational showcase of how Article transforms various HTML elements into QwickApps components.',
|
|
467
|
+
},
|
|
468
|
+
},
|
|
469
|
+
},
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
export const RealWorldExample: Story = {
|
|
473
|
+
render: () => (
|
|
474
|
+
<QwickApp appId="article-real-world" appName='Real World Article Example' dataSource={{ dataProvider }}>
|
|
475
|
+
<Box>
|
|
476
|
+
|
|
477
|
+
{/* Blog Post */}
|
|
478
|
+
<Box sx={{ mb: 6 }}>
|
|
479
|
+
<Typography variant="h3" gutterBottom>Latest Blog Post</Typography>
|
|
480
|
+
<Typography variant="h6" sx={{ mb: 4, opacity: 0.7 }}>
|
|
481
|
+
Direct from our CMS with header removal enabled
|
|
482
|
+
</Typography>
|
|
483
|
+
<Article dataSource="articles.blog-post" />
|
|
484
|
+
</Box>
|
|
485
|
+
|
|
486
|
+
{/* Documentation */}
|
|
487
|
+
<Box sx={{ mb: 6 }}>
|
|
488
|
+
<Typography variant="h3" gutterBottom>Documentation</Typography>
|
|
489
|
+
<Typography variant="h6" sx={{ mb: 4, opacity: 0.7 }}>
|
|
490
|
+
Technical content with code examples and proper syntax highlighting
|
|
491
|
+
</Typography>
|
|
492
|
+
<Article dataSource="articles.code-examples" />
|
|
493
|
+
</Box>
|
|
494
|
+
|
|
495
|
+
{/* Tutorial Content */}
|
|
496
|
+
<Box>
|
|
497
|
+
<Typography variant="h3" gutterBottom>Learning Resources</Typography>
|
|
498
|
+
<Typography variant="h6" sx={{ mb: 4, opacity: 0.7 }}>
|
|
499
|
+
Step-by-step tutorials with mixed content types
|
|
500
|
+
</Typography>
|
|
501
|
+
<Article dataSource="articles.tutorial" />
|
|
502
|
+
</Box>
|
|
503
|
+
|
|
504
|
+
</Box>
|
|
505
|
+
</QwickApp>
|
|
506
|
+
),
|
|
507
|
+
parameters: {
|
|
508
|
+
docs: {
|
|
509
|
+
description: {
|
|
510
|
+
story: 'Real-world example showing Article in various contexts: blog posts, documentation, and tutorials.',
|
|
511
|
+
},
|
|
512
|
+
},
|
|
513
|
+
},
|
|
514
|
+
};
|
|
515
|
+
|
|
516
|
+
export const EmptyAndLoadingStates: Story = {
|
|
517
|
+
render: () => (
|
|
518
|
+
<QwickApp appId="article-states" appName='Article States' dataSource={{ dataProvider }}>
|
|
519
|
+
<Box>
|
|
520
|
+
|
|
521
|
+
<Box sx={{ p: 4, backgroundColor: 'background.paper' }}>
|
|
522
|
+
<Typography variant="h5" gutterBottom>🔄 State Management</Typography>
|
|
523
|
+
<Typography variant="body1" sx={{ mb: 3, opacity: 0.8 }}>
|
|
524
|
+
Article handles various states including empty content and loading scenarios gracefully.
|
|
525
|
+
</Typography>
|
|
526
|
+
</Box>
|
|
527
|
+
|
|
528
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 4 }}>
|
|
529
|
+
<Box>
|
|
530
|
+
<Typography variant="h6" gutterBottom>Empty Content</Typography>
|
|
531
|
+
<Article html="" />
|
|
532
|
+
</Box>
|
|
533
|
+
<Box>
|
|
534
|
+
<Typography variant="h6" gutterBottom>Valid Content</Typography>
|
|
535
|
+
<Article dataSource="articles.simple" />
|
|
536
|
+
</Box>
|
|
537
|
+
</Box>
|
|
538
|
+
|
|
539
|
+
</Box>
|
|
540
|
+
</QwickApp>
|
|
541
|
+
),
|
|
542
|
+
parameters: {
|
|
543
|
+
docs: {
|
|
544
|
+
description: {
|
|
545
|
+
story: 'Demonstrates empty state handling and normal article display states.',
|
|
546
|
+
},
|
|
547
|
+
},
|
|
548
|
+
},
|
|
549
|
+
};
|