@amboss/design-system 1.15.1 → 1.15.2

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 (348) hide show
  1. package/package.json +1 -1
  2. package/build/cjs/build-tokens/_breakpoints.json.js +0 -10
  3. package/build/cjs/build-tokens/_icon_sizes_map.json.js +0 -5
  4. package/build/cjs/build-tokens/_zindex.json.js +0 -10
  5. package/build/cjs/build-tokens/assets/icons.json.js +0 -82
  6. package/build/cjs/build-tokens/assets/icons16.json.js +0 -87
  7. package/build/cjs/build-tokens/assets/logo.json.js +0 -7
  8. package/build/cjs/build-tokens/visualConfig.js +0 -1329
  9. package/build/cjs/scss/themes/dark.scss +0 -111
  10. package/build/cjs/scss/themes/light.scss +0 -111
  11. package/build/cjs/src/components/Badge/Badge.js +0 -63
  12. package/build/cjs/src/components/Box/Box.js +0 -89
  13. package/build/cjs/src/components/Button/Button.js +0 -290
  14. package/build/cjs/src/components/Callout/Callout.js +0 -102
  15. package/build/cjs/src/components/Card/Card.js +0 -69
  16. package/build/cjs/src/components/Card/CardBox.js +0 -23
  17. package/build/cjs/src/components/Card/CardHeader/CardHeader.js +0 -59
  18. package/build/cjs/src/components/Collapsible/Collapsible.js +0 -117
  19. package/build/cjs/src/components/Column/Columns.js +0 -147
  20. package/build/cjs/src/components/Container/Container.js +0 -63
  21. package/build/cjs/src/components/DataTable/DataTable.js +0 -187
  22. package/build/cjs/src/components/DataTable/TableBody.js +0 -161
  23. package/build/cjs/src/components/DataTable/TableCell.js +0 -45
  24. package/build/cjs/src/components/DataTable/TableHeader.js +0 -194
  25. package/build/cjs/src/components/DataTable/useDataTableSort.js +0 -42
  26. package/build/cjs/src/components/Divider/Divider.js +0 -68
  27. package/build/cjs/src/components/DropdownMenu/DropdownMenu.js +0 -227
  28. package/build/cjs/src/components/DropdownMenu/MenuItem.js +0 -103
  29. package/build/cjs/src/components/Form/Checkbox/Checkbox.js +0 -147
  30. package/build/cjs/src/components/Form/FormErrorMessages/FormErrorMessages.js +0 -27
  31. package/build/cjs/src/components/Form/FormField/FormField.js +0 -58
  32. package/build/cjs/src/components/Form/FormFieldGroup/FormFieldGroup.js +0 -55
  33. package/build/cjs/src/components/Form/FormLabelText/FormLabelText.js +0 -42
  34. package/build/cjs/src/components/Form/Input/Input.js +0 -186
  35. package/build/cjs/src/components/Form/PasswordInput/PasswordInput.js +0 -226
  36. package/build/cjs/src/components/Form/Radio/Radio.js +0 -138
  37. package/build/cjs/src/components/Form/RadioButton/RadioButton.js +0 -124
  38. package/build/cjs/src/components/Form/SegmentedControl/SegmentedControl.js +0 -131
  39. package/build/cjs/src/components/Form/SegmentedControl/SegmentedControlOption.js +0 -216
  40. package/build/cjs/src/components/Form/Select/Select.js +0 -291
  41. package/build/cjs/src/components/Form/Textarea/Textarea.js +0 -93
  42. package/build/cjs/src/components/Form/Toggle/Toggle.js +0 -179
  43. package/build/cjs/src/components/Form/ToggleButton/ToggleButton.js +0 -143
  44. package/build/cjs/src/components/Icon/Icon.js +0 -110
  45. package/build/cjs/src/components/Inline/Inline.js +0 -113
  46. package/build/cjs/src/components/Link/Link.js +0 -77
  47. package/build/cjs/src/components/LoadingSpinner/LoadingSpinner.js +0 -84
  48. package/build/cjs/src/components/Logo/Logo.js +0 -44
  49. package/build/cjs/src/components/MediaItem/MediaItem.js +0 -120
  50. package/build/cjs/src/components/MediaViewerBar/MediaViewerBar.js +0 -73
  51. package/build/cjs/src/components/Notification/Notification.js +0 -108
  52. package/build/cjs/src/components/Pagination/Pagination.js +0 -91
  53. package/build/cjs/src/components/Patterns/ButtonGroup/ButtonGroup.js +0 -52
  54. package/build/cjs/src/components/Patterns/Modal/Modal.js +0 -221
  55. package/build/cjs/src/components/PictogramButton/PictogramButton.js +0 -150
  56. package/build/cjs/src/components/Portal/Portal.js +0 -22
  57. package/build/cjs/src/components/ProgressBar/ProgressBar.js +0 -38
  58. package/build/cjs/src/components/RoundButton/RoundButton.js +0 -140
  59. package/build/cjs/src/components/SearchResult/SearchResult.js +0 -184
  60. package/build/cjs/src/components/SegmentedProgressBar/SegmentedProgressBar.js +0 -110
  61. package/build/cjs/src/components/SegmentedProgressBar/SegmentedProgressBarUtil.js +0 -42
  62. package/build/cjs/src/components/Stack/Stack.js +0 -80
  63. package/build/cjs/src/components/SubThemeProvider/SubThemeProvider.js +0 -55
  64. package/build/cjs/src/components/Tabs/Tabs.js +0 -137
  65. package/build/cjs/src/components/Tag/Tag.js +0 -90
  66. package/build/cjs/src/components/Tooltip/Tooltip.js +0 -275
  67. package/build/cjs/src/components/Tooltip/utils.js +0 -81
  68. package/build/cjs/src/components/Typography/Header/Header.js +0 -132
  69. package/build/cjs/src/components/Typography/StyledText/StyledText.js +0 -168
  70. package/build/cjs/src/components/Typography/Text/Text.js +0 -71
  71. package/build/cjs/src/components/Typography/TextClamped/TextClamped.js +0 -54
  72. package/build/cjs/src/components/VirtualScrollList/VirtualScrollList.js +0 -116
  73. package/build/cjs/src/components/VirtualScrollList/VirtualScrollListReducer.js +0 -131
  74. package/build/cjs/src/index.js +0 -136
  75. package/build/cjs/src/shared/ScreenReaderText.js +0 -26
  76. package/build/cjs/src/shared/flattenChildren.js +0 -33
  77. package/build/cjs/src/shared/informDeprecation.js +0 -12
  78. package/build/cjs/src/shared/mediaQueries.js +0 -68
  79. package/build/cjs/src/shared/useAutoPosition.js +0 -42
  80. package/build/cjs/src/shared/useDocument.js +0 -7
  81. package/build/cjs/src/shared/useHover.js +0 -26
  82. package/build/cjs/src/shared/useKeyboard.js +0 -43
  83. package/build/cjs/src/shared/useOnEscapePress.js +0 -52
  84. package/build/cjs/src/shared/useOutsideClick.js +0 -33
  85. package/build/cjs/src/shared/useWindow.js +0 -7
  86. package/build/esm/build-tokens/_breakpoints.json +0 -17
  87. package/build/esm/build-tokens/_breakpoints.json.js +0 -4
  88. package/build/esm/build-tokens/_breakpoints.json.js.map +0 -1
  89. package/build/esm/build-tokens/_colors.json +0 -918
  90. package/build/esm/build-tokens/_icon_sizes_map.json +0 -7
  91. package/build/esm/build-tokens/_icon_sizes_map.json.js +0 -4
  92. package/build/esm/build-tokens/_icon_sizes_map.json.js.map +0 -1
  93. package/build/esm/build-tokens/_sizes.json +0 -782
  94. package/build/esm/build-tokens/_subThemeType.d.ts +0 -1
  95. package/build/esm/build-tokens/_zindex.json +0 -17
  96. package/build/esm/build-tokens/_zindex.json.js +0 -4
  97. package/build/esm/build-tokens/_zindex.json.js.map +0 -1
  98. package/build/esm/build-tokens/assets/icons.json +0 -141
  99. package/build/esm/build-tokens/assets/icons.json.js +0 -4
  100. package/build/esm/build-tokens/assets/icons.json.js.map +0 -1
  101. package/build/esm/build-tokens/assets/icons16.json +0 -153
  102. package/build/esm/build-tokens/assets/icons16.json.js +0 -4
  103. package/build/esm/build-tokens/assets/icons16.json.js.map +0 -1
  104. package/build/esm/build-tokens/assets/logo.json +0 -3
  105. package/build/esm/build-tokens/assets/logo.json.js +0 -4
  106. package/build/esm/build-tokens/assets/logo.json.js.map +0 -1
  107. package/build/esm/build-tokens/visualConfig.d.ts +0 -767
  108. package/build/esm/build-tokens/visualConfig.js +0 -1328
  109. package/build/esm/build-tokens/visualConfig.js.map +0 -1
  110. package/build/esm/scss/themes/dark.scss +0 -111
  111. package/build/esm/scss/themes/light.scss +0 -111
  112. package/build/esm/src/components/Badge/Badge.d.ts +0 -11
  113. package/build/esm/src/components/Badge/Badge.js +0 -57
  114. package/build/esm/src/components/Badge/Badge.js.map +0 -1
  115. package/build/esm/src/components/Box/Box.d.ts +0 -35
  116. package/build/esm/src/components/Box/Box.js +0 -82
  117. package/build/esm/src/components/Box/Box.js.map +0 -1
  118. package/build/esm/src/components/Button/Button.d.ts +0 -33
  119. package/build/esm/src/components/Button/Button.js +0 -282
  120. package/build/esm/src/components/Button/Button.js.map +0 -1
  121. package/build/esm/src/components/Button/mock.d.ts +0 -326
  122. package/build/esm/src/components/Callout/Callout.d.ts +0 -14
  123. package/build/esm/src/components/Callout/Callout.js +0 -96
  124. package/build/esm/src/components/Callout/Callout.js.map +0 -1
  125. package/build/esm/src/components/Card/Card.d.ts +0 -16
  126. package/build/esm/src/components/Card/Card.js +0 -63
  127. package/build/esm/src/components/Card/Card.js.map +0 -1
  128. package/build/esm/src/components/Card/CardBox.d.ts +0 -6
  129. package/build/esm/src/components/Card/CardBox.js +0 -18
  130. package/build/esm/src/components/Card/CardBox.js.map +0 -1
  131. package/build/esm/src/components/Card/CardHeader/CardHeader.d.ts +0 -12
  132. package/build/esm/src/components/Card/CardHeader/CardHeader.js +0 -52
  133. package/build/esm/src/components/Card/CardHeader/CardHeader.js.map +0 -1
  134. package/build/esm/src/components/Collapsible/Collapsible.d.ts +0 -15
  135. package/build/esm/src/components/Collapsible/Collapsible.js +0 -110
  136. package/build/esm/src/components/Collapsible/Collapsible.js.map +0 -1
  137. package/build/esm/src/components/Column/Columns.d.ts +0 -45
  138. package/build/esm/src/components/Column/Columns.js +0 -141
  139. package/build/esm/src/components/Column/Columns.js.map +0 -1
  140. package/build/esm/src/components/Container/Container.d.ts +0 -11
  141. package/build/esm/src/components/Container/Container.js +0 -57
  142. package/build/esm/src/components/Container/Container.js.map +0 -1
  143. package/build/esm/src/components/DataTable/DataTable.d.ts +0 -58
  144. package/build/esm/src/components/DataTable/DataTable.js +0 -180
  145. package/build/esm/src/components/DataTable/DataTable.js.map +0 -1
  146. package/build/esm/src/components/DataTable/TableBody.d.ts +0 -9
  147. package/build/esm/src/components/DataTable/TableBody.js +0 -153
  148. package/build/esm/src/components/DataTable/TableBody.js.map +0 -1
  149. package/build/esm/src/components/DataTable/TableCell.d.ts +0 -15
  150. package/build/esm/src/components/DataTable/TableCell.js +0 -38
  151. package/build/esm/src/components/DataTable/TableCell.js.map +0 -1
  152. package/build/esm/src/components/DataTable/TableHeader.d.ts +0 -9
  153. package/build/esm/src/components/DataTable/TableHeader.js +0 -185
  154. package/build/esm/src/components/DataTable/TableHeader.js.map +0 -1
  155. package/build/esm/src/components/DataTable/index.d.ts +0 -4
  156. package/build/esm/src/components/DataTable/types.d.ts +0 -15
  157. package/build/esm/src/components/DataTable/useDataTableSort.d.ts +0 -14
  158. package/build/esm/src/components/DataTable/useDataTableSort.js +0 -41
  159. package/build/esm/src/components/DataTable/useDataTableSort.js.map +0 -1
  160. package/build/esm/src/components/Divider/Divider.d.ts +0 -6
  161. package/build/esm/src/components/Divider/Divider.js +0 -62
  162. package/build/esm/src/components/Divider/Divider.js.map +0 -1
  163. package/build/esm/src/components/DropdownMenu/DropdownMenu.d.ts +0 -35
  164. package/build/esm/src/components/DropdownMenu/DropdownMenu.js +0 -221
  165. package/build/esm/src/components/DropdownMenu/DropdownMenu.js.map +0 -1
  166. package/build/esm/src/components/DropdownMenu/MenuItem.d.ts +0 -19
  167. package/build/esm/src/components/DropdownMenu/MenuItem.js +0 -97
  168. package/build/esm/src/components/DropdownMenu/MenuItem.js.map +0 -1
  169. package/build/esm/src/components/Form/Checkbox/Checkbox.d.ts +0 -15
  170. package/build/esm/src/components/Form/Checkbox/Checkbox.js +0 -140
  171. package/build/esm/src/components/Form/Checkbox/Checkbox.js.map +0 -1
  172. package/build/esm/src/components/Form/FormErrorMessages/FormErrorMessages.d.ts +0 -6
  173. package/build/esm/src/components/Form/FormErrorMessages/FormErrorMessages.js +0 -22
  174. package/build/esm/src/components/Form/FormErrorMessages/FormErrorMessages.js.map +0 -1
  175. package/build/esm/src/components/Form/FormField/FormField.d.ts +0 -15
  176. package/build/esm/src/components/Form/FormField/FormField.js +0 -52
  177. package/build/esm/src/components/Form/FormField/FormField.js.map +0 -1
  178. package/build/esm/src/components/Form/FormFieldGroup/FormFieldGroup.d.ts +0 -11
  179. package/build/esm/src/components/Form/FormFieldGroup/FormFieldGroup.js +0 -49
  180. package/build/esm/src/components/Form/FormFieldGroup/FormFieldGroup.js.map +0 -1
  181. package/build/esm/src/components/Form/FormLabelText/FormLabelText.d.ts +0 -7
  182. package/build/esm/src/components/Form/FormLabelText/FormLabelText.js +0 -36
  183. package/build/esm/src/components/Form/FormLabelText/FormLabelText.js.map +0 -1
  184. package/build/esm/src/components/Form/Input/Input.d.ts +0 -54
  185. package/build/esm/src/components/Form/Input/Input.js +0 -178
  186. package/build/esm/src/components/Form/Input/Input.js.map +0 -1
  187. package/build/esm/src/components/Form/Input/index.d.ts +0 -2
  188. package/build/esm/src/components/Form/PasswordInput/PasswordInput.d.ts +0 -53
  189. package/build/esm/src/components/Form/PasswordInput/PasswordInput.js +0 -218
  190. package/build/esm/src/components/Form/PasswordInput/PasswordInput.js.map +0 -1
  191. package/build/esm/src/components/Form/PasswordInput/index.d.ts +0 -2
  192. package/build/esm/src/components/Form/Radio/Radio.d.ts +0 -14
  193. package/build/esm/src/components/Form/Radio/Radio.js +0 -131
  194. package/build/esm/src/components/Form/Radio/Radio.js.map +0 -1
  195. package/build/esm/src/components/Form/RadioButton/RadioButton.d.ts +0 -17
  196. package/build/esm/src/components/Form/RadioButton/RadioButton.js +0 -117
  197. package/build/esm/src/components/Form/RadioButton/RadioButton.js.map +0 -1
  198. package/build/esm/src/components/Form/SegmentedControl/SegmentedControl.d.ts +0 -31
  199. package/build/esm/src/components/Form/SegmentedControl/SegmentedControl.js +0 -124
  200. package/build/esm/src/components/Form/SegmentedControl/SegmentedControl.js.map +0 -1
  201. package/build/esm/src/components/Form/SegmentedControl/SegmentedControlOption.d.ts +0 -8
  202. package/build/esm/src/components/Form/SegmentedControl/SegmentedControlOption.js +0 -210
  203. package/build/esm/src/components/Form/SegmentedControl/SegmentedControlOption.js.map +0 -1
  204. package/build/esm/src/components/Form/Select/Select.d.ts +0 -23
  205. package/build/esm/src/components/Form/Select/Select.js +0 -284
  206. package/build/esm/src/components/Form/Select/Select.js.map +0 -1
  207. package/build/esm/src/components/Form/Textarea/Textarea.d.ts +0 -26
  208. package/build/esm/src/components/Form/Textarea/Textarea.js +0 -86
  209. package/build/esm/src/components/Form/Textarea/Textarea.js.map +0 -1
  210. package/build/esm/src/components/Form/Toggle/Toggle.d.ts +0 -18
  211. package/build/esm/src/components/Form/Toggle/Toggle.js +0 -172
  212. package/build/esm/src/components/Form/Toggle/Toggle.js.map +0 -1
  213. package/build/esm/src/components/Form/ToggleButton/ToggleButton.d.ts +0 -15
  214. package/build/esm/src/components/Form/ToggleButton/ToggleButton.js +0 -136
  215. package/build/esm/src/components/Form/ToggleButton/ToggleButton.js.map +0 -1
  216. package/build/esm/src/components/Icon/Icon.d.ts +0 -22
  217. package/build/esm/src/components/Icon/Icon.js +0 -104
  218. package/build/esm/src/components/Icon/Icon.js.map +0 -1
  219. package/build/esm/src/components/Inline/Inline.d.ts +0 -30
  220. package/build/esm/src/components/Inline/Inline.js +0 -107
  221. package/build/esm/src/components/Inline/Inline.js.map +0 -1
  222. package/build/esm/src/components/Link/Link.d.ts +0 -14
  223. package/build/esm/src/components/Link/Link.js +0 -70
  224. package/build/esm/src/components/Link/Link.js.map +0 -1
  225. package/build/esm/src/components/LoadingSpinner/LoadingSpinner.d.ts +0 -11
  226. package/build/esm/src/components/LoadingSpinner/LoadingSpinner.js +0 -78
  227. package/build/esm/src/components/LoadingSpinner/LoadingSpinner.js.map +0 -1
  228. package/build/esm/src/components/Logo/Logo.d.ts +0 -8
  229. package/build/esm/src/components/Logo/Logo.js +0 -38
  230. package/build/esm/src/components/Logo/Logo.js.map +0 -1
  231. package/build/esm/src/components/MediaItem/MediaItem.d.ts +0 -14
  232. package/build/esm/src/components/MediaItem/MediaItem.js +0 -114
  233. package/build/esm/src/components/MediaItem/MediaItem.js.map +0 -1
  234. package/build/esm/src/components/MediaViewerBar/MediaViewerBar.d.ts +0 -7
  235. package/build/esm/src/components/MediaViewerBar/MediaViewerBar.js +0 -67
  236. package/build/esm/src/components/MediaViewerBar/MediaViewerBar.js.map +0 -1
  237. package/build/esm/src/components/Notification/ExpandedContent.d.ts +0 -2
  238. package/build/esm/src/components/Notification/Notification.d.ts +0 -16
  239. package/build/esm/src/components/Notification/Notification.js +0 -102
  240. package/build/esm/src/components/Notification/Notification.js.map +0 -1
  241. package/build/esm/src/components/Pagination/Pagination.d.ts +0 -17
  242. package/build/esm/src/components/Pagination/Pagination.js +0 -86
  243. package/build/esm/src/components/Pagination/Pagination.js.map +0 -1
  244. package/build/esm/src/components/Patterns/ButtonGroup/ButtonGroup.d.ts +0 -14
  245. package/build/esm/src/components/Patterns/ButtonGroup/ButtonGroup.js +0 -46
  246. package/build/esm/src/components/Patterns/ButtonGroup/ButtonGroup.js.map +0 -1
  247. package/build/esm/src/components/Patterns/Modal/Modal.d.ts +0 -28
  248. package/build/esm/src/components/Patterns/Modal/Modal.js +0 -214
  249. package/build/esm/src/components/Patterns/Modal/Modal.js.map +0 -1
  250. package/build/esm/src/components/PictogramButton/PictogramButton.d.ts +0 -15
  251. package/build/esm/src/components/PictogramButton/PictogramButton.js +0 -143
  252. package/build/esm/src/components/PictogramButton/PictogramButton.js.map +0 -1
  253. package/build/esm/src/components/Portal/Portal.d.ts +0 -7
  254. package/build/esm/src/components/Portal/Portal.js +0 -16
  255. package/build/esm/src/components/Portal/Portal.js.map +0 -1
  256. package/build/esm/src/components/ProgressBar/ProgressBar.d.ts +0 -15
  257. package/build/esm/src/components/ProgressBar/ProgressBar.js +0 -33
  258. package/build/esm/src/components/ProgressBar/ProgressBar.js.map +0 -1
  259. package/build/esm/src/components/RoundButton/RoundButton.d.ts +0 -12
  260. package/build/esm/src/components/RoundButton/RoundButton.js +0 -133
  261. package/build/esm/src/components/RoundButton/RoundButton.js.map +0 -1
  262. package/build/esm/src/components/SearchResult/SearchResult.d.ts +0 -43
  263. package/build/esm/src/components/SearchResult/SearchResult.js +0 -178
  264. package/build/esm/src/components/SearchResult/SearchResult.js.map +0 -1
  265. package/build/esm/src/components/SegmentedProgressBar/SegmentedProgressBar.d.ts +0 -28
  266. package/build/esm/src/components/SegmentedProgressBar/SegmentedProgressBar.js +0 -104
  267. package/build/esm/src/components/SegmentedProgressBar/SegmentedProgressBar.js.map +0 -1
  268. package/build/esm/src/components/SegmentedProgressBar/SegmentedProgressBarUtil.d.ts +0 -10
  269. package/build/esm/src/components/SegmentedProgressBar/SegmentedProgressBarUtil.js +0 -40
  270. package/build/esm/src/components/SegmentedProgressBar/SegmentedProgressBarUtil.js.map +0 -1
  271. package/build/esm/src/components/ShadowWebComponent/ShadowWebComponent.d.ts +0 -13
  272. package/build/esm/src/components/Stack/Stack.d.ts +0 -20
  273. package/build/esm/src/components/Stack/Stack.js +0 -74
  274. package/build/esm/src/components/Stack/Stack.js.map +0 -1
  275. package/build/esm/src/components/SubThemeProvider/SubThemeProvider.d.ts +0 -8
  276. package/build/esm/src/components/SubThemeProvider/SubThemeProvider.js +0 -50
  277. package/build/esm/src/components/SubThemeProvider/SubThemeProvider.js.map +0 -1
  278. package/build/esm/src/components/Tabs/Tabs.d.ts +0 -28
  279. package/build/esm/src/components/Tabs/Tabs.js +0 -130
  280. package/build/esm/src/components/Tabs/Tabs.js.map +0 -1
  281. package/build/esm/src/components/Tag/Tag.d.ts +0 -18
  282. package/build/esm/src/components/Tag/Tag.js +0 -84
  283. package/build/esm/src/components/Tag/Tag.js.map +0 -1
  284. package/build/esm/src/components/Tooltip/BaseTooltip.d.ts +0 -22
  285. package/build/esm/src/components/Tooltip/Popover.d.ts +0 -7
  286. package/build/esm/src/components/Tooltip/Tooltip.d.ts +0 -23
  287. package/build/esm/src/components/Tooltip/Tooltip.js +0 -269
  288. package/build/esm/src/components/Tooltip/Tooltip.js.map +0 -1
  289. package/build/esm/src/components/Tooltip/util.d.ts +0 -12
  290. package/build/esm/src/components/Tooltip/utils.d.ts +0 -11
  291. package/build/esm/src/components/Tooltip/utils.js +0 -75
  292. package/build/esm/src/components/Tooltip/utils.js.map +0 -1
  293. package/build/esm/src/components/Typography/Header/Header.d.ts +0 -34
  294. package/build/esm/src/components/Typography/Header/Header.js +0 -122
  295. package/build/esm/src/components/Typography/Header/Header.js.map +0 -1
  296. package/build/esm/src/components/Typography/StyledText/StyledText.d.ts +0 -11
  297. package/build/esm/src/components/Typography/StyledText/StyledText.js +0 -161
  298. package/build/esm/src/components/Typography/StyledText/StyledText.js.map +0 -1
  299. package/build/esm/src/components/Typography/Text/Text.d.ts +0 -21
  300. package/build/esm/src/components/Typography/Text/Text.js +0 -65
  301. package/build/esm/src/components/Typography/Text/Text.js.map +0 -1
  302. package/build/esm/src/components/Typography/TextClamped/TextClamped.d.ts +0 -10
  303. package/build/esm/src/components/Typography/TextClamped/TextClamped.js +0 -47
  304. package/build/esm/src/components/Typography/TextClamped/TextClamped.js.map +0 -1
  305. package/build/esm/src/components/VirtualScrollList/VirtualScrollList.d.ts +0 -11
  306. package/build/esm/src/components/VirtualScrollList/VirtualScrollList.js +0 -110
  307. package/build/esm/src/components/VirtualScrollList/VirtualScrollList.js.map +0 -1
  308. package/build/esm/src/components/VirtualScrollList/VirtualScrollListReducer.d.ts +0 -36
  309. package/build/esm/src/components/VirtualScrollList/VirtualScrollListReducer.js +0 -130
  310. package/build/esm/src/components/VirtualScrollList/VirtualScrollListReducer.js.map +0 -1
  311. package/build/esm/src/index.d.ts +0 -53
  312. package/build/esm/src/index.js +0 -60
  313. package/build/esm/src/index.js.map +0 -1
  314. package/build/esm/src/shared/ScreenReaderText.d.ts +0 -5
  315. package/build/esm/src/shared/ScreenReaderText.js +0 -21
  316. package/build/esm/src/shared/ScreenReaderText.js.map +0 -1
  317. package/build/esm/src/shared/flattenChildren.d.ts +0 -11
  318. package/build/esm/src/shared/flattenChildren.js +0 -32
  319. package/build/esm/src/shared/flattenChildren.js.map +0 -1
  320. package/build/esm/src/shared/informDeprecation.d.ts +0 -1
  321. package/build/esm/src/shared/informDeprecation.js +0 -11
  322. package/build/esm/src/shared/informDeprecation.js.map +0 -1
  323. package/build/esm/src/shared/mediaQueries.d.ts +0 -14
  324. package/build/esm/src/shared/mediaQueries.js +0 -66
  325. package/build/esm/src/shared/mediaQueries.js.map +0 -1
  326. package/build/esm/src/shared/replaceDeprecated.d.ts +0 -1
  327. package/build/esm/src/shared/useAutoPosition.d.ts +0 -5
  328. package/build/esm/src/shared/useAutoPosition.js +0 -41
  329. package/build/esm/src/shared/useAutoPosition.js.map +0 -1
  330. package/build/esm/src/shared/useDocument.d.ts +0 -1
  331. package/build/esm/src/shared/useDocument.js +0 -6
  332. package/build/esm/src/shared/useDocument.js.map +0 -1
  333. package/build/esm/src/shared/useHover.d.ts +0 -2
  334. package/build/esm/src/shared/useHover.js +0 -25
  335. package/build/esm/src/shared/useHover.js.map +0 -1
  336. package/build/esm/src/shared/useKeyboard.d.ts +0 -17
  337. package/build/esm/src/shared/useKeyboard.js +0 -42
  338. package/build/esm/src/shared/useKeyboard.js.map +0 -1
  339. package/build/esm/src/shared/useOnEscapePress.d.ts +0 -2
  340. package/build/esm/src/shared/useOnEscapePress.js +0 -51
  341. package/build/esm/src/shared/useOnEscapePress.js.map +0 -1
  342. package/build/esm/src/shared/useOutsideClick.d.ts +0 -11
  343. package/build/esm/src/shared/useOutsideClick.js +0 -32
  344. package/build/esm/src/shared/useOutsideClick.js.map +0 -1
  345. package/build/esm/src/shared/useWindow.d.ts +0 -1
  346. package/build/esm/src/shared/useWindow.js +0 -6
  347. package/build/esm/src/shared/useWindow.js.map +0 -1
  348. package/build/esm/src/types/index.d.ts +0 -57
