@k3-universe/react-kit 0.0.26 → 0.0.28

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 (439) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +22442 -22283
  4. package/dist/kit/builder/data-table/components/DataTable.d.ts +2 -1
  5. package/dist/kit/builder/data-table/components/DataTable.d.ts.map +1 -1
  6. package/dist/kit/builder/data-table/components/DataTablePagination.d.ts +2 -1
  7. package/dist/kit/builder/data-table/components/DataTablePagination.d.ts.map +1 -1
  8. package/dist/kit/builder/form/components/FormBuilder.d.ts.map +1 -1
  9. package/dist/kit/builder/form/components/FormBuilderField.d.ts.map +1 -1
  10. package/dist/kit/builder/form/hooks/useFormBuilder.d.ts +15 -0
  11. package/dist/kit/builder/form/hooks/useFormBuilder.d.ts.map +1 -0
  12. package/dist/kit/builder/form/index.d.ts +1 -0
  13. package/dist/kit/builder/form/index.d.ts.map +1 -1
  14. package/dist/kit/builder/form/types.d.ts +1 -1
  15. package/dist/kit/builder/form/types.d.ts.map +1 -1
  16. package/dist/kit/components/forminfo/FormInfoError.d.ts +12 -0
  17. package/dist/kit/components/forminfo/FormInfoError.d.ts.map +1 -0
  18. package/dist/kit/components/forminfo/index.d.ts +2 -0
  19. package/dist/kit/components/forminfo/index.d.ts.map +1 -0
  20. package/dist/kit/themes/clean-slate.css +6 -0
  21. package/dist/kit/themes/default.css +6 -0
  22. package/dist/kit/themes/minimal-modern.css +6 -0
  23. package/dist/kit/themes/spotify.css +6 -0
  24. package/package.json +11 -8
  25. package/src/index.ts +1 -0
  26. package/src/kit/builder/data-table/components/DataTable.tsx +3 -1
  27. package/src/kit/builder/data-table/components/DataTablePagination.tsx +31 -23
  28. package/src/kit/builder/form/components/FormBuilder.tsx +51 -332
  29. package/src/kit/builder/form/components/FormBuilderField.tsx +12 -4
  30. package/src/kit/builder/form/hooks/useFormBuilder.ts +399 -0
  31. package/src/kit/builder/form/index.ts +1 -0
  32. package/src/kit/builder/form/types.ts +8 -1
  33. package/src/kit/components/forminfo/FormInfoError.tsx +120 -0
  34. package/src/kit/components/forminfo/index.ts +1 -0
  35. package/storybook-static/assets/Accordion.stories-KU4JBR8U.js +0 -52
  36. package/storybook-static/assets/AdminLayout-CPvVCwfY.js +0 -53
  37. package/storybook-static/assets/AdminLayout.Basic.stories-DkP2UVXe.js +0 -4
  38. package/storybook-static/assets/AdminLayout.Collapsible.stories-BuuVjtpW.js +0 -4
  39. package/storybook-static/assets/AdminLayout.Complex.stories-D-k4H0hJ.js +0 -29
  40. package/storybook-static/assets/AdminLayout.CustomSidebarHeaderComponent.stories-B_0IEDd4.js +0 -9
  41. package/storybook-static/assets/AdminLayout.CustomSidebarTitleAndIcon.stories-CvAeXUyA.js +0 -4
  42. package/storybook-static/assets/AdminLayout.HeaderSlots.stories-RBFHoSZK.js +0 -7
  43. package/storybook-static/assets/Alert.stories-DKxKtIc0.js +0 -27
  44. package/storybook-static/assets/AlertDialog.stories-BqTpZ_nG.js +0 -43
  45. package/storybook-static/assets/AspectRatio.stories-DPO9QQ5F.js +0 -22
  46. package/storybook-static/assets/Autocomplete-Cpg4CaJe.js +0 -56
  47. package/storybook-static/assets/Autocomplete.stories-CWj4G5fh.js +0 -56
  48. package/storybook-static/assets/Avatar.stories-DPhov_2g.js +0 -12
  49. package/storybook-static/assets/Badge.stories-DFKrRdXq.js +0 -12
  50. package/storybook-static/assets/Breadcrumb.stories-CTE6CZUC.js +0 -25
  51. package/storybook-static/assets/Button.stories-cbt2InL-.js +0 -26
  52. package/storybook-static/assets/Calendar.stories-DRhTw_43.js +0 -3
  53. package/storybook-static/assets/Card.stories-Isf6n_K3.js +0 -15
  54. package/storybook-static/assets/Carousel.stories-Cmg0I3fR.js +0 -15
  55. package/storybook-static/assets/Chart.stories-aQ-fNijT.js +0 -126
  56. package/storybook-static/assets/Checkbox.stories-B7YMXPDc.js +0 -12
  57. package/storybook-static/assets/Collapsible.stories-BUzl17ZZ.js +0 -18
  58. package/storybook-static/assets/Combination-BdQWAuko.js +0 -41
  59. package/storybook-static/assets/Command.stories-DzBlWQs0.js +0 -30
  60. package/storybook-static/assets/ContextMenu.stories-CJlBQyXc.js +0 -31
  61. package/storybook-static/assets/DataTable.Basic.stories-BWYKFDmK.js +0 -6
  62. package/storybook-static/assets/DataTable.Filters.stories-uZdtJk8t.js +0 -21
  63. package/storybook-static/assets/DataTable.Pagination.stories-C5N1khkp.js +0 -24
  64. package/storybook-static/assets/DataTable.SelectionAndActions.stories-FhCqZKvO.js +0 -26
  65. package/storybook-static/assets/DataTable.Sorting.stories-D-k7EtRj.js +0 -6
  66. package/storybook-static/assets/Dialog.stories-C62AF-Gx.js +0 -54
  67. package/storybook-static/assets/Dialog.stories-lrjRwOus.js +0 -18
  68. package/storybook-static/assets/Drawer.stories-CGjkdJeV.js +0 -24
  69. package/storybook-static/assets/DropdownMenu.stories-DkGClRAA.js +0 -35
  70. package/storybook-static/assets/Form.ArrayLayouts.stories-C5d_062d.js +0 -130
  71. package/storybook-static/assets/Form.Autocomplete.stories-CPZPkk4o.js +0 -142
  72. package/storybook-static/assets/Form.Basic.stories-Bhcu3-3n.js +0 -58
  73. package/storybook-static/assets/Form.Complex.stories-QnXh5a7Q.js +0 -361
  74. package/storybook-static/assets/Form.Dynamic.stories-DFW6wIuT.js +0 -502
  75. package/storybook-static/assets/Form.Simple.stories-BhJcyhbE.js +0 -53
  76. package/storybook-static/assets/Form.stories-PFNsMYxO.js +0 -3
  77. package/storybook-static/assets/FormBuilder-BQBBxo_k.js +0 -5
  78. package/storybook-static/assets/HoverCard.stories-CAlQEVn8.js +0 -21
  79. package/storybook-static/assets/Input.stories-CEhODt0V.js +0 -16
  80. package/storybook-static/assets/InputOtp.stories-DSvNP4dS.js +0 -42
  81. package/storybook-static/assets/Label.stories-B3pa8ZLY.js +0 -14
  82. package/storybook-static/assets/Login.stories-C7KQkmR_.js +0 -37
  83. package/storybook-static/assets/Menubar.stories-CHXhSHxc.js +0 -44
  84. package/storybook-static/assets/MonthPicker.stories-BnrOc4fm.js +0 -99
  85. package/storybook-static/assets/MonthRangePicker.stories-55Gk1t-7.js +0 -134
  86. package/storybook-static/assets/NavigationMenu.stories-CXoS080P.js +0 -30
  87. package/storybook-static/assets/Page.stories-GdSJgZ6-.js +0 -91
  88. package/storybook-static/assets/Pagination.stories-BEBwqH4N.js +0 -29
  89. package/storybook-static/assets/Popover.stories-BICy98Cw.js +0 -15
  90. package/storybook-static/assets/Progress.stories-DECHNOME.js +0 -8
  91. package/storybook-static/assets/RadioGroup.stories-DA7-uKfV.js +0 -16
  92. package/storybook-static/assets/Resizable.stories-B99kWkH7.js +0 -25
  93. package/storybook-static/assets/ScrollArea.stories-BqvUAXqU.js +0 -12
  94. package/storybook-static/assets/Section.stories-lFMlFBQn.js +0 -277
  95. package/storybook-static/assets/SectionBuilder-BQW705x0.js +0 -1
  96. package/storybook-static/assets/Select.stories-BsKyZ6Io.js +0 -17
  97. package/storybook-static/assets/Separator.stories-BTDOaOM2.js +0 -17
  98. package/storybook-static/assets/Sheet.stories-Cam1gR6G.js +0 -24
  99. package/storybook-static/assets/Sidebar.stories-DnOa6G7y.js +0 -106
  100. package/storybook-static/assets/Skeleton.stories-BQNIuIe5.js +0 -9
  101. package/storybook-static/assets/Slider.stories-Bslq7hjq.js +0 -6
  102. package/storybook-static/assets/Sonner.stories-D34pBBtI.js +0 -18
  103. package/storybook-static/assets/Switch.stories-Puyb1-Bx.js +0 -3
  104. package/storybook-static/assets/Table.stories-ClZxAhut.js +0 -35
  105. package/storybook-static/assets/Tabs.stories-CURNTETB.js +0 -10
  106. package/storybook-static/assets/Textarea.stories-Cf1ZBrWw.js +0 -17
  107. package/storybook-static/assets/Toggle.stories-CdMHY_bi.js +0 -3
  108. package/storybook-static/assets/ToggleGroup.stories-BM68m1dX.js +0 -13
  109. package/storybook-static/assets/Tooltip.stories-DiQv64dM.js +0 -10
  110. package/storybook-static/assets/accordion-DVgwQcnw.js +0 -1
  111. package/storybook-static/assets/alert-dialog-DCUEwpqm.js +0 -7
  112. package/storybook-static/assets/avatar-BzwOE-mi.js +0 -1
  113. package/storybook-static/assets/axe-HmUsR1st.js +0 -30
  114. package/storybook-static/assets/badge-BnQWua6u.js +0 -1
  115. package/storybook-static/assets/button-0oMkiryo.js +0 -1
  116. package/storybook-static/assets/card-BJpPOzP8.js +0 -1
  117. package/storybook-static/assets/chart-column-DZGb4ZZS.js +0 -6
  118. package/storybook-static/assets/check-B9hBGj6o.js +0 -6
  119. package/storybook-static/assets/checkbox-CyIeaWHX.js +0 -1
  120. package/storybook-static/assets/chevron-down-D_37S6il.js +0 -6
  121. package/storybook-static/assets/chevron-left-BBoN0vbI.js +0 -6
  122. package/storybook-static/assets/chevron-right-B5vIMLxK.js +0 -6
  123. package/storybook-static/assets/circle-C5Lzx6Nx.js +0 -6
  124. package/storybook-static/assets/clean-slate-D1HmMFJM.css +0 -1
  125. package/storybook-static/assets/command-Csa9p8_a.js +0 -6
  126. package/storybook-static/assets/createLucideIcon-BrHXro7t.js +0 -21
  127. package/storybook-static/assets/default-CN_Fo1GY.css +0 -1
  128. package/storybook-static/assets/dependencies-ctrV69dx.js +0 -1
  129. package/storybook-static/assets/dialog-CsnqITTn.js +0 -1
  130. package/storybook-static/assets/dropdown-menu-BWxxwPHL.js +0 -1
  131. package/storybook-static/assets/ellipsis-BRS038RR.js +0 -6
  132. package/storybook-static/assets/grip-vertical-BxXG8KNA.js +0 -6
  133. package/storybook-static/assets/iframe-C9bogcIc.css +0 -1
  134. package/storybook-static/assets/iframe-v7iAhKit.js +0 -1555
  135. package/storybook-static/assets/index-0-qMRXou.js +0 -1
  136. package/storybook-static/assets/index-AvwFFKJc.js +0 -1
  137. package/storybook-static/assets/index-BVDb4dFc.js +0 -1
  138. package/storybook-static/assets/index-B_qx7A5T.js +0 -1
  139. package/storybook-static/assets/index-BdQq_4o_.js +0 -1
  140. package/storybook-static/assets/index-BfiCOk42.js +0 -1
  141. package/storybook-static/assets/index-Bv9yk470.js +0 -1
  142. package/storybook-static/assets/index-Bw1A27Kp.js +0 -1
  143. package/storybook-static/assets/index-ByqivBWx.js +0 -1
  144. package/storybook-static/assets/index-C9Ta0ZTH.js +0 -1
  145. package/storybook-static/assets/index-CDY5kTx5.js +0 -1
  146. package/storybook-static/assets/index-CGnyVRgB.js +0 -1
  147. package/storybook-static/assets/index-CGrAONsN.js +0 -1
  148. package/storybook-static/assets/index-CWjrGFAQ.js +0 -1
  149. package/storybook-static/assets/index-CwBdPBFz.js +0 -9
  150. package/storybook-static/assets/index-D8RXF03I.js +0 -1
  151. package/storybook-static/assets/index-DLIxT4Z7.js +0 -1
  152. package/storybook-static/assets/index-DW48STyt.js +0 -1
  153. package/storybook-static/assets/index-DbaA6-o1.js +0 -1
  154. package/storybook-static/assets/index-Dph_5COR.js +0 -1
  155. package/storybook-static/assets/index-DrN5n71E.js +0 -1
  156. package/storybook-static/assets/index-Tp9IdbR8.js +0 -1
  157. package/storybook-static/assets/index-WyF3-wTE.js +0 -9
  158. package/storybook-static/assets/index-XSmPROEP.js +0 -1
  159. package/storybook-static/assets/index-Z6wF44KX.js +0 -5
  160. package/storybook-static/assets/index-_RPqOjlQ.js +0 -1
  161. package/storybook-static/assets/index-jrimW4QO.js +0 -1
  162. package/storybook-static/assets/index-nqc17SX4.js +0 -1
  163. package/storybook-static/assets/input-11YRd9gD.js +0 -1
  164. package/storybook-static/assets/jsx-runtime-D_zvdyIk.js +0 -9
  165. package/storybook-static/assets/label-Do8ODIVk.js +0 -1
  166. package/storybook-static/assets/lodash-DDwpuhPG.js +0 -73
  167. package/storybook-static/assets/matchers-7Z3WT2CE-T3xScrR7.js +0 -14
  168. package/storybook-static/assets/minimal-modern-BlYVzfQU.css +0 -1
  169. package/storybook-static/assets/popover-CcciSWAw.js +0 -1
  170. package/storybook-static/assets/preload-helper-Dp1pzeXC.js +0 -1
  171. package/storybook-static/assets/radio-group-DiJ0Y_KQ.js +0 -1
  172. package/storybook-static/assets/react-18-Cr9fq_Ip.js +0 -25
  173. package/storybook-static/assets/react-icons.esm-B_ULMmNU.js +0 -1
  174. package/storybook-static/assets/refresh-cw-BmRDhIV_.js +0 -6
  175. package/storybook-static/assets/schemas-CGNYCiJ6.js +0 -18
  176. package/storybook-static/assets/section-factories-DCCY9R35.js +0 -1
  177. package/storybook-static/assets/select-DDrkxaOg.js +0 -6
  178. package/storybook-static/assets/separator-o5SAUnaJ.js +0 -1
  179. package/storybook-static/assets/settings-2-xWGvvbG6.js +0 -6
  180. package/storybook-static/assets/sheet-C7jhU3XE.js +0 -1
  181. package/storybook-static/assets/shopping-cart-BFlrufvo.js +0 -11
  182. package/storybook-static/assets/sidebar-C8hU1Mxy.js +0 -6
  183. package/storybook-static/assets/skeleton-CjDnQs43.js +0 -1
  184. package/storybook-static/assets/spotify-CUDj7g8m.css +0 -1
  185. package/storybook-static/assets/switch-CKGRuk3u.js +0 -1
  186. package/storybook-static/assets/table-CP3vMqFn.js +0 -1
  187. package/storybook-static/assets/tabs-CopK2m3j.js +0 -1
  188. package/storybook-static/assets/textarea-Dw2vruMl.js +0 -1
  189. package/storybook-static/assets/toggle-DmHbWetf.js +0 -16
  190. package/storybook-static/assets/tooltip-_LqYEYFw.js +0 -1
  191. package/storybook-static/assets/trash-2-xdbApPby.js +0 -11
  192. package/storybook-static/assets/utils-D-KgF5mV.js +0 -1
  193. package/storybook-static/assets/x-B1a4fyWM.js +0 -6
  194. package/storybook-static/favicon-wrapper.svg +0 -46
  195. package/storybook-static/favicon.svg +0 -1
  196. package/storybook-static/iframe.html +0 -687
  197. package/storybook-static/index.d.ts +0 -64
  198. package/storybook-static/index.d.ts.map +0 -1
  199. package/storybook-static/index.html +0 -166
  200. package/storybook-static/index.json +0 -1
  201. package/storybook-static/kit/builder/data-table/components/DataTable.d.ts +0 -37
  202. package/storybook-static/kit/builder/data-table/components/DataTable.d.ts.map +0 -1
  203. package/storybook-static/kit/builder/data-table/components/DataTableColumnHeader.d.ts +0 -8
  204. package/storybook-static/kit/builder/data-table/components/DataTableColumnHeader.d.ts.map +0 -1
  205. package/storybook-static/kit/builder/data-table/components/DataTablePagination.d.ts +0 -6
  206. package/storybook-static/kit/builder/data-table/components/DataTablePagination.d.ts.map +0 -1
  207. package/storybook-static/kit/builder/data-table/components/DataTableViewOptions.d.ts +0 -5
  208. package/storybook-static/kit/builder/data-table/components/DataTableViewOptions.d.ts.map +0 -1
  209. package/storybook-static/kit/builder/data-table/index.d.ts +0 -7
  210. package/storybook-static/kit/builder/data-table/index.d.ts.map +0 -1
  211. package/storybook-static/kit/builder/data-table/types.d.ts +0 -27
  212. package/storybook-static/kit/builder/data-table/types.d.ts.map +0 -1
  213. package/storybook-static/kit/builder/data-table/utils/dotAccessor.d.ts +0 -2
  214. package/storybook-static/kit/builder/data-table/utils/dotAccessor.d.ts.map +0 -1
  215. package/storybook-static/kit/builder/dialog/index.d.ts +0 -3
  216. package/storybook-static/kit/builder/dialog/index.d.ts.map +0 -1
  217. package/storybook-static/kit/builder/dialog/provider.d.ts +0 -26
  218. package/storybook-static/kit/builder/dialog/provider.d.ts.map +0 -1
  219. package/storybook-static/kit/builder/form/components/FormBuilder.d.ts +0 -137
  220. package/storybook-static/kit/builder/form/components/FormBuilder.d.ts.map +0 -1
  221. package/storybook-static/kit/builder/form/components/FormBuilderActions.d.ts +0 -20
  222. package/storybook-static/kit/builder/form/components/FormBuilderActions.d.ts.map +0 -1
  223. package/storybook-static/kit/builder/form/components/FormBuilderField.d.ts +0 -12
  224. package/storybook-static/kit/builder/form/components/FormBuilderField.d.ts.map +0 -1
  225. package/storybook-static/kit/builder/form/components/fields/ArrayField.d.ts +0 -3
  226. package/storybook-static/kit/builder/form/components/fields/ArrayField.d.ts.map +0 -1
  227. package/storybook-static/kit/builder/form/components/fields/AutocompleteField.d.ts +0 -3
  228. package/storybook-static/kit/builder/form/components/fields/AutocompleteField.d.ts.map +0 -1
  229. package/storybook-static/kit/builder/form/components/fields/CheckboxField.d.ts +0 -3
  230. package/storybook-static/kit/builder/form/components/fields/CheckboxField.d.ts.map +0 -1
  231. package/storybook-static/kit/builder/form/components/fields/DateField.d.ts +0 -3
  232. package/storybook-static/kit/builder/form/components/fields/DateField.d.ts.map +0 -1
  233. package/storybook-static/kit/builder/form/components/fields/FileField.d.ts +0 -3
  234. package/storybook-static/kit/builder/form/components/fields/FileField.d.ts.map +0 -1
  235. package/storybook-static/kit/builder/form/components/fields/NumberField.d.ts +0 -3
  236. package/storybook-static/kit/builder/form/components/fields/NumberField.d.ts.map +0 -1
  237. package/storybook-static/kit/builder/form/components/fields/ObjectField.d.ts +0 -3
  238. package/storybook-static/kit/builder/form/components/fields/ObjectField.d.ts.map +0 -1
  239. package/storybook-static/kit/builder/form/components/fields/RadioField.d.ts +0 -3
  240. package/storybook-static/kit/builder/form/components/fields/RadioField.d.ts.map +0 -1
  241. package/storybook-static/kit/builder/form/components/fields/SelectField.d.ts +0 -3
  242. package/storybook-static/kit/builder/form/components/fields/SelectField.d.ts.map +0 -1
  243. package/storybook-static/kit/builder/form/components/fields/SwitchField.d.ts +0 -3
  244. package/storybook-static/kit/builder/form/components/fields/SwitchField.d.ts.map +0 -1
  245. package/storybook-static/kit/builder/form/components/fields/TextField.d.ts +0 -3
  246. package/storybook-static/kit/builder/form/components/fields/TextField.d.ts.map +0 -1
  247. package/storybook-static/kit/builder/form/components/fields/TextareaField.d.ts +0 -3
  248. package/storybook-static/kit/builder/form/components/fields/TextareaField.d.ts.map +0 -1
  249. package/storybook-static/kit/builder/form/components/fields/index.d.ts +0 -14
  250. package/storybook-static/kit/builder/form/components/fields/index.d.ts.map +0 -1
  251. package/storybook-static/kit/builder/form/components/fields/types.d.ts +0 -14
  252. package/storybook-static/kit/builder/form/components/fields/types.d.ts.map +0 -1
  253. package/storybook-static/kit/builder/form/components/index.d.ts +0 -4
  254. package/storybook-static/kit/builder/form/components/index.d.ts.map +0 -1
  255. package/storybook-static/kit/builder/form/index.d.ts +0 -3
  256. package/storybook-static/kit/builder/form/index.d.ts.map +0 -1
  257. package/storybook-static/kit/builder/form/utils/common-forms.d.ts +0 -7
  258. package/storybook-static/kit/builder/form/utils/common-forms.d.ts.map +0 -1
  259. package/storybook-static/kit/builder/form/utils/dependencies.d.ts +0 -41
  260. package/storybook-static/kit/builder/form/utils/dependencies.d.ts.map +0 -1
  261. package/storybook-static/kit/builder/form/utils/field-factories.d.ts +0 -23
  262. package/storybook-static/kit/builder/form/utils/field-factories.d.ts.map +0 -1
  263. package/storybook-static/kit/builder/form/utils/index.d.ts +0 -15
  264. package/storybook-static/kit/builder/form/utils/index.d.ts.map +0 -1
  265. package/storybook-static/kit/builder/form/utils/section-factories.d.ts +0 -7
  266. package/storybook-static/kit/builder/form/utils/section-factories.d.ts.map +0 -1
  267. package/storybook-static/kit/builder/form/utils/transformers.d.ts +0 -6
  268. package/storybook-static/kit/builder/form/utils/transformers.d.ts.map +0 -1
  269. package/storybook-static/kit/builder/form/utils/validations.d.ts +0 -13
  270. package/storybook-static/kit/builder/form/utils/validations.d.ts.map +0 -1
  271. package/storybook-static/kit/builder/form/utils/validators.d.ts +0 -8
  272. package/storybook-static/kit/builder/form/utils/validators.d.ts.map +0 -1
  273. package/storybook-static/kit/builder/page/Page.d.ts +0 -48
  274. package/storybook-static/kit/builder/page/Page.d.ts.map +0 -1
  275. package/storybook-static/kit/builder/page/index.d.ts +0 -2
  276. package/storybook-static/kit/builder/page/index.d.ts.map +0 -1
  277. package/storybook-static/kit/builder/section/SectionBuilder.d.ts +0 -3
  278. package/storybook-static/kit/builder/section/SectionBuilder.d.ts.map +0 -1
  279. package/storybook-static/kit/builder/section/index.d.ts +0 -3
  280. package/storybook-static/kit/builder/section/index.d.ts.map +0 -1
  281. package/storybook-static/kit/builder/section/types.d.ts +0 -70
  282. package/storybook-static/kit/builder/section/types.d.ts.map +0 -1
  283. package/storybook-static/kit/builder/stack-dialog/context.d.ts +0 -3
  284. package/storybook-static/kit/builder/stack-dialog/context.d.ts.map +0 -1
  285. package/storybook-static/kit/builder/stack-dialog/hooks.d.ts +0 -6
  286. package/storybook-static/kit/builder/stack-dialog/hooks.d.ts.map +0 -1
  287. package/storybook-static/kit/builder/stack-dialog/index.d.ts +0 -5
  288. package/storybook-static/kit/builder/stack-dialog/index.d.ts.map +0 -1
  289. package/storybook-static/kit/builder/stack-dialog/provider.d.ts +0 -3
  290. package/storybook-static/kit/builder/stack-dialog/provider.d.ts.map +0 -1
  291. package/storybook-static/kit/builder/stack-dialog/renderer.d.ts +0 -6
  292. package/storybook-static/kit/builder/stack-dialog/renderer.d.ts.map +0 -1
  293. package/storybook-static/kit/builder/stack-dialog/types.d.ts +0 -20
  294. package/storybook-static/kit/builder/stack-dialog/types.d.ts.map +0 -1
  295. package/storybook-static/kit/components/autocomplete/Autocomplete.d.ts +0 -53
  296. package/storybook-static/kit/components/autocomplete/Autocomplete.d.ts.map +0 -1
  297. package/storybook-static/kit/components/autocomplete/index.d.ts +0 -4
  298. package/storybook-static/kit/components/autocomplete/index.d.ts.map +0 -1
  299. package/storybook-static/kit/components/autocomplete/types.d.ts +0 -19
  300. package/storybook-static/kit/components/autocomplete/types.d.ts.map +0 -1
  301. package/storybook-static/kit/components/login/Login.d.ts +0 -29
  302. package/storybook-static/kit/components/login/Login.d.ts.map +0 -1
  303. package/storybook-static/kit/components/login/index.d.ts +0 -2
  304. package/storybook-static/kit/components/login/index.d.ts.map +0 -1
  305. package/storybook-static/kit/components/monthpicker/MonthPicker.d.ts +0 -32
  306. package/storybook-static/kit/components/monthpicker/MonthPicker.d.ts.map +0 -1
  307. package/storybook-static/kit/components/monthpicker/MonthRangePicker.d.ts +0 -48
  308. package/storybook-static/kit/components/monthpicker/MonthRangePicker.d.ts.map +0 -1
  309. package/storybook-static/kit/layouts/admin/components/AdminLayout.d.ts +0 -17
  310. package/storybook-static/kit/layouts/admin/components/AdminLayout.d.ts.map +0 -1
  311. package/storybook-static/kit/layouts/admin/components/ThemeToggle.d.ts +0 -5
  312. package/storybook-static/kit/layouts/admin/components/ThemeToggle.d.ts.map +0 -1
  313. package/storybook-static/kit/layouts/admin/hooks/menu.d.ts +0 -13
  314. package/storybook-static/kit/layouts/admin/hooks/menu.d.ts.map +0 -1
  315. package/storybook-static/kit/layouts/admin/providers/AdminMenuProvider.d.ts +0 -7
  316. package/storybook-static/kit/layouts/admin/providers/AdminMenuProvider.d.ts.map +0 -1
  317. package/storybook-static/kit/layouts/admin/types/index.d.ts +0 -27
  318. package/storybook-static/kit/layouts/admin/types/index.d.ts.map +0 -1
  319. package/storybook-static/kit/providers/ThemeProvider.d.ts +0 -14
  320. package/storybook-static/kit/providers/ThemeProvider.d.ts.map +0 -1
  321. package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
  322. package/storybook-static/nunito-sans-bold.woff2 +0 -0
  323. package/storybook-static/nunito-sans-italic.woff2 +0 -0
  324. package/storybook-static/nunito-sans-regular.woff2 +0 -0
  325. package/storybook-static/project.json +0 -1
  326. package/storybook-static/sb-addons/a11y-5/manager-bundle.js +0 -5
  327. package/storybook-static/sb-addons/essentials-backgrounds-1/manager-bundle.js +0 -3
  328. package/storybook-static/sb-addons/essentials-measure-2/manager-bundle.js +0 -3
  329. package/storybook-static/sb-addons/essentials-outline-3/manager-bundle.js +0 -3
  330. package/storybook-static/sb-addons/interactions-4/manager-bundle.js +0 -57
  331. package/storybook-static/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +0 -971
  332. package/storybook-static/sb-addons/storysource-6/manager-bundle.js +0 -3
  333. package/storybook-static/sb-common-assets/favicon-wrapper.svg +0 -46
  334. package/storybook-static/sb-common-assets/favicon.svg +0 -1
  335. package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
  336. package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
  337. package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
  338. package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
  339. package/storybook-static/sb-manager/globals-module-info.js +0 -797
  340. package/storybook-static/sb-manager/globals-runtime.js +0 -69653
  341. package/storybook-static/sb-manager/globals.js +0 -34
  342. package/storybook-static/sb-manager/runtime.js +0 -13181
  343. package/storybook-static/shadcn/hooks/use-mobile.d.ts +0 -2
  344. package/storybook-static/shadcn/hooks/use-mobile.d.ts.map +0 -1
  345. package/storybook-static/shadcn/lib/utils.d.ts +0 -3
  346. package/storybook-static/shadcn/lib/utils.d.ts.map +0 -1
  347. package/storybook-static/shadcn/ui/accordion.d.ts +0 -8
  348. package/storybook-static/shadcn/ui/accordion.d.ts.map +0 -1
  349. package/storybook-static/shadcn/ui/alert-dialog.d.ts +0 -15
  350. package/storybook-static/shadcn/ui/alert-dialog.d.ts.map +0 -1
  351. package/storybook-static/shadcn/ui/alert.d.ts +0 -10
  352. package/storybook-static/shadcn/ui/alert.d.ts.map +0 -1
  353. package/storybook-static/shadcn/ui/aspect-ratio.d.ts +0 -4
  354. package/storybook-static/shadcn/ui/aspect-ratio.d.ts.map +0 -1
  355. package/storybook-static/shadcn/ui/avatar.d.ts +0 -7
  356. package/storybook-static/shadcn/ui/avatar.d.ts.map +0 -1
  357. package/storybook-static/shadcn/ui/badge.d.ts +0 -10
  358. package/storybook-static/shadcn/ui/badge.d.ts.map +0 -1
  359. package/storybook-static/shadcn/ui/breadcrumb.d.ts +0 -12
  360. package/storybook-static/shadcn/ui/breadcrumb.d.ts.map +0 -1
  361. package/storybook-static/shadcn/ui/button.d.ts +0 -11
  362. package/storybook-static/shadcn/ui/button.d.ts.map +0 -1
  363. package/storybook-static/shadcn/ui/calendar.d.ts +0 -9
  364. package/storybook-static/shadcn/ui/calendar.d.ts.map +0 -1
  365. package/storybook-static/shadcn/ui/card.d.ts +0 -10
  366. package/storybook-static/shadcn/ui/card.d.ts.map +0 -1
  367. package/storybook-static/shadcn/ui/carousel.d.ts +0 -20
  368. package/storybook-static/shadcn/ui/carousel.d.ts.map +0 -1
  369. package/storybook-static/shadcn/ui/chart.d.ts +0 -41
  370. package/storybook-static/shadcn/ui/chart.d.ts.map +0 -1
  371. package/storybook-static/shadcn/ui/checkbox.d.ts +0 -5
  372. package/storybook-static/shadcn/ui/checkbox.d.ts.map +0 -1
  373. package/storybook-static/shadcn/ui/collapsible.d.ts +0 -6
  374. package/storybook-static/shadcn/ui/collapsible.d.ts.map +0 -1
  375. package/storybook-static/shadcn/ui/command.d.ts +0 -19
  376. package/storybook-static/shadcn/ui/command.d.ts.map +0 -1
  377. package/storybook-static/shadcn/ui/context-menu.d.ts +0 -26
  378. package/storybook-static/shadcn/ui/context-menu.d.ts.map +0 -1
  379. package/storybook-static/shadcn/ui/dialog.d.ts +0 -16
  380. package/storybook-static/shadcn/ui/dialog.d.ts.map +0 -1
  381. package/storybook-static/shadcn/ui/drawer.d.ts +0 -14
  382. package/storybook-static/shadcn/ui/drawer.d.ts.map +0 -1
  383. package/storybook-static/shadcn/ui/dropdown-menu.d.ts +0 -26
  384. package/storybook-static/shadcn/ui/dropdown-menu.d.ts.map +0 -1
  385. package/storybook-static/shadcn/ui/form.d.ts +0 -25
  386. package/storybook-static/shadcn/ui/form.d.ts.map +0 -1
  387. package/storybook-static/shadcn/ui/hover-card.d.ts +0 -7
  388. package/storybook-static/shadcn/ui/hover-card.d.ts.map +0 -1
  389. package/storybook-static/shadcn/ui/input-otp.d.ts +0 -12
  390. package/storybook-static/shadcn/ui/input-otp.d.ts.map +0 -1
  391. package/storybook-static/shadcn/ui/input.d.ts +0 -4
  392. package/storybook-static/shadcn/ui/input.d.ts.map +0 -1
  393. package/storybook-static/shadcn/ui/label.d.ts +0 -5
  394. package/storybook-static/shadcn/ui/label.d.ts.map +0 -1
  395. package/storybook-static/shadcn/ui/menubar.d.ts +0 -27
  396. package/storybook-static/shadcn/ui/menubar.d.ts.map +0 -1
  397. package/storybook-static/shadcn/ui/navigation-menu.d.ts +0 -15
  398. package/storybook-static/shadcn/ui/navigation-menu.d.ts.map +0 -1
  399. package/storybook-static/shadcn/ui/pagination.d.ts +0 -14
  400. package/storybook-static/shadcn/ui/pagination.d.ts.map +0 -1
  401. package/storybook-static/shadcn/ui/popover.d.ts +0 -8
  402. package/storybook-static/shadcn/ui/popover.d.ts.map +0 -1
  403. package/storybook-static/shadcn/ui/progress.d.ts +0 -5
  404. package/storybook-static/shadcn/ui/progress.d.ts.map +0 -1
  405. package/storybook-static/shadcn/ui/radio-group.d.ts +0 -6
  406. package/storybook-static/shadcn/ui/radio-group.d.ts.map +0 -1
  407. package/storybook-static/shadcn/ui/resizable.d.ts +0 -9
  408. package/storybook-static/shadcn/ui/resizable.d.ts.map +0 -1
  409. package/storybook-static/shadcn/ui/scroll-area.d.ts +0 -6
  410. package/storybook-static/shadcn/ui/scroll-area.d.ts.map +0 -1
  411. package/storybook-static/shadcn/ui/select.d.ts +0 -16
  412. package/storybook-static/shadcn/ui/select.d.ts.map +0 -1
  413. package/storybook-static/shadcn/ui/separator.d.ts +0 -5
  414. package/storybook-static/shadcn/ui/separator.d.ts.map +0 -1
  415. package/storybook-static/shadcn/ui/sheet.d.ts +0 -14
  416. package/storybook-static/shadcn/ui/sheet.d.ts.map +0 -1
  417. package/storybook-static/shadcn/ui/sidebar.d.ts +0 -70
  418. package/storybook-static/shadcn/ui/sidebar.d.ts.map +0 -1
  419. package/storybook-static/shadcn/ui/skeleton.d.ts +0 -3
  420. package/storybook-static/shadcn/ui/skeleton.d.ts.map +0 -1
  421. package/storybook-static/shadcn/ui/slider.d.ts +0 -5
  422. package/storybook-static/shadcn/ui/slider.d.ts.map +0 -1
  423. package/storybook-static/shadcn/ui/sonner.d.ts +0 -4
  424. package/storybook-static/shadcn/ui/sonner.d.ts.map +0 -1
  425. package/storybook-static/shadcn/ui/switch.d.ts +0 -5
  426. package/storybook-static/shadcn/ui/switch.d.ts.map +0 -1
  427. package/storybook-static/shadcn/ui/table.d.ts +0 -11
  428. package/storybook-static/shadcn/ui/table.d.ts.map +0 -1
  429. package/storybook-static/shadcn/ui/tabs.d.ts +0 -8
  430. package/storybook-static/shadcn/ui/tabs.d.ts.map +0 -1
  431. package/storybook-static/shadcn/ui/textarea.d.ts +0 -4
  432. package/storybook-static/shadcn/ui/textarea.d.ts.map +0 -1
  433. package/storybook-static/shadcn/ui/toggle-group.d.ts +0 -8
  434. package/storybook-static/shadcn/ui/toggle-group.d.ts.map +0 -1
  435. package/storybook-static/shadcn/ui/toggle.d.ts +0 -10
  436. package/storybook-static/shadcn/ui/toggle.d.ts.map +0 -1
  437. package/storybook-static/shadcn/ui/tooltip.d.ts +0 -8
  438. package/storybook-static/shadcn/ui/tooltip.d.ts.map +0 -1
  439. package/storybook-static/vite-inject-mocker-entry.js +0 -18
