@esri/calcite-components 1.4.0-next.1 → 1.4.0-next.11

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 (873) 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.css +1 -1
  11. package/dist/calcite/calcite.esm.js +2 -2
  12. package/dist/calcite/index.esm.js +2 -2
  13. package/dist/calcite/p-02a5a46d.entry.js +6 -0
  14. package/dist/calcite/p-0472ee23.entry.js +6 -0
  15. package/dist/calcite/p-06a32d43.entry.js +6 -0
  16. package/dist/calcite/p-07ab96dc.entry.js +6 -0
  17. package/dist/calcite/p-0af8f02b.entry.js +6 -0
  18. package/dist/calcite/{p-fdc776d9.js → p-0d985cc2.js} +3 -3
  19. package/dist/calcite/{p-3f20b4ea.js → p-0e6174e1.js} +1 -1
  20. package/dist/calcite/p-0f380c43.entry.js +6 -0
  21. package/dist/calcite/p-15cb4cb0.entry.js +6 -0
  22. package/dist/calcite/{p-7b470dfe.js → p-165ec40b.js} +1 -1
  23. package/dist/calcite/p-18520138.entry.js +6 -0
  24. package/dist/calcite/p-1b20682f.entry.js +6 -0
  25. package/dist/calcite/p-1c831629.js +6 -0
  26. package/dist/calcite/{p-40e9ea4d.js → p-1f66d449.js} +1 -1
  27. package/dist/calcite/p-2338b106.entry.js +6 -0
  28. package/dist/calcite/p-2409fb7f.entry.js +6 -0
  29. package/dist/calcite/{p-baca04ad.entry.js → p-2a3cf375.entry.js} +2 -2
  30. package/dist/calcite/p-2c4bc19b.entry.js +6 -0
  31. package/dist/calcite/{p-3fd6d05a.js → p-2da7b70b.js} +1 -1
  32. package/dist/calcite/{p-931355e8.js → p-2dc2a820.js} +1 -1
  33. package/dist/calcite/{p-dab4ee30.js → p-2dcf0c10.js} +1 -1
  34. package/dist/calcite/p-2eb00e69.js +6 -0
  35. package/dist/calcite/p-30a6bd5e.js +6 -0
  36. package/dist/calcite/{p-b74b3edc.js → p-31ec389a.js} +1 -1
  37. package/dist/calcite/p-365f3e91.entry.js +6 -0
  38. package/dist/calcite/p-38714981.entry.js +6 -0
  39. package/dist/calcite/p-38aa122c.entry.js +6 -0
  40. package/dist/calcite/p-38cd1b20.entry.js +6 -0
  41. package/dist/calcite/p-3b392b46.entry.js +6 -0
  42. package/dist/calcite/{p-160e376e.js → p-42552845.js} +1 -1
  43. package/dist/calcite/p-43699b83.entry.js +6 -0
  44. package/dist/calcite/p-4726e3f1.entry.js +6 -0
  45. package/dist/calcite/p-4d1058f4.entry.js +6 -0
  46. package/dist/calcite/p-4d496ce6.entry.js +6 -0
  47. package/dist/calcite/p-4e86e62c.entry.js +6 -0
  48. package/dist/calcite/p-4ea387a3.entry.js +6 -0
  49. package/dist/calcite/{p-00b8a8e9.js → p-529f0e4a.js} +2 -2
  50. package/dist/calcite/p-5441476c.entry.js +6 -0
  51. package/dist/calcite/p-5e275908.entry.js +6 -0
  52. package/dist/calcite/p-61b39222.entry.js +6 -0
  53. package/dist/calcite/{p-c75b8170.js → p-6315c73f.js} +2 -2
  54. package/dist/calcite/p-6736c3c0.entry.js +6 -0
  55. package/dist/calcite/{p-3048b02a.js → p-6911bf06.js} +1 -1
  56. package/dist/calcite/p-6d9c082a.entry.js +6 -0
  57. package/dist/calcite/{p-8e588bd5.js → p-6dc8f26e.js} +2 -2
  58. package/dist/calcite/p-7543c7af.entry.js +6 -0
  59. package/dist/calcite/{p-202ec7cb.js → p-75a62ff3.js} +1 -1
  60. package/dist/calcite/p-785a071f.entry.js +6 -0
  61. package/dist/calcite/{p-192c9303.js → p-7b4366b3.js} +2 -2
  62. package/dist/calcite/p-7d35466a.entry.js +6 -0
  63. package/dist/calcite/p-80701cd1.entry.js +6 -0
  64. package/dist/calcite/{p-dbfc5b2e.js → p-8420a6cf.js} +2 -2
  65. package/dist/calcite/{p-9f492399.js → p-84c1e54b.js} +2 -2
  66. package/dist/calcite/p-85cca4f2.js +6 -0
  67. package/dist/calcite/p-88dc218e.entry.js +6 -0
  68. package/dist/calcite/p-8ac3da4a.entry.js +6 -0
  69. package/dist/calcite/{p-9f47f20c.js → p-8ae8e08d.js} +1 -1
  70. package/dist/calcite/{p-929f251f.js → p-8d6e3780.js} +1 -1
  71. package/dist/calcite/p-8faa3bdc.entry.js +6 -0
  72. package/dist/calcite/{p-cb0f1e83.js → p-95093c16.js} +1 -1
  73. package/dist/calcite/p-99d4749d.entry.js +6 -0
  74. package/dist/calcite/p-9ad25ab1.entry.js +6 -0
  75. package/dist/calcite/p-a49b3c20.entry.js +6 -0
  76. package/dist/calcite/{p-cbbc6c3c.js → p-a8f92d33.js} +1 -1
  77. package/dist/calcite/p-aa2f5346.entry.js +6 -0
  78. package/dist/calcite/p-ac4a7ccf.entry.js +6 -0
  79. package/dist/calcite/{p-0d8ab202.js → p-afe946bd.js} +2 -2
  80. package/dist/calcite/p-b1058ef9.entry.js +6 -0
  81. package/dist/calcite/{p-cccdae42.js → p-b15456d2.js} +2 -2
  82. package/dist/calcite/p-b6b1831c.entry.js +6 -0
  83. package/dist/calcite/p-bb026473.entry.js +6 -0
  84. package/dist/calcite/p-c0538fc7.entry.js +6 -0
  85. package/dist/calcite/p-c448c7bd.entry.js +6 -0
  86. package/dist/calcite/p-c98aeafa.entry.js +6 -0
  87. package/dist/calcite/p-cafdc943.entry.js +6 -0
  88. package/dist/calcite/p-cfb7ba9f.js +6 -0
  89. package/dist/calcite/p-d0a4d643.entry.js +6 -0
  90. package/dist/calcite/p-d55fc7c1.entry.js +6 -0
  91. package/dist/calcite/p-d5a8044b.entry.js +6 -0
  92. package/dist/calcite/p-d7b38007.entry.js +6 -0
  93. package/dist/calcite/p-da7bb2c5.entry.js +6 -0
  94. package/dist/calcite/p-dc69e13c.entry.js +6 -0
  95. package/dist/calcite/p-df4228a1.entry.js +6 -0
  96. package/dist/calcite/p-df73eefa.entry.js +6 -0
  97. package/dist/calcite/p-e0fa4d49.entry.js +6 -0
  98. package/dist/calcite/p-e2206b46.js +6 -0
  99. package/dist/calcite/p-e22f0d26.entry.js +6 -0
  100. package/dist/calcite/p-e718d92b.entry.js +6 -0
  101. package/dist/calcite/{p-80f5c7dc.entry.js → p-e7ace0b9.entry.js} +2 -2
  102. package/dist/calcite/{p-90170ec7.js → p-ea084a60.js} +2 -2
  103. package/dist/calcite/p-ebb31c6d.entry.js +6 -0
  104. package/dist/calcite/{p-a8216142.js → p-f3a960c7.js} +1 -1
  105. package/dist/calcite/{p-52234353.js → p-f747567a.js} +2 -2
  106. package/dist/calcite/{p-a7a5335e.js → p-f9a351e1.js} +2 -2
  107. package/dist/calcite/{p-4dfe3be2.js → p-fcbd924b.js} +1 -1
  108. package/dist/calcite/p-ffb1f95e.entry.js +6 -0
  109. package/dist/cjs/{ExpandToggle-46462b73.js → ExpandToggle-47593692.js} +5 -5
  110. package/dist/cjs/{FloatingArrow-386bcf99.js → FloatingArrow-f41bbf5a.js} +2 -2
  111. package/dist/cjs/{Heading-cdc35796.js → Heading-2bd3592d.js} +2 -2
  112. package/dist/cjs/{app-globals-d6130b8b.js → app-globals-0b2c6450.js} +2 -2
  113. package/dist/cjs/{array-79e60de8.js → array-09964494.js} +1 -1
  114. package/dist/cjs/calcite-accordion_2.cjs.entry.js +9 -9
  115. package/dist/cjs/calcite-action-bar.cjs.entry.js +16 -16
  116. package/dist/cjs/calcite-action-group.cjs.entry.js +14 -14
  117. package/dist/cjs/calcite-action-menu.cjs.entry.js +10 -10
  118. package/dist/cjs/calcite-action-pad.cjs.entry.js +15 -15
  119. package/dist/cjs/calcite-action.cjs.entry.js +12 -12
  120. package/dist/cjs/calcite-alert.cjs.entry.js +13 -13
  121. package/dist/cjs/calcite-avatar.cjs.entry.js +10 -9
  122. package/dist/cjs/calcite-block_2.cjs.entry.js +14 -14
  123. package/dist/cjs/calcite-button.cjs.entry.js +14 -14
  124. package/dist/cjs/calcite-card.cjs.entry.js +11 -11
  125. package/dist/cjs/calcite-checkbox.cjs.entry.js +11 -11
  126. package/dist/cjs/calcite-chip-group.cjs.entry.js +9 -9
  127. package/dist/cjs/calcite-chip.cjs.entry.js +13 -13
  128. package/dist/cjs/calcite-color-picker_3.cjs.entry.js +585 -339
  129. package/dist/cjs/calcite-combobox_3.cjs.entry.js +21 -21
  130. package/dist/cjs/calcite-date-picker_4.cjs.entry.js +17 -17
  131. package/dist/cjs/calcite-dropdown_3.cjs.entry.js +15 -15
  132. package/dist/cjs/calcite-fab.cjs.entry.js +8 -8
  133. package/dist/cjs/calcite-filter.cjs.entry.js +14 -14
  134. package/dist/cjs/calcite-flow-item.cjs.entry.js +13 -13
  135. package/dist/cjs/calcite-flow.cjs.entry.js +4 -4
  136. package/dist/cjs/calcite-graph_2.cjs.entry.js +15 -15
  137. package/dist/cjs/calcite-handle.cjs.entry.js +11 -11
  138. package/dist/cjs/calcite-icon.cjs.entry.js +7 -7
  139. package/dist/cjs/calcite-inline-editable.cjs.entry.js +13 -13
  140. package/dist/cjs/calcite-input-date-picker.cjs.entry.js +19 -19
  141. package/dist/cjs/calcite-input-message.cjs.entry.js +6 -6
  142. package/dist/cjs/calcite-input-number.cjs.entry.js +14 -14
  143. package/dist/cjs/calcite-input-text.cjs.entry.js +14 -14
  144. package/dist/cjs/calcite-input-time-picker_2.cjs.entry.js +16 -16
  145. package/dist/cjs/calcite-input.cjs.entry.js +14 -14
  146. package/dist/cjs/calcite-label.cjs.entry.js +7 -7
  147. package/dist/cjs/calcite-link.cjs.entry.js +8 -8
  148. package/dist/cjs/calcite-list_3.cjs.entry.js +53 -43
  149. package/dist/cjs/calcite-loader.cjs.entry.js +4 -4
  150. package/dist/cjs/calcite-modal.cjs.entry.js +14 -14
  151. package/dist/cjs/calcite-notice.cjs.entry.js +13 -13
  152. package/dist/cjs/calcite-option_3.cjs.entry.js +13 -13
  153. package/dist/cjs/calcite-pagination.cjs.entry.js +11 -11
  154. package/dist/cjs/calcite-panel.cjs.entry.js +15 -15
  155. package/dist/cjs/calcite-pick-list_3.cjs.entry.js +19 -19
  156. package/dist/cjs/calcite-popover.cjs.entry.js +17 -17
  157. package/dist/cjs/calcite-progress.cjs.entry.js +3 -3
  158. package/dist/cjs/calcite-radio-button-group.cjs.entry.js +4 -4
  159. package/dist/cjs/calcite-radio-button.cjs.entry.js +11 -11
  160. package/dist/cjs/calcite-rating.cjs.entry.js +14 -14
  161. package/dist/cjs/calcite-scrim.cjs.entry.js +10 -10
  162. package/dist/cjs/calcite-segmented-control_2.cjs.entry.js +11 -11
  163. package/dist/cjs/calcite-shell_3.cjs.entry.js +14 -17
  164. package/dist/cjs/calcite-sortable-list.cjs.entry.js +6 -6
  165. package/dist/cjs/calcite-split-button.cjs.entry.js +5 -5
  166. package/dist/cjs/calcite-stepper_2.cjs.entry.js +12 -12
  167. package/dist/cjs/calcite-switch.cjs.entry.js +11 -11
  168. package/dist/cjs/calcite-tab_4.cjs.entry.js +11 -11
  169. package/dist/cjs/calcite-text-area.cjs.entry.js +16 -16
  170. package/dist/cjs/calcite-tile-select_2.cjs.entry.js +7 -7
  171. package/dist/cjs/calcite-tile.cjs.entry.js +9 -9
  172. package/dist/cjs/calcite-tip_3.cjs.entry.js +14 -14
  173. package/dist/cjs/calcite-tooltip.cjs.entry.js +47 -33
  174. package/dist/cjs/calcite-tree_2.cjs.entry.js +49 -29
  175. package/dist/cjs/calcite-value-list_2.cjs.entry.js +18 -18
  176. package/dist/cjs/calcite.cjs.js +5 -5
  177. package/dist/cjs/{composed-offset-position.esm-34843aea.js → composed-offset-position.esm-da5b3cd1.js} +1 -1
  178. package/dist/cjs/{conditionalSlot-a61d43fc.js → conditionalSlot-00a45a49.js} +3 -3
  179. package/dist/cjs/{debounce-bf9bd36d.js → debounce-8b93ddf9.js} +1 -1
  180. package/dist/cjs/{dom-dd7e7078.js → dom-f9be6b76.js} +116 -17
  181. package/dist/cjs/{filter-95f477d2.js → filter-78a4abdc.js} +2 -2
  182. package/dist/cjs/{floating-ui-fab04fea.js → floating-ui-767d9fec.js} +71 -65
  183. package/dist/cjs/{focusTrapComponent-6e1488e8.js → focusTrapComponent-11458ff7.js} +2 -2
  184. package/dist/cjs/{form-a683c373.js → form-da98f535.js} +3 -3
  185. package/dist/cjs/{guid-6841fe52.js → guid-d38d5390.js} +1 -1
  186. package/dist/cjs/{index-2a60e5ec.js → index-878e6a10.js} +1 -1
  187. package/dist/cjs/index.cjs.js +2 -2
  188. package/dist/cjs/{interactive-6cff8d4e.js → interactive-5c9db1e0.js} +1 -1
  189. package/dist/cjs/{key-629ff080.js → key-19d72847.js} +1 -1
  190. package/dist/cjs/{label-7712e5a1.js → label-41cb371b.js} +2 -2
  191. package/dist/cjs/{loadable-85e1f45b.js → loadable-30ec84d4.js} +1 -1
  192. package/dist/cjs/loader.cjs.js +5 -5
  193. package/dist/cjs/{locale-44e61096.js → locale-2feae2e1.js} +4 -4
  194. package/dist/cjs/{math-faf5a949.js → math-06431d34.js} +1 -1
  195. package/dist/cjs/{observers-d3bfb778.js → observers-1f039e59.js} +1 -1
  196. package/dist/cjs/{openCloseComponent-65c2ca00.js → openCloseComponent-97cba1d8.js} +2 -2
  197. package/dist/cjs/{resources-ad5570c2.js → resources-1e20f92b.js} +1 -1
  198. package/dist/cjs/{resources-6ae8b620.js → resources-37d537a4.js} +1 -1
  199. package/dist/cjs/{resources-2e9fab44.js → resources-71924711.js} +1 -1
  200. package/dist/cjs/{resources-54920aaa.js → resources-d828a7a2.js} +5 -5
  201. package/dist/cjs/{resources-4861da6e.js → resources-dcd3ec6f.js} +1 -1
  202. package/dist/cjs/{resources-34d3d589.js → resources-e81bfcee.js} +1 -1
  203. package/dist/cjs/{sortable.esm-7c113379.js → sortable.esm-bdf4502c.js} +1 -1
  204. package/dist/cjs/{t9n-6d0f2ca7.js → t9n-e4b5d7bc.js} +3 -3
  205. package/dist/cjs/{throttle-9dfcf548.js → throttle-c959a70a.js} +2 -2
  206. package/dist/cjs/utils-3cbb4489.js +213 -0
  207. package/dist/cjs/{utils-7e605f34.js → utils-d7655679.js} +3 -3
  208. package/dist/collection/components/accordion/accordion.css +28 -0
  209. package/dist/collection/components/accordion/accordion.js +1 -1
  210. package/dist/collection/components/accordion-item/accordion-item.css +28 -0
  211. package/dist/collection/components/accordion-item/accordion-item.js +1 -1
  212. package/dist/collection/components/accordion-item/resources.js +1 -1
  213. package/dist/collection/components/action/action.css +28 -0
  214. package/dist/collection/components/action/action.js +1 -1
  215. package/dist/collection/components/action/resources.js +1 -1
  216. package/dist/collection/components/action-bar/action-bar.css +37 -12
  217. package/dist/collection/components/action-bar/action-bar.js +1 -1
  218. package/dist/collection/components/action-bar/resources.js +1 -1
  219. package/dist/collection/components/action-bar/utils.js +1 -1
  220. package/dist/collection/components/action-group/action-group.css +28 -0
  221. package/dist/collection/components/action-group/action-group.js +1 -1
  222. package/dist/collection/components/action-group/resources.js +1 -1
  223. package/dist/collection/components/action-menu/action-menu.css +28 -0
  224. package/dist/collection/components/action-menu/action-menu.js +1 -1
  225. package/dist/collection/components/action-menu/resources.js +1 -1
  226. package/dist/collection/components/action-pad/action-pad.css +28 -0
  227. package/dist/collection/components/action-pad/action-pad.js +1 -1
  228. package/dist/collection/components/action-pad/resources.js +1 -1
  229. package/dist/collection/components/alert/alert.css +28 -0
  230. package/dist/collection/components/alert/alert.js +1 -1
  231. package/dist/collection/components/alert/resources.js +1 -1
  232. package/dist/collection/components/avatar/avatar.css +28 -0
  233. package/dist/collection/components/avatar/avatar.js +22 -4
  234. package/dist/collection/components/avatar/utils.js +1 -1
  235. package/dist/collection/components/block/block.css +56 -0
  236. package/dist/collection/components/block/block.js +1 -1
  237. package/dist/collection/components/block/resources.js +1 -1
  238. package/dist/collection/components/block-section/block-section.css +28 -0
  239. package/dist/collection/components/block-section/block-section.js +1 -1
  240. package/dist/collection/components/block-section/resources.js +1 -1
  241. package/dist/collection/components/button/button.css +28 -0
  242. package/dist/collection/components/button/button.js +1 -1
  243. package/dist/collection/components/button/resources.js +1 -1
  244. package/dist/collection/components/card/card.css +28 -0
  245. package/dist/collection/components/card/card.js +1 -1
  246. package/dist/collection/components/card/resources.js +1 -1
  247. package/dist/collection/components/checkbox/checkbox.css +28 -0
  248. package/dist/collection/components/checkbox/checkbox.js +1 -1
  249. package/dist/collection/components/chip/chip.css +28 -0
  250. package/dist/collection/components/chip/chip.js +1 -1
  251. package/dist/collection/components/chip/resources.js +1 -1
  252. package/dist/collection/components/chip-group/chip-group.css +28 -0
  253. package/dist/collection/components/chip-group/chip-group.js +1 -1
  254. package/dist/collection/components/color-picker/color-picker.css +87 -52
  255. package/dist/collection/components/color-picker/color-picker.js +449 -234
  256. package/dist/collection/components/color-picker/resources.js +37 -27
  257. package/dist/collection/components/color-picker/utils.js +116 -30
  258. package/dist/collection/components/color-picker-hex-input/color-picker-hex-input.css +47 -16
  259. package/dist/collection/components/color-picker-hex-input/color-picker-hex-input.js +225 -118
  260. package/dist/collection/components/color-picker-hex-input/resources.js +3 -3
  261. package/dist/collection/components/color-picker-swatch/color-picker-swatch.css +38 -6
  262. package/dist/collection/components/color-picker-swatch/color-picker-swatch.js +34 -7
  263. package/dist/collection/components/color-picker-swatch/resources.js +8 -2
  264. package/dist/collection/components/combobox/combobox.css +28 -0
  265. package/dist/collection/components/combobox/combobox.js +1 -1
  266. package/dist/collection/components/combobox/resources.js +1 -1
  267. package/dist/collection/components/combobox/utils.js +1 -1
  268. package/dist/collection/components/combobox-item/combobox-item.css +28 -0
  269. package/dist/collection/components/combobox-item/combobox-item.js +1 -1
  270. package/dist/collection/components/combobox-item/resources.js +1 -1
  271. package/dist/collection/components/combobox-item-group/combobox-item-group.css +28 -0
  272. package/dist/collection/components/combobox-item-group/combobox-item-group.js +1 -1
  273. package/dist/collection/components/combobox-item-group/resources.js +1 -1
  274. package/dist/collection/components/date-picker/date-picker.css +28 -0
  275. package/dist/collection/components/date-picker/date-picker.js +1 -1
  276. package/dist/collection/components/date-picker/resources.js +1 -1
  277. package/dist/collection/components/date-picker/utils.js +1 -1
  278. package/dist/collection/components/date-picker-day/date-picker-day.css +28 -0
  279. package/dist/collection/components/date-picker-day/date-picker-day.js +1 -1
  280. package/dist/collection/components/date-picker-month/date-picker-month.css +28 -0
  281. package/dist/collection/components/date-picker-month/date-picker-month.js +1 -1
  282. package/dist/collection/components/date-picker-month-header/date-picker-month-header.css +28 -0
  283. package/dist/collection/components/date-picker-month-header/date-picker-month-header.js +1 -1
  284. package/dist/collection/components/date-picker-month-header/resources.js +1 -1
  285. package/dist/collection/components/dropdown/dropdown.css +28 -0
  286. package/dist/collection/components/dropdown/dropdown.js +1 -1
  287. package/dist/collection/components/dropdown/resources.js +1 -1
  288. package/dist/collection/components/dropdown-group/dropdown-group.css +28 -0
  289. package/dist/collection/components/dropdown-group/dropdown-group.js +1 -1
  290. package/dist/collection/components/dropdown-group/resources.js +1 -1
  291. package/dist/collection/components/dropdown-item/dropdown-item.css +28 -0
  292. package/dist/collection/components/dropdown-item/dropdown-item.js +1 -1
  293. package/dist/collection/components/dropdown-item/resources.js +1 -1
  294. package/dist/collection/components/fab/fab.css +28 -0
  295. package/dist/collection/components/fab/fab.js +1 -1
  296. package/dist/collection/components/fab/resources.js +1 -1
  297. package/dist/collection/components/filter/filter.css +28 -0
  298. package/dist/collection/components/filter/filter.js +1 -1
  299. package/dist/collection/components/filter/resources.js +1 -1
  300. package/dist/collection/components/flow/flow.css +28 -0
  301. package/dist/collection/components/flow/flow.js +1 -1
  302. package/dist/collection/components/flow/resources.js +1 -1
  303. package/dist/collection/components/flow-item/flow-item.css +40 -0
  304. package/dist/collection/components/flow-item/flow-item.js +2 -2
  305. package/dist/collection/components/flow-item/resources.js +1 -1
  306. package/dist/collection/components/functional/ExpandToggle.js +1 -1
  307. package/dist/collection/components/functional/FloatingArrow.js +1 -1
  308. package/dist/collection/components/functional/Heading.js +1 -1
  309. package/dist/collection/components/graph/graph.css +28 -0
  310. package/dist/collection/components/graph/graph.js +1 -1
  311. package/dist/collection/components/graph/util.js +1 -1
  312. package/dist/collection/components/handle/handle.css +28 -0
  313. package/dist/collection/components/handle/handle.js +1 -1
  314. package/dist/collection/components/handle/resources.js +1 -1
  315. package/dist/collection/components/icon/assets/icon/orientedImageryLayer16.json +1 -0
  316. package/dist/collection/components/icon/assets/icon/orientedImageryLayer24.json +1 -0
  317. package/dist/collection/components/icon/assets/icon/orientedImageryLayer32.json +1 -0
  318. package/dist/collection/components/icon/assets/icon/parcelLayer16.json +1 -0
  319. package/dist/collection/components/icon/assets/icon/parcelLayer24.json +1 -0
  320. package/dist/collection/components/icon/assets/icon/parcelLayer32.json +1 -0
  321. package/dist/collection/components/icon/assets/icon/viewAssociations16.json +1 -0
  322. package/dist/collection/components/icon/assets/icon/viewAssociations24.json +1 -0
  323. package/dist/collection/components/icon/assets/icon/viewAssociations32.json +1 -0
  324. package/dist/collection/components/icon/icon.css +28 -0
  325. package/dist/collection/components/icon/icon.js +1 -1
  326. package/dist/collection/components/icon/resources.js +1 -1
  327. package/dist/collection/components/icon/utils.js +1 -1
  328. package/dist/collection/components/inline-editable/inline-editable.css +28 -0
  329. package/dist/collection/components/inline-editable/inline-editable.js +1 -1
  330. package/dist/collection/components/inline-editable/resources.js +1 -1
  331. package/dist/collection/components/input/input.css +28 -0
  332. package/dist/collection/components/input/input.js +1 -1
  333. package/dist/collection/components/input/resources.js +1 -1
  334. package/dist/collection/components/input-date-picker/input-date-picker.css +28 -0
  335. package/dist/collection/components/input-date-picker/input-date-picker.js +1 -1
  336. package/dist/collection/components/input-date-picker/resources.js +1 -1
  337. package/dist/collection/components/input-message/input-message.css +28 -0
  338. package/dist/collection/components/input-message/input-message.js +1 -1
  339. package/dist/collection/components/input-message/interfaces.js +1 -1
  340. package/dist/collection/components/input-number/input-number.css +28 -0
  341. package/dist/collection/components/input-number/input-number.js +1 -1
  342. package/dist/collection/components/input-number/resources.js +1 -1
  343. package/dist/collection/components/input-text/input-text.css +28 -0
  344. package/dist/collection/components/input-text/input-text.js +1 -1
  345. package/dist/collection/components/input-text/resources.js +1 -1
  346. package/dist/collection/components/input-time-picker/input-time-picker.css +28 -0
  347. package/dist/collection/components/input-time-picker/input-time-picker.js +1 -1
  348. package/dist/collection/components/input-time-picker/resources.js +1 -1
  349. package/dist/collection/components/label/label.css +28 -0
  350. package/dist/collection/components/label/label.js +1 -1
  351. package/dist/collection/components/label/resources.js +1 -1
  352. package/dist/collection/components/link/link.css +28 -0
  353. package/dist/collection/components/link/link.js +1 -1
  354. package/dist/collection/components/list/list.css +28 -0
  355. package/dist/collection/components/list/list.js +60 -30
  356. package/dist/collection/components/list/resources.js +2 -2
  357. package/dist/collection/components/list-item/list-item.css +28 -0
  358. package/dist/collection/components/list-item/list-item.js +1 -1
  359. package/dist/collection/components/list-item/resources.js +1 -1
  360. package/dist/collection/components/list-item/utils.js +1 -1
  361. package/dist/collection/components/list-item-group/list-item-group.css +28 -0
  362. package/dist/collection/components/list-item-group/list-item-group.js +1 -1
  363. package/dist/collection/components/list-item-group/resources.js +1 -1
  364. package/dist/collection/components/loader/loader.css +56 -0
  365. package/dist/collection/components/loader/loader.js +1 -1
  366. package/dist/collection/components/modal/modal.css +28 -0
  367. package/dist/collection/components/modal/modal.js +1 -1
  368. package/dist/collection/components/modal/resources.js +1 -1
  369. package/dist/collection/components/notice/notice.css +28 -0
  370. package/dist/collection/components/notice/notice.js +1 -1
  371. package/dist/collection/components/notice/resources.js +1 -1
  372. package/dist/collection/components/option/option.css +28 -0
  373. package/dist/collection/components/option/option.js +1 -1
  374. package/dist/collection/components/option-group/option-group.css +28 -0
  375. package/dist/collection/components/option-group/option-group.js +1 -1
  376. package/dist/collection/components/pagination/pagination.css +28 -0
  377. package/dist/collection/components/pagination/pagination.js +1 -1
  378. package/dist/collection/components/pagination/resources.js +1 -1
  379. package/dist/collection/components/panel/panel.css +37 -2
  380. package/dist/collection/components/panel/panel.js +2 -2
  381. package/dist/collection/components/panel/resources.js +1 -1
  382. package/dist/collection/components/pick-list/pick-list.css +28 -0
  383. package/dist/collection/components/pick-list/pick-list.js +1 -1
  384. package/dist/collection/components/pick-list/resources.js +1 -1
  385. package/dist/collection/components/pick-list/shared-list-logic.js +1 -1
  386. package/dist/collection/components/pick-list/shared-list-render.js +1 -1
  387. package/dist/collection/components/pick-list-group/pick-list-group.css +28 -0
  388. package/dist/collection/components/pick-list-group/pick-list-group.js +1 -1
  389. package/dist/collection/components/pick-list-group/resources.js +1 -1
  390. package/dist/collection/components/pick-list-item/pick-list-item.css +28 -0
  391. package/dist/collection/components/pick-list-item/pick-list-item.js +1 -1
  392. package/dist/collection/components/pick-list-item/resources.js +1 -1
  393. package/dist/collection/components/popover/PopoverManager.js +1 -1
  394. package/dist/collection/components/popover/popover.css +28 -0
  395. package/dist/collection/components/popover/popover.js +1 -1
  396. package/dist/collection/components/popover/resources.js +1 -1
  397. package/dist/collection/components/progress/progress.css +56 -0
  398. package/dist/collection/components/progress/progress.js +1 -1
  399. package/dist/collection/components/radio-button/radio-button.css +28 -0
  400. package/dist/collection/components/radio-button/radio-button.js +1 -1
  401. package/dist/collection/components/radio-button/resources.js +1 -1
  402. package/dist/collection/components/radio-button-group/radio-button-group.css +28 -0
  403. package/dist/collection/components/radio-button-group/radio-button-group.js +1 -1
  404. package/dist/collection/components/rating/function/star.js +1 -1
  405. package/dist/collection/components/rating/rating.css +28 -0
  406. package/dist/collection/components/rating/rating.js +1 -1
  407. package/dist/collection/components/resources.js +1 -1
  408. package/dist/collection/components/scrim/resources.js +1 -1
  409. package/dist/collection/components/scrim/scrim.css +28 -0
  410. package/dist/collection/components/scrim/scrim.js +1 -1
  411. package/dist/collection/components/segmented-control/segmented-control.css +28 -0
  412. package/dist/collection/components/segmented-control/segmented-control.js +1 -1
  413. package/dist/collection/components/segmented-control-item/resources.js +1 -1
  414. package/dist/collection/components/segmented-control-item/segmented-control-item.css +28 -0
  415. package/dist/collection/components/segmented-control-item/segmented-control-item.js +1 -1
  416. package/dist/collection/components/select/resources.js +1 -1
  417. package/dist/collection/components/select/select.css +28 -0
  418. package/dist/collection/components/select/select.js +1 -1
  419. package/dist/collection/components/shell/resources.js +1 -1
  420. package/dist/collection/components/shell/shell.css +28 -0
  421. package/dist/collection/components/shell/shell.js +1 -1
  422. package/dist/collection/components/shell-center-row/resources.js +1 -1
  423. package/dist/collection/components/shell-center-row/shell-center-row.css +28 -0
  424. package/dist/collection/components/shell-center-row/shell-center-row.js +1 -4
  425. package/dist/collection/components/shell-panel/resources.js +1 -1
  426. package/dist/collection/components/shell-panel/shell-panel.css +28 -0
  427. package/dist/collection/components/shell-panel/shell-panel.js +1 -1
  428. package/dist/collection/components/slider/resources.js +1 -1
  429. package/dist/collection/components/slider/slider.css +28 -0
  430. package/dist/collection/components/slider/slider.js +1 -1
  431. package/dist/collection/components/sortable-list/resources.js +1 -1
  432. package/dist/collection/components/sortable-list/sortable-list.css +28 -0
  433. package/dist/collection/components/sortable-list/sortable-list.js +1 -1
  434. package/dist/collection/components/split-button/resources.js +1 -1
  435. package/dist/collection/components/split-button/split-button.css +28 -0
  436. package/dist/collection/components/split-button/split-button.js +1 -1
  437. package/dist/collection/components/stepper/stepper.css +28 -0
  438. package/dist/collection/components/stepper/stepper.js +1 -1
  439. package/dist/collection/components/stepper-item/stepper-item.css +28 -0
  440. package/dist/collection/components/stepper-item/stepper-item.js +1 -1
  441. package/dist/collection/components/switch/switch.css +28 -0
  442. package/dist/collection/components/switch/switch.js +1 -1
  443. package/dist/collection/components/tab/tab.css +28 -0
  444. package/dist/collection/components/tab/tab.js +1 -1
  445. package/dist/collection/components/tab-nav/tab-nav.css +28 -0
  446. package/dist/collection/components/tab-nav/tab-nav.js +1 -1
  447. package/dist/collection/components/tab-title/resources.js +1 -1
  448. package/dist/collection/components/tab-title/tab-title.css +28 -0
  449. package/dist/collection/components/tab-title/tab-title.js +1 -1
  450. package/dist/collection/components/tabs/resources.js +1 -1
  451. package/dist/collection/components/tabs/tabs.css +28 -0
  452. package/dist/collection/components/tabs/tabs.js +1 -1
  453. package/dist/collection/components/text-area/resources.js +1 -1
  454. package/dist/collection/components/text-area/text-area.css +28 -0
  455. package/dist/collection/components/text-area/text-area.js +1 -1
  456. package/dist/collection/components/tile/resources.js +1 -1
  457. package/dist/collection/components/tile/tile.css +28 -0
  458. package/dist/collection/components/tile/tile.js +1 -1
  459. package/dist/collection/components/tile-select/resources.js +1 -1
  460. package/dist/collection/components/tile-select/tile-select.css +28 -0
  461. package/dist/collection/components/tile-select/tile-select.js +1 -1
  462. package/dist/collection/components/tile-select-group/tile-select-group.css +28 -0
  463. package/dist/collection/components/tile-select-group/tile-select-group.js +1 -1
  464. package/dist/collection/components/time-picker/resources.js +1 -1
  465. package/dist/collection/components/time-picker/time-picker.css +28 -0
  466. package/dist/collection/components/time-picker/time-picker.js +1 -1
  467. package/dist/collection/components/tip/resources.js +1 -1
  468. package/dist/collection/components/tip/tip.css +28 -0
  469. package/dist/collection/components/tip/tip.js +1 -1
  470. package/dist/collection/components/tip-group/tip-group.css +28 -0
  471. package/dist/collection/components/tip-group/tip-group.js +1 -1
  472. package/dist/collection/components/tip-manager/resources.js +1 -1
  473. package/dist/collection/components/tip-manager/tip-manager.css +28 -0
  474. package/dist/collection/components/tip-manager/tip-manager.js +1 -1
  475. package/dist/collection/components/tooltip/TooltipManager.js +38 -24
  476. package/dist/collection/components/tooltip/resources.js +1 -1
  477. package/dist/collection/components/tooltip/tooltip.css +28 -0
  478. package/dist/collection/components/tooltip/tooltip.js +1 -1
  479. package/dist/collection/components/tooltip/utils.js +1 -1
  480. package/dist/collection/components/tree/tree.css +28 -0
  481. package/dist/collection/components/tree/tree.js +25 -12
  482. package/dist/collection/components/tree/utils.js +1 -1
  483. package/dist/collection/components/tree-item/resources.js +1 -1
  484. package/dist/collection/components/tree-item/tree-item.css +28 -0
  485. package/dist/collection/components/tree-item/tree-item.js +15 -8
  486. package/dist/collection/components/value-list/resources.js +1 -1
  487. package/dist/collection/components/value-list/utils.js +1 -1
  488. package/dist/collection/components/value-list/value-list.css +28 -0
  489. package/dist/collection/components/value-list/value-list.js +1 -1
  490. package/dist/collection/components/value-list-item/resources.js +1 -1
  491. package/dist/collection/components/value-list-item/value-list-item.css +28 -0
  492. package/dist/collection/components/value-list-item/value-list-item.js +1 -1
  493. package/dist/collection/index.js +1 -1
  494. package/dist/collection/utils/array.js +1 -1
  495. package/dist/collection/utils/conditionalSlot.js +1 -1
  496. package/dist/collection/utils/config.js +1 -1
  497. package/dist/collection/utils/date.js +1 -1
  498. package/dist/collection/utils/dom.js +114 -15
  499. package/dist/collection/utils/filter.js +1 -1
  500. package/dist/collection/utils/floating-ui.js +1 -1
  501. package/dist/collection/utils/focusTrapComponent.js +1 -1
  502. package/dist/collection/utils/form.js +1 -1
  503. package/dist/collection/utils/globalAttributes.js +1 -1
  504. package/dist/collection/utils/globalScript.js +1 -1
  505. package/dist/collection/utils/guid.js +1 -1
  506. package/dist/collection/utils/interactive.js +1 -1
  507. package/dist/collection/utils/key.js +1 -1
  508. package/dist/collection/utils/label.js +1 -1
  509. package/dist/collection/utils/loadable.js +1 -1
  510. package/dist/collection/utils/locale.js +1 -1
  511. package/dist/collection/utils/math.js +1 -1
  512. package/dist/collection/utils/mode.js +1 -1
  513. package/dist/collection/utils/number.js +1 -1
  514. package/dist/collection/utils/observers.js +1 -1
  515. package/dist/collection/utils/openCloseComponent.js +1 -1
  516. package/dist/collection/utils/resources.js +1 -1
  517. package/dist/collection/utils/t9n.js +1 -1
  518. package/dist/collection/utils/time.js +1 -1
  519. package/dist/components/ExpandToggle.js +1 -1
  520. package/dist/components/FloatingArrow.js +1 -1
  521. package/dist/components/Heading.js +1 -1
  522. package/dist/components/action-group.js +2 -2
  523. package/dist/components/action-menu.js +2 -2
  524. package/dist/components/action.js +2 -2
  525. package/dist/components/array.js +1 -1
  526. package/dist/components/button.js +2 -2
  527. package/dist/components/calcite-accordion-item.js +2 -2
  528. package/dist/components/calcite-accordion.js +2 -2
  529. package/dist/components/calcite-action-bar.js +2 -2
  530. package/dist/components/calcite-action-group.js +1 -1
  531. package/dist/components/calcite-action-menu.js +1 -1
  532. package/dist/components/calcite-action-pad.js +2 -2
  533. package/dist/components/calcite-action.js +1 -1
  534. package/dist/components/calcite-alert.js +2 -2
  535. package/dist/components/calcite-avatar.js +6 -4
  536. package/dist/components/calcite-block-section.js +2 -2
  537. package/dist/components/calcite-block.js +2 -2
  538. package/dist/components/calcite-button.js +1 -1
  539. package/dist/components/calcite-card.js +2 -2
  540. package/dist/components/calcite-checkbox.js +1 -1
  541. package/dist/components/calcite-chip-group.js +2 -2
  542. package/dist/components/calcite-chip.js +1 -1
  543. package/dist/components/calcite-color-picker-hex-input.js +2 -2
  544. package/dist/components/calcite-color-picker-swatch.js +1 -1
  545. package/dist/components/calcite-color-picker.js +377 -314
  546. package/dist/components/calcite-combobox-item-group.js +2 -2
  547. package/dist/components/calcite-combobox-item.js +2 -2
  548. package/dist/components/calcite-combobox.js +2 -2
  549. package/dist/components/calcite-date-picker-day.js +1 -1
  550. package/dist/components/calcite-date-picker-month-header.js +1 -1
  551. package/dist/components/calcite-date-picker-month.js +1 -1
  552. package/dist/components/calcite-date-picker.js +1 -1
  553. package/dist/components/calcite-dropdown-group.js +2 -2
  554. package/dist/components/calcite-dropdown-item.js +2 -2
  555. package/dist/components/calcite-dropdown.js +1 -1
  556. package/dist/components/calcite-fab.js +2 -2
  557. package/dist/components/calcite-filter.js +1 -1
  558. package/dist/components/calcite-flow-item.js +2 -2
  559. package/dist/components/calcite-flow.js +2 -2
  560. package/dist/components/calcite-graph.js +1 -1
  561. package/dist/components/calcite-handle.js +1 -1
  562. package/dist/components/calcite-icon.js +1 -1
  563. package/dist/components/calcite-inline-editable.js +2 -2
  564. package/dist/components/calcite-input-date-picker.js +2 -2
  565. package/dist/components/calcite-input-message.js +2 -2
  566. package/dist/components/calcite-input-number.js +2 -617
  567. package/dist/components/calcite-input-text.js +2 -2
  568. package/dist/components/calcite-input-time-picker.js +2 -2
  569. package/dist/components/calcite-input.js +1 -1
  570. package/dist/components/calcite-label.js +1 -1
  571. package/dist/components/calcite-link.js +1 -1
  572. package/dist/components/calcite-list-item-group.js +2 -2
  573. package/dist/components/calcite-list-item.js +2 -2
  574. package/dist/components/calcite-list.js +41 -31
  575. package/dist/components/calcite-loader.js +1 -1
  576. package/dist/components/calcite-modal.js +2 -2
  577. package/dist/components/calcite-notice.js +2 -2
  578. package/dist/components/calcite-option-group.js +2 -2
  579. package/dist/components/calcite-option.js +2 -2
  580. package/dist/components/calcite-pagination.js +2 -2
  581. package/dist/components/calcite-panel.js +1 -1
  582. package/dist/components/calcite-pick-list-group.js +2 -2
  583. package/dist/components/calcite-pick-list-item.js +1 -1
  584. package/dist/components/calcite-pick-list.js +2 -2
  585. package/dist/components/calcite-popover.js +1 -1
  586. package/dist/components/calcite-progress.js +1 -1
  587. package/dist/components/calcite-radio-button-group.js +2 -2
  588. package/dist/components/calcite-radio-button.js +2 -2
  589. package/dist/components/calcite-rating.js +2 -2
  590. package/dist/components/calcite-scrim.js +1 -1
  591. package/dist/components/calcite-segmented-control-item.js +2 -2
  592. package/dist/components/calcite-segmented-control.js +2 -2
  593. package/dist/components/calcite-select.js +2 -2
  594. package/dist/components/calcite-shell-center-row.js +2 -5
  595. package/dist/components/calcite-shell-panel.js +2 -2
  596. package/dist/components/calcite-shell.js +2 -2
  597. package/dist/components/calcite-slider.js +2 -2
  598. package/dist/components/calcite-sortable-list.js +2 -2
  599. package/dist/components/calcite-split-button.js +2 -2
  600. package/dist/components/calcite-stepper-item.js +2 -2
  601. package/dist/components/calcite-stepper.js +2 -2
  602. package/dist/components/calcite-switch.js +1 -1
  603. package/dist/components/calcite-tab-nav.js +1 -1
  604. package/dist/components/calcite-tab-title.js +1 -1
  605. package/dist/components/calcite-tab.js +1 -1
  606. package/dist/components/calcite-tabs.js +1 -1
  607. package/dist/components/calcite-text-area.js +2 -2
  608. package/dist/components/calcite-tile-select-group.js +2 -2
  609. package/dist/components/calcite-tile-select.js +2 -2
  610. package/dist/components/calcite-tile.js +1 -1
  611. package/dist/components/calcite-time-picker.js +1 -1
  612. package/dist/components/calcite-tip-group.js +2 -2
  613. package/dist/components/calcite-tip-manager.js +2 -2
  614. package/dist/components/calcite-tip.js +2 -2
  615. package/dist/components/calcite-tooltip.js +1 -1
  616. package/dist/components/calcite-tree-item.js +16 -9
  617. package/dist/components/calcite-tree.js +26 -13
  618. package/dist/components/calcite-value-list-item.js +2 -2
  619. package/dist/components/calcite-value-list.js +2 -2
  620. package/dist/components/checkbox.js +2 -2
  621. package/dist/components/chip.js +2 -2
  622. package/dist/components/color-picker-hex-input.js +252 -88
  623. package/dist/components/color-picker-swatch.js +42 -2118
  624. package/dist/components/composed-offset-position.esm.js +1 -1
  625. package/dist/components/conditionalSlot.js +1 -1
  626. package/dist/components/date-picker-day.js +2 -2
  627. package/dist/components/date-picker-month-header.js +2 -2
  628. package/dist/components/date-picker-month.js +2 -2
  629. package/dist/components/date-picker.js +3 -3
  630. package/dist/components/date.js +1 -1
  631. package/dist/components/debounce.js +1 -1
  632. package/dist/components/dom.js +114 -15
  633. package/dist/components/dropdown.js +2 -2
  634. package/dist/components/filter.js +2 -2
  635. package/dist/components/filter2.js +1 -1
  636. package/dist/components/floating-ui.js +68 -62
  637. package/dist/components/focusTrapComponent.js +1 -1
  638. package/dist/components/form.js +1 -1
  639. package/dist/components/graph.js +2 -2
  640. package/dist/components/guid.js +1 -1
  641. package/dist/components/handle.js +2 -2
  642. package/dist/components/icon.js +2 -2
  643. package/dist/components/index.js +1 -1
  644. package/dist/components/index2.js +2116 -0
  645. package/dist/components/input-number.js +623 -0
  646. package/dist/components/input.js +3 -3
  647. package/dist/components/interactive.js +1 -1
  648. package/dist/components/key.js +1 -1
  649. package/dist/components/label.js +2 -2
  650. package/dist/components/label2.js +1 -1
  651. package/dist/components/link.js +2 -2
  652. package/dist/components/loadable.js +1 -1
  653. package/dist/components/loader.js +2 -2
  654. package/dist/components/locale.js +2 -2
  655. package/dist/components/math.js +1 -1
  656. package/dist/components/observers.js +1 -1
  657. package/dist/components/openCloseComponent.js +1 -1
  658. package/dist/components/panel.js +2 -2
  659. package/dist/components/pick-list-item.js +2 -2
  660. package/dist/components/popover.js +2 -2
  661. package/dist/components/progress.js +2 -2
  662. package/dist/components/resources.js +1 -1
  663. package/dist/components/resources2.js +1 -1
  664. package/dist/components/resources3.js +1 -1
  665. package/dist/components/scrim.js +2 -2
  666. package/dist/components/shared-list-render.js +1 -1
  667. package/dist/components/sortable.esm.js +1 -1
  668. package/dist/components/switch.js +2 -2
  669. package/dist/components/t9n.js +1 -1
  670. package/dist/components/tab-nav.js +2 -2
  671. package/dist/components/tab-title.js +2 -2
  672. package/dist/components/tab.js +2 -2
  673. package/dist/components/tabs.js +2 -2
  674. package/dist/components/throttle.js +1 -1
  675. package/dist/components/tile.js +2 -2
  676. package/dist/components/time-picker.js +3 -3
  677. package/dist/components/tooltip.js +39 -25
  678. package/dist/components/utils.js +112 -31
  679. package/dist/components/utils2.js +1 -1
  680. package/dist/components/utils3.js +1 -1
  681. package/dist/esm/{ExpandToggle-b9435cd9.js → ExpandToggle-08d3fc16.js} +5 -5
  682. package/dist/esm/{FloatingArrow-c11f7328.js → FloatingArrow-2c212b17.js} +2 -2
  683. package/dist/esm/{Heading-cf0b7487.js → Heading-74a23d79.js} +2 -2
  684. package/dist/esm/{app-globals-4fed5e1d.js → app-globals-8c9ecd4d.js} +2 -2
  685. package/dist/esm/{array-358c609b.js → array-738e1ac6.js} +1 -1
  686. package/dist/esm/calcite-accordion_2.entry.js +9 -9
  687. package/dist/esm/calcite-action-bar.entry.js +16 -16
  688. package/dist/esm/calcite-action-group.entry.js +14 -14
  689. package/dist/esm/calcite-action-menu.entry.js +10 -10
  690. package/dist/esm/calcite-action-pad.entry.js +15 -15
  691. package/dist/esm/calcite-action.entry.js +12 -12
  692. package/dist/esm/calcite-alert.entry.js +13 -13
  693. package/dist/esm/calcite-avatar.entry.js +10 -9
  694. package/dist/esm/calcite-block_2.entry.js +14 -14
  695. package/dist/esm/calcite-button.entry.js +14 -14
  696. package/dist/esm/calcite-card.entry.js +11 -11
  697. package/dist/esm/calcite-checkbox.entry.js +11 -11
  698. package/dist/esm/calcite-chip-group.entry.js +9 -9
  699. package/dist/esm/calcite-chip.entry.js +13 -13
  700. package/dist/esm/calcite-color-picker_3.entry.js +585 -339
  701. package/dist/esm/calcite-combobox_3.entry.js +21 -21
  702. package/dist/esm/calcite-date-picker_4.entry.js +17 -17
  703. package/dist/esm/calcite-dropdown_3.entry.js +15 -15
  704. package/dist/esm/calcite-fab.entry.js +8 -8
  705. package/dist/esm/calcite-filter.entry.js +14 -14
  706. package/dist/esm/calcite-flow-item.entry.js +13 -13
  707. package/dist/esm/calcite-flow.entry.js +4 -4
  708. package/dist/esm/calcite-graph_2.entry.js +15 -15
  709. package/dist/esm/calcite-handle.entry.js +11 -11
  710. package/dist/esm/calcite-icon.entry.js +7 -7
  711. package/dist/esm/calcite-inline-editable.entry.js +13 -13
  712. package/dist/esm/calcite-input-date-picker.entry.js +19 -19
  713. package/dist/esm/calcite-input-message.entry.js +6 -6
  714. package/dist/esm/calcite-input-number.entry.js +14 -14
  715. package/dist/esm/calcite-input-text.entry.js +14 -14
  716. package/dist/esm/calcite-input-time-picker_2.entry.js +16 -16
  717. package/dist/esm/calcite-input.entry.js +14 -14
  718. package/dist/esm/calcite-label.entry.js +7 -7
  719. package/dist/esm/calcite-link.entry.js +8 -8
  720. package/dist/esm/calcite-list_3.entry.js +53 -43
  721. package/dist/esm/calcite-loader.entry.js +4 -4
  722. package/dist/esm/calcite-modal.entry.js +14 -14
  723. package/dist/esm/calcite-notice.entry.js +13 -13
  724. package/dist/esm/calcite-option_3.entry.js +13 -13
  725. package/dist/esm/calcite-pagination.entry.js +11 -11
  726. package/dist/esm/calcite-panel.entry.js +15 -15
  727. package/dist/esm/calcite-pick-list_3.entry.js +19 -19
  728. package/dist/esm/calcite-popover.entry.js +17 -17
  729. package/dist/esm/calcite-progress.entry.js +3 -3
  730. package/dist/esm/calcite-radio-button-group.entry.js +4 -4
  731. package/dist/esm/calcite-radio-button.entry.js +11 -11
  732. package/dist/esm/calcite-rating.entry.js +14 -14
  733. package/dist/esm/calcite-scrim.entry.js +10 -10
  734. package/dist/esm/calcite-segmented-control_2.entry.js +11 -11
  735. package/dist/esm/calcite-shell_3.entry.js +14 -17
  736. package/dist/esm/calcite-sortable-list.entry.js +6 -6
  737. package/dist/esm/calcite-split-button.entry.js +5 -5
  738. package/dist/esm/calcite-stepper_2.entry.js +12 -12
  739. package/dist/esm/calcite-switch.entry.js +11 -11
  740. package/dist/esm/calcite-tab_4.entry.js +11 -11
  741. package/dist/esm/calcite-text-area.entry.js +16 -16
  742. package/dist/esm/calcite-tile-select_2.entry.js +7 -7
  743. package/dist/esm/calcite-tile.entry.js +9 -9
  744. package/dist/esm/calcite-tip_3.entry.js +14 -14
  745. package/dist/esm/calcite-tooltip.entry.js +47 -33
  746. package/dist/esm/calcite-tree_2.entry.js +49 -29
  747. package/dist/esm/calcite-value-list_2.entry.js +18 -18
  748. package/dist/esm/calcite.js +6 -6
  749. package/dist/esm/{composed-offset-position.esm-7dad5f51.js → composed-offset-position.esm-7183f535.js} +1 -1
  750. package/dist/esm/{conditionalSlot-5cabd141.js → conditionalSlot-8dcf294e.js} +3 -3
  751. package/dist/esm/{debounce-3236c2d6.js → debounce-202fcbcd.js} +1 -1
  752. package/dist/esm/{dom-28b5e538.js → dom-bef76399.js} +116 -17
  753. package/dist/esm/{filter-698b6eb0.js → filter-99a00b00.js} +2 -2
  754. package/dist/esm/{floating-ui-b5749485.js → floating-ui-3b144250.js} +71 -65
  755. package/dist/esm/{focusTrapComponent-889051a9.js → focusTrapComponent-11da47cd.js} +2 -2
  756. package/dist/esm/{form-09082c06.js → form-9ec1fffc.js} +3 -3
  757. package/dist/esm/{guid-544471e1.js → guid-9fe3e534.js} +1 -1
  758. package/dist/esm/{index-5d088200.js → index-2db8a7e2.js} +1 -1
  759. package/dist/esm/index.js +2 -2
  760. package/dist/esm/{interactive-854fd770.js → interactive-bb1f57d0.js} +1 -1
  761. package/dist/esm/{key-fe7f0c5b.js → key-c032c64e.js} +1 -1
  762. package/dist/esm/{label-78d3672e.js → label-491a2111.js} +2 -2
  763. package/dist/esm/{loadable-1fd5df25.js → loadable-8dd0a87b.js} +1 -1
  764. package/dist/esm/loader.js +6 -6
  765. package/dist/esm/{locale-ca2b383e.js → locale-a0557607.js} +4 -4
  766. package/dist/esm/{math-144739fc.js → math-c3672f0c.js} +1 -1
  767. package/dist/esm/{observers-072ef19c.js → observers-600e50b2.js} +1 -1
  768. package/dist/esm/{openCloseComponent-6e2df95d.js → openCloseComponent-415e6baf.js} +2 -2
  769. package/dist/esm/{resources-bc08b0a8.js → resources-004115b1.js} +5 -5
  770. package/dist/esm/{resources-7c3efd5b.js → resources-07152e83.js} +1 -1
  771. package/dist/esm/{resources-81fb0e53.js → resources-30536763.js} +1 -1
  772. package/dist/esm/{resources-ae5aaa2f.js → resources-405d5533.js} +1 -1
  773. package/dist/esm/{resources-417fcb2c.js → resources-84de5e61.js} +1 -1
  774. package/dist/esm/{resources-0fd2a367.js → resources-8b8ca592.js} +1 -1
  775. package/dist/esm/{sortable.esm-2496d718.js → sortable.esm-b48569dd.js} +1 -1
  776. package/dist/esm/{t9n-a16b2bfd.js → t9n-5f6010b1.js} +3 -3
  777. package/dist/esm/{throttle-f248810f.js → throttle-c1467685.js} +2 -2
  778. package/dist/esm/{utils-dbad4ec5.js → utils-182a6956.js} +3 -3
  779. package/dist/esm/utils-c0bef67d.js +195 -0
  780. package/dist/extras/docs-json.json +193 -39
  781. package/dist/extras/vscode-data.json +28 -4
  782. package/dist/loader/cdn.js +1 -1
  783. package/dist/loader/index.cjs.js +1 -1
  784. package/dist/loader/index.es2017.js +1 -1
  785. package/dist/loader/index.js +1 -1
  786. package/dist/types/components/avatar/avatar.d.ts +3 -1
  787. package/dist/types/components/color-picker/color-picker.d.ts +55 -26
  788. package/dist/types/components/color-picker/interfaces.d.ts +1 -0
  789. package/dist/types/components/color-picker/resources.d.ts +28 -18
  790. package/dist/types/components/color-picker/utils.d.ts +16 -7
  791. package/dist/types/components/color-picker-hex-input/color-picker-hex-input.d.ts +33 -16
  792. package/dist/types/components/color-picker-hex-input/resources.d.ts +2 -2
  793. package/dist/types/components/color-picker-swatch/color-picker-swatch.d.ts +3 -2
  794. package/dist/types/components/color-picker-swatch/resources.d.ts +6 -1
  795. package/dist/types/components/flow-item/flow-item.d.ts +1 -1
  796. package/dist/types/components/list/list.d.ts +7 -2
  797. package/dist/types/components/list/resources.d.ts +1 -1
  798. package/dist/types/components/panel/panel.d.ts +1 -1
  799. package/dist/types/components/tooltip/TooltipManager.d.ts +3 -2
  800. package/dist/types/components/tree-item/tree-item.d.ts +2 -0
  801. package/dist/types/components.d.ts +74 -10
  802. package/dist/types/preact.d.ts +2 -1
  803. package/dist/types/utils/dom.d.ts +115 -19
  804. package/hydrate/index.js +1070 -597
  805. package/package.json +5 -6
  806. package/dist/calcite/p-0e62bf57.entry.js +0 -6
  807. package/dist/calcite/p-130cb272.entry.js +0 -6
  808. package/dist/calcite/p-137e2bb9.entry.js +0 -6
  809. package/dist/calcite/p-16186076.entry.js +0 -6
  810. package/dist/calcite/p-16eb38b3.entry.js +0 -6
  811. package/dist/calcite/p-16fa02e0.entry.js +0 -6
  812. package/dist/calcite/p-19558484.entry.js +0 -6
  813. package/dist/calcite/p-19eec879.entry.js +0 -6
  814. package/dist/calcite/p-1a2f0b78.entry.js +0 -6
  815. package/dist/calcite/p-1c134cca.entry.js +0 -6
  816. package/dist/calcite/p-1ea5ac9d.entry.js +0 -6
  817. package/dist/calcite/p-1ee8a27c.entry.js +0 -6
  818. package/dist/calcite/p-26900c87.entry.js +0 -6
  819. package/dist/calcite/p-2e37d908.entry.js +0 -6
  820. package/dist/calcite/p-331764e7.entry.js +0 -6
  821. package/dist/calcite/p-3480e564.js +0 -6
  822. package/dist/calcite/p-355c6b51.js +0 -6
  823. package/dist/calcite/p-3c07d6d9.entry.js +0 -6
  824. package/dist/calcite/p-43c67bb9.entry.js +0 -6
  825. package/dist/calcite/p-4fd321ce.entry.js +0 -6
  826. package/dist/calcite/p-5b450927.entry.js +0 -6
  827. package/dist/calcite/p-5f1f5c38.entry.js +0 -6
  828. package/dist/calcite/p-601ddd73.js +0 -6
  829. package/dist/calcite/p-6050736c.entry.js +0 -6
  830. package/dist/calcite/p-636d0418.entry.js +0 -6
  831. package/dist/calcite/p-647ebb8d.entry.js +0 -6
  832. package/dist/calcite/p-648773ca.entry.js +0 -6
  833. package/dist/calcite/p-69984379.entry.js +0 -6
  834. package/dist/calcite/p-6b999e6a.entry.js +0 -6
  835. package/dist/calcite/p-6f9a5b38.entry.js +0 -6
  836. package/dist/calcite/p-70dba721.entry.js +0 -6
  837. package/dist/calcite/p-77a01239.entry.js +0 -6
  838. package/dist/calcite/p-77e28424.entry.js +0 -6
  839. package/dist/calcite/p-77ffa8c0.entry.js +0 -6
  840. package/dist/calcite/p-78f1640b.entry.js +0 -6
  841. package/dist/calcite/p-8a791b50.entry.js +0 -6
  842. package/dist/calcite/p-8bfca736.entry.js +0 -6
  843. package/dist/calcite/p-8c36542e.entry.js +0 -6
  844. package/dist/calcite/p-8e7597b8.entry.js +0 -6
  845. package/dist/calcite/p-8eb242c3.entry.js +0 -6
  846. package/dist/calcite/p-8f36135a.entry.js +0 -6
  847. package/dist/calcite/p-91a65b3d.entry.js +0 -6
  848. package/dist/calcite/p-9419d79f.entry.js +0 -6
  849. package/dist/calcite/p-9a4aea5c.entry.js +0 -6
  850. package/dist/calcite/p-9e966c8c.entry.js +0 -6
  851. package/dist/calcite/p-9f70d531.entry.js +0 -6
  852. package/dist/calcite/p-a6964ccc.entry.js +0 -6
  853. package/dist/calcite/p-a7b6b725.entry.js +0 -6
  854. package/dist/calcite/p-b1128d62.entry.js +0 -6
  855. package/dist/calcite/p-b96e03be.entry.js +0 -6
  856. package/dist/calcite/p-bfd4b549.entry.js +0 -6
  857. package/dist/calcite/p-c0877b02.js +0 -6
  858. package/dist/calcite/p-ca503db0.entry.js +0 -6
  859. package/dist/calcite/p-ccdbdd3e.entry.js +0 -6
  860. package/dist/calcite/p-d025ac9c.entry.js +0 -6
  861. package/dist/calcite/p-d66139be.entry.js +0 -6
  862. package/dist/calcite/p-db810dad.js +0 -6
  863. package/dist/calcite/p-dc80a779.entry.js +0 -6
  864. package/dist/calcite/p-de9cb821.js +0 -6
  865. package/dist/calcite/p-ec46baf1.entry.js +0 -6
  866. package/dist/calcite/p-ede3f0a2.entry.js +0 -6
  867. package/dist/calcite/p-eebb35d7.entry.js +0 -6
  868. package/dist/calcite/p-f02dfea6.entry.js +0 -6
  869. package/dist/calcite/p-f3481dad.entry.js +0 -6
  870. package/dist/calcite/p-f3fd38f8.entry.js +0 -6
  871. package/dist/calcite/p-f54ae1ab.entry.js +0 -6
  872. package/dist/cjs/utils-a90ed219.js +0 -124
  873. package/dist/esm/utils-5f9ac4a7.js +0 -114
