@okam/stack-ui 1.25.2 → 1.25.3

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 (382) hide show
  1. package/.eslintrc.js +32 -0
  2. package/.storybook/.eslintrc.js +29 -0
  3. package/.storybook/main.ts +33 -0
  4. package/.storybook/preview.js +56 -0
  5. package/.storybook/tsconfig.json +17 -0
  6. package/CHANGELOG.md +574 -0
  7. package/README.md +8 -0
  8. package/package.json +1 -1
  9. package/postcss.config.js +15 -0
  10. package/project.json +77 -0
  11. package/src/_stories/icons/code-brackets.svg +1 -0
  12. package/src/_stories/icons/colors.svg +1 -0
  13. package/src/_stories/icons/comments.svg +1 -0
  14. package/src/_stories/icons/direction.svg +1 -0
  15. package/src/_stories/icons/flow.svg +1 -0
  16. package/src/_stories/icons/plugin.svg +1 -0
  17. package/src/_stories/icons/repo.svg +1 -0
  18. package/src/_stories/icons/stackalt.svg +1 -0
  19. package/src/components/Accordion/accordion.stories.mdx +240 -0
  20. package/src/components/Accordion/components/AccordionItem.tsx +53 -0
  21. package/src/components/Accordion/components/AriaAccordionItem.tsx +76 -0
  22. package/src/components/Accordion/hooks/useAccordionState.ts +46 -0
  23. package/src/components/Accordion/index.tsx +38 -0
  24. package/{components/Accordion/interface.d.ts → src/components/Accordion/interface.ts} +23 -17
  25. package/src/components/Alerts/alerts.stories.mdx +282 -0
  26. package/src/components/Alerts/components/AlertsCloseButton.tsx +20 -0
  27. package/src/components/Alerts/components/AlertsItem.tsx +39 -0
  28. package/src/components/Alerts/components/AlertsNavigationButton.tsx +71 -0
  29. package/src/components/Alerts/components/AlertsSwiper.tsx +125 -0
  30. package/src/components/Alerts/components/pagination/AlertsPagination.tsx +32 -0
  31. package/src/components/Alerts/components/pagination/AlertsPaginationBullet.tsx +61 -0
  32. package/src/components/Alerts/index.tsx +54 -0
  33. package/src/components/Alerts/interface.ts +51 -0
  34. package/src/components/Box/box.stories.mdx +27 -0
  35. package/src/components/Box/index.tsx +36 -0
  36. package/src/components/Box/interface.ts +10 -0
  37. package/src/components/Button/button.stories.mdx +99 -0
  38. package/src/components/Button/index.tsx +92 -0
  39. package/src/components/Button/interface.ts +22 -0
  40. package/src/components/Calendar/RangeCalendar.tsx +61 -0
  41. package/src/components/Calendar/calendar.stories.mdx +28 -0
  42. package/src/components/Calendar/components/CalendarCell.tsx +60 -0
  43. package/src/components/Calendar/components/CalendarGrid.tsx +44 -0
  44. package/src/components/Calendar/index.tsx +63 -0
  45. package/src/components/Calendar/interface.ts +37 -0
  46. package/src/components/Carousel/carousel.stories.mdx +182 -0
  47. package/src/components/Carousel/index.tsx +99 -0
  48. package/src/components/Carousel/interface.ts +26 -0
  49. package/src/components/Date/date.stories.mdx +122 -0
  50. package/src/components/Date/index.tsx +35 -0
  51. package/src/components/Date/interface.ts +7 -0
  52. package/src/components/Dialog/index.tsx +14 -0
  53. package/src/components/Dialog/interface.ts +6 -0
  54. package/src/components/DirectusImg/index.tsx +59 -0
  55. package/src/components/DirectusImg/interface.ts +19 -0
  56. package/src/components/Icon/index.tsx +40 -0
  57. package/src/components/Icon/interface.ts +8 -0
  58. package/src/components/Img/img.stories.mdx +28 -0
  59. package/src/components/Img/index.tsx +30 -0
  60. package/src/components/Img/interface.ts +9 -0
  61. package/src/components/Lightbox/hooks/overlay/index.tsx +36 -0
  62. package/src/components/Lightbox/index.tsx +82 -0
  63. package/src/components/Lightbox/interface.ts +28 -0
  64. package/src/components/Lightbox/lightbox.stories.mdx +79 -0
  65. package/src/components/Menu/Menu.tsx +43 -0
  66. package/src/components/Menu/MenuSidePanel.tsx +41 -0
  67. package/src/components/Menu/components/InnerContent.tsx +26 -0
  68. package/src/components/Menu/components/MenuItems.tsx +133 -0
  69. package/src/components/Menu/components/TabContainer.tsx +13 -0
  70. package/src/components/Menu/interface.ts +41 -0
  71. package/src/components/Menu/menu.stories.mdx +23 -0
  72. package/src/components/Modal/components/ModalDialog.tsx +31 -0
  73. package/src/components/Modal/components/ModalOverlay.tsx +21 -0
  74. package/src/components/Modal/index.tsx +32 -0
  75. package/{components/Modal/interface.d.ts → src/components/Modal/interface.ts} +14 -11
  76. package/src/components/Popover/index.tsx +138 -0
  77. package/src/components/Popover/interface.ts +25 -0
  78. package/src/components/Popover/popover.stories.mdx +66 -0
  79. package/src/components/ShareButton/index.tsx +172 -0
  80. package/src/components/ShareButton/interface.ts +29 -0
  81. package/src/components/ShareButton/share-button.stories.mdx +48 -0
  82. package/src/components/ShareButton/utils/generateUtmTags.ts +4 -0
  83. package/src/components/ShareButton/utils/useFacebookShareUrl.ts +15 -0
  84. package/src/components/ShareButton/utils/useMailToShareUrl.ts +15 -0
  85. package/src/components/ShareButton/utils/useTwitterShareUrl.ts +15 -0
  86. package/src/components/ShareButton/utils/useWindow.ts +17 -0
  87. package/src/components/SidePanel/index.tsx +43 -0
  88. package/src/components/SidePanel/interface.ts +16 -0
  89. package/src/components/SidePanel/side-panel.stories.mdx +44 -0
  90. package/src/components/TabList/components/Tab/Tab.tsx +19 -0
  91. package/src/components/TabList/components/TabPanel/TabPanel.tsx +27 -0
  92. package/src/components/TabList/index.tsx +44 -0
  93. package/src/components/TabList/interface.ts +23 -0
  94. package/src/components/Typography/index.tsx +35 -0
  95. package/src/components/Typography/interface.ts +9 -0
  96. package/src/components/Typography/typo.stories.mdx +157 -0
  97. package/src/components/WysiwygBlock/index.tsx +20 -0
  98. package/src/components/WysiwygBlock/interface.ts +7 -0
  99. package/src/components/WysiwygBlock/wysiwyg.stories.mdx +53 -0
  100. package/src/components/fields/Checkbox/Checkbox.interface.ts +21 -0
  101. package/src/components/fields/Checkbox/Checkbox.stories.mdx +127 -0
  102. package/src/components/fields/Checkbox/index.tsx +62 -0
  103. package/src/components/fields/CheckboxGroup/checkbox-group.stories.mdx +59 -0
  104. package/src/components/fields/CheckboxGroup/components/CheckboxGroupItem/index.tsx +66 -0
  105. package/src/components/fields/CheckboxGroup/index.tsx +49 -0
  106. package/src/components/fields/CheckboxGroup/interface.ts +17 -0
  107. package/src/components/fields/DatePicker/DateRangePicker.tsx +73 -0
  108. package/src/components/fields/DatePicker/components/CalendarPopover.tsx +31 -0
  109. package/src/components/fields/DatePicker/components/DateField.tsx +61 -0
  110. package/src/components/fields/DatePicker/date-picker.stories.mdx +55 -0
  111. package/src/components/fields/DatePicker/index.tsx +71 -0
  112. package/src/components/fields/DatePicker/interface.ts +69 -0
  113. package/src/components/fields/Radio/Radio.interface.ts +30 -0
  114. package/src/components/fields/Radio/index.tsx +63 -0
  115. package/src/components/fields/RadioGroup/index.tsx +33 -0
  116. package/src/components/fields/RadioGroup/interface.ts +10 -0
  117. package/src/components/fields/RadioGroup/radio-group.stories.mdx +56 -0
  118. package/src/components/fields/SearchField/index.tsx +59 -0
  119. package/src/components/fields/SearchField/interface.ts +10 -0
  120. package/src/components/fields/SearchField/search.stories.mdx +91 -0
  121. package/src/components/fields/Select/Select.interface.ts +24 -0
  122. package/src/components/fields/Select/Select.stories.mdx +53 -0
  123. package/src/components/fields/Select/Select.tsx +108 -0
  124. package/{components/fields/Select/components/Listbox.interface.d.ts → src/components/fields/Select/components/Listbox.interface.ts} +11 -8
  125. package/src/components/fields/Select/components/Listbox.tsx +40 -0
  126. package/src/components/fields/Select/components/Popover.interface.ts +14 -0
  127. package/src/components/fields/Select/components/Popover.tsx +32 -0
  128. package/{components/fields/SelectItem/SelectItem.interface.d.ts → src/components/fields/SelectItem/SelectItem.interface.ts} +4 -3
  129. package/src/components/fields/SelectItem/SelectItem.tsx +10 -0
  130. package/src/components/fields/TextArea/index.tsx +105 -0
  131. package/src/components/fields/TextArea/textArea.stories.mdx +60 -0
  132. package/src/components/fields/TextInputField/index.tsx +107 -0
  133. package/src/components/fields/TextInputField/interface.ts +30 -0
  134. package/src/components/fields/TextInputField/text-input-field.stories.mdx +64 -0
  135. package/src/components/icons/ArrowDown.tsx +11 -0
  136. package/src/components/icons/ArrowLeft.tsx +18 -0
  137. package/src/components/icons/ArrowRight.tsx +18 -0
  138. package/src/components/icons/Check.tsx +11 -0
  139. package/src/components/icons/ChevronLeft.tsx +11 -0
  140. package/src/components/icons/ChevronRight.tsx +11 -0
  141. package/src/components/icons/CloseBtn.tsx +11 -0
  142. package/src/components/icons/Facebook.tsx +14 -0
  143. package/src/components/icons/FacebookColored.tsx +16 -0
  144. package/src/components/icons/FacebookRounded.tsx +16 -0
  145. package/src/components/icons/Globe.tsx +38 -0
  146. package/src/components/icons/IconFallback.tsx +8 -0
  147. package/src/components/icons/Instagram.tsx +14 -0
  148. package/src/components/icons/InstagramColored.tsx +59 -0
  149. package/src/components/icons/Link.tsx +14 -0
  150. package/src/components/icons/LinkedIn.tsx +16 -0
  151. package/src/components/icons/Mail.tsx +16 -0
  152. package/src/components/icons/Plus.tsx +18 -0
  153. package/src/components/icons/Search.tsx +19 -0
  154. package/src/components/icons/Share.tsx +16 -0
  155. package/src/components/icons/Twitter.tsx +16 -0
  156. package/src/components/icons/TwitterColored.tsx +16 -0
  157. package/src/components/icons/Upload.tsx +14 -0
  158. package/src/components/icons/X.tsx +14 -0
  159. package/src/components/icons/YouTube.tsx +16 -0
  160. package/src/components/icons/YouTubeColored.tsx +17 -0
  161. package/src/components/icons/index.ts +24 -0
  162. package/src/examples/PageLayout/index.tsx +61 -0
  163. package/src/examples/PageLayout/layout.stories.mdx +35 -0
  164. package/{index.d.ts → src/index.ts} +72 -57
  165. package/src/message.tsx +8 -0
  166. package/src/providers/Accordion/index.tsx +15 -0
  167. package/src/providers/Accordion/interface.ts +14 -0
  168. package/src/providers/Alerts/index.tsx +15 -0
  169. package/src/providers/Alerts/interface.ts +11 -0
  170. package/src/providers/CheckboxGroup/index.tsx +22 -0
  171. package/{providers/CheckboxGroup/interface.d.ts → src/providers/CheckboxGroup/interface.ts} +5 -4
  172. package/src/providers/Client/index.tsx +21 -0
  173. package/src/providers/Client/interface.ts +13 -0
  174. package/src/providers/Menu/index.tsx +43 -0
  175. package/src/providers/Menu/interface.ts +32 -0
  176. package/src/providers/RadioGroup/RadioGroup.interface.ts +8 -0
  177. package/src/providers/RadioGroup/RadioGroup.tsx +25 -0
  178. package/src/providers/SidePanel/index.tsx +55 -0
  179. package/src/providers/SidePanel/interface.ts +26 -0
  180. package/src/providers/Theme/hooks.ts +25 -0
  181. package/src/providers/Theme/index.tsx +40 -0
  182. package/src/providers/Theme/interface.ts +28 -0
  183. package/src/providers/Theme/utils.ts +3 -0
  184. package/src/providers/UserSearchQuery/index.tsx +20 -0
  185. package/src/providers/UserSearchQuery/interface.ts +12 -0
  186. package/src/storybook/Lightbox/LightboxControlledState.tsx +28 -0
  187. package/src/storybook/Menu/Menu.tsx +177 -0
  188. package/src/storybook/Menu/NestedMenu.tsx +24 -0
  189. package/src/storybook/Menu/mock.tsx +84 -0
  190. package/src/storybook/SelectField/index.tsx +57 -0
  191. package/src/storybook/ShareButtonExample/index.tsx +66 -0
  192. package/src/tailwind.css +3 -0
  193. package/src/theme/Accordion/index.tsx +101 -0
  194. package/src/theme/Alerts/index.ts +97 -0
  195. package/src/theme/Box/index.ts +45 -0
  196. package/src/theme/Button/index.tsx +72 -0
  197. package/src/theme/Calendar/index.tsx +167 -0
  198. package/src/theme/Carousel/index.ts +36 -0
  199. package/src/theme/Checkbox/index.ts +49 -0
  200. package/src/theme/CheckboxGroup/index.ts +14 -0
  201. package/src/theme/DatePicker/index.tsx +42 -0
  202. package/src/theme/Image/index.ts +8 -0
  203. package/src/theme/LightBox/index.ts +56 -0
  204. package/src/theme/Radio/index.ts +31 -0
  205. package/src/theme/RadioGroup/index.ts +14 -0
  206. package/src/theme/Search/index.ts +20 -0
  207. package/src/theme/ShareButton/index.tsx +76 -0
  208. package/src/theme/SidePanel/index.ts +9 -0
  209. package/src/theme/TextArea/index.ts +25 -0
  210. package/src/theme/Typography/index.tsx +44 -0
  211. package/src/theme/index.tsx +178 -0
  212. package/src/transitions/AccordionTransition.tsx +26 -0
  213. package/src/transitions/ModalTransition.tsx +38 -0
  214. package/src/transitions/RenderWithOpacity.tsx +25 -0
  215. package/src/transitions/RenderWithSlide.tsx +21 -0
  216. package/src/transitions/SidePanelTransition.tsx +30 -0
  217. package/src/types/components.ts +34 -0
  218. package/static/images/image.png +0 -0
  219. package/tailwind.config.js +14 -0
  220. package/tsconfig.json +20 -0
  221. package/tsconfig.lib.json +25 -0
  222. package/vite.config.ts +58 -0
  223. package/components/Accordion/components/AccordionItem.d.ts +0 -3
  224. package/components/Accordion/components/AriaAccordionItem.d.ts +0 -3
  225. package/components/Accordion/hooks/useAccordionState.d.ts +0 -10
  226. package/components/Accordion/index.d.ts +0 -3
  227. package/components/Alerts/components/AlertsCloseButton.d.ts +0 -4
  228. package/components/Alerts/components/AlertsItem.d.ts +0 -3
  229. package/components/Alerts/components/AlertsNavigationButton.d.ts +0 -8
  230. package/components/Alerts/components/AlertsSwiper.d.ts +0 -3
  231. package/components/Alerts/components/pagination/AlertsPagination.d.ts +0 -3
  232. package/components/Alerts/components/pagination/AlertsPaginationBullet.d.ts +0 -3
  233. package/components/Alerts/index.d.ts +0 -3
  234. package/components/Alerts/interface.d.ts +0 -41
  235. package/components/Box/index.d.ts +0 -5
  236. package/components/Box/interface.d.ts +0 -10
  237. package/components/Button/index.d.ts +0 -6
  238. package/components/Button/interface.d.ts +0 -20
  239. package/components/Calendar/RangeCalendar.d.ts +0 -3
  240. package/components/Calendar/components/CalendarCell.d.ts +0 -3
  241. package/components/Calendar/components/CalendarGrid.d.ts +0 -3
  242. package/components/Calendar/index.d.ts +0 -3
  243. package/components/Calendar/interface.d.ts +0 -32
  244. package/components/Carousel/index.d.ts +0 -3
  245. package/components/Carousel/interface.d.ts +0 -24
  246. package/components/Date/index.d.ts +0 -3
  247. package/components/Date/interface.d.ts +0 -6
  248. package/components/Dialog/index.d.ts +0 -2
  249. package/components/Dialog/interface.d.ts +0 -6
  250. package/components/DirectusImg/index.d.ts +0 -3
  251. package/components/DirectusImg/interface.d.ts +0 -13
  252. package/components/Icon/index.d.ts +0 -3
  253. package/components/Icon/interface.d.ts +0 -7
  254. package/components/Img/index.d.ts +0 -3
  255. package/components/Img/interface.d.ts +0 -6
  256. package/components/Lightbox/index.d.ts +0 -3
  257. package/components/Lightbox/interface.d.ts +0 -25
  258. package/components/Menu/Menu.d.ts +0 -3
  259. package/components/Menu/MenuSidePanel.d.ts +0 -3
  260. package/components/Menu/components/InnerContent.d.ts +0 -3
  261. package/components/Menu/components/MenuItems.d.ts +0 -3
  262. package/components/Menu/components/TabContainer.d.ts +0 -3
  263. package/components/Menu/interface.d.ts +0 -31
  264. package/components/Modal/components/ModalDialog.d.ts +0 -3
  265. package/components/Modal/components/ModalOverlay.d.ts +0 -3
  266. package/components/Modal/index.d.ts +0 -3
  267. package/components/Popover/index.d.ts +0 -3
  268. package/components/Popover/interface.d.ts +0 -21
  269. package/components/ShareButton/index.d.ts +0 -4
  270. package/components/ShareButton/interface.d.ts +0 -26
  271. package/components/ShareButton/utils/generateUtmTags.d.ts +0 -2
  272. package/components/ShareButton/utils/useFacebookShareUrl.d.ts +0 -2
  273. package/components/ShareButton/utils/useMailToShareUrl.d.ts +0 -2
  274. package/components/ShareButton/utils/useTwitterShareUrl.d.ts +0 -2
  275. package/components/ShareButton/utils/useWindow.d.ts +0 -5
  276. package/components/SidePanel/index.d.ts +0 -4
  277. package/components/SidePanel/interface.d.ts +0 -12
  278. package/components/TabList/components/TabPanel/TabPanel.d.ts +0 -4
  279. package/components/TabList/interface.d.ts +0 -18
  280. package/components/Typography/index.d.ts +0 -5
  281. package/components/Typography/interface.d.ts +0 -9
  282. package/components/WysiwygBlock/index.d.ts +0 -3
  283. package/components/WysiwygBlock/interface.d.ts +0 -5
  284. package/components/fields/Checkbox/Checkbox.interface.d.ts +0 -18
  285. package/components/fields/Checkbox/index.d.ts +0 -3
  286. package/components/fields/CheckboxGroup/components/CheckboxGroupItem/index.d.ts +0 -3
  287. package/components/fields/CheckboxGroup/index.d.ts +0 -3
  288. package/components/fields/CheckboxGroup/interface.d.ts +0 -13
  289. package/components/fields/DatePicker/DateRangePicker.d.ts +0 -3
  290. package/components/fields/DatePicker/components/CalendarPopover.d.ts +0 -2
  291. package/components/fields/DatePicker/components/DateField.d.ts +0 -4
  292. package/components/fields/DatePicker/index.d.ts +0 -3
  293. package/components/fields/DatePicker/interface.d.ts +0 -37
  294. package/components/fields/Radio/Radio.interface.d.ts +0 -26
  295. package/components/fields/Radio/index.d.ts +0 -4
  296. package/components/fields/RadioGroup/index.d.ts +0 -3
  297. package/components/fields/RadioGroup/interface.d.ts +0 -9
  298. package/components/fields/SearchField/index.d.ts +0 -3
  299. package/components/fields/SearchField/interface.d.ts +0 -9
  300. package/components/fields/Select/Select.d.ts +0 -4
  301. package/components/fields/Select/Select.interface.d.ts +0 -26
  302. package/components/fields/Select/components/Listbox.d.ts +0 -4
  303. package/components/fields/Select/components/Popover.d.ts +0 -3
  304. package/components/fields/Select/components/Popover.interface.d.ts +0 -13
  305. package/components/fields/SelectItem/SelectItem.d.ts +0 -3
  306. package/components/fields/TextArea/index.d.ts +0 -4
  307. package/components/fields/TextInputField/index.d.ts +0 -4
  308. package/components/fields/TextInputField/interface.d.ts +0 -24
  309. package/components/icons/ArrowDown.d.ts +0 -3
  310. package/components/icons/ArrowLeft.d.ts +0 -3
  311. package/components/icons/ArrowRight.d.ts +0 -3
  312. package/components/icons/Check.d.ts +0 -3
  313. package/components/icons/ChevronLeft.d.ts +0 -3
  314. package/components/icons/ChevronRight.d.ts +0 -3
  315. package/components/icons/CloseBtn.d.ts +0 -3
  316. package/components/icons/Facebook.d.ts +0 -3
  317. package/components/icons/FacebookColored.d.ts +0 -3
  318. package/components/icons/FacebookRounded.d.ts +0 -3
  319. package/components/icons/Globe.d.ts +0 -3
  320. package/components/icons/IconFallback.d.ts +0 -3
  321. package/components/icons/Instagram.d.ts +0 -3
  322. package/components/icons/InstagramColored.d.ts +0 -3
  323. package/components/icons/Link.d.ts +0 -3
  324. package/components/icons/LinkedIn.d.ts +0 -3
  325. package/components/icons/Mail.d.ts +0 -3
  326. package/components/icons/Plus.d.ts +0 -3
  327. package/components/icons/Search.d.ts +0 -3
  328. package/components/icons/Share.d.ts +0 -3
  329. package/components/icons/Twitter.d.ts +0 -3
  330. package/components/icons/TwitterColored.d.ts +0 -3
  331. package/components/icons/Upload.d.ts +0 -3
  332. package/components/icons/X.d.ts +0 -3
  333. package/components/icons/YouTube.d.ts +0 -3
  334. package/components/icons/YouTubeColored.d.ts +0 -3
  335. package/components/icons/index.d.ts +0 -24
  336. package/index.js +0 -110
  337. package/index.mjs +0 -12897
  338. package/providers/Accordion/index.d.ts +0 -4
  339. package/providers/Accordion/interface.d.ts +0 -12
  340. package/providers/Alerts/index.d.ts +0 -4
  341. package/providers/Alerts/interface.d.ts +0 -9
  342. package/providers/CheckboxGroup/index.d.ts +0 -5
  343. package/providers/Client/index.d.ts +0 -4
  344. package/providers/Client/interface.d.ts +0 -10
  345. package/providers/Menu/index.d.ts +0 -4
  346. package/providers/Menu/interface.d.ts +0 -28
  347. package/providers/RadioGroup/RadioGroup.d.ts +0 -5
  348. package/providers/RadioGroup/RadioGroup.interface.d.ts +0 -7
  349. package/providers/SidePanel/index.d.ts +0 -4
  350. package/providers/SidePanel/interface.d.ts +0 -23
  351. package/providers/Theme/hooks.d.ts +0 -3
  352. package/providers/Theme/index.d.ts +0 -10
  353. package/providers/Theme/interface.d.ts +0 -24
  354. package/providers/Theme/utils.d.ts +0 -2
  355. package/providers/UserSearchQuery/index.d.ts +0 -4
  356. package/providers/UserSearchQuery/interface.d.ts +0 -10
  357. package/style.css +0 -1
  358. package/theme/Accordion/index.d.ts +0 -274
  359. package/theme/Alerts/index.d.ts +0 -1167
  360. package/theme/Box/index.d.ts +0 -214
  361. package/theme/Button/index.d.ts +0 -121
  362. package/theme/Calendar/index.d.ts +0 -366
  363. package/theme/Carousel/index.d.ts +0 -9
  364. package/theme/Checkbox/index.d.ts +0 -159
  365. package/theme/CheckboxGroup/index.d.ts +0 -30
  366. package/theme/DatePicker/index.d.ts +0 -43
  367. package/theme/Image/index.d.ts +0 -3
  368. package/theme/LightBox/index.d.ts +0 -455
  369. package/theme/Radio/index.d.ts +0 -108
  370. package/theme/RadioGroup/index.d.ts +0 -30
  371. package/theme/Search/index.d.ts +0 -30
  372. package/theme/ShareButton/index.d.ts +0 -174
  373. package/theme/SidePanel/index.d.ts +0 -3
  374. package/theme/TextArea/index.d.ts +0 -29
  375. package/theme/Typography/index.d.ts +0 -233
  376. package/theme/index.d.ts +0 -5
  377. package/transitions/AccordionTransition.d.ts +0 -3
  378. package/transitions/ModalTransition.d.ts +0 -7
  379. package/transitions/RenderWithOpacity.d.ts +0 -3
  380. package/transitions/RenderWithSlide.d.ts +0 -7
  381. package/transitions/SidePanelTransition.d.ts +0 -7
  382. package/types/components.d.ts +0 -28
