@intlayer/design-system 6.1.5 → 6.1.6

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 (336) hide show
  1. package/dist/.vite/manifest.json +13 -9
  2. package/dist/Form-CriPBaZk.js.map +1 -1
  3. package/dist/Form-DJrUK3mm.cjs.map +1 -1
  4. package/dist/components/Accordion/Accordion.cjs +51 -15
  5. package/dist/components/Accordion/Accordion.cjs.map +1 -1
  6. package/dist/components/Accordion/Accordion.d.ts +44 -5
  7. package/dist/components/Accordion/Accordion.d.ts.map +1 -1
  8. package/dist/components/Accordion/Accordion.mjs +52 -16
  9. package/dist/components/Accordion/Accordion.mjs.map +1 -1
  10. package/dist/components/Avatar/index.cjs +114 -31
  11. package/dist/components/Avatar/index.cjs.map +1 -1
  12. package/dist/components/Avatar/index.d.ts +46 -2
  13. package/dist/components/Avatar/index.d.ts.map +1 -1
  14. package/dist/components/Avatar/index.mjs +115 -32
  15. package/dist/components/Avatar/index.mjs.map +1 -1
  16. package/dist/components/Badge/index.cjs +88 -9
  17. package/dist/components/Badge/index.cjs.map +1 -1
  18. package/dist/components/Badge/index.d.ts +80 -2
  19. package/dist/components/Badge/index.d.ts.map +1 -1
  20. package/dist/components/Badge/index.mjs +89 -10
  21. package/dist/components/Badge/index.mjs.map +1 -1
  22. package/dist/components/Breadcrumb/index.cjs +124 -59
  23. package/dist/components/Breadcrumb/index.cjs.map +1 -1
  24. package/dist/components/Breadcrumb/index.d.ts +89 -5
  25. package/dist/components/Breadcrumb/index.d.ts.map +1 -1
  26. package/dist/components/Breadcrumb/index.mjs +124 -59
  27. package/dist/components/Breadcrumb/index.mjs.map +1 -1
  28. package/dist/components/Button/Button.cjs +44 -25
  29. package/dist/components/Button/Button.cjs.map +1 -1
  30. package/dist/components/Button/Button.d.ts +95 -1
  31. package/dist/components/Button/Button.d.ts.map +1 -1
  32. package/dist/components/Button/Button.mjs +44 -25
  33. package/dist/components/Button/Button.mjs.map +1 -1
  34. package/dist/components/ClickOutsideDiv/index.cjs +38 -7
  35. package/dist/components/ClickOutsideDiv/index.cjs.map +1 -1
  36. package/dist/components/ClickOutsideDiv/index.d.ts +13 -0
  37. package/dist/components/ClickOutsideDiv/index.d.ts.map +1 -1
  38. package/dist/components/ClickOutsideDiv/index.mjs +39 -8
  39. package/dist/components/ClickOutsideDiv/index.mjs.map +1 -1
  40. package/dist/components/Container/index.cjs +2 -0
  41. package/dist/components/Container/index.cjs.map +1 -1
  42. package/dist/components/Container/index.d.ts +42 -0
  43. package/dist/components/Container/index.d.ts.map +1 -1
  44. package/dist/components/Container/index.mjs +2 -0
  45. package/dist/components/Container/index.mjs.map +1 -1
  46. package/dist/components/ContentEditor/ContentEditor.cjs +80 -33
  47. package/dist/components/ContentEditor/ContentEditor.cjs.map +1 -1
  48. package/dist/components/ContentEditor/ContentEditor.d.ts +29 -0
  49. package/dist/components/ContentEditor/ContentEditor.d.ts.map +1 -1
  50. package/dist/components/ContentEditor/ContentEditor.mjs +80 -33
  51. package/dist/components/ContentEditor/ContentEditor.mjs.map +1 -1
  52. package/dist/components/ContentEditor/ContentEditorInput.cjs +58 -31
  53. package/dist/components/ContentEditor/ContentEditorInput.cjs.map +1 -1
  54. package/dist/components/ContentEditor/ContentEditorInput.d.ts +33 -0
  55. package/dist/components/ContentEditor/ContentEditorInput.d.ts.map +1 -1
  56. package/dist/components/ContentEditor/ContentEditorInput.mjs +58 -31
  57. package/dist/components/ContentEditor/ContentEditorInput.mjs.map +1 -1
  58. package/dist/components/ContentEditor/ContentEditorTextArea.cjs +58 -30
  59. package/dist/components/ContentEditor/ContentEditorTextArea.cjs.map +1 -1
  60. package/dist/components/ContentEditor/ContentEditorTextArea.d.ts +35 -0
  61. package/dist/components/ContentEditor/ContentEditorTextArea.d.ts.map +1 -1
  62. package/dist/components/ContentEditor/ContentEditorTextArea.mjs +59 -31
  63. package/dist/components/ContentEditor/ContentEditorTextArea.mjs.map +1 -1
  64. package/dist/components/ContentEditor/index.cjs +4 -0
  65. package/dist/components/ContentEditor/index.cjs.map +1 -1
  66. package/dist/components/ContentEditor/index.d.ts +2 -0
  67. package/dist/components/ContentEditor/index.d.ts.map +1 -1
  68. package/dist/components/ContentEditor/index.mjs +5 -1
  69. package/dist/components/ContentEditor/index.mjs.map +1 -1
  70. package/dist/components/ContentSelector/ContentSelector.cjs +9 -1
  71. package/dist/components/ContentSelector/ContentSelector.cjs.map +1 -1
  72. package/dist/components/ContentSelector/ContentSelector.d.ts +167 -0
  73. package/dist/components/ContentSelector/ContentSelector.d.ts.map +1 -1
  74. package/dist/components/ContentSelector/ContentSelector.mjs +9 -1
  75. package/dist/components/ContentSelector/ContentSelector.mjs.map +1 -1
  76. package/dist/components/CopyButton/index.cjs +23 -8
  77. package/dist/components/CopyButton/index.cjs.map +1 -1
  78. package/dist/components/CopyButton/index.d.ts +78 -0
  79. package/dist/components/CopyButton/index.d.ts.map +1 -1
  80. package/dist/components/CopyButton/index.mjs +23 -8
  81. package/dist/components/CopyButton/index.mjs.map +1 -1
  82. package/dist/components/CopyToClipboard/index.cjs +58 -22
  83. package/dist/components/CopyToClipboard/index.cjs.map +1 -1
  84. package/dist/components/CopyToClipboard/index.d.ts +68 -2
  85. package/dist/components/CopyToClipboard/index.d.ts.map +1 -1
  86. package/dist/components/CopyToClipboard/index.mjs +59 -23
  87. package/dist/components/CopyToClipboard/index.mjs.map +1 -1
  88. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs +4 -2
  89. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
  90. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts +1 -0
  91. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts.map +1 -1
  92. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +4 -2
  93. package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
  94. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs +2 -2
  95. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.cjs.map +1 -1
  96. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +2 -2
  97. package/dist/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
  98. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +3 -0
  99. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs.map +1 -1
  100. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts +1 -0
  101. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts.map +1 -1
  102. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +3 -0
  103. package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
  104. package/dist/components/DropDown/index.cjs +6 -4
  105. package/dist/components/DropDown/index.cjs.map +1 -1
  106. package/dist/components/DropDown/index.d.ts +92 -15
  107. package/dist/components/DropDown/index.d.ts.map +1 -1
  108. package/dist/components/DropDown/index.mjs +6 -4
  109. package/dist/components/DropDown/index.mjs.map +1 -1
  110. package/dist/components/EditableField/EditableFieldInput.cjs.map +1 -1
  111. package/dist/components/EditableField/EditableFieldInput.d.ts +38 -0
  112. package/dist/components/EditableField/EditableFieldInput.d.ts.map +1 -1
  113. package/dist/components/EditableField/EditableFieldInput.mjs.map +1 -1
  114. package/dist/components/EditableField/EditableFieldLayout.cjs +10 -2
  115. package/dist/components/EditableField/EditableFieldLayout.cjs.map +1 -1
  116. package/dist/components/EditableField/EditableFieldLayout.d.ts.map +1 -1
  117. package/dist/components/EditableField/EditableFieldLayout.mjs +10 -2
  118. package/dist/components/EditableField/EditableFieldLayout.mjs.map +1 -1
  119. package/dist/components/EditableField/EditableFieldTextArea.cjs.map +1 -1
  120. package/dist/components/EditableField/EditableFieldTextArea.d.ts +42 -0
  121. package/dist/components/EditableField/EditableFieldTextArea.d.ts.map +1 -1
  122. package/dist/components/EditableField/EditableFieldTextArea.mjs.map +1 -1
  123. package/dist/components/ExpandCollapse/ExpandCollapse.cjs.map +1 -1
  124. package/dist/components/ExpandCollapse/ExpandCollapse.d.ts +58 -0
  125. package/dist/components/ExpandCollapse/ExpandCollapse.d.ts.map +1 -1
  126. package/dist/components/ExpandCollapse/ExpandCollapse.mjs.map +1 -1
  127. package/dist/components/Footer/index.cjs.map +1 -1
  128. package/dist/components/Footer/index.d.ts +101 -0
  129. package/dist/components/Footer/index.d.ts.map +1 -1
  130. package/dist/components/Footer/index.mjs.map +1 -1
  131. package/dist/components/Form/elements/MultiselectElement.d.ts.map +1 -1
  132. package/dist/components/Form/elements/SelectElement.d.ts.map +1 -1
  133. package/dist/components/Form/elements/SwitchSelectorElement.d.ts.map +1 -1
  134. package/dist/components/Headers/index.cjs.map +1 -1
  135. package/dist/components/Headers/index.d.ts +69 -2
  136. package/dist/components/Headers/index.d.ts.map +1 -1
  137. package/dist/components/Headers/index.mjs.map +1 -1
  138. package/dist/components/HeightResizer/index.cjs +10 -7
  139. package/dist/components/HeightResizer/index.cjs.map +1 -1
  140. package/dist/components/HeightResizer/index.d.ts +89 -0
  141. package/dist/components/HeightResizer/index.d.ts.map +1 -1
  142. package/dist/components/HeightResizer/index.mjs +10 -7
  143. package/dist/components/HeightResizer/index.mjs.map +1 -1
  144. package/dist/components/InformationTag/index.cjs.map +1 -1
  145. package/dist/components/InformationTag/index.d.ts +72 -0
  146. package/dist/components/InformationTag/index.d.ts.map +1 -1
  147. package/dist/components/InformationTag/index.mjs.map +1 -1
  148. package/dist/components/KeyboardScreenAdapter/index.cjs.map +1 -1
  149. package/dist/components/KeyboardScreenAdapter/index.d.ts +100 -0
  150. package/dist/components/KeyboardScreenAdapter/index.d.ts.map +1 -1
  151. package/dist/components/KeyboardScreenAdapter/index.mjs.map +1 -1
  152. package/dist/components/Label/index.cjs +25 -3
  153. package/dist/components/Label/index.cjs.map +1 -1
  154. package/dist/components/Label/index.d.ts +65 -1
  155. package/dist/components/Label/index.d.ts.map +1 -1
  156. package/dist/components/Label/index.mjs +26 -4
  157. package/dist/components/Label/index.mjs.map +1 -1
  158. package/dist/components/Link/Link.cjs +0 -4
  159. package/dist/components/Link/Link.cjs.map +1 -1
  160. package/dist/components/Link/Link.d.ts +169 -0
  161. package/dist/components/Link/Link.d.ts.map +1 -1
  162. package/dist/components/Link/Link.mjs +0 -4
  163. package/dist/components/Link/Link.mjs.map +1 -1
  164. package/dist/components/Loader/index.cjs.map +1 -1
  165. package/dist/components/Loader/index.d.ts +82 -11
  166. package/dist/components/Loader/index.d.ts.map +1 -1
  167. package/dist/components/Loader/index.mjs.map +1 -1
  168. package/dist/components/Loader/spinner.cjs.map +1 -1
  169. package/dist/components/Loader/spinner.d.ts +56 -0
  170. package/dist/components/Loader/spinner.d.ts.map +1 -1
  171. package/dist/components/Loader/spinner.mjs.map +1 -1
  172. package/dist/components/MarkDownRender/MarkDownRender.cjs +0 -1
  173. package/dist/components/MarkDownRender/MarkDownRender.cjs.map +1 -1
  174. package/dist/components/MarkDownRender/MarkDownRender.d.ts +147 -0
  175. package/dist/components/MarkDownRender/MarkDownRender.d.ts.map +1 -1
  176. package/dist/components/MarkDownRender/MarkDownRender.mjs +0 -1
  177. package/dist/components/MarkDownRender/MarkDownRender.mjs.map +1 -1
  178. package/dist/components/MarkDownRender/processor.cjs +12 -9
  179. package/dist/components/MarkDownRender/processor.cjs.map +1 -1
  180. package/dist/components/MarkDownRender/processor.d.ts.map +1 -1
  181. package/dist/components/MarkDownRender/processor.mjs +12 -9
  182. package/dist/components/MarkDownRender/processor.mjs.map +1 -1
  183. package/dist/components/MaxHeightSmoother/index.cjs.map +1 -1
  184. package/dist/components/MaxHeightSmoother/index.d.ts +152 -0
  185. package/dist/components/MaxHeightSmoother/index.d.ts.map +1 -1
  186. package/dist/components/MaxHeightSmoother/index.mjs.map +1 -1
  187. package/dist/components/Modal/Modal.cjs +5 -0
  188. package/dist/components/Modal/Modal.cjs.map +1 -1
  189. package/dist/components/Modal/Modal.d.ts +81 -3
  190. package/dist/components/Modal/Modal.d.ts.map +1 -1
  191. package/dist/components/Modal/Modal.mjs +5 -0
  192. package/dist/components/Modal/Modal.mjs.map +1 -1
  193. package/dist/components/Navbar/Burger.cjs.map +1 -1
  194. package/dist/components/Navbar/Burger.d.ts +54 -0
  195. package/dist/components/Navbar/Burger.d.ts.map +1 -1
  196. package/dist/components/Navbar/Burger.mjs.map +1 -1
  197. package/dist/components/Navbar/DesktopNavbar.cjs.map +1 -1
  198. package/dist/components/Navbar/DesktopNavbar.d.ts +78 -0
  199. package/dist/components/Navbar/DesktopNavbar.d.ts.map +1 -1
  200. package/dist/components/Navbar/DesktopNavbar.mjs.map +1 -1
  201. package/dist/components/Navbar/MobileNavbar.cjs.map +1 -1
  202. package/dist/components/Navbar/MobileNavbar.d.ts +88 -0
  203. package/dist/components/Navbar/MobileNavbar.d.ts.map +1 -1
  204. package/dist/components/Navbar/MobileNavbar.mjs.map +1 -1
  205. package/dist/components/Navbar/index.cjs.map +1 -1
  206. package/dist/components/Navbar/index.d.ts +69 -0
  207. package/dist/components/Navbar/index.d.ts.map +1 -1
  208. package/dist/components/Navbar/index.mjs.map +1 -1
  209. package/dist/components/Navbar/useNavigation.cjs +8 -1
  210. package/dist/components/Navbar/useNavigation.cjs.map +1 -1
  211. package/dist/components/Navbar/useNavigation.d.ts +83 -0
  212. package/dist/components/Navbar/useNavigation.d.ts.map +1 -1
  213. package/dist/components/Navbar/useNavigation.mjs +8 -1
  214. package/dist/components/Navbar/useNavigation.mjs.map +1 -1
  215. package/dist/components/Pattern/DotPattern.cjs.map +1 -1
  216. package/dist/components/Pattern/DotPattern.d.ts +101 -0
  217. package/dist/components/Pattern/DotPattern.d.ts.map +1 -1
  218. package/dist/components/Pattern/DotPattern.mjs.map +1 -1
  219. package/dist/components/Pattern/GridPattern.cjs.map +1 -1
  220. package/dist/components/Pattern/GridPattern.d.ts +114 -0
  221. package/dist/components/Pattern/GridPattern.d.ts.map +1 -1
  222. package/dist/components/Pattern/GridPattern.mjs.map +1 -1
  223. package/dist/components/Pattern/SpotLight.cjs.map +1 -1
  224. package/dist/components/Pattern/SpotLight.d.ts +125 -0
  225. package/dist/components/Pattern/SpotLight.d.ts.map +1 -1
  226. package/dist/components/Pattern/SpotLight.mjs.map +1 -1
  227. package/dist/components/Popover/index.cjs +10 -10
  228. package/dist/components/Popover/index.cjs.map +1 -1
  229. package/dist/components/Popover/index.d.ts +110 -15
  230. package/dist/components/Popover/index.d.ts.map +1 -1
  231. package/dist/components/Popover/index.mjs +10 -10
  232. package/dist/components/Popover/index.mjs.map +1 -1
  233. package/dist/components/PressableSpan/PressableSpan.cjs +22 -5
  234. package/dist/components/PressableSpan/PressableSpan.cjs.map +1 -1
  235. package/dist/components/PressableSpan/PressableSpan.d.ts +105 -3
  236. package/dist/components/PressableSpan/PressableSpan.d.ts.map +1 -1
  237. package/dist/components/PressableSpan/PressableSpan.mjs +22 -5
  238. package/dist/components/PressableSpan/PressableSpan.mjs.map +1 -1
  239. package/dist/components/RightDrawer/RightDrawer.cjs.map +1 -1
  240. package/dist/components/RightDrawer/RightDrawer.d.ts +182 -0
  241. package/dist/components/RightDrawer/RightDrawer.d.ts.map +1 -1
  242. package/dist/components/RightDrawer/RightDrawer.mjs.map +1 -1
  243. package/dist/components/RightDrawer/isElementAtTopAndNotCovered.cjs.map +1 -1
  244. package/dist/components/RightDrawer/isElementAtTopAndNotCovered.d.ts +44 -0
  245. package/dist/components/RightDrawer/isElementAtTopAndNotCovered.d.ts.map +1 -1
  246. package/dist/components/RightDrawer/isElementAtTopAndNotCovered.mjs.map +1 -1
  247. package/dist/components/RightDrawer/useRightDrawerStore.cjs.map +1 -1
  248. package/dist/components/RightDrawer/useRightDrawerStore.d.ts +102 -0
  249. package/dist/components/RightDrawer/useRightDrawerStore.d.ts.map +1 -1
  250. package/dist/components/RightDrawer/useRightDrawerStore.mjs.map +1 -1
  251. package/dist/components/Select/Multiselect.cjs.map +1 -1
  252. package/dist/components/Select/Multiselect.d.ts +125 -18
  253. package/dist/components/Select/Multiselect.d.ts.map +1 -1
  254. package/dist/components/Select/Multiselect.mjs.map +1 -1
  255. package/dist/components/Select/Select.cjs.map +1 -1
  256. package/dist/components/Select/Select.d.ts +214 -7
  257. package/dist/components/Select/Select.d.ts.map +1 -1
  258. package/dist/components/Select/Select.mjs.map +1 -1
  259. package/dist/components/SwitchSelector/index.cjs.map +1 -1
  260. package/dist/components/SwitchSelector/index.d.ts +157 -8
  261. package/dist/components/SwitchSelector/index.d.ts.map +1 -1
  262. package/dist/components/SwitchSelector/index.mjs.map +1 -1
  263. package/dist/components/Table/Table.cjs.map +1 -1
  264. package/dist/components/Table/Table.d.ts +184 -0
  265. package/dist/components/Table/Table.d.ts.map +1 -1
  266. package/dist/components/Table/Table.mjs.map +1 -1
  267. package/dist/components/Tag/index.cjs.map +1 -1
  268. package/dist/components/Tag/index.d.ts +223 -0
  269. package/dist/components/Tag/index.d.ts.map +1 -1
  270. package/dist/components/Tag/index.mjs.map +1 -1
  271. package/dist/components/TextArea/AutoSizeTextArea.cjs.map +1 -1
  272. package/dist/components/TextArea/AutoSizeTextArea.d.ts +91 -0
  273. package/dist/components/TextArea/AutoSizeTextArea.d.ts.map +1 -1
  274. package/dist/components/TextArea/AutoSizeTextArea.mjs.map +1 -1
  275. package/dist/components/TextArea/AutocompleteTextArea.cjs.map +1 -1
  276. package/dist/components/TextArea/AutocompleteTextArea.d.ts +145 -0
  277. package/dist/components/TextArea/AutocompleteTextArea.d.ts.map +1 -1
  278. package/dist/components/TextArea/AutocompleteTextArea.mjs.map +1 -1
  279. package/dist/components/TextArea/TextArea.cjs.map +1 -1
  280. package/dist/components/TextArea/TextArea.d.ts +74 -0
  281. package/dist/components/TextArea/TextArea.d.ts.map +1 -1
  282. package/dist/components/TextArea/TextArea.mjs.map +1 -1
  283. package/dist/components/Toaster/Toast.cjs +4 -0
  284. package/dist/components/Toaster/Toast.cjs.map +1 -1
  285. package/dist/components/Toaster/Toast.d.ts +148 -2
  286. package/dist/components/Toaster/Toast.d.ts.map +1 -1
  287. package/dist/components/Toaster/Toast.mjs +4 -0
  288. package/dist/components/Toaster/Toast.mjs.map +1 -1
  289. package/dist/components/Toaster/Toaster.cjs.map +1 -1
  290. package/dist/components/Toaster/Toaster.d.ts +42 -0
  291. package/dist/components/Toaster/Toaster.d.ts.map +1 -1
  292. package/dist/components/Toaster/Toaster.mjs.map +1 -1
  293. package/dist/components/Toaster/useToast.cjs.map +1 -1
  294. package/dist/components/Toaster/useToast.d.ts +199 -2
  295. package/dist/components/Toaster/useToast.d.ts.map +1 -1
  296. package/dist/components/Toaster/useToast.mjs.map +1 -1
  297. package/dist/components/WithResizer/index.cjs.map +1 -1
  298. package/dist/components/WithResizer/index.d.ts +143 -0
  299. package/dist/components/WithResizer/index.d.ts.map +1 -1
  300. package/dist/components/WithResizer/index.mjs.map +1 -1
  301. package/dist/components/index.cjs +2 -2
  302. package/dist/components/index.d.ts +0 -1
  303. package/dist/components/index.d.ts.map +1 -1
  304. package/dist/components/index.mjs +4 -4
  305. package/dist/components/index.mjs.map +1 -1
  306. package/dist/hooks/auth.cjs +2 -2
  307. package/dist/hooks/auth.cjs.map +1 -1
  308. package/dist/hooks/auth.mjs +2 -2
  309. package/dist/hooks/auth.mjs.map +1 -1
  310. package/dist/hooks/reactQuery.cjs +2 -1
  311. package/dist/hooks/reactQuery.cjs.map +1 -1
  312. package/dist/hooks/reactQuery.d.ts +1 -1
  313. package/dist/hooks/reactQuery.d.ts.map +1 -1
  314. package/dist/hooks/reactQuery.mjs +2 -1
  315. package/dist/hooks/reactQuery.mjs.map +1 -1
  316. package/dist/hooks/useAuth/useOAuth2.cjs +3 -3
  317. package/dist/hooks/useAuth/useOAuth2.cjs.map +1 -1
  318. package/dist/hooks/useAuth/useOAuth2.mjs +3 -3
  319. package/dist/hooks/useAuth/useOAuth2.mjs.map +1 -1
  320. package/dist/hooks/useAuth/useSession.cjs +3 -3
  321. package/dist/hooks/useAuth/useSession.cjs.map +1 -1
  322. package/dist/hooks/useAuth/useSession.mjs +3 -3
  323. package/dist/hooks/useAuth/useSession.mjs.map +1 -1
  324. package/dist/utils/image.cjs +30 -0
  325. package/dist/utils/image.cjs.map +1 -0
  326. package/dist/utils/image.d.ts +37 -0
  327. package/dist/utils/image.d.ts.map +1 -0
  328. package/dist/utils/image.mjs +30 -0
  329. package/dist/utils/image.mjs.map +1 -0
  330. package/package.json +20 -18
  331. package/dist/utils/capitalize.cjs +0 -10
  332. package/dist/utils/capitalize.cjs.map +0 -1
  333. package/dist/utils/capitalize.d.ts +0 -2
  334. package/dist/utils/capitalize.d.ts.map +0 -1
  335. package/dist/utils/capitalize.mjs +0 -10
  336. package/dist/utils/capitalize.mjs.map +0 -1
