@esri/calcite-components 1.4.0-next.0 → 1.4.0-next.10

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 (737) hide show
  1. package/dist/calcite/assets/icon/orientedImageryLayer16.json +1 -0
  2. package/dist/calcite/assets/icon/orientedImageryLayer24.json +1 -0
  3. package/dist/calcite/assets/icon/orientedImageryLayer32.json +1 -0
  4. package/dist/calcite/assets/icon/parcelLayer16.json +1 -0
  5. package/dist/calcite/assets/icon/parcelLayer24.json +1 -0
  6. package/dist/calcite/assets/icon/parcelLayer32.json +1 -0
  7. package/dist/calcite/assets/icon/viewAssociations16.json +1 -0
  8. package/dist/calcite/assets/icon/viewAssociations24.json +1 -0
  9. package/dist/calcite/assets/icon/viewAssociations32.json +1 -0
  10. package/dist/calcite/calcite.esm.js +2 -2
  11. package/dist/calcite/index.esm.js +2 -2
  12. package/dist/calcite/{p-289f6317.js → p-00383b72.js} +1 -1
  13. package/dist/calcite/{p-ba0d3bd7.entry.js → p-006421cf.entry.js} +2 -2
  14. package/dist/calcite/{p-cf703c59.entry.js → p-033b7e01.entry.js} +2 -2
  15. package/dist/calcite/{p-4326ccbd.js → p-04577b20.js} +1 -1
  16. package/dist/calcite/{p-e7ad5add.js → p-063a4869.js} +1 -1
  17. package/dist/calcite/{p-9748745f.entry.js → p-088553ab.entry.js} +2 -2
  18. package/dist/calcite/{p-2fa9c44a.js → p-0990e4b1.js} +1 -1
  19. package/dist/calcite/p-0b5b83ca.js +6 -0
  20. package/dist/calcite/{p-c01d0233.entry.js → p-0c5c7ac8.entry.js} +2 -2
  21. package/dist/calcite/{p-02ef04d5.entry.js → p-0f914551.entry.js} +2 -2
  22. package/dist/calcite/{p-0f59b0fa.js → p-11d8b4fa.js} +2 -2
  23. package/dist/calcite/{p-51cd139f.entry.js → p-12a17917.entry.js} +2 -2
  24. package/dist/calcite/{p-3c4b364e.entry.js → p-166b2653.entry.js} +2 -2
  25. package/dist/calcite/{p-376775c7.entry.js → p-1d8d9ad5.entry.js} +2 -2
  26. package/dist/calcite/p-21f70058.entry.js +6 -0
  27. package/dist/calcite/{p-edc60e96.entry.js → p-26ff46fc.entry.js} +2 -2
  28. package/dist/calcite/{p-6011d8eb.entry.js → p-285fde7a.entry.js} +2 -2
  29. package/dist/calcite/{p-11beded1.js → p-28bd653e.js} +3 -3
  30. package/dist/calcite/{p-64a44a39.js → p-2c11ed7d.js} +2 -2
  31. package/dist/calcite/p-2e345437.entry.js +6 -0
  32. package/dist/calcite/{p-57e653ea.js → p-2fba8e6a.js} +1 -1
  33. package/dist/calcite/{p-37d9d3e2.entry.js → p-33841e82.entry.js} +2 -2
  34. package/dist/calcite/{p-3255b488.js → p-33c5c291.js} +1 -1
  35. package/dist/calcite/{p-6088fbfa.js → p-369d7e1a.js} +1 -1
  36. package/dist/calcite/{p-e11ced36.js → p-37d03f0c.js} +2 -2
  37. package/dist/calcite/{p-f4cf789b.js → p-386abb7d.js} +3 -3
  38. package/dist/calcite/{p-f357d9a8.entry.js → p-39d22c35.entry.js} +2 -2
  39. package/dist/calcite/{p-137b6f9b.js → p-3d973854.js} +2 -2
  40. package/dist/calcite/{p-6f2233a8.entry.js → p-3fe662f7.entry.js} +2 -2
  41. package/dist/calcite/{p-df66e5af.entry.js → p-463c3817.entry.js} +2 -2
  42. package/dist/calcite/p-4e5db9b6.js +6 -0
  43. package/dist/calcite/{p-b7cc02fa.js → p-4f50176e.js} +1 -1
  44. package/dist/calcite/p-504ea909.entry.js +6 -0
  45. package/dist/calcite/{p-1d34d5b7.entry.js → p-548fb4ce.entry.js} +2 -2
  46. package/dist/calcite/{p-dc29d755.entry.js → p-55caae0c.entry.js} +2 -2
  47. package/dist/calcite/{p-f77c2524.entry.js → p-590cc126.entry.js} +2 -2
  48. package/dist/calcite/{p-5368cb06.entry.js → p-5bc7013c.entry.js} +2 -2
  49. package/dist/calcite/{p-34268eb0.entry.js → p-63d45233.entry.js} +2 -2
  50. package/dist/calcite/{p-cdbd4c6f.entry.js → p-6b84d6ef.entry.js} +2 -2
  51. package/dist/calcite/p-6d7e5273.entry.js +6 -0
  52. package/dist/calcite/{p-695e0525.entry.js → p-706ed58d.entry.js} +2 -2
  53. package/dist/calcite/p-718f633f.entry.js +6 -0
  54. package/dist/calcite/{p-7fb70776.entry.js → p-7249fbe5.entry.js} +2 -2
  55. package/dist/calcite/{p-5e23d67e.entry.js → p-72ba446e.entry.js} +2 -2
  56. package/dist/calcite/{p-6b118e60.entry.js → p-75b724ae.entry.js} +2 -2
  57. package/dist/calcite/{p-86a533d8.entry.js → p-771ec30b.entry.js} +2 -2
  58. package/dist/calcite/{p-f8e1c231.js → p-797661fe.js} +1 -1
  59. package/dist/calcite/{p-47d5e341.entry.js → p-7c870019.entry.js} +2 -2
  60. package/dist/calcite/{p-3b3b1e7e.entry.js → p-7cb6bb0c.entry.js} +2 -2
  61. package/dist/calcite/{p-b822b669.entry.js → p-7ddd51c0.entry.js} +2 -2
  62. package/dist/calcite/{p-8c54a92e.entry.js → p-80b4addf.entry.js} +2 -2
  63. package/dist/calcite/p-83924270.entry.js +6 -0
  64. package/dist/calcite/{p-8bd7bc4a.js → p-892279b1.js} +1 -1
  65. package/dist/calcite/{p-2fceaf3f.entry.js → p-8d09a65c.entry.js} +2 -2
  66. package/dist/calcite/{p-7b652538.entry.js → p-923166fc.entry.js} +2 -2
  67. package/dist/calcite/{p-c6b0ff12.entry.js → p-95fdcb91.entry.js} +2 -2
  68. package/dist/calcite/p-96968ac7.entry.js +6 -0
  69. package/dist/calcite/p-970be967.entry.js +6 -0
  70. package/dist/calcite/p-99e63f9f.js +6 -0
  71. package/dist/calcite/{p-6505aa9e.entry.js → p-9c84eb29.entry.js} +2 -2
  72. package/dist/calcite/{p-d37c6c61.js → p-9d02fe1c.js} +1 -1
  73. package/dist/calcite/{p-2f0fa893.entry.js → p-9d07088d.entry.js} +2 -2
  74. package/dist/calcite/{p-4f208a60.js → p-9fe27e8d.js} +2 -2
  75. package/dist/calcite/{p-b66a142d.js → p-a0a1f925.js} +1 -1
  76. package/dist/calcite/p-a15f7de3.js +6 -0
  77. package/dist/calcite/{p-483b59be.entry.js → p-a49d3536.entry.js} +2 -2
  78. package/dist/calcite/{p-4d55aa78.js → p-a7daef7a.js} +2 -2
  79. package/dist/calcite/p-a94a945f.entry.js +6 -0
  80. package/dist/calcite/{p-1f0e9bdc.entry.js → p-aa277b5a.entry.js} +2 -2
  81. package/dist/calcite/{p-06615599.entry.js → p-ac273467.entry.js} +2 -2
  82. package/dist/calcite/p-b140b736.js +6 -0
  83. package/dist/calcite/{p-5682711c.entry.js → p-b149fa47.entry.js} +2 -2
  84. package/dist/calcite/{p-58337196.entry.js → p-b2b99a48.entry.js} +2 -2
  85. package/dist/calcite/{p-5b24b90a.js → p-b6042b6c.js} +1 -1
  86. package/dist/calcite/{p-e243abb7.entry.js → p-b99a1036.entry.js} +2 -2
  87. package/dist/calcite/{p-dc1dcfc1.entry.js → p-c6a73b19.entry.js} +2 -2
  88. package/dist/calcite/{p-397fcd80.entry.js → p-c8c93dc4.entry.js} +2 -2
  89. package/dist/calcite/{p-ffd4191d.js → p-ca33af16.js} +2 -2
  90. package/dist/calcite/{p-db9631fc.entry.js → p-cc171e49.entry.js} +2 -2
  91. package/dist/calcite/{p-087c40ee.js → p-d2a6b24b.js} +1 -1
  92. package/dist/calcite/{p-48622a82.entry.js → p-d3245ccf.entry.js} +2 -2
  93. package/dist/calcite/{p-0008c6a3.entry.js → p-deb3bdde.entry.js} +2 -2
  94. package/dist/calcite/{p-21bacae6.entry.js → p-e0e93a72.entry.js} +2 -2
  95. package/dist/calcite/{p-94f16774.js → p-e1098787.js} +2 -2
  96. package/dist/calcite/p-e22cb550.entry.js +6 -0
  97. package/dist/calcite/{p-121f6053.js → p-e4c1febd.js} +1 -1
  98. package/dist/calcite/{p-1d426b87.js → p-e79254d3.js} +2 -2
  99. package/dist/calcite/{p-94aa5071.js → p-eacf0ee1.js} +1 -1
  100. package/dist/calcite/p-ee458bd5.js +6 -0
  101. package/dist/calcite/{p-1abc82c2.entry.js → p-f0fdf516.entry.js} +2 -2
  102. package/dist/calcite/{p-83bf9a0f.entry.js → p-f1642ec6.entry.js} +2 -2
  103. package/dist/calcite/{p-6950ca4b.js → p-f395d0e2.js} +2 -2
  104. package/dist/calcite/{p-f3753747.entry.js → p-f5e50012.entry.js} +2 -2
  105. package/dist/calcite/{p-c86d27a3.entry.js → p-fbfe8e4d.entry.js} +2 -2
  106. package/dist/calcite/{p-00a2d9ab.entry.js → p-fe1c87d5.entry.js} +2 -2
  107. package/dist/calcite/{p-97efa412.entry.js → p-ffdbd6d1.entry.js} +2 -2
  108. package/dist/cjs/{ExpandToggle-bdfd6fa1.js → ExpandToggle-953ef45b.js} +5 -5
  109. package/dist/cjs/{FloatingArrow-2721f8fc.js → FloatingArrow-cf108924.js} +2 -2
  110. package/dist/cjs/{Heading-6ef1898d.js → Heading-0b55bc06.js} +2 -2
  111. package/dist/cjs/{app-globals-cd964522.js → app-globals-4953ac0e.js} +2 -2
  112. package/dist/cjs/{array-576d7912.js → array-2726dfca.js} +1 -1
  113. package/dist/cjs/calcite-accordion_2.cjs.entry.js +7 -7
  114. package/dist/cjs/calcite-action-bar.cjs.entry.js +16 -16
  115. package/dist/cjs/calcite-action-group.cjs.entry.js +13 -13
  116. package/dist/cjs/calcite-action-menu.cjs.entry.js +9 -9
  117. package/dist/cjs/calcite-action-pad.cjs.entry.js +14 -14
  118. package/dist/cjs/calcite-action.cjs.entry.js +11 -11
  119. package/dist/cjs/calcite-alert.cjs.entry.js +12 -12
  120. package/dist/cjs/calcite-avatar.cjs.entry.js +9 -8
  121. package/dist/cjs/calcite-block_2.cjs.entry.js +13 -13
  122. package/dist/cjs/calcite-button.cjs.entry.js +13 -13
  123. package/dist/cjs/calcite-card.cjs.entry.js +10 -10
  124. package/dist/cjs/calcite-checkbox.cjs.entry.js +10 -10
  125. package/dist/cjs/calcite-chip-group.cjs.entry.js +8 -8
  126. package/dist/cjs/calcite-chip.cjs.entry.js +12 -12
  127. package/dist/cjs/calcite-color-picker_3.cjs.entry.js +585 -339
  128. package/dist/cjs/calcite-combobox_3.cjs.entry.js +18 -18
  129. package/dist/cjs/calcite-date-picker_4.cjs.entry.js +13 -13
  130. package/dist/cjs/calcite-dropdown_3.cjs.entry.js +12 -12
  131. package/dist/cjs/calcite-fab.cjs.entry.js +7 -7
  132. package/dist/cjs/calcite-filter.cjs.entry.js +13 -13
  133. package/dist/cjs/calcite-flow-item.cjs.entry.js +15 -14
  134. package/dist/cjs/calcite-flow.cjs.entry.js +3 -3
  135. package/dist/cjs/calcite-graph_2.cjs.entry.js +13 -13
  136. package/dist/cjs/calcite-handle.cjs.entry.js +10 -10
  137. package/dist/cjs/calcite-icon.cjs.entry.js +6 -6
  138. package/dist/cjs/calcite-inline-editable.cjs.entry.js +12 -12
  139. package/dist/cjs/calcite-input-date-picker.cjs.entry.js +18 -18
  140. package/dist/cjs/calcite-input-message.cjs.entry.js +5 -5
  141. package/dist/cjs/calcite-input-number.cjs.entry.js +13 -13
  142. package/dist/cjs/calcite-input-text.cjs.entry.js +13 -13
  143. package/dist/cjs/calcite-input-time-picker_2.cjs.entry.js +14 -14
  144. package/dist/cjs/calcite-input.cjs.entry.js +13 -13
  145. package/dist/cjs/calcite-label.cjs.entry.js +6 -6
  146. package/dist/cjs/calcite-link.cjs.entry.js +7 -7
  147. package/dist/cjs/calcite-list_3.cjs.entry.js +50 -40
  148. package/dist/cjs/calcite-loader.cjs.entry.js +3 -3
  149. package/dist/cjs/calcite-modal.cjs.entry.js +13 -13
  150. package/dist/cjs/calcite-notice.cjs.entry.js +12 -12
  151. package/dist/cjs/calcite-option_3.cjs.entry.js +10 -10
  152. package/dist/cjs/calcite-pagination.cjs.entry.js +10 -10
  153. package/dist/cjs/calcite-panel.cjs.entry.js +15 -15
  154. package/dist/cjs/calcite-pick-list_3.cjs.entry.js +16 -16
  155. package/dist/cjs/calcite-popover.cjs.entry.js +16 -16
  156. package/dist/cjs/calcite-progress.cjs.entry.js +2 -2
  157. package/dist/cjs/calcite-radio-button-group.cjs.entry.js +3 -3
  158. package/dist/cjs/calcite-radio-button.cjs.entry.js +10 -10
  159. package/dist/cjs/calcite-rating.cjs.entry.js +13 -13
  160. package/dist/cjs/calcite-scrim.cjs.entry.js +9 -9
  161. package/dist/cjs/calcite-segmented-control_2.cjs.entry.js +9 -9
  162. package/dist/cjs/calcite-shell_3.cjs.entry.js +11 -14
  163. package/dist/cjs/calcite-sortable-list.cjs.entry.js +5 -5
  164. package/dist/cjs/calcite-split-button.cjs.entry.js +4 -4
  165. package/dist/cjs/calcite-stepper_2.cjs.entry.js +10 -10
  166. package/dist/cjs/calcite-switch.cjs.entry.js +10 -10
  167. package/dist/cjs/calcite-tab_4.cjs.entry.js +7 -7
  168. package/dist/cjs/calcite-text-area.cjs.entry.js +15 -15
  169. package/dist/cjs/calcite-tile-select_2.cjs.entry.js +5 -5
  170. package/dist/cjs/calcite-tile.cjs.entry.js +8 -8
  171. package/dist/cjs/calcite-tip_3.cjs.entry.js +11 -11
  172. package/dist/cjs/calcite-tooltip.cjs.entry.js +46 -32
  173. package/dist/cjs/calcite-tree_2.cjs.entry.js +47 -27
  174. package/dist/cjs/calcite-value-list_2.cjs.entry.js +16 -16
  175. package/dist/cjs/calcite.cjs.js +5 -5
  176. package/dist/cjs/{composed-offset-position.esm-1a67d05e.js → composed-offset-position.esm-12a68feb.js} +1 -1
  177. package/dist/cjs/{conditionalSlot-229cfc41.js → conditionalSlot-f5ae40d5.js} +3 -3
  178. package/dist/cjs/{debounce-b4f960bc.js → debounce-a5772547.js} +1 -1
  179. package/dist/cjs/{dom-aa42bfcf.js → dom-60bc41cc.js} +116 -17
  180. package/dist/cjs/{filter-0dcbb310.js → filter-6d66baa0.js} +2 -2
  181. package/dist/cjs/{floating-ui-681123a5.js → floating-ui-eea897d6.js} +71 -65
  182. package/dist/cjs/{focusTrapComponent-2d2242ef.js → focusTrapComponent-adfb6fd0.js} +2 -2
  183. package/dist/cjs/{form-7bfb80aa.js → form-375179b0.js} +3 -3
  184. package/dist/cjs/{guid-00be0e24.js → guid-20fbb6f5.js} +1 -1
  185. package/dist/cjs/{index-8eb869ae.js → index-7ff03af4.js} +1 -1
  186. package/dist/cjs/index.cjs.js +2 -2
  187. package/dist/cjs/{interactive-2287fde4.js → interactive-e756405a.js} +1 -1
  188. package/dist/cjs/{key-a8c7ee49.js → key-965a0499.js} +1 -1
  189. package/dist/cjs/{label-cd4c10e7.js → label-d45108db.js} +2 -2
  190. package/dist/cjs/{loadable-68686b66.js → loadable-43aa8e12.js} +1 -1
  191. package/dist/cjs/loader.cjs.js +5 -5
  192. package/dist/cjs/{locale-c1aecec9.js → locale-352dde9f.js} +4 -4
  193. package/dist/cjs/{math-e324135c.js → math-9638f9db.js} +1 -1
  194. package/dist/cjs/{observers-2ab1ae0b.js → observers-c0279726.js} +1 -1
  195. package/dist/cjs/{openCloseComponent-9ad26303.js → openCloseComponent-02cae5bf.js} +2 -2
  196. package/dist/cjs/{resources-82f78554.js → resources-0c626808.js} +1 -1
  197. package/dist/cjs/{resources-b8855250.js → resources-2dbf7729.js} +1 -1
  198. package/dist/cjs/{resources-5c51a6fd.js → resources-4097e6e6.js} +5 -5
  199. package/dist/cjs/{resources-d24283c8.js → resources-b2185290.js} +1 -1
  200. package/dist/cjs/{resources-cf6da3a8.js → resources-db42842c.js} +1 -1
  201. package/dist/cjs/{resources-0e53773f.js → resources-ebef8fc8.js} +1 -1
  202. package/dist/cjs/{sortable.esm-b85af44a.js → sortable.esm-4549097b.js} +1 -1
  203. package/dist/cjs/{t9n-c3de7794.js → t9n-6dbfaf2b.js} +3 -3
  204. package/dist/cjs/{throttle-32a0520b.js → throttle-5b0015f5.js} +2 -2
  205. package/dist/cjs/utils-52def2ad.js +213 -0
  206. package/dist/cjs/{utils-b82df3c4.js → utils-643437eb.js} +3 -3
  207. package/dist/collection/components/accordion/accordion.js +1 -1
  208. package/dist/collection/components/accordion-item/accordion-item.js +1 -1
  209. package/dist/collection/components/accordion-item/resources.js +1 -1
  210. package/dist/collection/components/action/action.js +1 -1
  211. package/dist/collection/components/action/resources.js +1 -1
  212. package/dist/collection/components/action-bar/action-bar.css +9 -12
  213. package/dist/collection/components/action-bar/action-bar.js +1 -1
  214. package/dist/collection/components/action-bar/resources.js +1 -1
  215. package/dist/collection/components/action-bar/utils.js +1 -1
  216. package/dist/collection/components/action-group/action-group.js +1 -1
  217. package/dist/collection/components/action-group/resources.js +1 -1
  218. package/dist/collection/components/action-menu/action-menu.js +1 -1
  219. package/dist/collection/components/action-menu/resources.js +1 -1
  220. package/dist/collection/components/action-pad/action-pad.js +1 -1
  221. package/dist/collection/components/action-pad/resources.js +1 -1
  222. package/dist/collection/components/alert/alert.js +1 -1
  223. package/dist/collection/components/alert/resources.js +1 -1
  224. package/dist/collection/components/avatar/avatar.js +22 -4
  225. package/dist/collection/components/avatar/utils.js +1 -1
  226. package/dist/collection/components/block/block.css +1 -1
  227. package/dist/collection/components/block/block.js +1 -1
  228. package/dist/collection/components/block/resources.js +1 -1
  229. package/dist/collection/components/block-section/block-section.js +1 -1
  230. package/dist/collection/components/block-section/resources.js +1 -1
  231. package/dist/collection/components/button/button.js +1 -1
  232. package/dist/collection/components/button/resources.js +1 -1
  233. package/dist/collection/components/card/card.js +1 -1
  234. package/dist/collection/components/card/resources.js +1 -1
  235. package/dist/collection/components/checkbox/checkbox.js +1 -1
  236. package/dist/collection/components/chip/chip.js +1 -1
  237. package/dist/collection/components/chip/resources.js +1 -1
  238. package/dist/collection/components/chip-group/chip-group.js +1 -1
  239. package/dist/collection/components/color-picker/color-picker.css +59 -52
  240. package/dist/collection/components/color-picker/color-picker.js +449 -234
  241. package/dist/collection/components/color-picker/resources.js +37 -27
  242. package/dist/collection/components/color-picker/utils.js +116 -30
  243. package/dist/collection/components/color-picker-hex-input/color-picker-hex-input.css +19 -16
  244. package/dist/collection/components/color-picker-hex-input/color-picker-hex-input.js +225 -118
  245. package/dist/collection/components/color-picker-hex-input/resources.js +3 -3
  246. package/dist/collection/components/color-picker-swatch/color-picker-swatch.css +10 -6
  247. package/dist/collection/components/color-picker-swatch/color-picker-swatch.js +34 -7
  248. package/dist/collection/components/color-picker-swatch/resources.js +8 -2
  249. package/dist/collection/components/combobox/combobox.js +1 -1
  250. package/dist/collection/components/combobox/resources.js +1 -1
  251. package/dist/collection/components/combobox/utils.js +1 -1
  252. package/dist/collection/components/combobox-item/combobox-item.js +1 -1
  253. package/dist/collection/components/combobox-item/resources.js +1 -1
  254. package/dist/collection/components/combobox-item-group/combobox-item-group.js +1 -1
  255. package/dist/collection/components/combobox-item-group/resources.js +1 -1
  256. package/dist/collection/components/date-picker/date-picker.js +1 -1
  257. package/dist/collection/components/date-picker/resources.js +1 -1
  258. package/dist/collection/components/date-picker/utils.js +1 -1
  259. package/dist/collection/components/date-picker-day/date-picker-day.js +1 -1
  260. package/dist/collection/components/date-picker-month/date-picker-month.js +1 -1
  261. package/dist/collection/components/date-picker-month-header/date-picker-month-header.js +1 -1
  262. package/dist/collection/components/date-picker-month-header/resources.js +1 -1
  263. package/dist/collection/components/dropdown/dropdown.js +1 -1
  264. package/dist/collection/components/dropdown/resources.js +1 -1
  265. package/dist/collection/components/dropdown-group/dropdown-group.js +1 -1
  266. package/dist/collection/components/dropdown-group/resources.js +1 -1
  267. package/dist/collection/components/dropdown-item/dropdown-item.js +1 -1
  268. package/dist/collection/components/dropdown-item/resources.js +1 -1
  269. package/dist/collection/components/fab/fab.js +1 -1
  270. package/dist/collection/components/fab/resources.js +1 -1
  271. package/dist/collection/components/filter/filter.js +1 -1
  272. package/dist/collection/components/filter/resources.js +1 -1
  273. package/dist/collection/components/flow/flow.js +1 -1
  274. package/dist/collection/components/flow/resources.js +1 -1
  275. package/dist/collection/components/flow-item/flow-item.css +12 -0
  276. package/dist/collection/components/flow-item/flow-item.js +4 -3
  277. package/dist/collection/components/flow-item/resources.js +2 -1
  278. package/dist/collection/components/functional/ExpandToggle.js +1 -1
  279. package/dist/collection/components/functional/FloatingArrow.js +1 -1
  280. package/dist/collection/components/functional/Heading.js +1 -1
  281. package/dist/collection/components/graph/graph.js +1 -1
  282. package/dist/collection/components/graph/util.js +1 -1
  283. package/dist/collection/components/handle/handle.js +1 -1
  284. package/dist/collection/components/handle/resources.js +1 -1
  285. package/dist/collection/components/icon/assets/icon/orientedImageryLayer16.json +1 -0
  286. package/dist/collection/components/icon/assets/icon/orientedImageryLayer24.json +1 -0
  287. package/dist/collection/components/icon/assets/icon/orientedImageryLayer32.json +1 -0
  288. package/dist/collection/components/icon/assets/icon/parcelLayer16.json +1 -0
  289. package/dist/collection/components/icon/assets/icon/parcelLayer24.json +1 -0
  290. package/dist/collection/components/icon/assets/icon/parcelLayer32.json +1 -0
  291. package/dist/collection/components/icon/assets/icon/viewAssociations16.json +1 -0
  292. package/dist/collection/components/icon/assets/icon/viewAssociations24.json +1 -0
  293. package/dist/collection/components/icon/assets/icon/viewAssociations32.json +1 -0
  294. package/dist/collection/components/icon/icon.js +1 -1
  295. package/dist/collection/components/icon/resources.js +1 -1
  296. package/dist/collection/components/icon/utils.js +1 -1
  297. package/dist/collection/components/inline-editable/inline-editable.js +1 -1
  298. package/dist/collection/components/inline-editable/resources.js +1 -1
  299. package/dist/collection/components/input/input.js +1 -1
  300. package/dist/collection/components/input/resources.js +1 -1
  301. package/dist/collection/components/input-date-picker/input-date-picker.js +1 -1
  302. package/dist/collection/components/input-date-picker/resources.js +1 -1
  303. package/dist/collection/components/input-message/input-message.js +1 -1
  304. package/dist/collection/components/input-message/interfaces.js +1 -1
  305. package/dist/collection/components/input-number/input-number.js +1 -1
  306. package/dist/collection/components/input-number/resources.js +1 -1
  307. package/dist/collection/components/input-text/input-text.js +1 -1
  308. package/dist/collection/components/input-text/resources.js +1 -1
  309. package/dist/collection/components/input-time-picker/input-time-picker.js +1 -1
  310. package/dist/collection/components/input-time-picker/resources.js +1 -1
  311. package/dist/collection/components/label/label.js +1 -1
  312. package/dist/collection/components/label/resources.js +1 -1
  313. package/dist/collection/components/link/link.js +1 -1
  314. package/dist/collection/components/list/list.js +60 -30
  315. package/dist/collection/components/list/resources.js +2 -2
  316. package/dist/collection/components/list-item/list-item.js +1 -1
  317. package/dist/collection/components/list-item/resources.js +1 -1
  318. package/dist/collection/components/list-item/utils.js +1 -1
  319. package/dist/collection/components/list-item-group/list-item-group.js +1 -1
  320. package/dist/collection/components/list-item-group/resources.js +1 -1
  321. package/dist/collection/components/loader/loader.js +1 -1
  322. package/dist/collection/components/modal/modal.js +1 -1
  323. package/dist/collection/components/modal/resources.js +1 -1
  324. package/dist/collection/components/notice/notice.js +1 -1
  325. package/dist/collection/components/notice/resources.js +1 -1
  326. package/dist/collection/components/option/option.js +1 -1
  327. package/dist/collection/components/option-group/option-group.js +1 -1
  328. package/dist/collection/components/pagination/pagination.js +1 -1
  329. package/dist/collection/components/pagination/resources.js +1 -1
  330. package/dist/collection/components/panel/panel.css +9 -2
  331. package/dist/collection/components/panel/panel.js +2 -2
  332. package/dist/collection/components/panel/resources.js +1 -1
  333. package/dist/collection/components/pick-list/pick-list.js +1 -1
  334. package/dist/collection/components/pick-list/resources.js +1 -1
  335. package/dist/collection/components/pick-list/shared-list-logic.js +1 -1
  336. package/dist/collection/components/pick-list/shared-list-render.js +1 -1
  337. package/dist/collection/components/pick-list-group/pick-list-group.js +1 -1
  338. package/dist/collection/components/pick-list-group/resources.js +1 -1
  339. package/dist/collection/components/pick-list-item/pick-list-item.js +1 -1
  340. package/dist/collection/components/pick-list-item/resources.js +1 -1
  341. package/dist/collection/components/popover/PopoverManager.js +1 -1
  342. package/dist/collection/components/popover/popover.js +1 -1
  343. package/dist/collection/components/popover/resources.js +1 -1
  344. package/dist/collection/components/progress/progress.js +1 -1
  345. package/dist/collection/components/radio-button/radio-button.js +1 -1
  346. package/dist/collection/components/radio-button/resources.js +1 -1
  347. package/dist/collection/components/radio-button-group/radio-button-group.js +1 -1
  348. package/dist/collection/components/rating/function/star.js +1 -1
  349. package/dist/collection/components/rating/rating.js +1 -1
  350. package/dist/collection/components/resources.js +1 -1
  351. package/dist/collection/components/scrim/resources.js +1 -1
  352. package/dist/collection/components/scrim/scrim.js +1 -1
  353. package/dist/collection/components/segmented-control/segmented-control.js +1 -1
  354. package/dist/collection/components/segmented-control-item/resources.js +1 -1
  355. package/dist/collection/components/segmented-control-item/segmented-control-item.js +1 -1
  356. package/dist/collection/components/select/resources.js +1 -1
  357. package/dist/collection/components/select/select.js +1 -1
  358. package/dist/collection/components/shell/resources.js +1 -1
  359. package/dist/collection/components/shell/shell.js +1 -1
  360. package/dist/collection/components/shell-center-row/resources.js +1 -1
  361. package/dist/collection/components/shell-center-row/shell-center-row.js +1 -4
  362. package/dist/collection/components/shell-panel/resources.js +1 -1
  363. package/dist/collection/components/shell-panel/shell-panel.js +1 -1
  364. package/dist/collection/components/slider/resources.js +1 -1
  365. package/dist/collection/components/slider/slider.js +1 -1
  366. package/dist/collection/components/sortable-list/resources.js +1 -1
  367. package/dist/collection/components/sortable-list/sortable-list.js +1 -1
  368. package/dist/collection/components/split-button/resources.js +1 -1
  369. package/dist/collection/components/split-button/split-button.js +1 -1
  370. package/dist/collection/components/stepper/stepper.js +1 -1
  371. package/dist/collection/components/stepper-item/stepper-item.js +1 -1
  372. package/dist/collection/components/switch/switch.js +1 -1
  373. package/dist/collection/components/tab/tab.js +1 -1
  374. package/dist/collection/components/tab-nav/tab-nav.js +1 -1
  375. package/dist/collection/components/tab-title/resources.js +1 -1
  376. package/dist/collection/components/tab-title/tab-title.js +1 -1
  377. package/dist/collection/components/tabs/resources.js +1 -1
  378. package/dist/collection/components/tabs/tabs.js +1 -1
  379. package/dist/collection/components/text-area/resources.js +1 -1
  380. package/dist/collection/components/text-area/text-area.js +1 -1
  381. package/dist/collection/components/tile/resources.js +1 -1
  382. package/dist/collection/components/tile/tile.js +1 -1
  383. package/dist/collection/components/tile-select/resources.js +1 -1
  384. package/dist/collection/components/tile-select/tile-select.js +1 -1
  385. package/dist/collection/components/tile-select-group/tile-select-group.js +1 -1
  386. package/dist/collection/components/time-picker/resources.js +1 -1
  387. package/dist/collection/components/time-picker/time-picker.js +1 -1
  388. package/dist/collection/components/tip/resources.js +1 -1
  389. package/dist/collection/components/tip/tip.js +1 -1
  390. package/dist/collection/components/tip-group/tip-group.js +1 -1
  391. package/dist/collection/components/tip-manager/resources.js +1 -1
  392. package/dist/collection/components/tip-manager/tip-manager.js +1 -1
  393. package/dist/collection/components/tooltip/TooltipManager.js +38 -24
  394. package/dist/collection/components/tooltip/resources.js +1 -1
  395. package/dist/collection/components/tooltip/tooltip.js +1 -1
  396. package/dist/collection/components/tooltip/utils.js +1 -1
  397. package/dist/collection/components/tree/tree.js +25 -12
  398. package/dist/collection/components/tree/utils.js +1 -1
  399. package/dist/collection/components/tree-item/resources.js +1 -1
  400. package/dist/collection/components/tree-item/tree-item.js +15 -8
  401. package/dist/collection/components/value-list/resources.js +1 -1
  402. package/dist/collection/components/value-list/utils.js +1 -1
  403. package/dist/collection/components/value-list/value-list.js +1 -1
  404. package/dist/collection/components/value-list-item/resources.js +1 -1
  405. package/dist/collection/components/value-list-item/value-list-item.js +1 -1
  406. package/dist/collection/index.js +1 -1
  407. package/dist/collection/utils/array.js +1 -1
  408. package/dist/collection/utils/conditionalSlot.js +1 -1
  409. package/dist/collection/utils/config.js +1 -1
  410. package/dist/collection/utils/date.js +1 -1
  411. package/dist/collection/utils/dom.js +114 -15
  412. package/dist/collection/utils/filter.js +1 -1
  413. package/dist/collection/utils/floating-ui.js +1 -1
  414. package/dist/collection/utils/focusTrapComponent.js +1 -1
  415. package/dist/collection/utils/form.js +1 -1
  416. package/dist/collection/utils/globalAttributes.js +1 -1
  417. package/dist/collection/utils/globalScript.js +1 -1
  418. package/dist/collection/utils/guid.js +1 -1
  419. package/dist/collection/utils/interactive.js +1 -1
  420. package/dist/collection/utils/key.js +1 -1
  421. package/dist/collection/utils/label.js +1 -1
  422. package/dist/collection/utils/loadable.js +1 -1
  423. package/dist/collection/utils/locale.js +1 -1
  424. package/dist/collection/utils/math.js +1 -1
  425. package/dist/collection/utils/mode.js +1 -1
  426. package/dist/collection/utils/number.js +1 -1
  427. package/dist/collection/utils/observers.js +1 -1
  428. package/dist/collection/utils/openCloseComponent.js +1 -1
  429. package/dist/collection/utils/resources.js +1 -1
  430. package/dist/collection/utils/t9n.js +1 -1
  431. package/dist/collection/utils/time.js +1 -1
  432. package/dist/components/ExpandToggle.js +1 -1
  433. package/dist/components/FloatingArrow.js +1 -1
  434. package/dist/components/Heading.js +1 -1
  435. package/dist/components/action-group.js +1 -1
  436. package/dist/components/action-menu.js +1 -1
  437. package/dist/components/action.js +1 -1
  438. package/dist/components/array.js +1 -1
  439. package/dist/components/button.js +1 -1
  440. package/dist/components/calcite-accordion-item.js +1 -1
  441. package/dist/components/calcite-accordion.js +1 -1
  442. package/dist/components/calcite-action-bar.js +2 -2
  443. package/dist/components/calcite-action-group.js +1 -1
  444. package/dist/components/calcite-action-menu.js +1 -1
  445. package/dist/components/calcite-action-pad.js +1 -1
  446. package/dist/components/calcite-action.js +1 -1
  447. package/dist/components/calcite-alert.js +1 -1
  448. package/dist/components/calcite-avatar.js +5 -3
  449. package/dist/components/calcite-block-section.js +1 -1
  450. package/dist/components/calcite-block.js +2 -2
  451. package/dist/components/calcite-button.js +1 -1
  452. package/dist/components/calcite-card.js +1 -1
  453. package/dist/components/calcite-checkbox.js +1 -1
  454. package/dist/components/calcite-chip-group.js +1 -1
  455. package/dist/components/calcite-chip.js +1 -1
  456. package/dist/components/calcite-color-picker-hex-input.js +2 -2
  457. package/dist/components/calcite-color-picker-swatch.js +1 -1
  458. package/dist/components/calcite-color-picker.js +377 -314
  459. package/dist/components/calcite-combobox-item-group.js +1 -1
  460. package/dist/components/calcite-combobox-item.js +1 -1
  461. package/dist/components/calcite-combobox.js +1 -1
  462. package/dist/components/calcite-date-picker-day.js +1 -1
  463. package/dist/components/calcite-date-picker-month-header.js +1 -1
  464. package/dist/components/calcite-date-picker-month.js +1 -1
  465. package/dist/components/calcite-date-picker.js +1 -1
  466. package/dist/components/calcite-dropdown-group.js +1 -1
  467. package/dist/components/calcite-dropdown-item.js +1 -1
  468. package/dist/components/calcite-dropdown.js +1 -1
  469. package/dist/components/calcite-fab.js +1 -1
  470. package/dist/components/calcite-filter.js +1 -1
  471. package/dist/components/calcite-flow-item.js +4 -3
  472. package/dist/components/calcite-flow.js +1 -1
  473. package/dist/components/calcite-graph.js +1 -1
  474. package/dist/components/calcite-handle.js +1 -1
  475. package/dist/components/calcite-icon.js +1 -1
  476. package/dist/components/calcite-inline-editable.js +1 -1
  477. package/dist/components/calcite-input-date-picker.js +1 -1
  478. package/dist/components/calcite-input-message.js +1 -1
  479. package/dist/components/calcite-input-number.js +2 -617
  480. package/dist/components/calcite-input-text.js +1 -1
  481. package/dist/components/calcite-input-time-picker.js +1 -1
  482. package/dist/components/calcite-input.js +1 -1
  483. package/dist/components/calcite-label.js +1 -1
  484. package/dist/components/calcite-link.js +1 -1
  485. package/dist/components/calcite-list-item-group.js +1 -1
  486. package/dist/components/calcite-list-item.js +1 -1
  487. package/dist/components/calcite-list.js +40 -30
  488. package/dist/components/calcite-loader.js +1 -1
  489. package/dist/components/calcite-modal.js +1 -1
  490. package/dist/components/calcite-notice.js +1 -1
  491. package/dist/components/calcite-option-group.js +1 -1
  492. package/dist/components/calcite-option.js +1 -1
  493. package/dist/components/calcite-pagination.js +1 -1
  494. package/dist/components/calcite-panel.js +1 -1
  495. package/dist/components/calcite-pick-list-group.js +1 -1
  496. package/dist/components/calcite-pick-list-item.js +1 -1
  497. package/dist/components/calcite-pick-list.js +1 -1
  498. package/dist/components/calcite-popover.js +1 -1
  499. package/dist/components/calcite-progress.js +1 -1
  500. package/dist/components/calcite-radio-button-group.js +1 -1
  501. package/dist/components/calcite-radio-button.js +1 -1
  502. package/dist/components/calcite-rating.js +1 -1
  503. package/dist/components/calcite-scrim.js +1 -1
  504. package/dist/components/calcite-segmented-control-item.js +1 -1
  505. package/dist/components/calcite-segmented-control.js +1 -1
  506. package/dist/components/calcite-select.js +1 -1
  507. package/dist/components/calcite-shell-center-row.js +1 -4
  508. package/dist/components/calcite-shell-panel.js +1 -1
  509. package/dist/components/calcite-shell.js +1 -1
  510. package/dist/components/calcite-slider.js +1 -1
  511. package/dist/components/calcite-sortable-list.js +1 -1
  512. package/dist/components/calcite-split-button.js +1 -1
  513. package/dist/components/calcite-stepper-item.js +1 -1
  514. package/dist/components/calcite-stepper.js +1 -1
  515. package/dist/components/calcite-switch.js +1 -1
  516. package/dist/components/calcite-tab-nav.js +1 -1
  517. package/dist/components/calcite-tab-title.js +1 -1
  518. package/dist/components/calcite-tab.js +1 -1
  519. package/dist/components/calcite-tabs.js +1 -1
  520. package/dist/components/calcite-text-area.js +1 -1
  521. package/dist/components/calcite-tile-select-group.js +1 -1
  522. package/dist/components/calcite-tile-select.js +1 -1
  523. package/dist/components/calcite-tile.js +1 -1
  524. package/dist/components/calcite-time-picker.js +1 -1
  525. package/dist/components/calcite-tip-group.js +1 -1
  526. package/dist/components/calcite-tip-manager.js +1 -1
  527. package/dist/components/calcite-tip.js +1 -1
  528. package/dist/components/calcite-tooltip.js +1 -1
  529. package/dist/components/calcite-tree-item.js +15 -8
  530. package/dist/components/calcite-tree.js +25 -12
  531. package/dist/components/calcite-value-list-item.js +1 -1
  532. package/dist/components/calcite-value-list.js +1 -1
  533. package/dist/components/checkbox.js +1 -1
  534. package/dist/components/chip.js +1 -1
  535. package/dist/components/color-picker-hex-input.js +252 -88
  536. package/dist/components/color-picker-swatch.js +42 -2118
  537. package/dist/components/composed-offset-position.esm.js +1 -1
  538. package/dist/components/conditionalSlot.js +1 -1
  539. package/dist/components/date-picker-day.js +1 -1
  540. package/dist/components/date-picker-month-header.js +1 -1
  541. package/dist/components/date-picker-month.js +1 -1
  542. package/dist/components/date-picker.js +2 -2
  543. package/dist/components/date.js +1 -1
  544. package/dist/components/debounce.js +1 -1
  545. package/dist/components/dom.js +114 -15
  546. package/dist/components/dropdown.js +1 -1
  547. package/dist/components/filter.js +1 -1
  548. package/dist/components/filter2.js +1 -1
  549. package/dist/components/floating-ui.js +68 -62
  550. package/dist/components/focusTrapComponent.js +1 -1
  551. package/dist/components/form.js +1 -1
  552. package/dist/components/graph.js +1 -1
  553. package/dist/components/guid.js +1 -1
  554. package/dist/components/handle.js +1 -1
  555. package/dist/components/icon.js +1 -1
  556. package/dist/components/index.js +1 -1
  557. package/dist/components/index2.js +2116 -0
  558. package/dist/components/input-number.js +623 -0
  559. package/dist/components/input.js +2 -2
  560. package/dist/components/interactive.js +1 -1
  561. package/dist/components/key.js +1 -1
  562. package/dist/components/label.js +1 -1
  563. package/dist/components/label2.js +1 -1
  564. package/dist/components/link.js +1 -1
  565. package/dist/components/loadable.js +1 -1
  566. package/dist/components/loader.js +1 -1
  567. package/dist/components/locale.js +2 -2
  568. package/dist/components/math.js +1 -1
  569. package/dist/components/observers.js +1 -1
  570. package/dist/components/openCloseComponent.js +1 -1
  571. package/dist/components/panel.js +2 -2
  572. package/dist/components/pick-list-item.js +1 -1
  573. package/dist/components/popover.js +1 -1
  574. package/dist/components/progress.js +1 -1
  575. package/dist/components/resources.js +1 -1
  576. package/dist/components/resources2.js +1 -1
  577. package/dist/components/resources3.js +1 -1
  578. package/dist/components/scrim.js +1 -1
  579. package/dist/components/shared-list-render.js +1 -1
  580. package/dist/components/sortable.esm.js +1 -1
  581. package/dist/components/switch.js +1 -1
  582. package/dist/components/t9n.js +1 -1
  583. package/dist/components/tab-nav.js +1 -1
  584. package/dist/components/tab-title.js +1 -1
  585. package/dist/components/tab.js +1 -1
  586. package/dist/components/tabs.js +1 -1
  587. package/dist/components/throttle.js +1 -1
  588. package/dist/components/tile.js +1 -1
  589. package/dist/components/time-picker.js +2 -2
  590. package/dist/components/tooltip.js +38 -24
  591. package/dist/components/utils.js +112 -31
  592. package/dist/components/utils2.js +1 -1
  593. package/dist/components/utils3.js +1 -1
  594. package/dist/esm/{ExpandToggle-fde6af4a.js → ExpandToggle-453532fb.js} +5 -5
  595. package/dist/esm/{FloatingArrow-22ca29de.js → FloatingArrow-7e092a81.js} +2 -2
  596. package/dist/esm/{Heading-0cfa1161.js → Heading-3e8ede2b.js} +2 -2
  597. package/dist/esm/{app-globals-2838ecbb.js → app-globals-f5cd924f.js} +2 -2
  598. package/dist/esm/{array-2b055bc9.js → array-cd8aabd5.js} +1 -1
  599. package/dist/esm/calcite-accordion_2.entry.js +7 -7
  600. package/dist/esm/calcite-action-bar.entry.js +16 -16
  601. package/dist/esm/calcite-action-group.entry.js +13 -13
  602. package/dist/esm/calcite-action-menu.entry.js +9 -9
  603. package/dist/esm/calcite-action-pad.entry.js +14 -14
  604. package/dist/esm/calcite-action.entry.js +11 -11
  605. package/dist/esm/calcite-alert.entry.js +12 -12
  606. package/dist/esm/calcite-avatar.entry.js +9 -8
  607. package/dist/esm/calcite-block_2.entry.js +13 -13
  608. package/dist/esm/calcite-button.entry.js +13 -13
  609. package/dist/esm/calcite-card.entry.js +10 -10
  610. package/dist/esm/calcite-checkbox.entry.js +10 -10
  611. package/dist/esm/calcite-chip-group.entry.js +8 -8
  612. package/dist/esm/calcite-chip.entry.js +12 -12
  613. package/dist/esm/calcite-color-picker_3.entry.js +585 -339
  614. package/dist/esm/calcite-combobox_3.entry.js +18 -18
  615. package/dist/esm/calcite-date-picker_4.entry.js +13 -13
  616. package/dist/esm/calcite-dropdown_3.entry.js +12 -12
  617. package/dist/esm/calcite-fab.entry.js +7 -7
  618. package/dist/esm/calcite-filter.entry.js +13 -13
  619. package/dist/esm/calcite-flow-item.entry.js +15 -14
  620. package/dist/esm/calcite-flow.entry.js +3 -3
  621. package/dist/esm/calcite-graph_2.entry.js +13 -13
  622. package/dist/esm/calcite-handle.entry.js +10 -10
  623. package/dist/esm/calcite-icon.entry.js +6 -6
  624. package/dist/esm/calcite-inline-editable.entry.js +12 -12
  625. package/dist/esm/calcite-input-date-picker.entry.js +18 -18
  626. package/dist/esm/calcite-input-message.entry.js +5 -5
  627. package/dist/esm/calcite-input-number.entry.js +13 -13
  628. package/dist/esm/calcite-input-text.entry.js +13 -13
  629. package/dist/esm/calcite-input-time-picker_2.entry.js +14 -14
  630. package/dist/esm/calcite-input.entry.js +13 -13
  631. package/dist/esm/calcite-label.entry.js +6 -6
  632. package/dist/esm/calcite-link.entry.js +7 -7
  633. package/dist/esm/calcite-list_3.entry.js +50 -40
  634. package/dist/esm/calcite-loader.entry.js +3 -3
  635. package/dist/esm/calcite-modal.entry.js +13 -13
  636. package/dist/esm/calcite-notice.entry.js +12 -12
  637. package/dist/esm/calcite-option_3.entry.js +10 -10
  638. package/dist/esm/calcite-pagination.entry.js +10 -10
  639. package/dist/esm/calcite-panel.entry.js +15 -15
  640. package/dist/esm/calcite-pick-list_3.entry.js +16 -16
  641. package/dist/esm/calcite-popover.entry.js +16 -16
  642. package/dist/esm/calcite-progress.entry.js +2 -2
  643. package/dist/esm/calcite-radio-button-group.entry.js +3 -3
  644. package/dist/esm/calcite-radio-button.entry.js +10 -10
  645. package/dist/esm/calcite-rating.entry.js +13 -13
  646. package/dist/esm/calcite-scrim.entry.js +9 -9
  647. package/dist/esm/calcite-segmented-control_2.entry.js +9 -9
  648. package/dist/esm/calcite-shell_3.entry.js +11 -14
  649. package/dist/esm/calcite-sortable-list.entry.js +5 -5
  650. package/dist/esm/calcite-split-button.entry.js +4 -4
  651. package/dist/esm/calcite-stepper_2.entry.js +10 -10
  652. package/dist/esm/calcite-switch.entry.js +10 -10
  653. package/dist/esm/calcite-tab_4.entry.js +7 -7
  654. package/dist/esm/calcite-text-area.entry.js +15 -15
  655. package/dist/esm/calcite-tile-select_2.entry.js +5 -5
  656. package/dist/esm/calcite-tile.entry.js +8 -8
  657. package/dist/esm/calcite-tip_3.entry.js +11 -11
  658. package/dist/esm/calcite-tooltip.entry.js +46 -32
  659. package/dist/esm/calcite-tree_2.entry.js +47 -27
  660. package/dist/esm/calcite-value-list_2.entry.js +16 -16
  661. package/dist/esm/calcite.js +6 -6
  662. package/dist/esm/{composed-offset-position.esm-3d3a33f0.js → composed-offset-position.esm-76d65efb.js} +1 -1
  663. package/dist/esm/{conditionalSlot-cf62479a.js → conditionalSlot-aa1ef58a.js} +3 -3
  664. package/dist/esm/{debounce-5d51c702.js → debounce-8c6a3cbc.js} +1 -1
  665. package/dist/esm/{dom-edf2353d.js → dom-b9bed823.js} +116 -17
  666. package/dist/esm/{filter-f186a577.js → filter-e32fe919.js} +2 -2
  667. package/dist/esm/{floating-ui-6059a48a.js → floating-ui-fbd8bbc8.js} +71 -65
  668. package/dist/esm/{focusTrapComponent-3502b72b.js → focusTrapComponent-d63c1aa7.js} +2 -2
  669. package/dist/esm/{form-9792ef7d.js → form-7d8a2b92.js} +3 -3
  670. package/dist/esm/{guid-f191591c.js → guid-8fc9c6e4.js} +1 -1
  671. package/dist/esm/{index-182e3b39.js → index-18aa0ab5.js} +1 -1
  672. package/dist/esm/index.js +2 -2
  673. package/dist/esm/{interactive-e9ff4b45.js → interactive-c1d7134a.js} +1 -1
  674. package/dist/esm/{key-3503f056.js → key-c41d524a.js} +1 -1
  675. package/dist/esm/{label-21907408.js → label-fab33c80.js} +2 -2
  676. package/dist/esm/{loadable-a090b4d4.js → loadable-a4cb0e0a.js} +1 -1
  677. package/dist/esm/loader.js +6 -6
  678. package/dist/esm/{locale-6785b469.js → locale-70a08434.js} +4 -4
  679. package/dist/esm/{math-370975a2.js → math-4700eb3d.js} +1 -1
  680. package/dist/esm/{observers-cd3c1de9.js → observers-72f649b9.js} +1 -1
  681. package/dist/esm/{openCloseComponent-f3ea7fc6.js → openCloseComponent-7099262f.js} +2 -2
  682. package/dist/esm/{resources-5b8d643e.js → resources-04baed08.js} +1 -1
  683. package/dist/esm/{resources-f0665539.js → resources-3a3d58c2.js} +1 -1
  684. package/dist/esm/{resources-052baf79.js → resources-6f9c09ba.js} +5 -5
  685. package/dist/esm/{resources-63300d44.js → resources-6fb499ae.js} +1 -1
  686. package/dist/esm/{resources-a3f184da.js → resources-7d1e244f.js} +1 -1
  687. package/dist/esm/{resources-18d35b9a.js → resources-941c20ae.js} +1 -1
  688. package/dist/esm/{sortable.esm-8a9dc2f0.js → sortable.esm-fa5ebcb2.js} +1 -1
  689. package/dist/esm/{t9n-ee8bc8cf.js → t9n-1cf2a8af.js} +3 -3
  690. package/dist/esm/{throttle-e902571a.js → throttle-48795209.js} +2 -2
  691. package/dist/esm/{utils-dfe7cb74.js → utils-b673e5a0.js} +3 -3
  692. package/dist/esm/utils-cb560d06.js +195 -0
  693. package/dist/extras/docs-json.json +201 -39
  694. package/dist/extras/vscode-data.json +28 -4
  695. package/dist/loader/cdn.js +1 -1
  696. package/dist/loader/index.cjs.js +1 -1
  697. package/dist/loader/index.es2017.js +1 -1
  698. package/dist/loader/index.js +1 -1
  699. package/dist/types/components/avatar/avatar.d.ts +3 -1
  700. package/dist/types/components/color-picker/color-picker.d.ts +55 -26
  701. package/dist/types/components/color-picker/interfaces.d.ts +1 -0
  702. package/dist/types/components/color-picker/resources.d.ts +28 -18
  703. package/dist/types/components/color-picker/utils.d.ts +16 -7
  704. package/dist/types/components/color-picker-hex-input/color-picker-hex-input.d.ts +33 -16
  705. package/dist/types/components/color-picker-hex-input/resources.d.ts +2 -2
  706. package/dist/types/components/color-picker-swatch/color-picker-swatch.d.ts +3 -2
  707. package/dist/types/components/color-picker-swatch/resources.d.ts +6 -1
  708. package/dist/types/components/flow-item/flow-item.d.ts +2 -1
  709. package/dist/types/components/flow-item/resources.d.ts +1 -0
  710. package/dist/types/components/list/list.d.ts +7 -2
  711. package/dist/types/components/list/resources.d.ts +1 -1
  712. package/dist/types/components/panel/panel.d.ts +1 -1
  713. package/dist/types/components/tooltip/TooltipManager.d.ts +3 -2
  714. package/dist/types/components/tree-item/tree-item.d.ts +2 -0
  715. package/dist/types/components.d.ts +74 -10
  716. package/dist/types/preact.d.ts +2 -1
  717. package/dist/types/utils/dom.d.ts +115 -19
  718. package/hydrate/index.js +987 -512
  719. package/package.json +5 -6
  720. package/dist/calcite/p-0847f232.entry.js +0 -6
  721. package/dist/calcite/p-20ed5889.entry.js +0 -6
  722. package/dist/calcite/p-2cccfd42.entry.js +0 -6
  723. package/dist/calcite/p-3b4e44ab.entry.js +0 -6
  724. package/dist/calcite/p-425f369a.entry.js +0 -6
  725. package/dist/calcite/p-48afa956.entry.js +0 -6
  726. package/dist/calcite/p-5fae16d7.js +0 -6
  727. package/dist/calcite/p-8b364d5b.entry.js +0 -6
  728. package/dist/calcite/p-9779f6b5.entry.js +0 -6
  729. package/dist/calcite/p-afae74bd.js +0 -6
  730. package/dist/calcite/p-bf6df76d.js +0 -6
  731. package/dist/calcite/p-d2900eba.js +0 -6
  732. package/dist/calcite/p-e6dc645d.entry.js +0 -6
  733. package/dist/calcite/p-ebefbd07.js +0 -6
  734. package/dist/calcite/p-f0f05600.entry.js +0 -6
  735. package/dist/calcite/p-f8e0c9ff.js +0 -6
  736. package/dist/cjs/utils-7c8d4b9c.js +0 -124
  737. package/dist/esm/utils-9af69cbe.js +0 -114
