@itwin/imodel-components-react 4.0.0-dev.9 → 4.0.0

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 (327) hide show
  1. package/CHANGELOG.md +156 -1
  2. package/README.md +2 -2
  3. package/lib/cjs/imodel-components-react/UiIModelComponents.d.ts +28 -28
  4. package/lib/cjs/imodel-components-react/UiIModelComponents.d.ts.map +1 -1
  5. package/lib/cjs/imodel-components-react/UiIModelComponents.js +77 -79
  6. package/lib/cjs/imodel-components-react/UiIModelComponents.js.map +1 -1
  7. package/lib/cjs/imodel-components-react/color/AlphaSlider.d.ts +36 -36
  8. package/lib/cjs/imodel-components-react/color/AlphaSlider.js +190 -186
  9. package/lib/cjs/imodel-components-react/color/AlphaSlider.js.map +1 -1
  10. package/lib/cjs/imodel-components-react/color/ColorPickerButton.d.ts +37 -37
  11. package/lib/cjs/imodel-components-react/color/ColorPickerButton.d.ts.map +1 -1
  12. package/lib/cjs/imodel-components-react/color/ColorPickerButton.js +112 -107
  13. package/lib/cjs/imodel-components-react/color/ColorPickerButton.js.map +1 -1
  14. package/lib/cjs/imodel-components-react/color/ColorPickerButton.scss +4 -4
  15. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.d.ts +23 -23
  16. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js +78 -74
  17. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
  18. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.d.ts +44 -44
  19. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.d.ts.map +1 -1
  20. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js +143 -137
  21. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
  22. package/lib/cjs/imodel-components-react/color/ColorPickerPopup.scss +4 -5
  23. package/lib/cjs/imodel-components-react/color/HueSlider.d.ts +22 -22
  24. package/lib/cjs/imodel-components-react/color/HueSlider.js +203 -199
  25. package/lib/cjs/imodel-components-react/color/HueSlider.js.map +1 -1
  26. package/lib/cjs/imodel-components-react/color/SaturationPicker.d.ts +20 -20
  27. package/lib/cjs/imodel-components-react/color/SaturationPicker.js +217 -213
  28. package/lib/cjs/imodel-components-react/color/SaturationPicker.js.map +1 -1
  29. package/lib/cjs/imodel-components-react/color/Swatch.d.ts +22 -22
  30. package/lib/cjs/imodel-components-react/color/Swatch.js +64 -60
  31. package/lib/cjs/imodel-components-react/color/Swatch.js.map +1 -1
  32. package/lib/cjs/imodel-components-react/color/Swatch.scss +1 -2
  33. package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.d.ts +6 -6
  34. package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.js +23 -23
  35. package/lib/cjs/imodel-components-react/editors/ColorEditor.d.ts +44 -44
  36. package/lib/cjs/imodel-components-react/editors/ColorEditor.js +155 -151
  37. package/lib/cjs/imodel-components-react/editors/ColorEditor.js.map +1 -1
  38. package/lib/cjs/imodel-components-react/editors/ColorEditor.scss +1 -1
  39. package/lib/cjs/imodel-components-react/editors/WeightEditor.d.ts +47 -47
  40. package/lib/cjs/imodel-components-react/editors/WeightEditor.js +164 -160
  41. package/lib/cjs/imodel-components-react/editors/WeightEditor.js.map +1 -1
  42. package/lib/cjs/imodel-components-react/editors/WeightEditor.scss +1 -1
  43. package/lib/cjs/imodel-components-react/inputs/QuantityInput.d.ts +25 -25
  44. package/lib/cjs/imodel-components-react/inputs/QuantityInput.js +100 -96
  45. package/lib/cjs/imodel-components-react/inputs/QuantityInput.js.map +1 -1
  46. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.d.ts +44 -44
  47. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.d.ts.map +1 -1
  48. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js +272 -265
  49. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
  50. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.scss +6 -7
  51. package/lib/cjs/imodel-components-react/lineweight/Swatch.d.ts +33 -33
  52. package/lib/cjs/imodel-components-react/lineweight/Swatch.js +89 -85
  53. package/lib/cjs/imodel-components-react/lineweight/Swatch.js.map +1 -1
  54. package/lib/cjs/imodel-components-react/lineweight/Swatch.scss +1 -1
  55. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.d.ts +60 -60
  56. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js +163 -159
  57. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
  58. package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.scss +7 -8
  59. package/lib/cjs/imodel-components-react/navigationaids/Cube.d.ts +45 -45
  60. package/lib/cjs/imodel-components-react/navigationaids/Cube.js +131 -127
  61. package/lib/cjs/imodel-components-react/navigationaids/Cube.js.map +1 -1
  62. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +154 -174
  63. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.d.ts.map +1 -1
  64. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js +631 -634
  65. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
  66. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.scss +13 -17
  67. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts +145 -145
  68. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts.map +1 -1
  69. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js +657 -647
  70. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
  71. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.scss +4 -3
  72. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.d.ts +26 -26
  73. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js +103 -99
  74. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
  75. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.scss +2 -6
  76. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.d.ts +17 -17
  77. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js +57 -53
  78. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
  79. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.d.ts +18 -18
  80. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.d.ts.map +1 -1
  81. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js +88 -83
  82. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
  83. package/lib/cjs/imodel-components-react/quantityformat/FormatType.d.ts +17 -17
  84. package/lib/cjs/imodel-components-react/quantityformat/FormatType.js +90 -86
  85. package/lib/cjs/imodel-components-react/quantityformat/FormatType.js.map +1 -1
  86. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.d.ts +17 -17
  87. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js +113 -109
  88. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
  89. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.d.ts +19 -19
  90. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js +137 -133
  91. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
  92. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.d.ts +21 -21
  93. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js +188 -184
  94. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
  95. package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts +22 -22
  96. package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.js +149 -145
  97. package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +1 -1
  98. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts +17 -17
  99. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js +63 -59
  100. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +1 -1
  101. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts +17 -17
  102. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js +51 -47
  103. package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +1 -1
  104. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts +16 -16
  105. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js +58 -54
  106. package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +1 -1
  107. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.d.ts +18 -18
  108. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js +52 -48
  109. package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js.map +1 -1
  110. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.d.ts +17 -17
  111. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js +54 -50
  112. package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js.map +1 -1
  113. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts +17 -17
  114. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js +62 -58
  115. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +1 -1
  116. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts +17 -17
  117. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js +51 -47
  118. package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +1 -1
  119. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts +17 -17
  120. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js +60 -56
  121. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -1
  122. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts +17 -17
  123. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +99 -95
  124. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
  125. package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.d.ts +23 -23
  126. package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.js +123 -119
  127. package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.js.map +1 -1
  128. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.d.ts +52 -52
  129. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.d.ts.map +1 -1
  130. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.js +142 -143
  131. package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -1
  132. package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts +31 -31
  133. package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.js +69 -69
  134. package/lib/cjs/imodel-components-react/timeline/InlineEdit.d.ts +27 -27
  135. package/lib/cjs/imodel-components-react/timeline/InlineEdit.js +85 -81
  136. package/lib/cjs/imodel-components-react/timeline/InlineEdit.js.map +1 -1
  137. package/lib/cjs/imodel-components-react/timeline/InlineEdit.scss +2 -2
  138. package/lib/cjs/imodel-components-react/timeline/PlayerButton.d.ts +33 -33
  139. package/lib/cjs/imodel-components-react/timeline/PlayerButton.d.ts.map +1 -1
  140. package/lib/cjs/imodel-components-react/timeline/PlayerButton.js +99 -91
  141. package/lib/cjs/imodel-components-react/timeline/PlayerButton.js.map +1 -1
  142. package/lib/cjs/imodel-components-react/timeline/PlayerButton.scss +9 -12
  143. package/lib/cjs/imodel-components-react/timeline/Scrubber.d.ts +54 -54
  144. package/lib/cjs/imodel-components-react/timeline/Scrubber.js +195 -191
  145. package/lib/cjs/imodel-components-react/timeline/Scrubber.js.map +1 -1
  146. package/lib/cjs/imodel-components-react/timeline/Scrubber.scss +8 -15
  147. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.d.ts +77 -77
  148. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.d.ts.map +1 -1
  149. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js +432 -424
  150. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
  151. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.scss +27 -24
  152. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.d.ts +15 -15
  153. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js +58 -54
  154. package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js.map +1 -1
  155. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts +130 -133
  156. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts.map +1 -1
  157. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js +398 -358
  158. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
  159. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.scss +25 -11
  160. package/lib/cjs/imodel-components-react/timeline/interfaces.d.ts +145 -174
  161. package/lib/cjs/imodel-components-react/timeline/interfaces.d.ts.map +1 -1
  162. package/lib/cjs/imodel-components-react/timeline/interfaces.js +45 -45
  163. package/lib/cjs/imodel-components-react/timeline/interfaces.js.map +1 -1
  164. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.d.ts +42 -42
  165. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.d.ts.map +1 -1
  166. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js +278 -274
  167. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
  168. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.d.ts +106 -106
  169. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js +105 -105
  170. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
  171. package/lib/cjs/imodel-components-react.d.ts +81 -82
  172. package/lib/cjs/imodel-components-react.d.ts.map +1 -1
  173. package/lib/cjs/imodel-components-react.js +104 -101
  174. package/lib/cjs/imodel-components-react.js.map +1 -1
  175. package/lib/esm/imodel-components-react/UiIModelComponents.d.ts +28 -28
  176. package/lib/esm/imodel-components-react/UiIModelComponents.d.ts.map +1 -1
  177. package/lib/esm/imodel-components-react/UiIModelComponents.js +74 -75
  178. package/lib/esm/imodel-components-react/UiIModelComponents.js.map +1 -1
  179. package/lib/esm/imodel-components-react/color/AlphaSlider.d.ts +36 -36
  180. package/lib/esm/imodel-components-react/color/AlphaSlider.js +160 -160
  181. package/lib/esm/imodel-components-react/color/AlphaSlider.js.map +1 -1
  182. package/lib/esm/imodel-components-react/color/ColorPickerButton.d.ts +37 -37
  183. package/lib/esm/imodel-components-react/color/ColorPickerButton.d.ts.map +1 -1
  184. package/lib/esm/imodel-components-react/color/ColorPickerButton.js +83 -82
  185. package/lib/esm/imodel-components-react/color/ColorPickerButton.js.map +1 -1
  186. package/lib/esm/imodel-components-react/color/ColorPickerButton.scss +4 -4
  187. package/lib/esm/imodel-components-react/color/ColorPickerDialog.d.ts +23 -23
  188. package/lib/esm/imodel-components-react/color/ColorPickerDialog.js +51 -51
  189. package/lib/esm/imodel-components-react/color/ColorPickerPopup.d.ts +44 -44
  190. package/lib/esm/imodel-components-react/color/ColorPickerPopup.d.ts.map +1 -1
  191. package/lib/esm/imodel-components-react/color/ColorPickerPopup.js +114 -112
  192. package/lib/esm/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
  193. package/lib/esm/imodel-components-react/color/ColorPickerPopup.scss +4 -5
  194. package/lib/esm/imodel-components-react/color/HueSlider.d.ts +22 -22
  195. package/lib/esm/imodel-components-react/color/HueSlider.js +173 -173
  196. package/lib/esm/imodel-components-react/color/SaturationPicker.d.ts +20 -20
  197. package/lib/esm/imodel-components-react/color/SaturationPicker.js +187 -187
  198. package/lib/esm/imodel-components-react/color/Swatch.d.ts +22 -22
  199. package/lib/esm/imodel-components-react/color/Swatch.js +34 -34
  200. package/lib/esm/imodel-components-react/color/Swatch.scss +1 -2
  201. package/lib/esm/imodel-components-react/color/getCSSColorFromDef.d.ts +6 -6
  202. package/lib/esm/imodel-components-react/color/getCSSColorFromDef.js +19 -19
  203. package/lib/esm/imodel-components-react/editors/ColorEditor.d.ts +44 -44
  204. package/lib/esm/imodel-components-react/editors/ColorEditor.js +124 -124
  205. package/lib/esm/imodel-components-react/editors/ColorEditor.scss +1 -1
  206. package/lib/esm/imodel-components-react/editors/WeightEditor.d.ts +47 -47
  207. package/lib/esm/imodel-components-react/editors/WeightEditor.js +133 -133
  208. package/lib/esm/imodel-components-react/editors/WeightEditor.scss +1 -1
  209. package/lib/esm/imodel-components-react/inputs/QuantityInput.d.ts +25 -25
  210. package/lib/esm/imodel-components-react/inputs/QuantityInput.js +70 -70
  211. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.d.ts +44 -44
  212. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.d.ts.map +1 -1
  213. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js +243 -240
  214. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
  215. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.scss +6 -7
  216. package/lib/esm/imodel-components-react/lineweight/Swatch.d.ts +33 -33
  217. package/lib/esm/imodel-components-react/lineweight/Swatch.js +59 -59
  218. package/lib/esm/imodel-components-react/lineweight/Swatch.scss +1 -1
  219. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.d.ts +60 -60
  220. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js +134 -133
  221. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
  222. package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.scss +7 -8
  223. package/lib/esm/imodel-components-react/navigationaids/Cube.d.ts +45 -45
  224. package/lib/esm/imodel-components-react/navigationaids/Cube.js +100 -100
  225. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +154 -174
  226. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.d.ts.map +1 -1
  227. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js +601 -606
  228. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
  229. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.scss +13 -17
  230. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts +145 -145
  231. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts.map +1 -1
  232. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js +627 -620
  233. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
  234. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.scss +4 -3
  235. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.d.ts +26 -26
  236. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js +76 -76
  237. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.scss +2 -6
  238. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.d.ts +17 -17
  239. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js +30 -30
  240. package/lib/esm/imodel-components-react/quantityformat/FormatSample.d.ts +18 -18
  241. package/lib/esm/imodel-components-react/quantityformat/FormatSample.d.ts.map +1 -1
  242. package/lib/esm/imodel-components-react/quantityformat/FormatSample.js +61 -60
  243. package/lib/esm/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
  244. package/lib/esm/imodel-components-react/quantityformat/FormatType.d.ts +17 -17
  245. package/lib/esm/imodel-components-react/quantityformat/FormatType.js +63 -63
  246. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.d.ts +17 -17
  247. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js +83 -83
  248. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.d.ts +19 -19
  249. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js +110 -110
  250. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.d.ts +21 -21
  251. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js +158 -158
  252. package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts +22 -22
  253. package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.js +122 -122
  254. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts +17 -17
  255. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.js +36 -36
  256. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts +17 -17
  257. package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.js +24 -24
  258. package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts +16 -16
  259. package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.js +31 -31
  260. package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.d.ts +18 -18
  261. package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.js +25 -25
  262. package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.d.ts +17 -17
  263. package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.js +27 -27
  264. package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts +17 -17
  265. package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js +35 -35
  266. package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts +17 -17
  267. package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.js +24 -24
  268. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts +17 -17
  269. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.js +33 -33
  270. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts +17 -17
  271. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +69 -69
  272. package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.d.ts +23 -23
  273. package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.js +96 -96
  274. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.d.ts +52 -52
  275. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.d.ts.map +1 -1
  276. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.js +138 -139
  277. package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -1
  278. package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts +31 -31
  279. package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.js +65 -65
  280. package/lib/esm/imodel-components-react/timeline/InlineEdit.d.ts +27 -27
  281. package/lib/esm/imodel-components-react/timeline/InlineEdit.js +55 -55
  282. package/lib/esm/imodel-components-react/timeline/InlineEdit.scss +2 -2
  283. package/lib/esm/imodel-components-react/timeline/PlayerButton.d.ts +33 -33
  284. package/lib/esm/imodel-components-react/timeline/PlayerButton.d.ts.map +1 -1
  285. package/lib/esm/imodel-components-react/timeline/PlayerButton.js +68 -64
  286. package/lib/esm/imodel-components-react/timeline/PlayerButton.js.map +1 -1
  287. package/lib/esm/imodel-components-react/timeline/PlayerButton.scss +9 -12
  288. package/lib/esm/imodel-components-react/timeline/Scrubber.d.ts +54 -54
  289. package/lib/esm/imodel-components-react/timeline/Scrubber.js +164 -164
  290. package/lib/esm/imodel-components-react/timeline/Scrubber.scss +8 -15
  291. package/lib/esm/imodel-components-react/timeline/SolarTimeline.d.ts +77 -77
  292. package/lib/esm/imodel-components-react/timeline/SolarTimeline.d.ts.map +1 -1
  293. package/lib/esm/imodel-components-react/timeline/SolarTimeline.js +402 -398
  294. package/lib/esm/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
  295. package/lib/esm/imodel-components-react/timeline/SolarTimeline.scss +27 -24
  296. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.d.ts +15 -15
  297. package/lib/esm/imodel-components-react/timeline/SpeedTimeline.js +28 -28
  298. package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts +130 -133
  299. package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts.map +1 -1
  300. package/lib/esm/imodel-components-react/timeline/TimelineComponent.js +368 -332
  301. package/lib/esm/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
  302. package/lib/esm/imodel-components-react/timeline/TimelineComponent.scss +25 -11
  303. package/lib/esm/imodel-components-react/timeline/interfaces.d.ts +145 -174
  304. package/lib/esm/imodel-components-react/timeline/interfaces.d.ts.map +1 -1
  305. package/lib/esm/imodel-components-react/timeline/interfaces.js +42 -42
  306. package/lib/esm/imodel-components-react/timeline/interfaces.js.map +1 -1
  307. package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts +42 -42
  308. package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts.map +1 -1
  309. package/lib/esm/imodel-components-react/viewport/ViewportComponent.js +251 -251
  310. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.d.ts +106 -106
  311. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js +96 -95
  312. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
  313. package/lib/esm/imodel-components-react.d.ts +81 -82
  314. package/lib/esm/imodel-components-react.d.ts.map +1 -1
  315. package/lib/esm/imodel-components-react.js +86 -87
  316. package/lib/esm/imodel-components-react.js.map +1 -1
  317. package/package.json +35 -37
  318. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.d.ts +0 -22
  319. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.d.ts.map +0 -1
  320. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.js +0 -146
  321. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.js.map +0 -1
  322. package/lib/cjs/imodel-components-react/color/ColorPickerPanel.scss +0 -94
  323. package/lib/esm/imodel-components-react/color/ColorPickerPanel.d.ts +0 -22
  324. package/lib/esm/imodel-components-react/color/ColorPickerPanel.d.ts.map +0 -1
  325. package/lib/esm/imodel-components-react/color/ColorPickerPanel.js +0 -123
  326. package/lib/esm/imodel-components-react/color/ColorPickerPanel.js.map +0 -1
  327. package/lib/esm/imodel-components-react/color/ColorPickerPanel.scss +0 -94