@@ -1,18 +1,102 @@
1
- import { Locales } from '@intlayer/config/client';
2
- import { FC, HTMLAttributes } from 'react';
1
+ import { LocalesValues } from '@intlayer/config/client';
2
+ import { VariantProps } from 'class-variance-authority';
3
+ import { FC, HTMLAttributes, ReactNode } from 'react';
3
4
  import { LinkColor } from '../Link';
5
+ /**
6
+ * Breadcrumb variant styles using class-variance-authority
7
+ */
8
+ declare const breadcrumbVariants: (props?: ({
9
+ size?: "small" | "medium" | "large" | null | undefined;
10
+ spacing?: "compact" | "normal" | "loose" | null | undefined;
11
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
12
+ /**
13
+ * Detailed breadcrumb link configuration with optional href or onClick
14
+ */
4
15
  type DetailedBreadcrumbLink = {
16
+ /**
17
+ * URL to navigate to when the breadcrumb item is clicked
18
+ */
5
19
  href?: string;
20
+ /**
21
+ * Text content to display for this breadcrumb item
22
+ */
6
23
  text: string;
24
+ /**
25
+ * Custom click handler function for interactive breadcrumb items
26
+ */
7
27
  onClick?: () => void;
8
28
  };
29
+ /**
30
+ * Union type representing different breadcrumb item configurations:
31
+ * - string: Simple text breadcrumb item
32
+ * - DetailedBreadcrumbLink: Object with href, text, and/or onClick properties
33
+ */
9
34
  export type BreadcrumbLink = string | DetailedBreadcrumbLink;
10
35
  export type BreadcrumbProps = {
36
+ /**
37
+ * Array of breadcrumb items
38
+ */
11
39
  links: BreadcrumbLink[];
12
- color?: `${LinkColor}` | LinkColor;
13
- locale?: Locales;
40
+ /**
41
+ * Color scheme for breadcrumb links
42
+ * @default LinkColor.TEXT
43
+ */
44
+ color?: LinkColor | `${LinkColor}`;
45
+ /**
46
+ * Locale for internationalization
47
+ */
48
+ locale?: LocalesValues;
49
+ /**
50
+ * Element type for ARIA current attribute
51
+ * @default 'page'
52
+ */
14
53
  elementType?: 'page' | 'location';
15
- } & HTMLAttributes<HTMLOListElement>;
54
+ /**
55
+ * Custom separator between breadcrumb items
56
+ * @default ChevronRightIcon
57
+ */
58
+ separator?: ReactNode;
59
+ /**
60
+ * ARIA label for breadcrumb navigation
61
+ * @default 'breadcrumb'
62
+ */
63
+ ariaLabel?: string;
64
+ /**
65
+ * Whether to include structured data markup
66
+ * @default true
67
+ */
68
+ includeStructuredData?: boolean;
69
+ /**
70
+ * Maximum number of breadcrumb items to show before truncation
71
+ */
72
+ maxItems?: number;
73
+ } & VariantProps<typeof breadcrumbVariants> & HTMLAttributes<HTMLOListElement>;
74
+ /**
75
+ * Breadcrumb component providing navigational context with accessibility features
76
+ *
77
+ * Features:
78
+ * - Supports links, buttons, and static text elements
79
+ * - Full keyboard navigation support
80
+ * - ARIA attributes for screen readers
81
+ * - Schema.org structured data for SEO
82
+ * - Customizable separators and styling
83
+ * - Internationalization support
84
+ * - Responsive design variants
85
+ *
86
+ * @example
87
+ * ```tsx
88
+ * <Breadcrumb
89
+ * links={[
90
+ * 'Home',
91
+ * { href: '/products', text: 'Products' },
92
+ * { onClick: handleCategory, text: 'Electronics' },
93
+ * 'Smartphones'
94
+ * ]}
95
+ * size="medium"
96
+ * ariaLabel="Product navigation"
97
+ * />
98
+ * ```
99
+ */
16
100
  export declare const Breadcrumb: FC<BreadcrumbProps>;
17
101
  export {};
18
102
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Breadcrumb/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAY,KAAK,EAAE,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAI/D,OAAO,EAAQ,SAAS,EAAkB,MAAM,SAAS,CAAC;AAsF1D,KAAK,sBAAsB,GAAG;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AACF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,sBAAsB,CAAC;AAE7D,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,GAAG,SAAS,EAAE,GAAG,SAAS,CAAC;IACnC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;CACnC,GAAG,cAAc,CAAC,gBAAgB,CAAC,CAAC;AAErC,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAsF1C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Breadcrumb/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAW,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAY,KAAK,EAAE,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAI/E,OAAO,EAAQ,SAAS,EAAE,MAAM,SAAS,CAAC;AAuC1C;;GAEG;AACH,QAAA,MAAM,kBAAkB;;;8EAiBtB,CAAC;AAsHH;;GAEG;AACH,KAAK,sBAAsB,GAAG;IAC5B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,sBAAsB,CAAC;AAE7D,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,GAAG,GAAG,SAAS,EAAE,CAAC;IACnC;;OAEG;IACH,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAClC;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,YAAY,CAAC,OAAO,kBAAkB,CAAC,GACzC,cAAc,CAAC,gBAAgB,CAAC,CAAC;AAEnC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAiI1C,CAAC"}
@@ -1,11 +1,30 @@
1
1
  "use client";
2
2
  import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
3
+ import { Fragment, createElement } from "react";
4
+ import { cva } from "class-variance-authority";
3
5
  import { ChevronRightIcon } from "lucide-react";
4
- import { Fragment } from "react";
5
6
  import { useIntlayer } from "react-intlayer";
6
7
  import { cn } from "../../utils/cn.mjs";
7
8
  import { Button, ButtonVariant } from "../Button/Button.mjs";
8
9
  import { LinkColor, Link } from "../Link/Link.mjs";
10
+ const breadcrumbVariants = cva("flex flex-row flex-wrap items-center text-sm", {
11
+ variants: {
12
+ size: {
13
+ small: "gap-1 text-xs",
14
+ medium: "gap-2 text-sm",
15
+ large: "gap-3 text-base"
16
+ },
17
+ spacing: {
18
+ compact: "gap-1",
19
+ normal: "gap-2",
20
+ loose: "gap-4"
21
+ }
22
+ },
23
+ defaultVariants: {
24
+ size: "medium",
25
+ spacing: "normal"
26
+ }
27
+ });
9
28
  const LinkLink = ({
10
29
  href,
11
30
  lang,
@@ -14,6 +33,7 @@ const LinkLink = ({
14
33
  color,
15
34
  position,
16
35
  locale,
36
+ className,
17
37
  ...props
18
38
  }) => {
19
39
  const { linkLabel } = useIntlayer("breadcrumb");
@@ -43,6 +63,7 @@ const ButtonLink = ({
43
63
  onClick,
44
64
  color,
45
65
  position,
66
+ className,
46
67
  ...props
47
68
  }) => {
48
69
  const { linkLabel } = useIntlayer("breadcrumb");
@@ -62,81 +83,125 @@ const ButtonLink = ({
62
83
  /* @__PURE__ */ jsx("meta", { itemProp: "position", content: position.toString() })
63
84
  ] });
64
85
  };
65
- const Span = ({ children, position, ...props }) => /* @__PURE__ */ jsxs("span", { itemProp: "item", children: [
66
- /* @__PURE__ */ jsx("span", { itemProp: "name", ...props, children }),
67
- /* @__PURE__ */ jsx("meta", { itemProp: "position", content: position.toString() })
68
- ] });
86
+ const Span = ({ children, position, className, ...props }) => /* @__PURE__ */ jsxs(
87
+ "span",
88
+ {
89
+ itemProp: "item",
90
+ className: cn(
91
+ "inline-flex items-center",
92
+ "text-neutral-700 font-medium",
93
+ "transition-colors duration-200",
94
+ className
95
+ ),
96
+ children: [
97
+ /* @__PURE__ */ jsx("span", { itemProp: "name", ...props, children }),
98
+ /* @__PURE__ */ jsx("meta", { itemProp: "position", content: position.toString() })
99
+ ]
100
+ }
101
+ );
69
102
  const Breadcrumb = ({
70
103
  links,
71
104
  className,
72
105
  color = LinkColor.TEXT,
73
106
  locale,
74
107
  elementType = "page",
108
+ separator = /* @__PURE__ */ jsx(ChevronRightIcon, { size: 10 }),
109
+ ariaLabel = "breadcrumb",
110
+ includeStructuredData = true,
111
+ maxItems,
112
+ size,
113
+ spacing,
75
114
  ...props
76
- }) => /* @__PURE__ */ jsx("nav", { "aria-label": "breadcrumb", children: /* @__PURE__ */ jsx(
77
- "ol",
78
- {
79
- className: cn(
80
- "flex flex-row flex-wrap items-center gap-2 text-sm",
81
- className
82
- ),
83
- itemScope: true,
84
- itemType: "http://schema.org/BreadcrumbList",
85
- ...props,
86
- children: links.map((link, index) => {
87
- const isLastLink = index === links.length - 1;
88
- const isLink = typeof link === "object" && typeof link.href === "string";
89
- const isButton = typeof link === "object" && typeof link.onClick === "function";
90
- const isActive = index === links.length - 1;
91
- const ariaCurrent = isActive ? elementType : void 0;
92
- const text = link.text ?? link;
93
- let section = /* @__PURE__ */ jsx(Span, { position: index + 1, "aria-current": ariaCurrent, children: text }, text);
94
- if (isLink) {
95
- section = /* @__PURE__ */ jsx(
96
- LinkLink,
115
+ }) => {
116
+ const displayLinks = maxItems && links.length > maxItems ? [...links.slice(0, 1), "...", ...links.slice(-(maxItems - 2))] : links;
117
+ return /* @__PURE__ */ jsx("nav", { "aria-label": ariaLabel, role: "navigation", children: /* @__PURE__ */ jsx(
118
+ "ol",
119
+ {
120
+ className: cn(breadcrumbVariants({ size, spacing }), className),
121
+ ...includeStructuredData && {
122
+ itemScope: true,
123
+ itemType: "http://schema.org/BreadcrumbList"
124
+ },
125
+ ...props,
126
+ children: displayLinks.map((link, index) => {
127
+ const isLastLink = index === displayLinks.length - 1;
128
+ const isLink = typeof link === "object" && typeof link.href === "string";
129
+ const isButton = typeof link === "object" && typeof link.onClick === "function";
130
+ const isActive = index === displayLinks.length - 1;
131
+ const ariaCurrent = isActive ? elementType : void 0;
132
+ const isTruncated = link === "...";
133
+ const text = link.text ?? link;
134
+ if (isTruncated) {
135
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
136
+ /* @__PURE__ */ jsx("li", { className: "flex items-center", "aria-hidden": "true", children: /* @__PURE__ */ jsx("span", { className: "text-neutral-500", children: "…" }) }),
137
+ !isLastLink && /* @__PURE__ */ jsx("li", { "aria-hidden": "true", className: "flex items-center", children: separator })
138
+ ] }, `truncated-${index}`);
139
+ }
140
+ let section = /* @__PURE__ */ jsx(
141
+ Span,
97
142
  {
98
- href: link.href,
99
- color,
100
143
  position: index + 1,
101
- locale,
102
144
  "aria-current": ariaCurrent,
145
+ className: cn(
146
+ "transition-colors duration-200",
147
+ isActive && "text-neutral-900"
148
+ ),
103
149
  children: text
104
150
  },
105
151
  text
106
152
  );
107
- } else if (isButton) {
108
- section = /* @__PURE__ */ jsx(
109
- ButtonLink,
153
+ if (isLink) {
154
+ section = /* @__PURE__ */ jsx(
155
+ LinkLink,
156
+ {
157
+ href: link.href,
158
+ color,
159
+ position: index + 1,
160
+ locale,
161
+ "aria-current": ariaCurrent,
162
+ className: cn(isActive && "text-neutral-900 cursor-default"),
163
+ children: text
164
+ },
165
+ text
166
+ );
167
+ } else if (isButton) {
168
+ section = /* @__PURE__ */ jsx(
169
+ ButtonLink,
170
+ {
171
+ onClick: link.onClick,
172
+ color,
173
+ position: index + 1,
174
+ "aria-current": ariaCurrent,
175
+ className: cn(isActive && "text-neutral-900 cursor-default"),
176
+ children: text
177
+ },
178
+ text
179
+ );
180
+ }
181
+ const listElement = /* @__PURE__ */ createElement(
182
+ "li",
110
183
  {
111
- onClick: link.onClick,
112
- color,
113
- position: index + 1,
114
- "aria-current": ariaCurrent,
115
- children: text
184
+ ...includeStructuredData && {
185
+ itemProp: "itemListElement",
186
+ itemScope: true,
187
+ itemType: "https://schema.org/ListItem"
188
+ },
189
+ key: text,
190
+ className: "flex items-center"
116
191
  },
117
- text
192
+ section
118
193
  );
119
- }
120
- const listElement = /* @__PURE__ */ jsx(
121
- "li",
122
- {
123
- itemProp: "itemListElement",
124
- itemScope: true,
125
- itemType: "https://schema.org/ListItem",
126
- children: section
127
- },
128
- text
129
- );
130
- if (isLastLink) {
131
- return listElement;
132
- }
133
- return /* @__PURE__ */ jsxs(Fragment, { children: [
134
- listElement,
135
- /* @__PURE__ */ jsx(ChevronRightIcon, { size: 10 })
136
- ] }, text);
137
- })
138
- }
139
- ) });
194
+ if (isLastLink) {
195
+ return listElement;
196
+ }
197
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
198
+ listElement,
199
+ /* @__PURE__ */ jsx("li", { "aria-hidden": "true", className: "flex items-center", children: separator })
200
+ ] }, text);
201
+ })
202
+ }
203
+ ) });
204
+ };
140
205
  export {
141
206
  Breadcrumb
142
207
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../src/components/Breadcrumb/index.tsx"],"sourcesContent":["'use client';\n\nimport type { Locales } from '@intlayer/config/client';\nimport { ChevronRightIcon } from 'lucide-react';\nimport { Fragment, type FC, type HTMLAttributes } from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport { cn } from '../../utils/cn';\nimport { Button, ButtonVariant, type ButtonProps } from '../Button';\nimport { Link, LinkColor, type LinkProps } from '../Link';\n\ntype LinkLinkProps = {\n position: number;\n locale?: Locales;\n} & Omit<LinkProps, 'label'>;\n\nconst LinkLink: FC<LinkLinkProps> = ({\n href,\n lang,\n children,\n onClick,\n color,\n position,\n locale,\n ...props\n}) => {\n const { linkLabel } = useIntlayer('breadcrumb');\n\n return (\n <>\n <Link\n href={href}\n locale={locale}\n color={color}\n onClick={onClick}\n itemProp=\"item\"\n isExternalLink={false}\n itemScope\n itemType=\"https://schema.org/WebPage\"\n {...props}\n label={`${linkLabel} ${children}`}\n itemID={href}\n >\n <span itemProp=\"name\">{children}</span>\n </Link>\n <meta itemProp=\"position\" content={position.toString()} />\n </>\n );\n};\n\ntype ButtonButtonProps = {\n children: string;\n position: number;\n} & Omit<ButtonProps, 'children' | 'label'>;\n\nconst ButtonLink: FC<ButtonButtonProps> = ({\n children: text,\n onClick,\n color,\n position,\n ...props\n}) => {\n const { linkLabel } = useIntlayer('breadcrumb');\n\n return (\n <>\n <Button\n onClick={onClick}\n variant={ButtonVariant.LINK}\n label={`${linkLabel} ${text}`}\n color={color}\n itemProp=\"item\"\n {...props}\n >\n <span itemProp=\"name\">{text}</span>\n </Button>\n <meta itemProp=\"position\" content={position.toString()} />\n </>\n );\n};\n\ntype SpanProps = {\n children: string;\n position: number;\n} & HTMLAttributes<HTMLSpanElement>;\n\nconst Span: FC<SpanProps> = ({ children, position, ...props }) => (\n <span itemProp=\"item\">\n <span itemProp=\"name\" {...props}>\n {children}\n </span>\n <meta itemProp=\"position\" content={position.toString()} />\n </span>\n);\n\ntype DetailedBreadcrumbLink = {\n href?: string;\n text: string;\n onClick?: () => void;\n};\nexport type BreadcrumbLink = string | DetailedBreadcrumbLink;\n\nexport type BreadcrumbProps = {\n links: BreadcrumbLink[];\n color?: `${LinkColor}` | LinkColor;\n locale?: Locales;\n elementType?: 'page' | 'location';\n} & HTMLAttributes<HTMLOListElement>;\n\nexport const Breadcrumb: FC<BreadcrumbProps> = ({\n links,\n className,\n color = LinkColor.TEXT,\n locale,\n elementType = 'page',\n ...props\n}) => (\n <nav aria-label=\"breadcrumb\">\n <ol\n className={cn(\n 'flex flex-row flex-wrap items-center gap-2 text-sm',\n className\n )}\n itemScope\n itemType=\"http://schema.org/BreadcrumbList\"\n {...props}\n >\n {links.map((link, index) => {\n const isLastLink = index === links.length - 1;\n const isLink =\n typeof link === 'object' && typeof link.href === 'string';\n const isButton =\n typeof link === 'object' && typeof link.onClick === 'function';\n const isActive = index === links.length - 1;\n const ariaCurrent = isActive ? elementType : undefined;\n\n const text = (link as DetailedBreadcrumbLink).text ?? link;\n\n let section = (\n <Span key={text} position={index + 1} aria-current={ariaCurrent}>\n {text}\n </Span>\n );\n\n if (isLink) {\n section = (\n <LinkLink\n key={text}\n href={link.href!}\n color={color}\n position={index + 1}\n locale={locale}\n aria-current={ariaCurrent}\n >\n {text}\n </LinkLink>\n );\n } else if (isButton) {\n section = (\n <ButtonLink\n key={text}\n onClick={link.onClick!}\n color={color}\n position={index + 1}\n aria-current={ariaCurrent}\n >\n {text}\n </ButtonLink>\n );\n }\n\n const listElement = (\n <li\n itemProp=\"itemListElement\"\n itemScope\n itemType=\"https://schema.org/ListItem\"\n key={text}\n >\n {section}\n </li>\n );\n\n if (isLastLink) {\n return listElement;\n }\n\n return (\n <Fragment key={text}>\n {listElement}\n <ChevronRightIcon size={10} />\n </Fragment>\n );\n })}\n </ol>\n </nav>\n);\n"],"names":["Fragment"],"mappings":";;;;;;;;AAeA,MAAM,WAA8B,CAAC;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,EAAE,UAAA,IAAc,YAAY,YAAY;AAE9C,SACE,qBAAAA,YAAA,EACE,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,UAAS;AAAA,QACT,gBAAgB;AAAA,QAChB,WAAS;AAAA,QACT,UAAS;AAAA,QACR,GAAG;AAAA,QACJ,OAAO,GAAG,SAAS,IAAI,QAAQ;AAAA,QAC/B,QAAQ;AAAA,QAER,UAAA,oBAAC,QAAA,EAAK,UAAS,QAAQ,SAAA,CAAS;AAAA,MAAA;AAAA,IAAA;AAAA,wBAEjC,QAAA,EAAK,UAAS,YAAW,SAAS,SAAS,WAAS,CAAG;AAAA,EAAA,GAC1D;AAEJ;AAOA,MAAM,aAAoC,CAAC;AAAA,EACzC,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,EAAE,UAAA,IAAc,YAAY,YAAY;AAE9C,SACE,qBAAAA,YAAA,EACE,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,SAAS,cAAc;AAAA,QACvB,OAAO,GAAG,SAAS,IAAI,IAAI;AAAA,QAC3B;AAAA,QACA,UAAS;A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B;AAAA,YACA,gBAAc;AAAA,YAEb,UAAA;AAAA,UAAA;AAAA,UAPI;AAAA,QAAA;AAAA,MAUX,WAAW,UAAU;AACnB,kBACE;AAAA,UAAC;AAAA,UAAA;AAAA,YAEC,SAAS,KAAK;AAAA,YACd;AAAA,YACA,UAAU,QAAQ;AAAA,YAClB,gBAAc;AAAA,YAEb,UAAA;AAAA,UAAA;AAAA,UANI;AAAA,QAAA;AAAA,MASX;AAEA,YAAM,cACJ;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,UAAS;AAAA,UACT,WAAS;AAAA,UACT,UAAS;AAAA,UAGR,UAAA;AAAA,QAAA;AAAA,QAFI;AAAA,MAAA;AAMT,UAAI,YAAY;AACd,eAAO;AAAA,MACT;AAEA,aACE,qBAACA,UAAA,EACE,UAAA;AAAA,QAAA;AAAA,QACD,oBAAC,kBAAA,EAAiB,MAAM,GAAA,CAAI;AAAA,MAAA,EAAA,GAFf,IAGf;AAAA,IAEJ,CAAC;AAAA,EAAA;AACH,EAAA,CACF;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../src/components/Breadcrumb/index.tsx"],"sourcesContent":["'use client';\n\nimport type { Locales, LocalesValues } from '@intlayer/config/client';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { ChevronRightIcon } from 'lucide-react';\nimport { Fragment, type FC, type HTMLAttributes, type ReactNode } from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport { cn } from '../../utils/cn';\nimport { Button, ButtonVariant, type ButtonProps } from '../Button';\nimport { Link, LinkColor } from '../Link';\n\n/**\n * Props for LinkLink sub-component that renders breadcrumb items as links\n */\ntype LinkLinkProps = {\n /**\n * Position of the breadcrumb item in the list (1-based index)\n */\n position: number;\n /**\n * Locale for internationalization\n */\n locale?: Locales;\n /**\n * URL to navigate to\n */\n href?: string;\n /**\n * Link color\n */\n color?: LinkColor | `${LinkColor}`;\n /**\n * Click handler\n */\n onClick?: () => void;\n /**\n * Children content\n */\n children?: string;\n /**\n * Additional CSS classes\n */\n className?: string;\n} & Omit<\n HTMLAttributes<HTMLAnchorElement>,\n 'href' | 'onClick' | 'color' | 'children' | 'className'\n>;\n\n/**\n * Breadcrumb variant styles using class-variance-authority\n */\nconst breadcrumbVariants = cva('flex flex-row flex-wrap items-center text-sm', {\n variants: {\n size: {\n small: 'gap-1 text-xs',\n medium: 'gap-2 text-sm',\n large: 'gap-3 text-base',\n },\n spacing: {\n compact: 'gap-1',\n normal: 'gap-2',\n loose: 'gap-4',\n },\n },\n defaultVariants: {\n size: 'medium',\n spacing: 'normal',\n },\n});\n\n/**\n * LinkLink sub-component for breadcrumb items that navigate to other pages\n */\nconst LinkLink: FC<LinkLinkProps> = ({\n href,\n lang,\n children,\n onClick,\n color,\n position,\n locale,\n className,\n ...props\n}) => {\n const { linkLabel } = useIntlayer('breadcrumb');\n\n return (\n <>\n <Link\n href={href}\n locale={locale}\n color={color}\n onClick={onClick}\n itemProp=\"item\"\n isExternalLink={false}\n itemScope\n itemType=\"https://schema.org/WebPage\"\n {...props}\n label={`${linkLabel} ${children}`}\n itemID={href}\n >\n <span itemProp=\"name\">{children}</span>\n </Link>\n <meta itemProp=\"position\" content={position.toString()} />\n </>\n );\n};\n\n/**\n * Props for ButtonLink sub-component that renders breadcrumb items as interactive buttons\n */\ntype ButtonButtonProps = {\n /**\n * Text content for the breadcrumb button\n */\n children: string;\n /**\n * Position of the breadcrumb item in the list (1-based index)\n */\n position: number;\n} & Omit<ButtonProps, 'children' | 'label'>;\n\n/**\n * ButtonLink sub-component for breadcrumb items with click handlers\n */\nconst ButtonLink: FC<ButtonButtonProps> = ({\n children: text,\n onClick,\n color,\n position,\n className,\n ...props\n}) => {\n const { linkLabel } = useIntlayer('breadcrumb');\n\n return (\n <>\n <Button\n onClick={onClick}\n variant={ButtonVariant.LINK}\n label={`${linkLabel} ${text}`}\n color={color}\n itemProp=\"item\"\n {...props}\n >\n <span itemProp=\"name\">{text}</span>\n </Button>\n <meta itemProp=\"position\" content={position.toString()} />\n </>\n );\n};\n\n/**\n * Props for Span sub-component that renders static breadcrumb text\n */\ntype SpanProps = {\n /**\n * Text content for the static breadcrumb item\n */\n children: string;\n /**\n * Position of the breadcrumb item in the list (1-based index)\n */\n position: number;\n} & HTMLAttributes<HTMLSpanElement>;\n\n/**\n * Span sub-component for static breadcrumb text items\n */\nconst Span: FC<SpanProps> = ({ children, position, className, ...props }) => (\n <span\n itemProp=\"item\"\n className={cn(\n 'inline-flex items-center',\n 'text-neutral-700 font-medium',\n 'transition-colors duration-200',\n className\n )}\n >\n <span itemProp=\"name\" {...props}>\n {children}\n </span>\n <meta itemProp=\"position\" content={position.toString()} />\n </span>\n);\n\n/**\n * Detailed breadcrumb link configuration with optional href or onClick\n */\ntype DetailedBreadcrumbLink = {\n /**\n * URL to navigate to when the breadcrumb item is clicked\n */\n href?: string;\n /**\n * Text content to display for this breadcrumb item\n */\n text: string;\n /**\n * Custom click handler function for interactive breadcrumb items\n */\n onClick?: () => void;\n};\n\n/**\n * Union type representing different breadcrumb item configurations:\n * - string: Simple text breadcrumb item\n * - DetailedBreadcrumbLink: Object with href, text, and/or onClick properties\n */\nexport type BreadcrumbLink = string | DetailedBreadcrumbLink;\n\nexport type BreadcrumbProps = {\n /**\n * Array of breadcrumb items\n */\n links: BreadcrumbLink[];\n /**\n * Color scheme for breadcrumb links\n * @default LinkColor.TEXT\n */\n color?: LinkColor | `${LinkColor}`;\n /**\n * Locale for internationalization\n */\n locale?: LocalesValues;\n /**\n * Element type for ARIA current attribute\n * @default 'page'\n */\n elementType?: 'page' | 'location';\n /**\n * Custom separator between breadcrumb items\n * @default ChevronRightIcon\n */\n separator?: ReactNode;\n /**\n * ARIA label for breadcrumb navigation\n * @default 'breadcrumb'\n */\n ariaLabel?: string;\n /**\n * Whether to include structured data markup\n * @default true\n */\n includeStructuredData?: boolean;\n /**\n * Maximum number of breadcrumb items to show before truncation\n */\n maxItems?: number;\n} & VariantProps<typeof breadcrumbVariants> &\n HTMLAttributes<HTMLOListElement>;\n\n/**\n * Breadcrumb component providing navigational context with accessibility features\n *\n * Features:\n * - Supports links, buttons, and static text elements\n * - Full keyboard navigation support\n * - ARIA attributes for screen readers\n * - Schema.org structured data for SEO\n * - Customizable separators and styling\n * - Internationalization support\n * - Responsive design variants\n *\n * @example\n * ```tsx\n * <Breadcrumb\n * links={[\n * 'Home',\n * { href: '/products', text: 'Products' },\n * { onClick: handleCategory, text: 'Electronics' },\n * 'Smartphones'\n * ]}\n * size=\"medium\"\n * ariaLabel=\"Product navigation\"\n * />\n * ```\n */\nexport const Breadcrumb: FC<BreadcrumbProps> = ({\n links,\n className,\n color = LinkColor.TEXT,\n locale,\n elementType = 'page',\n separator = <ChevronRightIcon size={10} />,\n ariaLabel = 'breadcrumb',\n includeStructuredData = true,\n maxItems,\n size,\n spacing,\n ...props\n}) => {\n const displayLinks =\n maxItems && links.length > maxItems\n ? [...links.slice(0, 1), '...', ...links.slice(-(maxItems - 2))]\n : links;\n\n return (\n <nav aria-label={ariaLabel} role=\"navigation\">\n <ol\n className={cn(breadcrumbVariants({ size, spacing }), className)}\n {...(includeStructuredData && {\n itemScope: true,\n itemType: 'http://schema.org/BreadcrumbList',\n })}\n {...props}\n >\n {displayLinks.map((link, index) => {\n const isLastLink = index === displayLinks.length - 1;\n const isLink =\n typeof link === 'object' && typeof link.href === 'string';\n const isButton =\n typeof link === 'object' && typeof link.onClick === 'function';\n const isActive = index === displayLinks.length - 1;\n const ariaCurrent = isActive ? elementType : undefined;\n const isTruncated = link === '...';\n\n const text = (link as DetailedBreadcrumbLink).text ?? link;\n\n if (isTruncated) {\n return (\n <Fragment key={`truncated-${index}`}>\n <li className=\"flex items-center\" aria-hidden=\"true\">\n <span className=\"text-neutral-500\">…</span>\n </li>\n {!isLastLink && (\n <li aria-hidden=\"true\" className=\"flex items-center\">\n {separator}\n </li>\n )}\n </Fragment>\n );\n }\n\n let section = (\n <Span\n key={text}\n position={index + 1}\n aria-current={ariaCurrent}\n className={cn(\n 'transition-colors duration-200',\n isActive && 'text-neutral-900'\n )}\n >\n {text}\n </Span>\n );\n\n if (isLink) {\n section = (\n <LinkLink\n key={text}\n href={link.href!}\n color={color}\n position={index + 1}\n locale={locale}\n aria-current={ariaCurrent}\n className={cn(isActive && 'text-neutral-900 cursor-default')}\n >\n {text}\n </LinkLink>\n );\n } else if (isButton) {\n section = (\n <ButtonLink\n key={text}\n onClick={link.onClick!}\n color={color}\n position={index + 1}\n aria-current={ariaCurrent}\n className={cn(isActive && 'text-neutral-900 cursor-default')}\n >\n {text}\n </ButtonLink>\n );\n }\n\n const listElement = (\n <li\n {...(includeStructuredData && {\n itemProp: 'itemListElement',\n itemScope: true,\n itemType: 'https://schema.org/ListItem',\n })}\n key={text}\n className=\"flex items-center\"\n >\n {section}\n </li>\n );\n\n if (isLastLink) {\n return listElement;\n }\n\n return (\n <Fragment key={text}>\n {listElement}\n <li aria-hidden=\"true\" className=\"flex items-center\">\n {separator}\n </li>\n </Fragment>\n );\n })}\n </ol>\n </nav>\n );\n};\n"],"names":["Fragment"],"mappings":";;;;;;;;;AAmDA,MAAM,qBAAqB,IAAI,gDAAgD;AAAA,EAC7E,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,OAAO;AAAA,IAAA;AAAA,IAET,SAAS;AAAA,MACP,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,OAAO;AAAA,IAAA;AAAA,EACT;AAAA,EAEF,iBAAiB;AAAA,IACf,MAAM;AAAA,IACN,SAAS;AAAA,EAAA;AAEb,CAAC;AAKD,MAAM,WAA8B,CAAC;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,EAAE,UAAA,IAAc,YAAY,YAAY;AAE9C,SACE,qBAAAA,YAAA,EACE,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAA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ButtonTextAlign2) => {
72
72
  return ButtonTextAlign2;
73
73
  })(ButtonTextAlign || {});