@@ -1,14 +1,14 @@
1
1
  /*!
2
2
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
4
- * v1.4.0-next.0
4
+ * v1.4.0-next.10
5
5
  */
6
6
  import { h } from "@stencil/core";
7
7
  import Color from "color";
8
8
  import { throttle } from "lodash-es";
9
9
  import { getElementDir, isPrimaryPointerButton } from "../../utils/dom";
10
- import { CSS, DEFAULT_COLOR, DEFAULT_STORAGE_KEY_PREFIX, DIMENSIONS, HSV_LIMITS, RGB_LIMITS } from "./resources";
11
- import { colorEqual, CSSColorMode, normalizeHex, parseMode } from "./utils";
10
+ import { CSS, DEFAULT_COLOR, DEFAULT_STORAGE_KEY_PREFIX, DIMENSIONS, HSV_LIMITS, OPACITY_LIMITS, RGB_LIMITS } from "./resources";
11
+ import { alphaCompatible, alphaToOpacity, colorEqual, CSSColorMode, hexify, normalizeAlpha, normalizeColor, normalizeHex, opacityToAlpha, parseMode, toAlphaMode, toNonAlphaMode } from "./utils";
12
12
  import { updateHostInteraction } from "../../utils/interactive";
13
13
  import { isActivationKey } from "../../utils/key";
