@itwin/core-react 4.1.0-dev.0 → 4.1.0-dev.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 (685) hide show
  1. package/CHANGELOG.md +32 -7
  2. package/lib/cjs/core-react/UiCore.js.map +1 -1
  3. package/lib/cjs/core-react/_geometry.scss +70 -70
  4. package/lib/cjs/core-react/_helpers.scss +51 -51
  5. package/lib/cjs/core-react/_math.scss +13 -13
  6. package/lib/cjs/core-react/_scrollbar.scss +51 -51
  7. package/lib/cjs/core-react/_typography.scss +44 -44
  8. package/lib/cjs/core-react/_z-index.scss +65 -65
  9. package/lib/cjs/core-react/autosuggest/AutoSuggest.d.ts +1 -1
  10. package/lib/cjs/core-react/autosuggest/AutoSuggest.d.ts.map +1 -1
  11. package/lib/cjs/core-react/autosuggest/AutoSuggest.js.map +1 -1
  12. package/lib/cjs/core-react/autosuggest/AutoSuggest.scss +79 -79
  13. package/lib/cjs/core-react/badge/Badge.d.ts +1 -1
  14. package/lib/cjs/core-react/badge/Badge.d.ts.map +1 -1
  15. package/lib/cjs/core-react/badge/Badge.js.map +1 -1
  16. package/lib/cjs/core-react/badge/Badge.scss +13 -13
  17. package/lib/cjs/core-react/badge/BadgeUtilities.js.map +1 -1
  18. package/lib/cjs/core-react/badge/BetaBadge.d.ts +1 -1
  19. package/lib/cjs/core-react/badge/BetaBadge.d.ts.map +1 -1
  20. package/lib/cjs/core-react/badge/BetaBadge.js.map +1 -1
  21. package/lib/cjs/core-react/badge/NewBadge.d.ts +1 -1
  22. package/lib/cjs/core-react/badge/NewBadge.d.ts.map +1 -1
  23. package/lib/cjs/core-react/badge/NewBadge.js.map +1 -1
  24. package/lib/cjs/core-react/badge/NewBadge.scss +9 -9
  25. package/lib/cjs/core-react/base/Centered.d.ts +1 -1
  26. package/lib/cjs/core-react/base/Centered.d.ts.map +1 -1
  27. package/lib/cjs/core-react/base/Centered.js.map +1 -1
  28. package/lib/cjs/core-react/base/Div.d.ts +1 -1
  29. package/lib/cjs/core-react/base/Div.d.ts.map +1 -1
  30. package/lib/cjs/core-react/base/Div.js.map +1 -1
  31. package/lib/cjs/core-react/base/DivWithOutsideClick.d.ts +1 -1
  32. package/lib/cjs/core-react/base/DivWithOutsideClick.d.ts.map +1 -1
  33. package/lib/cjs/core-react/base/DivWithOutsideClick.js.map +1 -1
  34. package/lib/cjs/core-react/base/FillCentered.d.ts +1 -1
  35. package/lib/cjs/core-react/base/FillCentered.d.ts.map +1 -1
  36. package/lib/cjs/core-react/base/FillCentered.js.map +1 -1
  37. package/lib/cjs/core-react/base/FlexWrapContainer.d.ts +1 -1
  38. package/lib/cjs/core-react/base/FlexWrapContainer.d.ts.map +1 -1
  39. package/lib/cjs/core-react/base/FlexWrapContainer.js.map +1 -1
  40. package/lib/cjs/core-react/base/Gap.d.ts +1 -1
  41. package/lib/cjs/core-react/base/Gap.d.ts.map +1 -1
  42. package/lib/cjs/core-react/base/Gap.js +1 -1
  43. package/lib/cjs/core-react/base/Gap.js.map +1 -1
  44. package/lib/cjs/core-react/base/PointerEvents.js.map +1 -1
  45. package/lib/cjs/core-react/base/ScrollView.d.ts +1 -1
  46. package/lib/cjs/core-react/base/ScrollView.d.ts.map +1 -1
  47. package/lib/cjs/core-react/base/ScrollView.js.map +1 -1
  48. package/lib/cjs/core-react/base/base.scss +42 -42
  49. package/lib/cjs/core-react/base/classes.scss +13 -13
  50. package/lib/cjs/core-react/base/index.scss +5 -5
  51. package/lib/cjs/core-react/button/UnderlinedButton.js.map +1 -1
  52. package/lib/cjs/core-react/button/UnderlinedButton.scss +32 -32
  53. package/lib/cjs/core-react/checklistbox/CheckListBox.d.ts +1 -1
  54. package/lib/cjs/core-react/checklistbox/CheckListBox.d.ts.map +1 -1
  55. package/lib/cjs/core-react/checklistbox/CheckListBox.js.map +1 -1
  56. package/lib/cjs/core-react/checklistbox/CheckListBox.scss +21 -21
  57. package/lib/cjs/core-react/classes.scss +11 -11
  58. package/lib/cjs/core-react/colorthemes.scss +61 -61
  59. package/lib/cjs/core-react/colorvariables.scss +131 -131
  60. package/lib/cjs/core-react/contextmenu/ContextMenu.d.ts +1 -1
  61. package/lib/cjs/core-react/contextmenu/ContextMenu.d.ts.map +1 -1
  62. package/lib/cjs/core-react/contextmenu/ContextMenu.js +2 -1
  63. package/lib/cjs/core-react/contextmenu/ContextMenu.js.map +1 -1
  64. package/lib/cjs/core-react/contextmenu/ContextMenu.scss +236 -236
  65. package/lib/cjs/core-react/contextmenu/ContextMenuDirection.js.map +1 -1
  66. package/lib/cjs/core-react/contextmenu/ContextMenuDivider.d.ts +1 -1
  67. package/lib/cjs/core-react/contextmenu/ContextMenuDivider.d.ts.map +1 -1
  68. package/lib/cjs/core-react/contextmenu/ContextMenuDivider.js.map +1 -1
  69. package/lib/cjs/core-react/contextmenu/ContextMenuItem.d.ts +5 -4
  70. package/lib/cjs/core-react/contextmenu/ContextMenuItem.d.ts.map +1 -1
  71. package/lib/cjs/core-react/contextmenu/ContextMenuItem.js.map +1 -1
  72. package/lib/cjs/core-react/contextmenu/ContextSubMenu.d.ts +3 -3
  73. package/lib/cjs/core-react/contextmenu/ContextSubMenu.d.ts.map +1 -1
  74. package/lib/cjs/core-react/contextmenu/ContextSubMenu.js.map +1 -1
  75. package/lib/cjs/core-react/contextmenu/GlobalContextMenu.d.ts +1 -1
  76. package/lib/cjs/core-react/contextmenu/GlobalContextMenu.d.ts.map +1 -1
  77. package/lib/cjs/core-react/contextmenu/GlobalContextMenu.js +5 -3
  78. package/lib/cjs/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
  79. package/lib/cjs/core-react/contextmenu/PopupContextMenu.d.ts +1 -1
  80. package/lib/cjs/core-react/contextmenu/PopupContextMenu.d.ts.map +1 -1
  81. package/lib/cjs/core-react/contextmenu/PopupContextMenu.js.map +1 -1
  82. package/lib/cjs/core-react/contextmenu/TildeFinder.js.map +1 -1
  83. package/lib/cjs/core-react/dialog/Dialog.d.ts +3 -3
  84. package/lib/cjs/core-react/dialog/Dialog.d.ts.map +1 -1
  85. package/lib/cjs/core-react/dialog/Dialog.js +2 -1
  86. package/lib/cjs/core-react/dialog/Dialog.js.map +1 -1
  87. package/lib/cjs/core-react/dialog/Dialog.scss +245 -245
  88. package/lib/cjs/core-react/dialog/GlobalDialog.d.ts +1 -1
  89. package/lib/cjs/core-react/dialog/GlobalDialog.d.ts.map +1 -1
  90. package/lib/cjs/core-react/dialog/GlobalDialog.js +2 -1
  91. package/lib/cjs/core-react/dialog/GlobalDialog.js.map +1 -1
  92. package/lib/cjs/core-react/elementseparator/ElementSeparator.d.ts +1 -1
  93. package/lib/cjs/core-react/elementseparator/ElementSeparator.d.ts.map +1 -1
  94. package/lib/cjs/core-react/elementseparator/ElementSeparator.js +2 -2
  95. package/lib/cjs/core-react/elementseparator/ElementSeparator.js.map +1 -1
  96. package/lib/cjs/core-react/elementseparator/ElementSeparator.scss +85 -85
  97. package/lib/cjs/core-react/enums/Alignment.js.map +1 -1
  98. package/lib/cjs/core-react/enums/CheckBoxState.js.map +1 -1
  99. package/lib/cjs/core-react/enums/Orientation.js.map +1 -1
  100. package/lib/cjs/core-react/enums/SortDirection.js.map +1 -1
  101. package/lib/cjs/core-react/enums/TimeFormat.js.map +1 -1
  102. package/lib/cjs/core-react/expandable/ExpandableList.d.ts +1 -1
  103. package/lib/cjs/core-react/expandable/ExpandableList.d.ts.map +1 -1
  104. package/lib/cjs/core-react/expandable/ExpandableList.js.map +1 -1
  105. package/lib/cjs/core-react/expandable/ExpandableList.scss +8 -8
  106. package/lib/cjs/core-react/expandable/classes.scss +7 -7
  107. package/lib/cjs/core-react/expandable/index.scss +5 -5
  108. package/lib/cjs/core-react/expandable/list.scss +35 -35
  109. package/lib/cjs/core-react/focus/ItemKeyboardNavigator.js.map +1 -1
  110. package/lib/cjs/core-react/focustrap/FocusTrap.js.map +1 -1
  111. package/lib/cjs/core-react/hocs/withIsPressed.js.map +1 -1
  112. package/lib/cjs/core-react/hocs/withOnOutsideClick.js +2 -1
  113. package/lib/cjs/core-react/hocs/withOnOutsideClick.js.map +1 -1
  114. package/lib/cjs/core-react/hocs/withTimeout.js.map +1 -1
  115. package/lib/cjs/core-react/icons/ConditionalIconItem.d.ts +1 -1
  116. package/lib/cjs/core-react/icons/ConditionalIconItem.d.ts.map +1 -1
  117. package/lib/cjs/core-react/icons/ConditionalIconItem.js.map +1 -1
  118. package/lib/cjs/core-react/icons/IconComponent.d.ts +2 -2
  119. package/lib/cjs/core-react/icons/IconComponent.d.ts.map +1 -1
  120. package/lib/cjs/core-react/icons/IconComponent.js +1 -1
  121. package/lib/cjs/core-react/icons/IconComponent.js.map +1 -1
  122. package/lib/cjs/core-react/icons/IconComponent.scss +20 -20
  123. package/lib/cjs/core-react/icons/SvgPath.d.ts +1 -1
  124. package/lib/cjs/core-react/icons/SvgPath.d.ts.map +1 -1
  125. package/lib/cjs/core-react/icons/SvgPath.js.map +1 -1
  126. package/lib/cjs/core-react/icons/SvgPath.scss +15 -15
  127. package/lib/cjs/core-react/icons/WebFontIcon.d.ts +1 -1
  128. package/lib/cjs/core-react/icons/WebFontIcon.d.ts.map +1 -1
  129. package/lib/cjs/core-react/icons/WebFontIcon.js.map +1 -1
  130. package/lib/cjs/core-react/icons/WebFontIcon.scss +17 -17
  131. package/lib/cjs/core-react/icons/classes.scss +10 -10
  132. package/lib/cjs/core-react/icons/index.scss +6 -6
  133. package/lib/cjs/core-react/icons/mixins.scss +25 -25
  134. package/lib/cjs/core-react/icons/variables.scss +12 -12
  135. package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.d.ts +1 -1
  136. package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.d.ts.map +1 -1
  137. package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.js.map +1 -1
  138. package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.scss +54 -54
  139. package/lib/cjs/core-react/index.scss +21 -21
  140. package/lib/cjs/core-react/inputs/Input.d.ts +1 -1
  141. package/lib/cjs/core-react/inputs/Input.d.ts.map +1 -1
  142. package/lib/cjs/core-react/inputs/Input.js.map +1 -1
  143. package/lib/cjs/core-react/inputs/InputLabel.d.ts +2 -2
  144. package/lib/cjs/core-react/inputs/InputLabel.d.ts.map +1 -1
  145. package/lib/cjs/core-react/inputs/InputLabel.js.map +1 -1
  146. package/lib/cjs/core-react/inputs/InputStatus.js.map +1 -1
  147. package/lib/cjs/core-react/inputs/LabeledComponentProps.d.ts +2 -2
  148. package/lib/cjs/core-react/inputs/LabeledComponentProps.d.ts.map +1 -1
  149. package/lib/cjs/core-react/inputs/LabeledComponentProps.js.map +1 -1
  150. package/lib/cjs/core-react/inputs/classes.scss +8 -8
  151. package/lib/cjs/core-react/inputs/iconinput/IconInput.d.ts +1 -1
  152. package/lib/cjs/core-react/inputs/iconinput/IconInput.d.ts.map +1 -1
  153. package/lib/cjs/core-react/inputs/iconinput/IconInput.js.map +1 -1
  154. package/lib/cjs/core-react/inputs/iconinput/IconInput.scss +35 -35
  155. package/lib/cjs/core-react/inputs/index.scss +9 -9
  156. package/lib/cjs/core-react/inputs/input-label.scss +90 -90
  157. package/lib/cjs/core-react/inputs/input.scss +58 -58
  158. package/lib/cjs/core-react/inputs/numberinput/NumberInput.d.ts +1 -1
  159. package/lib/cjs/core-react/inputs/numberinput/NumberInput.d.ts.map +1 -1
  160. package/lib/cjs/core-react/inputs/numberinput/NumberInput.js.map +1 -1
  161. package/lib/cjs/core-react/inputs/numberinput/NumberInput.scss +88 -88
  162. package/lib/cjs/core-react/inputs/variables.scss +38 -38
  163. package/lib/cjs/core-react/layout-variables.scss +17 -17
  164. package/lib/cjs/core-react/listbox/Listbox.js +3 -2
  165. package/lib/cjs/core-react/listbox/Listbox.js.map +1 -1
  166. package/lib/cjs/core-react/listbox/Listbox.scss +54 -54
  167. package/lib/cjs/core-react/loading/LoadingBar.d.ts +1 -1
  168. package/lib/cjs/core-react/loading/LoadingBar.d.ts.map +1 -1
  169. package/lib/cjs/core-react/loading/LoadingBar.js.map +1 -1
  170. package/lib/cjs/core-react/loading/LoadingBar.scss +29 -29
  171. package/lib/cjs/core-react/loading/LoadingPrompt.d.ts +1 -1
  172. package/lib/cjs/core-react/loading/LoadingPrompt.d.ts.map +1 -1
  173. package/lib/cjs/core-react/loading/LoadingPrompt.js.map +1 -1
  174. package/lib/cjs/core-react/loading/LoadingPrompt.scss +33 -33
  175. package/lib/cjs/core-react/loading/LoadingSpinner.d.ts +1 -1
  176. package/lib/cjs/core-react/loading/LoadingSpinner.d.ts.map +1 -1
  177. package/lib/cjs/core-react/loading/LoadingSpinner.js.map +1 -1
  178. package/lib/cjs/core-react/loading/LoadingSpinner.scss +26 -26
  179. package/lib/cjs/core-react/loading/LoadingStatus.d.ts +1 -1
  180. package/lib/cjs/core-react/loading/LoadingStatus.d.ts.map +1 -1
  181. package/lib/cjs/core-react/loading/LoadingStatus.js.map +1 -1
  182. package/lib/cjs/core-react/loading/LoadingStatus.scss +20 -20
  183. package/lib/cjs/core-react/loading/index.scss +5 -5
  184. package/lib/cjs/core-react/loading/mixins.scss +57 -57
  185. package/lib/cjs/core-react/messagebox/MessageBox.d.ts +4 -3
  186. package/lib/cjs/core-react/messagebox/MessageBox.d.ts.map +1 -1
  187. package/lib/cjs/core-react/messagebox/MessageBox.js.map +1 -1
  188. package/lib/cjs/core-react/messagebox/MessageBox.scss +56 -56
  189. package/lib/cjs/core-react/notification/MessageRenderer.d.ts +2 -2
  190. package/lib/cjs/core-react/notification/MessageRenderer.d.ts.map +1 -1
  191. package/lib/cjs/core-react/notification/MessageRenderer.js +1 -1
  192. package/lib/cjs/core-react/notification/MessageRenderer.js.map +1 -1
  193. package/lib/cjs/core-react/notification/MessageType.d.ts +1 -1
  194. package/lib/cjs/core-react/notification/MessageType.d.ts.map +1 -1
  195. package/lib/cjs/core-react/notification/MessageType.js.map +1 -1
  196. package/lib/cjs/core-react/popup/Popup.d.ts +1 -1
  197. package/lib/cjs/core-react/popup/Popup.d.ts.map +1 -1
  198. package/lib/cjs/core-react/popup/Popup.js +8 -4
  199. package/lib/cjs/core-react/popup/Popup.js.map +1 -1
  200. package/lib/cjs/core-react/popup/Popup.scss +240 -240
  201. package/lib/cjs/core-react/radialmenu/Annulus.js.map +1 -1
  202. package/lib/cjs/core-react/radialmenu/RadialMenu.d.ts +2 -2
  203. package/lib/cjs/core-react/radialmenu/RadialMenu.d.ts.map +1 -1
  204. package/lib/cjs/core-react/radialmenu/RadialMenu.js.map +1 -1
  205. package/lib/cjs/core-react/radialmenu/RadialMenu.scss +55 -55
  206. package/lib/cjs/core-react/searchbox/SearchBox.d.ts +1 -1
  207. package/lib/cjs/core-react/searchbox/SearchBox.d.ts.map +1 -1
  208. package/lib/cjs/core-react/searchbox/SearchBox.js.map +1 -1
  209. package/lib/cjs/core-react/searchbox/SearchBox.scss +47 -47
  210. package/lib/cjs/core-react/settings/SettingsContainer.d.ts +1 -1
  211. package/lib/cjs/core-react/settings/SettingsContainer.d.ts.map +1 -1
  212. package/lib/cjs/core-react/settings/SettingsContainer.js.map +1 -1
  213. package/lib/cjs/core-react/settings/SettingsContainer.scss +68 -68
  214. package/lib/cjs/core-react/settings/SettingsManager.d.ts +1 -1
  215. package/lib/cjs/core-react/settings/SettingsManager.d.ts.map +1 -1
  216. package/lib/cjs/core-react/settings/SettingsManager.js.map +1 -1
  217. package/lib/cjs/core-react/style/baseline.scss +11 -11
  218. package/lib/cjs/core-react/style/breakpoints.scss +41 -41
  219. package/lib/cjs/core-react/style/colors.scss +77 -77
  220. package/lib/cjs/core-react/style/index.scss +10 -10
  221. package/lib/cjs/core-react/style/mixins.scss +27 -27
  222. package/lib/cjs/core-react/style/opacity.scss +16 -16
  223. package/lib/cjs/core-react/style/themecolors.scss +123 -123
  224. package/lib/cjs/core-react/tabs/Tabs.d.ts +1 -1
  225. package/lib/cjs/core-react/tabs/Tabs.d.ts.map +1 -1
  226. package/lib/cjs/core-react/tabs/Tabs.js.map +1 -1
  227. package/lib/cjs/core-react/tabs/VerticalTabs.d.ts +1 -1
  228. package/lib/cjs/core-react/tabs/VerticalTabs.d.ts.map +1 -1
  229. package/lib/cjs/core-react/tabs/VerticalTabs.js.map +1 -1
  230. package/lib/cjs/core-react/tabs/classes.scss +7 -7
  231. package/lib/cjs/core-react/tabs/index.scss +5 -5
  232. package/lib/cjs/core-react/tabs/tabs.scss +96 -96
  233. package/lib/cjs/core-react/tabs/vertical.scss +51 -51
  234. package/lib/cjs/core-react/text/BlockText.d.ts +1 -1
  235. package/lib/cjs/core-react/text/BlockText.d.ts.map +1 -1
  236. package/lib/cjs/core-react/text/BlockText.js.map +1 -1
  237. package/lib/cjs/core-react/text/BodyText.d.ts +1 -1
  238. package/lib/cjs/core-react/text/BodyText.d.ts.map +1 -1
  239. package/lib/cjs/core-react/text/BodyText.js.map +1 -1
  240. package/lib/cjs/core-react/text/DisabledText.d.ts +1 -1
  241. package/lib/cjs/core-react/text/DisabledText.d.ts.map +1 -1
  242. package/lib/cjs/core-react/text/DisabledText.js.map +1 -1
  243. package/lib/cjs/core-react/text/FilteredText.d.ts +2 -2
  244. package/lib/cjs/core-react/text/FilteredText.d.ts.map +1 -1
  245. package/lib/cjs/core-react/text/FilteredText.js.map +1 -1
  246. package/lib/cjs/core-react/text/FilteredText.scss +10 -10
  247. package/lib/cjs/core-react/text/MutedText.d.ts +1 -1
  248. package/lib/cjs/core-react/text/MutedText.d.ts.map +1 -1
  249. package/lib/cjs/core-react/text/MutedText.js.map +1 -1
  250. package/lib/cjs/core-react/text/StyledText.d.ts +1 -1
  251. package/lib/cjs/core-react/text/StyledText.d.ts.map +1 -1
  252. package/lib/cjs/core-react/text/StyledText.js.map +1 -1
  253. package/lib/cjs/core-react/text/TextProps.d.ts +2 -2
  254. package/lib/cjs/core-react/text/TextProps.d.ts.map +1 -1
  255. package/lib/cjs/core-react/text/TextProps.js.map +1 -1
  256. package/lib/cjs/core-react/text/block.scss +15 -15
  257. package/lib/cjs/core-react/text/body.scss +13 -13
  258. package/lib/cjs/core-react/text/classes.scss +10 -10
  259. package/lib/cjs/core-react/text/disabled.scss +10 -10
  260. package/lib/cjs/core-react/text/index.scss +10 -10
  261. package/lib/cjs/core-react/text/mixins.scss +24 -24
  262. package/lib/cjs/core-react/text/muted.scss +10 -10
  263. package/lib/cjs/core-react/tree/Branch.d.ts +1 -1
  264. package/lib/cjs/core-react/tree/Branch.d.ts.map +1 -1
  265. package/lib/cjs/core-react/tree/Branch.js.map +1 -1
  266. package/lib/cjs/core-react/tree/Branch.scss +12 -12
  267. package/lib/cjs/core-react/tree/ExpansionToggle.d.ts +1 -1
  268. package/lib/cjs/core-react/tree/ExpansionToggle.d.ts.map +1 -1
  269. package/lib/cjs/core-react/tree/ExpansionToggle.js.map +1 -1
  270. package/lib/cjs/core-react/tree/ExpansionToggle.scss +32 -32
  271. package/lib/cjs/core-react/tree/Node.d.ts +3 -3
  272. package/lib/cjs/core-react/tree/Node.d.ts.map +1 -1
  273. package/lib/cjs/core-react/tree/Node.js +2 -1
  274. package/lib/cjs/core-react/tree/Node.js.map +1 -1
  275. package/lib/cjs/core-react/tree/Node.scss +68 -68
  276. package/lib/cjs/core-react/tree/Placeholder.d.ts +1 -1
  277. package/lib/cjs/core-react/tree/Placeholder.d.ts.map +1 -1
  278. package/lib/cjs/core-react/tree/Placeholder.js.map +1 -1
  279. package/lib/cjs/core-react/tree/Placeholder.scss +17 -17
  280. package/lib/cjs/core-react/tree/Tree.d.ts +1 -1
  281. package/lib/cjs/core-react/tree/Tree.d.ts.map +1 -1
  282. package/lib/cjs/core-react/tree/Tree.js.map +1 -1
  283. package/lib/cjs/core-react/tree/Tree.scss +21 -21
  284. package/lib/cjs/core-react/uistate/LocalStateStorage.d.ts +1 -1
  285. package/lib/cjs/core-react/uistate/LocalStateStorage.d.ts.map +1 -1
  286. package/lib/cjs/core-react/uistate/LocalStateStorage.js.map +1 -1
  287. package/lib/cjs/core-react/uistate/UiStateEntry.d.ts +1 -1
  288. package/lib/cjs/core-react/uistate/UiStateEntry.d.ts.map +1 -1
  289. package/lib/cjs/core-react/uistate/UiStateEntry.js.map +1 -1
  290. package/lib/cjs/core-react/uistate/UiStateStorage.js.map +1 -1
  291. package/lib/cjs/core-react/utils/IconHelper.d.ts +1 -1
  292. package/lib/cjs/core-react/utils/IconHelper.d.ts.map +1 -1
  293. package/lib/cjs/core-react/utils/IconHelper.js.map +1 -1
  294. package/lib/cjs/core-react/utils/IconWebComponent.js +1 -1
  295. package/lib/cjs/core-react/utils/IconWebComponent.js.map +1 -1
  296. package/lib/cjs/core-react/utils/Point.d.ts +1 -1
  297. package/lib/cjs/core-react/utils/Point.d.ts.map +1 -1
  298. package/lib/cjs/core-react/utils/Point.js.map +1 -1
  299. package/lib/cjs/core-react/utils/Props.d.ts +2 -2
  300. package/lib/cjs/core-react/utils/Props.d.ts.map +1 -1
  301. package/lib/cjs/core-react/utils/Props.js.map +1 -1
  302. package/lib/cjs/core-react/utils/Rectangle.d.ts +3 -2
  303. package/lib/cjs/core-react/utils/Rectangle.d.ts.map +1 -1
  304. package/lib/cjs/core-react/utils/Rectangle.js.map +1 -1
  305. package/lib/cjs/core-react/utils/ScrollPositionMaintainer.d.ts +1 -1
  306. package/lib/cjs/core-react/utils/ScrollPositionMaintainer.d.ts.map +1 -1
  307. package/lib/cjs/core-react/utils/ScrollPositionMaintainer.js.map +1 -1
  308. package/lib/cjs/core-react/utils/Size.js.map +1 -1
  309. package/lib/cjs/core-react/utils/Timer.js.map +1 -1
  310. package/lib/cjs/core-react/utils/UiGeometry.js.map +1 -1
  311. package/lib/cjs/core-react/utils/flattenChildren.js.map +1 -1
  312. package/lib/cjs/core-react/utils/getBestBWContrastColor.js.map +1 -1
  313. package/lib/cjs/core-react/utils/getCssVariable.js +1 -1
  314. package/lib/cjs/core-react/utils/getCssVariable.js.map +1 -1
  315. package/lib/cjs/core-react/utils/getDisplayName.d.ts +1 -1
  316. package/lib/cjs/core-react/utils/getDisplayName.d.ts.map +1 -1
  317. package/lib/cjs/core-react/utils/getDisplayName.js.map +1 -1
  318. package/lib/cjs/core-react/utils/getUserColor.js.map +1 -1
  319. package/lib/cjs/core-react/utils/hooks/ResizeObserverPolyfill.js.map +1 -1
  320. package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.js +2 -1
  321. package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -1
  322. package/lib/cjs/core-react/utils/hooks/useDisposable.d.ts +1 -1
  323. package/lib/cjs/core-react/utils/hooks/useDisposable.d.ts.map +1 -1
  324. package/lib/cjs/core-react/utils/hooks/useDisposable.js.map +1 -1
  325. package/lib/cjs/core-react/utils/hooks/useEffectSkipFirst.js.map +1 -1
  326. package/lib/cjs/core-react/utils/hooks/useEventListener.js.map +1 -1
  327. package/lib/cjs/core-react/utils/hooks/useInterval.js.map +1 -1
  328. package/lib/cjs/core-react/utils/hooks/useLifecycleLogging.js.map +1 -1
  329. package/lib/cjs/core-react/utils/hooks/useOnOutsideClick.js.map +1 -1
  330. package/lib/cjs/core-react/utils/hooks/useProximityToMouse.js.map +1 -1
  331. package/lib/cjs/core-react/utils/hooks/useRefEffect.js.map +1 -1
  332. package/lib/cjs/core-react/utils/hooks/useRefState.js.map +1 -1
  333. package/lib/cjs/core-react/utils/hooks/useRefs.js.map +1 -1
  334. package/lib/cjs/core-react/utils/hooks/useResizeObserver.js +13 -8
  335. package/lib/cjs/core-react/utils/hooks/useResizeObserver.js.map +1 -1
  336. package/lib/cjs/core-react/utils/hooks/useTargeted.js.map +1 -1
  337. package/lib/cjs/core-react/utils/hooks/useThrottledFn.js.map +1 -1
  338. package/lib/cjs/core-react/utils/hooks/useWidgetOpacityContext.js.map +1 -1
  339. package/lib/cjs/core-react/utils/isPromiseLike.js.map +1 -1
  340. package/lib/cjs/core-react/utils/shallowDiffers.js.map +1 -1
  341. package/lib/cjs/core-react/utils/typeUtils.js.map +1 -1
  342. package/lib/cjs/core-react.js.map +1 -1
  343. package/lib/esm/core-react/UiCore.js.map +1 -1
  344. package/lib/esm/core-react/_geometry.scss +70 -70
  345. package/lib/esm/core-react/_helpers.scss +51 -51
  346. package/lib/esm/core-react/_math.scss +13 -13
  347. package/lib/esm/core-react/_scrollbar.scss +51 -51
  348. package/lib/esm/core-react/_typography.scss +44 -44
  349. package/lib/esm/core-react/_z-index.scss +65 -65
  350. package/lib/esm/core-react/autosuggest/AutoSuggest.d.ts +1 -1
  351. package/lib/esm/core-react/autosuggest/AutoSuggest.d.ts.map +1 -1
  352. package/lib/esm/core-react/autosuggest/AutoSuggest.js.map +1 -1
  353. package/lib/esm/core-react/autosuggest/AutoSuggest.scss +79 -79
  354. package/lib/esm/core-react/badge/Badge.d.ts +1 -1
  355. package/lib/esm/core-react/badge/Badge.d.ts.map +1 -1
  356. package/lib/esm/core-react/badge/Badge.js.map +1 -1
  357. package/lib/esm/core-react/badge/Badge.scss +13 -13
  358. package/lib/esm/core-react/badge/BadgeUtilities.js.map +1 -1
  359. package/lib/esm/core-react/badge/BetaBadge.d.ts +1 -1
  360. package/lib/esm/core-react/badge/BetaBadge.d.ts.map +1 -1
  361. package/lib/esm/core-react/badge/BetaBadge.js.map +1 -1
  362. package/lib/esm/core-react/badge/NewBadge.d.ts +1 -1
  363. package/lib/esm/core-react/badge/NewBadge.d.ts.map +1 -1
  364. package/lib/esm/core-react/badge/NewBadge.js.map +1 -1
  365. package/lib/esm/core-react/badge/NewBadge.scss +9 -9
  366. package/lib/esm/core-react/base/Centered.d.ts +1 -1
  367. package/lib/esm/core-react/base/Centered.d.ts.map +1 -1
  368. package/lib/esm/core-react/base/Centered.js.map +1 -1
  369. package/lib/esm/core-react/base/Div.d.ts +1 -1
  370. package/lib/esm/core-react/base/Div.d.ts.map +1 -1
  371. package/lib/esm/core-react/base/Div.js.map +1 -1
  372. package/lib/esm/core-react/base/DivWithOutsideClick.d.ts +1 -1
  373. package/lib/esm/core-react/base/DivWithOutsideClick.d.ts.map +1 -1
  374. package/lib/esm/core-react/base/DivWithOutsideClick.js.map +1 -1
  375. package/lib/esm/core-react/base/FillCentered.d.ts +1 -1
  376. package/lib/esm/core-react/base/FillCentered.d.ts.map +1 -1
  377. package/lib/esm/core-react/base/FillCentered.js.map +1 -1
  378. package/lib/esm/core-react/base/FlexWrapContainer.d.ts +1 -1
  379. package/lib/esm/core-react/base/FlexWrapContainer.d.ts.map +1 -1
  380. package/lib/esm/core-react/base/FlexWrapContainer.js.map +1 -1
  381. package/lib/esm/core-react/base/Gap.d.ts +1 -1
  382. package/lib/esm/core-react/base/Gap.d.ts.map +1 -1
  383. package/lib/esm/core-react/base/Gap.js +1 -1
  384. package/lib/esm/core-react/base/Gap.js.map +1 -1
  385. package/lib/esm/core-react/base/PointerEvents.js.map +1 -1
  386. package/lib/esm/core-react/base/ScrollView.d.ts +1 -1
  387. package/lib/esm/core-react/base/ScrollView.d.ts.map +1 -1
  388. package/lib/esm/core-react/base/ScrollView.js.map +1 -1
  389. package/lib/esm/core-react/base/base.scss +42 -42
  390. package/lib/esm/core-react/base/classes.scss +13 -13
  391. package/lib/esm/core-react/base/index.scss +5 -5
  392. package/lib/esm/core-react/button/UnderlinedButton.js.map +1 -1
  393. package/lib/esm/core-react/button/UnderlinedButton.scss +32 -32
  394. package/lib/esm/core-react/checklistbox/CheckListBox.d.ts +1 -1
  395. package/lib/esm/core-react/checklistbox/CheckListBox.d.ts.map +1 -1
  396. package/lib/esm/core-react/checklistbox/CheckListBox.js.map +1 -1
  397. package/lib/esm/core-react/checklistbox/CheckListBox.scss +21 -21
  398. package/lib/esm/core-react/classes.scss +11 -11
  399. package/lib/esm/core-react/colorthemes.scss +61 -61
  400. package/lib/esm/core-react/colorvariables.scss +131 -131
  401. package/lib/esm/core-react/contextmenu/ContextMenu.d.ts +1 -1
  402. package/lib/esm/core-react/contextmenu/ContextMenu.d.ts.map +1 -1
  403. package/lib/esm/core-react/contextmenu/ContextMenu.js +2 -1
  404. package/lib/esm/core-react/contextmenu/ContextMenu.js.map +1 -1
  405. package/lib/esm/core-react/contextmenu/ContextMenu.scss +236 -236
  406. package/lib/esm/core-react/contextmenu/ContextMenuDirection.js.map +1 -1
  407. package/lib/esm/core-react/contextmenu/ContextMenuDivider.d.ts +1 -1
  408. package/lib/esm/core-react/contextmenu/ContextMenuDivider.d.ts.map +1 -1
  409. package/lib/esm/core-react/contextmenu/ContextMenuDivider.js.map +1 -1
  410. package/lib/esm/core-react/contextmenu/ContextMenuItem.d.ts +5 -4
  411. package/lib/esm/core-react/contextmenu/ContextMenuItem.d.ts.map +1 -1
  412. package/lib/esm/core-react/contextmenu/ContextMenuItem.js.map +1 -1
  413. package/lib/esm/core-react/contextmenu/ContextSubMenu.d.ts +3 -3
  414. package/lib/esm/core-react/contextmenu/ContextSubMenu.d.ts.map +1 -1
  415. package/lib/esm/core-react/contextmenu/ContextSubMenu.js.map +1 -1
  416. package/lib/esm/core-react/contextmenu/GlobalContextMenu.d.ts +1 -1
  417. package/lib/esm/core-react/contextmenu/GlobalContextMenu.d.ts.map +1 -1
  418. package/lib/esm/core-react/contextmenu/GlobalContextMenu.js +5 -3
  419. package/lib/esm/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
  420. package/lib/esm/core-react/contextmenu/PopupContextMenu.d.ts +1 -1
  421. package/lib/esm/core-react/contextmenu/PopupContextMenu.d.ts.map +1 -1
  422. package/lib/esm/core-react/contextmenu/PopupContextMenu.js.map +1 -1
  423. package/lib/esm/core-react/contextmenu/TildeFinder.js.map +1 -1
  424. package/lib/esm/core-react/dialog/Dialog.d.ts +3 -3
  425. package/lib/esm/core-react/dialog/Dialog.d.ts.map +1 -1
  426. package/lib/esm/core-react/dialog/Dialog.js +2 -1
  427. package/lib/esm/core-react/dialog/Dialog.js.map +1 -1
  428. package/lib/esm/core-react/dialog/Dialog.scss +245 -245
  429. package/lib/esm/core-react/dialog/GlobalDialog.d.ts +1 -1
  430. package/lib/esm/core-react/dialog/GlobalDialog.d.ts.map +1 -1
  431. package/lib/esm/core-react/dialog/GlobalDialog.js +2 -1
  432. package/lib/esm/core-react/dialog/GlobalDialog.js.map +1 -1
  433. package/lib/esm/core-react/elementseparator/ElementSeparator.d.ts +1 -1
  434. package/lib/esm/core-react/elementseparator/ElementSeparator.d.ts.map +1 -1
  435. package/lib/esm/core-react/elementseparator/ElementSeparator.js +2 -2
  436. package/lib/esm/core-react/elementseparator/ElementSeparator.js.map +1 -1
  437. package/lib/esm/core-react/elementseparator/ElementSeparator.scss +85 -85
  438. package/lib/esm/core-react/enums/Alignment.js.map +1 -1
  439. package/lib/esm/core-react/enums/CheckBoxState.js.map +1 -1
  440. package/lib/esm/core-react/enums/Orientation.js.map +1 -1
  441. package/lib/esm/core-react/enums/SortDirection.js.map +1 -1
  442. package/lib/esm/core-react/enums/TimeFormat.js.map +1 -1
  443. package/lib/esm/core-react/expandable/ExpandableList.d.ts +1 -1
  444. package/lib/esm/core-react/expandable/ExpandableList.d.ts.map +1 -1
  445. package/lib/esm/core-react/expandable/ExpandableList.js.map +1 -1
  446. package/lib/esm/core-react/expandable/ExpandableList.scss +8 -8
  447. package/lib/esm/core-react/expandable/classes.scss +7 -7
  448. package/lib/esm/core-react/expandable/index.scss +5 -5
  449. package/lib/esm/core-react/expandable/list.scss +35 -35
  450. package/lib/esm/core-react/focus/ItemKeyboardNavigator.js.map +1 -1
  451. package/lib/esm/core-react/focustrap/FocusTrap.js.map +1 -1
  452. package/lib/esm/core-react/hocs/withIsPressed.js.map +1 -1
  453. package/lib/esm/core-react/hocs/withOnOutsideClick.js +2 -1
  454. package/lib/esm/core-react/hocs/withOnOutsideClick.js.map +1 -1
  455. package/lib/esm/core-react/hocs/withTimeout.js.map +1 -1
  456. package/lib/esm/core-react/icons/ConditionalIconItem.d.ts +1 -1
  457. package/lib/esm/core-react/icons/ConditionalIconItem.d.ts.map +1 -1
  458. package/lib/esm/core-react/icons/ConditionalIconItem.js.map +1 -1
  459. package/lib/esm/core-react/icons/IconComponent.d.ts +2 -2
  460. package/lib/esm/core-react/icons/IconComponent.d.ts.map +1 -1
  461. package/lib/esm/core-react/icons/IconComponent.js +1 -1
  462. package/lib/esm/core-react/icons/IconComponent.js.map +1 -1
  463. package/lib/esm/core-react/icons/IconComponent.scss +20 -20
  464. package/lib/esm/core-react/icons/SvgPath.d.ts +1 -1
  465. package/lib/esm/core-react/icons/SvgPath.d.ts.map +1 -1
  466. package/lib/esm/core-react/icons/SvgPath.js.map +1 -1
  467. package/lib/esm/core-react/icons/SvgPath.scss +15 -15
  468. package/lib/esm/core-react/icons/WebFontIcon.d.ts +1 -1
  469. package/lib/esm/core-react/icons/WebFontIcon.d.ts.map +1 -1
  470. package/lib/esm/core-react/icons/WebFontIcon.js.map +1 -1
  471. package/lib/esm/core-react/icons/WebFontIcon.scss +17 -17
  472. package/lib/esm/core-react/icons/classes.scss +10 -10
  473. package/lib/esm/core-react/icons/index.scss +6 -6
  474. package/lib/esm/core-react/icons/mixins.scss +25 -25
  475. package/lib/esm/core-react/icons/variables.scss +12 -12
  476. package/lib/esm/core-react/imagecheckbox/ImageCheckBox.d.ts +1 -1
  477. package/lib/esm/core-react/imagecheckbox/ImageCheckBox.d.ts.map +1 -1
  478. package/lib/esm/core-react/imagecheckbox/ImageCheckBox.js.map +1 -1
  479. package/lib/esm/core-react/imagecheckbox/ImageCheckBox.scss +54 -54
  480. package/lib/esm/core-react/index.scss +21 -21
  481. package/lib/esm/core-react/inputs/Input.d.ts +1 -1
  482. package/lib/esm/core-react/inputs/Input.d.ts.map +1 -1
  483. package/lib/esm/core-react/inputs/Input.js.map +1 -1
  484. package/lib/esm/core-react/inputs/InputLabel.d.ts +2 -2
  485. package/lib/esm/core-react/inputs/InputLabel.d.ts.map +1 -1
  486. package/lib/esm/core-react/inputs/InputLabel.js.map +1 -1
  487. package/lib/esm/core-react/inputs/InputStatus.js.map +1 -1
  488. package/lib/esm/core-react/inputs/LabeledComponentProps.d.ts +2 -2
  489. package/lib/esm/core-react/inputs/LabeledComponentProps.d.ts.map +1 -1
  490. package/lib/esm/core-react/inputs/LabeledComponentProps.js.map +1 -1
  491. package/lib/esm/core-react/inputs/classes.scss +8 -8
  492. package/lib/esm/core-react/inputs/iconinput/IconInput.d.ts +1 -1
  493. package/lib/esm/core-react/inputs/iconinput/IconInput.d.ts.map +1 -1
  494. package/lib/esm/core-react/inputs/iconinput/IconInput.js.map +1 -1
  495. package/lib/esm/core-react/inputs/iconinput/IconInput.scss +35 -35
  496. package/lib/esm/core-react/inputs/index.scss +9 -9
  497. package/lib/esm/core-react/inputs/input-label.scss +90 -90
  498. package/lib/esm/core-react/inputs/input.scss +58 -58
  499. package/lib/esm/core-react/inputs/numberinput/NumberInput.d.ts +1 -1
  500. package/lib/esm/core-react/inputs/numberinput/NumberInput.d.ts.map +1 -1
  501. package/lib/esm/core-react/inputs/numberinput/NumberInput.js.map +1 -1
  502. package/lib/esm/core-react/inputs/numberinput/NumberInput.scss +88 -88
  503. package/lib/esm/core-react/inputs/variables.scss +38 -38
  504. package/lib/esm/core-react/layout-variables.scss +17 -17
  505. package/lib/esm/core-react/listbox/Listbox.js +3 -2
  506. package/lib/esm/core-react/listbox/Listbox.js.map +1 -1
  507. package/lib/esm/core-react/listbox/Listbox.scss +54 -54
  508. package/lib/esm/core-react/loading/LoadingBar.d.ts +1 -1
  509. package/lib/esm/core-react/loading/LoadingBar.d.ts.map +1 -1
  510. package/lib/esm/core-react/loading/LoadingBar.js.map +1 -1
  511. package/lib/esm/core-react/loading/LoadingBar.scss +29 -29
  512. package/lib/esm/core-react/loading/LoadingPrompt.d.ts +1 -1
  513. package/lib/esm/core-react/loading/LoadingPrompt.d.ts.map +1 -1
  514. package/lib/esm/core-react/loading/LoadingPrompt.js.map +1 -1
  515. package/lib/esm/core-react/loading/LoadingPrompt.scss +33 -33
  516. package/lib/esm/core-react/loading/LoadingSpinner.d.ts +1 -1
  517. package/lib/esm/core-react/loading/LoadingSpinner.d.ts.map +1 -1
  518. package/lib/esm/core-react/loading/LoadingSpinner.js.map +1 -1
  519. package/lib/esm/core-react/loading/LoadingSpinner.scss +26 -26
  520. package/lib/esm/core-react/loading/LoadingStatus.d.ts +1 -1
  521. package/lib/esm/core-react/loading/LoadingStatus.d.ts.map +1 -1
  522. package/lib/esm/core-react/loading/LoadingStatus.js.map +1 -1
  523. package/lib/esm/core-react/loading/LoadingStatus.scss +20 -20
  524. package/lib/esm/core-react/loading/index.scss +5 -5
  525. package/lib/esm/core-react/loading/mixins.scss +57 -57
  526. package/lib/esm/core-react/messagebox/MessageBox.d.ts +4 -3
  527. package/lib/esm/core-react/messagebox/MessageBox.d.ts.map +1 -1
  528. package/lib/esm/core-react/messagebox/MessageBox.js.map +1 -1
  529. package/lib/esm/core-react/messagebox/MessageBox.scss +56 -56
  530. package/lib/esm/core-react/notification/MessageRenderer.d.ts +2 -2
  531. package/lib/esm/core-react/notification/MessageRenderer.d.ts.map +1 -1
  532. package/lib/esm/core-react/notification/MessageRenderer.js +1 -1
  533. package/lib/esm/core-react/notification/MessageRenderer.js.map +1 -1
  534. package/lib/esm/core-react/notification/MessageType.d.ts +1 -1
  535. package/lib/esm/core-react/notification/MessageType.d.ts.map +1 -1
  536. package/lib/esm/core-react/notification/MessageType.js.map +1 -1
  537. package/lib/esm/core-react/popup/Popup.d.ts +1 -1
  538. package/lib/esm/core-react/popup/Popup.d.ts.map +1 -1
  539. package/lib/esm/core-react/popup/Popup.js +8 -4
  540. package/lib/esm/core-react/popup/Popup.js.map +1 -1
  541. package/lib/esm/core-react/popup/Popup.scss +240 -240
  542. package/lib/esm/core-react/radialmenu/Annulus.js.map +1 -1
  543. package/lib/esm/core-react/radialmenu/RadialMenu.d.ts +2 -2
  544. package/lib/esm/core-react/radialmenu/RadialMenu.d.ts.map +1 -1
  545. package/lib/esm/core-react/radialmenu/RadialMenu.js.map +1 -1
  546. package/lib/esm/core-react/radialmenu/RadialMenu.scss +55 -55
  547. package/lib/esm/core-react/searchbox/SearchBox.d.ts +1 -1
  548. package/lib/esm/core-react/searchbox/SearchBox.d.ts.map +1 -1
  549. package/lib/esm/core-react/searchbox/SearchBox.js.map +1 -1
  550. package/lib/esm/core-react/searchbox/SearchBox.scss +47 -47
  551. package/lib/esm/core-react/settings/SettingsContainer.d.ts +1 -1
  552. package/lib/esm/core-react/settings/SettingsContainer.d.ts.map +1 -1
  553. package/lib/esm/core-react/settings/SettingsContainer.js.map +1 -1
  554. package/lib/esm/core-react/settings/SettingsContainer.scss +68 -68
  555. package/lib/esm/core-react/settings/SettingsManager.d.ts +1 -1
  556. package/lib/esm/core-react/settings/SettingsManager.d.ts.map +1 -1
  557. package/lib/esm/core-react/settings/SettingsManager.js.map +1 -1
  558. package/lib/esm/core-react/style/baseline.scss +11 -11
  559. package/lib/esm/core-react/style/breakpoints.scss +41 -41
  560. package/lib/esm/core-react/style/colors.scss +77 -77
  561. package/lib/esm/core-react/style/index.scss +10 -10
  562. package/lib/esm/core-react/style/mixins.scss +27 -27
  563. package/lib/esm/core-react/style/opacity.scss +16 -16
  564. package/lib/esm/core-react/style/themecolors.scss +123 -123
  565. package/lib/esm/core-react/tabs/Tabs.d.ts +1 -1
  566. package/lib/esm/core-react/tabs/Tabs.d.ts.map +1 -1
  567. package/lib/esm/core-react/tabs/Tabs.js.map +1 -1
  568. package/lib/esm/core-react/tabs/VerticalTabs.d.ts +1 -1
  569. package/lib/esm/core-react/tabs/VerticalTabs.d.ts.map +1 -1
  570. package/lib/esm/core-react/tabs/VerticalTabs.js.map +1 -1
  571. package/lib/esm/core-react/tabs/classes.scss +7 -7
  572. package/lib/esm/core-react/tabs/index.scss +5 -5
  573. package/lib/esm/core-react/tabs/tabs.scss +96 -96
  574. package/lib/esm/core-react/tabs/vertical.scss +51 -51
  575. package/lib/esm/core-react/text/BlockText.d.ts +1 -1
  576. package/lib/esm/core-react/text/BlockText.d.ts.map +1 -1
  577. package/lib/esm/core-react/text/BlockText.js.map +1 -1
  578. package/lib/esm/core-react/text/BodyText.d.ts +1 -1
  579. package/lib/esm/core-react/text/BodyText.d.ts.map +1 -1
  580. package/lib/esm/core-react/text/BodyText.js.map +1 -1
  581. package/lib/esm/core-react/text/DisabledText.d.ts +1 -1
  582. package/lib/esm/core-react/text/DisabledText.d.ts.map +1 -1
  583. package/lib/esm/core-react/text/DisabledText.js.map +1 -1
  584. package/lib/esm/core-react/text/FilteredText.d.ts +2 -2
  585. package/lib/esm/core-react/text/FilteredText.d.ts.map +1 -1
  586. package/lib/esm/core-react/text/FilteredText.js.map +1 -1
  587. package/lib/esm/core-react/text/FilteredText.scss +10 -10
  588. package/lib/esm/core-react/text/MutedText.d.ts +1 -1
  589. package/lib/esm/core-react/text/MutedText.d.ts.map +1 -1
  590. package/lib/esm/core-react/text/MutedText.js.map +1 -1
  591. package/lib/esm/core-react/text/StyledText.d.ts +1 -1
  592. package/lib/esm/core-react/text/StyledText.d.ts.map +1 -1
  593. package/lib/esm/core-react/text/StyledText.js.map +1 -1
  594. package/lib/esm/core-react/text/TextProps.d.ts +2 -2
  595. package/lib/esm/core-react/text/TextProps.d.ts.map +1 -1
  596. package/lib/esm/core-react/text/TextProps.js.map +1 -1
  597. package/lib/esm/core-react/text/block.scss +15 -15
  598. package/lib/esm/core-react/text/body.scss +13 -13
  599. package/lib/esm/core-react/text/classes.scss +10 -10
  600. package/lib/esm/core-react/text/disabled.scss +10 -10
  601. package/lib/esm/core-react/text/index.scss +10 -10
  602. package/lib/esm/core-react/text/mixins.scss +24 -24
  603. package/lib/esm/core-react/text/muted.scss +10 -10
  604. package/lib/esm/core-react/tree/Branch.d.ts +1 -1
  605. package/lib/esm/core-react/tree/Branch.d.ts.map +1 -1
  606. package/lib/esm/core-react/tree/Branch.js.map +1 -1
  607. package/lib/esm/core-react/tree/Branch.scss +12 -12
  608. package/lib/esm/core-react/tree/ExpansionToggle.d.ts +1 -1
  609. package/lib/esm/core-react/tree/ExpansionToggle.d.ts.map +1 -1
  610. package/lib/esm/core-react/tree/ExpansionToggle.js.map +1 -1
  611. package/lib/esm/core-react/tree/ExpansionToggle.scss +32 -32
  612. package/lib/esm/core-react/tree/Node.d.ts +3 -3
  613. package/lib/esm/core-react/tree/Node.d.ts.map +1 -1
  614. package/lib/esm/core-react/tree/Node.js +2 -1
  615. package/lib/esm/core-react/tree/Node.js.map +1 -1
  616. package/lib/esm/core-react/tree/Node.scss +68 -68
  617. package/lib/esm/core-react/tree/Placeholder.d.ts +1 -1
  618. package/lib/esm/core-react/tree/Placeholder.d.ts.map +1 -1
  619. package/lib/esm/core-react/tree/Placeholder.js.map +1 -1
  620. package/lib/esm/core-react/tree/Placeholder.scss +17 -17
  621. package/lib/esm/core-react/tree/Tree.d.ts +1 -1
  622. package/lib/esm/core-react/tree/Tree.d.ts.map +1 -1
  623. package/lib/esm/core-react/tree/Tree.js.map +1 -1
  624. package/lib/esm/core-react/tree/Tree.scss +21 -21
  625. package/lib/esm/core-react/uistate/LocalStateStorage.d.ts +1 -1
  626. package/lib/esm/core-react/uistate/LocalStateStorage.d.ts.map +1 -1
  627. package/lib/esm/core-react/uistate/LocalStateStorage.js.map +1 -1
  628. package/lib/esm/core-react/uistate/UiStateEntry.d.ts +1 -1
  629. package/lib/esm/core-react/uistate/UiStateEntry.d.ts.map +1 -1
  630. package/lib/esm/core-react/uistate/UiStateEntry.js.map +1 -1
  631. package/lib/esm/core-react/uistate/UiStateStorage.js.map +1 -1
  632. package/lib/esm/core-react/utils/IconHelper.d.ts +1 -1
  633. package/lib/esm/core-react/utils/IconHelper.d.ts.map +1 -1
  634. package/lib/esm/core-react/utils/IconHelper.js.map +1 -1
  635. package/lib/esm/core-react/utils/IconWebComponent.js +1 -1
  636. package/lib/esm/core-react/utils/IconWebComponent.js.map +1 -1
  637. package/lib/esm/core-react/utils/Point.d.ts +1 -1
  638. package/lib/esm/core-react/utils/Point.d.ts.map +1 -1
  639. package/lib/esm/core-react/utils/Point.js.map +1 -1
  640. package/lib/esm/core-react/utils/Props.d.ts +2 -2
  641. package/lib/esm/core-react/utils/Props.d.ts.map +1 -1
  642. package/lib/esm/core-react/utils/Props.js.map +1 -1
  643. package/lib/esm/core-react/utils/Rectangle.d.ts +3 -2
  644. package/lib/esm/core-react/utils/Rectangle.d.ts.map +1 -1
  645. package/lib/esm/core-react/utils/Rectangle.js.map +1 -1
  646. package/lib/esm/core-react/utils/ScrollPositionMaintainer.d.ts +1 -1
  647. package/lib/esm/core-react/utils/ScrollPositionMaintainer.d.ts.map +1 -1
  648. package/lib/esm/core-react/utils/ScrollPositionMaintainer.js.map +1 -1
  649. package/lib/esm/core-react/utils/Size.js.map +1 -1
  650. package/lib/esm/core-react/utils/Timer.js.map +1 -1
  651. package/lib/esm/core-react/utils/UiGeometry.js.map +1 -1
  652. package/lib/esm/core-react/utils/flattenChildren.js.map +1 -1
  653. package/lib/esm/core-react/utils/getBestBWContrastColor.js.map +1 -1
  654. package/lib/esm/core-react/utils/getCssVariable.js +1 -1
  655. package/lib/esm/core-react/utils/getCssVariable.js.map +1 -1
  656. package/lib/esm/core-react/utils/getDisplayName.d.ts +1 -1
  657. package/lib/esm/core-react/utils/getDisplayName.d.ts.map +1 -1
  658. package/lib/esm/core-react/utils/getDisplayName.js.map +1 -1
  659. package/lib/esm/core-react/utils/getUserColor.js.map +1 -1
  660. package/lib/esm/core-react/utils/hooks/ResizeObserverPolyfill.js.map +1 -1
  661. package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.js +2 -1
  662. package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -1
  663. package/lib/esm/core-react/utils/hooks/useDisposable.d.ts +1 -1
  664. package/lib/esm/core-react/utils/hooks/useDisposable.d.ts.map +1 -1
  665. package/lib/esm/core-react/utils/hooks/useDisposable.js.map +1 -1
  666. package/lib/esm/core-react/utils/hooks/useEffectSkipFirst.js.map +1 -1
  667. package/lib/esm/core-react/utils/hooks/useEventListener.js.map +1 -1
  668. package/lib/esm/core-react/utils/hooks/useInterval.js.map +1 -1
  669. package/lib/esm/core-react/utils/hooks/useLifecycleLogging.js.map +1 -1
  670. package/lib/esm/core-react/utils/hooks/useOnOutsideClick.js.map +1 -1
  671. package/lib/esm/core-react/utils/hooks/useProximityToMouse.js.map +1 -1
  672. package/lib/esm/core-react/utils/hooks/useRefEffect.js.map +1 -1
  673. package/lib/esm/core-react/utils/hooks/useRefState.js.map +1 -1
  674. package/lib/esm/core-react/utils/hooks/useRefs.js.map +1 -1
  675. package/lib/esm/core-react/utils/hooks/useResizeObserver.js +13 -8
  676. package/lib/esm/core-react/utils/hooks/useResizeObserver.js.map +1 -1
  677. package/lib/esm/core-react/utils/hooks/useTargeted.js.map +1 -1
  678. package/lib/esm/core-react/utils/hooks/useThrottledFn.js.map +1 -1
  679. package/lib/esm/core-react/utils/hooks/useWidgetOpacityContext.js.map +1 -1
  680. package/lib/esm/core-react/utils/isPromiseLike.js.map +1 -1
  681. package/lib/esm/core-react/utils/shallowDiffers.js.map +1 -1
  682. package/lib/esm/core-react/utils/typeUtils.js.map +1 -1
  683. package/lib/esm/core-react.js.map +1 -1
  684. package/lib/public/locales/en/UiCore.json +30 -30
  685. package/package.json +9 -4
