@k3-universe/react-kit 0.0.7 → 0.0.9

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 (359) hide show
  1. package/dist/index.js +2403 -3156
  2. package/dist/kit/builder/data-table/components/DataTable.d.ts +2 -2
  3. package/dist/kit/builder/data-table/components/DataTable.d.ts.map +1 -1
  4. package/package.json +6 -2
  5. package/src/kit/builder/data-table/components/DataTable.tsx +9 -9
  6. package/vite.config.ts +1 -1
  7. package/storybook-static/assets/Accordion.stories-q6yg6wg1.js +0 -52
  8. package/storybook-static/assets/AdminLayout-B9bV4J_6.js +0 -53
  9. package/storybook-static/assets/AdminLayout.Basic.stories-C-ZxuH-O.js +0 -4
  10. package/storybook-static/assets/AdminLayout.Collapsible.stories-xcQzkxio.js +0 -4
  11. package/storybook-static/assets/AdminLayout.Complex.stories-DyjkVpvE.js +0 -29
  12. package/storybook-static/assets/AdminLayout.CustomSidebarHeaderComponent.stories-BqhzWCIA.js +0 -9
  13. package/storybook-static/assets/AdminLayout.CustomSidebarTitleAndIcon.stories-aWxyR67T.js +0 -4
  14. package/storybook-static/assets/AdminLayout.HeaderSlots.stories-dNzhUdDt.js +0 -7
  15. package/storybook-static/assets/Alert.stories-DXwNfJ3w.js +0 -27
  16. package/storybook-static/assets/AlertDialog.stories-I324NsnP.js +0 -43
  17. package/storybook-static/assets/AspectRatio.stories-CghHiX3Z.js +0 -22
  18. package/storybook-static/assets/Autocomplete-B4gV705L.js +0 -35
  19. package/storybook-static/assets/Autocomplete.stories-CyOvjTGN.js +0 -33
  20. package/storybook-static/assets/Avatar.stories-CEF5FVSR.js +0 -12
  21. package/storybook-static/assets/Badge.stories-_-G3GriP.js +0 -12
  22. package/storybook-static/assets/Breadcrumb.stories-DORe9T4b.js +0 -25
  23. package/storybook-static/assets/Button.stories-3nQ6wsBX.js +0 -26
  24. package/storybook-static/assets/Calendar.stories-Dn__djE1.js +0 -3
  25. package/storybook-static/assets/Card.stories-BJcbdwCI.js +0 -15
  26. package/storybook-static/assets/Carousel.stories-CfqbE7Va.js +0 -15
  27. package/storybook-static/assets/Chart.stories-cGgef3tv.js +0 -126
  28. package/storybook-static/assets/Checkbox.stories-BcaxWzCS.js +0 -12
  29. package/storybook-static/assets/Collapsible.stories-CQ95s7Cs.js +0 -18
  30. package/storybook-static/assets/Combination-CeVus13L.js +0 -41
  31. package/storybook-static/assets/Command.stories-DYflJh8u.js +0 -30
  32. package/storybook-static/assets/ContextMenu.stories-CU7ehYrE.js +0 -31
  33. package/storybook-static/assets/DataTable.Basic.stories-BQNWUKiw.js +0 -6
  34. package/storybook-static/assets/DataTable.Filters.stories-DPCoeYhK.js +0 -21
  35. package/storybook-static/assets/DataTable.Pagination.stories-8UNqTNgw.js +0 -24
  36. package/storybook-static/assets/DataTable.SelectionAndActions.stories-CDEjgQ6T.js +0 -26
  37. package/storybook-static/assets/DataTable.Sorting.stories-qG7-X_6r.js +0 -6
  38. package/storybook-static/assets/Dialog.stories-Bu6ZJXNH.js +0 -18
  39. package/storybook-static/assets/Dialog.stories-DobNZ0Hp.js +0 -54
  40. package/storybook-static/assets/Drawer.stories-BN0idp4u.js +0 -24
  41. package/storybook-static/assets/DropdownMenu.stories-sfsVDTvm.js +0 -35
  42. package/storybook-static/assets/Form.Basic.stories-dE4nbgpr.js +0 -45
  43. package/storybook-static/assets/Form.Complex.stories-BEZufnjb.js +0 -230
  44. package/storybook-static/assets/Form.Dynamic.stories-cJTbd6cV.js +0 -247
  45. package/storybook-static/assets/Form.Simple.stories-DOPzZKhh.js +0 -50
  46. package/storybook-static/assets/Form.stories-27doU7JS.js +0 -3
  47. package/storybook-static/assets/FormBuilder-C0S7C69Q.js +0 -5
  48. package/storybook-static/assets/HoverCard.stories-0lted9Zx.js +0 -21
  49. package/storybook-static/assets/Input.stories-CwsIObFs.js +0 -16
  50. package/storybook-static/assets/InputOtp.stories-DVc086h4.js +0 -42
  51. package/storybook-static/assets/Label.stories-bJa0rk1A.js +0 -14
  52. package/storybook-static/assets/Login.stories-C6X6Kj5B.js +0 -37
  53. package/storybook-static/assets/Menubar.stories-CuediVp7.js +0 -44
  54. package/storybook-static/assets/NavigationMenu.stories-CKGZYhKk.js +0 -30
  55. package/storybook-static/assets/Page.stories-Cf76wtRx.js +0 -91
  56. package/storybook-static/assets/Pagination.stories-D7IdL1_4.js +0 -29
  57. package/storybook-static/assets/Popover.stories-1VP_zNY8.js +0 -15
  58. package/storybook-static/assets/Progress.stories-C35R5YvA.js +0 -8
  59. package/storybook-static/assets/RadioGroup.stories-CjuD3CwD.js +0 -16
  60. package/storybook-static/assets/Resizable.stories-Cs8dvdc5.js +0 -25
  61. package/storybook-static/assets/ScrollArea.stories-D6_z-5jm.js +0 -12
  62. package/storybook-static/assets/Section.stories-Ce5qYITI.js +0 -196
  63. package/storybook-static/assets/SectionBuilder-Df_lRZkj.js +0 -1
  64. package/storybook-static/assets/Select.stories-w_kbza5k.js +0 -17
  65. package/storybook-static/assets/Separator.stories-B5QnaJXb.js +0 -17
  66. package/storybook-static/assets/Sheet.stories-CORnEGvV.js +0 -24
  67. package/storybook-static/assets/Sidebar.stories-DVuWTi4j.js +0 -106
  68. package/storybook-static/assets/Skeleton.stories-BQNIuIe5.js +0 -9
  69. package/storybook-static/assets/Slider.stories-YoS2vvT2.js +0 -6
  70. package/storybook-static/assets/Sonner.stories-CXW5e_Qg.js +0 -18
  71. package/storybook-static/assets/Switch.stories-zr6i-aNi.js +0 -3
  72. package/storybook-static/assets/Table.stories-BuGU4MUM.js +0 -35
  73. package/storybook-static/assets/Tabs.stories-jxkJ-AUI.js +0 -10
  74. package/storybook-static/assets/Textarea.stories-CHXVobz6.js +0 -17
  75. package/storybook-static/assets/Toggle.stories-C4uB4Hkq.js +0 -3
  76. package/storybook-static/assets/ToggleGroup.stories-Cr229wf_.js +0 -13
  77. package/storybook-static/assets/Tooltip.stories-DmMYGR3T.js +0 -10
  78. package/storybook-static/assets/accordion-BCfsz_gl.js +0 -1
  79. package/storybook-static/assets/alert-dialog-BYt6Z7Kt.js +0 -7
  80. package/storybook-static/assets/avatar-CRn1qQsC.js +0 -1
  81. package/storybook-static/assets/axe-JCJl60WC.js +0 -30
  82. package/storybook-static/assets/button-BObfgcV1.js +0 -1
  83. package/storybook-static/assets/card-BJpPOzP8.js +0 -1
  84. package/storybook-static/assets/chart-column-CplFCmg8.js +0 -6
  85. package/storybook-static/assets/check-DyecuwP4.js +0 -6
  86. package/storybook-static/assets/checkbox-D5BmNJeL.js +0 -1
  87. package/storybook-static/assets/chevron-down-Bp7zbUB0.js +0 -6
  88. package/storybook-static/assets/chevron-left-D1L4J3UW.js +0 -6
  89. package/storybook-static/assets/chevron-right-oMYqDJ_f.js +0 -6
  90. package/storybook-static/assets/circle-CyarsADt.js +0 -6
  91. package/storybook-static/assets/clean-slate-V4nUw2Bm.css +0 -1
  92. package/storybook-static/assets/command-DCnXmNmT.js +0 -6
  93. package/storybook-static/assets/createLucideIcon-CLBo0iA0.js +0 -21
  94. package/storybook-static/assets/default-CuTBjDca.css +0 -1
  95. package/storybook-static/assets/dependencies-ctrV69dx.js +0 -1
  96. package/storybook-static/assets/dialog-DL0QBIbC.js +0 -1
  97. package/storybook-static/assets/dropdown-menu-BwL9gQwG.js +0 -1
  98. package/storybook-static/assets/ellipsis-DPg968Rc.js +0 -6
  99. package/storybook-static/assets/grip-vertical-CM0GDwvq.js +0 -6
  100. package/storybook-static/assets/iframe-BWjPIle6.js +0 -1555
  101. package/storybook-static/assets/iframe-C9bogcIc.css +0 -1
  102. package/storybook-static/assets/index-04C4iZwC.js +0 -1
  103. package/storybook-static/assets/index-3zykFCgl.js +0 -1
  104. package/storybook-static/assets/index-7XoYQV2z.js +0 -1
  105. package/storybook-static/assets/index-A7UzX-Xw.js +0 -1
  106. package/storybook-static/assets/index-BN5_W3Yi.js +0 -1
  107. package/storybook-static/assets/index-BcAKBHrX.js +0 -1
  108. package/storybook-static/assets/index-BdQq_4o_.js +0 -1
  109. package/storybook-static/assets/index-BfKpUbCE.js +0 -1
  110. package/storybook-static/assets/index-C5eJ31Z3.js +0 -1
  111. package/storybook-static/assets/index-C6O7WofA.js +0 -1
  112. package/storybook-static/assets/index-C9xvlw_B.js +0 -1
  113. package/storybook-static/assets/index-CGrAONsN.js +0 -1
  114. package/storybook-static/assets/index-CKwUGXmt.js +0 -1
  115. package/storybook-static/assets/index-Cce91yJQ.js +0 -1
  116. package/storybook-static/assets/index-Cw7p-pms.js +0 -1
  117. package/storybook-static/assets/index-DE2OlfDP.js +0 -1
  118. package/storybook-static/assets/index-DMk2qc2_.js +0 -1
  119. package/storybook-static/assets/index-DW48STyt.js +0 -1
  120. package/storybook-static/assets/index-DWC9SV-P.js +0 -1
  121. package/storybook-static/assets/index-Dqw7miiX.js +0 -1
  122. package/storybook-static/assets/index-Dr2xmx-F.js +0 -1
  123. package/storybook-static/assets/index-DschQYGl.js +0 -1
  124. package/storybook-static/assets/index-Dsg7S8zu.js +0 -9
  125. package/storybook-static/assets/index-Pk2lGsul.js +0 -1
  126. package/storybook-static/assets/index-URSssr5a.js +0 -1
  127. package/storybook-static/assets/index-npvyVsxD.js +0 -9
  128. package/storybook-static/assets/index-u70nzfOV.js +0 -5
  129. package/storybook-static/assets/input-11YRd9gD.js +0 -1
  130. package/storybook-static/assets/jsx-runtime-D_zvdyIk.js +0 -9
  131. package/storybook-static/assets/label-CwntpYJ0.js +0 -1
  132. package/storybook-static/assets/lodash-BkmSIg_J.js +0 -73
  133. package/storybook-static/assets/matchers-7Z3WT2CE-T3xScrR7.js +0 -14
  134. package/storybook-static/assets/minimal-modern-d2yFlFJM.css +0 -1
  135. package/storybook-static/assets/popover-ClqrrvjL.js +0 -1
  136. package/storybook-static/assets/preload-helper-Dp1pzeXC.js +0 -1
  137. package/storybook-static/assets/radio-group-CvN0LQZp.js +0 -1
  138. package/storybook-static/assets/react-18-Bj31y5Nr.js +0 -25
  139. package/storybook-static/assets/react-icons.esm-DNr9VcvP.js +0 -1
  140. package/storybook-static/assets/refresh-cw-OZakDsFY.js +0 -6
  141. package/storybook-static/assets/schemas-CaLvKjsI.js +0 -18
  142. package/storybook-static/assets/section-factories-DKfKL-5s.js +0 -1
  143. package/storybook-static/assets/select-gtXRB92c.js +0 -6
  144. package/storybook-static/assets/separator-CxCWfpZX.js +0 -1
  145. package/storybook-static/assets/settings-2-DSSkfF6W.js +0 -6
  146. package/storybook-static/assets/sheet-r0VNiBiN.js +0 -1
  147. package/storybook-static/assets/shopping-cart-CJBClF2m.js +0 -11
  148. package/storybook-static/assets/sidebar-BsMnOE7Y.js +0 -6
  149. package/storybook-static/assets/skeleton-CjDnQs43.js +0 -1
  150. package/storybook-static/assets/spotify-BuPUgQEa.css +0 -1
  151. package/storybook-static/assets/table-CP3vMqFn.js +0 -1
  152. package/storybook-static/assets/textarea-Dw2vruMl.js +0 -1
  153. package/storybook-static/assets/toggle-D08-8sQA.js +0 -16
  154. package/storybook-static/assets/tooltip-CZ1UAE_e.js +0 -1
  155. package/storybook-static/assets/trash-2-D55eseMQ.js +0 -11
  156. package/storybook-static/assets/utils-D-KgF5mV.js +0 -1
  157. package/storybook-static/assets/x-n8sFtlI2.js +0 -6
  158. package/storybook-static/favicon-wrapper.svg +0 -46
  159. package/storybook-static/favicon.svg +0 -1
  160. package/storybook-static/iframe.html +0 -687
  161. package/storybook-static/index.d.ts +0 -64
  162. package/storybook-static/index.d.ts.map +0 -1
  163. package/storybook-static/index.html +0 -166
  164. package/storybook-static/index.json +0 -1
  165. package/storybook-static/kit/builder/data-table/components/DataTable.d.ts +0 -34
  166. package/storybook-static/kit/builder/data-table/components/DataTable.d.ts.map +0 -1
  167. package/storybook-static/kit/builder/data-table/components/DataTableColumnHeader.d.ts +0 -8
  168. package/storybook-static/kit/builder/data-table/components/DataTableColumnHeader.d.ts.map +0 -1
  169. package/storybook-static/kit/builder/data-table/components/DataTablePagination.d.ts +0 -6
  170. package/storybook-static/kit/builder/data-table/components/DataTablePagination.d.ts.map +0 -1
  171. package/storybook-static/kit/builder/data-table/components/DataTableViewOptions.d.ts +0 -5
  172. package/storybook-static/kit/builder/data-table/components/DataTableViewOptions.d.ts.map +0 -1
  173. package/storybook-static/kit/builder/data-table/index.d.ts +0 -6
  174. package/storybook-static/kit/builder/data-table/index.d.ts.map +0 -1
  175. package/storybook-static/kit/builder/data-table/types.d.ts +0 -27
  176. package/storybook-static/kit/builder/data-table/types.d.ts.map +0 -1
  177. package/storybook-static/kit/builder/data-table/utils/dotAccessor.d.ts +0 -2
  178. package/storybook-static/kit/builder/data-table/utils/dotAccessor.d.ts.map +0 -1
  179. package/storybook-static/kit/builder/dialog/index.d.ts +0 -3
  180. package/storybook-static/kit/builder/dialog/index.d.ts.map +0 -1
  181. package/storybook-static/kit/builder/dialog/provider.d.ts +0 -26
  182. package/storybook-static/kit/builder/dialog/provider.d.ts.map +0 -1
  183. package/storybook-static/kit/builder/form/components/FormBuilder.d.ts +0 -97
  184. package/storybook-static/kit/builder/form/components/FormBuilder.d.ts.map +0 -1
  185. package/storybook-static/kit/builder/form/components/FormBuilderActions.d.ts +0 -20
  186. package/storybook-static/kit/builder/form/components/FormBuilderActions.d.ts.map +0 -1
  187. package/storybook-static/kit/builder/form/components/FormBuilderField.d.ts +0 -12
  188. package/storybook-static/kit/builder/form/components/FormBuilderField.d.ts.map +0 -1
  189. package/storybook-static/kit/builder/form/components/index.d.ts +0 -4
  190. package/storybook-static/kit/builder/form/components/index.d.ts.map +0 -1
  191. package/storybook-static/kit/builder/form/index.d.ts +0 -3
  192. package/storybook-static/kit/builder/form/index.d.ts.map +0 -1
  193. package/storybook-static/kit/builder/form/utils/common-forms.d.ts +0 -7
  194. package/storybook-static/kit/builder/form/utils/common-forms.d.ts.map +0 -1
  195. package/storybook-static/kit/builder/form/utils/dependencies.d.ts +0 -41
  196. package/storybook-static/kit/builder/form/utils/dependencies.d.ts.map +0 -1
  197. package/storybook-static/kit/builder/form/utils/field-factories.d.ts +0 -22
  198. package/storybook-static/kit/builder/form/utils/field-factories.d.ts.map +0 -1
  199. package/storybook-static/kit/builder/form/utils/index.d.ts +0 -15
  200. package/storybook-static/kit/builder/form/utils/index.d.ts.map +0 -1
  201. package/storybook-static/kit/builder/form/utils/section-factories.d.ts +0 -7
  202. package/storybook-static/kit/builder/form/utils/section-factories.d.ts.map +0 -1
  203. package/storybook-static/kit/builder/form/utils/transformers.d.ts +0 -6
  204. package/storybook-static/kit/builder/form/utils/transformers.d.ts.map +0 -1
  205. package/storybook-static/kit/builder/form/utils/validations.d.ts +0 -13
  206. package/storybook-static/kit/builder/form/utils/validations.d.ts.map +0 -1
  207. package/storybook-static/kit/builder/form/utils/validators.d.ts +0 -8
  208. package/storybook-static/kit/builder/form/utils/validators.d.ts.map +0 -1
  209. package/storybook-static/kit/builder/page/Page.d.ts +0 -48
  210. package/storybook-static/kit/builder/page/Page.d.ts.map +0 -1
  211. package/storybook-static/kit/builder/page/index.d.ts +0 -2
  212. package/storybook-static/kit/builder/page/index.d.ts.map +0 -1
  213. package/storybook-static/kit/builder/section/SectionBuilder.d.ts +0 -3
  214. package/storybook-static/kit/builder/section/SectionBuilder.d.ts.map +0 -1
  215. package/storybook-static/kit/builder/section/index.d.ts +0 -3
  216. package/storybook-static/kit/builder/section/index.d.ts.map +0 -1
  217. package/storybook-static/kit/builder/section/types.d.ts +0 -59
  218. package/storybook-static/kit/builder/section/types.d.ts.map +0 -1
  219. package/storybook-static/kit/components/autocomplete/Autocomplete.d.ts +0 -21
  220. package/storybook-static/kit/components/autocomplete/Autocomplete.d.ts.map +0 -1
  221. package/storybook-static/kit/components/autocomplete/index.d.ts +0 -3
  222. package/storybook-static/kit/components/autocomplete/index.d.ts.map +0 -1
  223. package/storybook-static/kit/components/autocomplete/types.d.ts +0 -19
  224. package/storybook-static/kit/components/autocomplete/types.d.ts.map +0 -1
  225. package/storybook-static/kit/components/login/Login.d.ts +0 -29
  226. package/storybook-static/kit/components/login/Login.d.ts.map +0 -1
  227. package/storybook-static/kit/components/login/index.d.ts +0 -2
  228. package/storybook-static/kit/components/login/index.d.ts.map +0 -1
  229. package/storybook-static/kit/layouts/admin/components/AdminLayout.d.ts +0 -17
  230. package/storybook-static/kit/layouts/admin/components/AdminLayout.d.ts.map +0 -1
  231. package/storybook-static/kit/layouts/admin/components/ThemeToggle.d.ts +0 -5
  232. package/storybook-static/kit/layouts/admin/components/ThemeToggle.d.ts.map +0 -1
  233. package/storybook-static/kit/layouts/admin/hooks/menu.d.ts +0 -12
  234. package/storybook-static/kit/layouts/admin/hooks/menu.d.ts.map +0 -1
  235. package/storybook-static/kit/layouts/admin/providers/AdminMenuProvider.d.ts +0 -7
  236. package/storybook-static/kit/layouts/admin/providers/AdminMenuProvider.d.ts.map +0 -1
  237. package/storybook-static/kit/layouts/admin/types/index.d.ts +0 -27
  238. package/storybook-static/kit/layouts/admin/types/index.d.ts.map +0 -1
  239. package/storybook-static/kit/providers/ThemeProvider.d.ts +0 -14
  240. package/storybook-static/kit/providers/ThemeProvider.d.ts.map +0 -1
  241. package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
  242. package/storybook-static/nunito-sans-bold.woff2 +0 -0
  243. package/storybook-static/nunito-sans-italic.woff2 +0 -0
  244. package/storybook-static/nunito-sans-regular.woff2 +0 -0
  245. package/storybook-static/project.json +0 -1
  246. package/storybook-static/sb-addons/a11y-5/manager-bundle.js +0 -5
  247. package/storybook-static/sb-addons/essentials-backgrounds-1/manager-bundle.js +0 -3
  248. package/storybook-static/sb-addons/essentials-measure-2/manager-bundle.js +0 -3
  249. package/storybook-static/sb-addons/essentials-outline-3/manager-bundle.js +0 -3
  250. package/storybook-static/sb-addons/interactions-4/manager-bundle.js +0 -57
  251. package/storybook-static/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +0 -971
  252. package/storybook-static/sb-addons/storysource-6/manager-bundle.js +0 -3
  253. package/storybook-static/sb-common-assets/favicon-wrapper.svg +0 -46
  254. package/storybook-static/sb-common-assets/favicon.svg +0 -1
  255. package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
  256. package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
  257. package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
  258. package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
  259. package/storybook-static/sb-manager/globals-module-info.js +0 -797
  260. package/storybook-static/sb-manager/globals-runtime.js +0 -69653
  261. package/storybook-static/sb-manager/globals.js +0 -34
  262. package/storybook-static/sb-manager/runtime.js +0 -13181
  263. package/storybook-static/shadcn/hooks/use-mobile.d.ts +0 -2
  264. package/storybook-static/shadcn/hooks/use-mobile.d.ts.map +0 -1
  265. package/storybook-static/shadcn/lib/utils.d.ts +0 -3
  266. package/storybook-static/shadcn/lib/utils.d.ts.map +0 -1
  267. package/storybook-static/shadcn/ui/accordion.d.ts +0 -8
  268. package/storybook-static/shadcn/ui/accordion.d.ts.map +0 -1
  269. package/storybook-static/shadcn/ui/alert-dialog.d.ts +0 -15
  270. package/storybook-static/shadcn/ui/alert-dialog.d.ts.map +0 -1
  271. package/storybook-static/shadcn/ui/alert.d.ts +0 -10
  272. package/storybook-static/shadcn/ui/alert.d.ts.map +0 -1
  273. package/storybook-static/shadcn/ui/aspect-ratio.d.ts +0 -4
  274. package/storybook-static/shadcn/ui/aspect-ratio.d.ts.map +0 -1
  275. package/storybook-static/shadcn/ui/avatar.d.ts +0 -7
  276. package/storybook-static/shadcn/ui/avatar.d.ts.map +0 -1
  277. package/storybook-static/shadcn/ui/badge.d.ts +0 -10
  278. package/storybook-static/shadcn/ui/badge.d.ts.map +0 -1
  279. package/storybook-static/shadcn/ui/breadcrumb.d.ts +0 -12
  280. package/storybook-static/shadcn/ui/breadcrumb.d.ts.map +0 -1
  281. package/storybook-static/shadcn/ui/button.d.ts +0 -11
  282. package/storybook-static/shadcn/ui/button.d.ts.map +0 -1
  283. package/storybook-static/shadcn/ui/calendar.d.ts +0 -9
  284. package/storybook-static/shadcn/ui/calendar.d.ts.map +0 -1
  285. package/storybook-static/shadcn/ui/card.d.ts +0 -10
  286. package/storybook-static/shadcn/ui/card.d.ts.map +0 -1
  287. package/storybook-static/shadcn/ui/carousel.d.ts +0 -20
  288. package/storybook-static/shadcn/ui/carousel.d.ts.map +0 -1
  289. package/storybook-static/shadcn/ui/chart.d.ts +0 -41
  290. package/storybook-static/shadcn/ui/chart.d.ts.map +0 -1
  291. package/storybook-static/shadcn/ui/checkbox.d.ts +0 -5
  292. package/storybook-static/shadcn/ui/checkbox.d.ts.map +0 -1
  293. package/storybook-static/shadcn/ui/collapsible.d.ts +0 -6
  294. package/storybook-static/shadcn/ui/collapsible.d.ts.map +0 -1
  295. package/storybook-static/shadcn/ui/command.d.ts +0 -19
  296. package/storybook-static/shadcn/ui/command.d.ts.map +0 -1
  297. package/storybook-static/shadcn/ui/context-menu.d.ts +0 -26
  298. package/storybook-static/shadcn/ui/context-menu.d.ts.map +0 -1
  299. package/storybook-static/shadcn/ui/dialog.d.ts +0 -16
  300. package/storybook-static/shadcn/ui/dialog.d.ts.map +0 -1
  301. package/storybook-static/shadcn/ui/drawer.d.ts +0 -14
  302. package/storybook-static/shadcn/ui/drawer.d.ts.map +0 -1
  303. package/storybook-static/shadcn/ui/dropdown-menu.d.ts +0 -26
  304. package/storybook-static/shadcn/ui/dropdown-menu.d.ts.map +0 -1
  305. package/storybook-static/shadcn/ui/form.d.ts +0 -25
  306. package/storybook-static/shadcn/ui/form.d.ts.map +0 -1
  307. package/storybook-static/shadcn/ui/hover-card.d.ts +0 -7
  308. package/storybook-static/shadcn/ui/hover-card.d.ts.map +0 -1
  309. package/storybook-static/shadcn/ui/input-otp.d.ts +0 -12
  310. package/storybook-static/shadcn/ui/input-otp.d.ts.map +0 -1
  311. package/storybook-static/shadcn/ui/input.d.ts +0 -4
  312. package/storybook-static/shadcn/ui/input.d.ts.map +0 -1
  313. package/storybook-static/shadcn/ui/label.d.ts +0 -5
  314. package/storybook-static/shadcn/ui/label.d.ts.map +0 -1
  315. package/storybook-static/shadcn/ui/menubar.d.ts +0 -27
  316. package/storybook-static/shadcn/ui/menubar.d.ts.map +0 -1
  317. package/storybook-static/shadcn/ui/navigation-menu.d.ts +0 -15
  318. package/storybook-static/shadcn/ui/navigation-menu.d.ts.map +0 -1
  319. package/storybook-static/shadcn/ui/pagination.d.ts +0 -14
  320. package/storybook-static/shadcn/ui/pagination.d.ts.map +0 -1
  321. package/storybook-static/shadcn/ui/popover.d.ts +0 -8
  322. package/storybook-static/shadcn/ui/popover.d.ts.map +0 -1
  323. package/storybook-static/shadcn/ui/progress.d.ts +0 -5
  324. package/storybook-static/shadcn/ui/progress.d.ts.map +0 -1
  325. package/storybook-static/shadcn/ui/radio-group.d.ts +0 -6
  326. package/storybook-static/shadcn/ui/radio-group.d.ts.map +0 -1
  327. package/storybook-static/shadcn/ui/resizable.d.ts +0 -9
  328. package/storybook-static/shadcn/ui/resizable.d.ts.map +0 -1
  329. package/storybook-static/shadcn/ui/scroll-area.d.ts +0 -6
  330. package/storybook-static/shadcn/ui/scroll-area.d.ts.map +0 -1
  331. package/storybook-static/shadcn/ui/select.d.ts +0 -16
  332. package/storybook-static/shadcn/ui/select.d.ts.map +0 -1
  333. package/storybook-static/shadcn/ui/separator.d.ts +0 -5
  334. package/storybook-static/shadcn/ui/separator.d.ts.map +0 -1
  335. package/storybook-static/shadcn/ui/sheet.d.ts +0 -14
  336. package/storybook-static/shadcn/ui/sheet.d.ts.map +0 -1
  337. package/storybook-static/shadcn/ui/sidebar.d.ts +0 -70
  338. package/storybook-static/shadcn/ui/sidebar.d.ts.map +0 -1
  339. package/storybook-static/shadcn/ui/skeleton.d.ts +0 -3
  340. package/storybook-static/shadcn/ui/skeleton.d.ts.map +0 -1
  341. package/storybook-static/shadcn/ui/slider.d.ts +0 -5
  342. package/storybook-static/shadcn/ui/slider.d.ts.map +0 -1
  343. package/storybook-static/shadcn/ui/sonner.d.ts +0 -4
  344. package/storybook-static/shadcn/ui/sonner.d.ts.map +0 -1
  345. package/storybook-static/shadcn/ui/switch.d.ts +0 -5
  346. package/storybook-static/shadcn/ui/switch.d.ts.map +0 -1
  347. package/storybook-static/shadcn/ui/table.d.ts +0 -11
  348. package/storybook-static/shadcn/ui/table.d.ts.map +0 -1
  349. package/storybook-static/shadcn/ui/tabs.d.ts +0 -8
  350. package/storybook-static/shadcn/ui/tabs.d.ts.map +0 -1
  351. package/storybook-static/shadcn/ui/textarea.d.ts +0 -4
  352. package/storybook-static/shadcn/ui/textarea.d.ts.map +0 -1
  353. package/storybook-static/shadcn/ui/toggle-group.d.ts +0 -8
  354. package/storybook-static/shadcn/ui/toggle-group.d.ts.map +0 -1
  355. package/storybook-static/shadcn/ui/toggle.d.ts +0 -10
  356. package/storybook-static/shadcn/ui/toggle.d.ts.map +0 -1
  357. package/storybook-static/shadcn/ui/tooltip.d.ts +0 -8
  358. package/storybook-static/shadcn/ui/tooltip.d.ts.map +0 -1
  359. package/storybook-static/vite-inject-mocker-entry.js +0 -18
