@lumx/react 3.0.2 → 3.0.3-alpha.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 (391) hide show
  1. package/{esm/_internal/_rollupPluginBabelHelpers.js → _internal/ClickAwayProvider.js} +107 -2
  2. package/_internal/ClickAwayProvider.js.map +1 -0
  3. package/_internal/types.d.ts +271 -0
  4. package/index.d.ts +2686 -0
  5. package/index.js +12533 -0
  6. package/index.js.map +1 -0
  7. package/package.json +7 -6
  8. package/src/components/alert-dialog/AlertDialog.tsx +2 -1
  9. package/src/components/autocomplete/Autocomplete.tsx +2 -2
  10. package/src/components/autocomplete/AutocompleteMultiple.tsx +2 -1
  11. package/src/components/avatar/Avatar.tsx +2 -1
  12. package/src/components/badge/Badge.test.tsx +1 -1
  13. package/src/components/badge/Badge.tsx +2 -1
  14. package/src/components/button/Button.test.tsx +1 -1
  15. package/src/components/button/Button.tsx +2 -1
  16. package/src/components/button/ButtonGroup.tsx +2 -1
  17. package/src/components/button/ButtonRoot.test.tsx +1 -1
  18. package/src/components/button/ButtonRoot.tsx +2 -1
  19. package/src/components/button/IconButton.tsx +2 -1
  20. package/src/components/checkbox/Checkbox.test.tsx +1 -1
  21. package/src/components/checkbox/Checkbox.tsx +2 -1
  22. package/src/components/chip/Chip.test.tsx +1 -1
  23. package/src/components/chip/Chip.tsx +3 -1
  24. package/src/components/chip/ChipGroup.tsx +2 -1
  25. package/src/components/comment-block/CommentBlock.tsx +2 -1
  26. package/src/components/date-picker/DatePicker.tsx +1 -1
  27. package/src/components/date-picker/DatePickerControlled.tsx +1 -1
  28. package/src/components/date-picker/DatePickerField.tsx +1 -1
  29. package/src/components/date-picker/constants.ts +1 -1
  30. package/src/components/date-picker/types.ts +1 -1
  31. package/src/components/dialog/Dialog.tsx +4 -8
  32. package/src/components/divider/Divider.test.tsx +1 -1
  33. package/src/components/divider/Divider.tsx +3 -2
  34. package/src/components/drag-handle/DragHandle.tsx +2 -1
  35. package/src/components/dropdown/Dropdown.tsx +2 -1
  36. package/src/components/expansion-panel/ExpansionPanel.test.tsx +1 -1
  37. package/src/components/expansion-panel/ExpansionPanel.tsx +3 -10
  38. package/src/components/flag/Flag.test.tsx +1 -1
  39. package/src/components/flag/Flag.tsx +2 -1
  40. package/src/components/flex-box/FlexBox.stories.tsx +8 -0
  41. package/src/components/flex-box/FlexBox.tsx +7 -3
  42. package/src/components/flex-box/__snapshots__/FlexBox.test.tsx.snap +16 -0
  43. package/src/components/generic-block/GenericBlock.stories.jsx +23 -1
  44. package/src/components/generic-block/GenericBlock.tsx +18 -4
  45. package/src/components/generic-block/constants.ts +9 -0
  46. package/src/components/generic-block/index.ts +1 -0
  47. package/src/components/grid/Grid.tsx +2 -1
  48. package/src/components/grid/GridItem.tsx +2 -1
  49. package/src/components/heading/Heading.tsx +2 -1
  50. package/src/components/heading/HeadingLevelProvider.tsx +1 -1
  51. package/src/components/heading/context.tsx +1 -1
  52. package/src/components/icon/Icon.test.tsx +1 -1
  53. package/src/components/icon/Icon.tsx +2 -1
  54. package/src/components/image-block/ImageBlock.tsx +2 -1
  55. package/src/components/index.ts +1 -1
  56. package/src/components/inline-list/InlineList.stories.tsx +40 -0
  57. package/src/components/inline-list/InlineList.test.tsx +41 -0
  58. package/src/components/inline-list/InlineList.tsx +80 -0
  59. package/src/components/inline-list/index.ts +1 -0
  60. package/src/components/input-helper/InputHelper.tsx +2 -1
  61. package/src/components/input-label/InputLabel.tsx +2 -1
  62. package/src/components/lightbox/Lightbox.tsx +2 -1
  63. package/src/components/link/Link.tsx +2 -1
  64. package/src/components/link-preview/LinkPreview.test.tsx +1 -1
  65. package/src/components/link-preview/LinkPreview.tsx +2 -1
  66. package/src/components/list/List.tsx +2 -1
  67. package/src/components/list/ListDivider.tsx +2 -1
  68. package/src/components/list/ListItem.tsx +3 -8
  69. package/src/components/list/ListSubheader.tsx +2 -1
  70. package/src/components/list/useInteractiveList.tsx +1 -1
  71. package/src/components/message/Message.test.tsx +1 -1
  72. package/src/components/message/Message.tsx +2 -1
  73. package/src/components/mosaic/Mosaic.tsx +2 -1
  74. package/src/components/notification/Notification.tsx +2 -1
  75. package/src/components/popover/Popover.tsx +2 -1
  76. package/src/components/post-block/PostBlock.tsx +2 -1
  77. package/src/components/progress/Progress.tsx +2 -1
  78. package/src/components/progress-tracker/ProgressTracker.tsx +2 -1
  79. package/src/components/progress-tracker/ProgressTrackerStep.test.tsx +1 -1
  80. package/src/components/progress-tracker/ProgressTrackerStep.tsx +2 -1
  81. package/src/components/progress-tracker/ProgressTrackerStepPanel.tsx +2 -1
  82. package/src/components/radio-button/RadioButton.test.tsx +1 -1
  83. package/src/components/radio-button/RadioButton.tsx +2 -1
  84. package/src/components/radio-button/RadioGroup.tsx +2 -1
  85. package/src/components/select/Select.test.tsx +1 -1
  86. package/src/components/select/Select.tsx +2 -1
  87. package/src/components/select/SelectMultiple.test.tsx +1 -1
  88. package/src/components/select/SelectMultiple.tsx +2 -1
  89. package/src/components/select/WithSelectContext.tsx +1 -1
  90. package/src/components/select/constants.ts +1 -1
  91. package/src/components/side-navigation/SideNavigation.tsx +2 -1
  92. package/src/components/side-navigation/SideNavigationItem.test.tsx +1 -1
  93. package/src/components/side-navigation/SideNavigationItem.tsx +3 -9
  94. package/src/components/skeleton/SkeletonCircle.tsx +2 -1
  95. package/src/components/skeleton/SkeletonRectangle.tsx +2 -1
  96. package/src/components/skeleton/SkeletonTypography.tsx +2 -1
  97. package/src/components/slider/Slider.tsx +2 -1
  98. package/src/components/slideshow/Slides.tsx +2 -1
  99. package/src/components/slideshow/Slideshow.tsx +1 -1
  100. package/src/components/slideshow/SlideshowControls.tsx +2 -1
  101. package/src/components/slideshow/SlideshowItem.tsx +2 -1
  102. package/src/components/slideshow/SlideshowItemGroup.tsx +2 -1
  103. package/src/components/switch/Switch.test.tsx +1 -1
  104. package/src/components/switch/Switch.tsx +2 -1
  105. package/src/components/table/Table.tsx +2 -1
  106. package/src/components/table/TableBody.tsx +2 -1
  107. package/src/components/table/TableCell.tsx +3 -1
  108. package/src/components/table/TableHeader.tsx +2 -1
  109. package/src/components/table/TableRow.tsx +2 -1
  110. package/src/components/tabs/Tab.test.tsx +1 -1
  111. package/src/components/tabs/Tab.tsx +2 -1
  112. package/src/components/tabs/TabList.test.tsx +1 -1
  113. package/src/components/tabs/TabList.tsx +2 -1
  114. package/src/components/tabs/TabPanel.tsx +2 -1
  115. package/src/components/text/{Text.stories.tsx → Text.stories.jsx} +23 -28
  116. package/src/components/text/Text.test.tsx +15 -1
  117. package/src/components/text/Text.tsx +38 -12
  118. package/src/components/text-field/TextField.test.tsx +1 -1
  119. package/src/components/text-field/TextField.tsx +2 -1
  120. package/src/components/thumbnail/Thumbnail.tsx +2 -1
  121. package/src/components/thumbnail/types.ts +1 -1
  122. package/src/components/toolbar/Toolbar.tsx +2 -1
  123. package/src/components/tooltip/Tooltip.tsx +2 -1
  124. package/src/components/tooltip/useTooltipOpen.tsx +1 -1
  125. package/src/components/uploader/Uploader.test.tsx +1 -1
  126. package/src/components/uploader/Uploader.tsx +2 -1
  127. package/src/components/user-block/UserBlock.tsx +2 -1
  128. package/src/hooks/useCallbackOnEscape.ts +2 -1
  129. package/src/hooks/useClickAway.tsx +1 -1
  130. package/src/hooks/useDisableBodyScroll.ts +1 -1
  131. package/src/hooks/useFocusTrap.ts +1 -1
  132. package/src/hooks/useInterval.tsx +1 -1
  133. package/src/hooks/useOnResize.ts +1 -1
  134. package/src/index.ts +5 -0
  135. package/src/stories/generated/GenericBlock/Demos.stories.tsx +3 -1
  136. package/src/stories/generated/Heading/Demos.stories.tsx +6 -0
  137. package/src/stories/withResizableBox.tsx +18 -0
  138. package/src/testing/utils/commonTestsSuite.ts +1 -1
  139. package/src/utils/{getRootClassName.ts → className.ts} +19 -0
  140. package/src/utils/event.ts +1 -0
  141. package/src/utils/index.ts +5 -0
  142. package/src/utils/type.ts +3 -0
  143. package/src/utils/utils.test.ts +1 -1
  144. package/types.d.ts +68 -11
  145. package/utils/index.d.ts +29 -0
  146. package/utils/index.js +2 -0
  147. package/utils/index.js.map +1 -0
  148. package/esm/_internal/AlertDialog.js +0 -141
  149. package/esm/_internal/AlertDialog.js.map +0 -1
  150. package/esm/_internal/AutocompleteMultiple.js +0 -257
  151. package/esm/_internal/AutocompleteMultiple.js.map +0 -1
  152. package/esm/_internal/Avatar2.js +0 -82
  153. package/esm/_internal/Avatar2.js.map +0 -1
  154. package/esm/_internal/Badge2.js +0 -54
  155. package/esm/_internal/Badge2.js.map +0 -1
  156. package/esm/_internal/Button2.js +0 -84
  157. package/esm/_internal/Button2.js.map +0 -1
  158. package/esm/_internal/ButtonGroup.js +0 -51
  159. package/esm/_internal/ButtonGroup.js.map +0 -1
  160. package/esm/_internal/ButtonRoot.js +0 -135
  161. package/esm/_internal/ButtonRoot.js.map +0 -1
  162. package/esm/_internal/Checkbox2.js +0 -116
  163. package/esm/_internal/Checkbox2.js.map +0 -1
  164. package/esm/_internal/Chip2.js +0 -118
  165. package/esm/_internal/Chip2.js.map +0 -1
  166. package/esm/_internal/ChipGroup.js +0 -122
  167. package/esm/_internal/ChipGroup.js.map +0 -1
  168. package/esm/_internal/ClickAwayProvider.js +0 -217
  169. package/esm/_internal/ClickAwayProvider.js.map +0 -1
  170. package/esm/_internal/CommentBlock.js +0 -124
  171. package/esm/_internal/CommentBlock.js.map +0 -1
  172. package/esm/_internal/DatePickerField.js +0 -347
  173. package/esm/_internal/DatePickerField.js.map +0 -1
  174. package/esm/_internal/Dialog2.js +0 -274
  175. package/esm/_internal/Dialog2.js.map +0 -1
  176. package/esm/_internal/Divider2.js +0 -53
  177. package/esm/_internal/Divider2.js.map +0 -1
  178. package/esm/_internal/DragHandle.js +0 -50
  179. package/esm/_internal/DragHandle.js.map +0 -1
  180. package/esm/_internal/Dropdown2.js +0 -157
  181. package/esm/_internal/Dropdown2.js.map +0 -1
  182. package/esm/_internal/ExpansionPanel.js +0 -156
  183. package/esm/_internal/ExpansionPanel.js.map +0 -1
  184. package/esm/_internal/Flag2.js +0 -48
  185. package/esm/_internal/Flag2.js.map +0 -1
  186. package/esm/_internal/FlexBox.js +0 -55
  187. package/esm/_internal/FlexBox.js.map +0 -1
  188. package/esm/_internal/GenericBlock.js +0 -125
  189. package/esm/_internal/GenericBlock.js.map +0 -1
  190. package/esm/_internal/GridItem.js +0 -96
  191. package/esm/_internal/GridItem.js.map +0 -1
  192. package/esm/_internal/HeadingLevelProvider.js +0 -112
  193. package/esm/_internal/HeadingLevelProvider.js.map +0 -1
  194. package/esm/_internal/Icon2.js +0 -120
  195. package/esm/_internal/Icon2.js.map +0 -1
  196. package/esm/_internal/IconButton.js +0 -74
  197. package/esm/_internal/IconButton.js.map +0 -1
  198. package/esm/_internal/ImageBlock.js +0 -101
  199. package/esm/_internal/ImageBlock.js.map +0 -1
  200. package/esm/_internal/InputHelper.js +0 -72
  201. package/esm/_internal/InputHelper.js.map +0 -1
  202. package/esm/_internal/InputLabel.js +0 -58
  203. package/esm/_internal/InputLabel.js.map +0 -1
  204. package/esm/_internal/Lightbox2.js +0 -123
  205. package/esm/_internal/Lightbox2.js.map +0 -1
  206. package/esm/_internal/Link2.js +0 -122
  207. package/esm/_internal/Link2.js.map +0 -1
  208. package/esm/_internal/LinkPreview.js +0 -105
  209. package/esm/_internal/LinkPreview.js.map +0 -1
  210. package/esm/_internal/List2.js +0 -799
  211. package/esm/_internal/List2.js.map +0 -1
  212. package/esm/_internal/ListSubheader.js +0 -79
  213. package/esm/_internal/ListSubheader.js.map +0 -1
  214. package/esm/_internal/Message2.js +0 -78
  215. package/esm/_internal/Message2.js.map +0 -1
  216. package/esm/_internal/Mosaic2.js +0 -89
  217. package/esm/_internal/Mosaic2.js.map +0 -1
  218. package/esm/_internal/Notification2.js +0 -133
  219. package/esm/_internal/Notification2.js.map +0 -1
  220. package/esm/_internal/Popover2.js +0 -2473
  221. package/esm/_internal/Popover2.js.map +0 -1
  222. package/esm/_internal/PostBlock.js +0 -96
  223. package/esm/_internal/PostBlock.js.map +0 -1
  224. package/esm/_internal/Progress2.js +0 -81
  225. package/esm/_internal/Progress2.js.map +0 -1
  226. package/esm/_internal/ProgressTrackerStepPanel.js +0 -313
  227. package/esm/_internal/ProgressTrackerStepPanel.js.map +0 -1
  228. package/esm/_internal/RadioGroup.js +0 -147
  229. package/esm/_internal/RadioGroup.js.map +0 -1
  230. package/esm/_internal/SelectMultiple.js +0 -424
  231. package/esm/_internal/SelectMultiple.js.map +0 -1
  232. package/esm/_internal/SideNavigationItem.js +0 -151
  233. package/esm/_internal/SideNavigationItem.js.map +0 -1
  234. package/esm/_internal/SkeletonTypography.js +0 -168
  235. package/esm/_internal/SkeletonTypography.js.map +0 -1
  236. package/esm/_internal/Slider2.js +0 -327
  237. package/esm/_internal/Slider2.js.map +0 -1
  238. package/esm/_internal/Slides.js +0 -864
  239. package/esm/_internal/Slides.js.map +0 -1
  240. package/esm/_internal/Switch2.js +0 -116
  241. package/esm/_internal/Switch2.js.map +0 -1
  242. package/esm/_internal/TabPanel.js +0 -280
  243. package/esm/_internal/TabPanel.js.map +0 -1
  244. package/esm/_internal/TableRow.js +0 -291
  245. package/esm/_internal/TableRow.js.map +0 -1
  246. package/esm/_internal/Text2.js +0 -63
  247. package/esm/_internal/Text2.js.map +0 -1
  248. package/esm/_internal/TextField.js +0 -322
  249. package/esm/_internal/TextField.js.map +0 -1
  250. package/esm/_internal/Thumbnail2.js +0 -301
  251. package/esm/_internal/Thumbnail2.js.map +0 -1
  252. package/esm/_internal/Toolbar2.js +0 -60
  253. package/esm/_internal/Toolbar2.js.map +0 -1
  254. package/esm/_internal/Tooltip2.js +0 -282
  255. package/esm/_internal/Tooltip2.js.map +0 -1
  256. package/esm/_internal/Uploader2.js +0 -84
  257. package/esm/_internal/Uploader2.js.map +0 -1
  258. package/esm/_internal/UserBlock.js +0 -132
  259. package/esm/_internal/UserBlock.js.map +0 -1
  260. package/esm/_internal/_rollupPluginBabelHelpers.js.map +0 -1
  261. package/esm/_internal/alert-dialog.js +0 -34
  262. package/esm/_internal/alert-dialog.js.map +0 -1
  263. package/esm/_internal/autocomplete.js +0 -32
  264. package/esm/_internal/autocomplete.js.map +0 -1
  265. package/esm/_internal/avatar.js +0 -13
  266. package/esm/_internal/avatar.js.map +0 -1
  267. package/esm/_internal/badge.js +0 -10
  268. package/esm/_internal/badge.js.map +0 -1
  269. package/esm/_internal/button.js +0 -25
  270. package/esm/_internal/button.js.map +0 -1
  271. package/esm/_internal/checkbox.js +0 -14
  272. package/esm/_internal/checkbox.js.map +0 -1
  273. package/esm/_internal/chip.js +0 -12
  274. package/esm/_internal/chip.js.map +0 -1
  275. package/esm/_internal/comment-block.js +0 -24
  276. package/esm/_internal/comment-block.js.map +0 -1
  277. package/esm/_internal/components.js +0 -156
  278. package/esm/_internal/components.js.map +0 -1
  279. package/esm/_internal/constants.js +0 -13
  280. package/esm/_internal/constants.js.map +0 -1
  281. package/esm/_internal/date-picker.js +0 -32
  282. package/esm/_internal/date-picker.js.map +0 -1
  283. package/esm/_internal/dialog.js +0 -27
  284. package/esm/_internal/dialog.js.map +0 -1
  285. package/esm/_internal/divider.js +0 -10
  286. package/esm/_internal/divider.js.map +0 -1
  287. package/esm/_internal/drag-handle.js +0 -11
  288. package/esm/_internal/drag-handle.js.map +0 -1
  289. package/esm/_internal/dropdown.js +0 -21
  290. package/esm/_internal/dropdown.js.map +0 -1
  291. package/esm/_internal/expansion-panel.js +0 -32
  292. package/esm/_internal/expansion-panel.js.map +0 -1
  293. package/esm/_internal/flag.js +0 -11
  294. package/esm/_internal/flag.js.map +0 -1
  295. package/esm/_internal/flex-box.js +0 -11
  296. package/esm/_internal/flex-box.js.map +0 -1
  297. package/esm/_internal/generic-block.js +0 -20
  298. package/esm/_internal/generic-block.js.map +0 -1
  299. package/esm/_internal/getRootClassName.js +0 -346
  300. package/esm/_internal/getRootClassName.js.map +0 -1
  301. package/esm/_internal/grid.js +0 -10
  302. package/esm/_internal/grid.js.map +0 -1
  303. package/esm/_internal/heading.js +0 -11
  304. package/esm/_internal/heading.js.map +0 -1
  305. package/esm/_internal/icon.js +0 -10
  306. package/esm/_internal/icon.js.map +0 -1
  307. package/esm/_internal/image-block.js +0 -14
  308. package/esm/_internal/image-block.js.map +0 -1
  309. package/esm/_internal/input-helper.js +0 -10
  310. package/esm/_internal/input-helper.js.map +0 -1
  311. package/esm/_internal/input-label.js +0 -10
  312. package/esm/_internal/input-label.js.map +0 -1
  313. package/esm/_internal/lightbox.js +0 -27
  314. package/esm/_internal/lightbox.js.map +0 -1
  315. package/esm/_internal/link-preview.js +0 -15
  316. package/esm/_internal/link-preview.js.map +0 -1
  317. package/esm/_internal/link.js +0 -12
  318. package/esm/_internal/link.js.map +0 -1
  319. package/esm/_internal/list.js +0 -15
  320. package/esm/_internal/list.js.map +0 -1
  321. package/esm/_internal/mergeRefs.js +0 -25
  322. package/esm/_internal/mergeRefs.js.map +0 -1
  323. package/esm/_internal/message.js +0 -11
  324. package/esm/_internal/message.js.map +0 -1
  325. package/esm/_internal/mosaic.js +0 -14
  326. package/esm/_internal/mosaic.js.map +0 -1
  327. package/esm/_internal/notification.js +0 -18
  328. package/esm/_internal/notification.js.map +0 -1
  329. package/esm/_internal/partitionMulti.js +0 -27
  330. package/esm/_internal/partitionMulti.js.map +0 -1
  331. package/esm/_internal/popover.js +0 -15
  332. package/esm/_internal/popover.js.map +0 -1
  333. package/esm/_internal/post-block.js +0 -15
  334. package/esm/_internal/post-block.js.map +0 -1
  335. package/esm/_internal/progress-tracker.js +0 -17
  336. package/esm/_internal/progress-tracker.js.map +0 -1
  337. package/esm/_internal/progress.js +0 -10
  338. package/esm/_internal/progress.js.map +0 -1
  339. package/esm/_internal/radio-button.js +0 -13
  340. package/esm/_internal/radio-button.js.map +0 -1
  341. package/esm/_internal/renderLink.js +0 -25
  342. package/esm/_internal/renderLink.js.map +0 -1
  343. package/esm/_internal/select.js +0 -31
  344. package/esm/_internal/select.js.map +0 -1
  345. package/esm/_internal/side-navigation.js +0 -25
  346. package/esm/_internal/side-navigation.js.map +0 -1
  347. package/esm/_internal/skeleton.js +0 -10
  348. package/esm/_internal/skeleton.js.map +0 -1
  349. package/esm/_internal/slider.js +0 -13
  350. package/esm/_internal/slider.js.map +0 -1
  351. package/esm/_internal/slideshow.js +0 -29
  352. package/esm/_internal/slideshow.js.map +0 -1
  353. package/esm/_internal/state.js +0 -145
  354. package/esm/_internal/state.js.map +0 -1
  355. package/esm/_internal/switch.js +0 -13
  356. package/esm/_internal/switch.js.map +0 -1
  357. package/esm/_internal/table.js +0 -12
  358. package/esm/_internal/table.js.map +0 -1
  359. package/esm/_internal/tabs.js +0 -15
  360. package/esm/_internal/tabs.js.map +0 -1
  361. package/esm/_internal/text-field.js +0 -26
  362. package/esm/_internal/text-field.js.map +0 -1
  363. package/esm/_internal/text.js +0 -10
  364. package/esm/_internal/text.js.map +0 -1
  365. package/esm/_internal/thumbnail.js +0 -13
  366. package/esm/_internal/thumbnail.js.map +0 -1
  367. package/esm/_internal/toolbar.js +0 -9
  368. package/esm/_internal/toolbar.js.map +0 -1
  369. package/esm/_internal/tooltip.js +0 -18
  370. package/esm/_internal/tooltip.js.map +0 -1
  371. package/esm/_internal/type.js +0 -40
  372. package/esm/_internal/type.js.map +0 -1
  373. package/esm/_internal/types.js +0 -23
  374. package/esm/_internal/types.js.map +0 -1
  375. package/esm/_internal/uploader.js +0 -11
  376. package/esm/_internal/uploader.js.map +0 -1
  377. package/esm/_internal/useDelayedVisibility.js +0 -47
  378. package/esm/_internal/useDelayedVisibility.js.map +0 -1
  379. package/esm/_internal/useDisableBodyScroll.js +0 -220
  380. package/esm/_internal/useDisableBodyScroll.js.map +0 -1
  381. package/esm/_internal/useFocusTrap.js +0 -86
  382. package/esm/_internal/useFocusTrap.js.map +0 -1
  383. package/esm/_internal/useRovingTabIndex.js +0 -87
  384. package/esm/_internal/useRovingTabIndex.js.map +0 -1
  385. package/esm/_internal/user-block.js +0 -17
  386. package/esm/_internal/user-block.js.map +0 -1
  387. package/esm/index.js +0 -95
  388. package/esm/index.js.map +0 -1
  389. package/esm/index2.js +0 -16
  390. package/esm/index2.js.map +0 -1
  391. package/src/utils/index.tsx +0 -7
