@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
package/README.md
ADDED
|
@@ -0,0 +1,794 @@
|
|
|
1
|
+
# QwickApps React Framework
|
|
2
|
+
|
|
3
|
+
A complete React framework for building modern, responsive applications with intelligent navigation, flexible layouts, and a comprehensive theming system.
|
|
4
|
+
|
|
5
|
+
## What's New
|
|
6
|
+
|
|
7
|
+
### August 31, 2025 - CMS Content Components
|
|
8
|
+
- **Html Component**: Transform HTML strings into React components with configurable transformation rules
|
|
9
|
+
- **Markdown Component**: Convert Markdown to React components using marked library with Html component integration
|
|
10
|
+
- **Transform System**: Extensible HTML transformation architecture with optimized rule sets for Article and Markdown content
|
|
11
|
+
- **Content Simplification**: Article and Content components refactored to use Html component internally, eliminating duplicate transformation logic
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
### 🧭 **Responsive Navigation**
|
|
16
|
+
- **Mobile**: Bottom navigation bar for touch-friendly access
|
|
17
|
+
- **Tablet**: Expandable nav rail with collapsible sidebar
|
|
18
|
+
- **Desktop**: Top navigation with overflow drawer
|
|
19
|
+
- **Automatic**: Adapts based on screen size without configuration
|
|
20
|
+
|
|
21
|
+
### 📐 **Flexible Layout System**
|
|
22
|
+
- **Hero Blocks**: Full-width hero sections with background images/gradients
|
|
23
|
+
- **Multi-Column Layouts**: Responsive 2-5 column layouts with equal heights
|
|
24
|
+
- **Content Blocks**: Styled containers with variants (elevated, outlined, filled)
|
|
25
|
+
- **Feature Grids**: Showcase features with icons, titles, and actions
|
|
26
|
+
- **Section Containers**: Configurable spacing and background variants
|
|
27
|
+
|
|
28
|
+
### 🎨 **Advanced Theming**
|
|
29
|
+
- **Theme Management**: Light, dark, and system theme support
|
|
30
|
+
- **Color Palettes**: Multiple built-in palettes (Ocean, Autumn, Spring, Winter)
|
|
31
|
+
- **CSS Variables**: Dynamic theme switching without re-renders
|
|
32
|
+
- **Custom Palettes**: Easy to create and integrate custom color schemes
|
|
33
|
+
|
|
34
|
+
### 🧩 **Component Library**
|
|
35
|
+
- **Logo Component**: Dynamic, customizable logos with badges and animations
|
|
36
|
+
- **Theme Controls**: Built-in theme and palette switchers
|
|
37
|
+
- **Form Components**: Accessible, themed form inputs
|
|
38
|
+
- **Safe Components**: XSS-protected content rendering
|
|
39
|
+
- **Html Component**: Transform HTML strings to React components with configurable rules
|
|
40
|
+
- **Markdown Component**: Convert Markdown to React components with syntax highlighting
|
|
41
|
+
- **Transform System**: Extensible HTML element transformation with fallback handling
|
|
42
|
+
|
|
43
|
+
### 🚀 **Developer Experience**
|
|
44
|
+
- **TypeScript First**: Full TypeScript support with comprehensive types
|
|
45
|
+
- **Storybook**: Interactive component documentation
|
|
46
|
+
- **Performance**: Optimized rendering and minimal bundle size
|
|
47
|
+
- **Accessibility**: WCAG-compliant components with ARIA support
|
|
48
|
+
|
|
49
|
+
## Installation
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npm install @qwickapps/react-framework
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Quick Start
|
|
56
|
+
|
|
57
|
+
### Basic Setup
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
import {
|
|
61
|
+
QwickApp,
|
|
62
|
+
ResponsiveMenu,
|
|
63
|
+
HeroBlock,
|
|
64
|
+
Section,
|
|
65
|
+
Content
|
|
66
|
+
} from '@qwickapps/react-framework';
|
|
67
|
+
|
|
68
|
+
const menuItems = [
|
|
69
|
+
{
|
|
70
|
+
id: 'home',
|
|
71
|
+
label: 'Home',
|
|
72
|
+
icon: <HomeIcon />,
|
|
73
|
+
onClick: () => navigate('/'),
|
|
74
|
+
active: true,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: 'about',
|
|
78
|
+
label: 'About',
|
|
79
|
+
icon: <InfoIcon />,
|
|
80
|
+
onClick: () => navigate('/about'),
|
|
81
|
+
},
|
|
82
|
+
];
|
|
83
|
+
|
|
84
|
+
function App() {
|
|
85
|
+
return (
|
|
86
|
+
<QwickApp appName="MyApp" appId="com.mycompany.app">
|
|
87
|
+
<ResponsiveMenu items={menuItems} />
|
|
88
|
+
|
|
89
|
+
<HeroBlock
|
|
90
|
+
title="Welcome to MyApp"
|
|
91
|
+
subtitle="Build amazing applications with ease"
|
|
92
|
+
backgroundGradient="linear-gradient(135deg, #667eea 0%, #764ba2 100%)"
|
|
93
|
+
actions={
|
|
94
|
+
<button>Get Started</button>
|
|
95
|
+
}
|
|
96
|
+
/>
|
|
97
|
+
|
|
98
|
+
<Section padding="large">
|
|
99
|
+
<Content title="About Us" centered>
|
|
100
|
+
<p>Your content here...</p>
|
|
101
|
+
</Content>
|
|
102
|
+
</Section>
|
|
103
|
+
</QwickApp>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Custom Logo
|
|
109
|
+
|
|
110
|
+
```tsx
|
|
111
|
+
// Use built-in Logo component with appName
|
|
112
|
+
<QwickApp appName="MyApp" />
|
|
113
|
+
|
|
114
|
+
// Or provide a custom logo
|
|
115
|
+
<QwickApp
|
|
116
|
+
appName="MyApp"
|
|
117
|
+
logo={<img src="/logo.png" alt="MyApp" />}
|
|
118
|
+
/>
|
|
119
|
+
|
|
120
|
+
// Custom logo with built-in Logo component
|
|
121
|
+
<QwickApp
|
|
122
|
+
appName="MyApp"
|
|
123
|
+
logo={<Logo name="MyApp" size="large" badge="top-right" />}
|
|
124
|
+
/>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Responsive Navigation
|
|
128
|
+
|
|
129
|
+
The `ResponsiveMenu` component automatically adapts to different screen sizes:
|
|
130
|
+
|
|
131
|
+
```tsx
|
|
132
|
+
import { ResponsiveMenu } from '@qwickapps/react-framework';
|
|
133
|
+
|
|
134
|
+
const menuItems = [
|
|
135
|
+
{
|
|
136
|
+
id: 'dashboard',
|
|
137
|
+
label: 'Dashboard',
|
|
138
|
+
icon: <DashboardIcon />,
|
|
139
|
+
onClick: () => navigate('/dashboard'),
|
|
140
|
+
active: true,
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
id: 'products',
|
|
144
|
+
label: 'Products',
|
|
145
|
+
icon: <ProductsIcon />,
|
|
146
|
+
onClick: () => navigate('/products'),
|
|
147
|
+
badge: '5', // Show badge with count
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
id: 'settings',
|
|
151
|
+
label: 'Settings',
|
|
152
|
+
icon: <SettingsIcon />,
|
|
153
|
+
href: '/settings', // Use href for links
|
|
154
|
+
disabled: false,
|
|
155
|
+
},
|
|
156
|
+
];
|
|
157
|
+
|
|
158
|
+
function App() {
|
|
159
|
+
return (
|
|
160
|
+
<QwickApp appName="MyApp">
|
|
161
|
+
<ResponsiveMenu
|
|
162
|
+
items={menuItems}
|
|
163
|
+
logoPosition="center" // 'left' | 'center' | 'right'
|
|
164
|
+
onMenuToggle={(isOpen) => console.log('Menu state:', isOpen)}
|
|
165
|
+
/>
|
|
166
|
+
{/* Your content */}
|
|
167
|
+
</QwickApp>
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
**Responsive Behavior:**
|
|
173
|
+
- **Mobile (< 768px)**: Bottom navigation bar
|
|
174
|
+
- **Tablet (768-1024px)**: Collapsible sidebar nav rail
|
|
175
|
+
- **Desktop (> 1024px)**: Top navigation with drawer for overflow
|
|
176
|
+
|
|
177
|
+
## Layout Blocks
|
|
178
|
+
|
|
179
|
+
Build flexible, responsive layouts with pre-built components:
|
|
180
|
+
|
|
181
|
+
### Hero Blocks
|
|
182
|
+
|
|
183
|
+
```tsx
|
|
184
|
+
import { HeroBlock } from '@qwickapps/react-framework';
|
|
185
|
+
|
|
186
|
+
<HeroBlock
|
|
187
|
+
title="Welcome to Our Platform"
|
|
188
|
+
subtitle="The best way to manage your workflow"
|
|
189
|
+
height="large" // 'small' | 'medium' | 'large' | 'fullscreen'
|
|
190
|
+
backgroundImage="/hero-bg.jpg"
|
|
191
|
+
backgroundGradient="linear-gradient(135deg, #667eea 0%, #764ba2 100%)"
|
|
192
|
+
overlayOpacity={0.6}
|
|
193
|
+
textAlign="center"
|
|
194
|
+
actions={
|
|
195
|
+
<div>
|
|
196
|
+
<button>Get Started</button>
|
|
197
|
+
<button>Learn More</button>
|
|
198
|
+
</div>
|
|
199
|
+
}
|
|
200
|
+
/>
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Multi-Column Layouts
|
|
204
|
+
|
|
205
|
+
```tsx
|
|
206
|
+
import { GridLayout, GridCell } from '@qwickapps/react-framework';
|
|
207
|
+
|
|
208
|
+
<GridLayout columns={3} spacing="large" equalHeight responsive>
|
|
209
|
+
<GridCell padding="large" background="var(--theme-surface)">
|
|
210
|
+
<h3>Feature One</h3>
|
|
211
|
+
<p>Description here...</p>
|
|
212
|
+
</GridCell>
|
|
213
|
+
<GridCell padding="large" background="var(--theme-surface)">
|
|
214
|
+
<h3>Feature Two</h3>
|
|
215
|
+
<p>More content...</p>
|
|
216
|
+
</GridCell>
|
|
217
|
+
<GridCell padding="large" background="var(--theme-surface)">
|
|
218
|
+
<h3>Feature Three</h3>
|
|
219
|
+
<p>Even more content...</p>
|
|
220
|
+
</GridCell>
|
|
221
|
+
</GridLayout>
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Feature Grids
|
|
225
|
+
|
|
226
|
+
```tsx
|
|
227
|
+
import { FeatureGrid } from '@qwickapps/react-framework';
|
|
228
|
+
|
|
229
|
+
<FeatureGrid
|
|
230
|
+
columns={3}
|
|
231
|
+
gap="large"
|
|
232
|
+
features={[
|
|
233
|
+
{
|
|
234
|
+
id: 'fast',
|
|
235
|
+
icon: <FastIcon />,
|
|
236
|
+
title: 'Lightning Fast',
|
|
237
|
+
description: 'Optimized for performance and speed',
|
|
238
|
+
action: <button>Learn More</button>
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
id: 'secure',
|
|
242
|
+
icon: <SecureIcon />,
|
|
243
|
+
title: 'Secure by Default',
|
|
244
|
+
description: 'Built with security best practices',
|
|
245
|
+
action: <button>Security Guide</button>
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
id: 'scalable',
|
|
249
|
+
icon: <ScaleIcon />,
|
|
250
|
+
title: 'Highly Scalable',
|
|
251
|
+
description: 'Grows with your application needs',
|
|
252
|
+
action: <button>Architecture</button>
|
|
253
|
+
},
|
|
254
|
+
]}
|
|
255
|
+
/>
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### Content Blocks & Sections
|
|
259
|
+
|
|
260
|
+
```tsx
|
|
261
|
+
import { Section, Content } from '@qwickapps/react-framework';
|
|
262
|
+
|
|
263
|
+
<Section padding="large" background="alternate" maxWidth="large">
|
|
264
|
+
<Content
|
|
265
|
+
title="About Our Company"
|
|
266
|
+
variant="elevated" // 'default' | 'elevated' | 'outlined' | 'filled'
|
|
267
|
+
padding="large"
|
|
268
|
+
centered
|
|
269
|
+
>
|
|
270
|
+
<p>Your content here...</p>
|
|
271
|
+
</Content>
|
|
272
|
+
</Section>
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
## CMS Content Components
|
|
276
|
+
|
|
277
|
+
Transform HTML strings and Markdown content into React components with intelligent element transformation and syntax highlighting.
|
|
278
|
+
|
|
279
|
+
### Html Component
|
|
280
|
+
|
|
281
|
+
Transform HTML strings into React components with configurable transformation rules:
|
|
282
|
+
|
|
283
|
+
```tsx
|
|
284
|
+
import { Html } from '@qwickapps/react-framework';
|
|
285
|
+
|
|
286
|
+
// Basic HTML transformation
|
|
287
|
+
<Html>
|
|
288
|
+
{`<h1>Welcome</h1>
|
|
289
|
+
<p>This is a paragraph with <code>inline code</code>.</p>
|
|
290
|
+
<pre><code class="language-javascript">
|
|
291
|
+
const greeting = "Hello, World!";
|
|
292
|
+
console.log(greeting);
|
|
293
|
+
</code></pre>`}
|
|
294
|
+
</Html>
|
|
295
|
+
|
|
296
|
+
// Custom transformation rules
|
|
297
|
+
const customRules = [
|
|
298
|
+
{
|
|
299
|
+
selector: 'button',
|
|
300
|
+
transform: (element, key) => (
|
|
301
|
+
<Button key={key} variant="contained">
|
|
302
|
+
{element.textContent}
|
|
303
|
+
</Button>
|
|
304
|
+
)
|
|
305
|
+
}
|
|
306
|
+
];
|
|
307
|
+
|
|
308
|
+
<Html transformConfig={{ rules: customRules }}>
|
|
309
|
+
{htmlContent}
|
|
310
|
+
</Html>
|
|
311
|
+
|
|
312
|
+
// With header stripping (useful for articles)
|
|
313
|
+
<Html stripHeaders placeholder="No content available">
|
|
314
|
+
{articleContent}
|
|
315
|
+
</Html>
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
**Default Transformations:**
|
|
319
|
+
- `<pre><code>` → Code component with syntax highlighting
|
|
320
|
+
- `<section class="blog-section">` → Section component
|
|
321
|
+
- `<button>` → Button component
|
|
322
|
+
- Other elements → Native HTML with SafeSpan content
|
|
323
|
+
|
|
324
|
+
### Markdown Component
|
|
325
|
+
|
|
326
|
+
Convert Markdown to React components with full GitHub Flavored Markdown support:
|
|
327
|
+
|
|
328
|
+
```tsx
|
|
329
|
+
import { Markdown } from '@qwickapps/react-framework';
|
|
330
|
+
|
|
331
|
+
const markdownContent = `
|
|
332
|
+
# Welcome to Our Platform
|
|
333
|
+
|
|
334
|
+
This is **bold text** and this is *italic text*.
|
|
335
|
+
|
|
336
|
+
## Code Example
|
|
337
|
+
|
|
338
|
+
Here's some JavaScript:
|
|
339
|
+
|
|
340
|
+
\`\`\`javascript
|
|
341
|
+
const framework = "QwickApps";
|
|
342
|
+
console.log(\`Using \${framework} Framework\`);
|
|
343
|
+
\`\`\`
|
|
344
|
+
|
|
345
|
+
And some inline \`code\` here.
|
|
346
|
+
|
|
347
|
+
## Features
|
|
348
|
+
|
|
349
|
+
- React components
|
|
350
|
+
- Syntax highlighting
|
|
351
|
+
- GitHub Flavored Markdown
|
|
352
|
+
- Configurable transformation
|
|
353
|
+
`;
|
|
354
|
+
|
|
355
|
+
<Markdown>{markdownContent}</Markdown>
|
|
356
|
+
|
|
357
|
+
// With custom HTML transformation config
|
|
358
|
+
<Markdown htmlTransformConfig={customConfig}>
|
|
359
|
+
{markdownContent}
|
|
360
|
+
</Markdown>
|
|
361
|
+
|
|
362
|
+
// With placeholder for empty content
|
|
363
|
+
<Markdown placeholder="No content to display">
|
|
364
|
+
{emptyContent}
|
|
365
|
+
</Markdown>
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
**Key Features:**
|
|
369
|
+
- GitHub Flavored Markdown support via marked library
|
|
370
|
+
- Automatic syntax highlighting for code blocks
|
|
371
|
+
- Inline code preservation
|
|
372
|
+
- Custom transformation rules for HTML elements
|
|
373
|
+
- Error handling with development debugging
|
|
374
|
+
- TypeScript support with comprehensive props interface
|
|
375
|
+
|
|
376
|
+
### Transform System Architecture
|
|
377
|
+
|
|
378
|
+
The transform system provides extensible HTML element transformation:
|
|
379
|
+
|
|
380
|
+
```tsx
|
|
381
|
+
import { TransformRule, TransformConfig } from '@qwickapps/react-framework';
|
|
382
|
+
|
|
383
|
+
// Define custom transformation rules
|
|
384
|
+
const articleRules: TransformRule[] = [
|
|
385
|
+
{
|
|
386
|
+
selector: 'pre',
|
|
387
|
+
transform: (element, key) => {
|
|
388
|
+
const codeChild = element.querySelector('code');
|
|
389
|
+
if (!codeChild) return null;
|
|
390
|
+
|
|
391
|
+
const language = Array.from(codeChild.classList)
|
|
392
|
+
.find(cls => cls.startsWith('language-'))
|
|
393
|
+
?.replace('language-', '') || 'text';
|
|
394
|
+
|
|
395
|
+
return (
|
|
396
|
+
<Code key={key} language={language} showCopy>
|
|
397
|
+
{codeChild.textContent || ''}
|
|
398
|
+
</Code>
|
|
399
|
+
);
|
|
400
|
+
}
|
|
401
|
+
},
|
|
402
|
+
// Add more rules...
|
|
403
|
+
];
|
|
404
|
+
|
|
405
|
+
const config: TransformConfig = {
|
|
406
|
+
rules: articleRules,
|
|
407
|
+
sanitize: true,
|
|
408
|
+
fallbackComponent: (element, key) => (
|
|
409
|
+
<SafeSpan key={key} html={element.outerHTML} />
|
|
410
|
+
)
|
|
411
|
+
};
|
|
412
|
+
|
|
413
|
+
// Use with Html or Markdown components
|
|
414
|
+
<Html transformConfig={config}>{htmlContent}</Html>
|
|
415
|
+
<Markdown htmlTransformConfig={config}>{markdownContent}</Markdown>
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
**Built-in Rule Sets:**
|
|
419
|
+
- `defaultArticleRules` - Optimized for blog/article content with header stripping
|
|
420
|
+
- `defaultMarkdownRules` - Optimized for Markdown content with inline code preservation
|
|
421
|
+
|
|
422
|
+
### Integration with Existing Components
|
|
423
|
+
|
|
424
|
+
The Html and Markdown components integrate seamlessly with existing Framework components:
|
|
425
|
+
|
|
426
|
+
```tsx
|
|
427
|
+
// Article component now uses Html internally
|
|
428
|
+
<Article title="Blog Post" author="John Doe">
|
|
429
|
+
{htmlContent} {/* Automatically transformed via Html component */}
|
|
430
|
+
</Article>
|
|
431
|
+
|
|
432
|
+
// Content component detects string children and uses Html
|
|
433
|
+
<Content title="Dynamic Content">
|
|
434
|
+
{dynamicHtmlFromCMS} {/* String content automatically transformed */}
|
|
435
|
+
</Content>
|
|
436
|
+
|
|
437
|
+
// Section with Markdown content
|
|
438
|
+
<Section padding="large">
|
|
439
|
+
<Content title="Documentation">
|
|
440
|
+
<Markdown>{documentationMarkdown}</Markdown>
|
|
441
|
+
</Content>
|
|
442
|
+
</Section>
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
### Error Handling and Fallbacks
|
|
446
|
+
|
|
447
|
+
Both components provide comprehensive error handling:
|
|
448
|
+
|
|
449
|
+
```tsx
|
|
450
|
+
// Development mode shows detailed errors
|
|
451
|
+
<Html>{malformedHtml}</Html> // Shows red border with error details
|
|
452
|
+
|
|
453
|
+
// Production mode gracefully degrades
|
|
454
|
+
<Markdown>{invalidMarkdown}</Markdown> // Falls back to SafeSpan rendering
|
|
455
|
+
|
|
456
|
+
// Custom error handling
|
|
457
|
+
<Html
|
|
458
|
+
placeholder="Content temporarily unavailable"
|
|
459
|
+
fallbackComponent={(element, key) => (
|
|
460
|
+
<div key={key}>Custom fallback for {element.tagName}</div>
|
|
461
|
+
)}
|
|
462
|
+
>
|
|
463
|
+
{riskyContent}
|
|
464
|
+
</Html>
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
## Theming System
|
|
468
|
+
|
|
469
|
+
### Theme Modes
|
|
470
|
+
|
|
471
|
+
```tsx
|
|
472
|
+
import { useTheme } from '@qwickapps/react-framework';
|
|
473
|
+
|
|
474
|
+
function ThemeControls() {
|
|
475
|
+
const { themeMode, switchTheme } = useTheme();
|
|
476
|
+
|
|
477
|
+
return (
|
|
478
|
+
<div>
|
|
479
|
+
<button onClick={() => switchTheme('light')}>Light</button>
|
|
480
|
+
<button onClick={() => switchTheme('dark')}>Dark</button>
|
|
481
|
+
<button onClick={() => switchTheme('system')}>System</button>
|
|
482
|
+
<p>Current theme: {themeMode}</p>
|
|
483
|
+
</div>
|
|
484
|
+
);
|
|
485
|
+
}
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
### Color Palettes
|
|
489
|
+
|
|
490
|
+
```tsx
|
|
491
|
+
import { usePalette } from '@qwickapps/react-framework';
|
|
492
|
+
|
|
493
|
+
function PaletteControls() {
|
|
494
|
+
const { currentPalette, switchPalette } = usePalette();
|
|
495
|
+
|
|
496
|
+
return (
|
|
497
|
+
<div>
|
|
498
|
+
<button onClick={() => switchPalette('ocean')}>Ocean</button>
|
|
499
|
+
<button onClick={() => switchPalette('autumn')}>Autumn</button>
|
|
500
|
+
<button onClick={() => switchPalette('spring')}>Spring</button>
|
|
501
|
+
<button onClick={() => switchPalette('winter')}>Winter</button>
|
|
502
|
+
<p>Current palette: {currentPalette}</p>
|
|
503
|
+
</div>
|
|
504
|
+
);
|
|
505
|
+
}
|
|
506
|
+
```
|
|
507
|
+
|
|
508
|
+
### CSS Variables
|
|
509
|
+
|
|
510
|
+
The framework exposes CSS custom properties for consistent theming:
|
|
511
|
+
|
|
512
|
+
```css
|
|
513
|
+
.my-component {
|
|
514
|
+
background: var(--theme-surface);
|
|
515
|
+
color: var(--theme-on-surface);
|
|
516
|
+
border: 1px solid var(--theme-border-main);
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
.primary-button {
|
|
520
|
+
background: var(--theme-primary);
|
|
521
|
+
color: var(--theme-on-primary);
|
|
522
|
+
border-radius: var(--theme-border-radius);
|
|
523
|
+
}
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
**Available Variables:**
|
|
527
|
+
- `--theme-primary`, `--theme-on-primary`
|
|
528
|
+
- `--theme-secondary`, `--theme-on-secondary`
|
|
529
|
+
- `--theme-surface`, `--theme-on-surface`
|
|
530
|
+
- `--theme-background`, `--theme-on-background`
|
|
531
|
+
- `--theme-outline`, `--theme-outline-variant`
|
|
532
|
+
- `--theme-elevation-1`, `--theme-elevation-2`
|
|
533
|
+
|
|
534
|
+
## Component API
|
|
535
|
+
|
|
536
|
+
### QwickApp
|
|
537
|
+
|
|
538
|
+
```tsx
|
|
539
|
+
interface QwickAppProps {
|
|
540
|
+
children: React.ReactNode;
|
|
541
|
+
appId?: string | true | false; // Storage key strategy
|
|
542
|
+
appName?: string; // Display name for built-in Logo
|
|
543
|
+
logo?: React.ReactNode; // Custom logo component
|
|
544
|
+
className?: string;
|
|
545
|
+
style?: React.CSSProperties;
|
|
546
|
+
defaultTheme?: 'light' | 'dark' | 'system';
|
|
547
|
+
defaultPalette?: string;
|
|
548
|
+
}
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
### ResponsiveMenu
|
|
552
|
+
|
|
553
|
+
```tsx
|
|
554
|
+
interface ResponsiveMenuProps {
|
|
555
|
+
items: MenuItem[];
|
|
556
|
+
className?: string;
|
|
557
|
+
logo?: React.ReactNode;
|
|
558
|
+
showLogo?: boolean;
|
|
559
|
+
logoPosition?: 'left' | 'center' | 'right';
|
|
560
|
+
brandText?: string;
|
|
561
|
+
onMenuToggle?: (isOpen: boolean) => void;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
interface MenuItem {
|
|
565
|
+
id: string;
|
|
566
|
+
label: string;
|
|
567
|
+
icon?: React.ReactNode;
|
|
568
|
+
onClick?: () => void;
|
|
569
|
+
href?: string;
|
|
570
|
+
active?: boolean;
|
|
571
|
+
disabled?: boolean;
|
|
572
|
+
badge?: string | number;
|
|
573
|
+
}
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
### Html Component
|
|
577
|
+
|
|
578
|
+
```tsx
|
|
579
|
+
interface HtmlProps extends WithBaseProps {
|
|
580
|
+
children: string; // HTML content as string
|
|
581
|
+
transformConfig?: TransformConfig; // Custom transformation rules
|
|
582
|
+
stripHeaders?: boolean; // Strip header elements (default: false)
|
|
583
|
+
sanitize?: boolean; // Sanitize HTML (default: true)
|
|
584
|
+
sanitizeOptions?: any; // Custom sanitization options
|
|
585
|
+
placeholder?: string; // Fallback when content is empty
|
|
586
|
+
component?: React.ElementType; // Container element (default: 'div')
|
|
587
|
+
}
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
### Markdown Component
|
|
591
|
+
|
|
592
|
+
```tsx
|
|
593
|
+
interface MarkdownProps extends WithBaseProps {
|
|
594
|
+
children: string; // Markdown content as string
|
|
595
|
+
htmlTransformConfig?: TransformConfig; // HTML transformation config
|
|
596
|
+
sanitize?: boolean; // Sanitize HTML output (default: true)
|
|
597
|
+
sanitizeOptions?: any; // Custom sanitization options
|
|
598
|
+
placeholder?: string; // Fallback when content is empty
|
|
599
|
+
component?: React.ElementType; // Container element (default: 'div')
|
|
600
|
+
markedOptions?: marked.MarkedOptions; // Marked library options
|
|
601
|
+
}
|
|
602
|
+
```
|
|
603
|
+
|
|
604
|
+
### Transform System
|
|
605
|
+
|
|
606
|
+
```tsx
|
|
607
|
+
interface TransformRule {
|
|
608
|
+
selector: string; // CSS selector for elements to transform
|
|
609
|
+
transform: (element: Element, key: string) => React.ReactNode;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
interface TransformConfig {
|
|
613
|
+
rules: TransformRule[]; // Array of transformation rules
|
|
614
|
+
sanitize?: boolean; // Enable HTML sanitization
|
|
615
|
+
sanitizeOptions?: any; // Sanitization configuration
|
|
616
|
+
fallbackComponent?: (element: Element, key: string) => React.ReactNode;
|
|
617
|
+
}
|
|
618
|
+
```
|
|
619
|
+
|
|
620
|
+
## Advanced Usage
|
|
621
|
+
|
|
622
|
+
### Custom Layout Composition
|
|
623
|
+
|
|
624
|
+
```tsx
|
|
625
|
+
function LandingPage() {
|
|
626
|
+
return (
|
|
627
|
+
<QwickApp appName="ProductApp">
|
|
628
|
+
<ResponsiveMenu items={navigationItems} />
|
|
629
|
+
|
|
630
|
+
{/* Hero Section */}
|
|
631
|
+
<HeroBlock
|
|
632
|
+
title="Revolutionary Product"
|
|
633
|
+
subtitle="Transform your workflow today"
|
|
634
|
+
backgroundGradient="linear-gradient(135deg, #667eea 0%, #764ba2 100%)"
|
|
635
|
+
height="fullscreen"
|
|
636
|
+
actions={<CallToActionButtons />}
|
|
637
|
+
/>
|
|
638
|
+
|
|
639
|
+
{/* Features Section */}
|
|
640
|
+
<Section padding="extra-large" background="alternate">
|
|
641
|
+
<Content title="Why Choose Us?" centered maxWidth="large">
|
|
642
|
+
<FeatureGrid columns={3} features={featureData} />
|
|
643
|
+
</Content>
|
|
644
|
+
</Section>
|
|
645
|
+
|
|
646
|
+
{/* Content Sections */}
|
|
647
|
+
<Section padding="extra-large">
|
|
648
|
+
<GridLayout columns={2} gap="large">
|
|
649
|
+
<GridCell>
|
|
650
|
+
<Content title="For Developers" variant="elevated" padding="large">
|
|
651
|
+
{/* Developer content */}
|
|
652
|
+
</Content>
|
|
653
|
+
</GridCell>
|
|
654
|
+
<GridCell>
|
|
655
|
+
<Content title="For Businesses" variant="elevated" padding="large">
|
|
656
|
+
{/* Business content */}
|
|
657
|
+
</Content>
|
|
658
|
+
</GridCell>
|
|
659
|
+
</GridLayout>
|
|
660
|
+
</Section>
|
|
661
|
+
|
|
662
|
+
{/* CTA Section */}
|
|
663
|
+
<Section padding="large" background="primary">
|
|
664
|
+
<Content centered>
|
|
665
|
+
<CallToActionSection />
|
|
666
|
+
</Content>
|
|
667
|
+
</Section>
|
|
668
|
+
</QwickApp>
|
|
669
|
+
);
|
|
670
|
+
}
|
|
671
|
+
```
|
|
672
|
+
|
|
673
|
+
### Accessing App Context
|
|
674
|
+
|
|
675
|
+
```tsx
|
|
676
|
+
import { useQwickApp } from '@qwickapps/react-framework';
|
|
677
|
+
|
|
678
|
+
function MyComponent() {
|
|
679
|
+
const { appName, logo } = useQwickApp();
|
|
680
|
+
|
|
681
|
+
return (
|
|
682
|
+
<div>
|
|
683
|
+
<h1>Welcome to {appName}</h1>
|
|
684
|
+
{logo && <div>{logo}</div>}
|
|
685
|
+
</div>
|
|
686
|
+
);
|
|
687
|
+
}
|
|
688
|
+
```
|
|
689
|
+
|
|
690
|
+
## TypeScript Support
|
|
691
|
+
|
|
692
|
+
Full TypeScript support with comprehensive type definitions:
|
|
693
|
+
|
|
694
|
+
```tsx
|
|
695
|
+
import type {
|
|
696
|
+
QwickAppProps,
|
|
697
|
+
ResponsiveMenuProps,
|
|
698
|
+
MenuItem,
|
|
699
|
+
HeroBlockProps,
|
|
700
|
+
ColumnLayoutProps,
|
|
701
|
+
FeatureItem,
|
|
702
|
+
} from '@qwickapps/react-framework';
|
|
703
|
+
```
|
|
704
|
+
|
|
705
|
+
## Development
|
|
706
|
+
|
|
707
|
+
```bash
|
|
708
|
+
# Install dependencies
|
|
709
|
+
npm install
|
|
710
|
+
|
|
711
|
+
# Start Storybook
|
|
712
|
+
npm run storybook
|
|
713
|
+
|
|
714
|
+
# Run tests
|
|
715
|
+
npm test
|
|
716
|
+
|
|
717
|
+
# Build package
|
|
718
|
+
npm run build
|
|
719
|
+
```
|
|
720
|
+
|
|
721
|
+
## Best Practices
|
|
722
|
+
|
|
723
|
+
### Logging and Debugging
|
|
724
|
+
|
|
725
|
+
The framework uses the `@qwickapps/logging` package for centralized logging with development insights and zero production impact:
|
|
726
|
+
|
|
727
|
+
```typescript
|
|
728
|
+
import { loggers, createLogger } from '@qwickapps/react-framework';
|
|
729
|
+
|
|
730
|
+
// Use framework-specific loggers
|
|
731
|
+
const logger = loggers.navigation;
|
|
732
|
+
logger.debug('Route changed:', path);
|
|
733
|
+
logger.error('Navigation failed:', error);
|
|
734
|
+
|
|
735
|
+
// Or create custom loggers
|
|
736
|
+
const myLogger = createLogger('MyComponent');
|
|
737
|
+
myLogger.info('Component initialized');
|
|
738
|
+
```
|
|
739
|
+
|
|
740
|
+
**Key Benefits:**
|
|
741
|
+
- ✅ No boilerplate conditionals
|
|
742
|
+
- ✅ Automatic production silencing
|
|
743
|
+
- ✅ Namespaced for clarity
|
|
744
|
+
- ✅ TypeScript support
|
|
745
|
+
- ✅ Optional complete stripping
|
|
746
|
+
|
|
747
|
+
**Build Configuration:**
|
|
748
|
+
|
|
749
|
+
```json
|
|
750
|
+
// package.json - Consumer application
|
|
751
|
+
{
|
|
752
|
+
"scripts": {
|
|
753
|
+
"build:dev": "NODE_ENV=development vite build",
|
|
754
|
+
"build:prod": "NODE_ENV=production STRIP_LOGS=true vite build",
|
|
755
|
+
"deploy:dev": "npm run build:dev && npm run deploy",
|
|
756
|
+
"deploy": "npm run build:prod && npm run deploy"
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
```
|
|
760
|
+
|
|
761
|
+
For complete documentation, see [@qwickapps/logging](../qwickapps-logging/README.md).
|
|
762
|
+
|
|
763
|
+
### Component Development
|
|
764
|
+
|
|
765
|
+
1. **Always extend WithBaseProps** for consistent component API
|
|
766
|
+
2. **Use the GridLayout system** for responsive layouts
|
|
767
|
+
3. **Leverage pre-built hooks** like `useBaseProps` for standardization
|
|
768
|
+
4. **Follow the established patterns** in existing components
|
|
769
|
+
|
|
770
|
+
### Theme and Styling
|
|
771
|
+
|
|
772
|
+
1. **Use CSS variables** from the theme system
|
|
773
|
+
2. **Support both light and dark modes** by default
|
|
774
|
+
3. **Test with different palettes** to ensure flexibility
|
|
775
|
+
4. **Use t-shirt sizing** (tiny, small, medium, large, huge) for consistency
|
|
776
|
+
|
|
777
|
+
### Performance
|
|
778
|
+
|
|
779
|
+
1. **Import only what you need** - the package supports tree shaking
|
|
780
|
+
2. **Use React.memo** for expensive components
|
|
781
|
+
3. **Leverage the built-in performance monitoring** for theme changes
|
|
782
|
+
4. **Consider lazy loading** for large component trees
|
|
783
|
+
|
|
784
|
+
## License
|
|
785
|
+
|
|
786
|
+
**This software is proprietary and confidential. Copyright © 2025 QwickApps.com. All rights reserved.**
|
|
787
|
+
|
|
788
|
+
This package is private and proprietary to QwickApps.com. It is not licensed for public use, modification, or distribution. Access is restricted to authorized QwickApps team members and approved partners only.
|
|
789
|
+
|
|
790
|
+
## About QwickApps
|
|
791
|
+
|
|
792
|
+
This framework is part of the QwickApps ecosystem, providing high-quality solutions for educational and productivity applications.
|
|
793
|
+
|
|
794
|
+
For more information, visit [QwickApps.com](https://qwickapps.com).
|