74
74
  const buttonVariants = classVarianceAuthority.cva(
75
- "relative cursor-pointer truncate whitespace-nowrap font-medium transition focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50",
75
+ "relative cursor-pointer truncate whitespace-nowrap font-medium transition-all duration-200 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50",
76
76
  {
77
77
  variants: {
78
78
  size: {
@@ -86,22 +86,22 @@ const buttonVariants = classVarianceAuthority.cva(
86
86
  [`${"icon-xl"}`]: "p-3"
87
87
  },
88
88
  color: {
89
- [`${"primary"}`]: "text-primary *:text-text-light",
90
- [`${"secondary"}`]: "text-secondary *:text-text-light",
91
- [`${"destructive"}`]: "text-destructive *:text-text-light",
92
- [`${"neutral"}`]: "text-neutral *:text-text-light",
93
- [`${"light"}`]: "text-white *:text-text-light",
94
- [`${"dark"}`]: "text-neutral-800 *:text-text-light",
95
- [`${"text"}`]: "text-text *:text-text-opposite",
96
- [`${"text-inverse"}`]: "text-text-opposite *:text-text",
97
- [`${"error"}`]: "text-error *:text-text-light",
98
- [`${"success"}`]: "text-success *:text-text-light",
99
- [`${"custom"}`]: ""
89
+ [`${"primary"}`]: "text-primary *:text-text-light focus:ring-primary-500",
90
+ [`${"secondary"}`]: "text-secondary *:text-text-light focus:ring-secondary-500",
91
+ [`${"destructive"}`]: "text-destructive *:text-text-light focus:ring-destructive-500",
92
+ [`${"neutral"}`]: "text-neutral *:text-text-light focus:ring-neutral-500",
93
+ [`${"light"}`]: "text-white *:text-text-light focus:ring-white/50",
94
+ [`${"dark"}`]: "text-neutral-800 *:text-text-light focus:ring-neutral-800/50",
95
+ [`${"text"}`]: "text-text *:text-text-opposite focus:ring-neutral-500",
96
+ [`${"text-inverse"}`]: "text-text-opposite *:text-text focus:ring-neutral-500",
97
+ [`${"error"}`]: "text-error *:text-text-light focus:ring-error/50",
98
+ [`${"success"}`]: "text-success *:text-text-light focus:ring-success/50",
99
+ [`${"custom"}`]: "focus:ring-primary-500"
100
100
  },
101
101
  variant: {
102
- [`${"default"}`]: "rounded-lg bg-current",
102
+ [`${"default"}`]: "rounded-lg bg-current hover:bg-current/90",
103
103
  [`${"none"}`]: "border-none bg-current/0 text-inherit hover:bg-current/0",
104
- [`${"outline"}`]: "*:!text-current rounded-lg border-[1.5px] bg-current/0 hover:bg-current/30",
104
+ [`${"outline"}`]: "*:!text-current rounded-lg border-[1.5px] bg-current/0 hover:bg-current/30 border-current",
105
105
  [`${"link"}`]: "*:!text-current h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 hover:bg-transparent hover:underline",
106
106
  [`${"invisible-link"}`]: "*:!text-current h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 hover:bg-transparent",
107
107
  [`${"hoverable"}`]: "*:!text-current rounded-lg border-none bg-current/0 transition hover:bg-current/10 aria-[current]:bg-current/5",
@@ -149,25 +149,38 @@ const Button = ({
149
149
  Icon,
150
150
  IconRight,
151
151
  iconClassName,
152
- isLoading,
153
- isActive,
152
+ isLoading = false,
153
+ isActive = false,
154
154
  isFullWidth = false,
155
155
  textAlign,
156
156
  disabled,
157
157
  label,
158
158
  className,
159
159
  type = "button",
160
+ "aria-describedby": ariaDescribedBy,
161
+ "aria-expanded": ariaExpanded,
162
+ "aria-haspopup": ariaHasPopup,
163
+ "aria-pressed": ariaPressed,
160
164
  ...props
161
165
  }) => {
162
166
  const isLink = variant === "link" || variant === "invisible-link";
167
+ const isIconOnly = !children && (Icon || IconRight);
168
+ const accessibilityProps = {
169
+ "aria-label": isIconOnly ? label : void 0,
170
+ "aria-labelledby": !isIconOnly ? void 0 : void 0,
171
+ "aria-describedby": ariaDescribedBy,
172
+ "aria-expanded": ariaExpanded,
173
+ "aria-haspopup": ariaHasPopup,
174
+ "aria-pressed": isActive !== void 0 ? isActive : ariaPressed,
175
+ "aria-busy": isLoading,
176
+ "aria-current": isActive ? "page" : void 0,
177
+ "aria-disabled": disabled || isLoading
178
+ };
163
179
  return /* @__PURE__ */ jsxRuntime.jsxs(
164
180
  "button",
165
181
  {
166
182
  disabled: isLoading || disabled,
167
- "aria-current": isActive ? "page" : void 0,
168
- "aria-label": label,
169
- "aria-busy": isLoading,
170
- role: isLink ? "link" : void 0,
183
+ role: isLink ? "link" : "button",
171
184
  type,
172
185
  className: buttonVariants({
173
186
  variant,
@@ -176,13 +189,14 @@ const Button = ({
176
189
  isFullWidth,
177
190
  textAlign: textAlign ?? (IconRight ? "left" : "center"),
178
191
  hasIconLeft: Boolean(
179
- typeof children !== "undefined" && (typeof Icon !== "undefined" || typeof isLoading !== "undefined")
192
+ typeof children !== "undefined" && (typeof Icon !== "undefined" || isLoading)
180
193
  ),
181
194
  hasIconRight: Boolean(
182
195
  typeof children !== "undefined" && typeof IconRight !== "undefined"
183
196
  ),
184
197
  className
185
198
  }),
199
+ ...accessibilityProps,
186
200
  ...props,
187
201
  children: [
188
202
  Icon && !isLoading && /* @__PURE__ */ jsxRuntime.jsx(
@@ -193,7 +207,8 @@ const Button = ({
193
207
  className: iconClassName,
194
208
  position: "left"
195
209
  /* LEFT */
196
- })
210
+ }),
211
+ "aria-hidden": "true"
197
212
  }
198
213
  ),
199
214
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -205,10 +220,13 @@ const Button = ({
205
220
  position: "left"
206
221
  /* LEFT */
207
222
  }),
208
- isLoading: isLoading ?? false
223
+ isLoading,
224
+ "aria-hidden": "true",
225
+ "data-testid": "loader"
209
226
  }
210
227
  ),
211
- /* @__PURE__ */ jsxRuntime.jsx("span", { children }),
228
+ children && /* @__PURE__ */ jsxRuntime.jsx("span", { children }),
229
+ !children && isIconOnly && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: label }),
212
230
  IconRight && /* @__PURE__ */ jsxRuntime.jsx(
213
231
  IconRight,
214
232
  {
@@ -217,7 +235,8 @@ const Button = ({
217
235
  className: iconClassName,
218
236
  position: "right"
219
237
  /* RIGHT */
220
- })
238
+ }),
239
+ "aria-hidden": "true"
221
240
  }
222
241
  )
223
242
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"Button.cjs","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport type { LucideIcon } from 'lucide-react';\nimport {\n type ButtonHTMLAttributes,\n type DetailedHTMLProps,\n type FC,\n} from 'react';\nimport { Loader } from '../Loader';\n\nexport enum ButtonSize {\n SM = 'sm',\n MD = 'md',\n LG = 'lg',\n XL = 'xl',\n ICON_SM = 'icon-sm',\n ICON_MD = 'icon-md',\n ICON_LG = 'icon-lg',\n ICON_XL = 'icon-xl',\n}\n\nexport enum ButtonIconPosition {\n LEFT = 'left',\n RIGHT = 'right',\n}\n\nconst buttonIconVariants = cva('', {\n variants: {\n size: {\n [`${ButtonSize.SM}`]: 'size-3 absolute top-1/2 -translate-y-1/2',\n [`${ButtonSize.MD}`]: 'size-4 absolute top-1/2 -translate-y-1/2',\n [`${ButtonSize.LG}`]: 'size-5 absolute top-1/2 -translate-y-1/2',\n [`${ButtonSize.XL}`]: 'size-6 absolute top-1/2 -translate-y-1/2',\n [`${ButtonSize.ICON_SM}`]: 'size-3',\n [`${ButtonSize.ICON_MD}`]: 'size-4',\n [`${ButtonSize.ICON_LG}`]: 'size-5',\n [`${ButtonSize.ICON_XL}`]: 'size-6',\n },\n position: {\n [`${ButtonIconPosition.LEFT}`]: 'left-3',\n [`${ButtonIconPosition.RIGHT}`]: 'right-3',\n },\n },\n defaultVariants: {\n size: ButtonSize.MD,\n },\n});\n\nexport enum ButtonVariant {\n DEFAULT = 'default',\n NONE = 'none',\n OUTLINE = 'outline',\n LINK = 'link',\n INVISIBLE_LINK = 'invisible-link',\n HOVERABLE = 'hoverable',\n INPUT = 'input',\n}\n\nexport enum ButtonColor {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n DESTRUCTIVE = 'destructive',\n NEUTRAL = 'neutral',\n LIGHT = 'light',\n DARK = 'dark',\n TEXT = 'text',\n TEXT_INVERSE = 'text-inverse',\n ERROR = 'error',\n SUCCESS = 'success',\n CUSTOM = 'custom',\n}\n\nexport enum ButtonTextAlign {\n LEFT = 'left',\n CENTER = 'center',\n RIGHT = 'right',\n}\n\nconst buttonVariants = cva(\n 'relative cursor-pointer truncate whitespace-nowrap font-medium transition focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n size: {\n [`${ButtonSize.SM}`]: 'min-h-7 px-3 max-md:py-1 text-xs',\n [`${ButtonSize.MD}`]: 'min-h-8 px-6 max-md:py-2 text-sm',\n [`${ButtonSize.LG}`]: 'min-h-10 px-8 max-md:py-3 text-lg',\n [`${ButtonSize.XL}`]: 'min-h-11 px-10 max-md:py-4 text-xl',\n [`${ButtonSize.ICON_SM}`]: 'p-1.5',\n [`${ButtonSize.ICON_MD}`]: 'p-1.5',\n [`${ButtonSize.ICON_LG}`]: 'p-2',\n [`${ButtonSize.ICON_XL}`]: 'p-3',\n },\n color: {\n [`${ButtonColor.PRIMARY}`]: 'text-primary *:text-text-light',\n [`${ButtonColor.SECONDARY}`]: 'text-secondary *:text-text-light',\n [`${ButtonColor.DESTRUCTIVE}`]: 'text-destructive *:text-text-light',\n [`${ButtonColor.NEUTRAL}`]: 'text-neutral *:text-text-light',\n [`${ButtonColor.LIGHT}`]: 'text-white *:text-text-light',\n [`${ButtonColor.DARK}`]: 'text-neutral-800 *:text-text-light',\n [`${ButtonColor.TEXT}`]: 'text-text *:text-text-opposite',\n [`${ButtonColor.TEXT_INVERSE}`]: 'text-text-opposite *:text-text',\n [`${ButtonColor.ERROR}`]: 'text-error *:text-text-light',\n [`${ButtonColor.SUCCESS}`]: 'text-success *:text-text-light',\n [`${ButtonColor.CUSTOM}`]: '',\n },\n variant: {\n [`${ButtonVariant.DEFAULT}`]: 'rounded-lg bg-current',\n [`${ButtonVariant.NONE}`]:\n 'border-none bg-current/0 text-inherit hover:bg-current/0',\n [`${ButtonVariant.OUTLINE}`]:\n '*:!text-current rounded-lg border-[1.5px] bg-current/0 hover:bg-current/30',\n [`${ButtonVariant.LINK}`]:\n '*:!text-current h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 hover:bg-transparent hover:underline',\n [`${ButtonVariant.INVISIBLE_LINK}`]:\n '*:!text-current h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 hover:bg-transparent',\n [`${ButtonVariant.HOVERABLE}`]:\n '*:!text-current rounded-lg border-none bg-current/0 transition hover:bg-current/10 aria-[current]:bg-current/5',\n [`${ButtonVariant.INPUT}`]: [\n '*:!text-current w-full select-text resize-none rounded-xl border-2 bg-input-background text-sm text-input-text shadow-none outline-0 transition-all',\n 'border-input-border hover:border-input-border-hover focus:border-input-border-focus focus:outline-0 focus:[box-shadow:none]',\n 'aria-[invalid=true]:border-error',\n 'disabled:opacity-50',\n ],\n },\n\n textAlign: {\n [`${ButtonTextAlign.LEFT}`]: 'text-left',\n [`${ButtonTextAlign.CENTER}`]: 'text-center',\n [`${ButtonTextAlign.RIGHT}`]: 'text-right',\n },\n\n isFullWidth: {\n true: 'w-full',\n false: '',\n },\n\n hasIconLeft: {\n true: 'px-12',\n false: '',\n },\n hasIconRight: {\n true: 'pr-8',\n false: '',\n },\n },\n defaultVariants: {\n variant: ButtonVariant.DEFAULT,\n size: ButtonSize.MD,\n color: ButtonColor.CUSTOM,\n textAlign: ButtonTextAlign.CENTER,\n isFullWidth: false,\n hasIconRight: false,\n hasIconLeft: false,\n },\n }\n);\n\nexport type ButtonProps = DetailedHTMLProps<\n ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n> &\n VariantProps<typeof buttonVariants> & {\n /**\n * Optional icon to be displayed on the button\n */\n label: string;\n Icon?: FC | LucideIcon;\n IconRight?: FC | LucideIcon;\n iconClassName?: string;\n isLoading?: boolean;\n isActive?: boolean;\n isFullWidth?: boolean;\n };\n\nexport const Button: FC<ButtonProps> = ({\n variant,\n size,\n color,\n children,\n Icon,\n IconRight,\n iconClassName,\n isLoading,\n isActive,\n isFullWidth = false,\n textAlign,\n disabled,\n label,\n className,\n type = 'button',\n ...props\n}) => {\n const isLink = variant === 'link' || variant === 'invisible-link';\n\n return (\n <button\n disabled={isLoading || disabled}\n aria-current={isActive ? 'page' : undefined}\n aria-label={label}\n aria-busy={isLoading}\n role={isLink ? 'link' : undefined}\n type={type}\n className={buttonVariants({\n variant,\n size,\n color,\n isFullWidth,\n textAlign:\n textAlign ??\n (IconRight ? ButtonTextAlign.LEFT : ButtonTextAlign.CENTER),\n hasIconLeft: Boolean(\n typeof children !== 'undefined' &&\n (typeof Icon !== 'undefined' || typeof isLoading !== 'undefined')\n ),\n hasIconRight: Boolean(\n typeof children !== 'undefined' && typeof IconRight !== 'undefined'\n ),\n className,\n })}\n {...props}\n >\n {Icon && !isLoading && (\n <Icon\n className={buttonIconVariants({\n size,\n className: iconClassName,\n position: ButtonIconPosition.LEFT,\n })}\n />\n )}\n\n <Loader\n className={buttonIconVariants({\n size,\n className: iconClassName,\n position: ButtonIconPosition.LEFT,\n })}\n isLoading={isLoading ?? false}\n />\n\n <span>{children}</span>\n\n {IconRight && (\n <IconRight\n className={buttonIconVariants({\n size,\n className: iconClassName,\n position: ButtonIconPosition.RIGHT,\n })}\n />\n )}\n </button>\n );\n};\n"],"names":["ButtonSize","ButtonIconPosition","cva","ButtonVariant","ButtonColor","ButtonTextAlign","jsxs","jsx","Loader"],"mappings":";;;;;AASO,IAAK,+BAAAA,gBAAL;AACLA,cAAA,IAAA,IAAK;AACLA,cAAA,IAAA,IAAK;AACLA,cAAA,IAAA,IAAK;AACLA,cAAA,IAAA,IAAK;AACLA,cAAA,SAAA,IAAU;AACVA,cAAA,SAAA,IAAU;AACVA,cAAA,SAAA,IAAU;AACVA,cAAA,SAAA,IAAU;AARA,SAAAA;AAAA,GAAA,cAAA,CAAA,CAAA;AAWL,IAAK,uCAAAC,wBAAL;AACLA,sBAAA,MAAA,IAAO;AACPA,sBAAA,OAAA,IAAQ;AAFE,SAAAA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ACX,MAAM,SAAS,SAAS;AAAA,MACxB;AAAA,MACA,WAAW,eAAe;AAAA,QACxB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,WACE,cACC,YAAY,SAAuB;AAAA,QACtC,aAAa;AAAA,UACX,OAAO,aAAa,gBACjB,OAAO,SAAS,eAAe,OAAO,cAAc;AAAA,QAAA;AAAA,QAEzD,cAAc;AAAA,UACZ,OAAO,aAAa,eAAe,OAAO,cAAc;AAAA,QAAA;AAAA,QAE1D;AAAA,MAAA,CACD;AAAA,MACA,GAAG;AAAA,MAEH,UAAA;AAAA,QAAA,QAAQ,CAAC,aACRC,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAW,mBAAmB;AAAA,cAC5B;AAAA,cACA,WAAW;AAAA,cACX,UAAU;AAAA;AAAA,YAAA,CACX;AAAA,UAAA;AAAA,QAAA;AAAA,QAILA,2BAAAA;AAAAA,UAACC,wBAAAA;AAAAA,UAAA;AAAA,YACC,WAAW,mBAAmB;AAAA,cAC5B;AAAA,cACA,WAAW;AAAA,cACX,UAAU;AAAA;AAAA,YAAA,CACX;AAAA,YACD,WAAW,aAAa;AAAA,UAAA;AAAA,QAAA;AAAA,QAG1BD,+BAAC,UAAM,UAAS;AAAA,QAEf,aACCA,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAW,mBAAmB;AAAA,cAC5B;AAAA,cACA,WAAW;AAAA,cACX,UAAU;AAAA;AAAA,YAAA,CACX;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAIR;;;;;;;"}
1
+ {"version":3,"file":"Button.cjs","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport type { LucideIcon } from 'lucide-react';\nimport {\n type ButtonHTMLAttributes,\n type DetailedHTMLProps,\n type FC,\n} from 'react';\nimport { Loader } from '../Loader';\n\n/**\n * Button size variants for different use cases\n */\nexport enum ButtonSize {\n SM = 'sm',\n MD = 'md',\n LG = 'lg',\n XL = 'xl',\n ICON_SM = 'icon-sm',\n ICON_MD = 'icon-md',\n ICON_LG = 'icon-lg',\n ICON_XL = 'icon-xl',\n}\n\n/**\n * Icon positioning within the button\n */\nexport enum ButtonIconPosition {\n LEFT = 'left',\n RIGHT = 'right',\n}\n\nconst buttonIconVariants = cva('', {\n variants: {\n size: {\n [`${ButtonSize.SM}`]: 'size-3 absolute top-1/2 -translate-y-1/2',\n [`${ButtonSize.MD}`]: 'size-4 absolute top-1/2 -translate-y-1/2',\n [`${ButtonSize.LG}`]: 'size-5 absolute top-1/2 -translate-y-1/2',\n [`${ButtonSize.XL}`]: 'size-6 absolute top-1/2 -translate-y-1/2',\n [`${ButtonSize.ICON_SM}`]: 'size-3',\n [`${ButtonSize.ICON_MD}`]: 'size-4',\n [`${ButtonSize.ICON_LG}`]: 'size-5',\n [`${ButtonSize.ICON_XL}`]: 'size-6',\n },\n position: {\n [`${ButtonIconPosition.LEFT}`]: 'left-3',\n [`${ButtonIconPosition.RIGHT}`]: 'right-3',\n },\n },\n defaultVariants: {\n size: ButtonSize.MD,\n },\n});\n\n/**\n * Button visual style variants\n */\nexport enum ButtonVariant {\n DEFAULT = 'default',\n NONE = 'none',\n OUTLINE = 'outline',\n LINK = 'link',\n INVISIBLE_LINK = 'invisible-link',\n HOVERABLE = 'hoverable',\n INPUT = 'input',\n}\n\n/**\n * Button color themes that work with the design system\n */\nexport enum ButtonColor {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n DESTRUCTIVE = 'destructive',\n NEUTRAL = 'neutral',\n LIGHT = 'light',\n DARK = 'dark',\n TEXT = 'text',\n TEXT_INVERSE = 'text-inverse',\n ERROR = 'error',\n SUCCESS = 'success',\n CUSTOM = 'custom',\n}\n\n/**\n * Text alignment options for button content\n */\nexport enum ButtonTextAlign {\n LEFT = 'left',\n CENTER = 'center',\n RIGHT = 'right',\n}\n\n/**\n * Enhanced button variants with improved accessibility and focus states\n */\nconst buttonVariants = cva(\n 'relative cursor-pointer truncate whitespace-nowrap font-medium transition-all duration-200 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n size: {\n [`${ButtonSize.SM}`]: 'min-h-7 px-3 max-md:py-1 text-xs',\n [`${ButtonSize.MD}`]: 'min-h-8 px-6 max-md:py-2 text-sm',\n [`${ButtonSize.LG}`]: 'min-h-10 px-8 max-md:py-3 text-lg',\n [`${ButtonSize.XL}`]: 'min-h-11 px-10 max-md:py-4 text-xl',\n [`${ButtonSize.ICON_SM}`]: 'p-1.5',\n [`${ButtonSize.ICON_MD}`]: 'p-1.5',\n [`${ButtonSize.ICON_LG}`]: 'p-2',\n [`${ButtonSize.ICON_XL}`]: 'p-3',\n },\n color: {\n [`${ButtonColor.PRIMARY}`]:\n 'text-primary *:text-text-light focus:ring-primary-500',\n [`${ButtonColor.SECONDARY}`]:\n 'text-secondary *:text-text-light focus:ring-secondary-500',\n [`${ButtonColor.DESTRUCTIVE}`]:\n 'text-destructive *:text-text-light focus:ring-destructive-500',\n [`${ButtonColor.NEUTRAL}`]:\n 'text-neutral *:text-text-light focus:ring-neutral-500',\n [`${ButtonColor.LIGHT}`]:\n 'text-white *:text-text-light focus:ring-white/50',\n [`${ButtonColor.DARK}`]:\n 'text-neutral-800 *:text-text-light focus:ring-neutral-800/50',\n [`${ButtonColor.TEXT}`]:\n 'text-text *:text-text-opposite focus:ring-neutral-500',\n [`${ButtonColor.TEXT_INVERSE}`]:\n 'text-text-opposite *:text-text focus:ring-neutral-500',\n [`${ButtonColor.ERROR}`]:\n 'text-error *:text-text-light focus:ring-error/50',\n [`${ButtonColor.SUCCESS}`]:\n 'text-success *:text-text-light focus:ring-success/50',\n [`${ButtonColor.CUSTOM}`]: 'focus:ring-primary-500',\n },\n variant: {\n [`${ButtonVariant.DEFAULT}`]:\n 'rounded-lg bg-current hover:bg-current/90',\n [`${ButtonVariant.NONE}`]:\n 'border-none bg-current/0 text-inherit hover:bg-current/0',\n [`${ButtonVariant.OUTLINE}`]:\n '*:!text-current rounded-lg border-[1.5px] bg-current/0 hover:bg-current/30 border-current',\n [`${ButtonVariant.LINK}`]:\n '*:!text-current h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 hover:bg-transparent hover:underline',\n [`${ButtonVariant.INVISIBLE_LINK}`]:\n '*:!text-current h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 hover:bg-transparent',\n [`${ButtonVariant.HOVERABLE}`]:\n '*:!text-current rounded-lg border-none bg-current/0 transition hover:bg-current/10 aria-[current]:bg-current/5',\n [`${ButtonVariant.INPUT}`]: [\n '*:!text-current w-full select-text resize-none rounded-xl border-2 bg-input-background text-sm text-input-text shadow-none outline-0 transition-all',\n 'border-input-border hover:border-input-border-hover focus:border-input-border-focus focus:outline-0 focus:[box-shadow:none]',\n 'aria-[invalid=true]:border-error',\n 'disabled:opacity-50',\n ],\n },\n\n textAlign: {\n [`${ButtonTextAlign.LEFT}`]: 'text-left',\n [`${ButtonTextAlign.CENTER}`]: 'text-center',\n [`${ButtonTextAlign.RIGHT}`]: 'text-right',\n },\n\n isFullWidth: {\n true: 'w-full',\n false: '',\n },\n\n hasIconLeft: {\n true: 'px-12',\n false: '',\n },\n hasIconRight: {\n true: 'pr-8',\n false: '',\n },\n },\n defaultVariants: {\n variant: ButtonVariant.DEFAULT,\n size: ButtonSize.MD,\n color: ButtonColor.CUSTOM,\n textAlign: ButtonTextAlign.CENTER,\n isFullWidth: false,\n hasIconRight: false,\n hasIconLeft: false,\n },\n }\n);\n\n/**\n * Enhanced Button component props with comprehensive type safety and accessibility features\n */\nexport type ButtonProps = DetailedHTMLProps<\n ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n> &\n VariantProps<typeof buttonVariants> & {\n /**\n * Accessible label for screen readers and assistive technologies.\n * This is required for accessibility compliance.\n */\n label: string;\n\n /**\n * Optional icon to display on the left side of the button\n */\n Icon?: FC | LucideIcon;\n\n /**\n * Optional icon to display on the right side of the button\n */\n IconRight?: FC | LucideIcon;\n\n /**\n * Additional CSS classes for icon styling\n */\n iconClassName?: string;\n\n /**\n * Shows loading spinner and disables button interaction when true\n */\n isLoading?: boolean;\n\n /**\n * Marks the button as active (useful for navigation or toggle states)\n */\n isActive?: boolean;\n\n /**\n * Makes the button span the full width of its container\n */\n isFullWidth?: boolean;\n\n /**\n * Additional description for complex buttons (optional)\n */\n 'aria-describedby'?: string;\n\n /**\n * Expanded state for collapsible sections (optional)\n */\n 'aria-expanded'?: boolean;\n\n /**\n * Controls whether the button has popup/menu (optional)\n */\n 'aria-haspopup'?:\n | boolean\n | 'true'\n | 'false'\n | 'menu'\n | 'listbox'\n | 'tree'\n | 'grid'\n | 'dialog';\n\n /**\n * Indicates if button controls are currently pressed (for toggle buttons)\n */\n 'aria-pressed'?: boolean;\n };\n\n/**\n * Button Component - A comprehensive, accessible button component\n *\n * Features:\n * - Full accessibility compliance with ARIA attributes\n * - Multiple variants and sizes for different use cases\n * - Icon support (left and right positioning)\n * - Loading states with spinner\n * - Keyboard navigation support\n * - Focus management with visible indicators\n * - Responsive design adaptations\n *\n * @example\n * ```tsx\n * // Basic button\n * <Button label=\"Click me\">Click me</Button>\n *\n * // Button with icon and loading state\n * <Button\n * label=\"Save document\"\n * Icon={SaveIcon}\n * isLoading={saving}\n * disabled={!hasChanges}\n * >\n * Save\n * </Button>\n *\n * // Destructive action button\n * <Button\n * variant={ButtonVariant.OUTLINE}\n * color={ButtonColor.DESTRUCTIVE}\n * label=\"Delete item permanently\"\n * aria-describedby=\"delete-warning\"\n * >\n * Delete\n * </Button>\n * ```\n */\nexport const Button: FC<ButtonProps> = ({\n variant,\n size,\n color,\n children,\n Icon,\n IconRight,\n iconClassName,\n isLoading = false,\n isActive = false,\n isFullWidth = false,\n textAlign,\n disabled,\n label,\n className,\n type = 'button',\n 'aria-describedby': ariaDescribedBy,\n 'aria-expanded': ariaExpanded,\n 'aria-haspopup': ariaHasPopup,\n 'aria-pressed': ariaPressed,\n ...props\n}) => {\n const isLink =\n variant === ButtonVariant.LINK || variant === ButtonVariant.INVISIBLE_LINK;\n const isIconOnly = !children && (Icon || IconRight);\n\n const accessibilityProps = {\n 'aria-label': isIconOnly ? label : undefined,\n 'aria-labelledby': !isIconOnly ? undefined : undefined,\n 'aria-describedby': ariaDescribedBy,\n 'aria-expanded': ariaExpanded,\n 'aria-haspopup': ariaHasPopup,\n 'aria-pressed': isActive !== undefined ? isActive : ariaPressed,\n 'aria-busy': isLoading,\n 'aria-current': (isActive ? 'page' : undefined) as 'page' | undefined,\n 'aria-disabled': disabled || isLoading,\n };\n\n return (\n <button\n disabled={isLoading || disabled}\n role={isLink ? 'link' : 'button'}\n type={type}\n className={buttonVariants({\n variant,\n size,\n color,\n isFullWidth,\n textAlign:\n textAlign ??\n (IconRight ? ButtonTextAlign.LEFT : ButtonTextAlign.CENTER),\n hasIconLeft: Boolean(\n typeof children !== 'undefined' &&\n (typeof Icon !== 'undefined' || isLoading)\n ),\n hasIconRight: Boolean(\n typeof children !== 'undefined' && typeof IconRight !== 'undefined'\n ),\n className,\n })}\n {...accessibilityProps}\n {...props}\n >\n {Icon && !isLoading && (\n <Icon\n className={buttonIconVariants({\n size,\n className: iconClassName,\n position: ButtonIconPosition.LEFT,\n })}\n aria-hidden=\"true\"\n />\n )}\n\n <Loader\n className={buttonIconVariants({\n size,\n className: iconClassName,\n position: ButtonIconPosition.LEFT,\n })}\n isLoading={isLoading}\n aria-hidden=\"true\"\n data-testid=\"loader\"\n />\n\n {children && <span>{children}</span>}\n\n {!children && isIconOnly && <span className=\"sr-only\">{label}</span>}\n\n {IconRight && (\n <IconRight\n className={buttonIconVariants({\n size,\n className: iconClassName,\n position: ButtonIconPosition.RIGHT,\n })}\n aria-hidden=\"true\"\n />\n )}\n </button>\n );\n};\n"],"names":["ButtonSize","ButtonIconPosition","cva","ButtonVariant","ButtonColor","ButtonTextAlign","jsxs","jsx","Loader"],"mappings":";;;;;AAYO,IAAK,+BAA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