@k3-universe/react-kit 0.0.1 → 0.0.2

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 (217) hide show
  1. package/.storybook/preview.ts +1 -1
  2. package/dist/index.d.ts +63 -0
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +91 -0
  5. package/dist/kit/builder/data-table/components/DataTable.d.ts +4 -1
  6. package/dist/kit/builder/data-table/components/DataTable.d.ts.map +1 -1
  7. package/dist/kit/builder/data-table/index.d.ts +6 -5
  8. package/dist/kit/builder/data-table/index.d.ts.map +1 -1
  9. package/dist/kit/builder/form/components/FormBuilder.d.ts +4 -1
  10. package/dist/kit/builder/form/components/FormBuilder.d.ts.map +1 -1
  11. package/dist/kit/builder/form/components/{FormActions.d.ts → FormBuilderActions.d.ts} +3 -3
  12. package/dist/kit/builder/form/components/FormBuilderActions.d.ts.map +1 -0
  13. package/{storybook-static/kit/builder/form/components/FormField.d.ts → dist/kit/builder/form/components/FormBuilderField.d.ts} +4 -4
  14. package/dist/kit/builder/form/components/FormBuilderField.d.ts.map +1 -0
  15. package/dist/kit/builder/form/components/index.d.ts +2 -3
  16. package/dist/kit/builder/form/components/index.d.ts.map +1 -1
  17. package/dist/kit/builder/section/SectionBuilder.d.ts.map +1 -1
  18. package/dist/kit/components/autocomplete/types.d.ts +1 -1
  19. package/dist/kit/components/autocomplete/types.d.ts.map +1 -1
  20. package/dist/kit/layouts/admin/components/AdminLayout.d.ts.map +1 -1
  21. package/dist/kit/layouts/admin/hooks/menu.d.ts +1 -0
  22. package/dist/kit/layouts/admin/hooks/menu.d.ts.map +1 -1
  23. package/dist/kit/providers/ThemeProvider.d.ts.map +1 -1
  24. package/dist/kit/themes/base.css +1 -0
  25. package/dist/kit/themes/clean-slate.css +1 -0
  26. package/dist/kit/themes/default.css +1 -0
  27. package/dist/kit/themes/minimal-modern.css +1 -0
  28. package/dist/kit/themes/spotify.css +1 -0
  29. package/package.json +11 -10
  30. package/src/index.ts +88 -0
  31. package/src/kit/builder/data-table/components/DataTable.tsx +63 -23
  32. package/src/kit/builder/data-table/index.ts +6 -5
  33. package/src/kit/builder/form/components/FormBuilder.tsx +34 -10
  34. package/src/kit/builder/form/components/{FormActions.tsx → FormBuilderActions.tsx} +3 -3
  35. package/src/kit/builder/form/components/{FormField.tsx → FormBuilderField.tsx} +79 -8
  36. package/src/kit/builder/form/components/index.ts +2 -3
  37. package/src/kit/builder/section/SectionBuilder.tsx +67 -10
  38. package/src/kit/components/autocomplete/types.ts +1 -1
  39. package/src/kit/layouts/admin/components/AdminLayout.tsx +1 -2
  40. package/src/kit/layouts/admin/hooks/menu.ts +2 -2
  41. package/src/kit/providers/ThemeProvider.tsx +38 -38
  42. package/src/stories/kit/layouts/admin/AdminLayout.Basic.stories.tsx +2 -0
  43. package/src/stories/kit/layouts/admin/AdminLayout.Collapsible.stories.tsx +2 -0
  44. package/src/stories/kit/layouts/admin/AdminLayout.Complex.stories.tsx +2 -0
  45. package/src/stories/kit/layouts/admin/AdminLayout.CustomSidebarHeaderComponent.stories.tsx +2 -0
  46. package/src/stories/kit/layouts/admin/AdminLayout.CustomSidebarTitleAndIcon.stories.tsx +2 -0
  47. package/src/stories/kit/layouts/admin/AdminLayout.HeaderSlots.stories.tsx +2 -0
  48. package/storybook-static/assets/{Accordion.stories-N1auke5L.js → Accordion.stories-q6yg6wg1.js} +1 -1
  49. package/storybook-static/assets/{AdminLayout-Cxd0-A_L.js → AdminLayout-B9bV4J_6.js} +1 -1
  50. package/storybook-static/assets/{AdminLayout.Basic.stories-C_I6rWuq.js → AdminLayout.Basic.stories-C-ZxuH-O.js} +1 -1
  51. package/storybook-static/assets/AdminLayout.Collapsible.stories-xcQzkxio.js +4 -0
  52. package/storybook-static/assets/{AdminLayout.Complex.stories-BbY1Ue6d.js → AdminLayout.Complex.stories-DyjkVpvE.js} +1 -1
  53. package/storybook-static/assets/{AdminLayout.CustomSidebarHeaderComponent.stories-LFVi-aIv.js → AdminLayout.CustomSidebarHeaderComponent.stories-BqhzWCIA.js} +1 -1
  54. package/storybook-static/assets/AdminLayout.CustomSidebarTitleAndIcon.stories-aWxyR67T.js +4 -0
  55. package/storybook-static/assets/{AdminLayout.HeaderSlots.stories-BactzgkF.js → AdminLayout.HeaderSlots.stories-dNzhUdDt.js} +1 -1
  56. package/storybook-static/assets/{Alert.stories-_FtuixdR.js → Alert.stories-DXwNfJ3w.js} +1 -1
  57. package/storybook-static/assets/{AlertDialog.stories-6NY3BjwR.js → AlertDialog.stories-I324NsnP.js} +1 -1
  58. package/storybook-static/assets/{AspectRatio.stories-DAT11y02.js → AspectRatio.stories-CghHiX3Z.js} +1 -1
  59. package/storybook-static/assets/{Autocomplete-DngjqsCM.js → Autocomplete-B4gV705L.js} +1 -1
  60. package/storybook-static/assets/{Autocomplete.stories-BCaOrgTR.js → Autocomplete.stories-CyOvjTGN.js} +1 -1
  61. package/storybook-static/assets/{Avatar.stories-DlzxSLJ-.js → Avatar.stories-CEF5FVSR.js} +1 -1
  62. package/storybook-static/assets/{Badge.stories-DKHXsoV5.js → Badge.stories-_-G3GriP.js} +1 -1
  63. package/storybook-static/assets/{Breadcrumb.stories-D8eUHpf7.js → Breadcrumb.stories-DORe9T4b.js} +1 -1
  64. package/storybook-static/assets/{Button.stories-kvPdKxdw.js → Button.stories-3nQ6wsBX.js} +1 -1
  65. package/storybook-static/assets/{Calendar.stories-D-hUtQQI.js → Calendar.stories-Dn__djE1.js} +1 -1
  66. package/storybook-static/assets/{Card.stories-y8Z7NgrQ.js → Card.stories-BJcbdwCI.js} +1 -1
  67. package/storybook-static/assets/{Carousel.stories-CFcHYKgp.js → Carousel.stories-CfqbE7Va.js} +1 -1
  68. package/storybook-static/assets/{Chart.stories-BJwLNKfE.js → Chart.stories-cGgef3tv.js} +1 -1
  69. package/storybook-static/assets/{Checkbox.stories-B22Fbwx1.js → Checkbox.stories-BcaxWzCS.js} +1 -1
  70. package/storybook-static/assets/{Collapsible.stories-BgcRp8Rk.js → Collapsible.stories-CQ95s7Cs.js} +1 -1
  71. package/storybook-static/assets/{Combination-BT_gXe1L.js → Combination-CeVus13L.js} +1 -1
  72. package/storybook-static/assets/{Command.stories-Dp4CtSQR.js → Command.stories-DYflJh8u.js} +1 -1
  73. package/storybook-static/assets/{ContextMenu.stories-DnVnIi-T.js → ContextMenu.stories-CU7ehYrE.js} +1 -1
  74. package/storybook-static/assets/DataTable.Basic.stories-BQNWUKiw.js +6 -0
  75. package/storybook-static/assets/{DataTable.Filters.stories-CO0ipuGm.js → DataTable.Filters.stories-DPCoeYhK.js} +1 -1
  76. package/storybook-static/assets/{DataTable.Pagination.stories-DNwCw64e.js → DataTable.Pagination.stories-8UNqTNgw.js} +1 -1
  77. package/storybook-static/assets/{DataTable.SelectionAndActions.stories-DGgdEbsf.js → DataTable.SelectionAndActions.stories-CDEjgQ6T.js} +1 -1
  78. package/storybook-static/assets/DataTable.Sorting.stories-qG7-X_6r.js +6 -0
  79. package/storybook-static/assets/{Dialog.stories-DQkYN8ht.js → Dialog.stories-Bu6ZJXNH.js} +1 -1
  80. package/storybook-static/assets/{Dialog.stories-DXZINEgo.js → Dialog.stories-DobNZ0Hp.js} +1 -1
  81. package/storybook-static/assets/{Drawer.stories-DMH_vZgi.js → Drawer.stories-BN0idp4u.js} +1 -1
  82. package/storybook-static/assets/{DropdownMenu.stories-Dl8y-N7T.js → DropdownMenu.stories-sfsVDTvm.js} +1 -1
  83. package/storybook-static/assets/{Form.Basic.stories-CJugIYsx.js → Form.Basic.stories-dE4nbgpr.js} +1 -1
  84. package/storybook-static/assets/{Form.Complex.stories-BPogRp6F.js → Form.Complex.stories-BEZufnjb.js} +1 -1
  85. package/storybook-static/assets/{Form.Dynamic.stories-Boway5AK.js → Form.Dynamic.stories-cJTbd6cV.js} +1 -1
  86. package/storybook-static/assets/{Form.Simple.stories-_OXGXXpE.js → Form.Simple.stories-DOPzZKhh.js} +1 -1
  87. package/storybook-static/assets/{Form.stories-BoHyR8ho.js → Form.stories-27doU7JS.js} +1 -1
  88. package/storybook-static/assets/{FormBuilder-BGgeY8ik.js → FormBuilder-C0S7C69Q.js} +1 -1
  89. package/storybook-static/assets/{HoverCard.stories-1HM92M79.js → HoverCard.stories-0lted9Zx.js} +1 -1
  90. package/storybook-static/assets/{Input.stories-sQ4EUlWt.js → Input.stories-CwsIObFs.js} +1 -1
  91. package/storybook-static/assets/{InputOtp.stories-Cpk_EmLx.js → InputOtp.stories-DVc086h4.js} +1 -1
  92. package/storybook-static/assets/{Label.stories-MjABHKSw.js → Label.stories-bJa0rk1A.js} +1 -1
  93. package/storybook-static/assets/{Login.stories-BY4OYGk3.js → Login.stories-C6X6Kj5B.js} +1 -1
  94. package/storybook-static/assets/{Menubar.stories-B_60TWNE.js → Menubar.stories-CuediVp7.js} +1 -1
  95. package/storybook-static/assets/{NavigationMenu.stories-DyuaBvvq.js → NavigationMenu.stories-CKGZYhKk.js} +1 -1
  96. package/storybook-static/assets/{Page.stories-DQKMxrPZ.js → Page.stories-Cf76wtRx.js} +1 -1
  97. package/storybook-static/assets/{Pagination.stories-CBo7UrNd.js → Pagination.stories-D7IdL1_4.js} +1 -1
  98. package/storybook-static/assets/{Popover.stories-D98_JrxN.js → Popover.stories-1VP_zNY8.js} +1 -1
  99. package/storybook-static/assets/{Progress.stories-Dejt5v3z.js → Progress.stories-C35R5YvA.js} +1 -1
  100. package/storybook-static/assets/{RadioGroup.stories-Tz2LW6O6.js → RadioGroup.stories-CjuD3CwD.js} +1 -1
  101. package/storybook-static/assets/{Resizable.stories-DhP2GKN7.js → Resizable.stories-Cs8dvdc5.js} +1 -1
  102. package/storybook-static/assets/{ScrollArea.stories-CF7-8wbM.js → ScrollArea.stories-D6_z-5jm.js} +1 -1
  103. package/storybook-static/assets/{Section.stories-BpurjHIQ.js → Section.stories-Ce5qYITI.js} +1 -1
  104. package/storybook-static/assets/SectionBuilder-Df_lRZkj.js +1 -0
  105. package/storybook-static/assets/{Select.stories-DJrU-mi0.js → Select.stories-w_kbza5k.js} +1 -1
  106. package/storybook-static/assets/{Separator.stories-BYH_o8QM.js → Separator.stories-B5QnaJXb.js} +1 -1
  107. package/storybook-static/assets/{Sheet.stories-BNJ7BIb-.js → Sheet.stories-CORnEGvV.js} +1 -1
  108. package/storybook-static/assets/{Sidebar.stories-BbjcJuOg.js → Sidebar.stories-DVuWTi4j.js} +1 -1
  109. package/storybook-static/assets/{Slider.stories-CWOjKHKD.js → Slider.stories-YoS2vvT2.js} +1 -1
  110. package/storybook-static/assets/{Sonner.stories-CXSZs5yN.js → Sonner.stories-CXW5e_Qg.js} +1 -1
  111. package/storybook-static/assets/{Switch.stories-BUQjobWe.js → Switch.stories-zr6i-aNi.js} +1 -1
  112. package/storybook-static/assets/{Table.stories-DJcV7M9R.js → Table.stories-BuGU4MUM.js} +1 -1
  113. package/storybook-static/assets/{Tabs.stories-ByeVrP18.js → Tabs.stories-jxkJ-AUI.js} +1 -1
  114. package/storybook-static/assets/{Textarea.stories-CKsDPHYc.js → Textarea.stories-CHXVobz6.js} +1 -1
  115. package/storybook-static/assets/{Toggle.stories-DutEzZ8k.js → Toggle.stories-C4uB4Hkq.js} +1 -1
  116. package/storybook-static/assets/{ToggleGroup.stories-C9fzJTh-.js → ToggleGroup.stories-Cr229wf_.js} +1 -1
  117. package/storybook-static/assets/{Tooltip.stories-CngnJbP7.js → Tooltip.stories-DmMYGR3T.js} +1 -1
  118. package/storybook-static/assets/{accordion-bQe9Rep4.js → accordion-BCfsz_gl.js} +1 -1
  119. package/storybook-static/assets/{alert-dialog-CypF_yaW.js → alert-dialog-BYt6Z7Kt.js} +1 -1
  120. package/storybook-static/assets/{avatar-CukM9hXu.js → avatar-CRn1qQsC.js} +1 -1
  121. package/storybook-static/assets/{axe-W8QMjM0E.js → axe-JCJl60WC.js} +1 -1
  122. package/storybook-static/assets/{button-BTWmFXop.js → button-BObfgcV1.js} +1 -1
  123. package/storybook-static/assets/{chart-column-Bzh5arua.js → chart-column-CplFCmg8.js} +1 -1
  124. package/storybook-static/assets/{check-BgWXKGqi.js → check-DyecuwP4.js} +1 -1
  125. package/storybook-static/assets/{checkbox-QlugAqJY.js → checkbox-D5BmNJeL.js} +1 -1
  126. package/storybook-static/assets/{chevron-down-BqLjUn1_.js → chevron-down-Bp7zbUB0.js} +1 -1
  127. package/storybook-static/assets/{chevron-left-BR_0lKnE.js → chevron-left-D1L4J3UW.js} +1 -1
  128. package/storybook-static/assets/{chevron-right-DpCIoMaJ.js → chevron-right-oMYqDJ_f.js} +1 -1
  129. package/storybook-static/assets/{circle-DVJTkDI7.js → circle-CyarsADt.js} +1 -1
  130. package/storybook-static/assets/clean-slate-V4nUw2Bm.css +1 -0
  131. package/storybook-static/assets/{command-BERL33lL.js → command-DCnXmNmT.js} +1 -1
  132. package/storybook-static/assets/{createLucideIcon-1ZwIAs_l.js → createLucideIcon-CLBo0iA0.js} +1 -1
  133. package/storybook-static/assets/default-CuTBjDca.css +1 -0
  134. package/storybook-static/assets/{dialog-DM9YJ1JD.js → dialog-DL0QBIbC.js} +1 -1
  135. package/storybook-static/assets/{dropdown-menu-TfFll7G9.js → dropdown-menu-BwL9gQwG.js} +1 -1
  136. package/storybook-static/assets/{ellipsis-BSY8VuLI.js → ellipsis-DPg968Rc.js} +1 -1
  137. package/storybook-static/assets/{grip-vertical-Buja1rv9.js → grip-vertical-CM0GDwvq.js} +1 -1
  138. package/storybook-static/assets/{iframe-G-6sM9Mt.js → iframe-BWjPIle6.js} +4 -4
  139. package/storybook-static/assets/{index-DqWzLCH-.js → index-04C4iZwC.js} +1 -1
  140. package/storybook-static/assets/{index-B-fXBfyD.js → index-3zykFCgl.js} +1 -1
  141. package/storybook-static/assets/{index-CAwQR9Pv.js → index-7XoYQV2z.js} +1 -1
  142. package/storybook-static/assets/{index-DySHPxMy.js → index-A7UzX-Xw.js} +1 -1
  143. package/storybook-static/assets/index-BN5_W3Yi.js +1 -0
  144. package/storybook-static/assets/{index-1v1lhNFD.js → index-BcAKBHrX.js} +1 -1
  145. package/storybook-static/assets/{index-7yNAGow7.js → index-BfKpUbCE.js} +1 -1
  146. package/storybook-static/assets/index-C5eJ31Z3.js +1 -0
  147. package/storybook-static/assets/{index-CayhpKmv.js → index-C6O7WofA.js} +1 -1
  148. package/storybook-static/assets/{index-BDwnENHR.js → index-C9xvlw_B.js} +1 -1
  149. package/storybook-static/assets/{index-Bq6UNRVc.js → index-CKwUGXmt.js} +1 -1
  150. package/storybook-static/assets/{index-d_S6mtzU.js → index-Cce91yJQ.js} +1 -1
  151. package/storybook-static/assets/{index-CMmbDm5O.js → index-Cw7p-pms.js} +1 -1
  152. package/storybook-static/assets/{index-CLmN5G1a.js → index-DE2OlfDP.js} +1 -1
  153. package/storybook-static/assets/{index-ev1RjzGv.js → index-DMk2qc2_.js} +1 -1
  154. package/storybook-static/assets/index-DWC9SV-P.js +1 -0
  155. package/storybook-static/assets/{index-HghBIZeg.js → index-Dqw7miiX.js} +1 -1
  156. package/storybook-static/assets/{index-ClNNG_ys.js → index-Dr2xmx-F.js} +1 -1
  157. package/storybook-static/assets/{index-lH-AZpAn.js → index-DschQYGl.js} +1 -1
  158. package/storybook-static/assets/{index-SxI7_jxe.js → index-Dsg7S8zu.js} +1 -1
  159. package/storybook-static/assets/{index-DvM9azdj.js → index-Pk2lGsul.js} +1 -1
  160. package/storybook-static/assets/{index-DNAxNqEO.js → index-URSssr5a.js} +1 -1
  161. package/storybook-static/assets/{index-CZaD3imo.js → index-npvyVsxD.js} +1 -1
  162. package/storybook-static/assets/{index-CzJf-yyP.js → index-u70nzfOV.js} +1 -1
  163. package/storybook-static/assets/{label-C5vJTTwH.js → label-CwntpYJ0.js} +1 -1
  164. package/storybook-static/assets/{lodash-Q9aGJGMb.js → lodash-BkmSIg_J.js} +1 -1
  165. package/storybook-static/assets/minimal-modern-d2yFlFJM.css +1 -0
  166. package/storybook-static/assets/{popover-DW1K4QCO.js → popover-ClqrrvjL.js} +1 -1
  167. package/storybook-static/assets/{radio-group-iPL-8jvw.js → radio-group-CvN0LQZp.js} +1 -1
  168. package/storybook-static/assets/{react-18-CK1-M7n3.js → react-18-Bj31y5Nr.js} +1 -1
  169. package/storybook-static/assets/{react-icons.esm-n2MUhK0n.js → react-icons.esm-DNr9VcvP.js} +1 -1
  170. package/storybook-static/assets/{refresh-cw-FYEbhX1i.js → refresh-cw-OZakDsFY.js} +1 -1
  171. package/storybook-static/assets/{schemas-S_Tg7JYp.js → schemas-CaLvKjsI.js} +1 -1
  172. package/storybook-static/assets/{section-factories-CC6eFfbk.js → section-factories-DKfKL-5s.js} +1 -1
  173. package/storybook-static/assets/{select-DbLzULCJ.js → select-gtXRB92c.js} +1 -1
  174. package/storybook-static/assets/{separator-DoUX1TNx.js → separator-CxCWfpZX.js} +1 -1
  175. package/storybook-static/assets/{settings-2-CpOcGlDm.js → settings-2-DSSkfF6W.js} +1 -1
  176. package/storybook-static/assets/{sheet-n5VQ25jh.js → sheet-r0VNiBiN.js} +1 -1
  177. package/storybook-static/assets/{shopping-cart-9kOJ1UDd.js → shopping-cart-CJBClF2m.js} +1 -1
  178. package/storybook-static/assets/{sidebar-CvUiZOJe.js → sidebar-BsMnOE7Y.js} +1 -1
  179. package/storybook-static/assets/spotify-BuPUgQEa.css +1 -0
  180. package/storybook-static/assets/{toggle-B-YKWMF8.js → toggle-D08-8sQA.js} +1 -1
  181. package/storybook-static/assets/{tooltip-CNONbPiI.js → tooltip-CZ1UAE_e.js} +1 -1
  182. package/storybook-static/assets/{trash-2-Bt5LMclM.js → trash-2-D55eseMQ.js} +1 -1
  183. package/storybook-static/assets/{x-DG9mLFAg.js → x-n8sFtlI2.js} +1 -1
  184. package/storybook-static/iframe.html +1 -1
  185. package/storybook-static/index.d.ts +63 -0
  186. package/storybook-static/index.d.ts.map +1 -1
  187. package/storybook-static/kit/builder/form/components/{FormActions.d.ts → FormBuilderActions.d.ts} +3 -3
  188. package/storybook-static/kit/builder/form/components/FormBuilderActions.d.ts.map +1 -0
  189. package/{dist/kit/builder/form/components/FormField.d.ts → storybook-static/kit/builder/form/components/FormBuilderField.d.ts} +4 -4
  190. package/storybook-static/kit/builder/form/components/FormBuilderField.d.ts.map +1 -0
  191. package/storybook-static/kit/builder/form/components/index.d.ts +2 -3
  192. package/storybook-static/kit/builder/form/components/index.d.ts.map +1 -1
  193. package/storybook-static/kit/builder/section/SectionBuilder.d.ts.map +1 -1
  194. package/storybook-static/project.json +1 -1
  195. package/vite.config.ts +76 -52
  196. package/dist/kit/builder/form/components/FormActions.d.ts.map +0 -1
  197. package/dist/kit/builder/form/components/FormField.d.ts.map +0 -1
  198. package/dist/kit/builder/form/components/FormSection.d.ts +0 -15
  199. package/dist/kit/builder/form/components/FormSection.d.ts.map +0 -1
  200. package/src/kit/builder/form/components/FormSection.tsx +0 -88
  201. package/storybook-static/assets/AdminLayout.Collapsible.stories-CsU3DwTo.js +0 -4
  202. package/storybook-static/assets/AdminLayout.CustomSidebarTitleAndIcon.stories-BqP6UVc7.js +0 -4
  203. package/storybook-static/assets/DataTable.Basic.stories-DBF5VYq9.js +0 -6
  204. package/storybook-static/assets/DataTable.Sorting.stories-CWpqloAB.js +0 -6
  205. package/storybook-static/assets/SectionBuilder-Bav4WrnT.js +0 -1
  206. package/storybook-static/assets/clean-slate-BR-XvZPt.css +0 -1
  207. package/storybook-static/assets/default-M24vcGB8.css +0 -1
  208. package/storybook-static/assets/index-DhoByIgc.js +0 -1
  209. package/storybook-static/assets/index-I343IfOC.js +0 -1
  210. package/storybook-static/assets/index-_crRFOM5.js +0 -1
  211. package/storybook-static/assets/minimal-modern-BmvR5wyr.css +0 -1
  212. package/storybook-static/assets/spotify-DpbeJq1r.css +0 -1
  213. package/storybook-static/kit/builder/form/components/FormActions.d.ts.map +0 -1
  214. package/storybook-static/kit/builder/form/components/FormField.d.ts.map +0 -1
  215. package/storybook-static/kit/builder/form/components/FormSection.d.ts +0 -15
  216. package/storybook-static/kit/builder/form/components/FormSection.d.ts.map +0 -1
  217. /package/src/{index.css → kit/themes/base.css} +0 -0