14
14
  import { componentLoaded, setComponentLoaded, setUpLoadableComponent } from "../../utils/loadable";
@@ -16,16 +16,11 @@ import { connectLocalized, disconnectLocalized } from "../../utils/locale";
16
16
  import { clamp } from "../../utils/math";
17
17
  import { connectMessages, disconnectMessages, setUpMessages, updateMessages } from "../../utils/t9n";
18
18
  const throttleFor60FpsInMs = 16;
19
- const defaultValue = normalizeHex(DEFAULT_COLOR.hex());
20
- const defaultFormat = "auto";
21
19
  export class ColorPicker {
22
20
  constructor() {
23
- this.colorFieldAndSliderHovered = false;
24
- this.hueThumbState = "idle";
25
21
  this.internalColorUpdateContext = null;
26
22
  this.mode = CSSColorMode.HEX;
27
23
  this.shiftKeyChannelAdjustment = 0;
28
- this.sliderThumbState = "idle";
29
24
  this.handleTabActivate = (event) => {
30
25
  this.channelMode = event.currentTarget.getAttribute("data-color-mode");
31
26
  this.updateChannelsFromColor(this.color);
@@ -70,7 +65,7 @@ export class ColorPicker {
70
65
  this.internalColorSet(null);
71
66
  return;
72
67
  }
73
- const normalizedHex = color && normalizeHex(color.hex());
68
+ const normalizedHex = color && normalizeHex(hexify(color, alphaCompatible(this.mode)));
74
69
  if (hex !== normalizedHex) {
75
70
  this.internalColorSet(Color(hex));
76
71
  }
@@ -82,16 +77,20 @@ export class ColorPicker {
82
77
  this.handleChannelInput = (event) => {
83
78
  const input = event.currentTarget;
84
79
  const channelIndex = Number(input.getAttribute("data-channel-index"));
85
- const limit = this.channelMode === "rgb"
86
- ? RGB_LIMITS[Object.keys(RGB_LIMITS)[channelIndex]]
87
- : HSV_LIMITS[Object.keys(HSV_LIMITS)[channelIndex]];
80
+ const isAlphaChannel = channelIndex === 3;
81
+ const limit = isAlphaChannel
82
+ ? OPACITY_LIMITS.max
83
+ : this.channelMode === "rgb"
84
+ ? RGB_LIMITS[Object.keys(RGB_LIMITS)[channelIndex]]
85
+ : HSV_LIMITS[Object.keys(HSV_LIMITS)[channelIndex]];
88
86
  let inputValue;
89
87
  if (this.allowEmpty && !input.value) {
90
88
  inputValue = "";
91
89
  }
92
90
  else {
93
- const value = Number(input.value) + this.shiftKeyChannelAdjustment;
94
- const clamped = clamp(value, 0, limit);
91
+ const value = Number(input.value);
92
+ const adjustedValue = value + this.shiftKeyChannelAdjustment;
93
+ const clamped = clamp(adjustedValue, 0, limit);
95
94
  inputValue = clamped.toString();
96
95
  }
97
96
  input.value = inputValue;
@@ -105,11 +104,13 @@ export class ColorPicker {
105
104
  const channels = [...this.channels];
106
105
  const shouldClearChannels = this.allowEmpty && !input.value;
107
106
  if (shouldClearChannels) {
108
- this.channels = [null, null, null];
107
+ this.channels = [null, null, null, null];
109
108
  this.internalColorSet(null);
110
109
  return;
111
110
  }
112
- channels[channelIndex] = Number(input.value);
111
+ const isAlphaChannel = channelIndex === 3;
112
+ const value = Number(input.value);
113
+ channels[channelIndex] = isAlphaChannel ? opacityToAlpha(value) : value;
113
114
  this.updateColorFromChannels(channels);
114
115
  };
115
116
  this.handleSavedColorKeyDown = (event) => {
@@ -118,144 +119,101 @@ export class ColorPicker {
118
119
  this.handleSavedColorSelect(event);
119
120
  }
120
121
  };
121
- this.handleColorFieldAndSliderPointerLeave = () => {
122
- this.colorFieldAndSliderInteractive = false;
123
- this.colorFieldAndSliderHovered = false;
124
- if (this.sliderThumbState !== "drag" && this.hueThumbState !== "drag") {
125
- this.hueThumbState = "idle";
126
- this.sliderThumbState = "idle";
127
- this.drawColorFieldAndSlider();
128
- }
129
- };
130
- this.handleColorFieldAndSliderPointerDown = (event) => {
122
+ this.handleColorFieldPointerDown = (event) => {
131
123
  if (!isPrimaryPointerButton(event)) {
132
124
  return;
133
125
  }
134
126
  const { offsetX, offsetY } = event;
135
- const region = this.getCanvasRegion(offsetY);
136
- if (region === "color-field") {
137
- this.hueThumbState = "drag";
138
- this.captureColorFieldColor(offsetX, offsetY);
139
- this.colorFieldScopeNode?.focus();
127
+ document.addEventListener("pointermove", this.globalPointerMoveHandler);
128
+ document.addEventListener("pointerup", this.globalPointerUpHandler, { once: true });
129
+ this.activeCanvasInfo = {
130
+ context: this.colorFieldRenderingContext,
131
+ bounds: this.colorFieldRenderingContext.canvas.getBoundingClientRect()
132
+ };
133
+ this.captureColorFieldColor(offsetX, offsetY);
134
+ this.colorFieldScopeNode.focus();
135
+ };
136
+ this.handleHueSliderPointerDown = (event) => {
137
+ if (!isPrimaryPointerButton(event)) {
138
+ return;
140
139
  }
141
- else if (region === "slider") {
142
- this.sliderThumbState = "drag";
143
- this.captureHueSliderColor(offsetX);
144
- this.hueScopeNode?.focus();
140
+ const { offsetX } = event;
141
+ document.addEventListener("pointermove", this.globalPointerMoveHandler);
142
+ document.addEventListener("pointerup", this.globalPointerUpHandler, { once: true });
143
+ this.activeCanvasInfo = {
144
+ context: this.hueSliderRenderingContext,
145
+ bounds: this.hueSliderRenderingContext.canvas.getBoundingClientRect()
146
+ };
147
+ this.captureHueSliderColor(offsetX);
148
+ this.hueScopeNode.focus();
149
+ };
150
+ this.handleOpacitySliderPointerDown = (event) => {
151
+ if (!isPrimaryPointerButton(event)) {
152
+ return;
145
153
  }
154
+ const { offsetX } = event;
146
155
  document.addEventListener("pointermove", this.globalPointerMoveHandler);
147
156
  document.addEventListener("pointerup", this.globalPointerUpHandler, { once: true });
148
- this.activeColorFieldAndSliderRect =
149
- this.fieldAndSliderRenderingContext.canvas.getBoundingClientRect();
157
+ this.activeCanvasInfo = {
158
+ context: this.opacitySliderRenderingContext,
159
+ bounds: this.opacitySliderRenderingContext.canvas.getBoundingClientRect()
160
+ };
161
+ this.captureOpacitySliderValue(offsetX);
162
+ this.opacityScopeNode.focus();
150
163
  };
151
164
  this.globalPointerUpHandler = (event) => {
152
165
  if (!isPrimaryPointerButton(event)) {
153
166
  return;
154
167
  }
155
- const previouslyDragging = this.sliderThumbState === "drag" || this.hueThumbState === "drag";
156
- this.hueThumbState = "idle";
157
- this.sliderThumbState = "idle";
158
- this.activeColorFieldAndSliderRect = null;
159
- this.drawColorFieldAndSlider();
168
+ const previouslyDragging = this.activeCanvasInfo;
169
+ this.activeCanvasInfo = null;
170
+ this.drawColorControls();
160
171
  if (previouslyDragging) {
161
172
  this.calciteColorPickerChange.emit();
162
173
  }
163
174
  };
164
175
  this.globalPointerMoveHandler = (event) => {
165
- const { el, dimensions } = this;
166
- const sliderThumbDragging = this.sliderThumbState === "drag";
167
- const hueThumbDragging = this.hueThumbState === "drag";
168
- if (!el.isConnected || (!sliderThumbDragging && !hueThumbDragging)) {
176
+ const { activeCanvasInfo, el } = this;
177
+ if (!el.isConnected || !activeCanvasInfo) {
169
178
  return;
170
179
  }
180
+ const { context, bounds } = activeCanvasInfo;
171
181
  let samplingX;
172
182
  let samplingY;
173
- const colorFieldAndSliderRect = this.activeColorFieldAndSliderRect;
174
183
  const { clientX, clientY } = event;
175
- if (this.colorFieldAndSliderHovered) {
176
- samplingX = clientX - colorFieldAndSliderRect.x;
177
- samplingY = clientY - colorFieldAndSliderRect.y;
184
+ if (context.canvas.matches(":hover")) {
185
+ samplingX = clientX - bounds.x;
186
+ samplingY = clientY - bounds.y;
178
187
  }
179
188
  else {
180
- const colorFieldWidth = dimensions.colorField.width;
181
- const colorFieldHeight = dimensions.colorField.height;
182
- const hueSliderHeight = dimensions.slider.height;
183
- if (clientX < colorFieldAndSliderRect.x + colorFieldWidth &&
184
- clientX > colorFieldAndSliderRect.x) {
185
- samplingX = clientX - colorFieldAndSliderRect.x;
189
+ // snap x and y to the closest edge
190
+ if (clientX < bounds.x + bounds.width && clientX > bounds.x) {
191
+ samplingX = clientX - bounds.x;
186
192
  }
187
- else if (clientX < colorFieldAndSliderRect.x) {
193
+ else if (clientX < bounds.x) {
188
194
  samplingX = 0;
189
195
  }
190
196
  else {
191
- samplingX = colorFieldWidth - 1;
197
+ samplingX = bounds.width;
192
198
  }
193
- if (clientY < colorFieldAndSliderRect.y + colorFieldHeight + hueSliderHeight &&
194
- clientY > colorFieldAndSliderRect.y) {
195
- samplingY = clientY - colorFieldAndSliderRect.y;
199
+ if (clientY < bounds.y + bounds.height && clientY > bounds.y) {
200
+ samplingY = clientY - bounds.y;
196
201
  }
197
- else if (clientY < colorFieldAndSliderRect.y) {
202
+ else if (clientY < bounds.y) {
198
203
  samplingY = 0;
199
204
  }
200
205
  else {
201
- samplingY = colorFieldHeight + hueSliderHeight;
206
+ samplingY = bounds.height;
202
207
  }
203
208
  }
204
- if (hueThumbDragging) {
209
+ if (context === this.colorFieldRenderingContext) {
205
210
  this.captureColorFieldColor(samplingX, samplingY, false);
206
211
  }
207
- else {
212
+ else if (context === this.hueSliderRenderingContext) {
208
213
  this.captureHueSliderColor(samplingX);
209
214
  }
210
- };
211
- this.handleColorFieldAndSliderPointerEnterOrMove = ({ offsetX, offsetY }) => {
212
- const { dimensions: { colorField, slider, thumb } } = this;
213
- this.colorFieldAndSliderInteractive = offsetY <= colorField.height + slider.height;
214
- this.colorFieldAndSliderHovered = true;
215
- const region = this.getCanvasRegion(offsetY);
216
- if (region === "color-field") {
217
- const prevHueThumbState = this.hueThumbState;
218
- const color = this.baseColorFieldColor.hsv();
219
- const centerX = Math.round(color.saturationv() / (HSV_LIMITS.s / colorField.width));
220
- const centerY = Math.round(colorField.height - color.value() / (HSV_LIMITS.v / colorField.height));
221
- const hoveringThumb = this.containsPoint(offsetX, offsetY, centerX, centerY, thumb.radius);
222
- let transitionedBetweenHoverAndIdle = false;
223
- if (prevHueThumbState === "idle" && hoveringThumb) {
224
- this.hueThumbState = "hover";
225
- transitionedBetweenHoverAndIdle = true;
226
- }
227
- else if (prevHueThumbState === "hover" && !hoveringThumb) {
228
- this.hueThumbState = "idle";
229
- transitionedBetweenHoverAndIdle = true;
230
- }
231
- if (this.hueThumbState !== "drag") {
232
- if (transitionedBetweenHoverAndIdle) {
233
- // refresh since we won't update color and thus no redraw
234
- this.drawColorFieldAndSlider();
235
- }
236
- }
237
- }
238
- else if (region === "slider") {
239
- const sliderThumbColor = this.baseColorFieldColor.hsv().saturationv(100).value(100);
240
- const prevSliderThumbState = this.sliderThumbState;
241
- const sliderThumbCenterX = Math.round(sliderThumbColor.hue() / (360 / slider.width));
242
- const sliderThumbCenterY = Math.round((slider.height + this.getSliderCapSpacing()) / 2) + colorField.height;
243
- const hoveringSliderThumb = this.containsPoint(offsetX, offsetY, sliderThumbCenterX, sliderThumbCenterY, thumb.radius);
244
- let sliderThumbTransitionedBetweenHoverAndIdle = false;
245
- if (prevSliderThumbState === "idle" && hoveringSliderThumb) {
246
- this.sliderThumbState = "hover";
247
- sliderThumbTransitionedBetweenHoverAndIdle = true;
248
- }
249
- else if (prevSliderThumbState === "hover" && !hoveringSliderThumb) {
250
- this.sliderThumbState = "idle";
251
- sliderThumbTransitionedBetweenHoverAndIdle = true;
252
- }
253
- if (this.sliderThumbState !== "drag") {
254
- if (sliderThumbTransitionedBetweenHoverAndIdle) {
255
- // refresh since we won't update color and thus no redraw
256
- this.drawColorFieldAndSlider();
257
- }
258
- }
215
+ else if (context === this.opacitySliderRenderingContext) {
216
+ this.captureOpacitySliderValue(samplingX);
259
217
  }
260
218
  };
261
219
  this.storeColorFieldScope = (node) => {
@@ -271,23 +229,35 @@ export class ColorPicker {
271
229
  return (h("calcite-tab-title", { class: CSS.colorMode, "data-color-mode": channelMode, key: channelMode, onCalciteTabsActivate: this.handleTabActivate, selected: selected }, label));
272
230
  };
273
231
  this.renderChannelsTab = (channelMode) => {
274
- const { channelMode: activeChannelMode, channels, messages } = this;
232
+ const { allowEmpty, channelMode: activeChannelMode, channels, messages, alphaChannel } = this;
275
233
  const selected = channelMode === activeChannelMode;
276
234
  const isRgb = channelMode === "rgb";
277
- const channelLabels = isRgb
278
- ? [messages.r, messages.g, messages.b]
279
- : [messages.h, messages.s, messages.v];
280
235
  const channelAriaLabels = isRgb
281
236
  ? [messages.red, messages.green, messages.blue]
282
237
  : [messages.hue, messages.saturation, messages.value];
283
238
  const direction = getElementDir(this.el);
284
- return (h("calcite-tab", { class: CSS.control, key: channelMode, selected: selected }, h("div", { class: CSS.channels, dir: "ltr" }, channels.map((channel, index) =>
285
- /* the channel container is ltr, so we apply the host's direction */
286
- this.renderChannel(channel, index, channelLabels[index], channelAriaLabels[index], direction)))));
239
+ const channelsToRender = alphaChannel ? channels : channels.slice(0, 3);
240
+ return (h("calcite-tab", { class: CSS.control, key: channelMode, selected: selected }, h("div", { class: CSS.channels, dir: "ltr" }, channelsToRender.map((channelValue, index) => {
241
+ const isAlphaChannel = index === 3;
242
+ if (isAlphaChannel) {
243
+ channelValue =
244
+ allowEmpty && !channelValue ? channelValue : alphaToOpacity(channelValue);
245
+ }
246
+ /* the channel container is ltr, so we apply the host's direction */
247
+ return this.renderChannel(channelValue, index, channelAriaLabels[index], direction, isAlphaChannel ? "%" : "");
248
+ }))));
249
+ };
250
+ this.renderChannel = (value, index, ariaLabel, direction, suffix) => {
251
+ return (h("calcite-input", { class: CSS.channel, "data-channel-index": index, dir: direction, key: index, label: ariaLabel, lang: this.effectiveLocale, numberButtonType: "none", numberingSystem: this.numberingSystem, onCalciteInputChange: this.handleChannelChange, onCalciteInputInput: this.handleChannelInput, onKeyDown: this.handleKeyDown, scale: this.scale === "l" ? "m" : "s",
252
+ // workaround to ensure input borders overlap as desired
253
+ // this is because the build transforms margin-left to its
254
+ // logical-prop, which is undesired as channels are always ltr
255
+ style: {
256
+ marginLeft: index > 0 && !(this.scale === "s" && this.alphaChannel && index === 3) ? "-1px" : ""
257
+ }, suffixText: suffix, type: "number", value: value?.toString() }));
287
258
  };
288
- this.renderChannel = (value, index, label, ariaLabel, direction) => (h("calcite-input", { class: CSS.channel, "data-channel-index": index, dir: direction, label: ariaLabel, lang: this.effectiveLocale, numberButtonType: "none", numberingSystem: this.numberingSystem, onCalciteInputChange: this.handleChannelChange, onCalciteInputInput: this.handleChannelInput, onKeyDown: this.handleKeyDown, prefixText: label, scale: this.scale === "l" ? "m" : "s", type: "number", value: value?.toString() }));
289
259
  this.deleteColor = () => {
290
- const colorToDelete = this.color.hex();
260
+ const colorToDelete = hexify(this.color, this.alphaChannel);
291
261
  const inStorage = this.savedColors.indexOf(colorToDelete) > -1;
292
262
  if (!inStorage) {
293
263
  return;
@@ -300,7 +270,7 @@ export class ColorPicker {
300
270
  }
301
271
  };
302
272
  this.saveColor = () => {
303
- const colorToSave = this.color.hex();
273
+ const colorToSave = hexify(this.color, this.alphaChannel);
304
274
  const alreadySaved = this.savedColors.indexOf(colorToSave) > -1;
305
275
  if (alreadySaved) {
306
276
  return;
@@ -312,12 +282,18 @@ export class ColorPicker {
312
282
  localStorage.setItem(storageKey, JSON.stringify(savedColors));
313
283
  }
314
284
  };
315
- this.drawColorFieldAndSlider = throttle(() => {
316
- if (!this.fieldAndSliderRenderingContext) {
317
- return;
285
+ this.drawColorControls = throttle((type = "all") => {
286
+ if ((type === "all" || type === "color-field") && this.colorFieldRenderingContext) {
287
+ this.drawColorField();
288
+ }
289
+ if ((type === "all" || type === "hue-slider") && this.hueSliderRenderingContext) {
290
+ this.drawHueSlider();
291
+ }
292
+ if (this.alphaChannel &&
293
+ (type === "all" || type === "opacity-slider") &&
294
+ this.opacitySliderRenderingContext) {
295
+ this.drawOpacitySlider();
318
296
  }
319
- this.drawColorField();
320
- this.drawHueSlider();
321
297
  }, throttleFor60FpsInMs);
322
298
  this.captureColorFieldColor = (x, y, skipEqual = true) => {
323
299
  const { dimensions: { colorField: { height, width } } } = this;
@@ -325,24 +301,56 @@ export class ColorPicker {
325
301
  const value = Math.round((HSV_LIMITS.v / height) * (height - y));
326
302
  this.internalColorSet(this.baseColorFieldColor.hsv().saturationv(saturation).value(value), skipEqual);
327
303
  };
328
- this.initColorFieldAndSlider = (canvas) => {
329
- this.fieldAndSliderRenderingContext = canvas.getContext("2d");
330
- this.updateCanvasSize(canvas);
304
+ this.initColorField = (canvas) => {
305
+ this.colorFieldRenderingContext = canvas.getContext("2d");
306
+ this.updateCanvasSize("color-field");
307
+ this.drawColorControls();
308
+ };
309
+ this.initHueSlider = (canvas) => {
310
+ this.hueSliderRenderingContext = canvas.getContext("2d");
311
+ this.updateCanvasSize("hue-slider");
312
+ this.drawHueSlider();
313
+ };
314
+ this.initOpacitySlider = (canvas) => {
315
+ this.opacitySliderRenderingContext = canvas.getContext("2d");
316
+ this.updateCanvasSize("opacity-slider");
317
+ this.drawOpacitySlider();
318
+ };
319
+ this.storeOpacityScope = (node) => {
320
+ this.opacityScopeNode = node;
321
+ };
322
+ this.handleOpacityScopeKeyDown = (event) => {
323
+ const modifier = event.shiftKey ? 10 : 1;
324
+ const { key } = event;
325
+ const arrowKeyToXOffset = {
326
+ ArrowUp: 1,
327
+ ArrowRight: 1,
328
+ ArrowDown: -1,
329
+ ArrowLeft: -1
330
+ };
331
+ if (arrowKeyToXOffset[key]) {
332
+ event.preventDefault();
333
+ const delta = opacityToAlpha(arrowKeyToXOffset[key] * modifier);
334
+ this.captureHueSliderColor(this.opacityScopeLeft + delta);
335
+ }
331
336
  };
332
337
  this.allowEmpty = false;
338
+ this.alphaChannel = false;
339
+ this.channelsDisabled = false;
333
340
  this.color = DEFAULT_COLOR;
334
341
  this.disabled = false;
335
- this.format = defaultFormat;
336
- this.hideHex = false;
342
+ this.format = "auto";
337
343
  this.hideChannels = false;
344
+ this.hexDisabled = false;
345
+ this.hideHex = false;
338
346
  this.hideSaved = false;
347
+ this.savedDisabled = false;
339
348
  this.scale = "m";
340
349
  this.storageId = undefined;
341
350
  this.messageOverrides = undefined;
342
351
  this.numberingSystem = undefined;
343
- this.value = defaultValue;
352
+ this.value = normalizeHex(hexify(DEFAULT_COLOR, this.alphaChannel));
344
353
  this.defaultMessages = undefined;
345
- this.colorFieldAndSliderInteractive = false;
346
354
  this.channelMode = "rgb";
347
355
  this.channels = this.toChannels(DEFAULT_COLOR);
348
356
  this.dimensions = DIMENSIONS.m;
@@ -351,12 +359,19 @@ export class ColorPicker {
351
359
  this.savedColors = [];
352
360
  this.colorFieldScopeTop = undefined;
353
361
  this.colorFieldScopeLeft = undefined;
354
- this.scopeOrientation = undefined;
355
362
  this.hueScopeLeft = undefined;
356
- this.hueScopeTop = undefined;
363
+ this.opacityScopeLeft = undefined;
364
+ this.scopeOrientation = undefined;
365
+ }
366
+ handleAlphaChannelChange(alphaChannel) {
367
+ const { format } = this;
368
+ if (alphaChannel && format !== "auto" && !alphaCompatible(format)) {
369
+ console.warn(`ignoring alphaChannel as the current format (${format}) does not support alpha`);
370
+ this.alphaChannel = false;
371
+ }
357
372
  }
358
373
  handleColorChange(color, oldColor) {
359
- this.drawColorFieldAndSlider();
374
+ this.drawColorControls();
360
375
  this.updateChannelsFromColor(color);
361
376
  this.previousColor = oldColor;
362
377
  }
@@ -366,7 +381,8 @@ export class ColorPicker {
366
381
  }
367
382
  handleScaleChange(scale = "m") {
368
383
  this.updateDimensions(scale);
369
- this.updateCanvasSize(this.fieldAndSliderRenderingContext?.canvas);
384
+ this.updateCanvasSize("all");
385
+ this.drawColorControls();
370
386
  }
371
387
  onMessagesChange() {
372
388
  /* wired up by t9n util */
@@ -383,9 +399,9 @@ export class ColorPicker {
383
399
  return;
384
400
  }
385
401
  modeChanged = this.mode !== nextMode;
386
- this.setMode(nextMode);
402
+ this.setMode(nextMode, this.internalColorUpdateContext === null);
387
403
  }
388
- const dragging = this.sliderThumbState === "drag" || this.hueThumbState === "drag";
404
+ const dragging = this.activeCanvasInfo;
389
405
  if (this.internalColorUpdateContext === "initial") {
390
406
  return;
391
407
  }
@@ -396,17 +412,16 @@ export class ColorPicker {
396
412
  }
397
413
  return;
398
414
  }
399
- const color = allowEmpty && !value ? null : Color(value);
415
+ const color = allowEmpty && !value
416
+ ? null
417
+ : Color(value != null && typeof value === "object" && alphaCompatible(this.mode)
418
+ ? normalizeColor(value)
419
+ : value);
400
420
  const colorChanged = !colorEqual(color, this.color);
401
421
  if (modeChanged || colorChanged) {
402
- this.internalColorSet(color, true, "internal");
422
+ this.internalColorSet(color, this.alphaChannel && !(this.mode.endsWith("a") || this.mode.endsWith("a-css")), "internal");
403
423
  }
404
424
  }
405
- //--------------------------------------------------------------------------
406
- //
407
- // Internal State/Props
408
- //
409
- //--------------------------------------------------------------------------
410
425
  get baseColorFieldColor() {
411
426
  return this.color || this.previousColor || DEFAULT_COLOR;
412
427
  }
@@ -462,7 +477,7 @@ export class ColorPicker {
462
477
  if (!valueIsCompatible) {
463
478
  this.showIncompatibleColorWarning(value, format);
464
479
  }
465
- this.setMode(format);
480
+ this.setMode(format, false);
466
481
  this.internalColorSet(initialColor, false, "initial");
467
482
  this.updateDimensions(this.scale);
468
483
  const storageKey = `${DEFAULT_STORAGE_KEY_PREFIX}${this.storageId}`;
@@ -493,34 +508,38 @@ export class ColorPicker {
493
508
  //
494
509
  //--------------------------------------------------------------------------
495
510
  render() {
496
- const { allowEmpty, color, messages, hideHex, hideChannels, hideSaved, savedColors, scale } = this;
497
- const selectedColorInHex = color ? color.hex() : null;
498
- const hexInputScale = scale === "l" ? "m" : "s";
499
- const { colorFieldAndSliderInteractive, colorFieldScopeTop, colorFieldScopeLeft, hueScopeLeft, hueScopeTop, scopeOrientation, dimensions: { colorField: { height: colorFieldHeight, width: colorFieldWidth }, slider: { height: sliderHeight } } } = this;
500
- const hueTop = hueScopeTop ?? sliderHeight / 2 + colorFieldHeight;
501
- const hueLeft = hueScopeLeft ?? (colorFieldWidth * DEFAULT_COLOR.hue()) / HSV_LIMITS.h;
511
+ const { allowEmpty, channelsDisabled, color, colorFieldScopeLeft, colorFieldScopeTop, dimensions: { colorField: { width: colorFieldWidth }, slider: { width: sliderWidth }, thumb: { radius: thumbRadius } }, hexDisabled, hideChannels, hideHex, hideSaved, hueScopeLeft, messages, alphaChannel, opacityScopeLeft, savedColors, savedDisabled, scale, scopeOrientation } = this;
512
+ const selectedColorInHex = color ? hexify(color, alphaChannel) : null;
513
+ const hueTop = thumbRadius;
514
+ const hueLeft = hueScopeLeft ?? (sliderWidth * DEFAULT_COLOR.hue()) / HSV_LIMITS.h;
515
+ const opacityTop = thumbRadius;
516
+ const opacityLeft = opacityScopeLeft ??
517
+ (colorFieldWidth * alphaToOpacity(DEFAULT_COLOR.alpha())) / OPACITY_LIMITS.max;
502
518
  const noColor = color === null;
503
519
  const vertical = scopeOrientation === "vertical";
504
- return (h("div", { class: CSS.container }, h("div", { class: CSS.colorFieldAndSliderWrap }, h("canvas", { class: {
505
- [CSS.colorFieldAndSlider]: true,
506
- [CSS.colorFieldAndSliderInteractive]: colorFieldAndSliderInteractive
507
- }, onPointerDown: this.handleColorFieldAndSliderPointerDown, onPointerEnter: this.handleColorFieldAndSliderPointerEnterOrMove, onPointerLeave: this.handleColorFieldAndSliderPointerLeave, onPointerMove: this.handleColorFieldAndSliderPointerEnterOrMove,
520
+ const noHex = hexDisabled || hideHex;
521
+ const noChannels = channelsDisabled || hideChannels;
522
+ const noSaved = savedDisabled || hideSaved;
523
+ return (h("div", { class: CSS.container }, h("div", { class: CSS.controlAndScope }, h("canvas", { class: CSS.colorField, onPointerDown: this.handleColorFieldPointerDown,
524
+ // eslint-disable-next-line react/jsx-sort-props
525
+ ref: this.initColorField }), h("div", { "aria-label": vertical ? messages.value : messages.saturation, "aria-valuemax": vertical ? HSV_LIMITS.v : HSV_LIMITS.s, "aria-valuemin": "0", "aria-valuenow": (vertical ? color?.saturationv() : color?.value()) || "0", class: { [CSS.scope]: true, [CSS.colorFieldScope]: true }, onKeyDown: this.handleColorFieldScopeKeyDown, role: "slider", style: { top: `${colorFieldScopeTop || 0}px`, left: `${colorFieldScopeLeft || 0}px` }, tabindex: "0",
526
+ // eslint-disable-next-line react/jsx-sort-props
527
+ ref: this.storeColorFieldScope })), h("div", { class: CSS.previewAndSliders }, h("calcite-color-picker-swatch", { class: CSS.preview, color: selectedColorInHex, scale: "l" }), h("div", { class: CSS.sliders }, h("div", { class: CSS.controlAndScope }, h("canvas", { class: { [CSS.slider]: true, [CSS.hueSlider]: true }, onPointerDown: this.handleHueSliderPointerDown,
528
+ // eslint-disable-next-line react/jsx-sort-props
529
+ ref: this.initHueSlider }), h("div", { "aria-label": messages.hue, "aria-valuemax": HSV_LIMITS.h, "aria-valuemin": "0", "aria-valuenow": color?.round().hue() || DEFAULT_COLOR.round().hue(), class: { [CSS.scope]: true, [CSS.hueScope]: true }, onKeyDown: this.handleHueScopeKeyDown, role: "slider", style: { top: `${hueTop}px`, left: `${hueLeft}px` }, tabindex: "0",
508
530
  // eslint-disable-next-line react/jsx-sort-props
509
- ref: this.initColorFieldAndSlider }), h("div", { "aria-label": vertical ? messages.value : messages.saturation, "aria-valuemax": vertical ? HSV_LIMITS.v : HSV_LIMITS.s, "aria-valuemin": "0", "aria-valuenow": (vertical ? color?.saturationv() : color?.value()) || "0", class: { [CSS.scope]: true, [CSS.colorFieldScope]: true }, onKeyDown: this.handleColorFieldScopeKeyDown, role: "slider", style: { top: `${colorFieldScopeTop || 0}px`, left: `${colorFieldScopeLeft || 0}px` }, tabindex: "0",
531
+ ref: this.storeHueScope })), alphaChannel ? (h("div", { class: CSS.controlAndScope }, h("canvas", { class: { [CSS.slider]: true, [CSS.opacitySlider]: true }, onPointerDown: this.handleOpacitySliderPointerDown,
510
532
  // eslint-disable-next-line react/jsx-sort-props
511
- ref: this.storeColorFieldScope }), h("div", { "aria-label": messages.hue, "aria-valuemax": HSV_LIMITS.h, "aria-valuemin": "0", "aria-valuenow": color?.round().hue() || DEFAULT_COLOR.round().hue(), class: { [CSS.scope]: true, [CSS.hueScope]: true }, onKeyDown: this.handleHueScopeKeyDown, role: "slider", style: { top: `${hueTop}px`, left: `${hueLeft}px` }, tabindex: "0",
533
+ ref: this.initOpacitySlider }), h("div", { "aria-label": messages.opacity, "aria-valuemax": OPACITY_LIMITS.max, "aria-valuemin": OPACITY_LIMITS.min, "aria-valuenow": (color || DEFAULT_COLOR).round().alpha(), class: { [CSS.scope]: true, [CSS.opacityScope]: true }, onKeyDown: this.handleOpacityScopeKeyDown, role: "slider", style: { top: `${opacityTop}px`, left: `${opacityLeft}px` }, tabindex: "0",
512
534
  // eslint-disable-next-line react/jsx-sort-props
513
- ref: this.storeHueScope })), hideHex && hideChannels ? null : (h("div", { class: {
535
+ ref: this.storeOpacityScope }))) : null)), noHex && noChannels ? null : (h("div", { class: {
514
536
  [CSS.controlSection]: true,
515
537
  [CSS.section]: true
516
- } }, hideHex ? null : (h("div", { class: CSS.hexOptions }, h("span", { class: {
517
- [CSS.header]: true,
518
- [CSS.headerHex]: true
519
- } }, messages.hex), h("calcite-color-picker-hex-input", { allowEmpty: allowEmpty, class: CSS.control, hexLabel: messages.hex, numberingSystem: this.numberingSystem, onCalciteColorPickerHexInputChange: this.handleHexInputChange, scale: hexInputScale, value: selectedColorInHex }))), hideChannels ? null : (h("calcite-tabs", { class: {
538
+ } }, h("div", { class: CSS.hexAndChannelsGroup }, noHex ? null : (h("div", { class: CSS.hexOptions }, h("calcite-color-picker-hex-input", { allowEmpty: allowEmpty, alphaChannel: alphaChannel, class: CSS.control, messages: messages, numberingSystem: this.numberingSystem, onCalciteColorPickerHexInputChange: this.handleHexInputChange, scale: scale, value: selectedColorInHex }))), noChannels ? null : (h("calcite-tabs", { class: {
520
539
  [CSS.colorModeContainer]: true,
521
540
  [CSS.splitSection]: true
522
- }, scale: hexInputScale }, h("calcite-tab-nav", { slot: "title-group" }, this.renderChannelsTabTitle("rgb"), this.renderChannelsTabTitle("hsv")), this.renderChannelsTab("rgb"), this.renderChannelsTab("hsv"))))), hideSaved ? null : (h("div", { class: { [CSS.savedColorsSection]: true, [CSS.section]: true } }, h("div", { class: CSS.header }, h("label", null, messages.saved), h("div", { class: CSS.savedColorsButtons }, h("calcite-button", { appearance: "transparent", class: CSS.deleteColor, disabled: noColor, iconStart: "minus", kind: "neutral", label: messages.deleteColor, onClick: this.deleteColor, scale: hexInputScale, type: "button" }), h("calcite-button", { appearance: "transparent", class: CSS.saveColor, disabled: noColor, iconStart: "plus", kind: "neutral", label: messages.saveColor, onClick: this.saveColor, scale: hexInputScale, type: "button" }))), savedColors.length > 0 ? (h("div", { class: CSS.savedColors }, [
523
- ...savedColors.map((color) => (h("calcite-color-picker-swatch", { active: selectedColorInHex === color, class: CSS.savedColor, color: color, key: color, onClick: this.handleSavedColorSelect, onKeyDown: this.handleSavedColorKeyDown, scale: scale, tabIndex: 0 })))
541
+ }, scale: scale === "l" ? "m" : "s" }, h("calcite-tab-nav", { slot: "title-group" }, this.renderChannelsTabTitle("rgb"), this.renderChannelsTabTitle("hsv")), this.renderChannelsTab("rgb"), this.renderChannelsTab("hsv")))))), noSaved ? null : (h("div", { class: { [CSS.savedColorsSection]: true, [CSS.section]: true } }, h("div", { class: CSS.header }, h("label", null, messages.saved), h("div", { class: CSS.savedColorsButtons }, h("calcite-button", { appearance: "transparent", class: CSS.deleteColor, disabled: noColor, iconStart: "minus", kind: "neutral", label: messages.deleteColor, onClick: this.deleteColor, scale: scale, type: "button" }), h("calcite-button", { appearance: "transparent", class: CSS.saveColor, disabled: noColor, iconStart: "plus", kind: "neutral", label: messages.saveColor, onClick: this.saveColor, scale: scale, type: "button" }))), savedColors.length > 0 ? (h("div", { class: CSS.savedColors }, [
542
+ ...savedColors.map((color) => (h("calcite-color-picker-swatch", { class: CSS.savedColor, color: color, key: color, onClick: this.handleSavedColorSelect, onKeyDown: this.handleSavedColorKeyDown, scale: scale, tabIndex: 0 })))
524
543
  ])) : null))));
525
544
  }
526
545
  // --------------------------------------------------------------------------
@@ -536,23 +555,38 @@ export class ColorPicker {
536
555
  showIncompatibleColorWarning(value, format) {
537
556
  console.warn(`ignoring color value (${value}) as it is not compatible with the current format (${format})`);
538
557
  }
539
- setMode(format) {
540
- this.mode = format === "auto" ? this.mode : format;
558
+ setMode(format, warn = true) {
559
+ const mode = format === "auto" ? this.mode : format;
560
+ this.mode = this.ensureCompatibleMode(mode, warn);
561
+ }
562
+ ensureCompatibleMode(mode, warn) {
563
+ const { alphaChannel } = this;
564
+ const isAlphaCompatible = alphaCompatible(mode);
565
+ if (alphaChannel && !isAlphaCompatible) {
566
+ const alphaMode = toAlphaMode(mode);
567
+ if (warn) {
568
+ console.warn(`setting format to (${alphaMode}) as the provided one (${mode}) does not support alpha`);
569
+ }
570
+ return alphaMode;
571
+ }
572
+ if (!alphaChannel && isAlphaCompatible) {
573
+ const nonAlphaMode = toNonAlphaMode(mode);
574
+ if (warn) {
575
+ console.warn(`setting format to (${nonAlphaMode}) as the provided one (${mode}) does not support alpha`);
576
+ }
577
+ return nonAlphaMode;
578
+ }
579
+ return mode;
541
580
  }
542
581
  captureHueSliderColor(x) {
543
582
  const { dimensions: { slider: { width } } } = this;
544
583
  const hue = (360 / width) * x;
545
584
  this.internalColorSet(this.baseColorFieldColor.hue(hue), false);
546
585
  }
547
- getCanvasRegion(y) {
548
- const { dimensions: { colorField: { height: colorFieldHeight }, slider: { height: sliderHeight } } } = this;
549
- if (y <= colorFieldHeight) {
550
- return "color-field";
551
- }
552
- if (y <= colorFieldHeight + sliderHeight) {
553
- return "slider";
554
- }
555
- return "none";
586
+ captureOpacitySliderValue(x) {
587
+ const { dimensions: { slider: { width } } } = this;
588
+ const alpha = opacityToAlpha((OPACITY_LIMITS.max / width) * x);
589
+ this.internalColorSet(this.baseColorFieldColor.alpha(alpha), false);
556
590
  }
557
591
  internalColorSet(color, skipEqual = true, context = "user-interaction") {
558
592
  if (skipEqual && colorEqual(color, this.color)) {
@@ -569,16 +603,25 @@ export class ColorPicker {
569
603
  }
570
604
  const hexMode = "hex";
571
605
  if (format.includes(hexMode)) {
572
- return normalizeHex(color.round()[hexMode]());
606
+ const hasAlpha = format === CSSColorMode.HEXA;
607
+ return normalizeHex(hexify(color.round(), hasAlpha), hasAlpha);
573
608
  }
574
609
  if (format.includes("-css")) {
575
- return color[format.replace("-css", "").replace("a", "")]().round().string();
610
+ const value = color[format.replace("-css", "").replace("a", "")]().round().string();
611
+ // Color omits alpha values when alpha is 1
612
+ const needToInjectAlpha = (format.endsWith("a") || format.endsWith("a-css")) && color.alpha() === 1;
613
+ if (needToInjectAlpha) {
614
+ const model = value.slice(0, 3);
615
+ const values = value.slice(4, -1);
616
+ return `${model}a(${values}, ${color.alpha()})`;
617
+ }
618
+ return value;
576
619
  }
577
- const colorObject = color[format]().round().object();
620
+ const colorObject =
621
+ /* Color() does not support hsva, hsla nor rgba, so we use the non-alpha mode */
622
+ color[toNonAlphaMode(format)]().round().object();
578
623
  if (format.endsWith("a")) {
579
- // normalize alpha prop
580
- colorObject.a = colorObject.alpha;
581
- delete colorObject.alpha;
624
+ return normalizeAlpha(colorObject);
582
625
  }
583
626
  return colorObject;
584
627
  }
@@ -590,9 +633,14 @@ export class ColorPicker {
590
633
  this.dimensions = DIMENSIONS[scale];
591
634
  }
592
635
  drawColorField() {
593
- const context = this.fieldAndSliderRenderingContext;
636
+ const context = this.colorFieldRenderingContext;
594
637
  const { dimensions: { colorField: { height, width } } } = this;
595
- context.fillStyle = this.baseColorFieldColor.hsv().saturationv(100).value(100).string();
638
+ context.fillStyle = this.baseColorFieldColor
639
+ .hsv()
640
+ .saturationv(100)
641
+ .value(100)
642
+ .alpha(1)
643
+ .string();
596
644
  context.fillRect(0, 0, width, height);
597
645
  const whiteGradient = context.createLinearGradient(0, 0, width, 0);
598
646
  whiteGradient.addColorStop(0, "rgba(255,255,255,1)");
@@ -607,6 +655,9 @@ export class ColorPicker {
607
655
  this.drawActiveColorFieldColor();
608
656
  }
609
657
  setCanvasContextSize(canvas, { height, width }) {
658
+ if (!canvas) {
659
+ return;
660
+ }
610
661
  const devicePixelRatio = window.devicePixelRatio || 1;
611
662
  canvas.width = width * devicePixelRatio;
612
663
  canvas.height = height * devicePixelRatio;
@@ -615,21 +666,21 @@ export class ColorPicker {
615
666
  const context = canvas.getContext("2d");
616
667
  context.scale(devicePixelRatio, devicePixelRatio);
617
668
  }
618
- updateCanvasSize(canvas) {
619
- if (!canvas) {
620
- return;
669
+ updateCanvasSize(context = "all") {
670
+ const { dimensions } = this;
671
+ if (context === "all" || context === "color-field") {
672
+ this.setCanvasContextSize(this.colorFieldRenderingContext?.canvas, dimensions.colorField);
673
+ }
674
+ const adjustedSliderDimensions = {
675
+ width: dimensions.slider.width,
676
+ height: dimensions.slider.height + (dimensions.thumb.radius - dimensions.slider.height / 2) * 2
677
+ };
678
+ if (context === "all" || context === "hue-slider") {
679
+ this.setCanvasContextSize(this.hueSliderRenderingContext?.canvas, adjustedSliderDimensions);
680
+ }
681
+ if (context === "all" || context === "opacity-slider") {
682
+ this.setCanvasContextSize(this.opacitySliderRenderingContext?.canvas, adjustedSliderDimensions);
621
683
  }
622
- this.setCanvasContextSize(canvas, {
623
- width: this.dimensions.colorField.width,
624
- height: this.dimensions.colorField.height +
625
- this.dimensions.slider.height +
626
- this.getSliderCapSpacing() * 2
627
- });
628
- this.drawColorFieldAndSlider();
629
- }
630
- containsPoint(testPointX, testPointY, boundsX, boundsY, boundsRadius) {
631
- return (Math.pow(testPointX - boundsX, 2) + Math.pow(testPointY - boundsY, 2) <=
632
- Math.pow(boundsRadius, 2));
633
684
  }
634
685
  drawActiveColorFieldColor() {
635
686
  const { color } = this;
@@ -644,22 +695,23 @@ export class ColorPicker {
644
695
  this.colorFieldScopeLeft = x;
645
696
  this.colorFieldScopeTop = y;
646
697
  });
647
- this.drawThumb(this.fieldAndSliderRenderingContext, radius, x, y, hsvColor, this.hueThumbState);
698
+ this.drawThumb(this.colorFieldRenderingContext, radius, x, y, hsvColor);
648
699
  }
649
- drawThumb(context, radius, x, y, color, state) {
700
+ drawThumb(context, radius, x, y, color) {
650
701
  const startAngle = 0;
651
702
  const endAngle = 2 * Math.PI;
703
+ const outlineWidth = 1;
704
+ radius = radius - outlineWidth;
652
705
  context.beginPath();
653
706
  context.arc(x, y, radius, startAngle, endAngle);
654
- context.shadowBlur = state === "hover" ? 32 : 16;
655
- context.shadowColor = `rgba(0, 0, 0, ${state === "drag" ? 0.32 : 0.16})`;
656
707
  context.fillStyle = "#fff";
657
708
  context.fill();
709
+ context.strokeStyle = "rgba(0,0,0,0.3)";
710
+ context.lineWidth = outlineWidth;
711
+ context.stroke();
658
712
  context.beginPath();
659
713
  context.arc(x, y, radius - 3, startAngle, endAngle);
660
- context.shadowBlur = 0;
661
- context.shadowColor = "transparent";
662
- context.fillStyle = color.rgb().string();
714
+ context.fillStyle = color.rgb().alpha(1).string();
663
715
  context.fill();
664
716
  }
665
717
  drawActiveHueSliderColor() {
@@ -668,18 +720,19 @@ export class ColorPicker {
668
720
  return;
669
721
  }
670
722
  const hsvColor = color.hsv().saturationv(100).value(100);
671
- const { dimensions: { colorField: { height: colorFieldHeight }, slider: { height, width }, thumb: { radius } } } = this;
723
+ const { dimensions: { slider: { height, width }, thumb: { radius } } } = this;
672
724
  const x = hsvColor.hue() / (360 / width);
673
- const y = height / 2 + colorFieldHeight;
725
+ const y = radius - height / 2 + height / 2;
674
726
  requestAnimationFrame(() => {
675
727
  this.hueScopeLeft = x;
676
- this.hueScopeTop = y;
677
728
  });
678
- this.drawThumb(this.fieldAndSliderRenderingContext, radius, x, y, hsvColor, this.sliderThumbState);
729
+ this.drawThumb(this.hueSliderRenderingContext, radius, x, y, hsvColor);
679
730
  }
680
731
  drawHueSlider() {
681
- const context = this.fieldAndSliderRenderingContext;
682
- const { dimensions: { colorField: { height: colorFieldHeight }, slider: { height, width } } } = this;
732
+ const context = this.hueSliderRenderingContext;
733
+ const { dimensions: { slider: { height, width }, thumb: { radius: thumbRadius } } } = this;
734
+ const x = 0;
735
+ const y = thumbRadius - height / 2;
683
736
  const gradient = context.createLinearGradient(0, 0, width, 0);
684
737
  const hueSliderColorStopKeywords = ["red", "yellow", "lime", "cyan", "blue", "magenta", "red"];
685
738
  const offset = 1 / (hueSliderColorStopKeywords.length - 1);
@@ -688,22 +741,101 @@ export class ColorPicker {
688
741
  gradient.addColorStop(currentOffset, Color(keyword).string());
689
742
  currentOffset += offset;
690
743
  });
744
+ context.clearRect(0, 0, width, height + this.getSliderCapSpacing() * 2);
745
+ this.drawSliderPath(context, height, width, x, y);
691
746
  context.fillStyle = gradient;
692
- context.clearRect(0, colorFieldHeight, width, height + this.getSliderCapSpacing() * 2);
693
- context.fillRect(0, colorFieldHeight, width, height);
747
+ context.fill();
748
+ context.strokeStyle = "rgba(0,0,0,0.3)";
749
+ context.lineWidth = 1;
750
+ context.stroke();
694
751
  this.drawActiveHueSliderColor();
695
752
  }
753
+ drawOpacitySlider() {
754
+ const context = this.opacitySliderRenderingContext;
755
+ const { baseColorFieldColor: previousColor, dimensions: { slider: { height, width }, thumb: { radius: thumbRadius } } } = this;
756
+ const x = 0;
757
+ const y = thumbRadius - height / 2;
758
+ context.clearRect(0, 0, width, height + this.getSliderCapSpacing() * 2);
759
+ const gradient = context.createLinearGradient(0, y, width, 0);
760
+ const startColor = previousColor.rgb().alpha(0);
761
+ const midColor = previousColor.rgb().alpha(0.5);
762
+ const endColor = previousColor.rgb().alpha(1);
763
+ gradient.addColorStop(0, startColor.string());
764
+ gradient.addColorStop(0.5, midColor.string());
765
+ gradient.addColorStop(1, endColor.string());
766
+ this.drawSliderPath(context, height, width, x, y);
767
+ const pattern = context.createPattern(this.getCheckeredBackgroundPattern(), "repeat");
768
+ context.fillStyle = pattern;
769
+ context.fill();
770
+ context.fillStyle = gradient;
771
+ context.fill();
772
+ context.strokeStyle = "rgba(0,0,0,0.3)";
773
+ context.lineWidth = 1;
774
+ context.stroke();
775
+ this.drawActiveOpacitySliderColor();
776
+ }
777
+ drawSliderPath(context, height, width, x, y) {
778
+ const radius = height / 2 + 1;
779
+ context.beginPath();
780
+ context.moveTo(x + radius, y);
781
+ context.lineTo(x + width - radius, y);
782
+ context.quadraticCurveTo(x + width, y, x + width, y + radius);
783
+ context.lineTo(x + width, y + height - radius);
784
+ context.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);
785
+ context.lineTo(x + radius, y + height);
786
+ context.quadraticCurveTo(x, y + height, x, y + height - radius);
787
+ context.lineTo(x, y + radius);
788
+ context.quadraticCurveTo(x, y, x + radius, y);
789
+ context.closePath();
790
+ }
791
+ getCheckeredBackgroundPattern() {
792
+ if (this.checkerPattern) {
793
+ return this.checkerPattern;
794
+ }
795
+ const pattern = document.createElement("canvas");
796
+ pattern.width = 10;
797
+ pattern.height = 10;
798
+ const patternContext = pattern.getContext("2d");
799
+ patternContext.fillStyle = "#ccc";
800
+ patternContext.fillRect(0, 0, 10, 10);
801
+ patternContext.fillStyle = "#fff";
802
+ patternContext.fillRect(0, 0, 5, 5);
803
+ patternContext.fillRect(5, 5, 5, 5);
804
+ this.checkerPattern = pattern;
805
+ return pattern;
806
+ }
807
+ drawActiveOpacitySliderColor() {
808
+ const { color } = this;
809
+ if (!color) {
810
+ return;
811
+ }
812
+ const hsvColor = color;
813
+ const { dimensions: { slider: { width }, thumb: { radius } } } = this;
814
+ const x = alphaToOpacity(hsvColor.alpha()) / (OPACITY_LIMITS.max / width);
815
+ const y = radius;
816
+ requestAnimationFrame(() => {
817
+ this.opacityScopeLeft = x;
818
+ });
819
+ this.drawThumb(this.opacitySliderRenderingContext, radius, x, y, hsvColor);
820
+ }
696
821
  updateColorFromChannels(channels) {
697
822
  this.internalColorSet(Color(channels, this.channelMode));
698
823
  }
699
824
  updateChannelsFromColor(color) {
700
- this.channels = color ? this.toChannels(color) : [null, null, null];
825
+ this.channels = color ? this.toChannels(color) : [null, null, null, null];
701
826
  }
702
827
  toChannels(color) {
703
828
  const { channelMode } = this;
704
- return color[channelMode]()
829
+ const channels = color[channelMode]()
705
830
  .array()
706
- .map((value) => Math.floor(value));
831
+ .map((value, index) => {
832
+ const isAlpha = index === 3;
833
+ return isAlpha ? value : Math.floor(value);
834
+ });
835
+ if (channels.length === 3) {
836
+ channels.push(1); // Color omits alpha when 1
837
+ }
838
+ return channels;
707
839
  }
708
840
  static get is() { return "calcite-color-picker"; }
709
841
  static get encapsulation() { return "shadow"; }
@@ -733,12 +865,48 @@ export class ColorPicker {
733
865
  "optional": false,
734
866
  "docs": {
735
867
  "tags": [],
736
- "text": "When `false`, an empty color (`null`) will be allowed as a `value`. Otherwise, a color value is enforced on the component.\n\nWhen `true`, a color value is enforced, and clearing the input or blurring will restore the last valid `value`. When `false`, an empty color (`null`) will be allowed as a `value`."
868
+ "text": "When `true`, an empty color (`null`) will be allowed as a `value`. When `false`, a color value is enforced, and clearing the input or blurring will restore the last valid `value`."
737
869
  },
738
870
  "attribute": "allow-empty",
739
871
  "reflect": true,
740
872
  "defaultValue": "false"
741
873
  },
874
+ "alphaChannel": {
875
+ "type": "boolean",
876
+ "mutable": false,
877
+ "complexType": {
878
+ "original": "boolean",
879
+ "resolved": "boolean",
880
+ "references": {}
881
+ },
882
+ "required": false,
883
+ "optional": false,
884
+ "docs": {
885
+ "tags": [],
886
+ "text": "When true, the component will allow updates to the color's alpha value."
887
+ },
888
+ "attribute": "alpha-channel",
889
+ "reflect": false,
890
+ "defaultValue": "false"
891
+ },
892
+ "channelsDisabled": {
893
+ "type": "boolean",
894
+ "mutable": false,
895
+ "complexType": {
896
+ "original": "boolean",
897
+ "resolved": "boolean",
898
+ "references": {}
899
+ },
900
+ "required": false,
901
+ "optional": false,
902
+ "docs": {
903
+ "tags": [],
904
+ "text": "When true, hides the RGB/HSV channel inputs"
905
+ },
906
+ "attribute": "channels-disabled",
907
+ "reflect": false,
908
+ "defaultValue": "false"
909
+ },
742
910
  "color": {
743
911
  "type": "unknown",
744
912
  "mutable": true,
@@ -805,9 +973,9 @@ export class ColorPicker {
805
973
  },
806
974
  "attribute": "format",
807
975
  "reflect": true,
808
- "defaultValue": "defaultFormat"
976
+ "defaultValue": "\"auto\""
809
977
  },
810
- "hideHex": {
978
+ "hideChannels": {
811
979
  "type": "boolean",
812
980
  "mutable": false,
813
981
  "complexType": {
@@ -818,14 +986,17 @@ export class ColorPicker {
818
986
  "required": false,
819
987
  "optional": false,
820
988
  "docs": {
821
- "tags": [],
822
- "text": "When `true`, hides the Hex input."
989
+ "tags": [{
990
+ "name": "deprecated",
991
+ "text": "use `channelsDisabled` instead"
992
+ }],
993
+ "text": "When `true`, hides the RGB/HSV channel inputs."
823
994
  },
824
- "attribute": "hide-hex",
995
+ "attribute": "hide-channels",
825
996
  "reflect": true,
826
997
  "defaultValue": "false"
827
998
  },
828
- "hideChannels": {
999
+ "hexDisabled": {
829
1000
  "type": "boolean",
830
1001
  "mutable": false,
831
1002
  "complexType": {
@@ -837,9 +1008,30 @@ export class ColorPicker {
837
1008
  "optional": false,
838
1009
  "docs": {
839
1010
  "tags": [],
840
- "text": "When `true`, hides the RGB/HSV channel inputs."
1011
+ "text": "When true, hides the hex input"
841
1012
  },
842
- "attribute": "hide-channels",
1013
+ "attribute": "hex-disabled",
1014
+ "reflect": false,
1015
+ "defaultValue": "false"
1016
+ },
1017
+ "hideHex": {
1018
+ "type": "boolean",
1019
+ "mutable": false,
1020
+ "complexType": {
1021
+ "original": "boolean",
1022
+ "resolved": "boolean",
1023
+ "references": {}
1024
+ },
1025
+ "required": false,
1026
+ "optional": false,
1027
+ "docs": {
1028
+ "tags": [{
1029
+ "name": "deprecated",
1030
+ "text": "use `hexDisabled` instead"
1031
+ }],
1032
+ "text": "When `true`, hides the hex input."
1033
+ },
1034
+ "attribute": "hide-hex",
843
1035
  "reflect": true,
844
1036
  "defaultValue": "false"
845
1037
  },
@@ -854,13 +1046,34 @@ export class ColorPicker {
854
1046
  "required": false,
855
1047
  "optional": false,
856
1048
  "docs": {
857
- "tags": [],
1049
+ "tags": [{
1050
+ "name": "deprecated",
1051
+ "text": "use `savedDisabled` instead"
1052
+ }],
858
1053
  "text": "When `true`, hides the saved colors section."
859
1054
  },
860
1055
  "attribute": "hide-saved",
861
1056
  "reflect": true,
862
1057
  "defaultValue": "false"
863
1058
  },
1059
+ "savedDisabled": {
1060
+ "type": "boolean",
1061
+ "mutable": false,
1062
+ "complexType": {
1063
+ "original": "boolean",
1064
+ "resolved": "boolean",
1065
+ "references": {}
1066
+ },
1067
+ "required": false,
1068
+ "optional": false,
1069
+ "docs": {
1070
+ "tags": [],
1071
+ "text": "When true, hides the saved colors section"
1072
+ },
1073
+ "attribute": "saved-disabled",
1074
+ "reflect": true,
1075
+ "defaultValue": "false"
1076
+ },
864
1077
  "scale": {
865
1078
  "type": "string",
866
1079
  "mutable": false,
@@ -976,7 +1189,7 @@ export class ColorPicker {
976
1189
  },
977
1190
  "attribute": "value",
978
1191
  "reflect": false,
979
- "defaultValue": "defaultValue"
1192
+ "defaultValue": "normalizeHex(\n hexify(DEFAULT_COLOR, this.alphaChannel)\n )"
980
1193
  },
981
1194
  "messages": {
982
1195
  "type": "unknown",
@@ -1006,7 +1219,6 @@ export class ColorPicker {
1006
1219
  static get states() {
1007
1220
  return {
1008
1221
  "defaultMessages": {},
1009
- "colorFieldAndSliderInteractive": {},
1010
1222
  "channelMode": {},
1011
1223
  "channels": {},
1012
1224
  "dimensions": {},
@@ -1014,9 +1226,9 @@ export class ColorPicker {
1014
1226
  "savedColors": {},
1015
1227
  "colorFieldScopeTop": {},
1016
1228
  "colorFieldScopeLeft": {},
1017
- "scopeOrientation": {},
1018
1229
  "hueScopeLeft": {},
1019
- "hueScopeTop": {}
1230
+ "opacityScopeLeft": {},
1231
+ "scopeOrientation": {}
1020
1232
  };
1021
1233
  }
1022
1234
  static get events() {
@@ -1075,6 +1287,9 @@ export class ColorPicker {
1075
1287
  static get elementRef() { return "el"; }
1076
1288
  static get watchers() {
1077
1289
  return [{
1290
+ "propName": "alphaChannel",
1291
+ "methodName": "handleAlphaChannelChange"
1292
+ }, {
1078
1293
  "propName": "color",
1079
1294
  "methodName": "handleColorChange"
1080
1295
  }, {