@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,526 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TextInputField Component Stories - Reusable text input with data binding support
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { Box, Typography, Paper } 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 TextInputField from '../components/input/TextInputField';
|
|
12
|
+
import QwickApp from '../components/QwickApp';
|
|
13
|
+
|
|
14
|
+
// Sample text input field data for different use cases
|
|
15
|
+
const sampleCmsData = {
|
|
16
|
+
'textInputFields': {
|
|
17
|
+
'basic-text': {
|
|
18
|
+
label: 'Full Name',
|
|
19
|
+
placeholder: 'Enter your full name',
|
|
20
|
+
required: true,
|
|
21
|
+
type: 'text'
|
|
22
|
+
},
|
|
23
|
+
'email-field': {
|
|
24
|
+
label: 'Email Address',
|
|
25
|
+
placeholder: 'your.email@example.com',
|
|
26
|
+
type: 'email',
|
|
27
|
+
required: true,
|
|
28
|
+
helperText: 'We will never share your email address'
|
|
29
|
+
},
|
|
30
|
+
'password-field': {
|
|
31
|
+
label: 'Password',
|
|
32
|
+
placeholder: 'Enter a strong password',
|
|
33
|
+
type: 'password',
|
|
34
|
+
required: true,
|
|
35
|
+
helperText: 'Minimum 8 characters with mixed case and numbers'
|
|
36
|
+
},
|
|
37
|
+
'phone-field': {
|
|
38
|
+
label: 'Phone Number',
|
|
39
|
+
placeholder: '+1 (555) 123-4567',
|
|
40
|
+
type: 'tel',
|
|
41
|
+
helperText: 'Include country code for international numbers'
|
|
42
|
+
},
|
|
43
|
+
'number-field': {
|
|
44
|
+
label: 'Age',
|
|
45
|
+
placeholder: '25',
|
|
46
|
+
type: 'number',
|
|
47
|
+
required: false
|
|
48
|
+
},
|
|
49
|
+
'search-field': {
|
|
50
|
+
label: 'Search',
|
|
51
|
+
placeholder: 'Search products, articles, or help...',
|
|
52
|
+
type: 'search',
|
|
53
|
+
helperText: 'Use keywords to find what you need'
|
|
54
|
+
},
|
|
55
|
+
'multiline-field': {
|
|
56
|
+
label: 'Description',
|
|
57
|
+
placeholder: 'Tell us more about yourself...',
|
|
58
|
+
multiline: true,
|
|
59
|
+
rows: 4,
|
|
60
|
+
helperText: 'Provide a brief description (optional)'
|
|
61
|
+
},
|
|
62
|
+
'large-textarea': {
|
|
63
|
+
label: 'Comments',
|
|
64
|
+
placeholder: 'Share your thoughts, feedback, or questions...',
|
|
65
|
+
multiline: true,
|
|
66
|
+
rows: 6,
|
|
67
|
+
maxRows: 10,
|
|
68
|
+
required: true
|
|
69
|
+
},
|
|
70
|
+
'disabled-field': {
|
|
71
|
+
label: 'Account ID',
|
|
72
|
+
value: 'USR-12345',
|
|
73
|
+
disabled: true,
|
|
74
|
+
helperText: 'This field cannot be modified'
|
|
75
|
+
},
|
|
76
|
+
'error-field': {
|
|
77
|
+
label: 'Username',
|
|
78
|
+
placeholder: 'Choose a unique username',
|
|
79
|
+
error: 'This username is already taken',
|
|
80
|
+
required: true
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const dataProvider = new JsonDataProvider({ data: sampleCmsData });
|
|
86
|
+
|
|
87
|
+
const meta = {
|
|
88
|
+
title: 'Forms/TextInputField',
|
|
89
|
+
component: TextInputField,
|
|
90
|
+
parameters: {
|
|
91
|
+
layout: 'padded',
|
|
92
|
+
docs: {
|
|
93
|
+
description: {
|
|
94
|
+
component: `TextInputField is a reusable text input component with consistent styling and comprehensive features for form building.
|
|
95
|
+
|
|
96
|
+
**Key Features:**
|
|
97
|
+
- **Multiple Input Types**: Support for text, email, password, number, tel, search, and more
|
|
98
|
+
- **Multiline Support**: Configurable textarea mode with rows and maxRows
|
|
99
|
+
- **Validation States**: Built-in error handling and helper text display
|
|
100
|
+
- **Data Binding**: Full CMS integration through dataSource prop
|
|
101
|
+
- **Accessibility**: Complete ARIA support and keyboard navigation
|
|
102
|
+
- **Theme Integration**: Automatically uses QwickApp theme styling
|
|
103
|
+
- **Base Props**: Supports grid behavior and consistent styling patterns
|
|
104
|
+
- **Flexible Configuration**: Comprehensive props for customization
|
|
105
|
+
|
|
106
|
+
**Perfect For:**
|
|
107
|
+
- User registration and login forms
|
|
108
|
+
- Contact and feedback forms
|
|
109
|
+
- Search and filter interfaces
|
|
110
|
+
- Profile and settings forms
|
|
111
|
+
- Any text input requirement with consistent styling`,
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
tags: ['autodocs'],
|
|
116
|
+
} satisfies Meta<typeof TextInputField>;
|
|
117
|
+
|
|
118
|
+
export default meta;
|
|
119
|
+
type Story = StoryObj<typeof TextInputField>;
|
|
120
|
+
|
|
121
|
+
// Traditional Usage Examples
|
|
122
|
+
export const BasicText: Story = {
|
|
123
|
+
render: () => (
|
|
124
|
+
<QwickApp appId="text-input-basic" appName='Basic Text Input'>
|
|
125
|
+
<TextInputField
|
|
126
|
+
label="Full Name"
|
|
127
|
+
placeholder="Enter your full name"
|
|
128
|
+
onChange={(value) => console.log('Name changed:', value)}
|
|
129
|
+
/>
|
|
130
|
+
</QwickApp>
|
|
131
|
+
),
|
|
132
|
+
parameters: {
|
|
133
|
+
docs: {
|
|
134
|
+
description: {
|
|
135
|
+
story: 'Basic text input field with label and placeholder.',
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export const EmailField: Story = {
|
|
142
|
+
render: () => (
|
|
143
|
+
<QwickApp appId="text-input-email" appName='Email Text Input'>
|
|
144
|
+
<TextInputField
|
|
145
|
+
label="Email Address"
|
|
146
|
+
type="email"
|
|
147
|
+
placeholder="your.email@example.com"
|
|
148
|
+
required={true}
|
|
149
|
+
helperText="We will never share your email address"
|
|
150
|
+
onChange={(value) => console.log('Email changed:', value)}
|
|
151
|
+
/>
|
|
152
|
+
</QwickApp>
|
|
153
|
+
),
|
|
154
|
+
parameters: {
|
|
155
|
+
docs: {
|
|
156
|
+
description: {
|
|
157
|
+
story: 'Email input field with validation type and helper text.',
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export const PasswordField: Story = {
|
|
164
|
+
render: () => (
|
|
165
|
+
<QwickApp appId="text-input-password" appName='Password Text Input'>
|
|
166
|
+
<TextInputField
|
|
167
|
+
label="Password"
|
|
168
|
+
type="password"
|
|
169
|
+
placeholder="Enter a strong password"
|
|
170
|
+
required={true}
|
|
171
|
+
helperText="Minimum 8 characters with mixed case and numbers"
|
|
172
|
+
onChange={(value) => console.log('Password changed:', value.length > 0 ? '***' : '')}
|
|
173
|
+
/>
|
|
174
|
+
</QwickApp>
|
|
175
|
+
),
|
|
176
|
+
parameters: {
|
|
177
|
+
docs: {
|
|
178
|
+
description: {
|
|
179
|
+
story: 'Password input field with masked text and security guidance.',
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
export const MultilineField: Story = {
|
|
186
|
+
render: () => (
|
|
187
|
+
<QwickApp appId="text-input-multiline" appName='Multiline Text Input'>
|
|
188
|
+
<TextInputField
|
|
189
|
+
label="Description"
|
|
190
|
+
placeholder="Tell us more about yourself..."
|
|
191
|
+
multiline={true}
|
|
192
|
+
rows={4}
|
|
193
|
+
helperText="Provide a brief description (optional)"
|
|
194
|
+
onChange={(value) => console.log('Description changed:', value)}
|
|
195
|
+
/>
|
|
196
|
+
</QwickApp>
|
|
197
|
+
),
|
|
198
|
+
parameters: {
|
|
199
|
+
docs: {
|
|
200
|
+
description: {
|
|
201
|
+
story: 'Multiline textarea input with configurable rows.',
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
export const InputTypes: Story = {
|
|
208
|
+
render: () => (
|
|
209
|
+
<QwickApp appId="text-input-types" appName='Input Types'>
|
|
210
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3, maxWidth: 500 }}>
|
|
211
|
+
<TextInputField
|
|
212
|
+
label="Number Input"
|
|
213
|
+
type="number"
|
|
214
|
+
placeholder="25"
|
|
215
|
+
onChange={(value) => console.log('Number:', value)}
|
|
216
|
+
/>
|
|
217
|
+
<TextInputField
|
|
218
|
+
label="Phone Number"
|
|
219
|
+
type="tel"
|
|
220
|
+
placeholder="+1 (555) 123-4567"
|
|
221
|
+
onChange={(value) => console.log('Phone:', value)}
|
|
222
|
+
/>
|
|
223
|
+
<TextInputField
|
|
224
|
+
label="Search Field"
|
|
225
|
+
type="search"
|
|
226
|
+
placeholder="Search products, articles, or help..."
|
|
227
|
+
onChange={(value) => console.log('Search:', value)}
|
|
228
|
+
/>
|
|
229
|
+
<TextInputField
|
|
230
|
+
label="URL Input"
|
|
231
|
+
type="url"
|
|
232
|
+
placeholder="https://example.com"
|
|
233
|
+
onChange={(value) => console.log('URL:', value)}
|
|
234
|
+
/>
|
|
235
|
+
</Box>
|
|
236
|
+
</QwickApp>
|
|
237
|
+
),
|
|
238
|
+
parameters: {
|
|
239
|
+
docs: {
|
|
240
|
+
description: {
|
|
241
|
+
story: 'Various input types with appropriate placeholders and validation.',
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
export const States: Story = {
|
|
248
|
+
render: () => (
|
|
249
|
+
<QwickApp appId="text-input-states" appName='Input Field States'>
|
|
250
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3, maxWidth: 500 }}>
|
|
251
|
+
<TextInputField
|
|
252
|
+
label="Normal State"
|
|
253
|
+
placeholder="Enter text here"
|
|
254
|
+
onChange={(value) => console.log('Normal:', value)}
|
|
255
|
+
/>
|
|
256
|
+
<TextInputField
|
|
257
|
+
label="Required Field"
|
|
258
|
+
placeholder="This field is required"
|
|
259
|
+
required={true}
|
|
260
|
+
onChange={(value) => console.log('Required:', value)}
|
|
261
|
+
/>
|
|
262
|
+
<TextInputField
|
|
263
|
+
label="Disabled Field"
|
|
264
|
+
value="This field is disabled"
|
|
265
|
+
disabled={true}
|
|
266
|
+
/>
|
|
267
|
+
<TextInputField
|
|
268
|
+
label="Error State"
|
|
269
|
+
placeholder="Enter a valid value"
|
|
270
|
+
error="This field contains an error"
|
|
271
|
+
onChange={(value) => console.log('Error field:', value)}
|
|
272
|
+
/>
|
|
273
|
+
<TextInputField
|
|
274
|
+
label="With Helper Text"
|
|
275
|
+
placeholder="Enter your information"
|
|
276
|
+
helperText="This is helpful information about this field"
|
|
277
|
+
onChange={(value) => console.log('With helper:', value)}
|
|
278
|
+
/>
|
|
279
|
+
</Box>
|
|
280
|
+
</QwickApp>
|
|
281
|
+
),
|
|
282
|
+
parameters: {
|
|
283
|
+
docs: {
|
|
284
|
+
description: {
|
|
285
|
+
story: 'Different input field states including normal, required, disabled, error, and helper text.',
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
// Data Binding Examples
|
|
292
|
+
export const DataBindingBasic: Story = {
|
|
293
|
+
render: () => (
|
|
294
|
+
<QwickApp appId="text-input-data-binding" appName='TextInputField Data Binding' dataSource={{ dataProvider }}>
|
|
295
|
+
<Box>
|
|
296
|
+
|
|
297
|
+
<Box sx={{ p: 4, backgroundColor: 'background.paper' }}>
|
|
298
|
+
<Typography variant="h5" gutterBottom>📊 Data-Driven Text Input</Typography>
|
|
299
|
+
<Typography variant="body1" sx={{ mb: 3, opacity: 0.8 }}>
|
|
300
|
+
TextInputField components can be completely driven by CMS data, loading configuration and behavior from your data source.
|
|
301
|
+
</Typography>
|
|
302
|
+
|
|
303
|
+
<Code title="Usage" language="tsx">{`<TextInputField dataSource="textInputFields.basic-text" />`}</Code>
|
|
304
|
+
|
|
305
|
+
<Code title="Data Structure" language="json">{JSON.stringify(sampleCmsData.textInputFields['basic-text'], null, 2)}</Code>
|
|
306
|
+
</Box>
|
|
307
|
+
|
|
308
|
+
<TextInputField dataSource="textInputFields.basic-text" />
|
|
309
|
+
|
|
310
|
+
</Box>
|
|
311
|
+
</QwickApp>
|
|
312
|
+
),
|
|
313
|
+
parameters: {
|
|
314
|
+
docs: {
|
|
315
|
+
description: {
|
|
316
|
+
story: 'TextInputField with data binding - configuration resolved from CMS data through dataSource.',
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
},
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
export const DataBindingAdvanced: Story = {
|
|
323
|
+
render: () => (
|
|
324
|
+
<QwickApp appId="text-input-data-advanced" appName='Advanced TextInputField Data Binding' dataSource={{ dataProvider }}>
|
|
325
|
+
<Box>
|
|
326
|
+
|
|
327
|
+
<Box sx={{ p: 4, backgroundColor: 'background.paper' }}>
|
|
328
|
+
<Typography variant="h5" gutterBottom>🎯 Multiple Input Types</Typography>
|
|
329
|
+
<Typography variant="body1" sx={{ mb: 3, opacity: 0.8 }}>
|
|
330
|
+
Different TextInputField instances can load different configurations from separate data sources.
|
|
331
|
+
</Typography>
|
|
332
|
+
</Box>
|
|
333
|
+
|
|
334
|
+
{/* Basic Contact Form */}
|
|
335
|
+
<Box sx={{ mb: 4 }}>
|
|
336
|
+
<Typography variant="h4" gutterBottom>Contact Information</Typography>
|
|
337
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3, maxWidth: 500 }}>
|
|
338
|
+
<TextInputField dataSource="textInputFields.basic-text" />
|
|
339
|
+
<TextInputField dataSource="textInputFields.email-field" />
|
|
340
|
+
<TextInputField dataSource="textInputFields.phone-field" />
|
|
341
|
+
</Box>
|
|
342
|
+
</Box>
|
|
343
|
+
|
|
344
|
+
{/* Account Setup */}
|
|
345
|
+
<Box sx={{ mb: 4 }}>
|
|
346
|
+
<Typography variant="h4" gutterBottom>Account Setup</Typography>
|
|
347
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3, maxWidth: 500 }}>
|
|
348
|
+
<TextInputField dataSource="textInputFields.email-field" />
|
|
349
|
+
<TextInputField dataSource="textInputFields.password-field" />
|
|
350
|
+
<TextInputField dataSource="textInputFields.number-field" />
|
|
351
|
+
</Box>
|
|
352
|
+
</Box>
|
|
353
|
+
|
|
354
|
+
{/* Text Areas */}
|
|
355
|
+
<Box sx={{ mb: 4 }}>
|
|
356
|
+
<Typography variant="h4" gutterBottom>Extended Information</Typography>
|
|
357
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3, maxWidth: 600 }}>
|
|
358
|
+
<TextInputField dataSource="textInputFields.multiline-field" />
|
|
359
|
+
<TextInputField dataSource="textInputFields.large-textarea" />
|
|
360
|
+
</Box>
|
|
361
|
+
</Box>
|
|
362
|
+
|
|
363
|
+
</Box>
|
|
364
|
+
</QwickApp>
|
|
365
|
+
),
|
|
366
|
+
parameters: {
|
|
367
|
+
docs: {
|
|
368
|
+
description: {
|
|
369
|
+
story: 'Advanced data binding with multiple text input types showcasing different configurations and field types.',
|
|
370
|
+
},
|
|
371
|
+
},
|
|
372
|
+
},
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
export const DataBindingWithFallback: Story = {
|
|
376
|
+
render: () => (
|
|
377
|
+
<QwickApp appId="text-input-fallback" appName='TextInputField Data Binding with Fallback' dataSource={{ dataProvider }}>
|
|
378
|
+
<Box>
|
|
379
|
+
|
|
380
|
+
<Box sx={{ p: 4, backgroundColor: 'background.paper' }}>
|
|
381
|
+
<Typography variant="h5" gutterBottom>🛡️ Fallback Support</Typography>
|
|
382
|
+
<Typography variant="body1" sx={{ mb: 3, opacity: 0.8 }}>
|
|
383
|
+
TextInputField components gracefully handle missing data sources with fallback configurations.
|
|
384
|
+
</Typography>
|
|
385
|
+
|
|
386
|
+
<Code title="Fallback Usage" language="tsx">{`<TextInputField
|
|
387
|
+
dataSource="nonexistent.field"
|
|
388
|
+
label="Fallback Input"
|
|
389
|
+
placeholder="This is fallback content"
|
|
390
|
+
/>`}</Code>
|
|
391
|
+
</Box>
|
|
392
|
+
|
|
393
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 4 }}>
|
|
394
|
+
<Box>
|
|
395
|
+
<Typography variant="h6" gutterBottom>Missing Data Source (Fallback)</Typography>
|
|
396
|
+
<TextInputField
|
|
397
|
+
dataSource="nonexistent.field"
|
|
398
|
+
label="Fallback Input"
|
|
399
|
+
placeholder="This is fallback content"
|
|
400
|
+
/>
|
|
401
|
+
</Box>
|
|
402
|
+
<Box>
|
|
403
|
+
<Typography variant="h6" gutterBottom>Valid Data Source</Typography>
|
|
404
|
+
<TextInputField dataSource="textInputFields.basic-text" />
|
|
405
|
+
</Box>
|
|
406
|
+
</Box>
|
|
407
|
+
|
|
408
|
+
</Box>
|
|
409
|
+
</QwickApp>
|
|
410
|
+
),
|
|
411
|
+
parameters: {
|
|
412
|
+
docs: {
|
|
413
|
+
description: {
|
|
414
|
+
story: 'TextInputField with fallback configuration when dataSource is missing or unavailable.',
|
|
415
|
+
},
|
|
416
|
+
},
|
|
417
|
+
},
|
|
418
|
+
};
|
|
419
|
+
|
|
420
|
+
export const RealWorldExample: Story = {
|
|
421
|
+
render: () => (
|
|
422
|
+
<QwickApp appId="text-input-real-world" appName='Real World TextInputField Example' dataSource={{ dataProvider }}>
|
|
423
|
+
<Box>
|
|
424
|
+
|
|
425
|
+
{/* Registration Form */}
|
|
426
|
+
<Paper sx={{ p: 4, mb: 4 }}>
|
|
427
|
+
<Typography variant="h3" gutterBottom>Create Your Account</Typography>
|
|
428
|
+
<Typography variant="body1" sx={{ mb: 4, opacity: 0.8 }}>
|
|
429
|
+
Join thousands of developers building with QwickApps React Framework
|
|
430
|
+
</Typography>
|
|
431
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3, maxWidth: 500 }}>
|
|
432
|
+
<TextInputField dataSource="textInputFields.basic-text" />
|
|
433
|
+
<TextInputField dataSource="textInputFields.email-field" />
|
|
434
|
+
<TextInputField dataSource="textInputFields.password-field" />
|
|
435
|
+
</Box>
|
|
436
|
+
</Paper>
|
|
437
|
+
|
|
438
|
+
{/* Contact Form */}
|
|
439
|
+
<Paper sx={{ p: 4, mb: 4 }}>
|
|
440
|
+
<Typography variant="h3" gutterBottom>Get In Touch</Typography>
|
|
441
|
+
<Typography variant="body1" sx={{ mb: 4, opacity: 0.8 }}>
|
|
442
|
+
Have questions? We'd love to hear from you.
|
|
443
|
+
</Typography>
|
|
444
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3, maxWidth: 600 }}>
|
|
445
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 3 }}>
|
|
446
|
+
<TextInputField dataSource="textInputFields.basic-text" />
|
|
447
|
+
<TextInputField dataSource="textInputFields.email-field" />
|
|
448
|
+
</Box>
|
|
449
|
+
<TextInputField dataSource="textInputFields.phone-field" />
|
|
450
|
+
<TextInputField dataSource="textInputFields.large-textarea" />
|
|
451
|
+
</Box>
|
|
452
|
+
</Paper>
|
|
453
|
+
|
|
454
|
+
{/* Search Interface */}
|
|
455
|
+
<Paper sx={{ p: 4 }}>
|
|
456
|
+
<Typography variant="h3" gutterBottom>Search & Discovery</Typography>
|
|
457
|
+
<Typography variant="body1" sx={{ mb: 4, opacity: 0.8 }}>
|
|
458
|
+
Find exactly what you need with our powerful search
|
|
459
|
+
</Typography>
|
|
460
|
+
<Box sx={{ maxWidth: 500 }}>
|
|
461
|
+
<TextInputField dataSource="textInputFields.search-field" />
|
|
462
|
+
</Box>
|
|
463
|
+
</Paper>
|
|
464
|
+
|
|
465
|
+
</Box>
|
|
466
|
+
</QwickApp>
|
|
467
|
+
),
|
|
468
|
+
parameters: {
|
|
469
|
+
docs: {
|
|
470
|
+
description: {
|
|
471
|
+
story: 'Real-world example showing TextInputField in various contexts: registration forms, contact forms, and search interfaces.',
|
|
472
|
+
},
|
|
473
|
+
},
|
|
474
|
+
},
|
|
475
|
+
};
|
|
476
|
+
|
|
477
|
+
export const FieldStatesShowcase: Story = {
|
|
478
|
+
render: () => (
|
|
479
|
+
<QwickApp appId="text-input-showcase" appName='TextInputField States Showcase' dataSource={{ dataProvider }}>
|
|
480
|
+
<Box>
|
|
481
|
+
|
|
482
|
+
<Box sx={{ p: 4, backgroundColor: 'background.paper' }}>
|
|
483
|
+
<Typography variant="h5" gutterBottom>🔄 State Management</Typography>
|
|
484
|
+
<Typography variant="body1" sx={{ mb: 3, opacity: 0.8 }}>
|
|
485
|
+
TextInputField handles various states including error, disabled, and different field types gracefully.
|
|
486
|
+
</Typography>
|
|
487
|
+
</Box>
|
|
488
|
+
|
|
489
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))', gap: 4 }}>
|
|
490
|
+
<Box>
|
|
491
|
+
<Typography variant="h6" gutterBottom>Normal State</Typography>
|
|
492
|
+
<TextInputField dataSource="textInputFields.basic-text" />
|
|
493
|
+
</Box>
|
|
494
|
+
<Box>
|
|
495
|
+
<Typography variant="h6" gutterBottom>Error State</Typography>
|
|
496
|
+
<TextInputField dataSource="textInputFields.error-field" />
|
|
497
|
+
</Box>
|
|
498
|
+
<Box>
|
|
499
|
+
<Typography variant="h6" gutterBottom>Disabled State</Typography>
|
|
500
|
+
<TextInputField dataSource="textInputFields.disabled-field" />
|
|
501
|
+
</Box>
|
|
502
|
+
<Box>
|
|
503
|
+
<Typography variant="h6" gutterBottom>Multiline Field</Typography>
|
|
504
|
+
<TextInputField dataSource="textInputFields.multiline-field" />
|
|
505
|
+
</Box>
|
|
506
|
+
<Box>
|
|
507
|
+
<Typography variant="h6" gutterBottom>Email Field</Typography>
|
|
508
|
+
<TextInputField dataSource="textInputFields.email-field" />
|
|
509
|
+
</Box>
|
|
510
|
+
<Box>
|
|
511
|
+
<Typography variant="h6" gutterBottom>Password Field</Typography>
|
|
512
|
+
<TextInputField dataSource="textInputFields.password-field" />
|
|
513
|
+
</Box>
|
|
514
|
+
</Box>
|
|
515
|
+
|
|
516
|
+
</Box>
|
|
517
|
+
</QwickApp>
|
|
518
|
+
),
|
|
519
|
+
parameters: {
|
|
520
|
+
docs: {
|
|
521
|
+
description: {
|
|
522
|
+
story: 'Comprehensive showcase of different TextInputField states and configurations.',
|
|
523
|
+
},
|
|
524
|
+
},
|
|
525
|
+
},
|
|
526
|
+
};
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ThemeSwitcher Component Stories
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
8
|
+
import ThemeSwitcher from '../components/buttons/ThemeSwitcher';
|
|
9
|
+
import PaletteSwitcher from '../components/buttons/PaletteSwitcher';
|
|
10
|
+
import AccessibilityChecker from '../components/AccessibilityChecker';
|
|
11
|
+
import { QwickApp } from '../index';
|
|
12
|
+
import { useTheme } from '../contexts/ThemeContext';
|
|
13
|
+
import { usePalette } from '../contexts/PaletteContext';
|
|
14
|
+
import { Box, Typography, Button, Card, CardContent } from '@mui/material';
|
|
15
|
+
|
|
16
|
+
const meta = {
|
|
17
|
+
title: 'Components/ThemeSwitcher',
|
|
18
|
+
component: ThemeSwitcher,
|
|
19
|
+
parameters: {
|
|
20
|
+
layout: 'centered',
|
|
21
|
+
docs: {
|
|
22
|
+
description: {
|
|
23
|
+
component: `ThemeSwitcher provides users with light, dark, and system theme mode options for optimal viewing experience.
|
|
24
|
+
|
|
25
|
+
**Key Features:**
|
|
26
|
+
- **Three Theme Modes**: Light, dark, and automatic system preference detection
|
|
27
|
+
- **System Integration**: Automatically follows OS theme changes when in system mode
|
|
28
|
+
- **Material-UI Integration**: Seamlessly integrates with Material-UI theme system
|
|
29
|
+
- **Context Management**: Works with ThemeContext for consistent state management
|
|
30
|
+
- **Instant Switching**: Smooth transitions between theme modes without page reload
|
|
31
|
+
- **Persistent Preference**: Remembers user selection across browser sessions
|
|
32
|
+
- **Accessibility Compliant**: Full ARIA support and keyboard navigation
|
|
33
|
+
|
|
34
|
+
**Perfect for:**
|
|
35
|
+
- User settings and preference panels
|
|
36
|
+
- Application headers and navigation bars
|
|
37
|
+
- Accessibility features and user comfort options
|
|
38
|
+
- Multi-theme applications requiring user choice
|
|
39
|
+
- Dashboard and admin panel customization
|
|
40
|
+
- Design system demonstrations and showcases`,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
tags: ['autodocs'],
|
|
45
|
+
} satisfies Meta<typeof ThemeSwitcher>;
|
|
46
|
+
|
|
47
|
+
export default meta;
|
|
48
|
+
type Story = StoryObj<typeof meta>;
|
|
49
|
+
|
|
50
|
+
// Component that uses the theme context
|
|
51
|
+
function ThemeDemo() {
|
|
52
|
+
const { currentTheme, actualThemeMode } = useTheme();
|
|
53
|
+
const { currentPalette } = usePalette();
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<Box sx={{ p: 3, maxWidth: 600, margin: '0 auto' }}>
|
|
57
|
+
<div style={{ marginBottom: '20px', textAlign: 'center' }}>
|
|
58
|
+
<Typography variant="h5" gutterBottom>
|
|
59
|
+
Try switching themes and palettes!
|
|
60
|
+
</Typography>
|
|
61
|
+
<Typography variant="body1" color="text.secondary" sx={{ mb: 2 }}>
|
|
62
|
+
Use the theme and palette switchers to see how different combinations affect the appearance.
|
|
63
|
+
</Typography>
|
|
64
|
+
<Box sx={{ display: 'flex', gap: 2, justifyContent: 'center', alignItems: 'center' }}>
|
|
65
|
+
<ThemeSwitcher />
|
|
66
|
+
<PaletteSwitcher />
|
|
67
|
+
</Box>
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<Card sx={{ mt: 3 }}>
|
|
71
|
+
<CardContent>
|
|
72
|
+
<Typography variant="h6" gutterBottom>
|
|
73
|
+
Theme & Palette Demo Content
|
|
74
|
+
</Typography>
|
|
75
|
+
<Typography variant="body2" color="text.secondary" paragraph>
|
|
76
|
+
Current Theme: <strong>{currentTheme}</strong> → Actual: <strong>{actualThemeMode}</strong>
|
|
77
|
+
</Typography>
|
|
78
|
+
<Typography variant="body2" color="text.secondary" paragraph>
|
|
79
|
+
Current Palette: <strong>{currentPalette}</strong>
|
|
80
|
+
</Typography>
|
|
81
|
+
<Typography variant="body2" color="text.secondary" paragraph>
|
|
82
|
+
This content changes appearance based on both the selected theme mode and color palette,
|
|
83
|
+
demonstrating the full theming system integration with Material-UI.
|
|
84
|
+
</Typography>
|
|
85
|
+
|
|
86
|
+
{/* AccessibilityChecker Integration */}
|
|
87
|
+
<Box sx={{
|
|
88
|
+
p: 2,
|
|
89
|
+
backgroundColor: 'background.paper',
|
|
90
|
+
border: '1px solid',
|
|
91
|
+
borderColor: 'divider',
|
|
92
|
+
borderRadius: 1,
|
|
93
|
+
mb: 2
|
|
94
|
+
}}>
|
|
95
|
+
<Typography variant="subtitle2" gutterBottom>
|
|
96
|
+
🔍 Accessibility Monitoring
|
|
97
|
+
</Typography>
|
|
98
|
+
<Typography variant="caption" color="text.secondary" paragraph>
|
|
99
|
+
The AccessibilityChecker automatically monitors color contrast and accessibility compliance as you switch themes and palettes.
|
|
100
|
+
</Typography>
|
|
101
|
+
<AccessibilityChecker />
|
|
102
|
+
</Box>
|
|
103
|
+
|
|
104
|
+
<Box sx={{
|
|
105
|
+
display: 'flex',
|
|
106
|
+
gap: 2,
|
|
107
|
+
flexWrap: 'wrap',
|
|
108
|
+
justifyContent: 'center',
|
|
109
|
+
mb: 3
|
|
110
|
+
}}>
|
|
111
|
+
<Button variant="contained" color="primary">
|
|
112
|
+
Primary Button
|
|
113
|
+
</Button>
|
|
114
|
+
<Button variant="outlined" color="secondary">
|
|
115
|
+
Secondary Button
|
|
116
|
+
</Button>
|
|
117
|
+
<Button variant="text">
|
|
118
|
+
Text Button
|
|
119
|
+
</Button>
|
|
120
|
+
</Box>
|
|
121
|
+
|
|
122
|
+
<Box sx={{
|
|
123
|
+
display: 'grid',
|
|
124
|
+
gridTemplateColumns: 'repeat(auto-fit, minmax(120px, 1fr))',
|
|
125
|
+
gap: 2,
|
|
126
|
+
mt: 2
|
|
127
|
+
}}>
|
|
128
|
+
{[
|
|
129
|
+
{ name: 'Primary', color: 'primary.main' },
|
|
130
|
+
{ name: 'Secondary', color: 'secondary.main' },
|
|
131
|
+
{ name: 'Background', color: 'background.default' },
|
|
132
|
+
{ name: 'Surface', color: 'background.paper' },
|
|
133
|
+
].map(({ name, color }) => (
|
|
134
|
+
<Box key={name} sx={{ textAlign: 'center' }}>
|
|
135
|
+
<Box sx={{
|
|
136
|
+
width: '100%',
|
|
137
|
+
height: 40,
|
|
138
|
+
backgroundColor: color,
|
|
139
|
+
border: color.includes('background') ? '1px solid' : 'none',
|
|
140
|
+
borderColor: 'divider',
|
|
141
|
+
borderRadius: 1,
|
|
142
|
+
mb: 1
|
|
143
|
+
}} />
|
|
144
|
+
<Typography variant="caption" color="text.secondary">
|
|
145
|
+
{name}
|
|
146
|
+
</Typography>
|
|
147
|
+
</Box>
|
|
148
|
+
))}
|
|
149
|
+
</Box>
|
|
150
|
+
</CardContent>
|
|
151
|
+
</Card>
|
|
152
|
+
</Box>
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Default story - Interactive Theme Demo
|
|
157
|
+
export const Default: Story = {
|
|
158
|
+
render: () => (
|
|
159
|
+
<QwickApp appId="com.qwickapps.storybook" appName="QwickApps Storybook">
|
|
160
|
+
<ThemeDemo />
|
|
161
|
+
</QwickApp>
|
|
162
|
+
),
|
|
163
|
+
parameters: {
|
|
164
|
+
docs: {
|
|
165
|
+
description: {
|
|
166
|
+
story: 'Interactive theme and palette switcher demo showing how different theme modes and color palettes work together. Switch between light/dark/system modes and try different color palettes to see the full theming system in action.',
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
};
|