@lumx/react 2.2.18-alpha-hooks.1 → 2.2.20-alpha-type.1

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 (311) hide show
  1. package/esm/_internal/{alertdialog.1.js → AlertDialog.js} +8 -8
  2. package/esm/_internal/AlertDialog.js.map +1 -0
  3. package/esm/_internal/{autocompletemultiple.2.js → AutocompleteMultiple.js} +9 -9
  4. package/esm/_internal/AutocompleteMultiple.js.map +1 -0
  5. package/esm/_internal/{avatar.3.js → Avatar2.js} +4 -4
  6. package/esm/_internal/Avatar2.js.map +1 -0
  7. package/esm/_internal/{badge.4.js → Badge2.js} +3 -3
  8. package/esm/_internal/Badge2.js.map +1 -0
  9. package/esm/_internal/{button.5.js → Button2.js} +5 -5
  10. package/esm/_internal/Button2.js.map +1 -0
  11. package/esm/_internal/{buttongroup.7.js → ButtonGroup.js} +3 -3
  12. package/esm/_internal/ButtonGroup.js.map +1 -0
  13. package/esm/_internal/{buttonroot.57.js → ButtonRoot.js} +4 -4
  14. package/esm/_internal/ButtonRoot.js.map +1 -0
  15. package/esm/_internal/{checkbox.8.js → Checkbox2.js} +10 -8
  16. package/esm/_internal/Checkbox2.js.map +1 -0
  17. package/esm/_internal/{chip.9.js → Chip2.js} +3 -3
  18. package/esm/_internal/Chip2.js.map +1 -0
  19. package/esm/_internal/{chipgroup.10.js → ChipGroup.js} +3 -3
  20. package/esm/_internal/ChipGroup.js.map +1 -0
  21. package/esm/_internal/ClickAwayProvider.js +194 -0
  22. package/esm/_internal/ClickAwayProvider.js.map +1 -0
  23. package/esm/_internal/{commentblock.11.js → CommentBlock.js} +5 -5
  24. package/esm/_internal/CommentBlock.js.map +1 -0
  25. package/esm/_internal/{datepickerfield.12.js → DatePickerField.js} +27 -20
  26. package/esm/_internal/DatePickerField.js.map +1 -0
  27. package/esm/_internal/{dialog.13.js → Dialog2.js} +13 -13
  28. package/esm/_internal/Dialog2.js.map +1 -0
  29. package/esm/_internal/{divider.14.js → Divider2.js} +3 -3
  30. package/esm/_internal/Divider2.js.map +1 -0
  31. package/esm/_internal/{draghandle.15.js → DragHandle.js} +4 -4
  32. package/esm/_internal/DragHandle.js.map +1 -0
  33. package/esm/_internal/{dropdown.16.js → Dropdown2.js} +6 -6
  34. package/esm/_internal/Dropdown2.js.map +1 -0
  35. package/esm/_internal/{expansionpanel.17.js → ExpansionPanel.js} +8 -8
  36. package/esm/_internal/ExpansionPanel.js.map +1 -0
  37. package/esm/_internal/{flag.18.js → Flag2.js} +4 -4
  38. package/esm/_internal/Flag2.js.map +1 -0
  39. package/esm/_internal/{flexbox.19.js → FlexBox.js} +3 -3
  40. package/esm/_internal/FlexBox.js.map +1 -0
  41. package/esm/_internal/GenericBlock.js +90 -0
  42. package/esm/_internal/GenericBlock.js.map +1 -0
  43. package/esm/_internal/{griditem.20.js → GridItem.js} +3 -3
  44. package/esm/_internal/GridItem.js.map +1 -0
  45. package/esm/_internal/{icon.21.js → Icon2.js} +3 -3
  46. package/esm/_internal/Icon2.js.map +1 -0
  47. package/esm/_internal/{iconbutton.6.js → IconButton.js} +6 -6
  48. package/esm/_internal/IconButton.js.map +1 -0
  49. package/esm/_internal/{imageblock.22.js → ImageBlock.js} +4 -4
  50. package/esm/_internal/ImageBlock.js.map +1 -0
  51. package/esm/_internal/{inputhelper.23.js → InputHelper.js} +3 -3
  52. package/esm/_internal/InputHelper.js.map +1 -0
  53. package/esm/_internal/{inputlabel.24.js → InputLabel.js} +3 -3
  54. package/esm/_internal/InputLabel.js.map +1 -0
  55. package/esm/_internal/{lightbox.25.js → Lightbox2.js} +12 -12
  56. package/esm/_internal/Lightbox2.js.map +1 -0
  57. package/esm/_internal/{link.26.js → Link2.js} +5 -5
  58. package/esm/_internal/Link2.js.map +1 -0
  59. package/esm/_internal/{linkpreview.27.js → LinkPreview.js} +26 -16
  60. package/esm/_internal/LinkPreview.js.map +1 -0
  61. package/esm/_internal/{list.28.js → List2.js} +6 -6
  62. package/esm/_internal/List2.js.map +1 -0
  63. package/esm/_internal/{listsubheader.29.js → ListSubheader.js} +3 -3
  64. package/esm/_internal/ListSubheader.js.map +1 -0
  65. package/esm/_internal/{message.30.js → Message2.js} +4 -4
  66. package/esm/_internal/Message2.js.map +1 -0
  67. package/esm/_internal/{mosaic.31.js → Mosaic2.js} +4 -4
  68. package/esm/_internal/Mosaic2.js.map +1 -0
  69. package/esm/_internal/{notification.32.js → Notification2.js} +7 -7
  70. package/esm/_internal/Notification2.js.map +1 -0
  71. package/esm/_internal/{popover.33.js → Popover2.js} +51 -15
  72. package/esm/_internal/Popover2.js.map +1 -0
  73. package/esm/_internal/{postblock.34.js → PostBlock.js} +5 -5
  74. package/esm/_internal/PostBlock.js.map +1 -0
  75. package/esm/_internal/{progress.35.js → Progress2.js} +3 -3
  76. package/esm/_internal/Progress2.js.map +1 -0
  77. package/esm/_internal/{progresstrackersteppanel.36.js → ProgressTrackerStepPanel.js} +8 -8
  78. package/esm/_internal/ProgressTrackerStepPanel.js.map +1 -0
  79. package/esm/_internal/{radiogroup.37.js → RadioGroup.js} +6 -6
  80. package/esm/_internal/RadioGroup.js.map +1 -0
  81. package/esm/_internal/{selectmultiple.38.js → SelectMultiple.js} +28 -16
  82. package/esm/_internal/SelectMultiple.js.map +1 -0
  83. package/esm/_internal/{sidenavigationitem.39.js → SideNavigationItem.js} +15 -11
  84. package/esm/_internal/SideNavigationItem.js.map +1 -0
  85. package/esm/_internal/{skeletontypography.40.js → SkeletonTypography.js} +3 -3
  86. package/esm/_internal/SkeletonTypography.js.map +1 -0
  87. package/esm/_internal/{slider.41.js → Slider2.js} +6 -6
  88. package/esm/_internal/Slider2.js.map +1 -0
  89. package/esm/_internal/{slides.42.js → Slides.js} +8 -8
  90. package/esm/_internal/Slides.js.map +1 -0
  91. package/esm/_internal/{switch.43.js → Switch2.js} +6 -6
  92. package/esm/_internal/Switch2.js.map +1 -0
  93. package/esm/_internal/{tabpanel.45.js → TabPanel.js} +6 -6
  94. package/esm/_internal/TabPanel.js.map +1 -0
  95. package/esm/_internal/{tablerow.44.js → TableRow.js} +4 -4
  96. package/esm/_internal/TableRow.js.map +1 -0
  97. package/esm/_internal/{textfield.46.js → TextField.js} +9 -9
  98. package/esm/_internal/TextField.js.map +1 -0
  99. package/esm/_internal/{thumbnail.47.js → Thumbnail2.js} +6 -6
  100. package/esm/_internal/Thumbnail2.js.map +1 -0
  101. package/esm/_internal/{toolbar.49.js → Toolbar2.js} +3 -3
  102. package/esm/_internal/Toolbar2.js.map +1 -0
  103. package/esm/_internal/{tooltip.50.js → Tooltip2.js} +17 -19
  104. package/esm/_internal/Tooltip2.js.map +1 -0
  105. package/esm/_internal/{uploader.51.js → Uploader2.js} +4 -4
  106. package/esm/_internal/Uploader2.js.map +1 -0
  107. package/esm/_internal/{userblock.52.js → UserBlock.js} +14 -7
  108. package/esm/_internal/UserBlock.js.map +1 -0
  109. package/esm/_internal/{_rolluppluginbabelhelpers.53.js → _rollupPluginBabelHelpers.js} +1 -1
  110. package/esm/_internal/_rollupPluginBabelHelpers.js.map +1 -0
  111. package/esm/_internal/alert-dialog.js +20 -20
  112. package/esm/_internal/autocomplete.js +22 -22
  113. package/esm/_internal/avatar.js +6 -6
  114. package/esm/_internal/badge.js +3 -3
  115. package/esm/_internal/button.js +16 -16
  116. package/esm/_internal/checkbox.js +7 -7
  117. package/esm/_internal/chip.js +4 -4
  118. package/esm/_internal/comment-block.js +14 -14
  119. package/esm/_internal/components.js +1 -1
  120. package/esm/_internal/{constants.59.js → constants.js} +1 -1
  121. package/esm/_internal/constants.js.map +1 -0
  122. package/esm/_internal/date-picker.js +20 -20
  123. package/esm/_internal/dialog.js +13 -13
  124. package/esm/_internal/divider.js +3 -3
  125. package/esm/_internal/drag-handle.js +4 -4
  126. package/esm/_internal/dropdown.js +12 -12
  127. package/esm/_internal/expansion-panel.js +17 -18
  128. package/esm/_internal/expansion-panel.js.map +1 -1
  129. package/esm/_internal/flag.js +4 -4
  130. package/esm/_internal/flex-box.js +3 -3
  131. package/esm/_internal/generic-block.js +12 -0
  132. package/esm/_internal/generic-block.js.map +1 -0
  133. package/esm/_internal/{getrootclassname.54.js → getRootClassName.js} +2 -2
  134. package/esm/_internal/getRootClassName.js.map +1 -0
  135. package/esm/_internal/grid.js +3 -3
  136. package/esm/_internal/icon.js +3 -3
  137. package/esm/_internal/image-block.js +6 -6
  138. package/esm/_internal/input-helper.js +3 -3
  139. package/esm/_internal/input-label.js +3 -3
  140. package/esm/_internal/lightbox.js +18 -18
  141. package/esm/_internal/link-preview.js +8 -8
  142. package/esm/_internal/link.js +5 -5
  143. package/esm/_internal/list.js +7 -7
  144. package/esm/_internal/{mergerefs.56.js → mergeRefs.js} +1 -1
  145. package/esm/_internal/mergeRefs.js.map +1 -0
  146. package/esm/_internal/message.js +4 -4
  147. package/esm/_internal/mosaic.js +6 -6
  148. package/esm/_internal/notification.js +9 -9
  149. package/esm/_internal/{partitionmulti.62.js → partitionMulti.js} +1 -1
  150. package/esm/_internal/partitionMulti.js.map +1 -0
  151. package/esm/_internal/popover.js +8 -8
  152. package/esm/_internal/post-block.js +7 -7
  153. package/esm/_internal/progress-tracker.js +9 -9
  154. package/esm/_internal/progress.js +3 -3
  155. package/esm/_internal/radio-button.js +6 -6
  156. package/esm/_internal/{renderlink.65.js → renderLink.js} +2 -2
  157. package/esm/_internal/renderLink.js.map +1 -0
  158. package/esm/_internal/select.js +21 -21
  159. package/esm/_internal/side-navigation.js +16 -16
  160. package/esm/_internal/skeleton.js +3 -3
  161. package/esm/_internal/slider.js +6 -6
  162. package/esm/_internal/slideshow.js +15 -15
  163. package/esm/_internal/switch.js +6 -6
  164. package/esm/_internal/table.js +4 -4
  165. package/esm/_internal/tabs.js +7 -7
  166. package/esm/_internal/text-field.js +17 -17
  167. package/esm/_internal/thumbnail.js +6 -6
  168. package/esm/_internal/toolbar.js +3 -3
  169. package/esm/_internal/tooltip.js +10 -10
  170. package/esm/_internal/{type.64.js → type.js} +1 -1
  171. package/esm/_internal/type.js.map +1 -0
  172. package/esm/_internal/{types.48.js → types.js} +3 -2
  173. package/esm/_internal/types.js.map +1 -0
  174. package/esm/_internal/uploader.js +4 -4
  175. package/esm/_internal/{usedelayedvisibility.63.js → useDelayedVisibility.js} +2 -2
  176. package/esm/_internal/useDelayedVisibility.js.map +1 -0
  177. package/esm/_internal/{usedisablebodyscroll.61.js → useDisableBodyScroll.js} +1 -1
  178. package/esm/_internal/useDisableBodyScroll.js.map +1 -0
  179. package/esm/_internal/useFocusTrap.js +86 -0
  180. package/esm/_internal/useFocusTrap.js.map +1 -0
  181. package/esm/_internal/{userovingtabindex.66.js → useRovingTabIndex.js} +3 -3
  182. package/esm/_internal/useRovingTabIndex.js.map +1 -0
  183. package/esm/_internal/user-block.js +10 -9
  184. package/esm/_internal/user-block.js.map +1 -1
  185. package/esm/index.js +91 -0
  186. package/{index.js.map → esm/index.js.map} +1 -1
  187. package/esm/{_internal/index.55.js → index2.js} +1 -1
  188. package/esm/index2.js.map +1 -0
  189. package/package.json +9 -12
  190. package/src/components/autocomplete/Autocomplete.tsx +4 -4
  191. package/src/components/button/Button.stories.tsx +1 -0
  192. package/src/components/button/ButtonRoot.tsx +4 -4
  193. package/src/components/checkbox/Checkbox.tsx +2 -1
  194. package/src/components/checkbox/__snapshots__/Checkbox.test.tsx.snap +4 -0
  195. package/src/components/date-picker/DatePickerField.tsx +15 -16
  196. package/src/components/date-picker/types.ts +2 -2
  197. package/src/components/dialog/Dialog.stories.tsx +61 -14
  198. package/src/components/dialog/Dialog.tsx +3 -3
  199. package/src/components/dialog/__snapshots__/Dialog.test.tsx.snap +167 -91
  200. package/src/components/dropdown/Dropdown.tsx +4 -3
  201. package/src/components/generic-block/GenericBlock.stories.tsx +149 -0
  202. package/src/components/generic-block/GenericBlock.test.tsx +28 -0
  203. package/src/components/generic-block/GenericBlock.tsx +120 -0
  204. package/src/components/generic-block/__snapshots__/GenericBlock.test.tsx.snap +92 -0
  205. package/src/components/generic-block/index.ts +1 -0
  206. package/src/components/lightbox/Lightbox.tsx +1 -1
  207. package/src/components/link-preview/LinkPreview.test.tsx +50 -55
  208. package/src/components/link-preview/LinkPreview.tsx +43 -16
  209. package/src/components/popover/Popover.tsx +20 -4
  210. package/src/components/select/Select.stories.tsx +2 -0
  211. package/src/components/select/Select.tsx +11 -1
  212. package/src/components/select/SelectMultiple.stories.tsx +2 -0
  213. package/src/components/select/SelectMultiple.tsx +11 -1
  214. package/src/components/select/constants.ts +2 -0
  215. package/src/components/side-navigation/SideNavigation.stories.tsx +26 -0
  216. package/src/components/side-navigation/SideNavigationItem.test.tsx +19 -2
  217. package/src/components/side-navigation/SideNavigationItem.tsx +10 -2
  218. package/src/components/side-navigation/__snapshots__/SideNavigationItem.test.tsx.snap +1 -1
  219. package/src/components/table/__snapshots__/Table.test.tsx.snap +5 -0
  220. package/src/components/text-field/TextField.tsx +4 -4
  221. package/src/components/thumbnail/Thumbnail.tsx +2 -2
  222. package/src/components/thumbnail/index.ts +1 -0
  223. package/src/components/tooltip/Tooltip.tsx +2 -5
  224. package/src/components/tooltip/useTooltipOpen.tsx +7 -4
  225. package/src/components/user-block/UserBlock.stories.tsx +4 -4
  226. package/src/components/user-block/UserBlock.tsx +9 -3
  227. package/src/components/user-block/__snapshots__/UserBlock.test.tsx.snap +51 -8
  228. package/src/hooks/useBooleanState.tsx +4 -10
  229. package/src/hooks/useCallbackOnEscape.ts +21 -13
  230. package/src/hooks/useFocusTrap.ts +67 -76
  231. package/src/index.ts +1 -0
  232. package/src/stories/generated/Dialog/Demos.stories.tsx +1 -0
  233. package/src/stories/generated/GenericBlock/Demos.stories.tsx +6 -0
  234. package/src/utils/focus/getFirstAndLastFocusable.test.ts +134 -0
  235. package/src/utils/focus/getFirstAndLastFocusable.ts +27 -0
  236. package/src/utils/makeListenerTowerContext.ts +32 -0
  237. package/src/utils/type.ts +3 -0
  238. package/{index.d.ts → types.d.ts} +82 -22
  239. package/esm/_internal/_rolluppluginbabelhelpers.53.js.map +0 -1
  240. package/esm/_internal/alertdialog.1.js.map +0 -1
  241. package/esm/_internal/autocompletemultiple.2.js.map +0 -1
  242. package/esm/_internal/avatar.3.js.map +0 -1
  243. package/esm/_internal/badge.4.js.map +0 -1
  244. package/esm/_internal/button.5.js.map +0 -1
  245. package/esm/_internal/buttongroup.7.js.map +0 -1
  246. package/esm/_internal/buttonroot.57.js.map +0 -1
  247. package/esm/_internal/checkbox.8.js.map +0 -1
  248. package/esm/_internal/chip.9.js.map +0 -1
  249. package/esm/_internal/chipgroup.10.js.map +0 -1
  250. package/esm/_internal/clickawayprovider.60.js +0 -116
  251. package/esm/_internal/clickawayprovider.60.js.map +0 -1
  252. package/esm/_internal/commentblock.11.js.map +0 -1
  253. package/esm/_internal/constants.59.js.map +0 -1
  254. package/esm/_internal/datepickerfield.12.js.map +0 -1
  255. package/esm/_internal/dialog.13.js.map +0 -1
  256. package/esm/_internal/divider.14.js.map +0 -1
  257. package/esm/_internal/draghandle.15.js.map +0 -1
  258. package/esm/_internal/dropdown.16.js.map +0 -1
  259. package/esm/_internal/expansionpanel.17.js.map +0 -1
  260. package/esm/_internal/flag.18.js.map +0 -1
  261. package/esm/_internal/flexbox.19.js.map +0 -1
  262. package/esm/_internal/getrootclassname.54.js.map +0 -1
  263. package/esm/_internal/griditem.20.js.map +0 -1
  264. package/esm/_internal/icon.21.js.map +0 -1
  265. package/esm/_internal/iconbutton.6.js.map +0 -1
  266. package/esm/_internal/imageblock.22.js.map +0 -1
  267. package/esm/_internal/index.55.js.map +0 -1
  268. package/esm/_internal/inputhelper.23.js.map +0 -1
  269. package/esm/_internal/inputlabel.24.js.map +0 -1
  270. package/esm/_internal/lightbox.25.js.map +0 -1
  271. package/esm/_internal/link.26.js.map +0 -1
  272. package/esm/_internal/linkpreview.27.js.map +0 -1
  273. package/esm/_internal/list.28.js.map +0 -1
  274. package/esm/_internal/listsubheader.29.js.map +0 -1
  275. package/esm/_internal/mergerefs.56.js.map +0 -1
  276. package/esm/_internal/message.30.js.map +0 -1
  277. package/esm/_internal/mosaic.31.js.map +0 -1
  278. package/esm/_internal/notification.32.js.map +0 -1
  279. package/esm/_internal/partitionmulti.62.js.map +0 -1
  280. package/esm/_internal/popover.33.js.map +0 -1
  281. package/esm/_internal/postblock.34.js.map +0 -1
  282. package/esm/_internal/progress.35.js.map +0 -1
  283. package/esm/_internal/progresstrackersteppanel.36.js.map +0 -1
  284. package/esm/_internal/radiogroup.37.js.map +0 -1
  285. package/esm/_internal/renderlink.65.js.map +0 -1
  286. package/esm/_internal/selectmultiple.38.js.map +0 -1
  287. package/esm/_internal/sidenavigationitem.39.js.map +0 -1
  288. package/esm/_internal/skeletontypography.40.js.map +0 -1
  289. package/esm/_internal/slider.41.js.map +0 -1
  290. package/esm/_internal/slides.42.js.map +0 -1
  291. package/esm/_internal/switch.43.js.map +0 -1
  292. package/esm/_internal/tablerow.44.js.map +0 -1
  293. package/esm/_internal/tabpanel.45.js.map +0 -1
  294. package/esm/_internal/textfield.46.js.map +0 -1
  295. package/esm/_internal/thumbnail.47.js.map +0 -1
  296. package/esm/_internal/toolbar.49.js.map +0 -1
  297. package/esm/_internal/tooltip.50.js.map +0 -1
  298. package/esm/_internal/type.64.js.map +0 -1
  299. package/esm/_internal/types.48.js.map +0 -1
  300. package/esm/_internal/uploader.51.js.map +0 -1
  301. package/esm/_internal/usedelayedvisibility.63.js.map +0 -1
  302. package/esm/_internal/usedisablebodyscroll.61.js.map +0 -1
  303. package/esm/_internal/usefocustrap.58.js +0 -93
  304. package/esm/_internal/usefocustrap.58.js.map +0 -1
  305. package/esm/_internal/userblock.52.js.map +0 -1
  306. package/esm/_internal/userovingtabindex.66.js.map +0 -1
  307. package/hooks/useFocusWithin.d.ts +0 -16
  308. package/hooks/useFocusWithin.js +0 -28
  309. package/hooks/useFocusWithin.js.map +0 -1
  310. package/index.js +0 -90
  311. package/src/components/link-preview/__snapshots__/LinkPreview.test.tsx.snap +0 -51