@@ -0,0 +1,282 @@
1
+ import { Canvas, Meta, Story } from '@storybook/addon-docs'
2
+ import { ArgTypes } from '@storybook/blocks'
3
+ import Alerts from '.'
4
+ import Box from '../Box'
5
+ import Typography from '../Typography'
6
+
7
+ <Meta
8
+ title="Base components/Alerts"
9
+ parameters={{
10
+ layout: 'fullscreen',
11
+ controls: {
12
+ include: ['alerts']
13
+ }
14
+ }}
15
+ component={Alerts}
16
+ args={{
17
+ a11y: {
18
+ nextSlideMessage: 'Next alert',
19
+ prevSlideMessage: 'Previous alert',
20
+ paginationBulletMessage: 'Navigate to slide number {{index}}'
21
+ },
22
+ closeButtonAriaLabel: 'Close alerts',
23
+ onOpenChange: (isOpen) => console.log(`Alerts component was ${isOpen ? 'opened' : 'closed'}`),
24
+ onNavigationPrev: () => console.log('Navigated to previous slide'),
25
+ onNavigationNext: () => console.log('Navigated to next slide'),
26
+ }}
27
+ argTypes={{
28
+ closeButton: {
29
+ table: {
30
+ defaultValue: {
31
+ summary: 'AlertsCloseButton'
32
+ }
33
+ }
34
+ },
35
+ a11y: {
36
+ description: "React Swiper's accessibility module parameters"
37
+ },
38
+ children: {
39
+ description: 'Function looping through every alert and passing the current alert. Can be used for rendering all alerts wrapping `AlertsItem` in another component',
40
+ table: {
41
+ type: {
42
+ summary: '(alert: TAlertsItem) => React.ReactNode'
43
+ },
44
+ defaultValue: {
45
+ summary: '(alert: TAlertsItem) => <AlertsItem {...alert />}'
46
+ }
47
+ }
48
+ },
49
+ prevButton: {
50
+ description: 'Custom previous button component for the carousel. Falls back to an arrow button',
51
+ table: {
52
+ defaultValue: {
53
+ summary: 'AlertsNavigationButton'
54
+ }
55
+ }
56
+ },
57
+ nextButton: {
58
+ description: 'Custom previous button component for the carousel. Falls back to an arrow button',
59
+ table: {
60
+ defaultValue: {
61
+ summary: 'AlertsNavigationButton'
62
+ }
63
+ }
64
+ },
65
+ setOpen: {
66
+ description: 'For controlled states'
67
+ },
68
+ onOpenChange: {
69
+ table: {
70
+ type: {
71
+ summary: '(isOpen) => void'
72
+ }
73
+ },
74
+ description: 'Triggered when the alerts are closed or opened'
75
+ },
76
+ modules: {
77
+ table: {
78
+ defaultValue: {
79
+ summary: "['A11y', 'Keyboard']"
80
+ },
81
+ type: {
82
+ summary: 'Array<A11y | Autoplay | Controller | EffectCoverflow | EffectCube | EffectFade | EffectFlip | EffectCreative | EffectCards | HashNavigation | History | Keyboard | Lazy | Mousewheel | Navigation | Pagination | Parallax | Scrollbar | Thumbs | Virtual | Zoom | FreeMode | Grid | Manipulation>'
83
+ }
84
+ },
85
+ description: 'String list of modules the swiper will automatically import'
86
+ }
87
+ }}
88
+ />
89
+
90
+ export const Template = (args) => (
91
+ <Alerts {...args} />
92
+ )
93
+
94
+ # Alerts
95
+
96
+ ### A closable and navigable carousel showcasing multiple alerts
97
+
98
+ ## Props
99
+
100
+ <ArgTypes include={[
101
+ 'alerts',
102
+ 'onOpenChange',
103
+ 'a11y',
104
+ 'closeButtonAriaLabel',
105
+ 'setOpen',
106
+ 'nextButton',
107
+ 'prevButton',
108
+ 'closeButton',
109
+ 'transitionComponent',
110
+ 'themeName',
111
+ 'tokens',
112
+ 'customTheme',
113
+ 'as',
114
+ 'onSwiper',
115
+ 'onNavigationPrev',
116
+ 'onNavigationNext',
117
+ 'children',
118
+ 'modules',
119
+ ]} />
120
+
121
+ ## Showcase
122
+
123
+ ### Single alert
124
+
125
+ <Canvas>
126
+ <Story
127
+ name="Single alert"
128
+ args={{
129
+ alerts: [{
130
+ id: '1',
131
+ title: 'Alert 1 title',
132
+ 'aria-label': 'Alert 1 aria',
133
+ icon: 'X',
134
+ content: (
135
+ <>
136
+ <Box>
137
+ <Typography tokens={{ size: 'h4' }}>This is alert 1 large content</Typography>
138
+ </Box>
139
+ <Box>
140
+ <Typography tokens={{ size: 'xs' }}>This is alert 1 small content</Typography>
141
+ </Box>
142
+ </>
143
+ )
144
+ }]
145
+ }}
146
+ >
147
+ {Template.bind({})}
148
+ </Story>
149
+ </Canvas>
150
+
151
+ ### Navigation
152
+
153
+ <Canvas>
154
+ <Story
155
+ name="Navigation"
156
+ args={{
157
+ modules: ['Navigation'],
158
+ alerts: [
159
+ {
160
+ id: '1',
161
+ title: 'Alert 1 title',
162
+ 'aria-label': 'Alert 1 aria',
163
+ icon: 'X',
164
+ content: (
165
+ <>
166
+ <Box>
167
+ <Typography tokens={{ size: 'h4' }}>This is alert 1 large content</Typography>
168
+ </Box>
169
+ <Box>
170
+ <Typography tokens={{ size: 'xs' }}>This is alert 1 small content</Typography>
171
+ </Box>
172
+ </>
173
+ )
174
+ },
175
+ {
176
+ button: {
177
+ href: '#',
178
+ as: 'a',
179
+ children: 'Consulter toutes les alertes'
180
+ },
181
+ id: '2',
182
+ title: 'Alert 2 title',
183
+ 'aria-label': 'Alert 2 aria',
184
+ icon: 'YouTube',
185
+ },
186
+ {
187
+ id: '3',
188
+ title: 'Alert 3 title',
189
+ 'aria-label': 'Alert 3 aria',
190
+ icon: 'Mail',
191
+ },
192
+ ]
193
+ }}
194
+ >
195
+ {Template.bind({})}
196
+ </Story>
197
+ </Canvas>
198
+
199
+ ### Pagination
200
+
201
+ <Canvas>
202
+ <Story
203
+ name="Pagination"
204
+ args={{
205
+ modules: ['Pagination'],
206
+ alerts: [
207
+ {
208
+ id: '1',
209
+ 'aria-label': 'Alert 1 aria',
210
+ icon: 'X',
211
+ content: (
212
+ <>
213
+ <Box>
214
+ <Typography tokens={{ size: 'h4' }}>This is alert 1 large content</Typography>
215
+ </Box>
216
+ <Box>
217
+ <Typography tokens={{ size: 'xs' }}>This is alert 1 small content</Typography>
218
+ </Box>
219
+ </>
220
+ )
221
+ },
222
+ {
223
+ id: '2',
224
+ title: 'Alert 2 title',
225
+ 'aria-label': 'Alert 2 aria',
226
+ icon: 'YouTube',
227
+ },
228
+ {
229
+ id: '3',
230
+ title: 'Alert 3 title',
231
+ 'aria-label': 'Alert 3 aria',
232
+ icon: 'Mail',
233
+ },
234
+ ]
235
+ }}
236
+ >
237
+ {Template.bind({})}
238
+ </Story>
239
+ </Canvas>
240
+
241
+ ### Pagination & Navigation
242
+
243
+ <Canvas>
244
+ <Story
245
+ name="Pagination & Navigation"
246
+ args={{
247
+ modules: ['Pagination', 'Navigation'],
248
+ alerts: [
249
+ {
250
+ id: '1',
251
+ title: 'Alert 1 title',
252
+ 'aria-label': 'Alert 1 aria',
253
+ icon: 'X',
254
+ content: (
255
+ <>
256
+ <Box>
257
+ <Typography tokens={{ size: 'h4' }}>This is alert 1 large content</Typography>
258
+ </Box>
259
+ <Box>
260
+ <Typography tokens={{ size: 'xs' }}>This is alert 1 small content</Typography>
261
+ </Box>
262
+ </>
263
+ )
264
+ },
265
+ {
266
+ id: '2',
267
+ title: 'Alert 2 title',
268
+ 'aria-label': 'Alert 2 aria',
269
+ icon: 'YouTube',
270
+ },
271
+ {
272
+ id: '3',
273
+ title: 'Alert 3 title',
274
+ 'aria-label': 'Alert 3 aria',
275
+ icon: 'Mail',
276
+ },
277
+ ]
278
+ }}
279
+ >
280
+ {Template.bind({})}
281
+ </Story>
282
+ </Canvas>
@@ -0,0 +1,20 @@
1
+ import type { Ref } from 'react'
2
+ import { forwardRef } from 'react'
3
+ import { ButtonWithForwardRef } from '../../Button'
4
+ import type { TButtonProps } from '../../Button/interface'
5
+ import Icon from '../../Icon'
6
+ import CloseBtn from '../../icons/CloseBtn'
7
+
8
+ const AlertsCloseButton = forwardRef((props: TButtonProps, ref: Ref<HTMLButtonElement & HTMLAnchorElement>) => {
9
+ const { themeName = 'alerts.closeBtn', ...rest } = props
10
+
11
+ return (
12
+ <ButtonWithForwardRef ref={ref} themeName={themeName} {...rest}>
13
+ <Icon icon={<CloseBtn />} />
14
+ </ButtonWithForwardRef>
15
+ )
16
+ })
17
+
18
+ AlertsCloseButton.displayName = 'AlertsCloseButton'
19
+
20
+ export default AlertsCloseButton
@@ -0,0 +1,39 @@
1
+ 'use client'
2
+
3
+ import React from 'react'
4
+ import { useSwiperSlide } from 'swiper/react'
5
+ import Box from '../../Box'
6
+ import Button from '../../Button'
7
+ import Icon from '../../Icon'
8
+ import type { TAlertsItemProps } from '../interface'
9
+
10
+ const AlertsItem = (props: TAlertsItemProps) => {
11
+ const { title, button, content, themeName = 'alerts.item', tokens, icon, id } = props
12
+ const { isActive } = useSwiperSlide()
13
+
14
+ if (!title && !button && !content && !icon) return null
15
+
16
+ return (
17
+ <>
18
+ {icon && <Icon icon={icon} themeName={`${themeName}.icon`} tokens={tokens} />}
19
+ {(title || button || content) && (
20
+ <Box themeName={`${themeName}.container`} tokens={tokens}>
21
+ {title && (
22
+ <Box as="span" themeName={`${themeName}.title`} tokens={tokens} {...{ id }}>
23
+ {title}
24
+ </Box>
25
+ )}
26
+ {button && (
27
+ <Button tabIndex={isActive ? 0 : -1} themeName={`${themeName}.button`} tokens={tokens} {...button} />
28
+ )}
29
+ {content &&
30
+ (React.isValidElement(content)
31
+ ? React.cloneElement(content, { ...content.props, themeName: `${themeName}.content`, tokens })
32
+ : content)}
33
+ </Box>
34
+ )}
35
+ </>
36
+ )
37
+ }
38
+
39
+ export default AlertsItem
@@ -0,0 +1,71 @@
1
+ import type { Ref } from 'react'
2
+ import { forwardRef } from 'react'
3
+ import { FocusRing, usePress } from 'react-aria'
4
+ import { useAlertsController } from '../../../providers/Alerts'
5
+ import { ButtonWithForwardRef } from '../../Button'
6
+ import type { TButtonProps } from '../../Button/interface'
7
+ import Icon from '../../Icon'
8
+
9
+ type TAlertsNavigationButtonProps = TButtonProps & {
10
+ onSubmit?: () => void
11
+ }
12
+
13
+ const AlertsNavigationButton = forwardRef(
14
+ (props: TAlertsNavigationButtonProps, ref: Ref<HTMLButtonElement & HTMLAnchorElement>) => {
15
+ const { themeName = 'alerts.navigationBtn', tokens, customTheme, children, onSubmit, ...rest } = props
16
+ const { isDisabled } = rest
17
+
18
+ const { pressProps } = usePress({
19
+ onPress: () => onSubmit?.(),
20
+ })
21
+
22
+ return (
23
+ <FocusRing within focusRingClass="has-focus-ring">
24
+ <ButtonWithForwardRef
25
+ themeName={themeName}
26
+ tokens={tokens}
27
+ ref={ref}
28
+ {...pressProps}
29
+ {...rest}
30
+ {...{ 'aria-disabled': isDisabled }}
31
+ >
32
+ {children}
33
+ </ButtonWithForwardRef>
34
+ </FocusRing>
35
+ )
36
+ },
37
+ )
38
+
39
+ export const AlertsNextNavigationButton = forwardRef(
40
+ (props: TButtonProps, ref: Ref<HTMLButtonElement & HTMLAnchorElement>) => {
41
+ const { controller } = useAlertsController()
42
+
43
+ const disabled = controller?.activeIndex === (controller?.slides?.length ?? 1) - 1
44
+
45
+ return (
46
+ <AlertsNavigationButton onSubmit={() => controller?.slideNext()} {...props} ref={ref} isDisabled={disabled}>
47
+ <Icon icon="ArrowRight" />
48
+ </AlertsNavigationButton>
49
+ )
50
+ },
51
+ )
52
+
53
+ export const AlertsPrevNavigationButton = forwardRef(
54
+ (props: TButtonProps, ref: Ref<HTMLButtonElement & HTMLAnchorElement>) => {
55
+ const { controller } = useAlertsController()
56
+
57
+ const disabled = controller?.activeIndex === 0
58
+
59
+ return (
60
+ <AlertsNavigationButton onSubmit={() => controller?.slidePrev()} {...props} ref={ref} isDisabled={disabled}>
61
+ <Icon icon="ArrowLeft" />
62
+ </AlertsNavigationButton>
63
+ )
64
+ },
65
+ )
66
+
67
+ AlertsNavigationButton.displayName = 'AlertsNavigationButton'
68
+ AlertsNextNavigationButton.displayName = 'AlertsNextNavigationButton'
69
+ AlertsPrevNavigationButton.displayName = 'AlertsPrevNavigationButton'
70
+
71
+ export default AlertsNavigationButton
@@ -0,0 +1,125 @@
1
+ import { useRef, useState } from 'react'
2
+ import slugify from 'slugify'
3
+ import * as swiperModules from 'swiper/modules'
4
+ import type { SwiperClass } from 'swiper/react'
5
+ import { Swiper, SwiperSlide } from 'swiper/react'
6
+ import { AlertsControllerContextProvider } from '../../../providers/Alerts'
7
+ import useThemeContext from '../../../providers/Theme/hooks'
8
+ import type { TAlertsComponentProps, TAlertsProps } from '../interface'
9
+ import AlertsItem from './AlertsItem'
10
+ import 'swiper/css'
11
+ import 'swiper/css/pagination'
12
+ import { AlertsNextNavigationButton, AlertsPrevNavigationButton } from './AlertsNavigationButton'
13
+ import AlertsPagination from './pagination/AlertsPagination'
14
+
15
+ const AlertsSwiper = (props: TAlertsProps) => {
16
+ const {
17
+ themeName,
18
+ tokens,
19
+ customTheme,
20
+ children = (itemProps) => <AlertsItem {...itemProps} />,
21
+ alerts,
22
+ a11y,
23
+ slidesPerView = 1,
24
+ spaceBetween = 50,
25
+ modules,
26
+ prevButton: PrevButton = AlertsPrevNavigationButton,
27
+ nextButton: NextButton = AlertsNextNavigationButton,
28
+ ...rest
29
+ } = props
30
+ const prevButtonRef = useRef(null)
31
+ const nextButtonRef = useRef(null)
32
+
33
+ const {
34
+ itemRoleDescriptionMessage = 'slide',
35
+ slideRole = 'group',
36
+ containerRoleDescriptionMessage = 'carousel',
37
+ paginationGroupLabel = 'pagination',
38
+ } = a11y ?? {}
39
+
40
+ const itemWrapperTheme = useThemeContext(`${themeName}.item.wrapper`, tokens, customTheme)
41
+ const swiperTheme = useThemeContext(`${themeName}.swiper.swiper`, tokens, customTheme)
42
+ const swiperWrapperTheme = useThemeContext(`${themeName}.swiper.wrapper`, tokens, customTheme)
43
+
44
+ const defaultModules: TAlertsComponentProps['modules'] = ['A11y']
45
+
46
+ const importedModules = [...(modules?.filter((module) => module !== 'Pagination') ?? []), ...defaultModules].map(
47
+ (module) => swiperModules[module],
48
+ )
49
+
50
+ const hasNavigation = modules?.includes('Navigation')
51
+ const hasPagination = modules?.includes('Pagination')
52
+
53
+ const [controller, setController] = useState<SwiperClass>()
54
+ const [activeIndex, setActiveIndex] = useState<number>(0)
55
+
56
+ return (
57
+ <AlertsControllerContextProvider controller={controller}>
58
+ {hasNavigation && (
59
+ <PrevButton
60
+ themeName={`${themeName}.navigation.button`}
61
+ tokens={{ ...tokens, order: 'prev' }}
62
+ ref={prevButtonRef}
63
+ aria-label={a11y?.prevSlideMessage}
64
+ />
65
+ )}
66
+ {hasNavigation && (
67
+ <NextButton
68
+ themeName={`${themeName}.navigation.button`}
69
+ tokens={{ ...tokens, order: 'next' }}
70
+ ref={nextButtonRef}
71
+ aria-label={a11y?.nextSlideMessage}
72
+ />
73
+ )}
74
+ {hasPagination && (
75
+ <AlertsPagination
76
+ themeName={`${themeName}.pagination`}
77
+ tokens={tokens}
78
+ activeIndex={activeIndex}
79
+ alerts={alerts}
80
+ paginationGroupLabel={paginationGroupLabel}
81
+ />
82
+ )}
83
+ <Swiper
84
+ tabIndex={0}
85
+ {...rest}
86
+ onSwiper={(c) => {
87
+ setController(c)
88
+ setActiveIndex(c.activeIndex)
89
+ }}
90
+ onSlideChange={(c) => setActiveIndex(c.activeIndex)}
91
+ role="group"
92
+ aria-roledescription={containerRoleDescriptionMessage ?? undefined}
93
+ slidesPerView={slidesPerView}
94
+ spaceBetween={spaceBetween}
95
+ className={swiperTheme}
96
+ wrapperClass={swiperWrapperTheme}
97
+ modules={importedModules}
98
+ keyboard={{
99
+ enabled: true,
100
+ onlyInViewport: false,
101
+ }}
102
+ a11y={a11y}
103
+ >
104
+ {alerts.map((alert) => {
105
+ const { id, title, ariaLabel } = alert
106
+
107
+ return (
108
+ <SwiperSlide
109
+ key={id}
110
+ className={itemWrapperTheme}
111
+ {...(title ? { 'aria-labelledby': id } : { 'aria-label': ariaLabel })}
112
+ {...{ id: slugify(`${id}-${title}`) }}
113
+ role={slideRole}
114
+ aria-roledescription={itemRoleDescriptionMessage ?? undefined}
115
+ >
116
+ {children({ ...alert, themeName: `${themeName}.item`, tokens })}
117
+ </SwiperSlide>
118
+ )
119
+ })}
120
+ </Swiper>
121
+ </AlertsControllerContextProvider>
122
+ )
123
+ }
124
+
125
+ export default AlertsSwiper
@@ -0,0 +1,32 @@
1
+ import { FocusScope } from 'react-aria'
2
+ import Box from '../../../Box'
3
+ import type { TAlertsPaginationProps } from '../../interface'
4
+ import AlertsPaginationBullet from './AlertsPaginationBullet'
5
+
6
+ const AlertsPagination = (props: TAlertsPaginationProps) => {
7
+ const { themeName, tokens, alerts, activeIndex, paginationGroupLabel } = props
8
+
9
+ return (
10
+ <Box
11
+ as="div"
12
+ themeName={`${themeName}.wrapper`}
13
+ tokens={tokens}
14
+ {...{ role: 'group', 'aria-label': paginationGroupLabel }}
15
+ >
16
+ <FocusScope>
17
+ {alerts.map((_, index) => (
18
+ <AlertsPaginationBullet
19
+ key={JSON.stringify(_)}
20
+ index={index}
21
+ activeIndex={activeIndex}
22
+ alerts={alerts}
23
+ themeName={themeName}
24
+ tokens={tokens}
25
+ />
26
+ ))}
27
+ </FocusScope>
28
+ </Box>
29
+ )
30
+ }
31
+
32
+ export default AlertsPagination
@@ -0,0 +1,61 @@
1
+ import { useAlertsController } from 'libs/stack/stack-ui/src/providers/Alerts'
2
+ import { useFocusManager, useKeyboard, usePress } from 'react-aria'
3
+ import slugify from 'slugify'
4
+ import Button from '../../../Button'
5
+ import type { TAlertsPaginationBulletProps } from '../../interface'
6
+
7
+ const AlertsPaginationBullet = (props: TAlertsPaginationBulletProps) => {
8
+ const { themeName, tokens, alerts, activeIndex, index } = props
9
+
10
+ const { controller } = useAlertsController()
11
+
12
+ const focusManager = useFocusManager()
13
+ const prevIndex = index === 0 ? alerts.length - 1 : index - 1
14
+ const nextIndex = index === alerts.length - 1 ? 0 : index + 1
15
+
16
+ const { keyboardProps } = useKeyboard({
17
+ onKeyUp: (e) => {
18
+ if (e.key === 'ArrowLeft') {
19
+ e.preventDefault()
20
+ focusManager?.focusPrevious({ wrap: true })
21
+ controller?.slideTo(prevIndex)
22
+ }
23
+
24
+ if (e.key === 'ArrowRight') {
25
+ e.preventDefault()
26
+ focusManager?.focusNext({ wrap: true })
27
+ controller?.slideTo(nextIndex)
28
+ }
29
+ },
30
+ })
31
+
32
+ const { pressProps } = usePress({
33
+ onPress: () => controller?.slideTo(index),
34
+ })
35
+
36
+ const alert = alerts[index]
37
+ const isActive = index === activeIndex
38
+ const { title, id } = alert
39
+
40
+ const hasTitle = title && title.length > 0
41
+
42
+ return (
43
+ <Button
44
+ as="button"
45
+ {...{
46
+ tabIndex: 0,
47
+ role: 'button',
48
+ 'aria-current': isActive ? 'true' : 'false',
49
+ 'aria-disabled': isActive,
50
+ 'aria-label': !hasTitle ? `${index + 1} / ${alerts.length}` : undefined,
51
+ 'aria-labelledby': hasTitle ? slugify(`${id}-${title}`) : undefined,
52
+ }}
53
+ {...keyboardProps}
54
+ {...pressProps}
55
+ themeName={`${themeName}.bullet`}
56
+ tokens={{ ...tokens, active: isActive }}
57
+ />
58
+ )
59
+ }
60
+
61
+ export default AlertsPaginationBullet
@@ -0,0 +1,54 @@
1
+ 'use client'
2
+
3
+ import { useRef } from 'react'
4
+ import { useOverlayTriggerState } from 'react-stately'
5
+ import RenderWithOpacity from '../../transitions/RenderWithOpacity'
6
+ import Box from '../Box'
7
+ import useOverlayHook from '../Lightbox/hooks/overlay'
8
+ import AlertsCloseButton from './components/AlertsCloseButton'
9
+ import AlertsSwiper from './components/AlertsSwiper'
10
+ import type { TAlertsProps } from './interface'
11
+
12
+ const Alerts = (props: TAlertsProps) => {
13
+ const {
14
+ themeName = 'alerts',
15
+ tokens,
16
+ customTheme,
17
+ defaultOpen = true,
18
+ closeButton: CloseButton = AlertsCloseButton,
19
+ transitionComponent: TransitionComponent = RenderWithOpacity,
20
+ closeButtonAriaLabel,
21
+ isOpen,
22
+ onOpenChange,
23
+ setOpen,
24
+ ...rest
25
+ } = props
26
+
27
+ const triggerRef = useRef(null)
28
+
29
+ const state = useOverlayTriggerState({ ...props, defaultOpen })
30
+
31
+ const { triggerProps, overlayProps } = useOverlayHook({ ...props, type: 'dialog' }, state, triggerRef)
32
+
33
+ return (
34
+ <TransitionComponent
35
+ {...overlayProps}
36
+ role="alert"
37
+ themeName={`${themeName}.wrapper`}
38
+ tokens={tokens}
39
+ isVisible={state.isOpen}
40
+ >
41
+ <CloseButton
42
+ ref={triggerRef}
43
+ themeName={`${themeName}.closeBtn`}
44
+ aria-label={closeButtonAriaLabel}
45
+ {...triggerProps}
46
+ />
47
+ <Box themeName={`${themeName}.container`} tokens={tokens}>
48
+ <AlertsSwiper themeName={themeName} tokens={tokens} {...rest} />
49
+ </Box>
50
+ </TransitionComponent>
51
+ )
52
+ }
53
+
54
+ export default Alerts