@lumx/react 3.20.1-alpha.12 → 3.20.1-alpha.14

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 (721) hide show
  1. package/_internal/index.js +236 -0
  2. package/_internal/index.js.map +1 -0
  3. package/index.d.ts +1 -1
  4. package/index.js +14440 -65
  5. package/index.js.map +1 -1
  6. package/package.json +11 -3
  7. package/src/components/alert-dialog/AlertDialog.stories.tsx +127 -0
  8. package/src/components/alert-dialog/AlertDialog.test.tsx +34 -0
  9. package/src/components/alert-dialog/AlertDialog.tsx +189 -0
  10. package/src/components/alert-dialog/index.ts +1 -0
  11. package/src/components/autocomplete/Autocomplete.stories.tsx +75 -0
  12. package/src/components/autocomplete/Autocomplete.test.tsx +99 -0
  13. package/src/components/autocomplete/Autocomplete.tsx +294 -0
  14. package/src/components/autocomplete/AutocompleteMultiple.stories.tsx +167 -0
  15. package/src/components/autocomplete/AutocompleteMultiple.test.tsx +61 -0
  16. package/src/components/autocomplete/AutocompleteMultiple.tsx +156 -0
  17. package/src/components/autocomplete/__mockData__/index.ts +39 -0
  18. package/src/components/autocomplete/index.ts +2 -0
  19. package/src/components/avatar/Avatar.stories.tsx +119 -0
  20. package/src/components/avatar/Avatar.test.tsx +32 -0
  21. package/src/components/avatar/Avatar.tsx +114 -0
  22. package/src/components/avatar/index.ts +1 -0
  23. package/src/components/badge/Badge.stories.tsx +69 -0
  24. package/src/components/badge/Badge.test.tsx +45 -0
  25. package/src/components/badge/Badge.tsx +58 -0
  26. package/src/components/badge/BadgeWrapper.stories.tsx +75 -0
  27. package/src/components/badge/BadgeWrapper.test.tsx +47 -0
  28. package/src/components/badge/BadgeWrapper.tsx +37 -0
  29. package/src/components/badge/index.ts +2 -0
  30. package/src/components/button/Button.stories.tsx +355 -0
  31. package/src/components/button/Button.test.tsx +125 -0
  32. package/src/components/button/Button.tsx +101 -0
  33. package/src/components/button/ButtonGroup.stories.tsx +52 -0
  34. package/src/components/button/ButtonGroup.test.tsx +41 -0
  35. package/src/components/button/ButtonGroup.tsx +50 -0
  36. package/src/components/button/ButtonRoot.tsx +163 -0
  37. package/src/components/button/IconButton.stories.tsx +52 -0
  38. package/src/components/button/IconButton.test.tsx +66 -0
  39. package/src/components/button/IconButton.tsx +91 -0
  40. package/src/components/button/index.ts +4 -0
  41. package/src/components/checkbox/Checkbox.stories.tsx +64 -0
  42. package/src/components/checkbox/Checkbox.test.tsx +154 -0
  43. package/src/components/checkbox/Checkbox.tsx +164 -0
  44. package/src/components/checkbox/index.ts +1 -0
  45. package/src/components/chip/Chip.stories.tsx +164 -0
  46. package/src/components/chip/Chip.test.tsx +243 -0
  47. package/src/components/chip/Chip.tsx +168 -0
  48. package/src/components/chip/ChipGroup.stories.tsx +47 -0
  49. package/src/components/chip/ChipGroup.test.tsx +37 -0
  50. package/src/components/chip/ChipGroup.tsx +60 -0
  51. package/src/components/chip/index.ts +2 -0
  52. package/src/components/comment-block/CommentBlock.stories.tsx +91 -0
  53. package/src/components/comment-block/CommentBlock.test.tsx +28 -0
  54. package/src/components/comment-block/CommentBlock.tsx +172 -0
  55. package/src/components/comment-block/index.ts +1 -0
  56. package/src/components/date-picker/DatePicker.stories.tsx +118 -0
  57. package/src/components/date-picker/DatePicker.test.tsx +34 -0
  58. package/src/components/date-picker/DatePicker.tsx +52 -0
  59. package/src/components/date-picker/DatePickerControlled.test.tsx +91 -0
  60. package/src/components/date-picker/DatePickerControlled.tsx +259 -0
  61. package/src/components/date-picker/DatePickerField.stories.tsx +100 -0
  62. package/src/components/date-picker/DatePickerField.test.tsx +70 -0
  63. package/src/components/date-picker/DatePickerField.tsx +135 -0
  64. package/src/components/date-picker/constants.ts +11 -0
  65. package/src/components/date-picker/index.ts +4 -0
  66. package/src/components/date-picker/types.ts +28 -0
  67. package/src/components/dialog/Dialog.stories.tsx +318 -0
  68. package/src/components/dialog/Dialog.test.tsx +97 -0
  69. package/src/components/dialog/Dialog.tsx +288 -0
  70. package/src/components/dialog/index.ts +1 -0
  71. package/src/components/divider/Divider.test.tsx +51 -0
  72. package/src/components/divider/Divider.tsx +50 -0
  73. package/src/components/divider/index.ts +1 -0
  74. package/src/components/drag-handle/DragHandle.test.tsx +36 -0
  75. package/src/components/drag-handle/DragHandle.tsx +51 -0
  76. package/src/components/drag-handle/index.ts +1 -0
  77. package/src/components/dropdown/Dropdown.stories.tsx +31 -0
  78. package/src/components/dropdown/Dropdown.test.tsx +66 -0
  79. package/src/components/dropdown/Dropdown.tsx +186 -0
  80. package/src/components/dropdown/index.ts +1 -0
  81. package/src/components/expansion-panel/ExpansionPanel.stories.tsx +91 -0
  82. package/src/components/expansion-panel/ExpansionPanel.test.tsx +185 -0
  83. package/src/components/expansion-panel/ExpansionPanel.tsx +195 -0
  84. package/src/components/expansion-panel/index.ts +1 -0
  85. package/src/components/flag/Flag.stories.tsx +48 -0
  86. package/src/components/flag/Flag.test.tsx +62 -0
  87. package/src/components/flag/Flag.tsx +52 -0
  88. package/src/components/flag/index.ts +1 -0
  89. package/src/components/flex-box/FlexBox.stories.tsx +156 -0
  90. package/src/components/flex-box/FlexBox.test.tsx +24 -0
  91. package/src/components/flex-box/FlexBox.tsx +100 -0
  92. package/src/components/flex-box/index.ts +1 -0
  93. package/src/components/generic-block/GenericBlock.stories.jsx +128 -0
  94. package/src/components/generic-block/GenericBlock.test.tsx +156 -0
  95. package/src/components/generic-block/GenericBlock.tsx +225 -0
  96. package/src/components/generic-block/constants.ts +9 -0
  97. package/src/components/generic-block/index.ts +2 -0
  98. package/src/components/grid/Grid.tsx +83 -0
  99. package/src/components/grid/GridItem.tsx +55 -0
  100. package/src/components/grid/index.ts +2 -0
  101. package/src/components/grid-column/GridColumn.stories.tsx +45 -0
  102. package/src/components/grid-column/GridColumn.test.jsx +56 -0
  103. package/src/components/grid-column/GridColumn.tsx +83 -0
  104. package/src/components/grid-column/index.ts +1 -0
  105. package/src/components/heading/Heading.stories.tsx +69 -0
  106. package/src/components/heading/Heading.test.tsx +82 -0
  107. package/src/components/heading/Heading.tsx +65 -0
  108. package/src/components/heading/HeadingLevelProvider.tsx +30 -0
  109. package/src/components/heading/constants.ts +16 -0
  110. package/src/components/heading/context.tsx +13 -0
  111. package/src/components/heading/index.ts +3 -0
  112. package/src/components/heading/useHeadingLevel.tsx +8 -0
  113. package/src/components/icon/Icon.stories.tsx +73 -0
  114. package/src/components/icon/Icon.test.tsx +125 -0
  115. package/src/components/icon/Icon.tsx +133 -0
  116. package/src/components/icon/index.ts +1 -0
  117. package/src/components/image-block/ImageBlock.stories.tsx +117 -0
  118. package/src/components/image-block/ImageBlock.test.tsx +58 -0
  119. package/src/components/image-block/ImageBlock.tsx +142 -0
  120. package/src/components/image-block/ImageCaption.tsx +115 -0
  121. package/src/components/image-block/index.ts +1 -0
  122. package/src/components/image-lightbox/ImageLightbox.stories.tsx +160 -0
  123. package/src/components/image-lightbox/ImageLightbox.test.tsx +254 -0
  124. package/src/components/image-lightbox/ImageLightbox.tsx +90 -0
  125. package/src/components/image-lightbox/constants.ts +11 -0
  126. package/src/components/image-lightbox/index.ts +2 -0
  127. package/src/components/image-lightbox/internal/ImageSlide.tsx +107 -0
  128. package/src/components/image-lightbox/internal/ImageSlideshow.tsx +164 -0
  129. package/src/components/image-lightbox/internal/useAnimateScroll.ts +55 -0
  130. package/src/components/image-lightbox/internal/usePointerZoom.ts +148 -0
  131. package/src/components/image-lightbox/types.ts +48 -0
  132. package/src/components/image-lightbox/useImageLightbox.tsx +141 -0
  133. package/src/components/inline-list/InlineList.stories.tsx +77 -0
  134. package/src/components/inline-list/InlineList.test.tsx +52 -0
  135. package/src/components/inline-list/InlineList.tsx +96 -0
  136. package/src/components/inline-list/index.ts +1 -0
  137. package/src/components/input-helper/InputHelper.stories.tsx +35 -0
  138. package/src/components/input-helper/InputHelper.test.tsx +55 -0
  139. package/src/components/input-helper/InputHelper.tsx +65 -0
  140. package/src/components/input-helper/constants.ts +11 -0
  141. package/src/components/input-helper/index.ts +1 -0
  142. package/src/components/input-label/InputLabel.stories.tsx +45 -0
  143. package/src/components/input-label/InputLabel.test.tsx +59 -0
  144. package/src/components/input-label/InputLabel.tsx +69 -0
  145. package/src/components/input-label/index.ts +1 -0
  146. package/src/components/lightbox/Lightbox.stories.tsx +101 -0
  147. package/src/components/lightbox/Lightbox.test.tsx +53 -0
  148. package/src/components/lightbox/Lightbox.tsx +180 -0
  149. package/src/components/lightbox/index.ts +1 -0
  150. package/src/components/link/Link.stories.tsx +195 -0
  151. package/src/components/link/Link.test.tsx +127 -0
  152. package/src/components/link/Link.tsx +106 -0
  153. package/src/components/link/index.ts +1 -0
  154. package/src/components/link-preview/LinkPreview.stories.tsx +61 -0
  155. package/src/components/link-preview/LinkPreview.test.tsx +105 -0
  156. package/src/components/link-preview/LinkPreview.tsx +158 -0
  157. package/src/components/link-preview/index.ts +1 -0
  158. package/src/components/list/List.stories.tsx +116 -0
  159. package/src/components/list/List.test.tsx +18 -0
  160. package/src/components/list/List.tsx +104 -0
  161. package/src/components/list/ListDivider.stories.tsx +12 -0
  162. package/src/components/list/ListDivider.test.tsx +22 -0
  163. package/src/components/list/ListDivider.tsx +35 -0
  164. package/src/components/list/ListItem.stories.tsx +66 -0
  165. package/src/components/list/ListItem.test.tsx +93 -0
  166. package/src/components/list/ListItem.tsx +157 -0
  167. package/src/components/list/ListSubheader.stories.tsx +11 -0
  168. package/src/components/list/ListSubheader.test.tsx +21 -0
  169. package/src/components/list/ListSubheader.tsx +44 -0
  170. package/src/components/list/index.ts +4 -0
  171. package/src/components/list/useInteractiveList.tsx +202 -0
  172. package/src/components/message/Message.stories.tsx +72 -0
  173. package/src/components/message/Message.test.tsx +76 -0
  174. package/src/components/message/Message.tsx +100 -0
  175. package/src/components/message/index.ts +1 -0
  176. package/src/components/mosaic/Mosaic.stories.tsx +89 -0
  177. package/src/components/mosaic/Mosaic.test.tsx +77 -0
  178. package/src/components/mosaic/Mosaic.tsx +98 -0
  179. package/src/components/mosaic/index.ts +1 -0
  180. package/src/components/navigation/Navigation.stories.tsx +234 -0
  181. package/src/components/navigation/Navigation.test.tsx +65 -0
  182. package/src/components/navigation/Navigation.tsx +79 -0
  183. package/src/components/navigation/NavigationItem.test.tsx +35 -0
  184. package/src/components/navigation/NavigationItem.tsx +82 -0
  185. package/src/components/navigation/NavigationSection.test.tsx +137 -0
  186. package/src/components/navigation/NavigationSection.tsx +108 -0
  187. package/src/components/navigation/context.tsx +7 -0
  188. package/src/components/navigation/index.ts +1 -0
  189. package/src/components/notification/Notification.test.tsx +94 -0
  190. package/src/components/notification/Notification.tsx +138 -0
  191. package/src/components/notification/Notifications.stories.tsx +92 -0
  192. package/src/components/notification/constants.ts +28 -0
  193. package/src/components/notification/index.ts +1 -0
  194. package/src/components/popover/Popover.stories.tsx +264 -0
  195. package/src/components/popover/Popover.test.tsx +62 -0
  196. package/src/components/popover/Popover.tsx +201 -0
  197. package/src/components/popover/constants.ts +62 -0
  198. package/src/components/popover/index.ts +3 -0
  199. package/src/components/popover/usePopoverStyle.tsx +184 -0
  200. package/src/components/popover/useRestoreFocusOnClose.tsx +47 -0
  201. package/src/components/popover-dialog/PopoverDialog.stories.tsx +64 -0
  202. package/src/components/popover-dialog/PopoverDialog.test.tsx +139 -0
  203. package/src/components/popover-dialog/PopoverDialog.tsx +74 -0
  204. package/src/components/popover-dialog/index.tsx +1 -0
  205. package/src/components/post-block/PostBlock.test.tsx +27 -0
  206. package/src/components/post-block/PostBlock.tsx +122 -0
  207. package/src/components/post-block/index.ts +1 -0
  208. package/src/components/progress/Progress.tsx +68 -0
  209. package/src/components/progress/ProgressCircular.stories.tsx +43 -0
  210. package/src/components/progress/ProgressCircular.test.tsx +46 -0
  211. package/src/components/progress/ProgressCircular.tsx +82 -0
  212. package/src/components/progress/ProgressLinear.stories.tsx +12 -0
  213. package/src/components/progress/ProgressLinear.test.tsx +30 -0
  214. package/src/components/progress/ProgressLinear.tsx +50 -0
  215. package/src/components/progress/index.ts +3 -0
  216. package/src/components/progress-tracker/ProgressTracker.stories.tsx +145 -0
  217. package/src/components/progress-tracker/ProgressTracker.test.tsx +42 -0
  218. package/src/components/progress-tracker/ProgressTracker.tsx +87 -0
  219. package/src/components/progress-tracker/ProgressTrackerProvider.test.tsx +65 -0
  220. package/src/components/progress-tracker/ProgressTrackerProvider.tsx +67 -0
  221. package/src/components/progress-tracker/ProgressTrackerStep.test.tsx +36 -0
  222. package/src/components/progress-tracker/ProgressTrackerStep.tsx +159 -0
  223. package/src/components/progress-tracker/ProgressTrackerStepPanel.test.tsx +34 -0
  224. package/src/components/progress-tracker/ProgressTrackerStepPanel.tsx +67 -0
  225. package/src/components/progress-tracker/index.ts +4 -0
  226. package/src/components/radio-button/RadioButton.stories.tsx +71 -0
  227. package/src/components/radio-button/RadioButton.test.tsx +143 -0
  228. package/src/components/radio-button/RadioButton.tsx +143 -0
  229. package/src/components/radio-button/RadioGroup.stories.tsx +39 -0
  230. package/src/components/radio-button/RadioGroup.test.tsx +29 -0
  231. package/src/components/radio-button/RadioGroup.tsx +44 -0
  232. package/src/components/radio-button/index.ts +2 -0
  233. package/src/components/select/Select.stories.tsx +385 -0
  234. package/src/components/select/Select.test.tsx +199 -0
  235. package/src/components/select/Select.tsx +199 -0
  236. package/src/components/select/SelectMultiple.stories.tsx +315 -0
  237. package/src/components/select/SelectMultiple.test.tsx +213 -0
  238. package/src/components/select/SelectMultiple.tsx +206 -0
  239. package/src/components/select/WithSelectContext.tsx +147 -0
  240. package/src/components/select/constants.ts +55 -0
  241. package/src/components/select/index.ts +2 -0
  242. package/src/components/side-navigation/SideNavigation.stories.tsx +191 -0
  243. package/src/components/side-navigation/SideNavigation.test.tsx +37 -0
  244. package/src/components/side-navigation/SideNavigation.tsx +52 -0
  245. package/src/components/side-navigation/SideNavigationItem.stories.tsx +133 -0
  246. package/src/components/side-navigation/SideNavigationItem.test.tsx +136 -0
  247. package/src/components/side-navigation/SideNavigationItem.tsx +165 -0
  248. package/src/components/side-navigation/index.ts +2 -0
  249. package/src/components/skeleton/SkeletonCircle.stories.tsx +41 -0
  250. package/src/components/skeleton/SkeletonCircle.test.tsx +27 -0
  251. package/src/components/skeleton/SkeletonCircle.tsx +52 -0
  252. package/src/components/skeleton/SkeletonRectangle.stories.tsx +82 -0
  253. package/src/components/skeleton/SkeletonRectangle.test.tsx +27 -0
  254. package/src/components/skeleton/SkeletonRectangle.tsx +88 -0
  255. package/src/components/skeleton/SkeletonTypography.stories.tsx +19 -0
  256. package/src/components/skeleton/SkeletonTypography.test.tsx +27 -0
  257. package/src/components/skeleton/SkeletonTypography.tsx +59 -0
  258. package/src/components/skeleton/index.ts +3 -0
  259. package/src/components/slider/Slider.stories.tsx +45 -0
  260. package/src/components/slider/Slider.test.tsx +29 -0
  261. package/src/components/slider/Slider.tsx +299 -0
  262. package/src/components/slider/index.ts +2 -0
  263. package/src/components/slideshow/Slides.tsx +130 -0
  264. package/src/components/slideshow/Slideshow.stories.tsx +179 -0
  265. package/src/components/slideshow/Slideshow.test.tsx +35 -0
  266. package/src/components/slideshow/Slideshow.tsx +173 -0
  267. package/src/components/slideshow/SlideshowControls.stories.tsx +100 -0
  268. package/src/components/slideshow/SlideshowControls.tsx +243 -0
  269. package/src/components/slideshow/SlideshowItem.tsx +44 -0
  270. package/src/components/slideshow/SlideshowItemGroup.tsx +60 -0
  271. package/src/components/slideshow/constants.ts +24 -0
  272. package/src/components/slideshow/index.ts +4 -0
  273. package/src/components/slideshow/useKeyNavigate.ts +28 -0
  274. package/src/components/slideshow/usePaginationVisibleRange.ts +37 -0
  275. package/src/components/slideshow/useSlideFocusManagement.tsx +92 -0
  276. package/src/components/slideshow/useSwipeNavigate.ts +18 -0
  277. package/src/components/switch/Switch.stories.tsx +49 -0
  278. package/src/components/switch/Switch.test.tsx +144 -0
  279. package/src/components/switch/Switch.tsx +145 -0
  280. package/src/components/switch/index.ts +1 -0
  281. package/src/components/table/Table.test.tsx +29 -0
  282. package/src/components/table/Table.tsx +59 -0
  283. package/src/components/table/TableBody.test.tsx +30 -0
  284. package/src/components/table/TableBody.tsx +42 -0
  285. package/src/components/table/TableCell.test.tsx +72 -0
  286. package/src/components/table/TableCell.tsx +130 -0
  287. package/src/components/table/TableHeader.test.tsx +30 -0
  288. package/src/components/table/TableHeader.tsx +48 -0
  289. package/src/components/table/TableRow.test.tsx +40 -0
  290. package/src/components/table/TableRow.tsx +71 -0
  291. package/src/components/table/index.ts +5 -0
  292. package/src/components/tabs/Tab.test.tsx +50 -0
  293. package/src/components/tabs/Tab.tsx +133 -0
  294. package/src/components/tabs/TabList.test.tsx +49 -0
  295. package/src/components/tabs/TabList.tsx +94 -0
  296. package/src/components/tabs/TabPanel.test.tsx +37 -0
  297. package/src/components/tabs/TabPanel.tsx +67 -0
  298. package/src/components/tabs/TabProvider.test.tsx +161 -0
  299. package/src/components/tabs/TabProvider.tsx +67 -0
  300. package/src/components/tabs/Tabs.stories.tsx +170 -0
  301. package/src/components/tabs/index.ts +4 -0
  302. package/src/components/tabs/state.ts +114 -0
  303. package/src/components/tabs/test-utils.ts +39 -0
  304. package/src/components/text/Text.stories.tsx +177 -0
  305. package/src/components/text/Text.test.tsx +92 -0
  306. package/src/components/text/Text.tsx +139 -0
  307. package/src/components/text/index.ts +1 -0
  308. package/src/components/text-field/TextField.stories.tsx +180 -0
  309. package/src/components/text-field/TextField.test.tsx +298 -0
  310. package/src/components/text-field/TextField.tsx +493 -0
  311. package/src/components/text-field/index.ts +1 -0
  312. package/src/components/thumbnail/Thumbnail.stories.tsx +448 -0
  313. package/src/components/thumbnail/Thumbnail.test.tsx +88 -0
  314. package/src/components/thumbnail/Thumbnail.tsx +248 -0
  315. package/src/components/thumbnail/index.ts +3 -0
  316. package/src/components/thumbnail/types.ts +48 -0
  317. package/src/components/thumbnail/useFocusPointStyle.test.ts +92 -0
  318. package/src/components/thumbnail/useFocusPointStyle.tsx +107 -0
  319. package/src/components/thumbnail/useImageLoad.ts +40 -0
  320. package/src/components/toolbar/Toolbar.tsx +68 -0
  321. package/src/components/toolbar/index.ts +1 -0
  322. package/src/components/tooltip/Tooltip.stories.tsx +118 -0
  323. package/src/components/tooltip/Tooltip.test.tsx +417 -0
  324. package/src/components/tooltip/Tooltip.tsx +165 -0
  325. package/src/components/tooltip/constants.ts +8 -0
  326. package/src/components/tooltip/context.tsx +17 -0
  327. package/src/components/tooltip/index.ts +1 -0
  328. package/src/components/tooltip/useInjectTooltipRef.tsx +55 -0
  329. package/src/components/tooltip/useTooltipOpen.tsx +143 -0
  330. package/src/components/uploader/Uploader.stories.tsx +109 -0
  331. package/src/components/uploader/Uploader.test.tsx +146 -0
  332. package/src/components/uploader/Uploader.tsx +177 -0
  333. package/src/components/uploader/index.ts +1 -0
  334. package/src/components/user-block/UserBlock.stories.tsx +133 -0
  335. package/src/components/user-block/UserBlock.test.tsx +106 -0
  336. package/src/components/user-block/UserBlock.tsx +193 -0
  337. package/src/components/user-block/index.ts +1 -0
  338. package/src/constants.ts +27 -0
  339. package/src/hooks/useBooleanState.tsx +13 -0
  340. package/src/hooks/useCallbackOnEscape.ts +34 -0
  341. package/src/hooks/useChipGroupNavigation.tsx +75 -0
  342. package/src/hooks/useClickAway.tsx +48 -0
  343. package/src/hooks/useDisableBodyScroll.ts +28 -0
  344. package/src/hooks/useEventCallback.tsx +17 -0
  345. package/src/hooks/useFocus.tsx +21 -0
  346. package/src/hooks/useFocusTrap.ts +93 -0
  347. package/src/hooks/useFocusWithin.ts +33 -0
  348. package/src/hooks/useId.test.tsx +22 -0
  349. package/src/hooks/useId.ts +15 -0
  350. package/src/hooks/useImageSize.ts +17 -0
  351. package/src/hooks/useInfiniteScroll.tsx +60 -0
  352. package/src/hooks/useIntersectionObserver.tsx +43 -0
  353. package/src/hooks/useInterval.tsx +31 -0
  354. package/src/hooks/useKeyboardListNavigation.tsx +204 -0
  355. package/src/hooks/useListenFocus.tsx +26 -0
  356. package/src/hooks/useOverflowTooltipLabel.tsx +32 -0
  357. package/src/hooks/usePopper.ts +12 -0
  358. package/src/hooks/usePreviousValue.ts +12 -0
  359. package/src/hooks/useRovingTabIndex.tsx +90 -0
  360. package/src/hooks/useSizeOnWindowResize.ts +30 -0
  361. package/src/hooks/useSlideshowControls.ts +246 -0
  362. package/src/hooks/useStopPropagation.ts +21 -0
  363. package/src/hooks/useTransitionVisibility.ts +48 -0
  364. package/src/index.ts +63 -0
  365. package/src/stories/controls/color.ts +7 -0
  366. package/src/stories/controls/element.ts +6 -0
  367. package/src/stories/controls/focusPoint.ts +1 -0
  368. package/src/stories/controls/icons.ts +126 -0
  369. package/src/stories/controls/image.ts +84 -0
  370. package/src/stories/controls/selectArgType.ts +8 -0
  371. package/src/stories/controls/theme.ts +3 -0
  372. package/src/stories/controls/typography.ts +5 -0
  373. package/src/stories/controls/withUndefined.ts +1 -0
  374. package/src/stories/decorators/withChromaticForceScreenSize.tsx +7 -0
  375. package/src/stories/decorators/withCombinations.tsx +132 -0
  376. package/src/stories/decorators/withNestedProps.tsx +22 -0
  377. package/src/stories/decorators/withResizableBox.tsx +21 -0
  378. package/src/stories/decorators/withThemedBackground.tsx +16 -0
  379. package/src/stories/decorators/withValueOnChange.tsx +18 -0
  380. package/src/stories/decorators/withWrapper.tsx +19 -0
  381. package/src/stories/generated/Autocomplete/Demos.stories.tsx +7 -0
  382. package/src/stories/generated/Avatar/Demos.stories.tsx +7 -0
  383. package/src/stories/generated/Badge/Demos.stories.tsx +9 -0
  384. package/src/stories/generated/Button/Demos.stories.tsx +11 -0
  385. package/src/stories/generated/Checkbox/Demos.stories.tsx +6 -0
  386. package/src/stories/generated/Chip/Demos.stories.tsx +11 -0
  387. package/src/stories/generated/CommentBlock/Demos.stories.tsx +8 -0
  388. package/src/stories/generated/DatePicker/Demos.stories.tsx +8 -0
  389. package/src/stories/generated/Dialog/Demos.stories.tsx +10 -0
  390. package/src/stories/generated/Divider/Demos.stories.tsx +6 -0
  391. package/src/stories/generated/Dropdown/Demos.stories.tsx +8 -0
  392. package/src/stories/generated/ExpansionPanel/Demos.stories.tsx +9 -0
  393. package/src/stories/generated/Flag/Demos.stories.tsx +6 -0
  394. package/src/stories/generated/GenericBlock/Demos.stories.tsx +8 -0
  395. package/src/stories/generated/Heading/Demos.stories.tsx +6 -0
  396. package/src/stories/generated/Icon/Demos.stories.tsx +8 -0
  397. package/src/stories/generated/ImageBlock/Demos.stories.tsx +9 -0
  398. package/src/stories/generated/ImageLightbox/Demos.stories.tsx +6 -0
  399. package/src/stories/generated/Lightbox/Demos.stories.tsx +6 -0
  400. package/src/stories/generated/LinkPreview/Demos.stories.tsx +7 -0
  401. package/src/stories/generated/List/Demos.stories.tsx +11 -0
  402. package/src/stories/generated/Message/Demos.stories.tsx +11 -0
  403. package/src/stories/generated/Mosaic/Demos.stories.tsx +10 -0
  404. package/src/stories/generated/Notification/Demos.stories.tsx +6 -0
  405. package/src/stories/generated/Popover/Demos.stories.tsx +11 -0
  406. package/src/stories/generated/PopoverDialog/Demos.stories.tsx +6 -0
  407. package/src/stories/generated/PostBlock/Demos.stories.tsx +6 -0
  408. package/src/stories/generated/Progress/Demos.stories.tsx +7 -0
  409. package/src/stories/generated/ProgressTracker/Demos.stories.tsx +9 -0
  410. package/src/stories/generated/RadioButton/Demos.stories.tsx +6 -0
  411. package/src/stories/generated/Select/Demos.stories.tsx +14 -0
  412. package/src/stories/generated/SideNavigation/Demos.stories.tsx +10 -0
  413. package/src/stories/generated/Skeleton/Demos.stories.tsx +9 -0
  414. package/src/stories/generated/Slider/Demos.stories.tsx +9 -0
  415. package/src/stories/generated/Slideshow/Demos.stories.tsx +8 -0
  416. package/src/stories/generated/Switch/Demos.stories.tsx +6 -0
  417. package/src/stories/generated/Table/Demos.stories.tsx +7 -0
  418. package/src/stories/generated/Tabs/Demos.stories.tsx +8 -0
  419. package/src/stories/generated/TextField/Demos.stories.tsx +20 -0
  420. package/src/stories/generated/Thumbnail/Demos.stories.tsx +12 -0
  421. package/src/stories/generated/Toolbar/Demos.stories.tsx +10 -0
  422. package/src/stories/generated/Tooltip/Demos.stories.tsx +8 -0
  423. package/src/stories/generated/Uploader/Demos.stories.tsx +8 -0
  424. package/src/stories/generated/UserBlock/Demos.stories.tsx +11 -0
  425. package/src/stories/utils/CustomLink.tsx +12 -0
  426. package/src/stories/utils/concatPath.tsx +17 -0
  427. package/src/stories/utils/disableArgTypes.ts +3 -0
  428. package/src/stories/utils/initDemoShadowDOMPortal.ts +10 -0
  429. package/src/stories/utils/lorem.ts +59 -0
  430. package/src/stories/utils/theming.tsx +166 -0
  431. package/src/stories/utils/toFlattenProps.ts +28 -0
  432. package/src/stories/utils/withCategory.ts +12 -0
  433. package/src/testing/utils/ThemeSentinel.tsx +10 -0
  434. package/src/testing/utils/commonTestsSuiteRTL.tsx +193 -0
  435. package/src/testing/utils/index.ts +1 -0
  436. package/src/testing/utils/queries.ts +19 -0
  437. package/src/untypped-modules.d.ts +9 -0
  438. package/src/utils/ClickAwayProvider/ClickAwayProvider.stories.jsx +70 -0
  439. package/src/utils/ClickAwayProvider/ClickAwayProvider.tsx +69 -0
  440. package/src/utils/ClickAwayProvider/index.ts +1 -0
  441. package/src/utils/MaterialThemeSwitcher/MaterialThemeSwitcher.tsx +54 -0
  442. package/src/utils/MaterialThemeSwitcher/index.ts +1 -0
  443. package/src/utils/Portal/Portal.test.tsx +31 -0
  444. package/src/utils/Portal/Portal.tsx +33 -0
  445. package/src/utils/Portal/PortalProvider.stories.jsx +22 -0
  446. package/src/utils/Portal/PortalProvider.test.tsx +72 -0
  447. package/src/utils/Portal/PortalProvider.tsx +24 -0
  448. package/src/utils/Portal/index.tsx +2 -0
  449. package/src/utils/browser/DOM/findImage.tsx +3 -0
  450. package/src/utils/browser/DOM/startViewTransition.ts +68 -0
  451. package/src/utils/browser/focus/constants.ts +7 -0
  452. package/src/utils/browser/focus/getFirstAndLastFocusable.test.ts +134 -0
  453. package/src/utils/browser/focus/getFirstAndLastFocusable.ts +21 -0
  454. package/src/utils/browser/focus/getFocusableElements.test.ts +151 -0
  455. package/src/utils/browser/focus/getFocusableElements.ts +7 -0
  456. package/src/utils/browser/isFocusVisible.ts +9 -0
  457. package/src/utils/browser/isHoverNotSupported.test.js +24 -0
  458. package/src/utils/browser/isHoverNotSupported.ts +2 -0
  459. package/src/utils/browser/isReducedMotion.ts +6 -0
  460. package/src/utils/date/addMonthResetDay.test.ts +13 -0
  461. package/src/utils/date/addMonthResetDay.ts +9 -0
  462. package/src/utils/date/formatDayNumber.test.ts +12 -0
  463. package/src/utils/date/formatDayNumber.ts +5 -0
  464. package/src/utils/date/getFirstDayOfWeek.test.ts +20 -0
  465. package/src/utils/date/getFirstDayOfWeek.ts +59 -0
  466. package/src/utils/date/getMonthCalendar.test.ts +127 -0
  467. package/src/utils/date/getMonthCalendar.ts +69 -0
  468. package/src/utils/date/getWeekDays.test.ts +48 -0
  469. package/src/utils/date/getWeekDays.ts +34 -0
  470. package/src/utils/date/getYearDisplayName.test.ts +20 -0
  471. package/src/utils/date/getYearDisplayName.ts +12 -0
  472. package/src/utils/date/isDateValid.test.ts +15 -0
  473. package/src/utils/date/isDateValid.ts +4 -0
  474. package/src/utils/date/isSameDay.test.ts +37 -0
  475. package/src/utils/date/isSameDay.ts +11 -0
  476. package/src/utils/disabled/DisabledStateContext.tsx +29 -0
  477. package/src/utils/disabled/DisabledStateProvider.stories.tsx +92 -0
  478. package/src/utils/disabled/index.ts +2 -0
  479. package/src/utils/disabled/useDisableStateProps.test.tsx +74 -0
  480. package/src/utils/disabled/useDisableStateProps.tsx +37 -0
  481. package/src/utils/function/makeListenerTowerContext.ts +32 -0
  482. package/src/utils/index.ts +7 -0
  483. package/src/utils/locale/getCurrentLocale.ts +4 -0
  484. package/src/utils/locale/parseLocale.test.ts +17 -0
  485. package/src/utils/locale/parseLocale.ts +23 -0
  486. package/src/utils/locale/types.ts +8 -0
  487. package/src/utils/number/clamp.ts +17 -0
  488. package/src/utils/object/isEqual.test.ts +25 -0
  489. package/src/utils/object/isEqual.ts +11 -0
  490. package/src/utils/partitionMulti.test.ts +27 -0
  491. package/{_internal/4daccdd5.js → src/utils/partitionMulti.ts} +9 -5
  492. package/src/utils/react/OnBeforeUnmount.tsx +20 -0
  493. package/src/utils/react/RawClickable.test.tsx +153 -0
  494. package/src/utils/react/RawClickable.tsx +65 -0
  495. package/src/utils/react/flattenChildren.ts +32 -0
  496. package/src/utils/react/forwardRef.ts +11 -0
  497. package/src/utils/react/forwardRefPolymorphic.ts +9 -0
  498. package/src/utils/react/mergeRefs.ts +33 -0
  499. package/src/utils/react/renderLink.tsx +17 -0
  500. package/src/utils/react/skipRender.tsx +18 -0
  501. package/src/utils/react/unref.ts +7 -0
  502. package/src/utils/react/wrapChildrenIconWithSpaces.test.tsx +37 -0
  503. package/src/utils/react/wrapChildrenIconWithSpaces.tsx +22 -0
  504. package/src/utils/theme/ThemeContext.ts +16 -0
  505. package/src/utils/theme/invertTheme.ts +4 -0
  506. package/src/utils/type/Comp.ts +14 -0
  507. package/src/utils/type/ComponentRef.ts +16 -0
  508. package/src/utils/type/HasAriaDisabled.ts +6 -0
  509. package/src/utils/type/HasPolymorphicAs.ts +6 -0
  510. package/src/utils/type/HasRequiredLinkHref.ts +1 -0
  511. package/src/utils/type/MaybeElementOrRef.ts +6 -0
  512. package/src/utils/type/index.ts +9 -0
  513. package/src/utils/type/isComponent.ts +33 -0
  514. package/src/utils/type/isComponentType.ts +9 -0
  515. package/utils/index.d.ts +1 -1
  516. package/utils/index.js +1 -3
  517. package/utils/index.js.map +1 -1
  518. package/_internal/0420e67b.js +0 -119
  519. package/_internal/0420e67b.js.map +0 -1
  520. package/_internal/0a490b07.js +0 -75
  521. package/_internal/0a490b07.js.map +0 -1
  522. package/_internal/0b9c76cb.js +0 -6
  523. package/_internal/0b9c76cb.js.map +0 -1
  524. package/_internal/0be1006e.js +0 -97
  525. package/_internal/0be1006e.js.map +0 -1
  526. package/_internal/0d1a078c.js +0 -144
  527. package/_internal/0d1a078c.js.map +0 -1
  528. package/_internal/15eab19b.js +0 -75
  529. package/_internal/15eab19b.js.map +0 -1
  530. package/_internal/179a84d1.js +0 -259
  531. package/_internal/179a84d1.js.map +0 -1
  532. package/_internal/193521fa.js +0 -52
  533. package/_internal/193521fa.js.map +0 -1
  534. package/_internal/1a90ea3d.js +0 -51
  535. package/_internal/1a90ea3d.js.map +0 -1
  536. package/_internal/1deba7d7.js +0 -224
  537. package/_internal/1deba7d7.js.map +0 -1
  538. package/_internal/1ea72630.js +0 -146
  539. package/_internal/1ea72630.js.map +0 -1
  540. package/_internal/21b83d16.js +0 -137
  541. package/_internal/21b83d16.js.map +0 -1
  542. package/_internal/230173a8.js +0 -13
  543. package/_internal/230173a8.js.map +0 -1
  544. package/_internal/297bed8f.js +0 -457
  545. package/_internal/297bed8f.js.map +0 -1
  546. package/_internal/2a3d237c.js +0 -12
  547. package/_internal/2a3d237c.js.map +0 -1
  548. package/_internal/2c2b6a89.js +0 -52
  549. package/_internal/2c2b6a89.js.map +0 -1
  550. package/_internal/2f1716fa.js +0 -237
  551. package/_internal/2f1716fa.js.map +0 -1
  552. package/_internal/2f6c7f84.js +0 -103
  553. package/_internal/2f6c7f84.js.map +0 -1
  554. package/_internal/3181f000.js +0 -14
  555. package/_internal/3181f000.js.map +0 -1
  556. package/_internal/329b5f12.js +0 -55
  557. package/_internal/329b5f12.js.map +0 -1
  558. package/_internal/332e9844.js +0 -2
  559. package/_internal/332e9844.js.map +0 -1
  560. package/_internal/34c59f5b.js +0 -681
  561. package/_internal/34c59f5b.js.map +0 -1
  562. package/_internal/36bd7352.js +0 -219
  563. package/_internal/36bd7352.js.map +0 -1
  564. package/_internal/370bdaed.js +0 -61
  565. package/_internal/370bdaed.js.map +0 -1
  566. package/_internal/37b007a4.js +0 -20
  567. package/_internal/37b007a4.js.map +0 -1
  568. package/_internal/3a1facc0.js +0 -18
  569. package/_internal/3a1facc0.js.map +0 -1
  570. package/_internal/3a4e4636.js +0 -162
  571. package/_internal/3a4e4636.js.map +0 -1
  572. package/_internal/3e653144.js +0 -49
  573. package/_internal/3e653144.js.map +0 -1
  574. package/_internal/3f86608e.js +0 -45
  575. package/_internal/3f86608e.js.map +0 -1
  576. package/_internal/478b5c92.js +0 -24
  577. package/_internal/478b5c92.js.map +0 -1
  578. package/_internal/4962be5b.js +0 -121
  579. package/_internal/4962be5b.js.map +0 -1
  580. package/_internal/49bbeed3.js +0 -6
  581. package/_internal/49bbeed3.js.map +0 -1
  582. package/_internal/4cd870a5.js +0 -2155
  583. package/_internal/4cd870a5.js.map +0 -1
  584. package/_internal/4daccdd5.js.map +0 -1
  585. package/_internal/501f2f9f.js +0 -58
  586. package/_internal/501f2f9f.js.map +0 -1
  587. package/_internal/5e7b90e2.js +0 -2
  588. package/_internal/5e7b90e2.js.map +0 -1
  589. package/_internal/5ec059fe.js +0 -145
  590. package/_internal/5ec059fe.js.map +0 -1
  591. package/_internal/5f8f9454.js +0 -70
  592. package/_internal/5f8f9454.js.map +0 -1
  593. package/_internal/5fe09341.js +0 -112
  594. package/_internal/5fe09341.js.map +0 -1
  595. package/_internal/628468c4.js +0 -313
  596. package/_internal/628468c4.js.map +0 -1
  597. package/_internal/6589b796.js +0 -280
  598. package/_internal/6589b796.js.map +0 -1
  599. package/_internal/65f91970.js +0 -297
  600. package/_internal/65f91970.js.map +0 -1
  601. package/_internal/66f691d3.js +0 -74
  602. package/_internal/66f691d3.js.map +0 -1
  603. package/_internal/68c10f98.js +0 -166
  604. package/_internal/68c10f98.js.map +0 -1
  605. package/_internal/690ca33e.js +0 -109
  606. package/_internal/690ca33e.js.map +0 -1
  607. package/_internal/6ca04271.js +0 -108
  608. package/_internal/6ca04271.js.map +0 -1
  609. package/_internal/6da19518.js +0 -165
  610. package/_internal/6da19518.js.map +0 -1
  611. package/_internal/7093ba23.js +0 -95
  612. package/_internal/7093ba23.js.map +0 -1
  613. package/_internal/74a4a214.js +0 -82
  614. package/_internal/74a4a214.js.map +0 -1
  615. package/_internal/76be70dd.js +0 -42
  616. package/_internal/76be70dd.js.map +0 -1
  617. package/_internal/78df9309.js +0 -20
  618. package/_internal/78df9309.js.map +0 -1
  619. package/_internal/7b221b05.js +0 -9
  620. package/_internal/7b221b05.js.map +0 -1
  621. package/_internal/7daf0f24.js +0 -77
  622. package/_internal/7daf0f24.js.map +0 -1
  623. package/_internal/7f54e947.js +0 -758
  624. package/_internal/7f54e947.js.map +0 -1
  625. package/_internal/825ac334.js +0 -130
  626. package/_internal/825ac334.js.map +0 -1
  627. package/_internal/827b804a.js +0 -6
  628. package/_internal/827b804a.js.map +0 -1
  629. package/_internal/84dfe68f.js +0 -436
  630. package/_internal/84dfe68f.js.map +0 -1
  631. package/_internal/85e3a5ca.js +0 -145
  632. package/_internal/85e3a5ca.js.map +0 -1
  633. package/_internal/86aa4aa4.js +0 -154
  634. package/_internal/86aa4aa4.js.map +0 -1
  635. package/_internal/88ec77c2.js +0 -130
  636. package/_internal/88ec77c2.js.map +0 -1
  637. package/_internal/8ab42752.js +0 -103
  638. package/_internal/8ab42752.js.map +0 -1
  639. package/_internal/95cfd814.js +0 -70
  640. package/_internal/95cfd814.js.map +0 -1
  641. package/_internal/9a4dfad0.js +0 -326
  642. package/_internal/9a4dfad0.js.map +0 -1
  643. package/_internal/9c9df5f2.js +0 -80
  644. package/_internal/9c9df5f2.js.map +0 -1
  645. package/_internal/9d1336a1.js +0 -19
  646. package/_internal/9d1336a1.js.map +0 -1
  647. package/_internal/9fdc715b.js +0 -152
  648. package/_internal/9fdc715b.js.map +0 -1
  649. package/_internal/a003602b.js +0 -116
  650. package/_internal/a003602b.js.map +0 -1
  651. package/_internal/a34639bd.js +0 -97
  652. package/_internal/a34639bd.js.map +0 -1
  653. package/_internal/a84f4981.js +0 -122
  654. package/_internal/a84f4981.js.map +0 -1
  655. package/_internal/b0a7a999.js +0 -59
  656. package/_internal/b0a7a999.js.map +0 -1
  657. package/_internal/b0b2e33d.js +0 -359
  658. package/_internal/b0b2e33d.js.map +0 -1
  659. package/_internal/b1af5979.js +0 -653
  660. package/_internal/b1af5979.js.map +0 -1
  661. package/_internal/b477da26.js +0 -164
  662. package/_internal/b477da26.js.map +0 -1
  663. package/_internal/b8667090.js +0 -36
  664. package/_internal/b8667090.js.map +0 -1
  665. package/_internal/bae266a9.js +0 -61
  666. package/_internal/bae266a9.js.map +0 -1
  667. package/_internal/be6da9b0.js +0 -296
  668. package/_internal/be6da9b0.js.map +0 -1
  669. package/_internal/c0414b89.js +0 -101
  670. package/_internal/c0414b89.js.map +0 -1
  671. package/_internal/c2388b10.js +0 -58
  672. package/_internal/c2388b10.js.map +0 -1
  673. package/_internal/c459a04d.js +0 -148
  674. package/_internal/c459a04d.js.map +0 -1
  675. package/_internal/c6ca7494.js +0 -2
  676. package/_internal/c6ca7494.js.map +0 -1
  677. package/_internal/cdddaed8.js +0 -116
  678. package/_internal/cdddaed8.js.map +0 -1
  679. package/_internal/d0dd1815.js +0 -10
  680. package/_internal/d0dd1815.js.map +0 -1
  681. package/_internal/d45e3f16.js +0 -15
  682. package/_internal/d45e3f16.js.map +0 -1
  683. package/_internal/d5f316cb.js +0 -62
  684. package/_internal/d5f316cb.js.map +0 -1
  685. package/_internal/db4fdc7b.js +0 -310
  686. package/_internal/db4fdc7b.js.map +0 -1
  687. package/_internal/dbe0cf24.js +0 -75
  688. package/_internal/dbe0cf24.js.map +0 -1
  689. package/_internal/de24f857.js +0 -4
  690. package/_internal/de24f857.js.map +0 -1
  691. package/_internal/e2afb13f.js +0 -75
  692. package/_internal/e2afb13f.js.map +0 -1
  693. package/_internal/e52f0d3f.js +0 -94
  694. package/_internal/e52f0d3f.js.map +0 -1
  695. package/_internal/e6dd117e.js +0 -50
  696. package/_internal/e6dd117e.js.map +0 -1
  697. package/_internal/e806b848.js +0 -9
  698. package/_internal/e806b848.js.map +0 -1
  699. package/_internal/ea04260d.js +0 -29
  700. package/_internal/ea04260d.js.map +0 -1
  701. package/_internal/eaa8b1d8.js +0 -150
  702. package/_internal/eaa8b1d8.js.map +0 -1
  703. package/_internal/eaf6c45a.js +0 -4
  704. package/_internal/eaf6c45a.js.map +0 -1
  705. package/_internal/edab29ce.js +0 -308
  706. package/_internal/edab29ce.js.map +0 -1
  707. package/_internal/ef5d1aac.js +0 -4
  708. package/_internal/ef5d1aac.js.map +0 -1
  709. package/_internal/f0900583.js +0 -142
  710. package/_internal/f0900583.js.map +0 -1
  711. package/_internal/f0d7d6ea.js +0 -30
  712. package/_internal/f0d7d6ea.js.map +0 -1
  713. package/_internal/f23cdf84.js +0 -181
  714. package/_internal/f23cdf84.js.map +0 -1
  715. package/_internal/f52e979e.js +0 -3
  716. package/_internal/f52e979e.js.map +0 -1
  717. package/_internal/f5508d3d.js +0 -792
  718. package/_internal/f5508d3d.js.map +0 -1
  719. package/_internal/f93fe83e.js +0 -46
  720. package/_internal/f93fe83e.js.map +0 -1
  721. /package/_internal/{d95844c1.d.ts → Falsy.d.ts} +0 -0