@@ -0,0 +1,134 @@
1
+ import { getFirstAndLastFocusable } from '@lumx/react/utils/focus/getFirstAndLastFocusable';
2
+
3
+ function htmlToElement(html: string): any {
4
+ const template = document.createElement('template');
5
+ template.innerHTML = html.trim();
6
+ return template.content.firstChild;
7
+ }
8
+
9
+ describe(getFirstAndLastFocusable.name, () => {
10
+ it('should get empty', () => {
11
+ const element = htmlToElement(`<div></div>`);
12
+ const focusable = getFirstAndLastFocusable(element);
13
+ expect(focusable).toEqual({});
14
+ });
15
+
16
+ it('should get single item', () => {
17
+ const element = htmlToElement(`<div><button /></div>`);
18
+ const focusable = getFirstAndLastFocusable(element);
19
+ expect(focusable.last).toBe(focusable.first);
20
+ });
21
+
22
+ it('should get first and last', () => {
23
+ const element = htmlToElement(`
24
+ <div>
25
+ <div>Non focusable div</div>
26
+ <button>Simple button</button>
27
+ <div>Non focusable div</div>
28
+ <input />
29
+ <div>Non focusable div</div>
30
+ </div>
31
+ `);
32
+ const focusable = getFirstAndLastFocusable(element);
33
+ expect(focusable.first).toMatchInlineSnapshot(`
34
+ <button>
35
+ Simple button
36
+ </button>
37
+ `);
38
+ expect(focusable.first).toMatchInlineSnapshot(`
39
+ <button>
40
+ Simple button
41
+ </button>
42
+ `);
43
+ });
44
+
45
+ describe('match focusable elements', () => {
46
+ it('should match input element', () => {
47
+ const element = htmlToElement(`<div><input /></div>`);
48
+ const focusable = getFirstAndLastFocusable(element);
49
+ expect(focusable.first).toMatchInlineSnapshot(`<input />`);
50
+ });
51
+
52
+ it('should match link element', () => {
53
+ const element = htmlToElement(`<div><a href="#" /></div>`);
54
+ const focusable = getFirstAndLastFocusable(element);
55
+ expect(focusable.first).toMatchInlineSnapshot(`
56
+ <a
57
+ href="#"
58
+ />
59
+ `);
60
+ });
61
+
62
+ it('should match textarea element', () => {
63
+ const element = htmlToElement(`<div><textarea /></div>`);
64
+ const focusable = getFirstAndLastFocusable(element);
65
+ expect(focusable.first).toMatchInlineSnapshot(`
66
+ <textarea>
67
+ &lt;/div&gt;
68
+ </textarea>
69
+ `);
70
+ });
71
+
72
+ it('should match element with tabindex', () => {
73
+ const element = htmlToElement(`<div><span tabindex="0" /></div>`);
74
+ const focusable = getFirstAndLastFocusable(element);
75
+ expect(focusable.first).toMatchInlineSnapshot(`
76
+ <span
77
+ tabindex="0"
78
+ />
79
+ `);
80
+ });
81
+
82
+ it('should keep disabled=false', () => {
83
+ const element = htmlToElement(`<div><button disabled="false" /><button /></div>`);
84
+ const focusable = getFirstAndLastFocusable(element);
85
+ expect(focusable.first).toMatchInlineSnapshot(`
86
+ <button
87
+ disabled="false"
88
+ />
89
+ `);
90
+ });
91
+
92
+ it('should keep aria-disabled=false', () => {
93
+ const element = htmlToElement(`<div><button aria-disabled="false" /><button /></div>`);
94
+ const focusable = getFirstAndLastFocusable(element);
95
+ expect(focusable.first).toMatchInlineSnapshot(`
96
+ <button
97
+ aria-disabled="false"
98
+ />
99
+ `);
100
+ });
101
+ });
102
+
103
+ describe('skip disabled elements', () => {
104
+ it('should skip disabled', () => {
105
+ const element = htmlToElement(`<div><button disabled /><button /></div>`);
106
+ const focusable = getFirstAndLastFocusable(element);
107
+ expect(focusable.first).toMatchInlineSnapshot(`<button />`);
108
+ });
109
+
110
+ it('should skip aria-disabled', () => {
111
+ const element = htmlToElement(`<div><button aria-disabled /><button /></div>`);
112
+ const focusable = getFirstAndLastFocusable(element);
113
+ expect(focusable.first).toMatchInlineSnapshot(`<button />`);
114
+ });
115
+
116
+ it('should skip tabindex=-1', () => {
117
+ const element = htmlToElement(`<div><button tabindex="-1" /><button /></div>`);
118
+ const focusable = getFirstAndLastFocusable(element);
119
+ expect(focusable.first).toMatchInlineSnapshot(`<button />`);
120
+ });
121
+
122
+ it('should skip input type hidden', () => {
123
+ const element = htmlToElement(`<div><input type="hidden" /><button /></div>`);
124
+ const focusable = getFirstAndLastFocusable(element);
125
+ expect(focusable.first).toMatchInlineSnapshot(`<button />`);
126
+ });
127
+
128
+ it('should skip hidden input', () => {
129
+ const element = htmlToElement(`<div><input hidden /><button /></div>`);
130
+ const focusable = getFirstAndLastFocusable(element);
131
+ expect(focusable.first).toMatchInlineSnapshot(`<button />`);
132
+ });
133
+ });
134
+ });
@@ -0,0 +1,27 @@
1
+ /** CSS selector listing all tabbable elements. */
2
+ const TABBABLE_ELEMENTS_SELECTOR = `a[href], button, textarea, input:not([type="hidden"]):not([hidden]), [tabindex]`;
3
+
4
+ /** CSS selector matching element that are disabled (should not receive focus). */
5
+ const DISABLED_SELECTOR = `[hidden], [tabindex="-1"], [disabled]:not([disabled="false"]), [aria-disabled]:not([aria-disabled="false"])`;
6
+
7
+ const isNotDisabled = (element: HTMLElement) => !element.matches(DISABLED_SELECTOR);
8
+
9
+ /**
10
+ * Get first and last elements focusable in an element.
11
+ *
12
+ * @param parentElement The element in which to search focusable elements.
13
+ * @return first and last focusable elements
14
+ */
15
+ export function getFirstAndLastFocusable(parentElement: HTMLElement) {
16
+ const focusableElements = Array.from(parentElement.querySelectorAll<HTMLElement>(TABBABLE_ELEMENTS_SELECTOR));
17
+
18
+ // First non disabled element.
19
+ const first = focusableElements.find(isNotDisabled);
20
+ // Last non disabled element.
21
+ const last = focusableElements.reverse().find(isNotDisabled);
22
+
23
+ if (last && first) {
24
+ return { first, last };
25
+ }
26
+ return {};
27
+ }
@@ -0,0 +1,32 @@
1
+ import last from 'lodash/last';
2
+ import pull from 'lodash/pull';
3
+
4
+ export type Listener = { enable(): void; disable(): void };
5
+
6
+ /**
7
+ * Keep track of listeners, only the last registered listener gets activated at any point (previously registered
8
+ * listener are disabled).
9
+ * When a listener gets unregistered, the previously registered listener gets enabled again.
10
+ */
11
+ export function makeListenerTowerContext() {
12
+ const LISTENERS: Listener[] = [];
13
+
14
+ return {
15
+ register(listener: Listener) {
16
+ // Disable previous listener.
17
+ last(LISTENERS)?.disable();
18
+ // Keep track of current listener.
19
+ LISTENERS.push(listener);
20
+ // Enable current listener.
21
+ listener.enable();
22
+ },
23
+ unregister(listener: Listener) {
24
+ // Disable current listener.
25
+ listener.disable();
26
+ // Remove current listener.
27
+ pull(LISTENERS, listener);
28
+ // Enable previous listener.
29
+ last(LISTENERS)?.enable();
30
+ },
31
+ };
32
+ }
package/src/utils/type.ts CHANGED
@@ -31,6 +31,9 @@ export type Comp<P, T = HTMLElement> = {
31
31
  className?: string;
32
32
  };