@@ -1,4 +1,4 @@
1
- import{j as r}from"./jsx-runtime-D_zvdyIk.js";import{F as u}from"./FormBuilder-BGgeY8ik.js";import{c as l,a as e}from"./section-factories-CC6eFfbk.js";import{c as i,a as t}from"./dependencies-ctrV69dx.js";import"./iframe-G-6sM9Mt.js";import"./preload-helper-Dp1pzeXC.js";import"./schemas-S_Tg7JYp.js";import"./utils-D-KgF5mV.js";import"./button-BTWmFXop.js";import"./index-1v1lhNFD.js";import"./index-CGrAONsN.js";import"./input-11YRd9gD.js";import"./textarea-Dw2vruMl.js";import"./select-DbLzULCJ.js";import"./index-_crRFOM5.js";import"./index-CZaD3imo.js";import"./index-BdQq_4o_.js";import"./index-DW48STyt.js";import"./index-BDwnENHR.js";import"./index-DvM9azdj.js";import"./index-ClNNG_ys.js";import"./index-7yNAGow7.js";import"./index-DqWzLCH-.js";import"./index-lH-AZpAn.js";import"./Combination-BT_gXe1L.js";import"./index-DhoByIgc.js";import"./index-I343IfOC.js";import"./index-CayhpKmv.js";import"./index-ev1RjzGv.js";import"./index-d_S6mtzU.js";import"./index-CAwQR9Pv.js";import"./index-HghBIZeg.js";import"./index-DNAxNqEO.js";import"./chevron-down-BqLjUn1_.js";import"./createLucideIcon-1ZwIAs_l.js";import"./check-BgWXKGqi.js";import"./checkbox-QlugAqJY.js";import"./index-Bq6UNRVc.js";import"./radio-group-iPL-8jvw.js";import"./index-CMmbDm5O.js";import"./circle-DVJTkDI7.js";import"./label-C5vJTTwH.js";import"./card-BJpPOzP8.js";import"./Autocomplete-DngjqsCM.js";import"./popover-DW1K4QCO.js";import"./command-BERL33lL.js";import"./index-CzJf-yyP.js";import"./dialog-DM9YJ1JD.js";import"./x-DG9mLFAg.js";import"./trash-2-Bt5LMclM.js";import"./grip-vertical-Buja1rv9.js";import"./SectionBuilder-Bav4WrnT.js";import"./separator-DoUX1TNx.js";const me={title:"Kit/Builder/Form",component:u,parameters:{controls:{expanded:!0},backgrounds:{disable:!0}}},n={name:"Dynamic example",render:()=>{const p=a=>{console.log("Dynamic form submitted:",a)},h=(a,o)=>{console.log(`Field ${a} changed to:`,o),a==="productType"&&o==="subscription"&&console.log("Subscription product selected - additional fields will appear"),a==="hasDiscount"&&o===!0&&console.log("Discount enabled - discount fields will appear")},m=[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",a=>a!=="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 r.jsxs("div",{className:"max-w-6xl mx-auto p-6",children:[r.jsxs("div",{className:"mb-8",children:[r.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Dynamic Product Configuration"}),r.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."}),r.jsxs("div",{className:"mt-4 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[r.jsx("h3",{className:"font-semibold text-blue-900",children:"Try these interactions:"}),r.jsxs("ul",{className:"mt-2 text-sm text-blue-800 space-y-1",children:[r.jsx("li",{children:"• Change Product Type to see different field sets"}),r.jsx("li",{children:'• Enable "Apply Discount" to reveal discount configuration'}),r.jsx("li",{children:'• Toggle "Requires Physical Shipping" for shipping options'}),r.jsx("li",{children:'• Select "Digital Download" to auto-disable shipping'}),r.jsx("li",{children:'• Choose "Password Protected" visibility for password field'})]})]})]}),r.jsx(u,{sections:m,onSubmit:p,onFieldChange:h,submitLabel:"Save Product Configuration",resetLabel:"Reset All",className:"space-y-8"})]})}};var s,d,c;n.parameters={...n.parameters,docs:{...(s=n.parameters)==null?void 0:s.docs,source:{originalSource:`{
1
+ import{j as r}from"./jsx-runtime-D_zvdyIk.js";import{F as u}from"./FormBuilder-C0S7C69Q.js";import{c as l,a as e}from"./section-factories-DKfKL-5s.js";import{c as i,a as t}from"./dependencies-ctrV69dx.js";import"./iframe-BWjPIle6.js";import"./preload-helper-Dp1pzeXC.js";import"./schemas-CaLvKjsI.js";import"./utils-D-KgF5mV.js";import"./button-BObfgcV1.js";import"./index-BcAKBHrX.js";import"./index-CGrAONsN.js";import"./input-11YRd9gD.js";import"./textarea-Dw2vruMl.js";import"./select-gtXRB92c.js";import"./index-C5eJ31Z3.js";import"./index-npvyVsxD.js";import"./index-BdQq_4o_.js";import"./index-DW48STyt.js";import"./index-C9xvlw_B.js";import"./index-Pk2lGsul.js";import"./index-Dr2xmx-F.js";import"./index-BfKpUbCE.js";import"./index-04C4iZwC.js";import"./index-DschQYGl.js";import"./Combination-CeVus13L.js";import"./index-BN5_W3Yi.js";import"./index-DWC9SV-P.js";import"./index-C6O7WofA.js";import"./index-DMk2qc2_.js";import"./index-Cce91yJQ.js";import"./index-7XoYQV2z.js";import"./index-Dqw7miiX.js";import"./index-URSssr5a.js";import"./chevron-down-Bp7zbUB0.js";import"./createLucideIcon-CLBo0iA0.js";import"./check-DyecuwP4.js";import"./checkbox-D5BmNJeL.js";import"./index-CKwUGXmt.js";import"./radio-group-CvN0LQZp.js";import"./index-Cw7p-pms.js";import"./circle-CyarsADt.js";import"./label-CwntpYJ0.js";import"./card-BJpPOzP8.js";import"./Autocomplete-B4gV705L.js";import"./popover-ClqrrvjL.js";import"./command-DCnXmNmT.js";import"./index-u70nzfOV.js";import"./dialog-DL0QBIbC.js";import"./x-n8sFtlI2.js";import"./trash-2-D55eseMQ.js";import"./grip-vertical-CM0GDwvq.js";import"./SectionBuilder-Df_lRZkj.js";import"./separator-CxCWfpZX.js";const me={title:"Kit/Builder/Form",component:u,parameters:{controls:{expanded:!0},backgrounds:{disable:!0}}},n={name:"Dynamic example",render:()=>{const p=a=>{console.log("Dynamic form submitted:",a)},h=(a,o)=>{console.log(`Field ${a} changed to:`,o),a==="productType"&&o==="subscription"&&console.log("Subscription product selected - additional fields will appear"),a==="hasDiscount"&&o===!0&&console.log("Discount enabled - discount fields will appear")},m=[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",a=>a!=="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 r.jsxs("div",{className:"max-w-6xl mx-auto p-6",children:[r.jsxs("div",{className:"mb-8",children:[r.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Dynamic Product Configuration"}),r.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."}),r.jsxs("div",{className:"mt-4 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[r.jsx("h3",{className:"font-semibold text-blue-900",children:"Try these interactions:"}),r.jsxs("ul",{className:"mt-2 text-sm text-blue-800 space-y-1",children:[r.jsx("li",{children:"• Change Product Type to see different field sets"}),r.jsx("li",{children:'• Enable "Apply Discount" to reveal discount configuration'}),r.jsx("li",{children:'• Toggle "Requires Physical Shipping" for shipping options'}),r.jsx("li",{children:'• Select "Digital Download" to auto-disable shipping'}),r.jsx("li",{children:'• Choose "Password Protected" visibility for password field'})]})]})]}),r.jsx(u,{sections:m,onSubmit:p,onFieldChange:h,submitLabel:"Save Product Configuration",resetLabel:"Reset All",className:"space-y-8"})]})}};var s,d,c;n.parameters={...n.parameters,docs:{...(s=n.parameters)==null?void 0:s.docs,source:{originalSource:`{
2
2
  name: 'Dynamic example',
3
3
  render: () => {
4
4
  const handleSubmit = (data: unknown) => {
@@ -1,4 +1,4 @@
1
- import{j as r}from"./jsx-runtime-D_zvdyIk.js";import{F as i}from"./FormBuilder-BGgeY8ik.js";import{c as n,a as e,b as c}from"./section-factories-CC6eFfbk.js";import"./iframe-G-6sM9Mt.js";import"./preload-helper-Dp1pzeXC.js";import"./schemas-S_Tg7JYp.js";import"./utils-D-KgF5mV.js";import"./button-BTWmFXop.js";import"./index-1v1lhNFD.js";import"./index-CGrAONsN.js";import"./input-11YRd9gD.js";import"./textarea-Dw2vruMl.js";import"./select-DbLzULCJ.js";import"./index-_crRFOM5.js";import"./index-CZaD3imo.js";import"./index-BdQq_4o_.js";import"./index-DW48STyt.js";import"./index-BDwnENHR.js";import"./index-DvM9azdj.js";import"./index-ClNNG_ys.js";import"./index-7yNAGow7.js";import"./index-DqWzLCH-.js";import"./index-lH-AZpAn.js";import"./Combination-BT_gXe1L.js";import"./index-DhoByIgc.js";import"./index-I343IfOC.js";import"./index-CayhpKmv.js";import"./index-ev1RjzGv.js";import"./index-d_S6mtzU.js";import"./index-CAwQR9Pv.js";import"./index-HghBIZeg.js";import"./index-DNAxNqEO.js";import"./chevron-down-BqLjUn1_.js";import"./createLucideIcon-1ZwIAs_l.js";import"./check-BgWXKGqi.js";import"./checkbox-QlugAqJY.js";import"./index-Bq6UNRVc.js";import"./radio-group-iPL-8jvw.js";import"./index-CMmbDm5O.js";import"./circle-DVJTkDI7.js";import"./label-C5vJTTwH.js";import"./card-BJpPOzP8.js";import"./Autocomplete-DngjqsCM.js";import"./popover-DW1K4QCO.js";import"./command-BERL33lL.js";import"./index-CzJf-yyP.js";import"./dialog-DM9YJ1JD.js";import"./x-DG9mLFAg.js";import"./trash-2-Bt5LMclM.js";import"./grip-vertical-Buja1rv9.js";import"./SectionBuilder-Bav4WrnT.js";import"./separator-DoUX1TNx.js";const ne={title:"Kit/Builder/Form",component:i,parameters:{controls:{expanded:!0},backgrounds:{disable:!0}}},t={name:"Simple example",render:()=>{const s=p=>{console.log("Form submitted:",p)},m=[n.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:c.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})])];return r.jsxs("div",{className:"max-w-2xl mx-auto p-6",children:[r.jsxs("div",{className:"mb-6",children:[r.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Contact Us"}),r.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."})]}),r.jsx(i,{sections:m,onSubmit:s,className:"space-y-6"})]})}};var a,o,l;t.parameters={...t.parameters,docs:{...(a=t.parameters)==null?void 0:a.docs,source:{originalSource:`{
1
+ import{j as r}from"./jsx-runtime-D_zvdyIk.js";import{F as i}from"./FormBuilder-C0S7C69Q.js";import{c as n,a as e,b as c}from"./section-factories-DKfKL-5s.js";import"./iframe-BWjPIle6.js";import"./preload-helper-Dp1pzeXC.js";import"./schemas-CaLvKjsI.js";import"./utils-D-KgF5mV.js";import"./button-BObfgcV1.js";import"./index-BcAKBHrX.js";import"./index-CGrAONsN.js";import"./input-11YRd9gD.js";import"./textarea-Dw2vruMl.js";import"./select-gtXRB92c.js";import"./index-C5eJ31Z3.js";import"./index-npvyVsxD.js";import"./index-BdQq_4o_.js";import"./index-DW48STyt.js";import"./index-C9xvlw_B.js";import"./index-Pk2lGsul.js";import"./index-Dr2xmx-F.js";import"./index-BfKpUbCE.js";import"./index-04C4iZwC.js";import"./index-DschQYGl.js";import"./Combination-CeVus13L.js";import"./index-BN5_W3Yi.js";import"./index-DWC9SV-P.js";import"./index-C6O7WofA.js";import"./index-DMk2qc2_.js";import"./index-Cce91yJQ.js";import"./index-7XoYQV2z.js";import"./index-Dqw7miiX.js";import"./index-URSssr5a.js";import"./chevron-down-Bp7zbUB0.js";import"./createLucideIcon-CLBo0iA0.js";import"./check-DyecuwP4.js";import"./checkbox-D5BmNJeL.js";import"./index-CKwUGXmt.js";import"./radio-group-CvN0LQZp.js";import"./index-Cw7p-pms.js";import"./circle-CyarsADt.js";import"./label-CwntpYJ0.js";import"./card-BJpPOzP8.js";import"./Autocomplete-B4gV705L.js";import"./popover-ClqrrvjL.js";import"./command-DCnXmNmT.js";import"./index-u70nzfOV.js";import"./dialog-DL0QBIbC.js";import"./x-n8sFtlI2.js";import"./trash-2-D55eseMQ.js";import"./grip-vertical-CM0GDwvq.js";import"./SectionBuilder-Df_lRZkj.js";import"./separator-CxCWfpZX.js";const ne={title:"Kit/Builder/Form",component:i,parameters:{controls:{expanded:!0},backgrounds:{disable:!0}}},t={name:"Simple example",render:()=>{const s=p=>{console.log("Form submitted:",p)},m=[n.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:c.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})])];return r.jsxs("div",{className:"max-w-2xl mx-auto p-6",children:[r.jsxs("div",{className:"mb-6",children:[r.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Contact Us"}),r.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."})]}),r.jsx(i,{sections:m,onSubmit:s,className:"space-y-6"})]})}};var a,o,l;t.parameters={...t.parameters,docs:{...(a=t.parameters)==null?void 0:a.docs,source:{originalSource:`{
2
2
  name: 'Simple example',
3
3
  render: () => {
4
4
  const handleSubmit = (data: unknown) => {
@@ -1,3 +1,3 @@
1
- import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{r as m}from"./iframe-G-6sM9Mt.js";import{S as _}from"./index-1v1lhNFD.js";import{F as v,C,k as w,m as D,o as $,s as h,d as P,e as E}from"./schemas-S_Tg7JYp.js";import{c as d}from"./utils-D-KgF5mV.js";import{L as M}from"./label-C5vJTTwH.js";import{I as F}from"./input-11YRd9gD.js";import{B as V}from"./button-BTWmFXop.js";import{t as L}from"./index-DySHPxMy.js";import"./preload-helper-Dp1pzeXC.js";import"./index-DqWzLCH-.js";import"./index-_crRFOM5.js";import"./index-CZaD3imo.js";import"./index-CGrAONsN.js";const y=v,b=m.createContext({}),l=({...o})=>e.jsx(b.Provider,{value:{name:o.name},children:e.jsx(C,{...o})}),c=()=>{const o=m.useContext(b),r=m.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:n}=r;return{id:n,name:o.name,formItemId:`${n}-form-item`,formDescriptionId:`${n}-form-item-description`,formMessageId:`${n}-form-item-message`,...a}},S=m.createContext({});function u({className:o,...r}){const t=m.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 p({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}u.__docgenInfo={description:"",methods:[],displayName:"FormItem"};p.__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(u,{children:[e.jsx(p,{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(u,{children:[e.jsx(p,{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:`{
1
+ import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{r as m}from"./iframe-BWjPIle6.js";import{S as _}from"./index-BcAKBHrX.js";import{F as v,C,k as w,m as D,o as $,s as h,d as P,e as E}from"./schemas-CaLvKjsI.js";import{c as d}from"./utils-D-KgF5mV.js";import{L as M}from"./label-CwntpYJ0.js";import{I as F}from"./input-11YRd9gD.js";import{B as V}from"./button-BObfgcV1.js";import{t as L}from"./index-A7UzX-Xw.js";import"./preload-helper-Dp1pzeXC.js";import"./index-04C4iZwC.js";import"./index-C5eJ31Z3.js";import"./index-npvyVsxD.js";import"./index-CGrAONsN.js";const y=v,b=m.createContext({}),l=({...o})=>e.jsx(b.Provider,{value:{name:o.name},children:e.jsx(C,{...o})}),c=()=>{const o=m.useContext(b),r=m.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:n}=r;return{id:n,name:o.name,formItemId:`${n}-form-item`,formDescriptionId:`${n}-form-item-description`,formMessageId:`${n}-form-item-message`,...a}},S=m.createContext({});function u({className:o,...r}){const t=m.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 p({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}u.__docgenInfo={description:"",methods:[],displayName:"FormItem"};p.__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(u,{children:[e.jsx(p,{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(u,{children:[e.jsx(p,{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
2
  render: () => <ValidatedFormDemo />
3
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};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./jsx-runtime-D_zvdyIk.js";import{r as C}from"./iframe-G-6sM9Mt.js";import{u as ne,c as le,o as F,d as ie,e as ce,Z as K,s as V,f as Q,g as W,h as M,n as A,i as O,j as X,a as Y,b as oe,l as me}from"./schemas-S_Tg7JYp.js";import{c as k}from"./utils-D-KgF5mV.js";import{B as $}from"./button-BTWmFXop.js";import{I as q}from"./input-11YRd9gD.js";import{T as de}from"./textarea-Dw2vruMl.js";import{S as ue,a as pe,b as he,c as ve,d as ge}from"./select-DbLzULCJ.js";import{C as be}from"./checkbox-QlugAqJY.js";import{R as xe,a as ye}from"./radio-group-iPL-8jvw.js";import{L as z}from"./label-C5vJTTwH.js";import{C as U,a as Z,b as ee,c as D}from"./card-BJpPOzP8.js";import{A as fe}from"./Autocomplete-DngjqsCM.js";import{P as je,T as Ne}from"./trash-2-Bt5LMclM.js";import{G as Ce}from"./grip-vertical-Buja1rv9.js";import{S as we}from"./SectionBuilder-Bav4WrnT.js";function P({field:e,control:x,onChange:b,onFieldChange:I,parentPath:L}){const d=L?`${L}.${e.name}`:e.name,f="__NULL__",{field:u,fieldState:{error:j}}=ne({name:d,control:x,disabled:e.disabled}),h=C.useCallback(m=>{u.onChange(m),b==null||b(m)},[u.onChange,b]),w=()=>{var N,T;const m={id:d,disabled:e.disabled,placeholder:e.placeholder,className:k(j&&"border-destructive focus-visible:ring-destructive",e.className)};switch(e.type){case"autocomplete":{const c=(e.options??[]).filter(o=>o.value!==null&&o.value!==void 0).map(o=>({label:o.label,value:o.value}));return a.jsx(fe,{mode:e.autocompleteMode??"client",options:c,fetcher:e.fetcher,pageSize:e.pageSize,value:u.value??null,onChange:o=>h(o),placeholder:e.placeholder,searchPlaceholder:e.searchPlaceholder,renderOption:e.renderOption,disabled:e.disabled,className:m.className})}case"text":case"email":case"password":return a.jsx(q,{...m,type:e.type,value:u.value||"",onChange:c=>h(c.target.value)});case"number":return a.jsx(q,{...m,type:"number",value:u.value||"",onChange:c=>h(Number(c.target.value))});case"textarea":return a.jsx(de,{...m,value:u.value||"",onChange:c=>h(c.target.value),rows:4});case"select":{const c=t=>t==null?f:String(t),o=t=>{var v;const g=(v=e.options)==null?void 0:v.find(y=>c(y.value)===t);return g?g.value:null};return a.jsxs(ue,{value:c(u.value),onValueChange:t=>h(o(t)),disabled:e.disabled,children:[a.jsx(pe,{className:m.className,children:a.jsx(he,{placeholder:e.placeholder})}),a.jsx(ve,{children:(N=e.options)==null?void 0:N.map(t=>a.jsx(ge,{value:c(t.value),children:t.label},c(t.value)))})]})}case"checkbox":return a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(be,{id:d,checked:u.value||!1,onCheckedChange:h,disabled:e.disabled,className:k(j&&"border-destructive",e.className)}),a.jsx(z,{htmlFor:d,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:e.label})]});case"radio":{const c=t=>t==null?f:String(t),o=t=>{var v;const g=(v=e.options)==null?void 0:v.find(y=>c(y.value)===t);return g?g.value:null};return a.jsx(xe,{value:c(u.value),onValueChange:t=>h(o(t)),disabled:e.disabled,className:e.className,children:(T=e.options)==null?void 0:T.map(t=>a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ye,{value:c(t.value),id:`${d}-${c(t.value)}`}),a.jsx(z,{htmlFor:`${d}-${c(t.value)}`,children:t.label})]},c(t.value)))})}case"date":return a.jsx(q,{...m,type:"date",value:u.value?new Date(u.value).toISOString().split("T")[0]:"",onChange:c=>h(c.target.value?new Date(c.target.value):null)});case"file":return a.jsx(q,{...m,type:"file",onChange:c=>{var o;return h(((o=c.target.files)==null?void 0:o[0])||null)}});default:return a.jsx(q,{...m,value:u.value||"",onChange:c=>h(c.target.value)})}},B=()=>e.fields?a.jsxs(U,{className:e.className,children:[a.jsxs(Z,{className:"pb-3",children:[a.jsx(ee,{className:"text-base",children:e.label}),e.description&&a.jsx("p",{className:"text-sm text-muted-foreground",children:e.description})]}),a.jsx(D,{className:"space-y-4",children:a.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e.fields.map(m=>a.jsx(P,{field:m,control:x,parentPath:d,onChange:b,onFieldChange:I},m.name))})})]}):null,_=()=>{const{fields:m,append:N,remove:T}=le({control:x,name:d}),c=()=>{if(e.fields&&e.fields.length===1){const o=e.fields[0].defaultValue||"";N(o)}else if(e.fields){const o={};e.fields.forEach(t=>{o[t.name]=t.defaultValue||""}),N(o)}else N("")};return a.jsxs(U,{className:e.className,children:[a.jsx(Z,{className:"pb-3",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(ee,{className:"text-base",children:e.label}),e.description&&a.jsx("p",{className:"text-sm text-muted-foreground",children:e.description})]}),a.jsxs($,{type:"button",variant:"outline",size:"sm",onClick:c,disabled:e.disabled,children:[a.jsx(je,{className:"h-4 w-4 mr-1"}),"Add Item"]})]})}),a.jsx(D,{className:"space-y-4",children:m.length===0?a.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:'No items added yet. Click "Add Item" to get started.'}):m.map((o,t)=>{var g;return a.jsxs(U,{className:"relative",children:[a.jsx(Z,{className:"pb-3",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ce,{className:"h-4 w-4 text-muted-foreground"}),a.jsxs("span",{className:"text-sm font-medium",children:["Item",t+1]})]}),a.jsx($,{type:"button",variant:"ghost",size:"sm",onClick:()=>T(t),disabled:e.disabled,children:a.jsx(Ne,{className:"h-4 w-4"})})]})}),a.jsx(D,{children:e.fields&&e.fields.length===1?a.jsx(P,{field:{...e.fields[0],name:e.fields[0].name,label:e.fields[0].label||"Value"},control:x,parentPath:`${d}.${t}`,onChange:b}):e.fields?a.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e.fields.map(v=>a.jsx(P,{field:v,control:x,parentPath:`${d}.${t}`,onChange:b,onFieldChange:I},v.name))}):a.jsx(q,{value:((g=u.value)==null?void 0:g[t])||"",onChange:v=>{const y=[...u.value||[]];y[t]=v.target.value,h(y)},placeholder:`Item ${t+1}`,disabled:e.disabled})})]},o.id)})})]})};return e.type==="object"?B():e.type==="array"?_():e.type==="checkbox"?a.jsxs("div",{className:k("space-y-2",e.gridCols&&`md:col-span-${e.gridCols}`),children:[w(),e.description&&a.jsx("p",{className:"text-sm text-muted-foreground",children:e.description}),j&&a.jsx("p",{className:"text-sm text-destructive",children:j.message})]}):a.jsxs("div",{className:k("space-y-2",e.gridCols&&`md:col-span-${e.gridCols}`),children:[a.jsxs(z,{htmlFor:d,className:"text-sm font-medium",children:[e.label,e.required&&a.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),w(),e.description&&a.jsx("p",{className:"text-sm text-muted-foreground",children:e.description}),j&&a.jsx("p",{className:"text-sm text-destructive",children:j.message})]})}P.__docgenInfo={description:"",methods:[],displayName:"FormField",props:{field:{required:!0,tsType:{name:"FormBuilderFieldConfig"},description:""},control:{required:!0,tsType:{name:"Control",elements:[{name:"any"}],raw:"Control<any>"},description:""},onChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(value: any) => void",signature:{arguments:[{type:{name:"any"},name:"value"}],return:{name:"void"}}},description:""},onFieldChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(name: string, value: any, allValues: Record<string, any>) => void",signature:{arguments:[{type:{name:"string"},name:"name"},{type:{name:"any"},name:"value"},{type:{name:"Record",elements:[{name:"string"},{name:"any"}],raw:"Record<string, any>"},name:"allValues"}],return:{name:"void"}}},description:""},parentPath:{required:!1,tsType:{name:"string"},description:""}}};function Ve({sections:e,schema:x,defaultValues:b={},onSubmit:I,onCancel:L,onReset:d,onFieldChange:f,submitLabel:u="Submit",cancelLabel:j="Cancel",resetLabel:h="Reset",isSubmitting:w=!1,className:B,formClassName:_,actionsClassName:m,showActions:N=!0,customActions:T}){const c=C.useMemo(()=>{if(x)return x;const l=i=>{if(i.validation&&i.validation instanceof K)return i.validation;if(i.validation&&typeof i.validation=="object"&&!(i.validation instanceof K)){const n=i.validation;let r;switch(i.type){case"email":r=V().email("Invalid email address");break;case"number":r=A();break;case"autocomplete":r=M([V(),A()]).nullable();break;case"checkbox":r=W();break;case"date":r=Q();break;default:r=V()}return n.pattern&&r instanceof O&&(r=r.regex(n.pattern.value,n.pattern.message)),n.min&&r instanceof X&&(r=r.min(n.min.value,n.min.message)),n.max&&r instanceof X&&(r=r.max(n.max.value,n.max.message)),n.minLength&&r instanceof O&&(r=r.min(n.minLength.value,n.minLength.message)),n.maxLength&&r instanceof O&&(r=r.max(n.maxLength.value,n.maxLength.message)),i.required?r:r.optional()}let s;switch(i.type){case"email":s=V().email("Invalid email address");break;case"number":s=A();break;case"autocomplete":s=M([V(),A(),F()]).nullable();break;case"checkbox":s=W();break;case"date":s=Q();break;case"select":case"radio":if(i.options&&i.options.length>0){const n=i.options.map(r=>me(r.value));n.length===1?s=n[0]:s=M(n)}else s=V();break;case"object":if(i.fields){const n={};i.fields.forEach(r=>{n[r.name]=l(r)}),s=F(n)}else s=F({});break;case"array":if(i.fields&&i.fields.length>0){const n=i.fields.length===1?l(i.fields[0]):F(i.fields.reduce((r,R)=>(r[R.name]=l(R),r),{}));s=Y(n)}else s=Y(oe());break;default:s=V()}return i.required?s:s.optional()},p={};return e.forEach(i=>{i.fields.forEach(s=>{p[s.name]=l(s)})}),F(p)},[e,x]),o=C.useMemo(()=>{const l={...b},p=i=>{i.forEach(s=>{if(l[s.name]===void 0&&s.defaultValue!==void 0&&(l[s.name]=s.defaultValue),s.type==="object"&&s.fields){l[s.name]||(l[s.name]={});const n={};s.fields.forEach(r=>{r.defaultValue!==void 0&&(n[r.name]=r.defaultValue)}),l[s.name]={...n,...l[s.name]}}s.type==="array"&&s.fields&&(l[s.name]||(l[s.name]=s.defaultValue||[]))})};return e.forEach(i=>p(i.fields)),l},[e,b]),t=ie({resolver:ce(c),defaultValues:o}),{control:g,handleSubmit:v,reset:y,setValue:E,getValues:S,watch:ae}=t,G=ae(),H=C.useCallback(l=>{if(!l.dependencies)return{};const p={};return l.dependencies.forEach(i=>{const s=G[i.field],n=i.condition(s);switch(i.action){case"show":n||(p.hidden=!0);break;case"hide":n&&(p.hidden=!0);break;case"enable":n||(p.disabled=!0);break;case"disable":n&&(p.disabled=!0);break;case"setValue":n&&i.value!==void 0&&S(l.name)!==i.value&&E(l.name,i.value);break}}),p},[G,E,S]),J=C.useCallback((l,p)=>{l.onChange&&l.onChange(p,E,S)},[E,S]),se=C.useCallback(async l=>{try{await I(l)}catch(p){console.error("Form submission error:",p)}},[I]),te=C.useCallback(()=>{y(o),d==null||d()},[y,o,d]),re=C.useMemo(()=>e.map((l,p)=>({id:l.id??`section-${p}`,title:l.title,subtitle:l.description,variant:l.variant??"card",className:l.className,layout:l.layout??"grid",grid:l.grid??{cols:1,mdCols:2,gap:"gap-4"},flex:l.flex,hidden:l.hidden,children:l.fields.map(s=>{const n=H(s);if(s.hidden||n.hidden)return null;const r=Math.max(1,Math.min(12,s.gridCols??1));return{key:s.name,span:{base:1,md:r},hidden:s.hidden,content:a.jsx(P,{field:{...s,disabled:s.disabled||n.disabled},control:g,onChange:R=>{J(s,R),f==null||f(s.name,R,S())},onFieldChange:f},s.name)}}).filter(Boolean)})),[e,g,H,J,f,S]);return a.jsx("div",{className:k("space-y-6",B),children:a.jsxs("form",{onSubmit:v(se),className:k("space-y-6",_),children:[a.jsx(we,{sections:re}),N&&a.jsxs("div",{className:k("flex flex-col sm:flex-row gap-3 pt-6 border-t",m),children:[a.jsx($,{type:"submit",disabled:w,className:"sm:order-last",children:w?"Submitting...":u}),L&&a.jsx($,{type:"button",variant:"outline",onClick:L,disabled:w,children:j}),d&&a.jsx($,{type:"button",variant:"ghost",onClick:te,disabled:w,children:h}),T]})]})})}Ve.__docgenInfo={description:"",methods:[],displayName:"FormBuilder",props:{sections:{required:!0,tsType:{name:"Array",elements:[{name:"FormBuilderSectionConfig"}],raw:"FormBuilderSectionConfig[]"},description:""},schema:{required:!1,tsType:{name:"z.ZodType",elements:[{name:"any"}],raw:"z.ZodType<any>"},description:""},defaultValues:{required:!1,tsType:{name:"union",raw:"Record<string, any> | null",elements:[{name:"Record",elements:[{name:"string"},{name:"any"}],raw:"Record<string, any>"},{name:"null"}]},description:"",defaultValue:{value:"{}",computed:!1}},onSubmit:{required:!0,tsType:{name:"signature",type:"function",raw:"(data: any) => void | Promise<void>",signature:{arguments:[{type:{name:"any"},name:"data"}],return:{name:"union",raw:"void | Promise<void>",elements:[{name:"void"},{name:"Promise",elements:[{name:"void"}],raw:"Promise<void>"}]}}},description:""},onCancel:{required:!1,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},onReset:{required:!1,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},onFieldChange:{required:!1,tsType:{name:"signature",type:"function",raw:`(
1
+ import{j as a}from"./jsx-runtime-D_zvdyIk.js";import{r as C}from"./iframe-BWjPIle6.js";import{u as ne,c as le,o as F,d as ie,e as ce,Z as K,s as V,f as Q,g as W,h as M,n as E,i as O,j as X,a as Y,b as oe,l as me}from"./schemas-CaLvKjsI.js";import{c as k}from"./utils-D-KgF5mV.js";import{B as $}from"./button-BObfgcV1.js";import{I as q}from"./input-11YRd9gD.js";import{T as de}from"./textarea-Dw2vruMl.js";import{S as ue,a as pe,b as he,c as ve,d as ge}from"./select-gtXRB92c.js";import{C as be}from"./checkbox-D5BmNJeL.js";import{R as xe,a as ye}from"./radio-group-CvN0LQZp.js";import{L as z}from"./label-CwntpYJ0.js";import{C as U,a as Z,b as ee,c as D}from"./card-BJpPOzP8.js";import{A as fe}from"./Autocomplete-B4gV705L.js";import{P as je,T as Ne}from"./trash-2-D55eseMQ.js";import{G as Ce}from"./grip-vertical-CM0GDwvq.js";import{S as we}from"./SectionBuilder-Df_lRZkj.js";function P({field:e,control:x,onChange:b,onFieldChange:I,parentPath:L}){const d=L?`${L}.${e.name}`:e.name,f="__NULL__",{field:u,fieldState:{error:j}}=ne({name:d,control:x,disabled:e.disabled}),h=C.useCallback(m=>{u.onChange(m),b==null||b(m)},[u.onChange,b]),w=()=>{var N,T;const m={id:d,disabled:e.disabled,placeholder:e.placeholder,className:k(j&&"border-destructive focus-visible:ring-destructive",e.className)};switch(e.type){case"autocomplete":{const c=(e.options??[]).filter(o=>o.value!==null&&o.value!==void 0).map(o=>({label:o.label,value:o.value}));return a.jsx(fe,{mode:e.autocompleteMode??"client",options:c,fetcher:e.fetcher,pageSize:e.pageSize,value:u.value??null,onChange:o=>h(o),placeholder:e.placeholder,searchPlaceholder:e.searchPlaceholder,renderOption:e.renderOption,disabled:e.disabled,className:m.className})}case"text":case"email":case"password":return a.jsx(q,{...m,type:e.type,value:u.value||"",onChange:c=>h(c.target.value)});case"number":return a.jsx(q,{...m,type:"number",value:u.value||"",onChange:c=>h(Number(c.target.value))});case"textarea":return a.jsx(de,{...m,value:u.value||"",onChange:c=>h(c.target.value),rows:4});case"select":{const c=t=>t==null?f:String(t),o=t=>{var v;const g=(v=e.options)==null?void 0:v.find(y=>c(y.value)===t);return g?g.value:null};return a.jsxs(ue,{value:c(u.value),onValueChange:t=>h(o(t)),disabled:e.disabled,children:[a.jsx(pe,{className:m.className,children:a.jsx(he,{placeholder:e.placeholder})}),a.jsx(ve,{children:(N=e.options)==null?void 0:N.map(t=>a.jsx(ge,{value:c(t.value),children:t.label},c(t.value)))})]})}case"checkbox":return a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(be,{id:d,checked:u.value||!1,onCheckedChange:h,disabled:e.disabled,className:k(j&&"border-destructive",e.className)}),a.jsx(z,{htmlFor:d,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:e.label})]});case"radio":{const c=t=>t==null?f:String(t),o=t=>{var v;const g=(v=e.options)==null?void 0:v.find(y=>c(y.value)===t);return g?g.value:null};return a.jsx(xe,{value:c(u.value),onValueChange:t=>h(o(t)),disabled:e.disabled,className:e.className,children:(T=e.options)==null?void 0:T.map(t=>a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ye,{value:c(t.value),id:`${d}-${c(t.value)}`}),a.jsx(z,{htmlFor:`${d}-${c(t.value)}`,children:t.label})]},c(t.value)))})}case"date":return a.jsx(q,{...m,type:"date",value:u.value?new Date(u.value).toISOString().split("T")[0]:"",onChange:c=>h(c.target.value?new Date(c.target.value):null)});case"file":return a.jsx(q,{...m,type:"file",onChange:c=>{var o;return h(((o=c.target.files)==null?void 0:o[0])||null)}});default:return a.jsx(q,{...m,value:u.value||"",onChange:c=>h(c.target.value)})}},A=()=>e.fields?a.jsxs(U,{className:e.className,children:[a.jsxs(Z,{className:"pb-3",children:[a.jsx(ee,{className:"text-base",children:e.label}),e.description&&a.jsx("p",{className:"text-sm text-muted-foreground",children:e.description})]}),a.jsx(D,{className:"space-y-4",children:a.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e.fields.map(m=>a.jsx(P,{field:m,control:x,parentPath:d,onChange:b,onFieldChange:I},m.name))})})]}):null,_=()=>{const{fields:m,append:N,remove:T}=le({control:x,name:d}),c=()=>{if(e.fields&&e.fields.length===1){const o=e.fields[0].defaultValue||"";N(o)}else if(e.fields){const o={};e.fields.forEach(t=>{o[t.name]=t.defaultValue||""}),N(o)}else N("")};return a.jsxs(U,{className:e.className,children:[a.jsx(Z,{className:"pb-3",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(ee,{className:"text-base",children:e.label}),e.description&&a.jsx("p",{className:"text-sm text-muted-foreground",children:e.description})]}),a.jsxs($,{type:"button",variant:"outline",size:"sm",onClick:c,disabled:e.disabled,children:[a.jsx(je,{className:"h-4 w-4 mr-1"}),"Add Item"]})]})}),a.jsx(D,{className:"space-y-4",children:m.length===0?a.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:'No items added yet. Click "Add Item" to get started.'}):m.map((o,t)=>{var g;return a.jsxs(U,{className:"relative",children:[a.jsx(Z,{className:"pb-3",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ce,{className:"h-4 w-4 text-muted-foreground"}),a.jsxs("span",{className:"text-sm font-medium",children:["Item",t+1]})]}),a.jsx($,{type:"button",variant:"ghost",size:"sm",onClick:()=>T(t),disabled:e.disabled,children:a.jsx(Ne,{className:"h-4 w-4"})})]})}),a.jsx(D,{children:e.fields&&e.fields.length===1?a.jsx(P,{field:{...e.fields[0],name:e.fields[0].name,label:e.fields[0].label||"Value"},control:x,parentPath:`${d}.${t}`,onChange:b}):e.fields?a.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e.fields.map(v=>a.jsx(P,{field:v,control:x,parentPath:`${d}.${t}`,onChange:b,onFieldChange:I},v.name))}):a.jsx(q,{value:((g=u.value)==null?void 0:g[t])||"",onChange:v=>{const y=[...u.value||[]];y[t]=v.target.value,h(y)},placeholder:`Item ${t+1}`,disabled:e.disabled})})]},o.id)})})]})};return e.type==="object"?A():e.type==="array"?_():e.type==="checkbox"?a.jsxs("div",{className:k("space-y-2",e.gridCols&&`md:col-span-${e.gridCols}`),children:[w(),e.description&&a.jsx("p",{className:"text-sm text-muted-foreground",children:e.description}),j&&a.jsx("p",{className:"text-sm text-destructive",children:j.message})]}):a.jsxs("div",{className:k("space-y-2",e.gridCols&&`md:col-span-${e.gridCols}`),children:[a.jsxs(z,{htmlFor:d,className:"text-sm font-medium",children:[e.label,e.required&&a.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),w(),e.description&&a.jsx("p",{className:"text-sm text-muted-foreground",children:e.description}),j&&a.jsx("p",{className:"text-sm text-destructive",children:j.message})]})}P.__docgenInfo={description:"",methods:[],displayName:"FormBuilderField",props:{field:{required:!0,tsType:{name:"FormBuilderFieldConfig"},description:""},control:{required:!0,tsType:{name:"Control",elements:[{name:"any"}],raw:"Control<any>"},description:""},onChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(value: any) => void",signature:{arguments:[{type:{name:"any"},name:"value"}],return:{name:"void"}}},description:""},onFieldChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(name: string, value: any, allValues: Record<string, any>) => void",signature:{arguments:[{type:{name:"string"},name:"name"},{type:{name:"any"},name:"value"},{type:{name:"Record",elements:[{name:"string"},{name:"any"}],raw:"Record<string, any>"},name:"allValues"}],return:{name:"void"}}},description:""},parentPath:{required:!1,tsType:{name:"string"},description:""}}};function Ve({sections:e,schema:x,defaultValues:b={},onSubmit:I,onCancel:L,onReset:d,onFieldChange:f,submitLabel:u="Submit",cancelLabel:j="Cancel",resetLabel:h="Reset",isSubmitting:w=!1,className:A,formClassName:_,actionsClassName:m,showActions:N=!0,customActions:T}){const c=C.useMemo(()=>{if(x)return x;const l=i=>{if(i.validation&&i.validation instanceof K)return i.validation;if(i.validation&&typeof i.validation=="object"&&!(i.validation instanceof K)){const n=i.validation;let r;switch(i.type){case"email":r=V().email("Invalid email address");break;case"number":r=E();break;case"autocomplete":r=M([V(),E()]).nullable();break;case"checkbox":r=W();break;case"date":r=Q();break;default:r=V()}return n.pattern&&r instanceof O&&(r=r.regex(n.pattern.value,n.pattern.message)),n.min&&r instanceof X&&(r=r.min(n.min.value,n.min.message)),n.max&&r instanceof X&&(r=r.max(n.max.value,n.max.message)),n.minLength&&r instanceof O&&(r=r.min(n.minLength.value,n.minLength.message)),n.maxLength&&r instanceof O&&(r=r.max(n.maxLength.value,n.maxLength.message)),i.required?r:r.optional()}let s;switch(i.type){case"email":s=V().email("Invalid email address");break;case"number":s=E();break;case"autocomplete":s=M([V(),E(),F()]).nullable();break;case"checkbox":s=W();break;case"date":s=Q();break;case"select":case"radio":if(i.options&&i.options.length>0){const n=i.options.map(r=>me(r.value));n.length===1?s=n[0]:s=M(n)}else s=V();break;case"object":if(i.fields){const n={};i.fields.forEach(r=>{n[r.name]=l(r)}),s=F(n)}else s=F({});break;case"array":if(i.fields&&i.fields.length>0){const n=i.fields.length===1?l(i.fields[0]):F(i.fields.reduce((r,R)=>(r[R.name]=l(R),r),{}));s=Y(n)}else s=Y(oe());break;default:s=V()}return i.required?s:s.optional()},p={};return e.forEach(i=>{i.fields.forEach(s=>{p[s.name]=l(s)})}),F(p)},[e,x]),o=C.useMemo(()=>{const l={...b},p=i=>{i.forEach(s=>{if(l[s.name]===void 0&&s.defaultValue!==void 0&&(l[s.name]=s.defaultValue),s.type==="object"&&s.fields){l[s.name]||(l[s.name]={});const n={};s.fields.forEach(r=>{r.defaultValue!==void 0&&(n[r.name]=r.defaultValue)}),l[s.name]={...n,...l[s.name]}}s.type==="array"&&s.fields&&(l[s.name]||(l[s.name]=s.defaultValue||[]))})};return e.forEach(i=>p(i.fields)),l},[e,b]),t=ie({resolver:ce(c),defaultValues:o}),{control:g,handleSubmit:v,reset:y,setValue:B,getValues:S,watch:ae}=t,G=ae(),H=C.useCallback(l=>{if(!l.dependencies)return{};const p={};return l.dependencies.forEach(i=>{const s=G[i.field],n=i.condition(s);switch(i.action){case"show":n||(p.hidden=!0);break;case"hide":n&&(p.hidden=!0);break;case"enable":n||(p.disabled=!0);break;case"disable":n&&(p.disabled=!0);break;case"setValue":n&&i.value!==void 0&&S(l.name)!==i.value&&B(l.name,i.value);break}}),p},[G,B,S]),J=C.useCallback((l,p)=>{l.onChange&&l.onChange(p,B,S)},[B,S]),se=C.useCallback(async l=>{try{await I(l)}catch(p){console.error("Form submission error:",p)}},[I]),te=C.useCallback(()=>{y(o),d==null||d()},[y,o,d]),re=C.useMemo(()=>e.map((l,p)=>({id:l.id??`section-${p}`,title:l.title,subtitle:l.description,variant:l.variant??"card",className:l.className,layout:l.layout??"grid",grid:l.grid??{cols:1,mdCols:2,gap:"gap-4"},flex:l.flex,hidden:l.hidden,children:l.fields.map(s=>{const n=H(s);if(s.hidden||n.hidden)return null;const r=Math.max(1,Math.min(12,s.gridCols??1));return{key:s.name,span:{base:1,md:r},hidden:s.hidden,content:a.jsx(P,{field:{...s,disabled:s.disabled||n.disabled},control:g,onChange:R=>{J(s,R),f==null||f(s.name,R,S())},onFieldChange:f},s.name)}}).filter(Boolean)})),[e,g,H,J,f,S]);return a.jsx("div",{className:k("space-y-6",A),children:a.jsxs("form",{onSubmit:v(se),className:k("space-y-6",_),children:[a.jsx(we,{sections:re}),N&&a.jsxs("div",{className:k("flex flex-col sm:flex-row gap-3 pt-6 border-t",m),children:[a.jsx($,{type:"submit",disabled:w,className:"sm:order-last",children:w?"Submitting...":u}),L&&a.jsx($,{type:"button",variant:"outline",onClick:L,disabled:w,children:j}),d&&a.jsx($,{type:"button",variant:"ghost",onClick:te,disabled:w,children:h}),T]})]})})}Ve.__docgenInfo={description:"",methods:[],displayName:"FormBuilder",props:{sections:{required:!0,tsType:{name:"Array",elements:[{name:"FormBuilderSectionConfig"}],raw:"FormBuilderSectionConfig[]"},description:""},schema:{required:!1,tsType:{name:"z.ZodType",elements:[{name:"any"}],raw:"z.ZodType<any>"},description:""},defaultValues:{required:!1,tsType:{name:"union",raw:"Record<string, any> | null",elements:[{name:"Record",elements:[{name:"string"},{name:"any"}],raw:"Record<string, any>"},{name:"null"}]},description:"",defaultValue:{value:"{}",computed:!1}},onSubmit:{required:!0,tsType:{name:"signature",type:"function",raw:"(data: any) => void | Promise<void>",signature:{arguments:[{type:{name:"any"},name:"data"}],return:{name:"union",raw:"void | Promise<void>",elements:[{name:"void"},{name:"Promise",elements:[{name:"void"}],raw:"Promise<void>"}]}}},description:""},onCancel:{required:!1,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},onReset:{required:!1,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},onFieldChange:{required:!1,tsType:{name:"signature",type:"function",raw:`(
2
2
  name: string,
3
3
  value: any,
4
4
  allValues: Record<string, any>
@@ -1,4 +1,4 @@
1
- import{j as r}from"./jsx-runtime-D_zvdyIk.js";import{r as a}from"./iframe-G-6sM9Mt.js";import{c as l}from"./index-DW48STyt.js";import{c as W}from"./index-DvM9azdj.js";import{u as z}from"./index-CAwQR9Pv.js";import{u as V}from"./index-1v1lhNFD.js";import{c as O,R as q,A as G,C as K,a as J}from"./index-CayhpKmv.js";import{P as Q}from"./index-d_S6mtzU.js";import{P as A}from"./index-Bq6UNRVc.js";import{P as X}from"./index-DqWzLCH-.js";import{D as Y}from"./index-7yNAGow7.js";import{c as Z}from"./utils-D-KgF5mV.js";import{A as ee,a as re,b as te}from"./avatar-CukM9hXu.js";import{B as oe}from"./button-BTWmFXop.js";import"./preload-helper-Dp1pzeXC.js";import"./index-I343IfOC.js";import"./index-_crRFOM5.js";import"./index-CZaD3imo.js";import"./index-lH-AZpAn.js";import"./index-ev1RjzGv.js";import"./index-SxI7_jxe.js";import"./index-CGrAONsN.js";var w,S="HoverCard",[D,Fe]=W(S,[O]),N=O(),[ne,R]=D(S),k=e=>{const{__scopeHoverCard:o,children:n,open:s,defaultOpen:i,onOpenChange:c,openDelay:m=700,closeDelay:f=300}=e,d=N(o),v=a.useRef(0),u=a.useRef(0),h=a.useRef(!1),p=a.useRef(!1),[C,t]=z({prop:s,defaultProp:i??!1,onChange:c,caller:S}),x=a.useCallback(()=>{clearTimeout(u.current),v.current=window.setTimeout(()=>t(!0),m)},[m,t]),g=a.useCallback(()=>{clearTimeout(v.current),!h.current&&!p.current&&(u.current=window.setTimeout(()=>t(!1),f))},[f,t]),$=a.useCallback(()=>t(!1),[t]);return a.useEffect(()=>()=>{clearTimeout(v.current),clearTimeout(u.current)},[]),r.jsx(ne,{scope:o,open:C,onOpenChange:t,onOpen:x,onClose:g,onDismiss:$,hasSelectionRef:h,isPointerDownOnContentRef:p,children:r.jsx(q,{...d,children:n})})};k.displayName=S;var I="HoverCardTrigger",F=a.forwardRef((e,o)=>{const{__scopeHoverCard:n,...s}=e,i=R(I,n),c=N(n);return r.jsx(G,{asChild:!0,...c,children:r.jsx(X.a,{"data-state":i.open?"open":"closed",...s,ref:o,onPointerEnter:l(e.onPointerEnter,H(i.onOpen)),onPointerLeave:l(e.onPointerLeave,H(i.onClose)),onFocus:l(e.onFocus,i.onOpen),onBlur:l(e.onBlur,i.onClose),onTouchStart:l(e.onTouchStart,m=>m.preventDefault())})})});F.displayName=I;var E="HoverCardPortal",[ae,se]=D(E,{forceMount:void 0}),B=e=>{const{__scopeHoverCard:o,forceMount:n,children:s,container:i}=e,c=R(E,o);return r.jsx(ae,{scope:o,forceMount:n,children:r.jsx(A,{present:n||c.open,children:r.jsx(Q,{asChild:!0,container:i,children:s})})})};B.displayName=E;var P="HoverCardContent",L=a.forwardRef((e,o)=>{const n=se(P,e.__scopeHoverCard),{forceMount:s=n.forceMount,...i}=e,c=R(P,e.__scopeHoverCard);return r.jsx(A,{present:s||c.open,children:r.jsx(ie,{"data-state":c.open?"open":"closed",...i,onPointerEnter:l(e.onPointerEnter,H(c.onOpen)),onPointerLeave:l(e.onPointerLeave,H(c.onClose)),ref:o})})});L.displayName=P;var ie=a.forwardRef((e,o)=>{const{__scopeHoverCard:n,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:c,onInteractOutside:m,...f}=e,d=R(P,n),v=N(n),u=a.useRef(null),h=V(o,u),[p,C]=a.useState(!1);return a.useEffect(()=>{if(p){const t=document.body;return w=t.style.userSelect||t.style.webkitUserSelect,t.style.userSelect="none",t.style.webkitUserSelect="none",()=>{t.style.userSelect=w,t.style.webkitUserSelect=w}}},[p]),a.useEffect(()=>{if(u.current){const t=()=>{C(!1),d.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var g;((g=document.getSelection())==null?void 0:g.toString())!==""&&(d.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",t),()=>{document.removeEventListener("pointerup",t),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!1}}},[d.isPointerDownOnContentRef,d.hasSelectionRef]),a.useEffect(()=>{u.current&&le(u.current).forEach(x=>x.setAttribute("tabindex","-1"))}),r.jsx(Y,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:m,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:l(c,t=>{t.preventDefault()}),onDismiss:d.onDismiss,children:r.jsx(K,{...v,...f,onPointerDown:l(f.onPointerDown,t=>{t.currentTarget.contains(t.target)&&C(!0),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!0}),ref:h,style:{...f.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),ce="HoverCardArrow",de=a.forwardRef((e,o)=>{const{__scopeHoverCard:n,...s}=e,i=N(n);return r.jsx(J,{...i,...s,ref:o})});de.displayName=ce;function H(e){return o=>o.pointerType==="touch"?void 0:e()}function le(e){const o=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)o.push(n.currentNode);return o}var ue=k,pe=F,me=B,fe=L;function T({...e}){return r.jsx(ue,{"data-slot":"hover-card",...e})}function M({...e}){return r.jsx(pe,{"data-slot":"hover-card-trigger",...e})}function U({className:e,align:o="center",sideOffset:n=4,...s}){return r.jsx(me,{"data-slot":"hover-card-portal",children:r.jsx(fe,{"data-slot":"hover-card-content",align:o,sideOffset:n,className:Z("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...s})})}T.__docgenInfo={description:"",methods:[],displayName:"HoverCard"};M.__docgenInfo={description:"",methods:[],displayName:"HoverCardTrigger"};U.__docgenInfo={description:"",methods:[],displayName:"HoverCardContent",props:{align:{defaultValue:{value:'"center"',computed:!1},required:!1},sideOffset:{defaultValue:{value:"4",computed:!1},required:!1}}};const Be={title:"Shadcn/UI/HoverCard",component:T},b={render:()=>r.jsxs(T,{children:[r.jsx(M,{asChild:!0,children:r.jsx(oe,{variant:"link",className:"px-0",children:"@shadcn"})}),r.jsx(U,{className:"w-80",children:r.jsxs("div",{className:"flex space-x-4",children:[r.jsxs(ee,{children:[r.jsx(re,{src:"https://github.com/shadcn.png",alt:"@shadcn"}),r.jsx(te,{children:"SC"})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx("h4",{className:"text-sm font-semibold",children:"shadcn"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Creator of shadcn/ui. Building beautiful, accessible components."})]})]})})]})};var _,j,y;b.parameters={...b.parameters,docs:{...(_=b.parameters)==null?void 0:_.docs,source:{originalSource:`{
1
+ import{j as r}from"./jsx-runtime-D_zvdyIk.js";import{r as a}from"./iframe-BWjPIle6.js";import{c as l}from"./index-DW48STyt.js";import{c as W}from"./index-Pk2lGsul.js";import{u as z}from"./index-7XoYQV2z.js";import{u as V}from"./index-BcAKBHrX.js";import{c as O,R as q,A as G,C as K,a as J}from"./index-C6O7WofA.js";import{P as Q}from"./index-Cce91yJQ.js";import{P as A}from"./index-CKwUGXmt.js";import{P as X}from"./index-04C4iZwC.js";import{D as Y}from"./index-BfKpUbCE.js";import{c as Z}from"./utils-D-KgF5mV.js";import{A as ee,a as re,b as te}from"./avatar-CRn1qQsC.js";import{B as oe}from"./button-BObfgcV1.js";import"./preload-helper-Dp1pzeXC.js";import"./index-DWC9SV-P.js";import"./index-C5eJ31Z3.js";import"./index-npvyVsxD.js";import"./index-DschQYGl.js";import"./index-DMk2qc2_.js";import"./index-Dsg7S8zu.js";import"./index-CGrAONsN.js";var w,S="HoverCard",[D,Fe]=W(S,[O]),N=O(),[ne,R]=D(S),k=e=>{const{__scopeHoverCard:o,children:n,open:s,defaultOpen:i,onOpenChange:c,openDelay:m=700,closeDelay:f=300}=e,d=N(o),v=a.useRef(0),u=a.useRef(0),h=a.useRef(!1),p=a.useRef(!1),[C,t]=z({prop:s,defaultProp:i??!1,onChange:c,caller:S}),x=a.useCallback(()=>{clearTimeout(u.current),v.current=window.setTimeout(()=>t(!0),m)},[m,t]),g=a.useCallback(()=>{clearTimeout(v.current),!h.current&&!p.current&&(u.current=window.setTimeout(()=>t(!1),f))},[f,t]),$=a.useCallback(()=>t(!1),[t]);return a.useEffect(()=>()=>{clearTimeout(v.current),clearTimeout(u.current)},[]),r.jsx(ne,{scope:o,open:C,onOpenChange:t,onOpen:x,onClose:g,onDismiss:$,hasSelectionRef:h,isPointerDownOnContentRef:p,children:r.jsx(q,{...d,children:n})})};k.displayName=S;var I="HoverCardTrigger",F=a.forwardRef((e,o)=>{const{__scopeHoverCard:n,...s}=e,i=R(I,n),c=N(n);return r.jsx(G,{asChild:!0,...c,children:r.jsx(X.a,{"data-state":i.open?"open":"closed",...s,ref:o,onPointerEnter:l(e.onPointerEnter,H(i.onOpen)),onPointerLeave:l(e.onPointerLeave,H(i.onClose)),onFocus:l(e.onFocus,i.onOpen),onBlur:l(e.onBlur,i.onClose),onTouchStart:l(e.onTouchStart,m=>m.preventDefault())})})});F.displayName=I;var E="HoverCardPortal",[ae,se]=D(E,{forceMount:void 0}),B=e=>{const{__scopeHoverCard:o,forceMount:n,children:s,container:i}=e,c=R(E,o);return r.jsx(ae,{scope:o,forceMount:n,children:r.jsx(A,{present:n||c.open,children:r.jsx(Q,{asChild:!0,container:i,children:s})})})};B.displayName=E;var P="HoverCardContent",L=a.forwardRef((e,o)=>{const n=se(P,e.__scopeHoverCard),{forceMount:s=n.forceMount,...i}=e,c=R(P,e.__scopeHoverCard);return r.jsx(A,{present:s||c.open,children:r.jsx(ie,{"data-state":c.open?"open":"closed",...i,onPointerEnter:l(e.onPointerEnter,H(c.onOpen)),onPointerLeave:l(e.onPointerLeave,H(c.onClose)),ref:o})})});L.displayName=P;var ie=a.forwardRef((e,o)=>{const{__scopeHoverCard:n,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:c,onInteractOutside:m,...f}=e,d=R(P,n),v=N(n),u=a.useRef(null),h=V(o,u),[p,C]=a.useState(!1);return a.useEffect(()=>{if(p){const t=document.body;return w=t.style.userSelect||t.style.webkitUserSelect,t.style.userSelect="none",t.style.webkitUserSelect="none",()=>{t.style.userSelect=w,t.style.webkitUserSelect=w}}},[p]),a.useEffect(()=>{if(u.current){const t=()=>{C(!1),d.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var g;((g=document.getSelection())==null?void 0:g.toString())!==""&&(d.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",t),()=>{document.removeEventListener("pointerup",t),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!1}}},[d.isPointerDownOnContentRef,d.hasSelectionRef]),a.useEffect(()=>{u.current&&le(u.current).forEach(x=>x.setAttribute("tabindex","-1"))}),r.jsx(Y,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:m,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:l(c,t=>{t.preventDefault()}),onDismiss:d.onDismiss,children:r.jsx(K,{...v,...f,onPointerDown:l(f.onPointerDown,t=>{t.currentTarget.contains(t.target)&&C(!0),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!0}),ref:h,style:{...f.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),ce="HoverCardArrow",de=a.forwardRef((e,o)=>{const{__scopeHoverCard:n,...s}=e,i=N(n);return r.jsx(J,{...i,...s,ref:o})});de.displayName=ce;function H(e){return o=>o.pointerType==="touch"?void 0:e()}function le(e){const o=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)o.push(n.currentNode);return o}var ue=k,pe=F,me=B,fe=L;function T({...e}){return r.jsx(ue,{"data-slot":"hover-card",...e})}function M({...e}){return r.jsx(pe,{"data-slot":"hover-card-trigger",...e})}function U({className:e,align:o="center",sideOffset:n=4,...s}){return r.jsx(me,{"data-slot":"hover-card-portal",children:r.jsx(fe,{"data-slot":"hover-card-content",align:o,sideOffset:n,className:Z("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...s})})}T.__docgenInfo={description:"",methods:[],displayName:"HoverCard"};M.__docgenInfo={description:"",methods:[],displayName:"HoverCardTrigger"};U.__docgenInfo={description:"",methods:[],displayName:"HoverCardContent",props:{align:{defaultValue:{value:'"center"',computed:!1},required:!1},sideOffset:{defaultValue:{value:"4",computed:!1},required:!1}}};const Be={title:"Shadcn/UI/HoverCard",component:T},b={render:()=>r.jsxs(T,{children:[r.jsx(M,{asChild:!0,children:r.jsx(oe,{variant:"link",className:"px-0",children:"@shadcn"})}),r.jsx(U,{className:"w-80",children:r.jsxs("div",{className:"flex space-x-4",children:[r.jsxs(ee,{children:[r.jsx(re,{src:"https://github.com/shadcn.png",alt:"@shadcn"}),r.jsx(te,{children:"SC"})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx("h4",{className:"text-sm font-semibold",children:"shadcn"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Creator of shadcn/ui. Building beautiful, accessible components."})]})]})})]})};var _,j,y;b.parameters={...b.parameters,docs:{...(_=b.parameters)==null?void 0:_.docs,source:{originalSource:`{
2
2
  render: () => <HoverCard>
3
3
  <HoverCardTrigger asChild>
4
4
  <Button variant="link" className="px-0">@shadcn</Button>
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{I as t}from"./input-11YRd9gD.js";import{L as x}from"./label-C5vJTTwH.js";import"./utils-D-KgF5mV.js";import"./iframe-G-6sM9Mt.js";import"./preload-helper-Dp1pzeXC.js";import"./index-DqWzLCH-.js";import"./index-_crRFOM5.js";import"./index-CZaD3imo.js";import"./index-1v1lhNFD.js";const L={title:"Shadcn/UI/Input",component:t},a={render:()=>e.jsxs("div",{className:"grid w-full max-w-sm items-center gap-2",children:[e.jsx(x,{htmlFor:"email",children:"Email"}),e.jsx(t,{id:"email",type:"email",placeholder:"m@example.com"})]})},r={render:()=>e.jsxs("div",{className:"grid w-full max-w-sm items-center gap-2",children:[e.jsx(x,{htmlFor:"disabled",children:"Disabled"}),e.jsx(t,{id:"disabled",placeholder:"Can't type here",disabled:!0})]})},s={render:()=>e.jsxs("div",{className:"relative w-[280px]",children:[e.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3 text-muted-foreground",children:"@"}),e.jsx(t,{className:"pl-8",placeholder:"username"})]})};var l,i,m;a.parameters={...a.parameters,docs:{...(l=a.parameters)==null?void 0:l.docs,source:{originalSource:`{
1
+ import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{I as t}from"./input-11YRd9gD.js";import{L as x}from"./label-CwntpYJ0.js";import"./utils-D-KgF5mV.js";import"./iframe-BWjPIle6.js";import"./preload-helper-Dp1pzeXC.js";import"./index-04C4iZwC.js";import"./index-C5eJ31Z3.js";import"./index-npvyVsxD.js";import"./index-BcAKBHrX.js";const L={title:"Shadcn/UI/Input",component:t},a={render:()=>e.jsxs("div",{className:"grid w-full max-w-sm items-center gap-2",children:[e.jsx(x,{htmlFor:"email",children:"Email"}),e.jsx(t,{id:"email",type:"email",placeholder:"m@example.com"})]})},r={render:()=>e.jsxs("div",{className:"grid w-full max-w-sm items-center gap-2",children:[e.jsx(x,{htmlFor:"disabled",children:"Disabled"}),e.jsx(t,{id:"disabled",placeholder:"Can't type here",disabled:!0})]})},s={render:()=>e.jsxs("div",{className:"relative w-[280px]",children:[e.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3 text-muted-foreground",children:"@"}),e.jsx(t,{className:"pl-8",placeholder:"username"})]})};var l,i,m;a.parameters={...a.parameters,docs:{...(l=a.parameters)==null?void 0:l.docs,source:{originalSource:`{
2
2
  render: () => <div className="grid w-full max-w-sm items-center gap-2">
3
3
  <Label htmlFor="email">Email</Label>
4
4
  <Input id="email" type="email" placeholder="m@example.com" />
@@ -1,4 +1,4 @@
1
- import{j as d}from"./jsx-runtime-D_zvdyIk.js";import{r as t}from"./iframe-G-6sM9Mt.js";import{c as Q}from"./utils-D-KgF5mV.js";import{c as Ae}from"./createLucideIcon-1ZwIAs_l.js";import"./preload-helper-Dp1pzeXC.js";/**
1
+ import{j as d}from"./jsx-runtime-D_zvdyIk.js";import{r as t}from"./iframe-BWjPIle6.js";import{c as Q}from"./utils-D-KgF5mV.js";import{c as Ae}from"./createLucideIcon-CLBo0iA0.js";import"./preload-helper-Dp1pzeXC.js";/**
2
2
  * @license lucide-react v0.540.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{j as a}from"./jsx-runtime-D_zvdyIk.js";import{L as i}from"./label-C5vJTTwH.js";import{I as d}from"./input-11YRd9gD.js";import"./iframe-G-6sM9Mt.js";import"./preload-helper-Dp1pzeXC.js";import"./index-DqWzLCH-.js";import"./index-_crRFOM5.js";import"./index-CZaD3imo.js";import"./index-1v1lhNFD.js";import"./utils-D-KgF5mV.js";const h={title:"Shadcn/UI/Label",component:i},e={render:()=>a.jsxs("div",{className:"grid gap-3 w-[320px]",children:[a.jsxs("div",{className:"grid gap-1.5",children:[a.jsx(i,{htmlFor:"email",children:"Email"}),a.jsx(d,{id:"email",type:"email",placeholder:"you@example.com"})]}),a.jsxs("div",{className:"grid gap-1.5",children:[a.jsx(i,{htmlFor:"disabled",className:"group","data-disabled":!0,children:"Disabled input"}),a.jsx(d,{id:"disabled",placeholder:"Disabled",disabled:!0})]})]})};var s,r,l;e.parameters={...e.parameters,docs:{...(s=e.parameters)==null?void 0:s.docs,source:{originalSource:`{
1
+ import{j as a}from"./jsx-runtime-D_zvdyIk.js";import{L as i}from"./label-CwntpYJ0.js";import{I as d}from"./input-11YRd9gD.js";import"./iframe-BWjPIle6.js";import"./preload-helper-Dp1pzeXC.js";import"./index-04C4iZwC.js";import"./index-C5eJ31Z3.js";import"./index-npvyVsxD.js";import"./index-BcAKBHrX.js";import"./utils-D-KgF5mV.js";const h={title:"Shadcn/UI/Label",component:i},e={render:()=>a.jsxs("div",{className:"grid gap-3 w-[320px]",children:[a.jsxs("div",{className:"grid gap-1.5",children:[a.jsx(i,{htmlFor:"email",children:"Email"}),a.jsx(d,{id:"email",type:"email",placeholder:"you@example.com"})]}),a.jsxs("div",{className:"grid gap-1.5",children:[a.jsx(i,{htmlFor:"disabled",className:"group","data-disabled":!0,children:"Disabled input"}),a.jsx(d,{id:"disabled",placeholder:"Disabled",disabled:!0})]})]})};var s,r,l;e.parameters={...e.parameters,docs:{...(s=e.parameters)==null?void 0:s.docs,source:{originalSource:`{
2
2
  render: () => <div className="grid gap-3 w-[320px]">
3
3
  <div className="grid gap-1.5">
4
4
  <Label htmlFor="email">Email</Label>
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{B as g}from"./button-BTWmFXop.js";import{F as a}from"./FormBuilder-BGgeY8ik.js";import"./SectionBuilder-Bav4WrnT.js";import{s as f}from"./schemas-S_Tg7JYp.js";import"./index-1v1lhNFD.js";import"./iframe-G-6sM9Mt.js";import"./preload-helper-Dp1pzeXC.js";import"./index-CGrAONsN.js";import"./utils-D-KgF5mV.js";import"./input-11YRd9gD.js";import"./textarea-Dw2vruMl.js";import"./select-DbLzULCJ.js";import"./index-_crRFOM5.js";import"./index-CZaD3imo.js";import"./index-BdQq_4o_.js";import"./index-DW48STyt.js";import"./index-BDwnENHR.js";import"./index-DvM9azdj.js";import"./index-ClNNG_ys.js";import"./index-7yNAGow7.js";import"./index-DqWzLCH-.js";import"./index-lH-AZpAn.js";import"./Combination-BT_gXe1L.js";import"./index-DhoByIgc.js";import"./index-I343IfOC.js";import"./index-CayhpKmv.js";import"./index-ev1RjzGv.js";import"./index-d_S6mtzU.js";import"./index-CAwQR9Pv.js";import"./index-HghBIZeg.js";import"./index-DNAxNqEO.js";import"./chevron-down-BqLjUn1_.js";import"./createLucideIcon-1ZwIAs_l.js";import"./check-BgWXKGqi.js";import"./checkbox-QlugAqJY.js";import"./index-Bq6UNRVc.js";import"./radio-group-iPL-8jvw.js";import"./index-CMmbDm5O.js";import"./circle-DVJTkDI7.js";import"./label-C5vJTTwH.js";import"./card-BJpPOzP8.js";import"./Autocomplete-DngjqsCM.js";import"./popover-DW1K4QCO.js";import"./command-BERL33lL.js";import"./index-CzJf-yyP.js";import"./dialog-DM9YJ1JD.js";import"./x-DG9mLFAg.js";import"./trash-2-Bt5LMclM.js";import"./grip-vertical-Buja1rv9.js";import"./separator-DoUX1TNx.js";function t({appTitle:m="Acme Inc",subtitle:c,signupLabel:k="Don't have an account?",signupLinkLabel:q="Sign up",signupHref:B="#",forgotPasswordLabel:T="Forgot your password?",forgotPasswordLinkLabel:H="Reset Here",forgotPasswordHref:p,rightImageSrc:u,rightImageAlt:P="Login image",className:R,continueWith:d,children:W}){return e.jsxs("div",{className:["grid min-h-dvh grid-cols-1 md:grid-cols-2",R].filter(Boolean).join(" "),children:[e.jsx("div",{className:"flex items-center justify-center p-6 md:p-10",children:e.jsxs("div",{className:"w-full max-w-md",children:[e.jsxs("div",{className:"mb-6 text-center",children:[e.jsx("h1",{className:"text-2xl font-bold leading-tight tracking-tight",children:m}),c?e.jsx("p",{className:"text-muted-foreground mt-1 text-sm",children:c}):null]}),e.jsxs("div",{className:"grid gap-6",children:[W,p?e.jsxs("div",{className:"text-center text-sm",children:[T," ",e.jsx("a",{href:p,className:"underline underline-offset-4",children:H})]}):null,d?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"after:border-border relative text-center text-sm after:absolute after:inset-0 after:top-1/2 after:z-0 after:flex after:items-center after:border-t",children:e.jsx("span",{className:"bg-background text-muted-foreground relative z-10 px-2",children:"Or continue with"})}),e.jsx("div",{className:"grid gap-3",children:d})]}):null]}),e.jsxs("div",{className:"mt-6 text-center text-sm",children:[k," ",e.jsx("a",{href:B,className:"underline underline-offset-4",children:q})]})]})}),e.jsx("div",{className:"hidden md:block",children:u?e.jsx("img",{src:u,alt:P,className:"h-full w-full object-cover",loading:"lazy"}):e.jsx("div",{className:"h-full w-full bg-muted"})})]})}t.__docgenInfo={description:`Login layout container.
1
+ import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{B as g}from"./button-BObfgcV1.js";import{F as a}from"./FormBuilder-C0S7C69Q.js";import{s as f}from"./schemas-CaLvKjsI.js";import"./index-BcAKBHrX.js";import"./iframe-BWjPIle6.js";import"./preload-helper-Dp1pzeXC.js";import"./index-CGrAONsN.js";import"./utils-D-KgF5mV.js";import"./input-11YRd9gD.js";import"./textarea-Dw2vruMl.js";import"./select-gtXRB92c.js";import"./index-C5eJ31Z3.js";import"./index-npvyVsxD.js";import"./index-BdQq_4o_.js";import"./index-DW48STyt.js";import"./index-C9xvlw_B.js";import"./index-Pk2lGsul.js";import"./index-Dr2xmx-F.js";import"./index-BfKpUbCE.js";import"./index-04C4iZwC.js";import"./index-DschQYGl.js";import"./Combination-CeVus13L.js";import"./index-BN5_W3Yi.js";import"./index-DWC9SV-P.js";import"./index-C6O7WofA.js";import"./index-DMk2qc2_.js";import"./index-Cce91yJQ.js";import"./index-7XoYQV2z.js";import"./index-Dqw7miiX.js";import"./index-URSssr5a.js";import"./chevron-down-Bp7zbUB0.js";import"./createLucideIcon-CLBo0iA0.js";import"./check-DyecuwP4.js";import"./checkbox-D5BmNJeL.js";import"./index-CKwUGXmt.js";import"./radio-group-CvN0LQZp.js";import"./index-Cw7p-pms.js";import"./circle-CyarsADt.js";import"./label-CwntpYJ0.js";import"./card-BJpPOzP8.js";import"./Autocomplete-B4gV705L.js";import"./popover-ClqrrvjL.js";import"./command-DCnXmNmT.js";import"./index-u70nzfOV.js";import"./dialog-DL0QBIbC.js";import"./x-n8sFtlI2.js";import"./trash-2-D55eseMQ.js";import"./grip-vertical-CM0GDwvq.js";import"./SectionBuilder-Df_lRZkj.js";import"./separator-CxCWfpZX.js";function t({appTitle:m="Acme Inc",subtitle:c,signupLabel:k="Don't have an account?",signupLinkLabel:q="Sign up",signupHref:B="#",forgotPasswordLabel:T="Forgot your password?",forgotPasswordLinkLabel:H="Reset Here",forgotPasswordHref:p,rightImageSrc:u,rightImageAlt:P="Login image",className:R,continueWith:d,children:W}){return e.jsxs("div",{className:["grid min-h-dvh grid-cols-1 md:grid-cols-2",R].filter(Boolean).join(" "),children:[e.jsx("div",{className:"flex items-center justify-center p-6 md:p-10",children:e.jsxs("div",{className:"w-full max-w-md",children:[e.jsxs("div",{className:"mb-6 text-center",children:[e.jsx("h1",{className:"text-2xl font-bold leading-tight tracking-tight",children:m}),c?e.jsx("p",{className:"text-muted-foreground mt-1 text-sm",children:c}):null]}),e.jsxs("div",{className:"grid gap-6",children:[W,p?e.jsxs("div",{className:"text-center text-sm",children:[T," ",e.jsx("a",{href:p,className:"underline underline-offset-4",children:H})]}):null,d?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"after:border-border relative text-center text-sm after:absolute after:inset-0 after:top-1/2 after:z-0 after:flex after:items-center after:border-t",children:e.jsx("span",{className:"bg-background text-muted-foreground relative z-10 px-2",children:"Or continue with"})}),e.jsx("div",{className:"grid gap-3",children:d})]}):null]}),e.jsxs("div",{className:"mt-6 text-center text-sm",children:[k," ",e.jsx("a",{href:B,className:"underline underline-offset-4",children:q})]})]})}),e.jsx("div",{className:"hidden md:block",children:u?e.jsx("img",{src:u,alt:P,className:"h-full w-full object-cover",loading:"lazy"}):e.jsx("div",{className:"h-full w-full bg-muted"})})]})}t.__docgenInfo={description:`Login layout container.
2
2
 
3
3
  Responsibilities:
4
4
  - Provides a two-column layout (form + optional right-side image)
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{r as s}from"./iframe-G-6sM9Mt.js";import{c as Ie}from"./index-BDwnENHR.js";import{u as _e}from"./index-ClNNG_ys.js";import{c as I}from"./index-DW48STyt.js";import{u as Se}from"./index-1v1lhNFD.js";import{c as je}from"./index-DvM9azdj.js";import{u as E}from"./index-DhoByIgc.js";import{c as Ne,R as Re,A as Ce,C as ye,I as we,S as Te,f as Ee,g as Ae,h as Pe,a as Oe,b as ke,L as Fe,d as Ge,e as De,P as ze,G as Le,i as $e}from"./index-CLmN5G1a.js";import{c as q,R as Ke,I as Ve}from"./index-CMmbDm5O.js";import{P as W}from"./index-DqWzLCH-.js";import{u as Z}from"./index-CAwQR9Pv.js";import{c as x}from"./utils-D-KgF5mV.js";import{C as Be}from"./chevron-right-DpCIoMaJ.js";import{C as Ue}from"./check-BgWXKGqi.js";import{C as qe}from"./circle-DVJTkDI7.js";import"./preload-helper-Dp1pzeXC.js";import"./index-I343IfOC.js";import"./index-7yNAGow7.js";import"./index-lH-AZpAn.js";import"./Combination-BT_gXe1L.js";import"./index-CayhpKmv.js";import"./index-_crRFOM5.js";import"./index-CZaD3imo.js";import"./index-ev1RjzGv.js";import"./index-d_S6mtzU.js";import"./index-Bq6UNRVc.js";import"./createLucideIcon-1ZwIAs_l.js";var N="Menubar",[A,We,Ze]=Ie(N),[H,rn]=je(N,[Ze,q]),l=Ne(),X=q(),[He,G]=H(N),Y=s.forwardRef((r,n)=>{const{__scopeMenubar:a,value:t,onValueChange:o,defaultValue:h,loop:b=!0,dir:d,...u}=r,m=_e(d),i=X(a),[M,p]=Z({prop:t,onChange:o,defaultProp:h??"",caller:N}),[g,c]=s.useState(null);return e.jsx(He,{scope:a,value:M,onMenuOpen:s.useCallback(f=>{p(f),c(f)},[p]),onMenuClose:s.useCallback(()=>p(""),[p]),onMenuToggle:s.useCallback(f=>{p(L=>L?"":f),c(f)},[p]),dir:m,loop:b,children:e.jsx(A.Provider,{scope:a,children:e.jsx(A.Slot,{scope:a,children:e.jsx(Ke,{asChild:!0,...i,orientation:"horizontal",loop:b,dir:m,currentTabStopId:g,onCurrentTabStopIdChange:c,children:e.jsx(W.div,{role:"menubar",...u,ref:n})})})})})});Y.displayName=N;var D="MenubarMenu",[Xe,J]=H(D),Q=r=>{const{__scopeMenubar:n,value:a,...t}=r,o=E(),h=a||o||"LEGACY_REACT_AUTO_VALUE",b=G(D,n),d=l(n),u=s.useRef(null),m=s.useRef(!1),i=b.value===h;return s.useEffect(()=>{i||(m.current=!1)},[i]),e.jsx(Xe,{scope:n,value:h,triggerId:E(),triggerRef:u,contentId:E(),wasKeyboardTriggerOpenRef:m,children:e.jsx(Re,{...d,open:i,onOpenChange:M=>{M||b.onMenuClose()},modal:!1,dir:b.dir,...t})})};Q.displayName=D;var P="MenubarTrigger",ee=s.forwardRef((r,n)=>{const{__scopeMenubar:a,disabled:t=!1,...o}=r,h=X(a),b=l(a),d=G(P,a),u=J(P,a),m=s.useRef(null),i=Se(n,m,u.triggerRef),[M,p]=s.useState(!1),g=d.value===u.value;return e.jsx(A.ItemSlot,{scope:a,value:u.value,disabled:t,children:e.jsx(Ve,{asChild:!0,...h,focusable:!t,tabStopId:u.value,children:e.jsx(Ce,{asChild:!0,...b,children:e.jsx(W.button,{type:"button",role:"menuitem",id:u.triggerId,"aria-haspopup":"menu","aria-expanded":g,"aria-controls":g?u.contentId:void 0,"data-highlighted":M?"":void 0,"data-state":g?"open":"closed","data-disabled":t?"":void 0,disabled:t,...o,ref:i,onPointerDown:I(r.onPointerDown,c=>{!t&&c.button===0&&c.ctrlKey===!1&&(d.onMenuOpen(u.value),g||c.preventDefault())}),onPointerEnter:I(r.onPointerEnter,()=>{var f;!!d.value&&!g&&(d.onMenuOpen(u.value),(f=m.current)==null||f.focus())}),onKeyDown:I(r.onKeyDown,c=>{t||(["Enter"," "].includes(c.key)&&d.onMenuToggle(u.value),c.key==="ArrowDown"&&d.onMenuOpen(u.value),["Enter"," ","ArrowDown"].includes(c.key)&&(u.wasKeyboardTriggerOpenRef.current=!0,c.preventDefault()))}),onFocus:I(r.onFocus,()=>p(!0)),onBlur:I(r.onBlur,()=>p(!1))})})})})});ee.displayName=P;var Ye="MenubarPortal",re=r=>{const{__scopeMenubar:n,...a}=r,t=l(n);return e.jsx(ze,{...t,...a})};re.displayName=Ye;var O="MenubarContent",ne=s.forwardRef((r,n)=>{const{__scopeMenubar:a,align:t="start",...o}=r,h=l(a),b=G(O,a),d=J(O,a),u=We(a),m=s.useRef(!1);return e.jsx(ye,{id:d.contentId,"aria-labelledby":d.triggerId,"data-radix-menubar-content":"",...h,...o,ref:n,align:t,onCloseAutoFocus:I(r.onCloseAutoFocus,i=>{var p;!!!b.value&&!m.current&&((p=d.triggerRef.current)==null||p.focus()),m.current=!1,i.preventDefault()}),onFocusOutside:I(r.onFocusOutside,i=>{const M=i.target;u().some(g=>{var c;return(c=g.ref.current)==null?void 0:c.contains(M)})&&i.preventDefault()}),onInteractOutside:I(r.onInteractOutside,()=>{m.current=!0}),onEntryFocus:i=>{d.wasKeyboardTriggerOpenRef.current||i.preventDefault()},onKeyDown:I(r.onKeyDown,i=>{if(["ArrowRight","ArrowLeft"].includes(i.key)){const M=i.target,p=M.hasAttribute("data-radix-menubar-subtrigger"),g=M.closest("[data-radix-menubar-content]")!==i.currentTarget,f=(b.dir==="rtl"?"ArrowRight":"ArrowLeft")===i.key;if(!f&&p||g&&f)return;let S=u().filter(T=>!T.disabled).map(T=>T.value);f&&S.reverse();const $=S.indexOf(d.value);S=b.loop?lr(S,$+1):S.slice($+1);const[K]=S;K&&b.onMenuOpen(K)}},{checkForDefaultPrevented:!1}),style:{...r.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});ne.displayName=O;var Je="MenubarGroup",Qe=s.forwardRef((r,n)=>{const{__scopeMenubar:a,...t}=r,o=l(a);return e.jsx(Le,{...o,...t,ref:n})});Qe.displayName=Je;var er="MenubarLabel",ae=s.forwardRef((r,n)=>{const{__scopeMenubar:a,...t}=r,o=l(a);return e.jsx(Fe,{...o,...t,ref:n})});ae.displayName=er;var rr="MenubarItem",te=s.forwardRef((r,n)=>{const{__scopeMenubar:a,...t}=r,o=l(a);return e.jsx(we,{...o,...t,ref:n})});te.displayName=rr;var nr="MenubarCheckboxItem",oe=s.forwardRef((r,n)=>{const{__scopeMenubar:a,...t}=r,o=l(a);return e.jsx(Oe,{...o,...t,ref:n})});oe.displayName=nr;var ar="MenubarRadioGroup",se=s.forwardRef((r,n)=>{const{__scopeMenubar:a,...t}=r,o=l(a);return e.jsx(Ge,{...o,...t,ref:n})});se.displayName=ar;var tr="MenubarRadioItem",ue=s.forwardRef((r,n)=>{const{__scopeMenubar:a,...t}=r,o=l(a);return e.jsx(De,{...o,...t,ref:n})});ue.displayName=tr;var or="MenubarItemIndicator",ie=s.forwardRef((r,n)=>{const{__scopeMenubar:a,...t}=r,o=l(a);return e.jsx(ke,{...o,...t,ref:n})});ie.displayName=or;var sr="MenubarSeparator",de=s.forwardRef((r,n)=>{const{__scopeMenubar:a,...t}=r,o=l(a);return e.jsx(Te,{...o,...t,ref:n})});de.displayName=sr;var ur="MenubarArrow",ir=s.forwardRef((r,n)=>{const{__scopeMenubar:a,...t}=r,o=l(a);return e.jsx($e,{...o,...t,ref:n})});ir.displayName=ur;var ce="MenubarSub",le=r=>{const{__scopeMenubar:n,children:a,open:t,onOpenChange:o,defaultOpen:h}=r,b=l(n),[d,u]=Z({prop:t,defaultProp:h??!1,onChange:o,caller:ce});return e.jsx(Ee,{...b,open:d,onOpenChange:u,children:a})};le.displayName=ce;var dr="MenubarSubTrigger",be=s.forwardRef((r,n)=>{const{__scopeMenubar:a,...t}=r,o=l(a);return e.jsx(Ae,{"data-radix-menubar-subtrigger":"",...o,...t,ref:n})});be.displayName=dr;var cr="MenubarSubContent",pe=s.forwardRef((r,n)=>{const{__scopeMenubar:a,...t}=r,o=l(a);return e.jsx(Pe,{...o,"data-radix-menubar-content":"",...t,ref:n,style:{...r.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});pe.displayName=cr;function lr(r,n){return r.map((a,t)=>r[(n+t)%r.length])}var br=Y,pr=Q,mr=ee,fr=re,Mr=ne,gr=ae,xr=te,hr=oe,vr=se,Ir=ue,me=ie,_r=de,Sr=le,jr=be,Nr=pe;function z({className:r,...n}){return e.jsx(br,{"data-slot":"menubar",className:x("bg-background flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs",r),...n})}function C({...r}){return e.jsx(pr,{"data-slot":"menubar-menu",...r})}function fe({...r}){return e.jsx(fr,{"data-slot":"menubar-portal",...r})}function Me({...r}){return e.jsx(vr,{"data-slot":"menubar-radio-group",...r})}function y({className:r,...n}){return e.jsx(mr,{"data-slot":"menubar-trigger",className:x("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none",r),...n})}function w({className:r,align:n="start",alignOffset:a=-4,sideOffset:t=8,...o}){return e.jsx(fe,{children:e.jsx(Mr,{"data-slot":"menubar-content",align:n,alignOffset:a,sideOffset:t,className:x("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[12rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-md",r),...o})})}function v({className:r,inset:n,variant:a="default",...t}){return e.jsx(xr,{"data-slot":"menubar-item","data-inset":n,"data-variant":a,className:x("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",r),...t})}function k({className:r,children:n,checked:a,...t}){return e.jsxs(hr,{"data-slot":"menubar-checkbox-item",className:x("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",r),checked:a,...t,children:[e.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:e.jsx(me,{children:e.jsx(Ue,{className:"size-4"})})}),n]})}function F({className:r,children:n,...a}){return e.jsxs(Ir,{"data-slot":"menubar-radio-item",className:x("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",r),...a,children:[e.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:e.jsx(me,{children:e.jsx(qe,{className:"size-2 fill-current"})})}),n]})}function ge({className:r,inset:n,...a}){return e.jsx(gr,{"data-slot":"menubar-label","data-inset":n,className:x("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",r),...a})}function j({className:r,...n}){return e.jsx(_r,{"data-slot":"menubar-separator",className:x("bg-border -mx-1 my-1 h-px",r),...n})}function _({className:r,...n}){return e.jsx("span",{"data-slot":"menubar-shortcut",className:x("text-muted-foreground ml-auto text-xs tracking-widest",r),...n})}function xe({...r}){return e.jsx(Sr,{"data-slot":"menubar-sub",...r})}function he({className:r,inset:n,children:a,...t}){return e.jsxs(jr,{"data-slot":"menubar-sub-trigger","data-inset":n,className:x("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[inset]:pl-8",r),...t,children:[a,e.jsx(Be,{className:"ml-auto h-4 w-4"})]})}function ve({className:r,...n}){return e.jsx(Nr,{"data-slot":"menubar-sub-content",className:x("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",r),...n})}z.__docgenInfo={description:"",methods:[],displayName:"Menubar"};fe.__docgenInfo={description:"",methods:[],displayName:"MenubarPortal"};C.__docgenInfo={description:"",methods:[],displayName:"MenubarMenu"};y.__docgenInfo={description:"",methods:[],displayName:"MenubarTrigger"};w.__docgenInfo={description:"",methods:[],displayName:"MenubarContent",props:{align:{defaultValue:{value:'"start"',computed:!1},required:!1},alignOffset:{defaultValue:{value:"-4",computed:!1},required:!1},sideOffset:{defaultValue:{value:"8",computed:!1},required:!1}}};j.__docgenInfo={description:"",methods:[],displayName:"MenubarSeparator"};ge.__docgenInfo={description:"",methods:[],displayName:"MenubarLabel",props:{inset:{required:!1,tsType:{name:"boolean"},description:""}}};v.__docgenInfo={description:"",methods:[],displayName:"MenubarItem",props:{inset:{required:!1,tsType:{name:"boolean"},description:""},variant:{required:!1,tsType:{name:"union",raw:'"default" | "destructive"',elements:[{name:"literal",value:'"default"'},{name:"literal",value:'"destructive"'}]},description:"",defaultValue:{value:'"default"',computed:!1}}}};_.__docgenInfo={description:"",methods:[],displayName:"MenubarShortcut"};k.__docgenInfo={description:"",methods:[],displayName:"MenubarCheckboxItem"};Me.__docgenInfo={description:"",methods:[],displayName:"MenubarRadioGroup"};F.__docgenInfo={description:"",methods:[],displayName:"MenubarRadioItem"};xe.__docgenInfo={description:"",methods:[],displayName:"MenubarSub"};he.__docgenInfo={description:"",methods:[],displayName:"MenubarSubTrigger",props:{inset:{required:!1,tsType:{name:"boolean"},description:""}}};ve.__docgenInfo={description:"",methods:[],displayName:"MenubarSubContent"};const nn={title:"Shadcn/UI/Menubar",component:z},R={render:()=>e.jsxs(z,{children:[e.jsxs(C,{children:[e.jsx(y,{children:"File"}),e.jsxs(w,{children:[e.jsxs(v,{children:["New Tab ",e.jsx(_,{children:"⌘T"})]}),e.jsxs(v,{children:["New Window ",e.jsx(_,{children:"⌘N"})]}),e.jsx(j,{}),e.jsxs(xe,{children:[e.jsx(he,{children:"Share"}),e.jsxs(ve,{children:[e.jsx(v,{children:"Email link"}),e.jsx(v,{children:"Messages"})]})]}),e.jsx(j,{}),e.jsxs(v,{children:["Close Window ",e.jsx(_,{children:"⌘W"})]})]})]}),e.jsxs(C,{children:[e.jsx(y,{children:"Edit"}),e.jsxs(w,{children:[e.jsxs(v,{children:["Undo ",e.jsx(_,{children:"⌘Z"})]}),e.jsxs(v,{children:["Redo ",e.jsx(_,{children:"⇧⌘Z"})]}),e.jsx(j,{}),e.jsx(k,{checked:!0,children:"Show Ruler"}),e.jsx(k,{children:"Show Toolbar"}),e.jsx(j,{}),e.jsx(ge,{children:"Zoom"}),e.jsxs(Me,{value:"fit",children:[e.jsx(F,{value:"fit",children:"Fit"}),e.jsx(F,{value:"fill",children:"Fill"})]})]})]}),e.jsxs(C,{children:[e.jsx(y,{children:"View"}),e.jsxs(w,{children:[e.jsxs(v,{children:["Reload ",e.jsx(_,{children:"⌘R"})]}),e.jsxs(v,{children:["Toggle Full Screen ",e.jsx(_,{children:"⌃⌘F"})]})]})]})]})};var V,B,U;R.parameters={...R.parameters,docs:{...(V=R.parameters)==null?void 0:V.docs,source:{originalSource:`{
1
+ import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{r as s}from"./iframe-BWjPIle6.js";import{c as Ie}from"./index-C9xvlw_B.js";import{u as _e}from"./index-Dr2xmx-F.js";import{c as I}from"./index-DW48STyt.js";import{u as Se}from"./index-BcAKBHrX.js";import{c as je}from"./index-Pk2lGsul.js";import{u as E}from"./index-BN5_W3Yi.js";import{c as Ne,R as Re,A as Ce,C as ye,I as we,S as Te,f as Ee,g as Ae,h as Pe,a as Oe,b as ke,L as Fe,d as Ge,e as De,P as ze,G as Le,i as $e}from"./index-DE2OlfDP.js";import{c as q,R as Ke,I as Ve}from"./index-Cw7p-pms.js";import{P as W}from"./index-04C4iZwC.js";import{u as Z}from"./index-7XoYQV2z.js";import{c as x}from"./utils-D-KgF5mV.js";import{C as Be}from"./chevron-right-oMYqDJ_f.js";import{C as Ue}from"./check-DyecuwP4.js";import{C as qe}from"./circle-CyarsADt.js";import"./preload-helper-Dp1pzeXC.js";import"./index-DWC9SV-P.js";import"./index-BfKpUbCE.js";import"./index-DschQYGl.js";import"./Combination-CeVus13L.js";import"./index-C6O7WofA.js";import"./index-C5eJ31Z3.js";import"./index-npvyVsxD.js";import"./index-DMk2qc2_.js";import"./index-Cce91yJQ.js";import"./index-CKwUGXmt.js";import"./createLucideIcon-CLBo0iA0.js";var N="Menubar",[A,We,Ze]=Ie(N),[H,rn]=je(N,[Ze,q]),l=Ne(),X=q(),[He,G]=H(N),Y=s.forwardRef((r,n)=>{const{__scopeMenubar:a,value:t,onValueChange:o,defaultValue:h,loop:b=!0,dir:d,...u}=r,m=_e(d),i=X(a),[M,p]=Z({prop:t,onChange:o,defaultProp:h??"",caller:N}),[g,c]=s.useState(null);return e.jsx(He,{scope:a,value:M,onMenuOpen:s.useCallback(f=>{p(f),c(f)},[p]),onMenuClose:s.useCallback(()=>p(""),[p]),onMenuToggle:s.useCallback(f=>{p(L=>L?"":f),c(f)},[p]),dir:m,loop:b,children:e.jsx(A.Provider,{scope:a,children:e.jsx(A.Slot,{scope:a,children:e.jsx(Ke,{asChild:!0,...i,orientation:"horizontal",loop:b,dir:m,currentTabStopId:g,onCurrentTabStopIdChange:c,children:e.jsx(W.div,{role:"menubar",...u,ref:n})})})})})});Y.displayName=N;var D="MenubarMenu",[Xe,J]=H(D),Q=r=>{const{__scopeMenubar:n,value:a,...t}=r,o=E(),h=a||o||"LEGACY_REACT_AUTO_VALUE",b=G(D,n),d=l(n),u=s.useRef(null),m=s.useRef(!1),i=b.value===h;return s.useEffect(()=>{i||(m.current=!1)},[i]),e.jsx(Xe,{scope:n,value:h,triggerId:E(),triggerRef:u,contentId:E(),wasKeyboardTriggerOpenRef:m,children:e.jsx(Re,{...d,open:i,onOpenChange:M=>{M||b.onMenuClose()},modal:!1,dir:b.dir,...t})})};Q.displayName=D;var P="MenubarTrigger",ee=s.forwardRef((r,n)=>{const{__scopeMenubar:a,disabled:t=!1,...o}=r,h=X(a),b=l(a),d=G(P,a),u=J(P,a),m=s.useRef(null),i=Se(n,m,u.triggerRef),[M,p]=s.useState(!1),g=d.value===u.value;return e.jsx(A.ItemSlot,{scope:a,value:u.value,disabled:t,children:e.jsx(Ve,{asChild:!0,...h,focusable:!t,tabStopId:u.value,children:e.jsx(Ce,{asChild:!0,...b,children:e.jsx(W.button,{type:"button",role:"menuitem",id:u.triggerId,"aria-haspopup":"menu","aria-expanded":g,"aria-controls":g?u.contentId:void 0,"data-highlighted":M?"":void 0,"data-state":g?"open":"closed","data-disabled":t?"":void 0,disabled:t,...o,ref:i,onPointerDown:I(r.onPointerDown,c=>{!t&&c.button===0&&c.ctrlKey===!1&&(d.onMenuOpen(u.value),g||c.preventDefault())}),onPointerEnter:I(r.onPointerEnter,()=>{var f;!!d.value&&!g&&(d.onMenuOpen(u.value),(f=m.current)==null||f.focus())}),onKeyDown:I(r.onKeyDown,c=>{t||(["Enter"," "].includes(c.key)&&d.onMenuToggle(u.value),c.key==="ArrowDown"&&d.onMenuOpen(u.value),["Enter"," ","ArrowDown"].includes(c.key)&&(u.wasKeyboardTriggerOpenRef.current=!0,c.preventDefault()))}),onFocus:I(r.onFocus,()=>p(!0)),onBlur:I(r.onBlur,()=>p(!1))})})})})});ee.displayName=P;var Ye="MenubarPortal",re=r=>{const{__scopeMenubar:n,...a}=r,t=l(n);return e.jsx(ze,{...t,...a})};re.displayName=Ye;var O="MenubarContent",ne=s.forwardRef((r,n)=>{const{__scopeMenubar:a,align:t="start",...o}=r,h=l(a),b=G(O,a),d=J(O,a),u=We(a),m=s.useRef(!1);return e.jsx(ye,{id:d.contentId,"aria-labelledby":d.triggerId,"data-radix-menubar-content":"",...h,...o,ref:n,align:t,onCloseAutoFocus:I(r.onCloseAutoFocus,i=>{var p;!!!b.value&&!m.current&&((p=d.triggerRef.current)==null||p.focus()),m.current=!1,i.preventDefault()}),onFocusOutside:I(r.onFocusOutside,i=>{const M=i.target;u().some(g=>{var c;return(c=g.ref.current)==null?void 0:c.contains(M)})&&i.preventDefault()}),onInteractOutside:I(r.onInteractOutside,()=>{m.current=!0}),onEntryFocus:i=>{d.wasKeyboardTriggerOpenRef.current||i.preventDefault()},onKeyDown:I(r.onKeyDown,i=>{if(["ArrowRight","ArrowLeft"].includes(i.key)){const M=i.target,p=M.hasAttribute("data-radix-menubar-subtrigger"),g=M.closest("[data-radix-menubar-content]")!==i.currentTarget,f=(b.dir==="rtl"?"ArrowRight":"ArrowLeft")===i.key;if(!f&&p||g&&f)return;let S=u().filter(T=>!T.disabled).map(T=>T.value);f&&S.reverse();const $=S.indexOf(d.value);S=b.loop?lr(S,$+1):S.slice($+1);const[K]=S;K&&b.onMenuOpen(K)}},{checkForDefaultPrevented:!1}),style:{...r.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});ne.displayName=O;var Je="MenubarGroup",Qe=s.forwardRef((r,n)=>{const{__scopeMenubar:a,...t}=r,o=l(a);return e.jsx(Le,{...o,...t,ref:n})});Qe.displayName=Je;var er="MenubarLabel",ae=s.forwardRef((r,n)=>{const{__scopeMenubar:a,...t}=r,o=l(a);return e.jsx(Fe,{...o,...t,ref:n})});ae.displayName=er;var rr="MenubarItem",te=s.forwardRef((r,n)=>{const{__scopeMenubar:a,...t}=r,o=l(a);return e.jsx(we,{...o,...t,ref:n})});te.displayName=rr;var nr="MenubarCheckboxItem",oe=s.forwardRef((r,n)=>{const{__scopeMenubar:a,...t}=r,o=l(a);return e.jsx(Oe,{...o,...t,ref:n})});oe.displayName=nr;var ar="MenubarRadioGroup",se=s.forwardRef((r,n)=>{const{__scopeMenubar:a,...t}=r,o=l(a);return e.jsx(Ge,{...o,...t,ref:n})});se.displayName=ar;var tr="MenubarRadioItem",ue=s.forwardRef((r,n)=>{const{__scopeMenubar:a,...t}=r,o=l(a);return e.jsx(De,{...o,...t,ref:n})});ue.displayName=tr;var or="MenubarItemIndicator",ie=s.forwardRef((r,n)=>{const{__scopeMenubar:a,...t}=r,o=l(a);return e.jsx(ke,{...o,...t,ref:n})});ie.displayName=or;var sr="MenubarSeparator",de=s.forwardRef((r,n)=>{const{__scopeMenubar:a,...t}=r,o=l(a);return e.jsx(Te,{...o,...t,ref:n})});de.displayName=sr;var ur="MenubarArrow",ir=s.forwardRef((r,n)=>{const{__scopeMenubar:a,...t}=r,o=l(a);return e.jsx($e,{...o,...t,ref:n})});ir.displayName=ur;var ce="MenubarSub",le=r=>{const{__scopeMenubar:n,children:a,open:t,onOpenChange:o,defaultOpen:h}=r,b=l(n),[d,u]=Z({prop:t,defaultProp:h??!1,onChange:o,caller:ce});return e.jsx(Ee,{...b,open:d,onOpenChange:u,children:a})};le.displayName=ce;var dr="MenubarSubTrigger",be=s.forwardRef((r,n)=>{const{__scopeMenubar:a,...t}=r,o=l(a);return e.jsx(Ae,{"data-radix-menubar-subtrigger":"",...o,...t,ref:n})});be.displayName=dr;var cr="MenubarSubContent",pe=s.forwardRef((r,n)=>{const{__scopeMenubar:a,...t}=r,o=l(a);return e.jsx(Pe,{...o,"data-radix-menubar-content":"",...t,ref:n,style:{...r.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});pe.displayName=cr;function lr(r,n){return r.map((a,t)=>r[(n+t)%r.length])}var br=Y,pr=Q,mr=ee,fr=re,Mr=ne,gr=ae,xr=te,hr=oe,vr=se,Ir=ue,me=ie,_r=de,Sr=le,jr=be,Nr=pe;function z({className:r,...n}){return e.jsx(br,{"data-slot":"menubar",className:x("bg-background flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs",r),...n})}function C({...r}){return e.jsx(pr,{"data-slot":"menubar-menu",...r})}function fe({...r}){return e.jsx(fr,{"data-slot":"menubar-portal",...r})}function Me({...r}){return e.jsx(vr,{"data-slot":"menubar-radio-group",...r})}function y({className:r,...n}){return e.jsx(mr,{"data-slot":"menubar-trigger",className:x("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none",r),...n})}function w({className:r,align:n="start",alignOffset:a=-4,sideOffset:t=8,...o}){return e.jsx(fe,{children:e.jsx(Mr,{"data-slot":"menubar-content",align:n,alignOffset:a,sideOffset:t,className:x("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[12rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-md",r),...o})})}function v({className:r,inset:n,variant:a="default",...t}){return e.jsx(xr,{"data-slot":"menubar-item","data-inset":n,"data-variant":a,className:x("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",r),...t})}function k({className:r,children:n,checked:a,...t}){return e.jsxs(hr,{"data-slot":"menubar-checkbox-item",className:x("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",r),checked:a,...t,children:[e.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:e.jsx(me,{children:e.jsx(Ue,{className:"size-4"})})}),n]})}function F({className:r,children:n,...a}){return e.jsxs(Ir,{"data-slot":"menubar-radio-item",className:x("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",r),...a,children:[e.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:e.jsx(me,{children:e.jsx(qe,{className:"size-2 fill-current"})})}),n]})}function ge({className:r,inset:n,...a}){return e.jsx(gr,{"data-slot":"menubar-label","data-inset":n,className:x("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",r),...a})}function j({className:r,...n}){return e.jsx(_r,{"data-slot":"menubar-separator",className:x("bg-border -mx-1 my-1 h-px",r),...n})}function _({className:r,...n}){return e.jsx("span",{"data-slot":"menubar-shortcut",className:x("text-muted-foreground ml-auto text-xs tracking-widest",r),...n})}function xe({...r}){return e.jsx(Sr,{"data-slot":"menubar-sub",...r})}function he({className:r,inset:n,children:a,...t}){return e.jsxs(jr,{"data-slot":"menubar-sub-trigger","data-inset":n,className:x("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[inset]:pl-8",r),...t,children:[a,e.jsx(Be,{className:"ml-auto h-4 w-4"})]})}function ve({className:r,...n}){return e.jsx(Nr,{"data-slot":"menubar-sub-content",className:x("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",r),...n})}z.__docgenInfo={description:"",methods:[],displayName:"Menubar"};fe.__docgenInfo={description:"",methods:[],displayName:"MenubarPortal"};C.__docgenInfo={description:"",methods:[],displayName:"MenubarMenu"};y.__docgenInfo={description:"",methods:[],displayName:"MenubarTrigger"};w.__docgenInfo={description:"",methods:[],displayName:"MenubarContent",props:{align:{defaultValue:{value:'"start"',computed:!1},required:!1},alignOffset:{defaultValue:{value:"-4",computed:!1},required:!1},sideOffset:{defaultValue:{value:"8",computed:!1},required:!1}}};j.__docgenInfo={description:"",methods:[],displayName:"MenubarSeparator"};ge.__docgenInfo={description:"",methods:[],displayName:"MenubarLabel",props:{inset:{required:!1,tsType:{name:"boolean"},description:""}}};v.__docgenInfo={description:"",methods:[],displayName:"MenubarItem",props:{inset:{required:!1,tsType:{name:"boolean"},description:""},variant:{required:!1,tsType:{name:"union",raw:'"default" | "destructive"',elements:[{name:"literal",value:'"default"'},{name:"literal",value:'"destructive"'}]},description:"",defaultValue:{value:'"default"',computed:!1}}}};_.__docgenInfo={description:"",methods:[],displayName:"MenubarShortcut"};k.__docgenInfo={description:"",methods:[],displayName:"MenubarCheckboxItem"};Me.__docgenInfo={description:"",methods:[],displayName:"MenubarRadioGroup"};F.__docgenInfo={description:"",methods:[],displayName:"MenubarRadioItem"};xe.__docgenInfo={description:"",methods:[],displayName:"MenubarSub"};he.__docgenInfo={description:"",methods:[],displayName:"MenubarSubTrigger",props:{inset:{required:!1,tsType:{name:"boolean"},description:""}}};ve.__docgenInfo={description:"",methods:[],displayName:"MenubarSubContent"};const nn={title:"Shadcn/UI/Menubar",component:z},R={render:()=>e.jsxs(z,{children:[e.jsxs(C,{children:[e.jsx(y,{children:"File"}),e.jsxs(w,{children:[e.jsxs(v,{children:["New Tab ",e.jsx(_,{children:"⌘T"})]}),e.jsxs(v,{children:["New Window ",e.jsx(_,{children:"⌘N"})]}),e.jsx(j,{}),e.jsxs(xe,{children:[e.jsx(he,{children:"Share"}),e.jsxs(ve,{children:[e.jsx(v,{children:"Email link"}),e.jsx(v,{children:"Messages"})]})]}),e.jsx(j,{}),e.jsxs(v,{children:["Close Window ",e.jsx(_,{children:"⌘W"})]})]})]}),e.jsxs(C,{children:[e.jsx(y,{children:"Edit"}),e.jsxs(w,{children:[e.jsxs(v,{children:["Undo ",e.jsx(_,{children:"⌘Z"})]}),e.jsxs(v,{children:["Redo ",e.jsx(_,{children:"⇧⌘Z"})]}),e.jsx(j,{}),e.jsx(k,{checked:!0,children:"Show Ruler"}),e.jsx(k,{children:"Show Toolbar"}),e.jsx(j,{}),e.jsx(ge,{children:"Zoom"}),e.jsxs(Me,{value:"fit",children:[e.jsx(F,{value:"fit",children:"Fit"}),e.jsx(F,{value:"fill",children:"Fill"})]})]})]}),e.jsxs(C,{children:[e.jsx(y,{children:"View"}),e.jsxs(w,{children:[e.jsxs(v,{children:["Reload ",e.jsx(_,{children:"⌘R"})]}),e.jsxs(v,{children:["Toggle Full Screen ",e.jsx(_,{children:"⌃⌘F"})]})]})]})]})};var V,B,U;R.parameters={...R.parameters,docs:{...(V=R.parameters)==null?void 0:V.docs,source:{originalSource:`{
2
2
  render: () => <Menubar>
3
3
  <MenubarMenu>
4
4
  <MenubarTrigger>File</MenubarTrigger>
@@ -1,4 +1,4 @@
1
- import{j as n}from"./jsx-runtime-D_zvdyIk.js";import{r as s}from"./iframe-G-6sM9Mt.js";import{R as Ae}from"./index-_crRFOM5.js";import{c as Oe}from"./index-DvM9azdj.js";import{c as y}from"./index-DW48STyt.js";import{P as _,d as ae}from"./index-DqWzLCH-.js";import{u as de}from"./index-CAwQR9Pv.js";import{u as O,a as Fe}from"./index-1v1lhNFD.js";import{u as Ke}from"./index-ClNNG_ys.js";import{P as z}from"./index-Bq6UNRVc.js";import{u as le}from"./index-DhoByIgc.js";import{c as ve}from"./index-BDwnENHR.js";import{D as Ve}from"./index-7yNAGow7.js";import{u as ze}from"./index-HghBIZeg.js";import{u as G}from"./index-I343IfOC.js";import{u as L}from"./index-lH-AZpAn.js";import{R as $e}from"./index-DNAxNqEO.js";import{c as Ge}from"./index-CGrAONsN.js";import{c as j}from"./utils-D-KgF5mV.js";import{C as Ue}from"./chevron-down-BqLjUn1_.js";import"./preload-helper-Dp1pzeXC.js";import"./index-CZaD3imo.js";import"./createLucideIcon-1ZwIAs_l.js";var S="NavigationMenu",[X,me,Be]=ve(S),[U,He,We]=ve(S),[J,Ft]=Oe(S,[Be,We]),[Ye,I]=J(S),[qe,Xe]=J(S),fe=s.forwardRef((e,t)=>{const{__scopeNavigationMenu:o,value:i,onValueChange:a,defaultValue:r,delayDuration:c=200,skipDelayDuration:l=300,orientation:u="horizontal",dir:N,...d}=e,[g,C]=s.useState(null),b=O(t,x=>C(x)),h=Ke(N),p=s.useRef(0),w=s.useRef(0),R=s.useRef(0),[T,m]=s.useState(!0),[f,v]=de({prop:i,onChange:x=>{const k=x!=="",$=l>0;k?(window.clearTimeout(R.current),$&&m(!1)):(window.clearTimeout(R.current),R.current=window.setTimeout(()=>m(!0),l)),a==null||a(x)},defaultProp:r??"",caller:S}),M=s.useCallback(()=>{window.clearTimeout(w.current),w.current=window.setTimeout(()=>v(""),150)},[v]),E=s.useCallback(x=>{window.clearTimeout(w.current),v(x)},[v]),P=s.useCallback(x=>{f===x?window.clearTimeout(w.current):p.current=window.setTimeout(()=>{window.clearTimeout(w.current),v(x)},c)},[f,v,c]);return s.useEffect(()=>()=>{window.clearTimeout(p.current),window.clearTimeout(w.current),window.clearTimeout(R.current)},[]),n.jsx(ge,{scope:o,isRootMenu:!0,value:f,dir:h,orientation:u,rootNavigationMenu:g,onTriggerEnter:x=>{window.clearTimeout(p.current),T?P(x):E(x)},onTriggerLeave:()=>{window.clearTimeout(p.current),M()},onContentEnter:()=>window.clearTimeout(w.current),onContentLeave:M,onItemSelect:x=>{v(k=>k===x?"":x)},onItemDismiss:()=>v(""),children:n.jsx(_.nav,{"aria-label":"Main","data-orientation":u,dir:h,...d,ref:b})})});fe.displayName=S;var B="NavigationMenuSub",Je=s.forwardRef((e,t)=>{const{__scopeNavigationMenu:o,value:i,onValueChange:a,defaultValue:r,orientation:c="horizontal",...l}=e,u=I(B,o),[N,d]=de({prop:i,onChange:a,defaultProp:r??"",caller:B});return n.jsx(ge,{scope:o,isRootMenu:!1,value:N,dir:u.dir,orientation:c,rootNavigationMenu:u.rootNavigationMenu,onTriggerEnter:g=>d(g),onItemSelect:g=>d(g),onItemDismiss:()=>d(""),children:n.jsx(_.div,{"data-orientation":c,...l,ref:t})})});Je.displayName=B;var ge=e=>{const{scope:t,isRootMenu:o,rootNavigationMenu:i,dir:a,orientation:r,children:c,value:l,onItemSelect:u,onItemDismiss:N,onTriggerEnter:d,onTriggerLeave:g,onContentEnter:C,onContentLeave:b}=e,[h,p]=s.useState(null),[w,R]=s.useState(new Map),[T,m]=s.useState(null);return n.jsx(Ye,{scope:t,isRootMenu:o,rootNavigationMenu:i,value:l,previousValue:ze(l),baseId:le(),dir:a,orientation:r,viewport:h,onViewportChange:p,indicatorTrack:T,onIndicatorTrackChange:m,onTriggerEnter:L(d),onTriggerLeave:L(g),onContentEnter:L(C),onContentLeave:L(b),onItemSelect:L(u),onItemDismiss:L(N),onViewportContentChange:s.useCallback((f,v)=>{R(M=>(M.set(f,v),new Map(M)))},[]),onViewportContentRemove:s.useCallback(f=>{R(v=>v.has(f)?(v.delete(f),new Map(v)):v)},[]),children:n.jsx(X.Provider,{scope:t,children:n.jsx(qe,{scope:t,items:w,children:c})})})},pe="NavigationMenuList",xe=s.forwardRef((e,t)=>{const{__scopeNavigationMenu:o,...i}=e,a=I(pe,o),r=n.jsx(_.ul,{"data-orientation":a.orientation,...i,ref:t});return n.jsx(_.div,{style:{position:"relative"},ref:a.onIndicatorTrackChange,children:n.jsx(X.Slot,{scope:o,children:a.isRootMenu?n.jsx(Ie,{asChild:!0,children:r}):r})})});xe.displayName=pe;var he="NavigationMenuItem",[Qe,Ne]=J(he),we=s.forwardRef((e,t)=>{const{__scopeNavigationMenu:o,value:i,...a}=e,r=le(),c=i||r||"LEGACY_REACT_AUTO_VALUE",l=s.useRef(null),u=s.useRef(null),N=s.useRef(null),d=s.useRef(()=>{}),g=s.useRef(!1),C=s.useCallback((h="start")=>{if(l.current){d.current();const p=W(l.current);p.length&&ee(h==="start"?p:p.reverse())}},[]),b=s.useCallback(()=>{if(l.current){const h=W(l.current);h.length&&(d.current=it(h))}},[]);return n.jsx(Qe,{scope:o,value:c,triggerRef:u,contentRef:l,focusProxyRef:N,wasEscapeCloseRef:g,onEntryKeyDown:C,onFocusProxyEnter:C,onRootContentClose:b,onContentFocusOutside:b,children:n.jsx(_.li,{...a,ref:t})})});we.displayName=he;var H="NavigationMenuTrigger",Me=s.forwardRef((e,t)=>{const{__scopeNavigationMenu:o,disabled:i,...a}=e,r=I(H,e.__scopeNavigationMenu),c=Ne(H,e.__scopeNavigationMenu),l=s.useRef(null),u=O(l,c.triggerRef,t),N=Te(r.baseId,c.value),d=je(r.baseId,c.value),g=s.useRef(!1),C=s.useRef(!1),b=c.value===r.value;return n.jsxs(n.Fragment,{children:[n.jsx(X.ItemSlot,{scope:o,value:c.value,children:n.jsx(_e,{asChild:!0,children:n.jsx(_.button,{id:N,disabled:i,"data-disabled":i?"":void 0,"data-state":te(b),"aria-expanded":b,"aria-controls":d,...a,ref:u,onPointerEnter:y(e.onPointerEnter,()=>{C.current=!1,c.wasEscapeCloseRef.current=!1}),onPointerMove:y(e.onPointerMove,V(()=>{i||C.current||c.wasEscapeCloseRef.current||g.current||(r.onTriggerEnter(c.value),g.current=!0)})),onPointerLeave:y(e.onPointerLeave,V(()=>{i||(r.onTriggerLeave(),g.current=!1)})),onClick:y(e.onClick,()=>{r.onItemSelect(c.value),C.current=b}),onKeyDown:y(e.onKeyDown,h=>{const w={horizontal:"ArrowDown",vertical:r.dir==="rtl"?"ArrowLeft":"ArrowRight"}[r.orientation];b&&h.key===w&&(c.onEntryKeyDown(),h.preventDefault())})})})}),b&&n.jsxs(n.Fragment,{children:[n.jsx($e,{"aria-hidden":!0,tabIndex:0,ref:c.focusProxyRef,onFocus:h=>{const p=c.contentRef.current,w=h.relatedTarget,R=w===l.current,T=p==null?void 0:p.contains(w);(R||!T)&&c.onFocusProxyEnter(R?"start":"end")}}),r.viewport&&n.jsx("span",{"aria-owns":d})]})]})});Me.displayName=H;var Ze="NavigationMenuLink",ie="navigationMenu.linkSelect",Ce=s.forwardRef((e,t)=>{const{__scopeNavigationMenu:o,active:i,onSelect:a,...r}=e;return n.jsx(_e,{asChild:!0,children:n.jsx(_.a,{"data-active":i?"":void 0,"aria-current":i?"page":void 0,...r,ref:t,onClick:y(e.onClick,c=>{const l=c.target,u=new CustomEvent(ie,{bubbles:!0,cancelable:!0});if(l.addEventListener(ie,N=>a==null?void 0:a(N),{once:!0}),ae(l,u),!u.defaultPrevented&&!c.metaKey){const N=new CustomEvent(K,{bubbles:!0,cancelable:!0});ae(l,N)}},{checkForDefaultPrevented:!1})})})});Ce.displayName=Ze;var Q="NavigationMenuIndicator",be=s.forwardRef((e,t)=>{const{forceMount:o,...i}=e,a=I(Q,e.__scopeNavigationMenu),r=!!a.value;return a.indicatorTrack?Ae.createPortal(n.jsx(z,{present:o||r,children:n.jsx(et,{...i,ref:t})}),a.indicatorTrack):null});be.displayName=Q;var et=s.forwardRef((e,t)=>{const{__scopeNavigationMenu:o,...i}=e,a=I(Q,o),r=me(o),[c,l]=s.useState(null),[u,N]=s.useState(null),d=a.orientation==="horizontal",g=!!a.value;s.useEffect(()=>{var p;const h=(p=r().find(w=>w.value===a.value))==null?void 0:p.ref.current;h&&l(h)},[r,a.value]);const C=()=>{c&&N({size:d?c.offsetWidth:c.offsetHeight,offset:d?c.offsetLeft:c.offsetTop})};return Y(c,C),Y(a.indicatorTrack,C),u?n.jsx(_.div,{"aria-hidden":!0,"data-state":g?"visible":"hidden","data-orientation":a.orientation,...i,ref:t,style:{position:"absolute",...d?{left:0,width:u.size+"px",transform:`translateX(${u.offset}px)`}:{top:0,height:u.size+"px",transform:`translateY(${u.offset}px)`},...i.style}}):null}),A="NavigationMenuContent",Re=s.forwardRef((e,t)=>{const{forceMount:o,...i}=e,a=I(A,e.__scopeNavigationMenu),r=Ne(A,e.__scopeNavigationMenu),c=O(r.contentRef,t),l=r.value===a.value,u={value:r.value,triggerRef:r.triggerRef,focusProxyRef:r.focusProxyRef,wasEscapeCloseRef:r.wasEscapeCloseRef,onContentFocusOutside:r.onContentFocusOutside,onRootContentClose:r.onRootContentClose,...i};return a.viewport?n.jsx(tt,{forceMount:o,...u,ref:c}):n.jsx(z,{present:o||l,children:n.jsx(ye,{"data-state":te(l),...u,ref:c,onPointerEnter:y(e.onPointerEnter,a.onContentEnter),onPointerLeave:y(e.onPointerLeave,V(a.onContentLeave)),style:{pointerEvents:!l&&a.isRootMenu?"none":void 0,...u.style}})})});Re.displayName=A;var tt=s.forwardRef((e,t)=>{const o=I(A,e.__scopeNavigationMenu),{onViewportContentChange:i,onViewportContentRemove:a}=o;return G(()=>{i(e.value,{ref:t,...e})},[e,t,i]),G(()=>()=>a(e.value),[e.value,a]),null}),K="navigationMenu.rootContentDismiss",ye=s.forwardRef((e,t)=>{const{__scopeNavigationMenu:o,value:i,triggerRef:a,focusProxyRef:r,wasEscapeCloseRef:c,onRootContentClose:l,onContentFocusOutside:u,...N}=e,d=I(A,o),g=s.useRef(null),C=O(g,t),b=Te(d.baseId,i),h=je(d.baseId,i),p=me(o),w=s.useRef(null),{onItemDismiss:R}=d;s.useEffect(()=>{const m=g.current;if(d.isRootMenu&&m){const f=()=>{var v;R(),l(),m.contains(document.activeElement)&&((v=a.current)==null||v.focus())};return m.addEventListener(K,f),()=>m.removeEventListener(K,f)}},[d.isRootMenu,e.value,a,R,l]);const T=s.useMemo(()=>{const f=p().map(k=>k.value);d.dir==="rtl"&&f.reverse();const v=f.indexOf(d.value),M=f.indexOf(d.previousValue),E=i===d.value,P=M===f.indexOf(i);if(!E&&!P)return w.current;const x=(()=>{if(v!==M){if(E&&M!==-1)return v>M?"from-end":"from-start";if(P&&v!==-1)return v>M?"to-start":"to-end"}return null})();return w.current=x,x},[d.previousValue,d.value,d.dir,p,i]);return n.jsx(Ie,{asChild:!0,children:n.jsx(Ve,{id:h,"aria-labelledby":b,"data-motion":T,"data-orientation":d.orientation,...N,ref:C,disableOutsidePointerEvents:!1,onDismiss:()=>{var f;const m=new Event(K,{bubbles:!0,cancelable:!0});(f=g.current)==null||f.dispatchEvent(m)},onFocusOutside:y(e.onFocusOutside,m=>{var v;u();const f=m.target;(v=d.rootNavigationMenu)!=null&&v.contains(f)&&m.preventDefault()}),onPointerDownOutside:y(e.onPointerDownOutside,m=>{var E;const f=m.target,v=p().some(P=>{var x;return(x=P.ref.current)==null?void 0:x.contains(f)}),M=d.isRootMenu&&((E=d.viewport)==null?void 0:E.contains(f));(v||M||!d.isRootMenu)&&m.preventDefault()}),onKeyDown:y(e.onKeyDown,m=>{var M;const f=m.altKey||m.ctrlKey||m.metaKey;if(m.key==="Tab"&&!f){const E=W(m.currentTarget),P=document.activeElement,x=E.findIndex(De=>De===P),$=m.shiftKey?E.slice(0,x).reverse():E.slice(x+1,E.length);ee($)?m.preventDefault():(M=r.current)==null||M.focus()}}),onEscapeKeyDown:y(e.onEscapeKeyDown,m=>{c.current=!0})})})}),Z="NavigationMenuViewport",Ee=s.forwardRef((e,t)=>{const{forceMount:o,...i}=e,r=!!I(Z,e.__scopeNavigationMenu).value;return n.jsx(z,{present:o||r,children:n.jsx(nt,{...i,ref:t})})});Ee.displayName=Z;var nt=s.forwardRef((e,t)=>{const{__scopeNavigationMenu:o,children:i,...a}=e,r=I(Z,o),c=O(t,r.onViewportChange),l=Xe(A,e.__scopeNavigationMenu),[u,N]=s.useState(null),[d,g]=s.useState(null),C=u?(u==null?void 0:u.width)+"px":void 0,b=u?(u==null?void 0:u.height)+"px":void 0,h=!!r.value,p=h?r.value:r.previousValue;return Y(d,()=>{d&&N({width:d.offsetWidth,height:d.offsetHeight})}),n.jsx(_.div,{"data-state":te(h),"data-orientation":r.orientation,...a,ref:c,style:{pointerEvents:!h&&r.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":C,"--radix-navigation-menu-viewport-height":b,...a.style},onPointerEnter:y(e.onPointerEnter,r.onContentEnter),onPointerLeave:y(e.onPointerLeave,V(r.onContentLeave)),children:Array.from(l.items).map(([R,{ref:T,forceMount:m,...f}])=>{const v=p===R;return n.jsx(z,{present:m||v,children:n.jsx(ye,{...f,ref:Fe(T,M=>{v&&M&&g(M)})})},R)})})}),ot="FocusGroup",Ie=s.forwardRef((e,t)=>{const{__scopeNavigationMenu:o,...i}=e,a=I(ot,o);return n.jsx(U.Provider,{scope:o,children:n.jsx(U.Slot,{scope:o,children:n.jsx(_.div,{dir:a.dir,...i,ref:t})})})}),re=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],at="FocusGroupItem",_e=s.forwardRef((e,t)=>{const{__scopeNavigationMenu:o,...i}=e,a=He(o),r=I(at,o);return n.jsx(U.ItemSlot,{scope:o,children:n.jsx(_.button,{...i,ref:t,onKeyDown:y(e.onKeyDown,c=>{if(["Home","End",...re].includes(c.key)){let u=a().map(g=>g.ref.current);if([r.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(c.key)&&u.reverse(),re.includes(c.key)){const g=u.indexOf(c.currentTarget);u=u.slice(g+1)}setTimeout(()=>ee(u)),c.preventDefault()}})})})});function W(e){const t=[],o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const a=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||a?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;o.nextNode();)t.push(o.currentNode);return t}function ee(e){const t=document.activeElement;return e.some(o=>o===t?!0:(o.focus(),document.activeElement!==t))}function it(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const o=t.dataset.tabindex;t.setAttribute("tabindex",o)})}}function Y(e,t){const o=L(t);G(()=>{let i=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(i),i=window.requestAnimationFrame(o)});return a.observe(e),()=>{window.cancelAnimationFrame(i),a.unobserve(e)}}},[e,o])}function te(e){return e?"open":"closed"}function Te(e,t){return`${e}-trigger-${t}`}function je(e,t){return`${e}-content-${t}`}function V(e){return t=>t.pointerType==="mouse"?e(t):void 0}var rt=fe,st=xe,ct=we,ut=Me,dt=Ce,lt=be,vt=Re,mt=Ee;function ne({className:e,children:t,viewport:o=!0,...i}){return n.jsxs(rt,{"data-slot":"navigation-menu","data-viewport":o,className:j("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",e),...i,children:[t,o&&n.jsx(oe,{})]})}function Pe({className:e,...t}){return n.jsx(st,{"data-slot":"navigation-menu-list",className:j("group flex flex-1 list-none items-center justify-center gap-1",e),...t})}function q({className:e,...t}){return n.jsx(ct,{"data-slot":"navigation-menu-item",className:j("relative",e),...t})}const ft=Ge("group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1");function ke({className:e,children:t,...o}){return n.jsxs(ut,{"data-slot":"navigation-menu-trigger",className:j(ft(),"group",e),...o,children:[t," ",n.jsx(Ue,{className:"relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180","aria-hidden":"true"})]})}function Le({className:e,...t}){return n.jsx(vt,{"data-slot":"navigation-menu-content",className:j("data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto","group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none",e),...t})}function oe({className:e,...t}){return n.jsx("div",{className:j("absolute top-full left-0 isolate z-50 flex justify-center"),children:n.jsx(mt,{"data-slot":"navigation-menu-viewport",className:j("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",e),...t})})}function D({className:e,...t}){return n.jsx(dt,{"data-slot":"navigation-menu-link",className:j("data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",e),...t})}function Se({className:e,...t}){return n.jsx(lt,{"data-slot":"navigation-menu-indicator",className:j("data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden",e),...t,children:n.jsx("div",{className:"bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md"})})}ne.__docgenInfo={description:"",methods:[],displayName:"NavigationMenu",props:{viewport:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}}}};Pe.__docgenInfo={description:"",methods:[],displayName:"NavigationMenuList"};q.__docgenInfo={description:"",methods:[],displayName:"NavigationMenuItem"};Le.__docgenInfo={description:"",methods:[],displayName:"NavigationMenuContent"};ke.__docgenInfo={description:"",methods:[],displayName:"NavigationMenuTrigger"};D.__docgenInfo={description:"",methods:[],displayName:"NavigationMenuLink"};Se.__docgenInfo={description:"",methods:[],displayName:"NavigationMenuIndicator"};oe.__docgenInfo={description:"",methods:[],displayName:"NavigationMenuViewport"};const Kt={title:"Shadcn/UI/NavigationMenu",component:ne},F={render:()=>n.jsxs(ne,{children:[n.jsxs(Pe,{children:[n.jsxs(q,{children:[n.jsx(ke,{children:"Products"}),n.jsx(Le,{children:n.jsxs("div",{className:"grid w-[400px] gap-3 p-3 md:w-[500px] md:grid-cols-2",children:[n.jsx(D,{asChild:!0,children:n.jsx("a",{className:"rounded-md border p-3",href:"https://example.com/analytics",children:"Analytics"})}),n.jsx(D,{asChild:!0,children:n.jsx("a",{className:"rounded-md border p-3",href:"https://example.com/engagement",children:"Engagement"})}),n.jsx(D,{asChild:!0,children:n.jsx("a",{className:"rounded-md border p-3",href:"https://example.com/security",children:"Security"})}),n.jsx(D,{asChild:!0,children:n.jsx("a",{className:"rounded-md border p-3",href:"https://example.com/integrations",children:"Integrations"})})]})})]}),n.jsx(q,{children:n.jsx(D,{href:"https://example.com/pricing",className:"rounded-md px-4 py-2",children:"Pricing"})})]}),n.jsx(Se,{}),n.jsx(oe,{})]})};var se,ce,ue;F.parameters={...F.parameters,docs:{...(se=F.parameters)==null?void 0:se.docs,source:{originalSource:`{
1
+ import{j as n}from"./jsx-runtime-D_zvdyIk.js";import{r as s}from"./iframe-BWjPIle6.js";import{R as Ae}from"./index-C5eJ31Z3.js";import{c as Oe}from"./index-Pk2lGsul.js";import{c as y}from"./index-DW48STyt.js";import{P as _,d as ae}from"./index-04C4iZwC.js";import{u as de}from"./index-7XoYQV2z.js";import{u as O,a as Fe}from"./index-BcAKBHrX.js";import{u as Ke}from"./index-Dr2xmx-F.js";import{P as z}from"./index-CKwUGXmt.js";import{u as le}from"./index-BN5_W3Yi.js";import{c as ve}from"./index-C9xvlw_B.js";import{D as Ve}from"./index-BfKpUbCE.js";import{u as ze}from"./index-Dqw7miiX.js";import{u as G}from"./index-DWC9SV-P.js";import{u as L}from"./index-DschQYGl.js";import{R as $e}from"./index-URSssr5a.js";import{c as Ge}from"./index-CGrAONsN.js";import{c as j}from"./utils-D-KgF5mV.js";import{C as Ue}from"./chevron-down-Bp7zbUB0.js";import"./preload-helper-Dp1pzeXC.js";import"./index-npvyVsxD.js";import"./createLucideIcon-CLBo0iA0.js";var S="NavigationMenu",[X,me,Be]=ve(S),[U,He,We]=ve(S),[J,Ft]=Oe(S,[Be,We]),[Ye,I]=J(S),[qe,Xe]=J(S),fe=s.forwardRef((e,t)=>{const{__scopeNavigationMenu:o,value:i,onValueChange:a,defaultValue:r,delayDuration:c=200,skipDelayDuration:l=300,orientation:u="horizontal",dir:N,...d}=e,[g,C]=s.useState(null),b=O(t,x=>C(x)),h=Ke(N),p=s.useRef(0),w=s.useRef(0),R=s.useRef(0),[T,m]=s.useState(!0),[f,v]=de({prop:i,onChange:x=>{const k=x!=="",$=l>0;k?(window.clearTimeout(R.current),$&&m(!1)):(window.clearTimeout(R.current),R.current=window.setTimeout(()=>m(!0),l)),a==null||a(x)},defaultProp:r??"",caller:S}),M=s.useCallback(()=>{window.clearTimeout(w.current),w.current=window.setTimeout(()=>v(""),150)},[v]),E=s.useCallback(x=>{window.clearTimeout(w.current),v(x)},[v]),P=s.useCallback(x=>{f===x?window.clearTimeout(w.current):p.current=window.setTimeout(()=>{window.clearTimeout(w.current),v(x)},c)},[f,v,c]);return s.useEffect(()=>()=>{window.clearTimeout(p.current),window.clearTimeout(w.current),window.clearTimeout(R.current)},[]),n.jsx(ge,{scope:o,isRootMenu:!0,value:f,dir:h,orientation:u,rootNavigationMenu:g,onTriggerEnter:x=>{window.clearTimeout(p.current),T?P(x):E(x)},onTriggerLeave:()=>{window.clearTimeout(p.current),M()},onContentEnter:()=>window.clearTimeout(w.current),onContentLeave:M,onItemSelect:x=>{v(k=>k===x?"":x)},onItemDismiss:()=>v(""),children:n.jsx(_.nav,{"aria-label":"Main","data-orientation":u,dir:h,...d,ref:b})})});fe.displayName=S;var B="NavigationMenuSub",Je=s.forwardRef((e,t)=>{const{__scopeNavigationMenu:o,value:i,onValueChange:a,defaultValue:r,orientation:c="horizontal",...l}=e,u=I(B,o),[N,d]=de({prop:i,onChange:a,defaultProp:r??"",caller:B});return n.jsx(ge,{scope:o,isRootMenu:!1,value:N,dir:u.dir,orientation:c,rootNavigationMenu:u.rootNavigationMenu,onTriggerEnter:g=>d(g),onItemSelect:g=>d(g),onItemDismiss:()=>d(""),children:n.jsx(_.div,{"data-orientation":c,...l,ref:t})})});Je.displayName=B;var ge=e=>{const{scope:t,isRootMenu:o,rootNavigationMenu:i,dir:a,orientation:r,children:c,value:l,onItemSelect:u,onItemDismiss:N,onTriggerEnter:d,onTriggerLeave:g,onContentEnter:C,onContentLeave:b}=e,[h,p]=s.useState(null),[w,R]=s.useState(new Map),[T,m]=s.useState(null);return n.jsx(Ye,{scope:t,isRootMenu:o,rootNavigationMenu:i,value:l,previousValue:ze(l),baseId:le(),dir:a,orientation:r,viewport:h,onViewportChange:p,indicatorTrack:T,onIndicatorTrackChange:m,onTriggerEnter:L(d),onTriggerLeave:L(g),onContentEnter:L(C),onContentLeave:L(b),onItemSelect:L(u),onItemDismiss:L(N),onViewportContentChange:s.useCallback((f,v)=>{R(M=>(M.set(f,v),new Map(M)))},[]),onViewportContentRemove:s.useCallback(f=>{R(v=>v.has(f)?(v.delete(f),new Map(v)):v)},[]),children:n.jsx(X.Provider,{scope:t,children:n.jsx(qe,{scope:t,items:w,children:c})})})},pe="NavigationMenuList",xe=s.forwardRef((e,t)=>{const{__scopeNavigationMenu:o,...i}=e,a=I(pe,o),r=n.jsx(_.ul,{"data-orientation":a.orientation,...i,ref:t});return n.jsx(_.div,{style:{position:"relative"},ref:a.onIndicatorTrackChange,children:n.jsx(X.Slot,{scope:o,children:a.isRootMenu?n.jsx(Ie,{asChild:!0,children:r}):r})})});xe.displayName=pe;var he="NavigationMenuItem",[Qe,Ne]=J(he),we=s.forwardRef((e,t)=>{const{__scopeNavigationMenu:o,value:i,...a}=e,r=le(),c=i||r||"LEGACY_REACT_AUTO_VALUE",l=s.useRef(null),u=s.useRef(null),N=s.useRef(null),d=s.useRef(()=>{}),g=s.useRef(!1),C=s.useCallback((h="start")=>{if(l.current){d.current();const p=W(l.current);p.length&&ee(h==="start"?p:p.reverse())}},[]),b=s.useCallback(()=>{if(l.current){const h=W(l.current);h.length&&(d.current=it(h))}},[]);return n.jsx(Qe,{scope:o,value:c,triggerRef:u,contentRef:l,focusProxyRef:N,wasEscapeCloseRef:g,onEntryKeyDown:C,onFocusProxyEnter:C,onRootContentClose:b,onContentFocusOutside:b,children:n.jsx(_.li,{...a,ref:t})})});we.displayName=he;var H="NavigationMenuTrigger",Me=s.forwardRef((e,t)=>{const{__scopeNavigationMenu:o,disabled:i,...a}=e,r=I(H,e.__scopeNavigationMenu),c=Ne(H,e.__scopeNavigationMenu),l=s.useRef(null),u=O(l,c.triggerRef,t),N=Te(r.baseId,c.value),d=je(r.baseId,c.value),g=s.useRef(!1),C=s.useRef(!1),b=c.value===r.value;return n.jsxs(n.Fragment,{children:[n.jsx(X.ItemSlot,{scope:o,value:c.value,children:n.jsx(_e,{asChild:!0,children:n.jsx(_.button,{id:N,disabled:i,"data-disabled":i?"":void 0,"data-state":te(b),"aria-expanded":b,"aria-controls":d,...a,ref:u,onPointerEnter:y(e.onPointerEnter,()=>{C.current=!1,c.wasEscapeCloseRef.current=!1}),onPointerMove:y(e.onPointerMove,V(()=>{i||C.current||c.wasEscapeCloseRef.current||g.current||(r.onTriggerEnter(c.value),g.current=!0)})),onPointerLeave:y(e.onPointerLeave,V(()=>{i||(r.onTriggerLeave(),g.current=!1)})),onClick:y(e.onClick,()=>{r.onItemSelect(c.value),C.current=b}),onKeyDown:y(e.onKeyDown,h=>{const w={horizontal:"ArrowDown",vertical:r.dir==="rtl"?"ArrowLeft":"ArrowRight"}[r.orientation];b&&h.key===w&&(c.onEntryKeyDown(),h.preventDefault())})})})}),b&&n.jsxs(n.Fragment,{children:[n.jsx($e,{"aria-hidden":!0,tabIndex:0,ref:c.focusProxyRef,onFocus:h=>{const p=c.contentRef.current,w=h.relatedTarget,R=w===l.current,T=p==null?void 0:p.contains(w);(R||!T)&&c.onFocusProxyEnter(R?"start":"end")}}),r.viewport&&n.jsx("span",{"aria-owns":d})]})]})});Me.displayName=H;var Ze="NavigationMenuLink",ie="navigationMenu.linkSelect",Ce=s.forwardRef((e,t)=>{const{__scopeNavigationMenu:o,active:i,onSelect:a,...r}=e;return n.jsx(_e,{asChild:!0,children:n.jsx(_.a,{"data-active":i?"":void 0,"aria-current":i?"page":void 0,...r,ref:t,onClick:y(e.onClick,c=>{const l=c.target,u=new CustomEvent(ie,{bubbles:!0,cancelable:!0});if(l.addEventListener(ie,N=>a==null?void 0:a(N),{once:!0}),ae(l,u),!u.defaultPrevented&&!c.metaKey){const N=new CustomEvent(K,{bubbles:!0,cancelable:!0});ae(l,N)}},{checkForDefaultPrevented:!1})})})});Ce.displayName=Ze;var Q="NavigationMenuIndicator",be=s.forwardRef((e,t)=>{const{forceMount:o,...i}=e,a=I(Q,e.__scopeNavigationMenu),r=!!a.value;return a.indicatorTrack?Ae.createPortal(n.jsx(z,{present:o||r,children:n.jsx(et,{...i,ref:t})}),a.indicatorTrack):null});be.displayName=Q;var et=s.forwardRef((e,t)=>{const{__scopeNavigationMenu:o,...i}=e,a=I(Q,o),r=me(o),[c,l]=s.useState(null),[u,N]=s.useState(null),d=a.orientation==="horizontal",g=!!a.value;s.useEffect(()=>{var p;const h=(p=r().find(w=>w.value===a.value))==null?void 0:p.ref.current;h&&l(h)},[r,a.value]);const C=()=>{c&&N({size:d?c.offsetWidth:c.offsetHeight,offset:d?c.offsetLeft:c.offsetTop})};return Y(c,C),Y(a.indicatorTrack,C),u?n.jsx(_.div,{"aria-hidden":!0,"data-state":g?"visible":"hidden","data-orientation":a.orientation,...i,ref:t,style:{position:"absolute",...d?{left:0,width:u.size+"px",transform:`translateX(${u.offset}px)`}:{top:0,height:u.size+"px",transform:`translateY(${u.offset}px)`},...i.style}}):null}),A="NavigationMenuContent",Re=s.forwardRef((e,t)=>{const{forceMount:o,...i}=e,a=I(A,e.__scopeNavigationMenu),r=Ne(A,e.__scopeNavigationMenu),c=O(r.contentRef,t),l=r.value===a.value,u={value:r.value,triggerRef:r.triggerRef,focusProxyRef:r.focusProxyRef,wasEscapeCloseRef:r.wasEscapeCloseRef,onContentFocusOutside:r.onContentFocusOutside,onRootContentClose:r.onRootContentClose,...i};return a.viewport?n.jsx(tt,{forceMount:o,...u,ref:c}):n.jsx(z,{present:o||l,children:n.jsx(ye,{"data-state":te(l),...u,ref:c,onPointerEnter:y(e.onPointerEnter,a.onContentEnter),onPointerLeave:y(e.onPointerLeave,V(a.onContentLeave)),style:{pointerEvents:!l&&a.isRootMenu?"none":void 0,...u.style}})})});Re.displayName=A;var tt=s.forwardRef((e,t)=>{const o=I(A,e.__scopeNavigationMenu),{onViewportContentChange:i,onViewportContentRemove:a}=o;return G(()=>{i(e.value,{ref:t,...e})},[e,t,i]),G(()=>()=>a(e.value),[e.value,a]),null}),K="navigationMenu.rootContentDismiss",ye=s.forwardRef((e,t)=>{const{__scopeNavigationMenu:o,value:i,triggerRef:a,focusProxyRef:r,wasEscapeCloseRef:c,onRootContentClose:l,onContentFocusOutside:u,...N}=e,d=I(A,o),g=s.useRef(null),C=O(g,t),b=Te(d.baseId,i),h=je(d.baseId,i),p=me(o),w=s.useRef(null),{onItemDismiss:R}=d;s.useEffect(()=>{const m=g.current;if(d.isRootMenu&&m){const f=()=>{var v;R(),l(),m.contains(document.activeElement)&&((v=a.current)==null||v.focus())};return m.addEventListener(K,f),()=>m.removeEventListener(K,f)}},[d.isRootMenu,e.value,a,R,l]);const T=s.useMemo(()=>{const f=p().map(k=>k.value);d.dir==="rtl"&&f.reverse();const v=f.indexOf(d.value),M=f.indexOf(d.previousValue),E=i===d.value,P=M===f.indexOf(i);if(!E&&!P)return w.current;const x=(()=>{if(v!==M){if(E&&M!==-1)return v>M?"from-end":"from-start";if(P&&v!==-1)return v>M?"to-start":"to-end"}return null})();return w.current=x,x},[d.previousValue,d.value,d.dir,p,i]);return n.jsx(Ie,{asChild:!0,children:n.jsx(Ve,{id:h,"aria-labelledby":b,"data-motion":T,"data-orientation":d.orientation,...N,ref:C,disableOutsidePointerEvents:!1,onDismiss:()=>{var f;const m=new Event(K,{bubbles:!0,cancelable:!0});(f=g.current)==null||f.dispatchEvent(m)},onFocusOutside:y(e.onFocusOutside,m=>{var v;u();const f=m.target;(v=d.rootNavigationMenu)!=null&&v.contains(f)&&m.preventDefault()}),onPointerDownOutside:y(e.onPointerDownOutside,m=>{var E;const f=m.target,v=p().some(P=>{var x;return(x=P.ref.current)==null?void 0:x.contains(f)}),M=d.isRootMenu&&((E=d.viewport)==null?void 0:E.contains(f));(v||M||!d.isRootMenu)&&m.preventDefault()}),onKeyDown:y(e.onKeyDown,m=>{var M;const f=m.altKey||m.ctrlKey||m.metaKey;if(m.key==="Tab"&&!f){const E=W(m.currentTarget),P=document.activeElement,x=E.findIndex(De=>De===P),$=m.shiftKey?E.slice(0,x).reverse():E.slice(x+1,E.length);ee($)?m.preventDefault():(M=r.current)==null||M.focus()}}),onEscapeKeyDown:y(e.onEscapeKeyDown,m=>{c.current=!0})})})}),Z="NavigationMenuViewport",Ee=s.forwardRef((e,t)=>{const{forceMount:o,...i}=e,r=!!I(Z,e.__scopeNavigationMenu).value;return n.jsx(z,{present:o||r,children:n.jsx(nt,{...i,ref:t})})});Ee.displayName=Z;var nt=s.forwardRef((e,t)=>{const{__scopeNavigationMenu:o,children:i,...a}=e,r=I(Z,o),c=O(t,r.onViewportChange),l=Xe(A,e.__scopeNavigationMenu),[u,N]=s.useState(null),[d,g]=s.useState(null),C=u?(u==null?void 0:u.width)+"px":void 0,b=u?(u==null?void 0:u.height)+"px":void 0,h=!!r.value,p=h?r.value:r.previousValue;return Y(d,()=>{d&&N({width:d.offsetWidth,height:d.offsetHeight})}),n.jsx(_.div,{"data-state":te(h),"data-orientation":r.orientation,...a,ref:c,style:{pointerEvents:!h&&r.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":C,"--radix-navigation-menu-viewport-height":b,...a.style},onPointerEnter:y(e.onPointerEnter,r.onContentEnter),onPointerLeave:y(e.onPointerLeave,V(r.onContentLeave)),children:Array.from(l.items).map(([R,{ref:T,forceMount:m,...f}])=>{const v=p===R;return n.jsx(z,{present:m||v,children:n.jsx(ye,{...f,ref:Fe(T,M=>{v&&M&&g(M)})})},R)})})}),ot="FocusGroup",Ie=s.forwardRef((e,t)=>{const{__scopeNavigationMenu:o,...i}=e,a=I(ot,o);return n.jsx(U.Provider,{scope:o,children:n.jsx(U.Slot,{scope:o,children:n.jsx(_.div,{dir:a.dir,...i,ref:t})})})}),re=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],at="FocusGroupItem",_e=s.forwardRef((e,t)=>{const{__scopeNavigationMenu:o,...i}=e,a=He(o),r=I(at,o);return n.jsx(U.ItemSlot,{scope:o,children:n.jsx(_.button,{...i,ref:t,onKeyDown:y(e.onKeyDown,c=>{if(["Home","End",...re].includes(c.key)){let u=a().map(g=>g.ref.current);if([r.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(c.key)&&u.reverse(),re.includes(c.key)){const g=u.indexOf(c.currentTarget);u=u.slice(g+1)}setTimeout(()=>ee(u)),c.preventDefault()}})})})});function W(e){const t=[],o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const a=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||a?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;o.nextNode();)t.push(o.currentNode);return t}function ee(e){const t=document.activeElement;return e.some(o=>o===t?!0:(o.focus(),document.activeElement!==t))}function it(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const o=t.dataset.tabindex;t.setAttribute("tabindex",o)})}}function Y(e,t){const o=L(t);G(()=>{let i=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(i),i=window.requestAnimationFrame(o)});return a.observe(e),()=>{window.cancelAnimationFrame(i),a.unobserve(e)}}},[e,o])}function te(e){return e?"open":"closed"}function Te(e,t){return`${e}-trigger-${t}`}function je(e,t){return`${e}-content-${t}`}function V(e){return t=>t.pointerType==="mouse"?e(t):void 0}var rt=fe,st=xe,ct=we,ut=Me,dt=Ce,lt=be,vt=Re,mt=Ee;function ne({className:e,children:t,viewport:o=!0,...i}){return n.jsxs(rt,{"data-slot":"navigation-menu","data-viewport":o,className:j("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",e),...i,children:[t,o&&n.jsx(oe,{})]})}function Pe({className:e,...t}){return n.jsx(st,{"data-slot":"navigation-menu-list",className:j("group flex flex-1 list-none items-center justify-center gap-1",e),...t})}function q({className:e,...t}){return n.jsx(ct,{"data-slot":"navigation-menu-item",className:j("relative",e),...t})}const ft=Ge("group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1");function ke({className:e,children:t,...o}){return n.jsxs(ut,{"data-slot":"navigation-menu-trigger",className:j(ft(),"group",e),...o,children:[t," ",n.jsx(Ue,{className:"relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180","aria-hidden":"true"})]})}function Le({className:e,...t}){return n.jsx(vt,{"data-slot":"navigation-menu-content",className:j("data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto","group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none",e),...t})}function oe({className:e,...t}){return n.jsx("div",{className:j("absolute top-full left-0 isolate z-50 flex justify-center"),children:n.jsx(mt,{"data-slot":"navigation-menu-viewport",className:j("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",e),...t})})}function D({className:e,...t}){return n.jsx(dt,{"data-slot":"navigation-menu-link",className:j("data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",e),...t})}function Se({className:e,...t}){return n.jsx(lt,{"data-slot":"navigation-menu-indicator",className:j("data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden",e),...t,children:n.jsx("div",{className:"bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md"})})}ne.__docgenInfo={description:"",methods:[],displayName:"NavigationMenu",props:{viewport:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}}}};Pe.__docgenInfo={description:"",methods:[],displayName:"NavigationMenuList"};q.__docgenInfo={description:"",methods:[],displayName:"NavigationMenuItem"};Le.__docgenInfo={description:"",methods:[],displayName:"NavigationMenuContent"};ke.__docgenInfo={description:"",methods:[],displayName:"NavigationMenuTrigger"};D.__docgenInfo={description:"",methods:[],displayName:"NavigationMenuLink"};Se.__docgenInfo={description:"",methods:[],displayName:"NavigationMenuIndicator"};oe.__docgenInfo={description:"",methods:[],displayName:"NavigationMenuViewport"};const Kt={title:"Shadcn/UI/NavigationMenu",component:ne},F={render:()=>n.jsxs(ne,{children:[n.jsxs(Pe,{children:[n.jsxs(q,{children:[n.jsx(ke,{children:"Products"}),n.jsx(Le,{children:n.jsxs("div",{className:"grid w-[400px] gap-3 p-3 md:w-[500px] md:grid-cols-2",children:[n.jsx(D,{asChild:!0,children:n.jsx("a",{className:"rounded-md border p-3",href:"https://example.com/analytics",children:"Analytics"})}),n.jsx(D,{asChild:!0,children:n.jsx("a",{className:"rounded-md border p-3",href:"https://example.com/engagement",children:"Engagement"})}),n.jsx(D,{asChild:!0,children:n.jsx("a",{className:"rounded-md border p-3",href:"https://example.com/security",children:"Security"})}),n.jsx(D,{asChild:!0,children:n.jsx("a",{className:"rounded-md border p-3",href:"https://example.com/integrations",children:"Integrations"})})]})})]}),n.jsx(q,{children:n.jsx(D,{href:"https://example.com/pricing",className:"rounded-md px-4 py-2",children:"Pricing"})})]}),n.jsx(Se,{}),n.jsx(oe,{})]})};var se,ce,ue;F.parameters={...F.parameters,docs:{...(se=F.parameters)==null?void 0:se.docs,source:{originalSource:`{
2
2
  render: () => <NavigationMenu>
3
3
  <NavigationMenuList>
4
4
  <NavigationMenuItem>
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{B as h,b as P}from"./button-BTWmFXop.js";import{D as I,a as B,b as S,d as T,f as z}from"./dropdown-menu-TfFll7G9.js";import{c as o}from"./utils-D-KgF5mV.js";import{P as D,T as M}from"./trash-2-Bt5LMclM.js";import{c as W}from"./createLucideIcon-1ZwIAs_l.js";import{R as A}from"./refresh-cw-FYEbhX1i.js";import{E as O}from"./ellipsis-BSY8VuLI.js";import"./index-1v1lhNFD.js";import"./iframe-G-6sM9Mt.js";import"./preload-helper-Dp1pzeXC.js";import"./index-CGrAONsN.js";import"./index-DW48STyt.js";import"./index-DvM9azdj.js";import"./index-CAwQR9Pv.js";import"./index-I343IfOC.js";import"./index-DqWzLCH-.js";import"./index-_crRFOM5.js";import"./index-CZaD3imo.js";import"./index-CLmN5G1a.js";import"./index-BDwnENHR.js";import"./index-ClNNG_ys.js";import"./index-7yNAGow7.js";import"./index-lH-AZpAn.js";import"./Combination-BT_gXe1L.js";import"./index-DhoByIgc.js";import"./index-CayhpKmv.js";import"./index-ev1RjzGv.js";import"./index-d_S6mtzU.js";import"./index-Bq6UNRVc.js";import"./index-CMmbDm5O.js";import"./check-BgWXKGqi.js";import"./circle-DVJTkDI7.js";import"./chevron-right-DpCIoMaJ.js";/**
1
+ import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{B as h,b as P}from"./button-BObfgcV1.js";import{D as I,a as B,b as S,d as T,f as z}from"./dropdown-menu-BwL9gQwG.js";import{c as o}from"./utils-D-KgF5mV.js";import{P as D,T as M}from"./trash-2-D55eseMQ.js";import{c as W}from"./createLucideIcon-CLBo0iA0.js";import{R as A}from"./refresh-cw-OZakDsFY.js";import{E as O}from"./ellipsis-DPg968Rc.js";import"./index-BcAKBHrX.js";import"./iframe-BWjPIle6.js";import"./preload-helper-Dp1pzeXC.js";import"./index-CGrAONsN.js";import"./index-DW48STyt.js";import"./index-Pk2lGsul.js";import"./index-7XoYQV2z.js";import"./index-DWC9SV-P.js";import"./index-04C4iZwC.js";import"./index-C5eJ31Z3.js";import"./index-npvyVsxD.js";import"./index-DE2OlfDP.js";import"./index-C9xvlw_B.js";import"./index-Dr2xmx-F.js";import"./index-BfKpUbCE.js";import"./index-DschQYGl.js";import"./Combination-CeVus13L.js";import"./index-BN5_W3Yi.js";import"./index-C6O7WofA.js";import"./index-DMk2qc2_.js";import"./index-Cce91yJQ.js";import"./index-CKwUGXmt.js";import"./index-Cw7p-pms.js";import"./check-DyecuwP4.js";import"./circle-CyarsADt.js";import"./chevron-right-oMYqDJ_f.js";/**
2
2
  * @license lucide-react v0.540.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{j as n}from"./jsx-runtime-D_zvdyIk.js";import{c as o}from"./utils-D-KgF5mV.js";import{b as x}from"./button-BTWmFXop.js";import{C as u}from"./chevron-left-BR_0lKnE.js";import{E as j}from"./ellipsis-BSY8VuLI.js";import{C as I}from"./chevron-right-DpCIoMaJ.js";import"./index-1v1lhNFD.js";import"./iframe-G-6sM9Mt.js";import"./preload-helper-Dp1pzeXC.js";import"./index-CGrAONsN.js";import"./createLucideIcon-1ZwIAs_l.js";function r({className:i,...a}){return n.jsx("nav",{role:"navigation","aria-label":"pagination","data-slot":"pagination",className:o("mx-auto flex w-full justify-center",i),...a})}function m({className:i,...a}){return n.jsx("ul",{"data-slot":"pagination-content",className:o("flex flex-row items-center gap-1",i),...a})}function e({...i}){return n.jsx("li",{"data-slot":"pagination-item",...i})}function t({className:i,isActive:a,size:f="icon",...h}){return n.jsx("a",{"aria-current":a?"page":void 0,"data-slot":"pagination-link","data-active":a,className:o(x({variant:a?"outline":"ghost",size:f}),i),...h})}function g({className:i,...a}){return n.jsxs(t,{"aria-label":"Go to previous page",size:"default",className:o("gap-1 px-2.5 sm:pl-2.5",i),...a,children:[n.jsx(u,{}),n.jsx("span",{className:"hidden sm:block",children:"Previous"})]})}function p({className:i,...a}){return n.jsxs(t,{"aria-label":"Go to next page",size:"default",className:o("gap-1 px-2.5 sm:pr-2.5",i),...a,children:[n.jsx("span",{className:"hidden sm:block",children:"Next"}),n.jsx(I,{})]})}function P({className:i,...a}){return n.jsxs("span",{"aria-hidden":!0,"data-slot":"pagination-ellipsis",className:o("flex size-9 items-center justify-center",i),...a,children:[n.jsx(j,{className:"size-4"}),n.jsx("span",{className:"sr-only",children:"More pages"})]})}r.__docgenInfo={description:"",methods:[],displayName:"Pagination"};m.__docgenInfo={description:"",methods:[],displayName:"PaginationContent"};t.__docgenInfo={description:"",methods:[],displayName:"PaginationLink",props:{isActive:{required:!1,tsType:{name:"boolean"},description:""},size:{defaultValue:{value:'"icon"',computed:!1},required:!1}}};e.__docgenInfo={description:"",methods:[],displayName:"PaginationItem"};g.__docgenInfo={description:"",methods:[],displayName:"PaginationPrevious"};p.__docgenInfo={description:"",methods:[],displayName:"PaginationNext"};P.__docgenInfo={description:"",methods:[],displayName:"PaginationEllipsis"};const w={title:"Shadcn/UI/Pagination",component:r},s={render:()=>n.jsx(r,{children:n.jsxs(m,{children:[n.jsx(e,{children:n.jsx(g,{href:"#"})}),n.jsx(e,{children:n.jsx(t,{href:"#",children:"1"})}),n.jsx(e,{children:n.jsx(t,{href:"#",isActive:!0,children:"2"})}),n.jsx(e,{children:n.jsx(t,{href:"#",children:"3"})}),n.jsx(e,{children:n.jsx(P,{})}),n.jsx(e,{children:n.jsx(t,{href:"#",children:"10"})}),n.jsx(e,{children:n.jsx(p,{href:"#"})})]})})};var l,c,d;s.parameters={...s.parameters,docs:{...(l=s.parameters)==null?void 0:l.docs,source:{originalSource:`{
1
+ import{j as n}from"./jsx-runtime-D_zvdyIk.js";import{c as o}from"./utils-D-KgF5mV.js";import{b as x}from"./button-BObfgcV1.js";import{C as u}from"./chevron-left-D1L4J3UW.js";import{E as j}from"./ellipsis-DPg968Rc.js";import{C as I}from"./chevron-right-oMYqDJ_f.js";import"./index-BcAKBHrX.js";import"./iframe-BWjPIle6.js";import"./preload-helper-Dp1pzeXC.js";import"./index-CGrAONsN.js";import"./createLucideIcon-CLBo0iA0.js";function r({className:i,...a}){return n.jsx("nav",{role:"navigation","aria-label":"pagination","data-slot":"pagination",className:o("mx-auto flex w-full justify-center",i),...a})}function m({className:i,...a}){return n.jsx("ul",{"data-slot":"pagination-content",className:o("flex flex-row items-center gap-1",i),...a})}function e({...i}){return n.jsx("li",{"data-slot":"pagination-item",...i})}function t({className:i,isActive:a,size:f="icon",...h}){return n.jsx("a",{"aria-current":a?"page":void 0,"data-slot":"pagination-link","data-active":a,className:o(x({variant:a?"outline":"ghost",size:f}),i),...h})}function g({className:i,...a}){return n.jsxs(t,{"aria-label":"Go to previous page",size:"default",className:o("gap-1 px-2.5 sm:pl-2.5",i),...a,children:[n.jsx(u,{}),n.jsx("span",{className:"hidden sm:block",children:"Previous"})]})}function p({className:i,...a}){return n.jsxs(t,{"aria-label":"Go to next page",size:"default",className:o("gap-1 px-2.5 sm:pr-2.5",i),...a,children:[n.jsx("span",{className:"hidden sm:block",children:"Next"}),n.jsx(I,{})]})}function P({className:i,...a}){return n.jsxs("span",{"aria-hidden":!0,"data-slot":"pagination-ellipsis",className:o("flex size-9 items-center justify-center",i),...a,children:[n.jsx(j,{className:"size-4"}),n.jsx("span",{className:"sr-only",children:"More pages"})]})}r.__docgenInfo={description:"",methods:[],displayName:"Pagination"};m.__docgenInfo={description:"",methods:[],displayName:"PaginationContent"};t.__docgenInfo={description:"",methods:[],displayName:"PaginationLink",props:{isActive:{required:!1,tsType:{name:"boolean"},description:""},size:{defaultValue:{value:'"icon"',computed:!1},required:!1}}};e.__docgenInfo={description:"",methods:[],displayName:"PaginationItem"};g.__docgenInfo={description:"",methods:[],displayName:"PaginationPrevious"};p.__docgenInfo={description:"",methods:[],displayName:"PaginationNext"};P.__docgenInfo={description:"",methods:[],displayName:"PaginationEllipsis"};const w={title:"Shadcn/UI/Pagination",component:r},s={render:()=>n.jsx(r,{children:n.jsxs(m,{children:[n.jsx(e,{children:n.jsx(g,{href:"#"})}),n.jsx(e,{children:n.jsx(t,{href:"#",children:"1"})}),n.jsx(e,{children:n.jsx(t,{href:"#",isActive:!0,children:"2"})}),n.jsx(e,{children:n.jsx(t,{href:"#",children:"3"})}),n.jsx(e,{children:n.jsx(P,{})}),n.jsx(e,{children:n.jsx(t,{href:"#",children:"10"})}),n.jsx(e,{children:n.jsx(p,{href:"#"})})]})})};var l,c,d;s.parameters={...s.parameters,docs:{...(l=s.parameters)==null?void 0:l.docs,source:{originalSource:`{
2
2
  render: () => <Pagination>
3
3
  <PaginationContent>
4
4
  <PaginationItem>
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{r as v}from"./iframe-G-6sM9Mt.js";import{P as t,a as l,b as u}from"./popover-DW1K4QCO.js";import{B as h}from"./button-BTWmFXop.js";import"./preload-helper-Dp1pzeXC.js";import"./index-DW48STyt.js";import"./index-1v1lhNFD.js";import"./index-DvM9azdj.js";import"./index-7yNAGow7.js";import"./index-DqWzLCH-.js";import"./index-_crRFOM5.js";import"./index-CZaD3imo.js";import"./index-lH-AZpAn.js";import"./Combination-BT_gXe1L.js";import"./index-DhoByIgc.js";import"./index-I343IfOC.js";import"./index-CayhpKmv.js";import"./index-ev1RjzGv.js";import"./index-d_S6mtzU.js";import"./index-Bq6UNRVc.js";import"./index-CAwQR9Pv.js";import"./utils-D-KgF5mV.js";import"./index-CGrAONsN.js";const G={title:"Shadcn/UI/Popover",component:t},o={render:()=>e.jsxs(t,{children:[e.jsx(l,{asChild:!0,children:e.jsx(h,{variant:"outline",children:"Open popover"})}),e.jsx(u,{className:"w-64",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium leading-none",children:"Dimensions"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Set the dimensions for the layer."})]})})]})};function f(){const[n,s]=v.useState(!1);return e.jsxs(t,{open:n,onOpenChange:s,children:[e.jsx(l,{asChild:!0,children:e.jsxs(h,{onClick:()=>s(x=>!x),variant:"default",children:[n?"Close":"Open"," popover"]})}),e.jsx(u,{children:"Controlled popover content"})]})}const r={render:()=>e.jsx(f,{})};var i,a,p;o.parameters={...o.parameters,docs:{...(i=o.parameters)==null?void 0:i.docs,source:{originalSource:`{
1
+ import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{r as v}from"./iframe-BWjPIle6.js";import{P as t,a as l,b as u}from"./popover-ClqrrvjL.js";import{B as h}from"./button-BObfgcV1.js";import"./preload-helper-Dp1pzeXC.js";import"./index-DW48STyt.js";import"./index-BcAKBHrX.js";import"./index-Pk2lGsul.js";import"./index-BfKpUbCE.js";import"./index-04C4iZwC.js";import"./index-C5eJ31Z3.js";import"./index-npvyVsxD.js";import"./index-DschQYGl.js";import"./Combination-CeVus13L.js";import"./index-BN5_W3Yi.js";import"./index-DWC9SV-P.js";import"./index-C6O7WofA.js";import"./index-DMk2qc2_.js";import"./index-Cce91yJQ.js";import"./index-CKwUGXmt.js";import"./index-7XoYQV2z.js";import"./utils-D-KgF5mV.js";import"./index-CGrAONsN.js";const G={title:"Shadcn/UI/Popover",component:t},o={render:()=>e.jsxs(t,{children:[e.jsx(l,{asChild:!0,children:e.jsx(h,{variant:"outline",children:"Open popover"})}),e.jsx(u,{className:"w-64",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium leading-none",children:"Dimensions"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Set the dimensions for the layer."})]})})]})};function f(){const[n,s]=v.useState(!1);return e.jsxs(t,{open:n,onOpenChange:s,children:[e.jsx(l,{asChild:!0,children:e.jsxs(h,{onClick:()=>s(x=>!x),variant:"default",children:[n?"Close":"Open"," popover"]})}),e.jsx(u,{children:"Controlled popover content"})]})}const r={render:()=>e.jsx(f,{})};var i,a,p;o.parameters={...o.parameters,docs:{...(i=o.parameters)==null?void 0:i.docs,source:{originalSource:`{
2
2
  render: () => <Popover>
3
3
  <PopoverTrigger asChild>
4
4
  <Button variant="outline">Open popover</Button>
@@ -1,4 +1,4 @@
1
- import{j as o}from"./jsx-runtime-D_zvdyIk.js";import{r as u}from"./iframe-G-6sM9Mt.js";import{c as y}from"./index-DvM9azdj.js";import{P as N}from"./index-DqWzLCH-.js";import{c as S}from"./utils-D-KgF5mV.js";import"./preload-helper-Dp1pzeXC.js";import"./index-_crRFOM5.js";import"./index-CZaD3imo.js";import"./index-1v1lhNFD.js";var c="Progress",m=100,[w,H]=y(c),[R,V]=w(c),h=u.forwardRef((r,e)=>{const{__scopeProgress:t,value:s=null,max:a,getValueLabel:_=D,...$}=r;(a||a===0)&&!f(a)&&console.error(M(`${a}`,"Progress"));const n=f(a)?a:m;s!==null&&!v(s,n)&&console.error(A(`${s}`,"Progress"));const i=v(s,n)?s:null,E=d(i)?_(i,n):void 0;return o.jsx(R,{scope:t,value:i,max:n,children:o.jsx(N.div,{"aria-valuemax":n,"aria-valuemin":0,"aria-valuenow":d(i)?i:void 0,"aria-valuetext":E,role:"progressbar","data-state":j(i,n),"data-value":i??void 0,"data-max":n,...$,ref:e})})});h.displayName=c;var b="ProgressIndicator",I=u.forwardRef((r,e)=>{const{__scopeProgress:t,...s}=r,a=V(b,t);return o.jsx(N.div,{"data-state":j(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...s,ref:e})});I.displayName=b;function D(r,e){return`${Math.round(r/e*100)}%`}function j(r,e){return r==null?"indeterminate":r===e?"complete":"loading"}function d(r){return typeof r=="number"}function f(r){return d(r)&&!isNaN(r)&&r>0}function v(r,e){return d(r)&&!isNaN(r)&&r<=e&&r>=0}function M(r,e){return`Invalid prop \`max\` of value \`${r}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${m}\`.`}function A(r,e){return`Invalid prop \`value\` of value \`${r}\` supplied to \`${e}\`. The \`value\` prop must be:
1
+ import{j as o}from"./jsx-runtime-D_zvdyIk.js";import{r as u}from"./iframe-BWjPIle6.js";import{c as y}from"./index-Pk2lGsul.js";import{P as N}from"./index-04C4iZwC.js";import{c as S}from"./utils-D-KgF5mV.js";import"./preload-helper-Dp1pzeXC.js";import"./index-C5eJ31Z3.js";import"./index-npvyVsxD.js";import"./index-BcAKBHrX.js";var c="Progress",m=100,[w,H]=y(c),[R,V]=w(c),h=u.forwardRef((r,e)=>{const{__scopeProgress:t,value:s=null,max:a,getValueLabel:_=D,...$}=r;(a||a===0)&&!f(a)&&console.error(M(`${a}`,"Progress"));const n=f(a)?a:m;s!==null&&!v(s,n)&&console.error(A(`${s}`,"Progress"));const i=v(s,n)?s:null,E=d(i)?_(i,n):void 0;return o.jsx(R,{scope:t,value:i,max:n,children:o.jsx(N.div,{"aria-valuemax":n,"aria-valuemin":0,"aria-valuenow":d(i)?i:void 0,"aria-valuetext":E,role:"progressbar","data-state":j(i,n),"data-value":i??void 0,"data-max":n,...$,ref:e})})});h.displayName=c;var b="ProgressIndicator",I=u.forwardRef((r,e)=>{const{__scopeProgress:t,...s}=r,a=V(b,t);return o.jsx(N.div,{"data-state":j(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...s,ref:e})});I.displayName=b;function D(r,e){return`${Math.round(r/e*100)}%`}function j(r,e){return r==null?"indeterminate":r===e?"complete":"loading"}function d(r){return typeof r=="number"}function f(r){return d(r)&&!isNaN(r)&&r>0}function v(r,e){return d(r)&&!isNaN(r)&&r<=e&&r>=0}function M(r,e){return`Invalid prop \`max\` of value \`${r}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${m}\`.`}function A(r,e){return`Invalid prop \`value\` of value \`${r}\` supplied to \`${e}\`. The \`value\` prop must be:
2
2
  - a positive number
3
3
  - less than the value passed to \`max\` (or ${m} if no \`max\` prop is set)
4
4
  - \`null\` or \`undefined\` if the progress is indeterminate.