@@ -1,11 +0,0 @@
1
- const informDeprecation = function (property, value, location) {
2
- let details = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "";
3
- if (property === undefined) return;
4
- if (property === value) {
5
- // eslint-disable-next-line no-console
6
- console.error(`value ${JSON.stringify(value)} is depricated in ${location} \n ${details}`);
7
- }
8
- };
9
-
10
- export { informDeprecation };
11
- //# sourceMappingURL=informDeprecation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"informDeprecation.js","sources":["../../../../src/shared/informDeprecation.ts"],"sourcesContent":["export const informDeprecation = (\n property: unknown,\n value: unknown,\n location: string,\n details = \"\"\n): void => {\n if (property === undefined) return;\n if (property === value) {\n // eslint-disable-next-line no-console\n console.error(\n `value ${JSON.stringify(\n value\n )} is depricated in ${location} \\n ${details}`\n );\n }\n};\n"],"names":["informDeprecation","property","value","location","details","arguments","length","undefined","console","error","JSON","stringify"],"mappings":"AAAO,MAAMA,iBAAiB,GAAG,UAC/BC,QAAiB,EACjBC,KAAc,EACdC,QAAgB,EAEP;AAAA,EAAA,IADTC,OAAO,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,EAAE,CAAA;EAEZ,IAAIJ,QAAQ,KAAKM,SAAS,EAAE,OAAA;EAC5B,IAAIN,QAAQ,KAAKC,KAAK,EAAE;AACtB;AACAM,IAAAA,OAAO,CAACC,KAAK,CACV,CAAA,MAAA,EAAQC,IAAI,CAACC,SAAS,CACrBT,KACF,CAAE,CAAoBC,kBAAAA,EAAAA,QAAS,CAAMC,IAAAA,EAAAA,OAAQ,EAC/C,CAAC,CAAA;AACH,GAAA;AACF;;;;"}
@@ -1,14 +0,0 @@
1
- import { ColumnSizes, HorizontalAlignment, MQ, SpaceSizes, TextAlignment, VerticalAlignment, Order, ColumnAlignment, Hyphens } from "../types";
2
- declare type MqProp<T> = [
3
- T | MQ<T>,
4
- Record<T extends string ? T : never, string | number>
5
- ];
6
- declare type MqRules = Record<string, MqProp<TextAlignment> | MqProp<SpaceSizes> | MqProp<HorizontalAlignment> | MqProp<VerticalAlignment> | MqProp<ColumnSizes> | MqProp<Order> | MqProp<ColumnAlignment> | MqProp<Hyphens>>;
7
- declare type EmotionCssPropertyName = string;
8
- declare type EmotionCssValue = string | number;
9
- declare type EmotionCssDescription = Record<EmotionCssPropertyName, EmotionCssValue>;
10
- declare type MqFunc = (rules: MqRules) => Record<string, EmotionCssValue | EmotionCssDescription>;
11
- export declare const mq: MqFunc;
12
- export declare const mqValue: (rules: Record<EmotionCssPropertyName, EmotionCssValue[] | EmotionCssValue>) => Record<string, EmotionCssValue | EmotionCssDescription>;
13
- export declare function getMediaQueryClasses<T>(s: T | MQ<T> | undefined, styles: Record<string, string>, prefix?: string): string[];
14
- export {};
@@ -1,66 +0,0 @@
1
- import breakpoints from '../../build-tokens/_breakpoints.json.js';
2
-
3
- /* eslint-disable @typescript-eslint/no-explicit-any */
4
-
5
- /*
6
- Although, mq implementation supports any property type, the following types are specified to provide type safety. If you need support for a new type, add it here.
7
- */
8
-
9
- // this thing probably deserves to be a separate library, like facepaint for emotion
10
- function getMq(breakpointRules) {
11
- const keys = breakpointRules;
12
- return rules => {
13
- const res = {};
14
- keys.forEach(key => {
15
- res[key] = {};
16
- });
17
- res[`@media screen`] = {};
18
-
19
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
20
- Object.entries(rules).forEach(_ref => {
21
- let [cssProperty, [prop, map]] = _ref;
22
- if (Array.isArray(prop)) {
23
- const sm = prop[0];
24
- const md = prop[1] || prop[0];
25
- const lg = prop[2] || prop[1] || prop[0];
26
- const [s, m, l] = keys;
27
- res[s][cssProperty] = map[sm];
28
- res[m][cssProperty] = map[md];
29
- res[l][cssProperty] = map[lg];
30
- } else {
31
- res[`@media screen`][cssProperty] = map[prop];
32
- }
33
- });
34
- return res;
35
- };
36
- }
37
- const mq = getMq([`@media (max-width: ${breakpoints.medium.value}px)`, `@media (min-width: ${breakpoints.medium.value}px) and (max-width: ${breakpoints.large.value}px)`, `@media (min-width: ${breakpoints.large.value}px)`]);
38
- function getMqValue(breakpointRules) {
39
- const keys = breakpointRules;
40
- return rules => {
41
- const res = {};
42
- keys.forEach(key => {
43
- res[key] = {};
44
- });
45
- res[`@media screen`] = {};
46
- Object.entries(rules).forEach(_ref2 => {
47
- let [cssProperty, cssValues] = _ref2;
48
- if (Array.isArray(cssValues)) {
49
- breakpointRules.forEach((breakpoint, index) => {
50
- let i = index;
51
- while (!cssValues[i] && i !== 0) {
52
- i -= 1;
53
- }
54
- res[breakpoint][cssProperty] = cssValues[i];
55
- });
56
- } else {
57
- res[`@media screen`][cssProperty] = cssValues;
58
- }
59
- });
60
- return res;
61
- };
62
- }
63
- const mqValue = getMqValue([`@media (max-width: ${breakpoints.medium.value}px)`, `@media (min-width: ${breakpoints.medium.value}px) and (max-width: ${breakpoints.large.value}px)`, `@media (min-width: ${breakpoints.large.value}px)`]);
64
-
65
- export { mq, mqValue };
66
- //# sourceMappingURL=mediaQueries.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mediaQueries.js","sources":["../../../../src/shared/mediaQueries.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport {\n ColumnSizes,\n HorizontalAlignment,\n MQ,\n SpaceSizes,\n TextAlignment,\n VerticalAlignment,\n Order,\n ColumnAlignment,\n Hyphens,\n} from \"../types\";\nimport breakpoints from \"../../build-tokens/_breakpoints.json\";\n\ntype MqProp<T> = [\n T | MQ<T>,\n Record<T extends string ? T : never, string | number>\n];\n\n/*\n Although, mq implementation supports any property type, the following types are specified to provide type safety. If you need support for a new type, add it here.\n*/\ntype MqRules = Record<\n string,\n | MqProp<TextAlignment>\n | MqProp<SpaceSizes>\n | MqProp<HorizontalAlignment>\n | MqProp<VerticalAlignment>\n | MqProp<ColumnSizes>\n | MqProp<Order>\n | MqProp<ColumnAlignment>\n | MqProp<Hyphens>\n>;\n\ntype EmotionCssPropertyName = string;\ntype EmotionCssValue = string | number;\ntype EmotionCssDescription = Record<EmotionCssPropertyName, EmotionCssValue>;\ntype MqFunc = (\n rules: MqRules\n) => Record<string, EmotionCssValue | EmotionCssDescription>;\n\n// this thing probably deserves to be a separate library, like facepaint for emotion\nfunction getMq(breakpointRules: string[]): MqFunc {\n const keys = breakpointRules;\n\n return (rules) => {\n const res: Record<string, EmotionCssValue | EmotionCssDescription> = {};\n\n keys.forEach((key: string) => {\n res[key] = {};\n });\n res[`@media screen`] = {};\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Object.entries(rules).forEach(([cssProperty, [prop, map]]: any) => {\n if (Array.isArray(prop)) {\n const sm = prop[0];\n const md = prop[1] || prop[0];\n const lg = prop[2] || prop[1] || prop[0];\n const [s, m, l]: string[] = keys;\n\n (res[s] as EmotionCssDescription)[cssProperty] = map[sm];\n (res[m] as EmotionCssDescription)[cssProperty] = map[md];\n (res[l] as EmotionCssDescription)[cssProperty] = map[lg];\n } else {\n (res[`@media screen`] as EmotionCssDescription)[cssProperty] = map[\n prop as string\n ] as string;\n }\n });\n\n return res;\n };\n}\n\nexport const mq = getMq([\n `@media (max-width: ${breakpoints.medium.value}px)`,\n `@media (min-width: ${breakpoints.medium.value}px) and (max-width: ${breakpoints.large.value}px)`,\n `@media (min-width: ${breakpoints.large.value}px)`,\n]);\n\nfunction getMqValue(breakpointRules: string[]) {\n const keys = breakpointRules;\n return (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n rules: Record<EmotionCssPropertyName, EmotionCssValue[] | EmotionCssValue>\n ): Record<string, EmotionCssValue | EmotionCssDescription> => {\n const res: Record<string, EmotionCssValue | EmotionCssDescription> = {};\n keys.forEach((key: string) => {\n res[key] = {};\n });\n res[`@media screen`] = {};\n\n Object.entries(rules).forEach(([cssProperty, cssValues]) => {\n if (Array.isArray(cssValues)) {\n breakpointRules.forEach((breakpoint, index) => {\n let i = index;\n while (!cssValues[i] && i !== 0) {\n i -= 1;\n }\n\n (res[breakpoint] as EmotionCssDescription)[cssProperty] =\n cssValues[i];\n });\n } else {\n (res[`@media screen`] as EmotionCssDescription)[cssProperty] =\n cssValues;\n }\n });\n\n return res;\n };\n}\n\nexport const mqValue = getMqValue([\n `@media (max-width: ${breakpoints.medium.value}px)`,\n `@media (min-width: ${breakpoints.medium.value}px) and (max-width: ${breakpoints.large.value}px)`,\n `@media (min-width: ${breakpoints.large.value}px)`,\n]);\n\nexport function getMediaQueryClasses<T>(\n s: T | MQ<T> | undefined,\n styles: Record<string, string>,\n prefix = \"\"\n): string[] {\n if (s === undefined) return [];\n\n let res;\n if (Array.isArray(s)) {\n const sm = s[0];\n const md = s[1] || s[0];\n const lg = s[2] || s[1] || s[0];\n\n res = [`${sm}-small`, `${md}-medium`, `${lg}-large`];\n } else {\n res = [s as unknown as string];\n }\n\n return res.map((cl) => `${prefix}${cl}`).map((cl) => styles[cl]);\n}\n"],"names":["getMq","breakpointRules","keys","rules","res","forEach","key","Object","entries","_ref","cssProperty","prop","map","Array","isArray","sm","md","lg","s","m","l","mq","breakpoints","medium","value","large","getMqValue","_ref2","cssValues","breakpoint","index","i","mqValue"],"mappings":";;AAAA;;AAoBA;AACA;AACA;;AAoBA;AACA,SAASA,KAAKA,CAACC,eAAyB,EAAU;EAChD,MAAMC,IAAI,GAAGD,eAAe,CAAA;AAE5B,EAAA,OAAQE,KAAK,IAAK;IAChB,MAAMC,GAA4D,GAAG,EAAE,CAAA;AAEvEF,IAAAA,IAAI,CAACG,OAAO,CAAEC,GAAW,IAAK;AAC5BF,MAAAA,GAAG,CAACE,GAAG,CAAC,GAAG,EAAE,CAAA;AACf,KAAC,CAAC,CAAA;AACFF,IAAAA,GAAG,CAAE,CAAA,aAAA,CAAc,CAAC,GAAG,EAAE,CAAA;;AAEzB;IACAG,MAAM,CAACC,OAAO,CAACL,KAAK,CAAC,CAACE,OAAO,CAACI,IAAA,IAAqC;MAAA,IAApC,CAACC,WAAW,EAAE,CAACC,IAAI,EAAEC,GAAG,CAAC,CAAM,GAAAH,IAAA,CAAA;AAC5D,MAAA,IAAII,KAAK,CAACC,OAAO,CAACH,IAAI,CAAC,EAAE;AACvB,QAAA,MAAMI,EAAE,GAAGJ,IAAI,CAAC,CAAC,CAAC,CAAA;QAClB,MAAMK,EAAE,GAAGL,IAAI,CAAC,CAAC,CAAC,IAAIA,IAAI,CAAC,CAAC,CAAC,CAAA;AAC7B,QAAA,MAAMM,EAAE,GAAGN,IAAI,CAAC,CAAC,CAAC,IAAIA,IAAI,CAAC,CAAC,CAAC,IAAIA,IAAI,CAAC,CAAC,CAAC,CAAA;QACxC,MAAM,CAACO,CAAC,EAAEC,CAAC,EAAEC,CAAC,CAAW,GAAGlB,IAAI,CAAA;QAE/BE,GAAG,CAACc,CAAC,CAAC,CAA2BR,WAAW,CAAC,GAAGE,GAAG,CAACG,EAAE,CAAC,CAAA;QACvDX,GAAG,CAACe,CAAC,CAAC,CAA2BT,WAAW,CAAC,GAAGE,GAAG,CAACI,EAAE,CAAC,CAAA;QACvDZ,GAAG,CAACgB,CAAC,CAAC,CAA2BV,WAAW,CAAC,GAAGE,GAAG,CAACK,EAAE,CAAC,CAAA;AAC1D,OAAC,MAAM;QACJb,GAAG,CAAE,CAAc,aAAA,CAAA,CAAC,CAA2BM,WAAW,CAAC,GAAGE,GAAG,CAChED,IAAI,CACK,CAAA;AACb,OAAA;AACF,KAAC,CAAC,CAAA;AAEF,IAAA,OAAOP,GAAG,CAAA;GACX,CAAA;AACH,CAAA;MAEaiB,EAAE,GAAGrB,KAAK,CAAC,CACrB,CAAqBsB,mBAAAA,EAAAA,WAAW,CAACC,MAAM,CAACC,KAAM,CAAA,GAAA,CAAI,EAClD,CAAA,mBAAA,EAAqBF,WAAW,CAACC,MAAM,CAACC,KAAM,uBAAsBF,WAAW,CAACG,KAAK,CAACD,KAAM,CAAI,GAAA,CAAA,EAChG,CAAqBF,mBAAAA,EAAAA,WAAW,CAACG,KAAK,CAACD,KAAM,CAAA,GAAA,CAAI,CACnD,EAAC;AAEF,SAASE,UAAUA,CAACzB,eAAyB,EAAE;EAC7C,MAAMC,IAAI,GAAGD,eAAe,CAAA;AAC5B,EAAA,OAEEE,KAA0E,IACd;IAC5D,MAAMC,GAA4D,GAAG,EAAE,CAAA;AACvEF,IAAAA,IAAI,CAACG,OAAO,CAAEC,GAAW,IAAK;AAC5BF,MAAAA,GAAG,CAACE,GAAG,CAAC,GAAG,EAAE,CAAA;AACf,KAAC,CAAC,CAAA;AACFF,IAAAA,GAAG,CAAE,CAAA,aAAA,CAAc,CAAC,GAAG,EAAE,CAAA;IAEzBG,MAAM,CAACC,OAAO,CAACL,KAAK,CAAC,CAACE,OAAO,CAACsB,KAAA,IAA8B;AAAA,MAAA,IAA7B,CAACjB,WAAW,EAAEkB,SAAS,CAAC,GAAAD,KAAA,CAAA;AACrD,MAAA,IAAId,KAAK,CAACC,OAAO,CAACc,SAAS,CAAC,EAAE;AAC5B3B,QAAAA,eAAe,CAACI,OAAO,CAAC,CAACwB,UAAU,EAAEC,KAAK,KAAK;UAC7C,IAAIC,CAAC,GAAGD,KAAK,CAAA;UACb,OAAO,CAACF,SAAS,CAACG,CAAC,CAAC,IAAIA,CAAC,KAAK,CAAC,EAAE;AAC/BA,YAAAA,CAAC,IAAI,CAAC,CAAA;AACR,WAAA;UAEC3B,GAAG,CAACyB,UAAU,CAAC,CAA2BnB,WAAW,CAAC,GACrDkB,SAAS,CAACG,CAAC,CAAC,CAAA;AAChB,SAAC,CAAC,CAAA;AACJ,OAAC,MAAM;AACJ3B,QAAAA,GAAG,CAAE,CAAc,aAAA,CAAA,CAAC,CAA2BM,WAAW,CAAC,GAC1DkB,SAAS,CAAA;AACb,OAAA;AACF,KAAC,CAAC,CAAA;AAEF,IAAA,OAAOxB,GAAG,CAAA;GACX,CAAA;AACH,CAAA;MAEa4B,OAAO,GAAGN,UAAU,CAAC,CAC/B,CAAqBJ,mBAAAA,EAAAA,WAAW,CAACC,MAAM,CAACC,KAAM,CAAA,GAAA,CAAI,EAClD,CAAA,mBAAA,EAAqBF,WAAW,CAACC,MAAM,CAACC,KAAM,uBAAsBF,WAAW,CAACG,KAAK,CAACD,KAAM,CAAI,GAAA,CAAA,EAChG,CAAqBF,mBAAAA,EAAAA,WAAW,CAACG,KAAK,CAACD,KAAM,CAAA,GAAA,CAAI,CACnD;;;;"}
@@ -1 +0,0 @@
1
- export declare const replaceDeprecated: (property: unknown, from: unknown, to: unknown, location: string, details?: string) => unknown;
@@ -1,5 +0,0 @@
1
- import { RefObject } from "react";
2
- export declare type VerticalPosition = "up" | "down";
3
- export declare type HorizontalPosition = "left" | "right";
4
- export declare type Position = [VerticalPosition, HorizontalPosition];
5
- export declare const useAutoPosition: (anchorRef: RefObject<HTMLElement>, contentRef: RefObject<HTMLElement>, isActive: boolean) => Position;
@@ -1,41 +0,0 @@
1
- import { useState, useLayoutEffect } from 'react';
2
- import { useWindow } from './useWindow.js';
3
- import { useDocument } from './useDocument.js';
4
-
5
- const useAutoPosition = (anchorRef, contentRef, isActive) => {
6
- const [verticalPosition, setVerticalPosition] = useState("down");
7
- const [horizontalPosition, setHorizontalPosition] = useState("left");
8
- const document = useDocument();
9
- const window = useWindow();
10
- useLayoutEffect(() => {
11
- if (!contentRef) return;
12
- if (isActive) {
13
- const maxHeight = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0);
14
- const rect = contentRef.current.getBoundingClientRect();
15
- const anchorHeight = anchorRef.current.getBoundingClientRect().height;
16
- const anchorX = anchorRef.current.getBoundingClientRect().x;
17
- const screenWidth = window.innerWidth;
18
- const isUp = rect.top + rect.height > maxHeight;
19
- const isDown = rect.top - anchorHeight < rect.height;
20
- const isLeft = anchorX > screenWidth / 2;
21
- const isRight = anchorX < screenWidth / 2;
22
- if (isUp) {
23
- setVerticalPosition("up");
24
- } else if (isDown) {
25
- setVerticalPosition("down");
26
- }
27
- if (isLeft) {
28
- setHorizontalPosition("left");
29
- } else if (isRight) {
30
- setHorizontalPosition("right");
31
- }
32
- } else {
33
- setVerticalPosition("down");
34
- setHorizontalPosition("left");
35
- }
36
- }, [anchorRef, contentRef, document.documentElement.clientHeight, isActive, window.innerHeight, window.innerWidth]);
37
- return [verticalPosition, horizontalPosition];
38
- };
39
-
40
- export { useAutoPosition };
41
- //# sourceMappingURL=useAutoPosition.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAutoPosition.js","sources":["../../../../src/shared/useAutoPosition.ts"],"sourcesContent":["import { useState, useLayoutEffect, RefObject } from \"react\";\n\nimport { useWindow } from \"./useWindow\";\nimport { useDocument } from \"./useDocument\";\n\nexport type VerticalPosition = \"up\" | \"down\";\nexport type HorizontalPosition = \"left\" | \"right\";\nexport type Position = [VerticalPosition, HorizontalPosition];\n\nexport const useAutoPosition = (\n anchorRef: RefObject<HTMLElement>,\n contentRef: RefObject<HTMLElement>,\n isActive: boolean\n): Position => {\n const [verticalPosition, setVerticalPosition] = useState(\n \"down\" as VerticalPosition\n );\n const [horizontalPosition, setHorizontalPosition] = useState(\n \"left\" as HorizontalPosition\n );\n const document = useDocument();\n const window = useWindow();\n\n useLayoutEffect(() => {\n if (!contentRef) return;\n\n if (isActive) {\n const maxHeight = Math.max(\n document.documentElement.clientHeight || 0,\n window.innerHeight || 0\n );\n\n const rect: DOMRect = contentRef.current.getBoundingClientRect();\n const anchorHeight = anchorRef.current.getBoundingClientRect().height;\n const anchorX = anchorRef.current.getBoundingClientRect().x;\n const screenWidth = window.innerWidth;\n\n const isUp = rect.top + rect.height > maxHeight;\n const isDown = rect.top - anchorHeight < rect.height;\n const isLeft = anchorX > screenWidth / 2;\n const isRight = anchorX < screenWidth / 2;\n\n if (isUp) {\n setVerticalPosition(\"up\");\n } else if (isDown) {\n setVerticalPosition(\"down\");\n }\n\n if (isLeft) {\n setHorizontalPosition(\"left\");\n } else if (isRight) {\n setHorizontalPosition(\"right\");\n }\n } else {\n setVerticalPosition(\"down\");\n setHorizontalPosition(\"left\");\n }\n }, [\n anchorRef,\n contentRef,\n document.documentElement.clientHeight,\n isActive,\n window.innerHeight,\n window.innerWidth,\n ]);\n\n return [verticalPosition, horizontalPosition];\n};\n"],"names":["useAutoPosition","anchorRef","contentRef","isActive","verticalPosition","setVerticalPosition","useState","horizontalPosition","setHorizontalPosition","document","useDocument","window","useWindow","useLayoutEffect","maxHeight","Math","max","documentElement","clientHeight","innerHeight","rect","current","getBoundingClientRect","anchorHeight","height","anchorX","x","screenWidth","innerWidth","isUp","top","isDown","isLeft","isRight"],"mappings":";;;;AASO,MAAMA,eAAe,GAAGA,CAC7BC,SAAiC,EACjCC,UAAkC,EAClCC,QAAiB,KACJ;EACb,MAAM,CAACC,gBAAgB,EAAEC,mBAAmB,CAAC,GAAGC,QAAQ,CACtD,MACF,CAAC,CAAA;EACD,MAAM,CAACC,kBAAkB,EAAEC,qBAAqB,CAAC,GAAGF,QAAQ,CAC1D,MACF,CAAC,CAAA;AACD,EAAA,MAAMG,QAAQ,GAAGC,WAAW,EAAE,CAAA;AAC9B,EAAA,MAAMC,MAAM,GAAGC,SAAS,EAAE,CAAA;AAE1BC,EAAAA,eAAe,CAAC,MAAM;IACpB,IAAI,CAACX,UAAU,EAAE,OAAA;AAEjB,IAAA,IAAIC,QAAQ,EAAE;AACZ,MAAA,MAAMW,SAAS,GAAGC,IAAI,CAACC,GAAG,CACxBP,QAAQ,CAACQ,eAAe,CAACC,YAAY,IAAI,CAAC,EAC1CP,MAAM,CAACQ,WAAW,IAAI,CACxB,CAAC,CAAA;MAED,MAAMC,IAAa,GAAGlB,UAAU,CAACmB,OAAO,CAACC,qBAAqB,EAAE,CAAA;MAChE,MAAMC,YAAY,GAAGtB,SAAS,CAACoB,OAAO,CAACC,qBAAqB,EAAE,CAACE,MAAM,CAAA;MACrE,MAAMC,OAAO,GAAGxB,SAAS,CAACoB,OAAO,CAACC,qBAAqB,EAAE,CAACI,CAAC,CAAA;AAC3D,MAAA,MAAMC,WAAW,GAAGhB,MAAM,CAACiB,UAAU,CAAA;MAErC,MAAMC,IAAI,GAAGT,IAAI,CAACU,GAAG,GAAGV,IAAI,CAACI,MAAM,GAAGV,SAAS,CAAA;MAC/C,MAAMiB,MAAM,GAAGX,IAAI,CAACU,GAAG,GAAGP,YAAY,GAAGH,IAAI,CAACI,MAAM,CAAA;AACpD,MAAA,MAAMQ,MAAM,GAAGP,OAAO,GAAGE,WAAW,GAAG,CAAC,CAAA;AACxC,MAAA,MAAMM,OAAO,GAAGR,OAAO,GAAGE,WAAW,GAAG,CAAC,CAAA;AAEzC,MAAA,IAAIE,IAAI,EAAE;QACRxB,mBAAmB,CAAC,IAAI,CAAC,CAAA;OAC1B,MAAM,IAAI0B,MAAM,EAAE;QACjB1B,mBAAmB,CAAC,MAAM,CAAC,CAAA;AAC7B,OAAA;AAEA,MAAA,IAAI2B,MAAM,EAAE;QACVxB,qBAAqB,CAAC,MAAM,CAAC,CAAA;OAC9B,MAAM,IAAIyB,OAAO,EAAE;QAClBzB,qBAAqB,CAAC,OAAO,CAAC,CAAA;AAChC,OAAA;AACF,KAAC,MAAM;MACLH,mBAAmB,CAAC,MAAM,CAAC,CAAA;MAC3BG,qBAAqB,CAAC,MAAM,CAAC,CAAA;AAC/B,KAAA;GACD,EAAE,CACDP,SAAS,EACTC,UAAU,EACVO,QAAQ,CAACQ,eAAe,CAACC,YAAY,EACrCf,QAAQ,EACRQ,MAAM,CAACQ,WAAW,EAClBR,MAAM,CAACiB,UAAU,CAClB,CAAC,CAAA;AAEF,EAAA,OAAO,CAACxB,gBAAgB,EAAEG,kBAAkB,CAAC,CAAA;AAC/C;;;;"}
@@ -1 +0,0 @@
1
- export declare function useDocument(): Document;
@@ -1,6 +0,0 @@
1
- function useDocument() {
2
- return document;
3
- }
4
-
5
- export { useDocument };
6
- //# sourceMappingURL=useDocument.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDocument.js","sources":["../../../../src/shared/useDocument.ts"],"sourcesContent":["export function useDocument(): Document {\n return document;\n}\n"],"names":["useDocument","document"],"mappings":"AAAO,SAASA,WAAWA,GAAa;AACtC,EAAA,OAAOC,QAAQ,CAAA;AACjB;;;;"}
@@ -1,2 +0,0 @@
1
- import React from "react";
2
- export declare function useHover(ref: React.MutableRefObject<any>): boolean;
@@ -1,25 +0,0 @@
1
- import { useState, useEffect } from 'react';
2
-
3
- function useHover(ref) {
4
- const [hovered, setHovered] = useState(false);
5
- const handleMouseOver = () => setHovered(true);
6
- const handleMouseOut = () => setHovered(false);
7
- useEffect(() => {
8
- if (!ref) return undefined;
9
- const node = ref.current;
10
- if (node) {
11
- node.addEventListener("mouseover", handleMouseOver);
12
- node.addEventListener("mouseout", handleMouseOut);
13
- return () => {
14
- node.removeEventListener("mouseover", handleMouseOver);
15
- node.removeEventListener("mouseout", handleMouseOut);
16
- };
17
- }
18
- return undefined;
19
- }, [ref]);
20
- if (!ref) return null;
21
- return hovered;
22
- }
23
-
24
- export { useHover };
25
- //# sourceMappingURL=useHover.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useHover.js","sources":["../../../../src/shared/useHover.ts"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\n\nexport function useHover(ref: React.MutableRefObject<any>): boolean {\n const [hovered, setHovered] = useState(false);\n\n const handleMouseOver = () => setHovered(true);\n const handleMouseOut = () => setHovered(false);\n\n useEffect(() => {\n if (!ref) return undefined;\n const node = ref.current;\n if (node) {\n node.addEventListener(\"mouseover\", handleMouseOver);\n node.addEventListener(\"mouseout\", handleMouseOut);\n\n return () => {\n node.removeEventListener(\"mouseover\", handleMouseOver);\n node.removeEventListener(\"mouseout\", handleMouseOut);\n };\n }\n return undefined;\n }, [ref]);\n\n if (!ref) return null;\n return hovered;\n}\n"],"names":["useHover","ref","hovered","setHovered","useState","handleMouseOver","handleMouseOut","useEffect","undefined","node","current","addEventListener","removeEventListener"],"mappings":";;AAEO,SAASA,QAAQA,CAACC,GAAgC,EAAW;EAClE,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGC,QAAQ,CAAC,KAAK,CAAC,CAAA;AAE7C,EAAA,MAAMC,eAAe,GAAGA,MAAMF,UAAU,CAAC,IAAI,CAAC,CAAA;AAC9C,EAAA,MAAMG,cAAc,GAAGA,MAAMH,UAAU,CAAC,KAAK,CAAC,CAAA;AAE9CI,EAAAA,SAAS,CAAC,MAAM;AACd,IAAA,IAAI,CAACN,GAAG,EAAE,OAAOO,SAAS,CAAA;AAC1B,IAAA,MAAMC,IAAI,GAAGR,GAAG,CAACS,OAAO,CAAA;AACxB,IAAA,IAAID,IAAI,EAAE;AACRA,MAAAA,IAAI,CAACE,gBAAgB,CAAC,WAAW,EAAEN,eAAe,CAAC,CAAA;AACnDI,MAAAA,IAAI,CAACE,gBAAgB,CAAC,UAAU,EAAEL,cAAc,CAAC,CAAA;AAEjD,MAAA,OAAO,MAAM;AACXG,QAAAA,IAAI,CAACG,mBAAmB,CAAC,WAAW,EAAEP,eAAe,CAAC,CAAA;AACtDI,QAAAA,IAAI,CAACG,mBAAmB,CAAC,UAAU,EAAEN,cAAc,CAAC,CAAA;OACrD,CAAA;AACH,KAAA;AACA,IAAA,OAAOE,SAAS,CAAA;AAClB,GAAC,EAAE,CAACP,GAAG,CAAC,CAAC,CAAA;AAET,EAAA,IAAI,CAACA,GAAG,EAAE,OAAO,IAAI,CAAA;AACrB,EAAA,OAAOC,OAAO,CAAA;AAChB;;;;"}
@@ -1,17 +0,0 @@
1
- import { RefObject } from "react";
2
- /**
3
- * useKeyboard handles activation of keyboard hotkeys on a given element.
4
- * @param {Record<string, (e: KeyboardEvent) => {}} config - A map of keyboardEvent code to function.
5
- * @param {RefObject} ref - The element which the keyboard config has to apply on.
6
- * @param {boolean} isActive - A flag to determine when the keyboard config has to be applied.
7
- *
8
- * Example:
9
- * useKeyboard({
10
- * Escape: closeMenu,
11
- * ArrowUp: () => { doSomething() },
12
- * KeyB: () => { console.log("bagi") },
13
- * }, menuRef, menuOpen)
14
- *
15
- * This mean that these keyboard shortcuts will be applied on menuRef when the menu is opened.
16
- */
17
- export declare function useKeyboard(config: Record<string, (e: KeyboardEvent) => void | boolean>, ref: RefObject<any>, isActive: boolean): void;
@@ -1,42 +0,0 @@
1
- import { useEffect } from 'react';
2
- import { useDocument } from './useDocument.js';
3
-
4
- /**
5
- * useKeyboard handles activation of keyboard hotkeys on a given element.
6
- * @param {Record<string, (e: KeyboardEvent) => {}} config - A map of keyboardEvent code to function.
7
- * @param {RefObject} ref - The element which the keyboard config has to apply on.
8
- * @param {boolean} isActive - A flag to determine when the keyboard config has to be applied.
9
- *
10
- * Example:
11
- * useKeyboard({
12
- * Escape: closeMenu,
13
- * ArrowUp: () => { doSomething() },
14
- * KeyB: () => { console.log("bagi") },
15
- * }, menuRef, menuOpen)
16
- *
17
- * This mean that these keyboard shortcuts will be applied on menuRef when the menu is opened.
18
- */
19
-
20
- function useKeyboard(config, ref, isActive) {
21
- const document = useDocument();
22
- const handleKeyboard = event => {
23
- if (!isActive) return;
24
- if (document.activeElement !== ref.current && !ref.current.contains(document.activeElement)) return;
25
- const targetConfigKey = Object.keys(config).find(targetKeys => targetKeys.split(" ").includes(event.code));
26
- if (!targetConfigKey) return;
27
- event.preventDefault();
28
- const res = config[targetConfigKey](event);
29
- if (res === false) {
30
- event.stopPropagation();
31
- }
32
- };
33
- useEffect(() => {
34
- document.addEventListener("keydown", handleKeyboard);
35
- return () => {
36
- document.removeEventListener("keydown", handleKeyboard);
37
- };
38
- });
39
- }
40
-
41
- export { useKeyboard };
42
- //# sourceMappingURL=useKeyboard.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useKeyboard.js","sources":["../../../../src/shared/useKeyboard.ts"],"sourcesContent":["import { useEffect, RefObject } from \"react\";\nimport { useDocument } from \"./useDocument\";\n\n/**\n * useKeyboard handles activation of keyboard hotkeys on a given element.\n * @param {Record<string, (e: KeyboardEvent) => {}} config - A map of keyboardEvent code to function.\n * @param {RefObject} ref - The element which the keyboard config has to apply on.\n * @param {boolean} isActive - A flag to determine when the keyboard config has to be applied.\n *\n * Example:\n * useKeyboard({\n * Escape: closeMenu,\n * ArrowUp: () => { doSomething() },\n * KeyB: () => { console.log(\"bagi\") },\n * }, menuRef, menuOpen)\n *\n * This mean that these keyboard shortcuts will be applied on menuRef when the menu is opened.\n */\n\nexport function useKeyboard(\n config: Record<string, (e: KeyboardEvent) => void | boolean>,\n ref: RefObject<any>,\n isActive: boolean\n): void {\n const document = useDocument();\n const handleKeyboard = (event: KeyboardEvent) => {\n if (!isActive) return;\n\n if (\n document.activeElement !== ref.current &&\n !ref.current.contains(document.activeElement)\n )\n return;\n\n const targetConfigKey = Object.keys(config).find((targetKeys: string) =>\n targetKeys.split(\" \").includes(event.code)\n );\n if (!targetConfigKey) return;\n\n event.preventDefault();\n const res = config[targetConfigKey](event);\n if (res === false) {\n event.stopPropagation();\n }\n };\n\n useEffect(() => {\n document.addEventListener(\"keydown\", handleKeyboard);\n\n return () => {\n document.removeEventListener(\"keydown\", handleKeyboard);\n };\n });\n}\n"],"names":["useKeyboard","config","ref","isActive","document","useDocument","handleKeyboard","event","activeElement","current","contains","targetConfigKey","Object","keys","find","targetKeys","split","includes","code","preventDefault","res","stopPropagation","useEffect","addEventListener","removeEventListener"],"mappings":";;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,SAASA,WAAWA,CACzBC,MAA4D,EAC5DC,GAAmB,EACnBC,QAAiB,EACX;AACN,EAAA,MAAMC,QAAQ,GAAGC,WAAW,EAAE,CAAA;EAC9B,MAAMC,cAAc,GAAIC,KAAoB,IAAK;IAC/C,IAAI,CAACJ,QAAQ,EAAE,OAAA;AAEf,IAAA,IACEC,QAAQ,CAACI,aAAa,KAAKN,GAAG,CAACO,OAAO,IACtC,CAACP,GAAG,CAACO,OAAO,CAACC,QAAQ,CAACN,QAAQ,CAACI,aAAa,CAAC,EAE7C,OAAA;IAEF,MAAMG,eAAe,GAAGC,MAAM,CAACC,IAAI,CAACZ,MAAM,CAAC,CAACa,IAAI,CAAEC,UAAkB,IAClEA,UAAU,CAACC,KAAK,CAAC,GAAG,CAAC,CAACC,QAAQ,CAACV,KAAK,CAACW,IAAI,CAC3C,CAAC,CAAA;IACD,IAAI,CAACP,eAAe,EAAE,OAAA;IAEtBJ,KAAK,CAACY,cAAc,EAAE,CAAA;IACtB,MAAMC,GAAG,GAAGnB,MAAM,CAACU,eAAe,CAAC,CAACJ,KAAK,CAAC,CAAA;IAC1C,IAAIa,GAAG,KAAK,KAAK,EAAE;MACjBb,KAAK,CAACc,eAAe,EAAE,CAAA;AACzB,KAAA;GACD,CAAA;AAEDC,EAAAA,SAAS,CAAC,MAAM;AACdlB,IAAAA,QAAQ,CAACmB,gBAAgB,CAAC,SAAS,EAAEjB,cAAc,CAAC,CAAA;AAEpD,IAAA,OAAO,MAAM;AACXF,MAAAA,QAAQ,CAACoB,mBAAmB,CAAC,SAAS,EAAElB,cAAc,CAAC,CAAA;KACxD,CAAA;AACH,GAAC,CAAC,CAAA;AACJ;;;;"}
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const useOnEscapePress: (onEscape: (e: KeyboardEvent) => void, callbackDependencies?: import("react").DependencyList) => void;
@@ -1,51 +0,0 @@
1
- import { useCallback, useMemo, useEffect } from 'react';
2
- import { useDocument } from './useDocument.js';
3
-
4
- const registry = {};
5
- const handleEscape = event => {
6
- if (!event.defaultPrevented) {
7
- const handlers = Object.values(registry).reverse();
8
- for (let i = 0; i < handlers.length; i += 1) {
9
- const handler = handlers[i];
10
- handler(event);
11
- if (event.defaultPrevented) break;
12
- }
13
- }
14
- };
15
- const register = (id, handler) => {
16
- registry[id] = handler;
17
- };
18
- const deregister = id => {
19
- delete registry[id];
20
- };
21
-
22
- // For auto-incrementing unique identifiers for registered different handlers.
23
- let handlerId = 0;
24
- const useOnEscapePress = function (onEscape) {
25
- let callbackDependencies = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [onEscape];
26
- // eslint-disable-next-line react-hooks/exhaustive-deps
27
- const escapeCallback = useCallback(onEscape, callbackDependencies);
28
- const document = useDocument();
29
- const handler = useCallback(event => {
30
- if (event.key === "Escape") escapeCallback(event);
31
- }, [escapeCallback]);
32
- const id = useMemo(() => {
33
- handlerId += 1;
34
- return handlerId;
35
- }, []);
36
- useEffect(() => {
37
- if (Object.keys(registry).length === 0) {
38
- document.addEventListener("keydown", handleEscape);
39
- }
40
- register(id, handler);
41
- return () => {
42
- deregister(id);
43
- if (Object.keys(registry).length === 0) {
44
- document.removeEventListener("keydown", handleEscape);
45
- }
46
- };
47
- }, [id, handler, document]);
48
- };
49
-
50
- export { useOnEscapePress };
51
- //# sourceMappingURL=useOnEscapePress.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useOnEscapePress.js","sources":["../../../../src/shared/useOnEscapePress.ts"],"sourcesContent":["import { useEffect, useCallback, useMemo } from \"react\";\nimport { useDocument } from \"./useDocument\";\n\ntype KeyboardEventCallback = (event: KeyboardEvent) => void;\n\nconst registry: { [id: number]: KeyboardEventCallback } = {};\n\nconst handleEscape = (event: KeyboardEvent) => {\n if (!event.defaultPrevented) {\n const handlers = Object.values(registry).reverse();\n\n for (let i = 0; i < handlers.length; i += 1) {\n const handler = handlers[i];\n\n handler(event);\n\n if (event.defaultPrevented) break;\n }\n }\n};\n\nconst register = (id: number, handler: KeyboardEventCallback): void => {\n registry[id] = handler;\n};\n\nconst deregister = (id: number) => {\n delete registry[id];\n};\n\n// For auto-incrementing unique identifiers for registered different handlers.\nlet handlerId = 0;\n\nexport const useOnEscapePress = (\n onEscape: (e: KeyboardEvent) => void,\n callbackDependencies: React.DependencyList = [onEscape]\n): void => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const escapeCallback = useCallback(onEscape, callbackDependencies);\n const document = useDocument();\n\n const handler = useCallback<KeyboardEventCallback>(\n (event) => {\n if (event.key === \"Escape\") escapeCallback(event);\n },\n [escapeCallback]\n );\n\n const id = useMemo(() => {\n handlerId += 1;\n return handlerId;\n }, []);\n\n useEffect(() => {\n if (Object.keys(registry).length === 0) {\n document.addEventListener(\"keydown\", handleEscape);\n }\n register(id, handler);\n\n return () => {\n deregister(id);\n if (Object.keys(registry).length === 0) {\n document.removeEventListener(\"keydown\", handleEscape);\n }\n };\n }, [id, handler, document]);\n};\n"],"names":["registry","handleEscape","event","defaultPrevented","handlers","Object","values","reverse","i","length","handler","register","id","deregister","handlerId","useOnEscapePress","onEscape","callbackDependencies","arguments","undefined","escapeCallback","useCallback","document","useDocument","key","useMemo","useEffect","keys","addEventListener","removeEventListener"],"mappings":";;;AAKA,MAAMA,QAAiD,GAAG,EAAE,CAAA;AAE5D,MAAMC,YAAY,GAAIC,KAAoB,IAAK;AAC7C,EAAA,IAAI,CAACA,KAAK,CAACC,gBAAgB,EAAE;IAC3B,MAAMC,QAAQ,GAAGC,MAAM,CAACC,MAAM,CAACN,QAAQ,CAAC,CAACO,OAAO,EAAE,CAAA;AAElD,IAAA,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGJ,QAAQ,CAACK,MAAM,EAAED,CAAC,IAAI,CAAC,EAAE;AAC3C,MAAA,MAAME,OAAO,GAAGN,QAAQ,CAACI,CAAC,CAAC,CAAA;MAE3BE,OAAO,CAACR,KAAK,CAAC,CAAA;MAEd,IAAIA,KAAK,CAACC,gBAAgB,EAAE,MAAA;AAC9B,KAAA;AACF,GAAA;AACF,CAAC,CAAA;AAED,MAAMQ,QAAQ,GAAGA,CAACC,EAAU,EAAEF,OAA8B,KAAW;AACrEV,EAAAA,QAAQ,CAACY,EAAE,CAAC,GAAGF,OAAO,CAAA;AACxB,CAAC,CAAA;AAED,MAAMG,UAAU,GAAID,EAAU,IAAK;EACjC,OAAOZ,QAAQ,CAACY,EAAE,CAAC,CAAA;AACrB,CAAC,CAAA;;AAED;AACA,IAAIE,SAAS,GAAG,CAAC,CAAA;MAEJC,gBAAgB,GAAG,UAC9BC,QAAoC,EAE3B;AAAA,EAAA,IADTC,oBAA0C,GAAAC,SAAA,CAAAT,MAAA,GAAAS,CAAAA,IAAAA,SAAA,CAAAC,CAAAA,CAAAA,KAAAA,SAAA,GAAAD,SAAA,CAAG,CAAA,CAAA,GAAA,CAACF,QAAQ,CAAC,CAAA;AAEvD;AACA,EAAA,MAAMI,cAAc,GAAGC,WAAW,CAACL,QAAQ,EAAEC,oBAAoB,CAAC,CAAA;AAClE,EAAA,MAAMK,QAAQ,GAAGC,WAAW,EAAE,CAAA;AAE9B,EAAA,MAAMb,OAAO,GAAGW,WAAW,CACxBnB,KAAK,IAAK;IACT,IAAIA,KAAK,CAACsB,GAAG,KAAK,QAAQ,EAAEJ,cAAc,CAAClB,KAAK,CAAC,CAAA;AACnD,GAAC,EACD,CAACkB,cAAc,CACjB,CAAC,CAAA;AAED,EAAA,MAAMR,EAAE,GAAGa,OAAO,CAAC,MAAM;AACvBX,IAAAA,SAAS,IAAI,CAAC,CAAA;AACd,IAAA,OAAOA,SAAS,CAAA;GACjB,EAAE,EAAE,CAAC,CAAA;AAENY,EAAAA,SAAS,CAAC,MAAM;IACd,IAAIrB,MAAM,CAACsB,IAAI,CAAC3B,QAAQ,CAAC,CAACS,MAAM,KAAK,CAAC,EAAE;AACtCa,MAAAA,QAAQ,CAACM,gBAAgB,CAAC,SAAS,EAAE3B,YAAY,CAAC,CAAA;AACpD,KAAA;AACAU,IAAAA,QAAQ,CAACC,EAAE,EAAEF,OAAO,CAAC,CAAA;AAErB,IAAA,OAAO,MAAM;MACXG,UAAU,CAACD,EAAE,CAAC,CAAA;MACd,IAAIP,MAAM,CAACsB,IAAI,CAAC3B,QAAQ,CAAC,CAACS,MAAM,KAAK,CAAC,EAAE;AACtCa,QAAAA,QAAQ,CAACO,mBAAmB,CAAC,SAAS,EAAE5B,YAAY,CAAC,CAAA;AACvD,OAAA;KACD,CAAA;GACF,EAAE,CAACW,EAAE,EAAEF,OAAO,EAAEY,QAAQ,CAAC,CAAC,CAAA;AAC7B;;;;"}
@@ -1,11 +0,0 @@
1
- import { RefObject } from "react";
2
- /**
3
- * useOutsideClick handles outside click of a given element.
4
- * @param {RefObject} ref - Reference to a DOM element.
5
- * @param {e: Event) => void} handler - Function invoked when a click is triggered outside the referenced element.
6
- * @param {boolean} isActive - A flag to determine when the outside click event needs to be applied.
7
- *
8
- * Example: useOutsideClick(menuRef, closeMenu, menuIsOpen)
9
- * Means that when a menu is opened, clicking outside of the menu will close the mneu.
10
- */
11
- export declare const useOutsideClick: (ref: RefObject<any>, handler: (e: Event) => void, isActive: boolean) => void;
@@ -1,32 +0,0 @@
1
- import { useCallback, useEffect } from 'react';
2
- import { useWindow } from './useWindow.js';
3
-
4
- /**
5
- * useOutsideClick handles outside click of a given element.
6
- * @param {RefObject} ref - Reference to a DOM element.
7
- * @param {e: Event) => void} handler - Function invoked when a click is triggered outside the referenced element.
8
- * @param {boolean} isActive - A flag to determine when the outside click event needs to be applied.
9
- *
10
- * Example: useOutsideClick(menuRef, closeMenu, menuIsOpen)
11
- * Means that when a menu is opened, clicking outside of the menu will close the mneu.
12
- */
13
-
14
- const useOutsideClick = (ref, handler, isActive) => {
15
- const window = useWindow();
16
- const outsideClickEvent = useCallback(e => {
17
- if (ref && ref.current && !ref.current.contains(e.target)) {
18
- handler(e);
19
- }
20
- }, [handler, ref]);
21
- useEffect(() => {
22
- if (isActive) {
23
- window.addEventListener("click", outsideClickEvent);
24
- }
25
- return () => {
26
- window.removeEventListener("click", outsideClickEvent);
27
- };
28
- }, [isActive, window, outsideClickEvent]);
29
- };
30
-
31
- export { useOutsideClick };
32
- //# sourceMappingURL=useOutsideClick.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useOutsideClick.js","sources":["../../../../src/shared/useOutsideClick.ts"],"sourcesContent":["import { useEffect, useCallback, RefObject } from \"react\";\n\nimport { useWindow } from \"./useWindow\";\n\n/**\n * useOutsideClick handles outside click of a given element.\n * @param {RefObject} ref - Reference to a DOM element.\n * @param {e: Event) => void} handler - Function invoked when a click is triggered outside the referenced element.\n * @param {boolean} isActive - A flag to determine when the outside click event needs to be applied.\n *\n * Example: useOutsideClick(menuRef, closeMenu, menuIsOpen)\n * Means that when a menu is opened, clicking outside of the menu will close the mneu.\n */\n\nexport const useOutsideClick = (\n ref: RefObject<any>,\n handler: (e: Event) => void,\n isActive: boolean\n): void => {\n const window = useWindow();\n\n const outsideClickEvent = useCallback(\n (e: Event) => {\n if (ref && ref.current && !ref.current.contains(e.target)) {\n handler(e);\n }\n },\n [handler, ref]\n );\n\n useEffect(() => {\n if (isActive) {\n window.addEventListener(\"click\", outsideClickEvent);\n }\n\n return () => {\n window.removeEventListener(\"click\", outsideClickEvent);\n };\n }, [isActive, window, outsideClickEvent]);\n};\n"],"names":["useOutsideClick","ref","handler","isActive","window","useWindow","outsideClickEvent","useCallback","e","current","contains","target","useEffect","addEventListener","removeEventListener"],"mappings":";;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,MAAMA,eAAe,GAAGA,CAC7BC,GAAmB,EACnBC,OAA2B,EAC3BC,QAAiB,KACR;AACT,EAAA,MAAMC,MAAM,GAAGC,SAAS,EAAE,CAAA;AAE1B,EAAA,MAAMC,iBAAiB,GAAGC,WAAW,CAClCC,CAAQ,IAAK;AACZ,IAAA,IAAIP,GAAG,IAAIA,GAAG,CAACQ,OAAO,IAAI,CAACR,GAAG,CAACQ,OAAO,CAACC,QAAQ,CAACF,CAAC,CAACG,MAAM,CAAC,EAAE;MACzDT,OAAO,CAACM,CAAC,CAAC,CAAA;AACZ,KAAA;AACF,GAAC,EACD,CAACN,OAAO,EAAED,GAAG,CACf,CAAC,CAAA;AAEDW,EAAAA,SAAS,CAAC,MAAM;AACd,IAAA,IAAIT,QAAQ,EAAE;AACZC,MAAAA,MAAM,CAACS,gBAAgB,CAAC,OAAO,EAAEP,iBAAiB,CAAC,CAAA;AACrD,KAAA;AAEA,IAAA,OAAO,MAAM;AACXF,MAAAA,MAAM,CAACU,mBAAmB,CAAC,OAAO,EAAER,iBAAiB,CAAC,CAAA;KACvD,CAAA;GACF,EAAE,CAACH,QAAQ,EAAEC,MAAM,EAAEE,iBAAiB,CAAC,CAAC,CAAA;AAC3C;;;;"}
@@ -1 +0,0 @@
1
- export declare function useWindow(): Window;
@@ -1,6 +0,0 @@
1
- function useWindow() {
2
- return window;
3
- }
4
-
5
- export { useWindow };
6
- //# sourceMappingURL=useWindow.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useWindow.js","sources":["../../../../src/shared/useWindow.ts"],"sourcesContent":["export function useWindow(): Window {\n return window;\n}\n"],"names":["useWindow","window"],"mappings":"AAAO,SAASA,SAASA,GAAW;AAClC,EAAA,OAAOC,MAAM,CAAA;AACf;;;;"}
@@ -1,57 +0,0 @@
1
- /// <reference types="react" />
2
- import { Literal, Union, Static } from "runtypes";
3
- export declare const LinkTextSizeRuntype: Union<[Literal<"xs">, Literal<"s">, Literal<"m">, Literal<"l">]>;
4
- export declare type LinkTextSize = Static<typeof LinkTextSizeRuntype>;
5
- export declare const TextSizeRuntype: Union<[Literal<"xs">, Literal<"s">, Literal<"m">]>;
6
- export declare type TextSize = Static<typeof TextSizeRuntype>;
7
- export declare const BorderRadiusRuntype: Union<[Literal<"xs">, Literal<"s">, Literal<"m">]>;
8
- export declare type BorderRadius = Static<typeof BorderRadiusRuntype>;
9
- export declare const TextAlignmentRuntype: Union<[Literal<"left">, Literal<"right">, Literal<"center">]>;
10
- export declare type TextAlignment = Static<typeof TextAlignmentRuntype>;
11
- export declare const HorizontalAlignmentRuntype: Union<[Literal<"left">, Literal<"right">, Literal<"center">, Literal<"spaceBetween">]>;
12
- export declare type HorizontalAlignment = Static<typeof HorizontalAlignmentRuntype>;
13
- export declare const VerticalAlignmentRuntype: Union<[Literal<"top">, Literal<"bottom">, Literal<"center">, Literal<"stretch">]>;
14
- export declare type VerticalAlignment = Static<typeof VerticalAlignmentRuntype>;
15
- export declare const SpaceSizesRuntype: Union<[Literal<"zero">, Literal<"xxs">, Literal<"xs">, Literal<"s">, Literal<"m">, Literal<"l">, Literal<"xl">, Literal<"xxl">]>;
16
- export declare type SpaceSizes = Static<typeof SpaceSizesRuntype>;
17
- export declare const ColumsSizesRuntype: Union<[Literal<1>, Literal<2>, Literal<3>, Literal<4>, Literal<5>, Literal<6>, Literal<7>, Literal<8>, Literal<9>, Literal<10>, Literal<11>, Literal<12>, Literal<"auto">, Literal<"narrow">, Literal<"fill">]>;
18
- export declare type ColumnSizes = Static<typeof ColumsSizesRuntype>;
19
- export declare const ColumnAlignmentRunType: Union<[Literal<"auto">, Literal<"start">, Literal<"center">, Literal<"end">]>;
20
- export declare type ColumnAlignment = Static<typeof ColumnAlignmentRunType>;
21
- export declare const OrderRuntype: Union<[Literal<"first">, Literal<"last">, Literal<"unset">]>;
22
- export declare type Order = Static<typeof OrderRuntype>;
23
- export declare const BaseVariationsRuntype: Union<[Literal<"primary">, Literal<"secondary">, Literal<"tertiary">]>;
24
- export declare const BaseColorsRuntype: Union<[Union<[Literal<"primary">, Literal<"secondary">, Literal<"tertiary">]>, Literal<"accent">]>;
25
- export declare type BaseVariations = Static<typeof BaseVariationsRuntype>;
26
- export declare type BaseColors = Static<typeof BaseColorsRuntype>;
27
- declare const TextColorsRuntype: Union<[Union<[Union<[Literal<"primary">, Literal<"secondary">, Literal<"tertiary">]>, Literal<"accent">]>, Literal<"info">, Literal<"error">, Literal<"warning">]>;
28
- export declare type TextColors = Static<typeof TextColorsRuntype>;
29
- declare const TextVariationsRuntype: Union<[Union<[Literal<"primary">, Literal<"secondary">, Literal<"tertiary">]>, Literal<"info">, Literal<"error">, Literal<"warning">]>;
30
- export declare type TextVariations = Static<typeof TextVariationsRuntype>;
31
- declare const IconsColorsRuntime: Union<[Union<[Union<[Literal<"primary">, Literal<"secondary">, Literal<"tertiary">]>, Literal<"accent">]>, Literal<"info">, Literal<"error">, Literal<"warning">, Literal<"inherit">, Literal<"brand">, Literal<"quaternary">]>;
32
- export declare type IconsColors = Static<typeof IconsColorsRuntime>;
33
- declare const IconsVariationsRuntype: Union<[Union<[Literal<"primary">, Literal<"secondary">, Literal<"tertiary">]>, Literal<"info">, Literal<"error">, Literal<"warning">, Literal<"inherit">, Literal<"brand">]>;
34
- export declare type IconsVariations = Static<typeof IconsVariationsRuntype>;
35
- declare const CalloutVariationsRuntype: Union<[Literal<"info">, Literal<"success">, Literal<"error">, Literal<"warning">]>;
36
- export declare type CalloutVariations = Static<typeof CalloutVariationsRuntype>;
37
- declare const LinkVariationsRuntype: Union<[Union<[Literal<"primary">, Literal<"secondary">, Literal<"tertiary">]>]>;
38
- export declare type LinkVariations = Static<typeof LinkVariationsRuntype>;
39
- declare const LinkColorsRuntype: Union<[Union<[Union<[Literal<"primary">, Literal<"secondary">, Literal<"tertiary">]>, Literal<"accent">]>]>;
40
- export declare type LinkColors = Static<typeof LinkColorsRuntype>;
41
- export declare type MQ<T> = [T, T?, T?];
42
- declare const ButtonSizeRuntype: Union<[Literal<"s">, Literal<"m">, Literal<"l">]>;
43
- export declare type ButtonSize = Static<typeof ButtonSizeRuntype>;
44
- export declare const HyphensRuntype: Union<[Literal<"auto">, Literal<"none">, Literal<"manual">]>;
45
- export declare type Hyphens = Static<typeof HyphensRuntype>;
46
- export declare const ToggleSizeRuntype: Union<[Literal<"s">, Literal<"m">]>;
47
- export declare type ToggleSize = Static<typeof ToggleSizeRuntype>;
48
- export declare type AsProp<C extends React.ElementType> = {
49
- as?: C;
50
- };
51
- declare type PropsToOmit<C extends React.ElementType, P> = keyof (AsProp<C> & P);
52
- export declare type PolymorphicComponentProps<C extends React.ElementType, Props> = React.PropsWithChildren<Props & AsProp<C>> & Omit<React.ComponentPropsWithoutRef<C>, PropsToOmit<C, Props>>;
53
- export declare type PolymorphicRef<C extends React.ElementType> = React.ComponentPropsWithRef<C>["ref"];
54
- export declare type PolymorphicComponentPropsWithRef<C extends React.ElementType, Props> = PolymorphicComponentProps<C, Props> & {
55
- ref?: PolymorphicRef<C>;
56
- };
57
- export {};