@@ -1,75 +0,0 @@
1
- import { l as classNames } from './6589b796.js';
2
- import { jsxs, jsx } from 'react/jsx-runtime';
3
- import { u as useTheme } from './3181f000.js';
4
- import { FlexBox } from './329b5f12.js';
5
- import { T as Text } from './0420e67b.js';
6
-
7
- /** Internal component used to render image captions */
8
- const ImageCaption = props => {
9
- const defaultTheme = useTheme();
10
- const {
11
- baseClassName,
12
- theme = defaultTheme,
13
- as = 'figcaption',
14
- title,
15
- titleProps,
16
- description,
17
- descriptionProps,
18
- tags,
19
- captionStyle,
20
- align,
21
- truncate
22
- } = props;
23
- if (!title && !description && !tags) return null;
24
- const titleColor = {
25
- color: theme === 'dark' ? 'light' : 'dark'
26
- };
27
- const baseColor = {
28
- color: theme === 'dark' ? 'light' : 'dark',
29
- colorVariant: 'L2'
30
- };
31
-
32
- // Display description as string or HTML
33
- const descriptionContent = typeof description === 'string' ? {
34
- children: description
35
- } : {
36
- dangerouslySetInnerHTML: description
37
- };
38
- return /*#__PURE__*/jsxs(FlexBox, {
39
- as: as,
40
- className: classNames(baseClassName && `${baseClassName}__wrapper`),
41
- style: captionStyle,
42
- orientation: "vertical",
43
- vAlign: align,
44
- hAlign: align === 'center' ? align : undefined,
45
- gap: "regular",
46
- children: [(title || description) && /*#__PURE__*/jsxs(Text, {
47
- as: "p",
48
- className: classNames(baseClassName && `${baseClassName}__caption`),
49
- truncate: truncate,
50
- ...baseColor,
51
- children: [title && /*#__PURE__*/jsx(Text, {
52
- ...titleProps,
53
- as: "span",
54
- className: classNames(titleProps?.className, baseClassName && `${baseClassName}__title`),
55
- typography: "subtitle1",
56
- ...titleColor,
57
- children: title
58
- }), ' ', description && /*#__PURE__*/jsx(Text, {
59
- ...descriptionProps,
60
- as: "span",
61
- className: classNames(descriptionProps?.className, baseClassName && `${baseClassName}__description`),
62
- typography: "body1",
63
- ...descriptionContent
64
- })]
65
- }), tags && /*#__PURE__*/jsx(FlexBox, {
66
- className: classNames(baseClassName && `${baseClassName}__tags`),
67
- orientation: "horizontal",
68
- vAlign: align,
69
- children: tags
70
- })]
71
- });
72
- };
73
-
74
- export { ImageCaption as I };
75
- //# sourceMappingURL=dbe0cf24.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dbe0cf24.js","sources":["../../src/components/image-block/ImageCaption.tsx"],"sourcesContent":["import { CSSProperties, ReactNode } from 'react';\n\nimport { FlexBox, HorizontalAlignment, Text, TextProps, useTheme } from '@lumx/react';\nimport { HasPolymorphicAs, HasTheme } from '@lumx/react/utils/type';\nimport classNames from 'classnames';\n\ntype As = 'div' | 'figcaption';\n\ntype ForwardedTextProps = Omit<TextProps, 'as' | 'typography' | 'color' | 'colorVariant'>;\n\nexport type ImageCaptionMetadata = {\n /** Image title to display in the caption. */\n title?: string;\n /** Props to pass to the title. */\n titleProps?: ForwardedTextProps;\n /** Image description. Can be either a string, or sanitized html. */\n description?: string | { __html: string };\n /** Props to pass to the title. */\n descriptionProps?: ForwardedTextProps;\n /** Tag content. */\n tags?: ReactNode;\n /** Caption custom CSS style. */\n captionStyle?: CSSProperties;\n};\n\nexport type ImageCaptionProps<AS extends As = 'figcaption'> = HasTheme &\n HasPolymorphicAs<AS> &\n ImageCaptionMetadata & {\n /** Base className for sub elements */\n baseClassName?: string;\n /** Alignment. */\n align?: HorizontalAlignment;\n /** Truncate text on title & description (no line wrapping). */\n truncate?: TextProps['truncate'];\n };\n\n/** Internal component used to render image captions */\nexport const ImageCaption = <AS extends As>(props: ImageCaptionProps<AS>) => {\n const defaultTheme = useTheme();\n const {\n baseClassName,\n theme = defaultTheme,\n as = 'figcaption',\n title,\n titleProps,\n description,\n descriptionProps,\n tags,\n captionStyle,\n align,\n truncate,\n } = props;\n if (!title && !description && !tags) return null;\n\n const titleColor = { color: theme === 'dark' ? 'light' : 'dark' } as const;\n const baseColor = { color: theme === 'dark' ? 'light' : 'dark', colorVariant: 'L2' } as const;\n\n // Display description as string or HTML\n const descriptionContent =\n typeof description === 'string' ? { children: description } : { dangerouslySetInnerHTML: description };\n\n return (\n <FlexBox\n as={as}\n className={classNames(baseClassName && `${baseClassName}__wrapper`)}\n style={captionStyle}\n orientation=\"vertical\"\n vAlign={align}\n hAlign={align === 'center' ? align : undefined}\n gap=\"regular\"\n >\n {(title || description) && (\n <Text\n as=\"p\"\n className={classNames(baseClassName && `${baseClassName}__caption`)}\n truncate={truncate}\n {...baseColor}\n >\n {title && (\n <Text\n {...titleProps}\n as=\"span\"\n className={classNames(titleProps?.className, baseClassName && `${baseClassName}__title`)}\n typography=\"subtitle1\"\n {...titleColor}\n >\n {title}\n </Text>\n )}{' '}\n {description && (\n <Text\n {...descriptionProps}\n as=\"span\"\n className={classNames(\n descriptionProps?.className,\n baseClassName && `${baseClassName}__description`,\n )}\n typography=\"body1\"\n {...descriptionContent}\n />\n )}\n </Text>\n )}\n {tags && (\n <FlexBox\n className={classNames(baseClassName && `${baseClassName}__tags`)}\n orientation=\"horizontal\"\n vAlign={align}\n >\n {tags}\n </FlexBox>\n )}\n </FlexBox>\n );\n};\n"],"names":["ImageCaption","props","defaultTheme","useTheme","baseClassName","theme","as","title","titleProps","description","descriptionProps","tags","captionStyle","align","truncate","titleColor","color","baseColor","colorVariant","descriptionContent","children","dangerouslySetInnerHTML","_jsxs","FlexBox","className","classNames","style","orientation","vAlign","hAlign","undefined","gap","Text","_jsx","typography"],"mappings":";;;;;;AAoCA;AACaA,MAAAA,YAAY,GAAmBC,KAA4B,IAAK;AACzE,EAAA,MAAMC,YAAY,GAAGC,QAAQ,EAAE,CAAA;EAC/B,MAAM;IACFC,aAAa;AACbC,IAAAA,KAAK,GAAGH,YAAY;AACpBI,IAAAA,EAAE,GAAG,YAAY;IACjBC,KAAK;IACLC,UAAU;IACVC,WAAW;IACXC,gBAAgB;IAChBC,IAAI;IACJC,YAAY;IACZC,KAAK;AACLC,IAAAA,QAAAA;AACJ,GAAC,GAAGb,KAAK,CAAA;EACT,IAAI,CAACM,KAAK,IAAI,CAACE,WAAW,IAAI,CAACE,IAAI,EAAE,OAAO,IAAI,CAAA;AAEhD,EAAA,MAAMI,UAAU,GAAG;AAAEC,IAAAA,KAAK,EAAEX,KAAK,KAAK,MAAM,GAAG,OAAO,GAAG,MAAA;GAAiB,CAAA;AAC1E,EAAA,MAAMY,SAAS,GAAG;AAAED,IAAAA,KAAK,EAAEX,KAAK,KAAK,MAAM,GAAG,OAAO,GAAG,MAAM;AAAEa,IAAAA,YAAY,EAAE,IAAA;GAAe,CAAA;;AAE7F;AACA,EAAA,MAAMC,kBAAkB,GACpB,OAAOV,WAAW,KAAK,QAAQ,GAAG;AAAEW,IAAAA,QAAQ,EAAEX,WAAAA;AAAY,GAAC,GAAG;AAAEY,IAAAA,uBAAuB,EAAEZ,WAAAA;GAAa,CAAA;EAE1G,oBACIa,IAAA,CAACC,OAAO,EAAA;AACJjB,IAAAA,EAAE,EAAEA,EAAG;IACPkB,SAAS,EAAEC,UAAU,CAACrB,aAAa,IAAI,CAAGA,EAAAA,aAAa,WAAW,CAAE;AACpEsB,IAAAA,KAAK,EAAEd,YAAa;AACpBe,IAAAA,WAAW,EAAC,UAAU;AACtBC,IAAAA,MAAM,EAAEf,KAAM;AACdgB,IAAAA,M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AAM;AAAAO,MAAAA,QAAA,EAEbT,IAAAA;AAAI,KACA,CACZ,CAAA;AAAA,GACI,CAAC,CAAA;AAElB;;;;"}
@@ -1,4 +0,0 @@
1
- const mdiCheckCircle = 'M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z';
2
-
3
- export { mdiCheckCircle as m };
4
- //# sourceMappingURL=de24f857.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"de24f857.js","sources":["../../../lumx-icons/dist/esm/check-circle.js"],"sourcesContent":["export const mdiCheckCircle = 'M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z';"],"names":["mdiCheckCircle"],"mappings":"AAAO,MAAMA,cAAc,GAAG;;;;"}
@@ -1,75 +0,0 @@
1
- import { l as classNames } from './6589b796.js';
2
- import isBoolean from 'lodash/isBoolean';
3
- import isEmpty from 'lodash/isEmpty';
4
- import kebabCase from 'lodash/kebabCase';
5
-
6
- /**
7
- * Get the basic CSS class for the given type.
8
- *
9
- * @param prefix The class name prefix for the generated CSS class.
10
- * @param type The type of CSS class we want to generate (e.g.: 'color', 'variant', ...).
11
- * @param value The value of the type of the CSS class (e.g.: 'primary', 'button', ...).
12
- * @return The basic CSS class.
13
- */
14
- function getBasicClass({
15
- prefix,
16
- type,
17
- value
18
- }) {
19
- if (isBoolean(value)) {
20
- if (!value) {
21
- // False value should not return a class.
22
- return '';
23
- }
24
- const booleanPrefixes = ['has', 'is'];
25
- if (booleanPrefixes.some(booleanPrefix => type.toString().startsWith(booleanPrefix))) {
26
- return `${prefix}--${kebabCase(type)}`;
27
- }
28
- return `${prefix}--is-${kebabCase(type)}`;
29
- }
30
- return `${prefix}--${kebabCase(type)}-${value}`;
31
- }
32
-
33
- /**
34
- * Enhance isEmpty method to also works with numbers.
35
- *
36
- * @param value The value to check.
37
- * @return Whether the input value is empty or != 0.
38
- */
39
- const _isEmpty = value => {
40
- if (typeof value === 'number') {
41
- return value === 0;
42
- }
43
- return isEmpty(value);
44
- };
45
-
46
- /**
47
- * Return all basic LumX CSS classes which are available for every components.
48
- *
49
- * @see {@link /src/components/index.d.ts} for the possible values of each parameter.
50
- *
51
- * @param prefix The class name prefix for the generated CSS class.
52
- * @param props All the other props you want to generate a class.
53
- * The rule of thumb: the key is the name of the prop in the class, the value a string that will
54
- * be used in the classname to represent the value of the given prop.
55
- * @return All LumX basic CSS classes.
56
- */
57
- function handleBasicClasses({
58
- prefix,
59
- ...props
60
- }) {
61
- const otherClasses = {};
62
- if (!isEmpty(props)) {
63
- Object.keys(props).forEach(prop => {
64
- otherClasses[getBasicClass({
65
- prefix,
66
- type: prop,
67
- value: props[prop]
68
- })] = isBoolean(props[prop]) ? props[prop] : !_isEmpty(props[prop]);
69
- });
70
- }
71
- return classNames(prefix, otherClasses);
72
- }
73
-
74
- export { getBasicClass as g, handleBasicClasses as h };
75
- //# sourceMappingURL=e2afb13f.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"e2afb13f.js","sources":["../../../lumx-core/src/js/utils/className/getBasicClass.ts","../../../lumx-core/src/js/utils/className/handleBasicClasses.ts"],"sourcesContent":["import isBoolean from 'lodash/isBoolean';\nimport kebabCase from 'lodash/kebabCase';\n\n/**\n * Get the basic CSS class for the given type.\n *\n * @param prefix The class name prefix for the generated CSS class.\n * @param type The type of CSS class we want to generate (e.g.: 'color', 'variant', ...).\n * @param value The value of the type of the CSS class (e.g.: 'primary', 'button', ...).\n * @return The basic CSS class.\n */\nexport function getBasicClass({\n prefix,\n type,\n value,\n}: {\n prefix: string;\n type: string;\n value: string | number | boolean | undefined;\n}): string {\n if (isBoolean(value)) {\n if (!value) {\n // False value should not return a class.\n return '';\n }\n const booleanPrefixes = ['has', 'is'];\n\n if (booleanPrefixes.some((booleanPrefix) => type.toString().startsWith(booleanPrefix))) {\n return `${prefix}--${kebabCase(type)}`;\n }\n\n return `${prefix}--is-${kebabCase(type)}`;\n }\n\n return `${prefix}--${kebabCase(type)}-${value}`;\n}\n","import classNames from 'classnames';\n\nimport isBoolean from 'lodash/isBoolean';\nimport isEmpty from 'lodash/isEmpty';\n\nimport { getBasicClass } from './getBasicClass';\n\n/**\n * Enhance isEmpty method to also works with numbers.\n *\n * @param value The value to check.\n * @return Whether the input value is empty or != 0.\n */\nconst _isEmpty = (value: any) => {\n if (typeof value === 'number') {\n return value === 0;\n }\n\n return isEmpty(value);\n};\n\n/**\n * Return all basic LumX CSS classes which are available for every components.\n *\n * @see {@link /src/components/index.d.ts} for the possible values of each parameter.\n *\n * @param prefix The class name prefix for the generated CSS class.\n * @param props All the other props you want to generate a class.\n * The rule of thumb: the key is the name of the prop in the class, the value a string that will\n * be used in the classname to represent the value of the given prop.\n * @return All LumX basic CSS classes.\n */\nexport function handleBasicClasses({ prefix, ...props }: { prefix: string; [prop: string]: any }): string {\n const otherClasses: any = {};\n if (!isEmpty(props)) {\n Object.keys(props).forEach((prop) => {\n otherClasses[getBasicClass({ prefix, type: prop, value: props[prop] })] = isBoolean(props[prop])\n ? props[prop]\n : !_isEmpty(props[prop]);\n });\n }\n\n return classNames(prefix, otherClasses);\n}\n"],"names":["getBasicClass","prefix","type","value","isBoolean","booleanPrefixes","some","booleanPrefix","toString","startsWith","kebabCase","_isEmpty","isEmpty","handleBasicClasses","props","otherClasses","Object","keys","forEach","prop","classNames"],"mappings":";;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,aAAaA,CAAC;EAC1BC,MAAM;EACNC,IAAI;AACJC,EAAAA,KAAAA;AAKJ,CAAC,EAAU;AACP,EAAA,IAAIC,SAAS,CAACD,KAAK,CAAC,EAAE;IAClB,IAAI,CAACA,KAAK,EAAE;AACR;AACA,MAAA,OAAO,EAAE,CAAA;AACb,KAAA;AACA,IAAA,MAAME,eAAe,GAAG,CAAC,KAAK,EAAE,IAAI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IAAI,CAAC,GACX,CAACR,QAAQ,CAACG,KAAK,CAACK,IAAI,CAAC,CAAC,CAAA;AAChC,KAAC,CAAC,CAAA;AACN,GAAA;AAEA,EAAA,OAAOC,UAAU,CAACnB,MAAM,EAAEc,YAAY,CAAC,CAAA;AAC3C;;;;"}
@@ -1,94 +0,0 @@
1
- import { useMemo } from 'react';
2
- import { m as getRootClassName, n as forwardRef, b as Theme, l as classNames, A as Alignment, i as AspectRatio } from './6589b796.js';
3
- import take from 'lodash/take';
4
- import { u as useTheme } from './3181f000.js';
5
- import { h as handleBasicClasses } from './e2afb13f.js';
6
- import { jsx, jsxs } from 'react/jsx-runtime';
7
- import { T as Thumbnail } from './628468c4.js';
8
-
9
- /**
10
- * Component display name.
11
- */
12
- const COMPONENT_NAME = 'Mosaic';
13
-
14
- /**
15
- * Component default class name and class prefix.
16
- */
17
- const CLASSNAME = getRootClassName(COMPONENT_NAME);
18
-
19
- /**
20
- * Component default props.
21
- */
22
- const DEFAULT_PROPS = {};
23
-
24
- /**
25
- * Mosaic component.
26
- *
27
- * @param props Component props.
28
- * @param ref Component ref.
29
- * @return React element.
30
- */
31
- const Mosaic = forwardRef((props, ref) => {
32
- const defaultTheme = useTheme() || Theme.light;
33
- const {
34
- className,
35
- theme = defaultTheme,
36
- thumbnails,
37
- onImageClick,
38
- ...forwardedProps
39
- } = props;
40
- const handleImageClick = useMemo(() => {
41
- if (!onImageClick) return undefined;
42
- return (index, onClick) => event => {
43
- onClick?.(event);
44
- onImageClick?.(index);
45
- };
46
- }, [onImageClick]);
47
- return /*#__PURE__*/jsx("div", {
48
- ref: ref,
49
- ...forwardedProps,
50
- className: classNames(className, handleBasicClasses({
51
- prefix: CLASSNAME,
52
- theme
53
- }), {
54
- [`${CLASSNAME}--has-1-thumbnail`]: thumbnails?.length === 1,
55
- [`${CLASSNAME}--has-2-thumbnails`]: thumbnails?.length === 2,
56
- [`${CLASSNAME}--has-3-thumbnails`]: thumbnails?.length === 3,
57
- [`${CLASSNAME}--has-4-thumbnails`]: thumbnails?.length >= 4
58
- }),
59
- children: /*#__PURE__*/jsx("div", {
60
- className: `${CLASSNAME}__wrapper`,
61
- children: take(thumbnails, 4).map((thumbnail, index) => {
62
- const {
63
- image,
64
- onClick,
65
- align,
66
- ...thumbnailProps
67
- } = thumbnail;
68
- return /*#__PURE__*/jsxs("div", {
69
- className: `${CLASSNAME}__thumbnail`,
70
- children: [/*#__PURE__*/jsx(Thumbnail, {
71
- ...thumbnailProps,
72
- align: align || Alignment.left,
73
- image: image,
74
- theme: theme,
75
- aspectRatio: AspectRatio.free,
76
- fillHeight: true,
77
- onClick: handleImageClick?.(index, onClick) || onClick
78
- }), thumbnails.length > 4 && index === 3 && /*#__PURE__*/jsx("div", {
79
- className: `${CLASSNAME}__overlay`,
80
- children: /*#__PURE__*/jsxs("span", {
81
- children: ["+", thumbnails.length - 4]
82
- })
83
- })]
84
- }, index);
85
- })
86
- })
87
- });
88
- });
89
- Mosaic.displayName = COMPONENT_NAME;
90
- Mosaic.className = CLASSNAME;
91
- Mosaic.defaultProps = DEFAULT_PROPS;
92
-
93
- export { Mosaic };
94
- //# sourceMappingURL=e52f0d3f.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"e52f0d3f.js","sources":["../../src/components/mosaic/Mosaic.tsx"],"sourcesContent":["import { MouseEventHandler, useMemo } from 'react';\n\nimport classNames from 'classnames';\nimport take from 'lodash/take';\nimport { useTheme } from '@lumx/react/utils/theme/ThemeContext';\n\nimport { Alignment, AspectRatio, Theme, Thumbnail, ThumbnailProps } from '@lumx/react';\nimport { GenericProps, HasTheme } from '@lumx/react/utils/type';\nimport { getRootClassName, handleBasicClasses } from '@lumx/core/js/utils/className';\nimport { forwardRef } from '@lumx/react/utils/react/forwardRef';\n\n/**\n * Defines the props of the component.\n */\nexport interface MosaicProps extends GenericProps, HasTheme {\n /** Thumbnails. */\n thumbnails: ThumbnailProps[];\n /** On image click callback. */\n onImageClick?(index: number): void;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'Mosaic';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * Component default props.\n */\nconst DEFAULT_PROPS: Partial<MosaicProps> = {};\n\n/**\n * Mosaic component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const Mosaic = forwardRef<MosaicProps, HTMLDivElement>((props, ref) => {\n const defaultTheme = useTheme() || Theme.light;\n const { className, theme = defaultTheme, thumbnails, onImageClick, ...forwardedProps } = props;\n const handleImageClick = useMemo(() => {\n if (!onImageClick) return undefined;\n\n return (index: number, onClick?: MouseEventHandler): MouseEventHandler =>\n (event) => {\n onClick?.(event);\n onImageClick?.(index);\n };\n }, [onImageClick]);\n\n return (\n <div\n ref={ref}\n {...forwardedProps}\n className={classNames(className, handleBasicClasses({ prefix: CLASSNAME, theme }), {\n [`${CLASSNAME}--has-1-thumbnail`]: thumbnails?.length === 1,\n [`${CLASSNAME}--has-2-thumbnails`]: thumbnails?.length === 2,\n [`${CLASSNAME}--has-3-thumbnails`]: thumbnails?.length === 3,\n [`${CLASSNAME}--has-4-thumbnails`]: thumbnails?.length >= 4,\n })}\n >\n <div className={`${CLASSNAME}__wrapper`}>\n {take(thumbnails, 4).map((thumbnail: any, index: number) => {\n const { image, onClick, align, ...thumbnailProps } = thumbnail;\n\n return (\n <div key={index} className={`${CLASSNAME}__thumbnail`}>\n <Thumbnail\n {...thumbnailProps}\n align={align || Alignment.left}\n image={image}\n theme={theme}\n aspectRatio={AspectRatio.free}\n fillHeight\n onClick={handleImageClick?.(index, onClick) || onClick}\n />\n\n {thumbnails.length > 4 && index === 3 && (\n <div className={`${CLASSNAME}__overlay`}>\n <span>+{thumbnails.length - 4}</span>\n </div>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n});\nMosaic.displayName = COMPONENT_NAME;\nMosaic.className = CLASSNAME;\nMosaic.defaultProps = DEFAULT_PROPS;\n"],"names":["COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","Mosaic","forwardRef","props","ref","defaultTheme","useTheme","Theme","light","className","theme","thumbnails","onImageClick","forwardedProps","handleImageClick","useMemo","undefined","index","onClick","event","_jsx","classNames","handleBasicClasses","prefix","length","children","take","map","thumbnail","image","align","thumbnailProps","_jsxs","Thumbnail","Alignment","left","aspectRatio","AspectRatio","free","fillHeight","displayName","defaultProps"],"mappings":";;;;;;;;AAqBA;AACA;AACA;AACA,MAAMA,cAAc,GAAG,QAAQ,CAAA;;AAE/B;AACA;AACA;AACA,MAAMC,SAAS,GAAGC,gBAAgB,CAACF,cAAc,CAAC,CAAA;;AAElD;AACA;AACA;AACA,MAAMG,aAAmC,GAAG,EAAE,CAAA;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,MAAM,GAAGC,UAAU,CAA8B,CAACC,KAAK,EAAEC,GAAG,KAAK;EAC1E,MAAMC,YAAY,GAAGC,QAAQ,EAAE,IAAIC,KAAK,CAACC,KAAK,CAAA;EAC9C,MAAM;IAAEC,SAAS;AAAEC,IAAAA,KAAK,GAAGL,YAAY;IAAEM,UAAU;IAAEC,YAAY;IAAE,GAAGC,cAAAA;AAAe,GAAC,GAAGV,KAAK,CAAA;AAC9F,EAAA,MAAMW,gBAAgB,GAAGC,OAAO,CAAC,MAAM;AACnC,IAAA,IAAI,CAACH,YAAY,EAAE,OAAOI,SAAS,CAAA;AAEnC,IAAA,OAAO,CAACC,KAAa,EAAEC,OAA2B,KAC7CC,KAAK,IAAK;MACPD,OAAO,GAAGC,KAAK,CAAC,CAAA;MAChBP,YAAY,GAAGK,KAAK,CAAC,CAAA;KACxB,CAAA;AACT,GAAC,EAAE,CAACL,YAAY,CAAC,CAAC,CAAA;AAElB,EAAA,oBACIQ,GAAA,CAAA,KAAA,EAAA;AACIhB,IAAAA,GAAG,EAAEA,GAAI;AAAA,IAAA,GACLS,cAAc;AAClBJ,IAAAA,SAAS,EAAEY,UAAU,CAACZ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AgB,GAAGG,KAAK,EAAEC,OAAO,CAAC,IAAIA,OAAAA;AAAQ,WAC1D,CAAC,EAEDP,UAAU,CAACa,MAAM,GAAG,CAAC,IAAIP,KAAK,KAAK,CAAC,iBACjCG,GAAA,CAAA,KAAA,EAAA;YAAKX,SAAS,EAAE,CAAGX,EAAAA,SAAS,CAAY,SAAA,CAAA;AAAA2B,YAAAA,QAAA,eACpCO,IAAA,CAAA,MAAA,EAAA;AAAAP,cAAAA,QAAA,GAAM,GAAC,EAACd,UAAU,CAACa,MAAM,GAAG,CAAC,CAAA;aAAO,CAAA;AAAC,WACpC,CACR,CAAA;AAAA,SAAA,EAfKP,KAgBL,CAAC,CAAA;OAEb,CAAA;KACA,CAAA;AAAC,GACL,CAAC,CAAA;AAEd,CAAC,EAAC;AACFhB,MAAM,CAACuC,WAAW,GAAG3C,cAAc,CAAA;AACnCI,MAAM,CAACQ,SAAS,GAAGX,SAAS,CAAA;AAC5BG,MAAM,CAACwC,YAAY,GAAGzC,aAAa;;;;"}
@@ -1,50 +0,0 @@
1
- import { useState, useRef, useEffect } from 'react';
2
- import { W as WINDOW } from './478b5c92.js';
3
-
4
- /** Check if user prefers reduced motion */
5
- function isReducedMotion() {
6
- return WINDOW?.matchMedia?.('(prefers-reduced-motion: reduce)').matches;
7
- }
8
-
9
- /**
10
- * Returns true if the component is visible tracking the opacity transition.
11
- *
12
- * @param ref Element on which to listen the transition event.
13
- * @param isComponentVisible Whether the component intends to be visible or not.
14
- * @param onVisibilityChange Callback called when the visibility changes.
15
- * @return true if the component should be rendered
16
- */
17
- const useTransitionVisibility = (ref, isComponentVisible, timeout, onVisibilityChange) => {
18
- const [isVisible, setVisible] = useState(isComponentVisible);
19
- const previousVisibility = useRef(isVisible);
20
-
21
- // On component visibility change.
22
- useEffect(() => {
23
- if (isComponentVisible) {
24
- setVisible(true);
25
- return undefined;
26
- }
27
- const {
28
- current: element
29
- } = ref;
30
-
31
- // Transition event is not supported or the user prefers reduced motion.
32
- // => Skip and set visibility to false directly.
33
- if (!element || !window.TransitionEvent || isReducedMotion()) {
34
- setVisible(false);
35
- return undefined;
36
- }
37
- const timer = setTimeout(() => setVisible(false), timeout);
38
- return () => clearTimeout(timer);
39
- }, [isComponentVisible, ref, timeout]);
40
- useEffect(() => {
41
- if (onVisibilityChange && previousVisibility.current !== isVisible) {
42
- onVisibilityChange(isVisible);
43
- previousVisibility.current = isVisible;
44
- }
45
- }, [isVisible, onVisibilityChange]);
46
- return isVisible || isComponentVisible;
47
- };
48
-
49
- export { isReducedMotion as i, useTransitionVisibility as u };
50
- //# sourceMappingURL=e6dd117e.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"e6dd117e.js","sources":["../../src/utils/browser/isReducedMotion.ts","../../src/hooks/useTransitionVisibility.ts"],"sourcesContent":["import { WINDOW } from '@lumx/react/constants';\n\n/** Check if user prefers reduced motion */\nexport function isReducedMotion() {\n return WINDOW?.matchMedia?.('(prefers-reduced-motion: reduce)').matches;\n}\n","import { RefObject, useEffect, useRef, useState } from 'react';\nimport { isReducedMotion } from '@lumx/react/utils/browser/isReducedMotion';\n\n/**\n * Returns true if the component is visible tracking the opacity transition.\n *\n * @param ref Element on which to listen the transition event.\n * @param isComponentVisible Whether the component intends to be visible or not.\n * @param onVisibilityChange Callback called when the visibility changes.\n * @return true if the component should be rendered\n */\nexport const useTransitionVisibility = (\n ref: RefObject<HTMLElement>,\n isComponentVisible: boolean,\n timeout: number,\n onVisibilityChange?: (isVisible: boolean) => void,\n) => {\n const [isVisible, setVisible] = useState(isComponentVisible);\n const previousVisibility = useRef(isVisible);\n\n // On component visibility change.\n useEffect(() => {\n if (isComponentVisible) {\n setVisible(true);\n return undefined;\n }\n const { current: element } = ref;\n\n // Transition event is not supported or the user prefers reduced motion.\n // => Skip and set visibility to false directly.\n if (!element || !window.TransitionEvent || isReducedMotion()) {\n setVisible(false);\n return undefined;\n }\n\n const timer = setTimeout(() => setVisible(false), timeout);\n return () => clearTimeout(timer);\n }, [isComponentVisible, ref, timeout]);\n\n useEffect(() => {\n if (onVisibilityChange && previousVisibility.current !== isVisible) {\n onVisibilityChange(isVisible);\n previousVisibility.current = isVisible;\n }\n }, [isVisible, onVisibilityChange]);\n\n return isVisible || isComponentVisible;\n};\n"],"names":["isReducedMotion","WINDOW","matchMedia","matches","useTransitionVisibility","ref","isComponentVisible","timeout","onVisibilityChange","isVisible","setVisible","useState","previousVisibility","useRef","useEffect","undefined","current","element","window","TransitionEvent","timer","setTimeout","clearTimeout"],"mappings":";;;AAEA;AACO,SAASA,eAAeA,GAAG;AAC9B,EAAA,OAAOC,MAAM,EAAEC,UAAU,GAAG,kCAAkC,CAAC,CAACC,OAAO,CAAA;AAC3E;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,uBAAuB,GAAGA,CACnCC,GAA2B,EAC3BC,kBAA2B,EAC3BC,OAAe,EACfC,kBAAiD,KAChD;EACD,MAAM,CAACC,SAAS,EAAEC,UAAU,CAAC,GAAGC,QAAQ,CAACL,kBAAkB,CAAC,CAAA;AAC5D,EAAA,MAAMM,kBAAkB,GAAGC,MAAM,CAACJ,SAAS,CAAC,CAAA;;AAE5C;AACAK,EAAAA,SAAS,CAAC,MAAM;AACZ,IAAA,IAAIR,kBAAkB,EAAE;MACpBI,UAAU,CAAC,IAAI,CAAC,CAAA;AAChB,MAAA,OAAOK,SAAS,CAAA;AACpB,KAAA;IACA,MAAM;AAAEC,MAAAA,OAAO,EAAEC,OAAAA;AAAQ,KAAC,GAAGZ,GAAG,CAAA;;AAEhC;AACA;IACA,IAAI,CAACY,OAAO,IAAI,CAACC,MAAM,CAACC,eAAe,IAAInB,eAAe,EAAE,EAAE;MAC1DU,UAAU,CAAC,KAAK,CAAC,CAAA;AACjB,MAAA,OAAOK,SAAS,CAAA;AACpB,KAAA;IAEA,MAAMK,KAAK,GAAGC,UAAU,CAAC,MAAMX,UAAU,CAAC,KAAK,CAAC,EAAEH,OAAO,CAAC,CAAA;AAC1D,IAAA,OAAO,MAAMe,YAAY,CAACF,KAAK,CAAC,CAAA;GACnC,EAAE,CAACd,kBAAkB,EAAED,GAAG,EAAEE,OAAO,CAAC,CAAC,CAAA;AAEtCO,EAAAA,SAAS,CAAC,MAAM;AACZ,IAAA,IAAIN,kBAAkB,IAAII,kBAAkB,CAACI,OAAO,KAAKP,SAAS,EAAE;MAChED,kBAAkB,CAACC,SAAS,CAAC,CAAA;MAC7BG,kBAAkB,CAACI,OAAO,GAAGP,SAAS,CAAA;AAC1C,KAAA;AACJ,GAAC,EAAE,CAACA,SAAS,EAAED,kBAAkB,CAAC,CAAC,CAAA;EAEnC,OAAOC,SAAS,IAAIH,kBAAkB,CAAA;AAC1C;;;;"}
@@ -1,9 +0,0 @@
1
- import React__default from 'react';
2
-
3
- /**
4
- * Similar to `isComponent` but more precise as it's not based on the component `displayName` but on the component function reference.
5
- */
6
- const isComponentType = type => node => /*#__PURE__*/React__default.isValidElement(node) && node.type === type;
7
-
8
- export { isComponentType as i };
9
- //# sourceMappingURL=e806b848.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"e806b848.js","sources":["../../src/utils/type/isComponentType.ts"],"sourcesContent":["import React, { ReactElement, ReactNode } from 'react';\n\n/**\n * Similar to `isComponent` but more precise as it's not based on the component `displayName` but on the component function reference.\n */\nexport const isComponentType =\n (type: ReactElement['type']) =>\n (node: ReactNode): node is ReactElement =>\n React.isValidElement(node) && node.type === type;\n"],"names":["isComponentType","type","node","React","isValidElement"],"mappings":";;AAEA;AACA;AACA;MACaA,eAAe,GACvBC,IAA0B,IAC1BC,IAAe,iBACZC,cAAK,CAACC,cAAc,CAACF,IAAI,CAAC,IAAIA,IAAI,CAACD,IAAI,KAAKA;;;;"}
@@ -1,29 +0,0 @@
1
- import React__default, { useContext } from 'react';
2
- import { jsx } from 'react/jsx-runtime';
3
-
4
- const DisabledStateContext = /*#__PURE__*/React__default.createContext({
5
- state: null
6
- });
7
- /**
8
- * Disabled state provider.
9
- * All nested LumX Design System components inherit this disabled state.
10
- */
11
- function DisabledStateProvider({
12
- children,
13
- ...value
14
- }) {
15
- return /*#__PURE__*/jsx(DisabledStateContext.Provider, {
16
- value: value,
17
- children: children
18
- });
19
- }
20
-
21
- /**
22
- * Get DisabledState context value
23
- */
24
- function useDisabledStateContext() {
25
- return useContext(DisabledStateContext);
26
- }
27
-
28
- export { DisabledStateProvider as D, useDisabledStateContext as u };
29
- //# sourceMappingURL=ea04260d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ea04260d.js","sources":["../../src/utils/disabled/DisabledStateContext.tsx"],"sourcesContent":["import React, { useContext } from 'react';\n\n/** Disable state */\ntype DisabledStateContextValue =\n | {\n state: 'disabled';\n }\n | { state: undefined | null };\n\nexport const DisabledStateContext = React.createContext<DisabledStateContextValue>({ state: null });\n\nexport type DisabledStateProviderProps = DisabledStateContextValue & {\n children: React.ReactNode;\n};\n\n/**\n * Disabled state provider.\n * All nested LumX Design System components inherit this disabled state.\n */\nexport function DisabledStateProvider({ children, ...value }: DisabledStateProviderProps) {\n return <DisabledStateContext.Provider value={value}>{children}</DisabledStateContext.Provider>;\n}\n\n/**\n * Get DisabledState context value\n */\nexport function useDisabledStateContext(): DisabledStateContextValue {\n return useContext(DisabledStateContext);\n}\n"],"names":["DisabledStateContext","React","createContext","state","DisabledStateProvider","children","value","_jsx","Provider","useDisabledStateContext","useContext"],"mappings":";;;AASO,MAAMA,oBAAoB,gBAAGC,cAAK,CAACC,aAAa,CAA4B;AAAEC,EAAAA,KAAK,EAAE,IAAA;AAAK,CAAC,CAAC,CAAA;AAMnG;AACA;AACA;AACA;AACO,SAASC,qBAAqBA,CAAC;EAAEC,QAAQ;EAAE,GAAGC,KAAAA;AAAkC,CAAC,EAAE;AACtF,EAAA,oBAAOC,GAAA,CAACP,oBAAoB,CAACQ,QAAQ,EAAA;AAACF,IAAAA,KAAK,EAAEA,KAAM;AAAAD,IAAAA,QAAA,EAAEA,QAAAA;AAAQ,GAAgC,CAAC,CAAA;AAClG,CAAA;;AAEA;AACA;AACA;AACO,SAASI,uBAAuBA,GAA8B;EACjE,OAAOC,UAAU,CAACV,oBAAoB,CAAC,CAAA;AAC3C;;;;"}
@@ -1,150 +0,0 @@
1
- import React__default, { useEffect } from 'react';
2
- import { a as SlideshowControls, b as Slides, c as buildSlideShowGroupId, D as DEFAULT_OPTIONS } from './34c59f5b.js';
3
- export { S as SlideshowItem } from './34c59f5b.js';
4
- import { m as mergeRefs } from './f0d7d6ea.js';
5
- import { u as useTheme } from './3181f000.js';
6
- import { n as forwardRef, b as Theme } from './6589b796.js';
7
- import { jsx } from 'react/jsx-runtime';
8
-
9
- /**
10
- * Hook that allows to control when there is a focus event within a given element, meaning
11
- * that any element within the given target will trigger the focus in and focus out events.
12
- * @param options - UseFocusWithinOptions
13
- */
14
- const useFocusWithin = ({
15
- element,
16
- onFocusIn,
17
- onFocusOut
18
- }) => {
19
- useEffect(() => {
20
- if (element) {
21
- element.addEventListener('focusin', onFocusIn);
22
- element.addEventListener('focusout', onFocusOut);
23
- }
24
- return () => {
25
- if (element) {
26
- element.removeEventListener('focusin', onFocusIn);
27
- element.removeEventListener('focusout', onFocusOut);
28
- }
29
- };
30
- }, [onFocusIn, element, onFocusOut]);
31
- };
32
-
33
- /**
34
- * Component default props.
35
- */
36
- const DEFAULT_PROPS = DEFAULT_OPTIONS;
37
-
38
- /**
39
- * Slideshow component.
40
- *
41
- * @param props Component props.
42
- * @param ref Component ref.
43
- * @return React element.
44
- */
45
- const Slideshow = forwardRef((props, ref) => {
46
- const defaultTheme = useTheme() || Theme.light;
47
- const {
48
- activeIndex,
49
- autoPlay = DEFAULT_PROPS.autoPlay,
50
- children,
51
- className,
52
- fillHeight,
53
- groupBy = DEFAULT_OPTIONS.groupBy,
54
- interval = DEFAULT_PROPS.interval,
55
- onChange,
56
- slideshowControlsProps,
57
- theme = defaultTheme,
58
- id,
59
- slidesId,
60
- slideGroupLabel,
61
- ...forwardedProps
62
- } = props;
63
- // Number of slideshow items.
64
- const itemsCount = React__default.Children.count(children);
65
- const {
66
- activeIndex: currentIndex,
67
- slideshowId,
68
- setSlideshow,
69
- isAutoPlaying,
70
- slideshowSlidesId,
71
- slidesCount,
72
- onNextClick,
73
- onPaginationClick,
74
- onPreviousClick,
75
- slideshow,
76
- stopAutoPlay,
77
- startAutoPlay,
78
- toggleAutoPlay,
79
- toggleForcePause
80
- } = SlideshowControls.useSlideshowControls({
81
- activeIndex,
82
- defaultActiveIndex: DEFAULT_PROPS.activeIndex,
83
- autoPlay: Boolean(autoPlay),
84
- itemsCount,
85
- groupBy,
86
- id,
87
- interval,
88
- onChange,
89
- slidesId
90
- });
91
- useFocusWithin({
92
- element: slideshow,
93
- onFocusIn: stopAutoPlay,
94
- onFocusOut: startAutoPlay
95
- });
96
- const showControls = slideshowControlsProps && slidesCount > 1;
97
- return /*#__PURE__*/jsx(Slides, {
98
- activeIndex: currentIndex,
99
- id: slideshowId,
100
- className: className,
101
- theme: theme,
102
- fillHeight: fillHeight,
103
- groupBy: groupBy,
104
- isAutoPlaying: isAutoPlaying,
105
- autoPlay: autoPlay,
106
- slidesId: slideshowSlidesId,
107
- toggleAutoPlay: toggleAutoPlay,
108
- ref: mergeRefs(ref, setSlideshow),
109
- hasControls: showControls,
110
- slideGroupLabel: slideGroupLabel,
111
- afterSlides: slideshowControlsProps && slidesCount > 1 ? /*#__PURE__*/jsx("div", {
112
- className: `${Slides.className}__controls`,
113
- children: /*#__PURE__*/jsx(SlideshowControls, {
114
- ...slideshowControlsProps,
115
- activeIndex: currentIndex,
116
- onPaginationClick: onPaginationClick,
117
- onNextClick: onNextClick,
118
- onPreviousClick: onPreviousClick,
119
- slidesCount: slidesCount,
120
- parentRef: slideshow,
121
- theme: theme,
122
- isAutoPlaying: isAutoPlaying,
123
- nextButtonProps: {
124
- 'aria-controls': slideshowSlidesId,
125
- ...slideshowControlsProps.nextButtonProps
126
- },
127
- previousButtonProps: {
128
- 'aria-controls': slideshowSlidesId,
129
- ...slideshowControlsProps.previousButtonProps
130
- },
131
- playButtonProps: autoPlay ? {
132
- 'aria-controls': slideshowSlidesId,
133
- onClick: toggleForcePause,
134
- ...slideshowControlsProps.playButtonProps
135
- } : undefined,
136
- paginationItemProps: index => ({
137
- 'aria-controls': buildSlideShowGroupId(slideshowSlidesId, index),
138
- ...slideshowControlsProps.paginationItemProps?.(index)
139
- })
140
- })
141
- }) : undefined,
142
- ...forwardedProps,
143
- children: children
144
- });
145
- });
146
- Slideshow.displayName = 'Slideshow';
147
- Slideshow.defaultProps = DEFAULT_PROPS;
148
-
149
- export { Slides, Slideshow, SlideshowControls };
150
- //# sourceMappingURL=eaa8b1d8.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eaa8b1d8.js","sources":["../../src/hooks/useFocusWithin.ts","../../src/components/slideshow/Slideshow.tsx"],"sourcesContent":["import { useEffect } from 'react';\n\nexport interface UseFocusWithinOptions {\n /** element to add the focus within to */\n element: HTMLElement | null;\n /** callback to be executed on focus in */\n onFocusIn: (ev: FocusEvent) => void;\n /** callback to be executed on focus out */\n onFocusOut: (ev: FocusEvent) => void;\n}\n\n/**\n * Hook that allows to control when there is a focus event within a given element, meaning\n * that any element within the given target will trigger the focus in and focus out events.\n * @param options - UseFocusWithinOptions\n */\nexport const useFocusWithin = ({ element, onFocusIn, onFocusOut }: UseFocusWithinOptions) => {\n useEffect(() => {\n if (element) {\n element.addEventListener('focusin', onFocusIn);\n\n element.addEventListener('focusout', onFocusOut);\n }\n\n return () => {\n if (element) {\n element.removeEventListener('focusin', onFocusIn);\n\n element.removeEventListener('focusout', onFocusOut);\n }\n };\n }, [onFocusIn, element, onFocusOut]);\n};\n","import React from 'react';\n\nimport { SlideshowControls, SlideshowControlsProps, Theme, Slides, SlidesProps } from '@lumx/react';\nimport { DEFAULT_OPTIONS } from '@lumx/react/hooks/useSlideshowControls';\nimport { GenericProps } from '@lumx/react/utils/type';\nimport { useFocusWithin } from '@lumx/react/hooks/useFocusWithin';\nimport { mergeRefs } from '@lumx/react/utils/react/mergeRefs';\nimport { useTheme } from '@lumx/react/utils/theme/ThemeContext';\nimport { forwardRef } from '@lumx/react/utils/react/forwardRef';\n\nimport { buildSlideShowGroupId } from './SlideshowItemGroup';\n\n/**\n * Defines the props of the component.\n */\nexport interface SlideshowProps\n extends GenericProps,\n Pick<SlidesProps, 'autoPlay' | 'slidesId' | 'id' | 'theme' | 'fillHeight' | 'groupBy' | 'slideGroupLabel'> {\n /** current slide active */\n activeIndex?: SlidesProps['activeIndex'];\n /** Interval between each slide when automatic rotation is enabled. */\n interval?: number;\n /** Props to pass to the slideshow controls (minus those already set by the Slideshow props). */\n slideshowControlsProps?: Pick<\n SlideshowControlsProps,\n 'nextButtonProps' | 'previousButtonProps' | 'paginationItemProps'\n > &\n Omit<\n SlideshowControlsProps,\n | 'activeIndex'\n | 'onPaginationClick'\n | 'onNextClick'\n | 'onPreviousClick'\n | 'slidesCount'\n | 'parentRef'\n | 'theme'\n >;\n /** Callback when slide changes */\n onChange?(index: number): void;\n /** Children */\n children?: React.ReactNode;\n}\n\n/**\n * Component default props.\n */\nconst DEFAULT_PROPS: Partial<SlideshowProps> = DEFAULT_OPTIONS;\n\n/**\n * Slideshow component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const Slideshow = forwardRef<SlideshowProps, HTMLDivElement>((props, ref) => {\n const defaultTheme = useTheme() || Theme.light;\n const {\n activeIndex,\n autoPlay = DEFAULT_PROPS.autoPlay,\n children,\n className,\n fillHeight,\n groupBy = DEFAULT_OPTIONS.groupBy,\n interval = DEFAULT_PROPS.interval,\n onChange,\n slideshowControlsProps,\n theme = defaultTheme,\n id,\n slidesId,\n slideGroupLabel,\n ...forwardedProps\n } = props;\n // Number of slideshow items.\n const itemsCount = React.Children.count(children);\n\n const {\n activeIndex: currentIndex,\n slideshowId,\n setSlideshow,\n isAutoPlaying,\n slideshowSlidesId,\n slidesCount,\n onNextClick,\n onPaginationClick,\n onPreviousClick,\n slideshow,\n stopAutoPlay,\n startAutoPlay,\n toggleAutoPlay,\n toggleForcePause,\n } = SlideshowControls.useSlideshowControls({\n activeIndex,\n defaultActiveIndex: DEFAULT_PROPS.activeIndex as number,\n autoPlay: Boolean(autoPlay),\n itemsCount,\n groupBy,\n id,\n interval,\n onChange,\n slidesId,\n });\n\n useFocusWithin({\n element: slideshow,\n onFocusIn: stopAutoPlay,\n onFocusOut: startAutoPlay,\n });\n\n const showControls = slideshowControlsProps && slidesCount > 1;\n\n return (\n <Slides\n activeIndex={currentIndex}\n id={slideshowId}\n className={className}\n theme={theme}\n fillHeight={fillHeight}\n groupBy={groupBy}\n isAutoPlaying={isAutoPlaying}\n autoPlay={autoPlay}\n slidesId={slideshowSlidesId}\n toggleAutoPlay={toggleAutoPlay}\n ref={mergeRefs(ref, setSlideshow)}\n hasControls={showControls}\n slideGroupLabel={slideGroupLabel}\n afterSlides={\n slideshowControlsProps && slidesCount > 1 ? (\n <div className={`${Slides.className}__controls`}>\n <SlideshowControls\n {...slideshowControlsProps}\n activeIndex={currentIndex}\n onPaginationClick={onPaginationClick}\n onNextClick={onNextClick}\n onPreviousClick={onPreviousClick}\n slidesCount={slidesCount}\n parentRef={slideshow}\n theme={theme}\n isAutoPlaying={isAutoPlaying}\n nextButtonProps={{\n 'aria-controls': slideshowSlidesId,\n ...slideshowControlsProps.nextButtonProps,\n }}\n previousButtonProps={{\n 'aria-controls': slideshowSlidesId,\n ...slideshowControlsProps.previousButtonProps,\n }}\n playButtonProps={\n autoPlay\n ? {\n 'aria-controls': slideshowSlidesId,\n onClick: toggleForcePause,\n ...slideshowControlsProps.playButtonProps,\n }\n : undefined\n }\n paginationItemProps={(index) => ({\n 'aria-controls': buildSlideShowGroupId(slideshowSlidesId, index),\n ...slideshowControlsProps.paginationItemProps?.(index),\n })}\n />\n </div>\n ) : undefined\n }\n {...forwardedProps}\n >\n {children}\n </Slides>\n );\n});\n\nSlideshow.displayName = 'Slideshow';\nSlideshow.defaultProps = DEFAULT_PROPS;\n"],"names":["useFocusWithin","element","onFocusIn","onFocusOut","useEffect","addEventListener","removeEventListener","DEFAULT_PROPS","DEFAULT_OPTIONS","Slideshow","forwardRef","props","ref","defaultTheme","useTheme","Theme","light","activeIndex","autoPlay","children","className","fillHeight","groupBy","interval","onChange","slideshowControlsProps","theme","id","slidesId","slideGroupLabel","forwardedProps","itemsCount","React","Children","count","currentIndex","slideshowId","setSlideshow","isAutoPlaying","slideshowSlidesId","slidesCount","onNextClick","onPaginationClick","onPreviousClick","slideshow","stopAutoPlay","startAutoPlay","toggleAutoPlay","toggleForcePause","SlideshowControls","useSlideshowControls","defaultActiveIndex","Boolean","showControls","_jsx","Slides","mergeRefs","hasControls","afterSlides","parentRef","nextButtonProps","previousButtonProps","playButtonProps","onClick","undefined","paginationItemProps","index","buildSlideShowGroupId","displayName","defaultProps"],"mappings":";;;;;;;;AAWA;AACA;AACA;AACA;AACA;AACO,MAAMA,cAAc,GAAGA,CAAC;EAAEC,OAAO;EAAEC,SAAS;AAAEC,EAAAA,UAAAA;AAAkC,CAAC,KAAK;AACzFC,EAAAA,SAAS,CAAC,MAAM;AACZ,IAAA,IAAIH,OAAO,EAAE;AACTA,MAAAA,OAAO,CAACI,gBAAgB,CAAC,SAAS,EAAEH,SAAS,CAAC,CAAA;AAE9CD,MAAAA,OAAO,CAACI,gBAAgB,CAAC,UAAU,EAAEF,UAAU,CAAC,CAAA;AACpD,KAAA;AAEA,IAAA,OAAO,MAAM;AACT,MAAA,IAAIF,OAAO,EAAE;AACTA,QAAAA,OAAO,CAACK,mBAAmB,CAAC,SAAS,EAAEJ,SAAS,CAAC,CAAA;AAEjDD,QAAAA,OAAO,CAACK,mBAAmB,CAAC,UAAU,EAAEH,UAAU,CAAC,CAAA;AACvD,OAAA;KACH,CAAA;GACJ,EAAE,CAACD,SAAS,EAAED,OAAO,EAAEE,UAAU,CAAC,CAAC,CAAA;AACxC,CAAC;;ACWD;AACA;AACA;AACA,MAAMI,aAAsC,GAAGC,e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iB;AAClC,UAAA,GAAGd,sBAAsB,CAACmC,eAAAA;SAC5B;AACFC,QAAAA,mBAAmB,EAAE;AACjB,UAAA,eAAe,EAAEtB,iBAAiB;AAClC,UAAA,GAAGd,sBAAsB,CAACoC,mBAAAA;SAC5B;QACFC,eAAe,EACX5C,QAAQ,GACF;AACI,UAAA,eAAe,EAAEqB,iBAAiB;AAClCwB,UAAAA,OAAO,EAAEf,gBAAgB;AACzB,UAAA,GAAGvB,sBAAsB,CAACqC,eAAAA;AAC9B,SAAC,GACDE,SACT;QACDC,mBAAmB,EAAGC,KAAK,KAAM;AAC7B,UAAA,eAAe,EAAEC,qBAAqB,CAAC5B,iBAAiB,EAAE2B,KAAK,CAAC;AAChE,UAAA,GAAGzC,sBAAsB,CAACwC,mBAAmB,GAAGC,KAAK,CAAA;SACxD,CAAA;OACJ,CAAA;KACA,CAAC,GACNF,SACP;AAAA,IAAA,GACGlC,cAAc;AAAAX,IAAAA,QAAA,EAEjBA,QAAAA;AAAQ,GACL,CAAC,CAAA;AAEjB,CAAC,EAAC;AAEFV,SAAS,CAAC2D,WAAW,GAAG,WAAW,CAAA;AACnC3D,SAAS,CAAC4D,YAAY,GAAG9D,aAAa;;;;"}
@@ -1,4 +0,0 @@
1
- const mdiClose = 'M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z';
2
-
3
- export { mdiClose as m };
4
- //# sourceMappingURL=eaf6c45a.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eaf6c45a.js","sources":["../../../lumx-icons/dist/esm/close.js"],"sourcesContent":["export const mdiClose = 'M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z';"],"names":["mdiClose"],"mappings":"AAAO,MAAMA,QAAQ,GAAG;;;;"}