@esri/calcite-components 1.4.0-next.4 → 1.4.0-next.6

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 (704) hide show
  1. package/dist/calcite/calcite.esm.js +2 -2
  2. package/dist/calcite/index.esm.js +2 -2
  3. package/dist/calcite/{p-1b48dcda.entry.js → p-00e1b3a8.entry.js} +2 -2
  4. package/dist/calcite/{p-4a86d1ab.js → p-02706e35.js} +1 -1
  5. package/dist/calcite/p-058ac7cb.entry.js +6 -0
  6. package/dist/calcite/{p-be5734f7.js → p-08fb12d7.js} +2 -2
  7. package/dist/calcite/{p-5081856a.entry.js → p-09339f89.entry.js} +2 -2
  8. package/dist/calcite/{p-549d3d07.entry.js → p-0f9e9bef.entry.js} +2 -2
  9. package/dist/calcite/{p-198ab071.entry.js → p-15d26e08.entry.js} +2 -2
  10. package/dist/calcite/{p-c6c82380.entry.js → p-1678bfd5.entry.js} +2 -2
  11. package/dist/calcite/{p-14f78c1b.entry.js → p-18e2b588.entry.js} +2 -2
  12. package/dist/calcite/{p-14eccdb3.entry.js → p-198abcbb.entry.js} +2 -2
  13. package/dist/calcite/p-1bcc4ef2.js +6 -0
  14. package/dist/calcite/{p-4be0d67c.entry.js → p-20c6068d.entry.js} +2 -2
  15. package/dist/calcite/{p-2468ff71.js → p-238464b3.js} +1 -1
  16. package/dist/calcite/{p-10335369.js → p-24833d0f.js} +2 -2
  17. package/dist/calcite/{p-a8ae64d6.js → p-28ee6675.js} +1 -1
  18. package/dist/calcite/{p-f8af9a6c.js → p-2d155925.js} +1 -1
  19. package/dist/calcite/{p-f8ff6c94.entry.js → p-2f987df1.entry.js} +2 -2
  20. package/dist/calcite/{p-a0d99484.entry.js → p-309c88b2.entry.js} +2 -2
  21. package/dist/calcite/{p-460df0b5.js → p-36a4f2c8.js} +1 -1
  22. package/dist/calcite/{p-607951d2.entry.js → p-3c58757e.entry.js} +2 -2
  23. package/dist/calcite/{p-3465fcef.js → p-3d782f5e.js} +1 -1
  24. package/dist/calcite/{p-9170dc8c.entry.js → p-3e4ed9a3.entry.js} +2 -2
  25. package/dist/calcite/{p-29675f69.entry.js → p-3f09b972.entry.js} +2 -2
  26. package/dist/calcite/{p-b88213e9.entry.js → p-3fb7e1e9.entry.js} +2 -2
  27. package/dist/calcite/{p-4094c395.js → p-49e5e96a.js} +1 -1
  28. package/dist/calcite/{p-e4676089.entry.js → p-4ad0e5e7.entry.js} +2 -2
  29. package/dist/calcite/{p-167a7bdc.js → p-50e95bdb.js} +1 -1
  30. package/dist/calcite/{p-e7e84acd.entry.js → p-51f4cb23.entry.js} +2 -2
  31. package/dist/calcite/{p-09b5e911.entry.js → p-520cf1b0.entry.js} +2 -2
  32. package/dist/calcite/{p-690e8224.entry.js → p-56d69bd6.entry.js} +2 -2
  33. package/dist/calcite/{p-4612e3c4.entry.js → p-5b82075d.entry.js} +2 -2
  34. package/dist/calcite/{p-5099d131.entry.js → p-6582a43e.entry.js} +2 -2
  35. package/dist/calcite/{p-99546fc2.entry.js → p-6989f500.entry.js} +2 -2
  36. package/dist/calcite/{p-ac512a57.entry.js → p-6aadaed2.entry.js} +2 -2
  37. package/dist/calcite/{p-eabc3a81.entry.js → p-6c011dac.entry.js} +2 -2
  38. package/dist/calcite/{p-110f836d.js → p-6e1f7f1f.js} +1 -1
  39. package/dist/calcite/{p-762e069e.entry.js → p-70edce50.entry.js} +2 -2
  40. package/dist/calcite/{p-00346107.entry.js → p-71294102.entry.js} +2 -2
  41. package/dist/calcite/{p-c592404b.entry.js → p-721669b1.entry.js} +2 -2
  42. package/dist/calcite/{p-cc5d73b1.entry.js → p-7773ec0c.entry.js} +2 -2
  43. package/dist/calcite/{p-7aac398a.js → p-78ecccfd.js} +2 -2
  44. package/dist/calcite/{p-7c069e47.entry.js → p-794cd7e0.entry.js} +2 -2
  45. package/dist/calcite/{p-1e353e72.js → p-7e85033a.js} +1 -1
  46. package/dist/calcite/{p-37601822.entry.js → p-829a8016.entry.js} +2 -2
  47. package/dist/calcite/{p-bfa1073e.entry.js → p-8576f7a9.entry.js} +2 -2
  48. package/dist/calcite/{p-4dd1d026.entry.js → p-85ce36b4.entry.js} +2 -2
  49. package/dist/calcite/{p-fbb43fd3.entry.js → p-89b037e5.entry.js} +2 -2
  50. package/dist/calcite/{p-7c93f55c.entry.js → p-8bc8392a.entry.js} +2 -2
  51. package/dist/calcite/{p-d83e122d.js → p-8d592b3c.js} +1 -1
  52. package/dist/calcite/{p-bf3b07a8.entry.js → p-8d911c0f.entry.js} +2 -2
  53. package/dist/calcite/{p-518e42e2.js → p-8e4e219a.js} +1 -1
  54. package/dist/calcite/{p-798257c9.js → p-8eb6d3d6.js} +2 -2
  55. package/dist/calcite/{p-9d6d46fb.js → p-8eed6488.js} +1 -1
  56. package/dist/calcite/{p-1f65fd97.entry.js → p-902ccf8c.entry.js} +2 -2
  57. package/dist/calcite/{p-41b1924f.entry.js → p-90faa188.entry.js} +2 -2
  58. package/dist/calcite/{p-5b0e38f4.entry.js → p-94ae14ed.entry.js} +2 -2
  59. package/dist/calcite/{p-2477ffab.js → p-977a7373.js} +2 -2
  60. package/dist/calcite/{p-fc5a05c8.js → p-9c5561f6.js} +2 -2
  61. package/dist/calcite/{p-71ee6c09.js → p-9ecad02c.js} +2 -2
  62. package/dist/calcite/p-a2dcc545.js +6 -0
  63. package/dist/calcite/{p-6c28a6a6.entry.js → p-ac50f328.entry.js} +2 -2
  64. package/dist/calcite/{p-af19d2eb.entry.js → p-acbe9c99.entry.js} +2 -2
  65. package/dist/calcite/p-ad29a95f.js +6 -0
  66. package/dist/calcite/{p-3476e72e.js → p-ae330013.js} +2 -2
  67. package/dist/calcite/{p-88e0c279.js → p-b0388e91.js} +2 -2
  68. package/dist/calcite/{p-07e56bf4.js → p-b086f92d.js} +1 -1
  69. package/dist/calcite/p-b3099221.js +6 -0
  70. package/dist/calcite/{p-c33810ce.js → p-b3f59734.js} +1 -1
  71. package/dist/calcite/{p-12b426c9.entry.js → p-b7f76e88.entry.js} +2 -2
  72. package/dist/calcite/p-bb1f280b.entry.js +6 -0
  73. package/dist/calcite/{p-cafbf219.entry.js → p-bde56e46.entry.js} +2 -2
  74. package/dist/calcite/{p-48071f1a.entry.js → p-bde9a8bf.entry.js} +2 -2
  75. package/dist/calcite/{p-e88938fe.entry.js → p-becceac4.entry.js} +2 -2
  76. package/dist/calcite/p-c3bd1ae0.entry.js +6 -0
  77. package/dist/calcite/{p-8ac1324f.entry.js → p-c477bf75.entry.js} +2 -2
  78. package/dist/calcite/{p-db1f6411.js → p-c4e985ef.js} +2 -2
  79. package/dist/calcite/{p-605ff48d.entry.js → p-c9159a0a.entry.js} +2 -2
  80. package/dist/calcite/{p-4569f702.entry.js → p-ca95c6ed.entry.js} +2 -2
  81. package/dist/calcite/{p-dc554515.entry.js → p-cabf475d.entry.js} +2 -2
  82. package/dist/calcite/p-cc008746.js +6 -0
  83. package/dist/calcite/{p-b6d1694c.entry.js → p-cd8ecd59.entry.js} +2 -2
  84. package/dist/calcite/{p-b1c81dcc.js → p-cf5e973f.js} +2 -2
  85. package/dist/calcite/{p-90b23414.entry.js → p-d4f5d56a.entry.js} +2 -2
  86. package/dist/calcite/{p-0e0a4c8e.entry.js → p-dda5a868.entry.js} +2 -2
  87. package/dist/calcite/p-de460c7f.js +6 -0
  88. package/dist/calcite/p-e907c9d7.entry.js +6 -0
  89. package/dist/calcite/{p-23c694da.entry.js → p-e9dedbc2.entry.js} +2 -2
  90. package/dist/calcite/{p-74a4ac3e.js → p-ece4c169.js} +1 -1
  91. package/dist/calcite/{p-df5d4340.entry.js → p-ef9439cd.entry.js} +2 -2
  92. package/dist/calcite/p-f0eab93a.entry.js +6 -0
  93. package/dist/calcite/{p-01e73d3c.entry.js → p-f1dc743d.entry.js} +2 -2
  94. package/dist/calcite/{p-feb44263.entry.js → p-f2bf5444.entry.js} +2 -2
  95. package/dist/calcite/{p-ab5ba8d8.entry.js → p-f44b8d1c.entry.js} +2 -2
  96. package/dist/calcite/{p-083022ce.entry.js → p-fd37640e.entry.js} +2 -2
  97. package/dist/calcite/{p-18fe3593.entry.js → p-fd38d722.entry.js} +2 -2
  98. package/dist/calcite/p-ff1e2786.js +6 -0
  99. package/dist/cjs/{ExpandToggle-9c9692c9.js → ExpandToggle-34efb36e.js} +5 -5
  100. package/dist/cjs/{FloatingArrow-8cad3e02.js → FloatingArrow-ca4a438c.js} +2 -2
  101. package/dist/cjs/{Heading-a54c437a.js → Heading-16403a18.js} +2 -2
  102. package/dist/cjs/{app-globals-6921d6ca.js → app-globals-08fa4928.js} +2 -2
  103. package/dist/cjs/{array-11eaef78.js → array-a48e72f4.js} +1 -1
  104. package/dist/cjs/calcite-accordion_2.cjs.entry.js +7 -7
  105. package/dist/cjs/calcite-action-bar.cjs.entry.js +15 -15
  106. package/dist/cjs/calcite-action-group.cjs.entry.js +13 -13
  107. package/dist/cjs/calcite-action-menu.cjs.entry.js +9 -9
  108. package/dist/cjs/calcite-action-pad.cjs.entry.js +14 -14
  109. package/dist/cjs/calcite-action.cjs.entry.js +11 -11
  110. package/dist/cjs/calcite-alert.cjs.entry.js +12 -12
  111. package/dist/cjs/calcite-avatar.cjs.entry.js +6 -6
  112. package/dist/cjs/calcite-block_2.cjs.entry.js +12 -12
  113. package/dist/cjs/calcite-button.cjs.entry.js +13 -13
  114. package/dist/cjs/calcite-card.cjs.entry.js +10 -10
  115. package/dist/cjs/calcite-checkbox.cjs.entry.js +10 -10
  116. package/dist/cjs/calcite-chip-group.cjs.entry.js +8 -8
  117. package/dist/cjs/calcite-chip.cjs.entry.js +12 -12
  118. package/dist/cjs/calcite-color-picker_3.cjs.entry.js +585 -339
  119. package/dist/cjs/calcite-combobox_3.cjs.entry.js +18 -18
  120. package/dist/cjs/calcite-date-picker_4.cjs.entry.js +13 -13
  121. package/dist/cjs/calcite-dropdown_3.cjs.entry.js +12 -12
  122. package/dist/cjs/calcite-fab.cjs.entry.js +7 -7
  123. package/dist/cjs/calcite-filter.cjs.entry.js +13 -13
  124. package/dist/cjs/calcite-flow-item.cjs.entry.js +12 -12
  125. package/dist/cjs/calcite-flow.cjs.entry.js +3 -3
  126. package/dist/cjs/calcite-graph_2.cjs.entry.js +13 -13
  127. package/dist/cjs/calcite-handle.cjs.entry.js +10 -10
  128. package/dist/cjs/calcite-icon.cjs.entry.js +6 -6
  129. package/dist/cjs/calcite-inline-editable.cjs.entry.js +12 -12
  130. package/dist/cjs/calcite-input-date-picker.cjs.entry.js +18 -18
  131. package/dist/cjs/calcite-input-message.cjs.entry.js +5 -5
  132. package/dist/cjs/calcite-input-number.cjs.entry.js +13 -13
  133. package/dist/cjs/calcite-input-text.cjs.entry.js +13 -13
  134. package/dist/cjs/calcite-input-time-picker_2.cjs.entry.js +14 -14
  135. package/dist/cjs/calcite-input.cjs.entry.js +13 -13
  136. package/dist/cjs/calcite-label.cjs.entry.js +6 -6
  137. package/dist/cjs/calcite-link.cjs.entry.js +7 -7
  138. package/dist/cjs/calcite-list_3.cjs.entry.js +50 -40
  139. package/dist/cjs/calcite-loader.cjs.entry.js +3 -3
  140. package/dist/cjs/calcite-modal.cjs.entry.js +13 -13
  141. package/dist/cjs/calcite-notice.cjs.entry.js +12 -12
  142. package/dist/cjs/calcite-option_3.cjs.entry.js +10 -10
  143. package/dist/cjs/calcite-pagination.cjs.entry.js +10 -10
  144. package/dist/cjs/calcite-panel.cjs.entry.js +14 -14
  145. package/dist/cjs/calcite-pick-list_3.cjs.entry.js +16 -16
  146. package/dist/cjs/calcite-popover.cjs.entry.js +16 -16
  147. package/dist/cjs/calcite-progress.cjs.entry.js +2 -2
  148. package/dist/cjs/calcite-radio-button-group.cjs.entry.js +3 -3
  149. package/dist/cjs/calcite-radio-button.cjs.entry.js +10 -10
  150. package/dist/cjs/calcite-rating.cjs.entry.js +13 -13
  151. package/dist/cjs/calcite-scrim.cjs.entry.js +9 -9
  152. package/dist/cjs/calcite-segmented-control_2.cjs.entry.js +9 -9
  153. package/dist/cjs/calcite-shell_3.cjs.entry.js +11 -11
  154. package/dist/cjs/calcite-sortable-list.cjs.entry.js +5 -5
  155. package/dist/cjs/calcite-split-button.cjs.entry.js +4 -4
  156. package/dist/cjs/calcite-stepper_2.cjs.entry.js +10 -10
  157. package/dist/cjs/calcite-switch.cjs.entry.js +10 -10
  158. package/dist/cjs/calcite-tab_4.cjs.entry.js +7 -7
  159. package/dist/cjs/calcite-text-area.cjs.entry.js +15 -15
  160. package/dist/cjs/calcite-tile-select_2.cjs.entry.js +5 -5
  161. package/dist/cjs/calcite-tile.cjs.entry.js +8 -8
  162. package/dist/cjs/calcite-tip_3.cjs.entry.js +11 -11
  163. package/dist/cjs/calcite-tooltip.cjs.entry.js +9 -9
  164. package/dist/cjs/calcite-tree_2.cjs.entry.js +9 -9
  165. package/dist/cjs/calcite-value-list_2.cjs.entry.js +16 -16
  166. package/dist/cjs/calcite.cjs.js +5 -5
  167. package/dist/cjs/{composed-offset-position.esm-5a2f9ff8.js → composed-offset-position.esm-00262258.js} +1 -1
  168. package/dist/cjs/{conditionalSlot-39f2741e.js → conditionalSlot-44ce332c.js} +3 -3
  169. package/dist/cjs/{debounce-f09b6263.js → debounce-a2674dc4.js} +1 -1
  170. package/dist/cjs/{dom-1b2f41d1.js → dom-c4a69490.js} +3 -3
  171. package/dist/cjs/{filter-c268fa9a.js → filter-a7677076.js} +2 -2
  172. package/dist/cjs/{floating-ui-86f1cd7e.js → floating-ui-b9ad845e.js} +71 -65
  173. package/dist/cjs/{focusTrapComponent-84a6204d.js → focusTrapComponent-ad111b58.js} +2 -2
  174. package/dist/cjs/{form-c4ef3b01.js → form-4441b5de.js} +3 -3
  175. package/dist/cjs/{guid-053b3b9f.js → guid-3ea77659.js} +1 -1
  176. package/dist/cjs/{index-3f1e65e1.js → index-5631fa22.js} +1 -1
  177. package/dist/cjs/index.cjs.js +2 -2
  178. package/dist/cjs/{interactive-002e7de1.js → interactive-0d0f7af7.js} +1 -1
  179. package/dist/cjs/{key-26c7350c.js → key-5a12f647.js} +1 -1
  180. package/dist/cjs/{label-c5a73703.js → label-81db116a.js} +2 -2
  181. package/dist/cjs/{loadable-21f49ddd.js → loadable-9733bc78.js} +1 -1
  182. package/dist/cjs/loader.cjs.js +5 -5
  183. package/dist/cjs/{locale-bec864db.js → locale-cd52f850.js} +4 -4
  184. package/dist/cjs/{math-b23a2620.js → math-d7fcd025.js} +1 -1
  185. package/dist/cjs/{observers-7b381996.js → observers-6aa64455.js} +1 -1
  186. package/dist/cjs/{openCloseComponent-d285707d.js → openCloseComponent-f2d47f5b.js} +2 -2
  187. package/dist/cjs/{resources-4b35c7c3.js → resources-4a16f695.js} +1 -1
  188. package/dist/cjs/{resources-ccc69560.js → resources-7805e29e.js} +5 -5
  189. package/dist/cjs/{resources-d72b2060.js → resources-9c69ee5f.js} +1 -1
  190. package/dist/cjs/{resources-6603995b.js → resources-a3154079.js} +1 -1
  191. package/dist/cjs/{resources-42c16d2f.js → resources-cb69cc10.js} +1 -1
  192. package/dist/cjs/{resources-adbdd1d0.js → resources-fb8b0a5e.js} +1 -1
  193. package/dist/cjs/{sortable.esm-e90f34c4.js → sortable.esm-b954a413.js} +1 -1
  194. package/dist/cjs/{t9n-d1d3fae9.js → t9n-e49fe20d.js} +3 -3
  195. package/dist/cjs/{throttle-d2814ea6.js → throttle-3df9debd.js} +2 -2
  196. package/dist/cjs/utils-136fb325.js +213 -0
  197. package/dist/cjs/{utils-da168911.js → utils-411455bc.js} +3 -3
  198. package/dist/collection/components/accordion/accordion.js +1 -1
  199. package/dist/collection/components/accordion-item/accordion-item.js +1 -1
  200. package/dist/collection/components/accordion-item/resources.js +1 -1
  201. package/dist/collection/components/action/action.js +1 -1
  202. package/dist/collection/components/action/resources.js +1 -1
  203. package/dist/collection/components/action-bar/action-bar.js +1 -1
  204. package/dist/collection/components/action-bar/resources.js +1 -1
  205. package/dist/collection/components/action-bar/utils.js +1 -1
  206. package/dist/collection/components/action-group/action-group.js +1 -1
  207. package/dist/collection/components/action-group/resources.js +1 -1
  208. package/dist/collection/components/action-menu/action-menu.js +1 -1
  209. package/dist/collection/components/action-menu/resources.js +1 -1
  210. package/dist/collection/components/action-pad/action-pad.js +1 -1
  211. package/dist/collection/components/action-pad/resources.js +1 -1
  212. package/dist/collection/components/alert/alert.js +1 -1
  213. package/dist/collection/components/alert/resources.js +1 -1
  214. package/dist/collection/components/avatar/avatar.js +1 -1
  215. package/dist/collection/components/avatar/utils.js +1 -1
  216. package/dist/collection/components/block/block.js +1 -1
  217. package/dist/collection/components/block/resources.js +1 -1
  218. package/dist/collection/components/block-section/block-section.js +1 -1
  219. package/dist/collection/components/block-section/resources.js +1 -1
  220. package/dist/collection/components/button/button.js +1 -1
  221. package/dist/collection/components/button/resources.js +1 -1
  222. package/dist/collection/components/card/card.js +1 -1
  223. package/dist/collection/components/card/resources.js +1 -1
  224. package/dist/collection/components/checkbox/checkbox.js +1 -1
  225. package/dist/collection/components/chip/chip.js +1 -1
  226. package/dist/collection/components/chip/resources.js +1 -1
  227. package/dist/collection/components/chip-group/chip-group.js +1 -1
  228. package/dist/collection/components/color-picker/color-picker.css +59 -52
  229. package/dist/collection/components/color-picker/color-picker.js +448 -233
  230. package/dist/collection/components/color-picker/resources.js +37 -27
  231. package/dist/collection/components/color-picker/utils.js +116 -30
  232. package/dist/collection/components/color-picker-hex-input/color-picker-hex-input.css +19 -16
  233. package/dist/collection/components/color-picker-hex-input/color-picker-hex-input.js +225 -118
  234. package/dist/collection/components/color-picker-hex-input/resources.js +3 -3
  235. package/dist/collection/components/color-picker-swatch/color-picker-swatch.css +10 -6
  236. package/dist/collection/components/color-picker-swatch/color-picker-swatch.js +34 -7
  237. package/dist/collection/components/color-picker-swatch/resources.js +8 -2
  238. package/dist/collection/components/combobox/combobox.js +1 -1
  239. package/dist/collection/components/combobox/resources.js +1 -1
  240. package/dist/collection/components/combobox/utils.js +1 -1
  241. package/dist/collection/components/combobox-item/combobox-item.js +1 -1
  242. package/dist/collection/components/combobox-item/resources.js +1 -1
  243. package/dist/collection/components/combobox-item-group/combobox-item-group.js +1 -1
  244. package/dist/collection/components/combobox-item-group/resources.js +1 -1
  245. package/dist/collection/components/date-picker/date-picker.js +1 -1
  246. package/dist/collection/components/date-picker/resources.js +1 -1
  247. package/dist/collection/components/date-picker/utils.js +1 -1
  248. package/dist/collection/components/date-picker-day/date-picker-day.js +1 -1
  249. package/dist/collection/components/date-picker-month/date-picker-month.js +1 -1
  250. package/dist/collection/components/date-picker-month-header/date-picker-month-header.js +1 -1
  251. package/dist/collection/components/date-picker-month-header/resources.js +1 -1
  252. package/dist/collection/components/dropdown/dropdown.js +1 -1
  253. package/dist/collection/components/dropdown/resources.js +1 -1
  254. package/dist/collection/components/dropdown-group/dropdown-group.js +1 -1
  255. package/dist/collection/components/dropdown-group/resources.js +1 -1
  256. package/dist/collection/components/dropdown-item/dropdown-item.js +1 -1
  257. package/dist/collection/components/dropdown-item/resources.js +1 -1
  258. package/dist/collection/components/fab/fab.js +1 -1
  259. package/dist/collection/components/fab/resources.js +1 -1
  260. package/dist/collection/components/filter/filter.js +1 -1
  261. package/dist/collection/components/filter/resources.js +1 -1
  262. package/dist/collection/components/flow/flow.js +1 -1
  263. package/dist/collection/components/flow/resources.js +1 -1
  264. package/dist/collection/components/flow-item/flow-item.js +1 -1
  265. package/dist/collection/components/flow-item/resources.js +1 -1
  266. package/dist/collection/components/functional/ExpandToggle.js +1 -1
  267. package/dist/collection/components/functional/FloatingArrow.js +1 -1
  268. package/dist/collection/components/functional/Heading.js +1 -1
  269. package/dist/collection/components/graph/graph.js +1 -1
  270. package/dist/collection/components/graph/util.js +1 -1
  271. package/dist/collection/components/handle/handle.js +1 -1
  272. package/dist/collection/components/handle/resources.js +1 -1
  273. package/dist/collection/components/icon/icon.js +1 -1
  274. package/dist/collection/components/icon/resources.js +1 -1
  275. package/dist/collection/components/icon/utils.js +1 -1
  276. package/dist/collection/components/inline-editable/inline-editable.js +1 -1
  277. package/dist/collection/components/inline-editable/resources.js +1 -1
  278. package/dist/collection/components/input/input.js +1 -1
  279. package/dist/collection/components/input/resources.js +1 -1
  280. package/dist/collection/components/input-date-picker/input-date-picker.js +1 -1
  281. package/dist/collection/components/input-date-picker/resources.js +1 -1
  282. package/dist/collection/components/input-message/input-message.js +1 -1
  283. package/dist/collection/components/input-message/interfaces.js +1 -1
  284. package/dist/collection/components/input-number/input-number.js +1 -1
  285. package/dist/collection/components/input-number/resources.js +1 -1
  286. package/dist/collection/components/input-text/input-text.js +1 -1
  287. package/dist/collection/components/input-text/resources.js +1 -1
  288. package/dist/collection/components/input-time-picker/input-time-picker.js +1 -1
  289. package/dist/collection/components/input-time-picker/resources.js +1 -1
  290. package/dist/collection/components/label/label.js +1 -1
  291. package/dist/collection/components/label/resources.js +1 -1
  292. package/dist/collection/components/link/link.js +1 -1
  293. package/dist/collection/components/list/list.js +60 -30
  294. package/dist/collection/components/list/resources.js +2 -2
  295. package/dist/collection/components/list-item/list-item.js +1 -1
  296. package/dist/collection/components/list-item/resources.js +1 -1
  297. package/dist/collection/components/list-item/utils.js +1 -1
  298. package/dist/collection/components/list-item-group/list-item-group.js +1 -1
  299. package/dist/collection/components/list-item-group/resources.js +1 -1
  300. package/dist/collection/components/loader/loader.js +1 -1
  301. package/dist/collection/components/modal/modal.js +1 -1
  302. package/dist/collection/components/modal/resources.js +1 -1
  303. package/dist/collection/components/notice/notice.js +1 -1
  304. package/dist/collection/components/notice/resources.js +1 -1
  305. package/dist/collection/components/option/option.js +1 -1
  306. package/dist/collection/components/option-group/option-group.js +1 -1
  307. package/dist/collection/components/pagination/pagination.js +1 -1
  308. package/dist/collection/components/pagination/resources.js +1 -1
  309. package/dist/collection/components/panel/panel.js +1 -1
  310. package/dist/collection/components/panel/resources.js +1 -1
  311. package/dist/collection/components/pick-list/pick-list.js +1 -1
  312. package/dist/collection/components/pick-list/resources.js +1 -1
  313. package/dist/collection/components/pick-list/shared-list-logic.js +1 -1
  314. package/dist/collection/components/pick-list/shared-list-render.js +1 -1
  315. package/dist/collection/components/pick-list-group/pick-list-group.js +1 -1
  316. package/dist/collection/components/pick-list-group/resources.js +1 -1
  317. package/dist/collection/components/pick-list-item/pick-list-item.js +1 -1
  318. package/dist/collection/components/pick-list-item/resources.js +1 -1
  319. package/dist/collection/components/popover/PopoverManager.js +1 -1
  320. package/dist/collection/components/popover/popover.js +1 -1
  321. package/dist/collection/components/popover/resources.js +1 -1
  322. package/dist/collection/components/progress/progress.js +1 -1
  323. package/dist/collection/components/radio-button/radio-button.js +1 -1
  324. package/dist/collection/components/radio-button/resources.js +1 -1
  325. package/dist/collection/components/radio-button-group/radio-button-group.js +1 -1
  326. package/dist/collection/components/rating/function/star.js +1 -1
  327. package/dist/collection/components/rating/rating.js +1 -1
  328. package/dist/collection/components/resources.js +1 -1
  329. package/dist/collection/components/scrim/resources.js +1 -1
  330. package/dist/collection/components/scrim/scrim.js +1 -1
  331. package/dist/collection/components/segmented-control/segmented-control.js +1 -1
  332. package/dist/collection/components/segmented-control-item/resources.js +1 -1
  333. package/dist/collection/components/segmented-control-item/segmented-control-item.js +1 -1
  334. package/dist/collection/components/select/resources.js +1 -1
  335. package/dist/collection/components/select/select.js +1 -1
  336. package/dist/collection/components/shell/resources.js +1 -1
  337. package/dist/collection/components/shell/shell.js +1 -1
  338. package/dist/collection/components/shell-center-row/resources.js +1 -1
  339. package/dist/collection/components/shell-center-row/shell-center-row.js +1 -1
  340. package/dist/collection/components/shell-panel/resources.js +1 -1
  341. package/dist/collection/components/shell-panel/shell-panel.js +1 -1
  342. package/dist/collection/components/slider/resources.js +1 -1
  343. package/dist/collection/components/slider/slider.js +1 -1
  344. package/dist/collection/components/sortable-list/resources.js +1 -1
  345. package/dist/collection/components/sortable-list/sortable-list.js +1 -1
  346. package/dist/collection/components/split-button/resources.js +1 -1
  347. package/dist/collection/components/split-button/split-button.js +1 -1
  348. package/dist/collection/components/stepper/stepper.js +1 -1
  349. package/dist/collection/components/stepper-item/stepper-item.js +1 -1
  350. package/dist/collection/components/switch/switch.js +1 -1
  351. package/dist/collection/components/tab/tab.js +1 -1
  352. package/dist/collection/components/tab-nav/tab-nav.js +1 -1
  353. package/dist/collection/components/tab-title/resources.js +1 -1
  354. package/dist/collection/components/tab-title/tab-title.js +1 -1
  355. package/dist/collection/components/tabs/resources.js +1 -1
  356. package/dist/collection/components/tabs/tabs.js +1 -1
  357. package/dist/collection/components/text-area/resources.js +1 -1
  358. package/dist/collection/components/text-area/text-area.js +1 -1
  359. package/dist/collection/components/tile/resources.js +1 -1
  360. package/dist/collection/components/tile/tile.js +1 -1
  361. package/dist/collection/components/tile-select/resources.js +1 -1
  362. package/dist/collection/components/tile-select/tile-select.js +1 -1
  363. package/dist/collection/components/tile-select-group/tile-select-group.js +1 -1
  364. package/dist/collection/components/time-picker/resources.js +1 -1
  365. package/dist/collection/components/time-picker/time-picker.js +1 -1
  366. package/dist/collection/components/tip/resources.js +1 -1
  367. package/dist/collection/components/tip/tip.js +1 -1
  368. package/dist/collection/components/tip-group/tip-group.js +1 -1
  369. package/dist/collection/components/tip-manager/resources.js +1 -1
  370. package/dist/collection/components/tip-manager/tip-manager.js +1 -1
  371. package/dist/collection/components/tooltip/TooltipManager.js +1 -1
  372. package/dist/collection/components/tooltip/resources.js +1 -1
  373. package/dist/collection/components/tooltip/tooltip.js +1 -1
  374. package/dist/collection/components/tooltip/utils.js +1 -1
  375. package/dist/collection/components/tree/tree.js +1 -1
  376. package/dist/collection/components/tree/utils.js +1 -1
  377. package/dist/collection/components/tree-item/resources.js +1 -1
  378. package/dist/collection/components/tree-item/tree-item.js +1 -1
  379. package/dist/collection/components/value-list/resources.js +1 -1
  380. package/dist/collection/components/value-list/utils.js +1 -1
  381. package/dist/collection/components/value-list/value-list.js +1 -1
  382. package/dist/collection/components/value-list-item/resources.js +1 -1
  383. package/dist/collection/components/value-list-item/value-list-item.js +1 -1
  384. package/dist/collection/index.js +1 -1
  385. package/dist/collection/utils/array.js +1 -1
  386. package/dist/collection/utils/conditionalSlot.js +1 -1
  387. package/dist/collection/utils/config.js +1 -1
  388. package/dist/collection/utils/date.js +1 -1
  389. package/dist/collection/utils/dom.js +1 -1
  390. package/dist/collection/utils/filter.js +1 -1
  391. package/dist/collection/utils/floating-ui.js +1 -1
  392. package/dist/collection/utils/focusTrapComponent.js +1 -1
  393. package/dist/collection/utils/form.js +1 -1
  394. package/dist/collection/utils/globalAttributes.js +1 -1
  395. package/dist/collection/utils/globalScript.js +1 -1
  396. package/dist/collection/utils/guid.js +1 -1
  397. package/dist/collection/utils/interactive.js +1 -1
  398. package/dist/collection/utils/key.js +1 -1
  399. package/dist/collection/utils/label.js +1 -1
  400. package/dist/collection/utils/loadable.js +1 -1
  401. package/dist/collection/utils/locale.js +1 -1
  402. package/dist/collection/utils/math.js +1 -1
  403. package/dist/collection/utils/mode.js +1 -1
  404. package/dist/collection/utils/number.js +1 -1
  405. package/dist/collection/utils/observers.js +1 -1
  406. package/dist/collection/utils/openCloseComponent.js +1 -1
  407. package/dist/collection/utils/resources.js +1 -1
  408. package/dist/collection/utils/t9n.js +1 -1
  409. package/dist/collection/utils/time.js +1 -1
  410. package/dist/components/ExpandToggle.js +1 -1
  411. package/dist/components/FloatingArrow.js +1 -1
  412. package/dist/components/Heading.js +1 -1
  413. package/dist/components/action-group.js +1 -1
  414. package/dist/components/action-menu.js +1 -1
  415. package/dist/components/action.js +1 -1
  416. package/dist/components/array.js +1 -1
  417. package/dist/components/button.js +1 -1
  418. package/dist/components/calcite-accordion-item.js +1 -1
  419. package/dist/components/calcite-accordion.js +1 -1
  420. package/dist/components/calcite-action-bar.js +1 -1
  421. package/dist/components/calcite-action-group.js +1 -1
  422. package/dist/components/calcite-action-menu.js +1 -1
  423. package/dist/components/calcite-action-pad.js +1 -1
  424. package/dist/components/calcite-action.js +1 -1
  425. package/dist/components/calcite-alert.js +1 -1
  426. package/dist/components/calcite-avatar.js +1 -1
  427. package/dist/components/calcite-block-section.js +1 -1
  428. package/dist/components/calcite-block.js +1 -1
  429. package/dist/components/calcite-button.js +1 -1
  430. package/dist/components/calcite-card.js +1 -1
  431. package/dist/components/calcite-checkbox.js +1 -1
  432. package/dist/components/calcite-chip-group.js +1 -1
  433. package/dist/components/calcite-chip.js +1 -1
  434. package/dist/components/calcite-color-picker-hex-input.js +2 -2
  435. package/dist/components/calcite-color-picker-swatch.js +1 -1
  436. package/dist/components/calcite-color-picker.js +377 -314
  437. package/dist/components/calcite-combobox-item-group.js +1 -1
  438. package/dist/components/calcite-combobox-item.js +1 -1
  439. package/dist/components/calcite-combobox.js +1 -1
  440. package/dist/components/calcite-date-picker-day.js +1 -1
  441. package/dist/components/calcite-date-picker-month-header.js +1 -1
  442. package/dist/components/calcite-date-picker-month.js +1 -1
  443. package/dist/components/calcite-date-picker.js +1 -1
  444. package/dist/components/calcite-dropdown-group.js +1 -1
  445. package/dist/components/calcite-dropdown-item.js +1 -1
  446. package/dist/components/calcite-dropdown.js +1 -1
  447. package/dist/components/calcite-fab.js +1 -1
  448. package/dist/components/calcite-filter.js +1 -1
  449. package/dist/components/calcite-flow-item.js +1 -1
  450. package/dist/components/calcite-flow.js +1 -1
  451. package/dist/components/calcite-graph.js +1 -1
  452. package/dist/components/calcite-handle.js +1 -1
  453. package/dist/components/calcite-icon.js +1 -1
  454. package/dist/components/calcite-inline-editable.js +1 -1
  455. package/dist/components/calcite-input-date-picker.js +1 -1
  456. package/dist/components/calcite-input-message.js +1 -1
  457. package/dist/components/calcite-input-number.js +2 -617
  458. package/dist/components/calcite-input-text.js +1 -1
  459. package/dist/components/calcite-input-time-picker.js +1 -1
  460. package/dist/components/calcite-input.js +1 -1
  461. package/dist/components/calcite-label.js +1 -1
  462. package/dist/components/calcite-link.js +1 -1
  463. package/dist/components/calcite-list-item-group.js +1 -1
  464. package/dist/components/calcite-list-item.js +1 -1
  465. package/dist/components/calcite-list.js +40 -30
  466. package/dist/components/calcite-loader.js +1 -1
  467. package/dist/components/calcite-modal.js +1 -1
  468. package/dist/components/calcite-notice.js +1 -1
  469. package/dist/components/calcite-option-group.js +1 -1
  470. package/dist/components/calcite-option.js +1 -1
  471. package/dist/components/calcite-pagination.js +1 -1
  472. package/dist/components/calcite-panel.js +1 -1
  473. package/dist/components/calcite-pick-list-group.js +1 -1
  474. package/dist/components/calcite-pick-list-item.js +1 -1
  475. package/dist/components/calcite-pick-list.js +1 -1
  476. package/dist/components/calcite-popover.js +1 -1
  477. package/dist/components/calcite-progress.js +1 -1
  478. package/dist/components/calcite-radio-button-group.js +1 -1
  479. package/dist/components/calcite-radio-button.js +1 -1
  480. package/dist/components/calcite-rating.js +1 -1
  481. package/dist/components/calcite-scrim.js +1 -1
  482. package/dist/components/calcite-segmented-control-item.js +1 -1
  483. package/dist/components/calcite-segmented-control.js +1 -1
  484. package/dist/components/calcite-select.js +1 -1
  485. package/dist/components/calcite-shell-center-row.js +1 -1
  486. package/dist/components/calcite-shell-panel.js +1 -1
  487. package/dist/components/calcite-shell.js +1 -1
  488. package/dist/components/calcite-slider.js +1 -1
  489. package/dist/components/calcite-sortable-list.js +1 -1
  490. package/dist/components/calcite-split-button.js +1 -1
  491. package/dist/components/calcite-stepper-item.js +1 -1
  492. package/dist/components/calcite-stepper.js +1 -1
  493. package/dist/components/calcite-switch.js +1 -1
  494. package/dist/components/calcite-tab-nav.js +1 -1
  495. package/dist/components/calcite-tab-title.js +1 -1
  496. package/dist/components/calcite-tab.js +1 -1
  497. package/dist/components/calcite-tabs.js +1 -1
  498. package/dist/components/calcite-text-area.js +1 -1
  499. package/dist/components/calcite-tile-select-group.js +1 -1
  500. package/dist/components/calcite-tile-select.js +1 -1
  501. package/dist/components/calcite-tile.js +1 -1
  502. package/dist/components/calcite-time-picker.js +1 -1
  503. package/dist/components/calcite-tip-group.js +1 -1
  504. package/dist/components/calcite-tip-manager.js +1 -1
  505. package/dist/components/calcite-tip.js +1 -1
  506. package/dist/components/calcite-tooltip.js +1 -1
  507. package/dist/components/calcite-tree-item.js +1 -1
  508. package/dist/components/calcite-tree.js +1 -1
  509. package/dist/components/calcite-value-list-item.js +1 -1
  510. package/dist/components/calcite-value-list.js +1 -1
  511. package/dist/components/checkbox.js +1 -1
  512. package/dist/components/chip.js +1 -1
  513. package/dist/components/color-picker-hex-input.js +252 -88
  514. package/dist/components/color-picker-swatch.js +42 -2118
  515. package/dist/components/composed-offset-position.esm.js +1 -1
  516. package/dist/components/conditionalSlot.js +1 -1
  517. package/dist/components/date-picker-day.js +1 -1
  518. package/dist/components/date-picker-month-header.js +1 -1
  519. package/dist/components/date-picker-month.js +1 -1
  520. package/dist/components/date-picker.js +2 -2
  521. package/dist/components/date.js +1 -1
  522. package/dist/components/debounce.js +1 -1
  523. package/dist/components/dom.js +1 -1
  524. package/dist/components/dropdown.js +1 -1
  525. package/dist/components/filter.js +1 -1
  526. package/dist/components/filter2.js +1 -1
  527. package/dist/components/floating-ui.js +68 -62
  528. package/dist/components/focusTrapComponent.js +1 -1
  529. package/dist/components/form.js +1 -1
  530. package/dist/components/graph.js +1 -1
  531. package/dist/components/guid.js +1 -1
  532. package/dist/components/handle.js +1 -1
  533. package/dist/components/icon.js +1 -1
  534. package/dist/components/index.js +1 -1
  535. package/dist/components/index2.js +2116 -0
  536. package/dist/components/input-number.js +623 -0
  537. package/dist/components/input.js +2 -2
  538. package/dist/components/interactive.js +1 -1
  539. package/dist/components/key.js +1 -1
  540. package/dist/components/label.js +1 -1
  541. package/dist/components/label2.js +1 -1
  542. package/dist/components/link.js +1 -1
  543. package/dist/components/loadable.js +1 -1
  544. package/dist/components/loader.js +1 -1
  545. package/dist/components/locale.js +2 -2
  546. package/dist/components/math.js +1 -1
  547. package/dist/components/observers.js +1 -1
  548. package/dist/components/openCloseComponent.js +1 -1
  549. package/dist/components/panel.js +1 -1
  550. package/dist/components/pick-list-item.js +1 -1
  551. package/dist/components/popover.js +1 -1
  552. package/dist/components/progress.js +1 -1
  553. package/dist/components/resources.js +1 -1
  554. package/dist/components/resources2.js +1 -1
  555. package/dist/components/resources3.js +1 -1
  556. package/dist/components/scrim.js +1 -1
  557. package/dist/components/shared-list-render.js +1 -1
  558. package/dist/components/sortable.esm.js +1 -1
  559. package/dist/components/switch.js +1 -1
  560. package/dist/components/t9n.js +1 -1
  561. package/dist/components/tab-nav.js +1 -1
  562. package/dist/components/tab-title.js +1 -1
  563. package/dist/components/tab.js +1 -1
  564. package/dist/components/tabs.js +1 -1
  565. package/dist/components/throttle.js +1 -1
  566. package/dist/components/tile.js +1 -1
  567. package/dist/components/time-picker.js +2 -2
  568. package/dist/components/tooltip.js +1 -1
  569. package/dist/components/utils.js +112 -31
  570. package/dist/components/utils2.js +1 -1
  571. package/dist/components/utils3.js +1 -1
  572. package/dist/esm/{ExpandToggle-095e2f69.js → ExpandToggle-84cd3334.js} +5 -5
  573. package/dist/esm/{FloatingArrow-4e190499.js → FloatingArrow-2a728102.js} +2 -2
  574. package/dist/esm/{Heading-08826e02.js → Heading-aa5e7f03.js} +2 -2
  575. package/dist/esm/{app-globals-a86875ad.js → app-globals-9a63f836.js} +2 -2
  576. package/dist/esm/{array-937e8e63.js → array-cba42ef7.js} +1 -1
  577. package/dist/esm/calcite-accordion_2.entry.js +7 -7
  578. package/dist/esm/calcite-action-bar.entry.js +15 -15
  579. package/dist/esm/calcite-action-group.entry.js +13 -13
  580. package/dist/esm/calcite-action-menu.entry.js +9 -9
  581. package/dist/esm/calcite-action-pad.entry.js +14 -14
  582. package/dist/esm/calcite-action.entry.js +11 -11
  583. package/dist/esm/calcite-alert.entry.js +12 -12
  584. package/dist/esm/calcite-avatar.entry.js +6 -6
  585. package/dist/esm/calcite-block_2.entry.js +12 -12
  586. package/dist/esm/calcite-button.entry.js +13 -13
  587. package/dist/esm/calcite-card.entry.js +10 -10
  588. package/dist/esm/calcite-checkbox.entry.js +10 -10
  589. package/dist/esm/calcite-chip-group.entry.js +8 -8
  590. package/dist/esm/calcite-chip.entry.js +12 -12
  591. package/dist/esm/calcite-color-picker_3.entry.js +585 -339
  592. package/dist/esm/calcite-combobox_3.entry.js +18 -18
  593. package/dist/esm/calcite-date-picker_4.entry.js +13 -13
  594. package/dist/esm/calcite-dropdown_3.entry.js +12 -12
  595. package/dist/esm/calcite-fab.entry.js +7 -7
  596. package/dist/esm/calcite-filter.entry.js +13 -13
  597. package/dist/esm/calcite-flow-item.entry.js +12 -12
  598. package/dist/esm/calcite-flow.entry.js +3 -3
  599. package/dist/esm/calcite-graph_2.entry.js +13 -13
  600. package/dist/esm/calcite-handle.entry.js +10 -10
  601. package/dist/esm/calcite-icon.entry.js +6 -6
  602. package/dist/esm/calcite-inline-editable.entry.js +12 -12
  603. package/dist/esm/calcite-input-date-picker.entry.js +18 -18
  604. package/dist/esm/calcite-input-message.entry.js +5 -5
  605. package/dist/esm/calcite-input-number.entry.js +13 -13
  606. package/dist/esm/calcite-input-text.entry.js +13 -13
  607. package/dist/esm/calcite-input-time-picker_2.entry.js +14 -14
  608. package/dist/esm/calcite-input.entry.js +13 -13
  609. package/dist/esm/calcite-label.entry.js +6 -6
  610. package/dist/esm/calcite-link.entry.js +7 -7
  611. package/dist/esm/calcite-list_3.entry.js +50 -40
  612. package/dist/esm/calcite-loader.entry.js +3 -3
  613. package/dist/esm/calcite-modal.entry.js +13 -13
  614. package/dist/esm/calcite-notice.entry.js +12 -12
  615. package/dist/esm/calcite-option_3.entry.js +10 -10
  616. package/dist/esm/calcite-pagination.entry.js +10 -10
  617. package/dist/esm/calcite-panel.entry.js +14 -14
  618. package/dist/esm/calcite-pick-list_3.entry.js +16 -16
  619. package/dist/esm/calcite-popover.entry.js +16 -16
  620. package/dist/esm/calcite-progress.entry.js +2 -2
  621. package/dist/esm/calcite-radio-button-group.entry.js +3 -3
  622. package/dist/esm/calcite-radio-button.entry.js +10 -10
  623. package/dist/esm/calcite-rating.entry.js +13 -13
  624. package/dist/esm/calcite-scrim.entry.js +9 -9
  625. package/dist/esm/calcite-segmented-control_2.entry.js +9 -9
  626. package/dist/esm/calcite-shell_3.entry.js +11 -11
  627. package/dist/esm/calcite-sortable-list.entry.js +5 -5
  628. package/dist/esm/calcite-split-button.entry.js +4 -4
  629. package/dist/esm/calcite-stepper_2.entry.js +10 -10
  630. package/dist/esm/calcite-switch.entry.js +10 -10
  631. package/dist/esm/calcite-tab_4.entry.js +7 -7
  632. package/dist/esm/calcite-text-area.entry.js +15 -15
  633. package/dist/esm/calcite-tile-select_2.entry.js +5 -5
  634. package/dist/esm/calcite-tile.entry.js +8 -8
  635. package/dist/esm/calcite-tip_3.entry.js +11 -11
  636. package/dist/esm/calcite-tooltip.entry.js +9 -9
  637. package/dist/esm/calcite-tree_2.entry.js +9 -9
  638. package/dist/esm/calcite-value-list_2.entry.js +16 -16
  639. package/dist/esm/calcite.js +6 -6
  640. package/dist/esm/{composed-offset-position.esm-fb83e249.js → composed-offset-position.esm-2c2ff148.js} +1 -1
  641. package/dist/esm/{conditionalSlot-98fcfe31.js → conditionalSlot-734f45e3.js} +3 -3
  642. package/dist/esm/{debounce-911eef82.js → debounce-13053af0.js} +1 -1
  643. package/dist/esm/{dom-2b55c6b1.js → dom-3643d47b.js} +3 -3
  644. package/dist/esm/{filter-6a2a0d23.js → filter-c124b3a7.js} +2 -2
  645. package/dist/esm/{floating-ui-1f96fa4e.js → floating-ui-dde330fd.js} +71 -65
  646. package/dist/esm/{focusTrapComponent-9f5c20f0.js → focusTrapComponent-be382f0c.js} +2 -2
  647. package/dist/esm/{form-ef433149.js → form-9b4d08d5.js} +3 -3
  648. package/dist/esm/{guid-08c9d9d2.js → guid-00c961cf.js} +1 -1
  649. package/dist/esm/{index-34f68bbe.js → index-de813188.js} +1 -1
  650. package/dist/esm/index.js +2 -2
  651. package/dist/esm/{interactive-a2eb6b56.js → interactive-7577fa95.js} +1 -1
  652. package/dist/esm/{key-a12e3d36.js → key-204f54dc.js} +1 -1
  653. package/dist/esm/{label-e5638056.js → label-aa3ca023.js} +2 -2
  654. package/dist/esm/{loadable-7ddbc3f7.js → loadable-295e7059.js} +1 -1
  655. package/dist/esm/loader.js +6 -6
  656. package/dist/esm/{locale-cdbef5ac.js → locale-cf07a13b.js} +4 -4
  657. package/dist/esm/{math-2b6a45bc.js → math-81cb18a5.js} +1 -1
  658. package/dist/esm/{observers-58b3356b.js → observers-e24920a0.js} +1 -1
  659. package/dist/esm/{openCloseComponent-6350a6b9.js → openCloseComponent-d6957380.js} +2 -2
  660. package/dist/esm/{resources-f97f2e3d.js → resources-20a9105d.js} +1 -1
  661. package/dist/esm/{resources-95e5c0bc.js → resources-510afe06.js} +1 -1
  662. package/dist/esm/{resources-52988112.js → resources-b814eba0.js} +5 -5
  663. package/dist/esm/{resources-87498192.js → resources-b81c1240.js} +1 -1
  664. package/dist/esm/{resources-66bba32b.js → resources-d27d888f.js} +1 -1
  665. package/dist/esm/{resources-509df361.js → resources-f496ba11.js} +1 -1
  666. package/dist/esm/{sortable.esm-69990d9c.js → sortable.esm-8c3ec43a.js} +1 -1
  667. package/dist/esm/{t9n-c5155b27.js → t9n-62bf4e90.js} +3 -3
  668. package/dist/esm/{throttle-161e1712.js → throttle-ab3e5fce.js} +2 -2
  669. package/dist/esm/utils-119581ee.js +195 -0
  670. package/dist/esm/{utils-4c71f289.js → utils-1692b158.js} +3 -3
  671. package/dist/extras/docs-json.json +156 -30
  672. package/dist/extras/vscode-data.json +22 -2
  673. package/dist/loader/cdn.js +1 -1
  674. package/dist/loader/index.cjs.js +1 -1
  675. package/dist/loader/index.es2017.js +1 -1
  676. package/dist/loader/index.js +1 -1
  677. package/dist/types/components/color-picker/color-picker.d.ts +54 -23
  678. package/dist/types/components/color-picker/interfaces.d.ts +1 -0
  679. package/dist/types/components/color-picker/resources.d.ts +28 -18
  680. package/dist/types/components/color-picker/utils.d.ts +16 -7
  681. package/dist/types/components/color-picker-hex-input/color-picker-hex-input.d.ts +33 -16
  682. package/dist/types/components/color-picker-hex-input/resources.d.ts +2 -2
  683. package/dist/types/components/color-picker-swatch/color-picker-swatch.d.ts +3 -2
  684. package/dist/types/components/color-picker-swatch/resources.d.ts +6 -1
  685. package/dist/types/components/list/list.d.ts +7 -2
  686. package/dist/types/components/list/resources.d.ts +1 -1
  687. package/dist/types/components.d.ts +62 -6
  688. package/dist/types/preact.d.ts +2 -1
  689. package/hydrate/index.js +796 -447
  690. package/package.json +4 -5
  691. package/dist/calcite/p-2927ff1d.js +0 -6
  692. package/dist/calcite/p-3623550f.entry.js +0 -6
  693. package/dist/calcite/p-5782f6ba.js +0 -6
  694. package/dist/calcite/p-5e1869b5.js +0 -6
  695. package/dist/calcite/p-663a4c37.js +0 -6
  696. package/dist/calcite/p-8b7561ca.js +0 -6
  697. package/dist/calcite/p-95860b15.entry.js +0 -6
  698. package/dist/calcite/p-b0a41644.js +0 -6
  699. package/dist/calcite/p-b1dcf567.js +0 -6
  700. package/dist/calcite/p-b73ede81.entry.js +0 -6
  701. package/dist/calcite/p-c107f270.entry.js +0 -6
  702. package/dist/calcite/p-f8d77f71.entry.js +0 -6
  703. package/dist/cjs/utils-78b4120a.js +0 -124
  704. package/dist/esm/utils-ab93be5f.js +0 -114