@@ -1,26 +1,26 @@
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.1
4
+ * v1.4.0-next.11
5
5
  */
6
6
  'use strict';
7
7
 
8
8
  Object.defineProperty(exports, '__esModule', { value: true });
9
9
 
10
- const index = require('./index-2a60e5ec.js');
11
- const dom = require('./dom-dd7e7078.js');
12
- const utils = require('./utils-a90ed219.js');
13
- const interactive = require('./interactive-6cff8d4e.js');
14
- const key = require('./key-629ff080.js');
15
- const loadable = require('./loadable-85e1f45b.js');
16
- const locale = require('./locale-44e61096.js');
17
- const math = require('./math-faf5a949.js');
18
- const t9n = require('./t9n-6d0f2ca7.js');
19
- const throttle = require('./throttle-9dfcf548.js');
20
- require('./guid-6841fe52.js');
21
- require('./resources-ad5570c2.js');
22
- require('./observers-d3bfb778.js');
23
- require('./debounce-bf9bd36d.js');
10
+ const index = require('./index-878e6a10.js');
11
+ const dom = require('./dom-f9be6b76.js');
12
+ const utils = require('./utils-3cbb4489.js');
13
+ const interactive = require('./interactive-5c9db1e0.js');
14
+ const key = require('./key-19d72847.js');
15
+ const loadable = require('./loadable-30ec84d4.js');
16
+ const locale = require('./locale-2feae2e1.js');
17
+ const math = require('./math-06431d34.js');
18
+ const t9n = require('./t9n-e4b5d7bc.js');
19
+ const throttle = require('./throttle-c959a70a.js');
20
+ require('./guid-d38d5390.js');
21
+ require('./resources-1e20f92b.js');
22
+ require('./observers-1f039e59.js');
23
+ require('./debounce-8b93ddf9.js');
24
24
 
