@qwickapps/react-framework 1.3.5 → 1.4.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/README.md +1681 -2
- package/dist/__tests__/schemas/transformers/MockSerializableComponent.d.ts +66 -0
- package/dist/__tests__/schemas/transformers/MockSerializableComponent.d.ts.map +1 -0
- package/dist/components/ErrorBoundary.d.ts +7 -0
- package/dist/components/ErrorBoundary.d.ts.map +1 -1
- package/dist/components/Html.d.ts +28 -18
- package/dist/components/Html.d.ts.map +1 -1
- package/dist/components/Logo.d.ts +12 -35
- package/dist/components/Logo.d.ts.map +1 -1
- package/dist/components/Markdown.d.ts +18 -13
- package/dist/components/Markdown.d.ts.map +1 -1
- package/dist/components/QwickApp.d.ts +16 -3
- package/dist/components/QwickApp.d.ts.map +1 -1
- package/dist/components/QwickIcon.d.ts +23 -0
- package/dist/components/QwickIcon.d.ts.map +1 -0
- package/dist/components/SafeSpan.d.ts +12 -5
- package/dist/components/SafeSpan.d.ts.map +1 -1
- package/dist/components/Scaffold.d.ts.map +1 -1
- package/dist/components/base/ModelView.d.ts +101 -0
- package/dist/components/base/ModelView.d.ts.map +1 -0
- package/dist/components/base/index.d.ts +11 -0
- package/dist/components/base/index.d.ts.map +1 -0
- package/dist/components/blocks/Article.d.ts +12 -2
- package/dist/components/blocks/Article.d.ts.map +1 -1
- package/dist/components/blocks/Code.d.ts +13 -2
- package/dist/components/blocks/Code.d.ts.map +1 -1
- package/dist/components/blocks/CoverImageHeader.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/components/blocks/HeroBlock.d.ts +27 -13
- package/dist/components/blocks/HeroBlock.d.ts.map +1 -1
- package/dist/components/blocks/Image.d.ts +41 -0
- package/dist/components/blocks/Image.d.ts.map +1 -0
- package/dist/components/blocks/PageBannerHeader.d.ts.map +1 -1
- package/dist/components/blocks/Section.d.ts +16 -2
- package/dist/components/blocks/Section.d.ts.map +1 -1
- package/dist/components/blocks/Text.d.ts +41 -0
- package/dist/components/blocks/Text.d.ts.map +1 -0
- package/dist/components/blocks/index.d.ts +4 -0
- package/dist/components/blocks/index.d.ts.map +1 -1
- package/dist/components/buttons/Button.d.ts +23 -7
- package/dist/components/buttons/Button.d.ts.map +1 -1
- package/dist/components/forms/FormBlock.d.ts +19 -13
- package/dist/components/forms/FormBlock.d.ts.map +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/input/ChoiceInputField.d.ts +17 -11
- package/dist/components/input/ChoiceInputField.d.ts.map +1 -1
- package/dist/components/input/HtmlInputField.d.ts +17 -11
- package/dist/components/input/HtmlInputField.d.ts.map +1 -1
- package/dist/components/input/SelectInputField.d.ts +16 -10
- package/dist/components/input/SelectInputField.d.ts.map +1 -1
- package/dist/components/input/SwitchInputField.d.ts +16 -10
- package/dist/components/input/SwitchInputField.d.ts.map +1 -1
- package/dist/components/input/TextField.d.ts.map +1 -1
- package/dist/components/input/TextInputField.d.ts +16 -11
- package/dist/components/input/TextInputField.d.ts.map +1 -1
- package/dist/components/layout/GridCell.d.ts +23 -6
- package/dist/components/layout/GridCell.d.ts.map +1 -1
- package/dist/components/layout/GridLayout.d.ts +24 -23
- package/dist/components/layout/GridLayout.d.ts.map +1 -1
- package/dist/components/pages/FormPage.d.ts.map +1 -1
- package/dist/components/pages/Page.d.ts +49 -87
- package/dist/components/pages/Page.d.ts.map +1 -1
- package/dist/components/pages/index.d.ts +2 -2
- package/dist/components/pages/index.d.ts.map +1 -1
- package/dist/config/AppConfig.d.ts +49 -0
- package/dist/config/AppConfig.d.ts.map +1 -0
- package/dist/config/AppConfigBuilder.d.ts +75 -0
- package/dist/config/AppConfigBuilder.d.ts.map +1 -0
- package/dist/config/index.d.ts +13 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/types.d.ts +130 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config.d.ts +15 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.esm.js +451 -0
- package/dist/config.js +455 -0
- package/dist/contexts/PrintModeContext.d.ts +27 -0
- package/dist/contexts/PrintModeContext.d.ts.map +1 -0
- package/dist/contexts/QwickAppContext.d.ts +2 -2
- package/dist/contexts/QwickAppContext.d.ts.map +1 -1
- package/dist/contexts/index.d.ts +2 -0
- package/dist/contexts/index.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/usePrintMode.d.ts +39 -0
- package/dist/hooks/usePrintMode.d.ts.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +10951 -6238
- package/dist/index.js +11014 -6287
- package/dist/schemas/CodeSchema.d.ts +2 -1
- package/dist/schemas/CodeSchema.d.ts.map +1 -1
- package/dist/schemas/CollapsibleLayoutSchema.d.ts +2 -1
- package/dist/schemas/CollapsibleLayoutSchema.d.ts.map +1 -1
- package/dist/schemas/ContentSchema.d.ts +2 -1
- package/dist/schemas/ContentSchema.d.ts.map +1 -1
- package/dist/schemas/GridCellSchema.d.ts +25 -0
- package/dist/schemas/GridCellSchema.d.ts.map +1 -0
- package/dist/schemas/GridLayoutSchema.d.ts +23 -0
- package/dist/schemas/GridLayoutSchema.d.ts.map +1 -0
- package/dist/schemas/HtmlSchema.d.ts +14 -0
- package/dist/schemas/HtmlSchema.d.ts.map +1 -0
- package/dist/schemas/ImageSchema.d.ts +32 -0
- package/dist/schemas/ImageSchema.d.ts.map +1 -0
- package/dist/schemas/LogoSchema.d.ts +35 -0
- package/dist/schemas/LogoSchema.d.ts.map +1 -0
- package/dist/schemas/MarkdownSchema.d.ts +14 -0
- package/dist/schemas/MarkdownSchema.d.ts.map +1 -0
- package/dist/schemas/PageTemplateSchema.d.ts +31 -0
- package/dist/schemas/PageTemplateSchema.d.ts.map +1 -0
- package/dist/schemas/PrintConfigSchema.d.ts +31 -0
- package/dist/schemas/PrintConfigSchema.d.ts.map +1 -0
- package/dist/schemas/SectionSchema.d.ts +2 -1
- package/dist/schemas/SectionSchema.d.ts.map +1 -1
- package/dist/schemas/TextSchema.d.ts +37 -0
- package/dist/schemas/TextSchema.d.ts.map +1 -0
- package/dist/schemas/ViewModelSchema.d.ts +23 -0
- package/dist/schemas/ViewModelSchema.d.ts.map +1 -0
- package/dist/schemas/index.d.ts +15 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/transformers/ComponentTransformer.d.ts +116 -0
- package/dist/schemas/transformers/ComponentTransformer.d.ts.map +1 -0
- package/dist/schemas/transformers/ReactNodeTransformer.d.ts +53 -0
- package/dist/schemas/transformers/ReactNodeTransformer.d.ts.map +1 -0
- package/dist/schemas/transformers/__tests__/MockSerializableComponent.d.ts +66 -0
- package/dist/schemas/transformers/__tests__/MockSerializableComponent.d.ts.map +1 -0
- package/dist/schemas/transformers/registry.d.ts +15 -0
- package/dist/schemas/transformers/registry.d.ts.map +1 -0
- package/dist/schemas/types/Serializable.d.ts +46 -0
- package/dist/schemas/types/Serializable.d.ts.map +1 -0
- package/dist/utils/htmlTransform.d.ts.map +1 -1
- package/dist/utils/reactUtils.d.ts +12 -3
- package/dist/utils/reactUtils.d.ts.map +1 -1
- package/package.json +17 -3
- package/src/{components/__tests__ → __tests__/components}/AccessibilityProvider.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Article.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Breadcrumbs.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Button.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/CardListGrid.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/ChoiceInputField.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Code.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Content.integration.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Content.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/CoverImageHeader.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/ErrorBoundary.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/FeatureCard.integration.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/FeatureGrid.integration.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/FeatureGrid.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/Footer.test.tsx +4 -4
- package/src/{components/__tests__ → __tests__/components}/FormBlock.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/HeroBlock.integration.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/HeroBlock.test.tsx +233 -7
- package/src/{components/__tests__ → __tests__/components}/Html.test.tsx +11 -2
- package/src/{components/__tests__ → __tests__/components}/HtmlInputField.test.tsx +3 -3
- package/src/__tests__/components/Logo.test.js +3 -3
- package/src/{components/__tests__ → __tests__/components}/Markdown.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/PageBannerHeader.test.tsx +3 -3
- package/src/{components/__tests__ → __tests__/components}/PaletteSwitcher.test.tsx +3 -3
- package/src/{components/__tests__ → __tests__/components}/ProductCard.test.tsx +4 -4
- package/src/{components/__tests__ → __tests__/components}/SafeSpan.integration.test.tsx +2 -2
- package/src/{components/__tests__ → __tests__/components}/SafeSpan.simple.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/SafeSpan.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Section.integration.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/Section.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/SelectInputField.test.tsx +1 -1
- package/src/{components/__tests__ → __tests__/components}/TextInputField.test.tsx +3 -3
- package/src/{components/__tests__ → __tests__/components}/ThemeSwitcher.test.tsx +3 -3
- package/src/__tests__/components/base/ModelView.test.tsx +220 -0
- package/src/__tests__/components/blocks/Code.performance.test.tsx +625 -0
- package/src/__tests__/components/blocks/Code.serialization.test.tsx +507 -0
- package/src/__tests__/components/blocks/HeroBlock.serialization.test.tsx +414 -0
- package/src/__tests__/components/blocks/Image.serialization.test.tsx +257 -0
- package/src/__tests__/components/blocks/Section.serialization.test.tsx +553 -0
- package/src/__tests__/components/blocks/Text.performance.test.tsx +442 -0
- package/src/__tests__/components/blocks/Text.serialization.test.tsx +491 -0
- package/src/__tests__/components/buttons/Button.serialization.test.tsx +443 -0
- package/src/__tests__/components/input/FormComponents.serialization.test.tsx +482 -0
- package/src/__tests__/components/input/SelectInputField.serialization.test.tsx +439 -0
- package/src/__tests__/components/input/TextInputField.serialization.test.tsx +359 -0
- package/src/{components/layout/CollapsibleLayout/__tests__ → __tests__/components/layout}/CollapsibleLayout.test.tsx +4 -4
- package/src/__tests__/components/layout/GridCell.serialization.test.tsx +403 -0
- package/src/__tests__/components/layout/GridLayout.serialization.test.tsx +311 -0
- package/src/__tests__/hooks/usePrintMode.test.ts +89 -0
- package/src/__tests__/schemas/PageTemplateSchema.test.ts +161 -0
- package/src/__tests__/schemas/PrintConfigSchema.test.ts +127 -0
- package/src/__tests__/schemas/ViewModelSchema.test.ts +80 -0
- package/src/__tests__/schemas/transformers/ComponentSerializationPatterns.test.tsx +602 -0
- package/src/__tests__/schemas/transformers/ComponentTransformer.htmlPatterns.test.ts +301 -0
- package/src/__tests__/schemas/transformers/ComponentTransformer.test.ts +521 -0
- package/src/__tests__/schemas/transformers/CrossBrowserCompatibility.test.ts +586 -0
- package/src/__tests__/schemas/transformers/MockSerializableComponent.ts +103 -0
- package/src/__tests__/schemas/transformers/RealWorldScenarios.test.tsx +1165 -0
- package/src/__tests__/schemas/transformers/SerializationErrorHandling.test.ts +602 -0
- package/src/__tests__/schemas/transformers/SerializationIntegration.test.tsx +691 -0
- package/src/__tests__/schemas/transformers/SerializationPerformance.test.ts +460 -0
- package/src/__tests__/schemas/transformers/TestAutomation.test.ts +597 -0
- package/src/{utils/__tests__ → __tests__/utils}/nested-dom-fix.test.tsx +1 -1
- package/src/components/ErrorBoundary.tsx +8 -8
- package/src/components/Html.tsx +147 -44
- package/src/components/Logo.tsx +198 -100
- package/src/components/Markdown.tsx +125 -16
- package/src/components/QwickApp.tsx +64 -31
- package/src/components/QwickIcon.tsx +59 -0
- package/src/components/SafeSpan.tsx +65 -10
- package/src/components/Scaffold.tsx +2 -8
- package/src/components/base/ModelView.tsx +199 -0
- package/src/components/base/index.ts +11 -0
- package/src/components/blocks/Article.tsx +57 -18
- package/src/components/blocks/Code.md +529 -0
- package/src/components/blocks/Code.tsx +102 -15
- package/src/components/blocks/CoverImageHeader.tsx +9 -4
- package/src/components/blocks/FeatureCard.tsx +1 -2
- package/src/components/blocks/FeatureGrid.tsx +19 -1
- package/src/components/blocks/Footer.tsx +13 -1
- package/src/components/blocks/HeroBlock.tsx +87 -20
- package/src/components/blocks/Image.tsx +395 -0
- package/src/components/blocks/PageBannerHeader.tsx +14 -12
- package/src/components/blocks/ProductCard.tsx +1 -1
- package/src/components/blocks/Section.tsx +113 -8
- package/src/components/blocks/Text.tsx +285 -0
- package/src/components/blocks/index.ts +4 -0
- package/src/components/buttons/Button.tsx +184 -15
- package/src/components/forms/FormBlock.tsx +70 -17
- package/src/components/index.ts +5 -0
- package/src/components/input/ChoiceInputField.tsx +48 -18
- package/src/components/input/HtmlInputField.tsx +48 -18
- package/src/components/input/SelectInputField.tsx +48 -16
- package/src/components/input/SwitchInputField.tsx +48 -17
- package/src/components/input/TextField.tsx +41 -1
- package/src/components/input/TextInputField.tsx +52 -18
- package/src/components/layout/GridCell.tsx +118 -9
- package/src/components/layout/GridLayout.tsx +125 -24
- package/src/components/pages/FormPage.tsx +0 -1
- package/src/components/pages/Page.css +304 -332
- package/src/components/pages/Page.tsx +307 -255
- package/src/components/pages/index.ts +2 -2
- package/src/config/AppConfig.ts +133 -0
- package/src/config/AppConfigBuilder.ts +421 -0
- package/src/config/__tests__/AppConfig.test.ts +385 -0
- package/src/config/__tests__/AppConfigBuilder.test.ts +432 -0
- package/src/config/index.ts +24 -0
- package/src/config/types.ts +170 -0
- package/src/config.ts +25 -0
- package/src/contexts/PrintModeContext.tsx +332 -0
- package/src/contexts/QwickAppContext.tsx +2 -2
- package/src/contexts/index.ts +2 -0
- package/src/hooks/index.ts +5 -1
- package/src/hooks/usePrintMode.ts +73 -0
- package/src/index.ts +3 -0
- package/src/schemas/CodeSchema.ts +3 -3
- package/src/schemas/CollapsibleLayoutSchema.ts +2 -1
- package/src/schemas/ContentSchema.ts +2 -1
- package/src/schemas/GridCellSchema.ts +164 -0
- package/src/schemas/GridLayoutSchema.ts +133 -0
- package/src/schemas/HtmlSchema.ts +47 -0
- package/src/schemas/ImageSchema.ts +235 -0
- package/src/schemas/LogoSchema.ts +241 -0
- package/src/schemas/MarkdownSchema.ts +47 -0
- package/src/schemas/PageTemplateSchema.ts +186 -0
- package/src/schemas/PrintConfigSchema.ts +207 -0
- package/src/schemas/README.md +661 -0
- package/src/schemas/SectionSchema.ts +2 -1
- package/src/schemas/TextSchema.ts +329 -0
- package/src/schemas/ViewModelSchema.ts +115 -0
- package/src/schemas/index.ts +21 -2
- package/src/schemas/transformers/ComponentTransformer.ts +403 -0
- package/src/schemas/transformers/ReactNodeTransformer.ts +236 -0
- package/src/schemas/transformers/registry.ts +72 -0
- package/src/schemas/types/Serializable.ts +51 -0
- package/src/stories/AccessibilityProvider.stories.tsx +253 -253
- package/src/stories/Article.stories.tsx +433 -433
- package/src/stories/Button.stories.tsx +1 -1
- package/src/stories/CardListGrid.stories.tsx +451 -451
- package/src/stories/ChoiceInputField.stories.tsx +503 -503
- package/src/stories/Code.stories.tsx +1 -1
- package/src/stories/CollapsibleLayout.stories.tsx +1414 -1414
- package/src/stories/Content.stories.tsx +393 -393
- package/src/stories/CoverImageHeader.stories.tsx +701 -701
- package/src/stories/DataBinding.advanced.stories.tsx +432 -432
- package/src/stories/DataProvider.stories.tsx +1192 -1192
- package/src/stories/FeatureCard.stories.tsx +557 -557
- package/src/stories/FeatureGrid.stories.tsx +594 -594
- package/src/stories/Footer.stories.tsx +640 -640
- package/src/stories/FormBlock.stories.tsx +760 -760
- package/src/stories/FormComponents.stories.tsx +349 -541
- package/src/stories/GridCell.stories.tsx +417 -0
- package/src/stories/GridLayout.stories.tsx +353 -0
- package/src/stories/HeroBlock.stories.tsx +862 -373
- package/src/stories/HtmlInputField.stories.tsx +474 -474
- package/src/stories/Image.stories.tsx +819 -0
- package/src/stories/Introduction.stories.tsx +667 -667
- package/src/stories/LayoutBlocks.stories.tsx +324 -324
- package/src/stories/Logo.stories.tsx +165 -6
- package/src/stories/Markdown.stories.tsx +137 -137
- package/src/stories/ModelView.stories.tsx +477 -0
- package/src/stories/Page.stories.tsx +688 -688
- package/src/stories/PageBannerHeader.stories.tsx +864 -864
- package/src/stories/PaletteSwitcher.stories.tsx +119 -119
- package/src/stories/ProductCard.stories.tsx +424 -424
- package/src/stories/QwickApp.stories.tsx +368 -368
- package/src/stories/ResponsiveMenu.stories.tsx +249 -249
- package/src/stories/SafeSpan.stories.tsx +531 -531
- package/src/stories/Section.stories.tsx +90 -2
- package/src/stories/SelectInputField.stories.tsx +524 -524
- package/src/stories/Text.stories.tsx +560 -0
- package/src/stories/TextInputField.stories.tsx +443 -443
- package/src/stories/ThemeSwitcher.stories.tsx +123 -123
- package/src/utils/htmlTransform.tsx +74 -53
- package/src/utils/reactUtils.tsx +57 -6
- package/dist/index.bundled.css +0 -12
- /package/src/{hooks/__tests__ → __tests__/hooks}/useDataBinding.test.tsx.disabled +0 -0
- /package/src/{schemas/__tests__ → __tests__/schemas}/builders.test.ts +0 -0
- /package/src/{utils/__tests__ → __tests__/utils}/createDataDrivenComponent.test.tsx.disabled +0 -0
- /package/src/{utils/__tests__ → __tests__/utils}/htmlTransform.test.tsx +0 -0
- /package/src/{utils/__tests__ → __tests__/utils}/optional-logging.test.ts +0 -0
|
@@ -12,104 +12,104 @@ import { Button, Code, FormBlock, QwickApp, QwickAppsLogo, SelectInputField, Tex
|
|
|
12
12
|
|
|
13
13
|
// Sample form block data for different use cases
|
|
14
14
|
const sampleCmsData = {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
15
|
+
'formBlocks': {
|
|
16
|
+
'login-form': {
|
|
17
|
+
title: 'Welcome Back',
|
|
18
|
+
description: 'Sign in to your account to continue',
|
|
19
|
+
maxWidth: 'sm',
|
|
20
|
+
background: 'default',
|
|
21
|
+
form: null, // Will be provided via children in stories
|
|
22
|
+
footer: null // Will be provided via children in stories
|
|
23
|
+
},
|
|
24
|
+
'registration-form': {
|
|
25
|
+
title: 'Create Your Account',
|
|
26
|
+
description: 'Join thousands of developers building with QwickApps React Framework',
|
|
27
|
+
maxWidth: 'md',
|
|
28
|
+
background: 'gradient',
|
|
29
|
+
form: null,
|
|
30
|
+
footer: null
|
|
31
|
+
},
|
|
32
|
+
'contact-form': {
|
|
33
|
+
title: 'Get In Touch',
|
|
34
|
+
description: 'We\'d love to hear from you. Send us a message and we\'ll respond as soon as possible.',
|
|
35
|
+
maxWidth: 'md',
|
|
36
|
+
background: 'default',
|
|
37
|
+
form: null,
|
|
38
|
+
footer: null
|
|
39
|
+
},
|
|
40
|
+
'survey-form': {
|
|
41
|
+
title: 'Customer Feedback Survey',
|
|
42
|
+
description: 'Help us improve by sharing your thoughts and experiences',
|
|
43
|
+
maxWidth: 'lg',
|
|
44
|
+
background: 'gradient',
|
|
45
|
+
form: null,
|
|
46
|
+
footer: null
|
|
47
|
+
},
|
|
48
|
+
'subscription-form': {
|
|
49
|
+
title: 'Choose Your Plan',
|
|
50
|
+
description: 'Select the perfect plan for your needs and get started today',
|
|
51
|
+
maxWidth: 'md',
|
|
52
|
+
background: 'image',
|
|
53
|
+
backgroundImage: 'https://images.unsplash.com/photo-1557804506-669a67965ba0?ixlib=rb-4.0.3&auto=format&fit=crop&w=1000&q=80',
|
|
54
|
+
form: null,
|
|
55
|
+
footer: null
|
|
56
|
+
},
|
|
57
|
+
'newsletter-form': {
|
|
58
|
+
title: 'Stay Updated',
|
|
59
|
+
description: 'Subscribe to our newsletter for the latest updates and insights',
|
|
60
|
+
maxWidth: 'sm',
|
|
61
|
+
background: 'default',
|
|
62
|
+
form: null,
|
|
63
|
+
footer: null
|
|
64
|
+
},
|
|
65
|
+
'profile-form': {
|
|
66
|
+
title: 'Edit Profile',
|
|
67
|
+
description: 'Update your personal information and preferences',
|
|
68
|
+
maxWidth: 'md',
|
|
69
|
+
background: 'default',
|
|
70
|
+
form: null,
|
|
71
|
+
footer: null
|
|
72
|
+
},
|
|
73
|
+
'feedback-form': {
|
|
74
|
+
title: 'Share Your Feedback',
|
|
75
|
+
description: 'Your input helps us build better products and experiences',
|
|
76
|
+
maxWidth: 'lg',
|
|
77
|
+
background: 'gradient',
|
|
78
|
+
form: null,
|
|
79
|
+
status: 'info',
|
|
80
|
+
message: 'Your feedback is important to us and will be reviewed by our team.'
|
|
81
|
+
},
|
|
82
|
+
'error-form': {
|
|
83
|
+
title: 'Form Submission',
|
|
84
|
+
description: 'There was an issue processing your request',
|
|
85
|
+
maxWidth: 'sm',
|
|
86
|
+
background: 'default',
|
|
87
|
+
form: null,
|
|
88
|
+
status: 'error',
|
|
89
|
+
message: 'Please check your information and try again.'
|
|
90
|
+
},
|
|
91
|
+
'success-form': {
|
|
92
|
+
title: 'Thank You!',
|
|
93
|
+
description: 'Your submission has been received successfully',
|
|
94
|
+
maxWidth: 'sm',
|
|
95
|
+
background: 'default',
|
|
96
|
+
form: null,
|
|
97
|
+
status: 'success',
|
|
98
|
+
message: 'We will get back to you within 24 hours.'
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
101
|
};
|
|
102
102
|
|
|
103
103
|
const dataProvider = new JsonDataProvider({ data: sampleCmsData });
|
|
104
104
|
|
|
105
105
|
const meta = {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
106
|
+
title: 'Forms/FormBlock',
|
|
107
|
+
component: FormBlock,
|
|
108
|
+
parameters: {
|
|
109
|
+
layout: 'fullscreen',
|
|
110
|
+
docs: {
|
|
111
|
+
description: {
|
|
112
|
+
component: `FormBlock is a comprehensive form layout component that provides consistent styling and structure for form interfaces with data binding support.
|
|
113
113
|
|
|
114
114
|
**Key Features:**
|
|
115
115
|
- **Flexible Layouts**: Support for different container widths (xs, sm, md, lg)
|
|
@@ -128,10 +128,10 @@ const meta = {
|
|
|
128
128
|
- Profile and settings management
|
|
129
129
|
- Subscription and payment forms
|
|
130
130
|
- Any form requiring professional layout and presentation`,
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
tags: ['autodocs'],
|
|
135
135
|
} satisfies Meta<typeof FormBlock>;
|
|
136
136
|
|
|
137
137
|
export default meta;
|
|
@@ -139,696 +139,696 @@ type Story = StoryObj<typeof FormBlock>;
|
|
|
139
139
|
|
|
140
140
|
// Traditional Usage Examples
|
|
141
141
|
export const LoginForm: Story = {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
142
|
+
render: () => (
|
|
143
|
+
<QwickApp appId="form-login" appName='Login Form'>
|
|
144
|
+
<FormBlock
|
|
145
|
+
title="Welcome Back"
|
|
146
|
+
description="Sign in to your account to continue"
|
|
147
|
+
maxWidth="sm"
|
|
148
|
+
coverImage={<QwickAppsLogo size="medium" />}
|
|
149
|
+
form={
|
|
150
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
|
|
151
|
+
<TextInputField
|
|
152
|
+
label="Email Address"
|
|
153
|
+
type="email"
|
|
154
|
+
placeholder="your.email@example.com"
|
|
155
|
+
required={true}
|
|
156
|
+
onChange={(value) => console.log('Email:', value)}
|
|
157
|
+
/>
|
|
158
|
+
<TextInputField
|
|
159
|
+
label="Password"
|
|
160
|
+
type="password"
|
|
161
|
+
placeholder="Enter your password"
|
|
162
|
+
required={true}
|
|
163
|
+
onChange={(value) => console.log('Password:', '***')}
|
|
164
|
+
/>
|
|
165
|
+
<Button
|
|
166
|
+
label="Sign In"
|
|
167
|
+
variant="primary"
|
|
168
|
+
fullWidth={true}
|
|
169
|
+
onClick={() => console.log('Login submitted')}
|
|
170
|
+
/>
|
|
171
|
+
</Box>
|
|
172
|
+
}
|
|
173
|
+
footer={
|
|
174
|
+
<Typography variant="body2" color="text.secondary">
|
|
175
|
+
Don't have an account? <Link href="#" color="primary">Sign up here</Link>
|
|
176
|
+
</Typography>
|
|
177
|
+
}
|
|
178
|
+
/>
|
|
179
|
+
</QwickApp>
|
|
180
|
+
),
|
|
181
|
+
parameters: {
|
|
182
|
+
docs: {
|
|
183
|
+
description: {
|
|
184
|
+
story: 'Basic login form with email and password fields in a clean layout.',
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
188
|
};
|
|
189
189
|
|
|
190
190
|
export const RegistrationForm: Story = {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
191
|
+
render: () => (
|
|
192
|
+
<QwickApp appId="form-registration" appName='Registration Form'>
|
|
193
|
+
<FormBlock
|
|
194
|
+
title="Create Your Account"
|
|
195
|
+
description="Join thousands of developers building with QwickApps React Framework"
|
|
196
|
+
maxWidth="md"
|
|
197
|
+
background="gradient"
|
|
198
|
+
coverImage={<QwickAppsLogo size="medium" />}
|
|
199
|
+
form={
|
|
200
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
|
|
201
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: { xs: '1fr', md: '1fr 1fr' }, gap: 3 }}>
|
|
202
|
+
<TextInputField
|
|
203
|
+
label="First Name"
|
|
204
|
+
placeholder="John"
|
|
205
|
+
required={true}
|
|
206
|
+
onChange={(value) => console.log('First Name:', value)}
|
|
207
|
+
/>
|
|
208
|
+
<TextInputField
|
|
209
|
+
label="Last Name"
|
|
210
|
+
placeholder="Doe"
|
|
211
|
+
required={true}
|
|
212
|
+
onChange={(value) => console.log('Last Name:', value)}
|
|
213
|
+
/>
|
|
214
|
+
</Box>
|
|
215
|
+
<TextInputField
|
|
216
|
+
label="Email Address"
|
|
217
|
+
type="email"
|
|
218
|
+
placeholder="john.doe@example.com"
|
|
219
|
+
required={true}
|
|
220
|
+
helperText="We'll never share your email address"
|
|
221
|
+
onChange={(value) => console.log('Email:', value)}
|
|
222
|
+
/>
|
|
223
|
+
<TextInputField
|
|
224
|
+
label="Password"
|
|
225
|
+
type="password"
|
|
226
|
+
placeholder="Create a strong password"
|
|
227
|
+
required={true}
|
|
228
|
+
helperText="Minimum 8 characters with mixed case and numbers"
|
|
229
|
+
onChange={(value) => console.log('Password:', '***')}
|
|
230
|
+
/>
|
|
231
|
+
<SelectInputField
|
|
232
|
+
label="Country"
|
|
233
|
+
placeholder="Select your country"
|
|
234
|
+
required={true}
|
|
235
|
+
options={[
|
|
236
|
+
{ label: 'United States', value: 'us' },
|
|
237
|
+
{ label: 'Canada', value: 'ca' },
|
|
238
|
+
{ label: 'United Kingdom', value: 'uk' },
|
|
239
|
+
{ label: 'Germany', value: 'de' },
|
|
240
|
+
{ label: 'Australia', value: 'au' }
|
|
241
|
+
]}
|
|
242
|
+
onChange={(value) => console.log('Country:', value)}
|
|
243
|
+
/>
|
|
244
|
+
<Button
|
|
245
|
+
label="Create Account"
|
|
246
|
+
variant="primary"
|
|
247
|
+
fullWidth={true}
|
|
248
|
+
buttonSize="large"
|
|
249
|
+
onClick={() => console.log('Registration submitted')}
|
|
250
|
+
/>
|
|
251
|
+
</Box>
|
|
252
|
+
}
|
|
253
|
+
footer={
|
|
254
|
+
<Typography variant="body2" color="text.secondary">
|
|
255
|
+
Already have an account? <Link href="#" color="primary">Sign in here</Link>
|
|
256
|
+
</Typography>
|
|
257
|
+
}
|
|
258
|
+
/>
|
|
259
|
+
</QwickApp>
|
|
260
|
+
),
|
|
261
|
+
parameters: {
|
|
262
|
+
docs: {
|
|
263
|
+
description: {
|
|
264
|
+
story: 'Registration form with gradient background and comprehensive user information fields.',
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
268
|
};
|
|
269
269
|
|
|
270
270
|
export const ContactForm: Story = {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
271
|
+
render: () => (
|
|
272
|
+
<QwickApp appId="form-contact" appName='Contact Form'>
|
|
273
|
+
<FormBlock
|
|
274
|
+
title="Get In Touch"
|
|
275
|
+
description="We'd love to hear from you. Send us a message and we'll respond as soon as possible."
|
|
276
|
+
maxWidth="md"
|
|
277
|
+
coverImage={<QwickAppsLogo size="medium" />}
|
|
278
|
+
form={
|
|
279
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
|
|
280
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: { xs: '1fr', md: '1fr 1fr' }, gap: 3 }}>
|
|
281
|
+
<TextInputField
|
|
282
|
+
label="Full Name"
|
|
283
|
+
placeholder="Your full name"
|
|
284
|
+
required={true}
|
|
285
|
+
onChange={(value) => console.log('Name:', value)}
|
|
286
|
+
/>
|
|
287
|
+
<TextInputField
|
|
288
|
+
label="Email Address"
|
|
289
|
+
type="email"
|
|
290
|
+
placeholder="your.email@example.com"
|
|
291
|
+
required={true}
|
|
292
|
+
onChange={(value) => console.log('Email:', value)}
|
|
293
|
+
/>
|
|
294
|
+
</Box>
|
|
295
|
+
<TextInputField
|
|
296
|
+
label="Subject"
|
|
297
|
+
placeholder="What is this regarding?"
|
|
298
|
+
required={true}
|
|
299
|
+
onChange={(value) => console.log('Subject:', value)}
|
|
300
|
+
/>
|
|
301
|
+
<TextInputField
|
|
302
|
+
label="Message"
|
|
303
|
+
placeholder="Tell us more about your inquiry..."
|
|
304
|
+
multiline={true}
|
|
305
|
+
rows={5}
|
|
306
|
+
required={true}
|
|
307
|
+
onChange={(value) => console.log('Message:', value)}
|
|
308
|
+
/>
|
|
309
|
+
<Button
|
|
310
|
+
label="Send Message"
|
|
311
|
+
variant="primary"
|
|
312
|
+
fullWidth={true}
|
|
313
|
+
onClick={() => console.log('Contact form submitted')}
|
|
314
|
+
/>
|
|
315
|
+
</Box>
|
|
316
|
+
}
|
|
317
|
+
footer={
|
|
318
|
+
<Typography variant="body2" color="text.secondary" sx={{ textAlign: 'center' }}>
|
|
319
|
+
Need immediate assistance? Call us at <Link href="tel:+1-555-0123" color="primary">+1-555-0123</Link>
|
|
320
|
+
</Typography>
|
|
321
|
+
}
|
|
322
|
+
/>
|
|
323
|
+
</QwickApp>
|
|
324
|
+
),
|
|
325
|
+
parameters: {
|
|
326
|
+
docs: {
|
|
327
|
+
description: {
|
|
328
|
+
story: 'Contact form with comprehensive fields and professional layout.',
|
|
329
|
+
},
|
|
330
|
+
},
|
|
331
|
+
},
|
|
332
332
|
};
|
|
333
333
|
|
|
334
334
|
export const WithStatusMessages: Story = {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
335
|
+
render: () => (
|
|
336
|
+
<QwickApp appId="form-status" appName='QwickApps'>
|
|
337
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 4 }}>
|
|
338
|
+
|
|
339
|
+
{/* Info Status */}
|
|
340
|
+
<FormBlock
|
|
341
|
+
title="Newsletter Signup"
|
|
342
|
+
description="Stay updated with our latest news"
|
|
343
|
+
maxWidth="sm"
|
|
344
|
+
status="info"
|
|
345
|
+
message="Your subscription helps us create better content for you."
|
|
346
|
+
coverImage={<QwickAppsLogo size="medium" />}
|
|
347
|
+
form={
|
|
348
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
|
|
349
|
+
<TextInputField
|
|
350
|
+
label="Email Address"
|
|
351
|
+
type="email"
|
|
352
|
+
placeholder="your.email@example.com"
|
|
353
|
+
required={true}
|
|
354
|
+
onChange={(value) => console.log('Email:', value)}
|
|
355
|
+
/>
|
|
356
|
+
<Button
|
|
357
|
+
label="Subscribe"
|
|
358
|
+
variant="primary"
|
|
359
|
+
fullWidth={true}
|
|
360
|
+
onClick={() => console.log('Newsletter signup')}
|
|
361
|
+
/>
|
|
362
|
+
</Box>
|
|
363
|
+
}
|
|
364
|
+
/>
|
|
365
|
+
|
|
366
|
+
{/* Success Status */}
|
|
367
|
+
<FormBlock
|
|
368
|
+
title="Thank You!"
|
|
369
|
+
description="Your submission has been received"
|
|
370
|
+
maxWidth="sm"
|
|
371
|
+
status="success"
|
|
372
|
+
message="We will get back to you within 24 hours."
|
|
373
|
+
form={
|
|
374
|
+
<Button
|
|
375
|
+
label="Go Back to Homepage"
|
|
376
|
+
variant="outlined"
|
|
377
|
+
fullWidth={true}
|
|
378
|
+
onClick={() => console.log('Back to home')}
|
|
379
|
+
/>
|
|
380
|
+
}
|
|
381
|
+
/>
|
|
382
|
+
|
|
383
|
+
{/* Error Status */}
|
|
384
|
+
<FormBlock
|
|
385
|
+
title="Form Error"
|
|
386
|
+
description="There was an issue processing your request"
|
|
387
|
+
maxWidth="sm"
|
|
388
|
+
status="error"
|
|
389
|
+
message="Please check your information and try again."
|
|
390
|
+
coverImage={<QwickAppsLogo size="medium" />}
|
|
391
|
+
form={
|
|
392
|
+
<Box sx={{ display: 'flex', gap: 2 }}>
|
|
393
|
+
<Button
|
|
394
|
+
label="Try Again"
|
|
395
|
+
variant="primary"
|
|
396
|
+
fullWidth={true}
|
|
397
|
+
onClick={() => console.log('Retry')}
|
|
398
|
+
/>
|
|
399
|
+
<Button
|
|
400
|
+
label="Contact Support"
|
|
401
|
+
variant="outlined"
|
|
402
|
+
fullWidth={true}
|
|
403
|
+
onClick={() => console.log('Contact support')}
|
|
404
|
+
/>
|
|
405
|
+
</Box>
|
|
406
|
+
}
|
|
407
|
+
/>
|
|
408
|
+
|
|
409
|
+
</Box>
|
|
410
|
+
</QwickApp>
|
|
411
|
+
),
|
|
412
|
+
parameters: {
|
|
413
|
+
docs: {
|
|
414
|
+
description: {
|
|
415
|
+
story: 'Form blocks with different status message types: info, success, and error.',
|
|
416
|
+
},
|
|
417
|
+
},
|
|
418
|
+
},
|
|
419
419
|
};
|
|
420
420
|
|
|
421
421
|
export const BackgroundVariants: Story = {
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
422
|
+
render: () => (
|
|
423
|
+
<QwickApp appId="form-backgrounds" appName='Form Background Variants'>
|
|
424
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
|
|
425
|
+
|
|
426
|
+
{/* Default Background */}
|
|
427
|
+
<FormBlock
|
|
428
|
+
title="Default Background"
|
|
429
|
+
description="Clean and simple form layout"
|
|
430
|
+
maxWidth="sm"
|
|
431
|
+
coverImage={<QwickAppsLogo size="medium" />}
|
|
432
|
+
form={
|
|
433
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
|
|
434
|
+
<TextInputField
|
|
435
|
+
label="Name"
|
|
436
|
+
placeholder="Your name"
|
|
437
|
+
onChange={(value) => console.log('Name:', value)}
|
|
438
|
+
/>
|
|
439
|
+
<Button label="Submit" variant="primary" fullWidth={true} />
|
|
440
|
+
</Box>
|
|
441
|
+
}
|
|
442
|
+
/>
|
|
443
|
+
|
|
444
|
+
{/* Gradient Background */}
|
|
445
|
+
<FormBlock
|
|
446
|
+
title="Gradient Background"
|
|
447
|
+
description="Eye-catching gradient styling"
|
|
448
|
+
maxWidth="sm"
|
|
449
|
+
background="gradient"
|
|
450
|
+
form={
|
|
451
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
|
|
452
|
+
<TextInputField
|
|
453
|
+
label="Name"
|
|
454
|
+
placeholder="Your name"
|
|
455
|
+
onChange={(value) => console.log('Name:', value)}
|
|
456
|
+
/>
|
|
457
|
+
<Button label="Submit" variant="primary" fullWidth={true} />
|
|
458
|
+
</Box>
|
|
459
|
+
}
|
|
460
|
+
/>
|
|
461
|
+
|
|
462
|
+
</Box>
|
|
463
|
+
</QwickApp>
|
|
464
|
+
),
|
|
465
|
+
parameters: {
|
|
466
|
+
docs: {
|
|
467
|
+
description: {
|
|
468
|
+
story: 'FormBlock with different background variants: default and gradient.',
|
|
469
|
+
},
|
|
470
|
+
},
|
|
471
|
+
},
|
|
472
472
|
};
|
|
473
473
|
|
|
474
474
|
// Data Binding Examples
|
|
475
475
|
export const DataBindingBasic: Story = {
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
476
|
+
render: () => (
|
|
477
|
+
<QwickApp appId="form-data-binding" appName='FormBlock Data Binding' dataSource={{ dataProvider }}>
|
|
478
|
+
<Box>
|
|
479
|
+
|
|
480
|
+
<Box sx={{ p: 4, backgroundColor: 'background.paper', mb: 4 }}>
|
|
481
|
+
<Typography variant="h5" gutterBottom> Data-Driven Form Layout</Typography>
|
|
482
|
+
<Typography variant="body1" sx={{ mb: 3, opacity: 0.8 }}>
|
|
483
|
+
FormBlock components can be driven by CMS data, loading layout configuration from your data source while providing custom form content.
|
|
484
|
+
</Typography>
|
|
485
|
+
|
|
486
|
+
<Code title="Usage" language="tsx">{`<FormBlock dataSource="formBlocks.login-form">
|
|
487
|
+
<TextInputField label="Email" type="email" />
|
|
488
|
+
<TextInputField label="Password" type="password" />
|
|
489
|
+
<Button label="Sign In" variant="primary" />
|
|
490
490
|
</FormBlock>`}</Code>
|
|
491
491
|
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
492
|
+
<Code title="Data Structure" language="json">{JSON.stringify(sampleCmsData.formBlocks['login-form'], null, 2)}</Code>
|
|
493
|
+
</Box>
|
|
494
|
+
|
|
495
|
+
<FormBlock
|
|
496
|
+
dataSource="formBlocks.login-form"
|
|
497
|
+
coverImage={<QwickAppsLogo size="medium" />}
|
|
498
|
+
form={
|
|
499
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
|
|
500
|
+
<TextInputField
|
|
501
|
+
label="Email Address"
|
|
502
|
+
type="email"
|
|
503
|
+
placeholder="your.email@example.com"
|
|
504
|
+
required={true}
|
|
505
|
+
onChange={(value) => console.log('Email:', value)}
|
|
506
|
+
/>
|
|
507
|
+
<TextInputField
|
|
508
|
+
label="Password"
|
|
509
|
+
type="password"
|
|
510
|
+
placeholder="Enter your password"
|
|
511
|
+
required={true}
|
|
512
|
+
onChange={(value) => console.log('Password:', '***')}
|
|
513
|
+
/>
|
|
514
|
+
<Button
|
|
515
|
+
label="Sign In"
|
|
516
|
+
variant="primary"
|
|
517
|
+
fullWidth={true}
|
|
518
|
+
onClick={() => console.log('Login submitted')}
|
|
519
|
+
/>
|
|
520
|
+
</Box>
|
|
521
|
+
}
|
|
522
|
+
footer={
|
|
523
|
+
<Typography variant="body2" color="text.secondary">
|
|
524
|
+
Don't have an account? <Link href="#" color="primary">Sign up here</Link>
|
|
525
|
+
</Typography>
|
|
526
|
+
}
|
|
527
|
+
/>
|
|
528
|
+
|
|
529
|
+
</Box>
|
|
530
|
+
</QwickApp>
|
|
531
|
+
),
|
|
532
|
+
parameters: {
|
|
533
|
+
docs: {
|
|
534
|
+
description: {
|
|
535
|
+
story: 'FormBlock with data binding - layout configuration resolved from CMS data while form content is provided as children.',
|
|
536
|
+
},
|
|
537
|
+
},
|
|
538
|
+
},
|
|
539
539
|
};
|
|
540
540
|
|
|
541
541
|
export const DataBindingAdvanced: Story = {
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
542
|
+
render: () => (
|
|
543
|
+
<QwickApp appId="form-data-advanced" appName='Advanced FormBlock Data Binding' dataSource={{ dataProvider }}>
|
|
544
|
+
<Box>
|
|
545
|
+
|
|
546
|
+
<Box sx={{ p: 4, backgroundColor: 'background.paper', mb: 4 }}>
|
|
547
|
+
<Typography variant="h5" gutterBottom> Multiple Form Types</Typography>
|
|
548
|
+
<Typography variant="body1" sx={{ mb: 3, opacity: 0.8 }}>
|
|
549
|
+
Different FormBlock instances can load different layout configurations from separate data sources.
|
|
550
|
+
</Typography>
|
|
551
|
+
</Box>
|
|
552
|
+
|
|
553
|
+
{/* Authentication Forms */}
|
|
554
|
+
<Box sx={{ mb: 6 }}>
|
|
555
|
+
<Typography variant="h4" gutterBottom sx={{ mb: 4 }}>Authentication Forms</Typography>
|
|
556
|
+
|
|
557
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
|
|
558
|
+
<FormBlock
|
|
559
|
+
dataSource="formBlocks.login-form"
|
|
560
|
+
coverImage={<QwickAppsLogo size="medium" />}
|
|
561
|
+
form={
|
|
562
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
|
|
563
|
+
<TextInputField
|
|
564
|
+
label="Email"
|
|
565
|
+
type="email"
|
|
566
|
+
placeholder="your.email@example.com"
|
|
567
|
+
required={true}
|
|
568
|
+
/>
|
|
569
|
+
<TextInputField
|
|
570
|
+
label="Password"
|
|
571
|
+
type="password"
|
|
572
|
+
placeholder="Enter password"
|
|
573
|
+
required={true}
|
|
574
|
+
/>
|
|
575
|
+
<Button label="Sign In" variant="primary" fullWidth={true} />
|
|
576
|
+
</Box>
|
|
577
|
+
}
|
|
578
|
+
/>
|
|
579
|
+
|
|
580
|
+
<FormBlock
|
|
581
|
+
dataSource="formBlocks.registration-form"
|
|
582
|
+
coverImage={<QwickAppsLogo size="medium" />}
|
|
583
|
+
form={
|
|
584
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
|
|
585
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: { xs: '1fr', md: '1fr 1fr' }, gap: 3 }}>
|
|
586
|
+
<TextInputField label="First Name" placeholder="John" required={true} />
|
|
587
|
+
<TextInputField label="Last Name" placeholder="Doe" required={true} />
|
|
588
|
+
</Box>
|
|
589
|
+
<TextInputField label="Email" type="email" placeholder="john@example.com" required={true} />
|
|
590
|
+
<TextInputField label="Password" type="password" placeholder="Create password" required={true} />
|
|
591
|
+
<Button label="Create Account" variant="primary" fullWidth={true} buttonSize="large" />
|
|
592
|
+
</Box>
|
|
593
|
+
}
|
|
594
|
+
/>
|
|
595
|
+
</Box>
|
|
596
|
+
</Box>
|
|
597
|
+
|
|
598
|
+
{/* Communication Forms */}
|
|
599
|
+
<Box sx={{ mb: 6 }}>
|
|
600
|
+
<Typography variant="h4" gutterBottom sx={{ mb: 4 }}>Communication Forms</Typography>
|
|
601
|
+
|
|
602
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
|
|
603
|
+
<FormBlock
|
|
604
|
+
dataSource="formBlocks.contact-form"
|
|
605
|
+
coverImage={<QwickAppsLogo size="medium" />}
|
|
606
|
+
form={
|
|
607
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
|
|
608
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: { xs: '1fr', md: '1fr 1fr' }, gap: 3 }}>
|
|
609
|
+
<TextInputField label="Name" placeholder="Your name" required={true} />
|
|
610
|
+
<TextInputField label="Email" type="email" placeholder="your.email@example.com" required={true} />
|
|
611
|
+
</Box>
|
|
612
|
+
<TextInputField label="Subject" placeholder="What's this about?" required={true} />
|
|
613
|
+
<TextInputField label="Message" multiline={true} rows={4} placeholder="Your message..." required={true} />
|
|
614
|
+
<Button label="Send Message" variant="primary" fullWidth={true} />
|
|
615
|
+
</Box>
|
|
616
|
+
}
|
|
617
|
+
/>
|
|
618
|
+
|
|
619
|
+
<FormBlock
|
|
620
|
+
dataSource="formBlocks.newsletter-form"
|
|
621
|
+
form={
|
|
622
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
|
|
623
|
+
<TextInputField label="Email" type="email" placeholder="your.email@example.com" required={true} />
|
|
624
|
+
<Button label="Subscribe" variant="primary" fullWidth={true} />
|
|
625
|
+
</Box>
|
|
626
|
+
}
|
|
627
|
+
/>
|
|
628
|
+
</Box>
|
|
629
|
+
</Box>
|
|
630
|
+
|
|
631
|
+
</Box>
|
|
632
|
+
</QwickApp>
|
|
633
|
+
),
|
|
634
|
+
parameters: {
|
|
635
|
+
docs: {
|
|
636
|
+
description: {
|
|
637
|
+
story: 'Advanced data binding with multiple form types showcasing different layouts and background configurations.',
|
|
638
|
+
},
|
|
639
|
+
},
|
|
640
|
+
},
|
|
641
641
|
};
|
|
642
642
|
|
|
643
643
|
export const DataBindingWithFallback: Story = {
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
644
|
+
render: () => (
|
|
645
|
+
<QwickApp appId="form-fallback" appName='FormBlock Data Binding with Fallback' dataSource={{ dataProvider }}>
|
|
646
|
+
<Box>
|
|
647
|
+
|
|
648
|
+
<Box sx={{ p: 4, backgroundColor: 'background.paper', mb: 4 }}>
|
|
649
|
+
<Typography variant="h5" gutterBottom> Fallback Support</Typography>
|
|
650
|
+
<Typography variant="body1" sx={{ mb: 3, opacity: 0.8 }}>
|
|
651
|
+
FormBlock components gracefully handle missing data sources with fallback configurations.
|
|
652
|
+
</Typography>
|
|
653
|
+
|
|
654
|
+
<Code title="Fallback Usage" language="tsx">{`<FormBlock
|
|
655
|
+
dataSource="nonexistent.form"
|
|
656
|
+
title="Fallback Form"
|
|
657
|
+
description="This uses fallback configuration"
|
|
658
|
+
maxWidth="sm"
|
|
659
659
|
>
|
|
660
|
-
|
|
661
|
-
|
|
660
|
+
<TextInputField label="Name" />
|
|
661
|
+
<Button label="Submit" />
|
|
662
662
|
</FormBlock>`}</Code>
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
663
|
+
</Box>
|
|
664
|
+
|
|
665
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 6 }}>
|
|
666
|
+
<Box>
|
|
667
|
+
<Typography variant="h6" gutterBottom>Missing Data Source (Fallback)</Typography>
|
|
668
|
+
<FormBlock
|
|
669
|
+
dataSource="nonexistent.form"
|
|
670
|
+
title="Fallback Form"
|
|
671
|
+
description="This uses fallback configuration"
|
|
672
|
+
maxWidth="sm"
|
|
673
|
+
coverImage={<QwickAppsLogo size="medium" />}
|
|
674
|
+
form={
|
|
675
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
|
|
676
|
+
<TextInputField label="Name" placeholder="Your name" />
|
|
677
|
+
<Button label="Submit" variant="primary" fullWidth={true} />
|
|
678
|
+
</Box>
|
|
679
|
+
}
|
|
680
|
+
/>
|
|
681
|
+
</Box>
|
|
682
|
+
<Box>
|
|
683
|
+
<Typography variant="h6" gutterBottom>Valid Data Source</Typography>
|
|
684
|
+
<FormBlock
|
|
685
|
+
dataSource="formBlocks.login-form"
|
|
686
|
+
form={
|
|
687
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
|
|
688
|
+
<TextInputField label="Email" type="email" placeholder="your.email@example.com" />
|
|
689
|
+
<TextInputField label="Password" type="password" placeholder="Enter password" />
|
|
690
|
+
<Button label="Sign In" variant="primary" fullWidth={true} />
|
|
691
|
+
</Box>
|
|
692
|
+
}
|
|
693
|
+
/>
|
|
694
|
+
</Box>
|
|
695
|
+
</Box>
|
|
696
|
+
|
|
697
|
+
</Box>
|
|
698
|
+
</QwickApp>
|
|
699
|
+
),
|
|
700
|
+
parameters: {
|
|
701
|
+
docs: {
|
|
702
|
+
description: {
|
|
703
|
+
story: 'FormBlock with fallback configuration when dataSource is missing or unavailable.',
|
|
704
|
+
},
|
|
705
|
+
},
|
|
706
|
+
},
|
|
707
707
|
};
|
|
708
708
|
|
|
709
709
|
export const RealWorldExample: Story = {
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
710
|
+
render: () => (
|
|
711
|
+
<QwickApp appId="form-real-world" appName='Real World FormBlock Example' dataSource={{ dataProvider }}>
|
|
712
|
+
<Box>
|
|
713
|
+
|
|
714
|
+
{/* Status Messages Showcase */}
|
|
715
|
+
<Box sx={{ mb: 6 }}>
|
|
716
|
+
<Typography variant="h2" gutterBottom sx={{ textAlign: 'center', mb: 6 }}>Form Status Messages</Typography>
|
|
717
|
+
|
|
718
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
|
|
719
|
+
<FormBlock
|
|
720
|
+
dataSource="formBlocks.feedback-form"
|
|
721
|
+
coverImage={<QwickAppsLogo size="medium" />}
|
|
722
|
+
form={
|
|
723
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
|
|
724
|
+
<TextInputField label="Feedback" multiline={true} rows={4} placeholder="Share your thoughts..." />
|
|
725
|
+
<Button label="Submit Feedback" variant="primary" fullWidth={true} />
|
|
726
|
+
</Box>
|
|
727
|
+
}
|
|
728
|
+
/>
|
|
729
|
+
|
|
730
|
+
<FormBlock
|
|
731
|
+
dataSource="formBlocks.success-form"
|
|
732
|
+
form={
|
|
733
|
+
<Button label="Continue" variant="primary" fullWidth={true} />
|
|
734
|
+
}
|
|
735
|
+
/>
|
|
736
|
+
|
|
737
|
+
<FormBlock
|
|
738
|
+
dataSource="formBlocks.error-form"
|
|
739
|
+
form={
|
|
740
|
+
<Box sx={{ display: 'flex', gap: 2 }}>
|
|
741
|
+
<Button label="Try Again" variant="primary" fullWidth={true} />
|
|
742
|
+
<Button label="Get Help" variant="outlined" fullWidth={true} />
|
|
743
|
+
</Box>
|
|
744
|
+
}
|
|
745
|
+
/>
|
|
746
|
+
</Box>
|
|
747
|
+
</Box>
|
|
748
|
+
|
|
749
|
+
{/* Business Forms */}
|
|
750
|
+
<Box sx={{ mb: 6 }}>
|
|
751
|
+
<Typography variant="h2" gutterBottom sx={{ textAlign: 'center', mb: 6 }}>Business Applications</Typography>
|
|
752
|
+
|
|
753
|
+
<FormBlock
|
|
754
|
+
dataSource="formBlocks.subscription-form"
|
|
755
|
+
coverImage={<QwickAppsLogo size="medium" />}
|
|
756
|
+
form={
|
|
757
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 4 }}>
|
|
758
|
+
<SelectInputField
|
|
759
|
+
label="Subscription Plan"
|
|
760
|
+
placeholder="Choose your plan"
|
|
761
|
+
required={true}
|
|
762
|
+
options={[
|
|
763
|
+
{ label: 'Starter - $9/month', value: 'starter' },
|
|
764
|
+
{ label: 'Professional - $29/month', value: 'professional' },
|
|
765
|
+
{ label: 'Enterprise - $99/month', value: 'enterprise' }
|
|
766
|
+
]}
|
|
767
|
+
/>
|
|
768
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: { xs: '1fr', md: '1fr 1fr' }, gap: 3 }}>
|
|
769
|
+
<TextInputField label="Full Name" placeholder="John Doe" required={true} />
|
|
770
|
+
<TextInputField label="Email" type="email" placeholder="john@company.com" required={true} />
|
|
771
|
+
</Box>
|
|
772
|
+
<TextInputField label="Company Name" placeholder="Your Company Inc." />
|
|
773
|
+
<Button label="Start Subscription" variant="primary" fullWidth={true} buttonSize="large" />
|
|
774
|
+
</Box>
|
|
775
|
+
}
|
|
776
|
+
footer={
|
|
777
|
+
<Typography variant="body2" color="text.secondary" sx={{ textAlign: 'center' }}>
|
|
778
|
+
Cancel anytime. No hidden fees. <Link href="#" color="primary">View pricing details</Link>
|
|
779
|
+
</Typography>
|
|
780
|
+
}
|
|
781
|
+
/>
|
|
782
|
+
</Box>
|
|
783
|
+
|
|
784
|
+
{/* User Profile Management */}
|
|
785
|
+
<Box>
|
|
786
|
+
<Typography variant="h2" gutterBottom sx={{ textAlign: 'center', mb: 6 }}>User Management</Typography>
|
|
787
|
+
|
|
788
|
+
<FormBlock
|
|
789
|
+
dataSource="formBlocks.profile-form"
|
|
790
|
+
coverImage={<QwickAppsLogo size="medium" />}
|
|
791
|
+
form={
|
|
792
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 4 }}>
|
|
793
|
+
<Box sx={{ display: 'grid', gridTemplateColumns: { xs: '1fr', md: '1fr 1fr' }, gap: 3 }}>
|
|
794
|
+
<TextInputField label="First Name" placeholder="John" value="John" />
|
|
795
|
+
<TextInputField label="Last Name" placeholder="Doe" value="Doe" />
|
|
796
|
+
</Box>
|
|
797
|
+
<TextInputField label="Email Address" type="email" placeholder="john.doe@example.com" value="john.doe@example.com" />
|
|
798
|
+
<TextInputField label="Phone Number" type="tel" placeholder="+1 (555) 123-4567" />
|
|
799
|
+
<SelectInputField
|
|
800
|
+
label="Country"
|
|
801
|
+
value="us"
|
|
802
|
+
options={[
|
|
803
|
+
{ label: 'United States', value: 'us' },
|
|
804
|
+
{ label: 'Canada', value: 'ca' },
|
|
805
|
+
{ label: 'United Kingdom', value: 'uk' }
|
|
806
|
+
]}
|
|
807
|
+
/>
|
|
808
|
+
<TextInputField
|
|
809
|
+
label="Bio"
|
|
810
|
+
multiline={true}
|
|
811
|
+
rows={3}
|
|
812
|
+
placeholder="Tell us about yourself..."
|
|
813
|
+
value="Senior developer with expertise in React and TypeScript."
|
|
814
|
+
/>
|
|
815
|
+
<Box sx={{ display: 'flex', gap: 2 }}>
|
|
816
|
+
<Button label="Update Profile" variant="primary" fullWidth={true} />
|
|
817
|
+
<Button label="Cancel" variant="outlined" fullWidth={true} />
|
|
818
|
+
</Box>
|
|
819
|
+
</Box>
|
|
820
|
+
}
|
|
821
|
+
/>
|
|
822
|
+
</Box>
|
|
823
|
+
|
|
824
|
+
</Box>
|
|
825
|
+
</QwickApp>
|
|
826
|
+
),
|
|
827
|
+
parameters: {
|
|
828
|
+
docs: {
|
|
829
|
+
description: {
|
|
830
|
+
story: 'Real-world example showing FormBlock in various contexts: status messages, business subscriptions, and user management.',
|
|
831
|
+
},
|
|
832
|
+
},
|
|
833
|
+
},
|
|
834
834
|
};
|