@@ -1,5 +0,0 @@
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
- name: string,
3
- value: any,
4
- allValues: Record<string, any>
5
- ) => 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:""},submitLabel:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"'Submit'",computed:!1}},cancelLabel:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"'Cancel'",computed:!1}},resetLabel:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"'Reset'",computed:!1}},isSubmitting:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},className:{required:!1,tsType:{name:"string"},description:""},formClassName:{required:!1,tsType:{name:"string"},description:""},actionsClassName:{required:!1,tsType:{name:"string"},description:""},showActions:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}},customActions:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""}}};export{Ve as F};
@@ -1,21 +0,0 @@
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
- render: () => <HoverCard>
3
- <HoverCardTrigger asChild>
4
- <Button variant="link" className="px-0">@shadcn</Button>
5
- </HoverCardTrigger>
6
- <HoverCardContent className="w-80">
7
- <div className="flex space-x-4">
8
- <Avatar>
9
- <AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
10
- <AvatarFallback>SC</AvatarFallback>
11
- </Avatar>
12
- <div className="space-y-1">
13
- <h4 className="text-sm font-semibold">shadcn</h4>
14
- <p className="text-sm text-muted-foreground">
15
- Creator of shadcn/ui. Building beautiful, accessible components.
16
- </p>
17
- </div>
18
- </div>
19
- </HoverCardContent>
20
- </HoverCard>
21
- }`,...(y=(j=b.parameters)==null?void 0:j.docs)==null?void 0:y.source}}};const Le=["Basic"];export{b as Basic,Le as __namedExportsOrder,Be as default};
@@ -1,16 +0,0 @@
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
- render: () => <div className="grid w-full max-w-sm items-center gap-2">
3
- <Label htmlFor="email">Email</Label>
4
- <Input id="email" type="email" placeholder="m@example.com" />
5
- </div>
6
- }`,...(m=(i=a.parameters)==null?void 0:i.docs)==null?void 0:m.source}}};var d,o,n;r.parameters={...r.parameters,docs:{...(d=r.parameters)==null?void 0:d.docs,source:{originalSource:`{
7
- render: () => <div className="grid w-full max-w-sm items-center gap-2">
8
- <Label htmlFor="disabled">Disabled</Label>
9
- <Input id="disabled" placeholder="Can't type here" disabled />
10
- </div>
11
- }`,...(n=(o=r.parameters)==null?void 0:o.docs)==null?void 0:n.source}}};var c,p,u;s.parameters={...s.parameters,docs:{...(c=s.parameters)==null?void 0:c.docs,source:{originalSource:`{
12
- render: () => <div className="relative w-[280px]">
13
- <span className="pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3 text-muted-foreground">@</span>
14
- <Input className="pl-8" placeholder="username" />
15
- </div>
16
- }`,...(u=(p=s.parameters)==null?void 0:p.docs)==null?void 0:u.source}}};const D=["Basic","Disabled","WithIcon"];export{a as Basic,r as Disabled,s as WithIcon,D as __namedExportsOrder,L as default};
@@ -1,42 +0,0 @@
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
- * @license lucide-react v0.540.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const We=[["path",{d:"M5 12h14",key:"1ays0h"}]],Fe=Ae("minus",We);var Ge=Object.defineProperty,Le=Object.defineProperties,He=Object.getOwnPropertyDescriptors,X=Object.getOwnPropertySymbols,Pe=Object.prototype.hasOwnProperty,ye=Object.prototype.propertyIsEnumerable,xe=(n,a,o)=>a in n?Ge(n,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[a]=o,$e=(n,a)=>{for(var o in a||(a={}))Pe.call(a,o)&&xe(n,o,a[o]);if(X)for(var o of X(a))ye.call(a,o)&&xe(n,o,a[o]);return n},ze=(n,a)=>Le(n,He(a)),qe=(n,a)=>{var o={};for(var i in n)Pe.call(n,i)&&a.indexOf(i)<0&&(o[i]=n[i]);if(n!=null&&X)for(var i of X(n))a.indexOf(i)<0&&ye.call(n,i)&&(o[i]=n[i]);return o};function Ve(n){let a=setTimeout(n,0),o=setTimeout(n,10),i=setTimeout(n,50);return[a,o,i]}function Ue(n){let a=t.useRef();return t.useEffect(()=>{a.current=n}),a.current}var Ze=18,Ee=40,Je=`${Ee}px`,Ke=["[data-lastpass-icon-root]","com-1password-button","[data-dashlanecreated]",'[style$="2147483647 !important;"]'].join(",");function Qe({containerRef:n,inputRef:a,pushPasswordManagerStrategy:o,isFocused:i}){let[S,p]=t.useState(!1),[O,j]=t.useState(!1),[D,G]=t.useState(!1),L=t.useMemo(()=>o==="none"?!1:(o==="increase-width"||o==="experimental-no-flickering")&&S&&O,[S,O,o]),B=t.useCallback(()=>{let v=n.current,E=a.current;if(!v||!E||D||o==="none")return;let x=v,P=x.getBoundingClientRect().left+x.offsetWidth,A=x.getBoundingClientRect().top+x.offsetHeight/2,s=P-Ze,H=A;document.querySelectorAll(Ke).length===0&&document.elementFromPoint(s,H)===v||(p(!0),G(!0))},[n,a,D,o]);return t.useEffect(()=>{let v=n.current;if(!v||o==="none")return;function E(){let P=window.innerWidth-v.getBoundingClientRect().right;j(P>=Ee)}E();let x=setInterval(E,1e3);return()=>{clearInterval(x)}},[n,o]),t.useEffect(()=>{let v=i||document.activeElement===a.current;if(o==="none"||!v)return;let E=setTimeout(B,0),x=setTimeout(B,2e3),P=setTimeout(B,5e3),A=setTimeout(()=>{G(!0)},6e3);return()=>{clearTimeout(E),clearTimeout(x),clearTimeout(P),clearTimeout(A)}},[a,i,o,B]),{hasPWMBadge:S,willPushPWMBadge:L,PWM_BADGE_SPACE_WIDTH:Je}}var Te=t.createContext({}),Ie=t.forwardRef((n,a)=>{var o=n,{value:i,onChange:S,maxLength:p,textAlign:O="left",pattern:j,placeholder:D,inputMode:G="numeric",onComplete:L,pushPasswordManagerStrategy:B="increase-width",pasteTransformer:v,containerClassName:E,noScriptCSSFallback:x=Xe,render:P,children:A}=o,s=qe(o,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]),H,le,ie,se,ue;let[je,Ce]=t.useState(typeof s.defaultValue=="string"?s.defaultValue:""),u=i??je,C=Ue(u),$=t.useCallback(e=>{S==null||S(e),Ce(e)},[S]),w=t.useMemo(()=>j?typeof j=="string"?new RegExp(j):j:null,[j]),c=t.useRef(null),Y=t.useRef(null),ee=t.useRef({value:u,onChange:$,isIOS:typeof window<"u"&&((le=(H=window==null?void 0:window.CSS)==null?void 0:H.supports)==null?void 0:le.call(H,"-webkit-touch-callout","none"))}),Z=t.useRef({prev:[(ie=c.current)==null?void 0:ie.selectionStart,(se=c.current)==null?void 0:se.selectionEnd,(ue=c.current)==null?void 0:ue.selectionDirection]});t.useImperativeHandle(a,()=>c.current,[]),t.useEffect(()=>{let e=c.current,r=Y.current;if(!e||!r)return;ee.current.value!==e.value&&ee.current.onChange(e.value),Z.current.prev=[e.selectionStart,e.selectionEnd,e.selectionDirection];function m(){if(document.activeElement!==e){q(null),V(null);return}let l=e.selectionStart,f=e.selectionEnd,J=e.selectionDirection,b=e.maxLength,k=e.value,y=Z.current.prev,T=-1,I=-1,_;if(k.length!==0&&l!==null&&f!==null){let Ne=l===f,De=l===k.length&&k.length<b;if(Ne&&!De){let R=l;if(R===0)T=0,I=1,_="forward";else if(R===b)T=R-1,I=R,_="backward";else if(b>1&&k.length>1){let re=0;if(y[0]!==null&&y[1]!==null){_=R<y[1]?"backward":"forward";let Be=y[0]===y[1]&&y[0]<b;_==="backward"&&!Be&&(re=-1)}T=re+R,I=re+R+1}}T!==-1&&I!==-1&&T!==I&&c.current.setSelectionRange(T,I,_)}let he=T!==-1?T:l,ge=I!==-1?I:f,Re=_??J;q(he),V(ge),Z.current.prev=[he,ge,Re]}if(document.addEventListener("selectionchange",m,{capture:!0}),m(),document.activeElement===e&&te(!0),!document.getElementById("input-otp-style")){let l=document.createElement("style");if(l.id="input-otp-style",document.head.appendChild(l),l.sheet){let f="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";U(l.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),U(l.sheet,`[data-input-otp]:autofill { ${f} }`),U(l.sheet,`[data-input-otp]:-webkit-autofill { ${f} }`),U(l.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),U(l.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let h=()=>{r&&r.style.setProperty("--root-height",`${e.clientHeight}px`)};h();let g=new ResizeObserver(h);return g.observe(e),()=>{document.removeEventListener("selectionchange",m,{capture:!0}),g.disconnect()}},[]);let[ce,de]=t.useState(!1),[z,te]=t.useState(!1),[M,q]=t.useState(null),[W,V]=t.useState(null);t.useEffect(()=>{Ve(()=>{var e,r,m,h;(e=c.current)==null||e.dispatchEvent(new Event("input"));let g=(r=c.current)==null?void 0:r.selectionStart,l=(m=c.current)==null?void 0:m.selectionEnd,f=(h=c.current)==null?void 0:h.selectionDirection;g!==null&&l!==null&&(q(g),V(l),Z.current.prev=[g,l,f])})},[u,z]),t.useEffect(()=>{C!==void 0&&u!==C&&C.length<p&&u.length===p&&(L==null||L(u))},[p,L,C,u]);let F=Qe({containerRef:Y,inputRef:c,pushPasswordManagerStrategy:B,isFocused:z}),pe=t.useCallback(e=>{let r=e.currentTarget.value.slice(0,p);if(r.length>0&&w&&!w.test(r)){e.preventDefault();return}typeof C=="string"&&r.length<C.length&&document.dispatchEvent(new Event("selectionchange")),$(r)},[p,$,C,w]),me=t.useCallback(()=>{var e;if(c.current){let r=Math.min(c.current.value.length,p-1),m=c.current.value.length;(e=c.current)==null||e.setSelectionRange(r,m),q(r),V(m)}te(!0)},[p]),fe=t.useCallback(e=>{var r,m;let h=c.current;if(!v&&(!ee.current.isIOS||!e.clipboardData||!h))return;let g=e.clipboardData.getData("text/plain"),l=v?v(g):g;e.preventDefault();let f=(r=c.current)==null?void 0:r.selectionStart,J=(m=c.current)==null?void 0:m.selectionEnd,b=(f!==J?u.slice(0,f)+l+u.slice(J):u.slice(0,f)+l+u.slice(f)).slice(0,p);if(b.length>0&&w&&!w.test(b))return;h.value=b,$(b);let k=Math.min(b.length,p-1),y=b.length;h.setSelectionRange(k,y),q(k),V(y)},[p,$,w,u]),Me=t.useMemo(()=>({position:"relative",cursor:s.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[s.disabled]),ve=t.useMemo(()=>({position:"absolute",inset:0,width:F.willPushPWMBadge?`calc(100% + ${F.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:F.willPushPWMBadge?`inset(0 ${F.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:O,opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",lineHeight:"1",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"}),[F.PWM_BADGE_SPACE_WIDTH,F.willPushPWMBadge,O]),ke=t.useMemo(()=>t.createElement("input",ze($e({autoComplete:s.autoComplete||"one-time-code"},s),{"data-input-otp":!0,"data-input-otp-placeholder-shown":u.length===0||void 0,"data-input-otp-mss":M,"data-input-otp-mse":W,inputMode:G,pattern:w==null?void 0:w.source,"aria-placeholder":D,style:ve,maxLength:p,value:u,ref:c,onPaste:e=>{var r;fe(e),(r=s.onPaste)==null||r.call(s,e)},onChange:pe,onMouseOver:e=>{var r;de(!0),(r=s.onMouseOver)==null||r.call(s,e)},onMouseLeave:e=>{var r;de(!1),(r=s.onMouseLeave)==null||r.call(s,e)},onFocus:e=>{var r;me(),(r=s.onFocus)==null||r.call(s,e)},onBlur:e=>{var r;te(!1),(r=s.onBlur)==null||r.call(s,e)}})),[pe,me,fe,G,ve,p,W,M,s,w==null?void 0:w.source,u]),ne=t.useMemo(()=>({slots:Array.from({length:p}).map((e,r)=>{var m;let h=z&&M!==null&&W!==null&&(M===W&&r===M||r>=M&&r<W),g=u[r]!==void 0?u[r]:null,l=u[0]!==void 0?null:(m=D==null?void 0:D[r])!=null?m:null;return{char:g,placeholderChar:l,isActive:h,hasFakeCaret:h&&g===null}}),isFocused:z,isHovering:!s.disabled&&ce}),[z,ce,p,W,M,s.disabled,u]),_e=t.useMemo(()=>P?P(ne):t.createElement(Te.Provider,{value:ne},A),[A,ne,P]);return t.createElement(t.Fragment,null,x!==null&&t.createElement("noscript",null,t.createElement("style",null,x)),t.createElement("div",{ref:Y,"data-input-otp-container":!0,style:Me,className:E},_e,t.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},ke)))});Ie.displayName="Input";function U(n,a){try{n.insertRule(a)}catch{console.error("input-otp could not insert CSS rule:",a)}}var Xe=`
7
- [data-input-otp] {
8
- --nojs-bg: white !important;
9
- --nojs-fg: black !important;
10
-
11
- background-color: var(--nojs-bg) !important;
12
- color: var(--nojs-fg) !important;
13
- caret-color: var(--nojs-fg) !important;
14
- letter-spacing: .25em !important;
15
- text-align: center !important;
16
- border: 1px solid var(--nojs-fg) !important;
17
- border-radius: 4px !important;
18
- width: 100% !important;
19
- }
20
- @media (prefers-color-scheme: dark) {
21
- [data-input-otp] {
22
- --nojs-bg: black !important;
23
- --nojs-fg: white !important;
24
- }
25
- }`;function oe({className:n,containerClassName:a,...o}){return d.jsx(Ie,{"data-slot":"input-otp",containerClassName:Q("flex items-center gap-2 has-disabled:opacity-50",a),className:Q("disabled:cursor-not-allowed",n),...o})}function ae({className:n,...a}){return d.jsx("div",{"data-slot":"input-otp-group",className:Q("flex items-center",n),...a})}function N({index:n,className:a,...o}){const i=t.useContext(Te),{char:S,hasFakeCaret:p,isActive:O}=(i==null?void 0:i.slots[n])??{};return d.jsxs("div",{"data-slot":"input-otp-slot","data-active":O,className:Q("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",a),...o,children:[S,p&&d.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:d.jsx("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function Oe({...n}){return d.jsx("div",{"data-slot":"input-otp-separator",role:"separator",...n,children:d.jsx(Fe,{})})}oe.__docgenInfo={description:"",methods:[],displayName:"InputOTP",props:{containerClassName:{required:!1,tsType:{name:"string"},description:""}}};ae.__docgenInfo={description:"",methods:[],displayName:"InputOTPGroup"};N.__docgenInfo={description:"",methods:[],displayName:"InputOTPSlot",props:{index:{required:!0,tsType:{name:"number"},description:""}}};Oe.__docgenInfo={description:"",methods:[],displayName:"InputOTPSeparator"};const at={title:"Shadcn/UI/InputOTP",component:oe},K={render:()=>d.jsxs("div",{className:"space-y-2",children:[d.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter the 6-digit code we emailed you."}),d.jsxs(oe,{maxLength:6,"aria-label":"One-time password input",children:[d.jsxs(ae,{children:[d.jsx(N,{index:0}),d.jsx(N,{index:1}),d.jsx(N,{index:2})]}),d.jsx(Oe,{}),d.jsxs(ae,{children:[d.jsx(N,{index:3}),d.jsx(N,{index:4}),d.jsx(N,{index:5})]})]})]})};var be,we,Se;K.parameters={...K.parameters,docs:{...(be=K.parameters)==null?void 0:be.docs,source:{originalSource:`{
26
- render: () => <div className="space-y-2">
27
- <p className="text-sm text-muted-foreground">Enter the 6-digit code we emailed you.</p>
28
- <InputOTP maxLength={6} aria-label="One-time password input">
29
- <InputOTPGroup>
30
- <InputOTPSlot index={0} />
31
- <InputOTPSlot index={1} />
32
- <InputOTPSlot index={2} />
33
- </InputOTPGroup>
34
- <InputOTPSeparator />
35
- <InputOTPGroup>
36
- <InputOTPSlot index={3} />
37
- <InputOTPSlot index={4} />
38
- <InputOTPSlot index={5} />
39
- </InputOTPGroup>
40
- </InputOTP>
41
- </div>
42
- }`,...(Se=(we=K.parameters)==null?void 0:we.docs)==null?void 0:Se.source}}};const ot=["Basic"];export{K as Basic,ot as __namedExportsOrder,at as default};
@@ -1,14 +0,0 @@
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
- render: () => <div className="grid gap-3 w-[320px]">
3
- <div className="grid gap-1.5">
4
- <Label htmlFor="email">Email</Label>
5
- <Input id="email" type="email" placeholder="you@example.com" />
6
- </div>
7
- <div className="grid gap-1.5">
8
- <Label htmlFor="disabled" className="group" data-disabled>
9
- Disabled input
10
- </Label>
11
- <Input id="disabled" placeholder="Disabled" disabled />
12
- </div>
13
- </div>
14
- }`,...(l=(r=e.parameters)==null?void 0:r.docs)==null?void 0:l.source}}};const j=["Basic"];export{e as Basic,j as __namedExportsOrder,h as default};
@@ -1,37 +0,0 @@
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
-
3
- Responsibilities:
4
- - Provides a two-column layout (form + optional right-side image)
5
- - Renders an app title and optional subtitle above the form
6
- - Renders optional separator and custom \`continueWith\` content (e.g., social buttons)
7
- - Renders a footer with configurable signup CTA
8
- - Leaves the actual form implementation to children, so you can use FormBuilder or any custom form`,methods:[],displayName:"Login",props:{appTitle:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"'Acme Inc'",computed:!1}},subtitle:{required:!1,tsType:{name:"string"},description:""},signupLabel:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:`"Don't have an account?"`,computed:!1}},signupLinkLabel:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"'Sign up'",computed:!1}},signupHref:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"'#'",computed:!1}},forgotPasswordLabel:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"'Forgot your password?'",computed:!1}},forgotPasswordLinkLabel:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"'Reset Here'",computed:!1}},forgotPasswordHref:{required:!1,tsType:{name:"string"},description:""},rightImageSrc:{required:!1,tsType:{name:"string"},description:""},rightImageAlt:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"'Login image'",computed:!1}},className:{required:!1,tsType:{name:"string"},description:""},continueWith:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},children:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""}}};const We={title:"Kit/Components/Login",component:t},n=[{variant:"plain",fields:[{name:"email",label:"Email",type:"email",placeholder:"m@example.com",required:!0,validation:f().email("Please enter a valid email")},{name:"password",label:"Password",type:"password",required:!0,validation:f().min(6,"Password must be at least 6 characters")}]}],l=async m=>{console.log("Login submit",m)};function A(){return e.jsx("svg",{viewBox:"0 0 24 24",className:"h-4 w-4","aria-hidden":!0,children:e.jsx("path",{fill:"#EA4335",d:"M12 10.2v3.9h5.5c-.2 1.3-1.7 3.9-5.5 3.9-3.3 0-6-2.7-6-6s2.7-6 6-6c1.9 0 3.2.8 3.9 1.5l2.7-2.6C16.9 3 14.7 2 12 2 6.9 2 2.7 6.2 2.7 11.3S6.9 20.7 12 20.7c6 0 9.9-4.2 9.9-10.1 0-.7-.1-1.2-.2-1.7H12z"})})}function C(){return e.jsxs("svg",{viewBox:"0 0 24 24",className:"h-4 w-4","aria-hidden":!0,children:[e.jsx("path",{fill:"#F25022",d:"M11.5 11.5H2.5V2.5h9z"}),e.jsx("path",{fill:"#7FBA00",d:"M21.5 11.5h-9V2.5h9z"}),e.jsx("path",{fill:"#00A4EF",d:"M11.5 21.5H2.5v-9h9z"}),e.jsx("path",{fill:"#FFB900",d:"M21.5 21.5h-9v-9h9z"})]})}const s={name:"Basic with FormBuilder",render:()=>e.jsx(t,{appTitle:"Acme Inc",subtitle:"Enter your email and password to sign in",signupLabel:"Don't have an account?",signupLinkLabel:"Create one",signupHref:"#signup",rightImageSrc:"https://images.unsplash.com/photo-1547658719-da2b51169166?q=80&w=2069&auto=format&fit=crop",children:e.jsx(a,{sections:n,onSubmit:l,submitLabel:"Login",className:"",formClassName:""})})},o={name:"With social continue-with",render:()=>e.jsx(t,{appTitle:"Acme Inc",subtitle:"Welcome back",signupLabel:"New here?",signupLinkLabel:"Sign up",signupHref:"#signup",rightImageSrc:"https://images.unsplash.com/photo-1486312338219-ce68d2c6f44d?q=80&w=2070&auto=format&fit=crop",continueWith:e.jsxs(e.Fragment,{children:[e.jsxs(g,{variant:"outline",className:"w-full justify-center gap-2",children:[e.jsx(A,{}),"Continue with Google"]}),e.jsxs(g,{variant:"outline",className:"w-full justify-center gap-2",children:[e.jsx(C,{}),"Continue with Microsoft"]})]}),children:e.jsx(a,{sections:n,onSubmit:l,submitLabel:"Login"})})},i={name:"With forgot password (default label)",render:()=>e.jsx(t,{appTitle:"Acme Inc",subtitle:"Use your credentials to sign in",signupLabel:"Don't have an account?",signupLinkLabel:"Create one",signupHref:"#signup",forgotPasswordLabel:"Forgot your password?",forgotPasswordLinkLabel:"Reset Here",forgotPasswordHref:"#forgot-password",rightImageSrc:"https://images.unsplash.com/photo-1547658719-da2b51169166?q=80&w=2069&auto=format&fit=crop",children:e.jsx(a,{sections:n,onSubmit:l,submitLabel:"Login"})})},r={name:"With forgot password (custom label/link)",render:()=>e.jsx(t,{appTitle:"Acme Inc",subtitle:"Welcome back",signupLabel:"New here?",signupLinkLabel:"Join now",signupHref:"#signup",forgotPasswordHref:"/auth/reset-password",forgotPasswordLabel:"Your password is lost?",forgotPasswordLinkLabel:"Reset Here",rightImageSrc:"https://images.unsplash.com/photo-1486312338219-ce68d2c6f44d?q=80&w=2070&auto=format&fit=crop",children:e.jsx(a,{sections:n,onSubmit:l,submitLabel:"Login"})})};var h,b,w;s.parameters={...s.parameters,docs:{...(h=s.parameters)==null?void 0:h.docs,source:{originalSource:`{
9
- name: 'Basic with FormBuilder',
10
- render: () => <Login appTitle="Acme Inc" subtitle="Enter your email and password to sign in" signupLabel="Don't have an account?" signupLinkLabel="Create one" signupHref="#signup" rightImageSrc="https://images.unsplash.com/photo-1547658719-da2b51169166?q=80&w=2069&auto=format&fit=crop">
11
- <FormBuilder sections={formSections} onSubmit={handleSubmit} submitLabel="Login" className="" formClassName="" />
12
- </Login>
13
- }`,...(w=(b=s.parameters)==null?void 0:b.docs)==null?void 0:w.source}}};var L,x,j;o.parameters={...o.parameters,docs:{...(L=o.parameters)==null?void 0:L.docs,source:{originalSource:`{
14
- name: 'With social continue-with',
15
- render: () => <Login appTitle="Acme Inc" subtitle="Welcome back" signupLabel="New here?" signupLinkLabel="Sign up" signupHref="#signup" rightImageSrc="https://images.unsplash.com/photo-1486312338219-ce68d2c6f44d?q=80&w=2070&auto=format&fit=crop" continueWith={<>
16
- <Button variant="outline" className="w-full justify-center gap-2">
17
- <GoogleIcon />
18
- Continue with Google
19
- </Button>
20
- <Button variant="outline" className="w-full justify-center gap-2">
21
- <MicrosoftIcon />
22
- Continue with Microsoft
23
- </Button>
24
- </>}>
25
- <FormBuilder sections={formSections} onSubmit={handleSubmit} submitLabel="Login" />
26
- </Login>
27
- }`,...(j=(x=o.parameters)==null?void 0:x.docs)==null?void 0:j.source}}};var v,N,S;i.parameters={...i.parameters,docs:{...(v=i.parameters)==null?void 0:v.docs,source:{originalSource:`{
28
- name: 'With forgot password (default label)',
29
- render: () => <Login appTitle="Acme Inc" subtitle="Use your credentials to sign in" signupLabel="Don't have an account?" signupLinkLabel="Create one" signupHref="#signup" forgotPasswordLabel="Forgot your password?" forgotPasswordLinkLabel="Reset Here" forgotPasswordHref="#forgot-password" rightImageSrc="https://images.unsplash.com/photo-1547658719-da2b51169166?q=80&w=2069&auto=format&fit=crop">
30
- <FormBuilder sections={formSections} onSubmit={handleSubmit} submitLabel="Login" />
31
- </Login>
32
- }`,...(S=(N=i.parameters)==null?void 0:N.docs)==null?void 0:S.source}}};var y,F,I;r.parameters={...r.parameters,docs:{...(y=r.parameters)==null?void 0:y.docs,source:{originalSource:`{
33
- name: 'With forgot password (custom label/link)',
34
- render: () => <Login appTitle="Acme Inc" subtitle="Welcome back" signupLabel="New here?" signupLinkLabel="Join now" signupHref="#signup" forgotPasswordHref="/auth/reset-password" forgotPasswordLabel="Your password is lost?" forgotPasswordLinkLabel="Reset Here" rightImageSrc="https://images.unsplash.com/photo-1486312338219-ce68d2c6f44d?q=80&w=2070&auto=format&fit=crop">
35
- <FormBuilder sections={formSections} onSubmit={handleSubmit} submitLabel="Login" />
36
- </Login>
37
- }`,...(I=(F=r.parameters)==null?void 0:F.docs)==null?void 0:I.source}}};const Ae=["Basic","WithSocial","WithForgotPassword","WithForgotPasswordCustom"];export{s as Basic,i as WithForgotPassword,r as WithForgotPasswordCustom,o as WithSocial,Ae as __namedExportsOrder,We as default};
@@ -1,44 +0,0 @@
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
- render: () => <Menubar>
3
- <MenubarMenu>
4
- <MenubarTrigger>File</MenubarTrigger>
5
- <MenubarContent>
6
- <MenubarItem>New Tab <MenubarShortcut>⌘T</MenubarShortcut></MenubarItem>
7
- <MenubarItem>New Window <MenubarShortcut>⌘N</MenubarShortcut></MenubarItem>
8
- <MenubarSeparator />
9
- <MenubarSub>
10
- <MenubarSubTrigger>Share</MenubarSubTrigger>
11
- <MenubarSubContent>
12
- <MenubarItem>Email link</MenubarItem>
13
- <MenubarItem>Messages</MenubarItem>
14
- </MenubarSubContent>
15
- </MenubarSub>
16
- <MenubarSeparator />
17
- <MenubarItem>Close Window <MenubarShortcut>⌘W</MenubarShortcut></MenubarItem>
18
- </MenubarContent>
19
- </MenubarMenu>
20
- <MenubarMenu>
21
- <MenubarTrigger>Edit</MenubarTrigger>
22
- <MenubarContent>
23
- <MenubarItem>Undo <MenubarShortcut>⌘Z</MenubarShortcut></MenubarItem>
24
- <MenubarItem>Redo <MenubarShortcut>⇧⌘Z</MenubarShortcut></MenubarItem>
25
- <MenubarSeparator />
26
- <MenubarCheckboxItem checked>Show Ruler</MenubarCheckboxItem>
27
- <MenubarCheckboxItem>Show Toolbar</MenubarCheckboxItem>
28
- <MenubarSeparator />
29
- <MenubarLabel>Zoom</MenubarLabel>
30
- <MenubarRadioGroup value="fit">
31
- <MenubarRadioItem value="fit">Fit</MenubarRadioItem>
32
- <MenubarRadioItem value="fill">Fill</MenubarRadioItem>
33
- </MenubarRadioGroup>
34
- </MenubarContent>
35
- </MenubarMenu>
36
- <MenubarMenu>
37
- <MenubarTrigger>View</MenubarTrigger>
38
- <MenubarContent>
39
- <MenubarItem>Reload <MenubarShortcut>⌘R</MenubarShortcut></MenubarItem>
40
- <MenubarItem>Toggle Full Screen <MenubarShortcut>⌃⌘F</MenubarShortcut></MenubarItem>
41
- </MenubarContent>
42
- </MenubarMenu>
43
- </Menubar>
44
- }`,...(U=(B=R.parameters)==null?void 0:B.docs)==null?void 0:U.source}}};const an=["Basic"];export{R as Basic,an as __namedExportsOrder,nn as default};
@@ -1,30 +0,0 @@
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
- render: () => <NavigationMenu>
3
- <NavigationMenuList>
4
- <NavigationMenuItem>
5
- <NavigationMenuTrigger>Products</NavigationMenuTrigger>
6
- <NavigationMenuContent>
7
- <div className="grid w-[400px] gap-3 p-3 md:w-[500px] md:grid-cols-2">
8
- <NavigationMenuLink asChild>
9
- <a className="rounded-md border p-3" href="https://example.com/analytics">Analytics</a>
10
- </NavigationMenuLink>
11
- <NavigationMenuLink asChild>
12
- <a className="rounded-md border p-3" href="https://example.com/engagement">Engagement</a>
13
- </NavigationMenuLink>
14
- <NavigationMenuLink asChild>
15
- <a className="rounded-md border p-3" href="https://example.com/security">Security</a>
16
- </NavigationMenuLink>
17
- <NavigationMenuLink asChild>
18
- <a className="rounded-md border p-3" href="https://example.com/integrations">Integrations</a>
19
- </NavigationMenuLink>
20
- </div>
21
- </NavigationMenuContent>
22
- </NavigationMenuItem>
23
- <NavigationMenuItem>
24
- <NavigationMenuLink href="https://example.com/pricing" className="rounded-md px-4 py-2">Pricing</NavigationMenuLink>
25
- </NavigationMenuItem>
26
- </NavigationMenuList>
27
- <NavigationMenuIndicator />
28
- <NavigationMenuViewport />
29
- </NavigationMenu>
30
- }`,...(ue=(ce=F.parameters)==null?void 0:ce.docs)==null?void 0:ue.source}}};const Vt=["Basic"];export{F as Basic,Vt as __namedExportsOrder,Kt as default};
@@ -1,91 +0,0 @@
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
- * @license lucide-react v0.540.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const E=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],_=W("download",E),v={full:"max-w-none",sm:"max-w-screen-sm",md:"max-w-screen-md",lg:"max-w-screen-lg",xl:"max-w-screen-xl"};function L(r){if(r.type==="button"){const{label:t,onClick:i,variant:l,size:n,leftIcon:d,rightIcon:m,disabled:f,className:q}=r;return e.jsxs(h,{onClick:i,variant:l,size:n,disabled:f,className:q,children:[d,e.jsx("span",{children:t}),m]},r.key??String(t))}const{trigger:a,items:s}=r;return e.jsxs(I,{children:[e.jsx(B,{asChild:!0,children:e.jsxs("button",{type:"button",className:o(P({variant:a.variant,size:a.size}),a.className),onClick:a.onClick,disabled:a.disabled,children:[a.leftIcon,e.jsx("span",{children:a.label}),a.rightIcon]})}),e.jsx(S,{align:"end",children:s.map((t,i)=>"type"in t?e.jsx(T,{},t.key??`sep-${i}`):e.jsx(z,{onSelect:l=>{var n;l.preventDefault(),(n=t.onSelect)==null||n.call(t)},variant:t.destructive?"destructive":"default",children:e.jsxs("div",{className:"flex items-center gap-2",children:[t.leftIcon,e.jsx("span",{children:t.label}),t.rightIcon]})},t.key??String(t.label)))})]},r.key??String(a.label))}function c({title:r,subtitle:a,actions:s,containerWidth:t="lg",className:i,headerClassName:l,contentClassName:n,footerLeft:d,footerRight:m,children:f}){return e.jsx("div",{className:o("w-full",i),children:e.jsxs("div",{className:o("px-4 sm:px-6 lg:px-8",v[t],"mx-auto"),children:[e.jsxs("header",{className:o("flex items-start justify-between gap-3 py-6",l),children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[e.jsx("h1",{className:"text-2xl font-semibold leading-none tracking-tight text-foreground",children:r}),a?e.jsx("p",{className:"text-sm text-muted-foreground",children:a}):null]}),s&&s.length>0?e.jsx("div",{className:"flex shrink-0 flex-wrap items-center justify-end gap-2",children:s.map(L)}):null]}),e.jsx("main",{className:o("pb-8",n),children:f}),(d||m)&&e.jsx("footer",{className:"border-t pt-4 pb-8",children:e.jsx("div",{className:o("px-0",v[t]),children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:d}),e.jsx("div",{className:"flex items-center gap-2",children:m})]})})})]})})}c.__docgenInfo={description:"",methods:[],displayName:"Page",props:{title:{required:!0,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},subtitle:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},actions:{required:!1,tsType:{name:"Array",elements:[{name:"union",raw:"PageButtonAction | PageDropdownAction",elements:[{name:"signature",type:"object",raw:`{
7
- type: 'button';
8
- key?: string;
9
- label: React.ReactNode;
10
- onClick?: () => void;
11
- variant?: React.ComponentProps<typeof Button>['variant'];
12
- size?: React.ComponentProps<typeof Button>['size'];
13
- leftIcon?: React.ReactNode;
14
- rightIcon?: React.ReactNode;
15
- disabled?: boolean;
16
- className?: string;
17
- }`,signature:{properties:[{key:"type",value:{name:"literal",value:"'button'",required:!0}},{key:"key",value:{name:"string",required:!1}},{key:"label",value:{name:"ReactReactNode",raw:"React.ReactNode",required:!0}},{key:"onClick",value:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}},required:!1}},{key:"variant",value:{name:"ReactComponentProps['variant']",raw:"React.ComponentProps<typeof Button>['variant']",required:!1}},{key:"size",value:{name:"ReactComponentProps['size']",raw:"React.ComponentProps<typeof Button>['size']",required:!1}},{key:"leftIcon",value:{name:"ReactReactNode",raw:"React.ReactNode",required:!1}},{key:"rightIcon",value:{name:"ReactReactNode",raw:"React.ReactNode",required:!1}},{key:"disabled",value:{name:"boolean",required:!1}},{key:"className",value:{name:"string",required:!1}}]}},{name:"signature",type:"object",raw:`{
18
- type: 'dropdown';
19
- key?: string;
20
- trigger: Omit<PageButtonAction, 'type'>;
21
- items: (PageDropdownActionItem | { type: 'separator'; key?: string; })[];
22
- }`,signature:{properties:[{key:"type",value:{name:"literal",value:"'dropdown'",required:!0}},{key:"key",value:{name:"string",required:!1}},{key:"trigger",value:{name:"Omit",elements:[{name:"signature",type:"object",raw:`{
23
- type: 'button';
24
- key?: string;
25
- label: React.ReactNode;
26
- onClick?: () => void;
27
- variant?: React.ComponentProps<typeof Button>['variant'];
28
- size?: React.ComponentProps<typeof Button>['size'];
29
- leftIcon?: React.ReactNode;
30
- rightIcon?: React.ReactNode;
31
- disabled?: boolean;
32
- className?: string;
33
- }`,signature:{properties:[{key:"type",value:{name:"literal",value:"'button'",required:!0}},{key:"key",value:{name:"string",required:!1}},{key:"label",value:{name:"ReactReactNode",raw:"React.ReactNode",required:!0}},{key:"onClick",value:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}},required:!1}},{key:"variant",value:{name:"ReactComponentProps['variant']",raw:"React.ComponentProps<typeof Button>['variant']",required:!1}},{key:"size",value:{name:"ReactComponentProps['size']",raw:"React.ComponentProps<typeof Button>['size']",required:!1}},{key:"leftIcon",value:{name:"ReactReactNode",raw:"React.ReactNode",required:!1}},{key:"rightIcon",value:{name:"ReactReactNode",raw:"React.ReactNode",required:!1}},{key:"disabled",value:{name:"boolean",required:!1}},{key:"className",value:{name:"string",required:!1}}]}},{name:"literal",value:"'type'"}],raw:"Omit<PageButtonAction, 'type'>",required:!0}},{key:"items",value:{name:"Array",elements:[{name:"unknown"}],raw:"(PageDropdownActionItem | { type: 'separator'; key?: string; })[]",required:!0}}]}}]}],raw:"PageAction[]"},description:""},containerWidth:{required:!1,tsType:{name:"union",raw:"'full' | 'sm' | 'md' | 'lg' | 'xl'",elements:[{name:"literal",value:"'full'"},{name:"literal",value:"'sm'"},{name:"literal",value:"'md'"},{name:"literal",value:"'lg'"},{name:"literal",value:"'xl'"}]},description:"",defaultValue:{value:"'lg'",computed:!1}},className:{required:!1,tsType:{name:"string"},description:""},headerClassName:{required:!1,tsType:{name:"string"},description:""},contentClassName:{required:!1,tsType:{name:"string"},description:""},footerLeft:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},footerRight:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""},children:{required:!1,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""}}};const Re={title:"kit/Builder/Page",component:c},u={name:"Basic",render:()=>e.jsx(c,{title:"Orders",subtitle:"Manage and review customer orders",containerWidth:"lg",children:e.jsx("div",{className:"rounded-md border bg-card p-6 text-sm text-muted-foreground",children:"Page content goes here."})})},p={name:"With actions",render:()=>{const r=[{type:"button",label:"New Order",variant:"default",leftIcon:e.jsx(D,{className:"h-4 w-4"}),onClick:()=>console.log("new")},{type:"button",label:"Export",variant:"outline",leftIcon:e.jsx(_,{className:"h-4 w-4"}),onClick:()=>console.log("export")},{type:"dropdown",trigger:{label:"More",variant:"ghost",leftIcon:e.jsx(O,{className:"h-4 w-4"})},items:[{label:"Refresh",leftIcon:e.jsx(A,{className:"h-4 w-4"}),onSelect:()=>console.log("refresh")},{type:"separator"},{label:"Delete selected",leftIcon:e.jsx(M,{className:"h-4 w-4"}),destructive:!0,onSelect:()=>console.log("delete")}]}];return e.jsx(c,{title:"Orders",subtitle:"Manage and review customer orders",actions:r,containerWidth:"xl",children:e.jsx("div",{className:"rounded-md border bg-card p-6 text-sm text-muted-foreground",children:"Content with actions."})})}},g={name:"With footer",render:()=>e.jsx(c,{title:"Settings",subtitle:"Configure your workspace",containerWidth:"md",footerLeft:e.jsx("span",{className:"text-xs",children:"Last updated 2 hours ago"}),footerRight:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"outline",onClick:()=>console.log("cancel"),children:"Cancel"}),e.jsx(h,{onClick:()=>console.log("save"),children:"Save changes"})]}),children:e.jsx("div",{className:"rounded-md border bg-card p-6 text-sm text-muted-foreground",children:"Settings content here."})})};var x,y,w;u.parameters={...u.parameters,docs:{...(x=u.parameters)==null?void 0:x.docs,source:{originalSource:`{
34
- name: 'Basic',
35
- render: () => <Page title="Orders" subtitle="Manage and review customer orders" containerWidth="lg">
36
- <div className="rounded-md border bg-card p-6 text-sm text-muted-foreground">
37
- Page content goes here.
38
- </div>
39
- </Page>
40
- }`,...(w=(y=u.parameters)==null?void 0:y.docs)==null?void 0:w.source}}};var N,R,b;p.parameters={...p.parameters,docs:{...(N=p.parameters)==null?void 0:N.docs,source:{originalSource:`{
41
- name: 'With actions',
42
- render: () => {
43
- const actions: PageAction[] = [{
44
- type: 'button',
45
- label: 'New Order',
46
- variant: 'default',
47
- leftIcon: <Plus className="h-4 w-4" />,
48
- onClick: () => console.log('new')
49
- }, {
50
- type: 'button',
51
- label: 'Export',
52
- variant: 'outline',
53
- leftIcon: <Download className="h-4 w-4" />,
54
- onClick: () => console.log('export')
55
- }, {
56
- type: 'dropdown',
57
- trigger: {
58
- label: 'More',
59
- variant: 'ghost',
60
- leftIcon: <MoreHorizontal className="h-4 w-4" />
61
- },
62
- items: [{
63
- label: 'Refresh',
64
- leftIcon: <RefreshCw className="h-4 w-4" />,
65
- onSelect: () => console.log('refresh')
66
- }, {
67
- type: 'separator'
68
- }, {
69
- label: 'Delete selected',
70
- leftIcon: <Trash2 className="h-4 w-4" />,
71
- destructive: true,
72
- onSelect: () => console.log('delete')
73
- }]
74
- }];
75
- return <Page title="Orders" subtitle="Manage and review customer orders" actions={actions} containerWidth="xl">
76
- <div className="rounded-md border bg-card p-6 text-sm text-muted-foreground">
77
- Content with actions.
78
- </div>
79
- </Page>;
80
- }
81
- }`,...(b=(R=p.parameters)==null?void 0:R.docs)==null?void 0:b.source}}};var k,j,C;g.parameters={...g.parameters,docs:{...(k=g.parameters)==null?void 0:k.docs,source:{originalSource:`{
82
- name: 'With footer',
83
- render: () => <Page title="Settings" subtitle="Configure your workspace" containerWidth="md" footerLeft={<span className="text-xs">Last updated 2 hours ago</span>} footerRight={<div className="flex gap-2">
84
- <Button variant="outline" onClick={() => console.log('cancel')}>Cancel</Button>
85
- <Button onClick={() => console.log('save')}>Save changes</Button>
86
- </div>}>
87
- <div className="rounded-md border bg-card p-6 text-sm text-muted-foreground">
88
- Settings content here.
89
- </div>
90
- </Page>
91
- }`,...(C=(j=g.parameters)==null?void 0:j.docs)==null?void 0:C.source}}};const be=["Basic","WithActions","WithFooter"];export{u as Basic,p as WithActions,g as WithFooter,be as __namedExportsOrder,Re as default};
@@ -1,29 +0,0 @@
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
- render: () => <Pagination>
3
- <PaginationContent>
4
- <PaginationItem>
5
- <PaginationPrevious href="#" />
6
- </PaginationItem>
7
- <PaginationItem>
8
- <PaginationLink href="#">1</PaginationLink>
9
- </PaginationItem>
10
- <PaginationItem>
11
- <PaginationLink href="#" isActive>
12
- 2
13
- </PaginationLink>
14
- </PaginationItem>
15
- <PaginationItem>
16
- <PaginationLink href="#">3</PaginationLink>
17
- </PaginationItem>
18
- <PaginationItem>
19
- <PaginationEllipsis />
20
- </PaginationItem>
21
- <PaginationItem>
22
- <PaginationLink href="#">10</PaginationLink>
23
- </PaginationItem>
24
- <PaginationItem>
25
- <PaginationNext href="#" />
26
- </PaginationItem>
27
- </PaginationContent>
28
- </Pagination>
29
- }`,...(d=(c=s.parameters)==null?void 0:c.docs)==null?void 0:d.source}}};const B=["Basic"];export{s as Basic,B as __namedExportsOrder,w as default};
@@ -1,15 +0,0 @@
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
- render: () => <Popover>
3
- <PopoverTrigger asChild>
4
- <Button variant="outline">Open popover</Button>
5
- </PopoverTrigger>
6
- <PopoverContent className="w-64">
7
- <div className="space-y-2">
8
- <h4 className="font-medium leading-none">Dimensions</h4>
9
- <p className="text-sm text-muted-foreground">Set the dimensions for the layer.</p>
10
- </div>
11
- </PopoverContent>
12
- </Popover>
13
- }`,...(p=(a=o.parameters)==null?void 0:a.docs)==null?void 0:p.source}}};var m,d,c;r.parameters={...r.parameters,docs:{...(m=r.parameters)==null?void 0:m.docs,source:{originalSource:`{
14
- render: () => <ControlledDemo />
15
- }`,...(c=(d=r.parameters)==null?void 0:d.docs)==null?void 0:c.source}}};const H=["Basic","Controlled"];export{o as Basic,r as Controlled,H as __namedExportsOrder,G as default};