@@ -1,22 +1,22 @@
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.4
4
+ * v1.4.0-next.6
5
5
  */
6
- import { r as registerInstance, c as createEvent, h, a as getElement } from './index-34f68bbe.js';
7
- import { i as isPrimaryPointerButton, b as getElementDir, f as focusElement, h as getModeName } from './dom-2b55c6b1.js';
8
- import { n as normalizeHex, C as CSSColorMode, p as parseMode, c as colorEqual, i as isValidHex, a as isLonghandHex, r as rgbToHex, b as hexChar } from './utils-ab93be5f.js';
9
- import { u as updateHostInteraction } from './interactive-a2eb6b56.js';
10
- import { i as isActivationKey } from './key-a12e3d36.js';
11
- import { c as componentLoaded, s as setUpLoadableComponent, a as setComponentLoaded } from './loadable-7ddbc3f7.js';
12
- import { c as connectLocalized, d as disconnectLocalized } from './locale-cdbef5ac.js';
13
- import { c as clamp } from './math-2b6a45bc.js';
14
- import { u as updateMessages, s as setUpMessages, c as connectMessages, d as disconnectMessages } from './t9n-c5155b27.js';
15
- import { t as throttle } from './throttle-161e1712.js';
16
- import './guid-08c9d9d2.js';
17
- import './resources-509df361.js';
18
- import './observers-58b3356b.js';
19
- import './debounce-911eef82.js';
6
+ import { r as registerInstance, c as createEvent, h, a as getElement, F as Fragment } from './index-de813188.js';
7
+ import { i as isPrimaryPointerButton, b as getElementDir, f as focusElement, h as getModeName } from './dom-3643d47b.js';
8
+ import { C as CSSColorMode, n as normalizeHex, a as hexify, o as opacityToAlpha, b as alphaToOpacity, c as alphaCompatible, p as parseMode, d as colorEqual, t as toNonAlphaMode, e as normalizeAlpha, f as toAlphaMode, g as normalizeColor, j as isLonghandHex, i as isValidHex, r as rgbToHex, k as hexChar } from './utils-119581ee.js';
9
+ import { u as updateHostInteraction } from './interactive-7577fa95.js';
10
+ import { i as isActivationKey } from './key-204f54dc.js';
11
+ import { c as componentLoaded, s as setUpLoadableComponent, a as setComponentLoaded } from './loadable-295e7059.js';
12
+ import { c as connectLocalized, d as disconnectLocalized } from './locale-cf07a13b.js';
13
+ import { c as clamp } from './math-81cb18a5.js';
14
+ import { u as updateMessages, s as setUpMessages, c as connectMessages, d as disconnectMessages } from './t9n-62bf4e90.js';
15
+ import { t as throttle } from './throttle-ab3e5fce.js';
16
+ import './guid-00c961cf.js';
17
+ import './resources-f496ba11.js';
18
+ import './observers-e24920a0.js';
19
+ import './debounce-13053af0.js';
20
20
 
