@qwickapps/react-framework 1.4.9 → 1.5.1
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/README.md +23 -0
- package/dist/__tests__/schemas/transformers/MockSerializableComponent.d.ts +9 -9
- package/dist/__tests__/schemas/transformers/MockSerializableComponent.d.ts.map +1 -1
- package/dist/components/AccessibilityProvider.d.ts +1 -1
- package/dist/components/AccessibilityProvider.d.ts.map +1 -1
- package/dist/components/ErrorBoundary.d.ts +1 -1
- package/dist/components/Html.d.ts +8 -8
- package/dist/components/Html.d.ts.map +1 -1
- package/dist/components/Logo.d.ts +2 -2
- package/dist/components/Logo.d.ts.map +1 -1
- package/dist/components/Markdown.d.ts +5 -5
- package/dist/components/Markdown.d.ts.map +1 -1
- package/dist/components/ProductLogo.d.ts +60 -0
- package/dist/components/ProductLogo.d.ts.map +1 -0
- package/dist/components/QwickAppsLogo.d.ts +1 -1
- package/dist/components/QwickAppsLogo.d.ts.map +1 -1
- package/dist/components/ResponsiveMenu.d.ts.map +1 -1
- package/dist/components/SafeSpan.d.ts +4 -4
- package/dist/components/SafeSpan.d.ts.map +1 -1
- package/dist/components/Scaffold.d.ts.map +1 -1
- package/dist/components/base/Container.d.ts +3 -2
- package/dist/components/base/Container.d.ts.map +1 -1
- package/dist/components/base/ModelView.d.ts +16 -16
- package/dist/components/base/ModelView.d.ts.map +1 -1
- package/dist/components/base/index.d.ts +1 -1
- package/dist/components/base/index.d.ts.map +1 -1
- package/dist/components/blocks/Article.d.ts +4 -18
- package/dist/components/blocks/Article.d.ts.map +1 -1
- package/dist/components/blocks/CardListGrid.d.ts +3 -3
- package/dist/components/blocks/CardListGrid.d.ts.map +1 -1
- package/dist/components/blocks/Code.d.ts +5 -31
- package/dist/components/blocks/Code.d.ts.map +1 -1
- package/dist/components/blocks/Content.d.ts +2 -17
- package/dist/components/blocks/Content.d.ts.map +1 -1
- package/dist/components/blocks/CoverImageHeader.d.ts +2 -12
- package/dist/components/blocks/CoverImageHeader.d.ts.map +1 -1
- package/dist/components/blocks/FeatureCard.d.ts +0 -17
- package/dist/components/blocks/FeatureCard.d.ts.map +1 -1
- package/dist/components/blocks/FeatureGrid.d.ts.map +1 -1
- package/dist/components/blocks/Footer.d.ts +2 -14
- package/dist/components/blocks/Footer.d.ts.map +1 -1
- package/dist/components/blocks/HeroBlock.d.ts +35 -26
- package/dist/components/blocks/HeroBlock.d.ts.map +1 -1
- package/dist/components/blocks/Image.d.ts +23 -23
- package/dist/components/blocks/Image.d.ts.map +1 -1
- package/dist/components/blocks/PageBannerHeader.d.ts +2 -13
- package/dist/components/blocks/PageBannerHeader.d.ts.map +1 -1
- package/dist/components/blocks/ProductCard.d.ts +0 -9
- package/dist/components/blocks/ProductCard.d.ts.map +1 -1
- package/dist/components/blocks/Section.d.ts +16 -24
- package/dist/components/blocks/Section.d.ts.map +1 -1
- package/dist/components/blocks/Text.d.ts +5 -20
- package/dist/components/blocks/Text.d.ts.map +1 -1
- package/dist/components/buttons/Button.d.ts +19 -23
- package/dist/components/buttons/Button.d.ts.map +1 -1
- package/dist/components/buttons/PaletteSwitcher.d.ts +2 -2
- package/dist/components/buttons/PaletteSwitcher.d.ts.map +1 -1
- package/dist/components/buttons/ThemeSwitcher.d.ts +2 -2
- package/dist/components/buttons/ThemeSwitcher.d.ts.map +1 -1
- package/dist/components/dialogs/Dialog.d.ts +35 -0
- package/dist/components/dialogs/Dialog.d.ts.map +1 -0
- package/dist/components/dialogs/index.d.ts +8 -0
- package/dist/components/dialogs/index.d.ts.map +1 -0
- package/dist/components/forms/Captcha.d.ts +55 -0
- package/dist/components/forms/Captcha.d.ts.map +1 -0
- package/dist/components/forms/FormBlock.d.ts +6 -6
- package/dist/components/forms/FormBlock.d.ts.map +1 -1
- package/dist/components/forms/FormCheckbox.d.ts +27 -0
- package/dist/components/forms/FormCheckbox.d.ts.map +1 -0
- package/dist/components/forms/FormField.d.ts +43 -0
- package/dist/components/forms/FormField.d.ts.map +1 -0
- package/dist/components/forms/FormSelect.d.ts +35 -0
- package/dist/components/forms/FormSelect.d.ts.map +1 -0
- package/dist/components/forms/index.d.ts +8 -0
- package/dist/components/forms/index.d.ts.map +1 -1
- package/dist/components/index.d.ts +10 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/input/ChoiceInputField.d.ts +13 -19
- package/dist/components/input/ChoiceInputField.d.ts.map +1 -1
- package/dist/components/input/HtmlInputField.d.ts +16 -17
- package/dist/components/input/HtmlInputField.d.ts.map +1 -1
- package/dist/components/input/SelectInputField.d.ts +14 -17
- package/dist/components/input/SelectInputField.d.ts.map +1 -1
- package/dist/components/input/SwitchInputField.d.ts +11 -18
- package/dist/components/input/SwitchInputField.d.ts.map +1 -1
- package/dist/components/input/TextInputField.d.ts +16 -19
- package/dist/components/input/TextInputField.d.ts.map +1 -1
- package/dist/components/layout/CollapsibleLayout/CollapsibleLayout.d.ts.map +1 -1
- package/dist/components/layout/GridCell.d.ts +18 -19
- package/dist/components/layout/GridCell.d.ts.map +1 -1
- package/dist/components/layout/GridLayout.d.ts +36 -25
- package/dist/components/layout/GridLayout.d.ts.map +1 -1
- package/dist/components/menu/MenuItem.d.ts +2 -2
- package/dist/components/menu/MenuItem.d.ts.map +1 -1
- package/dist/components/pages/FormPage.d.ts.map +1 -1
- package/dist/components/pages/Page.d.ts +1 -1
- package/dist/components/pages/Page.d.ts.map +1 -1
- package/dist/components/shared/createSerializableView.d.ts +22 -10
- package/dist/components/shared/createSerializableView.d.ts.map +1 -1
- package/dist/components/shared/viewProps.d.ts +3 -3
- package/dist/components/shared/viewProps.d.ts.map +1 -1
- package/dist/config/AppConfig.d.ts +2 -2
- package/dist/config/AppConfig.d.ts.map +1 -1
- package/dist/config/types.d.ts +1 -1
- package/dist/config/types.d.ts.map +1 -1
- package/dist/contexts/DataContext.d.ts +3 -3
- package/dist/contexts/DataContext.d.ts.map +1 -1
- package/dist/contexts/PaletteContext.d.ts.map +1 -1
- package/dist/contexts/ThemeContext.d.ts.map +1 -1
- package/dist/hooks/useDataBinding.d.ts +2 -2
- package/dist/hooks/useDataBinding.d.ts.map +1 -1
- package/dist/hooks/usePrintMode.d.ts +2 -2
- package/dist/hooks/usePrintMode.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +4143 -2318
- package/dist/index.js +4169 -2315
- package/dist/palettes/manifest.json +90 -0
- package/dist/palettes/palette-autumn.1.4.9.min.css +1 -0
- package/dist/palettes/palette-autumn.1.5.0.css +172 -0
- package/dist/palettes/palette-autumn.1.5.0.min.css +1 -0
- package/dist/palettes/palette-autumn.1.5.1.css +172 -0
- package/dist/palettes/palette-autumn.1.5.1.min.css +1 -0
- package/dist/palettes/palette-autumn.latest.css +172 -0
- package/dist/palettes/palette-autumn.latest.min.css +1 -0
- package/dist/palettes/palette-cosmic.1.4.9.min.css +1 -0
- package/dist/palettes/palette-cosmic.1.5.0.css +172 -0
- package/dist/palettes/palette-cosmic.1.5.0.min.css +1 -0
- package/dist/palettes/palette-cosmic.1.5.1.css +172 -0
- package/dist/palettes/palette-cosmic.1.5.1.min.css +1 -0
- package/dist/palettes/palette-cosmic.latest.css +172 -0
- package/dist/palettes/palette-cosmic.latest.min.css +1 -0
- package/dist/palettes/palette-default.1.4.9.min.css +1 -0
- package/dist/palettes/palette-default.1.5.0.css +178 -0
- package/dist/palettes/palette-default.1.5.0.min.css +1 -0
- package/dist/palettes/palette-default.1.5.1.css +178 -0
- package/dist/palettes/palette-default.1.5.1.min.css +1 -0
- package/dist/palettes/palette-default.latest.css +178 -0
- package/dist/palettes/palette-default.latest.min.css +1 -0
- package/dist/palettes/palette-ocean.1.4.9.min.css +1 -0
- package/dist/palettes/palette-ocean.1.5.0.css +172 -0
- package/dist/palettes/palette-ocean.1.5.0.min.css +1 -0
- package/dist/palettes/palette-ocean.1.5.1.css +172 -0
- package/dist/palettes/palette-ocean.1.5.1.min.css +1 -0
- package/dist/palettes/palette-ocean.latest.css +172 -0
- package/dist/palettes/palette-ocean.latest.min.css +1 -0
- package/dist/palettes/palette-spring.1.4.9.min.css +1 -0
- package/dist/palettes/palette-spring.1.5.0.css +160 -0
- package/dist/palettes/palette-spring.1.5.0.min.css +1 -0
- package/dist/palettes/palette-spring.1.5.1.css +160 -0
- package/dist/palettes/palette-spring.1.5.1.min.css +1 -0
- package/dist/palettes/palette-spring.latest.css +160 -0
- package/dist/palettes/palette-spring.latest.min.css +1 -0
- package/dist/palettes/palette-winter.1.4.9.min.css +1 -0
- package/dist/palettes/palette-winter.1.5.0.css +172 -0
- package/dist/palettes/palette-winter.1.5.0.min.css +1 -0
- package/dist/palettes/palette-winter.1.5.1.css +172 -0
- package/dist/palettes/palette-winter.1.5.1.min.css +1 -0
- package/dist/palettes/palette-winter.latest.css +172 -0
- package/dist/palettes/palette-winter.latest.min.css +1 -0
- package/dist/schemas/ButtonSchema.d.ts +5 -2
- package/dist/schemas/ButtonSchema.d.ts.map +1 -1
- package/dist/schemas/CardListGridSchema.d.ts +4 -4
- package/dist/schemas/CardListGridSchema.d.ts.map +1 -1
- package/dist/schemas/ChoiceInputFieldSchema.d.ts +2 -2
- package/dist/schemas/ChoiceInputFieldSchema.d.ts.map +1 -1
- package/dist/schemas/CodeSchema.d.ts +1 -2
- package/dist/schemas/CodeSchema.d.ts.map +1 -1
- package/dist/schemas/FormBlockSchema.d.ts +2 -2
- package/dist/schemas/FormBlockSchema.d.ts.map +1 -1
- package/dist/schemas/GridCellSchema.d.ts +2 -4
- package/dist/schemas/GridCellSchema.d.ts.map +1 -1
- package/dist/schemas/GridLayoutSchema.d.ts +3 -5
- package/dist/schemas/GridLayoutSchema.d.ts.map +1 -1
- package/dist/schemas/HeroBlockSchema.d.ts +2 -2
- package/dist/schemas/HeroBlockSchema.d.ts.map +1 -1
- package/dist/schemas/HtmlInputFieldSchema.d.ts +2 -2
- package/dist/schemas/HtmlInputFieldSchema.d.ts.map +1 -1
- package/dist/schemas/ImageSchema.d.ts +2 -2
- package/dist/schemas/ImageSchema.d.ts.map +1 -1
- package/dist/schemas/SectionSchema.d.ts +2 -4
- package/dist/schemas/SectionSchema.d.ts.map +1 -1
- package/dist/schemas/SelectInputFieldSchema.d.ts +2 -2
- package/dist/schemas/SelectInputFieldSchema.d.ts.map +1 -1
- package/dist/schemas/SwitchInputFieldSchema.d.ts +2 -2
- package/dist/schemas/SwitchInputFieldSchema.d.ts.map +1 -1
- package/dist/schemas/TextInputFieldSchema.d.ts +2 -2
- package/dist/schemas/TextInputFieldSchema.d.ts.map +1 -1
- package/dist/schemas/ViewSchema.d.ts +8 -7
- package/dist/schemas/ViewSchema.d.ts.map +1 -1
- package/dist/schemas/transformers/ComponentTransformer.d.ts +2 -2
- package/dist/schemas/transformers/ComponentTransformer.d.ts.map +1 -1
- package/dist/schemas/transformers/ReactNodeTransformer.d.ts +2 -2
- package/dist/schemas/transformers/ReactNodeTransformer.d.ts.map +1 -1
- package/dist/schemas/transformers/registry.d.ts +0 -7
- package/dist/schemas/transformers/registry.d.ts.map +1 -1
- package/dist/schemas/types/Serializable.d.ts +3 -3
- package/dist/schemas/types/Serializable.d.ts.map +1 -1
- package/dist/stories/_templates/SerializationTemplate.d.ts.map +1 -0
- package/dist/types/CollapsibleLayout.d.ts +3 -3
- package/dist/types/CollapsibleLayout.d.ts.map +1 -1
- package/dist/types/ContentProxy.d.ts +4 -4
- package/dist/types/ContentProxy.d.ts.map +1 -1
- package/dist/types/DataTypes.d.ts +4 -4
- package/dist/types/DataTypes.d.ts.map +1 -1
- package/dist/types/TemplateProvider.d.ts +1 -1
- package/dist/types/TemplateProvider.d.ts.map +1 -1
- package/dist/types/TemplateResolver.d.ts +1 -1
- package/dist/types/TemplateResolver.d.ts.map +1 -1
- package/dist/utils/htmlTransform.d.ts +1 -1
- package/dist/utils/htmlTransform.d.ts.map +1 -1
- package/dist/utils/iconMap.d.ts +48 -0
- package/dist/utils/iconMap.d.ts.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/logger.d.ts +11 -7
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/paletteLoader.d.ts +34 -0
- package/dist/utils/paletteLoader.d.ts.map +1 -0
- package/dist/utils/paletteManifest.d.ts +51 -0
- package/dist/utils/paletteManifest.d.ts.map +1 -0
- package/dist/utils/paletteUtils.d.ts.map +1 -1
- package/dist/utils/reactUtils.d.ts +12 -6
- package/dist/utils/reactUtils.d.ts.map +1 -1
- package/dist/utils/spacing.d.ts +2 -2
- package/dist/utils/spacing.d.ts.map +1 -1
- package/dist/utils/themePerformanceMonitor.d.ts.map +1 -1
- package/dist/utils/themeUtils.d.ts.map +1 -1
- package/package.json +20 -9
- package/scripts/build-palettes.cjs +120 -0
- package/src/__tests__/components/Article.test.tsx +1 -1
- package/src/__tests__/components/Breadcrumbs.test.tsx +2 -2
- package/src/__tests__/components/Button.test.tsx +3 -3
- package/src/__tests__/components/CardListGrid.test.tsx +5 -5
- package/src/__tests__/components/ChoiceInputField.test.tsx +2 -2
- package/src/__tests__/components/Code.test.tsx +2 -2
- package/src/__tests__/components/Content.integration.test.tsx +1 -1
- package/src/__tests__/components/Content.test.tsx +5 -5
- package/src/__tests__/components/CoverImageHeader.test.tsx +3 -3
- package/src/__tests__/components/FeatureCard.integration.test.tsx +1 -1
- package/src/__tests__/components/FeatureGrid.integration.test.tsx +1 -1
- package/src/__tests__/components/FeatureGrid.test.tsx +3 -3
- package/src/__tests__/components/Footer.test.tsx +3 -3
- package/src/__tests__/components/FormBlock.test.tsx +2 -2
- package/src/__tests__/components/HeroBlock.integration.test.tsx +1 -1
- package/src/__tests__/components/HeroBlock.test.tsx +4 -4
- package/src/__tests__/components/HtmlInputField.test.tsx +8 -8
- package/src/__tests__/components/PageBannerHeader.test.tsx +7 -7
- package/src/__tests__/components/PaletteSwitcher.test.tsx +3 -3
- package/src/__tests__/components/ProductCard.test.tsx +1 -1
- package/src/__tests__/components/Section.integration.test.tsx +1 -1
- package/src/__tests__/components/Section.test.tsx +1 -1
- package/src/__tests__/components/SelectInputField.test.tsx +2 -2
- package/src/__tests__/components/TextInputField.test.tsx +4 -4
- package/src/__tests__/components/ThemeSwitcher.test.tsx +3 -3
- package/src/__tests__/components/base/Container.test.tsx +22 -21
- package/src/__tests__/components/blocks/Code.performance.test.tsx +10 -10
- package/src/__tests__/components/blocks/Code.serialization.test.tsx +9 -9
- package/src/__tests__/components/blocks/HeroBlock.serialization.test.tsx +2 -3
- package/src/__tests__/components/blocks/Image.serialization.test.tsx +8 -7
- package/src/__tests__/components/blocks/Section.serialization.test.tsx +8 -8
- package/src/__tests__/components/blocks/Text.performance.test.tsx +5 -5
- package/src/__tests__/components/blocks/Text.serialization.test.tsx +9 -9
- package/src/__tests__/components/buttons/Button.serialization.test.tsx +4 -4
- package/src/__tests__/components/input/FormComponents.serialization.test.tsx +9 -9
- package/src/__tests__/components/input/SelectInputField.serialization.test.tsx +16 -18
- package/src/__tests__/components/input/TextInputField.serialization.test.tsx +9 -9
- package/src/__tests__/components/layout/CollapsibleLayout.test.tsx +5 -9
- package/src/__tests__/components/layout/GridCell.serialization.test.tsx +5 -5
- package/src/__tests__/components/layout/GridLayout.serialization.test.tsx +5 -5
- package/src/__tests__/hooks/usePrintMode.test.ts +1 -0
- package/src/__tests__/schemas/builders.test.ts +2 -2
- package/src/__tests__/schemas/transformers/ComponentSerializationPatterns.test.tsx +28 -28
- package/src/__tests__/schemas/transformers/ComponentTransformer.htmlPatterns.test.ts +5 -5
- package/src/__tests__/schemas/transformers/ComponentTransformer.test.ts +11 -11
- package/src/__tests__/schemas/transformers/CrossBrowserCompatibility.test.ts +10 -10
- package/src/__tests__/schemas/transformers/MockSerializableComponent.ts +15 -15
- package/src/__tests__/schemas/transformers/RealWorldScenarios.test.tsx +19 -19
- package/src/__tests__/schemas/transformers/SerializationErrorHandling.test.ts +15 -15
- package/src/__tests__/schemas/transformers/SerializationIntegration.test.tsx +19 -21
- package/src/__tests__/schemas/transformers/SerializationPerformance.test.ts +15 -15
- package/src/__tests__/schemas/transformers/TestAutomation.test.ts +3 -3
- package/src/__tests__/schemas/transformers/nested-serialization.test.tsx +1 -1
- package/src/__tests__/schemas/transformers/round-trip-component-serialization.test.tsx +10 -10
- package/src/__tests__/utils/optional-logging.test.ts +3 -3
- package/src/components/AccessibilityProvider.tsx +4 -2
- package/src/components/ErrorBoundary.tsx +1 -1
- package/src/components/Html.tsx +13 -16
- package/src/components/Logo.tsx +42 -29
- package/src/components/Markdown.tsx +9 -9
- package/src/components/ProductLogo.tsx +118 -0
- package/src/components/QwickApp.css +37 -1060
- package/src/components/QwickApp.tsx +1 -1
- package/src/components/QwickAppsLogo.tsx +1 -1
- package/src/components/ResponsiveMenu.tsx +1 -1
- package/src/components/SafeSpan.tsx +8 -8
- package/src/components/Scaffold.css +11 -1
- package/src/components/Scaffold.tsx +55 -25
- package/src/components/base/Container.tsx +2 -2
- package/src/components/base/ModelView.tsx +28 -27
- package/src/components/base/index.ts +1 -1
- package/src/components/blocks/Article.tsx +213 -69
- package/src/components/blocks/CardListGrid.tsx +18 -14
- package/src/components/blocks/Code.tsx +18 -13
- package/src/components/blocks/Content.tsx +15 -10
- package/src/components/blocks/CoverImageHeader.tsx +14 -9
- package/src/components/blocks/FeatureCard.tsx +16 -11
- package/src/components/blocks/FeatureGrid.tsx +13 -8
- package/src/components/blocks/Footer.tsx +25 -16
- package/src/components/blocks/HeroBlock.tsx +12 -13
- package/src/components/blocks/Image.tsx +16 -8
- package/src/components/blocks/PageBannerHeader.tsx +15 -11
- package/src/components/blocks/ProductCard.tsx +32 -25
- package/src/components/blocks/Section.tsx +21 -13
- package/src/components/blocks/Text.tsx +26 -11
- package/src/components/buttons/Button.tsx +22 -118
- package/src/components/buttons/PaletteSwitcher.tsx +11 -8
- package/src/components/buttons/ThemeSwitcher.tsx +20 -16
- package/src/components/dialogs/Dialog.tsx +126 -0
- package/src/components/dialogs/index.ts +15 -0
- package/src/components/forms/Captcha.tsx +291 -0
- package/src/components/forms/FormBlock.tsx +22 -15
- package/src/components/forms/FormCheckbox.tsx +116 -0
- package/src/components/forms/FormField.tsx +180 -0
- package/src/components/forms/FormSelect.tsx +140 -0
- package/src/components/forms/index.ts +13 -1
- package/src/components/index.ts +13 -2
- package/src/components/input/ChoiceInputField.tsx +1 -2
- package/src/components/input/HtmlInputField.tsx +2 -3
- package/src/components/input/SelectInputField.tsx +31 -5
- package/src/components/input/SwitchInputField.tsx +3 -4
- package/src/components/input/TextField.tsx +2 -2
- package/src/components/input/TextInputField.tsx +32 -6
- package/src/components/layout/CollapsibleLayout/CollapsibleLayout.tsx +13 -13
- package/src/components/layout/GridCell.tsx +10 -9
- package/src/components/layout/GridCellWrapper.tsx +1 -1
- package/src/components/layout/GridLayout.tsx +29 -32
- package/src/components/pages/FormPage.tsx +0 -1
- package/src/components/pages/Page.tsx +2 -2
- package/src/components/shared/createSerializableView.tsx +24 -23
- package/src/components/shared/viewProps.ts +11 -11
- package/src/config/AppConfig.ts +2 -2
- package/src/config/__tests__/AppConfig.test.ts +3 -3
- package/src/config/__tests__/AppConfigBuilder.test.ts +10 -11
- package/src/config/types.ts +1 -1
- package/src/contexts/DataContext.tsx +58 -52
- package/src/contexts/PaletteContext.tsx +22 -9
- package/src/contexts/PrintModeContext.tsx +4 -4
- package/src/contexts/ThemeContext.tsx +2 -1
- package/src/hooks/useBaseProps.ts +10 -10
- package/src/hooks/useDataBinding.ts +15 -18
- package/src/hooks/usePrintMode.ts +3 -3
- package/src/index.ts +2 -0
- package/src/palettes/manifest.json +72 -0
- package/src/palettes/manifest.schema.json +74 -0
- package/src/schemas/CardListGridSchema.ts +3 -3
- package/src/schemas/CodeSchema.ts +0 -1
- package/src/schemas/FeatureGridSchema.ts +1 -1
- package/src/schemas/FormBlockSchema.ts +1 -1
- package/src/schemas/GridCellSchema.ts +0 -1
- package/src/schemas/GridLayoutSchema.ts +0 -1
- package/src/schemas/SectionSchema.ts +0 -1
- package/src/schemas/ViewSchema.ts +6 -6
- package/src/schemas/transformers/ComponentTransformer.ts +37 -20
- package/src/schemas/transformers/ReactNodeTransformer.ts +18 -16
- package/src/schemas/transformers/registry.ts +28 -24
- package/src/schemas/types/Serializable.ts +3 -3
- package/src/setupTests.js +9 -0
- package/src/stories/AccessibilityProvider.stories.tsx +0 -1
- package/src/stories/CardListGrid.stories.tsx +1 -1
- package/src/stories/Code.stories.tsx +2 -3
- package/src/stories/CollapsibleLayout.stories.tsx +41 -37
- package/src/stories/Container.stories.tsx +1 -2
- package/src/stories/DataBinding.advanced.stories.tsx +15 -9
- package/src/stories/DataProvider.stories.tsx +33 -16
- package/src/stories/ErrorBoundary.stories.tsx +28 -26
- package/src/stories/FeatureGrid.stories.tsx +0 -1
- package/src/stories/FormBlock.stories.tsx +8 -8
- package/src/stories/FormComponents.stories.tsx +15 -11
- package/src/stories/GridCell.stories.tsx +5 -5
- package/src/stories/GridLayout.stories.tsx +5 -5
- package/src/stories/Image.stories.tsx +5 -7
- package/src/stories/Introduction.stories.tsx +0 -1
- package/src/stories/ModelView.stories.tsx +7 -7
- package/src/stories/SafeSpan.stories.tsx +7 -3
- package/src/stories/Section.stories.tsx +2 -2
- package/src/stories/Text.stories.tsx +1 -3
- package/src/stories/_templates/SerializationTemplate.tsx +0 -1
- package/src/templates/TemplateResolver.ts +2 -2
- package/src/types/CollapsibleLayout.ts +2 -2
- package/src/types/ContentProxy.ts +6 -6
- package/src/types/DataTypes.ts +4 -4
- package/src/types/TemplateProvider.ts +1 -1
- package/src/types/TemplateResolver.ts +1 -1
- package/src/utils/htmlTransform.tsx +17 -11
- package/src/utils/iconMap.tsx +244 -0
- package/src/utils/index.ts +4 -1
- package/src/utils/logger.ts +20 -14
- package/src/utils/paletteLoader.ts +218 -0
- package/src/utils/paletteManifest.ts +268 -0
- package/src/utils/paletteUtils.ts +19 -1
- package/src/utils/reactUtils.tsx +34 -33
- package/src/utils/spacing.ts +16 -17
- package/src/utils/themePerformanceMonitor.js +14 -6
- package/src/utils/themeUtils.ts +17 -2
- package/dist/components/base/ContainerView.d.ts +0 -65
- package/dist/components/base/ContainerView.d.ts.map +0 -1
- package/dist/components/blocks/Code-factory.d.ts +0 -22
- package/dist/components/blocks/Code-factory.d.ts.map +0 -1
- package/dist/components/blocks/Code-old.d.ts +0 -31
- package/dist/components/blocks/Code-old.d.ts.map +0 -1
- package/dist/qa/ConsoleWarningTest.d.ts +0 -5
- package/dist/qa/ConsoleWarningTest.d.ts.map +0 -1
- package/dist/qa/StorageKeyTest.d.ts +0 -6
- package/dist/qa/StorageKeyTest.d.ts.map +0 -1
- package/dist/qa/ThemeStorageKeyTest.d.ts +0 -6
- package/dist/qa/ThemeStorageKeyTest.d.ts.map +0 -1
- package/dist/schemas/ViewModelSchema.d.ts +0 -63
- package/dist/schemas/ViewModelSchema.d.ts.map +0 -1
- package/dist/schemas/transformers/__tests__/MockSerializableComponent.d.ts +0 -66
- package/dist/schemas/transformers/__tests__/MockSerializableComponent.d.ts.map +0 -1
- package/dist/src/__tests__/schemas/transformers/MockSerializableComponent.d.ts +0 -66
- package/dist/src/__tests__/schemas/transformers/MockSerializableComponent.d.ts.map +0 -1
- package/dist/src/components/AccessibilityChecker.d.ts +0 -12
- package/dist/src/components/AccessibilityChecker.d.ts.map +0 -1
- package/dist/src/components/AccessibilityProvider.d.ts +0 -64
- package/dist/src/components/AccessibilityProvider.d.ts.map +0 -1
- package/dist/src/components/Breadcrumbs.d.ts +0 -39
- package/dist/src/components/Breadcrumbs.d.ts.map +0 -1
- package/dist/src/components/ErrorBoundary.d.ts +0 -46
- package/dist/src/components/ErrorBoundary.d.ts.map +0 -1
- package/dist/src/components/Html.d.ts +0 -58
- package/dist/src/components/Html.d.ts.map +0 -1
- package/dist/src/components/Logo.d.ts +0 -56
- package/dist/src/components/Logo.d.ts.map +0 -1
- package/dist/src/components/Markdown.d.ts +0 -51
- package/dist/src/components/Markdown.d.ts.map +0 -1
- package/dist/src/components/QwickApp.d.ts +0 -69
- package/dist/src/components/QwickApp.d.ts.map +0 -1
- package/dist/src/components/QwickAppsLogo.d.ts +0 -25
- package/dist/src/components/QwickAppsLogo.d.ts.map +0 -1
- package/dist/src/components/QwickIcon.d.ts +0 -23
- package/dist/src/components/QwickIcon.d.ts.map +0 -1
- package/dist/src/components/ResponsiveMenu.d.ts +0 -38
- package/dist/src/components/ResponsiveMenu.d.ts.map +0 -1
- package/dist/src/components/SafeSpan.d.ts +0 -29
- package/dist/src/components/SafeSpan.d.ts.map +0 -1
- package/dist/src/components/Scaffold.d.ts +0 -57
- package/dist/src/components/Scaffold.d.ts.map +0 -1
- package/dist/src/components/base/Container.d.ts +0 -33
- package/dist/src/components/base/Container.d.ts.map +0 -1
- package/dist/src/components/base/ModelView.d.ts +0 -92
- package/dist/src/components/base/ModelView.d.ts.map +0 -1
- package/dist/src/components/base/index.d.ts +0 -12
- package/dist/src/components/base/index.d.ts.map +0 -1
- package/dist/src/components/blocks/Article.d.ts +0 -32
- package/dist/src/components/blocks/Article.d.ts.map +0 -1
- package/dist/src/components/blocks/CardListGrid.d.ts +0 -23
- package/dist/src/components/blocks/CardListGrid.d.ts.map +0 -1
- package/dist/src/components/blocks/Code.d.ts +0 -37
- package/dist/src/components/blocks/Code.d.ts.map +0 -1
- package/dist/src/components/blocks/Content.d.ts +0 -24
- package/dist/src/components/blocks/Content.d.ts.map +0 -1
- package/dist/src/components/blocks/CoverImageHeader.d.ts +0 -44
- package/dist/src/components/blocks/CoverImageHeader.d.ts.map +0 -1
- package/dist/src/components/blocks/FeatureCard.d.ts +0 -66
- package/dist/src/components/blocks/FeatureCard.d.ts.map +0 -1
- package/dist/src/components/blocks/FeatureGrid.d.ts +0 -48
- package/dist/src/components/blocks/FeatureGrid.d.ts.map +0 -1
- package/dist/src/components/blocks/Footer.d.ts +0 -56
- package/dist/src/components/blocks/Footer.d.ts.map +0 -1
- package/dist/src/components/blocks/HeroBlock.d.ts +0 -55
- package/dist/src/components/blocks/HeroBlock.d.ts.map +0 -1
- package/dist/src/components/blocks/Image.d.ts +0 -40
- package/dist/src/components/blocks/Image.d.ts.map +0 -1
- package/dist/src/components/blocks/PageBannerHeader.d.ts +0 -30
- package/dist/src/components/blocks/PageBannerHeader.d.ts.map +0 -1
- package/dist/src/components/blocks/ProductCard.d.ts +0 -57
- package/dist/src/components/blocks/ProductCard.d.ts.map +0 -1
- package/dist/src/components/blocks/Section.d.ts +0 -45
- package/dist/src/components/blocks/Section.d.ts.map +0 -1
- package/dist/src/components/blocks/Text.d.ts +0 -34
- package/dist/src/components/blocks/Text.d.ts.map +0 -1
- package/dist/src/components/blocks/index.d.ts +0 -41
- package/dist/src/components/blocks/index.d.ts.map +0 -1
- package/dist/src/components/buttons/Button.d.ts +0 -57
- package/dist/src/components/buttons/Button.d.ts.map +0 -1
- package/dist/src/components/buttons/PaletteSwitcher.d.ts +0 -24
- package/dist/src/components/buttons/PaletteSwitcher.d.ts.map +0 -1
- package/dist/src/components/buttons/ThemeSwitcher.d.ts +0 -24
- package/dist/src/components/buttons/ThemeSwitcher.d.ts.map +0 -1
- package/dist/src/components/buttons/index.d.ts +0 -11
- package/dist/src/components/buttons/index.d.ts.map +0 -1
- package/dist/src/components/forms/FormBlock.d.ts +0 -51
- package/dist/src/components/forms/FormBlock.d.ts.map +0 -1
- package/dist/src/components/forms/index.d.ts +0 -8
- package/dist/src/components/forms/index.d.ts.map +0 -1
- package/dist/src/components/index.d.ts +0 -41
- package/dist/src/components/index.d.ts.map +0 -1
- package/dist/src/components/input/ChoiceInputField.d.ts +0 -29
- package/dist/src/components/input/ChoiceInputField.d.ts.map +0 -1
- package/dist/src/components/input/HtmlInputField.d.ts +0 -33
- package/dist/src/components/input/HtmlInputField.d.ts.map +0 -1
- package/dist/src/components/input/SelectInputField.d.ts +0 -31
- package/dist/src/components/input/SelectInputField.d.ts.map +0 -1
- package/dist/src/components/input/SwitchInputField.d.ts +0 -27
- package/dist/src/components/input/SwitchInputField.d.ts.map +0 -1
- package/dist/src/components/input/TextField.d.ts +0 -18
- package/dist/src/components/input/TextField.d.ts.map +0 -1
- package/dist/src/components/input/TextInputField.d.ts +0 -34
- package/dist/src/components/input/TextInputField.d.ts.map +0 -1
- package/dist/src/components/input/index.d.ts +0 -19
- package/dist/src/components/input/index.d.ts.map +0 -1
- package/dist/src/components/layout/CollapsibleLayout/CollapsibleLayout.d.ts +0 -34
- package/dist/src/components/layout/CollapsibleLayout/CollapsibleLayout.d.ts.map +0 -1
- package/dist/src/components/layout/CollapsibleLayout/index.d.ts +0 -9
- package/dist/src/components/layout/CollapsibleLayout/index.d.ts.map +0 -1
- package/dist/src/components/layout/GridCell.d.ts +0 -32
- package/dist/src/components/layout/GridCell.d.ts.map +0 -1
- package/dist/src/components/layout/GridCellWrapper.d.ts +0 -46
- package/dist/src/components/layout/GridCellWrapper.d.ts.map +0 -1
- package/dist/src/components/layout/GridLayout.d.ts +0 -50
- package/dist/src/components/layout/GridLayout.d.ts.map +0 -1
- package/dist/src/components/layout/index.d.ts +0 -14
- package/dist/src/components/layout/index.d.ts.map +0 -1
- package/dist/src/components/menu/Menu.d.ts +0 -1
- package/dist/src/components/menu/Menu.d.ts.map +0 -1
- package/dist/src/components/menu/MenuItem.d.ts +0 -31
- package/dist/src/components/menu/MenuItem.d.ts.map +0 -1
- package/dist/src/components/menu/index.d.ts +0 -7
- package/dist/src/components/menu/index.d.ts.map +0 -1
- package/dist/src/components/pages/FormPage.d.ts +0 -66
- package/dist/src/components/pages/FormPage.d.ts.map +0 -1
- package/dist/src/components/pages/Page.d.ts +0 -68
- package/dist/src/components/pages/Page.d.ts.map +0 -1
- package/dist/src/components/pages/index.d.ts +0 -10
- package/dist/src/components/pages/index.d.ts.map +0 -1
- package/dist/src/components/shared/createSerializableView.d.ts +0 -81
- package/dist/src/components/shared/createSerializableView.d.ts.map +0 -1
- package/dist/src/components/shared/viewProps.d.ts +0 -37
- package/dist/src/components/shared/viewProps.d.ts.map +0 -1
- package/dist/src/config/AppConfig.d.ts +0 -49
- package/dist/src/config/AppConfig.d.ts.map +0 -1
- package/dist/src/config/AppConfigBuilder.d.ts +0 -75
- package/dist/src/config/AppConfigBuilder.d.ts.map +0 -1
- package/dist/src/config/index.d.ts +0 -13
- package/dist/src/config/index.d.ts.map +0 -1
- package/dist/src/config/types.d.ts +0 -130
- package/dist/src/config/types.d.ts.map +0 -1
- package/dist/src/config.d.ts +0 -15
- package/dist/src/config.d.ts.map +0 -1
- package/dist/src/contexts/DataContext.d.ts +0 -139
- package/dist/src/contexts/DataContext.d.ts.map +0 -1
- package/dist/src/contexts/DimensionsContext.d.ts +0 -42
- package/dist/src/contexts/DimensionsContext.d.ts.map +0 -1
- package/dist/src/contexts/PaletteContext.d.ts +0 -53
- package/dist/src/contexts/PaletteContext.d.ts.map +0 -1
- package/dist/src/contexts/PrintModeContext.d.ts +0 -27
- package/dist/src/contexts/PrintModeContext.d.ts.map +0 -1
- package/dist/src/contexts/QwickAppContext.d.ts +0 -71
- package/dist/src/contexts/QwickAppContext.d.ts.map +0 -1
- package/dist/src/contexts/ThemeContext.d.ts +0 -65
- package/dist/src/contexts/ThemeContext.d.ts.map +0 -1
- package/dist/src/contexts/index.d.ts +0 -11
- package/dist/src/contexts/index.d.ts.map +0 -1
- package/dist/src/hooks/index.d.ts +0 -12
- package/dist/src/hooks/index.d.ts.map +0 -1
- package/dist/src/hooks/useBaseProps.d.ts +0 -101
- package/dist/src/hooks/useBaseProps.d.ts.map +0 -1
- package/dist/src/hooks/useDataBinding.d.ts +0 -22
- package/dist/src/hooks/useDataBinding.d.ts.map +0 -1
- package/dist/src/hooks/usePrintMode.d.ts +0 -39
- package/dist/src/hooks/usePrintMode.d.ts.map +0 -1
- package/dist/src/index.d.ts +0 -9
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/palettes/PaletteAutumn.d.ts +0 -10
- package/dist/src/palettes/PaletteAutumn.d.ts.map +0 -1
- package/dist/src/palettes/PaletteCosmic.d.ts +0 -10
- package/dist/src/palettes/PaletteCosmic.d.ts.map +0 -1
- package/dist/src/palettes/PaletteDefault.d.ts +0 -10
- package/dist/src/palettes/PaletteDefault.d.ts.map +0 -1
- package/dist/src/palettes/PaletteOcean.d.ts +0 -10
- package/dist/src/palettes/PaletteOcean.d.ts.map +0 -1
- package/dist/src/palettes/PaletteSpring.d.ts +0 -10
- package/dist/src/palettes/PaletteSpring.d.ts.map +0 -1
- package/dist/src/palettes/PaletteWinter.d.ts +0 -10
- package/dist/src/palettes/PaletteWinter.d.ts.map +0 -1
- package/dist/src/palettes/index.d.ts +0 -13
- package/dist/src/palettes/index.d.ts.map +0 -1
- package/dist/src/schemas/ActionSchema.d.ts +0 -21
- package/dist/src/schemas/ActionSchema.d.ts.map +0 -1
- package/dist/src/schemas/ArticleSchema.d.ts +0 -13
- package/dist/src/schemas/ArticleSchema.d.ts.map +0 -1
- package/dist/src/schemas/ButtonSchema.d.ts +0 -22
- package/dist/src/schemas/ButtonSchema.d.ts.map +0 -1
- package/dist/src/schemas/CardListGridSchema.d.ts +0 -17
- package/dist/src/schemas/CardListGridSchema.d.ts.map +0 -1
- package/dist/src/schemas/ChoiceInputFieldSchema.d.ts +0 -18
- package/dist/src/schemas/ChoiceInputFieldSchema.d.ts.map +0 -1
- package/dist/src/schemas/CodeSchema.d.ts +0 -18
- package/dist/src/schemas/CodeSchema.d.ts.map +0 -1
- package/dist/src/schemas/CollapsibleLayoutSchema.d.ts +0 -32
- package/dist/src/schemas/CollapsibleLayoutSchema.d.ts.map +0 -1
- package/dist/src/schemas/ContainerSchema.d.ts +0 -12
- package/dist/src/schemas/ContainerSchema.d.ts.map +0 -1
- package/dist/src/schemas/ContentSchema.d.ts +0 -21
- package/dist/src/schemas/ContentSchema.d.ts.map +0 -1
- package/dist/src/schemas/CoverImageHeaderSchema.d.ts +0 -28
- package/dist/src/schemas/CoverImageHeaderSchema.d.ts.map +0 -1
- package/dist/src/schemas/FeatureCardSchema.d.ts +0 -28
- package/dist/src/schemas/FeatureCardSchema.d.ts.map +0 -1
- package/dist/src/schemas/FeatureGridSchema.d.ts +0 -17
- package/dist/src/schemas/FeatureGridSchema.d.ts.map +0 -1
- package/dist/src/schemas/FeatureItemSchema.d.ts +0 -16
- package/dist/src/schemas/FeatureItemSchema.d.ts.map +0 -1
- package/dist/src/schemas/FooterItemSchema.d.ts +0 -15
- package/dist/src/schemas/FooterItemSchema.d.ts.map +0 -1
- package/dist/src/schemas/FooterSchema.d.ts +0 -20
- package/dist/src/schemas/FooterSchema.d.ts.map +0 -1
- package/dist/src/schemas/FooterSectionSchema.d.ts +0 -15
- package/dist/src/schemas/FooterSectionSchema.d.ts.map +0 -1
- package/dist/src/schemas/FormBlockSchema.d.ts +0 -19
- package/dist/src/schemas/FormBlockSchema.d.ts.map +0 -1
- package/dist/src/schemas/GridCellSchema.d.ts +0 -23
- package/dist/src/schemas/GridCellSchema.d.ts.map +0 -1
- package/dist/src/schemas/GridLayoutSchema.d.ts +0 -21
- package/dist/src/schemas/GridLayoutSchema.d.ts.map +0 -1
- package/dist/src/schemas/HeaderActionSchema.d.ts +0 -17
- package/dist/src/schemas/HeaderActionSchema.d.ts.map +0 -1
- package/dist/src/schemas/HeroBlockSchema.d.ts +0 -22
- package/dist/src/schemas/HeroBlockSchema.d.ts.map +0 -1
- package/dist/src/schemas/HtmlInputFieldSchema.d.ts +0 -18
- package/dist/src/schemas/HtmlInputFieldSchema.d.ts.map +0 -1
- package/dist/src/schemas/HtmlSchema.d.ts +0 -14
- package/dist/src/schemas/HtmlSchema.d.ts.map +0 -1
- package/dist/src/schemas/ImageSchema.d.ts +0 -32
- package/dist/src/schemas/ImageSchema.d.ts.map +0 -1
- package/dist/src/schemas/LogoSchema.d.ts +0 -35
- package/dist/src/schemas/LogoSchema.d.ts.map +0 -1
- package/dist/src/schemas/MarkdownSchema.d.ts +0 -14
- package/dist/src/schemas/MarkdownSchema.d.ts.map +0 -1
- package/dist/src/schemas/MetadataItemSchema.d.ts +0 -13
- package/dist/src/schemas/MetadataItemSchema.d.ts.map +0 -1
- package/dist/src/schemas/PageBannerHeaderSchema.d.ts +0 -28
- package/dist/src/schemas/PageBannerHeaderSchema.d.ts.map +0 -1
- package/dist/src/schemas/PageTemplateSchema.d.ts +0 -31
- package/dist/src/schemas/PageTemplateSchema.d.ts.map +0 -1
- package/dist/src/schemas/PaletteSwitcherSchema.d.ts +0 -16
- package/dist/src/schemas/PaletteSwitcherSchema.d.ts.map +0 -1
- package/dist/src/schemas/PrintConfigSchema.d.ts +0 -31
- package/dist/src/schemas/PrintConfigSchema.d.ts.map +0 -1
- package/dist/src/schemas/ProductCardSchema.d.ts +0 -39
- package/dist/src/schemas/ProductCardSchema.d.ts.map +0 -1
- package/dist/src/schemas/SafeSpanSchema.d.ts +0 -13
- package/dist/src/schemas/SafeSpanSchema.d.ts.map +0 -1
- package/dist/src/schemas/SectionSchema.d.ts +0 -16
- package/dist/src/schemas/SectionSchema.d.ts.map +0 -1
- package/dist/src/schemas/SelectInputFieldSchema.d.ts +0 -27
- package/dist/src/schemas/SelectInputFieldSchema.d.ts.map +0 -1
- package/dist/src/schemas/SwitchInputFieldSchema.d.ts +0 -18
- package/dist/src/schemas/SwitchInputFieldSchema.d.ts.map +0 -1
- package/dist/src/schemas/TextInputFieldSchema.d.ts +0 -22
- package/dist/src/schemas/TextInputFieldSchema.d.ts.map +0 -1
- package/dist/src/schemas/TextSchema.d.ts +0 -37
- package/dist/src/schemas/TextSchema.d.ts.map +0 -1
- package/dist/src/schemas/ThemeSwitcherSchema.d.ts +0 -19
- package/dist/src/schemas/ThemeSwitcherSchema.d.ts.map +0 -1
- package/dist/src/schemas/ViewSchema.d.ts +0 -66
- package/dist/src/schemas/ViewSchema.d.ts.map +0 -1
- package/dist/src/schemas/index.d.ts +0 -47
- package/dist/src/schemas/index.d.ts.map +0 -1
- package/dist/src/schemas/transformers/ComponentTransformer.d.ts +0 -128
- package/dist/src/schemas/transformers/ComponentTransformer.d.ts.map +0 -1
- package/dist/src/schemas/transformers/ReactNodeTransformer.d.ts +0 -53
- package/dist/src/schemas/transformers/ReactNodeTransformer.d.ts.map +0 -1
- package/dist/src/schemas/transformers/registry.d.ts +0 -18
- package/dist/src/schemas/transformers/registry.d.ts.map +0 -1
- package/dist/src/schemas/types/Serializable.d.ts +0 -46
- package/dist/src/schemas/types/Serializable.d.ts.map +0 -1
- package/dist/src/stories/_templates/SerializationTemplate.d.ts.map +0 -1
- package/dist/src/templates/TemplateResolver.d.ts +0 -52
- package/dist/src/templates/TemplateResolver.d.ts.map +0 -1
- package/dist/src/templates/index.d.ts +0 -7
- package/dist/src/templates/index.d.ts.map +0 -1
- package/dist/src/types/CacheProvider.d.ts +0 -18
- package/dist/src/types/CacheProvider.d.ts.map +0 -1
- package/dist/src/types/CollapsibleLayout.d.ts +0 -142
- package/dist/src/types/CollapsibleLayout.d.ts.map +0 -1
- package/dist/src/types/ContentProxy.d.ts +0 -47
- package/dist/src/types/ContentProxy.d.ts.map +0 -1
- package/dist/src/types/DataTypes.d.ts +0 -185
- package/dist/src/types/DataTypes.d.ts.map +0 -1
- package/dist/src/types/TemplateProvider.d.ts +0 -10
- package/dist/src/types/TemplateProvider.d.ts.map +0 -1
- package/dist/src/types/TemplateResolver.d.ts +0 -23
- package/dist/src/types/TemplateResolver.d.ts.map +0 -1
- package/dist/src/types/index.d.ts +0 -82
- package/dist/src/types/index.d.ts.map +0 -1
- package/dist/src/utils/breakpoints.d.ts +0 -35
- package/dist/src/utils/breakpoints.d.ts.map +0 -1
- package/dist/src/utils/cssUtils.d.ts +0 -17
- package/dist/src/utils/cssUtils.d.ts.map +0 -1
- package/dist/src/utils/customPaletteManager.d.ts +0 -8
- package/dist/src/utils/customPaletteManager.d.ts.map +0 -1
- package/dist/src/utils/dimensions.d.ts +0 -34
- package/dist/src/utils/dimensions.d.ts.map +0 -1
- package/dist/src/utils/htmlTransform.d.ts +0 -44
- package/dist/src/utils/htmlTransform.d.ts.map +0 -1
- package/dist/src/utils/index.d.ts +0 -16
- package/dist/src/utils/index.d.ts.map +0 -1
- package/dist/src/utils/logger.d.ts +0 -26
- package/dist/src/utils/logger.d.ts.map +0 -1
- package/dist/src/utils/paletteUtils.d.ts +0 -38
- package/dist/src/utils/paletteUtils.d.ts.map +0 -1
- package/dist/src/utils/persistenceUtils.d.ts +0 -31
- package/dist/src/utils/persistenceUtils.d.ts.map +0 -1
- package/dist/src/utils/reactUtils.d.ts +0 -33
- package/dist/src/utils/reactUtils.d.ts.map +0 -1
- package/dist/src/utils/spacing.d.ts +0 -34
- package/dist/src/utils/spacing.d.ts.map +0 -1
- package/dist/src/utils/themePerformanceMonitor.d.ts +0 -32
- package/dist/src/utils/themePerformanceMonitor.d.ts.map +0 -1
- package/dist/src/utils/themeUtils.d.ts +0 -27
- package/dist/src/utils/themeUtils.d.ts.map +0 -1
- package/dist/tests/ConsoleWarningTest.d.ts +0 -5
- package/dist/tests/ConsoleWarningTest.d.ts.map +0 -1
- package/dist/tests/StorageKeyTest.d.ts +0 -6
- package/dist/tests/StorageKeyTest.d.ts.map +0 -1
- package/dist/tests/ThemeStorageKeyTest.d.ts +0 -6
- package/dist/tests/ThemeStorageKeyTest.d.ts.map +0 -1
- /package/dist/palettes/{PaletteAutumn.css → palette-autumn.1.4.9.css} +0 -0
- /package/dist/palettes/{PaletteCosmic.css → palette-cosmic.1.4.9.css} +0 -0
- /package/dist/palettes/{PaletteDefault.css → palette-default.1.4.9.css} +0 -0
- /package/dist/palettes/{PaletteOcean.css → palette-ocean.1.4.9.css} +0 -0
- /package/dist/palettes/{PaletteSpring.css → palette-spring.1.4.9.css} +0 -0
- /package/dist/palettes/{PaletteWinter.css → palette-winter.1.4.9.css} +0 -0
- /package/dist/{src/stories → stories}/_templates/SerializationTemplate.d.ts +0 -0
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Captcha - Universal CAPTCHA component supporting multiple providers
|
|
3
|
+
*
|
|
4
|
+
* Supported providers:
|
|
5
|
+
* - Google reCAPTCHA v2 (checkbox)
|
|
6
|
+
* - Google reCAPTCHA v3 (invisible)
|
|
7
|
+
* - hCaptcha
|
|
8
|
+
* - Cloudflare Turnstile
|
|
9
|
+
*
|
|
10
|
+
* Features:
|
|
11
|
+
* - Provider-agnostic API
|
|
12
|
+
* - Automatic script loading
|
|
13
|
+
* - TypeScript support
|
|
14
|
+
* - Themed styling with base props support
|
|
15
|
+
* - Grid behavior support
|
|
16
|
+
* - Error handling
|
|
17
|
+
*
|
|
18
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
22
|
+
import { Box, Alert } from '@mui/material';
|
|
23
|
+
import { useBaseProps, WithBaseProps, QWICKAPP_COMPONENT } from '../../hooks/useBaseProps';
|
|
24
|
+
|
|
25
|
+
export type CaptchaProvider = 'recaptcha-v2' | 'recaptcha-v3' | 'hcaptcha' | 'turnstile';
|
|
26
|
+
|
|
27
|
+
interface CaptchaBaseProps {
|
|
28
|
+
/** CAPTCHA provider */
|
|
29
|
+
provider: CaptchaProvider;
|
|
30
|
+
/** Site key (public key) */
|
|
31
|
+
siteKey: string;
|
|
32
|
+
/** Callback when CAPTCHA is successfully completed */
|
|
33
|
+
onVerify: (token: string) => void;
|
|
34
|
+
/** Callback when CAPTCHA expires or fails */
|
|
35
|
+
onExpire?: () => void;
|
|
36
|
+
/** Callback when CAPTCHA encounters an error */
|
|
37
|
+
onError?: (error: Error) => void;
|
|
38
|
+
/** Theme for the widget (light or dark) */
|
|
39
|
+
theme?: 'light' | 'dark';
|
|
40
|
+
/** Size of the widget */
|
|
41
|
+
size?: 'normal' | 'compact' | 'invisible';
|
|
42
|
+
/** reCAPTCHA v3 action name */
|
|
43
|
+
action?: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface CaptchaProps extends WithBaseProps<CaptchaBaseProps> {}
|
|
47
|
+
|
|
48
|
+
// Declare global interfaces for CAPTCHA providers
|
|
49
|
+
declare global {
|
|
50
|
+
interface Window {
|
|
51
|
+
grecaptcha?: unknown;
|
|
52
|
+
hcaptcha?: unknown;
|
|
53
|
+
turnstile?: unknown;
|
|
54
|
+
onRecaptchaLoad?: () => void;
|
|
55
|
+
onHcaptchaLoad?: () => void;
|
|
56
|
+
onTurnstileLoad?: () => void;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export const Captcha = React.forwardRef<HTMLDivElement, CaptchaProps>((props, ref) => {
|
|
61
|
+
const { gridProps, styleProps, htmlProps, restProps } = useBaseProps(props);
|
|
62
|
+
|
|
63
|
+
const {
|
|
64
|
+
provider,
|
|
65
|
+
siteKey,
|
|
66
|
+
onVerify,
|
|
67
|
+
onExpire,
|
|
68
|
+
onError,
|
|
69
|
+
theme = 'light',
|
|
70
|
+
size = 'normal',
|
|
71
|
+
action = 'submit',
|
|
72
|
+
} = restProps as CaptchaBaseProps;
|
|
73
|
+
|
|
74
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
75
|
+
const widgetIdRef = useRef<string | number | null>(null);
|
|
76
|
+
const [isLoaded, setIsLoaded] = useState(false);
|
|
77
|
+
const [error, setError] = useState<string | null>(null);
|
|
78
|
+
|
|
79
|
+
// Load the appropriate CAPTCHA script
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
const loadScript = () => {
|
|
82
|
+
// Check if script is already loaded
|
|
83
|
+
const isAlreadyLoaded = (() => {
|
|
84
|
+
switch (provider) {
|
|
85
|
+
case 'recaptcha-v2':
|
|
86
|
+
case 'recaptcha-v3':
|
|
87
|
+
return !!window.grecaptcha;
|
|
88
|
+
case 'hcaptcha':
|
|
89
|
+
return !!window.hcaptcha;
|
|
90
|
+
case 'turnstile':
|
|
91
|
+
return !!window.turnstile;
|
|
92
|
+
default:
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
})();
|
|
96
|
+
|
|
97
|
+
if (isAlreadyLoaded) {
|
|
98
|
+
setIsLoaded(true);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Get the script URL for the provider
|
|
103
|
+
const getScriptUrl = (): string => {
|
|
104
|
+
switch (provider) {
|
|
105
|
+
case 'recaptcha-v2':
|
|
106
|
+
return 'https://www.google.com/recaptcha/api.js?render=explicit';
|
|
107
|
+
case 'recaptcha-v3':
|
|
108
|
+
return `https://www.google.com/recaptcha/api.js?render=${siteKey}`;
|
|
109
|
+
case 'hcaptcha':
|
|
110
|
+
return 'https://js.hcaptcha.com/1/api.js?render=explicit';
|
|
111
|
+
case 'turnstile':
|
|
112
|
+
return 'https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit';
|
|
113
|
+
default:
|
|
114
|
+
return '';
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
const scriptUrl = getScriptUrl();
|
|
119
|
+
if (!scriptUrl) {
|
|
120
|
+
setError('Unsupported CAPTCHA provider');
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Create and load script
|
|
125
|
+
const script = document.createElement('script');
|
|
126
|
+
script.src = scriptUrl;
|
|
127
|
+
script.async = true;
|
|
128
|
+
script.defer = true;
|
|
129
|
+
|
|
130
|
+
script.onload = () => {
|
|
131
|
+
setIsLoaded(true);
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
script.onerror = () => {
|
|
135
|
+
setError('Failed to load CAPTCHA script');
|
|
136
|
+
onError?.(new Error('Failed to load CAPTCHA script'));
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
document.head.appendChild(script);
|
|
140
|
+
|
|
141
|
+
return () => {
|
|
142
|
+
// Cleanup: remove script when component unmounts
|
|
143
|
+
document.head.removeChild(script);
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
loadScript();
|
|
148
|
+
}, [provider, siteKey, onError]);
|
|
149
|
+
|
|
150
|
+
// Render the CAPTCHA widget
|
|
151
|
+
useEffect(() => {
|
|
152
|
+
if (!isLoaded || !containerRef.current) return;
|
|
153
|
+
|
|
154
|
+
const renderWidget = () => {
|
|
155
|
+
try {
|
|
156
|
+
switch (provider) {
|
|
157
|
+
case 'recaptcha-v2':
|
|
158
|
+
if (window.grecaptcha && window.grecaptcha.render) {
|
|
159
|
+
widgetIdRef.current = window.grecaptcha.render(containerRef.current, {
|
|
160
|
+
sitekey: siteKey,
|
|
161
|
+
callback: onVerify,
|
|
162
|
+
'expired-callback': onExpire,
|
|
163
|
+
'error-callback': () => {
|
|
164
|
+
const err = new Error('reCAPTCHA error');
|
|
165
|
+
setError(err.message);
|
|
166
|
+
onError?.(err);
|
|
167
|
+
},
|
|
168
|
+
theme,
|
|
169
|
+
size,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
break;
|
|
173
|
+
|
|
174
|
+
case 'recaptcha-v3':
|
|
175
|
+
// reCAPTCHA v3 is invisible and executes programmatically
|
|
176
|
+
if (window.grecaptcha && window.grecaptcha.execute) {
|
|
177
|
+
window.grecaptcha.execute(siteKey, { action }).then((token: string) => {
|
|
178
|
+
onVerify(token);
|
|
179
|
+
}).catch((err: Error) => {
|
|
180
|
+
setError(err.message);
|
|
181
|
+
onError?.(err);
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
break;
|
|
185
|
+
|
|
186
|
+
case 'hcaptcha':
|
|
187
|
+
if (window.hcaptcha && window.hcaptcha.render) {
|
|
188
|
+
widgetIdRef.current = window.hcaptcha.render(containerRef.current, {
|
|
189
|
+
sitekey: siteKey,
|
|
190
|
+
callback: onVerify,
|
|
191
|
+
'expired-callback': onExpire,
|
|
192
|
+
'error-callback': () => {
|
|
193
|
+
const err = new Error('hCaptcha error');
|
|
194
|
+
setError(err.message);
|
|
195
|
+
onError?.(err);
|
|
196
|
+
},
|
|
197
|
+
theme,
|
|
198
|
+
size: size === 'normal' ? 'normal' : 'compact',
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
break;
|
|
202
|
+
|
|
203
|
+
case 'turnstile':
|
|
204
|
+
if (window.turnstile && window.turnstile.render) {
|
|
205
|
+
widgetIdRef.current = window.turnstile.render(containerRef.current, {
|
|
206
|
+
sitekey: siteKey,
|
|
207
|
+
callback: onVerify,
|
|
208
|
+
'expired-callback': onExpire,
|
|
209
|
+
'error-callback': () => {
|
|
210
|
+
const err = new Error('Turnstile error');
|
|
211
|
+
setError(err.message);
|
|
212
|
+
onError?.(err);
|
|
213
|
+
},
|
|
214
|
+
theme,
|
|
215
|
+
size: size === 'compact' ? 'compact' : 'normal',
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
break;
|
|
219
|
+
}
|
|
220
|
+
} catch (err) {
|
|
221
|
+
const error = err instanceof Error ? err : new Error('Failed to render CAPTCHA');
|
|
222
|
+
setError(error.message);
|
|
223
|
+
onError?.(error);
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
// Small delay to ensure the CAPTCHA library is fully initialized
|
|
228
|
+
const timer = setTimeout(renderWidget, 100);
|
|
229
|
+
|
|
230
|
+
return () => {
|
|
231
|
+
clearTimeout(timer);
|
|
232
|
+
// Cleanup widget on unmount
|
|
233
|
+
if (widgetIdRef.current !== null) {
|
|
234
|
+
try {
|
|
235
|
+
switch (provider) {
|
|
236
|
+
case 'recaptcha-v2':
|
|
237
|
+
window.grecaptcha?.reset(widgetIdRef.current);
|
|
238
|
+
break;
|
|
239
|
+
case 'hcaptcha':
|
|
240
|
+
window.hcaptcha?.remove(widgetIdRef.current);
|
|
241
|
+
break;
|
|
242
|
+
case 'turnstile':
|
|
243
|
+
window.turnstile?.remove(widgetIdRef.current);
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
246
|
+
} catch (e) {
|
|
247
|
+
// Ignore cleanup errors
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
}, [isLoaded, provider, siteKey, onVerify, onExpire, onError, theme, size, action]);
|
|
252
|
+
|
|
253
|
+
// Don't render anything for reCAPTCHA v3 (invisible)
|
|
254
|
+
if (provider === 'recaptcha-v3') {
|
|
255
|
+
return null;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
return (
|
|
259
|
+
<Box
|
|
260
|
+
ref={ref}
|
|
261
|
+
{...htmlProps}
|
|
262
|
+
sx={{
|
|
263
|
+
my: 2,
|
|
264
|
+
...styleProps.sx,
|
|
265
|
+
}}
|
|
266
|
+
// Store grid props as data attributes for ColumnLayout to pick up
|
|
267
|
+
{...(gridProps && {
|
|
268
|
+
'data-grid-span': gridProps.span,
|
|
269
|
+
'data-grid-xs': gridProps.xs,
|
|
270
|
+
'data-grid-sm': gridProps.sm,
|
|
271
|
+
'data-grid-md': gridProps.md,
|
|
272
|
+
'data-grid-lg': gridProps.lg,
|
|
273
|
+
'data-grid-xl': gridProps.xl,
|
|
274
|
+
})}
|
|
275
|
+
>
|
|
276
|
+
{error && (
|
|
277
|
+
<Alert severity="error" sx={{ mb: 2 }}>
|
|
278
|
+
{error}
|
|
279
|
+
</Alert>
|
|
280
|
+
)}
|
|
281
|
+
<div ref={containerRef} />
|
|
282
|
+
</Box>
|
|
283
|
+
);
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
Captcha.displayName = 'Captcha';
|
|
287
|
+
|
|
288
|
+
// Mark as QwickApp component
|
|
289
|
+
(Captcha as Record<string, unknown>)[QWICKAPP_COMPONENT] = true;
|
|
290
|
+
|
|
291
|
+
export default Captcha;
|
|
@@ -27,9 +27,9 @@ import type { SchemaProps, WithDataBinding } from '@qwickapps/schema';
|
|
|
27
27
|
import { useQwickApp } from '../../contexts/QwickAppContext';
|
|
28
28
|
import { QWICKAPP_COMPONENT, useBaseProps, useDataBinding } from '../../hooks';
|
|
29
29
|
import FormBlockModel from '../../schemas/FormBlockSchema';
|
|
30
|
+
import { ModelView } from '../base/ModelView';
|
|
30
31
|
import CoverImageHeader from '../blocks/CoverImageHeader';
|
|
31
32
|
import Logo from '../Logo';
|
|
32
|
-
import { ModelView } from '../base/ModelView';
|
|
33
33
|
|
|
34
34
|
type FormBlockViewProps = SchemaProps<FormBlockModel> & {
|
|
35
35
|
/**
|
|
@@ -55,7 +55,7 @@ type FormBlockViewProps = SchemaProps<FormBlockModel> & {
|
|
|
55
55
|
footer?: React.ReactNode;
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
export interface FormBlockProps extends FormBlockViewProps, WithDataBinding {
|
|
58
|
+
export interface FormBlockProps extends FormBlockViewProps, WithDataBinding {}
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* Default header component that uses CoverImageHeader and Logo
|
|
@@ -231,34 +231,41 @@ export class FormBlock extends ModelView<FormBlockProps, FormBlockModel> {
|
|
|
231
231
|
static readonly version = '1.0.0';
|
|
232
232
|
|
|
233
233
|
// Deserialization: JSON data → React element
|
|
234
|
-
static fromJson(jsonData:
|
|
235
|
-
return <FormBlock {...jsonData} />;
|
|
234
|
+
static fromJson(jsonData: unknown): ReactElement {
|
|
235
|
+
return <FormBlock {...(jsonData as Record<string, unknown>)} />;
|
|
236
236
|
}
|
|
237
237
|
|
|
238
238
|
// FormBlock components have nested ReactNode children (form content)
|
|
239
|
-
protected hasNestedComponents(
|
|
239
|
+
protected hasNestedComponents(_children: React.ReactNode): boolean {
|
|
240
240
|
// FormBlock may contain other serializable components as children
|
|
241
241
|
return true;
|
|
242
242
|
}
|
|
243
|
-
|
|
243
|
+
|
|
244
244
|
// Custom children serialization for FormBlock
|
|
245
|
-
protected serializeChildren(children: React.ReactNode):
|
|
245
|
+
protected serializeChildren(children: React.ReactNode): unknown {
|
|
246
246
|
// For FormBlock, children represent the form content which could be other components
|
|
247
247
|
// We need to handle this properly by checking if children contain serializable components
|
|
248
|
-
|
|
248
|
+
interface SerializableType {
|
|
249
|
+
prototype?: { toJson?: unknown };
|
|
250
|
+
fromJson?: unknown;
|
|
251
|
+
tagName?: string;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
if (React.isValidElement(children) && (children.type as SerializableType).prototype?.toJson) {
|
|
249
255
|
// If it's a serializable component, serialize it
|
|
250
|
-
|
|
251
|
-
|
|
256
|
+
const childType = children.type as SerializableType;
|
|
257
|
+
return childType.fromJson ? {
|
|
258
|
+
component: childType.tagName,
|
|
252
259
|
props: children.props
|
|
253
260
|
} : children;
|
|
254
261
|
}
|
|
255
|
-
|
|
262
|
+
|
|
256
263
|
// For non-serializable children (regular JSX), extract text or return as-is
|
|
257
264
|
return super.serializeChildren(children);
|
|
258
265
|
}
|
|
259
266
|
|
|
260
267
|
// Component-specific serialization properties
|
|
261
|
-
protected getComponentSpecificProps():
|
|
268
|
+
protected getComponentSpecificProps(): unknown {
|
|
262
269
|
return {
|
|
263
270
|
title: this.props.title,
|
|
264
271
|
description: this.props.description,
|
|
@@ -274,7 +281,7 @@ export class FormBlock extends ModelView<FormBlockProps, FormBlockModel> {
|
|
|
274
281
|
|
|
275
282
|
// FormBlock component renders traditional props view
|
|
276
283
|
protected renderView(): React.ReactElement {
|
|
277
|
-
const { dataSource, bindingOptions, ...restProps } = this.props;
|
|
284
|
+
const { dataSource: _dataSource, bindingOptions: _bindingOptions, ...restProps } = this.props;
|
|
278
285
|
return <FormBlockView {...restProps} />;
|
|
279
286
|
}
|
|
280
287
|
|
|
@@ -289,7 +296,7 @@ function FormBlockWithDataBinding(props: FormBlockProps) {
|
|
|
289
296
|
const { dataSource, bindingOptions, ...restProps } = props;
|
|
290
297
|
|
|
291
298
|
// Use data binding
|
|
292
|
-
const {
|
|
299
|
+
const { loading, error, ...formBlockProps } = useDataBinding<FormBlockModel>(
|
|
293
300
|
dataSource!,
|
|
294
301
|
restProps as Partial<FormBlockModel>,
|
|
295
302
|
FormBlockModel.getSchema(),
|
|
@@ -339,6 +346,6 @@ function FormBlockWithDataBinding(props: FormBlockProps) {
|
|
|
339
346
|
}
|
|
340
347
|
|
|
341
348
|
// Mark as QwickApp component
|
|
342
|
-
(FormBlock as
|
|
349
|
+
(FormBlock as Record<string, unknown>)[QWICKAPP_COMPONENT] = true;
|
|
343
350
|
|
|
344
351
|
export default FormBlock;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FormCheckbox - Themed checkbox component wrapping MUI Checkbox and FormControlLabel
|
|
3
|
+
*
|
|
4
|
+
* Features:
|
|
5
|
+
* - Uses QwickApps CSS theme variables for consistent styling
|
|
6
|
+
* - Supports FormControlLabel for proper label positioning
|
|
7
|
+
* - Handles required and disabled states
|
|
8
|
+
* - Helper text support
|
|
9
|
+
* - Base props support for grid behavior and styling
|
|
10
|
+
*
|
|
11
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import React from 'react';
|
|
15
|
+
import {
|
|
16
|
+
FormControl,
|
|
17
|
+
FormControlLabel,
|
|
18
|
+
Checkbox,
|
|
19
|
+
FormHelperText,
|
|
20
|
+
} from '@mui/material';
|
|
21
|
+
import { useBaseProps, WithBaseProps, QWICKAPP_COMPONENT } from '../../hooks/useBaseProps';
|
|
22
|
+
|
|
23
|
+
interface FormCheckboxBaseProps {
|
|
24
|
+
label: string;
|
|
25
|
+
checked: boolean;
|
|
26
|
+
onChange: (checked: boolean) => void;
|
|
27
|
+
helperText?: string;
|
|
28
|
+
required?: boolean;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface FormCheckboxProps extends WithBaseProps<FormCheckboxBaseProps> {}
|
|
33
|
+
|
|
34
|
+
export const FormCheckbox = React.forwardRef<HTMLDivElement, FormCheckboxProps>((props, ref) => {
|
|
35
|
+
const { gridProps, styleProps, htmlProps, restProps } = useBaseProps(props);
|
|
36
|
+
|
|
37
|
+
const {
|
|
38
|
+
label,
|
|
39
|
+
checked,
|
|
40
|
+
onChange,
|
|
41
|
+
helperText,
|
|
42
|
+
required = false,
|
|
43
|
+
disabled = false,
|
|
44
|
+
} = restProps as FormCheckboxBaseProps;
|
|
45
|
+
|
|
46
|
+
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
47
|
+
onChange(e.target.checked);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const checkboxStyles = {
|
|
51
|
+
color: 'var(--theme-primary)',
|
|
52
|
+
'&.Mui-checked': {
|
|
53
|
+
color: 'var(--theme-primary)',
|
|
54
|
+
},
|
|
55
|
+
'&.Mui-disabled': {
|
|
56
|
+
color: 'var(--theme-text-disabled)',
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const labelStyles = {
|
|
61
|
+
color: 'var(--theme-text-primary)',
|
|
62
|
+
'& .MuiFormControlLabel-label': {
|
|
63
|
+
color: 'var(--theme-text-primary)',
|
|
64
|
+
},
|
|
65
|
+
'& .MuiFormControlLabel-label.Mui-disabled': {
|
|
66
|
+
color: 'var(--theme-text-disabled)',
|
|
67
|
+
},
|
|
68
|
+
...styleProps.sx,
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const helperTextStyles = {
|
|
72
|
+
color: 'var(--theme-secondary)',
|
|
73
|
+
marginLeft: '32px', // Align with checkbox + label
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<FormControl
|
|
78
|
+
ref={ref}
|
|
79
|
+
{...htmlProps}
|
|
80
|
+
{...styleProps}
|
|
81
|
+
// Store grid props as data attributes for ColumnLayout to pick up
|
|
82
|
+
{...(gridProps && {
|
|
83
|
+
'data-grid-span': gridProps.span,
|
|
84
|
+
'data-grid-xs': gridProps.xs,
|
|
85
|
+
'data-grid-sm': gridProps.sm,
|
|
86
|
+
'data-grid-md': gridProps.md,
|
|
87
|
+
'data-grid-lg': gridProps.lg,
|
|
88
|
+
'data-grid-xl': gridProps.xl,
|
|
89
|
+
})}
|
|
90
|
+
>
|
|
91
|
+
<FormControlLabel
|
|
92
|
+
control={
|
|
93
|
+
<Checkbox
|
|
94
|
+
checked={checked}
|
|
95
|
+
onChange={handleChange}
|
|
96
|
+
required={required}
|
|
97
|
+
disabled={disabled}
|
|
98
|
+
sx={checkboxStyles}
|
|
99
|
+
/>
|
|
100
|
+
}
|
|
101
|
+
label={label}
|
|
102
|
+
sx={labelStyles}
|
|
103
|
+
/>
|
|
104
|
+
{helperText && (
|
|
105
|
+
<FormHelperText sx={helperTextStyles}>{helperText}</FormHelperText>
|
|
106
|
+
)}
|
|
107
|
+
</FormControl>
|
|
108
|
+
);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
FormCheckbox.displayName = 'FormCheckbox';
|
|
112
|
+
|
|
113
|
+
// Mark as QwickApp component
|
|
114
|
+
(FormCheckbox as Record<string, unknown>)[QWICKAPP_COMPONENT] = true;
|
|
115
|
+
|
|
116
|
+
export default FormCheckbox;
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FormField - Themed form field component wrapping MUI FormControl
|
|
3
|
+
*
|
|
4
|
+
* Features:
|
|
5
|
+
* - Uses QwickApps CSS theme variables for consistent styling
|
|
6
|
+
* - Supports text, number, password, and email input types
|
|
7
|
+
* - Integrated with MUI FormControl, Input, and Select
|
|
8
|
+
* - Handles readonly, disabled, and required states
|
|
9
|
+
* - Support for adornments and helper text
|
|
10
|
+
* - Base props support for grid behavior and styling
|
|
11
|
+
*
|
|
12
|
+
* Copyright (c) 2025 QwickApps.com. All rights reserved.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import React from 'react';
|
|
16
|
+
import {
|
|
17
|
+
FormControl,
|
|
18
|
+
InputLabel,
|
|
19
|
+
Input,
|
|
20
|
+
FormHelperText,
|
|
21
|
+
InputAdornment,
|
|
22
|
+
} from '@mui/material';
|
|
23
|
+
import { useBaseProps, WithBaseProps, QWICKAPP_COMPONENT } from '../../hooks/useBaseProps';
|
|
24
|
+
|
|
25
|
+
export interface FormFieldOption {
|
|
26
|
+
value: string | number;
|
|
27
|
+
label: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface FormFieldBaseProps {
|
|
31
|
+
label: string;
|
|
32
|
+
value: string | number;
|
|
33
|
+
onChange?: (value: string | number) => void;
|
|
34
|
+
onChangeRaw?: (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
35
|
+
type?: 'text' | 'number' | 'password' | 'email' | 'tel';
|
|
36
|
+
helperText?: string;
|
|
37
|
+
required?: boolean;
|
|
38
|
+
readOnly?: boolean;
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
disabledColor?: string;
|
|
41
|
+
fullWidth?: boolean;
|
|
42
|
+
multiline?: boolean;
|
|
43
|
+
rows?: number;
|
|
44
|
+
placeholder?: string;
|
|
45
|
+
startAdornment?: React.ReactNode;
|
|
46
|
+
endAdornment?: React.ReactNode;
|
|
47
|
+
inputProps?: unknown;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface FormFieldProps extends WithBaseProps<FormFieldBaseProps> {}
|
|
51
|
+
|
|
52
|
+
export const FormField = React.forwardRef<HTMLDivElement, FormFieldProps>((props, ref) => {
|
|
53
|
+
const { gridProps, styleProps, htmlProps, restProps } = useBaseProps(props);
|
|
54
|
+
|
|
55
|
+
const {
|
|
56
|
+
label,
|
|
57
|
+
value,
|
|
58
|
+
onChange,
|
|
59
|
+
onChangeRaw,
|
|
60
|
+
type = 'text',
|
|
61
|
+
helperText,
|
|
62
|
+
required = false,
|
|
63
|
+
readOnly = false,
|
|
64
|
+
disabled = false,
|
|
65
|
+
disabledColor,
|
|
66
|
+
fullWidth = true,
|
|
67
|
+
multiline = false,
|
|
68
|
+
rows,
|
|
69
|
+
placeholder,
|
|
70
|
+
startAdornment,
|
|
71
|
+
endAdornment,
|
|
72
|
+
inputProps,
|
|
73
|
+
} = restProps as FormFieldBaseProps;
|
|
74
|
+
|
|
75
|
+
// Generate a unique ID for the input field
|
|
76
|
+
const fieldId = React.useId();
|
|
77
|
+
|
|
78
|
+
const handleChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
|
|
79
|
+
// If onChangeRaw is provided, use it instead
|
|
80
|
+
if (onChangeRaw) {
|
|
81
|
+
onChangeRaw(e);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (onChange) {
|
|
86
|
+
const newValue = type === 'number' ? parseInt(e.target.value) || 0 : e.target.value;
|
|
87
|
+
onChange(newValue);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const inputStyles = {
|
|
92
|
+
p: 1,
|
|
93
|
+
pl: 1.6,
|
|
94
|
+
mt: 3,
|
|
95
|
+
color: disabled && disabledColor
|
|
96
|
+
? disabledColor
|
|
97
|
+
: readOnly
|
|
98
|
+
? 'var(--theme-text-secondary)'
|
|
99
|
+
: 'var(--theme-text-primary)',
|
|
100
|
+
backgroundColor: readOnly ? 'var(--theme-surface-variant)' : 'transparent',
|
|
101
|
+
borderRadius: 1,
|
|
102
|
+
'&.Mui-disabled': disabledColor ? {
|
|
103
|
+
color: disabledColor,
|
|
104
|
+
WebkitTextFillColor: disabledColor,
|
|
105
|
+
} : undefined,
|
|
106
|
+
'& input.Mui-disabled': disabledColor ? {
|
|
107
|
+
color: disabledColor,
|
|
108
|
+
WebkitTextFillColor: disabledColor,
|
|
109
|
+
} : undefined,
|
|
110
|
+
...styleProps.sx,
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
const labelStyles = {
|
|
114
|
+
left: -12,
|
|
115
|
+
fontWeight: 600,
|
|
116
|
+
color: 'var(--theme-text-primary)',
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const helperTextStyles = {
|
|
120
|
+
color: 'var(--theme-secondary)',
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
return (
|
|
124
|
+
<FormControl
|
|
125
|
+
ref={ref}
|
|
126
|
+
fullWidth={fullWidth}
|
|
127
|
+
{...htmlProps}
|
|
128
|
+
{...styleProps}
|
|
129
|
+
// Store grid props as data attributes for ColumnLayout to pick up
|
|
130
|
+
{...(gridProps && {
|
|
131
|
+
'data-grid-span': gridProps.span,
|
|
132
|
+
'data-grid-xs': gridProps.xs,
|
|
133
|
+
'data-grid-sm': gridProps.sm,
|
|
134
|
+
'data-grid-md': gridProps.md,
|
|
135
|
+
'data-grid-lg': gridProps.lg,
|
|
136
|
+
'data-grid-xl': gridProps.xl,
|
|
137
|
+
})}
|
|
138
|
+
>
|
|
139
|
+
<InputLabel htmlFor={fieldId} sx={labelStyles} shrink>
|
|
140
|
+
{label}
|
|
141
|
+
</InputLabel>
|
|
142
|
+
|
|
143
|
+
<Input
|
|
144
|
+
id={fieldId}
|
|
145
|
+
type={type}
|
|
146
|
+
value={value}
|
|
147
|
+
onChange={handleChange}
|
|
148
|
+
readOnly={readOnly}
|
|
149
|
+
disabled={disabled}
|
|
150
|
+
required={required}
|
|
151
|
+
multiline={multiline}
|
|
152
|
+
rows={rows}
|
|
153
|
+
placeholder={placeholder}
|
|
154
|
+
inputProps={inputProps}
|
|
155
|
+
sx={inputStyles}
|
|
156
|
+
startAdornment={
|
|
157
|
+
startAdornment ? (
|
|
158
|
+
<InputAdornment position="start">{startAdornment}</InputAdornment>
|
|
159
|
+
) : undefined
|
|
160
|
+
}
|
|
161
|
+
endAdornment={
|
|
162
|
+
endAdornment ? (
|
|
163
|
+
<InputAdornment position="end">{endAdornment}</InputAdornment>
|
|
164
|
+
) : undefined
|
|
165
|
+
}
|
|
166
|
+
/>
|
|
167
|
+
|
|
168
|
+
{helperText && (
|
|
169
|
+
<FormHelperText sx={helperTextStyles}>{helperText}</FormHelperText>
|
|
170
|
+
)}
|
|
171
|
+
</FormControl>
|
|
172
|
+
);
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
FormField.displayName = 'FormField';
|
|
176
|
+
|
|
177
|
+
// Mark as QwickApp component
|
|
178
|
+
(FormField as Record<string, unknown>)[QWICKAPP_COMPONENT] = true;
|
|
179
|
+
|
|
180
|
+
export default FormField;
|