@@ -1,55 +0,0 @@
1
- import { b as _objectWithoutProperties, c as _extends } from './_rollupPluginBabelHelpers.js';
2
- import { Orientation } from './components.js';
3
- import React, { forwardRef } from 'react';
4
- import { g as getRootClassName, c as classnames, h as handleBasicClasses } from './getRootClassName.js';
5
- import castArray from 'lodash/castArray';
6
-
7
- /**
8
- * Component display name.
9
- */
10
- var COMPONENT_NAME = 'FlexBox';
11
- /**
12
- * Component default class name and class prefix.
13
- */
14
-
15
- var CLASSNAME = getRootClassName(COMPONENT_NAME);
16
- /**
17
- * FlexBox component.
18
- *
19
- * @param props Component props.
20
- * @param ref Component ref.
21
- * @return React element.
22
- */
23
-
24
- var FlexBox = forwardRef(function (props, ref) {
25
- var children = props.children,
26
- className = props.className,
27
- fillSpace = props.fillSpace,
28
- gap = props.gap,
29
- hAlign = props.hAlign,
30
- marginAuto = props.marginAuto,
31
- noShrink = props.noShrink,
32
- orientation = props.orientation,
33
- vAlign = props.vAlign,
34
- wrap = props.wrap,
35
- forwardedProps = _objectWithoutProperties(props, ["children", "className", "fillSpace", "gap", "hAlign", "marginAuto", "noShrink", "orientation", "vAlign", "wrap"]);
36
-
37
- return React.createElement("div", _extends({
38
- ref: ref
39
- }, forwardedProps, {
40
- className: classnames(className, handleBasicClasses({
41
- prefix: CLASSNAME,
42
- orientation: orientation !== null && orientation !== void 0 ? orientation : wrap || hAlign || vAlign ? Orientation.horizontal : null,
43
- vAlign: vAlign,
44
- hAlign: hAlign,
45
- gap: gap
46
- }), wrap && "".concat(CLASSNAME, "--wrap"), fillSpace && "".concat(CLASSNAME, "--fill-space"), noShrink && "".concat(CLASSNAME, "--no-shrink"), marginAuto && castArray(marginAuto).map(function (align) {
47
- return "".concat(CLASSNAME, "--margin-auto-").concat(align);
48
- }))
49
- }), children);
50
- });
51
- FlexBox.displayName = COMPONENT_NAME;
52
- FlexBox.className = CLASSNAME;
53
-
54
- export { FlexBox as F };
55
- //# sourceMappingURL=FlexBox.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FlexBox.js","sources":["../../../src/components/flex-box/FlexBox.tsx"],"sourcesContent":["import { Alignment, Orientation } from '@lumx/react';\nimport { Comp, GenericProps, getRootClassName, handleBasicClasses } from '@lumx/react/utils';\nimport classNames from 'classnames';\nimport castArray from 'lodash/castArray';\nimport React, { forwardRef, ReactNode } from 'react';\nimport { HorizontalAlignment, Size, VerticalAlignment } from '..';\n\nexport type MarginAutoAlignment = Extract<Alignment, 'top' | 'bottom' | 'right' | 'left'>;\nexport type GapSize = Extract<Size, 'tiny' | 'regular' | 'medium' | 'big' | 'huge'>;\ntype SpaceAlignment = Extract<Alignment, 'space-between' | 'space-evenly' | 'space-around'>;\nexport type FlexVerticalAlignment = VerticalAlignment | SpaceAlignment;\nexport type FlexHorizontalAlignment = HorizontalAlignment | SpaceAlignment;\n\n/**\n * Defines the props of the component.\n */\nexport interface FlexBoxProps extends GenericProps {\n /** Children elements. */\n children?: ReactNode;\n /** Whether the \"content filling space\" is enabled or not. */\n fillSpace?: boolean;\n /** Gap space between flexbox items. */\n gap?: GapSize;\n /** Flex horizontal alignment. */\n hAlign?: FlexVerticalAlignment;\n /** Whether the \"auto margin\" is enabled all around or not. */\n marginAuto?: MarginAutoAlignment | MarginAutoAlignment[];\n /** Whether the \"content shrink\" is disabled or not. */\n noShrink?: boolean;\n /** Flex direction. */\n orientation?: Orientation;\n /** Flex vertical alignment. */\n vAlign?: FlexHorizontalAlignment;\n /** Whether the \"flex wrap\" is enabled or not. */\n wrap?: boolean;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'FlexBox';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * FlexBox component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const FlexBox: Comp<FlexBoxProps, HTMLDivElement> = forwardRef((props, ref) => {\n const {\n children,\n className,\n fillSpace,\n gap,\n hAlign,\n marginAuto,\n noShrink,\n orientation,\n vAlign,\n wrap,\n ...forwardedProps\n } = props;\n\n return (\n <div\n ref={ref}\n {...forwardedProps}\n className={classNames(\n className,\n handleBasicClasses({\n prefix: CLASSNAME,\n orientation: orientation ?? (wrap || hAlign || vAlign ? Orientation.horizontal : null),\n vAlign,\n hAlign,\n gap,\n }),\n wrap && `${CLASSNAME}--wrap`,\n fillSpace && `${CLASSNAME}--fill-space`,\n noShrink && `${CLASSNAME}--no-shrink`,\n marginAuto && castArray(marginAuto).map((align) => `${CLASSNAME}--margin-auto-${align}`),\n )}\n >\n {children}\n </div>\n );\n});\nFlexBox.displayName = COMPONENT_NAME;\nFlexBox.className = CLASSNAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","getRootClassName","FlexBox","forwardRef","props","ref","children","className","fillSpace","gap","hAlign","marginAuto","noShrink","orientation","vAlign","wrap","forwardedProps","classNames","handleBasicClasses","prefix","Orientation","horizontal","castArray","map","align","displayName"],"mappings":";;;;;;AAqCA;;;AAGA,IAAMA,cAAc,GAAG,SAAvB;AAEA;;;;AAGA,IAAMC,SAAS,GAAGC,gBAAgB,CAACF,cAAD,CAAlC;AAEA;;;;;;;;IAOaG,OAA2C,GAAGC,UAAU,CAAC,UAACC,KAAD,EAAQC,GAAR,EAAgB;AAAA,MAE9EC,QAF8E,GAa9EF,KAb8E,CAE9EE,QAF8E;AAAA,MAG9EC,SAH8E,GAa9EH,KAb8E,CAG9EG,SAH8E;AAAA,MAI9EC,SAJ8E,GAa9EJ,KAb8E,CAI9EI,SAJ8E;AAAA,MAK9EC,GAL8E,GAa9EL,KAb8E,CAK9EK,GAL8E;AAAA,MAM9EC,MAN8E,GAa9EN,KAb8E,CAM9EM,MAN8E;AAAA,MAO9EC,UAP8E,GAa9EP,KAb8E,CAO9EO,UAP8E;AAAA,MAQ9EC,QAR8E,GAa9ER,KAb8E,CAQ9EQ,QAR8E;AAAA,MAS9EC,WAT8E,GAa9ET,KAb8E,CAS9ES,WAT8E;AAAA,MAU9EC,MAV8E,GAa9EV,KAb8E,CAU9EU,MAV8E;AAAA,MAW9EC,IAX8E,GAa9EX,KAb8E,CAW9EW,IAX8E;AAAA,MAY3EC,cAZ2E,4BAa9EZ,KAb8E;;AAelF,SACI;AACI,IAAA,GAAG,EAAEC;AADT,KAEQW,cAFR;AAGI,IAAA,SAAS,EAAEC,UAAU,CACjBV,SADiB,EAEjBW,kBAAkB,CAAC;AACfC,MAAAA,MAAM,EAAEnB,SADO;AAEfa,MAAAA,WAAW,EAAEA,WAAF,aAAEA,WAAF,cAAEA,WAAF,GAAkBE,IAAI,IAAIL,MAAR,IAAkBI,MAAlB,GAA2BM,WAAW,CAACC,UAAvC,GAAoD,IAFlE;AAGfP,MAAAA,MAAM,EAANA,MAHe;AAIfJ,MAAAA,MAAM,EAANA,MAJe;AAKfD,MAAAA,GAAG,EAAHA;AALe,KAAD,CAFD,EASjBM,IAAI,cAAOf,SAAP,WATa,EAUjBQ,SAAS,cAAOR,SAAP,iBAVQ,EAWjBY,QAAQ,cAAOZ,SAAP,gBAXS,EAYjBW,UAAU,IAAIW,SAAS,CAACX,UAAD,CAAT,CAAsBY,GAAtB,CAA0B,UAACC,KAAD;AAAA,uBAAcxB,SAAd,2BAAwCwB,KAAxC;AAAA,KAA1B,CAZG;AAHzB,MAkBKlB,QAlBL,CADJ;AAsBH,CArCoE;AAsCrEJ,OAAO,CAACuB,WAAR,GAAsB1B,cAAtB;AACAG,OAAO,CAACK,SAAR,GAAoBP,SAApB;;;;"}
@@ -1,125 +0,0 @@
1
- import { b as _objectWithoutProperties, f as _toArray, d as _slicedToArray, c as _extends } from './_rollupPluginBabelHelpers.js';
2
- import { Orientation, Size } from './components.js';
3
- import React, { forwardRef, Children } from 'react';
4
- import { g as getRootClassName, c as classnames } from './getRootClassName.js';
5
- import 'lodash/isBoolean';
6
- import isEmpty from 'lodash/isEmpty';
7
- import 'lodash/kebabCase';
8
- import noop from 'lodash/noop';
9
- import { p as partitionMulti } from './partitionMulti.js';
10
- import { a as isComponentType } from './type.js';
11
- import { F as FlexBox } from './FlexBox.js';
12
-
13
- /**
14
- * Component display name.
15
- */
16
- var COMPONENT_NAME = 'GenericBlock';
17
- /**
18
- * Component default class name and class prefix.
19
- */
20
-
21
- var CLASSNAME = getRootClassName(COMPONENT_NAME);
22
- /**
23
- * Component default props.
24
- */
25
-
26
- var DEFAULT_PROPS = {
27
- gap: Size.big,
28
- orientation: Orientation.horizontal
29
- };
30
- var Figure = noop.bind({});
31
- var isFigure = isComponentType(Figure);
32
- var Content = noop.bind({});
33
- var isContent = isComponentType(Content);
34
- var Actions = noop.bind({});
35
- var isActions = isComponentType(Actions);
36
- /**
37
- * The GenericBlock is a layout component made of 3 sections that can be
38
- * displayed either horizontally of vertically with the same gap between each section.
39
- *
40
- * The sections are:
41
- * - `Figure` => A visual element to display before the main content.
42
- * - `Content` => The main content displayed
43
- * - `Actions` => One or more actions to set after the element.
44
- *
45
- * @see https://www.figma.com/file/lzzrQmsfaXRaOyRfoEogPZ/DS%3A-playground?node-id=1%3A4076
46
- */
47
-
48
- var BaseGenericBlock = forwardRef(function (props, ref) {
49
- var _sections$figureChild, _ref4, _sections$figureChild2, _sections$figureChild3, _sections$contentChil, _ref5, _sections$contentChil2, _sections$contentChil3, _sections$actionsChil, _ref6, _sections$actionsChil2, _sections$actionsChil3;
50
-
51
- var className = props.className,
52
- figure = props.figure,
53
- figureProps = props.figureProps,
54
- children = props.children,
55
- actions = props.actions,
56
- actionsProps = props.actionsProps,
57
- gap = props.gap,
58
- orientation = props.orientation,
59
- contentProps = props.contentProps,
60
- forwardedProps = _objectWithoutProperties(props, ["className", "figure", "figureProps", "children", "actions", "actionsProps", "gap", "orientation", "contentProps"]);
61
-
62
- var sections = React.useMemo(function () {
63
- var _ref, _ref2, _ref3;
64
-
65
- // Split children by section type
66
- var _partitionMulti = partitionMulti(Children.toArray(children), [isFigure, isContent, isActions]),
67
- _partitionMulti2 = _toArray(_partitionMulti),
68
- _partitionMulti2$ = _slicedToArray(_partitionMulti2[0], 1),
69
- figureChild = _partitionMulti2$[0],
70
- _partitionMulti2$2 = _slicedToArray(_partitionMulti2[1], 1),
71
- contentChild = _partitionMulti2$2[0],
72
- _partitionMulti2$3 = _slicedToArray(_partitionMulti2[2], 1),
73
- actionsChild = _partitionMulti2$3[0],
74
- otherChildren = _partitionMulti2.slice(3);
75
-
76
- return {
77
- figureChild: figureChild,
78
- figureChildProps: (_ref = figureChild) === null || _ref === void 0 ? void 0 : _ref.props,
79
- contentChild: contentChild,
80
- contentChildProps: (_ref2 = contentChild) === null || _ref2 === void 0 ? void 0 : _ref2.props,
81
- actionsChild: actionsChild,
82
- actionsChildProps: (_ref3 = actionsChild) === null || _ref3 === void 0 ? void 0 : _ref3.props,
83
- otherChildren: otherChildren.filter(function (child) {
84
- return !isEmpty(child);
85
- })
86
- };
87
- }, [children]);
88
- return React.createElement(FlexBox, _extends({
89
- ref: ref,
90
- className: classnames(className, CLASSNAME),
91
- gap: gap,
92
- orientation: orientation
93
- }, forwardedProps), (figure || ((_sections$figureChild = sections.figureChildProps) === null || _sections$figureChild === void 0 ? void 0 : _sections$figureChild.children)) && React.createElement(FlexBox, _extends({
94
- ref: (_ref4 = sections.figureChild) === null || _ref4 === void 0 ? void 0 : _ref4.ref,
95
- vAlign: forwardedProps.vAlign,
96
- hAlign: forwardedProps.hAlign
97
- }, figureProps, sections.figureChildProps, {
98
- className: classnames(figureProps === null || figureProps === void 0 ? void 0 : figureProps.className, (_sections$figureChild2 = sections.figureChildProps) === null || _sections$figureChild2 === void 0 ? void 0 : _sections$figureChild2.className, "".concat(CLASSNAME, "__figure"))
99
- }), figure, (_sections$figureChild3 = sections.figureChildProps) === null || _sections$figureChild3 === void 0 ? void 0 : _sections$figureChild3.children), (((_sections$contentChil = sections.contentChildProps) === null || _sections$contentChil === void 0 ? void 0 : _sections$contentChil.children) || sections.otherChildren.length > 0) && React.createElement(FlexBox, _extends({
100
- ref: (_ref5 = sections.contentChild) === null || _ref5 === void 0 ? void 0 : _ref5.ref,
101
- orientation: Orientation.vertical,
102
- fillSpace: true,
103
- vAlign: forwardedProps.vAlign,
104
- hAlign: forwardedProps.hAlign
105
- }, contentProps, sections.contentChildProps, {
106
- className: classnames(contentProps === null || contentProps === void 0 ? void 0 : contentProps.className, (_sections$contentChil2 = sections.contentChildProps) === null || _sections$contentChil2 === void 0 ? void 0 : _sections$contentChil2.className, "".concat(CLASSNAME, "__content"))
107
- }), (_sections$contentChil3 = sections.contentChildProps) === null || _sections$contentChil3 === void 0 ? void 0 : _sections$contentChil3.children, sections.otherChildren), (actions || ((_sections$actionsChil = sections.actionsChildProps) === null || _sections$actionsChil === void 0 ? void 0 : _sections$actionsChil.children)) && React.createElement(FlexBox, _extends({
108
- ref: (_ref6 = sections.actionsChild) === null || _ref6 === void 0 ? void 0 : _ref6.ref,
109
- vAlign: forwardedProps.vAlign,
110
- hAlign: forwardedProps.hAlign
111
- }, actionsProps, sections.actionsChildProps, {
112
- className: classnames(actionsProps === null || actionsProps === void 0 ? void 0 : actionsProps.className, (_sections$actionsChil2 = sections.actionsChildProps) === null || _sections$actionsChil2 === void 0 ? void 0 : _sections$actionsChil2.className, "".concat(CLASSNAME, "__actions"))
113
- }), actions, (_sections$actionsChil3 = sections.actionsChildProps) === null || _sections$actionsChil3 === void 0 ? void 0 : _sections$actionsChil3.children));
114
- });
115
- BaseGenericBlock.displayName = COMPONENT_NAME;
116
- BaseGenericBlock.className = CLASSNAME;
117
- BaseGenericBlock.defaultProps = DEFAULT_PROPS;
118
- var GenericBlock = Object.assign(BaseGenericBlock, {
119
- Figure: Figure,
120
- Content: Content,
121
- Actions: Actions
122
- });
123
-
124
- export { GenericBlock as G };
125
- //# sourceMappingURL=GenericBlock.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GenericBlock.js","sources":["../../../src/components/generic-block/GenericBlock.tsx"],"sourcesContent":["import React, { Children, forwardRef, ReactElement, ReactNode } from 'react';\nimport classNames from 'classnames';\nimport isEmpty from 'lodash/isEmpty';\nimport noop from 'lodash/noop';\nimport { Comp, getRootClassName, isComponentType, partitionMulti } from '@lumx/react/utils';\nimport { Orientation, Size, FlexBox, FlexBoxProps } from '@lumx/react';\n\nexport interface GenericBlockProps extends FlexBoxProps {\n /**\n * Component to use as visual element.\n */\n figure?: ReactNode;\n /**\n * Actions to set after the main content.\n */\n actions?: ReactNode;\n /**\n * Main content to display or sections components\n * ({@see GenericBlock.Figure}, {@see GenericBlock.Content} & {@see GenericBlock.Actions})\n */\n children: ReactNode;\n /**\n * Orientation of the 3 sections\n */\n orientation?: FlexBoxProps['orientation'];\n /**\n * Horizontal alignment.\n */\n hAlign?: FlexBoxProps['hAlign'];\n /**\n * Vertical alignment.\n */\n vAlign?: FlexBoxProps['vAlign'];\n /**\n * The props to forward to the content.\n * By default, the content will have the same alignment as wrapper.\n */\n contentProps?: Omit<FlexBoxProps, 'children'>;\n /**\n * props to forward to the actions element.\n */\n actionsProps?: Omit<FlexBoxProps, 'children'>;\n /**\n * props to forward to the figure element.\n */\n figureProps?: Omit<FlexBoxProps, 'children'>;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'GenericBlock';\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<GenericBlockProps> = {\n gap: Size.big,\n orientation: Orientation.horizontal,\n};\n\ntype BaseGenericBlock = Comp<GenericBlockProps, HTMLDivElement>;\n\ninterface GenericBlock extends BaseGenericBlock {\n /**\n * Use `GenericBlock.Figure` component as children of the `GenericBlock` component as an alternative way to inject\n * the \"figure\" section of the block (instead of using `figure` and `figureProps` props).\n */\n Figure: Comp<FlexBoxProps>;\n /**\n * Use `GenericBlock.Content` component as children of the `GenericBlock` component as an alternative way to inject\n * the \"content\" section of the block (instead of using `content` and `contentProps` props).\n */\n Content: Comp<FlexBoxProps>;\n /**\n * Use `GenericBlock.Actions` component as children of the `GenericBlock` component as an alternative way to inject\n * the \"actions\" section of the block (instead of using `actions` and `actionsProps` props).\n */\n Actions: Comp<FlexBoxProps>;\n}\n\nconst Figure = noop.bind({}) as Comp<FlexBoxProps>;\nconst isFigure = isComponentType(Figure);\n\nconst Content = noop.bind({}) as Comp<FlexBoxProps>;\nconst isContent = isComponentType(Content);\n\nconst Actions = noop.bind({}) as Comp<FlexBoxProps>;\nconst isActions = isComponentType(Actions);\n\n/**\n * The GenericBlock is a layout component made of 3 sections that can be\n * displayed either horizontally of vertically with the same gap between each section.\n *\n * The sections are:\n * - `Figure` => A visual element to display before the main content.\n * - `Content` => The main content displayed\n * - `Actions` => One or more actions to set after the element.\n *\n * @see https://www.figma.com/file/lzzrQmsfaXRaOyRfoEogPZ/DS%3A-playground?node-id=1%3A4076\n */\nconst BaseGenericBlock: BaseGenericBlock = forwardRef((props, ref) => {\n const {\n className,\n figure,\n figureProps,\n children,\n actions,\n actionsProps,\n gap,\n orientation,\n contentProps,\n ...forwardedProps\n } = props;\n\n const sections = React.useMemo(() => {\n // Split children by section type\n const [[figureChild], [contentChild], [actionsChild], ...otherChildren] = partitionMulti(\n Children.toArray(children),\n [isFigure, isContent, isActions],\n );\n return {\n figureChild,\n figureChildProps: (figureChild as ReactElement)?.props,\n contentChild,\n contentChildProps: (contentChild as ReactElement)?.props,\n actionsChild,\n actionsChildProps: (actionsChild as ReactElement)?.props,\n otherChildren: otherChildren.filter((child) => !isEmpty(child)),\n };\n }, [children]);\n\n return (\n <FlexBox\n ref={ref}\n className={classNames(className, CLASSNAME)}\n gap={gap}\n orientation={orientation}\n {...forwardedProps}\n >\n {(figure || sections.figureChildProps?.children) && (\n <FlexBox\n ref={(sections.figureChild as any)?.ref}\n vAlign={forwardedProps.vAlign}\n hAlign={forwardedProps.hAlign}\n {...figureProps}\n {...sections.figureChildProps}\n className={classNames(\n figureProps?.className,\n sections.figureChildProps?.className,\n `${CLASSNAME}__figure`,\n )}\n >\n {figure}\n {sections.figureChildProps?.children}\n </FlexBox>\n )}\n\n {(sections.contentChildProps?.children || sections.otherChildren.length > 0) && (\n <FlexBox\n ref={(sections.contentChild as any)?.ref}\n orientation={Orientation.vertical}\n fillSpace\n vAlign={forwardedProps.vAlign}\n hAlign={forwardedProps.hAlign}\n {...contentProps}\n {...sections.contentChildProps}\n className={classNames(\n contentProps?.className,\n sections.contentChildProps?.className,\n `${CLASSNAME}__content`,\n )}\n >\n {sections.contentChildProps?.children}\n {sections.otherChildren}\n </FlexBox>\n )}\n\n {(actions || sections.actionsChildProps?.children) && (\n <FlexBox\n ref={(sections.actionsChild as any)?.ref}\n vAlign={forwardedProps.vAlign}\n hAlign={forwardedProps.hAlign}\n {...actionsProps}\n {...sections.actionsChildProps}\n className={classNames(\n actionsProps?.className,\n sections.actionsChildProps?.className,\n `${CLASSNAME}__actions`,\n )}\n >\n {actions}\n {sections.actionsChildProps?.children}\n </FlexBox>\n )}\n </FlexBox>\n );\n});\nBaseGenericBlock.displayName = COMPONENT_NAME;\nBaseGenericBlock.className = CLASSNAME;\nBaseGenericBlock.defaultProps = DEFAULT_PROPS;\n\nexport const GenericBlock: GenericBlock = Object.assign(BaseGenericBlock, { Figure, Content, Actions });\n"],"names":["COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","gap","Size","big","orientation","Orientation","horizontal","Figure","noop","bind","isFigure","isComponentType","Content","isContent","Actions","isActions","BaseGenericBlock","forwardRef","props","ref","className","figure","figureProps","children","actions","actionsProps","contentProps","forwardedProps","sections","React","useMemo","partitionMulti","Children","toArray","figureChild","contentChild","actionsChild","otherChildren","figureChildProps","contentChildProps","actionsChildProps","filter","child","isEmpty","classNames","vAlign","hAlign","length","vertical","displayName","defaultProps","GenericBlock","Object","assign"],"mappings":";;;;;;;;;;;;AAgDA;;;AAGA,IAAMA,cAAc,GAAG,cAAvB;AA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U,CACjBnB,YADiB,aACjBA,YADiB,uBACjBA,YAAY,CAAEL,SADG,4BAEjBQ,QAAQ,CAACY,iBAFQ,2DAEjB,uBAA4BpB,SAFX,YAGdtB,SAHc;AANzB,MAYK0B,OAZL,4BAaKI,QAAQ,CAACY,iBAbd,2DAaK,uBAA4BjB,QAbjC,CA9CR,CADJ;AAiEH,CAhGoD,CAArD;AAiGAP,gBAAgB,CAACiC,WAAjB,GAA+BpD,cAA/B;AACAmB,gBAAgB,CAACI,SAAjB,GAA6BtB,SAA7B;AACAkB,gBAAgB,CAACkC,YAAjB,GAAgClD,aAAhC;IAEamD,YAA0B,GAAGC,MAAM,CAACC,MAAP,CAAcrC,gBAAd,EAAgC;AAAET,EAAAA,MAAM,EAANA,MAAF;AAAUK,EAAAA,OAAO,EAAPA,OAAV;AAAmBE,EAAAA,OAAO,EAAPA;AAAnB,CAAhC;;;;"}
@@ -1,96 +0,0 @@
1
- import { b as _objectWithoutProperties, c as _extends, a as _defineProperty } from './_rollupPluginBabelHelpers.js';
2
- import { Orientation } from './components.js';
3
- import React, { forwardRef } from 'react';
4
- import { g as getRootClassName, c as classnames, h as handleBasicClasses } from './getRootClassName.js';
5
-
6
- /**
7
- * Component display name.
8
- */
9
- var COMPONENT_NAME = 'Grid';
10
- /**
11
- * Component default class name and class prefix.
12
- */
13
-
14
- var CLASSNAME = getRootClassName(COMPONENT_NAME);
15
- /**
16
- * Component default props.
17
- */
18
-
19
- var DEFAULT_PROPS = {
20
- orientation: Orientation.horizontal,
21
- wrap: 'nowrap'
22
- };
23
- /**
24
- * Grid component.
25
- *
26
- * @param props Component props.
27
- * @param ref Component ref.
28
- * @return React element.
29
- */
30
-
31
- var Grid = forwardRef(function (props, ref) {
32
- var children = props.children,
33
- className = props.className,
34
- gutter = props.gutter,
35
- hAlign = props.hAlign,
36
- orientation = props.orientation,
37
- vAlign = props.vAlign,
38
- wrap = props.wrap,
39
- forwardedProps = _objectWithoutProperties(props, ["children", "className", "gutter", "hAlign", "orientation", "vAlign", "wrap"]);
40
-
41
- return React.createElement("div", _extends({
42
- ref: ref
43
- }, forwardedProps, {
44
- className: classnames(className, "".concat(CLASSNAME, "-container"), _defineProperty({}, "".concat(CLASSNAME, "--h-align-").concat(hAlign), hAlign), _defineProperty({}, "".concat(CLASSNAME, "--v-align-").concat(vAlign), vAlign), handleBasicClasses({
45
- prefix: CLASSNAME,
46
- orientation: orientation,
47
- wrap: wrap,
48
- gutter: gutter
49
- }))
50
- }), children);
51
- });
52
- Grid.displayName = COMPONENT_NAME;
53
- Grid.className = CLASSNAME;
54
- Grid.defaultProps = DEFAULT_PROPS;
55
-
56
- /**
57
- * Component display name.
58
- */
59
- var COMPONENT_NAME$1 = 'GridItem';
60
- /**
61
- * Component default class name and class prefix.
62
- */
63
-
64
- var CLASSNAME$1 = getRootClassName(COMPONENT_NAME$1);
65
- /**
66
- * GridItem component.
67
- *
68
- * @param props Component props.
69
- * @param ref Component ref.
70
- * @return React element.
71
- */
72
-
73
- var GridItem = forwardRef(function (props, ref) {
74
- var children = props.children,
75
- className = props.className,
76
- width = props.width,
77
- align = props.align,
78
- order = props.order,
79
- forwardedProps = _objectWithoutProperties(props, ["children", "className", "width", "align", "order"]);
80
-
81
- return React.createElement("div", _extends({
82
- ref: ref
83
- }, forwardedProps, {
84
- className: classnames(className, handleBasicClasses({
85
- prefix: CLASSNAME$1,
86
- width: width,
87
- order: order,
88
- align: align
89
- }))
90
- }), children);
91
- });
92
- GridItem.displayName = COMPONENT_NAME$1;
93
- GridItem.className = CLASSNAME$1;
94
-
95
- export { Grid as G, GridItem as a };
96
- //# sourceMappingURL=GridItem.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GridItem.js","sources":["../../../src/components/grid/Grid.tsx","../../../src/components/grid/GridItem.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { Alignment, Orientation, Size } from '@lumx/react';\nimport { Comp, GenericProps, getRootClassName, handleBasicClasses } from '@lumx/react/utils';\n\ntype GridGutterSize = Extract<Size, 'regular' | 'big' | 'huge'>;\n\n/**\n * Defines the props of the component.\n */\nexport interface GridProps extends GenericProps {\n /** Orientation. */\n orientation?: Orientation;\n /** Whether the children are wrapped or not. */\n wrap?: string;\n /** Vertical alignment. */\n vAlign?: Alignment;\n /** Horizontal alignment. */\n hAlign?: Alignment;\n /** Gutter size. */\n gutter?: GridGutterSize;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'Grid';\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<GridProps> = {\n orientation: Orientation.horizontal,\n wrap: 'nowrap',\n};\n\n/**\n * Grid component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const Grid: Comp<GridProps, HTMLDivElement> = forwardRef((props, ref) => {\n const { children, className, gutter, hAlign, orientation, vAlign, wrap, ...forwardedProps } = props;\n\n return (\n <div\n ref={ref}\n {...forwardedProps}\n className={classNames(\n className,\n `${CLASSNAME}-container`,\n { [`${CLASSNAME}--h-align-${hAlign}`]: hAlign },\n { [`${CLASSNAME}--v-align-${vAlign}`]: vAlign },\n handleBasicClasses({ prefix: CLASSNAME, orientation, wrap, gutter }),\n )}\n >\n {children}\n </div>\n );\n});\nGrid.displayName = COMPONENT_NAME;\nGrid.className = CLASSNAME;\nGrid.defaultProps = DEFAULT_PROPS;\n","import React, { forwardRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { Alignment } from '@lumx/react';\nimport { Comp, GenericProps, getRootClassName, handleBasicClasses } from '@lumx/react/utils';\n\ntype Columns = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12';\n\n/**\n * Defines the props of the component.\n */\nexport interface GridItemProps extends GenericProps {\n /** Alignment. */\n align?: Alignment;\n /** Order. */\n order?: Columns;\n /** Width. */\n width?: Columns;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'GridItem';\n\n/**\n * Component default class name and class prefix.\n */\nconst CLASSNAME = getRootClassName(COMPONENT_NAME);\n\n/**\n * GridItem component.\n *\n * @param props Component props.\n * @param ref Component ref.\n * @return React element.\n */\nexport const GridItem: Comp<GridItemProps, HTMLDivElement> = forwardRef((props, ref) => {\n const { children, className, width, align, order, ...forwardedProps } = props;\n\n return (\n <div\n ref={ref}\n {...forwardedProps}\n className={classNames(className, handleBasicClasses({ prefix: CLASSNAME, width, order, align }))}\n >\n {children}\n </div>\n );\n});\nGridItem.displayName = COMPONENT_NAME;\nGridItem.className = CLASSNAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","orientation","Orientation","horizontal","wrap","Grid","forwardRef","props","ref","children","className","gutter","hAlign","vAlign","forwardedProps","classNames","handleBasicClasses","prefix","displayName","defaultProps","GridItem","width","align","order"],"mappings":";;;;;AAyBA;;;AAGA,IAAMA,cAAc,GAAG,MAAvB;AAEA;;;;AAGA,IAAMC,SAAS,GAAGC,gBAAgB,CAACF,cAAD,CAAlC;AAEA;;;;AAGA,IAAMG,aAAiC,GAAG;AACtCC,EAAAA,WAAW,EAAEC,WAAW,CAACC,UADa;AAEtCC,EAAAA,IAAI,EAAE;AAFgC,CAA1C;AAKA;;;;;;;;IAOaC,IAAqC,GAAGC,UAAU,CAAC,UAACC,KAAD,EAAQC,GAAR,EAAgB;AAAA,MACpEC,QADoE,GACkBF,KADlB,CACpEE,QADoE;AAAA,MAC1DC,SAD0D,GACkBH,KADlB,CAC1DG,SAD0D;AAAA,MAC/CC,MAD+C,GACkBJ,KADlB,CAC/CI,MAD+C;AAAA,MACvCC,MADuC,GACkBL,KADlB,CACvCK,MADuC;AAAA,MAC/BX,WAD+B,GACkBM,KADlB,CAC/BN,WAD+B;AAAA,MAClBY,MADkB,GACkBN,KADlB,CAClBM,MADkB;AAAA,MACVT,IADU,GACkBG,KADlB,CACVH,IADU;AAAA,MACDU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AA5B;AAAmCD,MAAAA,KAAK,EAALA;AAAnC,KAAD,CAA9B;AAHzB,MAKKb,QALL,CADJ;AASH,CAZsE;AAavEW,QAAQ,CAACF,WAAT,GAAuBrB,gBAAvB;AACAuB,QAAQ,CAACV,SAAT,GAAqBZ,WAArB;;;;"}
@@ -1,112 +0,0 @@
1
- import { b as _objectWithoutProperties, c as _extends } from './_rollupPluginBabelHelpers.js';
2
- import { Typography } from './components.js';
3
- import React, { createContext, forwardRef } from 'react';
4
- import { g as getRootClassName, c as classnames, h as handleBasicClasses } from './getRootClassName.js';
5
- import { T as Text } from './Text2.js';
6
-
7
- /** The maximum authorized heading level. */
8
-
9
- var MAX_HEADING_LEVEL = 6;
10
- /**
11
- * Typography to use by default depending on the heading level.
12
- */
13
-
14
- var DEFAULT_TYPOGRAPHY_BY_LEVEL = {
15
- h1: Typography.display1,
16
- h2: Typography.headline,
17
- h3: Typography.title,
18
- h4: Typography.subtitle2,
19
- h5: Typography.subtitle1,
20
- h6: Typography.body2
21
- };
22
-
23
- var defaultContext = {
24
- level: 1,
25
- headingElement: 'h1'
26
- };
27
- var HeadingLevelContext = createContext(defaultContext);
28
-
29
- var useHeadingLevel = function useHeadingLevel() {
30
- var _React$useContext = React.useContext(HeadingLevelContext),
31
- _React$useContext$lev = _React$useContext.level,
32
- level = _React$useContext$lev === void 0 ? 1 : _React$useContext$lev,
33
- _React$useContext$hea = _React$useContext.headingElement,
34
- headingElement = _React$useContext$hea === void 0 ? 'h1' : _React$useContext$hea;
35
-
36
- return {
37
- level: level,
38
- headingElement: headingElement
39
- };
40
- };
41
-
42
- /**
43
- * Defines the props of the component.
44
- */
45
-
46
- /**
47
- * Component display name.
48
- */
49
- var COMPONENT_NAME = 'Heading';
50
- /**
51
- * Component default class name and class prefix.
52
- */
53
-
54
- var CLASSNAME = getRootClassName(COMPONENT_NAME);
55
- /**
56
- * Component default props.
57
- */
58
-
59
- var DEFAULT_PROPS = {};
60
- /**
61
- * Renders a heading component.
62
- * Extends the `Text` Component with the heading level automatically computed based on
63
- * the current level provided by the context.
64
- */
65
-
66
- var Heading = forwardRef(function (props, ref) {
67
- var children = props.children,
68
- as = props.as,
69
- className = props.className,
70
- forwardedProps = _objectWithoutProperties(props, ["children", "as", "className"]);
71
-
72
- var _useHeadingLevel = useHeadingLevel(),
73
- headingElement = _useHeadingLevel.headingElement;
74
-
75
- return React.createElement(Text, _extends({
76
- ref: ref,
77
- className: classnames(className, handleBasicClasses({
78
- prefix: CLASSNAME
79
- })),
80
- as: as || headingElement,
81
- typography: DEFAULT_TYPOGRAPHY_BY_LEVEL[headingElement]
82
- }, forwardedProps), children);
83
- });
84
- Heading.displayName = COMPONENT_NAME;
85
- Heading.className = CLASSNAME;
86
- Heading.defaultProps = DEFAULT_PROPS;
87
-
88
- /**
89
- * Provide a new heading level context.
90
- */
91
- var HeadingLevelProvider = function HeadingLevelProvider(_ref) {
92
- var children = _ref.children,
93
- level = _ref.level;
94
-
95
- var _useHeadingLevel = useHeadingLevel(),
96
- contextLevel = _useHeadingLevel.level;
97
-
98
- var incrementedLevel = level || contextLevel + 1;
99
- /** Don't allow a level beyond the maximum level. */
100
-
101
- var nextLevel = incrementedLevel > MAX_HEADING_LEVEL ? MAX_HEADING_LEVEL : incrementedLevel;
102
- var headingElement = "h".concat(nextLevel);
103
- return React.createElement(HeadingLevelContext.Provider, {
104
- value: {
105
- level: nextLevel,
106
- headingElement: headingElement
107
- }
108
- }, children);
109
- };
110
-
111
- export { Heading as H, HeadingLevelProvider as a, useHeadingLevel as u };
112
- //# sourceMappingURL=HeadingLevelProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HeadingLevelProvider.js","sources":["../../../src/components/heading/constants.ts","../../../src/components/heading/context.tsx","../../../src/components/heading/useHeadingLevel.tsx","../../../src/components/heading/Heading.tsx","../../../src/components/heading/HeadingLevelProvider.tsx"],"sourcesContent":["import { Typography } from '..';\n\n/** The maximum authorized heading level. */\nexport const MAX_HEADING_LEVEL = 6;\n\n/**\n * Typography to use by default depending on the heading level.\n */\nexport const DEFAULT_TYPOGRAPHY_BY_LEVEL = {\n h1: Typography.display1,\n h2: Typography.headline,\n h3: Typography.title,\n h4: Typography.subtitle2,\n h5: Typography.subtitle1,\n h6: Typography.body2,\n};\n","import { HeadingElement } from '@lumx/react/utils';\nimport { createContext } from 'react';\n\ninterface HeadingLevelContext {\n /** The current level */\n level: number;\n /** The heading element matching the current level */\n headingElement: HeadingElement;\n}\n\nconst defaultContext: HeadingLevelContext = { level: 1, headingElement: 'h1' };\n\nexport const HeadingLevelContext = createContext<HeadingLevelContext>(defaultContext);\n","import React from 'react';\nimport { HeadingLevelContext } from './context';\n\nexport const useHeadingLevel = () => {\n const { level = 1, headingElement = 'h1' } = React.useContext(HeadingLevelContext);\n\n return { level, headingElement };\n};\n","import { Comp, getRootClassName, handleBasicClasses, HeadingElement } from '@lumx/react/utils';\nimport classNames from 'classnames';\nimport React, { forwardRef } from 'react';\nimport { Text, TextProps } from '../text';\nimport { DEFAULT_TYPOGRAPHY_BY_LEVEL } from './constants';\nimport { useHeadingLevel } from './useHeadingLevel';\n\n/**\n * Defines the props of the component.\n */\nexport interface HeadingProps extends Partial<TextProps> {\n /**\n * Display a specific heading level instead of the one provided by parent context provider.\n */\n as?: HeadingElement;\n}\n\n/**\n * Component display name.\n */\nconst COMPONENT_NAME = 'Heading';\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 = {} as const;\n\n/**\n * Renders a heading component.\n * Extends the `Text` Component with the heading level automatically computed based on\n * the current level provided by the context.\n */\nexport const Heading: Comp<HeadingProps> = forwardRef((props, ref) => {\n const { children, as, className, ...forwardedProps } = props;\n const { headingElement } = useHeadingLevel();\n\n return (\n <Text\n ref={ref}\n className={classNames(\n className,\n handleBasicClasses({\n prefix: CLASSNAME,\n }),\n )}\n as={as || headingElement}\n typography={DEFAULT_TYPOGRAPHY_BY_LEVEL[headingElement]}\n {...forwardedProps}\n >\n {children}\n </Text>\n );\n});\n\nHeading.displayName = COMPONENT_NAME;\nHeading.className = CLASSNAME;\nHeading.defaultProps = DEFAULT_PROPS;\n","import { HeadingElement } from '@lumx/react/utils';\nimport React, { ReactNode } from 'react';\nimport { MAX_HEADING_LEVEL } from './constants';\nimport { HeadingLevelContext } from './context';\nimport { useHeadingLevel } from './useHeadingLevel';\n\nexport interface HeadingLevelProviderProps {\n /** The heading level to start at. If left undefined, the parent context will be used, if any. */\n level?: number;\n /** The children to display */\n children: ReactNode;\n}\n\n/**\n * Provide a new heading level context.\n */\nexport const HeadingLevelProvider: React.FC<HeadingLevelProviderProps> = ({ children, level }) => {\n const { level: contextLevel } = useHeadingLevel();\n\n const incrementedLevel = level || contextLevel + 1;\n /** Don't allow a level beyond the maximum level. */\n const nextLevel = incrementedLevel > MAX_HEADING_LEVEL ? MAX_HEADING_LEVEL : incrementedLevel;\n const headingElement = `h${nextLevel}` as HeadingElement;\n\n return (\n <HeadingLevelContext.Provider value={{ level: nextLevel, headingElement }}>\n {children}\n </HeadingLevelContext.Provider>\n );\n};\n"],"names":["MAX_HEADING_LEVEL","DEFAULT_TYPOGRAPHY_BY_LEVEL","h1","Typography","display1","h2","headline","h3","title","h4","subtitle2","h5","subtitle1","h6","body2","defaultContext","level","headingElement","HeadingLevelContext","createContext","useHeadingLevel","React","useContext","COMPONENT_NAME","CLASSNAME","getRootClassName","DEFAULT_PROPS","Heading","forwardRef","props","ref","children","as","className","forwardedProps","classNames","handleBasicClasses","prefix","displayName","defaultProps","HeadingLevelProvider","contextLevel","incrementedLevel","nextLevel"],"mappings":";;;;;;AAEA;;AACO,IAAMA,iBAAiB,GAAG,CAA1B;AAEP;;;;AAGO,IAAMC,2BAA2B,GAAG;AACvCC,EAAAA,EAAE,EAAEC,UAAU,CAACC,QADwB;AAEvCC,EAAAA,EAAE,EAAEF,UAAU,CAACG,QAFwB;AAGvCC,EAAAA,EAAE,EAAEJ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M,EAAEb;AADO,KAAD,CAFD,CAFzB;AAQI,IAAA,EAAE,EAAEQ,EAAE,IAAIf,cARd;AASI,IAAA,UAAU,EAAEhB,2BAA2B,CAACgB,cAAD;AAT3C,KAUQiB,cAVR,GAYKH,QAZL,CADJ;AAgBH,CApBoD;AAsBrDJ,OAAO,CAACW,WAAR,GAAsBf,cAAtB;AACAI,OAAO,CAACM,SAAR,GAAoBT,SAApB;AACAG,OAAO,CAACY,YAAR,GAAuBb,aAAvB;;AChDA;;;IAGac,oBAAyD,GAAG,SAA5DA,oBAA4D,OAAyB;AAAA,MAAtBT,QAAsB,QAAtBA,QAAsB;AAAA,MAAZf,KAAY,QAAZA,KAAY;;AAAA,yBAC9DI,eAAe,EAD+C;AAAA,MAC/EqB,YAD+E,oBACtFzB,KADsF;;AAG9F,MAAM0B,gBAAgB,GAAG1B,KAAK,IAAIyB,YAAY,GAAG,CAAjD;AACA;;AACA,MAAME,SAAS,GAAGD,gBAAgB,GAAG1C,iBAAnB,GAAuCA,iBAAvC,GAA2D0C,gBAA7E;AACA,MAAMzB,cAAc,cAAO0B,SAAP,CAApB;AAEA,SACI,oBAAC,mBAAD,CAAqB,QAArB;AAA8B,IAAA,KAAK,EAAE;AAAE3B,MAAAA,KAAK,EAAE2B,SAAT;AAAoB1B,MAAAA,cAAc,EAAdA;AAApB;AAArC,KACKc,QADL,CADJ;AAKH;;;;"}
@@ -1,120 +0,0 @@
1
- import { b as _objectWithoutProperties, c as _extends } from './_rollupPluginBabelHelpers.js';
2
- import { ColorPalette, Theme, Size } from './components.js';
3
- import React, { forwardRef } from 'react';
4
- import { g as getRootClassName, c as classnames, h as handleBasicClasses } from './getRootClassName.js';
5
-
6
- // Material Design Icons v5.8.55
7
- var mdiAlert = "M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z";
8
- var mdiAlertCircle = "M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z";
9
- var mdiArrowDown = "M11,4H13V16L18.5,10.5L19.92,11.92L12,19.84L4.08,11.92L5.5,10.5L11,16V4Z";
10
- var mdiArrowUp = "M13,20H11V8L5.5,13.5L4.08,12.08L12,4.16L19.92,12.08L18.5,13.5L13,8V20Z";
11
- var mdiCheck = "M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z";
12
- var mdiCheckCircle = "M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z";
13
- var mdiChevronDown = "M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z";
14
- var mdiChevronLeft = "M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z";
15
- var mdiChevronRight = "M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z";
16
- var mdiChevronUp = "M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z";
17
- var mdiClose = "M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z";
18
- var mdiCloseCircle = "M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z";
19
- var mdiDragVertical = "M9,3H11V5H9V3M13,3H15V5H13V3M9,7H11V9H9V7M13,7H15V9H13V7M9,11H11V13H9V11M13,11H15V13H13V11M9,15H11V17H9V15M13,15H15V17H13V15M9,19H11V21H9V19M13,19H15V21H13V19Z";
20
- var mdiImageBroken = "M19,3A2,2 0 0,1 21,5V11H19V13H19L17,13V15H15V17H13V19H11V21H5C3.89,21 3,20.1 3,19V5A2,2 0 0,1 5,3H19M21,15V19A2,2 0 0,1 19,21H19L15,21V19H17V17H19V15H21M19,8.5A0.5,0.5 0 0,0 18.5,8H5.5A0.5,0.5 0 0,0 5,8.5V15.5A0.5,0.5 0 0,0 5.5,16H11V15H13V13H15V11H17V9H19V8.5Z";
21
- var mdiInformation = "M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z";
22
- var mdiMenuDown = "M7,10L12,15L17,10H7Z";
23
- var mdiPauseCircleOutline = "M13,16V8H15V16H13M9,16V8H11V16H9M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z";
24
- var mdiPlayCircleOutline = "M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M10,16.5L16,12L10,7.5V16.5Z";
25
- var mdiRadioboxBlank = "M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z";
26
- var mdiRadioboxMarked = "M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,7A5,5 0 0,0 7,12A5,5 0 0,0 12,17A5,5 0 0,0 17,12A5,5 0 0,0 12,7Z";
27
-
28
- /**
29
- * Component display name.
30
- */
31
- var COMPONENT_NAME = 'Icon';
32
- /**
33
- * Component default class name and class prefix.
34
- */
35
-
36
- var CLASSNAME = getRootClassName(COMPONENT_NAME);
37
- /**
38
- * Component default props.
39
- */
40
-
41
- var DEFAULT_PROPS = {};
42
- /**
43
- * Icon component.
44
- *
45
- * @param props Component props.
46
- * @param ref Component ref.
47
- * @return React element.
48
- */
49
-
50
- var Icon = forwardRef(function (props, ref) {
51
- var className = props.className,
52
- color = props.color,
53
- colorVariant = props.colorVariant,
54
- hasShape = props.hasShape,
55
- icon = props.icon,
56
- size = props.size,
57
- theme = props.theme,
58
- alt = props.alt,
59
- forwardedProps = _objectWithoutProperties(props, ["className", "color", "colorVariant", "hasShape", "icon", "size", "theme", "alt"]); // Color
60
-
61
-
62
- var iconColor = color;
63
-
64
- if (!iconColor && (hasShape || theme)) {
65
- iconColor = theme === Theme.dark ? ColorPalette.light : ColorPalette.dark;
66
- } // Color variant
67
-
68
-
69
- var iconColorVariant = colorVariant;
70
-
71
- if (!iconColorVariant && hasShape && iconColor === ColorPalette.dark) {
72
- iconColorVariant = 'L2';
73
- } // Size
74
-
75
-
76
- var iconSize = size;
77
-
78
- if (size && hasShape) {
79
- if (size === Size.xxs || size === Size.xs) {
80
- iconSize = Size.s;
81
- } else if (size === Size.xxl) {
82
- iconSize = Size.xl;
83
- }
84
- } else if (hasShape) {
85
- iconSize = Size.m;
86
- }
87
-
88
- return React.createElement("i", _extends({
89
- ref: ref
90
- }, forwardedProps, {
91
- className: classnames(className, handleBasicClasses({
92
- color: iconColor,
93
- colorVariant: iconColorVariant,
94
- hasShape: hasShape,
95
- prefix: CLASSNAME,
96
- theme: theme,
97
- size: iconSize
98
- }), !hasShape && "".concat(CLASSNAME, "--no-shape"), !hasShape && iconColor === ColorPalette.yellow && icon === mdiAlertCircle && "".concat(CLASSNAME, "--has-dark-layer"), "".concat(CLASSNAME, "--path"))
99
- }), React.createElement("svg", {
100
- "aria-hidden": alt ? undefined : 'true',
101
- role: alt ? 'img' : undefined,
102
- "aria-label": alt,
103
- height: "1em",
104
- preserveAspectRatio: "xMidYMid meet",
105
- style: {
106
- verticalAlign: '-0.125em'
107
- },
108
- viewBox: "0 0 24 24",
109
- width: "1em"
110
- }, React.createElement("path", {
111
- d: icon,
112
- fill: "currentColor"
113
- })));
114
- });
115
- Icon.displayName = COMPONENT_NAME;
116
- Icon.className = CLASSNAME;
117
- Icon.defaultProps = DEFAULT_PROPS;
118
-
119
- export { Icon as I, mdiInformation as a, mdiCheckCircle as b, mdiAlertCircle as c, mdiClose as d, mdiCheck as e, mdiChevronRight as f, mdiChevronLeft as g, mdiDragVertical as h, mdiChevronUp as i, mdiChevronDown as j, mdiRadioboxMarked as k, mdiRadioboxBlank as l, mdiAlert as m, mdiCloseCircle as n, mdiMenuDown as o, mdiPauseCircleOutline as p, mdiPlayCircleOutline as q, mdiArrowUp as r, mdiArrowDown as s, mdiImageBroken as t };
120
- //# sourceMappingURL=Icon2.js.map