33
33
 
34
+ /** Union type of all heading elements */
35
+ export type HeadingElement = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
36
+
34
37
  /**
35
38
  * Define a generic props types.
36
39
  */
@@ -1,6 +1,13 @@
1
- // Generated by dts-bundle-generator v5.9.0
1
+ // Generated by dts-bundle-generator v5.6.0
2
2
 
3
- /// <reference types="react" />
3
+ /// <reference types="cheerio" />
4
+ /// <reference types="node" />
5
+ /// <reference types="prop-types" />
6
+
7
+ import * as CSS from 'csstype';
8
+ import * as PropTypes from 'prop-types';
9
+ import React from 'react';
10
+ import { AriaAttributes, ButtonHTMLAttributes, CSSProperties, DetailedHTMLProps, ImgHTMLAttributes, InputHTMLAttributes, Key, KeyboardEventHandler, MouseEventHandler, ReactElement, ReactNode, Ref, RefObject, SetStateAction, SyntheticEvent } from 'react';
4
11
 
5
12
  /** Get types of the values of a record. */
6
13
  export declare type ValueOf<T extends Record<any, any>> = T[keyof T];
@@ -18,6 +25,8 @@ export declare type Comp<P, T = HTMLElement> = {
18
25
  /** Component base class name. */
19
26
  className?: string;
20
27
  };
28
+ /** Union type of all heading elements */
29
+ export declare type HeadingElement = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
21
30
  /**
22
31
  * Define a generic props types.
23
32
  */