@@ -1,45 +1,45 @@
1
- /** @packageDocumentation
2
- * @module Color
3
- */
4
- import * as React from "react";
5
- import { ColorDef } from "@itwin/core-common";
6
- import { RelativePosition } from "@itwin/appui-abstract";
7
- import { CommonProps } from "@itwin/core-react";
8
- import "./ColorPickerPopup.scss";
9
- /** Properties for the [[ColorPickerPopup]] React component
10
- * @public
11
- */
12
- export interface ColorPickerPopupProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {
13
- /** Current color */
14
- initialColor: ColorDef;
15
- /** Preset colors. Pass undefined to show default preset colors. Pass empty array to show no presets.
16
- * Displayed in rows of 9 items */
17
- colorDefs?: ColorDef[];
18
- /** Function to call when the color value is changed */
19
- onColorChange?: ((newColor: ColorDef) => void) | undefined;
20
- /** Function to call when the popup is closed */
21
- onClose?: ((colorValue: ColorDef) => void) | undefined;
22
- /** Disabled or not */
23
- disabled?: boolean;
24
- /** Readonly or not, color displayed on button but button will not trigger pop-up */
25
- readonly?: boolean;
26
- /** popup position. If not set RelativePosition.BottomLeft is used */
27
- popupPosition?: RelativePosition;
28
- /** Provides ability to return reference to HTMLButtonElement */
29
- ref?: React.Ref<HTMLButtonElement>;
30
- /** If true show up/down caret next to color */
31
- showCaret?: boolean;
32
- /** If true, don't propagate clicks out of the ColorPicker */
33
- captureClicks?: boolean;
34
- /** If true, don't show close button at top */
35
- hideCloseButton?: boolean;
36
- /** If set show input values */
37
- colorInputType?: "hsl" | "rgb" | "hex";
38
- }
39
- /**
40
- * ColorPickerButton component that allows user to select a color from a set of color swatches or to define a new color.
41
- * @note Using forwardRef so the ColorEditor (Type Editor) can access the ref of the button element inside this component.
42
- * @public
43
- */
44
- export declare const ColorPickerPopup: (props: ColorPickerPopupProps) => JSX.Element | null;
1
+ /** @packageDocumentation
2
+ * @module Color
3
+ */
4
+ import * as React from "react";
5
+ import { ColorDef } from "@itwin/core-common";
6
+ import { RelativePosition } from "@itwin/appui-abstract";
7
+ import { CommonProps } from "@itwin/core-react";
8
+ import "./ColorPickerPopup.scss";
9
+ /** Properties for the [[ColorPickerPopup]] React component
10
+ * @public
11
+ */
12
+ export interface ColorPickerPopupProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {
13
+ /** Current color */
14
+ initialColor: ColorDef;
15
+ /** Preset colors. Pass undefined to show default preset colors. Pass empty array to show no presets.
16
+ * Displayed in rows of 9 items */
17
+ colorDefs?: ColorDef[];
18
+ /** Function to call when the color value is changed */
19
+ onColorChange?: ((newColor: ColorDef) => void) | undefined;
20
+ /** Function to call when the popup is closed */
21
+ onClose?: ((colorValue: ColorDef) => void) | undefined;
22
+ /** Disabled or not */
23
+ disabled?: boolean;
24
+ /** Readonly or not, color displayed on button but button will not trigger pop-up */
25
+ readonly?: boolean;
26
+ /** popup position. If not set RelativePosition.BottomLeft is used */
27
+ popupPosition?: RelativePosition;
28
+ /** Provides ability to return reference to HTMLButtonElement */
29
+ ref?: React.Ref<HTMLButtonElement>;
30
+ /** If true show up/down caret next to color */
31
+ showCaret?: boolean;
32
+ /** If true, don't propagate clicks out of the ColorPicker */
33
+ captureClicks?: boolean;
34
+ /** If true, don't show close button at top */
35
+ hideCloseButton?: boolean;
36
+ /** If set show input values */
37
+ colorInputType?: "hsl" | "rgb" | "hex";
38
+ }
39
+ /**
40
+ * ColorPickerButton component that allows user to select a color from a set of color swatches or to define a new color.
41
+ * @note Using forwardRef so the ColorEditor (Type Editor) can access the ref of the button element inside this component.
42
+ * @public
43
+ */
44
+ export declare const ColorPickerPopup: (props: ColorPickerPopupProps) => JSX.Element | null;
45
45
  //# sourceMappingURL=ColorPickerPopup.d.ts.map
