@intlayer/design-system 7.0.8 → 7.0.9-canary.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (363) hide show
  1. package/README.md +4 -4
  2. package/dist/esm/components/Accordion/Accordion.mjs +1 -1
  3. package/dist/esm/components/Accordion/Accordion.mjs.map +1 -1
  4. package/dist/esm/components/Avatar/index.mjs +2 -2
  5. package/dist/esm/components/Avatar/index.mjs.map +1 -1
  6. package/dist/esm/components/Badge/index.mjs +1 -1
  7. package/dist/esm/components/Badge/index.mjs.map +1 -1
  8. package/dist/esm/components/Breadcrumb/index.mjs +4 -4
  9. package/dist/esm/components/Breadcrumb/index.mjs.map +1 -1
  10. package/dist/esm/components/Button/Button.mjs +99 -88
  11. package/dist/esm/components/Button/Button.mjs.map +1 -1
  12. package/dist/esm/components/Button/index.mjs +2 -2
  13. package/dist/esm/components/ClickOutsideDiv/index.mjs +1 -1
  14. package/dist/esm/components/ClickOutsideDiv/index.mjs.map +1 -1
  15. package/dist/esm/components/CollapsibleTable/CollapsibleTable.mjs +1 -1
  16. package/dist/esm/components/CollapsibleTable/CollapsibleTable.mjs.map +1 -1
  17. package/dist/esm/components/Command/index.mjs +8 -8
  18. package/dist/esm/components/Command/index.mjs.map +1 -1
  19. package/dist/esm/components/Container/index.mjs +14 -13
  20. package/dist/esm/components/Container/index.mjs.map +1 -1
  21. package/dist/esm/components/ContentEditor/ContentEditor.mjs +1 -1
  22. package/dist/esm/components/ContentEditor/ContentEditor.mjs.map +1 -1
  23. package/dist/esm/components/ContentEditor/ContentEditorInput.mjs +1 -1
  24. package/dist/esm/components/ContentEditor/ContentEditorInput.mjs.map +1 -1
  25. package/dist/esm/components/ContentEditor/ContentEditorTextArea.mjs +1 -1
  26. package/dist/esm/components/ContentEditor/ContentEditorTextArea.mjs.map +1 -1
  27. package/dist/esm/components/CopyButton/index.mjs +1 -1
  28. package/dist/esm/components/CopyButton/index.mjs.map +1 -1
  29. package/dist/esm/components/CopyToClipboard/index.mjs +29 -27
  30. package/dist/esm/components/CopyToClipboard/index.mjs.map +1 -1
  31. package/dist/esm/components/DictionaryEditor/DictionaryEditor.mjs +1 -1
  32. package/dist/esm/components/DictionaryEditor/DictionaryEditor.mjs.map +1 -1
  33. package/dist/esm/components/DictionaryEditor/ItemLayout.mjs +6 -3
  34. package/dist/esm/components/DictionaryEditor/ItemLayout.mjs.map +1 -1
  35. package/dist/esm/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.mjs +2 -1
  36. package/dist/esm/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.mjs.map +1 -1
  37. package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +40 -22
  38. package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs.map +1 -1
  39. package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +1 -1
  40. package/dist/esm/components/DictionaryFieldEditor/KeyPathBreadcrumb.mjs +2 -1
  41. package/dist/esm/components/DictionaryFieldEditor/KeyPathBreadcrumb.mjs.map +1 -1
  42. package/dist/esm/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +1 -1
  43. package/dist/esm/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
  44. package/dist/esm/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +2 -2
  45. package/dist/esm/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
  46. package/dist/esm/components/DictionaryFieldEditor/StructureView/StructureView.mjs +2 -2
  47. package/dist/esm/components/DictionaryFieldEditor/StructureView/StructureView.mjs.map +1 -1
  48. package/dist/esm/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs +1 -1
  49. package/dist/esm/components/DropDown/index.mjs +3 -3
  50. package/dist/esm/components/DropDown/index.mjs.map +1 -1
  51. package/dist/esm/components/EditableField/EditableFieldInput.mjs +1 -1
  52. package/dist/esm/components/EditableField/EditableFieldInput.mjs.map +1 -1
  53. package/dist/esm/components/EditableField/EditableFieldLayout.mjs +1 -1
  54. package/dist/esm/components/EditableField/EditableFieldLayout.mjs.map +1 -1
  55. package/dist/esm/components/EditableField/EditableFieldTextArea.mjs +1 -1
  56. package/dist/esm/components/EditableField/EditableFieldTextArea.mjs.map +1 -1
  57. package/dist/esm/components/Flags/Flag.mjs +1 -1
  58. package/dist/esm/components/Flags/Flag.mjs.map +1 -1
  59. package/dist/esm/components/Form/Form.mjs +4 -0
  60. package/dist/esm/components/Form/Form.mjs.map +1 -1
  61. package/dist/esm/components/Form/FormBase.mjs +1 -1
  62. package/dist/esm/components/Form/FormBase.mjs.map +1 -1
  63. package/dist/esm/components/Form/FormItem.mjs +1 -1
  64. package/dist/esm/components/Form/FormItem.mjs.map +1 -1
  65. package/dist/esm/components/Form/FormLabel.mjs +1 -1
  66. package/dist/esm/components/Form/FormLabel.mjs.map +1 -1
  67. package/dist/esm/components/Form/FormMessage.mjs +1 -1
  68. package/dist/esm/components/Form/FormMessage.mjs.map +1 -1
  69. package/dist/esm/components/Form/elements/AutoSizeTextAreaElement.mjs.map +1 -1
  70. package/dist/esm/components/Form/elements/CheckboxElement.mjs +2 -2
  71. package/dist/esm/components/Form/elements/CheckboxElement.mjs.map +1 -1
  72. package/dist/esm/components/Form/elements/CodeInputElement.mjs +40 -0
  73. package/dist/esm/components/Form/elements/CodeInputElement.mjs.map +1 -0
  74. package/dist/esm/components/Form/elements/FormElement.mjs +2 -2
  75. package/dist/esm/components/Form/elements/FormElement.mjs.map +1 -1
  76. package/dist/esm/components/Form/elements/FormElementWrapper.mjs +1 -1
  77. package/dist/esm/components/Form/elements/FormElementWrapper.mjs.map +1 -1
  78. package/dist/esm/components/Form/elements/InputPasswordElement.mjs +1 -1
  79. package/dist/esm/components/Form/elements/InputPasswordElement.mjs.map +1 -1
  80. package/dist/esm/components/Form/elements/MultiselectElement.mjs +30 -19
  81. package/dist/esm/components/Form/elements/MultiselectElement.mjs.map +1 -1
  82. package/dist/esm/components/Form/elements/OTPElement.mjs +114 -0
  83. package/dist/esm/components/Form/elements/OTPElement.mjs.map +1 -0
  84. package/dist/esm/components/Form/elements/SearchInputElement.mjs +17 -0
  85. package/dist/esm/components/Form/elements/SearchInputElement.mjs.map +1 -0
  86. package/dist/esm/components/Form/elements/SelectElement.mjs +30 -19
  87. package/dist/esm/components/Form/elements/SelectElement.mjs.map +1 -1
  88. package/dist/esm/components/Form/elements/SwitchSelectorElement.mjs +29 -18
  89. package/dist/esm/components/Form/elements/SwitchSelectorElement.mjs.map +1 -1
  90. package/dist/esm/components/Form/elements/index.mjs +3 -1
  91. package/dist/esm/components/Form/layout/FormItemLayout.mjs +1 -2
  92. package/dist/esm/components/Form/layout/FormItemLayout.mjs.map +1 -1
  93. package/dist/esm/components/Headers/index.mjs +19 -19
  94. package/dist/esm/components/Headers/index.mjs.map +1 -1
  95. package/dist/esm/components/HeightResizer/index.mjs +1 -1
  96. package/dist/esm/components/HeightResizer/index.mjs.map +1 -1
  97. package/dist/esm/components/HideShow/index.mjs +2 -1
  98. package/dist/esm/components/HideShow/index.mjs.map +1 -1
  99. package/dist/esm/components/IDE/Code.mjs +1 -1
  100. package/dist/esm/components/IDE/Code.mjs.map +1 -1
  101. package/dist/esm/components/IDE/CodeBlockClient.mjs +1 -1
  102. package/dist/esm/components/IDE/CodeBlockClient.mjs.map +1 -1
  103. package/dist/esm/components/IDE/CodeBlockServer.mjs +3 -3
  104. package/dist/esm/components/IDE/CodeBlockServer.mjs.map +1 -1
  105. package/dist/esm/components/IDE/CodeConditionalRenderer.mjs +1 -1
  106. package/dist/esm/components/IDE/CodeConditionalRenderer.mjs.map +1 -1
  107. package/dist/esm/components/IDE/CodeFormatSelector.mjs +4 -1
  108. package/dist/esm/components/IDE/CodeFormatSelector.mjs.map +1 -1
  109. package/dist/esm/components/IDE/ContentDeclarationFormatSelector.mjs +4 -1
  110. package/dist/esm/components/IDE/ContentDeclarationFormatSelector.mjs.map +1 -1
  111. package/dist/esm/components/IDE/FileList.mjs +1 -1
  112. package/dist/esm/components/IDE/FileList.mjs.map +1 -1
  113. package/dist/esm/components/IDE/IDE.mjs +1 -1
  114. package/dist/esm/components/IDE/IDE.mjs.map +1 -1
  115. package/dist/esm/components/IDE/PackageManagerSelector.mjs +4 -1
  116. package/dist/esm/components/IDE/PackageManagerSelector.mjs.map +1 -1
  117. package/dist/esm/components/InformationTag/index.mjs +1 -1
  118. package/dist/esm/components/InformationTag/index.mjs.map +1 -1
  119. package/dist/esm/components/Input/Checkbox.mjs +22 -15
  120. package/dist/esm/components/Input/Checkbox.mjs.map +1 -1
  121. package/dist/esm/components/Input/CodeInput.mjs +84 -0
  122. package/dist/esm/components/Input/CodeInput.mjs.map +1 -0
  123. package/dist/esm/components/Input/Input.mjs +25 -14
  124. package/dist/esm/components/Input/Input.mjs.map +1 -1
  125. package/dist/esm/components/Input/InputPassword.mjs +1 -1
  126. package/dist/esm/components/Input/InputPassword.mjs.map +1 -1
  127. package/dist/esm/components/Input/OTPInput/Input.mjs +426 -0
  128. package/dist/esm/components/Input/OTPInput/Input.mjs.map +1 -0
  129. package/dist/esm/components/Input/OTPInput/index.mjs +495 -0
  130. package/dist/esm/components/Input/OTPInput/index.mjs.map +1 -0
  131. package/dist/esm/components/Input/OTPInput.mjs +495 -0
  132. package/dist/esm/components/Input/OTPInput.mjs.map +1 -0
  133. package/dist/esm/components/Input/SearchInput.mjs +1 -1
  134. package/dist/esm/components/Input/SearchInput.mjs.map +1 -1
  135. package/dist/esm/components/Input/index.mjs +2 -1
  136. package/dist/esm/components/KeyboardScreenAdapter/index.mjs +1 -1
  137. package/dist/esm/components/KeyboardScreenAdapter/index.mjs.map +1 -1
  138. package/dist/esm/components/Label/index.mjs +1 -1
  139. package/dist/esm/components/Label/index.mjs.map +1 -1
  140. package/dist/esm/components/Link/Link.mjs +1 -1
  141. package/dist/esm/components/Link/Link.mjs.map +1 -1
  142. package/dist/esm/components/Loader/index.mjs +1 -1
  143. package/dist/esm/components/Loader/index.mjs.map +1 -1
  144. package/dist/esm/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +1 -1
  145. package/dist/esm/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs +1 -1
  146. package/dist/esm/components/Logo/Logo.mjs +1 -1
  147. package/dist/esm/components/Logo/Logo.mjs.map +1 -1
  148. package/dist/esm/components/Logo/LogoWithTextBelow.mjs +1 -1
  149. package/dist/esm/components/Logo/LogoWithTextBelow.mjs.map +1 -1
  150. package/dist/esm/components/MarkDownRender/MarkDownRender.mjs +16 -11
  151. package/dist/esm/components/MarkDownRender/MarkDownRender.mjs.map +1 -1
  152. package/dist/esm/components/MarkDownRender/processor.mjs +1 -1
  153. package/dist/esm/components/MarkDownRender/processor.mjs.map +1 -1
  154. package/dist/esm/components/MaxHeightSmoother/index.mjs +1 -1
  155. package/dist/esm/components/MaxHeightSmoother/index.mjs.map +1 -1
  156. package/dist/esm/components/MaxWidthSmoother/index.mjs +1 -1
  157. package/dist/esm/components/MaxWidthSmoother/index.mjs.map +1 -1
  158. package/dist/esm/components/Modal/Modal.mjs +48 -41
  159. package/dist/esm/components/Modal/Modal.mjs.map +1 -1
  160. package/dist/esm/components/Navbar/Burger.mjs +1 -1
  161. package/dist/esm/components/Navbar/Burger.mjs.map +1 -1
  162. package/dist/esm/components/Pagination/Pagination.mjs +1 -1
  163. package/dist/esm/components/Pagination/Pagination.mjs.map +1 -1
  164. package/dist/esm/components/Pagination/ShowingResultsNumberItems.mjs +5 -2
  165. package/dist/esm/components/Pagination/ShowingResultsNumberItems.mjs.map +1 -1
  166. package/dist/esm/components/Pattern/DotPattern.mjs +1 -1
  167. package/dist/esm/components/Pattern/DotPattern.mjs.map +1 -1
  168. package/dist/esm/components/Pattern/GridPattern.mjs +1 -1
  169. package/dist/esm/components/Pattern/GridPattern.mjs.map +1 -1
  170. package/dist/esm/components/Pattern/SpotLight.mjs +1 -1
  171. package/dist/esm/components/Pattern/SpotLight.mjs.map +1 -1
  172. package/dist/esm/components/Popover/dynamic.mjs +1 -1
  173. package/dist/esm/components/Popover/dynamic.mjs.map +1 -1
  174. package/dist/esm/components/Popover/static.mjs +2 -2
  175. package/dist/esm/components/Popover/static.mjs.map +1 -1
  176. package/dist/esm/components/PressableSpan/PressableSpan.mjs +1 -1
  177. package/dist/esm/components/PressableSpan/PressableSpan.mjs.map +1 -1
  178. package/dist/esm/components/RightDrawer/RightDrawer.mjs +1 -1
  179. package/dist/esm/components/Select/Multiselect.mjs +7 -7
  180. package/dist/esm/components/Select/Multiselect.mjs.map +1 -1
  181. package/dist/esm/components/Select/Select.mjs +12 -12
  182. package/dist/esm/components/Select/Select.mjs.map +1 -1
  183. package/dist/esm/components/SocialNetworks/index.mjs +3 -8
  184. package/dist/esm/components/SocialNetworks/index.mjs.map +1 -1
  185. package/dist/esm/components/SwitchSelector/index.mjs +35 -27
  186. package/dist/esm/components/SwitchSelector/index.mjs.map +1 -1
  187. package/dist/esm/components/Tab/Tab.mjs +2 -2
  188. package/dist/esm/components/Tab/Tab.mjs.map +1 -1
  189. package/dist/esm/components/TabSelector/TabSelector.mjs +1 -1
  190. package/dist/esm/components/TabSelector/TabSelector.mjs.map +1 -1
  191. package/dist/esm/components/Table/Table.mjs +1 -1
  192. package/dist/esm/components/Table/Table.mjs.map +1 -1
  193. package/dist/esm/components/Tag/index.mjs +1 -1
  194. package/dist/esm/components/Tag/index.mjs.map +1 -1
  195. package/dist/esm/components/TextArea/AutoSizeTextArea.mjs +1 -1
  196. package/dist/esm/components/TextArea/AutoSizeTextArea.mjs.map +1 -1
  197. package/dist/esm/components/TextArea/AutocompleteTextArea.mjs +1 -1
  198. package/dist/esm/components/TextArea/AutocompleteTextArea.mjs.map +1 -1
  199. package/dist/esm/components/TextArea/TextArea.mjs +1 -1
  200. package/dist/esm/components/TextArea/TextArea.mjs.map +1 -1
  201. package/dist/esm/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.mjs +2 -2
  202. package/dist/esm/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.mjs.map +1 -1
  203. package/dist/esm/components/Toaster/Toast.mjs +7 -7
  204. package/dist/esm/components/Toaster/Toast.mjs.map +1 -1
  205. package/dist/esm/components/Toaster/Toaster.mjs +1 -1
  206. package/dist/esm/components/Toaster/Toaster.mjs.map +1 -1
  207. package/dist/esm/components/index.mjs +6 -5
  208. package/dist/esm/hooks/index.mjs +4 -3
  209. package/dist/esm/hooks/reactQuery.mjs +66 -3
  210. package/dist/esm/hooks/reactQuery.mjs.map +1 -1
  211. package/dist/esm/hooks/useAuth/useSession.mjs +5 -3
  212. package/dist/esm/hooks/useAuth/useSession.mjs.map +1 -1
  213. package/dist/esm/hooks/useDevice.mjs +16 -2
  214. package/dist/esm/hooks/useDevice.mjs.map +1 -1
  215. package/dist/esm/hooks/useItemSelector.mjs +4 -1
  216. package/dist/esm/hooks/useItemSelector.mjs.map +1 -1
  217. package/dist/esm/libs/auth.mjs +77 -32
  218. package/dist/esm/libs/auth.mjs.map +1 -1
  219. package/dist/types/Checkbox.d.ts +2 -0
  220. package/dist/types/Input.d.ts +16 -0
  221. package/dist/types/Input.d.ts.map +1 -0
  222. package/dist/types/InputPassword.d.ts +2 -0
  223. package/dist/types/OTPElement.d.ts +30 -0
  224. package/dist/types/OTPElement.d.ts.map +1 -0
  225. package/dist/types/OTPInput.d.ts +3 -0
  226. package/dist/types/SearchInput.d.ts +1 -0
  227. package/dist/types/components/Badge/index.d.ts +2 -2
  228. package/dist/types/components/Breadcrumb/breadcrumb.content.d.ts +3 -3
  229. package/dist/types/components/Breadcrumb/index.d.ts +2 -2
  230. package/dist/types/components/Breadcrumb/index.d.ts.map +1 -1
  231. package/dist/types/components/Browser/Browser.content.d.ts +11 -11
  232. package/dist/types/components/Button/Button.d.ts +10 -18
  233. package/dist/types/components/Button/Button.d.ts.map +1 -1
  234. package/dist/types/components/Button/index.d.ts +2 -2
  235. package/dist/types/components/CollapsibleTable/CollapsibleTable.d.ts +5 -5
  236. package/dist/types/components/CollapsibleTable/CollapsibleTable.d.ts.map +1 -1
  237. package/dist/types/components/Command/index.d.ts +13 -13
  238. package/dist/types/components/Container/index.d.ts +9 -9
  239. package/dist/types/components/Container/index.d.ts.map +1 -1
  240. package/dist/types/components/CopyToClipboard/index.d.ts +7 -3
  241. package/dist/types/components/CopyToClipboard/index.d.ts.map +1 -1
  242. package/dist/types/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.d.ts.map +1 -1
  243. package/dist/types/components/DictionaryFieldEditor/ContentEditorView/TextEditor.d.ts.map +1 -1
  244. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts +25 -25
  245. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.d.ts +9 -9
  246. package/dist/types/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.d.ts.map +1 -1
  247. package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts +33 -33
  248. package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.d.ts +25 -25
  249. package/dist/types/components/DictionaryFieldEditor/KeyPathBreadcrumb.d.ts.map +1 -1
  250. package/dist/types/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts +25 -25
  251. package/dist/types/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts +33 -33
  252. package/dist/types/components/DictionaryFieldEditor/StructureView/structureView.content.d.ts +9 -9
  253. package/dist/types/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.d.ts +7 -7
  254. package/dist/types/components/DictionaryFieldEditor/dictionaryFieldEditor.content.d.ts +5 -5
  255. package/dist/types/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts +31 -31
  256. package/dist/types/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts.map +1 -1
  257. package/dist/types/components/ExpandCollapse/expandCollapse.content.d.ts +3 -3
  258. package/dist/types/components/Form/Form.d.ts +4 -0
  259. package/dist/types/components/Form/Form.d.ts.map +1 -1
  260. package/dist/types/components/Form/FormBase.d.ts +2 -2
  261. package/dist/types/components/Form/FormBase.d.ts.map +1 -1
  262. package/dist/types/components/Form/FormField.d.ts +2 -2
  263. package/dist/types/components/Form/FormField.d.ts.map +1 -1
  264. package/dist/types/components/Form/FormItem.d.ts +2 -2
  265. package/dist/types/components/Form/FormItem.d.ts.map +1 -1
  266. package/dist/types/components/Form/elements/AutoSizeTextAreaElement.d.ts +2 -2
  267. package/dist/types/components/Form/elements/AutoSizeTextAreaElement.d.ts.map +1 -1
  268. package/dist/types/components/Form/elements/EditableFieldInputElement.d.ts +2 -2
  269. package/dist/types/components/Form/elements/EditableFieldInputElement.d.ts.map +1 -1
  270. package/dist/types/components/Form/elements/FormElement.d.ts +2 -2
  271. package/dist/types/components/Form/elements/MultiselectElement.d.ts +2 -2
  272. package/dist/types/components/Form/elements/MultiselectElement.d.ts.map +1 -1
  273. package/dist/types/components/Form/elements/OTPElement.d.ts +30 -0
  274. package/dist/types/components/Form/elements/OTPElement.d.ts.map +1 -0
  275. package/dist/types/components/Form/elements/SearchInputElement.d.ts +13 -0
  276. package/dist/types/components/Form/elements/SearchInputElement.d.ts.map +1 -0
  277. package/dist/types/components/Form/elements/SelectElement.d.ts +2 -2
  278. package/dist/types/components/Form/elements/SelectElement.d.ts.map +1 -1
  279. package/dist/types/components/Form/elements/SwitchSelectorElement.d.ts +2 -2
  280. package/dist/types/components/Form/elements/SwitchSelectorElement.d.ts.map +1 -1
  281. package/dist/types/components/Form/elements/index.d.ts +3 -1
  282. package/dist/types/components/HideShow/index.d.ts.map +1 -1
  283. package/dist/types/components/IDE/FileTree.d.ts.map +1 -1
  284. package/dist/types/components/IDE/code.content.d.ts +5 -5
  285. package/dist/types/components/IDE/code.content.d.ts.map +1 -1
  286. package/dist/types/components/IDE/copyCode.content.d.ts +5 -5
  287. package/dist/types/components/IDE/copyCode.content.d.ts.map +1 -1
  288. package/dist/types/components/Input/Checkbox.d.ts +5 -5
  289. package/dist/types/components/Input/Checkbox.d.ts.map +1 -1
  290. package/dist/types/components/Input/Input.d.ts +3 -3
  291. package/dist/types/components/Input/Input.d.ts.map +1 -1
  292. package/dist/types/components/Input/OTPInput/Input.d.ts +57 -0
  293. package/dist/types/components/Input/OTPInput/Input.d.ts.map +1 -0
  294. package/dist/types/components/Input/OTPInput/index.d.ts +78 -0
  295. package/dist/types/components/Input/OTPInput/index.d.ts.map +1 -0
  296. package/dist/types/components/Input/OTPInput.d.ts +78 -0
  297. package/dist/types/components/Input/OTPInput.d.ts.map +1 -0
  298. package/dist/types/components/Input/SearchInput.d.ts +2 -2
  299. package/dist/types/components/Input/index.d.ts +2 -1
  300. package/dist/types/components/Link/Link.d.ts +4 -4
  301. package/dist/types/components/Loader/index.content.d.ts +3 -3
  302. package/dist/types/components/Loader/spinner.d.ts +2 -2
  303. package/dist/types/components/LocaleSwitcherContentDropDown/localeSwitcher.content.d.ts +17 -17
  304. package/dist/types/components/LocaleSwitcherDropDown/localeSwitcher.content.d.ts +13 -13
  305. package/dist/types/components/MaxWidthSmoother/index.d.ts +2 -2
  306. package/dist/types/components/MaxWidthSmoother/index.d.ts.map +1 -1
  307. package/dist/types/components/Modal/Modal.d.ts.map +1 -1
  308. package/dist/types/components/Navbar/Burger.d.ts +2 -2
  309. package/dist/types/components/Navbar/Burger.d.ts.map +1 -1
  310. package/dist/types/components/Navbar/DesktopNavbar.d.ts +2 -2
  311. package/dist/types/components/Navbar/DesktopNavbar.d.ts.map +1 -1
  312. package/dist/types/components/Navbar/MobileNavbar.d.ts +2 -2
  313. package/dist/types/components/Navbar/MobileNavbar.d.ts.map +1 -1
  314. package/dist/types/components/Navbar/index.d.ts +2 -2
  315. package/dist/types/components/Navbar/index.d.ts.map +1 -1
  316. package/dist/types/components/Pagination/Pagination.d.ts +4 -4
  317. package/dist/types/components/Pagination/pagination.content.d.ts +11 -11
  318. package/dist/types/components/Popover/static.d.ts +3 -3
  319. package/dist/types/components/RightDrawer/useRightDrawerStore.d.ts +2 -2
  320. package/dist/types/components/Select/Multiselect.d.ts.map +1 -1
  321. package/dist/types/components/Select/Select.d.ts +3 -3
  322. package/dist/types/components/Select/Select.d.ts.map +1 -1
  323. package/dist/types/components/SocialNetworks/index.d.ts +2 -2
  324. package/dist/types/components/SocialNetworks/index.d.ts.map +1 -1
  325. package/dist/types/components/SwitchSelector/index.d.ts +10 -8
  326. package/dist/types/components/SwitchSelector/index.d.ts.map +1 -1
  327. package/dist/types/components/Tab/Tab.d.ts +5 -5
  328. package/dist/types/components/Tab/Tab.d.ts.map +1 -1
  329. package/dist/types/components/Tab/TabContext.d.ts +2 -2
  330. package/dist/types/components/TabSelector/TabSelector.d.ts +5 -5
  331. package/dist/types/components/TabSelector/TabSelector.d.ts.map +1 -1
  332. package/dist/types/components/Table/table.content.d.ts +3 -3
  333. package/dist/types/components/Table/table.content.d.ts.map +1 -1
  334. package/dist/types/components/Tag/index.d.ts +5 -5
  335. package/dist/types/components/Toaster/Toast.d.ts +2 -2
  336. package/dist/types/components/Toaster/Toaster.d.ts +2 -2
  337. package/dist/types/components/index.d.ts +4 -3
  338. package/dist/types/hooks/index.d.ts +5 -4
  339. package/dist/types/hooks/reactQuery.d.ts +1258 -65
  340. package/dist/types/hooks/reactQuery.d.ts.map +1 -1
  341. package/dist/types/hooks/useAuth/index.d.ts +2 -2
  342. package/dist/types/hooks/useAuth/useOAuth2.d.ts +2 -1
  343. package/dist/types/hooks/useAuth/useOAuth2.d.ts.map +1 -1
  344. package/dist/types/hooks/useAuth/useSession.d.ts +9 -4
  345. package/dist/types/hooks/useAuth/useSession.d.ts.map +1 -1
  346. package/dist/types/hooks/useDevice.d.ts +7 -1
  347. package/dist/types/hooks/useDevice.d.ts.map +1 -1
  348. package/dist/types/hooks/useItemSelector.d.ts +8 -1
  349. package/dist/types/hooks/useItemSelector.d.ts.map +1 -1
  350. package/dist/types/hooks/useScrollBlockage/useScrollBlockageStore.d.ts +2 -2
  351. package/dist/types/hooks/useUser/index.d.ts +18 -1
  352. package/dist/types/hooks/useUser/index.d.ts.map +1 -1
  353. package/dist/types/index.d.ts +5 -0
  354. package/dist/types/libs/auth.d.ts +3375 -2
  355. package/dist/types/libs/auth.d.ts.map +1 -1
  356. package/package.json +51 -45
  357. package/tailwind.css +55 -34
  358. package/dist/esm/components/Popover/index.mjs.map +0 -1
  359. package/dist/esm/utils/camelCase.mjs +0 -12
  360. package/dist/esm/utils/camelCase.mjs.map +0 -1
  361. package/dist/types/components/Popover/index.d.ts.map +0 -1
  362. package/dist/types/utils/camelCase.d.ts +0 -6
  363. package/dist/types/utils/camelCase.d.ts.map +0 -1