@@ -32,6 +41,11 @@ export interface GenericProps {
32
41
  * Callback function type alias (use for readability)
33
42
  */
34
43
  export declare type Callback = () => void;
44
+ /**
45
+ * JS falsy values.
46
+ * (excluding `NaN` as it can't be distinguished from `number`)
47
+ */
48
+ export declare type Falsy = false | undefined | null | 0 | "";
35
49
  /**
36
50
  * Alignments.
37
51
  */
@@ -259,7 +273,7 @@ export interface AutocompleteProps extends GenericProps {
259
273
  * Reference to the <input> or <textarea> element.
260
274
  * @see {@link TextFieldProps#inputRef}
261
275
  */
262
- inputRef?: RefObject<HTMLInputElement>;
276
+ inputRef?: TextFieldProps["inputRef"];
263
277
  /**
264
278
  * The offset that will be applied to the Dropdown position.
265
279
  * @see {@link DropdownProps#offset}
@@ -476,9 +490,7 @@ export declare type HTMLButtonProps = DetailedHTMLProps<ButtonHTMLAttributes<HTM
476
490
  * Button size definition.
477
491
  */
478
492
  export declare type ButtonSize = Extract<Size, "s" | "m">;
479
- export interface BaseButtonProps extends GenericProps {
480
- /** ARIA button label. */
481
- ["aria-label"]?: string;
493
+ export interface BaseButtonProps extends GenericProps, Pick<AriaAttributes, "aria-expanded" | "aria-haspopup" | "aria-pressed" | "aria-label"> {
482
494
  /** Color variant. */
483
495
  color?: Color;
484
496
  /** Emphasis variant. */
@@ -671,7 +683,7 @@ export interface ChipGroupProps extends GenericProps {
671
683
  children: ReactNode;
672
684
  }
673
685
  export declare const ChipGroup: Comp<ChipGroupProps, HTMLDivElement> & {
674
- useChipGroupNavigation: import("@lumx/react/hooks/useChipGroupNavigation").useChipGroupNavigationType<any>;
686
+ useChipGroupNavigation: import("../../hooks/useChipGroupNavigation").useChipGroupNavigationType<any>;
675
687
  };
676
688
  /**
677
689
  * Comment block variants.
@@ -743,7 +755,7 @@ export interface DatePickerProps extends GenericProps {
743
755
  /** Props to pass to the previous month button (minus those already set by the DatePickerControlled props). */
744
756
  previousButtonProps: Pick<IconButtonProps, "label"> & Omit<IconButtonProps, "label" | "onClick" | "icon" | "emphasis">;
745
757
  /** Reference to the <button> element corresponding to the current date or the selected date. */
746
- todayOrSelectedDateRef?: RefObject<HTMLButtonElement>;
758
+ todayOrSelectedDateRef?: Ref<HTMLButtonElement>;
747
759
  /** Currently selected date. */
748
760
  value: Date | undefined;
749
761
  /** On change callback. */
@@ -828,7 +840,7 @@ export interface DialogProps extends GenericProps {
828
840
  /** Reference to the parent element that triggered modal opening (will get back focus on close). */
829
841
  parentElement?: RefObject<HTMLElement>;
830
842
  /** Reference to the dialog content element. */
831
- contentRef?: RefObject<HTMLDivElement>;
843
+ contentRef?: Ref<HTMLDivElement>;
832
844
  /** Reference to the of the element that should get the focus when the dialogs opens. By default, the first child will take focus. */
833
845
  focusElement?: RefObject<HTMLElement>;
834
846
  /** Whether to keep the dialog open on clickaway or escape press. */
@@ -951,6 +963,8 @@ export interface PopoverProps extends GenericProps {
951
963
  isOpen: boolean;
952
964
  /** Offset placement relative to anchor. */
953
965
  offset?: Offset;
966
+ /** Reference to the parent element that triggered the popover (will get back focus on close or else fallback on the anchor element). */
967
+ parentElement?: RefObject<HTMLElement>;
954
968
  /** Placement relative to anchor. */
955
969
  placement?: Placement;
956
970
  /** Whether the popover should be rendered into a DOM node that exists outside the DOM hierarchy of the parent component. */
@@ -972,10 +986,11 @@ export declare const Popover: Comp<PopoverProps, HTMLDivElement>;
972
986
  * Defines the props of the component.
973
987
  */
974
988
  export interface DropdownProps extends GenericProps {
975
- /** Reference to the element around which the dropdown is placed.
989
+ /**
990
+ * Reference to the element around which the dropdown is placed.
976
991
  * @see {@link PopoverProps#anchorRef}
977
992
  */
978
- anchorRef: React.RefObject<HTMLElement>;
993
+ anchorRef: PopoverProps["anchorRef"];
979
994
  /** Dropdown content. */
980
995
  children: React.ReactNode;
981
996
  /**
@@ -1124,6 +1139,41 @@ export interface FlexBoxProps extends GenericProps {
1124
1139
  * @return React element.
1125
1140
  */
1126
1141
  export declare const FlexBox: Comp<FlexBoxProps, HTMLDivElement>;
1142
+ export interface GenericBlockProps extends FlexBoxProps {
1143
+ /** Component to use as visual element. */
1144
+ figure?: ReactNode;
1145
+ /** Actions to set after the main content. */
1146
+ actions?: ReactNode;
1147
+ /** Main content to display */
1148
+ children: ReactNode;
1149
+ /** Orientation of the 3 sections */
1150
+ orientation?: FlexBoxProps["orientation"];
1151
+ /** Horizontal alignment. */
1152
+ hAlign?: FlexBoxProps["hAlign"];
1153
+ /** Vertical alignment. */
1154
+ vAlign?: FlexBoxProps["vAlign"];
1155
+ /**
1156
+ * The props to forward to the content.
1157
+ * By default, the content will have the same alignment as wrapper.
1158
+ */
1159
+ contentProps?: Omit<FlexBoxProps, "children">;
1160
+ /** props to forward to the actions element. */
1161
+ actionsProps?: Omit<FlexBoxProps, "children">;
1162
+ /** props to forward to the figure element. */
1163
+ figureProps?: Omit<FlexBoxProps, "children">;
1164
+ }
1165
+ /**
1166
+ * The GenericBlock is a layout component made of 3 sections that can be
1167
+ * displayed either horizontally of vertically with the same gap between each section.
1168
+ *
1169
+ * The sections are:
1170
+ * * (Optional) `Figure` => A visual element to display before the main content.
1171
+ * * (Required) `Content` => The main content displayed
1172
+ * * (Optional) `Actions` => One or more actions to set after the element.
1173
+ *
1174
+ * @see https://www.figma.com/file/lzzrQmsfaXRaOyRfoEogPZ/DS%3A-playground?node-id=1%3A4076
1175
+ */
1176
+ export declare const GenericBlock: Comp<GenericBlockProps, HTMLDivElement>;
1127
1177
  export declare type GridGutterSize = Extract<Size, "regular" | "big" | "huge">;
1128
1178
  /**
1129
1179
  * Defines the props of the component.
@@ -1235,7 +1285,7 @@ export interface ThumbnailProps extends GenericProps {
1235
1285
  /** Image aspect ratio. */
1236
1286
  aspectRatio?: AspectRatio;
1237
1287
  /** Badge. */
1238
- badge?: ReactElement;
1288
+ badge?: ReactElement | Falsy;
1239
1289
  /** Image cross origin resource policy. */
1240
1290
  crossOrigin?: ImgHTMLProps["crossOrigin"];
1241
1291
  /** Fallback icon (SVG path) or react node when image fails to load. */
@@ -1433,12 +1483,12 @@ export declare const Link: Comp<LinkProps, HTMLAnchorElement | HTMLButtonElement
1433
1483
  * Defines the props of the component.
1434
1484
  */
1435
1485
  export interface LinkPreviewProps extends GenericProps {
1436
- /** Description (either a string, or sanitized html). */
1437
- description?: string | {
1438
- __html: string;
1439
- };
1486
+ /** Description. */
1487
+ description?: string;
1440
1488
  /** Link URL. */
1441
1489
  link: string;
1490
+ /** Custom react component for the link (can be used to inject react router Link). */
1491
+ linkAs?: "a" | any;
1442
1492
  /** Props to pass to the link (minus those already set by the LinkPreview props). */
1443
1493
  linkProps?: Omit<LinkProps, "color" | "colorVariant" | "href" | "target">;
1444
1494
  /** Size variant. */
@@ -1449,6 +1499,8 @@ export interface LinkPreviewProps extends GenericProps {
1449
1499
  thumbnailProps?: ThumbnailProps;
1450
1500
  /** Title. */
1451
1501
  title?: string;
1502
+ /** Customize the title heading tag. */
1503
+ titleHeading?: HeadingElement;
1452
1504
  }
1453
1505
  /**
1454
1506
  * LinkPreview component.
@@ -1495,7 +1547,7 @@ export interface ListProps extends GenericProps {
1495
1547
  onListItemSelected?(key: Key, index: number, evt: SyntheticEvent): void;
1496
1548
  }
1497
1549
  export declare const List: Comp<ListProps, HTMLUListElement> & {
1498
- useKeyboardListNavigation: import("@lumx/react/hooks/useKeyboardListNavigation").useKeyboardListNavigationType;
1550
+ useKeyboardListNavigation: import("../../hooks/useKeyboardListNavigation").useKeyboardListNavigationType;
1499
1551
  };
1500
1552
  export declare type ListItemSize = Extract<Size, "tiny" | "regular" | "big" | "huge">;
1501
1553
  /**
@@ -1858,6 +1910,8 @@ export interface CoreSelectProps extends GenericProps {
1858
1910
  helper?: string;
1859
1911
  /** Whether the select should close on click. */
1860
1912
  closeOnClick?: boolean;
1913
+ /** Icon (SVG path). */
1914
+ icon?: string;
1861
1915
  /** Whether the component is disabled or not. */
1862
1916
  isDisabled?: boolean;
1863
1917
  /** Whether the component is required or not. */
@@ -1957,6 +2011,11 @@ export interface SideNavigationItemProps extends GenericProps {
1957
2011
  linkProps?: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
1958
2012
  /** Props to pass to the toggle button (minus those already set by the SideNavigationItem props). */
1959
2013
  toggleButtonProps: Pick<IconButtonProps, "label"> & Omit<IconButtonProps, "label" | "onClick" | "icon" | "emphasis" | "color" | "size">;
2014
+ /**
2015
+ * Choose how the children are hidden when closed
2016
+ * ('hide' keeps the children in DOM but hide them, 'unmount' remove the children from the DOM).
2017
+ */
2018
+ closeMode?: "hide" | "unmount";
1960
2019
  /** On action button click callback. */
1961
2020
  onActionClick?(evt: React.MouseEvent): void;
1962
2021
  /** On click callback. */
@@ -2220,8 +2279,8 @@ export interface SlideshowControlsProps extends GenericProps {
2220
2279
  playButtonProps?: Pick<IconButtonProps, "label"> & Omit<IconButtonProps, "label" | "onClick" | "icon" | "emphasis" | "color">;
2221
2280
  }
2222
2281
  export declare const SlideshowControls: Comp<SlideshowControlsProps, HTMLDivElement> & {
2223
- useSlideshowControls: ({ activeIndex, groupBy, interval, autoPlay, defaultActiveIndex, onChange, itemsCount, id, slidesId, }: import("@lumx/react/hooks/useSlideshowControls").UseSlideshowControlsOptions) => import("@lumx/react/hooks/useSlideshowControls").UseSlideshowControls;
2224
- useSlideshowControlsDefaultOptions: Partial<import("@lumx/react/hooks/useSlideshowControls").UseSlideshowControlsOptions>;
2282
+ useSlideshowControls: ({ activeIndex, groupBy, interval, autoPlay, defaultActiveIndex, onChange, itemsCount, id, slidesId, }: import("../../hooks/useSlideshowControls").UseSlideshowControlsOptions) => import("../../hooks/useSlideshowControls").UseSlideshowControls;
2283
+ useSlideshowControlsDefaultOptions: Partial<import("../../hooks/useSlideshowControls").UseSlideshowControlsOptions>;
2225
2284
  };
2226
2285
  export interface SlidesProps extends GenericProps {
2227
2286
  /** current slide active */
@@ -2507,7 +2566,7 @@ export interface TextFieldProps extends GenericProps {
2507
2566
  /** Native input id property (generated if not provided to link the label element). */
2508
2567
  id?: string;
2509
2568
  /** Reference to the <input> or <textarea> element. */
2510
- inputRef?: RefObject<HTMLInputElement> | RefObject<HTMLTextAreaElement>;
2569
+ inputRef?: Ref<HTMLInputElement | HTMLTextAreaElement>;
2511
2570
  /** Whether the component is disabled or not. */
2512
2571
  isDisabled?: boolean;
2513
2572
  /** Whether the component is required or not. */
@@ -2527,7 +2586,7 @@ export interface TextFieldProps extends GenericProps {
2527
2586
  /** Placeholder text. */
2528
2587
  placeholder?: string;
2529
2588
  /** Reference to the wrapper. */
2530
- textFieldRef?: RefObject<HTMLDivElement>;
2589
+ textFieldRef?: Ref<HTMLDivElement>;
2531
2590
  /** Theme adapting the component to light or dark background. */
2532
2591
  theme?: Theme;
2533
2592
  /** Value. */
@@ -2547,6 +2606,7 @@ export interface TextFieldProps extends GenericProps {
2547
2606
  * @return React element.
2548
2607
  */
2549
2608
  export declare const TextField: Comp<TextFieldProps, HTMLDivElement>;
2609
+ export declare const useFocusPointStyle: ({ image, aspectRatio, focusPoint, imgProps: { width, height } }: ThumbnailProps, element: HTMLImageElement | undefined, isLoaded: boolean) => CSSProperties;
2550
2610
  /**
2551
2611
  * Defines the props of the component.
2552
2612
  */
@@ -2640,7 +2700,7 @@ export declare type UserBlockSize = Extract<Size, "s" | "m" | "l">;
2640
2700
  */
2641
2701
  export interface UserBlockProps extends GenericProps {
2642
2702
  /** Props to pass to the avatar. */
2643
- avatarProps?: AvatarProps;
2703
+ avatarProps?: Omit<AvatarProps, "alt">;
2644
2704
  /** Additional fields used to describe the user. */
2645
2705
  fields?: string[];
2646
2706
  /** Props to pass to the link wrapping the avatar thumbnail. */
@@ -1 +0,0 @@
1
- {"version":3,"file":"_rolluppluginbabelhelpers.53.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"alertdialog.1.js","sources":["../../../src/components/alert-dialog/AlertDialog.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport {\n DialogProps,\n Dialog,\n Button,\n Emphasis,\n ColorPalette,\n Icon,\n Size,\n Kind,\n Toolbar,\n ButtonProps,\n} from '@lumx/react';\n\nimport { mdiAlert, mdiAlertCircle, mdiCheckCircle, mdiInformation } from '@lumx/icons/';\nimport { uid } from 'uid';\nimport { Comp, getRootClassName, handleBasicClasses } from '@lumx/react/utils';\n\nexport interface AlertDialogProps extends Omit<DialogProps, 'header' | 'footer'> {\n /** Message variant. */\n kind?: Kind;\n /** Dialog title. */\n title?: string;\n /** Props forwarded to the confirm button */\n confirmProps: ButtonProps & {\n onClick(): void;\n label: string;\n };\n /**\n * Props forwarded to the cancel button.\n * Will not render a cancel button if undefined.\n */\n cancelProps?: ButtonProps & {\n onClick(): void;\n label: string;\n };\n}\n\n/**\n * Associative map from message kind to color and icon.\n */\nconst CONFIG = {\n [Kind.error]: { color: ColorPalette.red, icon: mdiAlert },\n [Kind.info]: { color: ColorPalette.blue, icon: mdiInformation },\n [Kind.success]: { color: ColorPalette.green, icon: mdiCheckCircle },\n [Kind.warning]: { color: ColorPalette.yellow, icon: mdiAlertCircle },\n};\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'AlertDialog';\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<DialogProps> = {\n size: Size.tiny,\n kind: Kind.info,\n};\n\n/**\n * AlertDialog component.\n *\n * An alert dialog is a modal dialog that interrupts the user's workflow to\n * communicate an important message and acquire a response.\n *\n * It should not have a complex content.\n * Children of this component should only be strings, paragraphs or links.\n */\nexport const AlertDialog: Comp<AlertDialogProps, HTMLDivElement> = forwardRef((props, ref) => {\n const {\n id,\n title,\n className,\n cancelProps,\n confirmProps,\n kind,\n size,\n dialogProps,\n children,\n ...forwardedProps\n } = props;\n\n const cancelButtonRef = React.useRef(null);\n const confirmationButtonRef = React.useRef(null);\n const { color, icon } = CONFIG[kind as Kind] || {};\n\n // Define a unique ID to target title and description for aria attributes.\n const uniqueId = React.useMemo(() => id || uid(), [id]);\n const titleId = `${uniqueId}-title`;\n const descriptionId = `${uniqueId}-description`;\n\n // If content is a string, set in a paragraph.\n const DescriptionElement = typeof children === 'string' ? 'p' : 'div';\n\n const { label: confirmLabel, onClick: confirmOnClick, ...forwardedConfirmProps } = confirmProps;\n const { label: cancelLabel, onClick: cancelOnClick, ...forwardedCancelProps } = cancelProps || {};\n\n return (\n <Dialog\n ref={ref}\n focusElement={cancelProps ? cancelButtonRef : confirmationButtonRef}\n size={size}\n dialogProps={{\n id: uniqueId,\n role: 'alertdialog',\n 'aria-labelledby': titleId,\n 'aria-describedby': descriptionId,\n ...dialogProps,\n }}\n className={classNames(\n className,\n handleBasicClasses({\n kind,\n prefix: CLASSNAME,\n }),\n )}\n {...forwardedProps}\n >\n <header>\n <Toolbar\n className=\"lumx-spacing-margin-horizontal\"\n before={<Icon icon={icon} size={Size.s} color={color} />}\n label={\n <h2 id={titleId} className=\"lumx-typography-title\">\n {title}\n </h2>\n }\n />\n </header>\n\n {children && (\n <DescriptionElement\n id={descriptionId}\n className=\"lumx-typography-body2 lumx-spacing-padding-vertical-big lumx-spacing-padding-horizontal-huge\"\n >\n {children}\n </DescriptionElement>\n )}\n\n <footer>\n <Toolbar\n className=\"lumx-spacing-margin-horizontal\"\n after={\n <>\n {cancelProps && (\n <Button\n {...forwardedCancelProps}\n ref={cancelButtonRef}\n emphasis={Emphasis.medium}\n onClick={cancelOnClick}\n >\n {cancelLabel}\n </Button>\n )}\n <Button\n {...forwardedConfirmProps}\n ref={confirmationButtonRef}\n color={color}\n className=\"lumx-spacing-margin-left-regular\"\n onClick={confirmOnClick}\n >\n {confirmLabel}\n </Button>\n </>\n }\n />\n </footer>\n </Dialog>\n );\n});\n\nAlertDialog.displayName = COMPONENT_NAME;\nAlertDialog.className = CLASSNAME;\nAlertDialog.defaultProps = DEFAULT_PROPS;\n"],"names":["CONFIG","Kind","error","color","ColorPalette","red","icon","mdiAlert","info","blue","mdiInformation","success","green","mdiCheckCircle","warning","yellow","mdiAlertCircle","COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","size","Size","tiny","kind","AlertDialog","forwardRef","props","ref","id","title","className","cancelProps","confirmProps","dialogProps","children","forwardedProps","cancelButtonRef","React","useRef","confirmationButtonRef","uniqueId","useMemo","uid","titleId","descriptionId","DescriptionElement","confirmLabel","label","confirmOnClick","onClick","forwardedConfirmProps","cancelLabel","cancelOnClick","forwardedCancelProps","role","classNames","handleBasicClasses","prefix","s","Emphasis","medium","displayName","defaultProps"],"mappings":";;;;;;;;;;;;AAyCA;;;AAGA,IAAMA,MAAM,2CACPC,IAAI,CAACC,KADE,EACM;AAAEC,EAAAA,KAAK,EAAEC,YAAY,CAACC,GAAtB;AAA2BC,EAAAA,IAAI,EAAEC;AAAjC,CADN,4BAEPN,IAAI,CAACO,IAFE,EAEK;AAAEL,EAAAA,KAAK,EAAEC,YAAY,CAACK,IAAtB;AAA4BH,EAAAA,IAAI,EAAEI;AAAlC,CAFL,4BAGPT,IAAI,CAACU,OAHE,EAGQ;AAAER,EAAAA,KAAK,EAAEC,YAAY,CAACQ,KAAtB;AAA6BN,EAAAA,IAAI,EAAEO;AAAnC,CAHR,4BAIPZ,IAAI,CAACa,OAJE,EAIQ;AAAEX,EAAAA,KAAK,EAAEC,YAAY,CAACW,MAAtB;AAA8BT,EAAAA,IAAI,EAAEU;AAApC,CAJR,WAAZ;AAOA;;;;AAGA,IAAMC,cAAc,GAAG,aAAvB;AAEA;;;;AAGA,IAAMC,SAAS,GAAGC,gBAAgB,CAACF,cAAD,CAAlC;AAEA;;;;AAGA,IAAMG,aAAmC,GAAG;AACxCC,EAAAA,IAAI,EAAEC,IAAI,CAACC,IAD6B;AAExCC,EAAAA,IAAI,EAAEvB,IAAI,CAACO;AAF6B,CAA5C;AAKA;;;;;;;;;;IASaiB,WAAmD,GAAGC,UAAU,CAAC,UAACC,KAAD,EAAQC,GAAR,EAAgB;AAAA,MAEtFC,EAFsF,GAYtFF,KAZsF,CAEtFE,EAFsF;AAAA,MAGtFC,KAHsF,GAYtFH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AER;AAJb,QAMKD,WANL,CAFR,EAWI,oBAAC,MAAD,eACQD,qBADR;AAEI,MAAA,GAAG,EAAEX,qBAFT;AAGI,MAAA,KAAK,EAAErC,KAHX;AAII,MAAA,SAAS,EAAC,kCAJd;AAKI,MAAA,OAAO,EAAE8C;AALb,QAOKF,YAPL,CAXJ;AAHR,IADJ,CAzCJ,CADJ;AAwEH,CArG4E;AAuG7EtB,WAAW,CAACqC,WAAZ,GAA0B7C,cAA1B;AACAQ,WAAW,CAACM,SAAZ,GAAwBb,SAAxB;AACAO,WAAW,CAACsC,YAAZ,GAA2B3C,aAA3B;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"autocompletemultiple.2.js","sources":["../../../src/components/autocomplete/Autocomplete.tsx","../../../src/components/autocomplete/AutocompleteMultiple.tsx"],"sourcesContent":["import React, { forwardRef, ReactNode, RefObject, SyntheticEvent, useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { Dropdown, IconButtonProps, Offset, Placement, TextField, Theme } from '@lumx/react';\n\nimport { Comp, GenericProps, getRootClassName, handleBasicClasses } from '@lumx/react/utils';\n\nimport { useFocus } from '@lumx/react/hooks/useFocus';\nimport { mergeRefs } from '@lumx/react/utils/mergeRefs';\n\n/**\n * Defines the props of the component.\n */\nexport interface AutocompleteProps extends GenericProps {\n /**\n * Whether the suggestions list should display anchored to the input or to the wrapper.\n * @see {@link DropdownProps#anchorToInput}\n */\n anchorToInput?: boolean;\n /**\n * Props to pass to the clear button (minus those already set by the TextField props).\n * If not specified, the button won't be displayed.\n * @see {@link TextFieldProps#clearButtonProps}\n */\n clearButtonProps?: Pick<IconButtonProps, 'label'> &\n Omit<IconButtonProps, 'label' | 'onClick' | 'icon' | 'emphasis'>;\n /**\n * Reference to the <input> or <textarea> element.\n * @see {@link TextFieldProps#inputRef}\n */\n inputRef?: RefObject<HTMLInputElement>;\n /**\n * The offset that will be applied to the Dropdown position.\n * @see {@link DropdownProps#offset}\n */\n offset?: Offset;\n /**\n * The preferred Dropdown location against the anchor element.\n * @see {@link DropdownProps#placement}\n */\n placement?: Placement;\n /**\n * Whether the dropdown should fit to the anchor width or not.\n * @see {@link DropdownProps#fitToAnchorWidth}\n */\n fitToAnchorWidth?: boolean;\n /**\n * The error related to the component.\n * @see {@link TextFieldProps#error}\n */\n error?: string | ReactNode;\n /**\n * Whether the text field is displayed with error style or not.\n * @see {@link TextFieldProps#hasError}\n */\n hasError?: boolean;\n /**\n * Whether the text box should be focused upon closing the suggestions or not.\n */\n shouldFocusOnClose?: boolean;\n /**\n * The helper message of the text field.\n * @see {@link TextFieldProps#helper}\n */\n helper?: string;\n /**\n * The icon of the text field (SVG path).\n * @see {@link TextFieldProps#icon}\n */\n icon?: string;\n /**\n * Whether the component is disabled or not.\n * @see {@link TextFieldProps#isDisabled}\n */\n isDisabled?: boolean;\n /**\n * Whether the component is required or not.\n * @see {@link TextFieldProps#isRequired}\n */\n isRequired?: boolean;\n /**\n * Whether the text field is displayed with valid style or not.\n * @see {@link TextFieldProps#isValid}\n */\n isValid?: boolean;\n /**\n * The label of the text field displayed in a label tag.\n * @see {@link TextFieldProps#label}\n */\n label?: string;\n /**\n * The placeholder message of the text field.\n * @see {@link TextFieldProps#placeholder}\n */\n placeholder?: string;\n /** Theme adapting the component to light or dark background. */\n theme?: Theme;\n /** List of suggestions to display during autocomplete. */\n children: React.ReactNode;\n /**\n * The list of chips to be displayed before the text field input.\n */\n chips?: React.ReactNode;\n /**\n * The value of the text field.\n * @see {@link TextFieldProps#value}\n */\n value: string;\n /**\n * Whether the suggestions from the autocomplete should be displayed or not.\n * @see {@link DropdownProps#isOpen}\n */\n isOpen: boolean;\n /**\n * The native input name property.\n * @see {@link TextFieldProps#name}\n */\n name?: string;\n /**\n * Whether a click in the Autocomplete dropdown would close it or not.\n * @see {@link DropdownProps#closeOnClick}\n */\n closeOnClick?: boolean;\n /**\n * Whether a click anywhere out of the Autocomplete would close it or not.\n * @see {@link DropdownProps#closeOnClickAway}\n */\n closeOnClickAway?: boolean;\n /**\n * Whether an escape key press would close the Autocomplete or not.\n * @see {@link DropdownProps#closeOnEscape}\n */\n closeOnEscape?: boolean;\n /**\n * The function called on blur.\n * @see {@link TextFieldProps#onBlur}\n */\n onBlur?(event: React.FocusEvent): void;\n /**\n * On change callback.\n * @see {@link TextFieldProps#onChange}\n */\n onChange(value: string, name?: string, event?: SyntheticEvent): void;\n /**\n * The function called on close.\n * @see {@link DropdownProps#onClose}\n */\n onClose?(): void;\n /**\n * The function called on focus.\n * @see {@link TextFieldProps#onFocus}\n */\n onFocus?(event: React.FocusEvent): void;\n /**\n * The function called when the bottom of the dropdown is reached.\n * @see {@link DropdownProps#onInfiniteScroll}\n */\n onInfiniteScroll?(): void;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'Autocomplete';\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<AutocompleteProps> = {\n anchorToInput: false,\n closeOnClick: false,\n closeOnClickAway: true,\n closeOnEscape: true,\n shouldFocusOnClose: false,\n};\n\n/**\n * Autocomplete component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const Autocomplete: Comp<AutocompleteProps, HTMLDivElement> = forwardRef((props, ref) => {\n const {\n anchorToInput,\n children,\n chips,\n className,\n closeOnClick,\n closeOnClickAway,\n closeOnEscape,\n disabled,\n error,\n fitToAnchorWidth,\n hasError,\n helper,\n icon,\n inputRef,\n clearButtonProps,\n isDisabled = disabled,\n isRequired,\n isOpen,\n isValid,\n label,\n name,\n offset,\n onBlur,\n onChange,\n onClose,\n onFocus,\n onInfiniteScroll,\n placeholder,\n placement,\n shouldFocusOnClose,\n theme,\n value,\n ...forwardedProps\n } = props;\n const inputAnchorRef = useRef<HTMLElement>(null);\n const textFieldRef = useRef(null);\n useFocus(inputAnchorRef.current, !isOpen && shouldFocusOnClose);\n\n return (\n <div\n ref={ref}\n {...forwardedProps}\n className={classNames(\n className,\n handleBasicClasses({\n prefix: CLASSNAME,\n }),\n )}\n >\n <TextField\n chips={chips}\n error={error}\n hasError={hasError}\n helper={helper}\n icon={icon}\n inputRef={mergeRefs(inputAnchorRef, inputRef) as any}\n clearButtonProps={clearButtonProps}\n isDisabled={isDisabled}\n isRequired={isRequired}\n isValid={isValid}\n label={label}\n name={name}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n placeholder={placeholder}\n textFieldRef={textFieldRef}\n theme={theme}\n value={value}\n />\n <Dropdown\n anchorRef={anchorToInput ? inputAnchorRef : textFieldRef}\n closeOnClick={closeOnClick}\n closeOnClickAway={closeOnClickAway}\n closeOnEscape={closeOnEscape}\n fitToAnchorWidth={fitToAnchorWidth}\n isOpen={isOpen}\n offset={offset}\n onClose={onClose}\n onInfiniteScroll={onInfiniteScroll}\n placement={placement}\n shouldFocusOnOpen={false}\n theme={theme}\n >\n {children}\n </Dropdown>\n </div>\n );\n});\nAutocomplete.displayName = COMPONENT_NAME;\nAutocomplete.className = CLASSNAME;\nAutocomplete.defaultProps = DEFAULT_PROPS;\n","import { mdiClose } from '@lumx/icons';\nimport { Autocomplete, AutocompleteProps, Chip, HorizontalAlignment, Icon, Size } from '@lumx/react';\n\nimport { Comp, getRootClassName, handleBasicClasses } from '@lumx/react/utils';\n\nimport classNames from 'classnames';\nimport React, { forwardRef, ReactNode } from 'react';\n\n/**\n * Defines the props of the component.\n */\nexport interface AutocompleteMultipleProps extends AutocompleteProps {\n /** Selected values. */\n values: any[];\n /** Alignment of the chips in the autocomplete. */\n chipsAlignment?: HorizontalAlignment;\n /** Selected value render function. Default: Renders the value inside of a Chip. */\n selectedChipRender(\n choice: any,\n index: number,\n onClear?: (event: React.MouseEvent, choice: any) => void,\n isDisabled?: boolean,\n ): ReactNode | string;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'AutocompleteMultiple';\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<AutocompleteMultipleProps> = {\n closeOnClickAway: true,\n closeOnEscape: true,\n selectedChipRender(choice, index, onClear, isDisabled) {\n const onClick = (event: React.MouseEvent) => onClear && onClear(event, choice);\n return (\n <Chip\n key={index}\n after={onClear && <Icon icon={mdiClose} size={Size.xxs} />}\n isDisabled={isDisabled}\n size={Size.s}\n onAfterClick={onClick}\n onClick={onClick}\n >\n {choice}\n </Chip>\n );\n },\n values: [],\n};\n\n/**\n * AutocompleteMultiple component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const AutocompleteMultiple: Comp<AutocompleteMultipleProps, HTMLDivElement> = forwardRef((props, ref) => {\n const {\n anchorToInput,\n children,\n // `chipsAlignment` needs to be here to remove it from `forwardedProps`.\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n chipsAlignment,\n className,\n closeOnClickAway,\n closeOnEscape,\n fitToAnchorWidth,\n hasError,\n helper,\n icon,\n inputRef,\n clearButtonProps,\n isDisabled,\n isRequired,\n isOpen,\n isValid,\n label,\n name,\n offset,\n onBlur,\n onChange,\n onClear,\n onClose,\n onFocus,\n onInfiniteScroll,\n onKeyDown,\n placeholder,\n placement,\n selectedChipRender,\n shouldFocusOnClose,\n theme,\n type,\n value,\n values,\n ...forwardedProps\n } = props;\n\n return (\n <Autocomplete\n ref={ref}\n {...forwardedProps}\n anchorToInput={anchorToInput}\n className={classNames(\n className,\n handleBasicClasses({\n prefix: CLASSNAME,\n }),\n )}\n name={name}\n value={value}\n onChange={onChange}\n onKeyDown={onKeyDown}\n onBlur={onBlur}\n shouldFocusOnClose={shouldFocusOnClose}\n onFocus={onFocus}\n hasError={hasError}\n helper={helper}\n icon={icon}\n inputRef={inputRef}\n chips={values && values.map((chip: any, index: number) => selectedChipRender(chip, index, onClear))}\n isDisabled={isDisabled}\n isRequired={isRequired}\n clearButtonProps={clearButtonProps}\n isValid={isValid}\n label={label}\n placeholder={placeholder}\n theme={theme}\n type={type}\n isOpen={isOpen}\n closeOnClick={false}\n closeOnClickAway={closeOnClickAway}\n closeOnEscape={closeOnEscape}\n onClose={onClose}\n offset={offset}\n placement={placement}\n fitToAnchorWidth={fitToAnchorWidth}\n onInfiniteScroll={onInfiniteScroll}\n >\n {children}\n </Autocomplete>\n );\n});\nAutocompleteMultiple.displayName = COMPONENT_NAME;\nAutocompleteMultiple.className = CLASSNAME;\nAutocompleteMultiple.defaultProps = DEFAULT_PROPS;\n"],"names":["COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","anchorToInput","closeOnClick","closeOnClickAway","closeOnEscape","shouldFocusOnClose","Autocomplete","forwardRef","props","ref","children","chips","className","disabled","error","fitToAnchorWidth","hasError","helper","icon","inputRef","clearButtonProps","isDisabled","isRequired","isOpen","isValid","label","name","offset","onBlur","onChange","onClose","onFocus","onInfiniteScroll","placeholder","placement","theme","value","forwardedProps","inputAnchorRef","useRef","textFieldRef","useFocus","current","classNames","handleBasicClasses","prefix","mergeRefs","displayName","defaultProps","selectedChipRender","choice","index","onClear","onClick","event","mdiClose","Size","xxs","s","values","AutocompleteMultiple","chipsAlignment","onKeyDown","type","map","chip"],"mappings":";;;;;;;;;;;AAWA;;;;AAsJA;;;AAGA,IAAMA,cAAc,GAAG,cAAvB;AAEA;;;;AAGA,IAAMC,SAAS,GAAGC,gBAAgB,CAACF,cAAD,CAAlC;AAEA;;;;AAGA,IAAMG,aAAyC,GAAG;AAC9CC,EAAAA,aAAa,EAAE,KAD+B;AAE9CC,EAAAA,YAAY,EAAE,KAFgC;AAG9CC,EAAAA,gBAAgB,EAAE,IAH4B;AAI9CC,EAAAA,aAAa,EAAE,IAJ+B;AAK9CC,EAAAA,kBAAkB,EAAE;AAL0B,CAAlD;AAQA;;;;;;;;IAOaC,YAAqD,GAAGC,UAAU,CAAC,UAACC,KAAD,EAAQC,GAAR,EAAgB;AAAA,MAExFR,aAFwF,GAmC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AX,CArBrB;AAsBI,IAAA,UAAU,EAAE/B,UAtBhB;AAuBI,IAAA,UAAU,EAAEC,UAvBhB;AAwBI,IAAA,gBAAgB,EAAEF,gBAxBtB;AAyBI,IAAA,OAAO,EAAEI,OAzBb;AA0BI,IAAA,KAAK,EAAEC,KA1BX;AA2BI,IAAA,WAAW,EAAEQ,WA3BjB;AA4BI,IAAA,KAAK,EAAEE,KA5BX;AA6BI,IAAA,IAAI,EAAE4B,IA7BV;AA8BI,IAAA,MAAM,EAAExC,MA9BZ;AA+BI,IAAA,YAAY,EAAE,KA/BlB;AAgCI,IAAA,gBAAgB,EAAEpB,gBAhCtB;AAiCI,IAAA,aAAa,EAAEC,aAjCnB;AAkCI,IAAA,OAAO,EAAE0B,OAlCb;AAmCI,IAAA,MAAM,EAAEH,MAnCZ;AAoCI,IAAA,SAAS,EAAEO,SApCf;AAqCI,IAAA,gBAAgB,EAAEnB,gBArCtB;AAsCI,IAAA,gBAAgB,EAAEiB;AAtCtB,MAwCKtB,QAxCL,CADJ;AA4CH,CArF8F;AAsF/FkD,oBAAoB,CAACb,WAArB,GAAmClD,gBAAnC;AACA+D,oBAAoB,CAAChD,SAArB,GAAiCd,WAAjC;AACA8D,oBAAoB,CAACZ,YAArB,GAAoChD,eAApC;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"avatar.3.js","sources":["../../../src/components/avatar/Avatar.tsx"],"sourcesContent":["import React, { forwardRef, KeyboardEventHandler, MouseEventHandler, ReactElement, ReactNode } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AspectRatio, Size, Theme, Thumbnail, ThumbnailProps } from '@lumx/react';\n\nimport { Comp, GenericProps, getRootClassName, handleBasicClasses } from '@lumx/react/utils';\n\n/**\n * Avatar sizes.\n */\nexport type AvatarSize = Extract<Size, 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl'>;\n\n/**\n * Defines the props of the component.\n */\nexport interface AvatarProps extends GenericProps {\n /** Action toolbar content. */\n actions?: ReactNode;\n /** Image alternative text. */\n alt: string;\n /** Badge. */\n badge?: ReactElement;\n /** Image URL. */\n image: string;\n /** Props to pass to the link wrapping the thumbnail. */\n linkProps?: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;\n /** Custom react component for the link (can be used to inject react router Link). */\n linkAs?: 'a' | any;\n /** On click callback. */\n onClick?: MouseEventHandler<HTMLDivElement>;\n /** On key press callback. */\n onKeyPress?: KeyboardEventHandler<HTMLDivElement>;\n /** Size variant. */\n size?: AvatarSize;\n /** Theme adapting the component to light or dark background. */\n theme?: Theme;\n /** Props to pass to the thumbnail (minus those already set by the Avatar props). */\n thumbnailProps?: Omit<\n ThumbnailProps,\n 'image' | 'alt' | 'size' | 'theme' | 'align' | 'fillHeight' | 'variant' | 'aspectRatio'\n >;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'Avatar';\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<AvatarProps> = {\n size: Size.m,\n theme: Theme.light,\n};\n\n/**\n * Avatar component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const Avatar: Comp<AvatarProps, HTMLDivElement> = forwardRef((props, ref) => {\n const {\n actions,\n alt,\n badge,\n className,\n image,\n linkProps,\n linkAs,\n onClick,\n onKeyPress,\n size,\n theme,\n thumbnailProps,\n ...forwardedProps\n } = props;\n\n return (\n <div\n ref={ref}\n {...forwardedProps}\n className={classNames(className, handleBasicClasses({ prefix: CLASSNAME, size, theme }))}\n >\n <Thumbnail\n linkProps={linkProps}\n linkAs={linkAs}\n className={`${CLASSNAME}__thumbnail`}\n onClick={onClick}\n onKeyPress={onKeyPress}\n {...thumbnailProps}\n aspectRatio={AspectRatio.square}\n size={size}\n image={image}\n alt={alt}\n theme={theme}\n />\n {actions && <div className={`${CLASSNAME}__actions`}>{actions}</div>}\n {badge && <div className={`${CLASSNAME}__badge`}>{badge}</div>}\n </div>\n );\n});\nAvatar.displayName = COMPONENT_NAME;\nAvatar.className = CLASSNAME;\nAvatar.defaultProps = DEFAULT_PROPS;\n"],"names":["COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","size","Size","m","theme","Theme","light","Avatar","forwardRef","props","ref","actions","alt","badge","className","image","linkProps","linkAs","onClick","onKeyPress","thumbnailProps","forwardedProps","classNames","handleBasicClasses","prefix","AspectRatio","square","displayName","defaultProps"],"mappings":";;;;;;AAQA;;;;AAoCA;;;AAGA,IAAMA,cAAc,GAAG,QAAvB;AAEA;;;;AAGA,IAAMC,SAAS,GAAGC,gBAAgB,CAACF,cAAD,CAAlC;AAEA;;;;AAGA,IAAMG,aAAmC,GAAG;AACxCC,EAAAA,IAAI,EAAEC,IAAI,CAACC,CAD6B;AAExCC,EAAAA,KAAK,EAAEC,KAAK,CAACC;AAF2B,CAA5C;AAKA;;;;;;;;IAOaC,MAAyC,GAAGC,UAAU,CAAC,UAACC,KAAD,EAAQC,GAAR,EAAgB;AAAA,MAE5EC,OAF4E,GAe5EF,KAf4E,CAE5EE,OAF4E;AAAA,MAG5EC,GAH4E,GAe5EH,KAf4E,CAG5EG,GAH4E;AAAA,MAI5EC,KAJ4E,GAe5EJ,KAf4E,CAI5EI,KAJ4E;AAAA,MAK5EC,SAL4E,GAe5EL,KAf4E,CAK5EK,SAL4E;AAAA,MAM5EC,KAN4E,GAe5EN,KAf4E,CAM5EM,KAN4E;AAAA,MAO5EC,SAP4E,GAe5EP,KAf4E,CAO5EO,SAP4E;AAAA,MAQ5EC,MAR4E,GAe5ER,KAf4E,CAQ5EQ,MAR4E;AAAA,MAS5EC,OAT4E,GAe5ET,KAf4E,CAS5ES,OAT4E;AAAA,MAU5EC,UAV4E,GAe5EV,KAf4E,CAU5EU,UAV4E;AAAA,MAW5ElB,IAX4E,GAe5EQ,KAf4E,CAW5ER,IAX4E;AAAA,MAY5EG,KAZ4E,GAe5EK,KAf4E,CAY5EL,KAZ4E;AAAA,MAa5EgB,cAb4E,GAe5EX,KAf4E,CAa5EW,cAb4E;AAAA,MAczEC,cAdyE,4BAe5EZ,KAf4E;;AAiBhF,SACI;AACI,IAAA,GAAG,EAAEC;AADT,KAEQW,cAFR;AAGI,IAAA,SAAS,EAAEC,UAAU,CAACR,SAAD,EAAYS,kBAAkB,CAAC;AAAEC,MAAAA,MAAM,EAAE1B,SAAV;AAAqBG,MAAAA,IAAI,EAAJA,IAArB;AAA2BG,MAAAA,KAAK,EAALA;AAA3B,KAAD,CAA9B;AAHzB,MAKI,oBAAC,SAAD;AACI,IAAA,SAAS,EAAEY,SADf;AAEI,IAAA,MAAM,EAAEC,MAFZ;AAGI,IAAA,SAAS,YAAKnB,SAAL,gBAHb;AAII,IAAA,OAAO,EAAEoB,OAJb;AAKI,IAAA,UAAU,EAAEC;AALhB,KAMQC,cANR;AAOI,IAAA,WAAW,EAAEK,WAAW,CAACC,MAP7B;AAQI,IAAA,IAAI,EAAEzB,IARV;AASI,IAAA,KAAK,EAAEc,KATX;AAUI,IAAA,GAAG,EAAEH,GAVT;AAWI,IAAA,KAAK,EAAER;AAXX,KALJ,EAkBKO,OAAO,IAAI;AAAK,IAAA,SAAS,YAAKb,SAAL;AAAd,KAA0Ca,OAA1C,CAlBhB,EAmBKE,KAAK,IAAI;AAAK,IAAA,SAAS,YAAKf,SAAL;AAAd,KAAwCe,KAAxC,CAnBd,CADJ;AAuBH,CAxCkE;AAyCnEN,MAAM,CAACoB,WAAP,GAAqB9B,cAArB;AACAU,MAAM,CAACO,SAAP,GAAmBhB,SAAnB;AACAS,MAAM,CAACqB,YAAP,GAAsB5B,aAAtB;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"badge.4.js","sources":["../../../src/components/badge/Badge.tsx"],"sourcesContent":["import { Color, ColorPalette } from '@lumx/react';\nimport { Comp, GenericProps, getRootClassName, handleBasicClasses } from '@lumx/react/utils';\nimport classNames from 'classnames';\nimport React, { forwardRef, ReactNode } from 'react';\n\n/**\n * Defines the props of the component.\n */\nexport interface BadgeProps extends GenericProps {\n /** Badge content. */\n children?: ReactNode;\n /** Color variant. */\n color?: Color;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'Badge';\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<BadgeProps> = {\n color: ColorPalette.primary,\n};\n\n/**\n * Badge component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const Badge: Comp<BadgeProps, HTMLDivElement> = forwardRef((props, ref) => {\n const { children, className, color, ...forwardedProps } = props;\n return (\n <div\n ref={ref}\n {...forwardedProps}\n className={classNames(className, handleBasicClasses({ prefix: CLASSNAME, color }))}\n >\n {children}\n </div>\n );\n});\nBadge.displayName = COMPONENT_NAME;\nBadge.className = CLASSNAME;\nBadge.defaultProps = DEFAULT_PROPS;\n"],"names":["COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","color","ColorPalette","primary","Badge","forwardRef","props","ref","children","className","forwardedProps","classNames","handleBasicClasses","prefix","displayName","defaultProps"],"mappings":";;;;;AAKA;;;;AAUA;;;AAGA,IAAMA,cAAc,GAAG,OAAvB;AAEA;;;;AAGA,IAAMC,SAAS,GAAGC,gBAAgB,CAACF,cAAD,CAAlC;AAEA;;;;AAGA,IAAMG,aAAkC,GAAG;AACvCC,EAAAA,KAAK,EAAEC,YAAY,CAACC;AADmB,CAA3C;AAIA;;;;;;;;IAOaC,KAAuC,GAAGC,UAAU,CAAC,UAACC,KAAD,EAAQC,GAAR,EAAgB;AAAA,MACtEC,QADsE,GACpBF,KADoB,CACtEE,QADsE;AAAA,MAC5DC,SAD4D,GACpBH,KADoB,CAC5DG,SAD4D;AAAA,MACjDR,KADiD,GACpBK,KADoB,CACjDL,KADiD;AAAA,MACvCS,cADuC,4BACpBJ,KADoB;;AAE9E,SACI;AACI,IAAA,GAAG,EAAEC;AADT,KAEQG,cAFR;AAGI,IAAA,SAAS,EAAEC,UAAU,CAACF,SAAD,EAAYG,kBAAkB,CAAC;AAAEC,MAAAA,MAAM,EAAEf,SAAV;AAAqBG,MAAAA,KAAK,EAALA;AAArB,KAAD,CAA9B;AAHzB,MAKKO,QALL,CADJ;AASH,CAXgE;AAYjEJ,KAAK,CAACU,WAAN,GAAoBjB,cAApB;AACAO,KAAK,CAACK,SAAN,GAAkBX,SAAlB;AACAM,KAAK,CAACW,YAAN,GAAqBf,aAArB;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"button.5.js","sources":["../../../src/components/button/Button.tsx"],"sourcesContent":["import React, { forwardRef, ReactNode } from 'react';\n\nimport classNames from 'classnames';\nimport isEmpty from 'lodash/isEmpty';\n\nimport { Emphasis, Icon, Size, Theme } from '@lumx/react';\nimport { Comp, getBasicClass, getRootClassName } from '@lumx/react/utils';\nimport { BaseButtonProps, ButtonRoot } from './ButtonRoot';\n\n/**\n * Button emphasis definition.\n * @deprecated Use Emphasis instead.\n */\nexport const ButtonEmphasis = Emphasis;\n\n/**\n * Defines the props of the component.\n */\nexport interface ButtonProps extends BaseButtonProps {\n /** Button content. */\n children?: ReactNode;\n /** Left icon (SVG path). */\n leftIcon?: string;\n /** Right icon (SVG path). */\n rightIcon?: string;\n /** When `true`, the button gets as large as possible. */\n fullWidth?: boolean;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'Button';\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<ButtonProps> = {\n emphasis: Emphasis.high,\n size: Size.m,\n theme: Theme.light,\n};\n\n/**\n * Button component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const Button: Comp<ButtonProps, HTMLButtonElement | HTMLAnchorElement> = forwardRef((props, ref) => {\n const { children, className, emphasis, leftIcon, rightIcon, size, theme, ...forwardedProps } = props;\n\n const buttonClassName = classNames(\n className,\n getBasicClass({ prefix: CLASSNAME, type: 'hasLeftIcon', value: !isEmpty(leftIcon) }),\n getBasicClass({ prefix: CLASSNAME, type: 'hasRightIcon', value: !isEmpty(rightIcon) }),\n );\n\n return (\n <ButtonRoot\n ref={ref}\n {...{ emphasis, size, theme, ...forwardedProps }}\n className={buttonClassName}\n variant=\"button\"\n >\n {leftIcon && !isEmpty(leftIcon) && <Icon icon={leftIcon} />}\n {children && <span>{children}</span>}\n {rightIcon && !isEmpty(rightIcon) && <Icon icon={rightIcon} />}\n </ButtonRoot>\n );\n});\nButton.displayName = COMPONENT_NAME;\nButton.className = CLASSNAME;\nButton.defaultProps = DEFAULT_PROPS;\n"],"names":["ButtonEmphasis","Emphasis","COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","emphasis","high","size","Size","m","theme","Theme","light","Button","forwardRef","props","ref","children","className","leftIcon","rightIcon","forwardedProps","buttonClassName","classNames","getBasicClass","prefix","type","value","isEmpty","displayName","defaultProps"],"mappings":";;;;;;;;AASA;;;;;IAIaA,cAAc,GAAGC;AAE9B;;;;AAcA;;;AAGA,IAAMC,cAAc,GAAG,QAAvB;AAEA;;;;AAGA,IAAMC,SAAS,GAAGC,gBAAgB,CAACF,cAAD,CAAlC;AAEA;;;;AAGA,IAAMG,aAAmC,GAAG;AACxCC,EAAAA,QAAQ,EAAEL,QAAQ,CAACM,IADqB;AAExCC,EAAAA,IAAI,EAAEC,IAAI,CAACC,CAF6B;AAGxCC,EAAAA,KAAK,EAAEC,KAAK,CAACC;AAH2B,CAA5C;AAMA;;;;;;;;IAOaC,MAAgE,GAAGC,UAAU,CAAC,UAACC,KAAD,EAAQC,GAAR,EAAgB;AAAA,MAC/FC,QAD+F,GACRF,KADQ,CAC/FE,QAD+F;AAAA,MACrFC,SADqF,GACRH,KADQ,CACrFG,SADqF;AAAA,MAC1Eb,QAD0E,GACRU,K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,MAAM,CAACiB,YAAP,GAAsB1B,aAAtB;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"buttongroup.7.js","sources":["../../../src/components/button/ButtonGroup.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { Comp, GenericProps, getRootClassName } from '@lumx/react/utils';\n\n/**\n * Defines the props of the component\n */\nexport type ButtonGroupProps = GenericProps;\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'ButtonGroup';\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<ButtonGroupProps> = {};\n\n/**\n * ButtonGroup component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const ButtonGroup: Comp<ButtonGroupProps, HTMLDivElement> = forwardRef((props, ref) => {\n const { children, className, ...forwardedProps } = props;\n\n return (\n <div ref={ref} {...forwardedProps} className={classNames(className, CLASSNAME)}>\n {children}\n </div>\n );\n});\nButtonGroup.displayName = COMPONENT_NAME;\nButtonGroup.className = CLASSNAME;\nButtonGroup.defaultProps = DEFAULT_PROPS;\n"],"names":["COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","ButtonGroup","forwardRef","props","ref","children","className","forwardedProps","classNames","displayName","defaultProps"],"mappings":";;;;;;;;AAMA;;;;AAKA;;;AAGA,IAAMA,cAAc,GAAG,aAAvB;AAEA;;;;AAGA,IAAMC,SAAS,GAAGC,gBAAgB,CAACF,cAAD,CAAlC;AAEA;;;;AAGA,IAAMG,aAAwC,GAAG,EAAjD;AAEA;;;;;;;;IAOaC,WAAmD,GAAGC,UAAU,CAAC,UAACC,KAAD,EAAQC,GAAR,EAAgB;AAAA,MAClFC,QADkF,GACvCF,KADuC,CAClFE,QADkF;AAAA,MACxEC,SADwE,GACvCH,KADuC,CACxEG,SADwE;AAAA,MAC1DC,cAD0D,4BACvCJ,KADuC;;AAG1F,SACI;AAAK,IAAA,GAAG,EAAEC;AAAV,KAAmBG,cAAnB;AAAmC,IAAA,SAAS,EAAEC,UAAU,CAACF,SAAD,EAAYR,SAAZ;AAAxD,MACKO,QADL,CADJ;AAKH,CAR4E;AAS7EJ,WAAW,CAACQ,WAAZ,GAA0BZ,cAA1B;AACAI,WAAW,CAACK,SAAZ,GAAwBR,SAAxB;AACAG,WAAW,CAACS,YAAZ,GAA2BV,aAA3B;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"buttonroot.57.js","sources":["../../../src/components/button/ButtonRoot.tsx"],"sourcesContent":["import React, { ButtonHTMLAttributes, DetailedHTMLProps, forwardRef, RefObject } from 'react';\n\nimport isEmpty from 'lodash/isEmpty';\n\nimport classNames from 'classnames';\n\nimport { Color, ColorPalette, Emphasis, Size, Theme } from '@lumx/react';\nimport { CSS_PREFIX } from '@lumx/react/constants';\nimport { Comp, GenericProps, handleBasicClasses } from '@lumx/react/utils';\nimport { renderLink } from '@lumx/react/utils/renderLink';\n\ntype HTMLButtonProps = DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;\n\n/**\n * Button size definition.\n */\nexport type ButtonSize = Extract<Size, 's' | 'm'>;\n\nexport interface BaseButtonProps extends GenericProps {\n /** ARIA button label. */\n ['aria-label']?: string;\n /** Color variant. */\n color?: Color;\n /** Emphasis variant. */\n emphasis?: Emphasis;\n /** Whether or not the button has a background color in low emphasis. */\n hasBackground?: boolean;\n /** Native anchor href property. It determines whether the Button will be a <button> or an <a>. */\n href?: string;\n /** Whether the component is disabled or not. */\n isDisabled?: boolean;\n /** Whether the component is selected or not. */\n isSelected?: boolean;\n /** Native button name property. */\n name?: string;\n /** Size variant. */\n size?: ButtonSize;\n /** Native anchor target property. */\n target?: '_self' | '_blank' | '_parent' | '_top';\n /** Theme adapting the component to light or dark background. */\n theme?: Theme;\n /** Native button type. */\n type?: HTMLButtonProps['type'];\n /** Custom react component for the link (can be used to inject react router Link). */\n linkAs?: 'a' | any;\n}\n\nexport interface ButtonRootProps extends BaseButtonProps {\n variant: 'button' | 'icon';\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'ButtonRoot';\n\nexport const BUTTON_WRAPPER_CLASSNAME = `${CSS_PREFIX}-button-wrapper`;\nexport const BUTTON_CLASSNAME = `${CSS_PREFIX}-button`;\n\n/**\n * Render a button wrapper with the ButtonRoot inside.\n *\n * @param props Component props.\n * @return React element.\n */\nconst renderButtonWrapper: React.FC<ButtonRootProps> = (props) => {\n const { color, emphasis, variant, fullWidth } = props;\n\n const adaptedColor =\n emphasis === Emphasis.low && (color === ColorPalette.light ? ColorPalette.dark : ColorPalette.light);\n\n const wrapperClassName = classNames(\n handleBasicClasses({\n color: adaptedColor,\n prefix: BUTTON_WRAPPER_CLASSNAME,\n variant,\n fullWidth,\n }),\n );\n const buttonProps = { ...props, hasBackground: false };\n\n return (\n <div className={wrapperClassName}>\n {/* eslint-disable-next-line @typescript-eslint/no-use-before-define */}\n <ButtonRoot {...buttonProps} />\n </div>\n );\n};\n\n/**\n * ButtonRoot component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const ButtonRoot: Comp<ButtonRootProps, HTMLButtonElement | HTMLAnchorElement> = forwardRef((props, ref) => {\n const {\n 'aria-label': ariaLabel,\n children,\n className,\n color,\n disabled,\n emphasis,\n hasBackground,\n href,\n isDisabled = disabled,\n isSelected,\n isActive,\n isFocused,\n isHovered,\n linkAs,\n name,\n size,\n target,\n theme,\n variant,\n type = 'button',\n fullWidth,\n ...forwardedProps\n } = props;\n\n const adaptedColor =\n color ||\n (emphasis !== Emphasis.high && theme === Theme.dark && ColorPalette.light) ||\n (emphasis === Emphasis.high && ColorPalette.primary) ||\n ColorPalette.dark;\n\n if (hasBackground) {\n return renderButtonWrapper({ ...props, ref, variant, color: adaptedColor });\n }\n\n const buttonClassName = classNames(\n className,\n handleBasicClasses({\n color: adaptedColor,\n emphasis,\n isSelected,\n isDisabled,\n isActive,\n isFocused,\n isHovered,\n prefix: BUTTON_CLASSNAME,\n size,\n theme: emphasis === Emphasis.high && theme,\n variant,\n fullWidth,\n }),\n );\n\n /**\n * If the linkAs prop is used, we use the linkAs component instead of a <button>.\n * If there is an href attribute, we display an <a> instead of a <button>.\n *\n * However, in any case, if the component is disabled, we returned a <button> since disabled is not compatible with <a>.\n */\n if ((linkAs || !isEmpty(props.href)) && !isDisabled) {\n return renderLink(\n {\n linkAs,\n ...forwardedProps,\n 'aria-label': ariaLabel,\n href,\n target,\n className: buttonClassName,\n ref: ref as RefObject<HTMLAnchorElement>,\n },\n children,\n );\n }\n return (\n <button\n {...forwardedProps}\n disabled={isDisabled}\n aria-disabled={isDisabled}\n aria-label={ariaLabel}\n ref={ref as RefObject<HTMLButtonElement>}\n className={buttonClassName}\n name={name}\n type={\n // eslint-disable-next-line react/button-has-type\n type\n }\n >\n {children}\n </button>\n );\n});\nButtonRoot.displayName = COMPONENT_NAME;\nButtonRoot.defaultProps = {};\n"],"names":["COMPONENT_NAME","BUTTON_WRAPPER_CLASSNAME","CSS_PREFIX","BUTTON_CLASSNAME","renderButtonWrapper","props","color","emphasis","variant","fullWidth","adaptedColor","Emphasis","low","ColorPalette","light","dark","wrapperClassName","classNames","handleBasicClasses","prefix","buttonProps","hasBackground","ButtonRoot","forwardRef","ref","ariaLabel","children","className","disabled","href","isDisabled","isSelected","isActive","isFocused","isHovered","linkAs","name","size","target","theme","type","forwardedProps","high","Theme","primary","buttonClassName","isEmpty","renderLink","displayName","defaultProps"],"mappings":";;;;;;;AAmDA;;;AAGA,IAAMA,cAAc,GAAG,YAAvB;AAEO,IAAMC,wBAAwB,aAAMC,UAAN,oBAA9B;AACA,IAAMC,gBAAgB,aAAMD,UAAN,YAAtB;AAEP;;;;;;;AAMA,IAAME,mBAA8C,GAAG,SAAjDA,mBAAiD,CAACC,KAAD,EAAW;AAAA,MACtDC,KADsD,GACdD,KADc,CACtDC,KADsD;AAAA,MAC/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