@@ -1,502 +0,0 @@
1
- import{j as a}from"./jsx-runtime-D_zvdyIk.js";import{F as p}from"./FormBuilder-BQBBxo_k.js";import{c as l,a as e}from"./section-factories-DCCY9R35.js";import{c as i,a as t}from"./dependencies-ctrV69dx.js";import"./iframe-v7iAhKit.js";import"./preload-helper-Dp1pzeXC.js";import"./schemas-CGNYCiJ6.js";import"./utils-D-KgF5mV.js";import"./button-0oMkiryo.js";import"./index-DbaA6-o1.js";import"./index-CGrAONsN.js";import"./label-Do8ODIVk.js";import"./index-Tp9IdbR8.js";import"./index-DrN5n71E.js";import"./index-CwBdPBFz.js";import"./Autocomplete-Cpg4CaJe.js";import"./popover-CcciSWAw.js";import"./index-DW48STyt.js";import"./index-CDY5kTx5.js";import"./index-BVDb4dFc.js";import"./index-0-qMRXou.js";import"./Combination-BdQWAuko.js";import"./index-BfiCOk42.js";import"./index-D8RXF03I.js";import"./index-nqc17SX4.js";import"./index-Bw1A27Kp.js";import"./index-jrimW4QO.js";import"./index-AvwFFKJc.js";import"./index-ByqivBWx.js";import"./command-Csa9p8_a.js";import"./index-Z6wF44KX.js";import"./dialog-CsnqITTn.js";import"./x-B1a4fyWM.js";import"./createLucideIcon-BrHXro7t.js";import"./badge-BnQWua6u.js";import"./check-B9hBGj6o.js";import"./input-11YRd9gD.js";import"./textarea-Dw2vruMl.js";import"./select-DDrkxaOg.js";import"./index-BdQq_4o_.js";import"./index-Bv9yk470.js";import"./index-B_qx7A5T.js";import"./index-_RPqOjlQ.js";import"./index-C9Ta0ZTH.js";import"./chevron-down-D_37S6il.js";import"./checkbox-CyIeaWHX.js";import"./switch-CKGRuk3u.js";import"./radio-group-DiJ0Y_KQ.js";import"./index-CWjrGFAQ.js";import"./circle-C5Lzx6Nx.js";import"./card-BJpPOzP8.js";import"./table-CP3vMqFn.js";import"./trash-2-xdbApPby.js";import"./grip-vertical-BxXG8KNA.js";import"./SectionBuilder-BQW705x0.js";import"./separator-o5SAUnaJ.js";import"./tabs-CopK2m3j.js";const Se={title:"Kit/Builder/Form",component:p,parameters:{controls:{expanded:!0},backgrounds:{disable:!0}}},d={name:"Dynamic example (Tabs)",render:()=>{const c=r=>{console.log("Dynamic tabs form submitted:",r)},o=(r,n)=>{console.log(`[Tabs] Field ${r} changed to:`,n)},u=[{title:"Product Builder",layout:"tabs",variant:"card",defaultTabId:"product",tabsListClassName:"w-full",tabsContentClassName:"mt-2",tabs:[{id:"product",label:"Product",sections:[l.card("Product Configuration",[e.select("productType","Product Type",[{label:"One-time Purchase",value:"onetime"},{label:"Subscription",value:"subscription"},{label:"Bundle",value:"bundle"},{label:"Digital Download",value:"digital"}],{required:!0,placeholder:"Select product type"}),e.text("productName","Product Name",{required:!0,placeholder:"Enter product name"}),e.number("basePrice","Base Price ($)",{required:!0,placeholder:"29.99"}),e.select("billingCycle","Billing Cycle",[{label:"Monthly",value:"monthly"},{label:"Quarterly",value:"quarterly"},{label:"Yearly",value:"yearly"}],{required:!0,placeholder:"Select billing cycle",dependencies:[i.showWhen("productType",t.equals("subscription"))]}),e.number("trialDays","Free Trial Days",{placeholder:"14",defaultValue:0,dependencies:[i.showWhen("productType",t.equals("subscription"))]}),e.array("bundleItems","Bundle Items",[e.text("itemName","Item Name",{required:!0,placeholder:"Item name"}),e.number("itemPrice","Item Price ($)",{required:!0,placeholder:"9.99"}),e.number("quantity","Quantity",{required:!0,defaultValue:1,placeholder:"1"})],{gridCols:2,defaultValue:[{itemName:"",itemPrice:0,quantity:1}],dependencies:[i.showWhen("productType",t.equals("bundle"))]}),e.select("fileFormat","File Format",[{label:"PDF",value:"pdf"},{label:"ZIP Archive",value:"zip"},{label:"Video (MP4)",value:"mp4"},{label:"Audio (MP3)",value:"mp3"},{label:"Software Installer",value:"exe"}],{required:!0,placeholder:"Select file format",dependencies:[i.showWhen("productType",t.equals("digital"))]}),e.number("fileSizeMB","File Size (MB)",{placeholder:"50",dependencies:[i.showWhen("productType",t.equals("digital"))]})])]},{id:"pricing",label:"Pricing",sections:[l.card("Pricing & Discounts",[e.checkbox("hasDiscount","Apply Discount",{defaultValue:!1,gridCols:2}),e.select("discountType","Discount Type",[{label:"Percentage",value:"percentage"},{label:"Fixed Amount",value:"fixed"},{label:"Buy One Get One",value:"bogo"}],{required:!0,placeholder:"Select discount type",dependencies:[i.showWhen("hasDiscount",t.isTrue())]}),e.number("discountValue","Discount Value",{required:!0,placeholder:"10",dependencies:[i.showWhen("hasDiscount",t.isTrue()),i.showWhen("discountType",r=>r!=="bogo")]}),e.date("discountStartDate","Discount Start Date",{dependencies:[i.showWhen("hasDiscount",t.isTrue())]}),e.date("discountEndDate","Discount End Date",{dependencies:[i.showWhen("hasDiscount",t.isTrue())]}),e.number("minimumQuantity","Minimum Quantity for Discount",{placeholder:"2",defaultValue:1,dependencies:[i.showWhen("hasDiscount",t.isTrue())]})])]},{id:"shipping",label:"Shipping",sections:[l.card("Shipping Configuration",[e.checkbox("requiresShipping","Requires Physical Shipping",{defaultValue:!0,gridCols:2,dependencies:[i.setValueWhen("productType",t.equals("digital"),!1),i.disableWhen("productType",t.equals("digital"))]}),e.number("weight","Weight (lbs)",{placeholder:"1.5",dependencies:[i.showWhen("requiresShipping",t.isTrue())]}),e.object("dimensions","Dimensions (inches)",[e.number("length","Length",{required:!0,placeholder:"10"}),e.number("width","Width",{required:!0,placeholder:"8"}),e.number("height","Height",{required:!0,placeholder:"2"})],{dependencies:[i.showWhen("requiresShipping",t.isTrue())]}),e.select("shippingClass","Shipping Class",[{label:"Standard",value:"standard"},{label:"Express",value:"express"},{label:"Overnight",value:"overnight"},{label:"Fragile",value:"fragile"},{label:"Hazardous",value:"hazardous"}],{required:!0,defaultValue:"standard",placeholder:"Select shipping class",dependencies:[i.showWhen("requiresShipping",t.isTrue())]}),e.checkbox("freeShipping","Offer Free Shipping",{defaultValue:!1,dependencies:[i.showWhen("requiresShipping",t.isTrue())]}),e.number("freeShippingThreshold","Free Shipping Threshold ($)",{placeholder:"50",dependencies:[i.showWhen("requiresShipping",t.isTrue()),i.showWhen("freeShipping",t.isTrue())]})])]},{id:"inventory",label:"Inventory",sections:[l.card("Inventory Management",[e.checkbox("trackInventory","Track Inventory",{defaultValue:!0,gridCols:2,dependencies:[i.setValueWhen("productType",t.equals("digital"),!1)]}),e.number("stockQuantity","Stock Quantity",{required:!0,placeholder:"100",dependencies:[i.showWhen("trackInventory",t.isTrue())]}),e.number("lowStockThreshold","Low Stock Alert Threshold",{placeholder:"10",dependencies:[i.showWhen("trackInventory",t.isTrue())]}),e.checkbox("allowBackorders","Allow Backorders",{defaultValue:!1,dependencies:[i.showWhen("trackInventory",t.isTrue())]}),e.text("sku","SKU (Stock Keeping Unit)",{placeholder:"PROD-001",dependencies:[i.showWhen("trackInventory",t.isTrue())]}),e.text("barcode","Barcode",{placeholder:"123456789012",dependencies:[i.showWhen("trackInventory",t.isTrue())]})])]},{id:"marketing",label:"Marketing",sections:[l.card("Marketing & SEO",[e.text("metaTitle","Meta Title",{placeholder:"SEO-friendly title",gridCols:2}),e.textarea("metaDescription","Meta Description",{placeholder:"SEO-friendly description (150-160 characters)",gridCols:2}),e.array("tags","Product Tags",[e.text("tag","Tag",{required:!0,placeholder:"e.g., electronics, gadgets"})],{gridCols:2,defaultValue:[{tag:""}]}),e.checkbox("featured","Featured Product",{defaultValue:!1}),e.checkbox("newProduct","Mark as New",{defaultValue:!1}),e.select("visibility","Product Visibility",[{label:"Public",value:"public"},{label:"Private",value:"private"},{label:"Password Protected",value:"password"},{label:"Coming Soon",value:"coming_soon"}],{required:!0,defaultValue:"public",placeholder:"Select visibility"}),e.text("password","Access Password",{placeholder:"Enter password",dependencies:[i.showWhen("visibility",t.equals("password"))]}),e.date("launchDate","Launch Date",{dependencies:[i.showWhen("visibility",t.equals("coming_soon"))]})])]}]}];return a.jsxs("div",{className:"max-w-6xl mx-auto p-6",children:[a.jsxs("div",{className:"mb-8",children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Dynamic Product Configuration (Tabs)"}),a.jsx("p",{className:"text-gray-600 mt-2",children:"The same dynamic form organized into tabs for better navigation."})]}),a.jsx(p,{sections:u,onSubmit:c,onFieldChange:o,submitLabel:"Save Product Configuration",resetLabel:"Reset All",className:"space-y-8"})]})}},s={name:"Dynamic example",render:()=>{const c=r=>{console.log("Dynamic form submitted:",r)},o=(r,n)=>{console.log(`Field ${r} changed to:`,n),r==="productType"&&n==="subscription"&&console.log("Subscription product selected - additional fields will appear"),r==="hasDiscount"&&n===!0&&console.log("Discount enabled - discount fields will appear")},u=[l.card("Product Configuration",[e.select("productType","Product Type",[{label:"One-time Purchase",value:"onetime"},{label:"Subscription",value:"subscription"},{label:"Bundle",value:"bundle"},{label:"Digital Download",value:"digital"}],{required:!0,placeholder:"Select product type"}),e.text("productName","Product Name",{required:!0,placeholder:"Enter product name"}),e.number("basePrice","Base Price ($)",{required:!0,placeholder:"29.99"}),e.select("billingCycle","Billing Cycle",[{label:"Monthly",value:"monthly"},{label:"Quarterly",value:"quarterly"},{label:"Yearly",value:"yearly"}],{required:!0,placeholder:"Select billing cycle",dependencies:[i.showWhen("productType",t.equals("subscription"))]}),e.number("trialDays","Free Trial Days",{placeholder:"14",defaultValue:0,dependencies:[i.showWhen("productType",t.equals("subscription"))]}),e.array("bundleItems","Bundle Items",[e.text("itemName","Item Name",{required:!0,placeholder:"Item name"}),e.number("itemPrice","Item Price ($)",{required:!0,placeholder:"9.99"}),e.number("quantity","Quantity",{required:!0,defaultValue:1,placeholder:"1"})],{gridCols:2,defaultValue:[{itemName:"",itemPrice:0,quantity:1}],dependencies:[i.showWhen("productType",t.equals("bundle"))]}),e.select("fileFormat","File Format",[{label:"PDF",value:"pdf"},{label:"ZIP Archive",value:"zip"},{label:"Video (MP4)",value:"mp4"},{label:"Audio (MP3)",value:"mp3"},{label:"Software Installer",value:"exe"}],{required:!0,placeholder:"Select file format",dependencies:[i.showWhen("productType",t.equals("digital"))]}),e.number("fileSizeMB","File Size (MB)",{placeholder:"50",dependencies:[i.showWhen("productType",t.equals("digital"))]})]),l.card("Pricing & Discounts",[e.checkbox("hasDiscount","Apply Discount",{defaultValue:!1,gridCols:2}),e.select("discountType","Discount Type",[{label:"Percentage",value:"percentage"},{label:"Fixed Amount",value:"fixed"},{label:"Buy One Get One",value:"bogo"}],{required:!0,placeholder:"Select discount type",dependencies:[i.showWhen("hasDiscount",t.isTrue())]}),e.number("discountValue","Discount Value",{required:!0,placeholder:"10",dependencies:[i.showWhen("hasDiscount",t.isTrue()),i.showWhen("discountType",r=>r!=="bogo")]}),e.date("discountStartDate","Discount Start Date",{dependencies:[i.showWhen("hasDiscount",t.isTrue())]}),e.date("discountEndDate","Discount End Date",{dependencies:[i.showWhen("hasDiscount",t.isTrue())]}),e.number("minimumQuantity","Minimum Quantity for Discount",{placeholder:"2",defaultValue:1,dependencies:[i.showWhen("hasDiscount",t.isTrue())]})]),l.card("Shipping Configuration",[e.checkbox("requiresShipping","Requires Physical Shipping",{defaultValue:!0,gridCols:2,dependencies:[i.setValueWhen("productType",t.equals("digital"),!1),i.disableWhen("productType",t.equals("digital"))]}),e.number("weight","Weight (lbs)",{placeholder:"1.5",dependencies:[i.showWhen("requiresShipping",t.isTrue())]}),e.object("dimensions","Dimensions (inches)",[e.number("length","Length",{required:!0,placeholder:"10"}),e.number("width","Width",{required:!0,placeholder:"8"}),e.number("height","Height",{required:!0,placeholder:"2"})],{dependencies:[i.showWhen("requiresShipping",t.isTrue())]}),e.select("shippingClass","Shipping Class",[{label:"Standard",value:"standard"},{label:"Express",value:"express"},{label:"Overnight",value:"overnight"},{label:"Fragile",value:"fragile"},{label:"Hazardous",value:"hazardous"}],{required:!0,defaultValue:"standard",placeholder:"Select shipping class",dependencies:[i.showWhen("requiresShipping",t.isTrue())]}),e.checkbox("freeShipping","Offer Free Shipping",{defaultValue:!1,dependencies:[i.showWhen("requiresShipping",t.isTrue())]}),e.number("freeShippingThreshold","Free Shipping Threshold ($)",{placeholder:"50",dependencies:[i.showWhen("requiresShipping",t.isTrue()),i.showWhen("freeShipping",t.isTrue())]})]),l.card("Inventory Management",[e.checkbox("trackInventory","Track Inventory",{defaultValue:!0,gridCols:2,dependencies:[i.setValueWhen("productType",t.equals("digital"),!1)]}),e.number("stockQuantity","Stock Quantity",{required:!0,placeholder:"100",dependencies:[i.showWhen("trackInventory",t.isTrue())]}),e.number("lowStockThreshold","Low Stock Alert Threshold",{placeholder:"10",dependencies:[i.showWhen("trackInventory",t.isTrue())]}),e.checkbox("allowBackorders","Allow Backorders",{defaultValue:!1,dependencies:[i.showWhen("trackInventory",t.isTrue())]}),e.text("sku","SKU (Stock Keeping Unit)",{placeholder:"PROD-001",dependencies:[i.showWhen("trackInventory",t.isTrue())]}),e.text("barcode","Barcode",{placeholder:"123456789012",dependencies:[i.showWhen("trackInventory",t.isTrue())]})]),l.card("Marketing & SEO",[e.text("metaTitle","Meta Title",{placeholder:"SEO-friendly title",gridCols:2}),e.textarea("metaDescription","Meta Description",{placeholder:"SEO-friendly description (150-160 characters)",gridCols:2}),e.array("tags","Product Tags",[e.text("tag","Tag",{required:!0,placeholder:"e.g., electronics, gadgets"})],{gridCols:2,defaultValue:[{tag:""}]}),e.checkbox("featured","Featured Product",{defaultValue:!1}),e.checkbox("newProduct","Mark as New",{defaultValue:!1}),e.select("visibility","Product Visibility",[{label:"Public",value:"public"},{label:"Private",value:"private"},{label:"Password Protected",value:"password"},{label:"Coming Soon",value:"coming_soon"}],{required:!0,defaultValue:"public",placeholder:"Select visibility"}),e.text("password","Access Password",{placeholder:"Enter password",dependencies:[i.showWhen("visibility",t.equals("password"))]}),e.date("launchDate","Launch Date",{dependencies:[i.showWhen("visibility",t.equals("coming_soon"))]})])];return a.jsxs("div",{className:"max-w-6xl mx-auto p-6",children:[a.jsxs("div",{className:"mb-8",children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Dynamic Product Configuration"}),a.jsx("p",{className:"text-gray-600 mt-2",children:"This form demonstrates advanced field dependencies and real-time interactions. Watch how fields appear, disappear, and change based on your selections."}),a.jsxs("div",{className:"mt-4 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[a.jsx("h3",{className:"font-semibold text-blue-900",children:"Try these interactions:"}),a.jsxs("ul",{className:"mt-2 text-sm text-blue-800 space-y-1",children:[a.jsx("li",{children:"• Change Product Type to see different field sets"}),a.jsx("li",{children:'• Enable "Apply Discount" to reveal discount configuration'}),a.jsx("li",{children:'• Toggle "Requires Physical Shipping" for shipping options'}),a.jsx("li",{children:'• Select "Digital Download" to auto-disable shipping'}),a.jsx("li",{children:'• Choose "Password Protected" visibility for password field'})]})]})]}),a.jsx(p,{sections:u,onSubmit:c,onFieldChange:o,submitLabel:"Save Product Configuration",resetLabel:"Reset All",className:"space-y-8"})]})}};var h,m,b;d.parameters={...d.parameters,docs:{...(h=d.parameters)==null?void 0:h.docs,source:{originalSource:`{
2
- name: 'Dynamic example (Tabs)',
3
- render: () => {
4
- const handleSubmit = (data: unknown) => {
5
- console.log('Dynamic tabs form submitted:', data);
6
- };
7
- const handleFieldChange = (name: string, value: unknown) => {
8
- console.log(\`[Tabs] Field \${name} changed to:\`, value);
9
- };
10
- const sections: FormBuilderSectionConfig[] = [{
11
- title: 'Product Builder',
12
- layout: 'tabs',
13
- variant: 'card',
14
- defaultTabId: 'product',
15
- tabsListClassName: 'w-full',
16
- tabsContentClassName: 'mt-2',
17
- tabs: [{
18
- id: 'product',
19
- label: 'Product',
20
- sections: [createSection.card('Product Configuration', [createField.select('productType', 'Product Type', [{
21
- label: 'One-time Purchase',
22
- value: 'onetime'
23
- }, {
24
- label: 'Subscription',
25
- value: 'subscription'
26
- }, {
27
- label: 'Bundle',
28
- value: 'bundle'
29
- }, {
30
- label: 'Digital Download',
31
- value: 'digital'
32
- }], {
33
- required: true,
34
- placeholder: 'Select product type'
35
- }), createField.text('productName', 'Product Name', {
36
- required: true,
37
- placeholder: 'Enter product name'
38
- }), createField.number('basePrice', 'Base Price ($)', {
39
- required: true,
40
- placeholder: '29.99'
41
- }), createField.select('billingCycle', 'Billing Cycle', [{
42
- label: 'Monthly',
43
- value: 'monthly'
44
- }, {
45
- label: 'Quarterly',
46
- value: 'quarterly'
47
- }, {
48
- label: 'Yearly',
49
- value: 'yearly'
50
- }], {
51
- required: true,
52
- placeholder: 'Select billing cycle',
53
- dependencies: [createDependency.showWhen('productType', conditions.equals('subscription'))]
54
- }), createField.number('trialDays', 'Free Trial Days', {
55
- placeholder: '14',
56
- defaultValue: 0,
57
- dependencies: [createDependency.showWhen('productType', conditions.equals('subscription'))]
58
- }), createField.array('bundleItems', 'Bundle Items', [createField.text('itemName', 'Item Name', {
59
- required: true,
60
- placeholder: 'Item name'
61
- }), createField.number('itemPrice', 'Item Price ($)', {
62
- required: true,
63
- placeholder: '9.99'
64
- }), createField.number('quantity', 'Quantity', {
65
- required: true,
66
- defaultValue: 1,
67
- placeholder: '1'
68
- })], {
69
- gridCols: 2,
70
- defaultValue: [{
71
- itemName: '',
72
- itemPrice: 0,
73
- quantity: 1
74
- }],
75
- dependencies: [createDependency.showWhen('productType', conditions.equals('bundle'))]
76
- }), createField.select('fileFormat', 'File Format', [{
77
- label: 'PDF',
78
- value: 'pdf'
79
- }, {
80
- label: 'ZIP Archive',
81
- value: 'zip'
82
- }, {
83
- label: 'Video (MP4)',
84
- value: 'mp4'
85
- }, {
86
- label: 'Audio (MP3)',
87
- value: 'mp3'
88
- }, {
89
- label: 'Software Installer',
90
- value: 'exe'
91
- }], {
92
- required: true,
93
- placeholder: 'Select file format',
94
- dependencies: [createDependency.showWhen('productType', conditions.equals('digital'))]
95
- }), createField.number('fileSizeMB', 'File Size (MB)', {
96
- placeholder: '50',
97
- dependencies: [createDependency.showWhen('productType', conditions.equals('digital'))]
98
- })])]
99
- }, {
100
- id: 'pricing',
101
- label: 'Pricing',
102
- sections: [createSection.card('Pricing & Discounts', [createField.checkbox('hasDiscount', 'Apply Discount', {
103
- defaultValue: false,
104
- gridCols: 2
105
- }), createField.select('discountType', 'Discount Type', [{
106
- label: 'Percentage',
107
- value: 'percentage'
108
- }, {
109
- label: 'Fixed Amount',
110
- value: 'fixed'
111
- }, {
112
- label: 'Buy One Get One',
113
- value: 'bogo'
114
- }], {
115
- required: true,
116
- placeholder: 'Select discount type',
117
- dependencies: [createDependency.showWhen('hasDiscount', conditions.isTrue())]
118
- }), createField.number('discountValue', 'Discount Value', {
119
- required: true,
120
- placeholder: '10',
121
- dependencies: [createDependency.showWhen('hasDiscount', conditions.isTrue()), createDependency.showWhen('discountType', value => value !== 'bogo')]
122
- }), createField.date('discountStartDate', 'Discount Start Date', {
123
- dependencies: [createDependency.showWhen('hasDiscount', conditions.isTrue())]
124
- }), createField.date('discountEndDate', 'Discount End Date', {
125
- dependencies: [createDependency.showWhen('hasDiscount', conditions.isTrue())]
126
- }), createField.number('minimumQuantity', 'Minimum Quantity for Discount', {
127
- placeholder: '2',
128
- defaultValue: 1,
129
- dependencies: [createDependency.showWhen('hasDiscount', conditions.isTrue())]
130
- })])]
131
- }, {
132
- id: 'shipping',
133
- label: 'Shipping',
134
- sections: [createSection.card('Shipping Configuration', [createField.checkbox('requiresShipping', 'Requires Physical Shipping', {
135
- defaultValue: true,
136
- gridCols: 2,
137
- dependencies: [createDependency.setValueWhen('productType', conditions.equals('digital'), false), createDependency.disableWhen('productType', conditions.equals('digital'))]
138
- }), createField.number('weight', 'Weight (lbs)', {
139
- placeholder: '1.5',
140
- dependencies: [createDependency.showWhen('requiresShipping', conditions.isTrue())]
141
- }), createField.object('dimensions', 'Dimensions (inches)', [createField.number('length', 'Length', {
142
- required: true,
143
- placeholder: '10'
144
- }), createField.number('width', 'Width', {
145
- required: true,
146
- placeholder: '8'
147
- }), createField.number('height', 'Height', {
148
- required: true,
149
- placeholder: '2'
150
- })], {
151
- dependencies: [createDependency.showWhen('requiresShipping', conditions.isTrue())]
152
- }), createField.select('shippingClass', 'Shipping Class', [{
153
- label: 'Standard',
154
- value: 'standard'
155
- }, {
156
- label: 'Express',
157
- value: 'express'
158
- }, {
159
- label: 'Overnight',
160
- value: 'overnight'
161
- }, {
162
- label: 'Fragile',
163
- value: 'fragile'
164
- }, {
165
- label: 'Hazardous',
166
- value: 'hazardous'
167
- }], {
168
- required: true,
169
- defaultValue: 'standard',
170
- placeholder: 'Select shipping class',
171
- dependencies: [createDependency.showWhen('requiresShipping', conditions.isTrue())]
172
- }), createField.checkbox('freeShipping', 'Offer Free Shipping', {
173
- defaultValue: false,
174
- dependencies: [createDependency.showWhen('requiresShipping', conditions.isTrue())]
175
- }), createField.number('freeShippingThreshold', 'Free Shipping Threshold ($)', {
176
- placeholder: '50',
177
- dependencies: [createDependency.showWhen('requiresShipping', conditions.isTrue()), createDependency.showWhen('freeShipping', conditions.isTrue())]
178
- })])]
179
- }, {
180
- id: 'inventory',
181
- label: 'Inventory',
182
- sections: [createSection.card('Inventory Management', [createField.checkbox('trackInventory', 'Track Inventory', {
183
- defaultValue: true,
184
- gridCols: 2,
185
- dependencies: [createDependency.setValueWhen('productType', conditions.equals('digital'), false)]
186
- }), createField.number('stockQuantity', 'Stock Quantity', {
187
- required: true,
188
- placeholder: '100',
189
- dependencies: [createDependency.showWhen('trackInventory', conditions.isTrue())]
190
- }), createField.number('lowStockThreshold', 'Low Stock Alert Threshold', {
191
- placeholder: '10',
192
- dependencies: [createDependency.showWhen('trackInventory', conditions.isTrue())]
193
- }), createField.checkbox('allowBackorders', 'Allow Backorders', {
194
- defaultValue: false,
195
- dependencies: [createDependency.showWhen('trackInventory', conditions.isTrue())]
196
- }), createField.text('sku', 'SKU (Stock Keeping Unit)', {
197
- placeholder: 'PROD-001',
198
- dependencies: [createDependency.showWhen('trackInventory', conditions.isTrue())]
199
- }), createField.text('barcode', 'Barcode', {
200
- placeholder: '123456789012',
201
- dependencies: [createDependency.showWhen('trackInventory', conditions.isTrue())]
202
- })])]
203
- }, {
204
- id: 'marketing',
205
- label: 'Marketing',
206
- sections: [createSection.card('Marketing & SEO', [createField.text('metaTitle', 'Meta Title', {
207
- placeholder: 'SEO-friendly title',
208
- gridCols: 2
209
- }), createField.textarea('metaDescription', 'Meta Description', {
210
- placeholder: 'SEO-friendly description (150-160 characters)',
211
- gridCols: 2
212
- }), createField.array('tags', 'Product Tags', [createField.text('tag', 'Tag', {
213
- required: true,
214
- placeholder: 'e.g., electronics, gadgets'
215
- })], {
216
- gridCols: 2,
217
- defaultValue: [{
218
- tag: ''
219
- }]
220
- }), createField.checkbox('featured', 'Featured Product', {
221
- defaultValue: false
222
- }), createField.checkbox('newProduct', 'Mark as New', {
223
- defaultValue: false
224
- }), createField.select('visibility', 'Product Visibility', [{
225
- label: 'Public',
226
- value: 'public'
227
- }, {
228
- label: 'Private',
229
- value: 'private'
230
- }, {
231
- label: 'Password Protected',
232
- value: 'password'
233
- }, {
234
- label: 'Coming Soon',
235
- value: 'coming_soon'
236
- }], {
237
- required: true,
238
- defaultValue: 'public',
239
- placeholder: 'Select visibility'
240
- }), createField.text('password', 'Access Password', {
241
- placeholder: 'Enter password',
242
- dependencies: [createDependency.showWhen('visibility', conditions.equals('password'))]
243
- }), createField.date('launchDate', 'Launch Date', {
244
- dependencies: [createDependency.showWhen('visibility', conditions.equals('coming_soon'))]
245
- })])]
246
- }]
247
- }];
248
- return <div className="max-w-6xl mx-auto p-6">
249
- <div className="mb-8">
250
- <h1 className="text-3xl font-bold text-gray-900">Dynamic Product Configuration (Tabs)</h1>
251
- <p className="text-gray-600 mt-2">The same dynamic form organized into tabs for better navigation.</p>
252
- </div>
253
- <FormBuilder sections={sections} onSubmit={handleSubmit} onFieldChange={handleFieldChange} submitLabel="Save Product Configuration" resetLabel="Reset All" className="space-y-8" />
254
- </div>;
255
- }
256
- }`,...(b=(m=d.parameters)==null?void 0:m.docs)==null?void 0:b.source}}};var g,y,f;s.parameters={...s.parameters,docs:{...(g=s.parameters)==null?void 0:g.docs,source:{originalSource:`{
257
- name: 'Dynamic example',
258
- render: () => {
259
- const handleSubmit = (data: unknown) => {
260
- console.log('Dynamic form submitted:', data);
261
- };
262
- const handleFieldChange = (name: string, value: unknown) => {
263
- console.log(\`Field \${name} changed to:\`, value);
264
- if (name === 'productType' && value === 'subscription') {
265
- console.log('Subscription product selected - additional fields will appear');
266
- }
267
- if (name === 'hasDiscount' && value === true) {
268
- console.log('Discount enabled - discount fields will appear');
269
- }
270
- };
271
- const sections = [createSection.card('Product Configuration', [createField.select('productType', 'Product Type', [{
272
- label: 'One-time Purchase',
273
- value: 'onetime'
274
- }, {
275
- label: 'Subscription',
276
- value: 'subscription'
277
- }, {
278
- label: 'Bundle',
279
- value: 'bundle'
280
- }, {
281
- label: 'Digital Download',
282
- value: 'digital'
283
- }], {
284
- required: true,
285
- placeholder: 'Select product type'
286
- }), createField.text('productName', 'Product Name', {
287
- required: true,
288
- placeholder: 'Enter product name'
289
- }), createField.number('basePrice', 'Base Price ($)', {
290
- required: true,
291
- placeholder: '29.99'
292
- }), createField.select('billingCycle', 'Billing Cycle', [{
293
- label: 'Monthly',
294
- value: 'monthly'
295
- }, {
296
- label: 'Quarterly',
297
- value: 'quarterly'
298
- }, {
299
- label: 'Yearly',
300
- value: 'yearly'
301
- }], {
302
- required: true,
303
- placeholder: 'Select billing cycle',
304
- dependencies: [createDependency.showWhen('productType', conditions.equals('subscription'))]
305
- }), createField.number('trialDays', 'Free Trial Days', {
306
- placeholder: '14',
307
- defaultValue: 0,
308
- dependencies: [createDependency.showWhen('productType', conditions.equals('subscription'))]
309
- }), createField.array('bundleItems', 'Bundle Items', [createField.text('itemName', 'Item Name', {
310
- required: true,
311
- placeholder: 'Item name'
312
- }), createField.number('itemPrice', 'Item Price ($)', {
313
- required: true,
314
- placeholder: '9.99'
315
- }), createField.number('quantity', 'Quantity', {
316
- required: true,
317
- defaultValue: 1,
318
- placeholder: '1'
319
- })], {
320
- gridCols: 2,
321
- defaultValue: [{
322
- itemName: '',
323
- itemPrice: 0,
324
- quantity: 1
325
- }],
326
- dependencies: [createDependency.showWhen('productType', conditions.equals('bundle'))]
327
- }), createField.select('fileFormat', 'File Format', [{
328
- label: 'PDF',
329
- value: 'pdf'
330
- }, {
331
- label: 'ZIP Archive',
332
- value: 'zip'
333
- }, {
334
- label: 'Video (MP4)',
335
- value: 'mp4'
336
- }, {
337
- label: 'Audio (MP3)',
338
- value: 'mp3'
339
- }, {
340
- label: 'Software Installer',
341
- value: 'exe'
342
- }], {
343
- required: true,
344
- placeholder: 'Select file format',
345
- dependencies: [createDependency.showWhen('productType', conditions.equals('digital'))]
346
- }), createField.number('fileSizeMB', 'File Size (MB)', {
347
- placeholder: '50',
348
- dependencies: [createDependency.showWhen('productType', conditions.equals('digital'))]
349
- })]), createSection.card('Pricing & Discounts', [createField.checkbox('hasDiscount', 'Apply Discount', {
350
- defaultValue: false,
351
- gridCols: 2
352
- }), createField.select('discountType', 'Discount Type', [{
353
- label: 'Percentage',
354
- value: 'percentage'
355
- }, {
356
- label: 'Fixed Amount',
357
- value: 'fixed'
358
- }, {
359
- label: 'Buy One Get One',
360
- value: 'bogo'
361
- }], {
362
- required: true,
363
- placeholder: 'Select discount type',
364
- dependencies: [createDependency.showWhen('hasDiscount', conditions.isTrue())]
365
- }), createField.number('discountValue', 'Discount Value', {
366
- required: true,
367
- placeholder: '10',
368
- dependencies: [createDependency.showWhen('hasDiscount', conditions.isTrue()), createDependency.showWhen('discountType', value => value !== 'bogo')]
369
- }), createField.date('discountStartDate', 'Discount Start Date', {
370
- dependencies: [createDependency.showWhen('hasDiscount', conditions.isTrue())]
371
- }), createField.date('discountEndDate', 'Discount End Date', {
372
- dependencies: [createDependency.showWhen('hasDiscount', conditions.isTrue())]
373
- }), createField.number('minimumQuantity', 'Minimum Quantity for Discount', {
374
- placeholder: '2',
375
- defaultValue: 1,
376
- dependencies: [createDependency.showWhen('hasDiscount', conditions.isTrue())]
377
- })]), createSection.card('Shipping Configuration', [createField.checkbox('requiresShipping', 'Requires Physical Shipping', {
378
- defaultValue: true,
379
- gridCols: 2,
380
- dependencies: [createDependency.setValueWhen('productType', conditions.equals('digital'), false), createDependency.disableWhen('productType', conditions.equals('digital'))]
381
- }), createField.number('weight', 'Weight (lbs)', {
382
- placeholder: '1.5',
383
- dependencies: [createDependency.showWhen('requiresShipping', conditions.isTrue())]
384
- }), createField.object('dimensions', 'Dimensions (inches)', [createField.number('length', 'Length', {
385
- required: true,
386
- placeholder: '10'
387
- }), createField.number('width', 'Width', {
388
- required: true,
389
- placeholder: '8'
390
- }), createField.number('height', 'Height', {
391
- required: true,
392
- placeholder: '2'
393
- })], {
394
- dependencies: [createDependency.showWhen('requiresShipping', conditions.isTrue())]
395
- }), createField.select('shippingClass', 'Shipping Class', [{
396
- label: 'Standard',
397
- value: 'standard'
398
- }, {
399
- label: 'Express',
400
- value: 'express'
401
- }, {
402
- label: 'Overnight',
403
- value: 'overnight'
404
- }, {
405
- label: 'Fragile',
406
- value: 'fragile'
407
- }, {
408
- label: 'Hazardous',
409
- value: 'hazardous'
410
- }], {
411
- required: true,
412
- defaultValue: 'standard',
413
- placeholder: 'Select shipping class',
414
- dependencies: [createDependency.showWhen('requiresShipping', conditions.isTrue())]
415
- }), createField.checkbox('freeShipping', 'Offer Free Shipping', {
416
- defaultValue: false,
417
- dependencies: [createDependency.showWhen('requiresShipping', conditions.isTrue())]
418
- }), createField.number('freeShippingThreshold', 'Free Shipping Threshold ($)', {
419
- placeholder: '50',
420
- dependencies: [createDependency.showWhen('requiresShipping', conditions.isTrue()), createDependency.showWhen('freeShipping', conditions.isTrue())]
421
- })]), createSection.card('Inventory Management', [createField.checkbox('trackInventory', 'Track Inventory', {
422
- defaultValue: true,
423
- gridCols: 2,
424
- dependencies: [createDependency.setValueWhen('productType', conditions.equals('digital'), false)]
425
- }), createField.number('stockQuantity', 'Stock Quantity', {
426
- required: true,
427
- placeholder: '100',
428
- dependencies: [createDependency.showWhen('trackInventory', conditions.isTrue())]
429
- }), createField.number('lowStockThreshold', 'Low Stock Alert Threshold', {
430
- placeholder: '10',
431
- dependencies: [createDependency.showWhen('trackInventory', conditions.isTrue())]
432
- }), createField.checkbox('allowBackorders', 'Allow Backorders', {
433
- defaultValue: false,
434
- dependencies: [createDependency.showWhen('trackInventory', conditions.isTrue())]
435
- }), createField.text('sku', 'SKU (Stock Keeping Unit)', {
436
- placeholder: 'PROD-001',
437
- dependencies: [createDependency.showWhen('trackInventory', conditions.isTrue())]
438
- }), createField.text('barcode', 'Barcode', {
439
- placeholder: '123456789012',
440
- dependencies: [createDependency.showWhen('trackInventory', conditions.isTrue())]
441
- })]), createSection.card('Marketing & SEO', [createField.text('metaTitle', 'Meta Title', {
442
- placeholder: 'SEO-friendly title',
443
- gridCols: 2
444
- }), createField.textarea('metaDescription', 'Meta Description', {
445
- placeholder: 'SEO-friendly description (150-160 characters)',
446
- gridCols: 2
447
- }), createField.array('tags', 'Product Tags', [createField.text('tag', 'Tag', {
448
- required: true,
449
- placeholder: 'e.g., electronics, gadgets'
450
- })], {
451
- gridCols: 2,
452
- defaultValue: [{
453
- tag: ''
454
- }]
455
- }), createField.checkbox('featured', 'Featured Product', {
456
- defaultValue: false
457
- }), createField.checkbox('newProduct', 'Mark as New', {
458
- defaultValue: false
459
- }), createField.select('visibility', 'Product Visibility', [{
460
- label: 'Public',
461
- value: 'public'
462
- }, {
463
- label: 'Private',
464
- value: 'private'
465
- }, {
466
- label: 'Password Protected',
467
- value: 'password'
468
- }, {
469
- label: 'Coming Soon',
470
- value: 'coming_soon'
471
- }], {
472
- required: true,
473
- defaultValue: 'public',
474
- placeholder: 'Select visibility'
475
- }), createField.text('password', 'Access Password', {
476
- placeholder: 'Enter password',
477
- dependencies: [createDependency.showWhen('visibility', conditions.equals('password'))]
478
- }), createField.date('launchDate', 'Launch Date', {
479
- dependencies: [createDependency.showWhen('visibility', conditions.equals('coming_soon'))]
480
- })])];
481
- return <div className="max-w-6xl mx-auto p-6">
482
- <div className="mb-8">
483
- <h1 className="text-3xl font-bold text-gray-900">Dynamic Product Configuration</h1>
484
- <p className="text-gray-600 mt-2">
485
- This form demonstrates advanced field dependencies and real-time interactions. Watch how fields appear, disappear, and change based on your selections.
486
- </p>
487
- <div className="mt-4 p-4 bg-blue-50 border border-blue-200 rounded-lg">
488
- <h3 className="font-semibold text-blue-900">Try these interactions:</h3>
489
- <ul className="mt-2 text-sm text-blue-800 space-y-1">
490
- <li>• Change Product Type to see different field sets</li>
491
- <li>• Enable "Apply Discount" to reveal discount configuration</li>
492
- <li>• Toggle "Requires Physical Shipping" for shipping options</li>
493
- <li>• Select "Digital Download" to auto-disable shipping</li>
494
- <li>• Choose "Password Protected" visibility for password field</li>
495
- </ul>
496
- </div>
497
- </div>
498
-
499
- <FormBuilder sections={sections} onSubmit={handleSubmit} onFieldChange={handleFieldChange} submitLabel="Save Product Configuration" resetLabel="Reset All" className="space-y-8" />
500
- </div>;
501
- }
502
- }`,...(f=(y=s.parameters)==null?void 0:y.docs)==null?void 0:f.source}}};const Te=["DynamicTabsExample","DynamicExample"];export{s as DynamicExample,d as DynamicTabsExample,Te as __namedExportsOrder,Se as default};
@@ -1,53 +0,0 @@
1
- import{j as t}from"./jsx-runtime-D_zvdyIk.js";import{F as i}from"./FormBuilder-BQBBxo_k.js";import{c,a as e,b as n}from"./section-factories-DCCY9R35.js";import"./iframe-v7iAhKit.js";import"./preload-helper-Dp1pzeXC.js";import"./schemas-CGNYCiJ6.js";import"./utils-D-KgF5mV.js";import"./button-0oMkiryo.js";import"./index-DbaA6-o1.js";import"./index-CGrAONsN.js";import"./label-Do8ODIVk.js";import"./index-Tp9IdbR8.js";import"./index-DrN5n71E.js";import"./index-CwBdPBFz.js";import"./Autocomplete-Cpg4CaJe.js";import"./popover-CcciSWAw.js";import"./index-DW48STyt.js";import"./index-CDY5kTx5.js";import"./index-BVDb4dFc.js";import"./index-0-qMRXou.js";import"./Combination-BdQWAuko.js";import"./index-BfiCOk42.js";import"./index-D8RXF03I.js";import"./index-nqc17SX4.js";import"./index-Bw1A27Kp.js";import"./index-jrimW4QO.js";import"./index-AvwFFKJc.js";import"./index-ByqivBWx.js";import"./command-Csa9p8_a.js";import"./index-Z6wF44KX.js";import"./dialog-CsnqITTn.js";import"./x-B1a4fyWM.js";import"./createLucideIcon-BrHXro7t.js";import"./badge-BnQWua6u.js";import"./check-B9hBGj6o.js";import"./input-11YRd9gD.js";import"./textarea-Dw2vruMl.js";import"./select-DDrkxaOg.js";import"./index-BdQq_4o_.js";import"./index-Bv9yk470.js";import"./index-B_qx7A5T.js";import"./index-_RPqOjlQ.js";import"./index-C9Ta0ZTH.js";import"./chevron-down-D_37S6il.js";import"./checkbox-CyIeaWHX.js";import"./switch-CKGRuk3u.js";import"./radio-group-DiJ0Y_KQ.js";import"./index-CWjrGFAQ.js";import"./circle-C5Lzx6Nx.js";import"./card-BJpPOzP8.js";import"./table-CP3vMqFn.js";import"./trash-2-xdbApPby.js";import"./grip-vertical-BxXG8KNA.js";import"./SectionBuilder-BQW705x0.js";import"./separator-o5SAUnaJ.js";import"./tabs-CopK2m3j.js";const be={title:"Kit/Builder/Form",component:i,parameters:{controls:{expanded:!0},backgrounds:{disable:!0}}},r={name:"Simple example",render:()=>{const s=p=>{console.log("Form submitted:",p)},m=[c.card("Contact Information",[e.text("name","Full Name",{required:!0,placeholder:"Enter your full name"}),e.email("email","Email Address",{required:!0,placeholder:"Enter your email address"}),e.text("phone","Phone Number",{validation:n.phone,placeholder:"+1 (555) 123-4567"}),e.select("subject","Subject",[{label:"General Inquiry",value:"general"},{label:"Technical Support",value:"support"},{label:"Sales Question",value:"sales"},{label:"Partnership",value:"partnership"}],{required:!0,placeholder:"Select a subject"}),e.textarea("message","Message",{required:!0,placeholder:"Enter your message here...",gridCols:2}),e.checkbox("subscribe","Subscribe to newsletter",{defaultValue:!1,gridCols:2}),e.switch("contactPermission","Allow contact by phone",{defaultValue:!1,gridCols:2})])];return t.jsxs("div",{className:"max-w-2xl mx-auto p-6",children:[t.jsxs("div",{className:"mb-6",children:[t.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Contact Us"}),t.jsx("p",{className:"text-gray-600 mt-2",children:"Fill out the form below and we'll get back to you as soon as possible."})]}),t.jsx(i,{sections:m,onSubmit:s,className:"space-y-6"})]})}};var o,a,l;r.parameters={...r.parameters,docs:{...(o=r.parameters)==null?void 0:o.docs,source:{originalSource:`{
2
- name: 'Simple example',
3
- render: () => {
4
- const handleSubmit = (data: unknown) => {
5
- console.log('Form submitted:', data);
6
- };
7
- const sections = [createSection.card('Contact Information', [createField.text('name', 'Full Name', {
8
- required: true,
9
- placeholder: 'Enter your full name'
10
- }), createField.email('email', 'Email Address', {
11
- required: true,
12
- placeholder: 'Enter your email address'
13
- }), createField.text('phone', 'Phone Number', {
14
- validation: commonValidations.phone,
15
- placeholder: '+1 (555) 123-4567'
16
- }), createField.select('subject', 'Subject', [{
17
- label: 'General Inquiry',
18
- value: 'general'
19
- }, {
20
- label: 'Technical Support',
21
- value: 'support'
22
- }, {
23
- label: 'Sales Question',
24
- value: 'sales'
25
- }, {
26
- label: 'Partnership',
27
- value: 'partnership'
28
- }], {
29
- required: true,
30
- placeholder: 'Select a subject'
31
- }), createField.textarea('message', 'Message', {
32
- required: true,
33
- placeholder: 'Enter your message here...',
34
- gridCols: 2
35
- }), createField.checkbox('subscribe', 'Subscribe to newsletter', {
36
- defaultValue: false,
37
- gridCols: 2
38
- }), createField.switch('contactPermission', 'Allow contact by phone', {
39
- defaultValue: false,
40
- gridCols: 2
41
- })])];
42
- return <div className="max-w-2xl mx-auto p-6">
43
- <div className="mb-6">
44
- <h1 className="text-2xl font-bold text-gray-900">Contact Us</h1>
45
- <p className="text-gray-600 mt-2">
46
- Fill out the form below and we'll get back to you as soon as possible.
47
- </p>
48
- </div>
49
-
50
- <FormBuilder sections={sections} onSubmit={handleSubmit} className="space-y-6" />
51
- </div>;
52
- }
53
- }`,...(l=(a=r.parameters)==null?void 0:a.docs)==null?void 0:l.source}}};const he=["SimpleExample"];export{r as SimpleExample,he as __namedExportsOrder,be as default};
@@ -1,3 +0,0 @@
1
- import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{r as n}from"./iframe-v7iAhKit.js";import{S as _}from"./index-DbaA6-o1.js";import{F as v,C,p as w,q as D,o as $,s as h,d as P,e as E}from"./schemas-CGNYCiJ6.js";import{c as d}from"./utils-D-KgF5mV.js";import{L as M}from"./label-Do8ODIVk.js";import{I as F}from"./input-11YRd9gD.js";import{B as V}from"./button-0oMkiryo.js";import{t as L}from"./index-XSmPROEP.js";import"./preload-helper-Dp1pzeXC.js";import"./index-Tp9IdbR8.js";import"./index-DrN5n71E.js";import"./index-CwBdPBFz.js";import"./index-CGrAONsN.js";const y=v,b=n.createContext({}),l=({...o})=>e.jsx(b.Provider,{value:{name:o.name},children:e.jsx(C,{...o})}),c=()=>{const o=n.useContext(b),r=n.useContext(S),{getFieldState:t}=w(),s=D({name:o.name}),a=t(o.name,s);if(!o)throw new Error("useFormField should be used within <FormField>");const{id:m}=r;return{id:m,name:o.name,formItemId:`${m}-form-item`,formDescriptionId:`${m}-form-item-description`,formMessageId:`${m}-form-item-message`,...a}},S=n.createContext({});function p({className:o,...r}){const t=n.useId();return e.jsx(S.Provider,{value:{id:t},children:e.jsx("div",{"data-slot":"form-item",className:d("grid gap-2",o),...r})})}function u({className:o,...r}){const{error:t,formItemId:s}=c();return e.jsx(M,{"data-slot":"form-label","data-error":!!t,className:d("data-[error=true]:text-destructive",o),htmlFor:s,...r})}function f({...o}){const{error:r,formItemId:t,formDescriptionId:s,formMessageId:a}=c();return e.jsx(_,{"data-slot":"form-control",id:t,"aria-describedby":r?`${s} ${a}`:`${s}`,"aria-invalid":!!r,...o})}function N({className:o,...r}){const{formDescriptionId:t}=c();return e.jsx("p",{"data-slot":"form-description",id:t,className:d("text-muted-foreground text-sm",o),...r})}function x({className:o,...r}){const{error:t,formMessageId:s}=c(),a=t?String((t==null?void 0:t.message)??""):r.children;return a?e.jsx("p",{"data-slot":"form-message",id:s,className:d("text-destructive text-sm",o),...r,children:a}):null}p.__docgenInfo={description:"",methods:[],displayName:"FormItem"};u.__docgenInfo={description:"",methods:[],displayName:"FormLabel"};f.__docgenInfo={description:"",methods:[],displayName:"FormControl"};N.__docgenInfo={description:"",methods:[],displayName:"FormDescription"};x.__docgenInfo={description:"",methods:[],displayName:"FormMessage"};l.__docgenInfo={description:"",methods:[],displayName:"FormField"};const X={title:"Shadcn/UI/Form",component:y};function W(){const o=$({email:h().email("Please enter a valid email"),password:h().min(6,"Password must be at least 6 characters")}),r=P({resolver:E(o),defaultValues:{email:"",password:""},mode:"onTouched"});function t(s){L.success(`Submitted: ${JSON.stringify(s,null,2)}`)}return e.jsx("div",{className:"max-w-md space-y-6",children:e.jsx(y,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(t),className:"space-y-4",children:[e.jsx(l,{control:r.control,name:"email",render:({field:s})=>e.jsxs(p,{children:[e.jsx(u,{children:"Email"}),e.jsx(f,{children:e.jsx(F,{type:"email",placeholder:"you@example.com",...s})}),e.jsx(N,{children:"We’ll never share your email."}),e.jsx(x,{})]})}),e.jsx(l,{control:r.control,name:"password",render:({field:s})=>e.jsxs(p,{children:[e.jsx(u,{children:"Password"}),e.jsx(f,{children:e.jsx(F,{type:"password",placeholder:"••••••••",...s})}),e.jsx(x,{})]})}),e.jsx(V,{type:"submit",className:"w-full",children:"Sign in"})]})})})}const i={render:()=>e.jsx(W,{})};var j,I,g;i.parameters={...i.parameters,docs:{...(j=i.parameters)==null?void 0:j.docs,source:{originalSource:`{
2
- render: () => <ValidatedFormDemo />
3
- }`,...(g=(I=i.parameters)==null?void 0:I.docs)==null?void 0:g.source}}};const Y=["WithValidation"];export{i as WithValidation,Y as __namedExportsOrder,X as default};