21
21
  function createCommonjsModule(fn, basedir, module) {
22
22
  return module = {
@@ -2129,30 +2129,36 @@ function zeroArray(array, length) {
2129
2129
  var color = Color;
2130
2130
 
2131
2131
  const CSS$2 = {
2132
+ channel: "channel",
2133
+ channels: "channels",
2134
+ colorField: "color-field",
2135
+ colorFieldScope: "scope--color-field",
2136
+ colorMode: "color-mode",
2137
+ colorModeContainer: "color-mode-container",
2132
2138
  container: "container",
2139
+ control: "control",
2140
+ controlAndScope: "control-and-scope",
2133
2141
  controlSection: "control-section",
2134
- hexOptions: "color-hex-options",
2135
- section: "section",
2142
+ deleteColor: "delete-color",
2136
2143
  header: "header",
2137
- control: "control",
2138
- splitSection: "section--split",
2139
- colorModeContainer: "color-mode-container",
2140
- colorMode: "color-mode",
2141
- channels: "channels",
2142
- channel: "channel",
2143
- savedColors: "saved-colors",
2144
- savedColorsSection: "saved-colors-section",
2144
+ hexAndChannelsGroup: "hex-and-channels-group",
2145
+ hexOptions: "color-hex-options",
2146
+ hueScope: "scope--hue",
2147
+ hueSlider: "hue-slider",
2148
+ opacityScope: "scope--opacity",
2149
+ opacitySlider: "opacity-slider",
2150
+ preview: "preview",
2151
+ previewAndSliders: "preview-and-sliders",
2145
2152
  saveColor: "save-color",
2146
- deleteColor: "delete-color",
2153
+ savedColor: "saved-color",
2154
+ savedColors: "saved-colors",
2147
2155
  savedColorsButtons: "saved-colors-buttons",
2148
- headerHex: "header--hex",
2149
- colorFieldAndSlider: "color-field-and-slider",
2150
- colorFieldAndSliderInteractive: "color-field-and-slider--interactive",
2151
- colorFieldAndSliderWrap: "color-field-and-slider-wrap",
2156
+ savedColorsSection: "saved-colors-section",
2152
2157
  scope: "scope",
2153
- hueScope: "scope--hue",
2154
- colorFieldScope: "scope--color-field",
2155
- savedColor: "saved-color"
2158
+ section: "section",
2159
+ slider: "slider",
2160
+ sliders: "sliders",
2161
+ splitSection: "section--split"
2156
2162
  };
2157
2163
  const DEFAULT_COLOR$1 = color("#007AC2");
2158
2164
  const DEFAULT_STORAGE_KEY_PREFIX = "calcite-color-";
@@ -2166,24 +2172,28 @@ const HSV_LIMITS = {
2166
2172
  s: 100,
2167
2173
  v: 100
2168
2174
  };
2175
+ const OPACITY_LIMITS = {
2176
+ min: 0,
2177
+ max: 100
2178
+ };
2169
2179
  const DIMENSIONS = {
2170
2180
  s: {
2171
2181
  slider: {
2172
- height: 10,
2173
- width: 160
2182
+ height: 12,
2183
+ width: 104
2174
2184
  },
2175
2185
  colorField: {
2176
2186
  height: 80,
2177
2187
  width: 160
2178
2188
  },
2179
2189
  thumb: {
2180
- radius: 8
2190
+ radius: 10
2181
2191
  }
2182
2192
  },
2183
2193
  m: {
2184
2194
  slider: {
2185
- height: 14,
2186
- width: 272
2195
+ height: 12,
2196
+ width: 204
2187
2197
  },
2188
2198
  colorField: {
2189
2199
  height: 150,
@@ -2195,35 +2205,30 @@ const DIMENSIONS = {
2195
2205
  },
2196
2206
  l: {
2197
2207
  slider: {
2198
- height: 16,
2199
- width: 464
2208
+ height: 12,
2209
+ width: 384
2200
2210
  },
2201
2211
  colorField: {
2202
2212
  height: 200,
2203
2213
  width: 464
2204
2214
  },
2205
2215
  thumb: {
2206
- radius: 12
2216
+ radius: 10
2207
2217
  }
2208
2218
  }
2209
2219
  };
2210
2220
 
2211
- 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}";
2221
+ 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]){--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}";
2212
2222
 
2213
2223
  const throttleFor60FpsInMs = 16;
2214
- const defaultValue = normalizeHex(DEFAULT_COLOR$1.hex());
2215
- const defaultFormat = "auto";
2216
2224
  const ColorPicker = class {
2217
2225
  constructor(hostRef) {
2218
2226
  registerInstance(this, hostRef);
2219
2227
  this.calciteColorPickerChange = createEvent(this, "calciteColorPickerChange", 6);
2220
2228
  this.calciteColorPickerInput = createEvent(this, "calciteColorPickerInput", 6);
2221
- this.colorFieldAndSliderHovered = false;
2222
- this.hueThumbState = "idle";
2223
2229
  this.internalColorUpdateContext = null;
2224
2230
  this.mode = CSSColorMode.HEX;
2225
2231
  this.shiftKeyChannelAdjustment = 0;
2226
- this.sliderThumbState = "idle";
2227
2232
  this.handleTabActivate = (event) => {
2228
2233
  this.channelMode = event.currentTarget.getAttribute("data-color-mode");
2229
2234
  this.updateChannelsFromColor(this.color);
@@ -2268,7 +2273,7 @@ const ColorPicker = class {
2268
2273
  this.internalColorSet(null);
2269
2274
  return;
2270
2275
  }
2271
- const normalizedHex = color$1 && normalizeHex(color$1.hex());
2276
+ const normalizedHex = color$1 && normalizeHex(hexify(color$1, alphaCompatible(this.mode)));
2272
2277
  if (hex !== normalizedHex) {
2273
2278
  this.internalColorSet(color(hex));
2274
2279
  }
@@ -2280,16 +2285,20 @@ const ColorPicker = class {
2280
2285
  this.handleChannelInput = (event) => {
2281
2286
  const input = event.currentTarget;
2282
2287
  const channelIndex = Number(input.getAttribute("data-channel-index"));
2283
- const limit = this.channelMode === "rgb"
2284
- ? RGB_LIMITS[Object.keys(RGB_LIMITS)[channelIndex]]
2285
- : HSV_LIMITS[Object.keys(HSV_LIMITS)[channelIndex]];
2288
+ const isAlphaChannel = channelIndex === 3;
2289
+ const limit = isAlphaChannel
2290
+ ? OPACITY_LIMITS.max
2291
+ : this.channelMode === "rgb"
2292
+ ? RGB_LIMITS[Object.keys(RGB_LIMITS)[channelIndex]]
2293
+ : HSV_LIMITS[Object.keys(HSV_LIMITS)[channelIndex]];
2286
2294
  let inputValue;
2287
2295
  if (this.allowEmpty && !input.value) {
2288
2296
  inputValue = "";
2289
2297
  }
2290
2298
  else {
2291
- const value = Number(input.value) + this.shiftKeyChannelAdjustment;
2292
- const clamped = clamp(value, 0, limit);
2299
+ const value = Number(input.value);
2300
+ const adjustedValue = value + this.shiftKeyChannelAdjustment;
2301
+ const clamped = clamp(adjustedValue, 0, limit);
2293
2302
  inputValue = clamped.toString();
2294
2303
  }
2295
2304
  input.value = inputValue;
@@ -2303,11 +2312,13 @@ const ColorPicker = class {
2303
2312
  const channels = [...this.channels];
2304
2313
  const shouldClearChannels = this.allowEmpty && !input.value;
2305
2314
  if (shouldClearChannels) {
2306
- this.channels = [null, null, null];
2315
+ this.channels = [null, null, null, null];
2307
2316
  this.internalColorSet(null);
2308
2317
  return;
2309
2318
  }
2310
- channels[channelIndex] = Number(input.value);
2319
+ const isAlphaChannel = channelIndex === 3;
2320
+ const value = Number(input.value);
2321
+ channels[channelIndex] = isAlphaChannel ? opacityToAlpha(value) : value;
2311
2322
  this.updateColorFromChannels(channels);
2312
2323
  };
2313
2324
  this.handleSavedColorKeyDown = (event) => {
@@ -2316,144 +2327,101 @@ const ColorPicker = class {
2316
2327
  this.handleSavedColorSelect(event);
2317
2328
  }
2318
2329
  };
2319
- this.handleColorFieldAndSliderPointerLeave = () => {
2320
- this.colorFieldAndSliderInteractive = false;
2321
- this.colorFieldAndSliderHovered = false;
2322
- if (this.sliderThumbState !== "drag" && this.hueThumbState !== "drag") {
2323
- this.hueThumbState = "idle";
2324
- this.sliderThumbState = "idle";
2325
- this.drawColorFieldAndSlider();
2326
- }
2327
- };
2328
- this.handleColorFieldAndSliderPointerDown = (event) => {
2330
+ this.handleColorFieldPointerDown = (event) => {
2329
2331
  if (!isPrimaryPointerButton(event)) {
2330
2332
  return;
2331
2333
  }
2332
2334
  const { offsetX, offsetY } = event;
2333
- const region = this.getCanvasRegion(offsetY);
2334
- if (region === "color-field") {
2335
- this.hueThumbState = "drag";
2336
- this.captureColorFieldColor(offsetX, offsetY);
2337
- this.colorFieldScopeNode?.focus();
2335
+ document.addEventListener("pointermove", this.globalPointerMoveHandler);
2336
+ document.addEventListener("pointerup", this.globalPointerUpHandler, { once: true });
2337
+ this.activeCanvasInfo = {
2338
+ context: this.colorFieldRenderingContext,
2339
+ bounds: this.colorFieldRenderingContext.canvas.getBoundingClientRect()
2340
+ };
2341
+ this.captureColorFieldColor(offsetX, offsetY);
2342
+ this.colorFieldScopeNode.focus();
2343
+ };
2344
+ this.handleHueSliderPointerDown = (event) => {
2345
+ if (!isPrimaryPointerButton(event)) {
2346
+ return;
2338
2347
  }
2339
- else if (region === "slider") {
2340
- this.sliderThumbState = "drag";
2341
- this.captureHueSliderColor(offsetX);
2342
- this.hueScopeNode?.focus();
2348
+ const { offsetX } = event;
2349
+ document.addEventListener("pointermove", this.globalPointerMoveHandler);
2350
+ document.addEventListener("pointerup", this.globalPointerUpHandler, { once: true });
2351
+ this.activeCanvasInfo = {
2352
+ context: this.hueSliderRenderingContext,
2353
+ bounds: this.hueSliderRenderingContext.canvas.getBoundingClientRect()
2354
+ };
2355
+ this.captureHueSliderColor(offsetX);
2356
+ this.hueScopeNode.focus();
2357
+ };
2358
+ this.handleOpacitySliderPointerDown = (event) => {
2359
+ if (!isPrimaryPointerButton(event)) {
2360
+ return;
2343
2361
  }
2362
+ const { offsetX } = event;
2344
2363
  document.addEventListener("pointermove", this.globalPointerMoveHandler);
2345
2364
  document.addEventListener("pointerup", this.globalPointerUpHandler, { once: true });
2346
- this.activeColorFieldAndSliderRect =
2347
- this.fieldAndSliderRenderingContext.canvas.getBoundingClientRect();
2365
+ this.activeCanvasInfo = {
2366
+ context: this.opacitySliderRenderingContext,
2367
+ bounds: this.opacitySliderRenderingContext.canvas.getBoundingClientRect()
2368
+ };
2369
+ this.captureOpacitySliderValue(offsetX);
2370
+ this.opacityScopeNode.focus();
2348
2371
  };
2349
2372
  this.globalPointerUpHandler = (event) => {
2350
2373
  if (!isPrimaryPointerButton(event)) {
2351
2374
  return;
2352
2375
  }
2353
- const previouslyDragging = this.sliderThumbState === "drag" || this.hueThumbState === "drag";
2354
- this.hueThumbState = "idle";
2355
- this.sliderThumbState = "idle";
2356
- this.activeColorFieldAndSliderRect = null;
2357
- this.drawColorFieldAndSlider();
2376
+ const previouslyDragging = this.activeCanvasInfo;
2377
+ this.activeCanvasInfo = null;
2378
+ this.drawColorControls();
2358
2379
  if (previouslyDragging) {
2359
2380
  this.calciteColorPickerChange.emit();
2360
2381
  }
2361
2382
  };
2362
2383
  this.globalPointerMoveHandler = (event) => {
2363
- const { el, dimensions } = this;
2364
- const sliderThumbDragging = this.sliderThumbState === "drag";
2365
- const hueThumbDragging = this.hueThumbState === "drag";
2366
- if (!el.isConnected || (!sliderThumbDragging && !hueThumbDragging)) {
2384
+ const { activeCanvasInfo, el } = this;
2385
+ if (!el.isConnected || !activeCanvasInfo) {
2367
2386
  return;
2368
2387
  }
2388
+ const { context, bounds } = activeCanvasInfo;
2369
2389
  let samplingX;
2370
2390
  let samplingY;
2371
- const colorFieldAndSliderRect = this.activeColorFieldAndSliderRect;
2372
2391
  const { clientX, clientY } = event;
2373
- if (this.colorFieldAndSliderHovered) {
2374
- samplingX = clientX - colorFieldAndSliderRect.x;
2375
- samplingY = clientY - colorFieldAndSliderRect.y;
2392
+ if (context.canvas.matches(":hover")) {
2393
+ samplingX = clientX - bounds.x;
2394
+ samplingY = clientY - bounds.y;
2376
2395
  }
2377
2396
  else {
2378
- const colorFieldWidth = dimensions.colorField.width;
2379
- const colorFieldHeight = dimensions.colorField.height;
2380
- const hueSliderHeight = dimensions.slider.height;
2381
- if (clientX < colorFieldAndSliderRect.x + colorFieldWidth &&
2382
- clientX > colorFieldAndSliderRect.x) {
2383
- samplingX = clientX - colorFieldAndSliderRect.x;
2397
+ // snap x and y to the closest edge
2398
+ if (clientX < bounds.x + bounds.width && clientX > bounds.x) {
2399
+ samplingX = clientX - bounds.x;
2384
2400
  }
2385
- else if (clientX < colorFieldAndSliderRect.x) {
2401
+ else if (clientX < bounds.x) {
2386
2402
  samplingX = 0;
2387
2403
  }
2388
2404
  else {
2389
- samplingX = colorFieldWidth - 1;
2405
+ samplingX = bounds.width;
2390
2406
  }
2391
- if (clientY < colorFieldAndSliderRect.y + colorFieldHeight + hueSliderHeight &&
2392
- clientY > colorFieldAndSliderRect.y) {
2393
- samplingY = clientY - colorFieldAndSliderRect.y;
2407
+ if (clientY < bounds.y + bounds.height && clientY > bounds.y) {
2408
+ samplingY = clientY - bounds.y;
2394
2409
  }
2395
- else if (clientY < colorFieldAndSliderRect.y) {
2410
+ else if (clientY < bounds.y) {
2396
2411
  samplingY = 0;
2397
2412
  }
2398
2413
  else {
2399
- samplingY = colorFieldHeight + hueSliderHeight;
2414
+ samplingY = bounds.height;
2400
2415
  }
2401
2416
  }
2402
- if (hueThumbDragging) {
2417
+ if (context === this.colorFieldRenderingContext) {
2403
2418
  this.captureColorFieldColor(samplingX, samplingY, false);
2404
2419
  }
2405
- else {
2420
+ else if (context === this.hueSliderRenderingContext) {
2406
2421
  this.captureHueSliderColor(samplingX);
2407
2422
  }
2408
- };
2409
- this.handleColorFieldAndSliderPointerEnterOrMove = ({ offsetX, offsetY }) => {
2410
- const { dimensions: { colorField, slider, thumb } } = this;
2411
- this.colorFieldAndSliderInteractive = offsetY <= colorField.height + slider.height;
2412
- this.colorFieldAndSliderHovered = true;
2413
- const region = this.getCanvasRegion(offsetY);
2414
- if (region === "color-field") {
2415
- const prevHueThumbState = this.hueThumbState;
2416
- const color = this.baseColorFieldColor.hsv();
2417
- const centerX = Math.round(color.saturationv() / (HSV_LIMITS.s / colorField.width));
2418
- const centerY = Math.round(colorField.height - color.value() / (HSV_LIMITS.v / colorField.height));
2419
- const hoveringThumb = this.containsPoint(offsetX, offsetY, centerX, centerY, thumb.radius);
2420
- let transitionedBetweenHoverAndIdle = false;
2421
- if (prevHueThumbState === "idle" && hoveringThumb) {
2422
- this.hueThumbState = "hover";
2423
- transitionedBetweenHoverAndIdle = true;
2424
- }
2425
- else if (prevHueThumbState === "hover" && !hoveringThumb) {
2426
- this.hueThumbState = "idle";
2427
- transitionedBetweenHoverAndIdle = true;
2428
- }
2429
- if (this.hueThumbState !== "drag") {
2430
- if (transitionedBetweenHoverAndIdle) {
2431
- // refresh since we won't update color and thus no redraw
2432
- this.drawColorFieldAndSlider();
2433
- }
2434
- }
2435
- }
2436
- else if (region === "slider") {
2437
- const sliderThumbColor = this.baseColorFieldColor.hsv().saturationv(100).value(100);
2438
- const prevSliderThumbState = this.sliderThumbState;
2439
- const sliderThumbCenterX = Math.round(sliderThumbColor.hue() / (360 / slider.width));
2440
- const sliderThumbCenterY = Math.round((slider.height + this.getSliderCapSpacing()) / 2) + colorField.height;
2441
- const hoveringSliderThumb = this.containsPoint(offsetX, offsetY, sliderThumbCenterX, sliderThumbCenterY, thumb.radius);
2442
- let sliderThumbTransitionedBetweenHoverAndIdle = false;
2443
- if (prevSliderThumbState === "idle" && hoveringSliderThumb) {
2444
- this.sliderThumbState = "hover";
2445
- sliderThumbTransitionedBetweenHoverAndIdle = true;
2446
- }
2447
- else if (prevSliderThumbState === "hover" && !hoveringSliderThumb) {
2448
- this.sliderThumbState = "idle";
2449
- sliderThumbTransitionedBetweenHoverAndIdle = true;
2450
- }
2451
- if (this.sliderThumbState !== "drag") {
2452
- if (sliderThumbTransitionedBetweenHoverAndIdle) {
2453
- // refresh since we won't update color and thus no redraw
2454
- this.drawColorFieldAndSlider();
2455
- }
2456
- }
2423
+ else if (context === this.opacitySliderRenderingContext) {
2424
+ this.captureOpacitySliderValue(samplingX);
2457
2425
  }
2458
2426
  };
2459
2427
  this.storeColorFieldScope = (node) => {
@@ -2469,23 +2437,35 @@ const ColorPicker = class {
2469
2437
  return (h("calcite-tab-title", { class: CSS$2.colorMode, "data-color-mode": channelMode, key: channelMode, onCalciteTabsActivate: this.handleTabActivate, selected: selected }, label));
2470
2438
  };
2471
2439
  this.renderChannelsTab = (channelMode) => {
2472
- const { channelMode: activeChannelMode, channels, messages } = this;
2440
+ const { allowEmpty, channelMode: activeChannelMode, channels, messages, alphaChannel } = this;
2473
2441
  const selected = channelMode === activeChannelMode;
2474
2442
  const isRgb = channelMode === "rgb";
2475
- const channelLabels = isRgb
2476
- ? [messages.r, messages.g, messages.b]
2477
- : [messages.h, messages.s, messages.v];
2478
2443
  const channelAriaLabels = isRgb
2479
2444
  ? [messages.red, messages.green, messages.blue]
2480
2445
  : [messages.hue, messages.saturation, messages.value];
2481
2446
  const direction = getElementDir(this.el);
2482
- return (h("calcite-tab", { class: CSS$2.control, key: channelMode, selected: selected }, h("div", { class: CSS$2.channels, dir: "ltr" }, channels.map((channel, index) =>
2483
- /* the channel container is ltr, so we apply the host's direction */
2484
- this.renderChannel(channel, index, channelLabels[index], channelAriaLabels[index], direction)))));
2447
+ const channelsToRender = alphaChannel ? channels : channels.slice(0, 3);
2448
+ return (h("calcite-tab", { class: CSS$2.control, key: channelMode, selected: selected }, h("div", { class: CSS$2.channels, dir: "ltr" }, channelsToRender.map((channelValue, index) => {
2449
+ const isAlphaChannel = index === 3;
2450
+ if (isAlphaChannel) {
2451
+ channelValue =
2452
+ allowEmpty && !channelValue ? channelValue : alphaToOpacity(channelValue);
2453
+ }
2454
+ /* the channel container is ltr, so we apply the host's direction */
2455
+ return this.renderChannel(channelValue, index, channelAriaLabels[index], direction, isAlphaChannel ? "%" : "");
2456
+ }))));
2457
+ };
2458
+ this.renderChannel = (value, index, ariaLabel, direction, suffix) => {
2459
+ return (h("calcite-input", { class: CSS$2.channel, "data-channel-index": index, dir: direction, key: index, label: ariaLabel, lang: this.effectiveLocale, numberButtonType: "none", numberingSystem: this.numberingSystem, onCalciteInputChange: this.handleChannelChange, onCalciteInputInput: this.handleChannelInput, onKeyDown: this.handleKeyDown, scale: this.scale === "l" ? "m" : "s",
2460
+ // workaround to ensure input borders overlap as desired
2461
+ // this is because the build transforms margin-left to its
2462
+ // logical-prop, which is undesired as channels are always ltr
2463
+ style: {
2464
+ marginLeft: index > 0 && !(this.scale === "s" && this.alphaChannel && index === 3) ? "-1px" : ""
2465
+ }, suffixText: suffix, type: "number", value: value?.toString() }));
2485
2466
  };
2486
- this.renderChannel = (value, index, label, ariaLabel, direction) => (h("calcite-input", { class: CSS$2.channel, "data-channel-index": index, dir: direction, label: ariaLabel, lang: this.effectiveLocale, numberButtonType: "none", numberingSystem: this.numberingSystem, onCalciteInputChange: this.handleChannelChange, onCalciteInputInput: this.handleChannelInput, onKeyDown: this.handleKeyDown, prefixText: label, scale: this.scale === "l" ? "m" : "s", type: "number", value: value?.toString() }));
2487
2467
  this.deleteColor = () => {
2488
- const colorToDelete = this.color.hex();
2468
+ const colorToDelete = hexify(this.color, this.alphaChannel);
2489
2469
  const inStorage = this.savedColors.indexOf(colorToDelete) > -1;
2490
2470
  if (!inStorage) {
2491
2471
  return;
@@ -2498,7 +2478,7 @@ const ColorPicker = class {
2498
2478
  }
2499
2479
  };
2500
2480
  this.saveColor = () => {
2501
- const colorToSave = this.color.hex();
2481
+ const colorToSave = hexify(this.color, this.alphaChannel);
2502
2482
  const alreadySaved = this.savedColors.indexOf(colorToSave) > -1;
2503
2483
  if (alreadySaved) {
2504
2484
  return;
@@ -2510,12 +2490,18 @@ const ColorPicker = class {
2510
2490
  localStorage.setItem(storageKey, JSON.stringify(savedColors));
2511
2491
  }
2512
2492
  };
2513
- this.drawColorFieldAndSlider = throttle(() => {
2514
- if (!this.fieldAndSliderRenderingContext) {
2515
- return;
2493
+ this.drawColorControls = throttle((type = "all") => {
2494
+ if ((type === "all" || type === "color-field") && this.colorFieldRenderingContext) {
2495
+ this.drawColorField();
2496
+ }
2497
+ if ((type === "all" || type === "hue-slider") && this.hueSliderRenderingContext) {
2498
+ this.drawHueSlider();
2499
+ }
2500
+ if (this.alphaChannel &&
2501
+ (type === "all" || type === "opacity-slider") &&
2502
+ this.opacitySliderRenderingContext) {
2503
+ this.drawOpacitySlider();
2516
2504
  }
2517
- this.drawColorField();
2518
- this.drawHueSlider();
2519
2505
  }, throttleFor60FpsInMs);
2520
2506
  this.captureColorFieldColor = (x, y, skipEqual = true) => {
2521
2507
  const { dimensions: { colorField: { height, width } } } = this;
@@ -2523,24 +2509,56 @@ const ColorPicker = class {
2523
2509
  const value = Math.round((HSV_LIMITS.v / height) * (height - y));
2524
2510
  this.internalColorSet(this.baseColorFieldColor.hsv().saturationv(saturation).value(value), skipEqual);
2525
2511
  };
2526
- this.initColorFieldAndSlider = (canvas) => {
2527
- this.fieldAndSliderRenderingContext = canvas.getContext("2d");
2528
- this.updateCanvasSize(canvas);
2512
+ this.initColorField = (canvas) => {
2513
+ this.colorFieldRenderingContext = canvas.getContext("2d");
2514
+ this.updateCanvasSize("color-field");
2515
+ this.drawColorControls();
2516
+ };
2517
+ this.initHueSlider = (canvas) => {
2518
+ this.hueSliderRenderingContext = canvas.getContext("2d");
2519
+ this.updateCanvasSize("hue-slider");
2520
+ this.drawHueSlider();
2521
+ };
2522
+ this.initOpacitySlider = (canvas) => {
2523
+ this.opacitySliderRenderingContext = canvas.getContext("2d");
2524
+ this.updateCanvasSize("opacity-slider");
2525
+ this.drawOpacitySlider();
2526
+ };
2527
+ this.storeOpacityScope = (node) => {
2528
+ this.opacityScopeNode = node;
2529
+ };
2530
+ this.handleOpacityScopeKeyDown = (event) => {
2531
+ const modifier = event.shiftKey ? 10 : 1;
2532
+ const { key } = event;
2533
+ const arrowKeyToXOffset = {
2534
+ ArrowUp: 1,
2535
+ ArrowRight: 1,
2536
+ ArrowDown: -1,
2537
+ ArrowLeft: -1
2538
+ };
2539
+ if (arrowKeyToXOffset[key]) {
2540
+ event.preventDefault();
2541
+ const delta = opacityToAlpha(arrowKeyToXOffset[key] * modifier);
2542
+ this.captureHueSliderColor(this.opacityScopeLeft + delta);
2543
+ }
2529
2544
  };
2530
2545
  this.allowEmpty = false;
2546
+ this.alphaChannel = false;
2547
+ this.channelsDisabled = false;
2531
2548
  this.color = DEFAULT_COLOR$1;
2532
2549
  this.disabled = false;
2533
- this.format = defaultFormat;
2534
- this.hideHex = false;
2550
+ this.format = "auto";
2535
2551
  this.hideChannels = false;
2552
+ this.hexDisabled = false;
2553
+ this.hideHex = false;
2536
2554
  this.hideSaved = false;
2555
+ this.savedDisabled = false;
2537
2556
  this.scale = "m";
2538
2557
  this.storageId = undefined;
2539
2558
  this.messageOverrides = undefined;
2540
2559
  this.numberingSystem = undefined;
2541
- this.value = defaultValue;
2560
+ this.value = normalizeHex(hexify(DEFAULT_COLOR$1, this.alphaChannel));
2542
2561
  this.defaultMessages = undefined;
2543
- this.colorFieldAndSliderInteractive = false;
2544
2562
  this.channelMode = "rgb";
2545
2563
  this.channels = this.toChannels(DEFAULT_COLOR$1);
2546
2564
  this.dimensions = DIMENSIONS.m;
@@ -2549,12 +2567,19 @@ const ColorPicker = class {
2549
2567
  this.savedColors = [];
2550
2568
  this.colorFieldScopeTop = undefined;
2551
2569
  this.colorFieldScopeLeft = undefined;
2552
- this.scopeOrientation = undefined;
2553
2570
  this.hueScopeLeft = undefined;
2554
- this.hueScopeTop = undefined;
2571
+ this.opacityScopeLeft = undefined;
2572
+ this.scopeOrientation = undefined;
2573
+ }
2574
+ handleAlphaChannelChange(alphaChannel) {
2575
+ const { format } = this;
2576
+ if (alphaChannel && format !== "auto" && !alphaCompatible(format)) {
2577
+ console.warn(`ignoring alphaChannel as the current format (${format}) does not support alpha`);
2578
+ this.alphaChannel = false;
2579
+ }
2555
2580
  }
2556
2581
  handleColorChange(color, oldColor) {
2557
- this.drawColorFieldAndSlider();
2582
+ this.drawColorControls();
2558
2583
  this.updateChannelsFromColor(color);
2559
2584
  this.previousColor = oldColor;
2560
2585
  }
@@ -2564,7 +2589,8 @@ const ColorPicker = class {
2564
2589
  }
2565
2590
  handleScaleChange(scale = "m") {
2566
2591
  this.updateDimensions(scale);
2567
- this.updateCanvasSize(this.fieldAndSliderRenderingContext?.canvas);
2592
+ this.updateCanvasSize("all");
2593
+ this.drawColorControls();
2568
2594
  }
2569
2595
  onMessagesChange() {
2570
2596
  /* wired up by t9n util */
@@ -2581,9 +2607,9 @@ const ColorPicker = class {
2581
2607
  return;
2582
2608
  }
2583
2609
  modeChanged = this.mode !== nextMode;
2584
- this.setMode(nextMode);
2610
+ this.setMode(nextMode, this.internalColorUpdateContext === null);
2585
2611
  }
2586
- const dragging = this.sliderThumbState === "drag" || this.hueThumbState === "drag";
2612
+ const dragging = this.activeCanvasInfo;
2587
2613
  if (this.internalColorUpdateContext === "initial") {
2588
2614
  return;
2589
2615
  }
@@ -2594,17 +2620,16 @@ const ColorPicker = class {
2594
2620
  }
2595
2621
  return;
2596
2622
  }
2597
- const color$1 = allowEmpty && !value ? null : color(value);
2623
+ const color$1 = allowEmpty && !value
2624
+ ? null
2625
+ : color(value != null && typeof value === "object" && alphaCompatible(this.mode)
2626
+ ? normalizeColor(value)
2627
+ : value);
2598
2628
  const colorChanged = !colorEqual(color$1, this.color);
2599
2629
  if (modeChanged || colorChanged) {
2600
- this.internalColorSet(color$1, true, "internal");
2630
+ this.internalColorSet(color$1, this.alphaChannel && !(this.mode.endsWith("a") || this.mode.endsWith("a-css")), "internal");
2601
2631
  }
2602
2632
  }
2603
- //--------------------------------------------------------------------------
2604
- //
2605
- // Internal State/Props
2606
- //
2607
- //--------------------------------------------------------------------------
2608
2633
  get baseColorFieldColor() {
2609
2634
  return this.color || this.previousColor || DEFAULT_COLOR$1;
2610
2635
  }
@@ -2660,7 +2685,7 @@ const ColorPicker = class {
2660
2685
  if (!valueIsCompatible) {
2661
2686
  this.showIncompatibleColorWarning(value, format);
2662
2687
  }
2663
- this.setMode(format);
2688
+ this.setMode(format, false);
2664
2689
  this.internalColorSet(initialColor, false, "initial");
2665
2690
  this.updateDimensions(this.scale);
2666
2691
  const storageKey = `${DEFAULT_STORAGE_KEY_PREFIX}${this.storageId}`;
@@ -2691,34 +2716,38 @@ const ColorPicker = class {
2691
2716
  //
2692
2717
  //--------------------------------------------------------------------------
2693
2718
  render() {
2694
- const { allowEmpty, color, messages, hideHex, hideChannels, hideSaved, savedColors, scale } = this;
2695
- const selectedColorInHex = color ? color.hex() : null;
2696
- const hexInputScale = scale === "l" ? "m" : "s";
2697
- const { colorFieldAndSliderInteractive, colorFieldScopeTop, colorFieldScopeLeft, hueScopeLeft, hueScopeTop, scopeOrientation, dimensions: { colorField: { height: colorFieldHeight, width: colorFieldWidth }, slider: { height: sliderHeight } } } = this;
2698
- const hueTop = hueScopeTop ?? sliderHeight / 2 + colorFieldHeight;
2699
- const hueLeft = hueScopeLeft ?? (colorFieldWidth * DEFAULT_COLOR$1.hue()) / HSV_LIMITS.h;
2719
+ 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;
2720
+ const selectedColorInHex = color ? hexify(color, alphaChannel) : null;
2721
+ const hueTop = thumbRadius;
2722
+ const hueLeft = hueScopeLeft ?? (sliderWidth * DEFAULT_COLOR$1.hue()) / HSV_LIMITS.h;
2723
+ const opacityTop = thumbRadius;
2724
+ const opacityLeft = opacityScopeLeft ??
2725
+ (colorFieldWidth * alphaToOpacity(DEFAULT_COLOR$1.alpha())) / OPACITY_LIMITS.max;
2700
2726
  const noColor = color === null;
2701
2727
  const vertical = scopeOrientation === "vertical";
2702
- return (h("div", { class: CSS$2.container }, h("div", { class: CSS$2.colorFieldAndSliderWrap }, h("canvas", { class: {
2703
- [CSS$2.colorFieldAndSlider]: true,
2704
- [CSS$2.colorFieldAndSliderInteractive]: colorFieldAndSliderInteractive
2705
- }, onPointerDown: this.handleColorFieldAndSliderPointerDown, onPointerEnter: this.handleColorFieldAndSliderPointerEnterOrMove, onPointerLeave: this.handleColorFieldAndSliderPointerLeave, onPointerMove: this.handleColorFieldAndSliderPointerEnterOrMove,
2728
+ const noHex = hexDisabled || hideHex;
2729
+ const noChannels = channelsDisabled || hideChannels;
2730
+ const noSaved = savedDisabled || hideSaved;
2731
+ return (h("div", { class: CSS$2.container }, h("div", { class: CSS$2.controlAndScope }, h("canvas", { class: CSS$2.colorField, onPointerDown: this.handleColorFieldPointerDown,
2732
+ // eslint-disable-next-line react/jsx-sort-props
2733
+ ref: this.initColorField }), h("div", { "aria-label": vertical ? messages.value : messages.saturation, "aria-valuemax": vertical ? HSV_LIMITS.v : HSV_LIMITS.s, "aria-valuemin": "0", "aria-valuenow": (vertical ? color?.saturationv() : color?.value()) || "0", class: { [CSS$2.scope]: true, [CSS$2.colorFieldScope]: true }, onKeyDown: this.handleColorFieldScopeKeyDown, role: "slider", style: { top: `${colorFieldScopeTop || 0}px`, left: `${colorFieldScopeLeft || 0}px` }, tabindex: "0",
2734
+ // eslint-disable-next-line react/jsx-sort-props
2735
+ ref: this.storeColorFieldScope })), h("div", { class: CSS$2.previewAndSliders }, h("calcite-color-picker-swatch", { class: CSS$2.preview, color: selectedColorInHex, scale: "l" }), h("div", { class: CSS$2.sliders }, h("div", { class: CSS$2.controlAndScope }, h("canvas", { class: { [CSS$2.slider]: true, [CSS$2.hueSlider]: true }, onPointerDown: this.handleHueSliderPointerDown,
2706
2736
  // eslint-disable-next-line react/jsx-sort-props
2707
- ref: this.initColorFieldAndSlider }), h("div", { "aria-label": vertical ? messages.value : messages.saturation, "aria-valuemax": vertical ? HSV_LIMITS.v : HSV_LIMITS.s, "aria-valuemin": "0", "aria-valuenow": (vertical ? color?.saturationv() : color?.value()) || "0", class: { [CSS$2.scope]: true, [CSS$2.colorFieldScope]: true }, onKeyDown: this.handleColorFieldScopeKeyDown, role: "slider", style: { top: `${colorFieldScopeTop || 0}px`, left: `${colorFieldScopeLeft || 0}px` }, tabindex: "0",
2737
+ ref: this.initHueSlider }), 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",
2708
2738
  // eslint-disable-next-line react/jsx-sort-props
2709
- ref: this.storeColorFieldScope }), 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",
2739
+ ref: this.storeHueScope })), alphaChannel ? (h("div", { class: CSS$2.controlAndScope }, h("canvas", { class: { [CSS$2.slider]: true, [CSS$2.opacitySlider]: true }, onPointerDown: this.handleOpacitySliderPointerDown,
2710
2740
  // eslint-disable-next-line react/jsx-sort-props
2711
- ref: this.storeHueScope })), hideHex && hideChannels ? null : (h("div", { class: {
2741
+ ref: this.initOpacitySlider }), 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",
2742
+ // eslint-disable-next-line react/jsx-sort-props
2743
+ ref: this.storeOpacityScope }))) : null)), noHex && noChannels ? null : (h("div", { class: {
2712
2744
  [CSS$2.controlSection]: true,
2713
2745
  [CSS$2.section]: true
2714
- } }, hideHex ? null : (h("div", { class: CSS$2.hexOptions }, h("span", { class: {
2715
- [CSS$2.header]: true,
2716
- [CSS$2.headerHex]: true
2717
- } }, messages.hex), 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 : (h("calcite-tabs", { class: {
2746
+ } }, h("div", { class: CSS$2.hexAndChannelsGroup }, noHex ? null : (h("div", { class: CSS$2.hexOptions }, 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 : (h("calcite-tabs", { class: {
2718
2747
  [CSS$2.colorModeContainer]: true,
2719
2748
  [CSS$2.splitSection]: true
2720
- }, scale: hexInputScale }, h("calcite-tab-nav", { slot: "title-group" }, this.renderChannelsTabTitle("rgb"), this.renderChannelsTabTitle("hsv")), this.renderChannelsTab("rgb"), this.renderChannelsTab("hsv"))))), hideSaved ? null : (h("div", { class: { [CSS$2.savedColorsSection]: true, [CSS$2.section]: true } }, h("div", { class: CSS$2.header }, h("label", null, messages.saved), h("div", { class: CSS$2.savedColorsButtons }, 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" }), 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 ? (h("div", { class: CSS$2.savedColors }, [
2721
- ...savedColors.map((color) => (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 })))
2749
+ }, scale: scale === "l" ? "m" : "s" }, h("calcite-tab-nav", { slot: "title-group" }, this.renderChannelsTabTitle("rgb"), this.renderChannelsTabTitle("hsv")), this.renderChannelsTab("rgb"), this.renderChannelsTab("hsv")))))), noSaved ? null : (h("div", { class: { [CSS$2.savedColorsSection]: true, [CSS$2.section]: true } }, h("div", { class: CSS$2.header }, h("label", null, messages.saved), h("div", { class: CSS$2.savedColorsButtons }, 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" }), 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 ? (h("div", { class: CSS$2.savedColors }, [
2750
+ ...savedColors.map((color) => (h("calcite-color-picker-swatch", { class: CSS$2.savedColor, color: color, key: color, onClick: this.handleSavedColorSelect, onKeyDown: this.handleSavedColorKeyDown, scale: scale, tabIndex: 0 })))
2722
2751
  ])) : null))));
2723
2752
  }
2724
2753
  // --------------------------------------------------------------------------
@@ -2734,23 +2763,38 @@ const ColorPicker = class {
2734
2763
  showIncompatibleColorWarning(value, format) {
2735
2764
  console.warn(`ignoring color value (${value}) as it is not compatible with the current format (${format})`);
2736
2765
  }
2737
- setMode(format) {
2738
- this.mode = format === "auto" ? this.mode : format;
2766
+ setMode(format, warn = true) {
2767
+ const mode = format === "auto" ? this.mode : format;
2768
+ this.mode = this.ensureCompatibleMode(mode, warn);
2769
+ }
2770
+ ensureCompatibleMode(mode, warn) {
2771
+ const { alphaChannel } = this;
2772
+ const isAlphaCompatible = alphaCompatible(mode);
2773
+ if (alphaChannel && !isAlphaCompatible) {
2774
+ const alphaMode = toAlphaMode(mode);
2775
+ if (warn) {
2776
+ console.warn(`setting format to (${alphaMode}) as the provided one (${mode}) does not support alpha`);
2777
+ }
2778
+ return alphaMode;
2779
+ }
2780
+ if (!alphaChannel && isAlphaCompatible) {
2781
+ const nonAlphaMode = toNonAlphaMode(mode);
2782
+ if (warn) {
2783
+ console.warn(`setting format to (${nonAlphaMode}) as the provided one (${mode}) does not support alpha`);
2784
+ }
2785
+ return nonAlphaMode;
2786
+ }
2787
+ return mode;
2739
2788
  }
2740
2789
  captureHueSliderColor(x) {
2741
2790
  const { dimensions: { slider: { width } } } = this;
2742
2791
  const hue = (360 / width) * x;
2743
2792
  this.internalColorSet(this.baseColorFieldColor.hue(hue), false);
2744
2793
  }
2745
- getCanvasRegion(y) {
2746
- const { dimensions: { colorField: { height: colorFieldHeight }, slider: { height: sliderHeight } } } = this;
2747
- if (y <= colorFieldHeight) {
2748
- return "color-field";
2749
- }
2750
- if (y <= colorFieldHeight + sliderHeight) {
2751
- return "slider";
2752
- }
2753
- return "none";
2794
+ captureOpacitySliderValue(x) {
2795
+ const { dimensions: { slider: { width } } } = this;
2796
+ const alpha = opacityToAlpha((OPACITY_LIMITS.max / width) * x);
2797
+ this.internalColorSet(this.baseColorFieldColor.alpha(alpha), false);
2754
2798
  }
2755
2799
  internalColorSet(color, skipEqual = true, context = "user-interaction") {
2756
2800
  if (skipEqual && colorEqual(color, this.color)) {
@@ -2767,16 +2811,25 @@ const ColorPicker = class {
2767
2811
  }
2768
2812
  const hexMode = "hex";
2769
2813
  if (format.includes(hexMode)) {
2770
- return normalizeHex(color.round()[hexMode]());
2814
+ const hasAlpha = format === CSSColorMode.HEXA;
2815
+ return normalizeHex(hexify(color.round(), hasAlpha), hasAlpha);
2771
2816
  }
2772
2817
  if (format.includes("-css")) {
2773
- return color[format.replace("-css", "").replace("a", "")]().round().string();
2818
+ const value = color[format.replace("-css", "").replace("a", "")]().round().string();
2819
+ // Color omits alpha values when alpha is 1
2820
+ const needToInjectAlpha = (format.endsWith("a") || format.endsWith("a-css")) && color.alpha() === 1;
2821
+ if (needToInjectAlpha) {
2822
+ const model = value.slice(0, 3);
2823
+ const values = value.slice(4, -1);
2824
+ return `${model}a(${values}, ${color.alpha()})`;
2825
+ }
2826
+ return value;
2774
2827
  }
2775
- const colorObject = color[format]().round().object();
2828
+ const colorObject =
2829
+ /* Color() does not support hsva, hsla nor rgba, so we use the non-alpha mode */
2830
+ color[toNonAlphaMode(format)]().round().object();
2776
2831
  if (format.endsWith("a")) {
2777
- // normalize alpha prop
2778
- colorObject.a = colorObject.alpha;
2779
- delete colorObject.alpha;
2832
+ return normalizeAlpha(colorObject);
2780
2833
  }
2781
2834
  return colorObject;
2782
2835
  }
@@ -2788,9 +2841,14 @@ const ColorPicker = class {
2788
2841
  this.dimensions = DIMENSIONS[scale];
2789
2842
  }
2790
2843
  drawColorField() {
2791
- const context = this.fieldAndSliderRenderingContext;
2844
+ const context = this.colorFieldRenderingContext;
2792
2845
  const { dimensions: { colorField: { height, width } } } = this;
2793
- context.fillStyle = this.baseColorFieldColor.hsv().saturationv(100).value(100).string();
2846
+ context.fillStyle = this.baseColorFieldColor
2847
+ .hsv()
2848
+ .saturationv(100)
2849
+ .value(100)
2850
+ .alpha(1)
2851
+ .string();
2794
2852
  context.fillRect(0, 0, width, height);
2795
2853
  const whiteGradient = context.createLinearGradient(0, 0, width, 0);
2796
2854
  whiteGradient.addColorStop(0, "rgba(255,255,255,1)");
@@ -2805,6 +2863,9 @@ const ColorPicker = class {
2805
2863
  this.drawActiveColorFieldColor();
2806
2864
  }
2807
2865
  setCanvasContextSize(canvas, { height, width }) {
2866
+ if (!canvas) {
2867
+ return;
2868
+ }
2808
2869
  const devicePixelRatio = window.devicePixelRatio || 1;
2809
2870
  canvas.width = width * devicePixelRatio;
2810
2871
  canvas.height = height * devicePixelRatio;
@@ -2813,21 +2874,21 @@ const ColorPicker = class {
2813
2874
  const context = canvas.getContext("2d");
2814
2875
  context.scale(devicePixelRatio, devicePixelRatio);
2815
2876
  }
2816
- updateCanvasSize(canvas) {
2817
- if (!canvas) {
2818
- return;
2877
+ updateCanvasSize(context = "all") {
2878
+ const { dimensions } = this;
2879
+ if (context === "all" || context === "color-field") {
2880
+ this.setCanvasContextSize(this.colorFieldRenderingContext?.canvas, dimensions.colorField);
2881
+ }
2882
+ const adjustedSliderDimensions = {
2883
+ width: dimensions.slider.width,
2884
+ height: dimensions.slider.height + (dimensions.thumb.radius - dimensions.slider.height / 2) * 2
2885
+ };
2886
+ if (context === "all" || context === "hue-slider") {
2887
+ this.setCanvasContextSize(this.hueSliderRenderingContext?.canvas, adjustedSliderDimensions);
2888
+ }
2889
+ if (context === "all" || context === "opacity-slider") {
2890
+ this.setCanvasContextSize(this.opacitySliderRenderingContext?.canvas, adjustedSliderDimensions);
2819
2891
  }
2820
- this.setCanvasContextSize(canvas, {
2821
- width: this.dimensions.colorField.width,
2822
- height: this.dimensions.colorField.height +
2823
- this.dimensions.slider.height +
2824
- this.getSliderCapSpacing() * 2
2825
- });
2826
- this.drawColorFieldAndSlider();
2827
- }
2828
- containsPoint(testPointX, testPointY, boundsX, boundsY, boundsRadius) {
2829
- return (Math.pow(testPointX - boundsX, 2) + Math.pow(testPointY - boundsY, 2) <=
2830
- Math.pow(boundsRadius, 2));
2831
2892
  }
2832
2893
  drawActiveColorFieldColor() {
2833
2894
  const { color } = this;
@@ -2842,22 +2903,23 @@ const ColorPicker = class {
2842
2903
  this.colorFieldScopeLeft = x;
2843
2904
  this.colorFieldScopeTop = y;
2844
2905
  });
2845
- this.drawThumb(this.fieldAndSliderRenderingContext, radius, x, y, hsvColor, this.hueThumbState);
2906
+ this.drawThumb(this.colorFieldRenderingContext, radius, x, y, hsvColor);
2846
2907
  }
2847
- drawThumb(context, radius, x, y, color, state) {
2908
+ drawThumb(context, radius, x, y, color) {
2848
2909
  const startAngle = 0;
2849
2910
  const endAngle = 2 * Math.PI;
2911
+ const outlineWidth = 1;
2912
+ radius = radius - outlineWidth;
2850
2913
  context.beginPath();
2851
2914
  context.arc(x, y, radius, startAngle, endAngle);
2852
- context.shadowBlur = state === "hover" ? 32 : 16;
2853
- context.shadowColor = `rgba(0, 0, 0, ${state === "drag" ? 0.32 : 0.16})`;
2854
2915
  context.fillStyle = "#fff";
2855
2916
  context.fill();
2917
+ context.strokeStyle = "rgba(0,0,0,0.3)";
2918
+ context.lineWidth = outlineWidth;
2919
+ context.stroke();
2856
2920
  context.beginPath();
2857
2921
  context.arc(x, y, radius - 3, startAngle, endAngle);
2858
- context.shadowBlur = 0;
2859
- context.shadowColor = "transparent";
2860
- context.fillStyle = color.rgb().string();
2922
+ context.fillStyle = color.rgb().alpha(1).string();
2861
2923
  context.fill();
2862
2924
  }
2863
2925
  drawActiveHueSliderColor() {
@@ -2866,18 +2928,19 @@ const ColorPicker = class {
2866
2928
  return;
2867
2929
  }
2868
2930
  const hsvColor = color.hsv().saturationv(100).value(100);
2869
- const { dimensions: { colorField: { height: colorFieldHeight }, slider: { height, width }, thumb: { radius } } } = this;
2931
+ const { dimensions: { slider: { height, width }, thumb: { radius } } } = this;
2870
2932
  const x = hsvColor.hue() / (360 / width);
2871
- const y = height / 2 + colorFieldHeight;
2933
+ const y = radius - height / 2 + height / 2;
2872
2934
  requestAnimationFrame(() => {
2873
2935
  this.hueScopeLeft = x;
2874
- this.hueScopeTop = y;
2875
2936
  });
2876
- this.drawThumb(this.fieldAndSliderRenderingContext, radius, x, y, hsvColor, this.sliderThumbState);
2937
+ this.drawThumb(this.hueSliderRenderingContext, radius, x, y, hsvColor);
2877
2938
  }
2878
2939
  drawHueSlider() {
2879
- const context = this.fieldAndSliderRenderingContext;
2880
- const { dimensions: { colorField: { height: colorFieldHeight }, slider: { height, width } } } = this;
2940
+ const context = this.hueSliderRenderingContext;
2941
+ const { dimensions: { slider: { height, width }, thumb: { radius: thumbRadius } } } = this;
2942
+ const x = 0;
2943
+ const y = thumbRadius - height / 2;
2881
2944
  const gradient = context.createLinearGradient(0, 0, width, 0);
2882
2945
  const hueSliderColorStopKeywords = ["red", "yellow", "lime", "cyan", "blue", "magenta", "red"];
2883
2946
  const offset = 1 / (hueSliderColorStopKeywords.length - 1);
@@ -2886,27 +2949,107 @@ const ColorPicker = class {
2886
2949
  gradient.addColorStop(currentOffset, color(keyword).string());
2887
2950
  currentOffset += offset;
2888
2951
  });
2952
+ context.clearRect(0, 0, width, height + this.getSliderCapSpacing() * 2);
2953
+ this.drawSliderPath(context, height, width, x, y);
2889
2954
  context.fillStyle = gradient;
2890
- context.clearRect(0, colorFieldHeight, width, height + this.getSliderCapSpacing() * 2);
2891
- context.fillRect(0, colorFieldHeight, width, height);
2955
+ context.fill();
2956
+ context.strokeStyle = "rgba(0,0,0,0.3)";
2957
+ context.lineWidth = 1;
2958
+ context.stroke();
2892
2959
  this.drawActiveHueSliderColor();
2893
2960
  }
2961
+ drawOpacitySlider() {
2962
+ const context = this.opacitySliderRenderingContext;
2963
+ const { baseColorFieldColor: previousColor, dimensions: { slider: { height, width }, thumb: { radius: thumbRadius } } } = this;
2964
+ const x = 0;
2965
+ const y = thumbRadius - height / 2;
2966
+ context.clearRect(0, 0, width, height + this.getSliderCapSpacing() * 2);
2967
+ const gradient = context.createLinearGradient(0, y, width, 0);
2968
+ const startColor = previousColor.rgb().alpha(0);
2969
+ const midColor = previousColor.rgb().alpha(0.5);
2970
+ const endColor = previousColor.rgb().alpha(1);
2971
+ gradient.addColorStop(0, startColor.string());
2972
+ gradient.addColorStop(0.5, midColor.string());
2973
+ gradient.addColorStop(1, endColor.string());
2974
+ this.drawSliderPath(context, height, width, x, y);
2975
+ const pattern = context.createPattern(this.getCheckeredBackgroundPattern(), "repeat");
2976
+ context.fillStyle = pattern;
2977
+ context.fill();
2978
+ context.fillStyle = gradient;
2979
+ context.fill();
2980
+ context.strokeStyle = "rgba(0,0,0,0.3)";
2981
+ context.lineWidth = 1;
2982
+ context.stroke();
2983
+ this.drawActiveOpacitySliderColor();
2984
+ }
2985
+ drawSliderPath(context, height, width, x, y) {
2986
+ const radius = height / 2 + 1;
2987
+ context.beginPath();
2988
+ context.moveTo(x + radius, y);
2989
+ context.lineTo(x + width - radius, y);
2990
+ context.quadraticCurveTo(x + width, y, x + width, y + radius);
2991
+ context.lineTo(x + width, y + height - radius);
2992
+ context.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);
2993
+ context.lineTo(x + radius, y + height);
2994
+ context.quadraticCurveTo(x, y + height, x, y + height - radius);
2995
+ context.lineTo(x, y + radius);
2996
+ context.quadraticCurveTo(x, y, x + radius, y);
2997
+ context.closePath();
2998
+ }
2999
+ getCheckeredBackgroundPattern() {
3000
+ if (this.checkerPattern) {
3001
+ return this.checkerPattern;
3002
+ }
3003
+ const pattern = document.createElement("canvas");
3004
+ pattern.width = 10;
3005
+ pattern.height = 10;
3006
+ const patternContext = pattern.getContext("2d");
3007
+ patternContext.fillStyle = "#ccc";
3008
+ patternContext.fillRect(0, 0, 10, 10);
3009
+ patternContext.fillStyle = "#fff";
3010
+ patternContext.fillRect(0, 0, 5, 5);
3011
+ patternContext.fillRect(5, 5, 5, 5);
3012
+ this.checkerPattern = pattern;
3013
+ return pattern;
3014
+ }
3015
+ drawActiveOpacitySliderColor() {
3016
+ const { color } = this;
3017
+ if (!color) {
3018
+ return;
3019
+ }
3020
+ const hsvColor = color;
3021
+ const { dimensions: { slider: { width }, thumb: { radius } } } = this;
3022
+ const x = alphaToOpacity(hsvColor.alpha()) / (OPACITY_LIMITS.max / width);
3023
+ const y = radius;
3024
+ requestAnimationFrame(() => {
3025
+ this.opacityScopeLeft = x;
3026
+ });
3027
+ this.drawThumb(this.opacitySliderRenderingContext, radius, x, y, hsvColor);
3028
+ }
2894
3029
  updateColorFromChannels(channels) {
2895
3030
  this.internalColorSet(color(channels, this.channelMode));
2896
3031
  }
2897
3032
  updateChannelsFromColor(color) {
2898
- this.channels = color ? this.toChannels(color) : [null, null, null];
3033
+ this.channels = color ? this.toChannels(color) : [null, null, null, null];
2899
3034
  }
2900
3035
  toChannels(color) {
2901
3036
  const { channelMode } = this;
2902
- return color[channelMode]()
3037
+ const channels = color[channelMode]()
2903
3038
  .array()
2904
- .map((value) => Math.floor(value));
3039
+ .map((value, index) => {
3040
+ const isAlpha = index === 3;
3041
+ return isAlpha ? value : Math.floor(value);
3042
+ });
3043
+ if (channels.length === 3) {
3044
+ channels.push(1); // Color omits alpha when 1
3045
+ }
3046
+ return channels;
2905
3047
  }
2906
3048
  static get delegatesFocus() { return true; }
2907
3049
  static get assetsDirs() { return ["assets"]; }
2908
3050
  get el() { return getElement(this); }
2909
3051
  static get watchers() { return {
3052
+ "alphaChannel": ["handleAlphaChannelChange"],
2910
3053
  "color": ["handleColorChange"],
2911
3054
  "format": ["handleFormatChange"],
2912
3055
  "scale": ["handleScaleChange"],
@@ -2919,43 +3062,131 @@ ColorPicker.style = colorPickerCss;
2919
3062
 
2920
3063
  const CSS$1 = {
2921
3064
  container: "container",
2922
- preview: "preview",
2923
- input: "input"
3065
+ hexInput: "hex-input",
3066
+ opacityInput: "opacity-input"
2924
3067
  };
2925
3068
 
2926
- 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}";
3069
+ 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: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}";
2927
3070
 
2928
3071
  const DEFAULT_COLOR = color();
2929
3072
  const ColorPickerHexInput = class {
2930
3073
  constructor(hostRef) {
2931
3074
  registerInstance(this, hostRef);
2932
3075
  this.calciteColorPickerHexInputChange = createEvent(this, "calciteColorPickerHexInputChange", 6);
2933
- this.onCalciteInternalInputBlur = () => {
2934
- const node = this.inputNode;
3076
+ this.onHexInputBlur = () => {
3077
+ const node = this.hexInputNode;
2935
3078
  const inputValue = node.value;
2936
3079
  const hex = `#${inputValue}`;
2937
- const willClearValue = this.allowEmpty && !inputValue;
2938
- if (willClearValue || (isValidHex(hex) && isLonghandHex(hex))) {
3080
+ const { allowEmpty, internalColor } = this;
3081
+ const willClearValue = allowEmpty && !inputValue;
3082
+ const isLonghand = isLonghandHex(hex);
3083
+ if (willClearValue || (isValidHex(hex) && isLonghand)) {
2939
3084
  return;
2940
3085
  }
2941
3086
  // manipulating DOM directly since rerender doesn't update input value
2942
3087
  node.value =
2943
- this.allowEmpty && !this.internalColor
3088
+ allowEmpty && !internalColor
2944
3089
  ? ""
2945
- : this.formatForInternalInput(rgbToHex(this.internalColor.object()));
3090
+ : this.formatHexForInternalInput(rgbToHex(
3091
+ // always display hex input in RRGGBB format
3092
+ internalColor.object()));
3093
+ };
3094
+ this.onOpacityInputBlur = () => {
3095
+ const node = this.opacityInputNode;
3096
+ const inputValue = node.value;
3097
+ const { allowEmpty, internalColor } = this;
3098
+ const willClearValue = allowEmpty && !inputValue;
3099
+ if (willClearValue) {
3100
+ return;
3101
+ }
3102
+ // manipulating DOM directly since rerender doesn't update input value
3103
+ node.value =
3104
+ allowEmpty && !internalColor ? "" : this.formatOpacityForInternalInput(internalColor);
3105
+ };
3106
+ this.onHexInputChange = () => {
3107
+ const nodeValue = this.hexInputNode.value;
3108
+ let value = nodeValue;
3109
+ if (value) {
3110
+ const normalized = normalizeHex(value, false);
3111
+ const preserveExistingAlpha = isValidHex(normalized) && this.alphaChannel;
3112
+ if (preserveExistingAlpha && this.internalColor) {
3113
+ const alphaHex = normalizeHex(this.internalColor.hexa(), true).slice(-2);
3114
+ value = `${normalized + alphaHex}`;
3115
+ }
3116
+ }
3117
+ this.internalSetValue(value, this.value);
2946
3118
  };
2947
- this.onInputChange = () => {
2948
- this.internalSetValue(this.inputNode.value, this.value);
3119
+ this.onOpacityInputChange = () => {
3120
+ const node = this.opacityInputNode;
3121
+ let value;
3122
+ if (!node.value) {
3123
+ value = node.value;
3124
+ }
3125
+ else {
3126
+ const alpha = opacityToAlpha(Number(node.value));
3127
+ value = this.internalColor?.alpha(alpha).hexa();
3128
+ }
3129
+ this.internalSetValue(value, this.value);
3130
+ };
3131
+ this.onInputKeyDown = (event) => {
3132
+ const { altKey, ctrlKey, metaKey, shiftKey } = event;
3133
+ const { alphaChannel, hexInputNode, internalColor, value } = this;
3134
+ const { key } = event;
3135
+ const composedPath = event.composedPath();
3136
+ if (key === "Tab" || key === "Enter") {
3137
+ if (composedPath.includes(hexInputNode)) {
3138
+ this.onHexInputChange();
3139
+ }
3140
+ else {
3141
+ this.onOpacityInputChange();
3142
+ }
3143
+ if (key === "Enter") {
3144
+ event.preventDefault();
3145
+ }
3146
+ return;
3147
+ }
3148
+ const isNudgeKey = key === "ArrowDown" || key === "ArrowUp";
3149
+ const oldValue = this.value;
3150
+ if (isNudgeKey) {
3151
+ if (!value) {
3152
+ this.internalSetValue(this.previousNonNullValue, oldValue);
3153
+ event.preventDefault();
3154
+ return;
3155
+ }
3156
+ const direction = key === "ArrowUp" ? 1 : -1;
3157
+ const bump = shiftKey ? 10 : 1;
3158
+ this.internalSetValue(hexify(this.nudgeRGBChannels(internalColor, bump * direction, composedPath.includes(hexInputNode) ? "rgb" : "a"), alphaChannel), oldValue);
3159
+ event.preventDefault();
3160
+ return;
3161
+ }
3162
+ const withModifiers = altKey || ctrlKey || metaKey;
3163
+ const singleChar = key.length === 1;
3164
+ const validHexChar = hexChar.test(key);
3165
+ if (singleChar && !withModifiers && !validHexChar) {
3166
+ event.preventDefault();
3167
+ }
3168
+ };
3169
+ this.onHexInputPaste = (event) => {
3170
+ const hex = event.clipboardData.getData("text");
3171
+ if (isValidHex(hex)) {
3172
+ event.preventDefault();
3173
+ this.hexInputNode.value = hex.slice(1);
3174
+ }
2949
3175
  };
2950
3176
  this.previousNonNullValue = this.value;
2951
- this.storeInputRef = (node) => {
2952
- this.inputNode = node;
3177
+ this.storeHexInputRef = (node) => {
3178
+ this.hexInputNode = node;
3179
+ };
3180
+ this.storeOpacityInputRef = (node) => {
3181
+ this.opacityInputNode = node;
2953
3182
  };
2954
- this.hexLabel = "Hex";
2955
3183
  this.allowEmpty = false;
2956
- this.scale = "m";
2957
- this.value = normalizeHex(DEFAULT_COLOR.hex());
3184
+ this.alphaChannel = false;
3185
+ this.hexLabel = "Hex";
3186
+ this.messages = undefined;
2958
3187
  this.numberingSystem = undefined;
3188
+ this.scale = "m";
3189
+ this.value = normalizeHex(hexify(DEFAULT_COLOR, this.alphaChannel), this.alphaChannel, true);
2959
3190
  this.internalColor = DEFAULT_COLOR;
2960
3191
  }
2961
3192
  //--------------------------------------------------------------------------
@@ -2964,10 +3195,10 @@ const ColorPickerHexInput = class {
2964
3195
  //
2965
3196
  //--------------------------------------------------------------------------
2966
3197
  connectedCallback() {
2967
- const { allowEmpty, value } = this;
3198
+ const { allowEmpty, alphaChannel, value } = this;
2968
3199
  if (value) {
2969
- const normalized = normalizeHex(value);
2970
- if (isValidHex(normalized)) {
3200
+ const normalized = normalizeHex(value, alphaChannel);
3201
+ if (isValidHex(normalized, alphaChannel)) {
2971
3202
  this.internalSetValue(normalized, normalized, false);
2972
3203
  }
2973
3204
  return;
@@ -2985,54 +3216,21 @@ const ColorPickerHexInput = class {
2985
3216
  handleValueChange(value, oldValue) {
2986
3217
  this.internalSetValue(value, oldValue, false);
2987
3218
  }
2988
- // using @Listen as a workaround for VDOM listener not firing
2989
- onInputKeyDown(event) {
2990
- const { altKey, ctrlKey, metaKey, shiftKey } = event;
2991
- const { internalColor, value } = this;
2992
- const { key } = event;
2993
- if (key === "Tab" || key === "Enter") {
2994
- this.onInputChange();
2995
- return;
2996
- }
2997
- const isNudgeKey = key === "ArrowDown" || key === "ArrowUp";
2998
- const oldValue = this.value;
2999
- if (isNudgeKey) {
3000
- if (!value) {
3001
- this.internalSetValue(this.previousNonNullValue, oldValue);
3002
- event.preventDefault();
3003
- return;
3004
- }
3005
- const direction = key === "ArrowUp" ? 1 : -1;
3006
- const bump = shiftKey ? 10 : 1;
3007
- this.internalSetValue(normalizeHex(this.nudgeRGBChannels(internalColor, bump * direction).hex()), oldValue);
3008
- event.preventDefault();
3009
- return;
3010
- }
3011
- const withModifiers = altKey || ctrlKey || metaKey;
3012
- const singleChar = key.length === 1;
3013
- const validHexChar = hexChar.test(key);
3014
- if (singleChar && !withModifiers && !validHexChar) {
3015
- event.preventDefault();
3016
- }
3017
- }
3018
- onPaste(event) {
3019
- const hex = event.clipboardData.getData("text");
3020
- if (isValidHex(hex)) {
3021
- event.preventDefault();
3022
- this.inputNode.value = hex.slice(1);
3023
- }
3024
- }
3025
3219
  //--------------------------------------------------------------------------
3026
3220
  //
3027
3221
  // Lifecycle
3028
3222
  //
3029
3223
  //--------------------------------------------------------------------------
3030
3224
  render() {
3031
- const { value } = this;
3032
- const hexInputValue = this.formatForInternalInput(value);
3033
- return (h("div", { class: CSS$1.container }, 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,
3225
+ const { alphaChannel, hexLabel, internalColor, messages, scale, value } = this;
3226
+ const hexInputValue = this.formatHexForInternalInput(value);
3227
+ const opacityInputValue = this.formatOpacityForInternalInput(internalColor);
3228
+ const inputScale = scale === "l" ? "m" : "s";
3229
+ return (h("div", { class: CSS$1.container }, 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,
3230
+ // eslint-disable-next-line react/jsx-sort-props
3231
+ ref: this.storeHexInputRef }), alphaChannel ? (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,
3034
3232
  // eslint-disable-next-line react/jsx-sort-props
3035
- ref: this.storeInputRef }), hexInputValue ? (h("calcite-color-picker-swatch", { active: true, class: CSS$1.preview, color: `#${hexInputValue}`, scale: this.scale })) : null));
3233
+ ref: this.storeOpacityInputRef })) : null));
3036
3234
  }
3037
3235
  //--------------------------------------------------------------------------
3038
3236
  //
@@ -3042,7 +3240,7 @@ const ColorPickerHexInput = class {
3042
3240
  /** Sets focus on the component. */
3043
3241
  async setFocus() {
3044
3242
  await componentLoaded(this);
3045
- focusElement(this.inputNode);
3243
+ focusElement(this.hexInputNode);
3046
3244
  }
3047
3245
  //--------------------------------------------------------------------------
3048
3246
  //
@@ -3051,13 +3249,17 @@ const ColorPickerHexInput = class {
3051
3249
  //--------------------------------------------------------------------------
3052
3250
  internalSetValue(value, oldValue, emit = true) {
3053
3251
  if (value) {
3054
- const normalized = normalizeHex(value);
3055
- if (isValidHex(normalized)) {
3056
- const { internalColor } = this;
3057
- const changed = !internalColor || normalized !== normalizeHex(internalColor.hex());
3058
- this.internalColor = color(normalized);
3059
- this.previousNonNullValue = normalized;
3060
- this.value = normalized;
3252
+ const { alphaChannel } = this;
3253
+ const normalized = normalizeHex(value, alphaChannel, alphaChannel);
3254
+ if (isValidHex(normalized, alphaChannel)) {
3255
+ const { internalColor: currentColor } = this;
3256
+ const nextColor = color(normalized);
3257
+ const normalizedLonghand = normalizeHex(hexify(nextColor, alphaChannel), alphaChannel);
3258
+ const changed = !currentColor ||
3259
+ normalizedLonghand !== normalizeHex(hexify(currentColor, alphaChannel), alphaChannel);
3260
+ this.internalColor = nextColor;
3261
+ this.previousNonNullValue = normalizedLonghand;
3262
+ this.value = normalizedLonghand;
3061
3263
  if (changed && emit) {
3062
3264
  this.calciteColorPickerHexInputChange.emit();
3063
3265
  }
@@ -3074,16 +3276,28 @@ const ColorPickerHexInput = class {
3074
3276
  }
3075
3277
  this.value = oldValue;
3076
3278
  }
3077
- formatForInternalInput(hex) {
3078
- return hex ? hex.replace("#", "") : "";
3279
+ formatHexForInternalInput(hex) {
3280
+ return hex ? hex.replace("#", "").slice(0, 6) : "";
3079
3281
  }
3080
- nudgeRGBChannels(color$1, amount) {
3081
- return color.rgb(color$1.array().map((channel) => channel + amount));
3282
+ formatOpacityForInternalInput(color) {
3283
+ return color ? `${alphaToOpacity(color.alpha())}` : "";
3082
3284
  }
3083
- handleKeyDown(event) {
3084
- if (event.key === "Enter") {
3085
- event.preventDefault();
3285
+ nudgeRGBChannels(color$1, amount, context) {
3286
+ let nudgedChannels;
3287
+ const channels = color$1.array();
3288
+ const rgbChannels = channels.slice(0, 3);
3289
+ if (context === "rgb") {
3290
+ const nudgedRGBChannels = rgbChannels.map((channel) => channel + amount);
3291
+ nudgedChannels = [
3292
+ ...nudgedRGBChannels,
3293
+ this.alphaChannel ? channels[3] : undefined
3294
+ ];
3295
+ }
3296
+ else {
3297
+ const nudgedAlpha = opacityToAlpha(alphaToOpacity(color$1.alpha()) + amount);
3298
+ nudgedChannels = [...rgbChannels, nudgedAlpha];
3086
3299
  }
3300
+ return color(nudgedChannels);
3087
3301
  }
3088
3302
  get el() { return getElement(this); }
3089
3303
  static get watchers() { return {
@@ -3094,14 +3308,20 @@ ColorPickerHexInput.style = colorPickerHexInputCss;
3094
3308
 
3095
3309
  const CSS = {
3096
3310
  swatch: "swatch",
3097
- noColorIcon: "no-color-icon"
3311
+ noColorSwatch: "swatch--no-color",
3312
+ checker: "checker"
3098
3313
  };
3099
3314
  const COLORS = {
3100
3315
  borderLight: "rgba(0, 0, 0, 0.3)",
3101
3316
  borderDark: "rgba(255, 255, 255, 0.15)"
3102
3317
  };
3318
+ const checkerSquareSize = 4;
3319
+ const CHECKER_DIMENSIONS = {
3320
+ squareSize: checkerSquareSize,
3321
+ size: checkerSquareSize * 2
3322
+ };
3103
3323
 
3104
- 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%}";
3324
+ 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: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}";
3105
3325
 
3106
3326
  const ColorPickerSwatch = class {
3107
3327
  constructor(hostRef) {
@@ -3111,7 +3331,7 @@ const ColorPickerSwatch = class {
3111
3331
  this.scale = "m";
3112
3332
  }
3113
3333
  handleColorChange(color$1) {
3114
- this.internalColor = color(color$1);
3334
+ this.internalColor = color$1 ? color(color$1) : null;
3115
3335
  }
3116
3336
  //--------------------------------------------------------------------------
3117
3337
  //
@@ -3122,12 +3342,38 @@ const ColorPickerSwatch = class {
3122
3342
  this.handleColorChange(this.color);
3123
3343
  }
3124
3344
  render() {
3345
+ const isEmpty = !this.internalColor;
3346
+ const classes = {
3347
+ [CSS.swatch]: true,
3348
+ [CSS.noColorSwatch]: isEmpty
3349
+ };
3350
+ return (h("svg", { class: classes, xmlns: "http://www.w3.org/2000/svg" }, this.renderSwatch()));
3351
+ }
3352
+ renderSwatch() {
3125
3353
  const { active, el, internalColor } = this;
3126
3354
  const borderRadius = active ? "100%" : "0";
3127
- const hex = internalColor.hex();
3128
3355
  const theme = getModeName(el);
3129
3356
  const borderColor = theme === "light" ? COLORS.borderLight : COLORS.borderDark;
3130
- return (h("svg", { class: CSS.swatch, xmlns: "http://www.w3.org/2000/svg" }, h("title", null, hex), h("rect", { fill: hex, height: "100%", id: "swatch", rx: borderRadius, stroke: borderColor, "stroke-width": "2", style: { "clip-path": `inset(0 round ${borderRadius})` }, width: "100%" })));
3357
+ const commonSwatchProps = {
3358
+ height: "100%",
3359
+ rx: borderRadius,
3360
+ stroke: borderColor,
3361
+ // stroke-width and clip-path are needed to hide overflowing portion of stroke
3362
+ // see https://stackoverflow.com/a/7273346/194216
3363
+ // using attribute to work around Stencil using the prop name vs the attribute when rendering
3364
+ ["stroke-width"]: "2",
3365
+ width: "100%"
3366
+ };
3367
+ const isEmpty = !internalColor;
3368
+ if (isEmpty) {
3369
+ return (h(Fragment, null, h("clipPath", { id: "shape" }, h("rect", { height: "100%", rx: borderRadius, width: "100%" })), h("rect", { "clip-path": `inset(0 round ${borderRadius})`, rx: borderRadius, ...commonSwatchProps }), h("line", { "clip-path": "url(#shape)", "stroke-width": "3", x1: "100%", x2: "0", y1: "0", y2: "100%" })));
3370
+ }
3371
+ const alpha = internalColor.alpha();
3372
+ const hex = hexify(internalColor);
3373
+ const hexa = hexify(internalColor, alpha < 1);
3374
+ return (h(Fragment, null, h("title", null, hexa), h("defs", null, h("pattern", { height: CHECKER_DIMENSIONS.size, id: "checker", patternUnits: "userSpaceOnUse", width: CHECKER_DIMENSIONS.size, x: "0", y: "0" }, h("rect", { class: CSS.checker, height: CHECKER_DIMENSIONS.squareSize, width: CHECKER_DIMENSIONS.squareSize, x: "0", y: "0" }), h("rect", { class: CSS.checker, height: CHECKER_DIMENSIONS.squareSize, width: CHECKER_DIMENSIONS.squareSize, x: CHECKER_DIMENSIONS.squareSize, y: CHECKER_DIMENSIONS.squareSize }))), h("rect", { fill: "url(#checker)", height: "100%", rx: borderRadius, width: "100%" }), h("rect", { fill: hex, style: {
3375
+ "clip-path": alpha < 1 ? "polygon(100% 0, 0 0, 0 100%)" : `inset(0 round ${borderRadius})`
3376
+ }, ...commonSwatchProps }), alpha < 1 ? (h("rect", { fill: hexa, key: "opacity-fill", style: { "clip-path": "polygon(100% 0, 100% 100%, 0 100%)" }, ...commonSwatchProps })) : null));
3131
3377
  }
3132
3378
  get el() { return getElement(this); }
3133
3379
  static get watchers() { return {