@qwickapps/react-framework 1.3.4 → 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.
Files changed (325) hide show
  1. package/README.md +1688 -2
  2. package/dist/__tests__/schemas/transformers/MockSerializableComponent.d.ts +66 -0
  3. package/dist/__tests__/schemas/transformers/MockSerializableComponent.d.ts.map +1 -0
  4. package/dist/components/ErrorBoundary.d.ts +7 -0
  5. package/dist/components/ErrorBoundary.d.ts.map +1 -1
  6. package/dist/components/Html.d.ts +28 -18
  7. package/dist/components/Html.d.ts.map +1 -1
  8. package/dist/components/Logo.d.ts +12 -35
  9. package/dist/components/Logo.d.ts.map +1 -1
  10. package/dist/components/Markdown.d.ts +18 -13
  11. package/dist/components/Markdown.d.ts.map +1 -1
  12. package/dist/components/QwickApp.d.ts +16 -3
  13. package/dist/components/QwickApp.d.ts.map +1 -1
  14. package/dist/components/QwickIcon.d.ts +23 -0
  15. package/dist/components/QwickIcon.d.ts.map +1 -0
  16. package/dist/components/SafeSpan.d.ts +12 -5
  17. package/dist/components/SafeSpan.d.ts.map +1 -1
  18. package/dist/components/Scaffold.d.ts.map +1 -1
  19. package/dist/components/base/ModelView.d.ts +101 -0
  20. package/dist/components/base/ModelView.d.ts.map +1 -0
  21. package/dist/components/base/index.d.ts +11 -0
  22. package/dist/components/base/index.d.ts.map +1 -0
  23. package/dist/components/blocks/Article.d.ts +12 -2
  24. package/dist/components/blocks/Article.d.ts.map +1 -1
  25. package/dist/components/blocks/Code.d.ts +13 -2
  26. package/dist/components/blocks/Code.d.ts.map +1 -1
  27. package/dist/components/blocks/Content.d.ts.map +1 -1
  28. package/dist/components/blocks/CoverImageHeader.d.ts.map +1 -1
  29. package/dist/components/blocks/FeatureCard.d.ts.map +1 -1
  30. package/dist/components/blocks/FeatureGrid.d.ts.map +1 -1
  31. package/dist/components/blocks/Footer.d.ts.map +1 -1
  32. package/dist/components/blocks/HeroBlock.d.ts +27 -13
  33. package/dist/components/blocks/HeroBlock.d.ts.map +1 -1
  34. package/dist/components/blocks/Image.d.ts +41 -0
  35. package/dist/components/blocks/Image.d.ts.map +1 -0
  36. package/dist/components/blocks/PageBannerHeader.d.ts.map +1 -1
  37. package/dist/components/blocks/ProductCard.d.ts.map +1 -1
  38. package/dist/components/blocks/Section.d.ts +16 -2
  39. package/dist/components/blocks/Section.d.ts.map +1 -1
  40. package/dist/components/blocks/Text.d.ts +41 -0
  41. package/dist/components/blocks/Text.d.ts.map +1 -0
  42. package/dist/components/blocks/index.d.ts +4 -0
  43. package/dist/components/blocks/index.d.ts.map +1 -1
  44. package/dist/components/buttons/Button.d.ts +23 -7
  45. package/dist/components/buttons/Button.d.ts.map +1 -1
  46. package/dist/components/forms/FormBlock.d.ts +19 -13
  47. package/dist/components/forms/FormBlock.d.ts.map +1 -1
  48. package/dist/components/index.d.ts +4 -0
  49. package/dist/components/index.d.ts.map +1 -1
  50. package/dist/components/input/ChoiceInputField.d.ts +17 -11
  51. package/dist/components/input/ChoiceInputField.d.ts.map +1 -1
  52. package/dist/components/input/HtmlInputField.d.ts +17 -11
  53. package/dist/components/input/HtmlInputField.d.ts.map +1 -1
  54. package/dist/components/input/SelectInputField.d.ts +16 -10
  55. package/dist/components/input/SelectInputField.d.ts.map +1 -1
  56. package/dist/components/input/SwitchInputField.d.ts +16 -10
  57. package/dist/components/input/SwitchInputField.d.ts.map +1 -1
  58. package/dist/components/input/TextField.d.ts.map +1 -1
  59. package/dist/components/input/TextInputField.d.ts +16 -11
  60. package/dist/components/input/TextInputField.d.ts.map +1 -1
  61. package/dist/components/layout/GridCell.d.ts +23 -6
  62. package/dist/components/layout/GridCell.d.ts.map +1 -1
  63. package/dist/components/layout/GridLayout.d.ts +24 -23
  64. package/dist/components/layout/GridLayout.d.ts.map +1 -1
  65. package/dist/components/pages/FormPage.d.ts.map +1 -1
  66. package/dist/components/pages/Page.d.ts +49 -87
  67. package/dist/components/pages/Page.d.ts.map +1 -1
  68. package/dist/components/pages/index.d.ts +2 -2
  69. package/dist/components/pages/index.d.ts.map +1 -1
  70. package/dist/config/AppConfig.d.ts +49 -0
  71. package/dist/config/AppConfig.d.ts.map +1 -0
  72. package/dist/config/AppConfigBuilder.d.ts +75 -0
  73. package/dist/config/AppConfigBuilder.d.ts.map +1 -0
  74. package/dist/config/index.d.ts +13 -0
  75. package/dist/config/index.d.ts.map +1 -0
  76. package/dist/config/types.d.ts +130 -0
  77. package/dist/config/types.d.ts.map +1 -0
  78. package/dist/config.d.ts +15 -0
  79. package/dist/config.d.ts.map +1 -0
  80. package/dist/config.esm.js +451 -0
  81. package/dist/config.js +455 -0
  82. package/dist/contexts/PrintModeContext.d.ts +27 -0
  83. package/dist/contexts/PrintModeContext.d.ts.map +1 -0
  84. package/dist/contexts/QwickAppContext.d.ts +2 -2
  85. package/dist/contexts/QwickAppContext.d.ts.map +1 -1
  86. package/dist/contexts/ThemeContext.d.ts.map +1 -1
  87. package/dist/contexts/index.d.ts +2 -0
  88. package/dist/contexts/index.d.ts.map +1 -1
  89. package/dist/hooks/index.d.ts +2 -0
  90. package/dist/hooks/index.d.ts.map +1 -1
  91. package/dist/hooks/usePrintMode.d.ts +39 -0
  92. package/dist/hooks/usePrintMode.d.ts.map +1 -0
  93. package/dist/index.css +1 -1
  94. package/dist/index.d.ts +1 -0
  95. package/dist/index.d.ts.map +1 -1
  96. package/dist/index.esm.css +1 -1
  97. package/dist/index.esm.js +20722 -16021
  98. package/dist/index.js +20725 -16010
  99. package/dist/schemas/CodeSchema.d.ts +2 -1
  100. package/dist/schemas/CodeSchema.d.ts.map +1 -1
  101. package/dist/schemas/CollapsibleLayoutSchema.d.ts +2 -1
  102. package/dist/schemas/CollapsibleLayoutSchema.d.ts.map +1 -1
  103. package/dist/schemas/ContentSchema.d.ts +2 -1
  104. package/dist/schemas/ContentSchema.d.ts.map +1 -1
  105. package/dist/schemas/GridCellSchema.d.ts +25 -0
  106. package/dist/schemas/GridCellSchema.d.ts.map +1 -0
  107. package/dist/schemas/GridLayoutSchema.d.ts +23 -0
  108. package/dist/schemas/GridLayoutSchema.d.ts.map +1 -0
  109. package/dist/schemas/HtmlSchema.d.ts +14 -0
  110. package/dist/schemas/HtmlSchema.d.ts.map +1 -0
  111. package/dist/schemas/ImageSchema.d.ts +32 -0
  112. package/dist/schemas/ImageSchema.d.ts.map +1 -0
  113. package/dist/schemas/LogoSchema.d.ts +35 -0
  114. package/dist/schemas/LogoSchema.d.ts.map +1 -0
  115. package/dist/schemas/MarkdownSchema.d.ts +14 -0
  116. package/dist/schemas/MarkdownSchema.d.ts.map +1 -0
  117. package/dist/schemas/PageTemplateSchema.d.ts +31 -0
  118. package/dist/schemas/PageTemplateSchema.d.ts.map +1 -0
  119. package/dist/schemas/PrintConfigSchema.d.ts +31 -0
  120. package/dist/schemas/PrintConfigSchema.d.ts.map +1 -0
  121. package/dist/schemas/SectionSchema.d.ts +2 -1
  122. package/dist/schemas/SectionSchema.d.ts.map +1 -1
  123. package/dist/schemas/TextSchema.d.ts +37 -0
  124. package/dist/schemas/TextSchema.d.ts.map +1 -0
  125. package/dist/schemas/ViewModelSchema.d.ts +23 -0
  126. package/dist/schemas/ViewModelSchema.d.ts.map +1 -0
  127. package/dist/schemas/index.d.ts +15 -1
  128. package/dist/schemas/index.d.ts.map +1 -1
  129. package/dist/schemas/transformers/ComponentTransformer.d.ts +116 -0
  130. package/dist/schemas/transformers/ComponentTransformer.d.ts.map +1 -0
  131. package/dist/schemas/transformers/ReactNodeTransformer.d.ts +53 -0
  132. package/dist/schemas/transformers/ReactNodeTransformer.d.ts.map +1 -0
  133. package/dist/schemas/transformers/__tests__/MockSerializableComponent.d.ts +66 -0
  134. package/dist/schemas/transformers/__tests__/MockSerializableComponent.d.ts.map +1 -0
  135. package/dist/schemas/transformers/registry.d.ts +15 -0
  136. package/dist/schemas/transformers/registry.d.ts.map +1 -0
  137. package/dist/schemas/types/Serializable.d.ts +46 -0
  138. package/dist/schemas/types/Serializable.d.ts.map +1 -0
  139. package/dist/utils/htmlTransform.d.ts.map +1 -1
  140. package/dist/utils/reactUtils.d.ts +12 -3
  141. package/dist/utils/reactUtils.d.ts.map +1 -1
  142. package/package.json +17 -3
  143. package/src/{components/__tests__ → __tests__/components}/AccessibilityProvider.test.tsx +1 -1
  144. package/src/{components/__tests__ → __tests__/components}/Article.test.tsx +1 -1
  145. package/src/{components/__tests__ → __tests__/components}/Breadcrumbs.test.tsx +1 -1
  146. package/src/{components/__tests__ → __tests__/components}/Button.test.tsx +1 -1
  147. package/src/{components/__tests__ → __tests__/components}/CardListGrid.test.tsx +2 -2
  148. package/src/{components/__tests__ → __tests__/components}/ChoiceInputField.test.tsx +1 -1
  149. package/src/{components/__tests__ → __tests__/components}/Code.test.tsx +1 -1
  150. package/src/{components/__tests__ → __tests__/components}/Content.integration.test.tsx +1 -1
  151. package/src/{components/__tests__ → __tests__/components}/Content.test.tsx +1 -1
  152. package/src/{components/__tests__ → __tests__/components}/CoverImageHeader.test.tsx +2 -2
  153. package/src/{components/__tests__ → __tests__/components}/ErrorBoundary.test.tsx +1 -1
  154. package/src/{components/__tests__ → __tests__/components}/FeatureCard.integration.test.tsx +2 -2
  155. package/src/{components/__tests__ → __tests__/components}/FeatureGrid.integration.test.tsx +2 -2
  156. package/src/{components/__tests__ → __tests__/components}/FeatureGrid.test.tsx +2 -2
  157. package/src/{components/__tests__ → __tests__/components}/Footer.test.tsx +4 -4
  158. package/src/{components/__tests__ → __tests__/components}/FormBlock.test.tsx +1 -1
  159. package/src/{components/__tests__ → __tests__/components}/HeroBlock.integration.test.tsx +2 -2
  160. package/src/{components/__tests__ → __tests__/components}/HeroBlock.test.tsx +233 -7
  161. package/src/{components/__tests__ → __tests__/components}/Html.test.tsx +11 -2
  162. package/src/{components/__tests__ → __tests__/components}/HtmlInputField.test.tsx +3 -3
  163. package/src/__tests__/components/Logo.test.js +3 -3
  164. package/src/{components/__tests__ → __tests__/components}/Markdown.test.tsx +1 -1
  165. package/src/{components/__tests__ → __tests__/components}/PageBannerHeader.test.tsx +3 -3
  166. package/src/{components/__tests__ → __tests__/components}/PaletteSwitcher.test.tsx +3 -3
  167. package/src/{components/__tests__ → __tests__/components}/ProductCard.test.tsx +4 -4
  168. package/src/{components/__tests__ → __tests__/components}/SafeSpan.integration.test.tsx +2 -2
  169. package/src/{components/__tests__ → __tests__/components}/SafeSpan.simple.test.tsx +1 -1
  170. package/src/{components/__tests__ → __tests__/components}/SafeSpan.test.tsx +1 -1
  171. package/src/{components/__tests__ → __tests__/components}/Section.integration.test.tsx +1 -1
  172. package/src/{components/__tests__ → __tests__/components}/Section.test.tsx +1 -1
  173. package/src/{components/__tests__ → __tests__/components}/SelectInputField.test.tsx +1 -1
  174. package/src/{components/__tests__ → __tests__/components}/TextInputField.test.tsx +3 -3
  175. package/src/{components/__tests__ → __tests__/components}/ThemeSwitcher.test.tsx +3 -3
  176. package/src/__tests__/components/base/ModelView.test.tsx +220 -0
  177. package/src/__tests__/components/blocks/Code.performance.test.tsx +625 -0
  178. package/src/__tests__/components/blocks/Code.serialization.test.tsx +507 -0
  179. package/src/__tests__/components/blocks/HeroBlock.serialization.test.tsx +414 -0
  180. package/src/__tests__/components/blocks/Image.serialization.test.tsx +257 -0
  181. package/src/__tests__/components/blocks/Section.serialization.test.tsx +553 -0
  182. package/src/__tests__/components/blocks/Text.performance.test.tsx +442 -0
  183. package/src/__tests__/components/blocks/Text.serialization.test.tsx +491 -0
  184. package/src/__tests__/components/buttons/Button.serialization.test.tsx +443 -0
  185. package/src/__tests__/components/input/FormComponents.serialization.test.tsx +482 -0
  186. package/src/__tests__/components/input/SelectInputField.serialization.test.tsx +439 -0
  187. package/src/__tests__/components/input/TextInputField.serialization.test.tsx +359 -0
  188. package/src/{components/layout/CollapsibleLayout/__tests__ → __tests__/components/layout}/CollapsibleLayout.test.tsx +4 -4
  189. package/src/__tests__/components/layout/GridCell.serialization.test.tsx +403 -0
  190. package/src/__tests__/components/layout/GridLayout.serialization.test.tsx +311 -0
  191. package/src/__tests__/hooks/usePrintMode.test.ts +89 -0
  192. package/src/__tests__/schemas/PageTemplateSchema.test.ts +161 -0
  193. package/src/__tests__/schemas/PrintConfigSchema.test.ts +127 -0
  194. package/src/__tests__/schemas/ViewModelSchema.test.ts +80 -0
  195. package/src/__tests__/schemas/transformers/ComponentSerializationPatterns.test.tsx +602 -0
  196. package/src/__tests__/schemas/transformers/ComponentTransformer.htmlPatterns.test.ts +301 -0
  197. package/src/__tests__/schemas/transformers/ComponentTransformer.test.ts +521 -0
  198. package/src/__tests__/schemas/transformers/CrossBrowserCompatibility.test.ts +586 -0
  199. package/src/__tests__/schemas/transformers/MockSerializableComponent.ts +103 -0
  200. package/src/__tests__/schemas/transformers/RealWorldScenarios.test.tsx +1165 -0
  201. package/src/__tests__/schemas/transformers/SerializationErrorHandling.test.ts +602 -0
  202. package/src/__tests__/schemas/transformers/SerializationIntegration.test.tsx +691 -0
  203. package/src/__tests__/schemas/transformers/SerializationPerformance.test.ts +460 -0
  204. package/src/__tests__/schemas/transformers/TestAutomation.test.ts +597 -0
  205. package/src/{utils/__tests__ → __tests__/utils}/nested-dom-fix.test.tsx +1 -1
  206. package/src/components/ErrorBoundary.tsx +8 -8
  207. package/src/components/Html.tsx +147 -44
  208. package/src/components/Logo.tsx +198 -100
  209. package/src/components/Markdown.tsx +125 -16
  210. package/src/components/QwickApp.tsx +64 -31
  211. package/src/components/QwickIcon.tsx +59 -0
  212. package/src/components/SafeSpan.tsx +65 -10
  213. package/src/components/Scaffold.tsx +2 -8
  214. package/src/components/base/ModelView.tsx +199 -0
  215. package/src/components/base/index.ts +11 -0
  216. package/src/components/blocks/Article.tsx +57 -18
  217. package/src/components/blocks/Code.md +529 -0
  218. package/src/components/blocks/Code.tsx +102 -15
  219. package/src/components/blocks/Content.tsx +25 -77
  220. package/src/components/blocks/CoverImageHeader.tsx +9 -4
  221. package/src/components/blocks/FeatureCard.tsx +1 -2
  222. package/src/components/blocks/FeatureGrid.tsx +19 -1
  223. package/src/components/blocks/Footer.tsx +13 -1
  224. package/src/components/blocks/HeroBlock.tsx +87 -20
  225. package/src/components/blocks/Image.tsx +395 -0
  226. package/src/components/blocks/PageBannerHeader.tsx +14 -12
  227. package/src/components/blocks/ProductCard.tsx +51 -52
  228. package/src/components/blocks/Section.tsx +113 -8
  229. package/src/components/blocks/Text.tsx +285 -0
  230. package/src/components/blocks/index.ts +4 -0
  231. package/src/components/buttons/Button.tsx +184 -15
  232. package/src/components/forms/FormBlock.tsx +70 -17
  233. package/src/components/index.ts +5 -0
  234. package/src/components/input/ChoiceInputField.tsx +48 -18
  235. package/src/components/input/HtmlInputField.tsx +48 -18
  236. package/src/components/input/SelectInputField.tsx +48 -16
  237. package/src/components/input/SwitchInputField.tsx +48 -17
  238. package/src/components/input/TextField.tsx +41 -1
  239. package/src/components/input/TextInputField.tsx +52 -18
  240. package/src/components/layout/GridCell.tsx +118 -9
  241. package/src/components/layout/GridLayout.tsx +125 -24
  242. package/src/components/pages/FormPage.tsx +0 -1
  243. package/src/components/pages/Page.css +304 -332
  244. package/src/components/pages/Page.tsx +307 -255
  245. package/src/components/pages/index.ts +2 -2
  246. package/src/config/AppConfig.ts +133 -0
  247. package/src/config/AppConfigBuilder.ts +421 -0
  248. package/src/config/__tests__/AppConfig.test.ts +385 -0
  249. package/src/config/__tests__/AppConfigBuilder.test.ts +432 -0
  250. package/src/config/index.ts +24 -0
  251. package/src/config/types.ts +170 -0
  252. package/src/config.ts +25 -0
  253. package/src/contexts/PrintModeContext.tsx +332 -0
  254. package/src/contexts/QwickAppContext.tsx +2 -2
  255. package/src/contexts/ThemeContext.tsx +1 -2
  256. package/src/contexts/index.ts +2 -0
  257. package/src/hooks/index.ts +5 -1
  258. package/src/hooks/usePrintMode.ts +73 -0
  259. package/src/index.ts +3 -0
  260. package/src/schemas/CodeSchema.ts +3 -3
  261. package/src/schemas/CollapsibleLayoutSchema.ts +2 -1
  262. package/src/schemas/ContentSchema.ts +2 -1
  263. package/src/schemas/GridCellSchema.ts +164 -0
  264. package/src/schemas/GridLayoutSchema.ts +133 -0
  265. package/src/schemas/HtmlSchema.ts +47 -0
  266. package/src/schemas/ImageSchema.ts +235 -0
  267. package/src/schemas/LogoSchema.ts +241 -0
  268. package/src/schemas/MarkdownSchema.ts +47 -0
  269. package/src/schemas/PageTemplateSchema.ts +186 -0
  270. package/src/schemas/PrintConfigSchema.ts +207 -0
  271. package/src/schemas/README.md +661 -0
  272. package/src/schemas/SectionSchema.ts +2 -1
  273. package/src/schemas/TextSchema.ts +329 -0
  274. package/src/schemas/ViewModelSchema.ts +115 -0
  275. package/src/schemas/index.ts +21 -2
  276. package/src/schemas/transformers/ComponentTransformer.ts +403 -0
  277. package/src/schemas/transformers/ReactNodeTransformer.ts +236 -0
  278. package/src/schemas/transformers/registry.ts +72 -0
  279. package/src/schemas/types/Serializable.ts +51 -0
  280. package/src/stories/AccessibilityProvider.stories.tsx +253 -253
  281. package/src/stories/Article.stories.tsx +433 -433
  282. package/src/stories/Button.stories.tsx +1 -1
  283. package/src/stories/CardListGrid.stories.tsx +451 -451
  284. package/src/stories/ChoiceInputField.stories.tsx +503 -503
  285. package/src/stories/Code.stories.tsx +1 -1
  286. package/src/stories/CollapsibleLayout.stories.tsx +1414 -1414
  287. package/src/stories/Content.stories.tsx +393 -393
  288. package/src/stories/CoverImageHeader.stories.tsx +701 -701
  289. package/src/stories/DataBinding.advanced.stories.tsx +432 -432
  290. package/src/stories/DataProvider.stories.tsx +1192 -1192
  291. package/src/stories/FeatureCard.stories.tsx +557 -557
  292. package/src/stories/FeatureGrid.stories.tsx +594 -594
  293. package/src/stories/Footer.stories.tsx +640 -640
  294. package/src/stories/FormBlock.stories.tsx +760 -760
  295. package/src/stories/FormComponents.stories.tsx +349 -541
  296. package/src/stories/GridCell.stories.tsx +417 -0
  297. package/src/stories/GridLayout.stories.tsx +353 -0
  298. package/src/stories/HeroBlock.stories.tsx +862 -373
  299. package/src/stories/HtmlInputField.stories.tsx +474 -474
  300. package/src/stories/Image.stories.tsx +819 -0
  301. package/src/stories/Introduction.stories.tsx +667 -667
  302. package/src/stories/LayoutBlocks.stories.tsx +324 -324
  303. package/src/stories/Logo.stories.tsx +165 -6
  304. package/src/stories/Markdown.stories.tsx +137 -137
  305. package/src/stories/ModelView.stories.tsx +477 -0
  306. package/src/stories/Page.stories.tsx +688 -688
  307. package/src/stories/PageBannerHeader.stories.tsx +864 -864
  308. package/src/stories/PaletteSwitcher.stories.tsx +119 -119
  309. package/src/stories/ProductCard.stories.tsx +424 -424
  310. package/src/stories/QwickApp.stories.tsx +368 -368
  311. package/src/stories/ResponsiveMenu.stories.tsx +249 -249
  312. package/src/stories/SafeSpan.stories.tsx +531 -531
  313. package/src/stories/Section.stories.tsx +90 -2
  314. package/src/stories/SelectInputField.stories.tsx +524 -524
  315. package/src/stories/Text.stories.tsx +560 -0
  316. package/src/stories/TextInputField.stories.tsx +443 -443
  317. package/src/stories/ThemeSwitcher.stories.tsx +123 -123
  318. package/src/utils/htmlTransform.tsx +74 -53
  319. package/src/utils/reactUtils.tsx +57 -6
  320. package/dist/index.bundled.css +0 -12
  321. /package/src/{hooks/__tests__ → __tests__/hooks}/useDataBinding.test.tsx.disabled +0 -0
  322. /package/src/{schemas/__tests__ → __tests__/schemas}/builders.test.ts +0 -0
  323. /package/src/{utils/__tests__ → __tests__/utils}/createDataDrivenComponent.test.tsx.disabled +0 -0
  324. /package/src/{utils/__tests__ → __tests__/utils}/htmlTransform.test.tsx +0 -0
  325. /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
- '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
- }
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
- 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.
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
- tags: ['autodocs'],
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
- 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
- },
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
- 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
- },
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
- 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
- },
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
- 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
- },
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
- 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
- },
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
- 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" />
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
- <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
- },
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
- 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
- },
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
- 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"
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
- <TextInputField label="Name" />
661
- <Button label="Submit" />
660
+ <TextInputField label="Name" />
661
+ <Button label="Submit" />
662
662
  </FormBlock>`}</Code>
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
- },
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
- 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
- },
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
  };