@@ -1 +1 @@
1
- {"version":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9C,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,+BAA+B;IAC/B,cAAc,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;CACxC;AAiID;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,GAAG,CAAC,OAAO,GAAG,IAAiC,CAAC"}
@@ -1,113 +1,115 @@
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
- /** @packageDocumentation
6
- * @module Color
7
- */
8
- // cSpell:ignore colorpicker
9
- import * as React from "react";
10
- import classnames from "classnames";
11
- import { ColorByName, ColorDef } from "@itwin/core-common";
12
- import { RelativePosition } from "@itwin/appui-abstract";
13
- import { Popup, useRefs, WebFontIcon } from "@itwin/core-react";
14
- // import { ColorPickerPanel } from "./ColorPickerPanel";
15
- import { ColorBuilder, ColorInputPanel, ColorPalette, ColorPicker, ColorValue } from "@itwin/itwinui-react";
16
- import "./ColorPickerPopup.scss";
17
- import { getCSSColorFromDef } from "./getCSSColorFromDef";
18
- import { UiIModelComponents } from "../UiIModelComponents";
19
- // Defined using following pattern (const ColorPickerPopup at bottom) to ensure useful API documentation is extracted
20
- const ForwardRefColorPickerPopup = React.forwardRef(function ForwardRefColorPickerPopup(props, ref) {
21
- const target = React.useRef(null);
22
- const refs = useRefs(target, ref); // combine ref needed for target with the forwardRef needed by the Parent when parent is a Type Editor.
23
- const [showPopup, setShowPopup] = React.useState(false);
24
- const [colorDef, setColorDef] = React.useState(props.initialColor);
25
- const initialColorRef = React.useRef(props.initialColor);
26
- React.useEffect(() => {
27
- if (props.initialColor !== initialColorRef.current) {
28
- initialColorRef.current = props.initialColor;
29
- setColorDef(props.initialColor);
30
- }
31
- }, [props.initialColor]);
32
- const defaultColors = React.useRef([
33
- ColorValue.fromTbgr(ColorByName.red),
34
- ColorValue.fromTbgr(ColorByName.orange),
35
- ColorValue.fromTbgr(ColorByName.yellow),
36
- ColorValue.fromTbgr(ColorByName.green),
37
- ColorValue.fromTbgr(ColorByName.blue),
38
- ColorValue.fromTbgr(ColorByName.mediumBlue),
39
- ColorValue.fromTbgr(ColorByName.indigo),
40
- ColorValue.fromTbgr(ColorByName.violet),
41
- ColorValue.fromTbgr(ColorByName.black),
42
- ColorValue.fromTbgr(ColorByName.white),
43
- ColorValue.fromTbgr(ColorByName.cyan),
44
- ColorValue.fromTbgr(ColorByName.fuchsia),
45
- ColorValue.fromTbgr(ColorByName.tan),
46
- ColorValue.fromTbgr(ColorByName.gray),
47
- ColorValue.fromTbgr(ColorByName.brown),
48
- ColorValue.fromTbgr(ColorByName.purple),
49
- ColorValue.fromTbgr(ColorByName.olive),
50
- ColorValue.fromTbgr(ColorByName.darkGreen),
51
- ]);
52
- // istanbul ignore next
53
- const closePopup = React.useCallback(() => {
54
- props.onClose && props.onClose(colorDef);
55
- setShowPopup(false);
56
- }, [colorDef, props]);
57
- const togglePopup = React.useCallback(() => {
58
- setShowPopup(!showPopup);
59
- }, [showPopup]);
60
- const handleColorChanged = React.useCallback((newColorValue) => {
61
- const newColor = ColorDef.fromTbgr(newColorValue.toTbgr());
62
- // istanbul ignore else
63
- if (!newColor.equals(colorDef)) {
64
- setColorDef(newColor);
65
- // istanbul ignore else
66
- props.onColorChange && props.onColorChange(newColor);
67
- }
68
- }, [colorDef, props]);
69
- const rgbaString = getCSSColorFromDef(colorDef);
70
- const buttonStyle = { ...props.style };
71
- const swatchStyle = { backgroundColor: rgbaString };
72
- const buttonClassNames = classnames("components-colorpicker-popup-button", props.readonly && "readonly", props.className);
73
- const clickHandler = (event) => {
74
- // istanbul ignore else
75
- if (props.captureClicks)
76
- event.stopPropagation();
77
- };
78
- const colorOptions = React.useMemo(() => {
79
- if (props.colorDefs && props.colorDefs.length) {
80
- return props.colorDefs.map((def) => ColorValue.fromTbgr(def.tbgr));
81
- }
82
- if (props.colorDefs && 0 === props.colorDefs.length)
83
- return undefined;
84
- return defaultColors.current;
85
- }, [props.colorDefs]);
86
- const popupPosition = undefined !== props.popupPosition ? props.popupPosition : RelativePosition.BottomLeft;
87
- const [closeLabel] = React.useState(() => UiIModelComponents.translate("color.close"));
88
- const [togglePopupLabel] = React.useState(() => UiIModelComponents.translate("color.toggleColorPopup"));
89
- return (
90
- /* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
91
- React.createElement("div", { onClick: clickHandler },
92
- React.createElement("button", { "data-testid": "components-colorpicker-popup-button", onClick: togglePopup, className: buttonClassNames, style: buttonStyle, disabled: props.disabled, ref: refs, title: togglePopupLabel },
93
- React.createElement("div", { className: "components-colorpicker-button-container" },
94
- React.createElement("div", { className: "components-colorpicker-button-color-swatch", style: swatchStyle }),
95
- props.showCaret && React.createElement(WebFontIcon, { className: "components-caret", iconName: showPopup ? "icon-caret-up" : "icon-caret-down", iconSize: "x-small" }))),
96
- React.createElement(Popup, { className: "components-colorpicker-popup", isOpen: showPopup, position: popupPosition, onClose: closePopup, target: target.current, closeOnNestedPopupOutsideClick: true },
97
- React.createElement("div", { className: "components-colorpicker-popup-panel-padding" },
98
- !props.hideCloseButton &&
99
- React.createElement("button", { title: closeLabel, className: "core-focus-trap-ignore-initial core-dialog-close icon icon-close", "data-testid": "core-dialog-close", onClick: togglePopup }),
100
- React.createElement(ColorPicker, { selectedColor: ColorValue.fromTbgr(colorDef.tbgr), onChangeComplete: handleColorChanged },
101
- React.createElement(ColorBuilder, null),
102
- props.colorInputType &&
103
- React.createElement(ColorInputPanel, { defaultColorFormat: props.colorInputType }),
104
- colorOptions &&
105
- React.createElement(ColorPalette, { colors: colorOptions }))))));
106
- });
107
- /**
108
- * ColorPickerButton component that allows user to select a color from a set of color swatches or to define a new color.
109
- * @note Using forwardRef so the ColorEditor (Type Editor) can access the ref of the button element inside this component.
110
- * @public
111
- */
112
- export const ColorPickerPopup = ForwardRefColorPickerPopup;
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
+ /** @packageDocumentation
6
+ * @module Color
7
+ */
8
+ // cSpell:ignore colorpicker
9
+ import * as React from "react";
10
+ import classnames from "classnames";
11
+ import { ColorByName, ColorDef } from "@itwin/core-common";
12
+ import { RelativePosition } from "@itwin/appui-abstract";
13
+ import { Icon, Popup, useRefs } from "@itwin/core-react";
14
+ // import { ColorPickerPanel } from "./ColorPickerPanel";
15
+ import { ColorBuilder, ColorInputPanel, ColorPalette, ColorPicker, ColorValue } from "@itwin/itwinui-react";
16
+ import "./ColorPickerPopup.scss";
17
+ import { getCSSColorFromDef } from "./getCSSColorFromDef";
18
+ import { UiIModelComponents } from "../UiIModelComponents";
19
+ import { SvgCaretDownSmall, SvgCaretUpSmall, SvgClose } from "@itwin/itwinui-icons-react";
20
+ // Defined using following pattern (const ColorPickerPopup at bottom) to ensure useful API documentation is extracted
21
+ const ForwardRefColorPickerPopup = React.forwardRef(function ForwardRefColorPickerPopup(props, ref) {
22
+ const target = React.useRef(null);
23
+ const refs = useRefs(target, ref); // combine ref needed for target with the forwardRef needed by the Parent when parent is a Type Editor.
24
+ const [showPopup, setShowPopup] = React.useState(false);
25
+ const [colorDef, setColorDef] = React.useState(props.initialColor);
26
+ const initialColorRef = React.useRef(props.initialColor);
27
+ React.useEffect(() => {
28
+ if (props.initialColor !== initialColorRef.current) {
29
+ initialColorRef.current = props.initialColor;
30
+ setColorDef(props.initialColor);
31
+ }
32
+ }, [props.initialColor]);
33
+ const defaultColors = React.useRef([
34
+ ColorValue.fromTbgr(ColorByName.red),
35
+ ColorValue.fromTbgr(ColorByName.orange),
36
+ ColorValue.fromTbgr(ColorByName.yellow),
37
+ ColorValue.fromTbgr(ColorByName.green),
38
+ ColorValue.fromTbgr(ColorByName.blue),
39
+ ColorValue.fromTbgr(ColorByName.mediumBlue),
40
+ ColorValue.fromTbgr(ColorByName.indigo),
41
+ ColorValue.fromTbgr(ColorByName.violet),
42
+ ColorValue.fromTbgr(ColorByName.black),
43
+ ColorValue.fromTbgr(ColorByName.white),
44
+ ColorValue.fromTbgr(ColorByName.cyan),
45
+ ColorValue.fromTbgr(ColorByName.fuchsia),
46
+ ColorValue.fromTbgr(ColorByName.tan),
47
+ ColorValue.fromTbgr(ColorByName.gray),
48
+ ColorValue.fromTbgr(ColorByName.brown),
49
+ ColorValue.fromTbgr(ColorByName.purple),
50
+ ColorValue.fromTbgr(ColorByName.olive),
51
+ ColorValue.fromTbgr(ColorByName.darkGreen),
52
+ ]);
53
+ // istanbul ignore next
54
+ const closePopup = React.useCallback(() => {
55
+ props.onClose && props.onClose(colorDef);
56
+ setShowPopup(false);
57
+ }, [colorDef, props]);
58
+ const togglePopup = React.useCallback(() => {
59
+ setShowPopup(!showPopup);
60
+ }, [showPopup]);
61
+ const handleColorChanged = React.useCallback((newColorValue) => {
62
+ const newColor = ColorDef.fromTbgr(newColorValue.toTbgr());
63
+ // istanbul ignore else
64
+ if (!newColor.equals(colorDef)) {
65
+ setColorDef(newColor);
66
+ // istanbul ignore else
67
+ props.onColorChange && props.onColorChange(newColor);
68
+ }
69
+ }, [colorDef, props]);
70
+ const rgbaString = getCSSColorFromDef(colorDef);
71
+ const buttonStyle = { ...props.style };
72
+ const swatchStyle = { backgroundColor: rgbaString };
73
+ const buttonClassNames = classnames("components-colorpicker-popup-button", props.readonly && "readonly", props.className);
74
+ const clickHandler = (event) => {
75
+ // istanbul ignore else
76
+ if (props.captureClicks)
77
+ event.stopPropagation();
78
+ };
79
+ const colorOptions = React.useMemo(() => {
80
+ if (props.colorDefs && props.colorDefs.length) {
81
+ return props.colorDefs.map((def) => ColorValue.fromTbgr(def.tbgr));
82
+ }
83
+ if (props.colorDefs && 0 === props.colorDefs.length)
84
+ return undefined;
85
+ return defaultColors.current;
86
+ }, [props.colorDefs]);
87
+ const popupPosition = undefined !== props.popupPosition ? props.popupPosition : RelativePosition.BottomLeft;
88
+ const [closeLabel] = React.useState(() => UiIModelComponents.translate("color.close"));
89
+ const [togglePopupLabel] = React.useState(() => UiIModelComponents.translate("color.toggleColorPopup"));
90
+ return (
91
+ /* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
92
+ React.createElement("div", { onClick: clickHandler },
93
+ React.createElement("button", { "data-testid": "components-colorpicker-popup-button", onClick: togglePopup, className: buttonClassNames, style: buttonStyle, disabled: props.disabled, ref: refs, title: togglePopupLabel },
94
+ React.createElement("div", { className: "components-colorpicker-button-container" },
95
+ React.createElement("div", { className: "components-colorpicker-button-color-swatch", style: swatchStyle, "data-testid": showPopup ? "caret-up" : "caret-down" }),
96
+ props.showCaret && React.createElement(Icon, { className: "components-caret", iconSpec: showPopup ? React.createElement(SvgCaretUpSmall, null) : React.createElement(SvgCaretDownSmall, null) }))),
97
+ React.createElement(Popup, { className: "components-colorpicker-popup", isOpen: showPopup, position: popupPosition, onClose: closePopup, target: target.current, closeOnNestedPopupOutsideClick: true },
98
+ React.createElement("div", { className: "components-colorpicker-popup-panel-padding" },
99
+ !props.hideCloseButton &&
100
+ React.createElement("button", { title: closeLabel, className: "core-focus-trap-ignore-initial core-dialog-close icon", "data-testid": "core-dialog-close", onClick: togglePopup },
101
+ React.createElement(Icon, { iconSpec: React.createElement(SvgClose, null) })),
102
+ React.createElement(ColorPicker, { selectedColor: ColorValue.fromTbgr(colorDef.tbgr), onChangeComplete: handleColorChanged },
103
+ React.createElement(ColorBuilder, null),
104
+ props.colorInputType &&
105
+ React.createElement(ColorInputPanel, { defaultColorFormat: props.colorInputType }),
106
+ colorOptions &&
107
+ React.createElement(ColorPalette, { colors: colorOptions }))))));
108
+ });
109
+ /**
110
+ * ColorPickerButton component that allows user to select a color from a set of color swatches or to define a new color.
111
+ * @note Using forwardRef so the ColorEditor (Type Editor) can access the ref of the button element inside this component.
112
+ * @public
113
+ */
114
+ export const ColorPickerPopup = ForwardRefColorPickerPopup;
113
115
  //# sourceMappingURL=ColorPickerPopup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPickerPopup.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/color/ColorPickerPopup.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,4BAA4B;AAE5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAe,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC7E,yDAAyD;AACzD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC5G,OAAO,yBAAyB,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAiC3D,qHAAqH;AAErH,MAAM,0BAA0B,GAAG,KAAK,CAAC,UAAU,CACjD,SAAS,0BAA0B,CAAC,KAAK,EAAE,GAAG;IAC5C,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAoB,IAAI,CAAC,CAAC;IACrD,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAE,uGAAuG;IAC3I,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACnE,MAAM,eAAe,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gBAAgB,EAAE,KAAK,EAAE,WAAW,EAC7H,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,gBAAgB;YAC5D,6BAAK,SAAS,EAAC,yCAAyC;gBACtD,6BAAK,SAAS,EAAC,4CAA4C,EAAC,KAAK,EAAE,WAAW,GAAI;gBACjF,KAAK,CAAC,SAAS,IAAI,oBAAC,WAAW,IAAC,SAAS,EAAC,kBAAkB,EAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,iBAAiB,EAAE,QAAQ,EAAC,SAAS,GAAG,CAC1I,CACC;QACT,oBAAC,KAAK,IACJ,SAAS,EAAC,8BAA8B,EACxC,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,MAAM,CAAC,OAAO,EACtB,8BAA8B;YAE9B,6BAAK,SAAS,EAAC,4CAA4C;gBACxD,CAAC,KAAK,CAAC,eAAe;oBACrB,gCAAQ,KAAK,EAAE,UAAU,EACvB,SAAS,EAAE,kEAAkE,iBACjE,mBAAmB,EAC/B,OAAO,EAAE,WAAW,GACpB;gBACJ,oBAAC,WAAW,IAAC,aAAa,EAAE,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,gBAAgB,EAAE,kBAAkB;oBAClG,oBAAC,YAAY,OAAG;oBACf,KAAK,CAAC,cAAc;wBACnB,oBAAC,eAAe,IAAC,kBAAkB,EAAE,KAAK,CAAC,cAAc,GAAI;oBAC9D,YAAY;wBACX,oBAAC,YAAY,IAAC,MAAM,EAAE,YAAY,GAAI,CAC5B,CACV,CACA,CACJ,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAyD,0BAA0B,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 Color\r\n */\r\n\r\n// cSpell:ignore colorpicker\r\n\r\nimport * as React from \"react\";\r\nimport classnames from \"classnames\";\r\nimport { ColorByName, ColorDef } from \"@itwin/core-common\";\r\nimport { RelativePosition } from \"@itwin/appui-abstract\";\r\nimport { CommonProps, Popup, useRefs, WebFontIcon } from \"@itwin/core-react\";\r\n// import { ColorPickerPanel } from \"./ColorPickerPanel\";\r\nimport { ColorBuilder, ColorInputPanel, ColorPalette, ColorPicker, ColorValue } from \"@itwin/itwinui-react\";\r\nimport \"./ColorPickerPopup.scss\";\r\nimport { getCSSColorFromDef } from \"./getCSSColorFromDef\";\r\nimport { UiIModelComponents } from \"../UiIModelComponents\";\r\n\r\n/** Properties for the [[ColorPickerPopup]] React component\r\n * @public\r\n */\r\nexport interface ColorPickerPopupProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {\r\n /** Current color */\r\n initialColor: ColorDef;\r\n /** Preset colors. Pass undefined to show default preset colors. Pass empty array to show no presets.\r\n * Displayed in rows of 9 items */\r\n colorDefs?: ColorDef[];\r\n /** Function to call when the color value is changed */\r\n onColorChange?: ((newColor: ColorDef) => void) | undefined;\r\n /** Function to call when the popup is closed */\r\n onClose?: ((colorValue: ColorDef) => void) | undefined;\r\n /** Disabled or not */\r\n disabled?: boolean;\r\n /** Readonly or not, color displayed on button but button will not trigger pop-up */\r\n readonly?: boolean;\r\n /** popup position. If not set RelativePosition.BottomLeft is used */\r\n popupPosition?: RelativePosition;\r\n /** Provides ability to return reference to HTMLButtonElement */\r\n ref?: React.Ref<HTMLButtonElement>;\r\n /** If true show up/down caret next to color */\r\n showCaret?: boolean;\r\n /** If true, don't propagate clicks out of the ColorPicker */\r\n captureClicks?: boolean;\r\n /** If true, don't show close button at top */\r\n hideCloseButton?: boolean;\r\n /** If set show input values */\r\n colorInputType?: \"hsl\" | \"rgb\" | \"hex\";\r\n}\r\n\r\n// Defined using following pattern (const ColorPickerPopup at bottom) to ensure useful API documentation is extracted\r\n\r\nconst ForwardRefColorPickerPopup = React.forwardRef<HTMLButtonElement, ColorPickerPopupProps>(\r\n function ForwardRefColorPickerPopup(props, ref) {\r\n const target = React.useRef<HTMLButtonElement>(null);\r\n const refs = useRefs(target, ref); // combine ref needed for target with the forwardRef needed by the Parent when parent is a Type Editor.\r\n const [showPopup, setShowPopup] = React.useState(false);\r\n const [colorDef, setColorDef] = React.useState(props.initialColor);\r\n const initialColorRef = React.useRef(props.initialColor);\r\n\r\n React.useEffect(() => {\r\n if (props.initialColor !== initialColorRef.current) {\r\n initialColorRef.current = props.initialColor;\r\n setColorDef(props.initialColor);\r\n }\r\n }, [props.initialColor]);\r\n\r\n const defaultColors = React.useRef(\r\n [\r\n ColorValue.fromTbgr(ColorByName.red),\r\n ColorValue.fromTbgr(ColorByName.orange),\r\n ColorValue.fromTbgr(ColorByName.yellow),\r\n ColorValue.fromTbgr(ColorByName.green),\r\n ColorValue.fromTbgr(ColorByName.blue),\r\n ColorValue.fromTbgr(ColorByName.mediumBlue),\r\n ColorValue.fromTbgr(ColorByName.indigo),\r\n ColorValue.fromTbgr(ColorByName.violet),\r\n ColorValue.fromTbgr(ColorByName.black),\r\n ColorValue.fromTbgr(ColorByName.white),\r\n ColorValue.fromTbgr(ColorByName.cyan),\r\n ColorValue.fromTbgr(ColorByName.fuchsia),\r\n ColorValue.fromTbgr(ColorByName.tan),\r\n ColorValue.fromTbgr(ColorByName.gray),\r\n ColorValue.fromTbgr(ColorByName.brown),\r\n ColorValue.fromTbgr(ColorByName.purple),\r\n ColorValue.fromTbgr(ColorByName.olive),\r\n ColorValue.fromTbgr(ColorByName.darkGreen),\r\n ]);\r\n\r\n // istanbul ignore next\r\n const closePopup = React.useCallback(() => {\r\n props.onClose && props.onClose(colorDef);\r\n setShowPopup(false);\r\n }, [colorDef, props]);\r\n\r\n const togglePopup = React.useCallback(() => {\r\n setShowPopup(!showPopup);\r\n }, [showPopup]);\r\n\r\n const handleColorChanged = React.useCallback((newColorValue: ColorValue) => {\r\n const newColor = ColorDef.fromTbgr(newColorValue.toTbgr());\r\n // istanbul ignore else\r\n if (!newColor.equals(colorDef)) {\r\n setColorDef(newColor);\r\n\r\n // istanbul ignore else\r\n props.onColorChange && props.onColorChange(newColor);\r\n }\r\n }, [colorDef, props]);\r\n\r\n const rgbaString = getCSSColorFromDef(colorDef);\r\n\r\n const buttonStyle = { ...props.style } as React.CSSProperties;\r\n const swatchStyle = { backgroundColor: rgbaString } as React.CSSProperties;\r\n const buttonClassNames = classnames(\"components-colorpicker-popup-button\",\r\n props.readonly && \"readonly\",\r\n props.className,\r\n );\r\n\r\n const clickHandler = (event: React.MouseEvent) => {\r\n // istanbul ignore else\r\n if (props.captureClicks)\r\n event.stopPropagation();\r\n };\r\n\r\n const colorOptions = React.useMemo(() => {\r\n if (props.colorDefs && props.colorDefs.length) {\r\n return props.colorDefs.map((def) => ColorValue.fromTbgr(def.tbgr));\r\n }\r\n if (props.colorDefs && 0 === props.colorDefs.length)\r\n return undefined;\r\n return defaultColors.current;\r\n }, [props.colorDefs]);\r\n const popupPosition = undefined !== props.popupPosition ? props.popupPosition : RelativePosition.BottomLeft;\r\n\r\n const [closeLabel] = React.useState(() => UiIModelComponents.translate(\"color.close\"));\r\n const [togglePopupLabel] = React.useState(() => UiIModelComponents.translate(\"color.toggleColorPopup\"));\r\n\r\n return (\r\n /* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */\r\n <div onClick={clickHandler}>\r\n <button data-testid=\"components-colorpicker-popup-button\" onClick={togglePopup} className={buttonClassNames} style={buttonStyle}\r\n disabled={props.disabled} ref={refs} title={togglePopupLabel} >\r\n <div className=\"components-colorpicker-button-container\">\r\n <div className=\"components-colorpicker-button-color-swatch\" style={swatchStyle} />\r\n {props.showCaret && <WebFontIcon className=\"components-caret\" iconName={showPopup ? \"icon-caret-up\" : \"icon-caret-down\"} iconSize=\"x-small\" />}\r\n </div>\r\n </button>\r\n <Popup\r\n className=\"components-colorpicker-popup\"\r\n isOpen={showPopup}\r\n position={popupPosition}\r\n onClose={closePopup}\r\n target={target.current}\r\n closeOnNestedPopupOutsideClick\r\n >\r\n <div className=\"components-colorpicker-popup-panel-padding\">\r\n {!props.hideCloseButton &&\r\n <button title={closeLabel}\r\n className={\"core-focus-trap-ignore-initial core-dialog-close icon icon-close\"}\r\n data-testid=\"core-dialog-close\"\r\n onClick={togglePopup}\r\n />}\r\n <ColorPicker selectedColor={ColorValue.fromTbgr(colorDef.tbgr)} onChangeComplete={handleColorChanged} >\r\n <ColorBuilder />\r\n {props.colorInputType &&\r\n <ColorInputPanel defaultColorFormat={props.colorInputType} />}\r\n {colorOptions &&\r\n <ColorPalette colors={colorOptions} />}\r\n </ColorPicker>\r\n </div>\r\n </Popup>\r\n </div>\r\n );\r\n }\r\n);\r\n\r\n/**\r\n * ColorPickerButton component that allows user to select a color from a set of color swatches or to define a new color.\r\n * @note Using forwardRef so the ColorEditor (Type Editor) can access the ref of the button element inside this component.\r\n * @public\r\n */\r\nexport const ColorPickerPopup: (props: ColorPickerPopupProps) => JSX.Element | null = ForwardRefColorPickerPopup;\r\n"]}
1
+ {"version":3,"file":"ColorPickerPopup.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/color/ColorPickerPopup.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,4BAA4B;AAE5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAe,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACtE,yDAAyD;AACzD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AG,GAAK,CACzH,CACC;QACT,oBAAC,KAAK,IACJ,SAAS,EAAC,8BAA8B,EACxC,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,MAAM,CAAC,OAAO,EACtB,8BAA8B;YAE9B,6BAAK,SAAS,EAAC,4CAA4C;gBACxD,CAAC,KAAK,CAAC,eAAe;oBACrB,gCAAQ,KAAK,EAAE,UAAU,EACvB,SAAS,EAAE,uDAAuD,iBACtD,mBAAmB,EAC/B,OAAO,EAAE,WAAW;wBACrB,oBAAC,IAAI,IAAC,QAAQ,EAAE,oBAAC,QAAQ,OAAG,GAAG,CAAS;gBAC3C,oBAAC,WAAW,IAAC,aAAa,EAAE,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,gBAAgB,EAAE,kBAAkB;oBAClG,oBAAC,YAAY,OAAG;oBACf,KAAK,CAAC,cAAc;wBACnB,oBAAC,eAAe,IAAC,kBAAkB,EAAE,KAAK,CAAC,cAAc,GAAI;oBAC9D,YAAY;wBACX,oBAAC,YAAY,IAAC,MAAM,EAAE,YAAY,GAAI,CAC5B,CACV,CACA,CACJ,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAyD,0BAA0B,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 Color\r\n */\r\n\r\n// cSpell:ignore colorpicker\r\n\r\nimport * as React from \"react\";\r\nimport classnames from \"classnames\";\r\nimport { ColorByName, ColorDef } from \"@itwin/core-common\";\r\nimport { RelativePosition } from \"@itwin/appui-abstract\";\r\nimport { CommonProps, Icon, Popup, useRefs } from \"@itwin/core-react\";\r\n// import { ColorPickerPanel } from \"./ColorPickerPanel\";\r\nimport { ColorBuilder, ColorInputPanel, ColorPalette, ColorPicker, ColorValue } from \"@itwin/itwinui-react\";\r\nimport \"./ColorPickerPopup.scss\";\r\nimport { getCSSColorFromDef } from \"./getCSSColorFromDef\";\r\nimport { UiIModelComponents } from \"../UiIModelComponents\";\r\nimport { SvgCaretDownSmall, SvgCaretUpSmall, SvgClose } from \"@itwin/itwinui-icons-react\";\r\n\r\n/** Properties for the [[ColorPickerPopup]] React component\r\n * @public\r\n */\r\nexport interface ColorPickerPopupProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {\r\n /** Current color */\r\n initialColor: ColorDef;\r\n /** Preset colors. Pass undefined to show default preset colors. Pass empty array to show no presets.\r\n * Displayed in rows of 9 items */\r\n colorDefs?: ColorDef[];\r\n /** Function to call when the color value is changed */\r\n onColorChange?: ((newColor: ColorDef) => void) | undefined;\r\n /** Function to call when the popup is closed */\r\n onClose?: ((colorValue: ColorDef) => void) | undefined;\r\n /** Disabled or not */\r\n disabled?: boolean;\r\n /** Readonly or not, color displayed on button but button will not trigger pop-up */\r\n readonly?: boolean;\r\n /** popup position. If not set RelativePosition.BottomLeft is used */\r\n popupPosition?: RelativePosition;\r\n /** Provides ability to return reference to HTMLButtonElement */\r\n ref?: React.Ref<HTMLButtonElement>;\r\n /** If true show up/down caret next to color */\r\n showCaret?: boolean;\r\n /** If true, don't propagate clicks out of the ColorPicker */\r\n captureClicks?: boolean;\r\n /** If true, don't show close button at top */\r\n hideCloseButton?: boolean;\r\n /** If set show input values */\r\n colorInputType?: \"hsl\" | \"rgb\" | \"hex\";\r\n}\r\n\r\n// Defined using following pattern (const ColorPickerPopup at bottom) to ensure useful API documentation is extracted\r\n\r\nconst ForwardRefColorPickerPopup = React.forwardRef<HTMLButtonElement, ColorPickerPopupProps>(\r\n function ForwardRefColorPickerPopup(props, ref) {\r\n const target = React.useRef<HTMLButtonElement>(null);\r\n const refs = useRefs(target, ref); // combine ref needed for target with the forwardRef needed by the Parent when parent is a Type Editor.\r\n const [showPopup, setShowPopup] = React.useState(false);\r\n const [colorDef, setColorDef] = React.useState(props.initialColor);\r\n const initialColorRef = React.useRef(props.initialColor);\r\n\r\n React.useEffect(() => {\r\n if (props.initialColor !== initialColorRef.current) {\r\n initialColorRef.current = props.initialColor;\r\n setColorDef(props.initialColor);\r\n }\r\n }, [props.initialColor]);\r\n\r\n const defaultColors = React.useRef(\r\n [\r\n ColorValue.fromTbgr(ColorByName.red),\r\n ColorValue.fromTbgr(ColorByName.orange),\r\n ColorValue.fromTbgr(ColorByName.yellow),\r\n ColorValue.fromTbgr(ColorByName.green),\r\n ColorValue.fromTbgr(ColorByName.blue),\r\n ColorValue.fromTbgr(ColorByName.mediumBlue),\r\n ColorValue.fromTbgr(ColorByName.indigo),\r\n ColorValue.fromTbgr(ColorByName.violet),\r\n ColorValue.fromTbgr(ColorByName.black),\r\n ColorValue.fromTbgr(ColorByName.white),\r\n ColorValue.fromTbgr(ColorByName.cyan),\r\n ColorValue.fromTbgr(ColorByName.fuchsia),\r\n ColorValue.fromTbgr(ColorByName.tan),\r\n ColorValue.fromTbgr(ColorByName.gray),\r\n ColorValue.fromTbgr(ColorByName.brown),\r\n ColorValue.fromTbgr(ColorByName.purple),\r\n ColorValue.fromTbgr(ColorByName.olive),\r\n ColorValue.fromTbgr(ColorByName.darkGreen),\r\n ]);\r\n\r\n // istanbul ignore next\r\n const closePopup = React.useCallback(() => {\r\n props.onClose && props.onClose(colorDef);\r\n setShowPopup(false);\r\n }, [colorDef, props]);\r\n\r\n const togglePopup = React.useCallback(() => {\r\n setShowPopup(!showPopup);\r\n }, [showPopup]);\r\n\r\n const handleColorChanged = React.useCallback((newColorValue: ColorValue) => {\r\n const newColor = ColorDef.fromTbgr(newColorValue.toTbgr());\r\n // istanbul ignore else\r\n if (!newColor.equals(colorDef)) {\r\n setColorDef(newColor);\r\n\r\n // istanbul ignore else\r\n props.onColorChange && props.onColorChange(newColor);\r\n }\r\n }, [colorDef, props]);\r\n\r\n const rgbaString = getCSSColorFromDef(colorDef);\r\n\r\n const buttonStyle = { ...props.style } as React.CSSProperties;\r\n const swatchStyle = { backgroundColor: rgbaString } as React.CSSProperties;\r\n const buttonClassNames = classnames(\"components-colorpicker-popup-button\",\r\n props.readonly && \"readonly\",\r\n props.className,\r\n );\r\n\r\n const clickHandler = (event: React.MouseEvent) => {\r\n // istanbul ignore else\r\n if (props.captureClicks)\r\n event.stopPropagation();\r\n };\r\n\r\n const colorOptions = React.useMemo(() => {\r\n if (props.colorDefs && props.colorDefs.length) {\r\n return props.colorDefs.map((def) => ColorValue.fromTbgr(def.tbgr));\r\n }\r\n if (props.colorDefs && 0 === props.colorDefs.length)\r\n return undefined;\r\n return defaultColors.current;\r\n }, [props.colorDefs]);\r\n const popupPosition = undefined !== props.popupPosition ? props.popupPosition : RelativePosition.BottomLeft;\r\n\r\n const [closeLabel] = React.useState(() => UiIModelComponents.translate(\"color.close\"));\r\n const [togglePopupLabel] = React.useState(() => UiIModelComponents.translate(\"color.toggleColorPopup\"));\r\n\r\n return (\r\n /* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */\r\n <div onClick={clickHandler}>\r\n <button data-testid=\"components-colorpicker-popup-button\" onClick={togglePopup} className={buttonClassNames} style={buttonStyle}\r\n disabled={props.disabled} ref={refs} title={togglePopupLabel} >\r\n <div className=\"components-colorpicker-button-container\">\r\n <div className=\"components-colorpicker-button-color-swatch\" style={swatchStyle} data-testid={showPopup ? \"caret-up\" : \"caret-down\"} />\r\n {props.showCaret && <Icon className=\"components-caret\" iconSpec={showPopup ? <SvgCaretUpSmall /> : <SvgCaretDownSmall /> } />}\r\n </div>\r\n </button>\r\n <Popup\r\n className=\"components-colorpicker-popup\"\r\n isOpen={showPopup}\r\n position={popupPosition}\r\n onClose={closePopup}\r\n target={target.current}\r\n closeOnNestedPopupOutsideClick\r\n >\r\n <div className=\"components-colorpicker-popup-panel-padding\">\r\n {!props.hideCloseButton &&\r\n <button title={closeLabel}\r\n className={\"core-focus-trap-ignore-initial core-dialog-close icon\"}\r\n data-testid=\"core-dialog-close\"\r\n onClick={togglePopup}\r\n ><Icon iconSpec={<SvgClose />}/></button>}\r\n <ColorPicker selectedColor={ColorValue.fromTbgr(colorDef.tbgr)} onChangeComplete={handleColorChanged} >\r\n <ColorBuilder />\r\n {props.colorInputType &&\r\n <ColorInputPanel defaultColorFormat={props.colorInputType} />}\r\n {colorOptions &&\r\n <ColorPalette colors={colorOptions} />}\r\n </ColorPicker>\r\n </div>\r\n </Popup>\r\n </div>\r\n );\r\n }\r\n);\r\n\r\n/**\r\n * ColorPickerButton component that allows user to select a color from a set of color swatches or to define a new color.\r\n * @note Using forwardRef so the ColorEditor (Type Editor) can access the ref of the button element inside this component.\r\n * @public\r\n */\r\nexport const ColorPickerPopup: (props: ColorPickerPopupProps) => JSX.Element | null = ForwardRefColorPickerPopup;\r\n"]}
@@ -2,12 +2,11 @@
2
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
- @import "~@itwin/core-react/lib/cjs/core-react/style/themecolors";
6
5
 
7
6
  button.components-colorpicker-popup-button {
8
7
  font-family: var(--iui-font-sans);
9
8
  font-size: var(--iui-font-size-1);
10
- color: $buic-foreground-body;
9
+ color: var(--iui-color-text);
11
10
  background-color: transparent;
12
11
  box-sizing: border-box;
13
12
  border-radius: var(--iui-border-radius-1);
@@ -24,7 +23,7 @@ button.components-colorpicker-popup-button {
24
23
  align-items: center;
25
24
 
26
25
  > .components-colorpicker-button-color-swatch {
27
- border: 1px solid $buic-inputs-border;
26
+ border: 1px solid var(--iui-color-border);
28
27
  border-radius: var(--iui-border-radius-1);
29
28
  width: 1.25em;
30
29
  height: 1.25em;
@@ -41,7 +40,7 @@ button.components-colorpicker-popup-button {
41
40
 
42
41
  > .components-colorpicker-button-container {
43
42
  > .components-caret {
44
- color: $buic-icon-color-disabled;
43
+ color: var(--iui-color-text-disabled);
45
44
  }
46
45
  }
47
46
  }
@@ -58,6 +57,6 @@ button.components-colorpicker-popup-button {
58
57
  margin-left: auto;
59
58
  background: transparent;
60
59
  border: none;
61
- color: var(--buic-foreground-body);
60
+ color: var(--iui-color-text);
62
61
  }
63
62
  }
@@ -1,23 +1,23 @@
1
- /** @packageDocumentation
2
- * @module Color
3
- */
4
- import "./HueSlider.scss";
5
- import * as React from "react";
6
- import { HSVColor } from "@itwin/core-common";
7
- import { CommonProps } from "@itwin/core-react";
8
- /** Properties for the [[HueSlider]] React component
9
- * @beta
10
- */
11
- export interface HueSliderProps extends React.HTMLAttributes<HTMLDivElement>, CommonProps {
12
- /** true if slider is oriented horizontal, else vertical orientation is assumed */
13
- isHorizontal?: boolean;
14
- /** function to run when user hue is changed */
15
- onHueChange?: ((hue: HSVColor) => void) | undefined;
16
- /** HSV Color Value */
17
- hsv: HSVColor;
18
- }
19
- /** HueSlider component used to set the hue value.
20
- * @beta
21
- */
22
- export declare function HueSlider({ isHorizontal, onHueChange, hsv, className, style }: HueSliderProps): JSX.Element;
1
+ /** @packageDocumentation
2
+ * @module Color
3
+ */
4
+ import "./HueSlider.scss";
5
+ import * as React from "react";
6
+ import { HSVColor } from "@itwin/core-common";
7
+ import { CommonProps } from "@itwin/core-react";
8
+ /** Properties for the [[HueSlider]] React component
9
+ * @beta
10
+ */
11
+ export interface HueSliderProps extends React.HTMLAttributes<HTMLDivElement>, CommonProps {
12
+ /** true if slider is oriented horizontal, else vertical orientation is assumed */
13
+ isHorizontal?: boolean;
14
+ /** function to run when user hue is changed */
15
+ onHueChange?: ((hue: HSVColor) => void) | undefined;
16
+ /** HSV Color Value */
17
+ hsv: HSVColor;
18
+ }
19
+ /** HueSlider component used to set the hue value.
20
+ * @beta
21
+ */
22
+ export declare function HueSlider({ isHorizontal, onHueChange, hsv, className, style }: HueSliderProps): JSX.Element;
23
23
  //# sourceMappingURL=HueSlider.d.ts.map