@@ -146,7 +146,7 @@ import { jsx } from "react/jsx-runtime";
146
146
  *
147
147
  * @returns A smooth height-transitioning container with configurable interaction modes
148
148
  */
149
- const MaxHeightSmoother = ({ children, isHidden, className = "", isOverable = false, isFocusable = false, minHeight = 0,...props }) => /* @__PURE__ */ jsx("div", {
149
+ const MaxHeightSmoother = ({ children, isHidden, className = "", isOverable = false, isFocusable = false, minHeight = 0, ...props }) => /* @__PURE__ */ jsx("div", {
150
150
  "aria-hidden": isFocusable ? isHidden : void 0,
151
151
  tabIndex: isFocusable ? 0 : void 0,
152
152
  role: isFocusable ? "button" : "none",
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["MaxHeightSmoother: FC<MaxHeightSmootherProps>"],"sources":["../../../../src/components/MaxHeightSmoother/index.tsx"],"sourcesContent":["import type { FC, HTMLAttributes, ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\n\n/**\n * Props for the MaxHeightSmoother component\n */\ninterface MaxHeightSmootherProps extends HTMLAttributes<HTMLDivElement> {\n /** Content to render within the smoother container */\n children: ReactNode;\n /** Controls collapse state. When true, content is collapsed; when false, expanded; when undefined, relies on hover/focus behavior */\n isHidden?: boolean;\n /** Enable expand-on-hover behavior */\n isOverable?: boolean;\n /** Enable expand-on-focus behavior for accessibility and keyboard navigation */\n isFocusable?: boolean;\n /** Minimum height in pixels for the collapsed state */\n minHeight?: number;\n}\n\n/**\n * MaxHeightSmoother Component\n *\n * A sophisticated container component that provides smooth height transitions\n * for collapsible content. Uses CSS Grid's fractional rows to create fluid\n * animations without JavaScript height calculations, making it performant\n * and smooth across all devices and screen sizes.\n *\n * @component\n * @example\n * Basic controlled usage:\n * ```tsx\n * const [isCollapsed, setIsCollapsed] = useState(true);\n *\n * <MaxHeightSmoother isHidden={isCollapsed}>\n * <div>Your collapsible content here</div>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * Hover-triggered expansion:\n * ```tsx\n * <MaxHeightSmoother isOverable={true}>\n * <div>\n * <p>This content expands when you hover over the container.</p>\n * <p>Perfect for preview cards or tooltips.</p>\n * </div>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * Accessible focus-triggered expansion:\n * ```tsx\n * <MaxHeightSmoother isFocusable={true}>\n * <div>\n * <h3>Expandable Section</h3>\n * <p>Tab to focus this container to expand the content.</p>\n * <p>Great for accessible progressive disclosure.</p>\n * </div>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * With minimum height for preview:\n * ```tsx\n * <MaxHeightSmoother\n * isOverable={true}\n * minHeight={100}\n * className=\"border rounded-lg p-4\"\n * >\n * <div>\n * <h3>Article Preview</h3>\n * <p>This article preview shows the first few lines...</p>\n * <p>Hover to see the full content with smooth expansion.</p>\n * <p>The minHeight ensures some content is always visible.</p>\n * </div>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * Combined hover and focus behavior:\n * ```tsx\n * <MaxHeightSmoother\n * isOverable={true}\n * isFocusable={true}\n * minHeight={80}\n * >\n * <div>\n * <h4>Interactive Card</h4>\n * <p>Expands on both hover and keyboard focus.</p>\n * <p>Accessible to both mouse and keyboard users.</p>\n * </div>\n * </MaxHeightSmoother>\n * ```\n *\n * Features:\n * - Smooth CSS Grid-based height transitions (700ms duration)\n * - Three interaction modes: controlled, hover, and focus\n * - Configurable minimum height for collapsed state\n * - Accessible keyboard navigation support\n * - Overflow handling with smooth scrolling\n * - ARIA attributes for screen reader compatibility\n * - Performance-optimized with CSS-only animations\n * - Responsive design that works on all screen sizes\n *\n * Animation Technique:\n * Uses CSS Grid `grid-rows-[0fr]` to `grid-rows-[1fr]` transitions\n * instead of height animations, which provides:\n * - Smooth animations without knowing content height\n * - Better performance (no layout recalculations)\n * - More reliable across different content types\n * - Automatic adaptation to dynamic content changes\n *\n * Interaction Modes:\n * 1. **Controlled**: Use `isHidden` prop for external state control\n * 2. **Hover**: Set `isOverable={true}` for mouse hover expansion\n * 3. **Focus**: Set `isFocusable={true}` for keyboard focus expansion\n * 4. **Combined**: Use both `isOverable` and `isFocusable` together\n *\n * Accessibility Features:\n * - `role=\"button\"` when focusable for proper screen reader context\n * - `tabIndex={0}` for keyboard navigation when focusable\n * - `aria-hidden` attribute for screen reader control\n * - Semantic focus management with focus-within pseudo-class\n * - High contrast focus indicators\n * - Respects prefers-reduced-motion settings\n *\n * Use Cases:\n * - FAQ accordions and expandable sections\n * - Article previews and read-more functionality\n * - Card hover effects and content previews\n * - Progressive disclosure for complex forms\n * - Tooltip and popover content containers\n * - Mobile-friendly collapsible navigation\n * - Dashboard widget expansion\n * - Email preview in mail clients\n *\n * Performance Considerations:\n * - Pure CSS animations (no JavaScript timer overhead)\n * - GPU acceleration through transform-based animations\n * - Minimal repaints and layout shifts\n * - Efficient event handling with CSS pseudo-classes\n * - No DOM measurements or calculations required\n *\n * @param props - Component props extending HTML div attributes\n * @param props.children - Content to render within the container\n * @param props.isHidden - Controlled collapse state (true=collapsed, false=expanded)\n * @param props.isOverable - Enable hover-to-expand behavior\n * @param props.isFocusable - Enable focus-to-expand behavior with keyboard navigation\n * @param props.minHeight - Minimum height in pixels for collapsed state (default: 0)\n * @param props.className - Additional CSS classes for styling\n * @param props.style - Inline styles (note: minHeight style will be applied)\n * @param props.role - ARIA role (automatically set to \"button\" when focusable)\n * @param props.tabIndex - Tab index (automatically set to 0 when focusable)\n * @param props.aria-hidden - ARIA hidden state (controlled by isHidden when focusable)\n * @param props.onClick - Click event handler\n * @param props.onMouseEnter - Mouse enter event handler\n * @param props.onMouseLeave - Mouse leave event handler\n * @param props.onFocus - Focus event handler\n * @param props.onBlur - Blur event handler\n * @param props...rest - All other standard HTML div attributes\n *\n * @returns A smooth height-transitioning container with configurable interaction modes\n */\nexport const MaxHeightSmoother: FC<MaxHeightSmootherProps> = ({\n children,\n isHidden,\n className = '',\n isOverable = false,\n isFocusable = false,\n minHeight = 0,\n ...props\n}) => (\n <div\n aria-hidden={isFocusable ? isHidden : undefined}\n tabIndex={isFocusable ? 0 : undefined}\n role={isFocusable ? 'button' : 'none'}\n className={cn(\n 'group/height-smoother relative grid w-full grid-rows-[0fr] overflow-hidden transition-all duration-700 ease-in-out',\n typeof isHidden !== 'undefined' &&\n !isHidden &&\n 'grid-rows-[1fr] overflow-x-auto',\n isOverable && 'hover:grid-rows-[1fr] hover:overflow-x-auto',\n isFocusable &&\n 'focus-within:grid-rows-[1fr] focus-within:overflow-x-auto focus:grid-rows-[1fr] focus:overflow-x-auto',\n className\n )}\n {...props}\n >\n <div\n style={{\n minHeight: `${minHeight}px`,\n }}\n className={cn(\n isOverable && 'group-hover/height-smoother:visible',\n isFocusable && 'group-focus/height-smoother:visible',\n className\n )}\n >\n {children}\n </div>\n </div>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmKA,MAAaA,qBAAiD,EAC5D,UACA,UACA,YAAY,IACZ,aAAa,OACb,cAAc,OACd,YAAY,EACZ,GAAG,YAEH,oBAAC;CACC,eAAa,cAAc,WAAW;CACtC,UAAU,cAAc,IAAI;CAC5B,MAAM,cAAc,WAAW;CAC/B,WAAW,GACT,sHACA,OAAO,aAAa,eAClB,CAAC,YACD,mCACF,cAAc,+CACd,eACE,yGACF,UACD;CACD,GAAI;WAEJ,oBAAC;EACC,OAAO,EACL,WAAW,GAAG,UAAU,KACzB;EACD,WAAW,GACT,cAAc,uCACd,eAAe,uCACf,UACD;EAEA;GACG;EACF"}
1
+ {"version":3,"file":"index.mjs","names":["MaxHeightSmoother: FC<MaxHeightSmootherProps>"],"sources":["../../../../src/components/MaxHeightSmoother/index.tsx"],"sourcesContent":["import type { FC, HTMLAttributes, ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\n\n/**\n * Props for the MaxHeightSmoother component\n */\ninterface MaxHeightSmootherProps extends HTMLAttributes<HTMLDivElement> {\n /** Content to render within the smoother container */\n children: ReactNode;\n /** Controls collapse state. When true, content is collapsed; when false, expanded; when undefined, relies on hover/focus behavior */\n isHidden?: boolean;\n /** Enable expand-on-hover behavior */\n isOverable?: boolean;\n /** Enable expand-on-focus behavior for accessibility and keyboard navigation */\n isFocusable?: boolean;\n /** Minimum height in pixels for the collapsed state */\n minHeight?: number;\n}\n\n/**\n * MaxHeightSmoother Component\n *\n * A sophisticated container component that provides smooth height transitions\n * for collapsible content. Uses CSS Grid's fractional rows to create fluid\n * animations without JavaScript height calculations, making it performant\n * and smooth across all devices and screen sizes.\n *\n * @component\n * @example\n * Basic controlled usage:\n * ```tsx\n * const [isCollapsed, setIsCollapsed] = useState(true);\n *\n * <MaxHeightSmoother isHidden={isCollapsed}>\n * <div>Your collapsible content here</div>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * Hover-triggered expansion:\n * ```tsx\n * <MaxHeightSmoother isOverable={true}>\n * <div>\n * <p>This content expands when you hover over the container.</p>\n * <p>Perfect for preview cards or tooltips.</p>\n * </div>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * Accessible focus-triggered expansion:\n * ```tsx\n * <MaxHeightSmoother isFocusable={true}>\n * <div>\n * <h3>Expandable Section</h3>\n * <p>Tab to focus this container to expand the content.</p>\n * <p>Great for accessible progressive disclosure.</p>\n * </div>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * With minimum height for preview:\n * ```tsx\n * <MaxHeightSmoother\n * isOverable={true}\n * minHeight={100}\n * className=\"border rounded-lg p-4\"\n * >\n * <div>\n * <h3>Article Preview</h3>\n * <p>This article preview shows the first few lines...</p>\n * <p>Hover to see the full content with smooth expansion.</p>\n * <p>The minHeight ensures some content is always visible.</p>\n * </div>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * Combined hover and focus behavior:\n * ```tsx\n * <MaxHeightSmoother\n * isOverable={true}\n * isFocusable={true}\n * minHeight={80}\n * >\n * <div>\n * <h4>Interactive Card</h4>\n * <p>Expands on both hover and keyboard focus.</p>\n * <p>Accessible to both mouse and keyboard users.</p>\n * </div>\n * </MaxHeightSmoother>\n * ```\n *\n * Features:\n * - Smooth CSS Grid-based height transitions (700ms duration)\n * - Three interaction modes: controlled, hover, and focus\n * - Configurable minimum height for collapsed state\n * - Accessible keyboard navigation support\n * - Overflow handling with smooth scrolling\n * - ARIA attributes for screen reader compatibility\n * - Performance-optimized with CSS-only animations\n * - Responsive design that works on all screen sizes\n *\n * Animation Technique:\n * Uses CSS Grid `grid-rows-[0fr]` to `grid-rows-[1fr]` transitions\n * instead of height animations, which provides:\n * - Smooth animations without knowing content height\n * - Better performance (no layout recalculations)\n * - More reliable across different content types\n * - Automatic adaptation to dynamic content changes\n *\n * Interaction Modes:\n * 1. **Controlled**: Use `isHidden` prop for external state control\n * 2. **Hover**: Set `isOverable={true}` for mouse hover expansion\n * 3. **Focus**: Set `isFocusable={true}` for keyboard focus expansion\n * 4. **Combined**: Use both `isOverable` and `isFocusable` together\n *\n * Accessibility Features:\n * - `role=\"button\"` when focusable for proper screen reader context\n * - `tabIndex={0}` for keyboard navigation when focusable\n * - `aria-hidden` attribute for screen reader control\n * - Semantic focus management with focus-within pseudo-class\n * - High contrast focus indicators\n * - Respects prefers-reduced-motion settings\n *\n * Use Cases:\n * - FAQ accordions and expandable sections\n * - Article previews and read-more functionality\n * - Card hover effects and content previews\n * - Progressive disclosure for complex forms\n * - Tooltip and popover content containers\n * - Mobile-friendly collapsible navigation\n * - Dashboard widget expansion\n * - Email preview in mail clients\n *\n * Performance Considerations:\n * - Pure CSS animations (no JavaScript timer overhead)\n * - GPU acceleration through transform-based animations\n * - Minimal repaints and layout shifts\n * - Efficient event handling with CSS pseudo-classes\n * - No DOM measurements or calculations required\n *\n * @param props - Component props extending HTML div attributes\n * @param props.children - Content to render within the container\n * @param props.isHidden - Controlled collapse state (true=collapsed, false=expanded)\n * @param props.isOverable - Enable hover-to-expand behavior\n * @param props.isFocusable - Enable focus-to-expand behavior with keyboard navigation\n * @param props.minHeight - Minimum height in pixels for collapsed state (default: 0)\n * @param props.className - Additional CSS classes for styling\n * @param props.style - Inline styles (note: minHeight style will be applied)\n * @param props.role - ARIA role (automatically set to \"button\" when focusable)\n * @param props.tabIndex - Tab index (automatically set to 0 when focusable)\n * @param props.aria-hidden - ARIA hidden state (controlled by isHidden when focusable)\n * @param props.onClick - Click event handler\n * @param props.onMouseEnter - Mouse enter event handler\n * @param props.onMouseLeave - Mouse leave event handler\n * @param props.onFocus - Focus event handler\n * @param props.onBlur - Blur event handler\n * @param props...rest - All other standard HTML div attributes\n *\n * @returns A smooth height-transitioning container with configurable interaction modes\n */\nexport const MaxHeightSmoother: FC<MaxHeightSmootherProps> = ({\n children,\n isHidden,\n className = '',\n isOverable = false,\n isFocusable = false,\n minHeight = 0,\n ...props\n}) => (\n <div\n aria-hidden={isFocusable ? isHidden : undefined}\n tabIndex={isFocusable ? 0 : undefined}\n role={isFocusable ? 'button' : 'none'}\n className={cn(\n 'group/height-smoother relative grid w-full grid-rows-[0fr] overflow-hidden transition-all duration-700 ease-in-out',\n typeof isHidden !== 'undefined' &&\n !isHidden &&\n 'grid-rows-[1fr] overflow-x-auto',\n isOverable && 'hover:grid-rows-[1fr] hover:overflow-x-auto',\n isFocusable &&\n 'focus-within:grid-rows-[1fr] focus-within:overflow-x-auto focus:grid-rows-[1fr] focus:overflow-x-auto',\n className\n )}\n {...props}\n >\n <div\n style={{\n minHeight: `${minHeight}px`,\n }}\n className={cn(\n isOverable && 'group-hover/height-smoother:visible',\n isFocusable && 'group-focus/height-smoother:visible',\n className\n )}\n >\n {children}\n </div>\n </div>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmKA,MAAaA,qBAAiD,EAC5D,UACA,UACA,YAAY,IACZ,aAAa,OACb,cAAc,OACd,YAAY,GACZ,GAAG,YAEH,oBAAC;CACC,eAAa,cAAc,WAAW;CACtC,UAAU,cAAc,IAAI;CAC5B,MAAM,cAAc,WAAW;CAC/B,WAAW,GACT,sHACA,OAAO,aAAa,eAClB,CAAC,YACD,mCACF,cAAc,+CACd,eACE,yGACF,UACD;CACD,GAAI;WAEJ,oBAAC;EACC,OAAO,EACL,WAAW,GAAG,UAAU,KACzB;EACD,WAAW,GACT,cAAc,uCACd,eAAe,uCACf,UACD;EAEA;GACG;EACF"}
@@ -2,7 +2,7 @@ import { cn } from "../../utils/cn.mjs";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/MaxWidthSmoother/index.tsx
5
- const MaxWidthSmoother = ({ children, isHidden, minWidth = 0, align = "left", className,...props }) => /* @__PURE__ */ jsx("div", {
5
+ const MaxWidthSmoother = ({ children, isHidden, minWidth = 0, align = "left", className, ...props }) => /* @__PURE__ */ jsx("div", {
6
6
  className: cn("relative grid h-full grid-cols-[0fr] overflow-x-hidden overflow-y-hidden transition-all duration-500 ease-in-out", isHidden ? "" : "grid-cols-[1fr]", className),
7
7
  "aria-hidden": isHidden,
8
8
  ...props,
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/MaxWidthSmoother/index.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\nimport { cn } from '../../utils/cn';\n\ntype Align = 'left' | 'right';\n\ntype MaxHeightSmootherProps = HTMLAttributes<HTMLDivElement> & {\n isHidden: boolean;\n minWidth?: number;\n align?: Align;\n};\n\nexport const MaxWidthSmoother = ({\n children,\n isHidden,\n minWidth = 0,\n align = 'left',\n className,\n ...props\n}: MaxHeightSmootherProps) => (\n <div\n className={cn(\n 'relative grid h-full grid-cols-[0fr] overflow-x-hidden overflow-y-hidden transition-all duration-500 ease-in-out',\n isHidden ? '' : 'grid-cols-[1fr]',\n className\n )}\n aria-hidden={isHidden}\n {...props}\n >\n <div\n style={{\n minWidth: `${minWidth}px`,\n }}\n tabIndex={isHidden !== false ? undefined : -1}\n className={cn(align === 'right' && 'ml-auto')}\n >\n {children}\n </div>\n </div>\n);\n"],"mappings":";;;;AAWA,MAAa,oBAAoB,EAC/B,UACA,UACA,WAAW,GACX,QAAQ,QACR,UACA,GAAG,YAEH,oBAAC;CACC,WAAW,GACT,oHACA,WAAW,KAAK,mBAChB,UACD;CACD,eAAa;CACb,GAAI;WAEJ,oBAAC;EACC,OAAO,EACL,UAAU,GAAG,SAAS,KACvB;EACD,UAAU,aAAa,QAAQ,SAAY;EAC3C,WAAW,GAAG,UAAU,WAAW,UAAU;EAE5C;GACG;EACF"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/MaxWidthSmoother/index.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\nimport { cn } from '../../utils/cn';\n\ntype Align = 'left' | 'right';\n\ntype MaxHeightSmootherProps = HTMLAttributes<HTMLDivElement> & {\n isHidden: boolean;\n minWidth?: number;\n align?: Align;\n};\n\nexport const MaxWidthSmoother = ({\n children,\n isHidden,\n minWidth = 0,\n align = 'left',\n className,\n ...props\n}: MaxHeightSmootherProps) => (\n <div\n className={cn(\n 'relative grid h-full grid-cols-[0fr] overflow-x-hidden overflow-y-hidden transition-all duration-500 ease-in-out',\n isHidden ? '' : 'grid-cols-[1fr]',\n className\n )}\n aria-hidden={isHidden}\n {...props}\n >\n <div\n style={{\n minWidth: `${minWidth}px`,\n }}\n tabIndex={isHidden !== false ? undefined : -1}\n className={cn(align === 'right' && 'ml-auto')}\n >\n {children}\n </div>\n </div>\n);\n"],"mappings":";;;;AAWA,MAAa,oBAAoB,EAC/B,UACA,UACA,WAAW,GACX,QAAQ,QACR,WACA,GAAG,YAEH,oBAAC;CACC,WAAW,GACT,oHACA,WAAW,KAAK,mBAChB,UACD;CACD,eAAa;CACb,GAAI;WAEJ,oBAAC;EACC,OAAO,EACL,UAAU,GAAG,SAAS,KACvB;EACD,UAAU,aAAa,QAAQ,SAAY;EAC3C,WAAW,GAAG,UAAU,WAAW,UAAU;EAE5C;GACG;EACF"}
@@ -2,14 +2,15 @@
2
2
 
3
3
 
4
4
  import { cn } from "../../utils/cn.mjs";
5
- import { Button, ButtonColor, ButtonSize, ButtonVariant } from "../Button/Button.mjs";
6
5
  import { Container } from "../Container/index.mjs";
6
+ import { Button, ButtonColor, ButtonSize, ButtonVariant } from "../Button/Button.mjs";
7
7
  import { useGetElementOrWindow } from "../../hooks/useGetElementOrWindow.mjs";
8
8
  import { useScrollBlockage } from "../../hooks/useScrollBlockage/index.mjs";
9
9
  import { H3 } from "../Headers/index.mjs";
10
10
  import { X } from "lucide-react";
11
+ import { useEffect } from "react";
11
12
  import { cva } from "class-variance-authority";
12
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
13
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
13
14
  import { motion } from "framer-motion";
14
15
  import { createPortal } from "react-dom";
15
16
 
@@ -34,7 +35,7 @@ let ModalSize = /* @__PURE__ */ function(ModalSize$1) {
34
35
  * Class name variants for different modal sizes using class-variance-authority
35
36
  * Defines responsive sizing and scrollable content for modal containers
36
37
  */
37
- const modalVariants = cva("cursor-default justify-center overflow-auto py-3 shadow-sm", {
38
+ const modalVariants = cva("cursor-default justify-center overflow-auto p-3 shadow-sm", {
38
39
  variants: { size: {
39
40
  sm: "h-auto max-h-[30vh] w-[95vw] max-w-xl",
40
41
  md: "h-auto max-h-[50vh] w-[95vw] max-w-xl",
@@ -116,13 +117,22 @@ const MotionModal = motion.create(Container);
116
117
  * @param props - Modal component props
117
118
  * @returns JSX element rendered via createPortal
118
119
  */
119
- const Modal = ({ children, isOpen, container, disableScroll = true, onClose, hasCloseButton = false, title, size = ModalSize.MD, className,...props }) => {
120
+ const Modal = ({ children, isOpen, container, disableScroll = true, onClose, hasCloseButton = false, title, size = ModalSize.MD, className, ...props }) => {
120
121
  const containerElement = useGetElementOrWindow(container);
121
122
  useScrollBlockage({
122
123
  key: "modal",
123
124
  disableScroll: isOpen && disableScroll
124
125
  });
125
- if (!containerElement) return /* @__PURE__ */ jsx(Fragment, {});
126
+ useEffect(() => {
127
+ const handleEscape = (event) => {
128
+ if (event.key === "Escape" && isOpen && onClose) onClose();
129
+ };
130
+ document.addEventListener("keydown", handleEscape);
131
+ return () => {
132
+ document.removeEventListener("keydown", handleEscape);
133
+ };
134
+ }, [isOpen, onClose]);
135
+ if (!containerElement) return /* @__PURE__ */ jsx(Fragment$1, {});
126
136
  const hasTitle = typeof title === "string";
127
137
  return createPortal(/* @__PURE__ */ jsx(motion.div, {
128
138
  className: "invisible fixed top-0 left-0 z-50 flex size-full cursor-pointer items-center justify-center overflow-auto bg-background/40 backdrop-blur",
@@ -150,43 +160,40 @@ const Modal = ({ children, isOpen, container, disableScroll = true, onClose, has
150
160
  onClose?.();
151
161
  },
152
162
  "aria-hidden": !isOpen,
153
- children: /* @__PURE__ */ jsx("div", {
154
- className: "flex justify-center p-4",
155
- children: /* @__PURE__ */ jsxs(MotionModal, {
156
- onClick: (e) => e.stopPropagation(),
157
- initial: { scale: isOpen ? .5 : 1 },
158
- animate: { scale: isOpen ? 1 : .5 },
159
- transition: { duration: .3 },
160
- className: modalVariants({
161
- size,
162
- className
163
- }),
164
- role: "dialog",
165
- "aria-modal": true,
166
- roundedSize: "2xl",
167
- ...props,
168
- children: [/* @__PURE__ */ jsxs("div", {
169
- className: cn("cursor-default px-4", hasCloseButton && hasTitle ? `flex items-center justify-center` : hasCloseButton ? `flex items-center justify-end` : hasTitle ? `items-center` : `hidden`),
170
- children: [hasTitle && /* @__PURE__ */ jsx(H3, {
171
- className: "ml-4 flex items-center justify-center font-bold text-lg",
172
- children: title
173
- }), hasCloseButton && /* @__PURE__ */ jsx(Button, {
174
- variant: ButtonVariant.HOVERABLE,
175
- color: ButtonColor.TEXT,
176
- label: "Close modal",
177
- className: "ml-auto",
178
- onClick: (e) => {
179
- e.stopPropagation();
180
- onClose?.();
181
- },
182
- Icon: X,
183
- size: ButtonSize.ICON_MD
184
- })]
185
- }), /* @__PURE__ */ jsx("div", {
186
- className: "flex flex-1 flex-col items-center overflow-auto",
187
- children
163
+ children: /* @__PURE__ */ jsxs(MotionModal, {
164
+ onClick: (e) => e.stopPropagation(),
165
+ initial: { scale: isOpen ? .5 : 1 },
166
+ animate: { scale: isOpen ? 1 : .5 },
167
+ transition: { duration: .3 },
168
+ className: modalVariants({
169
+ size,
170
+ className
171
+ }),
172
+ role: "dialog",
173
+ "aria-modal": true,
174
+ roundedSize: "2xl",
175
+ ...props,
176
+ children: [/* @__PURE__ */ jsxs("div", {
177
+ className: cn("cursor-default", hasCloseButton && hasTitle ? `flex items-start` : hasCloseButton ? `flex justify-end` : hasTitle ? `items-center` : `hidden`),
178
+ children: [hasTitle && /* @__PURE__ */ jsx(H3, {
179
+ className: "mt-2 mb-4 ml-4 flex items-center justify-center font-bold text-lg",
180
+ children: title
181
+ }), hasCloseButton && /* @__PURE__ */ jsx(Button, {
182
+ variant: ButtonVariant.HOVERABLE,
183
+ color: ButtonColor.TEXT,
184
+ label: "Close modal",
185
+ className: "ml-auto",
186
+ onClick: (e) => {
187
+ e.stopPropagation();
188
+ onClose?.();
189
+ },
190
+ Icon: X,
191
+ size: ButtonSize.ICON_MD
188
192
  })]
189
- })
193
+ }), /* @__PURE__ */ jsx("div", {
194
+ className: "flex flex-1 flex-col items-center",
195
+ children
196
+ })]
190
197
  })
191
198
  }), containerElement);
192
199
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.mjs","names":["m","Modal: FC<ModalProps>"],"sources":["../../../../src/components/Modal/Modal.tsx"],"sourcesContent":["'use client';\n\nimport { cva } from 'class-variance-authority';\nimport { motion as m } from 'framer-motion';\nimport { X } from 'lucide-react';\nimport type { FC, ReactNode } from 'react';\nimport { createPortal } from 'react-dom';\nimport { useGetElementOrWindow, useScrollBlockage } from '../../hooks/index';\nimport { cn } from '../../utils/cn';\nimport { Button, ButtonColor, ButtonSize, ButtonVariant } from '../Button';\nimport { Container, type ContainerProps } from '../Container';\nimport { H3 } from '../Headers';\n\n/**\n * Enumeration of available modal sizes\n */\nexport enum ModalSize {\n /** Small modal: max height 30vh, max width xl */\n SM = 'sm',\n /** Medium modal: max height 50vh, max width xl */\n MD = 'md',\n /** Large modal: max height 70vh, max width 2xl */\n LG = 'lg',\n /** Extra large modal: max height 95vh, max width 6xl */\n XL = 'xl',\n /** Unset size: max height 95vh, full width responsive */\n UNSET = 'unset',\n}\n\n/**\n * Props for the Modal component\n */\ntype ModalProps = {\n /** Content to be displayed inside the modal */\n children: ReactNode;\n /** Controls whether the modal is visible */\n isOpen: boolean;\n /** Callback function called when the modal should be closed */\n onClose?: () => void;\n /** Container element to render the modal into (defaults to document.body) */\n container?: HTMLElement;\n /** Whether to disable scrolling on the background content */\n disableScroll?: boolean;\n /** Whether to display a close button in the modal header */\n hasCloseButton?: boolean;\n /** Optional title displayed at the top of the modal */\n title?: string;\n /** Size variant for the modal */\n size?: ModalSize | `${ModalSize}`;\n} & Pick<\n ContainerProps,\n | 'className'\n | 'transparency'\n | 'border'\n | 'background'\n | 'roundedSize'\n | 'borderColor'\n | 'padding'\n | 'separator'\n | 'gap'\n>;\n\n/**\n * Class name variants for different modal sizes using class-variance-authority\n * Defines responsive sizing and scrollable content for modal containers\n */\nconst modalVariants = cva(\n 'cursor-default justify-center overflow-auto py-3 shadow-sm',\n {\n variants: {\n size: {\n /** Small modal: height auto, max-height 30vh, width 95vw, max-width xl */\n sm: 'h-auto max-h-[30vh] w-[95vw] max-w-xl',\n /** Medium modal: height auto, max-height 50vh, width 95vw, max-width xl */\n md: 'h-auto max-h-[50vh] w-[95vw] max-w-xl',\n /** Large modal: height auto, max-height 70vh, width 95vw, max-width 2xl */\n lg: 'h-auto max-h-[70vh] w-[95vw] max-w-2xl',\n /** Extra large modal: height auto, max-height 95vh, width 95vw, max-width 6xl */\n xl: 'h-auto max-h-[95vh] w-[95vw] max-w-6xl',\n /** Unset modal: height auto, max-height 95vh, width 95vw, no max-width */\n unset: 'h-auto max-h-[95vh] w-[95vw]',\n },\n },\n defaultVariants: {\n size: 'unset',\n },\n }\n);\n\n/**\n * Motion-enabled modal component with Framer Motion support\n * Extends Container component with motion capabilities for animations\n */\nconst MotionModal = m.create(Container);\n\n/**\n * Modal Component\n *\n * A highly customizable modal dialog component with portal rendering, Framer Motion animations,\n * and comprehensive accessibility features. Supports multiple size variants and scroll management.\n *\n * Features:\n * - Portal rendering to any container element (defaults to document.body)\n * - Smooth animations with Framer Motion\n * - Size variants: SM, MD, LG, XL, UNSET with responsive sizing\n * - Optional title and close button\n * - Background scroll prevention\n * - Click-outside-to-close functionality\n * - Full accessibility support with ARIA attributes\n * - Keyboard navigation support (ESC to close)\n * - Extensible styling with Container props\n *\n * @example\n * Basic usage:\n * ```jsx\n * <Modal isOpen={isModalOpen} onClose={() => setIsModalOpen(false)}>\n * <p>Modal content goes here</p>\n * </Modal>\n * ```\n *\n * @example\n * With title and close button:\n * ```jsx\n * <Modal\n * isOpen={isOpen}\n * onClose={onClose}\n * title=\"Confirm Action\"\n * hasCloseButton\n * size={ModalSize.LG}\n * >\n * <div>\n * <p>Are you sure you want to continue?</p>\n * <Button onClick={onConfirm}>Confirm</Button>\n * </div>\n * </Modal>\n * ```\n *\n * @example\n * Custom container and styling:\n * ```jsx\n * <Modal\n * isOpen={isOpen}\n * onClose={onClose}\n * container={customContainer}\n * background=\"card\"\n * padding=\"lg\"\n * border=\"default\"\n * >\n * Content with custom styling\n * </Modal>\n * ```\n *\n * Accessibility Notes:\n * - Modal receives focus when opened\n * - Background content is hidden from screen readers when modal is open\n * - ESC key closes modal (handled by browser for role=\"dialog\")\n * - Click outside modal closes it\n * - Close button has descriptive label for screen readers\n *\n * @param props - Modal component props\n * @returns JSX element rendered via createPortal\n */\nexport const Modal: FC<ModalProps> = ({\n children,\n isOpen,\n container,\n disableScroll = true,\n onClose,\n hasCloseButton = false,\n title,\n size = ModalSize.MD,\n className,\n ...props\n}) => {\n const containerElement = useGetElementOrWindow(container);\n\n useScrollBlockage({ key: 'modal', disableScroll: isOpen && disableScroll });\n\n if (!containerElement) return <></>;\n\n const hasTitle = typeof title === 'string';\n\n return createPortal(\n <m.div\n className=\"invisible fixed top-0 left-0 z-50 flex size-full cursor-pointer items-center justify-center overflow-auto bg-background/40 backdrop-blur\"\n animate={isOpen ? 'visible' : 'invisible'}\n variants={{\n visible: {\n opacity: 1,\n visibility: 'visible',\n transition: { duration: 0.1, when: 'beforeChildren' },\n },\n invisible: {\n opacity: 0,\n visibility: 'hidden',\n transition: { duration: 0.1, when: 'afterChildren' },\n },\n }}\n onClick={(e) => {\n e.stopPropagation();\n onClose?.();\n }}\n aria-hidden={!isOpen}\n >\n <div className=\"flex justify-center p-4\">\n <MotionModal\n onClick={(e) => e.stopPropagation()}\n initial={{ scale: isOpen ? 0.5 : 1 }}\n animate={{ scale: isOpen ? 1 : 0.5 }}\n transition={{ duration: 0.3 }}\n className={modalVariants({\n size,\n className,\n })}\n role=\"dialog\"\n aria-modal\n roundedSize=\"2xl\"\n {...props}\n >\n <div\n className={cn(\n 'cursor-default px-4',\n hasCloseButton && hasTitle\n ? `flex items-center justify-center`\n : hasCloseButton\n ? `flex items-center justify-end`\n : hasTitle\n ? `items-center`\n : `hidden`\n )}\n >\n {hasTitle && (\n <H3 className=\"ml-4 flex items-center justify-center font-bold text-lg\">\n {title}\n </H3>\n )}\n {hasCloseButton && (\n <Button\n variant={ButtonVariant.HOVERABLE}\n color={ButtonColor.TEXT}\n label=\"Close modal\"\n className=\"ml-auto\"\n onClick={(e) => {\n e.stopPropagation();\n onClose?.();\n }}\n Icon={X}\n size={ButtonSize.ICON_MD}\n />\n )}\n </div>\n <div className=\"flex flex-1 flex-col items-center overflow-auto\">\n {children}\n </div>\n </MotionModal>\n </div>\n </m.div>,\n containerElement\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAgBA,IAAY,kDAAL;;AAEL;;AAEA;;AAEA;;AAEA;;AAEA;;;;;;;AAwCF,MAAM,gBAAgB,IACpB,8DACA;CACE,UAAU,EACR,MAAM;EAEJ,IAAI;EAEJ,IAAI;EAEJ,IAAI;EAEJ,IAAI;EAEJ,OAAO;EACR,EACF;CACD,iBAAiB,EACf,MAAM,SACP;CACF,CACF;;;;;AAMD,MAAM,cAAcA,OAAE,OAAO,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEvC,MAAaC,SAAyB,EACpC,UACA,QACA,WACA,gBAAgB,MAChB,SACA,iBAAiB,OACjB,OACA,OAAO,UAAU,IACjB,UACA,GAAG,YACC;CACJ,MAAM,mBAAmB,sBAAsB,UAAU;AAEzD,mBAAkB;EAAE,KAAK;EAAS,eAAe,UAAU;EAAe,CAAC;AAE3E,KAAI,CAAC,iBAAkB,QAAO,iCAAK;CAEnC,MAAM,WAAW,OAAO,UAAU;AAElC,QAAO,aACL,oBAACD,OAAE;EACD,WAAU;EACV,SAAS,SAAS,YAAY;EAC9B,UAAU;GACR,SAAS;IACP,SAAS;IACT,YAAY;IACZ,YAAY;KAAE,UAAU;KAAK,MAAM;KAAkB;IACtD;GACD,WAAW;IACT,SAAS;IACT,YAAY;IACZ,YAAY;KAAE,UAAU;KAAK,MAAM;KAAiB;IACrD;GACF;EACD,UAAU,MAAM;AACd,KAAE,iBAAiB;AACnB,cAAW;;EAEb,eAAa,CAAC;YAEd,oBAAC;GAAI,WAAU;aACb,qBAAC;IACC,UAAU,MAAM,EAAE,iBAAiB;IACnC,SAAS,EAAE,OAAO,SAAS,KAAM,GAAG;IACpC,SAAS,EAAE,OAAO,SAAS,IAAI,IAAK;IACpC,YAAY,EAAE,UAAU,IAAK;IAC7B,WAAW,cAAc;KACvB;KACA;KACD,CAAC;IACF,MAAK;IACL;IACA,aAAY;IACZ,GAAI;eAEJ,qBAAC;KACC,WAAW,GACT,uBACA,kBAAkB,WACd,qCACA,iBACE,kCACA,WACE,iBACA,SACT;gBAEA,YACC,oBAAC;MAAG,WAAU;gBACX;OACE,EAEN,kBACC,oBAAC;MACC,SAAS,cAAc;MACvB,OAAO,YAAY;MACnB,OAAM;MACN,WAAU;MACV,UAAU,MAAM;AACd,SAAE,iBAAiB;AACnB,kBAAW;;MAEb,MAAM;MACN,MAAM,WAAW;OACjB;MAEA,EACN,oBAAC;KAAI,WAAU;KACZ;MACG;KACM;IACV;GACA,EACR,iBACD"}
1
+ {"version":3,"file":"Modal.mjs","names":["m","Modal: FC<ModalProps>"],"sources":["../../../../src/components/Modal/Modal.tsx"],"sourcesContent":["'use client';\n\nimport { cva } from 'class-variance-authority';\nimport { motion as m } from 'framer-motion';\nimport { X } from 'lucide-react';\nimport { type FC, type ReactNode, useEffect } from 'react';\nimport { createPortal } from 'react-dom';\nimport { useGetElementOrWindow, useScrollBlockage } from '../../hooks/index';\nimport { cn } from '../../utils/cn';\nimport { Button, ButtonColor, ButtonSize, ButtonVariant } from '../Button';\nimport { Container, type ContainerProps } from '../Container';\nimport { H3 } from '../Headers';\n\n/**\n * Enumeration of available modal sizes\n */\nexport enum ModalSize {\n /** Small modal: max height 30vh, max width xl */\n SM = 'sm',\n /** Medium modal: max height 50vh, max width xl */\n MD = 'md',\n /** Large modal: max height 70vh, max width 2xl */\n LG = 'lg',\n /** Extra large modal: max height 95vh, max width 6xl */\n XL = 'xl',\n /** Unset size: max height 95vh, full width responsive */\n UNSET = 'unset',\n}\n\n/**\n * Props for the Modal component\n */\ntype ModalProps = {\n /** Content to be displayed inside the modal */\n children: ReactNode;\n /** Controls whether the modal is visible */\n isOpen: boolean;\n /** Callback function called when the modal should be closed */\n onClose?: () => void;\n /** Container element to render the modal into (defaults to document.body) */\n container?: HTMLElement;\n /** Whether to disable scrolling on the background content */\n disableScroll?: boolean;\n /** Whether to display a close button in the modal header */\n hasCloseButton?: boolean;\n /** Optional title displayed at the top of the modal */\n title?: string;\n /** Size variant for the modal */\n size?: ModalSize | `${ModalSize}`;\n} & Pick<\n ContainerProps,\n | 'className'\n | 'transparency'\n | 'border'\n | 'background'\n | 'roundedSize'\n | 'borderColor'\n | 'padding'\n | 'separator'\n | 'gap'\n>;\n\n/**\n * Class name variants for different modal sizes using class-variance-authority\n * Defines responsive sizing and scrollable content for modal containers\n */\nconst modalVariants = cva(\n 'cursor-default justify-center overflow-auto p-3 shadow-sm',\n {\n variants: {\n size: {\n /** Small modal: height auto, max-height 30vh, width 95vw, max-width xl */\n sm: 'h-auto max-h-[30vh] w-[95vw] max-w-xl',\n /** Medium modal: height auto, max-height 50vh, width 95vw, max-width xl */\n md: 'h-auto max-h-[50vh] w-[95vw] max-w-xl',\n /** Large modal: height auto, max-height 70vh, width 95vw, max-width 2xl */\n lg: 'h-auto max-h-[70vh] w-[95vw] max-w-2xl',\n /** Extra large modal: height auto, max-height 95vh, width 95vw, max-width 6xl */\n xl: 'h-auto max-h-[95vh] w-[95vw] max-w-6xl',\n /** Unset modal: height auto, max-height 95vh, width 95vw, no max-width */\n unset: 'h-auto max-h-[95vh] w-[95vw]',\n },\n },\n defaultVariants: {\n size: 'unset',\n },\n }\n);\n\n/**\n * Motion-enabled modal component with Framer Motion support\n * Extends Container component with motion capabilities for animations\n */\nconst MotionModal = m.create(Container);\n\n/**\n * Modal Component\n *\n * A highly customizable modal dialog component with portal rendering, Framer Motion animations,\n * and comprehensive accessibility features. Supports multiple size variants and scroll management.\n *\n * Features:\n * - Portal rendering to any container element (defaults to document.body)\n * - Smooth animations with Framer Motion\n * - Size variants: SM, MD, LG, XL, UNSET with responsive sizing\n * - Optional title and close button\n * - Background scroll prevention\n * - Click-outside-to-close functionality\n * - Full accessibility support with ARIA attributes\n * - Keyboard navigation support (ESC to close)\n * - Extensible styling with Container props\n *\n * @example\n * Basic usage:\n * ```jsx\n * <Modal isOpen={isModalOpen} onClose={() => setIsModalOpen(false)}>\n * <p>Modal content goes here</p>\n * </Modal>\n * ```\n *\n * @example\n * With title and close button:\n * ```jsx\n * <Modal\n * isOpen={isOpen}\n * onClose={onClose}\n * title=\"Confirm Action\"\n * hasCloseButton\n * size={ModalSize.LG}\n * >\n * <div>\n * <p>Are you sure you want to continue?</p>\n * <Button onClick={onConfirm}>Confirm</Button>\n * </div>\n * </Modal>\n * ```\n *\n * @example\n * Custom container and styling:\n * ```jsx\n * <Modal\n * isOpen={isOpen}\n * onClose={onClose}\n * container={customContainer}\n * background=\"card\"\n * padding=\"lg\"\n * border=\"default\"\n * >\n * Content with custom styling\n * </Modal>\n * ```\n *\n * Accessibility Notes:\n * - Modal receives focus when opened\n * - Background content is hidden from screen readers when modal is open\n * - ESC key closes modal (handled by browser for role=\"dialog\")\n * - Click outside modal closes it\n * - Close button has descriptive label for screen readers\n *\n * @param props - Modal component props\n * @returns JSX element rendered via createPortal\n */\nexport const Modal: FC<ModalProps> = ({\n children,\n isOpen,\n container,\n disableScroll = true,\n onClose,\n hasCloseButton = false,\n title,\n size = ModalSize.MD,\n className,\n ...props\n}) => {\n const containerElement = useGetElementOrWindow(container);\n\n useScrollBlockage({ key: 'modal', disableScroll: isOpen && disableScroll });\n\n useEffect(() => {\n const handleEscape = (event: KeyboardEvent) => {\n if (event.key === 'Escape' && isOpen && onClose) {\n onClose();\n }\n };\n\n document.addEventListener('keydown', handleEscape);\n\n return () => {\n document.removeEventListener('keydown', handleEscape);\n };\n }, [isOpen, onClose]);\n\n if (!containerElement) return <></>;\n\n const hasTitle = typeof title === 'string';\n\n return createPortal(\n <m.div\n className=\"invisible fixed top-0 left-0 z-50 flex size-full cursor-pointer items-center justify-center overflow-auto bg-background/40 backdrop-blur\"\n animate={isOpen ? 'visible' : 'invisible'}\n variants={{\n visible: {\n opacity: 1,\n visibility: 'visible',\n transition: { duration: 0.1, when: 'beforeChildren' },\n },\n invisible: {\n opacity: 0,\n visibility: 'hidden',\n transition: { duration: 0.1, when: 'afterChildren' },\n },\n }}\n onClick={(e) => {\n e.stopPropagation();\n onClose?.();\n }}\n aria-hidden={!isOpen}\n >\n <MotionModal\n onClick={(e) => e.stopPropagation()}\n initial={{ scale: isOpen ? 0.5 : 1 }}\n animate={{ scale: isOpen ? 1 : 0.5 }}\n transition={{ duration: 0.3 }}\n className={modalVariants({\n size,\n className,\n })}\n role=\"dialog\"\n aria-modal\n roundedSize=\"2xl\"\n {...props}\n >\n <div\n className={cn(\n 'cursor-default',\n hasCloseButton && hasTitle\n ? `flex items-start`\n : hasCloseButton\n ? `flex justify-end`\n : hasTitle\n ? `items-center`\n : `hidden`\n )}\n >\n {hasTitle && (\n <H3 className=\"mt-2 mb-4 ml-4 flex items-center justify-center font-bold text-lg\">\n {title}\n </H3>\n )}\n {hasCloseButton && (\n <Button\n variant={ButtonVariant.HOVERABLE}\n color={ButtonColor.TEXT}\n label=\"Close modal\"\n className=\"ml-auto\"\n onClick={(e) => {\n e.stopPropagation();\n onClose?.();\n }}\n Icon={X}\n size={ButtonSize.ICON_MD}\n />\n )}\n </div>\n <div className=\"flex flex-1 flex-col items-center\">{children}</div>\n </MotionModal>\n </m.div>,\n containerElement\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgBA,IAAY,kDAAL;;AAEL;;AAEA;;AAEA;;AAEA;;AAEA;;;;;;;AAwCF,MAAM,gBAAgB,IACpB,6DACA;CACE,UAAU,EACR,MAAM;EAEJ,IAAI;EAEJ,IAAI;EAEJ,IAAI;EAEJ,IAAI;EAEJ,OAAO;EACR,EACF;CACD,iBAAiB,EACf,MAAM,SACP;CACF,CACF;;;;;AAMD,MAAM,cAAcA,OAAE,OAAO,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEvC,MAAaC,SAAyB,EACpC,UACA,QACA,WACA,gBAAgB,MAChB,SACA,iBAAiB,OACjB,OACA,OAAO,UAAU,IACjB,WACA,GAAG,YACC;CACJ,MAAM,mBAAmB,sBAAsB,UAAU;AAEzD,mBAAkB;EAAE,KAAK;EAAS,eAAe,UAAU;EAAe,CAAC;AAE3E,iBAAgB;EACd,MAAM,gBAAgB,UAAyB;AAC7C,OAAI,MAAM,QAAQ,YAAY,UAAU,QACtC,UAAS;;AAIb,WAAS,iBAAiB,WAAW,aAAa;AAElD,eAAa;AACX,YAAS,oBAAoB,WAAW,aAAa;;IAEtD,CAAC,QAAQ,QAAQ,CAAC;AAErB,KAAI,CAAC,iBAAkB,QAAO,mCAAK;CAEnC,MAAM,WAAW,OAAO,UAAU;AAElC,QAAO,aACL,oBAACD,OAAE;EACD,WAAU;EACV,SAAS,SAAS,YAAY;EAC9B,UAAU;GACR,SAAS;IACP,SAAS;IACT,YAAY;IACZ,YAAY;KAAE,UAAU;KAAK,MAAM;KAAkB;IACtD;GACD,WAAW;IACT,SAAS;IACT,YAAY;IACZ,YAAY;KAAE,UAAU;KAAK,MAAM;KAAiB;IACrD;GACF;EACD,UAAU,MAAM;AACd,KAAE,iBAAiB;AACnB,cAAW;;EAEb,eAAa,CAAC;YAEd,qBAAC;GACC,UAAU,MAAM,EAAE,iBAAiB;GACnC,SAAS,EAAE,OAAO,SAAS,KAAM,GAAG;GACpC,SAAS,EAAE,OAAO,SAAS,IAAI,IAAK;GACpC,YAAY,EAAE,UAAU,IAAK;GAC7B,WAAW,cAAc;IACvB;IACA;IACD,CAAC;GACF,MAAK;GACL;GACA,aAAY;GACZ,GAAI;cAEJ,qBAAC;IACC,WAAW,GACT,kBACA,kBAAkB,WACd,qBACA,iBACE,qBACA,WACE,iBACA,SACT;eAEA,YACC,oBAAC;KAAG,WAAU;eACX;MACE,EAEN,kBACC,oBAAC;KACC,SAAS,cAAc;KACvB,OAAO,YAAY;KACnB,OAAM;KACN,WAAU;KACV,UAAU,MAAM;AACd,QAAE,iBAAiB;AACnB,iBAAW;;KAEb,MAAM;KACN,MAAM,WAAW;MACjB;KAEA,EACN,oBAAC;IAAI,WAAU;IAAqC;KAAe;IACvD;GACR,EACR,iBACD"}
@@ -57,7 +57,7 @@ const lineStyle = "bg-text absolute top-1/2 block h-[2px] w-8 transition durati
57
57
  * @param props - Burger component props
58
58
  * @returns Animated burger menu JSX element
59
59
  */
60
- const Burger = ({ isActive = false, className,...props }) => /* @__PURE__ */ jsxs("div", {
60
+ const Burger = ({ isActive = false, className, ...props }) => /* @__PURE__ */ jsxs("div", {
61
61
  className: cn("relative mr-3 size-10 cursor-pointer", className),
62
62
  "aria-checked": isActive,
63
63
  "aria-expanded": isActive,
@@ -1 +1 @@
1
- {"version":3,"file":"Burger.mjs","names":[],"sources":["../../../../src/components/Navbar/Burger.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\nimport { cn } from '../../utils/cn';\n\n/**\n * Props for the Burger menu component\n */\ninterface BurgerProps extends HTMLAttributes<HTMLDivElement> {\n /** Whether the burger menu is in active/open state */\n isActive?: boolean;\n}\n\n/**\n * Shared styles for burger menu lines\n * Creates the classic hamburger menu appearance with smooth transitions\n */\nconst lineStyle =\n 'bg-text absolute top-1/2 block h-[2px] w-8 transition duration-300';\n\n/**\n * Burger Menu Component\n *\n * An animated hamburger menu icon that transforms between closed and open states.\n * Commonly used in mobile navigation to toggle menu visibility.\n *\n * Features:\n * - Smooth CSS transitions between states (300ms duration)\n * - Accessible with proper ARIA attributes\n * - Screen reader support with descriptive labels\n * - Role-based interaction (switch role for toggle behavior)\n * - Responsive sizing (40px × 40px clickable area)\n * - Classic three-line hamburger design\n *\n * Animation States:\n * - Closed: Three horizontal parallel lines\n * - Open: Top and bottom lines rotate to form an X, middle line fades out\n *\n * Accessibility Features:\n * - `role=\"switch\"` indicates toggle behavior\n * - `aria-expanded` reflects current menu state\n * - `aria-checked` provides current selection state\n * - `aria-controls` links to controlled menu element\n * - Dynamic `aria-label` describes current action\n *\n * @example\n * Basic usage:\n * ```tsx\n * const [isMenuOpen, setIsMenuOpen] = useState(false);\n *\n * <Burger\n * isActive={isMenuOpen}\n * onClick={() => setIsMenuOpen(!isMenuOpen)}\n * />\n * ```\n *\n * @example\n * With custom styling:\n * ```tsx\n * <Burger\n * isActive={isMenuOpen}\n * onClick={toggleMenu}\n * className=\"lg:hidden\"\n * style={{ zIndex: 1000 }}\n * />\n * ```\n *\n * @param props - Burger component props\n * @returns Animated burger menu JSX element\n */\nexport const Burger = ({\n isActive = false,\n className,\n ...props\n}: BurgerProps) => (\n <div\n className={cn('relative mr-3 size-10 cursor-pointer', className)}\n aria-checked={isActive}\n aria-expanded={isActive}\n aria-controls=\"mobile-menu\"\n role=\"switch\"\n aria-label={isActive ? 'Close menu' : 'Open menu'}\n {...props}\n >\n <div>\n <div\n className={cn(lineStyle, isActive ? 'rotate-[-45deg]' : 'rotate-0')}\n />\n <div\n className={cn(\n lineStyle,\n isActive ? '-translate-y-3 opacity-0' : '-translate-y-2 opacity-100'\n )}\n />\n </div>\n\n <div>\n <div className={cn(lineStyle, isActive ? 'opacity-0' : 'opacity-100')} />\n </div>\n\n <div>\n <div\n className={cn(lineStyle, isActive ? 'rotate-[45deg]' : 'rotate-0')}\n />\n <div\n className={cn(\n lineStyle,\n isActive ? 'translate-y-3 opacity-0' : 'translate-y-2 opacity-100'\n )}\n />\n </div>\n </div>\n);\n"],"mappings":";;;;;;;;AAeA,MAAM,YACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDF,MAAa,UAAU,EACrB,WAAW,OACX,UACA,GAAG,YAEH,qBAAC;CACC,WAAW,GAAG,wCAAwC,UAAU;CAChE,gBAAc;CACd,iBAAe;CACf,iBAAc;CACd,MAAK;CACL,cAAY,WAAW,eAAe;CACtC,GAAI;;EAEJ,qBAAC,oBACC,oBAAC,SACC,WAAW,GAAG,WAAW,WAAW,oBAAoB,WAAW,GACnE,EACF,oBAAC,SACC,WAAW,GACT,WACA,WAAW,6BAA6B,6BACzC,GACD,IACE;EAEN,oBAAC,mBACC,oBAAC,SAAI,WAAW,GAAG,WAAW,WAAW,cAAc,cAAc,GAAI,GACrE;EAEN,qBAAC,oBACC,oBAAC,SACC,WAAW,GAAG,WAAW,WAAW,mBAAmB,WAAW,GAClE,EACF,oBAAC,SACC,WAAW,GACT,WACA,WAAW,4BAA4B,4BACxC,GACD,IACE;;EACF"}
1
+ {"version":3,"file":"Burger.mjs","names":[],"sources":["../../../../src/components/Navbar/Burger.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\nimport { cn } from '../../utils/cn';\n\n/**\n * Props for the Burger menu component\n */\ninterface BurgerProps extends HTMLAttributes<HTMLDivElement> {\n /** Whether the burger menu is in active/open state */\n isActive?: boolean;\n}\n\n/**\n * Shared styles for burger menu lines\n * Creates the classic hamburger menu appearance with smooth transitions\n */\nconst lineStyle =\n 'bg-text absolute top-1/2 block h-[2px] w-8 transition duration-300';\n\n/**\n * Burger Menu Component\n *\n * An animated hamburger menu icon that transforms between closed and open states.\n * Commonly used in mobile navigation to toggle menu visibility.\n *\n * Features:\n * - Smooth CSS transitions between states (300ms duration)\n * - Accessible with proper ARIA attributes\n * - Screen reader support with descriptive labels\n * - Role-based interaction (switch role for toggle behavior)\n * - Responsive sizing (40px × 40px clickable area)\n * - Classic three-line hamburger design\n *\n * Animation States:\n * - Closed: Three horizontal parallel lines\n * - Open: Top and bottom lines rotate to form an X, middle line fades out\n *\n * Accessibility Features:\n * - `role=\"switch\"` indicates toggle behavior\n * - `aria-expanded` reflects current menu state\n * - `aria-checked` provides current selection state\n * - `aria-controls` links to controlled menu element\n * - Dynamic `aria-label` describes current action\n *\n * @example\n * Basic usage:\n * ```tsx\n * const [isMenuOpen, setIsMenuOpen] = useState(false);\n *\n * <Burger\n * isActive={isMenuOpen}\n * onClick={() => setIsMenuOpen(!isMenuOpen)}\n * />\n * ```\n *\n * @example\n * With custom styling:\n * ```tsx\n * <Burger\n * isActive={isMenuOpen}\n * onClick={toggleMenu}\n * className=\"lg:hidden\"\n * style={{ zIndex: 1000 }}\n * />\n * ```\n *\n * @param props - Burger component props\n * @returns Animated burger menu JSX element\n */\nexport const Burger = ({\n isActive = false,\n className,\n ...props\n}: BurgerProps) => (\n <div\n className={cn('relative mr-3 size-10 cursor-pointer', className)}\n aria-checked={isActive}\n aria-expanded={isActive}\n aria-controls=\"mobile-menu\"\n role=\"switch\"\n aria-label={isActive ? 'Close menu' : 'Open menu'}\n {...props}\n >\n <div>\n <div\n className={cn(lineStyle, isActive ? 'rotate-[-45deg]' : 'rotate-0')}\n />\n <div\n className={cn(\n lineStyle,\n isActive ? '-translate-y-3 opacity-0' : '-translate-y-2 opacity-100'\n )}\n />\n </div>\n\n <div>\n <div className={cn(lineStyle, isActive ? 'opacity-0' : 'opacity-100')} />\n </div>\n\n <div>\n <div\n className={cn(lineStyle, isActive ? 'rotate-[45deg]' : 'rotate-0')}\n />\n <div\n className={cn(\n lineStyle,\n isActive ? 'translate-y-3 opacity-0' : 'translate-y-2 opacity-100'\n )}\n />\n </div>\n </div>\n);\n"],"mappings":";;;;;;;;AAeA,MAAM,YACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDF,MAAa,UAAU,EACrB,WAAW,OACX,WACA,GAAG,YAEH,qBAAC;CACC,WAAW,GAAG,wCAAwC,UAAU;CAChE,gBAAc;CACd,iBAAe;CACf,iBAAc;CACd,MAAK;CACL,cAAY,WAAW,eAAe;CACtC,GAAI;;EAEJ,qBAAC,oBACC,oBAAC,SACC,WAAW,GAAG,WAAW,WAAW,oBAAoB,WAAW,GACnE,EACF,oBAAC,SACC,WAAW,GACT,WACA,WAAW,6BAA6B,6BACzC,GACD,IACE;EAEN,oBAAC,mBACC,oBAAC,SAAI,WAAW,GAAG,WAAW,WAAW,cAAc,cAAc,GAAI,GACrE;EAEN,qBAAC,oBACC,oBAAC,SACC,WAAW,GAAG,WAAW,WAAW,mBAAmB,WAAW,GAClE,EACF,oBAAC,SACC,WAAW,GACT,WACA,WAAW,4BAA4B,4BACxC,GACD,IACE;;EACF"}
@@ -70,7 +70,7 @@ const generatePageNumbers = (currentPage, totalPages, maxVisiblePages) => {
70
70
  const getButtonSize = (size) => {
71
71
  return size === PaginationSize.SM ? ButtonSize.ICON_SM : size === PaginationSize.LG ? ButtonSize.ICON_LG : ButtonSize.ICON_MD;
72
72
  };
73
- const Pagination = ({ currentPage, totalPages, onPageChange, showFirstLast = false, showPrevNext = true, maxVisiblePages = 5, disabled = false, size = PaginationSize.MD, variant = PaginationVariant.DEFAULT, color = ButtonColor.TEXT, className,...props }) => {
73
+ const Pagination = ({ currentPage, totalPages, onPageChange, showFirstLast = false, showPrevNext = true, maxVisiblePages = 5, disabled = false, size = PaginationSize.MD, variant = PaginationVariant.DEFAULT, color = ButtonColor.TEXT, className, ...props }) => {
74
74
  const pageNumbers = generatePageNumbers(currentPage, totalPages, maxVisiblePages);
75
75
  const buttonSize = getButtonSize(size);
76
76
  const isFirstPage = currentPage === 1;
@@ -1 +1 @@
1
- {"version":3,"file":"Pagination.mjs","names":["pages: (number | 'ellipsis')[]","Pagination: FC<PaginationProps>"],"sources":["../../../../src/components/Pagination/Pagination.tsx"],"sourcesContent":["'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { ChevronLeft, ChevronRight, MoreHorizontal } from 'lucide-react';\nimport type { FC, HTMLAttributes } from 'react';\nimport { cn } from '../../utils/cn';\nimport { Button, ButtonColor, ButtonSize, ButtonVariant } from '../Button';\n\nexport const paginationVariants = cva(\n 'flex items-center justify-center gap-1',\n {\n variants: {\n size: {\n sm: 'gap-1',\n md: 'gap-2',\n lg: 'gap-3',\n },\n color: {\n text: 'background-text',\n primary: 'background-primary',\n secondary: 'background-secondary',\n neutral: 'background-neutral',\n destructive: 'background-destructive',\n },\n variant: {\n default: '',\n bordered: 'rounded-lg border border-border p-2',\n ghost: 'bg-transparent',\n },\n },\n defaultVariants: {\n size: 'md',\n variant: 'default',\n },\n }\n);\n\nexport enum PaginationSize {\n SM = 'sm',\n MD = 'md',\n LG = 'lg',\n}\n\nexport enum PaginationVariant {\n DEFAULT = 'default',\n BORDERED = 'bordered',\n GHOST = 'ghost',\n}\n\nexport type PaginationProps = HTMLAttributes<HTMLDivElement> &\n VariantProps<typeof paginationVariants> & {\n currentPage: number;\n totalPages: number;\n onPageChange: (page: number) => void;\n showFirstLast?: boolean;\n showPrevNext?: boolean;\n maxVisiblePages?: number;\n disabled?: boolean;\n };\n\nconst generatePageNumbers = (\n currentPage: number,\n totalPages: number,\n maxVisiblePages: number\n): (number | 'ellipsis')[] => {\n if (totalPages <= maxVisiblePages) {\n return Array.from({ length: totalPages }, (_, i) => i + 1);\n }\n\n const pages: (number | 'ellipsis')[] = [];\n const halfVisible = Math.floor(maxVisiblePages / 2);\n\n pages.push(1);\n\n if (currentPage <= halfVisible + 2) {\n for (let i = 2; i <= Math.min(maxVisiblePages - 1, totalPages - 1); i++) {\n pages.push(i);\n }\n if (totalPages > maxVisiblePages) {\n pages.push('ellipsis');\n }\n if (totalPages > 1) {\n pages.push(totalPages);\n }\n } else if (currentPage >= totalPages - halfVisible - 1) {\n if (totalPages > maxVisiblePages) {\n pages.push('ellipsis');\n }\n for (\n let i = Math.max(2, totalPages - maxVisiblePages + 2);\n i <= totalPages;\n i++\n ) {\n pages.push(i);\n }\n } else {\n pages.push('ellipsis');\n const start = currentPage - halfVisible;\n const end = currentPage + halfVisible;\n for (let i = start; i <= end; i++) {\n pages.push(i);\n }\n pages.push('ellipsis');\n pages.push(totalPages);\n }\n\n return pages;\n};\n\nconst getButtonSize = (size?: PaginationSize | `${PaginationSize}` | null) => {\n return size === PaginationSize.SM\n ? ButtonSize.ICON_SM\n : size === PaginationSize.LG\n ? ButtonSize.ICON_LG\n : ButtonSize.ICON_MD;\n};\n\nexport const Pagination: FC<PaginationProps> = ({\n currentPage,\n totalPages,\n onPageChange,\n showFirstLast = false,\n showPrevNext = true,\n maxVisiblePages = 5,\n disabled = false,\n size = PaginationSize.MD,\n variant = PaginationVariant.DEFAULT,\n color = ButtonColor.TEXT,\n className,\n ...props\n}) => {\n const pageNumbers = generatePageNumbers(\n currentPage,\n totalPages,\n maxVisiblePages\n );\n\n const buttonSize = getButtonSize(size);\n const isFirstPage = currentPage === 1;\n const isLastPage = currentPage === totalPages;\n\n if (totalPages <= 1) return null;\n\n const handlePageChange = (page: number) => {\n if (!disabled && page >= 1 && page <= totalPages && page !== currentPage) {\n onPageChange(page);\n }\n };\n\n return (\n <div\n className={cn(paginationVariants({ size, variant }), className)}\n {...props}\n >\n {showPrevNext && (\n <Button\n variant={ButtonVariant.OUTLINE}\n size={buttonSize}\n color={ButtonColor.TEXT}\n onClick={() => handlePageChange(currentPage - 1)}\n disabled={disabled || isFirstPage}\n label=\"Go to previous page\"\n Icon={ChevronLeft}\n className=\"min-w-0 px-2\"\n />\n )}\n\n <div className=\"flex items-center gap-1 max-md:gap-0.5\">\n {pageNumbers.map((page) => {\n if (page === 'ellipsis') {\n return (\n <div\n key={`ellipsis-${page}`}\n className=\"flex h-8 min-w-8 items-center justify-center px-1\"\n >\n <MoreHorizontal className=\"h-4 w-4 text-muted-foreground\" />\n </div>\n );\n }\n\n const isActive = page === currentPage;\n return (\n <Button\n key={page}\n variant={isActive ? ButtonVariant.DEFAULT : ButtonVariant.OUTLINE}\n size={buttonSize}\n color={ButtonColor.TEXT}\n onClick={() => handlePageChange(page)}\n disabled={disabled}\n label={`Go to page ${page}`}\n className={cn(\n 'flex aspect-square h-8 w-8 min-w-0 items-center justify-center p-0',\n size === 'sm' && 'h-6 w-6',\n size === 'lg' && 'h-10 w-10',\n isActive && 'font-semibold'\n )}\n >\n {page}\n </Button>\n );\n })}\n </div>\n\n {showPrevNext && (\n <Button\n variant={ButtonVariant.OUTLINE}\n size={buttonSize}\n color={ButtonColor.TEXT}\n onClick={() => handlePageChange(currentPage + 1)}\n disabled={disabled || isLastPage}\n label=\"Go to next page\"\n Icon={ChevronRight}\n className=\"min-w-0 px-2\"\n />\n )}\n </div>\n );\n};\n"],"mappings":"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"}
1
+ {"version":3,"file":"Pagination.mjs","names":["pages: (number | 'ellipsis')[]","Pagination: FC<PaginationProps>"],"sources":["../../../../src/components/Pagination/Pagination.tsx"],"sourcesContent":["'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { ChevronLeft, ChevronRight, MoreHorizontal } from 'lucide-react';\nimport type { FC, HTMLAttributes } from 'react';\nimport { cn } from '../../utils/cn';\nimport { Button, ButtonColor, ButtonSize, ButtonVariant } from '../Button';\n\nexport const paginationVariants = cva(\n 'flex items-center justify-center gap-1',\n {\n variants: {\n size: {\n sm: 'gap-1',\n md: 'gap-2',\n lg: 'gap-3',\n },\n color: {\n text: 'background-text',\n primary: 'background-primary',\n secondary: 'background-secondary',\n neutral: 'background-neutral',\n destructive: 'background-destructive',\n },\n variant: {\n default: '',\n bordered: 'rounded-lg border border-border p-2',\n ghost: 'bg-transparent',\n },\n },\n defaultVariants: {\n size: 'md',\n variant: 'default',\n },\n }\n);\n\nexport enum PaginationSize {\n SM = 'sm',\n MD = 'md',\n LG = 'lg',\n}\n\nexport enum PaginationVariant {\n DEFAULT = 'default',\n BORDERED = 'bordered',\n GHOST = 'ghost',\n}\n\nexport type PaginationProps = HTMLAttributes<HTMLDivElement> &\n VariantProps<typeof paginationVariants> & {\n currentPage: number;\n totalPages: number;\n onPageChange: (page: number) => void;\n showFirstLast?: boolean;\n showPrevNext?: boolean;\n maxVisiblePages?: number;\n disabled?: boolean;\n };\n\nconst generatePageNumbers = (\n currentPage: number,\n totalPages: number,\n maxVisiblePages: number\n): (number | 'ellipsis')[] => {\n if (totalPages <= maxVisiblePages) {\n return Array.from({ length: totalPages }, (_, i) => i + 1);\n }\n\n const pages: (number | 'ellipsis')[] = [];\n const halfVisible = Math.floor(maxVisiblePages / 2);\n\n pages.push(1);\n\n if (currentPage <= halfVisible + 2) {\n for (let i = 2; i <= Math.min(maxVisiblePages - 1, totalPages - 1); i++) {\n pages.push(i);\n }\n if (totalPages > maxVisiblePages) {\n pages.push('ellipsis');\n }\n if (totalPages > 1) {\n pages.push(totalPages);\n }\n } else if (currentPage >= totalPages - halfVisible - 1) {\n if (totalPages > maxVisiblePages) {\n pages.push('ellipsis');\n }\n for (\n let i = Math.max(2, totalPages - maxVisiblePages + 2);\n i <= totalPages;\n i++\n ) {\n pages.push(i);\n }\n } else {\n pages.push('ellipsis');\n const start = currentPage - halfVisible;\n const end = currentPage + halfVisible;\n for (let i = start; i <= end; i++) {\n pages.push(i);\n }\n pages.push('ellipsis');\n pages.push(totalPages);\n }\n\n return pages;\n};\n\nconst getButtonSize = (size?: PaginationSize | `${PaginationSize}` | null) => {\n return size === PaginationSize.SM\n ? ButtonSize.ICON_SM\n : size === PaginationSize.LG\n ? ButtonSize.ICON_LG\n : ButtonSize.ICON_MD;\n};\n\nexport const Pagination: FC<PaginationProps> = ({\n currentPage,\n totalPages,\n onPageChange,\n showFirstLast = false,\n showPrevNext = true,\n maxVisiblePages = 5,\n disabled = false,\n size = PaginationSize.MD,\n variant = PaginationVariant.DEFAULT,\n color = ButtonColor.TEXT,\n className,\n ...props\n}) => {\n const pageNumbers = generatePageNumbers(\n currentPage,\n totalPages,\n maxVisiblePages\n );\n\n const buttonSize = getButtonSize(size);\n const isFirstPage = currentPage === 1;\n const isLastPage = currentPage === totalPages;\n\n if (totalPages <= 1) return null;\n\n const handlePageChange = (page: number) => {\n if (!disabled && page >= 1 && page <= totalPages && page !== currentPage) {\n onPageChange(page);\n }\n };\n\n return (\n <div\n className={cn(paginationVariants({ size, variant }), className)}\n {...props}\n >\n {showPrevNext && (\n <Button\n variant={ButtonVariant.OUTLINE}\n size={buttonSize}\n color={ButtonColor.TEXT}\n onClick={() => handlePageChange(currentPage - 1)}\n disabled={disabled || isFirstPage}\n label=\"Go to previous page\"\n Icon={ChevronLeft}\n className=\"min-w-0 px-2\"\n />\n )}\n\n <div className=\"flex items-center gap-1 max-md:gap-0.5\">\n {pageNumbers.map((page) => {\n if (page === 'ellipsis') {\n return (\n <div\n key={`ellipsis-${page}`}\n className=\"flex h-8 min-w-8 items-center justify-center px-1\"\n >\n <MoreHorizontal className=\"h-4 w-4 text-muted-foreground\" />\n </div>\n );\n }\n\n const isActive = page === currentPage;\n return (\n <Button\n key={page}\n variant={isActive ? ButtonVariant.DEFAULT : ButtonVariant.OUTLINE}\n size={buttonSize}\n color={ButtonColor.TEXT}\n onClick={() => handlePageChange(page)}\n disabled={disabled}\n label={`Go to page ${page}`}\n className={cn(\n 'flex aspect-square h-8 w-8 min-w-0 items-center justify-center p-0',\n size === 'sm' && 'h-6 w-6',\n size === 'lg' && 'h-10 w-10',\n isActive && 'font-semibold'\n )}\n >\n {page}\n </Button>\n );\n })}\n </div>\n\n {showPrevNext && (\n <Button\n variant={ButtonVariant.OUTLINE}\n size={buttonSize}\n color={ButtonColor.TEXT}\n onClick={() => handlePageChange(currentPage + 1)}\n disabled={disabled || isLastPage}\n label=\"Go to next page\"\n Icon={ChevronRight}\n className=\"min-w-0 px-2\"\n />\n )}\n </div>\n );\n};\n"],"mappings":"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"}
@@ -9,8 +9,11 @@ import { useNumber } from "react-intlayer/format";
9
9
  const ShowingResultsNumberItems = ({ currentPage, pageSize, totalItems }) => {
10
10
  const { showingResults } = useIntlayer("pagination");
11
11
  const number = useNumber();
12
- const start = Math.max(totalItems, (currentPage - 1) * pageSize + 1);
13
- const end = Math.min(currentPage * pageSize, totalItems);
12
+ const safePageSize = Math.max(1, pageSize);
13
+ const totalPages = Math.max(1, Math.ceil(totalItems / safePageSize));
14
+ const page = Math.min(Math.max(1, currentPage), totalPages);
15
+ const start = totalItems === 0 ? 0 : Math.min((page - 1) * safePageSize + 1, totalItems);
16
+ const end = totalItems === 0 ? 0 : Math.min(page * safePageSize, totalItems);
14
17
  return /* @__PURE__ */ jsx("div", {
15
18
  className: "text-neutral-600 text-sm dark:text-neutral-400",
16
19
  children: showingResults({
@@ -1 +1 @@
1
- {"version":3,"file":"ShowingResultsNumberItems.mjs","names":["ShowingResultsNumberItems: FC<ShowingResultsNumberItemsProps>","start: number","end: number"],"sources":["../../../../src/components/Pagination/ShowingResultsNumberItems.tsx"],"sourcesContent":["'use client';\n\nimport type { FC } from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport { useNumber } from 'react-intlayer/format';\n\nexport type ShowingResultsNumberItemsProps = {\n currentPage: number;\n pageSize: number;\n totalItems: number;\n};\n\nexport const ShowingResultsNumberItems: FC<ShowingResultsNumberItemsProps> = ({\n currentPage,\n pageSize,\n totalItems,\n}) => {\n const { showingResults } = useIntlayer('pagination');\n const number = useNumber();\n\n const start: number = Math.max(totalItems, (currentPage - 1) * pageSize + 1);\n const end: number = Math.min(currentPage * pageSize, totalItems);\n\n return (\n <div className=\"text-neutral-600 text-sm dark:text-neutral-400\">\n {showingResults({\n start: number(start),\n end: number(end),\n total: number(totalItems),\n })}\n </div>\n );\n};\n"],"mappings":";;;;;;;;AAYA,MAAaA,6BAAiE,EAC5E,aACA,UACA,iBACI;CACJ,MAAM,EAAE,mBAAmB,YAAY,aAAa;CACpD,MAAM,SAAS,WAAW;CAE1B,MAAMC,QAAgB,KAAK,IAAI,aAAa,cAAc,KAAK,WAAW,EAAE;CAC5E,MAAMC,MAAc,KAAK,IAAI,cAAc,UAAU,WAAW;AAEhE,QACE,oBAAC;EAAI,WAAU;YACZ,eAAe;GACd,OAAO,OAAO,MAAM;GACpB,KAAK,OAAO,IAAI;GAChB,OAAO,OAAO,WAAW;GAC1B,CAAC;GACE"}
1
+ {"version":3,"file":"ShowingResultsNumberItems.mjs","names":["ShowingResultsNumberItems: FC<ShowingResultsNumberItemsProps>"],"sources":["../../../../src/components/Pagination/ShowingResultsNumberItems.tsx"],"sourcesContent":["'use client';\n\nimport type { FC } from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport { useNumber } from 'react-intlayer/format';\n\nexport type ShowingResultsNumberItemsProps = {\n currentPage: number;\n pageSize: number;\n totalItems: number;\n};\n\nexport const ShowingResultsNumberItems: FC<ShowingResultsNumberItemsProps> = ({\n currentPage,\n pageSize,\n totalItems,\n}) => {\n const { showingResults } = useIntlayer('pagination');\n const number = useNumber();\n\n // Guard against weird inputs\n const safePageSize = Math.max(1, pageSize);\n const totalPages = Math.max(1, Math.ceil(totalItems / safePageSize));\n const page = Math.min(Math.max(1, currentPage), totalPages);\n\n const start =\n totalItems === 0 ? 0 : Math.min((page - 1) * safePageSize + 1, totalItems);\n const end = totalItems === 0 ? 0 : Math.min(page * safePageSize, totalItems);\n\n return (\n <div className=\"text-neutral-600 text-sm dark:text-neutral-400\">\n {showingResults({\n start: number(start),\n end: number(end),\n total: number(totalItems),\n })}\n </div>\n );\n};\n"],"mappings":";;;;;;;;AAYA,MAAaA,6BAAiE,EAC5E,aACA,UACA,iBACI;CACJ,MAAM,EAAE,mBAAmB,YAAY,aAAa;CACpD,MAAM,SAAS,WAAW;CAG1B,MAAM,eAAe,KAAK,IAAI,GAAG,SAAS;CAC1C,MAAM,aAAa,KAAK,IAAI,GAAG,KAAK,KAAK,aAAa,aAAa,CAAC;CACpE,MAAM,OAAO,KAAK,IAAI,KAAK,IAAI,GAAG,YAAY,EAAE,WAAW;CAE3D,MAAM,QACJ,eAAe,IAAI,IAAI,KAAK,KAAK,OAAO,KAAK,eAAe,GAAG,WAAW;CAC5E,MAAM,MAAM,eAAe,IAAI,IAAI,KAAK,IAAI,OAAO,cAAc,WAAW;AAE5E,QACE,oBAAC;EAAI,WAAU;YACZ,eAAe;GACd,OAAO,OAAO,MAAM;GACpB,KAAK,OAAO,IAAI;GAChB,OAAO,OAAO,WAAW;GAC1B,CAAC;GACE"}
@@ -92,7 +92,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
92
92
  * @param props - DotPattern component props
93
93
  * @returns SVG element with repeating dot pattern
94
94
  */
95
- const DotPattern = ({ width = 16, height = 16, x = 0, y = 0, cx = 1, cy = 1, cr = 1, className,...props }) => /* @__PURE__ */ jsxs("svg", {
95
+ const DotPattern = ({ width = 16, height = 16, x = 0, y = 0, cx = 1, cy = 1, cr = 1, className, ...props }) => /* @__PURE__ */ jsxs("svg", {
96
96
  "aria-hidden": "true",
97
97
  className: cn("pointer-events-none absolute inset-0 h-full w-full fill-neutral/30", className),
98
98
  ...props,
@@ -1 +1 @@
1
- {"version":3,"file":"DotPattern.mjs","names":["DotPattern: FC<DotPatternProps>"],"sources":["../../../../src/components/Pattern/DotPattern.tsx"],"sourcesContent":["import type { FC, SVGProps } from 'react';\n\nimport { cn } from '../../utils/cn';\n\n/**\n * Props for the DotPattern component\n * Extends SVGProps to inherit all standard SVG attributes\n */\ntype DotPatternProps = {\n /** Width of the pattern tile in pixels */\n width?: number;\n /** Height of the pattern tile in pixels */\n height?: number;\n /** Horizontal offset of the pattern */\n x?: number;\n /** Vertical offset of the pattern */\n y?: number;\n /** X coordinate of the dot center within the pattern tile */\n cx?: number;\n /** Y coordinate of the dot center within the pattern tile */\n cy?: number;\n /** Radius of each dot in the pattern */\n cr?: number;\n} & SVGProps<SVGSVGElement>;\n\n/**\n * Dot Pattern Component\n *\n * A decorative SVG component that generates a repeating dot pattern background.\n * Perfect for adding subtle texture and visual interest to sections, cards, or hero areas\n * without interfering with content readability.\n *\n * Features:\n * - Scalable vector-based pattern that looks crisp at any size\n * - Customizable dot spacing, size, and positioning\n * - Semi-transparent fill for subtle visual effect\n * - Accessibility-friendly with aria-hidden attribute\n * - Pointer events disabled to avoid interaction interference\n * - Unique pattern ID generation to prevent conflicts\n * - Full coverage with absolute positioning\n *\n * Technical Implementation:\n * - Uses SVG `<pattern>` element for efficient rendering\n * - Pattern repeats using userSpaceOnUse coordinate system\n * - Generates unique IDs using React's useId hook\n * - Fills entire container with 100% width and height\n * - Pattern tile coordinates defined in userSpaceOnUse units\n *\n * Visual Characteristics:\n * - Default: 16x16px tile with 1px radius dots\n * - Semi-transparent neutral fill (30% opacity)\n * - Dots positioned at (1,1) within each tile by default\n * - Absolute positioning covers entire parent container\n *\n * @example\n * Basic usage as background pattern:\n * ```tsx\n * <div className=\"relative min-h-screen\">\n * <DotPattern />\n * <div className=\"relative z-10\">\n * <h1>Content over dot pattern</h1>\n * </div>\n * </div>\n * ```\n *\n * @example\n * Custom dot spacing and size:\n * ```tsx\n * <DotPattern\n * width={24}\n * height={24}\n * cr={1.5}\n * className=\"fill-primary/20\"\n * />\n * ```\n *\n * @example\n * Offset pattern positioning:\n * ```tsx\n * <DotPattern\n * x={8}\n * y={8}\n * cx={2}\n * cy={2}\n * className=\"fill-accent/25\"\n * />\n * ```\n *\n * @example\n * Large sparse dots:\n * ```tsx\n * <DotPattern\n * width={32}\n * height={32}\n * cr={2}\n * cx={16}\n * cy={16}\n * className=\"fill-neutral/10\"\n * />\n * ```\n *\n * Styling Notes:\n * - Use `fill-*` classes to customize dot color and opacity\n * - Pattern automatically fills parent container\n * - Consider contrast with overlaid content\n * - Semi-transparent fills work best for backgrounds\n *\n * Accessibility:\n * - Marked as `aria-hidden=\"true\"` since it's decorative\n * - Pointer events disabled to maintain interactivity of overlaid content\n * - Does not interfere with screen readers or keyboard navigation\n *\n * @param props - DotPattern component props\n * @returns SVG element with repeating dot pattern\n */\nexport const DotPattern: FC<DotPatternProps> = ({\n width = 16,\n height = 16,\n x = 0,\n y = 0,\n cx = 1,\n cy = 1,\n cr = 1,\n className,\n ...props\n}) => (\n <svg\n aria-hidden=\"true\"\n className={cn(\n 'pointer-events-none absolute inset-0 h-full w-full fill-neutral/30',\n className\n )}\n {...props}\n >\n <defs>\n <pattern\n id=\"pattern-circle\"\n width={width}\n height={height}\n patternUnits=\"userSpaceOnUse\"\n patternContentUnits=\"userSpaceOnUse\"\n x={x}\n y={y}\n >\n <circle cx={cx} cy={cy} r={cr} />\n </pattern>\n </defs>\n <rect\n width=\"100%\"\n height=\"100%\"\n strokeWidth={0}\n fill={`url(#pattern-circle)`}\n />\n </svg>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmHA,MAAaA,cAAmC,EAC9C,QAAQ,IACR,SAAS,IACT,IAAI,GACJ,IAAI,GACJ,KAAK,GACL,KAAK,GACL,KAAK,GACL,UACA,GAAG,YAEH,qBAAC;CACC,eAAY;CACZ,WAAW,GACT,sEACA,UACD;CACD,GAAI;YAEJ,oBAAC,oBACC,oBAAC;EACC,IAAG;EACI;EACC;EACR,cAAa;EACb,qBAAoB;EACjB;EACA;YAEH,oBAAC;GAAW;GAAQ;GAAI,GAAG;IAAM;GACzB,GACL,EACP,oBAAC;EACC,OAAM;EACN,QAAO;EACP,aAAa;EACb,MAAM;GACN;EACE"}
1
+ {"version":3,"file":"DotPattern.mjs","names":["DotPattern: FC<DotPatternProps>"],"sources":["../../../../src/components/Pattern/DotPattern.tsx"],"sourcesContent":["import type { FC, SVGProps } from 'react';\n\nimport { cn } from '../../utils/cn';\n\n/**\n * Props for the DotPattern component\n * Extends SVGProps to inherit all standard SVG attributes\n */\ntype DotPatternProps = {\n /** Width of the pattern tile in pixels */\n width?: number;\n /** Height of the pattern tile in pixels */\n height?: number;\n /** Horizontal offset of the pattern */\n x?: number;\n /** Vertical offset of the pattern */\n y?: number;\n /** X coordinate of the dot center within the pattern tile */\n cx?: number;\n /** Y coordinate of the dot center within the pattern tile */\n cy?: number;\n /** Radius of each dot in the pattern */\n cr?: number;\n} & SVGProps<SVGSVGElement>;\n\n/**\n * Dot Pattern Component\n *\n * A decorative SVG component that generates a repeating dot pattern background.\n * Perfect for adding subtle texture and visual interest to sections, cards, or hero areas\n * without interfering with content readability.\n *\n * Features:\n * - Scalable vector-based pattern that looks crisp at any size\n * - Customizable dot spacing, size, and positioning\n * - Semi-transparent fill for subtle visual effect\n * - Accessibility-friendly with aria-hidden attribute\n * - Pointer events disabled to avoid interaction interference\n * - Unique pattern ID generation to prevent conflicts\n * - Full coverage with absolute positioning\n *\n * Technical Implementation:\n * - Uses SVG `<pattern>` element for efficient rendering\n * - Pattern repeats using userSpaceOnUse coordinate system\n * - Generates unique IDs using React's useId hook\n * - Fills entire container with 100% width and height\n * - Pattern tile coordinates defined in userSpaceOnUse units\n *\n * Visual Characteristics:\n * - Default: 16x16px tile with 1px radius dots\n * - Semi-transparent neutral fill (30% opacity)\n * - Dots positioned at (1,1) within each tile by default\n * - Absolute positioning covers entire parent container\n *\n * @example\n * Basic usage as background pattern:\n * ```tsx\n * <div className=\"relative min-h-screen\">\n * <DotPattern />\n * <div className=\"relative z-10\">\n * <h1>Content over dot pattern</h1>\n * </div>\n * </div>\n * ```\n *\n * @example\n * Custom dot spacing and size:\n * ```tsx\n * <DotPattern\n * width={24}\n * height={24}\n * cr={1.5}\n * className=\"fill-primary/20\"\n * />\n * ```\n *\n * @example\n * Offset pattern positioning:\n * ```tsx\n * <DotPattern\n * x={8}\n * y={8}\n * cx={2}\n * cy={2}\n * className=\"fill-accent/25\"\n * />\n * ```\n *\n * @example\n * Large sparse dots:\n * ```tsx\n * <DotPattern\n * width={32}\n * height={32}\n * cr={2}\n * cx={16}\n * cy={16}\n * className=\"fill-neutral/10\"\n * />\n * ```\n *\n * Styling Notes:\n * - Use `fill-*` classes to customize dot color and opacity\n * - Pattern automatically fills parent container\n * - Consider contrast with overlaid content\n * - Semi-transparent fills work best for backgrounds\n *\n * Accessibility:\n * - Marked as `aria-hidden=\"true\"` since it's decorative\n * - Pointer events disabled to maintain interactivity of overlaid content\n * - Does not interfere with screen readers or keyboard navigation\n *\n * @param props - DotPattern component props\n * @returns SVG element with repeating dot pattern\n */\nexport const DotPattern: FC<DotPatternProps> = ({\n width = 16,\n height = 16,\n x = 0,\n y = 0,\n cx = 1,\n cy = 1,\n cr = 1,\n className,\n ...props\n}) => (\n <svg\n aria-hidden=\"true\"\n className={cn(\n 'pointer-events-none absolute inset-0 h-full w-full fill-neutral/30',\n className\n )}\n {...props}\n >\n <defs>\n <pattern\n id=\"pattern-circle\"\n width={width}\n height={height}\n patternUnits=\"userSpaceOnUse\"\n patternContentUnits=\"userSpaceOnUse\"\n x={x}\n y={y}\n >\n <circle cx={cx} cy={cy} r={cr} />\n </pattern>\n </defs>\n <rect\n width=\"100%\"\n height=\"100%\"\n strokeWidth={0}\n fill={`url(#pattern-circle)`}\n />\n </svg>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmHA,MAAaA,cAAmC,EAC9C,QAAQ,IACR,SAAS,IACT,IAAI,GACJ,IAAI,GACJ,KAAK,GACL,KAAK,GACL,KAAK,GACL,WACA,GAAG,YAEH,qBAAC;CACC,eAAY;CACZ,WAAW,GACT,sEACA,UACD;CACD,GAAI;YAEJ,oBAAC,oBACC,oBAAC;EACC,IAAG;EACI;EACC;EACR,cAAa;EACb,qBAAoB;EACjB;EACA;YAEH,oBAAC;GAAW;GAAQ;GAAI,GAAG;IAAM;GACzB,GACL,EACP,oBAAC;EACC,OAAM;EACN,QAAO;EACP,aAAa;EACb,MAAM;GACN;EACE"}
@@ -111,7 +111,7 @@ const id = "grid-pattern";
111
111
  * @param props - GridPattern component props
112
112
  * @returns SVG element with repeating grid pattern and optional highlights
113
113
  */
114
- const GridPattern = ({ width = 40, height = 40, x = -1, y = -1, strokeDasharray = 0, squares, className,...props }) => /* @__PURE__ */ jsxs("svg", {
114
+ const GridPattern = ({ width = 40, height = 40, x = -1, y = -1, strokeDasharray = 0, squares, className, ...props }) => /* @__PURE__ */ jsxs("svg", {
115
115
  "aria-hidden": "true",
116
116
  className: cn("pointer-events-none absolute inset-0 h-full max-h-full w-full fill-neutral/10 stroke-neutral/15 dark:stroke-neutral/30", className),
117
117
  ...props,
@@ -1 +1 @@
1
- {"version":3,"file":"GridPattern.mjs","names":["GridPattern: FC<GridPatternProps>","x","y"],"sources":["../../../../src/components/Pattern/GridPattern.tsx"],"sourcesContent":["import type { FC, SVGProps } from 'react';\nimport { cn } from '../../utils/cn';\n\n/**\n * Props for the GridPattern component\n * Extends SVGProps to inherit all standard SVG attributes\n */\ntype GridPatternProps = {\n /** Width of each grid cell in pixels */\n width?: number;\n /** Height of each grid cell in pixels */\n height?: number;\n /** Horizontal offset of the pattern */\n x?: number;\n /** Vertical offset of the pattern */\n y?: number;\n /** Array of grid coordinates to highlight as filled squares */\n squares?: [x: number, y: number][];\n /** Dash pattern for grid lines (0 = solid, positive = dashed) */\n strokeDasharray?: number;\n} & SVGProps<SVGSVGElement>;\n\n/**\n * Unique identifier for the grid pattern definition\n * Static to ensure consistent referencing across instances\n */\nconst id = 'grid-pattern';\n\n/**\n * Grid Pattern Component\n *\n * A versatile SVG component that generates a repeating grid pattern background with\n * optional highlighted squares. Ideal for technical layouts, dashboards, design mockups,\n * and any interface requiring structured visual organization.\n *\n * Features:\n * - Scalable vector-based grid that renders crisp at any zoom level\n * - Customizable cell dimensions and spacing\n * - Optional square highlighting for emphasis or data visualization\n * - Configurable stroke patterns (solid or dashed lines)\n * - Theme-aware styling with automatic dark mode support\n * - Accessibility-friendly with screen reader exclusion\n * - Performance optimized with pointer events disabled\n * - Full container coverage with responsive sizing\n *\n * Technical Architecture:\n * - Uses SVG `<pattern>` for memory-efficient repetition\n * - Grid lines drawn with path elements for precision\n * - Highlighted squares rendered as separate rect elements\n * - Pattern coordinates use userSpaceOnUse for consistency\n * - Static pattern ID prevents conflicts between instances\n *\n * Visual Design:\n * - Default: 40x40px grid cells with subtle neutral strokes\n * - Light mode: 10% fill opacity, 15% stroke opacity\n * - Dark mode: Enhanced 30% stroke opacity for visibility\n * - Slight offset (-1px) for optimal line rendering\n * - Optional dashed lines for more subtle appearance\n *\n * Highlighted Squares:\n * - Defined by coordinate arrays [x, y] where x,y are grid positions\n * - Automatically sized to fit within grid cells (width-1, height-1)\n * - Positioned with 1px offset for visual separation from grid lines\n * - Inherit theme-based fill colors for consistency\n *\n * @example\n * Basic grid background:\n * ```tsx\n * <div className=\"relative min-h-screen\">\n * <GridPattern />\n * <div className=\"relative z-10\">\n * <h1>Content over grid</h1>\n * </div>\n * </div>\n * ```\n *\n * @example\n * Custom grid size with dashed lines:\n * ```tsx\n * <GridPattern\n * width={60}\n * height={60}\n * strokeDasharray={2}\n * className=\"stroke-primary/20\"\n * />\n * ```\n *\n * @example\n * Data visualization with highlighted squares:\n * ```tsx\n * <GridPattern\n * width={30}\n * height={30}\n * squares={[\n * [0, 1], [1, 1], [2, 1],\n * [1, 2], [3, 0], [4, 2]\n * ]}\n * className=\"fill-accent/20 stroke-accent/30\"\n * />\n * ```\n *\n * @example\n * Fine grid for technical layouts:\n * ```tsx\n * <GridPattern\n * width={20}\n * height={20}\n * strokeDasharray={1}\n * className=\"stroke-neutral/8 fill-neutral/5\"\n * />\n * ```\n *\n * Styling Guidelines:\n * - Use low opacity values (5-30%) for background subtlety\n * - Consider theme contrast when customizing colors\n * - Dashed patterns work well for secondary grids\n * - Match grid colors with overall design system\n *\n * Performance Notes:\n * - Pattern definition reused efficiently across large areas\n * - Highlighted squares rendered individually for flexibility\n * - Pointer events disabled to prevent interaction blocking\n * - SVG optimized for browser rendering performance\n *\n * Accessibility:\n * - Hidden from screen readers with aria-hidden=\"true\"\n * - Purely decorative - doesn't convey essential information\n * - Maintains sufficient contrast with overlaid content\n *\n * @param props - GridPattern component props\n * @returns SVG element with repeating grid pattern and optional highlights\n */\nexport const GridPattern: FC<GridPatternProps> = ({\n width = 40,\n height = 40,\n x = -1,\n y = -1,\n strokeDasharray = 0,\n squares,\n className,\n ...props\n}) => (\n <svg\n aria-hidden=\"true\"\n className={cn(\n 'pointer-events-none absolute inset-0 h-full max-h-full w-full fill-neutral/10 stroke-neutral/15 dark:stroke-neutral/30',\n className\n )}\n {...props}\n >\n <defs>\n <pattern\n id={id}\n width={width}\n height={height}\n patternUnits=\"userSpaceOnUse\"\n x={x}\n y={y}\n >\n <path\n d={`M.5 ${height}V.5H${width}`}\n fill=\"none\"\n strokeDasharray={strokeDasharray}\n />\n </pattern>\n </defs>\n <rect width=\"100%\" height=\"100%\" strokeWidth={0} fill={`url(#${id})`} />\n {squares && (\n <svg\n x={x}\n y={y}\n className=\"overflow-visible\"\n role=\"img\"\n aria-label=\"Grid pattern\"\n >\n {squares.map(([x, y]) => (\n <rect\n strokeWidth=\"0\"\n key={`${x}-${y}`}\n width={width - 1}\n height={height - 1}\n x={x * width + 1}\n y={y * height + 1}\n />\n ))}\n </svg>\n )}\n </svg>\n);\n"],"mappings":";;;;;;;;AA0BA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0GX,MAAaA,eAAqC,EAChD,QAAQ,IACR,SAAS,IACT,IAAI,IACJ,IAAI,IACJ,kBAAkB,GAClB,SACA,UACA,GAAG,YAEH,qBAAC;CACC,eAAY;CACZ,WAAW,GACT,0HACA,UACD;CACD,GAAI;;EAEJ,oBAAC,oBACC,oBAAC;GACK;GACG;GACC;GACR,cAAa;GACV;GACA;aAEH,oBAAC;IACC,GAAG,OAAO,OAAO,MAAM;IACvB,MAAK;IACY;KACjB;IACM,GACL;EACP,oBAAC;GAAK,OAAM;GAAO,QAAO;GAAO,aAAa;GAAG,MAAM,QAAQ,GAAG;IAAM;EACvE,WACC,oBAAC;GACI;GACA;GACH,WAAU;GACV,MAAK;GACL,cAAW;aAEV,QAAQ,KAAK,CAACC,KAAGC,SAChB,oBAAC;IACC,aAAY;IAEZ,OAAO,QAAQ;IACf,QAAQ,SAAS;IACjB,GAAGD,MAAI,QAAQ;IACf,GAAGC,MAAI,SAAS;MAJX,GAAGD,IAAE,GAAGC,MAKb,CACF;IACE;;EAEJ"}
1
+ {"version":3,"file":"GridPattern.mjs","names":["GridPattern: FC<GridPatternProps>","x","y"],"sources":["../../../../src/components/Pattern/GridPattern.tsx"],"sourcesContent":["import type { FC, SVGProps } from 'react';\nimport { cn } from '../../utils/cn';\n\n/**\n * Props for the GridPattern component\n * Extends SVGProps to inherit all standard SVG attributes\n */\ntype GridPatternProps = {\n /** Width of each grid cell in pixels */\n width?: number;\n /** Height of each grid cell in pixels */\n height?: number;\n /** Horizontal offset of the pattern */\n x?: number;\n /** Vertical offset of the pattern */\n y?: number;\n /** Array of grid coordinates to highlight as filled squares */\n squares?: [x: number, y: number][];\n /** Dash pattern for grid lines (0 = solid, positive = dashed) */\n strokeDasharray?: number;\n} & SVGProps<SVGSVGElement>;\n\n/**\n * Unique identifier for the grid pattern definition\n * Static to ensure consistent referencing across instances\n */\nconst id = 'grid-pattern';\n\n/**\n * Grid Pattern Component\n *\n * A versatile SVG component that generates a repeating grid pattern background with\n * optional highlighted squares. Ideal for technical layouts, dashboards, design mockups,\n * and any interface requiring structured visual organization.\n *\n * Features:\n * - Scalable vector-based grid that renders crisp at any zoom level\n * - Customizable cell dimensions and spacing\n * - Optional square highlighting for emphasis or data visualization\n * - Configurable stroke patterns (solid or dashed lines)\n * - Theme-aware styling with automatic dark mode support\n * - Accessibility-friendly with screen reader exclusion\n * - Performance optimized with pointer events disabled\n * - Full container coverage with responsive sizing\n *\n * Technical Architecture:\n * - Uses SVG `<pattern>` for memory-efficient repetition\n * - Grid lines drawn with path elements for precision\n * - Highlighted squares rendered as separate rect elements\n * - Pattern coordinates use userSpaceOnUse for consistency\n * - Static pattern ID prevents conflicts between instances\n *\n * Visual Design:\n * - Default: 40x40px grid cells with subtle neutral strokes\n * - Light mode: 10% fill opacity, 15% stroke opacity\n * - Dark mode: Enhanced 30% stroke opacity for visibility\n * - Slight offset (-1px) for optimal line rendering\n * - Optional dashed lines for more subtle appearance\n *\n * Highlighted Squares:\n * - Defined by coordinate arrays [x, y] where x,y are grid positions\n * - Automatically sized to fit within grid cells (width-1, height-1)\n * - Positioned with 1px offset for visual separation from grid lines\n * - Inherit theme-based fill colors for consistency\n *\n * @example\n * Basic grid background:\n * ```tsx\n * <div className=\"relative min-h-screen\">\n * <GridPattern />\n * <div className=\"relative z-10\">\n * <h1>Content over grid</h1>\n * </div>\n * </div>\n * ```\n *\n * @example\n * Custom grid size with dashed lines:\n * ```tsx\n * <GridPattern\n * width={60}\n * height={60}\n * strokeDasharray={2}\n * className=\"stroke-primary/20\"\n * />\n * ```\n *\n * @example\n * Data visualization with highlighted squares:\n * ```tsx\n * <GridPattern\n * width={30}\n * height={30}\n * squares={[\n * [0, 1], [1, 1], [2, 1],\n * [1, 2], [3, 0], [4, 2]\n * ]}\n * className=\"fill-accent/20 stroke-accent/30\"\n * />\n * ```\n *\n * @example\n * Fine grid for technical layouts:\n * ```tsx\n * <GridPattern\n * width={20}\n * height={20}\n * strokeDasharray={1}\n * className=\"stroke-neutral/8 fill-neutral/5\"\n * />\n * ```\n *\n * Styling Guidelines:\n * - Use low opacity values (5-30%) for background subtlety\n * - Consider theme contrast when customizing colors\n * - Dashed patterns work well for secondary grids\n * - Match grid colors with overall design system\n *\n * Performance Notes:\n * - Pattern definition reused efficiently across large areas\n * - Highlighted squares rendered individually for flexibility\n * - Pointer events disabled to prevent interaction blocking\n * - SVG optimized for browser rendering performance\n *\n * Accessibility:\n * - Hidden from screen readers with aria-hidden=\"true\"\n * - Purely decorative - doesn't convey essential information\n * - Maintains sufficient contrast with overlaid content\n *\n * @param props - GridPattern component props\n * @returns SVG element with repeating grid pattern and optional highlights\n */\nexport const GridPattern: FC<GridPatternProps> = ({\n width = 40,\n height = 40,\n x = -1,\n y = -1,\n strokeDasharray = 0,\n squares,\n className,\n ...props\n}) => (\n <svg\n aria-hidden=\"true\"\n className={cn(\n 'pointer-events-none absolute inset-0 h-full max-h-full w-full fill-neutral/10 stroke-neutral/15 dark:stroke-neutral/30',\n className\n )}\n {...props}\n >\n <defs>\n <pattern\n id={id}\n width={width}\n height={height}\n patternUnits=\"userSpaceOnUse\"\n x={x}\n y={y}\n >\n <path\n d={`M.5 ${height}V.5H${width}`}\n fill=\"none\"\n strokeDasharray={strokeDasharray}\n />\n </pattern>\n </defs>\n <rect width=\"100%\" height=\"100%\" strokeWidth={0} fill={`url(#${id})`} />\n {squares && (\n <svg\n x={x}\n y={y}\n className=\"overflow-visible\"\n role=\"img\"\n aria-label=\"Grid pattern\"\n >\n {squares.map(([x, y]) => (\n <rect\n strokeWidth=\"0\"\n key={`${x}-${y}`}\n width={width - 1}\n height={height - 1}\n x={x * width + 1}\n y={y * height + 1}\n />\n ))}\n </svg>\n )}\n </svg>\n);\n"],"mappings":";;;;;;;;AA0BA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0GX,MAAaA,eAAqC,EAChD,QAAQ,IACR,SAAS,IACT,IAAI,IACJ,IAAI,IACJ,kBAAkB,GAClB,SACA,WACA,GAAG,YAEH,qBAAC;CACC,eAAY;CACZ,WAAW,GACT,0HACA,UACD;CACD,GAAI;;EAEJ,oBAAC,oBACC,oBAAC;GACK;GACG;GACC;GACR,cAAa;GACV;GACA;aAEH,oBAAC;IACC,GAAG,OAAO,OAAO,MAAM;IACvB,MAAK;IACY;KACjB;IACM,GACL;EACP,oBAAC;GAAK,OAAM;GAAO,QAAO;GAAO,aAAa;GAAG,MAAM,QAAQ,GAAG;IAAM;EACvE,WACC,oBAAC;GACI;GACA;GACH,WAAU;GACV,MAAK;GACL,cAAW;aAEV,QAAQ,KAAK,CAACC,KAAGC,SAChB,oBAAC;IACC,aAAY;IAEZ,OAAO,QAAQ;IACf,QAAQ,SAAS;IACjB,GAAGD,MAAI,QAAQ;IACf,GAAGC,MAAI,SAAS;MAJX,GAAGD,IAAE,GAAGC,MAKb,CACF;IACE;;EAEJ"}
@@ -117,7 +117,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
117
117
  * @param props - Spotlight component props
118
118
  * @returns Animated SVG spotlight effect with blur filters
119
119
  */
120
- const Spotlight = ({ fill = "currentColor", cy = 273.501, rx = 1924.71, ry = 273.501, cx = 1924.71, opacity = .21, className,...props }) => /* @__PURE__ */ jsxs("svg", {
120
+ const Spotlight = ({ fill = "currentColor", cy = 273.501, rx = 1924.71, ry = 273.501, cx = 1924.71, opacity = .21, className, ...props }) => /* @__PURE__ */ jsxs("svg", {
121
121
  className: cn("pointer-events-none absolute size-screen animate-spotlight opacity-0", className),
122
122
  xmlns: "http://www.w3.org/2000/svg",
123
123
  viewBox: "0 0 3787 2842",
@@ -1 +1 @@
1
- {"version":3,"file":"SpotLight.mjs","names":["Spotlight: FC<SpotlightProps>"],"sources":["../../../../src/components/Pattern/SpotLight.tsx"],"sourcesContent":["import type { FC, SVGProps } from 'react';\nimport { cn } from '../../utils/cn';\n\n/**\n * Props for the Spotlight component\n * Extends SVGProps to inherit all standard SVG attributes\n */\ntype SpotlightProps = {\n /** Fill color for the spotlight effect (supports CSS color values) */\n fill?: string;\n /** X coordinate of the ellipse center */\n cx?: number;\n /** Y coordinate of the ellipse center */\n cy?: number;\n /** Horizontal radius of the ellipse */\n rx?: number;\n /** Vertical radius of the ellipse */\n ry?: number;\n /** Opacity of the spotlight effect (0-1) */\n opacity?: number;\n} & SVGProps<SVGSVGElement>;\n\n/**\n * Spotlight Component\n *\n * A dramatic animated SVG spotlight effect that creates a soft, glowing light beam\n * perfect for hero sections, landing pages, and attention-grabbing areas. Features\n * a sophisticated blur filter and smooth animation entrance.\n *\n * Features:\n * - Animated entrance with opacity fade-in effect\n * - Gaussian blur filter for realistic light diffusion\n * - Customizable positioning, size, and color\n * - Full-screen coverage with responsive scaling\n * - Performance optimized with CSS animations\n * - Pointer events disabled to preserve interactivity\n * - Theme-aware with currentColor support\n *\n * Technical Implementation:\n * - Uses SVG ellipse with advanced filter effects\n * - Gaussian blur with 151px standard deviation for soft edges\n * - Matrix transformation for realistic light angle (-0.822377, -0.568943)\n * - ViewBox coordinates optimized for screen coverage (3787x2842)\n * - Animation class `animate-spotlight` handles entrance effect\n * - Filter definition with unique ID prevents conflicts\n *\n * Visual Characteristics:\n * - Default: Large elliptical light beam (1924.71px radius)\n * - Positioned at (1924.71, 273.501) with soft vertical spread\n * - 21% opacity for subtle but noticeable effect\n * - Rotated and scaled for natural spotlight angle\n * - Soft gaussian blur creates realistic light falloff\n *\n * Animation Behavior:\n * - Starts with opacity: 0 (invisible)\n * - Animates to full visibility with smooth transition\n * - Animation timing and easing handled by CSS class\n * - Can be triggered on scroll or interaction events\n *\n * @example\n * Basic hero section spotlight:\n * ```tsx\n * <div className=\"relative min-h-screen bg-dark\">\n * <Spotlight className=\"top-0 left-0\" />\n * <div className=\"relative z-10 flex items-center justify-center h-screen\">\n * <h1 className=\"text-6xl font-bold text-white\">\n * Welcome to the Future\n * </h1>\n * </div>\n * </div>\n * ```\n *\n * @example\n * Custom colored spotlight:\n * ```tsx\n * <Spotlight\n * fill=\"#3b82f6\"\n * opacity={0.3}\n * className=\"top-10 -left-20\"\n * />\n * ```\n *\n * @example\n * Multiple spotlights for complex lighting:\n * ```tsx\n * <div className=\"relative\">\n * <Spotlight\n * cx={1000}\n * cy={300}\n * fill=\"rgb(59, 130, 246)\"\n * opacity={0.15}\n * />\n * <Spotlight\n * cx={2500}\n * cy={800}\n * fill=\"rgb(236, 72, 153)\"\n * opacity={0.15}\n * className=\"scale-75\"\n * />\n * </div>\n * ```\n *\n * @example\n * Responsive positioning:\n * ```tsx\n * <Spotlight\n * className=\"top-0 left-1/2 transform -translate-x-1/2 lg:left-0 lg:transform-none\"\n * opacity={0.25}\n * />\n * ```\n *\n * Styling Guidelines:\n * - Use low opacity (0.1-0.3) for subtle background effects\n * - Higher opacity (0.3-0.5) for dramatic focal points\n * - Consider theme colors when using custom fill values\n * - Position absolute with z-index management for layering\n *\n * Performance Considerations:\n * - SVG filter effects are GPU accelerated when possible\n * - Animation handled by CSS transforms for optimal performance\n * - Large viewBox size cached by browser for efficiency\n * - Pointer events disabled prevents layout recalculation\n *\n * Accessibility:\n * - Purely decorative - doesn't interfere with screen readers\n * - High contrast maintained with overlaid content\n * - Animation respects user's reduced motion preferences\n * - No semantic meaning - safe to hide from assistive tech\n *\n * CSS Requirements:\n * - Requires `animate-spotlight` animation class in Tailwind config\n * - Should define entrance animation timing and easing\n * - Consider defining custom animations for different effects\n *\n * @param props - Spotlight component props\n * @returns Animated SVG spotlight effect with blur filters\n */\nexport const Spotlight: FC<SpotlightProps> = ({\n fill = 'currentColor',\n cy = 273.501,\n rx = 1924.71,\n ry = 273.501,\n cx = 1924.71,\n opacity = 0.21,\n className,\n ...props\n}) => (\n <svg\n className={cn(\n 'pointer-events-none absolute size-screen animate-spotlight opacity-0',\n className\n )}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 3787 2842\"\n fill=\"none\"\n role=\"img\"\n aria-label=\"Spotlight\"\n {...props}\n >\n <g filter=\"url(#filter)\" transform=\"scale (-1, 1)\">\n <ellipse\n cx={cx}\n cy={cy}\n rx={rx}\n ry={ry}\n fill={fill}\n fillOpacity={opacity}\n transform=\"matrix(-0.822377 -0.568943 -0.568943 0.822377 3631.88 2291.09)\"\n ></ellipse>\n </g>\n <defs>\n <filter\n id=\"filter\"\n x=\"0.860352\"\n y=\"0.838989\"\n width=\"3785.16\"\n height=\"2840.26\"\n filterUnits=\"userSpaceOnUse\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feFlood floodOpacity=\"0\" result=\"BackgroundImageFix\"></feFlood>\n <feBlend\n mode=\"normal\"\n in=\"SourceGraphic\"\n in2=\"BackgroundImageFix\"\n result=\"shape\"\n ></feBlend>\n <feGaussianBlur\n stdDeviation=\"151\"\n result=\"effect1_foregroundBlur_1065_8\"\n ></feGaussianBlur>\n </filter>\n </defs>\n </svg>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyIA,MAAaA,aAAiC,EAC5C,OAAO,gBACP,KAAK,SACL,KAAK,SACL,KAAK,SACL,KAAK,SACL,UAAU,KACV,UACA,GAAG,YAEH,qBAAC;CACC,WAAW,GACT,wEACA,UACD;CACD,OAAM;CACN,SAAQ;CACR,MAAK;CACL,MAAK;CACL,cAAW;CACX,GAAI;YAEJ,oBAAC;EAAE,QAAO;EAAe,WAAU;YACjC,oBAAC;GACK;GACA;GACA;GACA;GACE;GACN,aAAa;GACb,WAAU;IACD;GACT,EACJ,oBAAC,oBACC,qBAAC;EACC,IAAG;EACH,GAAE;EACF,GAAE;EACF,OAAM;EACN,QAAO;EACP,aAAY;EACZ,2BAA0B;;GAE1B,oBAAC;IAAQ,cAAa;IAAI,QAAO;KAA+B;GAChE,oBAAC;IACC,MAAK;IACL,IAAG;IACH,KAAI;IACJ,QAAO;KACE;GACX,oBAAC;IACC,cAAa;IACb,QAAO;KACS;;GACX,GACJ;EACH"}
1
+ {"version":3,"file":"SpotLight.mjs","names":["Spotlight: FC<SpotlightProps>"],"sources":["../../../../src/components/Pattern/SpotLight.tsx"],"sourcesContent":["import type { FC, SVGProps } from 'react';\nimport { cn } from '../../utils/cn';\n\n/**\n * Props for the Spotlight component\n * Extends SVGProps to inherit all standard SVG attributes\n */\ntype SpotlightProps = {\n /** Fill color for the spotlight effect (supports CSS color values) */\n fill?: string;\n /** X coordinate of the ellipse center */\n cx?: number;\n /** Y coordinate of the ellipse center */\n cy?: number;\n /** Horizontal radius of the ellipse */\n rx?: number;\n /** Vertical radius of the ellipse */\n ry?: number;\n /** Opacity of the spotlight effect (0-1) */\n opacity?: number;\n} & SVGProps<SVGSVGElement>;\n\n/**\n * Spotlight Component\n *\n * A dramatic animated SVG spotlight effect that creates a soft, glowing light beam\n * perfect for hero sections, landing pages, and attention-grabbing areas. Features\n * a sophisticated blur filter and smooth animation entrance.\n *\n * Features:\n * - Animated entrance with opacity fade-in effect\n * - Gaussian blur filter for realistic light diffusion\n * - Customizable positioning, size, and color\n * - Full-screen coverage with responsive scaling\n * - Performance optimized with CSS animations\n * - Pointer events disabled to preserve interactivity\n * - Theme-aware with currentColor support\n *\n * Technical Implementation:\n * - Uses SVG ellipse with advanced filter effects\n * - Gaussian blur with 151px standard deviation for soft edges\n * - Matrix transformation for realistic light angle (-0.822377, -0.568943)\n * - ViewBox coordinates optimized for screen coverage (3787x2842)\n * - Animation class `animate-spotlight` handles entrance effect\n * - Filter definition with unique ID prevents conflicts\n *\n * Visual Characteristics:\n * - Default: Large elliptical light beam (1924.71px radius)\n * - Positioned at (1924.71, 273.501) with soft vertical spread\n * - 21% opacity for subtle but noticeable effect\n * - Rotated and scaled for natural spotlight angle\n * - Soft gaussian blur creates realistic light falloff\n *\n * Animation Behavior:\n * - Starts with opacity: 0 (invisible)\n * - Animates to full visibility with smooth transition\n * - Animation timing and easing handled by CSS class\n * - Can be triggered on scroll or interaction events\n *\n * @example\n * Basic hero section spotlight:\n * ```tsx\n * <div className=\"relative min-h-screen bg-dark\">\n * <Spotlight className=\"top-0 left-0\" />\n * <div className=\"relative z-10 flex items-center justify-center h-screen\">\n * <h1 className=\"text-6xl font-bold text-white\">\n * Welcome to the Future\n * </h1>\n * </div>\n * </div>\n * ```\n *\n * @example\n * Custom colored spotlight:\n * ```tsx\n * <Spotlight\n * fill=\"#3b82f6\"\n * opacity={0.3}\n * className=\"top-10 -left-20\"\n * />\n * ```\n *\n * @example\n * Multiple spotlights for complex lighting:\n * ```tsx\n * <div className=\"relative\">\n * <Spotlight\n * cx={1000}\n * cy={300}\n * fill=\"rgb(59, 130, 246)\"\n * opacity={0.15}\n * />\n * <Spotlight\n * cx={2500}\n * cy={800}\n * fill=\"rgb(236, 72, 153)\"\n * opacity={0.15}\n * className=\"scale-75\"\n * />\n * </div>\n * ```\n *\n * @example\n * Responsive positioning:\n * ```tsx\n * <Spotlight\n * className=\"top-0 left-1/2 transform -translate-x-1/2 lg:left-0 lg:transform-none\"\n * opacity={0.25}\n * />\n * ```\n *\n * Styling Guidelines:\n * - Use low opacity (0.1-0.3) for subtle background effects\n * - Higher opacity (0.3-0.5) for dramatic focal points\n * - Consider theme colors when using custom fill values\n * - Position absolute with z-index management for layering\n *\n * Performance Considerations:\n * - SVG filter effects are GPU accelerated when possible\n * - Animation handled by CSS transforms for optimal performance\n * - Large viewBox size cached by browser for efficiency\n * - Pointer events disabled prevents layout recalculation\n *\n * Accessibility:\n * - Purely decorative - doesn't interfere with screen readers\n * - High contrast maintained with overlaid content\n * - Animation respects user's reduced motion preferences\n * - No semantic meaning - safe to hide from assistive tech\n *\n * CSS Requirements:\n * - Requires `animate-spotlight` animation class in Tailwind config\n * - Should define entrance animation timing and easing\n * - Consider defining custom animations for different effects\n *\n * @param props - Spotlight component props\n * @returns Animated SVG spotlight effect with blur filters\n */\nexport const Spotlight: FC<SpotlightProps> = ({\n fill = 'currentColor',\n cy = 273.501,\n rx = 1924.71,\n ry = 273.501,\n cx = 1924.71,\n opacity = 0.21,\n className,\n ...props\n}) => (\n <svg\n className={cn(\n 'pointer-events-none absolute size-screen animate-spotlight opacity-0',\n className\n )}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 3787 2842\"\n fill=\"none\"\n role=\"img\"\n aria-label=\"Spotlight\"\n {...props}\n >\n <g filter=\"url(#filter)\" transform=\"scale (-1, 1)\">\n <ellipse\n cx={cx}\n cy={cy}\n rx={rx}\n ry={ry}\n fill={fill}\n fillOpacity={opacity}\n transform=\"matrix(-0.822377 -0.568943 -0.568943 0.822377 3631.88 2291.09)\"\n ></ellipse>\n </g>\n <defs>\n <filter\n id=\"filter\"\n x=\"0.860352\"\n y=\"0.838989\"\n width=\"3785.16\"\n height=\"2840.26\"\n filterUnits=\"userSpaceOnUse\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feFlood floodOpacity=\"0\" result=\"BackgroundImageFix\"></feFlood>\n <feBlend\n mode=\"normal\"\n in=\"SourceGraphic\"\n in2=\"BackgroundImageFix\"\n result=\"shape\"\n ></feBlend>\n <feGaussianBlur\n stdDeviation=\"151\"\n result=\"effect1_foregroundBlur_1065_8\"\n ></feGaussianBlur>\n </filter>\n </defs>\n </svg>\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyIA,MAAaA,aAAiC,EAC5C,OAAO,gBACP,KAAK,SACL,KAAK,SACL,KAAK,SACL,KAAK,SACL,UAAU,KACV,WACA,GAAG,YAEH,qBAAC;CACC,WAAW,GACT,wEACA,UACD;CACD,OAAM;CACN,SAAQ;CACR,MAAK;CACL,MAAK;CACL,cAAW;CACX,GAAI;YAEJ,oBAAC;EAAE,QAAO;EAAe,WAAU;YACjC,oBAAC;GACK;GACA;GACA;GACA;GACE;GACN,aAAa;GACb,WAAU;IACD;GACT,EACJ,oBAAC,oBACC,qBAAC;EACC,IAAG;EACH,GAAE;EACF,GAAE;EACF,OAAM;EACN,QAAO;EACP,aAAY;EACZ,2BAA0B;;GAE1B,oBAAC;IAAQ,cAAa;IAAI,QAAO;KAA+B;GAChE,oBAAC;IACC,MAAK;IACL,IAAG;IACH,KAAI;IACJ,QAAO;KACE;GACX,oBAAC;IACC,cAAa;IACb,QAAO;KACS;;GACX,GACJ;EACH"}
@@ -34,7 +34,7 @@ const PopoverComponent = (props) => {
34
34
  * @param props - Popover Detail component props
35
35
  * @returns Positioned popover content with animations and accessibility
36
36
  */
37
- const Detail$1 = ({ xAlign = PopoverXAlign.START, yAlign = PopoverYAlign.BELOW,...props }) => {
37
+ const Detail$1 = ({ xAlign = PopoverXAlign.START, yAlign = PopoverYAlign.BELOW, ...props }) => {
38
38
  const popoverRef = useRef(null);
39
39
  const [computedXAlign, setComputedXAlign] = useState(xAlign);
40
40
  const [computedYAlign, setComputedYAlign] = useState(yAlign);
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic.mjs","names":["PopoverComponent: FC<PopoverProps>","Detail: FC<DetailProps>","triggerElement","StaticDetail","Popover: PopoverType","Detail"],"sources":["../../../../src/components/Popover/dynamic.tsx"],"sourcesContent":["'use client';\n\nimport type { FC } from 'react';\nimport { useEffect, useRef, useState } from 'react';\nimport {\n type DetailProps,\n type PopoverProps,\n PopoverStatic,\n type PopoverType,\n PopoverXAlign,\n PopoverYAlign,\n Detail as StaticDetail,\n} from './static';\n\n/**\n * Popover Component (Client-side)\n *\n * Client-side wrapper around the static Popover component.\n * Reuses the server-side compatible implementation.\n *\n * @param props - Popover component props\n * @returns Trigger container with popover functionality\n */\nconst PopoverComponent: FC<PopoverProps> = (props) => {\n return <PopoverStatic {...props} />;\n};\n\n/**\n * Popover Detail Component (Client-side)\n *\n * Client-side wrapper around the static Detail component that adds automatic\n * positioning logic based on viewport constraints.\n *\n * Features:\n * - Reuses server-side compatible static Detail component\n * - Adds automatic positioning adjustment based on viewport\n * - Calculates optimal X/Y alignment to prevent overflow\n * - Dynamically adjusts max-width based on available space\n * - Listens to window resize and scroll events\n *\n * @param props - Popover Detail component props\n * @returns Positioned popover content with animations and accessibility\n */\nconst Detail: FC<DetailProps> = ({\n xAlign = PopoverXAlign.START,\n yAlign = PopoverYAlign.BELOW,\n ...props\n}) => {\n const popoverRef = useRef<HTMLDivElement>(null);\n const [computedXAlign, setComputedXAlign] = useState(xAlign);\n const [computedYAlign, setComputedYAlign] = useState(yAlign);\n const [maxWidth, setMaxWidth] = useState<number | undefined>(undefined);\n\n useEffect(() => {\n const adjustPosition = () => {\n if (!popoverRef.current) return;\n\n const popoverElement = popoverRef.current;\n const triggerElement = document.getElementById(\n `unrollable-panel-button-${props.identifier}`\n );\n\n if (!triggerElement) return;\n\n const triggerRect = triggerElement.getBoundingClientRect();\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n const gap = 16; // 1rem gap\n const padding = 16; // Additional padding from viewport edges\n\n // Calculate maximum width based on viewport and trigger position\n const maxWidthFromLeft = viewportWidth - triggerRect.left - padding;\n const maxWidthFromRight = triggerRect.right - padding;\n\n // Use the larger space to ensure popover can fit\n const absoluteMaxWidth = Math.max(maxWidthFromLeft, maxWidthFromRight);\n\n setMaxWidth(absoluteMaxWidth);\n\n // Force a layout calculation by temporarily making visible if needed\n const wasInvisible = popoverElement.classList.contains('invisible');\n if (wasInvisible) {\n popoverElement.style.visibility = 'hidden';\n popoverElement.classList.remove('invisible');\n }\n\n // Small delay to ensure max-width is applied and content reflows\n requestAnimationFrame(() => {\n const popoverRect = popoverElement.getBoundingClientRect();\n\n // Restore invisible state if it was invisible\n if (wasInvisible) {\n popoverElement.style.visibility = '';\n popoverElement.classList.add('invisible');\n }\n\n // Determine optimal Y alignment\n let newYAlign = yAlign;\n const spaceBelow = viewportHeight - triggerRect.bottom - gap;\n const spaceAbove = triggerRect.top - gap;\n\n if (yAlign === PopoverYAlign.BELOW && spaceBelow < popoverRect.height) {\n // Not enough space below, try above\n if (spaceAbove >= popoverRect.height) {\n newYAlign = PopoverYAlign.ABOVE;\n }\n } else if (\n yAlign === PopoverYAlign.ABOVE &&\n spaceAbove < popoverRect.height\n ) {\n // Not enough space above, try below\n if (spaceBelow >= popoverRect.height) {\n newYAlign = PopoverYAlign.BELOW;\n }\n }\n\n // Determine optimal X alignment\n let newXAlign = xAlign;\n const spaceRight = viewportWidth - triggerRect.left - padding;\n const spaceLeft = triggerRect.right - padding;\n\n if (xAlign === PopoverXAlign.START && spaceRight < popoverRect.width) {\n // Not enough space on the right, try left\n if (spaceLeft >= popoverRect.width) {\n newXAlign = PopoverXAlign.END;\n }\n } else if (\n xAlign === PopoverXAlign.END &&\n spaceLeft < popoverRect.width\n ) {\n // Not enough space on the left, try right\n if (spaceRight >= popoverRect.width) {\n newXAlign = PopoverXAlign.START;\n }\n }\n\n setComputedYAlign(newYAlign);\n setComputedXAlign(newXAlign);\n });\n };\n\n // Adjust position with a slight delay to ensure DOM is ready\n const timeoutId = setTimeout(adjustPosition, 0);\n\n // Listen to mouse enter on the trigger to recalculate\n const triggerElement = document.getElementById(\n `unrollable-panel-button-${props.identifier}`\n );\n\n if (triggerElement) {\n triggerElement.addEventListener('mouseenter', adjustPosition);\n triggerElement.addEventListener('focusin', adjustPosition);\n }\n\n // Use ResizeObserver to detect popover content size changes\n const resizeObserver = new ResizeObserver(() => {\n adjustPosition();\n });\n\n if (popoverRef.current) {\n resizeObserver.observe(popoverRef.current);\n }\n\n window.addEventListener('resize', adjustPosition);\n window.addEventListener('scroll', adjustPosition, true);\n\n return () => {\n clearTimeout(timeoutId);\n if (triggerElement) {\n triggerElement.removeEventListener('mouseenter', adjustPosition);\n triggerElement.removeEventListener('focusin', adjustPosition);\n }\n resizeObserver.disconnect();\n window.removeEventListener('resize', adjustPosition);\n window.removeEventListener('scroll', adjustPosition, true);\n };\n }, [props.identifier, xAlign, yAlign]);\n\n // Use the static Detail component with computed alignment values\n return (\n <StaticDetail\n {...props}\n xAlign={computedXAlign}\n yAlign={computedYAlign}\n ref={popoverRef}\n style={{\n ...props.style,\n maxWidth: maxWidth ? `${maxWidth}px` : undefined,\n }}\n />\n );\n};\n\n// Create Popover with Detail attached\nexport const Popover: PopoverType = PopoverComponent as PopoverType;\n\nPopover.Detail = Detail;\n"],"mappings":"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"}
1
+ {"version":3,"file":"dynamic.mjs","names":["PopoverComponent: FC<PopoverProps>","Detail: FC<DetailProps>","triggerElement","StaticDetail","Popover: PopoverType","Detail"],"sources":["../../../../src/components/Popover/dynamic.tsx"],"sourcesContent":["'use client';\n\nimport type { FC } from 'react';\nimport { useEffect, useRef, useState } from 'react';\nimport {\n type DetailProps,\n type PopoverProps,\n PopoverStatic,\n type PopoverType,\n PopoverXAlign,\n PopoverYAlign,\n Detail as StaticDetail,\n} from './static';\n\n/**\n * Popover Component (Client-side)\n *\n * Client-side wrapper around the static Popover component.\n * Reuses the server-side compatible implementation.\n *\n * @param props - Popover component props\n * @returns Trigger container with popover functionality\n */\nconst PopoverComponent: FC<PopoverProps> = (props) => {\n return <PopoverStatic {...props} />;\n};\n\n/**\n * Popover Detail Component (Client-side)\n *\n * Client-side wrapper around the static Detail component that adds automatic\n * positioning logic based on viewport constraints.\n *\n * Features:\n * - Reuses server-side compatible static Detail component\n * - Adds automatic positioning adjustment based on viewport\n * - Calculates optimal X/Y alignment to prevent overflow\n * - Dynamically adjusts max-width based on available space\n * - Listens to window resize and scroll events\n *\n * @param props - Popover Detail component props\n * @returns Positioned popover content with animations and accessibility\n */\nconst Detail: FC<DetailProps> = ({\n xAlign = PopoverXAlign.START,\n yAlign = PopoverYAlign.BELOW,\n ...props\n}) => {\n const popoverRef = useRef<HTMLDivElement>(null);\n const [computedXAlign, setComputedXAlign] = useState(xAlign);\n const [computedYAlign, setComputedYAlign] = useState(yAlign);\n const [maxWidth, setMaxWidth] = useState<number | undefined>(undefined);\n\n useEffect(() => {\n const adjustPosition = () => {\n if (!popoverRef.current) return;\n\n const popoverElement = popoverRef.current;\n const triggerElement = document.getElementById(\n `unrollable-panel-button-${props.identifier}`\n );\n\n if (!triggerElement) return;\n\n const triggerRect = triggerElement.getBoundingClientRect();\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n const gap = 16; // 1rem gap\n const padding = 16; // Additional padding from viewport edges\n\n // Calculate maximum width based on viewport and trigger position\n const maxWidthFromLeft = viewportWidth - triggerRect.left - padding;\n const maxWidthFromRight = triggerRect.right - padding;\n\n // Use the larger space to ensure popover can fit\n const absoluteMaxWidth = Math.max(maxWidthFromLeft, maxWidthFromRight);\n\n setMaxWidth(absoluteMaxWidth);\n\n // Force a layout calculation by temporarily making visible if needed\n const wasInvisible = popoverElement.classList.contains('invisible');\n if (wasInvisible) {\n popoverElement.style.visibility = 'hidden';\n popoverElement.classList.remove('invisible');\n }\n\n // Small delay to ensure max-width is applied and content reflows\n requestAnimationFrame(() => {\n const popoverRect = popoverElement.getBoundingClientRect();\n\n // Restore invisible state if it was invisible\n if (wasInvisible) {\n popoverElement.style.visibility = '';\n popoverElement.classList.add('invisible');\n }\n\n // Determine optimal Y alignment\n let newYAlign = yAlign;\n const spaceBelow = viewportHeight - triggerRect.bottom - gap;\n const spaceAbove = triggerRect.top - gap;\n\n if (yAlign === PopoverYAlign.BELOW && spaceBelow < popoverRect.height) {\n // Not enough space below, try above\n if (spaceAbove >= popoverRect.height) {\n newYAlign = PopoverYAlign.ABOVE;\n }\n } else if (\n yAlign === PopoverYAlign.ABOVE &&\n spaceAbove < popoverRect.height\n ) {\n // Not enough space above, try below\n if (spaceBelow >= popoverRect.height) {\n newYAlign = PopoverYAlign.BELOW;\n }\n }\n\n // Determine optimal X alignment\n let newXAlign = xAlign;\n const spaceRight = viewportWidth - triggerRect.left - padding;\n const spaceLeft = triggerRect.right - padding;\n\n if (xAlign === PopoverXAlign.START && spaceRight < popoverRect.width) {\n // Not enough space on the right, try left\n if (spaceLeft >= popoverRect.width) {\n newXAlign = PopoverXAlign.END;\n }\n } else if (\n xAlign === PopoverXAlign.END &&\n spaceLeft < popoverRect.width\n ) {\n // Not enough space on the left, try right\n if (spaceRight >= popoverRect.width) {\n newXAlign = PopoverXAlign.START;\n }\n }\n\n setComputedYAlign(newYAlign);\n setComputedXAlign(newXAlign);\n });\n };\n\n // Adjust position with a slight delay to ensure DOM is ready\n const timeoutId = setTimeout(adjustPosition, 0);\n\n // Listen to mouse enter on the trigger to recalculate\n const triggerElement = document.getElementById(\n `unrollable-panel-button-${props.identifier}`\n );\n\n if (triggerElement) {\n triggerElement.addEventListener('mouseenter', adjustPosition);\n triggerElement.addEventListener('focusin', adjustPosition);\n }\n\n // Use ResizeObserver to detect popover content size changes\n const resizeObserver = new ResizeObserver(() => {\n adjustPosition();\n });\n\n if (popoverRef.current) {\n resizeObserver.observe(popoverRef.current);\n }\n\n window.addEventListener('resize', adjustPosition);\n window.addEventListener('scroll', adjustPosition, true);\n\n return () => {\n clearTimeout(timeoutId);\n if (triggerElement) {\n triggerElement.removeEventListener('mouseenter', adjustPosition);\n triggerElement.removeEventListener('focusin', adjustPosition);\n }\n resizeObserver.disconnect();\n window.removeEventListener('resize', adjustPosition);\n window.removeEventListener('scroll', adjustPosition, true);\n };\n }, [props.identifier, xAlign, yAlign]);\n\n // Use the static Detail component with computed alignment values\n return (\n <StaticDetail\n {...props}\n xAlign={computedXAlign}\n yAlign={computedYAlign}\n ref={popoverRef}\n style={{\n ...props.style,\n maxWidth: maxWidth ? `${maxWidth}px` : undefined,\n }}\n />\n );\n};\n\n// Create Popover with Detail attached\nexport const Popover: PopoverType = PopoverComponent as PopoverType;\n\nPopover.Detail = Detail;\n"],"mappings":"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"}
@@ -105,7 +105,7 @@ let PopoverYAlign = /* @__PURE__ */ function(PopoverYAlign$1) {
105
105
  * @param props - Popover component props
106
106
  * @returns Trigger container with popover functionality
107
107
  */
108
- const PopoverStatic = ({ children, className, identifier,...props }) => /* @__PURE__ */ jsx("div", {
108
+ const PopoverStatic = ({ children, className, identifier, ...props }) => /* @__PURE__ */ jsx("div", {
109
109
  className: cn("group/popover relative flex cursor-pointer", className),
110
110
  id: `unrollable-panel-button-${identifier}`,
111
111
  "aria-haspopup": true,
@@ -175,7 +175,7 @@ const PopoverStatic = ({ children, className, identifier,...props }) => /* @__PU
175
175
  * @param props - Popover Detail component props
176
176
  * @returns Positioned popover content with animations and accessibility
177
177
  */
178
- const Detail = forwardRef(({ children, isHidden = void 0, isOverable = true, isFocusable = false, xAlign = PopoverXAlign.START, yAlign = PopoverYAlign.BELOW, identifier, className, displayArrow = true,...props }, ref) => /* @__PURE__ */ jsx(Container, {
178
+ const Detail = forwardRef(({ children, isHidden = void 0, isOverable = true, isFocusable = false, xAlign = PopoverXAlign.START, yAlign = PopoverYAlign.BELOW, identifier, className, displayArrow = true, ...props }, ref) => /* @__PURE__ */ jsx(Container, {
179
179
  ref,
180
180
  transparency: "sm",
181
181
  role: "group",