25
25
  function createCommonjsModule(fn, basedir, module) {
26
26
  return module = {
@@ -2133,30 +2133,36 @@ function zeroArray(array, length) {
2133
2133
  var color = Color;
2134
2134
 
2135
2135
  const CSS$2 = {
2136
+ channel: "channel",
2137
+ channels: "channels",
2138
+ colorField: "color-field",
2139
+ colorFieldScope: "scope--color-field",
2140
+ colorMode: "color-mode",
2141
+ colorModeContainer: "color-mode-container",
2136
2142
  container: "container",
2143
+ control: "control",
2144
+ controlAndScope: "control-and-scope",
2137
2145
  controlSection: "control-section",
2138
- hexOptions: "color-hex-options",
2139
- section: "section",
2146
+ deleteColor: "delete-color",
2140
2147
  header: "header",
2141
- control: "control",
2142
- splitSection: "section--split",
2143
- colorModeContainer: "color-mode-container",
2144
- colorMode: "color-mode",
2145
- channels: "channels",
2146
- channel: "channel",
2147
- savedColors: "saved-colors",
2148
- savedColorsSection: "saved-colors-section",
2148
+ hexAndChannelsGroup: "hex-and-channels-group",
2149
+ hexOptions: "color-hex-options",
2150
+ hueScope: "scope--hue",
2151
+ hueSlider: "hue-slider",
2152
+ opacityScope: "scope--opacity",
2153
+ opacitySlider: "opacity-slider",
2154
+ preview: "preview",
2155
+ previewAndSliders: "preview-and-sliders",
2149
2156
  saveColor: "save-color",
2150
- deleteColor: "delete-color",
2157
+ savedColor: "saved-color",
2158
+ savedColors: "saved-colors",
2151
2159
  savedColorsButtons: "saved-colors-buttons",
2152
- headerHex: "header--hex",
2153
- colorFieldAndSlider: "color-field-and-slider",
2154
- colorFieldAndSliderInteractive: "color-field-and-slider--interactive",
2155
- colorFieldAndSliderWrap: "color-field-and-slider-wrap",
2160
+ savedColorsSection: "saved-colors-section",
2156
2161
  scope: "scope",
2157
- hueScope: "scope--hue",
2158
- colorFieldScope: "scope--color-field",
2159
- savedColor: "saved-color"
2162
+ section: "section",
2163
+ slider: "slider",
2164
+ sliders: "sliders",
2165
+ splitSection: "section--split"
2160
2166
  };
2161
2167
  const DEFAULT_COLOR$1 = color("#007AC2");
2162
2168
  const DEFAULT_STORAGE_KEY_PREFIX = "calcite-color-";
@@ -2170,24 +2176,28 @@ const HSV_LIMITS = {
2170
2176
  s: 100,
2171
2177
  v: 100
2172
2178
  };
2179
+ const OPACITY_LIMITS = {
2180
+ min: 0,
2181
+ max: 100
2182
+ };
2173
2183
  const DIMENSIONS = {
2174
2184
  s: {
2175
2185
  slider: {
2176
- height: 10,
2177
- width: 160
2186
+ height: 12,
2187
+ width: 104
2178
2188
  },
2179
2189
  colorField: {
2180
2190
  height: 80,
2181
2191
  width: 160
2182
2192
  },
2183
2193
  thumb: {
2184
- radius: 8
2194
+ radius: 10
2185
2195
  }
2186
2196
  },
2187
2197
  m: {
2188
2198
  slider: {
2189
- height: 14,
2190
- width: 272
2199
+ height: 12,
2200
+ width: 204
2191
2201
  },
2192
2202
  colorField: {
2193
2203
  height: 150,
@@ -2199,35 +2209,30 @@ const DIMENSIONS = {
2199
2209
  },
2200
2210
  l: {
2201
2211
  slider: {
2202
- height: 16,
2203
- width: 464
2212
+ height: 12,
2213
+ width: 384
2204
2214
  },
2205
2215
  colorField: {
2206
2216
  height: 200,
2207
2217
  width: 464
2208
2218
  },
2209
2219
  thumb: {
2210
- radius: 12
2220
+ radius: 10
2211
2221
  }
2212
2222
  }
2213
2223
  };
2214
2224
 
2215
- const colorPickerCss = "@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-block;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-normal)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([scale=s]) .container{inline-size:160px}:host([scale=s]) .saved-colors{grid-template-columns:repeat(auto-fill, minmax(20px, 1fr))}:host([scale=s]) .channels{flex-direction:column}:host([scale=s]) .channel{inline-size:100%;margin-block-end:4px}:host([scale=s]) .channel:last-child{margin-block-end:0}:host([scale=m]) .container{inline-size:272px}:host([scale=l]) .header{padding-block-end:0px}:host([scale=l]){font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]) .container{inline-size:464px}:host([scale=l]) .color-field-and-slider{margin-block-end:-20px}:host([scale=l]) .section{padding-block:0 16px;padding-inline:16px}:host([scale=l]) .section:first-of-type{padding-block-start:16px}:host([scale=l]) .saved-colors{grid-template-columns:repeat(auto-fill, minmax(28px, 1fr));grid-gap:12px;padding-block-start:16px}:host([scale=l]) .control-section{flex-wrap:nowrap;align-items:baseline}:host([scale=l]) .control-section>:nth-child(2){margin-inline-start:12px}:host([scale=l]) .color-hex-options{display:flex;flex-shrink:1;flex-direction:column;justify-content:space-around;min-block-size:98px;inline-size:160px}:host([scale=l]) .color-mode-container{flex-shrink:3}.container{background-color:var(--calcite-ui-foreground-1);display:inline-block;border:1px solid var(--calcite-ui-border-1)}.color-field-and-slider-wrap{position:relative}.scope{position:absolute;font-size:var(--calcite-font-size--1);outline-color:transparent;outline-offset:14px}.scope:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc(\n 2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-ui-focus-offset-invert),\n 1\n )\n )\n );outline-offset:16px}.color-field-and-slider{margin-block-end:-16px;touch-action:none}.color-field-and-slider--interactive{cursor:pointer}.control-section{display:flex;flex-direction:row;flex-wrap:wrap}.section{padding-block:0 12px;padding-inline:12px}.section:first-of-type{padding-block-start:12px}.color-hex-options,.section--split{flex-grow:1}.header{display:flex;align-items:center;justify-content:space-between;padding-block-end:0.25rem;color:var(--calcite-ui-text-1)}.header--hex,.color-mode-container{padding-block-start:12px}.channels{display:flex;justify-content:space-between}.channel{inline-size:31%}.saved-colors{padding-block-start:12px;display:grid;grid-template-columns:repeat(auto-fill, minmax(24px, 1fr));grid-gap:8px;inline-size:100%}.saved-colors-buttons{display:flex}.saved-color{outline-offset:0;outline-color:transparent;cursor:pointer}.saved-color:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:2px}.saved-color:hover{transition:outline-color var(--calcite-internal-animation-timing-fast) ease-in-out;outline:2px solid var(--calcite-ui-border-2);outline-offset:2px}";
2225
+ const colorPickerCss = "@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-right{0%{opacity:0;transform:translate3D(-5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-left{0%{opacity:0;transform:translate3D(5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-right{animation-name:in-right}.calcite-animate__in-left{animation-name:in-left}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-block;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-normal)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([scale=s]){--calcite-color-picker-spacing:8px}:host([scale=s]) .container{inline-size:160px}:host([scale=s]) .saved-colors{gap:0.25rem;grid-template-columns:repeat(auto-fill, 20px)}:host([scale=m]){--calcite-color-picker-spacing:12px}:host([scale=m]) .container{inline-size:272px}:host([scale=l]){--calcite-color-picker-spacing:16px;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]) .container{inline-size:464px}:host([scale=l]) .section:first-of-type{padding-block-start:var(--calcite-color-picker-spacing)}:host([scale=l]) .saved-colors{grid-template-columns:repeat(auto-fill, 32px)}:host([scale=l]) .control-section{flex-wrap:nowrap;align-items:baseline;flex-wrap:wrap}:host([scale=l]) .color-hex-options{display:flex;flex-shrink:1;flex-direction:column;justify-content:space-around}:host([scale=l]) .color-mode-container{flex-shrink:3}.container{background-color:var(--calcite-ui-foreground-1);display:inline-block;border:1px solid var(--calcite-ui-border-1)}.control-and-scope{position:relative;display:flex;cursor:pointer;touch-action:none}.scope{position:absolute;z-index:1;font-size:var(--calcite-font-size--1);outline-color:transparent}.scope:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc(\n 2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-ui-focus-offset-invert),\n 1\n )\n )\n );outline-offset:16px}.hex-and-channels-group{inline-size:100%}.hex-and-channels-group,.control-section{display:flex;flex-direction:row;flex-wrap:wrap}.section{padding-block:0 var(--calcite-color-picker-spacing);padding-inline:var(--calcite-color-picker-spacing)}.section:first-of-type{padding-block-start:var(--calcite-color-picker-spacing)}.sliders{display:flex;flex-direction:column;justify-content:space-between;margin-inline-start:var(--calcite-color-picker-spacing)}.preview-and-sliders{display:flex;align-items:center;padding:var(--calcite-color-picker-spacing)}.color-hex-options,.section--split{flex-grow:1}.header{display:flex;align-items:center;justify-content:space-between;color:var(--calcite-ui-text-1)}.color-mode-container{padding-block-start:var(--calcite-color-picker-spacing)}.channels{display:flex;row-gap:0.125rem}.channel[data-channel-index=\"3\"]{inline-size:159px}:host([scale=s]) .channels{flex-wrap:wrap}:host([scale=s]) .channel{flex-basis:30%;flex-grow:1}:host([scale=s]) .channel[data-channel-index=\"3\"]{inline-size:unset;margin-inline-start:unset}:host([scale=l]) .channel[data-channel-index=\"3\"]{inline-size:131px}.saved-colors{display:grid;gap:0.5rem;padding-block-start:var(--calcite-color-picker-spacing);grid-template-columns:repeat(auto-fill, 24px)}.saved-colors-buttons{display:flex}.saved-color{outline-offset:0;outline-color:transparent;cursor:pointer}.saved-color:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:2px}.saved-color:hover{transition:outline-color var(--calcite-internal-animation-timing-fast) ease-in-out;outline:2px solid var(--calcite-ui-border-2);outline-offset:2px}";
2216
2226
 
2217
2227
  const throttleFor60FpsInMs = 16;
2218
- const defaultValue = utils.normalizeHex(DEFAULT_COLOR$1.hex());
2219
- const defaultFormat = "auto";
2220
2228
  const ColorPicker = class {
2221
2229
  constructor(hostRef) {
2222
2230
  index.registerInstance(this, hostRef);
2223
2231
  this.calciteColorPickerChange = index.createEvent(this, "calciteColorPickerChange", 6);
2224
2232
  this.calciteColorPickerInput = index.createEvent(this, "calciteColorPickerInput", 6);
2225
- this.colorFieldAndSliderHovered = false;
2226
- this.hueThumbState = "idle";
2227
2233
  this.internalColorUpdateContext = null;
2228
2234
  this.mode = utils.CSSColorMode.HEX;
2229
2235
  this.shiftKeyChannelAdjustment = 0;
2230
- this.sliderThumbState = "idle";
2231
2236
  this.handleTabActivate = (event) => {
2232
2237
  this.channelMode = event.currentTarget.getAttribute("data-color-mode");
2233
2238
  this.updateChannelsFromColor(this.color);
@@ -2272,7 +2277,7 @@ const ColorPicker = class {
2272
2277
  this.internalColorSet(null);
2273
2278
  return;
2274
2279
  }
2275
- const normalizedHex = color$1 && utils.normalizeHex(color$1.hex());
2280
+ const normalizedHex = color$1 && utils.normalizeHex(utils.hexify(color$1, utils.alphaCompatible(this.mode)));
2276
2281
  if (hex !== normalizedHex) {
2277
2282
  this.internalColorSet(color(hex));
2278
2283
  }
@@ -2284,16 +2289,20 @@ const ColorPicker = class {
2284
2289
  this.handleChannelInput = (event) => {
2285
2290
  const input = event.currentTarget;
2286
2291
  const channelIndex = Number(input.getAttribute("data-channel-index"));
2287
- const limit = this.channelMode === "rgb"
2288
- ? RGB_LIMITS[Object.keys(RGB_LIMITS)[channelIndex]]
2289
- : HSV_LIMITS[Object.keys(HSV_LIMITS)[channelIndex]];
2292
+ const isAlphaChannel = channelIndex === 3;
2293
+ const limit = isAlphaChannel
2294
+ ? OPACITY_LIMITS.max
2295
+ : this.channelMode === "rgb"
2296
+ ? RGB_LIMITS[Object.keys(RGB_LIMITS)[channelIndex]]
2297
+ : HSV_LIMITS[Object.keys(HSV_LIMITS)[channelIndex]];
2290
2298
  let inputValue;
2291
2299
  if (this.allowEmpty && !input.value) {
2292
2300
  inputValue = "";
2293
2301
  }
2294
2302
  else {
2295
- const value = Number(input.value) + this.shiftKeyChannelAdjustment;
2296
- const clamped = math.clamp(value, 0, limit);
2303
+ const value = Number(input.value);
2304
+ const adjustedValue = value + this.shiftKeyChannelAdjustment;
2305
+ const clamped = math.clamp(adjustedValue, 0, limit);
2297
2306
  inputValue = clamped.toString();
2298
2307
  }
2299
2308
  input.value = inputValue;
@@ -2307,11 +2316,13 @@ const ColorPicker = class {
2307
2316
  const channels = [...this.channels];
2308
2317
  const shouldClearChannels = this.allowEmpty && !input.value;
2309
2318
  if (shouldClearChannels) {
2310
- this.channels = [null, null, null];
2319
+ this.channels = [null, null, null, null];
2311
2320
  this.internalColorSet(null);
2312
2321
  return;
2313
2322
  }
2314
- channels[channelIndex] = Number(input.value);
2323
+ const isAlphaChannel = channelIndex === 3;
2324
+ const value = Number(input.value);
2325
+ channels[channelIndex] = isAlphaChannel ? utils.opacityToAlpha(value) : value;
2315
2326
  this.updateColorFromChannels(channels);
2316
2327
  };
2317
2328
  this.handleSavedColorKeyDown = (event) => {
@@ -2320,144 +2331,101 @@ const ColorPicker = class {
2320
2331
  this.handleSavedColorSelect(event);
2321
2332
  }
2322
2333
  };
2323
- this.handleColorFieldAndSliderPointerLeave = () => {
2324
- this.colorFieldAndSliderInteractive = false;
2325
- this.colorFieldAndSliderHovered = false;
2326
- if (this.sliderThumbState !== "drag" && this.hueThumbState !== "drag") {
2327
- this.hueThumbState = "idle";
2328
- this.sliderThumbState = "idle";
2329
- this.drawColorFieldAndSlider();
2330
- }
2331
- };
2332
- this.handleColorFieldAndSliderPointerDown = (event) => {
2334
+ this.handleColorFieldPointerDown = (event) => {
2333
2335
  if (!dom.isPrimaryPointerButton(event)) {
2334
2336
  return;
2335
2337
  }
2336
2338
  const { offsetX, offsetY } = event;
2337
- const region = this.getCanvasRegion(offsetY);
2338
- if (region === "color-field") {
2339
- this.hueThumbState = "drag";
2340
- this.captureColorFieldColor(offsetX, offsetY);
2341
- this.colorFieldScopeNode?.focus();
2339
+ document.addEventListener("pointermove", this.globalPointerMoveHandler);
2340
+ document.addEventListener("pointerup", this.globalPointerUpHandler, { once: true });
2341
+ this.activeCanvasInfo = {
2342
+ context: this.colorFieldRenderingContext,
2343
+ bounds: this.colorFieldRenderingContext.canvas.getBoundingClientRect()
2344
+ };
2345
+ this.captureColorFieldColor(offsetX, offsetY);
2346
+ this.colorFieldScopeNode.focus();
2347
+ };
2348
+ this.handleHueSliderPointerDown = (event) => {
2349
+ if (!dom.isPrimaryPointerButton(event)) {
2350
+ return;
2342
2351
  }
2343
- else if (region === "slider") {
2344
- this.sliderThumbState = "drag";
2345
- this.captureHueSliderColor(offsetX);
2346
- this.hueScopeNode?.focus();
2352
+ const { offsetX } = event;
2353
+ document.addEventListener("pointermove", this.globalPointerMoveHandler);
2354
+ document.addEventListener("pointerup", this.globalPointerUpHandler, { once: true });
2355
+ this.activeCanvasInfo = {
2356
+ context: this.hueSliderRenderingContext,
2357
+ bounds: this.hueSliderRenderingContext.canvas.getBoundingClientRect()
2358
+ };
2359
+ this.captureHueSliderColor(offsetX);
2360
+ this.hueScopeNode.focus();
2361
+ };
2362
+ this.handleOpacitySliderPointerDown = (event) => {
2363
+ if (!dom.isPrimaryPointerButton(event)) {
2364
+ return;
2347
2365
  }
2366
+ const { offsetX } = event;
2348
2367
  document.addEventListener("pointermove", this.globalPointerMoveHandler);
2349
2368
  document.addEventListener("pointerup", this.globalPointerUpHandler, { once: true });
2350
- this.activeColorFieldAndSliderRect =
2351
- this.fieldAndSliderRenderingContext.canvas.getBoundingClientRect();
2369
+ this.activeCanvasInfo = {
2370
+ context: this.opacitySliderRenderingContext,
2371
+ bounds: this.opacitySliderRenderingContext.canvas.getBoundingClientRect()
2372
+ };
2373
+ this.captureOpacitySliderValue(offsetX);
2374
+ this.opacityScopeNode.focus();
2352
2375
  };
2353
2376
  this.globalPointerUpHandler = (event) => {
2354
2377
  if (!dom.isPrimaryPointerButton(event)) {
2355
2378
  return;
2356
2379
  }
2357
- const previouslyDragging = this.sliderThumbState === "drag" || this.hueThumbState === "drag";
2358
- this.hueThumbState = "idle";
2359
- this.sliderThumbState = "idle";
2360
- this.activeColorFieldAndSliderRect = null;
2361
- this.drawColorFieldAndSlider();
2380
+ const previouslyDragging = this.activeCanvasInfo;
2381
+ this.activeCanvasInfo = null;
2382
+ this.drawColorControls();
2362
2383
  if (previouslyDragging) {
2363
2384
  this.calciteColorPickerChange.emit();
2364
2385
  }
2365
2386
  };
2366
2387
  this.globalPointerMoveHandler = (event) => {
2367
- const { el, dimensions } = this;
2368
- const sliderThumbDragging = this.sliderThumbState === "drag";
2369
- const hueThumbDragging = this.hueThumbState === "drag";
2370
- if (!el.isConnected || (!sliderThumbDragging && !hueThumbDragging)) {
2388
+ const { activeCanvasInfo, el } = this;
2389
+ if (!el.isConnected || !activeCanvasInfo) {
2371
2390
  return;
2372
2391
  }
2392
+ const { context, bounds } = activeCanvasInfo;
2373
2393
  let samplingX;
2374
2394
  let samplingY;
2375
- const colorFieldAndSliderRect = this.activeColorFieldAndSliderRect;
2376
2395
  const { clientX, clientY } = event;
2377
- if (this.colorFieldAndSliderHovered) {
2378
- samplingX = clientX - colorFieldAndSliderRect.x;
2379
- samplingY = clientY - colorFieldAndSliderRect.y;
2396
+ if (context.canvas.matches(":hover")) {
2397
+ samplingX = clientX - bounds.x;
2398
+ samplingY = clientY - bounds.y;
2380
2399
  }
2381
2400
  else {
2382
- const colorFieldWidth = dimensions.colorField.width;
2383
- const colorFieldHeight = dimensions.colorField.height;
2384
- const hueSliderHeight = dimensions.slider.height;
2385
- if (clientX < colorFieldAndSliderRect.x + colorFieldWidth &&
2386
- clientX > colorFieldAndSliderRect.x) {
2387
- samplingX = clientX - colorFieldAndSliderRect.x;
2401
+ // snap x and y to the closest edge
2402
+ if (clientX < bounds.x + bounds.width && clientX > bounds.x) {
2403
+ samplingX = clientX - bounds.x;
2388
2404
  }
2389
- else if (clientX < colorFieldAndSliderRect.x) {
2405
+ else if (clientX < bounds.x) {
2390
2406
  samplingX = 0;
2391
2407
  }
2392
2408
  else {
2393
- samplingX = colorFieldWidth - 1;
2409
+ samplingX = bounds.width;
2394
2410
  }
2395
- if (clientY < colorFieldAndSliderRect.y + colorFieldHeight + hueSliderHeight &&
2396
- clientY > colorFieldAndSliderRect.y) {
2397
- samplingY = clientY - colorFieldAndSliderRect.y;
2411
+ if (clientY < bounds.y + bounds.height && clientY > bounds.y) {
2412
+ samplingY = clientY - bounds.y;
2398
2413
  }
2399
- else if (clientY < colorFieldAndSliderRect.y) {
2414
+ else if (clientY < bounds.y) {
2400
2415
  samplingY = 0;
2401
2416
  }
2402
2417
  else {
2403
- samplingY = colorFieldHeight + hueSliderHeight;
2418
+ samplingY = bounds.height;
2404
2419
  }
2405
2420
  }
2406
- if (hueThumbDragging) {
2421
+ if (context === this.colorFieldRenderingContext) {
2407
2422
  this.captureColorFieldColor(samplingX, samplingY, false);
2408
2423
  }
2409
- else {
2424
+ else if (context === this.hueSliderRenderingContext) {
2410
2425
  this.captureHueSliderColor(samplingX);
2411
2426
  }
2412
- };
2413
- this.handleColorFieldAndSliderPointerEnterOrMove = ({ offsetX, offsetY }) => {
2414
- const { dimensions: { colorField, slider, thumb } } = this;
2415
- this.colorFieldAndSliderInteractive = offsetY <= colorField.height + slider.height;
2416
- this.colorFieldAndSliderHovered = true;
2417
- const region = this.getCanvasRegion(offsetY);
2418
- if (region === "color-field") {
2419
- const prevHueThumbState = this.hueThumbState;
2420
- const color = this.baseColorFieldColor.hsv();
2421
- const centerX = Math.round(color.saturationv() / (HSV_LIMITS.s / colorField.width));
2422
- const centerY = Math.round(colorField.height - color.value() / (HSV_LIMITS.v / colorField.height));
2423
- const hoveringThumb = this.containsPoint(offsetX, offsetY, centerX, centerY, thumb.radius);
2424
- let transitionedBetweenHoverAndIdle = false;
2425
- if (prevHueThumbState === "idle" && hoveringThumb) {
2426
- this.hueThumbState = "hover";
2427
- transitionedBetweenHoverAndIdle = true;
2428
- }
2429
- else if (prevHueThumbState === "hover" && !hoveringThumb) {
2430
- this.hueThumbState = "idle";
2431
- transitionedBetweenHoverAndIdle = true;
2432
- }
2433
- if (this.hueThumbState !== "drag") {
2434
- if (transitionedBetweenHoverAndIdle) {
2435
- // refresh since we won't update color and thus no redraw
2436
- this.drawColorFieldAndSlider();
2437
- }
2438
- }
2439
- }
2440
- else if (region === "slider") {
2441
- const sliderThumbColor = this.baseColorFieldColor.hsv().saturationv(100).value(100);
2442
- const prevSliderThumbState = this.sliderThumbState;
2443
- const sliderThumbCenterX = Math.round(sliderThumbColor.hue() / (360 / slider.width));
2444
- const sliderThumbCenterY = Math.round((slider.height + this.getSliderCapSpacing()) / 2) + colorField.height;
2445
- const hoveringSliderThumb = this.containsPoint(offsetX, offsetY, sliderThumbCenterX, sliderThumbCenterY, thumb.radius);
2446
- let sliderThumbTransitionedBetweenHoverAndIdle = false;
2447
- if (prevSliderThumbState === "idle" && hoveringSliderThumb) {
2448
- this.sliderThumbState = "hover";
2449
- sliderThumbTransitionedBetweenHoverAndIdle = true;
2450
- }
2451
- else if (prevSliderThumbState === "hover" && !hoveringSliderThumb) {
2452
- this.sliderThumbState = "idle";
2453
- sliderThumbTransitionedBetweenHoverAndIdle = true;
2454
- }
2455
- if (this.sliderThumbState !== "drag") {
2456
- if (sliderThumbTransitionedBetweenHoverAndIdle) {
2457
- // refresh since we won't update color and thus no redraw
2458
- this.drawColorFieldAndSlider();
2459
- }
2460
- }
2427
+ else if (context === this.opacitySliderRenderingContext) {
2428
+ this.captureOpacitySliderValue(samplingX);
2461
2429
  }
2462
2430
  };
2463
2431
  this.storeColorFieldScope = (node) => {
@@ -2473,23 +2441,35 @@ const ColorPicker = class {
2473
2441
  return (index.h("calcite-tab-title", { class: CSS$2.colorMode, "data-color-mode": channelMode, key: channelMode, onCalciteTabsActivate: this.handleTabActivate, selected: selected }, label));
2474
2442
  };
2475
2443
  this.renderChannelsTab = (channelMode) => {
2476
- const { channelMode: activeChannelMode, channels, messages } = this;
2444
+ const { allowEmpty, channelMode: activeChannelMode, channels, messages, alphaChannel } = this;
2477
2445
  const selected = channelMode === activeChannelMode;
2478
2446
  const isRgb = channelMode === "rgb";
2479
- const channelLabels = isRgb
2480
- ? [messages.r, messages.g, messages.b]
2481
- : [messages.h, messages.s, messages.v];
2482
2447
  const channelAriaLabels = isRgb
2483
2448
  ? [messages.red, messages.green, messages.blue]
2484
2449
  : [messages.hue, messages.saturation, messages.value];
2485
2450
  const direction = dom.getElementDir(this.el);
2486
- return (index.h("calcite-tab", { class: CSS$2.control, key: channelMode, selected: selected }, index.h("div", { class: CSS$2.channels, dir: "ltr" }, channels.map((channel, index) =>
2487
- /* the channel container is ltr, so we apply the host's direction */
2488
- this.renderChannel(channel, index, channelLabels[index], channelAriaLabels[index], direction)))));
2451
+ const channelsToRender = alphaChannel ? channels : channels.slice(0, 3);
2452
+ return (index.h("calcite-tab", { class: CSS$2.control, key: channelMode, selected: selected }, index.h("div", { class: CSS$2.channels, dir: "ltr" }, channelsToRender.map((channelValue, index) => {
2453
+ const isAlphaChannel = index === 3;
2454
+ if (isAlphaChannel) {
2455
+ channelValue =
2456
+ allowEmpty && !channelValue ? channelValue : utils.alphaToOpacity(channelValue);
2457
+ }
2458
+ /* the channel container is ltr, so we apply the host's direction */
2459
+ return this.renderChannel(channelValue, index, channelAriaLabels[index], direction, isAlphaChannel ? "%" : "");
2460
+ }))));
2461
+ };
2462
+ this.renderChannel = (value, index$1, ariaLabel, direction, suffix) => {
2463
+ return (index.h("calcite-input", { class: CSS$2.channel, "data-channel-index": index$1, dir: direction, key: index$1, 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",
2464
+ // workaround to ensure input borders overlap as desired
2465
+ // this is because the build transforms margin-left to its
2466
+ // logical-prop, which is undesired as channels are always ltr
2467
+ style: {
2468
+ marginLeft: index$1 > 0 && !(this.scale === "s" && this.alphaChannel && index$1 === 3) ? "-1px" : ""
2469
+ }, suffixText: suffix, type: "number", value: value?.toString() }));
2489
2470
  };
2490
- this.renderChannel = (value, index$1, label, ariaLabel, direction) => (index.h("calcite-input", { class: CSS$2.channel, "data-channel-index": index$1, 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() }));
2491
2471
  this.deleteColor = () => {
2492
- const colorToDelete = this.color.hex();
2472
+ const colorToDelete = utils.hexify(this.color, this.alphaChannel);
2493
2473
  const inStorage = this.savedColors.indexOf(colorToDelete) > -1;
2494
2474
  if (!inStorage) {
2495
2475
  return;
@@ -2502,7 +2482,7 @@ const ColorPicker = class {
2502
2482
  }
2503
2483
  };
2504
2484
  this.saveColor = () => {
2505
- const colorToSave = this.color.hex();
2485
+ const colorToSave = utils.hexify(this.color, this.alphaChannel);
2506
2486
  const alreadySaved = this.savedColors.indexOf(colorToSave) > -1;
2507
2487
  if (alreadySaved) {
2508
2488
  return;
@@ -2514,12 +2494,18 @@ const ColorPicker = class {
2514
2494
  localStorage.setItem(storageKey, JSON.stringify(savedColors));
2515
2495
  }
2516
2496
  };
2517
- this.drawColorFieldAndSlider = throttle.throttle(() => {
2518
- if (!this.fieldAndSliderRenderingContext) {
2519
- return;
2497
+ this.drawColorControls = throttle.throttle((type = "all") => {
2498
+ if ((type === "all" || type === "color-field") && this.colorFieldRenderingContext) {
2499
+ this.drawColorField();
2500
+ }
2501
+ if ((type === "all" || type === "hue-slider") && this.hueSliderRenderingContext) {
2502
+ this.drawHueSlider();
2503
+ }
2504
+ if (this.alphaChannel &&
2505
+ (type === "all" || type === "opacity-slider") &&
2506
+ this.opacitySliderRenderingContext) {
2507
+ this.drawOpacitySlider();
2520
2508
  }
2521
- this.drawColorField();
2522
- this.drawHueSlider();
2523
2509
  }, throttleFor60FpsInMs);
2524
2510
  this.captureColorFieldColor = (x, y, skipEqual = true) => {
2525
2511
  const { dimensions: { colorField: { height, width } } } = this;
@@ -2527,24 +2513,56 @@ const ColorPicker = class {
2527
2513
  const value = Math.round((HSV_LIMITS.v / height) * (height - y));
2528
2514
  this.internalColorSet(this.baseColorFieldColor.hsv().saturationv(saturation).value(value), skipEqual);
2529
2515
  };
2530
- this.initColorFieldAndSlider = (canvas) => {
2531
- this.fieldAndSliderRenderingContext = canvas.getContext("2d");
2532
- this.updateCanvasSize(canvas);
2516
+ this.initColorField = (canvas) => {
2517
+ this.colorFieldRenderingContext = canvas.getContext("2d");
2518
+ this.updateCanvasSize("color-field");
2519
+ this.drawColorControls();
2520
+ };
2521
+ this.initHueSlider = (canvas) => {
2522
+ this.hueSliderRenderingContext = canvas.getContext("2d");
2523
+ this.updateCanvasSize("hue-slider");
2524
+ this.drawHueSlider();
2525
+ };
2526
+ this.initOpacitySlider = (canvas) => {
2527
+ this.opacitySliderRenderingContext = canvas.getContext("2d");
2528
+ this.updateCanvasSize("opacity-slider");
2529
+ this.drawOpacitySlider();
2530
+ };
2531
+ this.storeOpacityScope = (node) => {
2532
+ this.opacityScopeNode = node;
2533
+ };
2534
+ this.handleOpacityScopeKeyDown = (event) => {
2535
+ const modifier = event.shiftKey ? 10 : 1;
2536
+ const { key } = event;
2537
+ const arrowKeyToXOffset = {
2538
+ ArrowUp: 1,
2539
+ ArrowRight: 1,
2540
+ ArrowDown: -1,
2541
+ ArrowLeft: -1
2542
+ };
2543
+ if (arrowKeyToXOffset[key]) {
2544
+ event.preventDefault();
2545
+ const delta = utils.opacityToAlpha(arrowKeyToXOffset[key] * modifier);
2546
+ this.captureHueSliderColor(this.opacityScopeLeft + delta);
2547
+ }
2533
2548
  };
2534
2549
  this.allowEmpty = false;
2550
+ this.alphaChannel = false;
2551
+ this.channelsDisabled = false;
2535
2552
  this.color = DEFAULT_COLOR$1;
2536
2553
  this.disabled = false;
2537
- this.format = defaultFormat;
2538
- this.hideHex = false;
2554
+ this.format = "auto";
2539
2555
  this.hideChannels = false;
2556
+ this.hexDisabled = false;
2557
+ this.hideHex = false;
2540
2558
  this.hideSaved = false;
2559
+ this.savedDisabled = false;
2541
2560
  this.scale = "m";
2542
2561
  this.storageId = undefined;
2543
2562
  this.messageOverrides = undefined;
2544
2563
  this.numberingSystem = undefined;
2545
- this.value = defaultValue;
2564
+ this.value = utils.normalizeHex(utils.hexify(DEFAULT_COLOR$1, this.alphaChannel));
2546
2565
  this.defaultMessages = undefined;
2547
- this.colorFieldAndSliderInteractive = false;
2548
2566
  this.channelMode = "rgb";
2549
2567
  this.channels = this.toChannels(DEFAULT_COLOR$1);
2550
2568
  this.dimensions = DIMENSIONS.m;
@@ -2553,12 +2571,19 @@ const ColorPicker = class {
2553
2571
  this.savedColors = [];
2554
2572
  this.colorFieldScopeTop = undefined;
2555
2573
  this.colorFieldScopeLeft = undefined;
2556
- this.scopeOrientation = undefined;
2557
2574
  this.hueScopeLeft = undefined;
2558
- this.hueScopeTop = undefined;
2575
+ this.opacityScopeLeft = undefined;
2576
+ this.scopeOrientation = undefined;
2577
+ }
2578
+ handleAlphaChannelChange(alphaChannel) {
2579
+ const { format } = this;
2580
+ if (alphaChannel && format !== "auto" && !utils.alphaCompatible(format)) {
2581
+ console.warn(`ignoring alphaChannel as the current format (${format}) does not support alpha`);
2582
+ this.alphaChannel = false;
2583
+ }
2559
2584
  }
2560
2585
  handleColorChange(color, oldColor) {
2561
- this.drawColorFieldAndSlider();
2586
+ this.drawColorControls();
2562
2587
  this.updateChannelsFromColor(color);
2563
2588
  this.previousColor = oldColor;
2564
2589
  }
@@ -2568,7 +2593,8 @@ const ColorPicker = class {
2568
2593
  }
2569
2594
  handleScaleChange(scale = "m") {
2570
2595
  this.updateDimensions(scale);
2571
- this.updateCanvasSize(this.fieldAndSliderRenderingContext?.canvas);
2596
+ this.updateCanvasSize("all");
2597
+ this.drawColorControls();
2572
2598
  }
2573
2599
  onMessagesChange() {
2574
2600
  /* wired up by t9n util */
@@ -2585,9 +2611,9 @@ const ColorPicker = class {
2585
2611
  return;
2586
2612
  }
2587
2613
  modeChanged = this.mode !== nextMode;
2588
- this.setMode(nextMode);
2614
+ this.setMode(nextMode, this.internalColorUpdateContext === null);
2589
2615
  }
2590
- const dragging = this.sliderThumbState === "drag" || this.hueThumbState === "drag";
2616
+ const dragging = this.activeCanvasInfo;
2591
2617
  if (this.internalColorUpdateContext === "initial") {
2592
2618
  return;
2593
2619
  }
@@ -2598,17 +2624,16 @@ const ColorPicker = class {
2598
2624
  }
2599
2625
  return;
2600
2626
  }
2601
- const color$1 = allowEmpty && !value ? null : color(value);
2627
+ const color$1 = allowEmpty && !value
2628
+ ? null
2629
+ : color(value != null && typeof value === "object" && utils.alphaCompatible(this.mode)
2630
+ ? utils.normalizeColor(value)
2631
+ : value);
2602
2632
  const colorChanged = !utils.colorEqual(color$1, this.color);
2603
2633
  if (modeChanged || colorChanged) {
2604
- this.internalColorSet(color$1, true, "internal");
2634
+ this.internalColorSet(color$1, this.alphaChannel && !(this.mode.endsWith("a") || this.mode.endsWith("a-css")), "internal");
2605
2635
  }
2606
2636
  }
2607
- //--------------------------------------------------------------------------
2608
- //
2609
- // Internal State/Props
2610
- //
2611
- //--------------------------------------------------------------------------
2612
2637
  get baseColorFieldColor() {
2613
2638
  return this.color || this.previousColor || DEFAULT_COLOR$1;
2614
2639
  }
@@ -2664,7 +2689,7 @@ const ColorPicker = class {
2664
2689
  if (!valueIsCompatible) {
2665
2690
  this.showIncompatibleColorWarning(value, format);
2666
2691
  }
2667
- this.setMode(format);
2692
+ this.setMode(format, false);
2668
2693
  this.internalColorSet(initialColor, false, "initial");
2669
2694
  this.updateDimensions(this.scale);
2670
2695
  const storageKey = `${DEFAULT_STORAGE_KEY_PREFIX}${this.storageId}`;
@@ -2695,34 +2720,38 @@ const ColorPicker = class {
2695
2720
  //
2696
2721
  //--------------------------------------------------------------------------
2697
2722
  render() {
2698
- const { allowEmpty, color, messages, hideHex, hideChannels, hideSaved, savedColors, scale } = this;
2699
- const selectedColorInHex = color ? color.hex() : null;
2700
- const hexInputScale = scale === "l" ? "m" : "s";
2701
- const { colorFieldAndSliderInteractive, colorFieldScopeTop, colorFieldScopeLeft, hueScopeLeft, hueScopeTop, scopeOrientation, dimensions: { colorField: { height: colorFieldHeight, width: colorFieldWidth }, slider: { height: sliderHeight } } } = this;
2702
- const hueTop = hueScopeTop ?? sliderHeight / 2 + colorFieldHeight;
2703
- const hueLeft = hueScopeLeft ?? (colorFieldWidth * DEFAULT_COLOR$1.hue()) / HSV_LIMITS.h;
2723
+ 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;
2724
+ const selectedColorInHex = color ? utils.hexify(color, alphaChannel) : null;
2725
+ const hueTop = thumbRadius;
2726
+ const hueLeft = hueScopeLeft ?? (sliderWidth * DEFAULT_COLOR$1.hue()) / HSV_LIMITS.h;
2727
+ const opacityTop = thumbRadius;
2728
+ const opacityLeft = opacityScopeLeft ??
2729
+ (colorFieldWidth * utils.alphaToOpacity(DEFAULT_COLOR$1.alpha())) / OPACITY_LIMITS.max;
2704
2730
  const noColor = color === null;
2705
2731
  const vertical = scopeOrientation === "vertical";
2706
- return (index.h("div", { class: CSS$2.container }, index.h("div", { class: CSS$2.colorFieldAndSliderWrap }, index.h("canvas", { class: {
2707
- [CSS$2.colorFieldAndSlider]: true,
2708
- [CSS$2.colorFieldAndSliderInteractive]: colorFieldAndSliderInteractive
2709
- }, onPointerDown: this.handleColorFieldAndSliderPointerDown, onPointerEnter: this.handleColorFieldAndSliderPointerEnterOrMove, onPointerLeave: this.handleColorFieldAndSliderPointerLeave, onPointerMove: this.handleColorFieldAndSliderPointerEnterOrMove,
2732
+ const noHex = hexDisabled || hideHex;
2733
+ const noChannels = channelsDisabled || hideChannels;
2734
+ const noSaved = savedDisabled || hideSaved;
2735
+ return (index.h("div", { class: CSS$2.container }, index.h("div", { class: CSS$2.controlAndScope }, index.h("canvas", { class: CSS$2.colorField, onPointerDown: this.handleColorFieldPointerDown,
2736
+ // eslint-disable-next-line react/jsx-sort-props
2737
+ ref: this.initColorField }), index.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$2.scope]: true, [CSS$2.colorFieldScope]: true }, onKeyDown: this.handleColorFieldScopeKeyDown, role: "slider", style: { top: `${colorFieldScopeTop || 0}px`, left: `${colorFieldScopeLeft || 0}px` }, tabindex: "0",
2738
+ // eslint-disable-next-line react/jsx-sort-props
2739
+ ref: this.storeColorFieldScope })), index.h("div", { class: CSS$2.previewAndSliders }, index.h("calcite-color-picker-swatch", { class: CSS$2.preview, color: selectedColorInHex, scale: "l" }), index.h("div", { class: CSS$2.sliders }, index.h("div", { class: CSS$2.controlAndScope }, index.h("canvas", { class: { [CSS$2.slider]: true, [CSS$2.hueSlider]: true }, onPointerDown: this.handleHueSliderPointerDown,
2710
2740
  // eslint-disable-next-line react/jsx-sort-props
2711
- ref: this.initColorFieldAndSlider }), index.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$2.scope]: true, [CSS$2.colorFieldScope]: true }, onKeyDown: this.handleColorFieldScopeKeyDown, role: "slider", style: { top: `${colorFieldScopeTop || 0}px`, left: `${colorFieldScopeLeft || 0}px` }, tabindex: "0",
2741
+ ref: this.initHueSlider }), index.h("div", { "aria-label": messages.hue, "aria-valuemax": HSV_LIMITS.h, "aria-valuemin": "0", "aria-valuenow": color?.round().hue() || DEFAULT_COLOR$1.round().hue(), class: { [CSS$2.scope]: true, [CSS$2.hueScope]: true }, onKeyDown: this.handleHueScopeKeyDown, role: "slider", style: { top: `${hueTop}px`, left: `${hueLeft}px` }, tabindex: "0",
2712
2742
  // eslint-disable-next-line react/jsx-sort-props
2713
- ref: this.storeColorFieldScope }), index.h("div", { "aria-label": messages.hue, "aria-valuemax": HSV_LIMITS.h, "aria-valuemin": "0", "aria-valuenow": color?.round().hue() || DEFAULT_COLOR$1.round().hue(), class: { [CSS$2.scope]: true, [CSS$2.hueScope]: true }, onKeyDown: this.handleHueScopeKeyDown, role: "slider", style: { top: `${hueTop}px`, left: `${hueLeft}px` }, tabindex: "0",
2743
+ ref: this.storeHueScope })), alphaChannel ? (index.h("div", { class: CSS$2.controlAndScope }, index.h("canvas", { class: { [CSS$2.slider]: true, [CSS$2.opacitySlider]: true }, onPointerDown: this.handleOpacitySliderPointerDown,
2714
2744
  // eslint-disable-next-line react/jsx-sort-props
2715
- ref: this.storeHueScope })), hideHex && hideChannels ? null : (index.h("div", { class: {
2745
+ ref: this.initOpacitySlider }), index.h("div", { "aria-label": messages.opacity, "aria-valuemax": OPACITY_LIMITS.max, "aria-valuemin": OPACITY_LIMITS.min, "aria-valuenow": (color || DEFAULT_COLOR$1).round().alpha(), class: { [CSS$2.scope]: true, [CSS$2.opacityScope]: true }, onKeyDown: this.handleOpacityScopeKeyDown, role: "slider", style: { top: `${opacityTop}px`, left: `${opacityLeft}px` }, tabindex: "0",
2746
+ // eslint-disable-next-line react/jsx-sort-props
2747
+ ref: this.storeOpacityScope }))) : null)), noHex && noChannels ? null : (index.h("div", { class: {
2716
2748
  [CSS$2.controlSection]: true,
2717
2749
  [CSS$2.section]: true
2718
- } }, hideHex ? null : (index.h("div", { class: CSS$2.hexOptions }, index.h("span", { class: {
2719
- [CSS$2.header]: true,
2720
- [CSS$2.headerHex]: true
2721
- } }, messages.hex), index.h("calcite-color-picker-hex-input", { allowEmpty: allowEmpty, class: CSS$2.control, hexLabel: messages.hex, numberingSystem: this.numberingSystem, onCalciteColorPickerHexInputChange: this.handleHexInputChange, scale: hexInputScale, value: selectedColorInHex }))), hideChannels ? null : (index.h("calcite-tabs", { class: {
2750
+ } }, index.h("div", { class: CSS$2.hexAndChannelsGroup }, noHex ? null : (index.h("div", { class: CSS$2.hexOptions }, index.h("calcite-color-picker-hex-input", { allowEmpty: allowEmpty, alphaChannel: alphaChannel, class: CSS$2.control, messages: messages, numberingSystem: this.numberingSystem, onCalciteColorPickerHexInputChange: this.handleHexInputChange, scale: scale, value: selectedColorInHex }))), noChannels ? null : (index.h("calcite-tabs", { class: {
2722
2751
  [CSS$2.colorModeContainer]: true,
2723
2752
  [CSS$2.splitSection]: true
2724
- }, scale: hexInputScale }, index.h("calcite-tab-nav", { slot: "title-group" }, this.renderChannelsTabTitle("rgb"), this.renderChannelsTabTitle("hsv")), this.renderChannelsTab("rgb"), this.renderChannelsTab("hsv"))))), hideSaved ? null : (index.h("div", { class: { [CSS$2.savedColorsSection]: true, [CSS$2.section]: true } }, index.h("div", { class: CSS$2.header }, index.h("label", null, messages.saved), index.h("div", { class: CSS$2.savedColorsButtons }, index.h("calcite-button", { appearance: "transparent", class: CSS$2.deleteColor, disabled: noColor, iconStart: "minus", kind: "neutral", label: messages.deleteColor, onClick: this.deleteColor, scale: hexInputScale, type: "button" }), index.h("calcite-button", { appearance: "transparent", class: CSS$2.saveColor, disabled: noColor, iconStart: "plus", kind: "neutral", label: messages.saveColor, onClick: this.saveColor, scale: hexInputScale, type: "button" }))), savedColors.length > 0 ? (index.h("div", { class: CSS$2.savedColors }, [
2725
- ...savedColors.map((color) => (index.h("calcite-color-picker-swatch", { active: selectedColorInHex === color, class: CSS$2.savedColor, color: color, key: color, onClick: this.handleSavedColorSelect, onKeyDown: this.handleSavedColorKeyDown, scale: scale, tabIndex: 0 })))
2753
+ }, scale: scale === "l" ? "m" : "s" }, index.h("calcite-tab-nav", { slot: "title-group" }, this.renderChannelsTabTitle("rgb"), this.renderChannelsTabTitle("hsv")), this.renderChannelsTab("rgb"), this.renderChannelsTab("hsv")))))), noSaved ? null : (index.h("div", { class: { [CSS$2.savedColorsSection]: true, [CSS$2.section]: true } }, index.h("div", { class: CSS$2.header }, index.h("label", null, messages.saved), index.h("div", { class: CSS$2.savedColorsButtons }, index.h("calcite-button", { appearance: "transparent", class: CSS$2.deleteColor, disabled: noColor, iconStart: "minus", kind: "neutral", label: messages.deleteColor, onClick: this.deleteColor, scale: scale, type: "button" }), index.h("calcite-button", { appearance: "transparent", class: CSS$2.saveColor, disabled: noColor, iconStart: "plus", kind: "neutral", label: messages.saveColor, onClick: this.saveColor, scale: scale, type: "button" }))), savedColors.length > 0 ? (index.h("div", { class: CSS$2.savedColors }, [
2754
+ ...savedColors.map((color) => (index.h("calcite-color-picker-swatch", { class: CSS$2.savedColor, color: color, key: color, onClick: this.handleSavedColorSelect, onKeyDown: this.handleSavedColorKeyDown, scale: scale, tabIndex: 0 })))
2726
2755
  ])) : null))));
2727
2756
  }
2728
2757
  // --------------------------------------------------------------------------
@@ -2738,23 +2767,38 @@ const ColorPicker = class {
2738
2767
  showIncompatibleColorWarning(value, format) {
2739
2768
  console.warn(`ignoring color value (${value}) as it is not compatible with the current format (${format})`);
2740
2769
  }
2741
- setMode(format) {
2742
- this.mode = format === "auto" ? this.mode : format;
2770
+ setMode(format, warn = true) {
2771
+ const mode = format === "auto" ? this.mode : format;
2772
+ this.mode = this.ensureCompatibleMode(mode, warn);
2773
+ }
2774
+ ensureCompatibleMode(mode, warn) {
2775
+ const { alphaChannel } = this;
2776
+ const isAlphaCompatible = utils.alphaCompatible(mode);
2777
+ if (alphaChannel && !isAlphaCompatible) {
2778
+ const alphaMode = utils.toAlphaMode(mode);
2779
+ if (warn) {
2780
+ console.warn(`setting format to (${alphaMode}) as the provided one (${mode}) does not support alpha`);
2781
+ }
2782
+ return alphaMode;
2783
+ }
2784
+ if (!alphaChannel && isAlphaCompatible) {
2785
+ const nonAlphaMode = utils.toNonAlphaMode(mode);
2786
+ if (warn) {
2787
+ console.warn(`setting format to (${nonAlphaMode}) as the provided one (${mode}) does not support alpha`);
2788
+ }
2789
+ return nonAlphaMode;
2790
+ }
2791
+ return mode;
2743
2792
  }
2744
2793
  captureHueSliderColor(x) {
2745
2794
  const { dimensions: { slider: { width } } } = this;
2746
2795
  const hue = (360 / width) * x;
2747
2796
  this.internalColorSet(this.baseColorFieldColor.hue(hue), false);
2748
2797
  }
2749
- getCanvasRegion(y) {
2750
- const { dimensions: { colorField: { height: colorFieldHeight }, slider: { height: sliderHeight } } } = this;
2751
- if (y <= colorFieldHeight) {
2752
- return "color-field";
2753
- }
2754
- if (y <= colorFieldHeight + sliderHeight) {
2755
- return "slider";
2756
- }
2757
- return "none";
2798
+ captureOpacitySliderValue(x) {
2799
+ const { dimensions: { slider: { width } } } = this;
2800
+ const alpha = utils.opacityToAlpha((OPACITY_LIMITS.max / width) * x);
2801
+ this.internalColorSet(this.baseColorFieldColor.alpha(alpha), false);
2758
2802
  }
2759
2803
  internalColorSet(color, skipEqual = true, context = "user-interaction") {
2760
2804
  if (skipEqual && utils.colorEqual(color, this.color)) {
@@ -2771,16 +2815,25 @@ const ColorPicker = class {
2771
2815
  }
2772
2816
  const hexMode = "hex";
2773
2817
  if (format.includes(hexMode)) {
2774
- return utils.normalizeHex(color.round()[hexMode]());
2818
+ const hasAlpha = format === utils.CSSColorMode.HEXA;
2819
+ return utils.normalizeHex(utils.hexify(color.round(), hasAlpha), hasAlpha);
2775
2820
  }
2776
2821
  if (format.includes("-css")) {
2777
- return color[format.replace("-css", "").replace("a", "")]().round().string();
2822
+ const value = color[format.replace("-css", "").replace("a", "")]().round().string();
2823
+ // Color omits alpha values when alpha is 1
2824
+ const needToInjectAlpha = (format.endsWith("a") || format.endsWith("a-css")) && color.alpha() === 1;
2825
+ if (needToInjectAlpha) {
2826
+ const model = value.slice(0, 3);
2827
+ const values = value.slice(4, -1);
2828
+ return `${model}a(${values}, ${color.alpha()})`;
2829
+ }
2830
+ return value;
2778
2831
  }
2779
- const colorObject = color[format]().round().object();
2832
+ const colorObject =
2833
+ /* Color() does not support hsva, hsla nor rgba, so we use the non-alpha mode */
2834
+ color[utils.toNonAlphaMode(format)]().round().object();
2780
2835
  if (format.endsWith("a")) {
2781
- // normalize alpha prop
2782
- colorObject.a = colorObject.alpha;
2783
- delete colorObject.alpha;
2836
+ return utils.normalizeAlpha(colorObject);
2784
2837
  }
2785
2838
  return colorObject;
2786
2839
  }
@@ -2792,9 +2845,14 @@ const ColorPicker = class {
2792
2845
  this.dimensions = DIMENSIONS[scale];
2793
2846
  }
2794
2847
  drawColorField() {
2795
- const context = this.fieldAndSliderRenderingContext;
2848
+ const context = this.colorFieldRenderingContext;
2796
2849
  const { dimensions: { colorField: { height, width } } } = this;
2797
- context.fillStyle = this.baseColorFieldColor.hsv().saturationv(100).value(100).string();
2850
+ context.fillStyle = this.baseColorFieldColor
2851
+ .hsv()
2852
+ .saturationv(100)
2853
+ .value(100)
2854
+ .alpha(1)
2855
+ .string();
2798
2856
  context.fillRect(0, 0, width, height);
2799
2857
  const whiteGradient = context.createLinearGradient(0, 0, width, 0);
2800
2858
  whiteGradient.addColorStop(0, "rgba(255,255,255,1)");
@@ -2809,6 +2867,9 @@ const ColorPicker = class {
2809
2867
  this.drawActiveColorFieldColor();
2810
2868
  }
2811
2869
  setCanvasContextSize(canvas, { height, width }) {
2870
+ if (!canvas) {
2871
+ return;
2872
+ }
2812
2873
  const devicePixelRatio = window.devicePixelRatio || 1;
2813
2874
  canvas.width = width * devicePixelRatio;
2814
2875
  canvas.height = height * devicePixelRatio;
@@ -2817,21 +2878,21 @@ const ColorPicker = class {
2817
2878
  const context = canvas.getContext("2d");
2818
2879
  context.scale(devicePixelRatio, devicePixelRatio);
2819
2880
  }
2820
- updateCanvasSize(canvas) {
2821
- if (!canvas) {
2822
- return;
2881
+ updateCanvasSize(context = "all") {
2882
+ const { dimensions } = this;
2883
+ if (context === "all" || context === "color-field") {
2884
+ this.setCanvasContextSize(this.colorFieldRenderingContext?.canvas, dimensions.colorField);
2885
+ }
2886
+ const adjustedSliderDimensions = {
2887
+ width: dimensions.slider.width,
2888
+ height: dimensions.slider.height + (dimensions.thumb.radius - dimensions.slider.height / 2) * 2
2889
+ };
2890
+ if (context === "all" || context === "hue-slider") {
2891
+ this.setCanvasContextSize(this.hueSliderRenderingContext?.canvas, adjustedSliderDimensions);
2892
+ }
2893
+ if (context === "all" || context === "opacity-slider") {
2894
+ this.setCanvasContextSize(this.opacitySliderRenderingContext?.canvas, adjustedSliderDimensions);
2823
2895
  }
2824
- this.setCanvasContextSize(canvas, {
2825
- width: this.dimensions.colorField.width,
2826
- height: this.dimensions.colorField.height +
2827
- this.dimensions.slider.height +
2828
- this.getSliderCapSpacing() * 2
2829
- });
2830
- this.drawColorFieldAndSlider();
2831
- }
2832
- containsPoint(testPointX, testPointY, boundsX, boundsY, boundsRadius) {
2833
- return (Math.pow(testPointX - boundsX, 2) + Math.pow(testPointY - boundsY, 2) <=
2834
- Math.pow(boundsRadius, 2));
2835
2896
  }
2836
2897
  drawActiveColorFieldColor() {
2837
2898
  const { color } = this;
@@ -2846,22 +2907,23 @@ const ColorPicker = class {
2846
2907
  this.colorFieldScopeLeft = x;
2847
2908
  this.colorFieldScopeTop = y;
2848
2909
  });
2849
- this.drawThumb(this.fieldAndSliderRenderingContext, radius, x, y, hsvColor, this.hueThumbState);
2910
+ this.drawThumb(this.colorFieldRenderingContext, radius, x, y, hsvColor);
2850
2911
  }
2851
- drawThumb(context, radius, x, y, color, state) {
2912
+ drawThumb(context, radius, x, y, color) {
2852
2913
  const startAngle = 0;
2853
2914
  const endAngle = 2 * Math.PI;
2915
+ const outlineWidth = 1;
2916
+ radius = radius - outlineWidth;
2854
2917
  context.beginPath();
2855
2918
  context.arc(x, y, radius, startAngle, endAngle);
2856
- context.shadowBlur = state === "hover" ? 32 : 16;
2857
- context.shadowColor = `rgba(0, 0, 0, ${state === "drag" ? 0.32 : 0.16})`;
2858
2919
  context.fillStyle = "#fff";
2859
2920
  context.fill();
2921
+ context.strokeStyle = "rgba(0,0,0,0.3)";
2922
+ context.lineWidth = outlineWidth;
2923
+ context.stroke();
2860
2924
  context.beginPath();
2861
2925
  context.arc(x, y, radius - 3, startAngle, endAngle);
2862
- context.shadowBlur = 0;
2863
- context.shadowColor = "transparent";
2864
- context.fillStyle = color.rgb().string();
2926
+ context.fillStyle = color.rgb().alpha(1).string();
2865
2927
  context.fill();
2866
2928
  }
2867
2929
  drawActiveHueSliderColor() {
@@ -2870,18 +2932,19 @@ const ColorPicker = class {
2870
2932
  return;
2871
2933
  }
2872
2934
  const hsvColor = color.hsv().saturationv(100).value(100);
2873
- const { dimensions: { colorField: { height: colorFieldHeight }, slider: { height, width }, thumb: { radius } } } = this;
2935
+ const { dimensions: { slider: { height, width }, thumb: { radius } } } = this;
2874
2936
  const x = hsvColor.hue() / (360 / width);
2875
- const y = height / 2 + colorFieldHeight;
2937
+ const y = radius - height / 2 + height / 2;
2876
2938
  requestAnimationFrame(() => {
2877
2939
  this.hueScopeLeft = x;
2878
- this.hueScopeTop = y;
2879
2940
  });
2880
- this.drawThumb(this.fieldAndSliderRenderingContext, radius, x, y, hsvColor, this.sliderThumbState);
2941
+ this.drawThumb(this.hueSliderRenderingContext, radius, x, y, hsvColor);
2881
2942
  }
2882
2943
  drawHueSlider() {
2883
- const context = this.fieldAndSliderRenderingContext;
2884
- const { dimensions: { colorField: { height: colorFieldHeight }, slider: { height, width } } } = this;
2944
+ const context = this.hueSliderRenderingContext;
2945
+ const { dimensions: { slider: { height, width }, thumb: { radius: thumbRadius } } } = this;
2946
+ const x = 0;
2947
+ const y = thumbRadius - height / 2;
2885
2948
  const gradient = context.createLinearGradient(0, 0, width, 0);
2886
2949
  const hueSliderColorStopKeywords = ["red", "yellow", "lime", "cyan", "blue", "magenta", "red"];
2887
2950
  const offset = 1 / (hueSliderColorStopKeywords.length - 1);
@@ -2890,27 +2953,107 @@ const ColorPicker = class {
2890
2953
  gradient.addColorStop(currentOffset, color(keyword).string());
2891
2954
  currentOffset += offset;
2892
2955
  });
2956
+ context.clearRect(0, 0, width, height + this.getSliderCapSpacing() * 2);
2957
+ this.drawSliderPath(context, height, width, x, y);
2893
2958
  context.fillStyle = gradient;
2894
- context.clearRect(0, colorFieldHeight, width, height + this.getSliderCapSpacing() * 2);
2895
- context.fillRect(0, colorFieldHeight, width, height);
2959
+ context.fill();
2960
+ context.strokeStyle = "rgba(0,0,0,0.3)";
2961
+ context.lineWidth = 1;
2962
+ context.stroke();
2896
2963
  this.drawActiveHueSliderColor();
2897
2964
  }
2965
+ drawOpacitySlider() {
2966
+ const context = this.opacitySliderRenderingContext;
2967
+ const { baseColorFieldColor: previousColor, dimensions: { slider: { height, width }, thumb: { radius: thumbRadius } } } = this;
2968
+ const x = 0;
2969
+ const y = thumbRadius - height / 2;
2970
+ context.clearRect(0, 0, width, height + this.getSliderCapSpacing() * 2);
2971
+ const gradient = context.createLinearGradient(0, y, width, 0);
2972
+ const startColor = previousColor.rgb().alpha(0);
2973
+ const midColor = previousColor.rgb().alpha(0.5);
2974
+ const endColor = previousColor.rgb().alpha(1);
2975
+ gradient.addColorStop(0, startColor.string());
2976
+ gradient.addColorStop(0.5, midColor.string());
2977
+ gradient.addColorStop(1, endColor.string());
2978
+ this.drawSliderPath(context, height, width, x, y);
2979
+ const pattern = context.createPattern(this.getCheckeredBackgroundPattern(), "repeat");
2980
+ context.fillStyle = pattern;
2981
+ context.fill();
2982
+ context.fillStyle = gradient;
2983
+ context.fill();
2984
+ context.strokeStyle = "rgba(0,0,0,0.3)";
2985
+ context.lineWidth = 1;
2986
+ context.stroke();
2987
+ this.drawActiveOpacitySliderColor();
2988
+ }
2989
+ drawSliderPath(context, height, width, x, y) {
2990
+ const radius = height / 2 + 1;
2991
+ context.beginPath();
2992
+ context.moveTo(x + radius, y);
2993
+ context.lineTo(x + width - radius, y);
2994
+ context.quadraticCurveTo(x + width, y, x + width, y + radius);
2995
+ context.lineTo(x + width, y + height - radius);
2996
+ context.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);
2997
+ context.lineTo(x + radius, y + height);
2998
+ context.quadraticCurveTo(x, y + height, x, y + height - radius);
2999
+ context.lineTo(x, y + radius);
3000
+ context.quadraticCurveTo(x, y, x + radius, y);
3001
+ context.closePath();
3002
+ }
3003
+ getCheckeredBackgroundPattern() {
3004
+ if (this.checkerPattern) {
3005
+ return this.checkerPattern;
3006
+ }
3007
+ const pattern = document.createElement("canvas");
3008
+ pattern.width = 10;
3009
+ pattern.height = 10;
3010
+ const patternContext = pattern.getContext("2d");
3011
+ patternContext.fillStyle = "#ccc";
3012
+ patternContext.fillRect(0, 0, 10, 10);
3013
+ patternContext.fillStyle = "#fff";
3014
+ patternContext.fillRect(0, 0, 5, 5);
3015
+ patternContext.fillRect(5, 5, 5, 5);
3016
+ this.checkerPattern = pattern;
3017
+ return pattern;
3018
+ }
3019
+ drawActiveOpacitySliderColor() {
3020
+ const { color } = this;
3021
+ if (!color) {
3022
+ return;
3023
+ }
3024
+ const hsvColor = color;
3025
+ const { dimensions: { slider: { width }, thumb: { radius } } } = this;
3026
+ const x = utils.alphaToOpacity(hsvColor.alpha()) / (OPACITY_LIMITS.max / width);
3027
+ const y = radius;
3028
+ requestAnimationFrame(() => {
3029
+ this.opacityScopeLeft = x;
3030
+ });
3031
+ this.drawThumb(this.opacitySliderRenderingContext, radius, x, y, hsvColor);
3032
+ }
2898
3033
  updateColorFromChannels(channels) {
2899
3034
  this.internalColorSet(color(channels, this.channelMode));
2900
3035
  }
2901
3036
  updateChannelsFromColor(color) {
2902
- this.channels = color ? this.toChannels(color) : [null, null, null];
3037
+ this.channels = color ? this.toChannels(color) : [null, null, null, null];
2903
3038
  }
2904
3039
  toChannels(color) {
2905
3040
  const { channelMode } = this;
2906
- return color[channelMode]()
3041
+ const channels = color[channelMode]()
2907
3042
  .array()
2908
- .map((value) => Math.floor(value));
3043
+ .map((value, index) => {
3044
+ const isAlpha = index === 3;
3045
+ return isAlpha ? value : Math.floor(value);
3046
+ });
3047
+ if (channels.length === 3) {
3048
+ channels.push(1); // Color omits alpha when 1
3049
+ }
3050
+ return channels;
2909
3051
  }
2910
3052
  static get delegatesFocus() { return true; }
2911
3053
  static get assetsDirs() { return ["assets"]; }
2912
3054
  get el() { return index.getElement(this); }
2913
3055
  static get watchers() { return {
3056
+ "alphaChannel": ["handleAlphaChannelChange"],
2914
3057
  "color": ["handleColorChange"],
2915
3058
  "format": ["handleFormatChange"],
2916
3059
  "scale": ["handleScaleChange"],
@@ -2923,43 +3066,131 @@ ColorPicker.style = colorPickerCss;
2923
3066
 
2924
3067
  const CSS$1 = {
2925
3068
  container: "container",
2926
- preview: "preview",
2927
- input: "input"
3069
+ hexInput: "hex-input",
3070
+ opacityInput: "opacity-input"
2928
3071
  };
2929
3072
 
2930
- const colorPickerHexInputCss = "@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host{display:block}.container{display:inline-grid;inline-size:100%;align-items:center;grid-template-columns:1fr auto}.preview{grid-column:2/3;pointer-events:none;margin-block:0px;margin-inline:0.25rem;display:flex;align-items:center}.preview,.input{grid-row:1}.input{grid-column:1/3;inline-size:100%;text-transform:uppercase}";
3073
+ const colorPickerHexInputCss = "@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-right{0%{opacity:0;transform:translate3D(-5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-left{0%{opacity:0;transform:translate3D(5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-right{animation-name:in-right}.calcite-animate__in-left{animation-name:in-left}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host{display:block}.container{display:flex;inline-size:100%;flex-wrap:nowrap;align-items:center}.hex-input{flex-grow:1;text-transform:uppercase}.opacity-input{inline-size:68px;margin-inline-start:-1px}:host([scale=s]) .container{flex-wrap:wrap;row-gap:0.125rem}:host([scale=s]) .opacity-input{inline-size:unset;margin-inline-start:unset}:host([scale=l]) .opacity-input{inline-size:88px}";
2931
3074
 
2932
3075
  const DEFAULT_COLOR = color();
2933
3076
  const ColorPickerHexInput = class {
2934
3077
  constructor(hostRef) {
2935
3078
  index.registerInstance(this, hostRef);
2936
3079
  this.calciteColorPickerHexInputChange = index.createEvent(this, "calciteColorPickerHexInputChange", 6);
2937
- this.onCalciteInternalInputBlur = () => {
2938
- const node = this.inputNode;
3080
+ this.onHexInputBlur = () => {
3081
+ const node = this.hexInputNode;
2939
3082
  const inputValue = node.value;
2940
3083
  const hex = `#${inputValue}`;
2941
- const willClearValue = this.allowEmpty && !inputValue;
2942
- if (willClearValue || (utils.isValidHex(hex) && utils.isLonghandHex(hex))) {
3084
+ const { allowEmpty, internalColor } = this;
3085
+ const willClearValue = allowEmpty && !inputValue;
3086
+ const isLonghand = utils.isLonghandHex(hex);
3087
+ if (willClearValue || (utils.isValidHex(hex) && isLonghand)) {
2943
3088
  return;
2944
3089
  }
2945
3090
  // manipulating DOM directly since rerender doesn't update input value
2946
3091
  node.value =
2947
- this.allowEmpty && !this.internalColor
3092
+ allowEmpty && !internalColor
2948
3093
  ? ""
2949
- : this.formatForInternalInput(utils.rgbToHex(this.internalColor.object()));
3094
+ : this.formatHexForInternalInput(utils.rgbToHex(
3095
+ // always display hex input in RRGGBB format
3096
+ internalColor.object()));
3097
+ };
3098
+ this.onOpacityInputBlur = () => {
3099
+ const node = this.opacityInputNode;
3100
+ const inputValue = node.value;
3101
+ const { allowEmpty, internalColor } = this;
3102
+ const willClearValue = allowEmpty && !inputValue;
3103
+ if (willClearValue) {
3104
+ return;
3105
+ }
3106
+ // manipulating DOM directly since rerender doesn't update input value
3107
+ node.value =
3108
+ allowEmpty && !internalColor ? "" : this.formatOpacityForInternalInput(internalColor);
3109
+ };
3110
+ this.onHexInputChange = () => {
3111
+ const nodeValue = this.hexInputNode.value;
3112
+ let value = nodeValue;
3113
+ if (value) {
3114
+ const normalized = utils.normalizeHex(value, false);
3115
+ const preserveExistingAlpha = utils.isValidHex(normalized) && this.alphaChannel;
3116
+ if (preserveExistingAlpha && this.internalColor) {
3117
+ const alphaHex = utils.normalizeHex(this.internalColor.hexa(), true).slice(-2);
3118
+ value = `${normalized + alphaHex}`;
3119
+ }
3120
+ }
3121
+ this.internalSetValue(value, this.value);
2950
3122
  };
2951
- this.onInputChange = () => {
2952
- this.internalSetValue(this.inputNode.value, this.value);
3123
+ this.onOpacityInputChange = () => {
3124
+ const node = this.opacityInputNode;
3125
+ let value;
3126
+ if (!node.value) {
3127
+ value = node.value;
3128
+ }
3129
+ else {
3130
+ const alpha = utils.opacityToAlpha(Number(node.value));
3131
+ value = this.internalColor?.alpha(alpha).hexa();
3132
+ }
3133
+ this.internalSetValue(value, this.value);
3134
+ };
3135
+ this.onInputKeyDown = (event) => {
3136
+ const { altKey, ctrlKey, metaKey, shiftKey } = event;
3137
+ const { alphaChannel, hexInputNode, internalColor, value } = this;
3138
+ const { key } = event;
3139
+ const composedPath = event.composedPath();
3140
+ if (key === "Tab" || key === "Enter") {
3141
+ if (composedPath.includes(hexInputNode)) {
3142
+ this.onHexInputChange();
3143
+ }
3144
+ else {
3145
+ this.onOpacityInputChange();
3146
+ }
3147
+ if (key === "Enter") {
3148
+ event.preventDefault();
3149
+ }
3150
+ return;
3151
+ }
3152
+ const isNudgeKey = key === "ArrowDown" || key === "ArrowUp";
3153
+ const oldValue = this.value;
3154
+ if (isNudgeKey) {
3155
+ if (!value) {
3156
+ this.internalSetValue(this.previousNonNullValue, oldValue);
3157
+ event.preventDefault();
3158
+ return;
3159
+ }
3160
+ const direction = key === "ArrowUp" ? 1 : -1;
3161
+ const bump = shiftKey ? 10 : 1;
3162
+ this.internalSetValue(utils.hexify(this.nudgeRGBChannels(internalColor, bump * direction, composedPath.includes(hexInputNode) ? "rgb" : "a"), alphaChannel), oldValue);
3163
+ event.preventDefault();
3164
+ return;
3165
+ }
3166
+ const withModifiers = altKey || ctrlKey || metaKey;
3167
+ const singleChar = key.length === 1;
3168
+ const validHexChar = utils.hexChar.test(key);
3169
+ if (singleChar && !withModifiers && !validHexChar) {
3170
+ event.preventDefault();
3171
+ }
3172
+ };
3173
+ this.onHexInputPaste = (event) => {
3174
+ const hex = event.clipboardData.getData("text");
3175
+ if (utils.isValidHex(hex)) {
3176
+ event.preventDefault();
3177
+ this.hexInputNode.value = hex.slice(1);
3178
+ }
2953
3179
  };
2954
3180
  this.previousNonNullValue = this.value;
2955
- this.storeInputRef = (node) => {
2956
- this.inputNode = node;
3181
+ this.storeHexInputRef = (node) => {
3182
+ this.hexInputNode = node;
3183
+ };
3184
+ this.storeOpacityInputRef = (node) => {
3185
+ this.opacityInputNode = node;
2957
3186
  };
2958
- this.hexLabel = "Hex";
2959
3187
  this.allowEmpty = false;
2960
- this.scale = "m";
2961
- this.value = utils.normalizeHex(DEFAULT_COLOR.hex());
3188
+ this.alphaChannel = false;
3189
+ this.hexLabel = "Hex";
3190
+ this.messages = undefined;
2962
3191
  this.numberingSystem = undefined;
3192
+ this.scale = "m";
3193
+ this.value = utils.normalizeHex(utils.hexify(DEFAULT_COLOR, this.alphaChannel), this.alphaChannel, true);
2963
3194
  this.internalColor = DEFAULT_COLOR;
2964
3195
  }
2965
3196
  //--------------------------------------------------------------------------
@@ -2968,10 +3199,10 @@ const ColorPickerHexInput = class {
2968
3199
  //
2969
3200
  //--------------------------------------------------------------------------
2970
3201
  connectedCallback() {
2971
- const { allowEmpty, value } = this;
3202
+ const { allowEmpty, alphaChannel, value } = this;
2972
3203
  if (value) {
2973
- const normalized = utils.normalizeHex(value);
2974
- if (utils.isValidHex(normalized)) {
3204
+ const normalized = utils.normalizeHex(value, alphaChannel);
3205
+ if (utils.isValidHex(normalized, alphaChannel)) {
2975
3206
  this.internalSetValue(normalized, normalized, false);
2976
3207
  }
2977
3208
  return;
@@ -2989,54 +3220,21 @@ const ColorPickerHexInput = class {
2989
3220
  handleValueChange(value, oldValue) {
2990
3221
  this.internalSetValue(value, oldValue, false);
2991
3222
  }
2992
- // using @Listen as a workaround for VDOM listener not firing
2993
- onInputKeyDown(event) {
2994
- const { altKey, ctrlKey, metaKey, shiftKey } = event;
2995
- const { internalColor, value } = this;
2996
- const { key } = event;
2997
- if (key === "Tab" || key === "Enter") {
2998
- this.onInputChange();
2999
- return;
3000
- }
3001
- const isNudgeKey = key === "ArrowDown" || key === "ArrowUp";
3002
- const oldValue = this.value;
3003
- if (isNudgeKey) {
3004
- if (!value) {
3005
- this.internalSetValue(this.previousNonNullValue, oldValue);
3006
- event.preventDefault();
3007
- return;
3008
- }
3009
- const direction = key === "ArrowUp" ? 1 : -1;
3010
- const bump = shiftKey ? 10 : 1;
3011
- this.internalSetValue(utils.normalizeHex(this.nudgeRGBChannels(internalColor, bump * direction).hex()), oldValue);
3012
- event.preventDefault();
3013
- return;
3014
- }
3015
- const withModifiers = altKey || ctrlKey || metaKey;
3016
- const singleChar = key.length === 1;
3017
- const validHexChar = utils.hexChar.test(key);
3018
- if (singleChar && !withModifiers && !validHexChar) {
3019
- event.preventDefault();
3020
- }
3021
- }
3022
- onPaste(event) {
3023
- const hex = event.clipboardData.getData("text");
3024
- if (utils.isValidHex(hex)) {
3025
- event.preventDefault();
3026
- this.inputNode.value = hex.slice(1);
3027
- }
3028
- }
3029
3223
  //--------------------------------------------------------------------------
3030
3224
  //
3031
3225
  // Lifecycle
3032
3226
  //
3033
3227
  //--------------------------------------------------------------------------
3034
3228
  render() {
3035
- const { value } = this;
3036
- const hexInputValue = this.formatForInternalInput(value);
3037
- return (index.h("div", { class: CSS$1.container }, index.h("calcite-input", { class: CSS$1.input, label: this.hexLabel, maxLength: 6, numberingSystem: this.numberingSystem, onCalciteInputChange: this.onInputChange, onCalciteInternalInputBlur: this.onCalciteInternalInputBlur, onKeyDown: this.handleKeyDown, onPaste: this.onPaste, prefixText: "#", scale: this.scale, value: hexInputValue,
3229
+ const { alphaChannel, hexLabel, internalColor, messages, scale, value } = this;
3230
+ const hexInputValue = this.formatHexForInternalInput(value);
3231
+ const opacityInputValue = this.formatOpacityForInternalInput(internalColor);
3232
+ const inputScale = scale === "l" ? "m" : "s";
3233
+ return (index.h("div", { class: CSS$1.container }, index.h("calcite-input", { class: CSS$1.hexInput, label: messages?.hex || hexLabel, maxLength: 6, numberingSystem: this.numberingSystem, onCalciteInputChange: this.onHexInputChange, onCalciteInternalInputBlur: this.onHexInputBlur, onKeyDown: this.onInputKeyDown, onPaste: this.onHexInputPaste, prefixText: "#", scale: inputScale, value: hexInputValue,
3234
+ // eslint-disable-next-line react/jsx-sort-props
3235
+ ref: this.storeHexInputRef }), alphaChannel ? (index.h("calcite-input-number", { class: CSS$1.opacityInput, key: "opacity-input", label: messages?.opacity, max: OPACITY_LIMITS.max, maxLength: 3, min: OPACITY_LIMITS.min, numberButtonType: "none", numberingSystem: this.numberingSystem, onCalciteInputNumberChange: this.onOpacityInputChange, onCalciteInternalInputNumberBlur: this.onOpacityInputBlur, onKeyDown: this.onInputKeyDown, scale: inputScale, suffixText: "%", value: opacityInputValue,
3038
3236
  // eslint-disable-next-line react/jsx-sort-props
3039
- ref: this.storeInputRef }), hexInputValue ? (index.h("calcite-color-picker-swatch", { active: true, class: CSS$1.preview, color: `#${hexInputValue}`, scale: this.scale })) : null));
3237
+ ref: this.storeOpacityInputRef })) : null));
3040
3238
  }
3041
3239
  //--------------------------------------------------------------------------
3042
3240
  //
@@ -3046,7 +3244,7 @@ const ColorPickerHexInput = class {
3046
3244
  /** Sets focus on the component. */
3047
3245
  async setFocus() {
3048
3246
  await loadable.componentLoaded(this);
3049
- dom.focusElement(this.inputNode);
3247
+ dom.focusElement(this.hexInputNode);
3050
3248
  }
3051
3249
  //--------------------------------------------------------------------------
3052
3250
  //
@@ -3055,13 +3253,17 @@ const ColorPickerHexInput = class {
3055
3253
  //--------------------------------------------------------------------------
3056
3254
  internalSetValue(value, oldValue, emit = true) {
3057
3255
  if (value) {
3058
- const normalized = utils.normalizeHex(value);
3059
- if (utils.isValidHex(normalized)) {
3060
- const { internalColor } = this;
3061
- const changed = !internalColor || normalized !== utils.normalizeHex(internalColor.hex());
3062
- this.internalColor = color(normalized);
3063
- this.previousNonNullValue = normalized;
3064
- this.value = normalized;
3256
+ const { alphaChannel } = this;
3257
+ const normalized = utils.normalizeHex(value, alphaChannel, alphaChannel);
3258
+ if (utils.isValidHex(normalized, alphaChannel)) {
3259
+ const { internalColor: currentColor } = this;
3260
+ const nextColor = color(normalized);
3261
+ const normalizedLonghand = utils.normalizeHex(utils.hexify(nextColor, alphaChannel), alphaChannel);
3262
+ const changed = !currentColor ||
3263
+ normalizedLonghand !== utils.normalizeHex(utils.hexify(currentColor, alphaChannel), alphaChannel);
3264
+ this.internalColor = nextColor;
3265
+ this.previousNonNullValue = normalizedLonghand;
3266
+ this.value = normalizedLonghand;
3065
3267
  if (changed && emit) {
3066
3268
  this.calciteColorPickerHexInputChange.emit();
3067
3269
  }
@@ -3078,16 +3280,28 @@ const ColorPickerHexInput = class {
3078
3280
  }
3079
3281
  this.value = oldValue;
3080
3282
  }
3081
- formatForInternalInput(hex) {
3082
- return hex ? hex.replace("#", "") : "";
3283
+ formatHexForInternalInput(hex) {
3284
+ return hex ? hex.replace("#", "").slice(0, 6) : "";
3083
3285
  }
3084
- nudgeRGBChannels(color$1, amount) {
3085
- return color.rgb(color$1.array().map((channel) => channel + amount));
3286
+ formatOpacityForInternalInput(color) {
3287
+ return color ? `${utils.alphaToOpacity(color.alpha())}` : "";
3086
3288
  }
3087
- handleKeyDown(event) {
3088
- if (event.key === "Enter") {
3089
- event.preventDefault();
3289
+ nudgeRGBChannels(color$1, amount, context) {
3290
+ let nudgedChannels;
3291
+ const channels = color$1.array();
3292
+ const rgbChannels = channels.slice(0, 3);
3293
+ if (context === "rgb") {
3294
+ const nudgedRGBChannels = rgbChannels.map((channel) => channel + amount);
3295
+ nudgedChannels = [
3296
+ ...nudgedRGBChannels,
3297
+ this.alphaChannel ? channels[3] : undefined
3298
+ ];
3299
+ }
3300
+ else {
3301
+ const nudgedAlpha = utils.opacityToAlpha(utils.alphaToOpacity(color$1.alpha()) + amount);
3302
+ nudgedChannels = [...rgbChannels, nudgedAlpha];
3090
3303
  }
3304
+ return color(nudgedChannels);
3091
3305
  }
3092
3306
  get el() { return index.getElement(this); }
3093
3307
  static get watchers() { return {
@@ -3098,14 +3312,20 @@ ColorPickerHexInput.style = colorPickerHexInputCss;
3098
3312
 
3099
3313
  const CSS = {
3100
3314
  swatch: "swatch",
3101
- noColorIcon: "no-color-icon"
3315
+ noColorSwatch: "swatch--no-color",
3316
+ checker: "checker"
3102
3317
  };
3103
3318
  const COLORS = {
3104
3319
  borderLight: "rgba(0, 0, 0, 0.3)",
3105
3320
  borderDark: "rgba(255, 255, 255, 0.15)"
3106
3321
  };
3322
+ const checkerSquareSize = 4;
3323
+ const CHECKER_DIMENSIONS = {
3324
+ squareSize: checkerSquareSize,
3325
+ size: checkerSquareSize * 2
3326
+ };
3107
3327
 
3108
- const colorPickerSwatchCss = "@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host{position:relative;display:inline-flex}:host([scale=s]){block-size:1.25rem;inline-size:1.25rem}:host([scale=m]){block-size:1.5rem;inline-size:1.5rem}:host([scale=l]){block-size:2rem;inline-size:2rem}.swatch{overflow:visible;block-size:inherit;inline-size:inherit}.swatch rect{transition-property:all;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.no-color-icon{position:absolute;inset:0px;block-size:100%;inline-size:100%}";
3328
+ const colorPickerSwatchCss = "@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-right{0%{opacity:0;transform:translate3D(-5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-left{0%{opacity:0;transform:translate3D(5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-right{animation-name:in-right}.calcite-animate__in-left{animation-name:in-left}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host{position:relative;display:inline-flex}:host([scale=s]){block-size:1.25rem;inline-size:1.25rem}:host([scale=m]){block-size:1.5rem;inline-size:1.5rem}:host([scale=l]){block-size:2rem;inline-size:2rem}.swatch{overflow:hidden;block-size:inherit;inline-size:inherit}.swatch rect{transition-property:all;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.swatch--no-color rect{fill:var(--calcite-ui-foreground-1)}.swatch--no-color line{stroke:var(--calcite-ui-danger)}.checker{fill:#cacaca}";
3109
3329
 
3110
3330
  const ColorPickerSwatch = class {
3111
3331
  constructor(hostRef) {
@@ -3115,7 +3335,7 @@ const ColorPickerSwatch = class {
3115
3335
  this.scale = "m";
3116
3336
  }
3117
3337
  handleColorChange(color$1) {
3118
- this.internalColor = color(color$1);
3338
+ this.internalColor = color$1 ? color(color$1) : null;
3119
3339
  }
3120
3340
  //--------------------------------------------------------------------------
3121
3341
  //
@@ -3126,12 +3346,38 @@ const ColorPickerSwatch = class {
3126
3346
  this.handleColorChange(this.color);
3127
3347
  }
3128
3348
  render() {
3349
+ const isEmpty = !this.internalColor;
3350
+ const classes = {
3351
+ [CSS.swatch]: true,
3352
+ [CSS.noColorSwatch]: isEmpty
3353
+ };
3354
+ return (index.h("svg", { class: classes, xmlns: "http://www.w3.org/2000/svg" }, this.renderSwatch()));
3355
+ }
3356
+ renderSwatch() {
3129
3357
  const { active, el, internalColor } = this;
3130
3358
  const borderRadius = active ? "100%" : "0";
3131
- const hex = internalColor.hex();
3132
3359
  const theme = dom.getModeName(el);
3133
3360
  const borderColor = theme === "light" ? COLORS.borderLight : COLORS.borderDark;
3134
- return (index.h("svg", { class: CSS.swatch, xmlns: "http://www.w3.org/2000/svg" }, index.h("title", null, hex), index.h("rect", { fill: hex, height: "100%", id: "swatch", rx: borderRadius, stroke: borderColor, "stroke-width": "2", style: { "clip-path": `inset(0 round ${borderRadius})` }, width: "100%" })));
3361
+ const commonSwatchProps = {
3362
+ height: "100%",
3363
+ rx: borderRadius,
3364
+ stroke: borderColor,
3365
+ // stroke-width and clip-path are needed to hide overflowing portion of stroke
3366
+ // see https://stackoverflow.com/a/7273346/194216
3367
+ // using attribute to work around Stencil using the prop name vs the attribute when rendering
3368
+ ["stroke-width"]: "2",
3369
+ width: "100%"
3370
+ };
3371
+ const isEmpty = !internalColor;
3372
+ if (isEmpty) {
3373
+ return (index.h(index.Fragment, null, index.h("clipPath", { id: "shape" }, index.h("rect", { height: "100%", rx: borderRadius, width: "100%" })), index.h("rect", { "clip-path": `inset(0 round ${borderRadius})`, rx: borderRadius, ...commonSwatchProps }), index.h("line", { "clip-path": "url(#shape)", "stroke-width": "3", x1: "100%", x2: "0", y1: "0", y2: "100%" })));
3374
+ }
3375
+ const alpha = internalColor.alpha();
3376
+ const hex = utils.hexify(internalColor);
3377
+ const hexa = utils.hexify(internalColor, alpha < 1);
3378
+ return (index.h(index.Fragment, null, index.h("title", null, hexa), index.h("defs", null, index.h("pattern", { height: CHECKER_DIMENSIONS.size, id: "checker", patternUnits: "userSpaceOnUse", width: CHECKER_DIMENSIONS.size, x: "0", y: "0" }, index.h("rect", { class: CSS.checker, height: CHECKER_DIMENSIONS.squareSize, width: CHECKER_DIMENSIONS.squareSize, x: "0", y: "0" }), index.h("rect", { class: CSS.checker, height: CHECKER_DIMENSIONS.squareSize, width: CHECKER_DIMENSIONS.squareSize, x: CHECKER_DIMENSIONS.squareSize, y: CHECKER_DIMENSIONS.squareSize }))), index.h("rect", { fill: "url(#checker)", height: "100%", rx: borderRadius, width: "100%" }), index.h("rect", { fill: hex, style: {
3379
+ "clip-path": alpha < 1 ? "polygon(100% 0, 0 0, 0 100%)" : `inset(0 round ${borderRadius})`
3380
+ }, ...commonSwatchProps }), alpha < 1 ? (index.h("rect", { fill: hexa, key: "opacity-fill", style: { "clip-path": "polygon(100% 0, 100% 100%, 0 100%)" }, ...commonSwatchProps })) : null));
3135
3381
  }
3136
3382
  get el() { return index.getElement(this); }
3137
3383
  static get watchers() { return {