@@ -1 +1 @@
1
- {"version":3,"file":"NumberInput.js","sourceRoot":"","sources":["../../../../../src/core-react/inputs/numberinput/NumberInput.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,8BAA4B;AAC5B,2CAAoC;AACpC,+BAA+B;AAC/B,wDAAyD;AACzD,0DAAmD;AACnD,6DAAiD;AACjD,oEAA0G;AA4C1G,MAAM,qBAAqB,GAAG,KAAK,CAAC,UAAU,CAC5C,SAAS,qBAAqB,CAAC,KAAK,EAAE,GAAG;IACvC,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EACnE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,gBAAgB,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IACnH,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,CAAC,KA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kBAAkB,EAClB,gBAAgB,IAAI,+BAA+B,EACnD,UAAU,IAAI,4BAA4B,CAC3C,CAAC;IAEF,MAAM,OAAO,GAAG,gBAAgB,CAAC,CAAC,CAAC,oBAAC,gCAAU,OAAG,CAAC,CAAC,CAAC,oBAAC,qCAAe,OAAG,CAAC;IACxE,MAAM,SAAS,GAAG,gBAAgB,CAAC,CAAC,CAAC,oBAAC,kCAAY,OAAG,CAAC,CAAC,CAAC,oBAAC,uCAAiB,OAAG,CAAC;IAE9E,OAAO,CACL,6BAAK,SAAS,EAAE,gBAAgB,EAAE,KAAK,EAAE,cAAc;QACrD,oBAAC,qBAAK,IAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAC,OAAO,KAAK,UAAU,GAAI;QACnK,6BAAK,SAAS,EAAE,IAAA,oBAAU,EAAC,qCAAqC,EAAE,gBAAgB,IAAI,+BAA+B,CAAC;YAEpH,6BAAK,SAAS,EAAC,sDAAsD,EAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAC,cAAc;gBAC7H,oBAAC,oBAAI,IAAC,QAAQ,EAAE,OAAO,GAAI,CACvB;YAEN,6BAAK,SAAS,EAAC,wDAAwD,EAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,IAAI,EAAC,cAAc;gBACjI,oBAAC,oBAAI,IAAC,QAAQ,EAAE,SAAS,GAAI,CACzB,CACF,CACF,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF;;GAEG;AACU,QAAA,WAAW,GAAoD,qBAAqB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Inputs\r\n */\r\n\r\nimport \"./NumberInput.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { Input, InputProps } from \"@itwin/itwinui-react\";\r\nimport { SpecialKey } from \"@itwin/appui-abstract\";\r\nimport { Icon } from \"../../icons/IconComponent\";\r\nimport { SvgCaretDown, SvgCaretDownSmall, SvgCaretUp, SvgCaretUpSmall } from \"@itwin/itwinui-icons-react\";\r\n\r\n/** Step function prototype for [[NumberInput]] component\r\n * @public\r\n */\r\nexport type StepFunctionProp = number | ((direction: string) => number | undefined);\r\n\r\n/** Properties for the [[NumberInput]] component\r\n * @public\r\n */\r\nexport interface NumberInputProps extends Omit<InputProps, \"min\" | \"max\" | \"step\" | \"onChange\"> {\r\n /** Numeric value, set to `undefined` to show placeholder text */\r\n value?: number;\r\n /** CSS class name for the NumberInput component container div */\r\n containerClassName?: string;\r\n /** Style for component container div. */\r\n containerStyle?: React.CSSProperties;\r\n /** number or function\tNumber.MIN_SAFE_INTEGER */\r\n min?: number;\r\n /** number or function\tdefaults to Number.MAX_SAFE_INTEGER */\r\n max?: number;\r\n /** increment step value used while incrementing or decrementing (up/down buttons or arrow keys) defaults to 1. */\r\n step?: StepFunctionProp;\r\n /** number of decimal places, defaults to 0 */\r\n precision?: number;\r\n /** function parseFloat */\r\n parse?: ((value: string) => number | null | undefined);\r\n /** function optional formatting function that takes the number value and the internal formatted value in case function just adds prefix or suffix. */\r\n format?: (num: number | null | undefined, formattedValue: string) => string;\r\n /** Set to true to \"snap\" to the closest step value while incrementing or decrementing (up/down buttons or arrow keys). */\r\n snap?: boolean;\r\n /** Function to call when value is changed. */\r\n onChange?: (value: number | undefined, stringValue: string) => void;\r\n /** if true up/down buttons are shown larger and side by side */\r\n showTouchButtons?: boolean;\r\n /** Provides ability to return reference to HTMLInputElement */\r\n ref?: React.Ref<HTMLInputElement>;\r\n /**\r\n * Makes this component behave as controlled component.\r\n * @internal\r\n */\r\n isControlled?: boolean;\r\n}\r\n\r\nconst ForwardRefNumberInput = React.forwardRef<HTMLInputElement, NumberInputProps>(\r\n function ForwardRefNumberInput(props, ref) {\r\n const { containerClassName, value, min, max, precision, format, parse,\r\n onChange, onBlur, onKeyDown, step, snap, showTouchButtons, containerStyle, isControlled, ...otherProps } = props;\r\n const currentValueRef = React.useRef(value);\r\n\r\n /**\r\n * Used internally to parse the argument x to it's numeric representation.\r\n * If the argument cannot be converted to finite number returns 0; If a\r\n * \"precision\" prop is specified uses it round the number with that\r\n * precision (no fixed precision here because the return value is float, not\r\n * string).\r\n */\r\n const parseInternal = React.useCallback((x: string) => {\r\n let n: number | undefined | null;\r\n\r\n if (parse)\r\n n = parse(x);\r\n if (undefined === n || null === n) {\r\n n = parseFloat(x);\r\n if (isNaN(n) || !isFinite(n)) {\r\n n = 0;\r\n }\r\n }\r\n\r\n const localPrecision = undefined === precision ? 10 : precision;\r\n const q = Math.pow(10, localPrecision);\r\n const localMin = undefined === min ? Number.MIN_SAFE_INTEGER : min;\r\n const localMax = undefined === max ? Number.MAX_SAFE_INTEGER : max;\r\n n = Math.min(Math.max(n, localMin), localMax);\r\n n = Math.round(n * q) / q;\r\n\r\n return n;\r\n }, [parse, precision, min, max]);\r\n\r\n /**\r\n * This is used internally to format a number to its display representation.\r\n * It will invoke the format function if one is provided.\r\n */\r\n const formatInternal = React.useCallback((num: number | undefined | null) => {\r\n const localPrecision = undefined === precision || null === precision ? 0 : precision;\r\n const str = undefined === num || null === num ? \"\" : num.toFixed(localPrecision);\r\n\r\n if (format)\r\n return format(num, str);\r\n\r\n return str;\r\n }, [format, precision]);\r\n\r\n const [formattedValue, setFormattedValue] = React.useState(() => formatInternal(value));\r\n\r\n // See if new initialValue props have changed since component mounted\r\n React.useEffect(() => {\r\n currentValueRef.current = value;\r\n const currentFormattedValue = formatInternal(currentValueRef.current);\r\n setFormattedValue(currentFormattedValue);\r\n }, [formatInternal, value]);\r\n\r\n const handleChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n const newVal = event.currentTarget.value;\r\n setFormattedValue(newVal);\r\n isControlled && onChange && onChange(parseInternal(newVal), newVal);\r\n }, [isControlled, onChange, parseInternal]);\r\n\r\n const updateValue = React.useCallback((newVal: number) => {\r\n const newFormattedVal = formatInternal(newVal);\r\n onChange && onChange(newVal, newFormattedVal);\r\n setFormattedValue(newFormattedVal);\r\n }, [onChange, formatInternal]);\r\n\r\n const updateValueFromString = React.useCallback((strValue: string) => {\r\n const newVal = parseInternal(strValue);\r\n updateValue(newVal);\r\n }, [parseInternal, updateValue]);\r\n\r\n const handleBlur = React.useCallback((event: React.FocusEvent<HTMLInputElement>) => {\r\n const newVal = parseInternal(event.target.value);\r\n onBlur && onBlur(event);\r\n updateValue(newVal);\r\n }, [parseInternal, updateValue, onBlur]);\r\n\r\n const getIncrementValue = React.useCallback((increment: boolean) => {\r\n if (typeof step === \"function\") {\r\n const stepVal = step(increment ? \"up\" : \"down\");\r\n return stepVal ? stepVal : 1;\r\n }\r\n\r\n return !step ? 1 : step;\r\n }, [step]);\r\n\r\n /**\r\n * The internal method that actually sets the new value on the input\r\n */\r\n const applyStep = React.useCallback((increment: boolean) => {\r\n const incrementValue = getIncrementValue(increment);\r\n\r\n let num = parseInternal(formattedValue) + (increment ? incrementValue : -incrementValue);\r\n if (snap) {\r\n num = Math.round(num / incrementValue) * incrementValue;\r\n }\r\n\r\n const localMin = undefined === min ? Number.MIN_SAFE_INTEGER : min;\r\n const localMax = undefined === max ? Number.MAX_SAFE_INTEGER : max;\r\n num = Math.min(Math.max(num, localMin), localMax);\r\n\r\n updateValue(num);\r\n }, [formattedValue, getIncrementValue, max, min, parseInternal, snap, updateValue]);\r\n\r\n const handleKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLInputElement>) => {\r\n // istanbul ignore else\r\n if (event.key === SpecialKey.Enter) {\r\n updateValueFromString(event.currentTarget.value);\r\n event.preventDefault();\r\n event.stopPropagation();\r\n } else if (event.key === SpecialKey.Escape) {\r\n setFormattedValue(formatInternal(currentValueRef.current));\r\n event.preventDefault();\r\n } else if (event.key === SpecialKey.ArrowDown) {\r\n applyStep(false);\r\n event.preventDefault();\r\n event.stopPropagation();\r\n } else if (event.key === SpecialKey.ArrowUp) {\r\n applyStep(true);\r\n event.preventDefault();\r\n event.stopPropagation();\r\n }\r\n onKeyDown && onKeyDown(event);\r\n }, [applyStep, formatInternal, updateValueFromString, onKeyDown]);\r\n\r\n const handleDownClick = React.useCallback((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\r\n applyStep(false);\r\n event.preventDefault();\r\n }, [applyStep]);\r\n\r\n const handleUpClick = React.useCallback((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\r\n applyStep(true);\r\n event.preventDefault();\r\n }, [applyStep]);\r\n\r\n const handleFocus = React.useCallback((event: React.FocusEvent<HTMLInputElement>) => {\r\n event.currentTarget.select();\r\n }, []);\r\n\r\n const isDisabled = !!otherProps.disabled;\r\n const containerClasses = classnames(\"core-number-input-container\",\r\n containerClassName,\r\n showTouchButtons && \"core-number-buttons-for-touch\",\r\n isDisabled && \"core-number-input-disabled\",\r\n );\r\n\r\n const caretUp = showTouchButtons ? <SvgCaretUp /> : <SvgCaretUpSmall />;\r\n const caretDown = showTouchButtons ? <SvgCaretDown /> : <SvgCaretDownSmall />;\r\n\r\n return (\r\n <div className={containerClasses} style={containerStyle} >\r\n <Input ref={ref} value={formattedValue} onChange={handleChange} onKeyDown={handleKeyDown} onFocus={handleFocus} onBlur={handleBlur} size=\"small\" {...otherProps} />\r\n <div className={classnames(\"core-number-input-buttons-container\", showTouchButtons && \"core-number-buttons-for-touch\")}>\r\n { /* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */}\r\n <div className=\"core-number-input-button core-number-input-button-up\" tabIndex={-1} onClick={handleUpClick} role=\"presentation\" >\r\n <Icon iconSpec={caretUp} />\r\n </div>\r\n { /* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */}\r\n <div className=\"core-number-input-button core-number-input-button-down\" tabIndex={-1} onClick={handleDownClick} role=\"presentation\" >\r\n <Icon iconSpec={caretDown} />\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n }\r\n);\r\n\r\n/** Input component for numbers with up and down buttons to increment and decrement the value.\r\n * @public\r\n */\r\nexport const NumberInput: (props: NumberInputProps) => JSX.Element | null = ForwardRefNumberInput;\r\n"]}
1
+ {"version":3,"file":"NumberInput.js","sourceRoot":"","sources":["../../../../../src/core-react/inputs/numberinput/NumberInput.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,8BAA4B;AAC5B,2CAAoC;AACpC,+BAA+B;AAE/B,wDAA6C;AAC7C,0DAAmD;AACnD,6DAAiD;AACjD,oEAA0G;AA4C1G,MAAM,qBAAqB,GAAG,KAAK,CAAC,UAAU,CAC5C,SAAS,qBAAqB,CAAC,KAAK,EAAE,GAAG;IACvC,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EACnE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,gBAAgB,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IACnH,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAE5C;;;;;;KAMC;IACD,MAAM,aAAa,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAS,EAAE,EAAE;QACpD,IAAI,CAA4B,CAAC;QAEjC,IAAI,KAAK;YACP,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACf,IAAI,SAAS,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,EAAE;YACjC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;YAClB,IAAI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,OAAO,CACL,6BAAK,SAAS,EAAE,gBAAgB,EAAE,KAAK,EAAE,cAAc;QACrD,oBAAC,qBAAK,IAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAC,OAAO,KAAK,UAAU,GAAI;QACnK,6BAAK,SAAS,EAAE,IAAA,oBAAU,EAAC,qCAAqC,EAAE,gBAAgB,IAAI,+BAA+B,CAAC;YAEpH,6BAAK,SAAS,EAAC,sDAAsD,EAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAC,cAAc;gBAC7H,oBAAC,oBAAI,IAAC,QAAQ,EAAE,OAAO,GAAI,CACvB;YAEN,6BAAK,SAAS,EAAC,wDAAwD,EAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,IAAI,EAAC,cAAc;gBACjI,oBAAC,oBAAI,IAAC,QAAQ,EAAE,SAAS,GAAI,CACzB,CACF,CACF,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF;;GAEG;AACU,QAAA,WAAW,GAAoD,qBAAqB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Inputs\n */\n\nimport \"./NumberInput.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { InputProps } from \"@itwin/itwinui-react\";\nimport { Input } from \"@itwin/itwinui-react\";\nimport { SpecialKey } from \"@itwin/appui-abstract\";\nimport { Icon } from \"../../icons/IconComponent\";\nimport { SvgCaretDown, SvgCaretDownSmall, SvgCaretUp, SvgCaretUpSmall } from \"@itwin/itwinui-icons-react\";\n\n/** Step function prototype for [[NumberInput]] component\n * @public\n */\nexport type StepFunctionProp = number | ((direction: string) => number | undefined);\n\n/** Properties for the [[NumberInput]] component\n * @public\n */\nexport interface NumberInputProps extends Omit<InputProps, \"min\" | \"max\" | \"step\" | \"onChange\"> {\n /** Numeric value, set to `undefined` to show placeholder text */\n value?: number;\n /** CSS class name for the NumberInput component container div */\n containerClassName?: string;\n /** Style for component container div. */\n containerStyle?: React.CSSProperties;\n /** number or function\tNumber.MIN_SAFE_INTEGER */\n min?: number;\n /** number or function\tdefaults to Number.MAX_SAFE_INTEGER */\n max?: number;\n /** increment step value used while incrementing or decrementing (up/down buttons or arrow keys) defaults to 1. */\n step?: StepFunctionProp;\n /** number of decimal places, defaults to 0 */\n precision?: number;\n /** function parseFloat */\n parse?: ((value: string) => number | null | undefined);\n /** function optional formatting function that takes the number value and the internal formatted value in case function just adds prefix or suffix. */\n format?: (num: number | null | undefined, formattedValue: string) => string;\n /** Set to true to \"snap\" to the closest step value while incrementing or decrementing (up/down buttons or arrow keys). */\n snap?: boolean;\n /** Function to call when value is changed. */\n onChange?: (value: number | undefined, stringValue: string) => void;\n /** if true up/down buttons are shown larger and side by side */\n showTouchButtons?: boolean;\n /** Provides ability to return reference to HTMLInputElement */\n ref?: React.Ref<HTMLInputElement>;\n /**\n * Makes this component behave as controlled component.\n * @internal\n */\n isControlled?: boolean;\n}\n\nconst ForwardRefNumberInput = React.forwardRef<HTMLInputElement, NumberInputProps>(\n function ForwardRefNumberInput(props, ref) {\n const { containerClassName, value, min, max, precision, format, parse,\n onChange, onBlur, onKeyDown, step, snap, showTouchButtons, containerStyle, isControlled, ...otherProps } = props;\n const currentValueRef = React.useRef(value);\n\n /**\n * Used internally to parse the argument x to it's numeric representation.\n * If the argument cannot be converted to finite number returns 0; If a\n * \"precision\" prop is specified uses it round the number with that\n * precision (no fixed precision here because the return value is float, not\n * string).\n */\n const parseInternal = React.useCallback((x: string) => {\n let n: number | undefined | null;\n\n if (parse)\n n = parse(x);\n if (undefined === n || null === n) {\n n = parseFloat(x);\n if (isNaN(n) || !isFinite(n)) {\n n = 0;\n }\n }\n\n const localPrecision = undefined === precision ? 10 : precision;\n const q = Math.pow(10, localPrecision);\n const localMin = undefined === min ? Number.MIN_SAFE_INTEGER : min;\n const localMax = undefined === max ? Number.MAX_SAFE_INTEGER : max;\n n = Math.min(Math.max(n, localMin), localMax);\n n = Math.round(n * q) / q;\n\n return n;\n }, [parse, precision, min, max]);\n\n /**\n * This is used internally to format a number to its display representation.\n * It will invoke the format function if one is provided.\n */\n const formatInternal = React.useCallback((num: number | undefined | null) => {\n const localPrecision = undefined === precision || null === precision ? 0 : precision;\n const str = undefined === num || null === num ? \"\" : num.toFixed(localPrecision);\n\n if (format)\n return format(num, str);\n\n return str;\n }, [format, precision]);\n\n const [formattedValue, setFormattedValue] = React.useState(() => formatInternal(value));\n\n // See if new initialValue props have changed since component mounted\n React.useEffect(() => {\n currentValueRef.current = value;\n const currentFormattedValue = formatInternal(currentValueRef.current);\n setFormattedValue(currentFormattedValue);\n }, [formatInternal, value]);\n\n const handleChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n const newVal = event.currentTarget.value;\n setFormattedValue(newVal);\n isControlled && onChange && onChange(parseInternal(newVal), newVal);\n }, [isControlled, onChange, parseInternal]);\n\n const updateValue = React.useCallback((newVal: number) => {\n const newFormattedVal = formatInternal(newVal);\n onChange && onChange(newVal, newFormattedVal);\n setFormattedValue(newFormattedVal);\n }, [onChange, formatInternal]);\n\n const updateValueFromString = React.useCallback((strValue: string) => {\n const newVal = parseInternal(strValue);\n updateValue(newVal);\n }, [parseInternal, updateValue]);\n\n const handleBlur = React.useCallback((event: React.FocusEvent<HTMLInputElement>) => {\n const newVal = parseInternal(event.target.value);\n onBlur && onBlur(event);\n updateValue(newVal);\n }, [parseInternal, updateValue, onBlur]);\n\n const getIncrementValue = React.useCallback((increment: boolean) => {\n if (typeof step === \"function\") {\n const stepVal = step(increment ? \"up\" : \"down\");\n return stepVal ? stepVal : 1;\n }\n\n return !step ? 1 : step;\n }, [step]);\n\n /**\n * The internal method that actually sets the new value on the input\n */\n const applyStep = React.useCallback((increment: boolean) => {\n const incrementValue = getIncrementValue(increment);\n\n let num = parseInternal(formattedValue) + (increment ? incrementValue : -incrementValue);\n if (snap) {\n num = Math.round(num / incrementValue) * incrementValue;\n }\n\n const localMin = undefined === min ? Number.MIN_SAFE_INTEGER : min;\n const localMax = undefined === max ? Number.MAX_SAFE_INTEGER : max;\n num = Math.min(Math.max(num, localMin), localMax);\n\n updateValue(num);\n }, [formattedValue, getIncrementValue, max, min, parseInternal, snap, updateValue]);\n\n const handleKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLInputElement>) => {\n // istanbul ignore else\n if (event.key === SpecialKey.Enter) {\n updateValueFromString(event.currentTarget.value);\n event.preventDefault();\n event.stopPropagation();\n } else if (event.key === SpecialKey.Escape) {\n setFormattedValue(formatInternal(currentValueRef.current));\n event.preventDefault();\n } else if (event.key === SpecialKey.ArrowDown) {\n applyStep(false);\n event.preventDefault();\n event.stopPropagation();\n } else if (event.key === SpecialKey.ArrowUp) {\n applyStep(true);\n event.preventDefault();\n event.stopPropagation();\n }\n onKeyDown && onKeyDown(event);\n }, [applyStep, formatInternal, updateValueFromString, onKeyDown]);\n\n const handleDownClick = React.useCallback((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n applyStep(false);\n event.preventDefault();\n }, [applyStep]);\n\n const handleUpClick = React.useCallback((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n applyStep(true);\n event.preventDefault();\n }, [applyStep]);\n\n const handleFocus = React.useCallback((event: React.FocusEvent<HTMLInputElement>) => {\n event.currentTarget.select();\n }, []);\n\n const isDisabled = !!otherProps.disabled;\n const containerClasses = classnames(\"core-number-input-container\",\n containerClassName,\n showTouchButtons && \"core-number-buttons-for-touch\",\n isDisabled && \"core-number-input-disabled\",\n );\n\n const caretUp = showTouchButtons ? <SvgCaretUp /> : <SvgCaretUpSmall />;\n const caretDown = showTouchButtons ? <SvgCaretDown /> : <SvgCaretDownSmall />;\n\n return (\n <div className={containerClasses} style={containerStyle} >\n <Input ref={ref} value={formattedValue} onChange={handleChange} onKeyDown={handleKeyDown} onFocus={handleFocus} onBlur={handleBlur} size=\"small\" {...otherProps} />\n <div className={classnames(\"core-number-input-buttons-container\", showTouchButtons && \"core-number-buttons-for-touch\")}>\n { /* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */}\n <div className=\"core-number-input-button core-number-input-button-up\" tabIndex={-1} onClick={handleUpClick} role=\"presentation\" >\n <Icon iconSpec={caretUp} />\n </div>\n { /* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */}\n <div className=\"core-number-input-button core-number-input-button-down\" tabIndex={-1} onClick={handleDownClick} role=\"presentation\" >\n <Icon iconSpec={caretDown} />\n </div>\n </div>\n </div>\n );\n }\n);\n\n/** Input component for numbers with up and down buttons to increment and decrement the value.\n * @public\n */\nexport const NumberInput: (props: NumberInputProps) => JSX.Element | null = ForwardRefNumberInput;\n"]}
@@ -1,88 +1,88 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
5
- @import "../../base/base";
6
- @import "../variables";
7
-
8
- .core-number-input-container {
9
- position: relative;
10
- padding: 0;
11
- margin: 0;
12
- box-sizing: border-box;
13
-
14
- input {
15
- margin: 0;
16
- padding-right: 1.5em;
17
-
18
- &.iui-input {
19
- padding: $uicore-iui-input-padding;
20
- }
21
- }
22
-
23
- &.core-number-buttons-for-touch {
24
- input {
25
- padding-right: 3.5em;
26
- }
27
- }
28
-
29
- .core-number-input-buttons-container {
30
- position: absolute;
31
- top: 0;
32
- right: 0;
33
- width: 20px;
34
- height: 100%;
35
- @include uicore-centered;
36
- flex-direction: column;
37
-
38
- .core-number-input-button {
39
- font-size: 8px;
40
- outline: none;
41
- height: 100%;
42
- width: 100%;
43
- @include uicore-centered;
44
- &:hover {
45
- color: var(--iui-color-text-accent-hover);
46
- transition-duration: 150ms;
47
- }
48
- &.core-number-input-button-up {
49
- padding-top: 1px;
50
- }
51
- &.core-number-input-button-down {
52
- padding-top: 1px;
53
- }
54
- }
55
-
56
- &.core-number-buttons-for-touch {
57
- width: 3.5em;
58
- flex-direction: row-reverse;
59
-
60
- .core-number-input-button {
61
- font-size: 1em;
62
-
63
- &:hover {
64
- color: unset;
65
- transition-duration: unset;
66
- }
67
-
68
- &.core-number-input-button-up {
69
- padding-top: 2px;
70
- }
71
- &.core-number-input-button-down {
72
- padding-top: 2px;
73
- }
74
- }
75
- }
76
- }
77
- &.core-number-input-disabled {
78
- .core-number-input-button-up {
79
- pointer-events: none;
80
- color: var(--iui-color-text-disabled);
81
- }
82
-
83
- .core-number-input-button-down {
84
- pointer-events: none;
85
- color: var(--iui-color-text-disabled);
86
- }
87
- }
88
- }
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ @import "../../base/base";
6
+ @import "../variables";
7
+
8
+ .core-number-input-container {
9
+ position: relative;
10
+ padding: 0;
11
+ margin: 0;
12
+ box-sizing: border-box;
13
+
14
+ input {
15
+ margin: 0;
16
+ padding-right: 1.5em;
17
+
18
+ &.iui-input {
19
+ padding: $uicore-iui-input-padding;
20
+ }
21
+ }
22
+
23
+ &.core-number-buttons-for-touch {
24
+ input {
25
+ padding-right: 3.5em;
26
+ }
27
+ }
28
+
29
+ .core-number-input-buttons-container {
30
+ position: absolute;
31
+ top: 0;
32
+ right: 0;
33
+ width: 20px;
34
+ height: 100%;
35
+ @include uicore-centered;
36
+ flex-direction: column;
37
+
38
+ .core-number-input-button {
39
+ font-size: 8px;
40
+ outline: none;
41
+ height: 100%;
42
+ width: 100%;
43
+ @include uicore-centered;
44
+ &:hover {
45
+ color: var(--iui-color-text-accent-hover);
46
+ transition-duration: 150ms;
47
+ }
48
+ &.core-number-input-button-up {
49
+ padding-top: 1px;
50
+ }
51
+ &.core-number-input-button-down {
52
+ padding-top: 1px;
53
+ }
54
+ }
55
+
56
+ &.core-number-buttons-for-touch {
57
+ width: 3.5em;
58
+ flex-direction: row-reverse;
59
+
60
+ .core-number-input-button {
61
+ font-size: 1em;
62
+
63
+ &:hover {
64
+ color: unset;
65
+ transition-duration: unset;
66
+ }
67
+
68
+ &.core-number-input-button-up {
69
+ padding-top: 2px;
70
+ }
71
+ &.core-number-input-button-down {
72
+ padding-top: 2px;
73
+ }
74
+ }
75
+ }
76
+ }
77
+ &.core-number-input-disabled {
78
+ .core-number-input-button-up {
79
+ pointer-events: none;
80
+ color: var(--iui-color-text-disabled);
81
+ }
82
+
83
+ .core-number-input-button-down {
84
+ pointer-events: none;
85
+ color: var(--iui-color-text-disabled);
86
+ }
87
+ }
88
+ }
@@ -1,38 +1,38 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
5
- @import "../style/baseline";
6
- @import "../style/themecolors";
7
-
8
- // cspell:ignore unbordered
9
-
10
- $uicore-inputs-height: 22px;
11
- $uicore-inputs-height-large: 40px;
12
- $uicore-line-height: calc(var(--iui-size-s) * 1.4);
13
- $uicore-bordered-padding: calc(#{$uicore-bordered-padding} * 0.5);
14
- $uicore-unbordered-padding: calc(#{$uicore-unbordered-padding} * 0.5);
15
-
16
- $uicore-inputs-padding: calc(
17
- (#{$uicore-inputs-height} - #{$uicore-line-height}) * 0.5
18
- );
19
- $uicore-inputs-padding-large: calc(
20
- (#{$uicore-inputs-height-large} - #{$uicore-line-height}) * 0.5
21
- );
22
- $uicore-inputs-padding-bordered: calc(#{$uicore-inputs-padding} - 2px);
23
- $uicore-inputs-padding-bordered-large: calc(
24
- #{$uicore-inputs-padding-large} - 2px
25
- );
26
-
27
- $uicore-inputs-margin: calc(
28
- (#{$uicore-line-height} * 2 - #{$uicore-inputs-height}) * 0.5
29
- );
30
- $uicore-inputs-margin-large: calc(
31
- (#{$uicore-line-height} * 3 - #{$uicore-inputs-height-large}) * 0.5
32
- );
33
-
34
- $uicore-inputs-border-color: $buic-inputs-border;
35
-
36
- $uicore-inputs-focus-boxshadow: $buic-focus-boxshadow 0px 0px 0px 2px;
37
-
38
- $uicore-iui-input-padding: var(--iui-size-3xs) var(--iui-size-xs);
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ @import "../style/baseline";
6
+ @import "../style/themecolors";
7
+
8
+ // cspell:ignore unbordered
9
+
10
+ $uicore-inputs-height: 22px;
11
+ $uicore-inputs-height-large: 40px;
12
+ $uicore-line-height: calc(var(--iui-size-s) * 1.4);
13
+ $uicore-bordered-padding: calc(#{$uicore-bordered-padding} * 0.5);
14
+ $uicore-unbordered-padding: calc(#{$uicore-unbordered-padding} * 0.5);
15
+
16
+ $uicore-inputs-padding: calc(
17
+ (#{$uicore-inputs-height} - #{$uicore-line-height}) * 0.5
18
+ );
19
+ $uicore-inputs-padding-large: calc(
20
+ (#{$uicore-inputs-height-large} - #{$uicore-line-height}) * 0.5
21
+ );
22
+ $uicore-inputs-padding-bordered: calc(#{$uicore-inputs-padding} - 2px);
23
+ $uicore-inputs-padding-bordered-large: calc(
24
+ #{$uicore-inputs-padding-large} - 2px
25
+ );
26
+
27
+ $uicore-inputs-margin: calc(
28
+ (#{$uicore-line-height} * 2 - #{$uicore-inputs-height}) * 0.5
29
+ );
30
+ $uicore-inputs-margin-large: calc(
31
+ (#{$uicore-line-height} * 3 - #{$uicore-inputs-height-large}) * 0.5
32
+ );
33
+
34
+ $uicore-inputs-border-color: $buic-inputs-border;
35
+
36
+ $uicore-inputs-focus-boxshadow: $buic-focus-boxshadow 0px 0px 0px 2px;
37
+
38
+ $uicore-iui-input-padding: var(--iui-size-3xs) var(--iui-size-xs);
@@ -1,17 +1,17 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
5
- @import "./z-index";
6
-
7
- :root {
8
-
9
- /** Default Widget Opacity */
10
- --buic-widget-opacity: 0.90;
11
- /** Default Toolbar Opacity */
12
- --buic-toolbar-opacity: 0.50;
13
-
14
- /** CSS variables for each z-index layer */
15
- @include uicore-z-index-variables();
16
-
17
- }
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ @import "./z-index";
6
+
7
+ :root {
8
+
9
+ /** Default Widget Opacity */
10
+ --buic-widget-opacity: 0.90;
11
+ /** Default Toolbar Opacity */
12
+ --buic-toolbar-opacity: 0.50;
13
+
14
+ /** CSS variables for each z-index layer */
15
+ @include uicore-z-index-variables();
16
+
17
+ }
@@ -71,7 +71,7 @@ function processKeyboardNavigation(optionValues, itemIndex, key) {
71
71
  function Listbox(props) {
72
72
  const { ariaLabel, ariaLabelledBy, id, children, selectedValue, className, onListboxValueChange, onKeyDown, ...otherProps } = props;
73
73
  const listRef = React.useRef(null);
74
- const [listId] = React.useState(() => { return id ?? core_bentley_1.Guid.createValue(); });
74
+ const [listId] = React.useState(() => { return id !== null && id !== void 0 ? id : core_bentley_1.Guid.createValue(); });
75
75
  const optionValues = React.useMemo(() => getOptionValueArray(children), [children]);
76
76
  const classes = React.useMemo(() => (0, classnames_1.default)("core-listbox", className), [className]);
77
77
  const [currentValue, setCurrentValue] = React.useState(selectedValue);
@@ -199,9 +199,10 @@ function ListboxItem(props) {
199
199
  const itemRef = React.useRef(null);
200
200
  const isSelected = listboxValue === value;
201
201
  const handleClick = React.useCallback((event) => {
202
+ var _a, _b;
202
203
  event.preventDefault();
203
204
  // istanbul ignore next
204
- const selectedValue = event.currentTarget?.dataset?.value;
205
+ const selectedValue = (_b = (_a = event.currentTarget) === null || _a === void 0 ? void 0 : _a.dataset) === null || _b === void 0 ? void 0 : _b.value;
205
206
  // istanbul ignore else
206
207
  if (undefined !== selectedValue) {
207
208
  onListboxValueChange(selectedValue, event.ctrlKey);
@@ -1 +1 @@
1
- {"version":3,"file":"Listbox.js","sourceRoot":"","sources":["../../../../src/core-react/listbox/Listbox.tsx"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,+BAA+B;AAC/B,2CAAoC;AAEpC,0BAAwB;AACxB,sDAA2C;AAC3C,0DAAmD;AA6CnD;;;GAGG;AACH,uBAAuB;AACV,QAAA,cAAc,GAAG,KAAK,CAAC,aAAa,CAAsB,EAAE,oBAAoB,EAAE,CAAC,SAAmC,EAAE,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,2DAA2D;AAE3M,SAAS,MAAM,CAAC,GAAG,IAA+C;IAChE,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACtD,CAAC;AAED,SAAS,mBAAmB,CAAC,UAA2B;IACtD,OAAO,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAG,UAAiC,CAAC,KAA0B,CAAC,CAAC;AACjM,CAAC;AAED,SAAS,yBAAyB,CAAC,YAAgC,EAA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AAO,CAAC,GAAG,EAAE,CAAC,IAAA,oBAAU,EAAC,mBAAmB,EAAE,QAAQ,IAAI,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC9H,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAgB,IAAI,CAAC,CAAC;IAClD,MAAM,UAAU,GAAG,YAAY,KAAK,KAAK,CAAC;IAE1C,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,KAAkD,EAAE,EAAE;QAC3F,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,uBAAuB;QACvB,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,EAAE,OAAO,EAAE,KAAK,CAAC;QAC1D,uBAAuB;QACvB,IAAI,SAAS,KAAK,aAAa,EAAE;YAC/B,oBAAoB,CAAC,aAAa,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;SACpD;IACH,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAE3B,MAAM,SAAS,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACvC,OAAO,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAClC,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;IAEvB,OAAO;IACL,iEAAiE;IACjE,6CAIiB,UAAU,mBAIV,QAAQ,IAAI,SAAS;QACpC,uEAAuE;QACvE,sCAAsC;QACtC,wDAAwD;QACxD,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,OAAO,KACd,UAAU,EACd,GAAG,EAAE,OAAO,EACZ,EAAE,EAAE,SAAS,EAAE,gBAEH,KAAK,EACjB,OAAO,EAAE,WAAW,IAEnB,QAAQ,CACN,CACN,CAAC;AACJ,CAAC;AA9DD,kCA8DC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport * as React from \"react\";\r\nimport classnames from \"classnames\";\r\n\r\nimport \"./Listbox.scss\";\r\nimport { Guid } from \"@itwin/core-bentley\";\r\nimport { SpecialKey } from \"@itwin/appui-abstract\";\r\n\r\n/** Ideas borrowed from https://reacttraining.com/reach-ui/listbox */\r\n\r\n/**\r\n * `Listbox` value.\r\n * @alpha\r\n */\r\nexport type ListboxValue = string;\r\n\r\n/**\r\n * `Listbox` Props.\r\n * @alpha\r\n */\r\nexport interface ListboxProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement> {\r\n id?: string;\r\n selectedValue?: ListboxValue;\r\n ariaLabel?: any;\r\n ariaLabelledBy?: any;\r\n onListboxValueChange?: ((newValue: ListboxValue, isControlOrCommandPressed?: boolean) => void);\r\n}\r\n\r\n/**\r\n * `ListboxItem` Props.\r\n * @alpha\r\n */\r\nexport interface ListboxItemProps extends React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement> {\r\n /** The unique item's value. */\r\n value: ListboxValue;\r\n /** set if item is disabled. */\r\n disabled?: boolean;\r\n}\r\n\r\n/**\r\n * `Listbox` Context.\r\n * @alpha\r\n */\r\nexport interface ListboxContextProps {\r\n listboxId?: string;\r\n listboxValue?: ListboxValue;\r\n focusValue?: ListboxValue;\r\n onListboxValueChange: ((newValue: ListboxValue, isControlOrCommandPressed?: boolean) => void);\r\n listboxRef?: React.RefObject<HTMLUListElement>;\r\n}\r\n\r\n/**\r\n * Context set up by listbox for use by `ListboxItems` .\r\n * @alpha\r\n */\r\n// istanbul ignore next\r\nexport const ListboxContext = React.createContext<ListboxContextProps>({ onListboxValueChange: (_newValue: ListboxValue | undefined) => { } }); // eslint-disable-line @typescript-eslint/naming-convention\r\n\r\nfunction makeId(...args: Array<string | number | null | undefined>) {\r\n return args.filter((val) => val != null).join(\"--\");\r\n}\r\n\r\nfunction getOptionValueArray(childNodes: React.ReactNode): ListboxItemProps[] {\r\n return React.Children.toArray(childNodes).filter((node) => React.isValidElement(node) && node.props.value).map((optionNode) => ((optionNode as React.ReactElement).props as ListboxItemProps));\r\n}\r\n\r\nfunction processKeyboardNavigation(optionValues: ListboxItemProps[], itemIndex: number, key: string): [number, boolean] {\r\n let keyProcessed = false;\r\n let newIndex = itemIndex >= 0 ? itemIndex : 0;\r\n\r\n // Note: In aria example Page Up/Down just moves up or down by one item. See https://www.w3.org/TR/wai-aria-practices-1.1/examples/listbox/js/listbox.js\r\n if (key === SpecialKey.ArrowDown || key === SpecialKey.PageDown) {\r\n for (let i = itemIndex + 1; i < optionValues.length; i++) {\r\n if (!optionValues[i].disabled) {\r\n newIndex = i;\r\n break;\r\n }\r\n }\r\n keyProcessed = true;\r\n } else if (key === SpecialKey.ArrowUp || key === SpecialKey.PageUp) {\r\n for (let i = itemIndex - 1; i >= 0; i--) {\r\n if (!optionValues[i].disabled) {\r\n newIndex = i;\r\n break;\r\n }\r\n }\r\n keyProcessed = true;\r\n } else if (key === SpecialKey.Home) {\r\n for (let i = 0; i < optionValues.length; i++) {\r\n if (!optionValues[i].disabled) {\r\n newIndex = i;\r\n break;\r\n }\r\n }\r\n keyProcessed = true;\r\n } else if (key === SpecialKey.End) {\r\n for (let i = optionValues.length - 1; i >= 0; i--) {\r\n if (!optionValues[i].disabled) {\r\n newIndex = i;\r\n break;\r\n }\r\n }\r\n keyProcessed = true;\r\n }\r\n return [newIndex, keyProcessed];\r\n}\r\n\r\n/**\r\n * Single select `Listbox` component\r\n * @alpha\r\n */\r\nexport function Listbox(props: ListboxProps) {\r\n const { ariaLabel, ariaLabelledBy, id, children, selectedValue, className, onListboxValueChange, onKeyDown, ...otherProps } = props;\r\n const listRef = React.useRef<HTMLUListElement>(null);\r\n const [listId] = React.useState(() => { return id ?? Guid.createValue(); });\r\n const optionValues = React.useMemo(() => getOptionValueArray(children), [children]);\r\n const classes = React.useMemo(() => classnames(\"core-listbox\", className), [className]);\r\n const [currentValue, setCurrentValue] = React.useState<ListboxValue | undefined>(selectedValue);\r\n const [focusValue, setFocusValue] = React.useState<ListboxValue | undefined>(currentValue);\r\n\r\n React.useEffect(() => {\r\n setCurrentValue(selectedValue);\r\n setFocusValue(selectedValue);\r\n }, [selectedValue]);\r\n\r\n const scrollTopRef = React.useRef(0);\r\n const handleValueChange = React.useCallback((newValue: ListboxValue, isControlOrCommandPressed?: boolean) => {\r\n // istanbul ignore else\r\n if (newValue !== currentValue) {\r\n setCurrentValue(newValue);\r\n setFocusValue(newValue);\r\n if (onListboxValueChange)\r\n onListboxValueChange(newValue, isControlOrCommandPressed);\r\n }\r\n }, [setCurrentValue, currentValue, onListboxValueChange]);\r\n\r\n const focusOption = React.useCallback((itemIndex: number) => {\r\n // istanbul ignore else\r\n if (itemIndex >= 0 && itemIndex < optionValues.length) {\r\n const newSelection = optionValues[itemIndex];\r\n const listElement = listRef.current as HTMLUListElement;\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\r\n const optionToFocus = listElement.querySelector(`li[data-value=\"${newSelection.value}\"]`) as HTMLLIElement | null;\r\n // istanbul ignore else\r\n if (optionToFocus && listElement) {\r\n let newScrollTop = listElement.scrollTop;\r\n\r\n // istanbul ignore next\r\n if (listElement.scrollHeight > listElement.clientHeight) {\r\n const scrollBottom = listElement.clientHeight + listElement.scrollTop;\r\n const elementBottom = optionToFocus.offsetTop + optionToFocus.offsetHeight;\r\n if (elementBottom > scrollBottom) {\r\n newScrollTop = elementBottom - listElement.clientHeight;\r\n } else if (optionToFocus.offsetTop < listElement.scrollTop) {\r\n newScrollTop = optionToFocus.offsetTop;\r\n }\r\n scrollTopRef.current = newScrollTop;\r\n }\r\n setFocusValue(newSelection.value);\r\n }\r\n }\r\n }, [optionValues]);\r\n\r\n const handleKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLUListElement>) => {\r\n if (optionValues.length < 1)\r\n return;\r\n\r\n const itemIndex = (undefined === focusValue) ? -1 : optionValues.findIndex((optionValue) => ((optionValue.value === focusValue)));\r\n\r\n if (event.key === SpecialKey.Space) {\r\n event.preventDefault();\r\n // istanbul ignore else\r\n if (focusValue)\r\n handleValueChange(focusValue, event.getModifierState(\"Control\") || event.getModifierState(\"Meta\")); // Control or Command\r\n return;\r\n } else {\r\n const [newItemIndex, keyProcessed] = processKeyboardNavigation(optionValues, itemIndex, event.key);\r\n // istanbul ignore else\r\n if (keyProcessed) {\r\n event.preventDefault();\r\n focusOption(newItemIndex);\r\n return;\r\n }\r\n }\r\n\r\n // istanbul ignore else\r\n if (onKeyDown)\r\n onKeyDown(event);\r\n }, [focusValue, optionValues, focusOption, onKeyDown, handleValueChange]);\r\n\r\n const isInitialMount = React.useRef(true);\r\n\r\n React.useEffect(() => {\r\n const list = listRef.current as HTMLUListElement;\r\n\r\n if (isInitialMount.current) {\r\n isInitialMount.current = false;\r\n\r\n if (undefined !== focusValue) {\r\n const itemIndex = optionValues.findIndex((optionValue) => (optionValue.value === focusValue));\r\n focusOption(itemIndex);\r\n }\r\n } else {\r\n list.scrollTop = scrollTopRef.current;\r\n }\r\n }, [focusValue, focusOption, optionValues]);\r\n\r\n // istanbul ignore next\r\n const handleOnScroll = React.useCallback((_event: React.UIEvent<HTMLUListElement, UIEvent>) => {\r\n if (listRef.current)\r\n scrollTopRef.current = listRef.current.scrollTop;\r\n }, []);\r\n\r\n // istanbul ignore next\r\n const handleOnFocus = React.useCallback((_event: React.FocusEvent<HTMLUListElement>) => {\r\n if (!focusValue || 0 === focusValue.length) {\r\n if (currentValue) {\r\n setFocusValue(currentValue);\r\n } else {\r\n if (optionValues.length > 0)\r\n setFocusValue(optionValues[0].value);\r\n }\r\n }\r\n }, [currentValue, focusValue, optionValues]);\r\n\r\n return <ul\r\n className={classes}\r\n // If the listbox is not part of another widget, then it has a visible\r\n // label referenced by `aria-labelledby` on the element with role\r\n // `listbox`.\r\n // https://www.w3.org/TR/wai-aria-practices-1.2/#Listbox\r\n // If an `aria-label` is passed, we should skip `aria-labelledby` to\r\n // avoid confusion.\r\n aria-labelledby={ariaLabel ? undefined : ariaLabelledBy}\r\n aria-label={ariaLabel}\r\n // An element that contains or owns all the listbox options has role\r\n // listbox.\r\n // https://www.w3.org/TR/wai-aria-practices-1.2/#Listbox\r\n role=\"listbox\"\r\n // https://www.w3.org/TR/wai-aria-practices-1.2/examples/listbox/listbox-collapsible.html\r\n tabIndex={0}\r\n // https://www.w3.org/TR/wai-aria-practices-1.2/examples/listbox/listbox-scrollable.html\r\n aria-activedescendant={makeId(currentValue, listId)}\r\n {...otherProps}\r\n ref={listRef}\r\n id={listId}\r\n onKeyDown={handleKeyDown}\r\n onScroll={handleOnScroll}\r\n data-value={currentValue}\r\n data-focusvalue={focusValue}\r\n onFocus={handleOnFocus}\r\n >\r\n <ListboxContext.Provider\r\n value={{\r\n listboxValue: currentValue,\r\n focusValue,\r\n listboxId: listId,\r\n onListboxValueChange: handleValueChange,\r\n listboxRef: listRef,\r\n }}\r\n >\r\n {children}\r\n </ListboxContext.Provider>\r\n </ul>;\r\n}\r\n\r\n/**\r\n * `ListboxItem` component.\r\n * @alpha\r\n */\r\nexport function ListboxItem(props: ListboxItemProps) {\r\n const {\r\n children,\r\n value,\r\n className,\r\n disabled,\r\n ...otherProps\r\n } = props;\r\n\r\n const {\r\n listboxValue,\r\n focusValue,\r\n listboxId,\r\n onListboxValueChange,\r\n } = React.useContext(ListboxContext);\r\n\r\n const hasFocus = focusValue === value;\r\n\r\n const classes = React.useMemo(() => classnames(\"core-listbox-item\", hasFocus && \"focused\", className), [className, hasFocus]);\r\n const itemRef = React.useRef<HTMLLIElement>(null);\r\n const isSelected = listboxValue === value;\r\n\r\n const handleClick = React.useCallback((event: React.MouseEvent<HTMLLIElement, MouseEvent>) => {\r\n event.preventDefault();\r\n // istanbul ignore next\r\n const selectedValue = event.currentTarget?.dataset?.value;\r\n // istanbul ignore else\r\n if (undefined !== selectedValue) {\r\n onListboxValueChange(selectedValue, event.ctrlKey);\r\n }\r\n }, [onListboxValueChange]);\r\n\r\n const getItemId = React.useCallback(() => {\r\n return makeId(value, listboxId);\r\n }, [listboxId, value]);\r\n\r\n return (\r\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events\r\n <li\r\n // In a single-select listbox, the selected option has `aria-selected`\r\n // set to `true`.\r\n // https://www.w3.org/TR/wai-aria-practices-1.2/#Listbox\r\n aria-selected={isSelected}\r\n // Applicable to all host language elements regardless of whether a\r\n // `role` is applied.\r\n // https://www.w3.org/WAI/PF/aria/states_and_properties#global_states_header\r\n aria-disabled={disabled || undefined}\r\n // Each option in the listbox has role `option` and is a DOM descendant\r\n // of the element with role `listbox`.\r\n // https://www.w3.org/TR/wai-aria-practices-1.2/#Listbox\r\n role=\"option\"\r\n className={classes}\r\n {...otherProps}\r\n ref={itemRef}\r\n id={getItemId()}\r\n // used for css styling\r\n data-value={value}\r\n onClick={handleClick}\r\n >\r\n {children}\r\n </li>\r\n );\r\n}\r\n"]}
1
+ {"version":3,"file":"Listbox.js","sourceRoot":"","sources":["../../../../src/core-react/listbox/Listbox.tsx"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,+BAA+B;AAC/B,2CAAoC;AAEpC,0BAAwB;AACxB,sDAA2C;AAC3C,0DAAmD;AA6CnD;;;GAGG;AACH,uBAAuB;AACV,QAAA,cAAc,GAAG,KAAK,CAAC,aAAa,CAAsB,EAAE,oBAAoB,EAAE,CAAC,SAAmC,EAAE,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,2DAA2D;AAE3M,SAAS,MAAM,CAAC,GAAG,IAA+C;IAChE,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACtD,CAAC;AAED,SAAS,mBAAmB,CAAC,UAA2B;IACtD,OAAO,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAA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AAS,EAAE,OAAO,KACd,UAAU,EACd,GAAG,EAAE,OAAO,EACZ,EAAE,EAAE,SAAS,EAAE,gBAEH,KAAK,EACjB,OAAO,EAAE,WAAW,IAEnB,QAAQ,CACN,CACN,CAAC;AACJ,CAAC;AA9DD,kCA8DC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport * as React from \"react\";\nimport classnames from \"classnames\";\n\nimport \"./Listbox.scss\";\nimport { Guid } from \"@itwin/core-bentley\";\nimport { SpecialKey } from \"@itwin/appui-abstract\";\n\n/** Ideas borrowed from https://reacttraining.com/reach-ui/listbox */\n\n/**\n * `Listbox` value.\n * @alpha\n */\nexport type ListboxValue = string;\n\n/**\n * `Listbox` Props.\n * @alpha\n */\nexport interface ListboxProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement> {\n id?: string;\n selectedValue?: ListboxValue;\n ariaLabel?: any;\n ariaLabelledBy?: any;\n onListboxValueChange?: ((newValue: ListboxValue, isControlOrCommandPressed?: boolean) => void);\n}\n\n/**\n * `ListboxItem` Props.\n * @alpha\n */\nexport interface ListboxItemProps extends React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement> {\n /** The unique item's value. */\n value: ListboxValue;\n /** set if item is disabled. */\n disabled?: boolean;\n}\n\n/**\n * `Listbox` Context.\n * @alpha\n */\nexport interface ListboxContextProps {\n listboxId?: string;\n listboxValue?: ListboxValue;\n focusValue?: ListboxValue;\n onListboxValueChange: ((newValue: ListboxValue, isControlOrCommandPressed?: boolean) => void);\n listboxRef?: React.RefObject<HTMLUListElement>;\n}\n\n/**\n * Context set up by listbox for use by `ListboxItems` .\n * @alpha\n */\n// istanbul ignore next\nexport const ListboxContext = React.createContext<ListboxContextProps>({ onListboxValueChange: (_newValue: ListboxValue | undefined) => { } }); // eslint-disable-line @typescript-eslint/naming-convention\n\nfunction makeId(...args: Array<string | number | null | undefined>) {\n return args.filter((val) => val != null).join(\"--\");\n}\n\nfunction getOptionValueArray(childNodes: React.ReactNode): ListboxItemProps[] {\n return React.Children.toArray(childNodes).filter((node) => React.isValidElement(node) && node.props.value).map((optionNode) => ((optionNode as React.ReactElement).props as ListboxItemProps));\n}\n\nfunction processKeyboardNavigation(optionValues: ListboxItemProps[], itemIndex: number, key: string): [number, boolean] {\n let keyProcessed = false;\n let newIndex = itemIndex >= 0 ? itemIndex : 0;\n\n // Note: In aria example Page Up/Down just moves up or down by one item. See https://www.w3.org/TR/wai-aria-practices-1.1/examples/listbox/js/listbox.js\n if (key === SpecialKey.ArrowDown || key === SpecialKey.PageDown) {\n for (let i = itemIndex + 1; i < optionValues.length; i++) {\n if (!optionValues[i].disabled) {\n newIndex = i;\n break;\n }\n }\n keyProcessed = true;\n } else if (key === SpecialKey.ArrowUp || key === SpecialKey.PageUp) {\n for (let i = itemIndex - 1; i >= 0; i--) {\n if (!optionValues[i].disabled) {\n newIndex = i;\n break;\n }\n }\n keyProcessed = true;\n } else if (key === SpecialKey.Home) {\n for (let i = 0; i < optionValues.length; i++) {\n if (!optionValues[i].disabled) {\n newIndex = i;\n break;\n }\n }\n keyProcessed = true;\n } else if (key === SpecialKey.End) {\n for (let i = optionValues.length - 1; i >= 0; i--) {\n if (!optionValues[i].disabled) {\n newIndex = i;\n break;\n }\n }\n keyProcessed = true;\n }\n return [newIndex, keyProcessed];\n}\n\n/**\n * Single select `Listbox` component\n * @alpha\n */\nexport function Listbox(props: ListboxProps) {\n const { ariaLabel, ariaLabelledBy, id, children, selectedValue, className, onListboxValueChange, onKeyDown, ...otherProps } = props;\n const listRef = React.useRef<HTMLUListElement>(null);\n const [listId] = React.useState(() => { return id ?? Guid.createValue(); });\n const optionValues = React.useMemo(() => getOptionValueArray(children), [children]);\n const classes = React.useMemo(() => classnames(\"core-listbox\", className), [className]);\n const [currentValue, setCurrentValue] = React.useState<ListboxValue | undefined>(selectedValue);\n const [focusValue, setFocusValue] = React.useState<ListboxValue | undefined>(currentValue);\n\n React.useEffect(() => {\n setCurrentValue(selectedValue);\n setFocusValue(selectedValue);\n }, [selectedValue]);\n\n const scrollTopRef = React.useRef(0);\n const handleValueChange = React.useCallback((newValue: ListboxValue, isControlOrCommandPressed?: boolean) => {\n // istanbul ignore else\n if (newValue !== currentValue) {\n setCurrentValue(newValue);\n setFocusValue(newValue);\n if (onListboxValueChange)\n onListboxValueChange(newValue, isControlOrCommandPressed);\n }\n }, [setCurrentValue, currentValue, onListboxValueChange]);\n\n const focusOption = React.useCallback((itemIndex: number) => {\n // istanbul ignore else\n if (itemIndex >= 0 && itemIndex < optionValues.length) {\n const newSelection = optionValues[itemIndex];\n const listElement = listRef.current as HTMLUListElement;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n const optionToFocus = listElement.querySelector(`li[data-value=\"${newSelection.value}\"]`) as HTMLLIElement | null;\n // istanbul ignore else\n if (optionToFocus && listElement) {\n let newScrollTop = listElement.scrollTop;\n\n // istanbul ignore next\n if (listElement.scrollHeight > listElement.clientHeight) {\n const scrollBottom = listElement.clientHeight + listElement.scrollTop;\n const elementBottom = optionToFocus.offsetTop + optionToFocus.offsetHeight;\n if (elementBottom > scrollBottom) {\n newScrollTop = elementBottom - listElement.clientHeight;\n } else if (optionToFocus.offsetTop < listElement.scrollTop) {\n newScrollTop = optionToFocus.offsetTop;\n }\n scrollTopRef.current = newScrollTop;\n }\n setFocusValue(newSelection.value);\n }\n }\n }, [optionValues]);\n\n const handleKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLUListElement>) => {\n if (optionValues.length < 1)\n return;\n\n const itemIndex = (undefined === focusValue) ? -1 : optionValues.findIndex((optionValue) => ((optionValue.value === focusValue)));\n\n if (event.key === SpecialKey.Space) {\n event.preventDefault();\n // istanbul ignore else\n if (focusValue)\n handleValueChange(focusValue, event.getModifierState(\"Control\") || event.getModifierState(\"Meta\")); // Control or Command\n return;\n } else {\n const [newItemIndex, keyProcessed] = processKeyboardNavigation(optionValues, itemIndex, event.key);\n // istanbul ignore else\n if (keyProcessed) {\n event.preventDefault();\n focusOption(newItemIndex);\n return;\n }\n }\n\n // istanbul ignore else\n if (onKeyDown)\n onKeyDown(event);\n }, [focusValue, optionValues, focusOption, onKeyDown, handleValueChange]);\n\n const isInitialMount = React.useRef(true);\n\n React.useEffect(() => {\n const list = listRef.current as HTMLUListElement;\n\n if (isInitialMount.current) {\n isInitialMount.current = false;\n\n if (undefined !== focusValue) {\n const itemIndex = optionValues.findIndex((optionValue) => (optionValue.value === focusValue));\n focusOption(itemIndex);\n }\n } else {\n list.scrollTop = scrollTopRef.current;\n }\n }, [focusValue, focusOption, optionValues]);\n\n // istanbul ignore next\n const handleOnScroll = React.useCallback((_event: React.UIEvent<HTMLUListElement, UIEvent>) => {\n if (listRef.current)\n scrollTopRef.current = listRef.current.scrollTop;\n }, []);\n\n // istanbul ignore next\n const handleOnFocus = React.useCallback((_event: React.FocusEvent<HTMLUListElement>) => {\n if (!focusValue || 0 === focusValue.length) {\n if (currentValue) {\n setFocusValue(currentValue);\n } else {\n if (optionValues.length > 0)\n setFocusValue(optionValues[0].value);\n }\n }\n }, [currentValue, focusValue, optionValues]);\n\n return <ul\n className={classes}\n // If the listbox is not part of another widget, then it has a visible\n // label referenced by `aria-labelledby` on the element with role\n // `listbox`.\n // https://www.w3.org/TR/wai-aria-practices-1.2/#Listbox\n // If an `aria-label` is passed, we should skip `aria-labelledby` to\n // avoid confusion.\n aria-labelledby={ariaLabel ? undefined : ariaLabelledBy}\n aria-label={ariaLabel}\n // An element that contains or owns all the listbox options has role\n // listbox.\n // https://www.w3.org/TR/wai-aria-practices-1.2/#Listbox\n role=\"listbox\"\n // https://www.w3.org/TR/wai-aria-practices-1.2/examples/listbox/listbox-collapsible.html\n tabIndex={0}\n // https://www.w3.org/TR/wai-aria-practices-1.2/examples/listbox/listbox-scrollable.html\n aria-activedescendant={makeId(currentValue, listId)}\n {...otherProps}\n ref={listRef}\n id={listId}\n onKeyDown={handleKeyDown}\n onScroll={handleOnScroll}\n data-value={currentValue}\n data-focusvalue={focusValue}\n onFocus={handleOnFocus}\n >\n <ListboxContext.Provider\n value={{\n listboxValue: currentValue,\n focusValue,\n listboxId: listId,\n onListboxValueChange: handleValueChange,\n listboxRef: listRef,\n }}\n >\n {children}\n </ListboxContext.Provider>\n </ul>;\n}\n\n/**\n * `ListboxItem` component.\n * @alpha\n */\nexport function ListboxItem(props: ListboxItemProps) {\n const {\n children,\n value,\n className,\n disabled,\n ...otherProps\n } = props;\n\n const {\n listboxValue,\n focusValue,\n listboxId,\n onListboxValueChange,\n } = React.useContext(ListboxContext);\n\n const hasFocus = focusValue === value;\n\n const classes = React.useMemo(() => classnames(\"core-listbox-item\", hasFocus && \"focused\", className), [className, hasFocus]);\n const itemRef = React.useRef<HTMLLIElement>(null);\n const isSelected = listboxValue === value;\n\n const handleClick = React.useCallback((event: React.MouseEvent<HTMLLIElement, MouseEvent>) => {\n event.preventDefault();\n // istanbul ignore next\n const selectedValue = event.currentTarget?.dataset?.value;\n // istanbul ignore else\n if (undefined !== selectedValue) {\n onListboxValueChange(selectedValue, event.ctrlKey);\n }\n }, [onListboxValueChange]);\n\n const getItemId = React.useCallback(() => {\n return makeId(value, listboxId);\n }, [listboxId, value]);\n\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events\n <li\n // In a single-select listbox, the selected option has `aria-selected`\n // set to `true`.\n // https://www.w3.org/TR/wai-aria-practices-1.2/#Listbox\n aria-selected={isSelected}\n // Applicable to all host language elements regardless of whether a\n // `role` is applied.\n // https://www.w3.org/WAI/PF/aria/states_and_properties#global_states_header\n aria-disabled={disabled || undefined}\n // Each option in the listbox has role `option` and is a DOM descendant\n // of the element with role `listbox`.\n // https://www.w3.org/TR/wai-aria-practices-1.2/#Listbox\n role=\"option\"\n className={classes}\n {...otherProps}\n ref={itemRef}\n id={getItemId()}\n // used for css styling\n data-value={value}\n onClick={handleClick}\n >\n {children}\n </li>\n );\n}\n"]}
@@ -1,54 +1,54 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
5
- @import "../index";
6
-
7
- $uicore-list-item-height: calc(var(--iui-size-s) * 2);
8
-
9
- ul.core-listbox {
10
- list-style: none;
11
- outline: none;
12
- padding: 0;
13
- margin: 0;
14
- box-sizing: border-box;
15
- width: 100%;
16
- height: 100%;
17
- display: flex;
18
- flex-direction: column;
19
- overflow: auto;
20
- color: var(--iui-color-text);
21
- border: 1px solid var(--iui-color-border);
22
- position: relative; // required to properly set scrollTop position
23
-
24
- @include uicore-touch-scrolling;
25
- @include uicore-scrollbar();
26
-
27
- &:focus {
28
- border-color: var(--iui-color-border-accent);
29
-
30
- li.core-listbox-item.focused {
31
- background-color: var(--iui-color-background-accent-muted);
32
- border: 1px solid var(--iui-color-border-accent);
33
- }
34
- }
35
-
36
- li.core-listbox-item {
37
- display: inline-flex;
38
- line-height: $uicore-list-item-height;
39
- padding-left: 4px;
40
-
41
- &[aria-selected="true"] {
42
- background-color: var(--iui-color-background-accent-muted);
43
- }
44
-
45
- &[aria-disabled="true"] {
46
- pointer-events: none;
47
- color: var(--iui-color-text-disabled);
48
- }
49
-
50
- &:hover {
51
- background-color: var(--iui-color-background-hover);
52
- }
53
- }
54
- }
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ @import "../index";
6
+
7
+ $uicore-list-item-height: calc(var(--iui-size-s) * 2);
8
+
9
+ ul.core-listbox {
10
+ list-style: none;
11
+ outline: none;
12
+ padding: 0;
13
+ margin: 0;
14
+ box-sizing: border-box;
15
+ width: 100%;
16
+ height: 100%;
17
+ display: flex;
18
+ flex-direction: column;
19
+ overflow: auto;
20
+ color: var(--iui-color-text);
21
+ border: 1px solid var(--iui-color-border);
22
+ position: relative; // required to properly set scrollTop position
23
+
24
+ @include uicore-touch-scrolling;
25
+ @include uicore-scrollbar();
26
+
27
+ &:focus {
28
+ border-color: var(--iui-color-border-accent);
29
+
30
+ li.core-listbox-item.focused {
31
+ background-color: var(--iui-color-background-accent-muted);
32
+ border: 1px solid var(--iui-color-border-accent);
33
+ }
34
+ }
35
+
36
+ li.core-listbox-item {
37
+ display: inline-flex;
38
+ line-height: $uicore-list-item-height;
39
+ padding-left: 4px;
40
+
41
+ &[aria-selected="true"] {
42
+ background-color: var(--iui-color-background-accent-muted);
43
+ }
44
+
45
+ &[aria-disabled="true"] {
46
+ pointer-events: none;
47
+ color: var(--iui-color-text-disabled);
48
+ }
49
+
50
+ &:hover {
51
+ background-color: var(--iui-color-background-hover);
52
+ }
53
+ }
54
+ }
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import "./LoadingBar.scss";
5
5
  import * as React from "react";
6
- import { CommonProps } from "../utils/Props";
6
+ import type { CommonProps } from "../utils/Props";
7
7
  /** Properties for [[LoadingBar]] component
8
8
  * @public
9
9
  */
@@ -1 +1 @@
1
- {"version":3,"file":"LoadingBar.d.ts","sourceRoot":"","sources":["../../../../src/core-react/loading/LoadingBar.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,mBAAmB,CAAC;AAE3B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAClD,cAAc;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,4CAA4C;IAC5C,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,qBAAa,UAAW,SAAQ,KAAK,CAAC,aAAa,CAAC,eAAe,CAAC;IAClE,OAAc,YAAY,EAAE,OAAO,CAAC,eAAe,CAAC,CAElD;IAEc,MAAM;CAYvB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAItD"}
1
+ {"version":3,"file":"LoadingBar.d.ts","sourceRoot":"","sources":["../../../../src/core-react/loading/LoadingBar.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,mBAAmB,CAAC;AAE3B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAClD,cAAc;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,4CAA4C;IAC5C,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,qBAAa,UAAW,SAAQ,KAAK,CAAC,aAAa,CAAC,eAAe,CAAC;IAClE,OAAc,YAAY,EAAE,OAAO,CAAC,eAAe,CAAC,CAElD;IAEc,MAAM;CAYvB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAItD"}