@esri/calcite-components 1.0.0-beta.79 → 1.0.0-beta.82

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 (1136) hide show
  1. package/dist/calcite/assets/icon/compactness16.json +1 -0
  2. package/dist/calcite/assets/icon/compactness24.json +1 -0
  3. package/dist/calcite/assets/icon/compactness32.json +1 -0
  4. package/dist/calcite/assets/icon/configure16.json +1 -0
  5. package/dist/calcite/assets/icon/configure24.json +1 -0
  6. package/dist/calcite/assets/icon/configure32.json +1 -0
  7. package/dist/calcite/assets/icon/debugScript16.json +1 -0
  8. package/dist/calcite/assets/icon/debugScript24.json +1 -0
  9. package/dist/calcite/assets/icon/debugScript32.json +1 -0
  10. package/dist/calcite/assets/icon/dissolveFeatures16.json +1 -0
  11. package/dist/calcite/assets/icon/dissolveFeatures24.json +1 -0
  12. package/dist/calcite/assets/icon/dissolveFeatures32.json +1 -0
  13. package/dist/calcite/assets/icon/distanceType16.json +1 -0
  14. package/dist/calcite/assets/icon/distanceType24.json +1 -0
  15. package/dist/calcite/assets/icon/distanceType32.json +1 -0
  16. package/dist/calcite/assets/icon/fileEcd16.json +1 -0
  17. package/dist/calcite/assets/icon/fileEcd24.json +1 -0
  18. package/dist/calcite/assets/icon/fileEcd32.json +1 -0
  19. package/dist/calcite/assets/icon/gridDiamond16.json +1 -0
  20. package/dist/calcite/assets/icon/gridDiamond24.json +1 -0
  21. package/dist/calcite/assets/icon/gridDiamond32.json +1 -0
  22. package/dist/calcite/assets/icon/gridHexagon16.json +1 -0
  23. package/dist/calcite/assets/icon/gridHexagon24.json +1 -0
  24. package/dist/calcite/assets/icon/gridHexagon32.json +1 -0
  25. package/dist/calcite/assets/icon/gridTriangle16.json +1 -0
  26. package/dist/calcite/assets/icon/gridTriangle24.json +1 -0
  27. package/dist/calcite/assets/icon/gridTriangle32.json +1 -0
  28. package/dist/calcite/assets/icon/insets16.json +1 -0
  29. package/dist/calcite/assets/icon/insets24.json +1 -0
  30. package/dist/calcite/assets/icon/insets32.json +1 -0
  31. package/dist/calcite/assets/icon/maximumTerritoryDistance16.json +1 -0
  32. package/dist/calcite/assets/icon/maximumTerritoryDistance24.json +1 -0
  33. package/dist/calcite/assets/icon/maximumTerritoryDistance32.json +1 -0
  34. package/dist/calcite/assets/icon/minDistanceBetweenCenters16.json +1 -0
  35. package/dist/calcite/assets/icon/minDistanceBetweenCenters24.json +1 -0
  36. package/dist/calcite/assets/icon/minDistanceBetweenCenters32.json +1 -0
  37. package/dist/calcite/assets/icon/numberOfTerritories16.json +1 -0
  38. package/dist/calcite/assets/icon/numberOfTerritories24.json +1 -0
  39. package/dist/calcite/assets/icon/numberOfTerritories32.json +1 -0
  40. package/dist/calcite/assets/icon/overlapFeatures16.json +1 -0
  41. package/dist/calcite/assets/icon/overlapFeatures24.json +1 -0
  42. package/dist/calcite/assets/icon/overlapFeatures32.json +1 -0
  43. package/dist/calcite/assets/icon/profileVariables16.json +1 -0
  44. package/dist/calcite/assets/icon/profileVariables24.json +1 -0
  45. package/dist/calcite/assets/icon/profileVariables32.json +1 -0
  46. package/dist/calcite/assets/icon/rasterAnalysis16.json +1 -0
  47. package/dist/calcite/assets/icon/rasterAnalysis24.json +1 -0
  48. package/dist/calcite/assets/icon/rasterAnalysis32.json +1 -0
  49. package/dist/calcite/assets/icon/recurrence16.json +1 -0
  50. package/dist/calcite/assets/icon/recurrence24.json +1 -0
  51. package/dist/calcite/assets/icon/recurrence32.json +1 -0
  52. package/dist/calcite/assets/icon/splitFeatures16.json +1 -0
  53. package/dist/calcite/assets/icon/splitFeatures24.json +1 -0
  54. package/dist/calcite/assets/icon/splitFeatures32.json +1 -0
  55. package/dist/calcite/assets/icon/territoryBufferDistance16.json +1 -0
  56. package/dist/calcite/assets/icon/territoryBufferDistance24.json +1 -0
  57. package/dist/calcite/assets/icon/territoryBufferDistance32.json +1 -0
  58. package/dist/calcite/assets/icon/testData16.json +1 -0
  59. package/dist/calcite/assets/icon/testData24.json +1 -0
  60. package/dist/calcite/assets/icon/testData32.json +1 -0
  61. package/dist/calcite/calcite.esm.js +2 -1
  62. package/dist/calcite/calcite.js +1 -1
  63. package/dist/calcite/index.esm.js +1 -0
  64. package/dist/calcite/p-01386e9f.entry.js +6 -0
  65. package/dist/calcite/p-01dc5605.entry.js +6 -0
  66. package/dist/calcite/p-0349dbb1.system.js +6 -0
  67. package/dist/calcite/{p-cbc6fee6.entry.js → p-03f1df01.entry.js} +2 -1
  68. package/dist/calcite/p-06320e6a.entry.js +6 -0
  69. package/dist/calcite/p-06d14664.system.entry.js +6 -0
  70. package/dist/calcite/p-0985e4df.system.entry.js +6 -0
  71. package/dist/calcite/p-09c7a130.system.entry.js +6 -0
  72. package/dist/calcite/p-0c41044b.entry.js +6 -0
  73. package/dist/calcite/{p-079a3322.js → p-0dbcb343.js} +1 -0
  74. package/dist/calcite/{p-2d09cc25.js → p-1094dab2.js} +1 -0
  75. package/dist/calcite/{p-569150ab.system.entry.js → p-11d0e13f.system.entry.js} +2 -1
  76. package/dist/calcite/p-164bea30.system.js +6 -0
  77. package/dist/calcite/{p-63624a01.js → p-18bcf729.js} +1 -0
  78. package/dist/calcite/{p-97904e9a.entry.js → p-1af2a45c.entry.js} +2 -1
  79. package/dist/calcite/p-20f86b1d.entry.js +6 -0
  80. package/dist/calcite/p-21dbd253.system.js +6 -0
  81. package/dist/calcite/{p-b2493735.entry.js → p-23a643c6.entry.js} +2 -1
  82. package/dist/calcite/{p-496e907a.system.entry.js → p-23ab0d5a.system.entry.js} +2 -1
  83. package/dist/calcite/{p-78bc502f.entry.js → p-2681265e.entry.js} +2 -1
  84. package/dist/calcite/p-27de1d41.entry.js +6 -0
  85. package/dist/calcite/{p-1aded388.system.entry.js → p-28dc602c.system.entry.js} +2 -1
  86. package/dist/calcite/p-2e9f9de6.system.entry.js +6 -0
  87. package/dist/calcite/{p-6ed27595.system.entry.js → p-2f977a66.system.entry.js} +2 -1
  88. package/dist/calcite/{p-7b8707b2.system.js → p-30dfc127.system.js} +1 -0
  89. package/dist/calcite/p-33694839.js +12 -0
  90. package/dist/calcite/{p-31c58f25.entry.js → p-33d317d6.entry.js} +2 -1
  91. package/dist/calcite/p-358263ac.system.js +6 -0
  92. package/dist/calcite/{p-7ed4c551.system.js → p-3819513d.system.js} +1 -0
  93. package/dist/calcite/p-3b01dd13.system.entry.js +6 -0
  94. package/dist/calcite/{p-cafd98e8.entry.js → p-3c3ec245.entry.js} +2 -1
  95. package/dist/calcite/p-3c78a381.entry.js +6 -0
  96. package/dist/calcite/p-3de000e5.system.js +6 -0
  97. package/dist/calcite/p-3e21c354.entry.js +6 -0
  98. package/dist/calcite/{p-3b4662a5.entry.js → p-3e92df28.entry.js} +2 -1
  99. package/dist/calcite/p-410b7a2a.system.entry.js +6 -0
  100. package/dist/calcite/{p-588bfa74.system.js → p-43d72920.system.js} +2 -1
  101. package/dist/calcite/{p-4eae61c5.entry.js → p-44061788.entry.js} +2 -1
  102. package/dist/calcite/{p-ef17447d.system.entry.js → p-446cb0a3.system.entry.js} +2 -1
  103. package/dist/calcite/{p-3e9d96c6.system.entry.js → p-474380ed.system.entry.js} +2 -1
  104. package/dist/calcite/{p-ea4119b1.system.entry.js → p-4a6fda6a.system.entry.js} +2 -1
  105. package/dist/calcite/{p-bdcb43b1.system.entry.js → p-4c3ce7bd.system.entry.js} +2 -1
  106. package/dist/calcite/{p-3cdee187.system.entry.js → p-4cd8e82e.system.entry.js} +2 -1
  107. package/dist/calcite/{p-02d7cf64.system.entry.js → p-4f823472.system.entry.js} +2 -1
  108. package/dist/calcite/p-508a7e13.system.entry.js +6 -0
  109. package/dist/calcite/p-5234dd2e.system.entry.js +6 -0
  110. package/dist/calcite/{p-3c34f20d.system.js → p-55057483.system.js} +2 -1
  111. package/dist/calcite/{p-dd460534.system.entry.js → p-56096486.system.entry.js} +2 -1
  112. package/dist/calcite/p-5adf6e11.entry.js +6 -0
  113. package/dist/calcite/{p-765c9bef.entry.js → p-62e44703.entry.js} +2 -1
  114. package/dist/calcite/{p-8e0dd0af.system.entry.js → p-64f15878.system.entry.js} +2 -1
  115. package/dist/calcite/p-6592ebdb.system.entry.js +6 -0
  116. package/dist/calcite/p-66a7f499.system.entry.js +6 -0
  117. package/dist/calcite/p-676b5b1e.entry.js +6 -0
  118. package/dist/calcite/{p-3119ffce.system.js → p-68277cce.system.js} +1 -0
  119. package/dist/calcite/p-6945f08a.system.entry.js +6 -0
  120. package/dist/calcite/p-697ea587.system.entry.js +6 -0
  121. package/dist/calcite/p-6a27e2d9.entry.js +6 -0
  122. package/dist/calcite/p-6bf2e610.entry.js +6 -0
  123. package/dist/calcite/{p-ac4aec20.system.js → p-6ca6734d.system.js} +1 -0
  124. package/dist/calcite/p-6d1d2449.entry.js +6 -0
  125. package/dist/calcite/p-6e8677ae.entry.js +6 -0
  126. package/dist/calcite/{p-b06207bb.js → p-70f33b3e.js} +1 -0
  127. package/dist/calcite/p-7266932c.js +6 -0
  128. package/dist/calcite/p-73784058.js +6 -0
  129. package/dist/calcite/p-751b387d.system.entry.js +6 -0
  130. package/dist/calcite/p-76e2d427.system.js +6 -0
  131. package/dist/calcite/{p-18be4438.entry.js → p-792fd998.entry.js} +2 -1
  132. package/dist/calcite/{p-cc6e7726.entry.js → p-7ae35ad7.entry.js} +2 -1
  133. package/dist/calcite/p-7dcdfeac.entry.js +6 -0
  134. package/dist/calcite/{p-6b5776af.js → p-7f183647.js} +1 -0
  135. package/dist/calcite/{p-5bb4d012.entry.js → p-7f556dbd.entry.js} +2 -1
  136. package/dist/calcite/p-80d62897.entry.js +6 -0
  137. package/dist/calcite/{p-f344e163.entry.js → p-80e8926a.entry.js} +2 -1
  138. package/dist/calcite/p-82da0c62.entry.js +6 -0
  139. package/dist/calcite/p-83192ea5.system.js +12 -0
  140. package/dist/calcite/p-8319da8e.entry.js +6 -0
  141. package/dist/calcite/{p-963e9aec.system.entry.js → p-83cc50f2.system.entry.js} +2 -1
  142. package/dist/calcite/p-84cd0598.system.entry.js +6 -0
  143. package/dist/calcite/p-8505461f.entry.js +6 -0
  144. package/dist/calcite/p-86904d57.entry.js +6 -0
  145. package/dist/calcite/{p-2fae8516.system.entry.js → p-87698ac7.system.entry.js} +2 -1
  146. package/dist/calcite/{p-69d2d9cf.system.entry.js → p-87aae2e3.system.entry.js} +2 -1
  147. package/dist/calcite/{p-e095517f.system.js → p-88147c4a.system.js} +1 -0
  148. package/dist/calcite/{p-7fc69a9d.js → p-89b2f38d.js} +1 -0
  149. package/dist/calcite/p-8a87f2b7.system.entry.js +6 -0
  150. package/dist/calcite/{p-f78023f1.system.js → p-8b0ea955.system.js} +1 -0
  151. package/dist/calcite/p-8e0a0d74.system.entry.js +6 -0
  152. package/dist/calcite/p-9141d57e.entry.js +6 -0
  153. package/dist/calcite/p-954973e6.system.entry.js +6 -0
  154. package/dist/calcite/p-9802e5ca.entry.js +6 -0
  155. package/dist/calcite/p-9969deb4.system.entry.js +6 -0
  156. package/dist/calcite/{p-4570cf6c.js → p-997202fe.js} +2 -1
  157. package/dist/calcite/{p-03c92ad2.entry.js → p-9987d5e9.entry.js} +2 -1
  158. package/dist/calcite/p-9d9629d5.system.entry.js +6 -0
  159. package/dist/calcite/p-9f50e2fe.system.entry.js +6 -0
  160. package/dist/calcite/{p-c51699d3.system.js → p-a0f7fe5b.system.js} +3 -2
  161. package/dist/calcite/p-a1076e59.system.js +6 -0
  162. package/dist/calcite/p-a1f93b32.js +6 -0
  163. package/dist/calcite/{p-1fc943d5.system.entry.js → p-a3074bb4.system.entry.js} +2 -1
  164. package/dist/calcite/{p-4de6f4fd.system.js → p-a3d47df8.system.js} +1 -0
  165. package/dist/calcite/{p-65dbbfb5.system.js → p-a4729c51.system.js} +2 -1
  166. package/dist/calcite/{p-9ac86d6a.entry.js → p-a56b2d66.entry.js} +2 -1
  167. package/dist/calcite/{p-c2adeae4.entry.js → p-a66f170f.entry.js} +2 -1
  168. package/dist/calcite/{p-7bee4942.system.entry.js → p-aaad5997.system.entry.js} +2 -1
  169. package/dist/calcite/p-aadce719.entry.js +6 -0
  170. package/dist/calcite/p-ad58c01e.system.js +6 -0
  171. package/dist/calcite/{p-48637359.system.entry.js → p-aea7886a.system.entry.js} +2 -1
  172. package/dist/calcite/p-aeaaccdf.entry.js +6 -0
  173. package/dist/calcite/{p-7432e5ef.system.entry.js → p-b2947a00.system.entry.js} +2 -1
  174. package/dist/calcite/p-b571cc54.system.entry.js +6 -0
  175. package/dist/calcite/p-b8132e75.system.entry.js +6 -0
  176. package/dist/calcite/{p-05bf835f.js → p-bf2fe8b0.js} +2 -1
  177. package/dist/calcite/p-c665108b.entry.js +6 -0
  178. package/dist/calcite/{p-5394666a.entry.js → p-c76d3ea1.entry.js} +2 -1
  179. package/dist/calcite/p-c8919467.entry.js +6 -0
  180. package/dist/calcite/p-c9235ef4.entry.js +6 -0
  181. package/dist/calcite/p-c9f57b84.system.entry.js +6 -0
  182. package/dist/calcite/{p-a117af56.system.js → p-ca9efa2d.system.js} +1 -0
  183. package/dist/calcite/p-cc1b5a8a.entry.js +6 -0
  184. package/dist/calcite/p-cc425495.entry.js +6 -0
  185. package/dist/calcite/{p-5958acc8.system.js → p-cca09bde.system.js} +1 -0
  186. package/dist/calcite/p-cfbb3f0f.system.entry.js +6 -0
  187. package/dist/calcite/{p-e020662f.system.js → p-d04eb041.system.js} +1 -0
  188. package/dist/calcite/{p-482885ae.system.entry.js → p-d22143e9.system.entry.js} +2 -1
  189. package/dist/calcite/p-d2e3fa31.system.entry.js +6 -0
  190. package/dist/calcite/p-d38ffb30.js +6 -0
  191. package/dist/calcite/{p-cb57638c.system.js → p-d40e595b.system.js} +2 -1
  192. package/dist/calcite/p-d484cd1b.system.entry.js +6 -0
  193. package/dist/calcite/p-d6381f74.js +6 -0
  194. package/dist/calcite/p-d674d041.entry.js +6 -0
  195. package/dist/calcite/p-d76afd8f.entry.js +6 -0
  196. package/dist/calcite/p-da7761d3.js +6 -0
  197. package/dist/calcite/{p-8a63221d.js → p-dc14a2a0.js} +1 -0
  198. package/dist/calcite/p-dc1d1b83.entry.js +6 -0
  199. package/dist/calcite/{p-8ab345f2.js → p-dd444456.js} +2 -1
  200. package/dist/calcite/p-df476c53.system.entry.js +6 -0
  201. package/dist/calcite/p-e086d5bc.entry.js +6 -0
  202. package/dist/calcite/{p-a7770d75.entry.js → p-e0fb9338.entry.js} +2 -1
  203. package/dist/calcite/{p-34730e94.entry.js → p-e2bc1677.entry.js} +2 -1
  204. package/dist/calcite/{p-1d6404b5.system.js → p-e3ee7868.system.js} +1 -0
  205. package/dist/calcite/p-e45b2203.entry.js +6 -0
  206. package/dist/calcite/p-e575643a.js +6 -0
  207. package/dist/calcite/p-e68bfc88.system.entry.js +6 -0
  208. package/dist/calcite/p-e9357dcc.system.entry.js +6 -0
  209. package/dist/calcite/p-e95c755c.entry.js +6 -0
  210. package/dist/calcite/p-e9acab15.entry.js +6 -0
  211. package/dist/calcite/{p-0a5d059d.js → p-e9e1dee1.js} +1 -0
  212. package/dist/calcite/p-ed7aab50.system.entry.js +6 -0
  213. package/dist/calcite/p-edc5bf01.js +6 -0
  214. package/dist/calcite/p-ee5494db.system.entry.js +6 -0
  215. package/dist/calcite/{p-bd38ff21.js → p-ee9b4197.js} +1 -0
  216. package/dist/calcite/{p-052ba882.system.entry.js → p-ef059155.system.entry.js} +2 -1
  217. package/dist/calcite/p-f383e414.js +6 -0
  218. package/dist/calcite/{p-e66a8ca1.system.entry.js → p-f5394fa4.system.entry.js} +2 -1
  219. package/dist/calcite/p-f74193a3.js +6 -0
  220. package/dist/calcite/{p-6a541e77.system.js → p-f86fd5f9.system.js} +2 -1
  221. package/dist/calcite/p-f8d59d84.entry.js +6 -0
  222. package/dist/calcite/{p-8a7596e3.entry.js → p-fa2ce2ae.entry.js} +2 -1
  223. package/dist/calcite/p-faeb976d.system.entry.js +6 -0
  224. package/dist/calcite/p-fc2144e0.system.entry.js +6 -0
  225. package/dist/calcite/p-fcac8f9c.system.entry.js +6 -0
  226. package/dist/calcite/{p-a11ee541.system.entry.js → p-fd5d23d1.system.entry.js} +2 -1
  227. package/dist/calcite/p-fe972352.js +6 -0
  228. package/dist/cjs/{ExpandToggle-f7682a15.js → ExpandToggle-8c61677e.js} +6 -5
  229. package/dist/cjs/{Heading-ec707493.js → Heading-0cb5902d.js} +2 -1
  230. package/dist/cjs/{array-a5dedf5a.js → array-f1fe66d8.js} +1 -0
  231. package/dist/cjs/calcite-accordion_2.cjs.entry.js +5 -4
  232. package/dist/cjs/calcite-action-bar.cjs.entry.js +15 -21
  233. package/dist/cjs/calcite-action-group.cjs.entry.js +8 -7
  234. package/dist/cjs/calcite-action-menu.cjs.entry.js +26 -23
  235. package/dist/cjs/calcite-action-pad.cjs.entry.js +13 -22
  236. package/dist/cjs/calcite-action.cjs.entry.js +7 -4
  237. package/dist/cjs/calcite-alert.cjs.entry.js +7 -6
  238. package/dist/cjs/calcite-avatar.cjs.entry.js +6 -5
  239. package/dist/cjs/calcite-block_2.cjs.entry.js +20 -11
  240. package/dist/cjs/calcite-button.cjs.entry.js +19 -17
  241. package/dist/cjs/calcite-card.cjs.entry.js +7 -6
  242. package/dist/cjs/calcite-checkbox.cjs.entry.js +9 -8
  243. package/dist/cjs/calcite-chip.cjs.entry.js +13 -11
  244. package/dist/cjs/calcite-color-picker_3.cjs.entry.js +1354 -1367
  245. package/dist/cjs/calcite-combobox_3.cjs.entry.js +97 -55
  246. package/dist/cjs/calcite-date-picker_4.cjs.entry.js +44 -31
  247. package/dist/cjs/calcite-dropdown_3.cjs.entry.js +67 -45
  248. package/dist/cjs/calcite-fab.cjs.entry.js +5 -4
  249. package/dist/cjs/calcite-filter.cjs.entry.js +27 -20
  250. package/dist/cjs/calcite-flow.cjs.entry.js +4 -3
  251. package/dist/cjs/calcite-graph_2.cjs.entry.js +77 -47
  252. package/dist/cjs/calcite-handle.cjs.entry.js +5 -2
  253. package/dist/cjs/calcite-icon.cjs.entry.js +6 -5
  254. package/dist/cjs/calcite-inline-editable.cjs.entry.js +11 -12
  255. package/dist/cjs/calcite-input-date-picker.cjs.entry.js +59 -24
  256. package/dist/cjs/calcite-input-message.cjs.entry.js +4 -3
  257. package/dist/cjs/calcite-input-time-picker_2.cjs.entry.js +35 -20
  258. package/dist/cjs/calcite-input.cjs.entry.js +60 -37
  259. package/dist/cjs/calcite-label.cjs.entry.js +5 -4
  260. package/dist/cjs/calcite-link.cjs.entry.js +5 -4
  261. package/dist/cjs/calcite-list_3.cjs.entry.js +18 -11
  262. package/dist/cjs/calcite-loader.cjs.entry.js +3 -2
  263. package/dist/cjs/calcite-modal.cjs.entry.js +8 -7
  264. package/dist/cjs/calcite-notice.cjs.entry.js +7 -6
  265. package/dist/cjs/calcite-option_3.cjs.entry.js +8 -7
  266. package/dist/cjs/calcite-pagination.cjs.entry.js +2 -1
  267. package/dist/cjs/calcite-panel.cjs.entry.js +35 -11
  268. package/dist/cjs/calcite-pick-list_3.cjs.entry.js +18 -27
  269. package/dist/cjs/calcite-popover_2.cjs.entry.js +121 -49
  270. package/dist/cjs/calcite-progress.cjs.entry.js +2 -1
  271. package/dist/cjs/calcite-radio-button-group.cjs.entry.js +3 -2
  272. package/dist/cjs/calcite-radio-button.cjs.entry.js +9 -8
  273. package/dist/cjs/calcite-radio-group_2.cjs.entry.js +8 -7
  274. package/dist/cjs/calcite-rating.cjs.entry.js +7 -6
  275. package/dist/cjs/calcite-scrim.cjs.entry.js +2 -1
  276. package/dist/cjs/calcite-shell_3.cjs.entry.js +9 -8
  277. package/dist/cjs/calcite-sortable-list.cjs.entry.js +5 -4
  278. package/dist/cjs/calcite-split-button.cjs.entry.js +3 -2
  279. package/dist/cjs/calcite-stepper_2.cjs.entry.js +114 -105
  280. package/dist/cjs/calcite-switch.cjs.entry.js +9 -7
  281. package/dist/cjs/calcite-tab_4.cjs.entry.js +79 -62
  282. package/dist/cjs/calcite-tile-select_2.cjs.entry.js +4 -3
  283. package/dist/cjs/calcite-tile.cjs.entry.js +8 -7
  284. package/dist/cjs/calcite-tip_3.cjs.entry.js +12 -9
  285. package/dist/cjs/calcite-tooltip_2.cjs.entry.js +163 -137
  286. package/dist/cjs/calcite-tree_2.cjs.entry.js +15 -14
  287. package/dist/cjs/calcite-value-list_2.cjs.entry.js +27 -26
  288. package/dist/cjs/calcite.cjs.js +4 -3
  289. package/dist/cjs/{conditionalSlot-64f9bfd3.js → conditionalSlot-ba5cd797.js} +3 -2
  290. package/dist/cjs/{debounce-95979061.js → debounce-94d2834e.js} +1 -0
  291. package/dist/cjs/{dom-f3df220d.js → dom-9ac0341c.js} +20 -2
  292. package/dist/cjs/{forIn-a5d553af.js → forIn-9f737b26.js} +2 -1
  293. package/dist/cjs/{form-0ef859c8.js → form-11926121.js} +20 -2
  294. package/dist/cjs/{guid-b270f0db.js → guid-8b6d6cb4.js} +1 -0
  295. package/dist/cjs/{index-1af0efd3.js → index-5c65e149.js} +1 -3
  296. package/dist/cjs/index.cjs.js +1 -0
  297. package/dist/cjs/{interactive-87406231.js → interactive-e294111f.js} +1 -0
  298. package/dist/cjs/{interfaces-7216af30.js → interfaces-083f4502.js} +1 -0
  299. package/dist/cjs/{label-980508de.js → label-165fc611.js} +19 -18
  300. package/dist/cjs/loader.cjs.js +4 -3
  301. package/dist/cjs/{locale-02462821.js → locale-f2ebe4fa.js} +25 -24
  302. package/dist/cjs/{math-145c80e2.js → math-9d6de52c.js} +1 -0
  303. package/dist/cjs/{number-e813e801.js → number-364babbc.js} +2 -1
  304. package/dist/cjs/{observers-79bfb8bc.js → observers-d9fdf006.js} +1 -0
  305. package/dist/cjs/{popper-64d89ef7.js → popper-3f97eb01.js} +29 -3
  306. package/dist/cjs/{resources-ac80e82c.js → resources-1a214670.js} +1 -0
  307. package/dist/cjs/{resources-7811eb2c.js → resources-247d05d5.js} +3 -2
  308. package/dist/cjs/{resources-7d5449fb.js → resources-5da94c46.js} +1 -0
  309. package/dist/cjs/{resources-daf15d54.js → resources-684ec2e5.js} +20 -6
  310. package/dist/cjs/{sortable.esm-d7a4560b.js → sortable.esm-0005295a.js} +63 -54
  311. package/dist/cjs/{utils-6579522f.js → utils-51c079f6.js} +1 -0
  312. package/dist/collection/collection-manifest.json +4 -4
  313. package/dist/collection/components/accordion/accordion.js +1 -0
  314. package/dist/collection/components/accordion/interfaces.js +1 -0
  315. package/dist/collection/components/accordion-item/accordion-item.js +3 -2
  316. package/dist/collection/components/action/action.js +3 -1
  317. package/dist/collection/components/action/resources.js +1 -0
  318. package/dist/collection/components/action-bar/action-bar.js +6 -12
  319. package/dist/collection/components/action-bar/resources.js +1 -0
  320. package/dist/collection/components/action-bar/utils.js +1 -0
  321. package/dist/collection/components/action-group/action-group.js +1 -0
  322. package/dist/collection/components/action-group/resources.js +1 -0
  323. package/dist/collection/components/action-menu/action-menu.js +24 -21
  324. package/dist/collection/components/action-menu/resources.js +1 -0
  325. package/dist/collection/components/action-pad/action-pad.js +5 -16
  326. package/dist/collection/components/action-pad/resources.js +1 -0
  327. package/dist/collection/components/alert/alert.css +2 -6
  328. package/dist/collection/components/alert/alert.js +3 -2
  329. package/dist/collection/components/alert/interfaces.js +1 -0
  330. package/dist/collection/components/alert/resources.js +1 -0
  331. package/dist/collection/components/avatar/avatar.css +1 -1
  332. package/dist/collection/components/avatar/avatar.js +1 -0
  333. package/dist/collection/components/avatar/utils.js +1 -0
  334. package/dist/collection/components/block/block.js +19 -8
  335. package/dist/collection/components/block/resources.js +1 -0
  336. package/dist/collection/components/block-section/block-section.js +3 -2
  337. package/dist/collection/components/block-section/interfaces.js +1 -0
  338. package/dist/collection/components/block-section/resources.js +1 -0
  339. package/dist/collection/components/button/button.js +16 -13
  340. package/dist/collection/components/button/interfaces.js +1 -0
  341. package/dist/collection/components/button/resources.js +1 -0
  342. package/dist/collection/components/card/card.js +3 -2
  343. package/dist/collection/components/card/resources.js +1 -0
  344. package/dist/collection/components/checkbox/checkbox.css +5 -1
  345. package/dist/collection/components/checkbox/checkbox.js +3 -1
  346. package/dist/collection/components/chip/chip.css +21 -18
  347. package/dist/collection/components/chip/chip.js +4 -3
  348. package/dist/collection/components/chip/interfaces.js +1 -0
  349. package/dist/collection/components/chip/resources.js +4 -2
  350. package/dist/collection/components/color-picker/color-picker.css +2 -9
  351. package/dist/collection/components/color-picker/color-picker.js +19 -18
  352. package/dist/collection/components/color-picker/interfaces.js +1 -0
  353. package/dist/collection/components/color-picker/resources.js +1 -0
  354. package/dist/collection/components/color-picker/utils.js +1 -0
  355. package/dist/collection/components/color-picker-hex-input/color-picker-hex-input.js +45 -49
  356. package/dist/collection/components/color-picker-hex-input/resources.js +1 -0
  357. package/dist/collection/components/color-picker-swatch/color-picker-swatch.js +1 -0
  358. package/dist/collection/components/color-picker-swatch/resources.js +1 -0
  359. package/dist/collection/components/combobox/combobox.js +89 -44
  360. package/dist/collection/components/combobox/interfaces.js +1 -0
  361. package/dist/collection/components/combobox/resources.js +5 -0
  362. package/dist/collection/components/combobox/utils.js +1 -0
  363. package/dist/collection/components/combobox-item/combobox-item.css +1 -1
  364. package/dist/collection/components/combobox-item/combobox-item.js +2 -1
  365. package/dist/collection/components/combobox-item/resources.js +1 -0
  366. package/dist/collection/components/combobox-item-group/combobox-item-group.js +2 -1
  367. package/dist/collection/components/combobox-item-group/resources.js +1 -0
  368. package/dist/collection/components/date-picker/date-picker.js +7 -2
  369. package/dist/collection/components/date-picker/interfaces.js +1 -0
  370. package/dist/collection/components/date-picker/resources.js +1 -0
  371. package/dist/collection/components/date-picker/utils.js +1 -0
  372. package/dist/collection/components/date-picker-day/date-picker-day.css +0 -2
  373. package/dist/collection/components/date-picker-day/date-picker-day.js +1 -0
  374. package/dist/collection/components/date-picker-month/date-picker-month.js +2 -1
  375. package/dist/collection/components/date-picker-month-header/date-picker-month-header.js +28 -19
  376. package/dist/collection/components/dropdown/dropdown.js +54 -36
  377. package/dist/collection/components/dropdown/interfaces.js +1 -0
  378. package/dist/collection/components/dropdown/resources.js +1 -0
  379. package/dist/collection/components/dropdown-group/dropdown-group.js +1 -0
  380. package/dist/collection/components/dropdown-group/interfaces.js +1 -0
  381. package/dist/collection/components/dropdown-group/resources.js +1 -0
  382. package/dist/collection/components/dropdown-item/dropdown-item.js +14 -7
  383. package/dist/collection/components/dropdown-item/resources.js +1 -0
  384. package/dist/collection/components/fab/fab.js +1 -0
  385. package/dist/collection/components/fab/resources.js +1 -0
  386. package/dist/collection/components/filter/filter.js +20 -15
  387. package/dist/collection/components/filter/resources.js +3 -2
  388. package/dist/collection/components/flow/flow.css +1 -9
  389. package/dist/collection/components/flow/flow.js +1 -0
  390. package/dist/collection/components/flow/interfaces.js +1 -0
  391. package/dist/collection/components/flow/resources.js +1 -0
  392. package/dist/collection/components/functional/ExpandToggle.js +2 -1
  393. package/dist/collection/components/functional/Heading.js +1 -0
  394. package/dist/collection/components/graph/graph.js +1 -0
  395. package/dist/collection/components/graph/interfaces.js +1 -0
  396. package/dist/collection/components/graph/util.js +1 -0
  397. package/dist/collection/components/handle/handle.js +3 -1
  398. package/dist/collection/components/handle/resources.js +1 -0
  399. package/dist/collection/components/icon/assets/icon/compactness16.json +1 -0
  400. package/dist/collection/components/icon/assets/icon/compactness24.json +1 -0
  401. package/dist/collection/components/icon/assets/icon/compactness32.json +1 -0
  402. package/dist/collection/components/icon/assets/icon/configure16.json +1 -0
  403. package/dist/collection/components/icon/assets/icon/configure24.json +1 -0
  404. package/dist/collection/components/icon/assets/icon/configure32.json +1 -0
  405. package/dist/collection/components/icon/assets/icon/debugScript16.json +1 -0
  406. package/dist/collection/components/icon/assets/icon/debugScript24.json +1 -0
  407. package/dist/collection/components/icon/assets/icon/debugScript32.json +1 -0
  408. package/dist/collection/components/icon/assets/icon/dissolveFeatures16.json +1 -0
  409. package/dist/collection/components/icon/assets/icon/dissolveFeatures24.json +1 -0
  410. package/dist/collection/components/icon/assets/icon/dissolveFeatures32.json +1 -0
  411. package/dist/collection/components/icon/assets/icon/distanceType16.json +1 -0
  412. package/dist/collection/components/icon/assets/icon/distanceType24.json +1 -0
  413. package/dist/collection/components/icon/assets/icon/distanceType32.json +1 -0
  414. package/dist/collection/components/icon/assets/icon/fileEcd16.json +1 -0
  415. package/dist/collection/components/icon/assets/icon/fileEcd24.json +1 -0
  416. package/dist/collection/components/icon/assets/icon/fileEcd32.json +1 -0
  417. package/dist/collection/components/icon/assets/icon/gridDiamond16.json +1 -0
  418. package/dist/collection/components/icon/assets/icon/gridDiamond24.json +1 -0
  419. package/dist/collection/components/icon/assets/icon/gridDiamond32.json +1 -0
  420. package/dist/collection/components/icon/assets/icon/gridHexagon16.json +1 -0
  421. package/dist/collection/components/icon/assets/icon/gridHexagon24.json +1 -0
  422. package/dist/collection/components/icon/assets/icon/gridHexagon32.json +1 -0
  423. package/dist/collection/components/icon/assets/icon/gridTriangle16.json +1 -0
  424. package/dist/collection/components/icon/assets/icon/gridTriangle24.json +1 -0
  425. package/dist/collection/components/icon/assets/icon/gridTriangle32.json +1 -0
  426. package/dist/collection/components/icon/assets/icon/insets16.json +1 -0
  427. package/dist/collection/components/icon/assets/icon/insets24.json +1 -0
  428. package/dist/collection/components/icon/assets/icon/insets32.json +1 -0
  429. package/dist/collection/components/icon/assets/icon/maximumTerritoryDistance16.json +1 -0
  430. package/dist/collection/components/icon/assets/icon/maximumTerritoryDistance24.json +1 -0
  431. package/dist/collection/components/icon/assets/icon/maximumTerritoryDistance32.json +1 -0
  432. package/dist/collection/components/icon/assets/icon/minDistanceBetweenCenters16.json +1 -0
  433. package/dist/collection/components/icon/assets/icon/minDistanceBetweenCenters24.json +1 -0
  434. package/dist/collection/components/icon/assets/icon/minDistanceBetweenCenters32.json +1 -0
  435. package/dist/collection/components/icon/assets/icon/numberOfTerritories16.json +1 -0
  436. package/dist/collection/components/icon/assets/icon/numberOfTerritories24.json +1 -0
  437. package/dist/collection/components/icon/assets/icon/numberOfTerritories32.json +1 -0
  438. package/dist/collection/components/icon/assets/icon/overlapFeatures16.json +1 -0
  439. package/dist/collection/components/icon/assets/icon/overlapFeatures24.json +1 -0
  440. package/dist/collection/components/icon/assets/icon/overlapFeatures32.json +1 -0
  441. package/dist/collection/components/icon/assets/icon/profileVariables16.json +1 -0
  442. package/dist/collection/components/icon/assets/icon/profileVariables24.json +1 -0
  443. package/dist/collection/components/icon/assets/icon/profileVariables32.json +1 -0
  444. package/dist/collection/components/icon/assets/icon/rasterAnalysis16.json +1 -0
  445. package/dist/collection/components/icon/assets/icon/rasterAnalysis24.json +1 -0
  446. package/dist/collection/components/icon/assets/icon/rasterAnalysis32.json +1 -0
  447. package/dist/collection/components/icon/assets/icon/recurrence16.json +1 -0
  448. package/dist/collection/components/icon/assets/icon/recurrence24.json +1 -0
  449. package/dist/collection/components/icon/assets/icon/recurrence32.json +1 -0
  450. package/dist/collection/components/icon/assets/icon/splitFeatures16.json +1 -0
  451. package/dist/collection/components/icon/assets/icon/splitFeatures24.json +1 -0
  452. package/dist/collection/components/icon/assets/icon/splitFeatures32.json +1 -0
  453. package/dist/collection/components/icon/assets/icon/territoryBufferDistance16.json +1 -0
  454. package/dist/collection/components/icon/assets/icon/territoryBufferDistance24.json +1 -0
  455. package/dist/collection/components/icon/assets/icon/territoryBufferDistance32.json +1 -0
  456. package/dist/collection/components/icon/assets/icon/testData16.json +1 -0
  457. package/dist/collection/components/icon/assets/icon/testData24.json +1 -0
  458. package/dist/collection/components/icon/assets/icon/testData32.json +1 -0
  459. package/dist/collection/components/icon/icon.js +3 -2
  460. package/dist/collection/components/icon/resources.js +1 -0
  461. package/dist/collection/components/icon/utils.js +1 -0
  462. package/dist/collection/components/inline-editable/inline-editable.js +5 -6
  463. package/dist/collection/components/inline-editable/resources.js +1 -0
  464. package/dist/collection/components/input/input.js +69 -32
  465. package/dist/collection/components/input/interfaces.js +1 -0
  466. package/dist/collection/components/input/resources.js +4 -0
  467. package/dist/collection/components/input-date-picker/input-date-picker.css +5 -0
  468. package/dist/collection/components/input-date-picker/input-date-picker.js +81 -17
  469. package/dist/collection/components/input-message/input-message.js +1 -0
  470. package/dist/collection/components/input-message/interfaces.js +1 -0
  471. package/dist/collection/components/input-time-picker/input-time-picker.js +71 -8
  472. package/dist/collection/components/interfaces.js +1 -0
  473. package/dist/collection/components/label/label.js +1 -0
  474. package/dist/collection/components/label/resources.js +1 -0
  475. package/dist/collection/components/link/link.js +1 -0
  476. package/dist/collection/components/list/list.js +1 -0
  477. package/dist/collection/components/list/resources.js +1 -0
  478. package/dist/collection/components/list-item/list-item.css +17 -1
  479. package/dist/collection/components/list-item/list-item.js +8 -2
  480. package/dist/collection/components/list-item/resources.js +3 -1
  481. package/dist/collection/components/list-item-group/list-item-group.js +1 -0
  482. package/dist/collection/components/list-item-group/resources.js +1 -0
  483. package/dist/collection/components/loader/loader.js +1 -0
  484. package/dist/collection/components/modal/interfaces.js +1 -0
  485. package/dist/collection/components/modal/modal.css +1 -37
  486. package/dist/collection/components/modal/modal.js +2 -1
  487. package/dist/collection/components/modal/resources.js +1 -0
  488. package/dist/collection/components/notice/notice.js +1 -0
  489. package/dist/collection/components/notice/resources.js +1 -0
  490. package/dist/collection/components/option/option.js +1 -0
  491. package/dist/collection/components/option-group/option-group.js +1 -0
  492. package/dist/collection/components/pagination/pagination.js +1 -0
  493. package/dist/collection/components/pagination/resources.js +1 -0
  494. package/dist/collection/components/panel/panel.css +1 -4
  495. package/dist/collection/components/panel/panel.js +47 -5
  496. package/dist/collection/components/panel/resources.js +1 -0
  497. package/dist/collection/components/pick-list/pick-list.js +1 -0
  498. package/dist/collection/components/pick-list/resources.js +1 -0
  499. package/dist/collection/components/pick-list/shared-list-logic.js +3 -1
  500. package/dist/collection/components/pick-list/shared-list-render.js +3 -1
  501. package/dist/collection/components/pick-list-group/pick-list-group.js +1 -0
  502. package/dist/collection/components/pick-list-group/resources.js +1 -0
  503. package/dist/collection/components/pick-list-item/pick-list-item.css +1 -1
  504. package/dist/collection/components/pick-list-item/pick-list-item.js +3 -2
  505. package/dist/collection/components/pick-list-item/resources.js +1 -0
  506. package/dist/collection/components/popover/PopoverManager.js +64 -0
  507. package/dist/collection/components/popover/popover.css +1 -1
  508. package/dist/collection/components/popover/popover.js +56 -16
  509. package/dist/collection/components/popover/resources.js +2 -1
  510. package/dist/collection/components/popover-manager/popover-manager.js +32 -44
  511. package/dist/collection/components/progress/progress.js +1 -0
  512. package/dist/collection/components/radio-button/radio-button.js +3 -2
  513. package/dist/collection/components/radio-button/resources.js +1 -0
  514. package/dist/collection/components/radio-button-group/radio-button-group.js +1 -0
  515. package/dist/collection/components/radio-group/interfaces.js +1 -0
  516. package/dist/collection/components/radio-group/radio-group.js +3 -4
  517. package/dist/collection/components/radio-group-item/radio-group-item.js +3 -2
  518. package/dist/collection/components/radio-group-item/resources.js +1 -0
  519. package/dist/collection/components/rating/rating.js +1 -0
  520. package/dist/collection/components/rating/resources.js +1 -0
  521. package/dist/collection/components/scrim/resources.js +1 -0
  522. package/dist/collection/components/scrim/scrim.js +1 -0
  523. package/dist/collection/components/select/resources.js +1 -0
  524. package/dist/collection/components/select/select.js +3 -4
  525. package/dist/collection/components/shell/resources.js +1 -0
  526. package/dist/collection/components/shell/shell.js +1 -0
  527. package/dist/collection/components/shell-center-row/resources.js +1 -0
  528. package/dist/collection/components/shell-center-row/shell-center-row.css +1 -1
  529. package/dist/collection/components/shell-center-row/shell-center-row.js +1 -0
  530. package/dist/collection/components/shell-panel/resources.js +1 -0
  531. package/dist/collection/components/shell-panel/shell-panel.css +2 -2
  532. package/dist/collection/components/shell-panel/shell-panel.js +5 -1
  533. package/dist/collection/components/slider/slider.css +29 -0
  534. package/dist/collection/components/slider/slider.js +77 -41
  535. package/dist/collection/components/sortable-list/resources.js +1 -0
  536. package/dist/collection/components/sortable-list/sortable-list.js +1 -0
  537. package/dist/collection/components/split-button/resources.js +1 -0
  538. package/dist/collection/components/split-button/split-button.js +1 -0
  539. package/dist/{calcite/p-accdb0ce.js → collection/components/stepper/interfaces.js} +2 -1
  540. package/dist/collection/components/stepper/stepper.js +75 -54
  541. package/dist/collection/components/stepper-item/stepper-item.js +74 -74
  542. package/dist/collection/components/switch/switch.js +5 -3
  543. package/dist/collection/components/tab/interfaces.js +1 -0
  544. package/dist/collection/components/tab/tab.js +16 -17
  545. package/dist/collection/components/tab-nav/tab-nav.js +65 -26
  546. package/dist/collection/components/tab-title/tab-title.js +57 -25
  547. package/dist/collection/components/tabs/interfaces.js +1 -0
  548. package/dist/collection/components/tabs/resources.js +1 -0
  549. package/dist/collection/components/tabs/tabs.css +1 -1
  550. package/dist/collection/components/tabs/tabs.js +1 -3
  551. package/dist/collection/components/tile/resources.js +1 -0
  552. package/dist/collection/components/tile/tile.css +3 -2
  553. package/dist/collection/components/tile/tile.js +1 -0
  554. package/dist/collection/components/tile-select/interfaces.js +1 -0
  555. package/dist/collection/components/tile-select/resources.js +1 -0
  556. package/dist/collection/components/tile-select/tile-select.js +1 -0
  557. package/dist/collection/components/tile-select-group/interfaces.js +1 -0
  558. package/dist/collection/components/tile-select-group/tile-select-group.js +1 -0
  559. package/dist/collection/components/time-picker/resources.js +1 -0
  560. package/dist/collection/components/time-picker/time-picker.js +1 -8
  561. package/dist/collection/components/tip/resources.js +1 -0
  562. package/dist/collection/components/tip/tip.js +1 -0
  563. package/dist/collection/components/tip-group/tip-group.js +1 -0
  564. package/dist/collection/components/tip-manager/resources.js +1 -0
  565. package/dist/collection/components/tip-manager/tip-manager.css +1 -9
  566. package/dist/collection/components/tip-manager/tip-manager.js +25 -5
  567. package/dist/collection/components/tooltip/TooltipManager.js +157 -0
  568. package/dist/collection/components/tooltip/resources.js +1 -1
  569. package/dist/collection/components/tooltip/tooltip.css +2 -2
  570. package/dist/collection/components/tooltip/tooltip.js +8 -11
  571. package/dist/collection/components/tooltip-manager/tooltip-manager.js +5 -163
  572. package/dist/collection/components/tree/interfaces.js +1 -0
  573. package/dist/collection/components/tree/tree.js +12 -11
  574. package/dist/collection/components/tree-item/interfaces.js +1 -0
  575. package/dist/collection/components/tree-item/resources.js +1 -0
  576. package/dist/collection/components/tree-item/tree-item.js +18 -17
  577. package/dist/collection/components/value-list/resources.js +1 -0
  578. package/dist/collection/components/value-list/value-list.js +19 -18
  579. package/dist/collection/components/value-list-item/resources.js +1 -0
  580. package/dist/collection/components/value-list-item/value-list-item.js +22 -21
  581. package/dist/collection/utils/array.js +1 -0
  582. package/dist/collection/utils/conditionalSlot.js +1 -0
  583. package/dist/collection/utils/date.js +1 -0
  584. package/dist/collection/utils/dom.js +18 -1
  585. package/dist/collection/utils/filter.js +2 -1
  586. package/dist/collection/utils/form.js +16 -0
  587. package/dist/collection/utils/globalAttributes.js +1 -0
  588. package/dist/collection/utils/guid.js +1 -0
  589. package/dist/collection/utils/interactive.js +1 -0
  590. package/dist/collection/utils/key.js +1 -0
  591. package/dist/collection/utils/label.js +18 -17
  592. package/dist/collection/utils/locale.js +25 -23
  593. package/dist/collection/utils/math.js +1 -0
  594. package/dist/collection/utils/number.js +2 -1
  595. package/dist/collection/utils/observers.js +1 -0
  596. package/dist/collection/utils/popper.js +17 -2
  597. package/dist/collection/utils/resources.js +1 -0
  598. package/dist/collection/utils/time.js +1 -0
  599. package/dist/components/ExpandToggle.js +2 -1
  600. package/dist/components/Heading.js +1 -0
  601. package/dist/components/action-group.js +11 -16
  602. package/dist/components/action-menu.js +28 -31
  603. package/dist/components/action.js +3 -1
  604. package/dist/components/array.js +1 -0
  605. package/dist/components/button.js +14 -12
  606. package/dist/components/calcite-accordion-item.js +3 -2
  607. package/dist/components/calcite-accordion.js +1 -0
  608. package/dist/components/calcite-action-bar.js +18 -30
  609. package/dist/components/calcite-action-group.js +1 -0
  610. package/dist/components/calcite-action-menu.js +1 -0
  611. package/dist/components/calcite-action-pad.js +17 -32
  612. package/dist/components/calcite-action.js +1 -0
  613. package/dist/components/calcite-alert.js +4 -3
  614. package/dist/components/calcite-avatar.js +3 -2
  615. package/dist/components/calcite-block-section.js +3 -2
  616. package/dist/components/calcite-block.js +27 -24
  617. package/dist/components/calcite-button.js +1 -0
  618. package/dist/components/calcite-card.js +3 -2
  619. package/dist/components/calcite-checkbox.js +1 -0
  620. package/dist/components/calcite-chip.js +1 -0
  621. package/dist/components/calcite-color-picker-hex-input.js +1 -0
  622. package/dist/components/calcite-color-picker-swatch.js +1 -0
  623. package/dist/components/calcite-color-picker.js +20 -19
  624. package/dist/components/calcite-combobox-item-group.js +1 -0
  625. package/dist/components/calcite-combobox-item.js +2 -1
  626. package/dist/components/calcite-combobox.js +88 -45
  627. package/dist/components/calcite-date-picker-day.js +1 -0
  628. package/dist/components/calcite-date-picker-month-header.js +1 -0
  629. package/dist/components/calcite-date-picker-month.js +1 -0
  630. package/dist/components/calcite-date-picker.js +1 -0
  631. package/dist/components/calcite-dropdown-group.js +1 -0
  632. package/dist/components/calcite-dropdown-item.js +14 -7
  633. package/dist/components/calcite-dropdown.js +1 -0
  634. package/dist/components/calcite-fab.js +1 -0
  635. package/dist/components/calcite-filter.js +1 -0
  636. package/dist/components/calcite-flow.js +2 -1
  637. package/dist/components/calcite-graph.js +1 -0
  638. package/dist/components/calcite-handle.js +1 -0
  639. package/dist/components/calcite-icon.js +1 -0
  640. package/dist/components/calcite-inline-editable.js +5 -6
  641. package/dist/components/calcite-input-date-picker.js +53 -16
  642. package/dist/components/calcite-input-message.js +1 -0
  643. package/dist/components/calcite-input-time-picker.js +31 -8
  644. package/dist/components/calcite-input.js +1 -0
  645. package/dist/components/calcite-label.js +1 -0
  646. package/dist/components/calcite-link.js +1 -0
  647. package/dist/components/calcite-list-item-group.js +1 -0
  648. package/dist/components/calcite-list-item.js +11 -4
  649. package/dist/components/calcite-list.js +1 -0
  650. package/dist/components/calcite-loader.js +1 -0
  651. package/dist/components/calcite-modal.js +4 -3
  652. package/dist/components/calcite-notice.js +1 -0
  653. package/dist/components/calcite-option-group.js +1 -0
  654. package/dist/components/calcite-option.js +1 -0
  655. package/dist/components/calcite-pagination.js +1 -0
  656. package/dist/components/calcite-panel.js +41 -22
  657. package/dist/components/calcite-pick-list-group.js +2 -10
  658. package/dist/components/calcite-pick-list-item.js +1 -0
  659. package/dist/components/calcite-pick-list.js +2 -1
  660. package/dist/components/calcite-popover-manager.js +30 -37
  661. package/dist/components/calcite-popover.js +1 -0
  662. package/dist/components/calcite-progress.js +1 -0
  663. package/dist/components/calcite-radio-button-group.js +1 -0
  664. package/dist/components/calcite-radio-button.js +3 -2
  665. package/dist/components/calcite-radio-group-item.js +3 -2
  666. package/dist/components/calcite-radio-group.js +2 -1
  667. package/dist/components/calcite-rating.js +1 -0
  668. package/dist/components/calcite-scrim.js +1 -0
  669. package/dist/components/calcite-select.js +2 -1
  670. package/dist/components/calcite-shell-center-row.js +2 -1
  671. package/dist/components/calcite-shell-panel.js +2 -1
  672. package/dist/components/calcite-shell.js +1 -0
  673. package/dist/components/calcite-slider.js +69 -39
  674. package/dist/components/calcite-sortable-list.js +1 -0
  675. package/dist/components/calcite-split-button.js +1 -0
  676. package/dist/components/calcite-stepper-item.js +50 -59
  677. package/dist/components/calcite-stepper.js +63 -44
  678. package/dist/components/calcite-switch.js +1 -0
  679. package/dist/components/calcite-tab-nav.js +1 -0
  680. package/dist/components/calcite-tab-title.js +1 -0
  681. package/dist/components/calcite-tab.js +1 -0
  682. package/dist/components/calcite-tabs.js +1 -0
  683. package/dist/components/calcite-tile-select-group.js +1 -0
  684. package/dist/components/calcite-tile-select.js +1 -0
  685. package/dist/components/calcite-tile.js +1 -0
  686. package/dist/components/calcite-time-picker.js +1 -0
  687. package/dist/components/calcite-tip-group.js +1 -0
  688. package/dist/components/calcite-tip-manager.js +8 -5
  689. package/dist/components/calcite-tip.js +2 -1
  690. package/dist/components/calcite-tooltip-manager.js +47 -1
  691. package/dist/components/calcite-tooltip.js +170 -16
  692. package/dist/components/calcite-tree-item.js +7 -6
  693. package/dist/components/calcite-tree.js +5 -4
  694. package/dist/components/calcite-value-list-item.js +11 -10
  695. package/dist/components/calcite-value-list.js +9 -8
  696. package/dist/components/checkbox.js +4 -2
  697. package/dist/components/chip.js +8 -6
  698. package/dist/components/color-picker-hex-input.js +45 -49
  699. package/dist/components/color-picker-swatch.js +1337 -1345
  700. package/dist/components/conditionalSlot.js +1 -0
  701. package/dist/components/date-picker-day.js +2 -1
  702. package/dist/components/date-picker-month-header.js +28 -19
  703. package/dist/components/date-picker-month.js +2 -1
  704. package/dist/components/date-picker.js +7 -2
  705. package/dist/components/date.js +1 -0
  706. package/dist/components/debounce.js +1 -0
  707. package/dist/components/dom.js +19 -2
  708. package/dist/components/dropdown.js +51 -35
  709. package/dist/components/filter.js +21 -14
  710. package/dist/components/forIn.js +1 -0
  711. package/dist/components/form.js +18 -2
  712. package/dist/components/graph.js +1 -0
  713. package/dist/components/guid.js +1 -0
  714. package/dist/components/handle.js +3 -1
  715. package/dist/components/icon.js +3 -2
  716. package/dist/components/index.d.ts +1 -1
  717. package/dist/components/index.js +1 -0
  718. package/dist/components/input.js +54 -30
  719. package/dist/components/interactive.js +1 -0
  720. package/dist/components/interfaces.js +1 -0
  721. package/dist/components/interfaces2.js +1 -0
  722. package/dist/components/label.js +19 -18
  723. package/dist/components/label2.js +1 -0
  724. package/dist/components/link.js +1 -0
  725. package/dist/components/loader.js +1 -0
  726. package/dist/components/locale.js +25 -24
  727. package/dist/components/math.js +1 -0
  728. package/dist/components/number.js +2 -1
  729. package/dist/components/observers.js +1 -0
  730. package/dist/components/pick-list-item.js +5 -4
  731. package/dist/components/popover.js +110 -12
  732. package/dist/components/popper.js +27 -2
  733. package/dist/components/progress.js +1 -0
  734. package/dist/components/resources.js +11 -17
  735. package/dist/components/resources2.js +8 -5
  736. package/dist/components/resources3.js +25 -10
  737. package/dist/components/scrim.js +1 -0
  738. package/dist/components/shared-list-render.js +7 -5
  739. package/dist/components/sortable.esm.js +63 -54
  740. package/dist/components/switch.js +4 -2
  741. package/dist/components/tab-nav.js +37 -20
  742. package/dist/components/tab-title.js +30 -23
  743. package/dist/components/tab.js +15 -16
  744. package/dist/components/tabs.js +2 -4
  745. package/dist/components/tile.js +2 -1
  746. package/dist/components/time-picker.js +2 -7
  747. package/dist/components/utils.js +1 -0
  748. package/dist/components/utils2.js +1 -0
  749. package/dist/custom-elements/index.js +2806 -2434
  750. package/dist/esm/{ExpandToggle-af224c1e.js → ExpandToggle-1f6d84ba.js} +6 -5
  751. package/dist/esm/{Heading-d5f1710a.js → Heading-8d613e81.js} +2 -1
  752. package/dist/esm/{array-91a648e2.js → array-1655bbf7.js} +1 -0
  753. package/dist/esm/calcite-accordion_2.entry.js +5 -4
  754. package/dist/esm/calcite-action-bar.entry.js +15 -21
  755. package/dist/esm/calcite-action-group.entry.js +8 -7
  756. package/dist/esm/calcite-action-menu.entry.js +26 -23
  757. package/dist/esm/calcite-action-pad.entry.js +13 -22
  758. package/dist/esm/calcite-action.entry.js +7 -4
  759. package/dist/esm/calcite-alert.entry.js +7 -6
  760. package/dist/esm/calcite-avatar.entry.js +6 -5
  761. package/dist/esm/calcite-block_2.entry.js +20 -11
  762. package/dist/esm/calcite-button.entry.js +19 -17
  763. package/dist/esm/calcite-card.entry.js +7 -6
  764. package/dist/esm/calcite-checkbox.entry.js +9 -8
  765. package/dist/esm/calcite-chip.entry.js +13 -11
  766. package/dist/esm/calcite-color-picker_3.entry.js +1354 -1367
  767. package/dist/esm/calcite-combobox_3.entry.js +97 -55
  768. package/dist/esm/calcite-date-picker_4.entry.js +44 -31
  769. package/dist/esm/calcite-dropdown_3.entry.js +67 -45
  770. package/dist/esm/calcite-fab.entry.js +5 -4
  771. package/dist/esm/calcite-filter.entry.js +27 -20
  772. package/dist/esm/calcite-flow.entry.js +4 -3
  773. package/dist/esm/calcite-graph_2.entry.js +77 -47
  774. package/dist/esm/calcite-handle.entry.js +5 -2
  775. package/dist/esm/calcite-icon.entry.js +6 -5
  776. package/dist/esm/calcite-inline-editable.entry.js +11 -12
  777. package/dist/esm/calcite-input-date-picker.entry.js +59 -24
  778. package/dist/esm/calcite-input-message.entry.js +4 -3
  779. package/dist/esm/calcite-input-time-picker_2.entry.js +35 -20
  780. package/dist/esm/calcite-input.entry.js +61 -38
  781. package/dist/esm/calcite-label.entry.js +5 -4
  782. package/dist/esm/calcite-link.entry.js +5 -4
  783. package/dist/esm/calcite-list_3.entry.js +18 -11
  784. package/dist/esm/calcite-loader.entry.js +3 -2
  785. package/dist/esm/calcite-modal.entry.js +8 -7
  786. package/dist/esm/calcite-notice.entry.js +7 -6
  787. package/dist/esm/calcite-option_3.entry.js +8 -7
  788. package/dist/esm/calcite-pagination.entry.js +2 -1
  789. package/dist/esm/calcite-panel.entry.js +35 -11
  790. package/dist/esm/calcite-pick-list_3.entry.js +13 -22
  791. package/dist/esm/calcite-popover_2.entry.js +121 -49
  792. package/dist/esm/calcite-progress.entry.js +2 -1
  793. package/dist/esm/calcite-radio-button-group.entry.js +3 -2
  794. package/dist/esm/calcite-radio-button.entry.js +9 -8
  795. package/dist/esm/calcite-radio-group_2.entry.js +8 -7
  796. package/dist/esm/calcite-rating.entry.js +7 -6
  797. package/dist/esm/calcite-scrim.entry.js +2 -1
  798. package/dist/esm/calcite-shell_3.entry.js +9 -8
  799. package/dist/esm/calcite-sortable-list.entry.js +5 -4
  800. package/dist/esm/calcite-split-button.entry.js +3 -2
  801. package/dist/esm/calcite-stepper_2.entry.js +114 -105
  802. package/dist/esm/calcite-switch.entry.js +9 -7
  803. package/dist/esm/calcite-tab_4.entry.js +79 -62
  804. package/dist/esm/calcite-tile-select_2.entry.js +4 -3
  805. package/dist/esm/calcite-tile.entry.js +8 -7
  806. package/dist/esm/calcite-tip_3.entry.js +12 -9
  807. package/dist/esm/calcite-tooltip_2.entry.js +163 -137
  808. package/dist/esm/calcite-tree_2.entry.js +15 -14
  809. package/dist/esm/calcite-value-list_2.entry.js +27 -26
  810. package/dist/esm/calcite.js +4 -3
  811. package/dist/esm/{conditionalSlot-67f579ff.js → conditionalSlot-203be745.js} +3 -2
  812. package/dist/esm/{debounce-79648d42.js → debounce-c4df98cc.js} +1 -0
  813. package/dist/esm/{dom-e7fa77b9.js → dom-da697a3f.js} +20 -3
  814. package/dist/esm/{forIn-48d8fb84.js → forIn-9b83dde4.js} +2 -1
  815. package/dist/esm/{form-5e4609eb.js → form-bca481e1.js} +19 -3
  816. package/dist/esm/{guid-196bd5ea.js → guid-b4461004.js} +1 -0
  817. package/dist/esm/{index-bd94948c.js → index-8ece2564.js} +1 -3
  818. package/dist/esm/index.js +1 -0
  819. package/dist/esm/{interactive-48b5cc0f.js → interactive-cb5bf285.js} +1 -0
  820. package/dist/esm/{interfaces-0e5b954c.js → interfaces-f57a0946.js} +1 -0
  821. package/dist/esm/{label-68f22660.js → label-50132b90.js} +19 -18
  822. package/dist/esm/loader.js +4 -3
  823. package/dist/esm/{locale-fc850b7c.js → locale-7ce850e5.js} +25 -24
  824. package/dist/esm/{math-456207f5.js → math-2e4483eb.js} +1 -0
  825. package/dist/esm/{number-8779395f.js → number-237e74a9.js} +2 -1
  826. package/dist/esm/{observers-46118290.js → observers-b198f831.js} +1 -0
  827. package/dist/esm/polyfills/css-shim.js +1 -1
  828. package/dist/esm/{popper-da45ec93.js → popper-0fd1fd89.js} +28 -3
  829. package/dist/esm/{resources-027bd8f9.js → resources-3c30f589.js} +1 -0
  830. package/dist/esm/{resources-cbfcf4a3.js → resources-c4ee68b9.js} +18 -7
  831. package/dist/esm/{resources-34334875.js → resources-e8f918f0.js} +1 -0
  832. package/dist/esm/{resources-73dac782.js → resources-f170fbe8.js} +3 -2
  833. package/dist/esm/{sortable.esm-04824d33.js → sortable.esm-34b12dd8.js} +63 -54
  834. package/dist/esm/{utils-e84055a3.js → utils-040a2a22.js} +1 -0
  835. package/dist/esm-es5/{ExpandToggle-af224c1e.js → ExpandToggle-1f6d84ba.js} +2 -1
  836. package/dist/esm-es5/{Heading-d5f1710a.js → Heading-8d613e81.js} +2 -1
  837. package/dist/esm-es5/{array-91a648e2.js → array-1655bbf7.js} +1 -0
  838. package/dist/esm-es5/calcite-accordion_2.entry.js +2 -1
  839. package/dist/esm-es5/calcite-action-bar.entry.js +2 -1
  840. package/dist/esm-es5/calcite-action-group.entry.js +2 -1
  841. package/dist/esm-es5/calcite-action-menu.entry.js +2 -1
  842. package/dist/esm-es5/calcite-action-pad.entry.js +3 -2
  843. package/dist/esm-es5/calcite-action.entry.js +2 -1
  844. package/dist/esm-es5/calcite-alert.entry.js +2 -1
  845. package/dist/esm-es5/calcite-avatar.entry.js +2 -1
  846. package/dist/esm-es5/calcite-block_2.entry.js +2 -1
  847. package/dist/esm-es5/calcite-button.entry.js +2 -1
  848. package/dist/esm-es5/calcite-card.entry.js +2 -1
  849. package/dist/esm-es5/calcite-checkbox.entry.js +2 -1
  850. package/dist/esm-es5/calcite-chip.entry.js +2 -1
  851. package/dist/esm-es5/calcite-color-picker_3.entry.js +2 -1
  852. package/dist/esm-es5/calcite-combobox_3.entry.js +2 -1
  853. package/dist/esm-es5/calcite-date-picker_4.entry.js +2 -1
  854. package/dist/esm-es5/calcite-dropdown_3.entry.js +3 -2
  855. package/dist/esm-es5/calcite-fab.entry.js +2 -1
  856. package/dist/esm-es5/calcite-filter.entry.js +2 -1
  857. package/dist/esm-es5/calcite-flow.entry.js +2 -1
  858. package/dist/esm-es5/calcite-graph_2.entry.js +2 -1
  859. package/dist/esm-es5/calcite-handle.entry.js +2 -1
  860. package/dist/esm-es5/calcite-icon.entry.js +2 -1
  861. package/dist/esm-es5/calcite-inline-editable.entry.js +2 -1
  862. package/dist/esm-es5/calcite-input-date-picker.entry.js +2 -1
  863. package/dist/esm-es5/calcite-input-message.entry.js +2 -1
  864. package/dist/esm-es5/calcite-input-time-picker_2.entry.js +2 -1
  865. package/dist/esm-es5/calcite-input.entry.js +2 -1
  866. package/dist/esm-es5/calcite-label.entry.js +2 -1
  867. package/dist/esm-es5/calcite-link.entry.js +2 -1
  868. package/dist/esm-es5/calcite-list_3.entry.js +3 -2
  869. package/dist/esm-es5/calcite-loader.entry.js +2 -1
  870. package/dist/esm-es5/calcite-modal.entry.js +3 -2
  871. package/dist/esm-es5/calcite-notice.entry.js +2 -1
  872. package/dist/esm-es5/calcite-option_3.entry.js +2 -1
  873. package/dist/esm-es5/calcite-pagination.entry.js +2 -1
  874. package/dist/esm-es5/calcite-panel.entry.js +3 -2
  875. package/dist/esm-es5/calcite-pick-list_3.entry.js +2 -1
  876. package/dist/esm-es5/calcite-popover_2.entry.js +2 -1
  877. package/dist/esm-es5/calcite-progress.entry.js +2 -1
  878. package/dist/esm-es5/calcite-radio-button-group.entry.js +2 -1
  879. package/dist/esm-es5/calcite-radio-button.entry.js +2 -1
  880. package/dist/esm-es5/calcite-radio-group_2.entry.js +2 -1
  881. package/dist/esm-es5/calcite-rating.entry.js +2 -1
  882. package/dist/esm-es5/calcite-scrim.entry.js +2 -1
  883. package/dist/esm-es5/calcite-shell_3.entry.js +2 -1
  884. package/dist/esm-es5/calcite-sortable-list.entry.js +2 -1
  885. package/dist/esm-es5/calcite-split-button.entry.js +2 -1
  886. package/dist/esm-es5/calcite-stepper_2.entry.js +3 -2
  887. package/dist/esm-es5/calcite-switch.entry.js +2 -1
  888. package/dist/esm-es5/calcite-tab_4.entry.js +2 -1
  889. package/dist/esm-es5/calcite-tile-select_2.entry.js +2 -1
  890. package/dist/esm-es5/calcite-tile.entry.js +2 -1
  891. package/dist/esm-es5/calcite-tip_3.entry.js +2 -1
  892. package/dist/esm-es5/calcite-tooltip_2.entry.js +3 -2
  893. package/dist/esm-es5/calcite-tree_2.entry.js +2 -1
  894. package/dist/esm-es5/calcite-value-list_2.entry.js +2 -1
  895. package/dist/esm-es5/calcite.js +2 -1
  896. package/dist/esm-es5/{conditionalSlot-67f579ff.js → conditionalSlot-203be745.js} +2 -1
  897. package/dist/esm-es5/{debounce-79648d42.js → debounce-c4df98cc.js} +1 -0
  898. package/dist/esm-es5/{dom-e7fa77b9.js → dom-da697a3f.js} +2 -1
  899. package/dist/esm-es5/{forIn-48d8fb84.js → forIn-9b83dde4.js} +2 -1
  900. package/dist/esm-es5/form-bca481e1.js +6 -0
  901. package/dist/esm-es5/{guid-196bd5ea.js → guid-b4461004.js} +1 -0
  902. package/dist/esm-es5/{index-bd94948c.js → index-8ece2564.js} +2 -1
  903. package/dist/esm-es5/index.js +1 -0
  904. package/dist/esm-es5/{interactive-48b5cc0f.js → interactive-cb5bf285.js} +1 -0
  905. package/dist/esm-es5/{interfaces-0e5b954c.js → interfaces-f57a0946.js} +1 -0
  906. package/dist/esm-es5/label-50132b90.js +6 -0
  907. package/dist/esm-es5/loader.js +2 -1
  908. package/dist/esm-es5/locale-7ce850e5.js +6 -0
  909. package/dist/esm-es5/{math-456207f5.js → math-2e4483eb.js} +1 -0
  910. package/dist/esm-es5/number-237e74a9.js +6 -0
  911. package/dist/esm-es5/{observers-46118290.js → observers-b198f831.js} +1 -0
  912. package/dist/esm-es5/{popper-da45ec93.js → popper-0fd1fd89.js} +2 -1
  913. package/dist/esm-es5/{resources-027bd8f9.js → resources-3c30f589.js} +1 -0
  914. package/dist/esm-es5/resources-c4ee68b9.js +6 -0
  915. package/dist/esm-es5/{resources-34334875.js → resources-e8f918f0.js} +1 -0
  916. package/dist/esm-es5/{resources-73dac782.js → resources-f170fbe8.js} +3 -2
  917. package/dist/esm-es5/sortable.esm-34b12dd8.js +12 -0
  918. package/dist/esm-es5/{utils-e84055a3.js → utils-040a2a22.js} +1 -0
  919. package/dist/extras/docs-json.json +263 -160
  920. package/dist/loader/cdn.js +1 -0
  921. package/dist/loader/index.cjs.js +1 -0
  922. package/dist/loader/index.es2017.js +1 -0
  923. package/dist/loader/index.js +1 -0
  924. package/dist/types/components/accordion/accordion.d.ts +42 -0
  925. package/dist/types/components/accordion-item/accordion-item.d.ts +54 -0
  926. package/dist/types/components/action/action.d.ts +75 -0
  927. package/dist/types/components/action-bar/action-bar.d.ts +69 -0
  928. package/dist/types/components/action-group/action-group.d.ts +42 -0
  929. package/dist/types/components/action-menu/action-menu.d.ts +83 -0
  930. package/dist/types/components/action-pad/action-pad.d.ts +54 -0
  931. package/dist/types/components/alert/alert.d.ts +83 -0
  932. package/dist/types/components/avatar/avatar.d.ts +26 -0
  933. package/dist/types/components/block/block.d.ts +79 -0
  934. package/dist/types/components/block-section/block-section.d.ts +44 -0
  935. package/dist/types/components/button/button.d.ts +81 -0
  936. package/dist/types/components/card/card.d.ts +46 -0
  937. package/dist/types/components/checkbox/checkbox.d.ts +75 -0
  938. package/dist/types/components/chip/chip.d.ts +40 -0
  939. package/dist/types/components/chip/resources.d.ts +3 -2
  940. package/dist/types/components/color-picker/color-picker.d.ts +233 -0
  941. package/dist/types/components/color-picker-hex-input/color-picker-hex-input.d.ts +53 -0
  942. package/dist/types/components/color-picker-swatch/color-picker-swatch.d.ts +23 -0
  943. package/dist/types/components/combobox/combobox.d.ts +189 -0
  944. package/dist/types/components/combobox/interfaces.d.ts +6 -0
  945. package/dist/types/components/combobox/resources.d.ts +4 -0
  946. package/dist/types/components/combobox/utils.d.ts +6 -0
  947. package/dist/types/components/combobox-item/combobox-item.d.ts +48 -0
  948. package/dist/types/components/combobox-item-group/combobox-item-group.d.ts +17 -0
  949. package/dist/types/components/date-picker/date-picker.d.ts +132 -0
  950. package/dist/types/components/date-picker-day/date-picker-day.d.ts +48 -0
  951. package/dist/types/components/date-picker-month/date-picker-month.d.ts +97 -0
  952. package/dist/types/components/date-picker-month-header/date-picker-month-header.d.ts +59 -0
  953. package/dist/types/components/dropdown/dropdown.d.ts +112 -0
  954. package/dist/types/components/dropdown-group/dropdown-group.d.ts +32 -0
  955. package/dist/types/components/dropdown-item/dropdown-item.d.ts +54 -0
  956. package/dist/types/components/fab/fab.d.ts +49 -0
  957. package/dist/types/components/filter/filter.d.ts +59 -0
  958. package/dist/types/components/filter/resources.d.ts +1 -1
  959. package/dist/types/components/flow/flow.d.ts +22 -0
  960. package/dist/types/components/functional/ExpandToggle.d.ts +19 -0
  961. package/dist/types/components/graph/graph.d.ts +28 -0
  962. package/dist/types/components/handle/handle.d.ts +22 -0
  963. package/dist/types/components/icon/icon.d.ts +32 -0
  964. package/dist/types/components/inline-editable/inline-editable.d.ts +73 -0
  965. package/dist/types/components/input/input.d.ts +177 -0
  966. package/dist/types/components/input/resources.d.ts +3 -0
  967. package/dist/types/components/input-date-picker/input-date-picker.d.ts +195 -0
  968. package/dist/types/components/input-message/input-message.d.ts +27 -0
  969. package/dist/types/components/input-time-picker/input-time-picker.d.ts +105 -0
  970. package/dist/types/components/label/label.d.ts +39 -0
  971. package/dist/types/components/link/link.d.ts +36 -0
  972. package/dist/types/components/list/list.d.ts +22 -0
  973. package/dist/types/components/list-item/list-item.d.ts +42 -0
  974. package/dist/types/components/list-item/resources.d.ts +1 -0
  975. package/dist/types/components/list-item-group/list-item-group.d.ts +18 -0
  976. package/dist/types/components/loader/loader.d.ts +27 -0
  977. package/dist/types/components/modal/modal.d.ts +89 -0
  978. package/dist/types/components/notice/notice.d.ts +51 -0
  979. package/dist/types/components/pagination/pagination.d.ts +51 -0
  980. package/dist/types/components/panel/panel.d.ts +140 -0
  981. package/dist/types/components/pick-list/pick-list.d.ts +77 -0
  982. package/dist/types/components/pick-list/shared-list-logic.d.ts +32 -0
  983. package/dist/types/components/pick-list/shared-list-render.d.ts +18 -0
  984. package/dist/types/components/pick-list-group/pick-list-group.d.ts +21 -0
  985. package/dist/types/components/pick-list-item/pick-list-item.d.ts +108 -0
  986. package/dist/types/components/popover/PopoverManager.d.ts +10 -0
  987. package/dist/types/components/popover/popover.d.ts +115 -0
  988. package/dist/types/components/popover/resources.d.ts +1 -1
  989. package/dist/types/components/popover-manager/popover-manager.d.ts +23 -0
  990. package/dist/types/components/progress/progress.d.ts +15 -0
  991. package/dist/types/components/radio-button/radio-button.d.ts +94 -0
  992. package/dist/types/components/radio-button-group/radio-button-group.d.ts +34 -0
  993. package/dist/types/components/radio-group/radio-group.d.ts +58 -0
  994. package/dist/types/components/radio-group-item/radio-group-item.d.ts +24 -0
  995. package/dist/types/components/rating/rating.d.ts +62 -0
  996. package/dist/types/components/scrim/scrim.d.ts +17 -0
  997. package/dist/types/components/select/select.d.ts +77 -0
  998. package/dist/types/components/shell/shell.d.ts +24 -0
  999. package/dist/types/components/shell-center-row/shell-center-row.d.ts +25 -0
  1000. package/dist/types/components/shell-panel/shell-panel.d.ts +70 -0
  1001. package/dist/types/components/slider/slider.d.ts +197 -0
  1002. package/dist/types/components/sortable-list/sortable-list.d.ts +52 -0
  1003. package/dist/types/components/split-button/split-button.d.ts +56 -0
  1004. package/dist/types/components/stepper/interfaces.d.ts +10 -0
  1005. package/dist/types/components/stepper/stepper.d.ts +62 -0
  1006. package/dist/types/components/stepper-item/stepper-item.d.ts +66 -0
  1007. package/dist/types/components/switch/switch.d.ts +45 -0
  1008. package/dist/types/components/tab/tab.d.ts +41 -0
  1009. package/dist/types/components/tab-nav/tab-nav.d.ts +76 -0
  1010. package/dist/types/components/tab-title/tab-title.d.ts +91 -0
  1011. package/dist/types/components/tabs/tabs.d.ts +62 -0
  1012. package/dist/types/components/tile/tile.d.ts +38 -0
  1013. package/dist/types/components/tile-select/tile-select.d.ts +59 -0
  1014. package/dist/types/components/tile-select-group/tile-select-group.d.ts +15 -0
  1015. package/dist/types/components/time-picker/time-picker.d.ts +136 -0
  1016. package/dist/types/components/tip/tip.d.ts +47 -0
  1017. package/dist/types/components/tip-manager/tip-manager.d.ts +70 -0
  1018. package/dist/types/components/tooltip/TooltipManager.d.ts +27 -0
  1019. package/dist/types/components/tooltip/resources.d.ts +0 -1
  1020. package/dist/types/components/tooltip/tooltip.d.ts +58 -0
  1021. package/dist/types/components/tooltip-manager/tooltip-manager.d.ts +13 -0
  1022. package/dist/types/components/tree/interfaces.d.ts +10 -0
  1023. package/dist/types/components/tree/tree.d.ts +39 -0
  1024. package/dist/types/components/tree-item/tree-item.d.ts +60 -0
  1025. package/dist/types/components/value-list/value-list.d.ts +92 -0
  1026. package/dist/types/components/value-list-item/value-list-item.d.ts +81 -0
  1027. package/dist/types/components.d.ts +114 -63
  1028. package/dist/types/preact.d.ts +8 -4
  1029. package/dist/types/utils/dom.d.ts +10 -2
  1030. package/dist/types/utils/form.d.ts +20 -5
  1031. package/dist/types/utils/label.d.ts +41 -0
  1032. package/dist/types/utils/locale.d.ts +1 -0
  1033. package/dist/types/utils/popper.d.ts +3 -2
  1034. package/hydrate/index.d.ts +1 -1
  1035. package/hydrate/index.js +2825 -2439
  1036. package/package.json +38 -39
  1037. package/readme.md +4 -5
  1038. package/dist/calcite/p-07f1f162.system.entry.js +0 -5
  1039. package/dist/calcite/p-1263bcc0.entry.js +0 -5
  1040. package/dist/calcite/p-184049cb.entry.js +0 -5
  1041. package/dist/calcite/p-193749c1.entry.js +0 -5
  1042. package/dist/calcite/p-1aeca42a.system.entry.js +0 -5
  1043. package/dist/calcite/p-1b1bca2d.entry.js +0 -5
  1044. package/dist/calcite/p-23145377.entry.js +0 -5
  1045. package/dist/calcite/p-28c333d0.entry.js +0 -5
  1046. package/dist/calcite/p-2bcaed33.entry.js +0 -5
  1047. package/dist/calcite/p-2dd22e8c.system.entry.js +0 -5
  1048. package/dist/calcite/p-32d6b962.entry.js +0 -5
  1049. package/dist/calcite/p-32efc4cd.system.entry.js +0 -5
  1050. package/dist/calcite/p-364db271.entry.js +0 -5
  1051. package/dist/calcite/p-3915705c.entry.js +0 -5
  1052. package/dist/calcite/p-3b707a1c.system.entry.js +0 -5
  1053. package/dist/calcite/p-3e149640.system.entry.js +0 -5
  1054. package/dist/calcite/p-3ea157ba.system.entry.js +0 -5
  1055. package/dist/calcite/p-42227a04.entry.js +0 -5
  1056. package/dist/calcite/p-426f011a.entry.js +0 -5
  1057. package/dist/calcite/p-4696e56f.entry.js +0 -5
  1058. package/dist/calcite/p-4730df46.js +0 -5
  1059. package/dist/calcite/p-47d38839.entry.js +0 -5
  1060. package/dist/calcite/p-4aecbaef.entry.js +0 -5
  1061. package/dist/calcite/p-4afb5a1b.system.entry.js +0 -5
  1062. package/dist/calcite/p-54c49493.entry.js +0 -5
  1063. package/dist/calcite/p-55e1a3a0.system.entry.js +0 -5
  1064. package/dist/calcite/p-57e0428a.system.entry.js +0 -5
  1065. package/dist/calcite/p-58adb34d.system.entry.js +0 -5
  1066. package/dist/calcite/p-5a8829cd.entry.js +0 -5
  1067. package/dist/calcite/p-614d8925.js +0 -5
  1068. package/dist/calcite/p-6261469d.entry.js +0 -5
  1069. package/dist/calcite/p-6ab3e489.entry.js +0 -5
  1070. package/dist/calcite/p-6b7b23d0.js +0 -5
  1071. package/dist/calcite/p-6c4a7041.system.entry.js +0 -5
  1072. package/dist/calcite/p-6e0103f5.system.entry.js +0 -5
  1073. package/dist/calcite/p-6fba3e1b.system.entry.js +0 -5
  1074. package/dist/calcite/p-7247b667.system.entry.js +0 -5
  1075. package/dist/calcite/p-7260c869.system.entry.js +0 -5
  1076. package/dist/calcite/p-73d23656.entry.js +0 -5
  1077. package/dist/calcite/p-7c88d545.js +0 -5
  1078. package/dist/calcite/p-7dfd6480.system.entry.js +0 -5
  1079. package/dist/calcite/p-824da4be.entry.js +0 -5
  1080. package/dist/calcite/p-867f7b7a.system.entry.js +0 -5
  1081. package/dist/calcite/p-872e82a6.system.entry.js +0 -5
  1082. package/dist/calcite/p-87888359.entry.js +0 -5
  1083. package/dist/calcite/p-895d22f3.entry.js +0 -5
  1084. package/dist/calcite/p-8f3a3e4e.js +0 -5
  1085. package/dist/calcite/p-9385e4b4.system.js +0 -5
  1086. package/dist/calcite/p-9940b82a.system.entry.js +0 -5
  1087. package/dist/calcite/p-9ad8c7c5.system.entry.js +0 -5
  1088. package/dist/calcite/p-9c913e3a.entry.js +0 -5
  1089. package/dist/calcite/p-9e61d89d.entry.js +0 -5
  1090. package/dist/calcite/p-a3527241.system.entry.js +0 -5
  1091. package/dist/calcite/p-a38fe099.entry.js +0 -5
  1092. package/dist/calcite/p-a9b3ef39.js +0 -5
  1093. package/dist/calcite/p-a9ea7f4f.entry.js +0 -5
  1094. package/dist/calcite/p-aaa21a84.system.entry.js +0 -5
  1095. package/dist/calcite/p-aad14a5d.system.entry.js +0 -5
  1096. package/dist/calcite/p-ac9607f2.system.js +0 -11
  1097. package/dist/calcite/p-afe59546.entry.js +0 -5
  1098. package/dist/calcite/p-b10af2b4.entry.js +0 -5
  1099. package/dist/calcite/p-b3c5247b.system.entry.js +0 -5
  1100. package/dist/calcite/p-b47dc903.system.entry.js +0 -5
  1101. package/dist/calcite/p-b765d197.system.js +0 -5
  1102. package/dist/calcite/p-bb401f25.system.js +0 -5
  1103. package/dist/calcite/p-bccbf58a.entry.js +0 -5
  1104. package/dist/calcite/p-bcdc20c3.system.entry.js +0 -5
  1105. package/dist/calcite/p-bffb4da3.system.entry.js +0 -5
  1106. package/dist/calcite/p-c228a1da.system.entry.js +0 -5
  1107. package/dist/calcite/p-c33f47d5.system.js +0 -5
  1108. package/dist/calcite/p-c4cb35ba.system.entry.js +0 -5
  1109. package/dist/calcite/p-c5c42405.entry.js +0 -5
  1110. package/dist/calcite/p-c5ec8d74.js +0 -11
  1111. package/dist/calcite/p-c9fc13b9.system.entry.js +0 -5
  1112. package/dist/calcite/p-cb847074.entry.js +0 -5
  1113. package/dist/calcite/p-cd5f5c8f.js +0 -5
  1114. package/dist/calcite/p-cd9226a1.system.entry.js +0 -5
  1115. package/dist/calcite/p-da7c2542.entry.js +0 -5
  1116. package/dist/calcite/p-daf5f04c.system.js +0 -5
  1117. package/dist/calcite/p-dcf33bb2.js +0 -5
  1118. package/dist/calcite/p-dd9f2e61.js +0 -5
  1119. package/dist/calcite/p-e22ab8fa.entry.js +0 -5
  1120. package/dist/calcite/p-e3280a36.system.entry.js +0 -5
  1121. package/dist/calcite/p-e43605c5.entry.js +0 -5
  1122. package/dist/calcite/p-e4d1651b.system.entry.js +0 -5
  1123. package/dist/calcite/p-e5a7ca2a.entry.js +0 -5
  1124. package/dist/calcite/p-e65b6bfb.entry.js +0 -5
  1125. package/dist/calcite/p-ec9bab33.system.js +0 -5
  1126. package/dist/calcite/p-ef6b4184.js +0 -5
  1127. package/dist/calcite/p-f09e27b0.system.js +0 -5
  1128. package/dist/calcite/p-fe9380a0.system.js +0 -5
  1129. package/dist/components/resources4.js +0 -32
  1130. package/dist/components/tooltip-manager.js +0 -175
  1131. package/dist/esm-es5/form-5e4609eb.js +0 -5
  1132. package/dist/esm-es5/label-68f22660.js +0 -5
  1133. package/dist/esm-es5/locale-fc850b7c.js +0 -5
  1134. package/dist/esm-es5/number-8779395f.js +0 -5
  1135. package/dist/esm-es5/resources-cbfcf4a3.js +0 -5
  1136. package/dist/esm-es5/sortable.esm-04824d33.js +0 -11
@@ -1,18 +1,19 @@
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.0.0-beta.82
4
5
  */
5
6
  'use strict';
6
7
 
7
8
  Object.defineProperty(exports, '__esModule', { value: true });
8
9
 
9
- const index = require('./index-1af0efd3.js');
10
- const dom = require('./dom-f3df220d.js');
11
- const utils = require('./utils-6579522f.js');
12
- const math = require('./math-145c80e2.js');
13
- const interactive = require('./interactive-87406231.js');
14
- const debounce = require('./debounce-95979061.js');
15
- require('./guid-b270f0db.js');
10
+ const index = require('./index-5c65e149.js');
11
+ const dom = require('./dom-9ac0341c.js');
12
+ const utils = require('./utils-51c079f6.js');
13
+ const math = require('./math-9d6de52c.js');
14
+ const interactive = require('./interactive-e294111f.js');
15
+ const debounce = require('./debounce-94d2834e.js');
16
+ require('./guid-8b6d6cb4.js');
16
17
 
17
18
  /** Error message constants. */
18
19
  var FUNC_ERROR_TEXT = 'Expected a function';
@@ -530,1023 +531,995 @@ function hexDouble(num) {
530
531
  }
531
532
  });
532
533
 
533
- var colorName = {
534
- "aliceblue": [240, 248, 255],
535
- "antiquewhite": [250, 235, 215],
536
- "aqua": [0, 255, 255],
537
- "aquamarine": [127, 255, 212],
538
- "azure": [240, 255, 255],
539
- "beige": [245, 245, 220],
540
- "bisque": [255, 228, 196],
541
- "black": [0, 0, 0],
542
- "blanchedalmond": [255, 235, 205],
543
- "blue": [0, 0, 255],
544
- "blueviolet": [138, 43, 226],
545
- "brown": [165, 42, 42],
546
- "burlywood": [222, 184, 135],
547
- "cadetblue": [95, 158, 160],
548
- "chartreuse": [127, 255, 0],
549
- "chocolate": [210, 105, 30],
550
- "coral": [255, 127, 80],
551
- "cornflowerblue": [100, 149, 237],
552
- "cornsilk": [255, 248, 220],
553
- "crimson": [220, 20, 60],
554
- "cyan": [0, 255, 255],
555
- "darkblue": [0, 0, 139],
556
- "darkcyan": [0, 139, 139],
557
- "darkgoldenrod": [184, 134, 11],
558
- "darkgray": [169, 169, 169],
559
- "darkgreen": [0, 100, 0],
560
- "darkgrey": [169, 169, 169],
561
- "darkkhaki": [189, 183, 107],
562
- "darkmagenta": [139, 0, 139],
563
- "darkolivegreen": [85, 107, 47],
564
- "darkorange": [255, 140, 0],
565
- "darkorchid": [153, 50, 204],
566
- "darkred": [139, 0, 0],
567
- "darksalmon": [233, 150, 122],
568
- "darkseagreen": [143, 188, 143],
569
- "darkslateblue": [72, 61, 139],
570
- "darkslategray": [47, 79, 79],
571
- "darkslategrey": [47, 79, 79],
572
- "darkturquoise": [0, 206, 209],
573
- "darkviolet": [148, 0, 211],
574
- "deeppink": [255, 20, 147],
575
- "deepskyblue": [0, 191, 255],
576
- "dimgray": [105, 105, 105],
577
- "dimgrey": [105, 105, 105],
578
- "dodgerblue": [30, 144, 255],
579
- "firebrick": [178, 34, 34],
580
- "floralwhite": [255, 250, 240],
581
- "forestgreen": [34, 139, 34],
582
- "fuchsia": [255, 0, 255],
583
- "gainsboro": [220, 220, 220],
584
- "ghostwhite": [248, 248, 255],
585
- "gold": [255, 215, 0],
586
- "goldenrod": [218, 165, 32],
587
- "gray": [128, 128, 128],
588
- "green": [0, 128, 0],
589
- "greenyellow": [173, 255, 47],
590
- "grey": [128, 128, 128],
591
- "honeydew": [240, 255, 240],
592
- "hotpink": [255, 105, 180],
593
- "indianred": [205, 92, 92],
594
- "indigo": [75, 0, 130],
595
- "ivory": [255, 255, 240],
596
- "khaki": [240, 230, 140],
597
- "lavender": [230, 230, 250],
598
- "lavenderblush": [255, 240, 245],
599
- "lawngreen": [124, 252, 0],
600
- "lemonchiffon": [255, 250, 205],
601
- "lightblue": [173, 216, 230],
602
- "lightcoral": [240, 128, 128],
603
- "lightcyan": [224, 255, 255],
604
- "lightgoldenrodyellow": [250, 250, 210],
605
- "lightgray": [211, 211, 211],
606
- "lightgreen": [144, 238, 144],
607
- "lightgrey": [211, 211, 211],
608
- "lightpink": [255, 182, 193],
609
- "lightsalmon": [255, 160, 122],
610
- "lightseagreen": [32, 178, 170],
611
- "lightskyblue": [135, 206, 250],
612
- "lightslategray": [119, 136, 153],
613
- "lightslategrey": [119, 136, 153],
614
- "lightsteelblue": [176, 196, 222],
615
- "lightyellow": [255, 255, 224],
616
- "lime": [0, 255, 0],
617
- "limegreen": [50, 205, 50],
618
- "linen": [250, 240, 230],
619
- "magenta": [255, 0, 255],
620
- "maroon": [128, 0, 0],
621
- "mediumaquamarine": [102, 205, 170],
622
- "mediumblue": [0, 0, 205],
623
- "mediumorchid": [186, 85, 211],
624
- "mediumpurple": [147, 112, 219],
625
- "mediumseagreen": [60, 179, 113],
626
- "mediumslateblue": [123, 104, 238],
627
- "mediumspringgreen": [0, 250, 154],
628
- "mediumturquoise": [72, 209, 204],
629
- "mediumvioletred": [199, 21, 133],
630
- "midnightblue": [25, 25, 112],
631
- "mintcream": [245, 255, 250],
632
- "mistyrose": [255, 228, 225],
633
- "moccasin": [255, 228, 181],
634
- "navajowhite": [255, 222, 173],
635
- "navy": [0, 0, 128],
636
- "oldlace": [253, 245, 230],
637
- "olive": [128, 128, 0],
638
- "olivedrab": [107, 142, 35],
639
- "orange": [255, 165, 0],
640
- "orangered": [255, 69, 0],
641
- "orchid": [218, 112, 214],
642
- "palegoldenrod": [238, 232, 170],
643
- "palegreen": [152, 251, 152],
644
- "paleturquoise": [175, 238, 238],
645
- "palevioletred": [219, 112, 147],
646
- "papayawhip": [255, 239, 213],
647
- "peachpuff": [255, 218, 185],
648
- "peru": [205, 133, 63],
649
- "pink": [255, 192, 203],
650
- "plum": [221, 160, 221],
651
- "powderblue": [176, 224, 230],
652
- "purple": [128, 0, 128],
653
- "rebeccapurple": [102, 51, 153],
654
- "red": [255, 0, 0],
655
- "rosybrown": [188, 143, 143],
656
- "royalblue": [65, 105, 225],
657
- "saddlebrown": [139, 69, 19],
658
- "salmon": [250, 128, 114],
659
- "sandybrown": [244, 164, 96],
660
- "seagreen": [46, 139, 87],
661
- "seashell": [255, 245, 238],
662
- "sienna": [160, 82, 45],
663
- "silver": [192, 192, 192],
664
- "skyblue": [135, 206, 235],
665
- "slateblue": [106, 90, 205],
666
- "slategray": [112, 128, 144],
667
- "slategrey": [112, 128, 144],
668
- "snow": [255, 250, 250],
669
- "springgreen": [0, 255, 127],
670
- "steelblue": [70, 130, 180],
671
- "tan": [210, 180, 140],
672
- "teal": [0, 128, 128],
673
- "thistle": [216, 191, 216],
674
- "tomato": [255, 99, 71],
675
- "turquoise": [64, 224, 208],
676
- "violet": [238, 130, 238],
677
- "wheat": [245, 222, 179],
678
- "white": [255, 255, 255],
679
- "whitesmoke": [245, 245, 245],
680
- "yellow": [255, 255, 0],
681
- "yellowgreen": [154, 205, 50]
534
+ var colorName = {
535
+ "aliceblue": [240, 248, 255],
536
+ "antiquewhite": [250, 235, 215],
537
+ "aqua": [0, 255, 255],
538
+ "aquamarine": [127, 255, 212],
539
+ "azure": [240, 255, 255],
540
+ "beige": [245, 245, 220],
541
+ "bisque": [255, 228, 196],
542
+ "black": [0, 0, 0],
543
+ "blanchedalmond": [255, 235, 205],
544
+ "blue": [0, 0, 255],
545
+ "blueviolet": [138, 43, 226],
546
+ "brown": [165, 42, 42],
547
+ "burlywood": [222, 184, 135],
548
+ "cadetblue": [95, 158, 160],
549
+ "chartreuse": [127, 255, 0],
550
+ "chocolate": [210, 105, 30],
551
+ "coral": [255, 127, 80],
552
+ "cornflowerblue": [100, 149, 237],
553
+ "cornsilk": [255, 248, 220],
554
+ "crimson": [220, 20, 60],
555
+ "cyan": [0, 255, 255],
556
+ "darkblue": [0, 0, 139],
557
+ "darkcyan": [0, 139, 139],
558
+ "darkgoldenrod": [184, 134, 11],
559
+ "darkgray": [169, 169, 169],
560
+ "darkgreen": [0, 100, 0],
561
+ "darkgrey": [169, 169, 169],
562
+ "darkkhaki": [189, 183, 107],
563
+ "darkmagenta": [139, 0, 139],
564
+ "darkolivegreen": [85, 107, 47],
565
+ "darkorange": [255, 140, 0],
566
+ "darkorchid": [153, 50, 204],
567
+ "darkred": [139, 0, 0],
568
+ "darksalmon": [233, 150, 122],
569
+ "darkseagreen": [143, 188, 143],
570
+ "darkslateblue": [72, 61, 139],
571
+ "darkslategray": [47, 79, 79],
572
+ "darkslategrey": [47, 79, 79],
573
+ "darkturquoise": [0, 206, 209],
574
+ "darkviolet": [148, 0, 211],
575
+ "deeppink": [255, 20, 147],
576
+ "deepskyblue": [0, 191, 255],
577
+ "dimgray": [105, 105, 105],
578
+ "dimgrey": [105, 105, 105],
579
+ "dodgerblue": [30, 144, 255],
580
+ "firebrick": [178, 34, 34],
581
+ "floralwhite": [255, 250, 240],
582
+ "forestgreen": [34, 139, 34],
583
+ "fuchsia": [255, 0, 255],
584
+ "gainsboro": [220, 220, 220],
585
+ "ghostwhite": [248, 248, 255],
586
+ "gold": [255, 215, 0],
587
+ "goldenrod": [218, 165, 32],
588
+ "gray": [128, 128, 128],
589
+ "green": [0, 128, 0],
590
+ "greenyellow": [173, 255, 47],
591
+ "grey": [128, 128, 128],
592
+ "honeydew": [240, 255, 240],
593
+ "hotpink": [255, 105, 180],
594
+ "indianred": [205, 92, 92],
595
+ "indigo": [75, 0, 130],
596
+ "ivory": [255, 255, 240],
597
+ "khaki": [240, 230, 140],
598
+ "lavender": [230, 230, 250],
599
+ "lavenderblush": [255, 240, 245],
600
+ "lawngreen": [124, 252, 0],
601
+ "lemonchiffon": [255, 250, 205],
602
+ "lightblue": [173, 216, 230],
603
+ "lightcoral": [240, 128, 128],
604
+ "lightcyan": [224, 255, 255],
605
+ "lightgoldenrodyellow": [250, 250, 210],
606
+ "lightgray": [211, 211, 211],
607
+ "lightgreen": [144, 238, 144],
608
+ "lightgrey": [211, 211, 211],
609
+ "lightpink": [255, 182, 193],
610
+ "lightsalmon": [255, 160, 122],
611
+ "lightseagreen": [32, 178, 170],
612
+ "lightskyblue": [135, 206, 250],
613
+ "lightslategray": [119, 136, 153],
614
+ "lightslategrey": [119, 136, 153],
615
+ "lightsteelblue": [176, 196, 222],
616
+ "lightyellow": [255, 255, 224],
617
+ "lime": [0, 255, 0],
618
+ "limegreen": [50, 205, 50],
619
+ "linen": [250, 240, 230],
620
+ "magenta": [255, 0, 255],
621
+ "maroon": [128, 0, 0],
622
+ "mediumaquamarine": [102, 205, 170],
623
+ "mediumblue": [0, 0, 205],
624
+ "mediumorchid": [186, 85, 211],
625
+ "mediumpurple": [147, 112, 219],
626
+ "mediumseagreen": [60, 179, 113],
627
+ "mediumslateblue": [123, 104, 238],
628
+ "mediumspringgreen": [0, 250, 154],
629
+ "mediumturquoise": [72, 209, 204],
630
+ "mediumvioletred": [199, 21, 133],
631
+ "midnightblue": [25, 25, 112],
632
+ "mintcream": [245, 255, 250],
633
+ "mistyrose": [255, 228, 225],
634
+ "moccasin": [255, 228, 181],
635
+ "navajowhite": [255, 222, 173],
636
+ "navy": [0, 0, 128],
637
+ "oldlace": [253, 245, 230],
638
+ "olive": [128, 128, 0],
639
+ "olivedrab": [107, 142, 35],
640
+ "orange": [255, 165, 0],
641
+ "orangered": [255, 69, 0],
642
+ "orchid": [218, 112, 214],
643
+ "palegoldenrod": [238, 232, 170],
644
+ "palegreen": [152, 251, 152],
645
+ "paleturquoise": [175, 238, 238],
646
+ "palevioletred": [219, 112, 147],
647
+ "papayawhip": [255, 239, 213],
648
+ "peachpuff": [255, 218, 185],
649
+ "peru": [205, 133, 63],
650
+ "pink": [255, 192, 203],
651
+ "plum": [221, 160, 221],
652
+ "powderblue": [176, 224, 230],
653
+ "purple": [128, 0, 128],
654
+ "rebeccapurple": [102, 51, 153],
655
+ "red": [255, 0, 0],
656
+ "rosybrown": [188, 143, 143],
657
+ "royalblue": [65, 105, 225],
658
+ "saddlebrown": [139, 69, 19],
659
+ "salmon": [250, 128, 114],
660
+ "sandybrown": [244, 164, 96],
661
+ "seagreen": [46, 139, 87],
662
+ "seashell": [255, 245, 238],
663
+ "sienna": [160, 82, 45],
664
+ "silver": [192, 192, 192],
665
+ "skyblue": [135, 206, 235],
666
+ "slateblue": [106, 90, 205],
667
+ "slategray": [112, 128, 144],
668
+ "slategrey": [112, 128, 144],
669
+ "snow": [255, 250, 250],
670
+ "springgreen": [0, 255, 127],
671
+ "steelblue": [70, 130, 180],
672
+ "tan": [210, 180, 140],
673
+ "teal": [0, 128, 128],
674
+ "thistle": [216, 191, 216],
675
+ "tomato": [255, 99, 71],
676
+ "turquoise": [64, 224, 208],
677
+ "violet": [238, 130, 238],
678
+ "wheat": [245, 222, 179],
679
+ "white": [255, 255, 255],
680
+ "whitesmoke": [245, 245, 245],
681
+ "yellow": [255, 255, 0],
682
+ "yellowgreen": [154, 205, 50]
682
683
  };
683
684
 
684
685
  /* MIT license */
685
-
686
686
  /* eslint-disable no-mixed-operators */
687
+
688
+
687
689
  // NOTE: conversions should only return primitive values (i.e. arrays, or
688
690
  // values that give correct `typeof` results).
689
691
  // do not use box values types (i.e. Number(), String(), etc.)
690
692
 
691
693
  const reverseKeywords = {};
692
-
693
694
  for (const key of Object.keys(colorName)) {
694
- reverseKeywords[colorName[key]] = key;
695
+ reverseKeywords[colorName[key]] = key;
695
696
  }
696
697
 
697
698
  const convert$1 = {
698
- rgb: {
699
- channels: 3,
700
- labels: 'rgb'
701
- },
702
- hsl: {
703
- channels: 3,
704
- labels: 'hsl'
705
- },
706
- hsv: {
707
- channels: 3,
708
- labels: 'hsv'
709
- },
710
- hwb: {
711
- channels: 3,
712
- labels: 'hwb'
713
- },
714
- cmyk: {
715
- channels: 4,
716
- labels: 'cmyk'
717
- },
718
- xyz: {
719
- channels: 3,
720
- labels: 'xyz'
721
- },
722
- lab: {
723
- channels: 3,
724
- labels: 'lab'
725
- },
726
- lch: {
727
- channels: 3,
728
- labels: 'lch'
729
- },
730
- hex: {
731
- channels: 1,
732
- labels: ['hex']
733
- },
734
- keyword: {
735
- channels: 1,
736
- labels: ['keyword']
737
- },
738
- ansi16: {
739
- channels: 1,
740
- labels: ['ansi16']
741
- },
742
- ansi256: {
743
- channels: 1,
744
- labels: ['ansi256']
745
- },
746
- hcg: {
747
- channels: 3,
748
- labels: ['h', 'c', 'g']
749
- },
750
- apple: {
751
- channels: 3,
752
- labels: ['r16', 'g16', 'b16']
753
- },
754
- gray: {
755
- channels: 1,
756
- labels: ['gray']
757
- }
758
- };
759
- var conversions = convert$1; // Hide .channels and .labels properties
760
-
699
+ rgb: {channels: 3, labels: 'rgb'},
700
+ hsl: {channels: 3, labels: 'hsl'},
701
+ hsv: {channels: 3, labels: 'hsv'},
702
+ hwb: {channels: 3, labels: 'hwb'},
703
+ cmyk: {channels: 4, labels: 'cmyk'},
704
+ xyz: {channels: 3, labels: 'xyz'},
705
+ lab: {channels: 3, labels: 'lab'},
706
+ lch: {channels: 3, labels: 'lch'},
707
+ hex: {channels: 1, labels: ['hex']},
708
+ keyword: {channels: 1, labels: ['keyword']},
709
+ ansi16: {channels: 1, labels: ['ansi16']},
710
+ ansi256: {channels: 1, labels: ['ansi256']},
711
+ hcg: {channels: 3, labels: ['h', 'c', 'g']},
712
+ apple: {channels: 3, labels: ['r16', 'g16', 'b16']},
713
+ gray: {channels: 1, labels: ['gray']}
714
+ };
715
+
716
+ var conversions = convert$1;
717
+
718
+ // Hide .channels and .labels properties
761
719
  for (const model of Object.keys(convert$1)) {
762
- if (!('channels' in convert$1[model])) {
763
- throw new Error('missing channels property: ' + model);
764
- }
720
+ if (!('channels' in convert$1[model])) {
721
+ throw new Error('missing channels property: ' + model);
722
+ }
765
723
 
766
- if (!('labels' in convert$1[model])) {
767
- throw new Error('missing channel labels property: ' + model);
768
- }
724
+ if (!('labels' in convert$1[model])) {
725
+ throw new Error('missing channel labels property: ' + model);
726
+ }
769
727
 
770
- if (convert$1[model].labels.length !== convert$1[model].channels) {
771
- throw new Error('channel and label counts mismatch: ' + model);
772
- }
728
+ if (convert$1[model].labels.length !== convert$1[model].channels) {
729
+ throw new Error('channel and label counts mismatch: ' + model);
730
+ }
773
731
 
774
- const {
775
- channels,
776
- labels
777
- } = convert$1[model];
778
- delete convert$1[model].channels;
779
- delete convert$1[model].labels;
780
- Object.defineProperty(convert$1[model], 'channels', {
781
- value: channels
782
- });
783
- Object.defineProperty(convert$1[model], 'labels', {
784
- value: labels
785
- });
732
+ const {channels, labels} = convert$1[model];
733
+ delete convert$1[model].channels;
734
+ delete convert$1[model].labels;
735
+ Object.defineProperty(convert$1[model], 'channels', {value: channels});
736
+ Object.defineProperty(convert$1[model], 'labels', {value: labels});
786
737
  }
787
738
 
788
739
  convert$1.rgb.hsl = function (rgb) {
789
- const r = rgb[0] / 255;
790
- const g = rgb[1] / 255;
791
- const b = rgb[2] / 255;
792
- const min = Math.min(r, g, b);
793
- const max = Math.max(r, g, b);
794
- const delta = max - min;
795
- let h;
796
- let s;
797
-
798
- if (max === min) {
799
- h = 0;
800
- } else if (r === max) {
801
- h = (g - b) / delta;
802
- } else if (g === max) {
803
- h = 2 + (b - r) / delta;
804
- } else if (b === max) {
805
- h = 4 + (r - g) / delta;
806
- }
740
+ const r = rgb[0] / 255;
741
+ const g = rgb[1] / 255;
742
+ const b = rgb[2] / 255;
743
+ const min = Math.min(r, g, b);
744
+ const max = Math.max(r, g, b);
745
+ const delta = max - min;
746
+ let h;
747
+ let s;
748
+
749
+ if (max === min) {
750
+ h = 0;
751
+ } else if (r === max) {
752
+ h = (g - b) / delta;
753
+ } else if (g === max) {
754
+ h = 2 + (b - r) / delta;
755
+ } else if (b === max) {
756
+ h = 4 + (r - g) / delta;
757
+ }
807
758
 
808
- h = Math.min(h * 60, 360);
759
+ h = Math.min(h * 60, 360);
809
760
 
810
- if (h < 0) {
811
- h += 360;
812
- }
761
+ if (h < 0) {
762
+ h += 360;
763
+ }
813
764
 
814
- const l = (min + max) / 2;
765
+ const l = (min + max) / 2;
815
766
 
816
- if (max === min) {
817
- s = 0;
818
- } else if (l <= 0.5) {
819
- s = delta / (max + min);
820
- } else {
821
- s = delta / (2 - max - min);
822
- }
767
+ if (max === min) {
768
+ s = 0;
769
+ } else if (l <= 0.5) {
770
+ s = delta / (max + min);
771
+ } else {
772
+ s = delta / (2 - max - min);
773
+ }
823
774
 
824
- return [h, s * 100, l * 100];
775
+ return [h, s * 100, l * 100];
825
776
  };
826
777
 
827
778
  convert$1.rgb.hsv = function (rgb) {
828
- let rdif;
829
- let gdif;
830
- let bdif;
831
- let h;
832
- let s;
833
- const r = rgb[0] / 255;
834
- const g = rgb[1] / 255;
835
- const b = rgb[2] / 255;
836
- const v = Math.max(r, g, b);
837
- const diff = v - Math.min(r, g, b);
838
-
839
- const diffc = function (c) {
840
- return (v - c) / 6 / diff + 1 / 2;
841
- };
842
-
843
- if (diff === 0) {
844
- h = 0;
845
- s = 0;
846
- } else {
847
- s = diff / v;
848
- rdif = diffc(r);
849
- gdif = diffc(g);
850
- bdif = diffc(b);
851
-
852
- if (r === v) {
853
- h = bdif - gdif;
854
- } else if (g === v) {
855
- h = 1 / 3 + rdif - bdif;
856
- } else if (b === v) {
857
- h = 2 / 3 + gdif - rdif;
858
- }
779
+ let rdif;
780
+ let gdif;
781
+ let bdif;
782
+ let h;
783
+ let s;
784
+
785
+ const r = rgb[0] / 255;
786
+ const g = rgb[1] / 255;
787
+ const b = rgb[2] / 255;
788
+ const v = Math.max(r, g, b);
789
+ const diff = v - Math.min(r, g, b);
790
+ const diffc = function (c) {
791
+ return (v - c) / 6 / diff + 1 / 2;
792
+ };
859
793
 
860
- if (h < 0) {
861
- h += 1;
862
- } else if (h > 1) {
863
- h -= 1;
864
- }
865
- }
794
+ if (diff === 0) {
795
+ h = 0;
796
+ s = 0;
797
+ } else {
798
+ s = diff / v;
799
+ rdif = diffc(r);
800
+ gdif = diffc(g);
801
+ bdif = diffc(b);
802
+
803
+ if (r === v) {
804
+ h = bdif - gdif;
805
+ } else if (g === v) {
806
+ h = (1 / 3) + rdif - bdif;
807
+ } else if (b === v) {
808
+ h = (2 / 3) + gdif - rdif;
809
+ }
866
810
 
867
- return [h * 360, s * 100, v * 100];
811
+ if (h < 0) {
812
+ h += 1;
813
+ } else if (h > 1) {
814
+ h -= 1;
815
+ }
816
+ }
817
+
818
+ return [
819
+ h * 360,
820
+ s * 100,
821
+ v * 100
822
+ ];
868
823
  };
869
824
 
870
825
  convert$1.rgb.hwb = function (rgb) {
871
- const r = rgb[0];
872
- const g = rgb[1];
873
- let b = rgb[2];
874
- const h = convert$1.rgb.hsl(rgb)[0];
875
- const w = 1 / 255 * Math.min(r, Math.min(g, b));
876
- b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
877
- return [h, w * 100, b * 100];
826
+ const r = rgb[0];
827
+ const g = rgb[1];
828
+ let b = rgb[2];
829
+ const h = convert$1.rgb.hsl(rgb)[0];
830
+ const w = 1 / 255 * Math.min(r, Math.min(g, b));
831
+
832
+ b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
833
+
834
+ return [h, w * 100, b * 100];
878
835
  };
879
836
 
880
837
  convert$1.rgb.cmyk = function (rgb) {
881
- const r = rgb[0] / 255;
882
- const g = rgb[1] / 255;
883
- const b = rgb[2] / 255;
884
- const k = Math.min(1 - r, 1 - g, 1 - b);
885
- const c = (1 - r - k) / (1 - k) || 0;
886
- const m = (1 - g - k) / (1 - k) || 0;
887
- const y = (1 - b - k) / (1 - k) || 0;
888
- return [c * 100, m * 100, y * 100, k * 100];
838
+ const r = rgb[0] / 255;
839
+ const g = rgb[1] / 255;
840
+ const b = rgb[2] / 255;
841
+
842
+ const k = Math.min(1 - r, 1 - g, 1 - b);
843
+ const c = (1 - r - k) / (1 - k) || 0;
844
+ const m = (1 - g - k) / (1 - k) || 0;
845
+ const y = (1 - b - k) / (1 - k) || 0;
846
+
847
+ return [c * 100, m * 100, y * 100, k * 100];
889
848
  };
890
849
 
891
850
  function comparativeDistance(x, y) {
892
- /*
893
- See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
894
- */
895
- return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
851
+ /*
852
+ See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
853
+ */
854
+ return (
855
+ ((x[0] - y[0]) ** 2) +
856
+ ((x[1] - y[1]) ** 2) +
857
+ ((x[2] - y[2]) ** 2)
858
+ );
896
859
  }
897
860
 
898
861
  convert$1.rgb.keyword = function (rgb) {
899
- const reversed = reverseKeywords[rgb];
900
-
901
- if (reversed) {
902
- return reversed;
903
- }
862
+ const reversed = reverseKeywords[rgb];
863
+ if (reversed) {
864
+ return reversed;
865
+ }
904
866
 
905
- let currentClosestDistance = Infinity;
906
- let currentClosestKeyword;
867
+ let currentClosestDistance = Infinity;
868
+ let currentClosestKeyword;
907
869
 
908
- for (const keyword of Object.keys(colorName)) {
909
- const value = colorName[keyword]; // Compute comparative distance
870
+ for (const keyword of Object.keys(colorName)) {
871
+ const value = colorName[keyword];
910
872
 
911
- const distance = comparativeDistance(rgb, value); // Check if its less, if so set as closest
873
+ // Compute comparative distance
874
+ const distance = comparativeDistance(rgb, value);
912
875
 
913
- if (distance < currentClosestDistance) {
914
- currentClosestDistance = distance;
915
- currentClosestKeyword = keyword;
916
- }
917
- }
876
+ // Check if its less, if so set as closest
877
+ if (distance < currentClosestDistance) {
878
+ currentClosestDistance = distance;
879
+ currentClosestKeyword = keyword;
880
+ }
881
+ }
918
882
 
919
- return currentClosestKeyword;
883
+ return currentClosestKeyword;
920
884
  };
921
885
 
922
886
  convert$1.keyword.rgb = function (keyword) {
923
- return colorName[keyword];
887
+ return colorName[keyword];
924
888
  };
925
889
 
926
890
  convert$1.rgb.xyz = function (rgb) {
927
- let r = rgb[0] / 255;
928
- let g = rgb[1] / 255;
929
- let b = rgb[2] / 255; // Assume sRGB
891
+ let r = rgb[0] / 255;
892
+ let g = rgb[1] / 255;
893
+ let b = rgb[2] / 255;
930
894
 
931
- r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
932
- g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
933
- b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
934
- const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
935
- const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
936
- const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
937
- return [x * 100, y * 100, z * 100];
895
+ // Assume sRGB
896
+ r = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92);
897
+ g = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92);
898
+ b = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92);
899
+
900
+ const x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);
901
+ const y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);
902
+ const z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);
903
+
904
+ return [x * 100, y * 100, z * 100];
938
905
  };
939
906
 
940
907
  convert$1.rgb.lab = function (rgb) {
941
- const xyz = convert$1.rgb.xyz(rgb);
942
- let x = xyz[0];
943
- let y = xyz[1];
944
- let z = xyz[2];
945
- x /= 95.047;
946
- y /= 100;
947
- z /= 108.883;
948
- x = x > 0.008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
949
- y = y > 0.008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
950
- z = z > 0.008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
951
- const l = 116 * y - 16;
952
- const a = 500 * (x - y);
953
- const b = 200 * (y - z);
954
- return [l, a, b];
908
+ const xyz = convert$1.rgb.xyz(rgb);
909
+ let x = xyz[0];
910
+ let y = xyz[1];
911
+ let z = xyz[2];
912
+
913
+ x /= 95.047;
914
+ y /= 100;
915
+ z /= 108.883;
916
+
917
+ x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);
918
+ y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);
919
+ z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);
920
+
921
+ const l = (116 * y) - 16;
922
+ const a = 500 * (x - y);
923
+ const b = 200 * (y - z);
924
+
925
+ return [l, a, b];
955
926
  };
956
927
 
957
928
  convert$1.hsl.rgb = function (hsl) {
958
- const h = hsl[0] / 360;
959
- const s = hsl[1] / 100;
960
- const l = hsl[2] / 100;
961
- let t2;
962
- let t3;
963
- let val;
964
-
965
- if (s === 0) {
966
- val = l * 255;
967
- return [val, val, val];
968
- }
969
-
970
- if (l < 0.5) {
971
- t2 = l * (1 + s);
972
- } else {
973
- t2 = l + s - l * s;
974
- }
929
+ const h = hsl[0] / 360;
930
+ const s = hsl[1] / 100;
931
+ const l = hsl[2] / 100;
932
+ let t2;
933
+ let t3;
934
+ let val;
935
+
936
+ if (s === 0) {
937
+ val = l * 255;
938
+ return [val, val, val];
939
+ }
975
940
 
976
- const t1 = 2 * l - t2;
977
- const rgb = [0, 0, 0];
941
+ if (l < 0.5) {
942
+ t2 = l * (1 + s);
943
+ } else {
944
+ t2 = l + s - l * s;
945
+ }
978
946
 
979
- for (let i = 0; i < 3; i++) {
980
- t3 = h + 1 / 3 * -(i - 1);
947
+ const t1 = 2 * l - t2;
981
948
 
982
- if (t3 < 0) {
983
- t3++;
984
- }
949
+ const rgb = [0, 0, 0];
950
+ for (let i = 0; i < 3; i++) {
951
+ t3 = h + 1 / 3 * -(i - 1);
952
+ if (t3 < 0) {
953
+ t3++;
954
+ }
985
955
 
986
- if (t3 > 1) {
987
- t3--;
988
- }
956
+ if (t3 > 1) {
957
+ t3--;
958
+ }
989
959
 
990
- if (6 * t3 < 1) {
991
- val = t1 + (t2 - t1) * 6 * t3;
992
- } else if (2 * t3 < 1) {
993
- val = t2;
994
- } else if (3 * t3 < 2) {
995
- val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
996
- } else {
997
- val = t1;
998
- }
960
+ if (6 * t3 < 1) {
961
+ val = t1 + (t2 - t1) * 6 * t3;
962
+ } else if (2 * t3 < 1) {
963
+ val = t2;
964
+ } else if (3 * t3 < 2) {
965
+ val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
966
+ } else {
967
+ val = t1;
968
+ }
999
969
 
1000
- rgb[i] = val * 255;
1001
- }
970
+ rgb[i] = val * 255;
971
+ }
1002
972
 
1003
- return rgb;
973
+ return rgb;
1004
974
  };
1005
975
 
1006
976
  convert$1.hsl.hsv = function (hsl) {
1007
- const h = hsl[0];
1008
- let s = hsl[1] / 100;
1009
- let l = hsl[2] / 100;
1010
- let smin = s;
1011
- const lmin = Math.max(l, 0.01);
1012
- l *= 2;
1013
- s *= l <= 1 ? l : 2 - l;
1014
- smin *= lmin <= 1 ? lmin : 2 - lmin;
1015
- const v = (l + s) / 2;
1016
- const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
1017
- return [h, sv * 100, v * 100];
977
+ const h = hsl[0];
978
+ let s = hsl[1] / 100;
979
+ let l = hsl[2] / 100;
980
+ let smin = s;
981
+ const lmin = Math.max(l, 0.01);
982
+
983
+ l *= 2;
984
+ s *= (l <= 1) ? l : 2 - l;
985
+ smin *= lmin <= 1 ? lmin : 2 - lmin;
986
+ const v = (l + s) / 2;
987
+ const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);
988
+
989
+ return [h, sv * 100, v * 100];
1018
990
  };
1019
991
 
1020
992
  convert$1.hsv.rgb = function (hsv) {
1021
- const h = hsv[0] / 60;
1022
- const s = hsv[1] / 100;
1023
- let v = hsv[2] / 100;
1024
- const hi = Math.floor(h) % 6;
1025
- const f = h - Math.floor(h);
1026
- const p = 255 * v * (1 - s);
1027
- const q = 255 * v * (1 - s * f);
1028
- const t = 255 * v * (1 - s * (1 - f));
1029
- v *= 255;
1030
-
1031
- switch (hi) {
1032
- case 0:
1033
- return [v, t, p];
1034
-
1035
- case 1:
1036
- return [q, v, p];
1037
-
1038
- case 2:
1039
- return [p, v, t];
1040
-
1041
- case 3:
1042
- return [p, q, v];
1043
-
1044
- case 4:
1045
- return [t, p, v];
1046
-
1047
- case 5:
1048
- return [v, p, q];
1049
- }
993
+ const h = hsv[0] / 60;
994
+ const s = hsv[1] / 100;
995
+ let v = hsv[2] / 100;
996
+ const hi = Math.floor(h) % 6;
997
+
998
+ const f = h - Math.floor(h);
999
+ const p = 255 * v * (1 - s);
1000
+ const q = 255 * v * (1 - (s * f));
1001
+ const t = 255 * v * (1 - (s * (1 - f)));
1002
+ v *= 255;
1003
+
1004
+ switch (hi) {
1005
+ case 0:
1006
+ return [v, t, p];
1007
+ case 1:
1008
+ return [q, v, p];
1009
+ case 2:
1010
+ return [p, v, t];
1011
+ case 3:
1012
+ return [p, q, v];
1013
+ case 4:
1014
+ return [t, p, v];
1015
+ case 5:
1016
+ return [v, p, q];
1017
+ }
1050
1018
  };
1051
1019
 
1052
1020
  convert$1.hsv.hsl = function (hsv) {
1053
- const h = hsv[0];
1054
- const s = hsv[1] / 100;
1055
- const v = hsv[2] / 100;
1056
- const vmin = Math.max(v, 0.01);
1057
- let sl;
1058
- let l;
1059
- l = (2 - s) * v;
1060
- const lmin = (2 - s) * vmin;
1061
- sl = s * vmin;
1062
- sl /= lmin <= 1 ? lmin : 2 - lmin;
1063
- sl = sl || 0;
1064
- l /= 2;
1065
- return [h, sl * 100, l * 100];
1066
- }; // http://dev.w3.org/csswg/css-color/#hwb-to-rgb
1021
+ const h = hsv[0];
1022
+ const s = hsv[1] / 100;
1023
+ const v = hsv[2] / 100;
1024
+ const vmin = Math.max(v, 0.01);
1025
+ let sl;
1026
+ let l;
1027
+
1028
+ l = (2 - s) * v;
1029
+ const lmin = (2 - s) * vmin;
1030
+ sl = s * vmin;
1031
+ sl /= (lmin <= 1) ? lmin : 2 - lmin;
1032
+ sl = sl || 0;
1033
+ l /= 2;
1067
1034
 
1035
+ return [h, sl * 100, l * 100];
1036
+ };
1068
1037
 
1038
+ // http://dev.w3.org/csswg/css-color/#hwb-to-rgb
1069
1039
  convert$1.hwb.rgb = function (hwb) {
1070
- const h = hwb[0] / 360;
1071
- let wh = hwb[1] / 100;
1072
- let bl = hwb[2] / 100;
1073
- const ratio = wh + bl;
1074
- let f; // Wh + bl cant be > 1
1075
-
1076
- if (ratio > 1) {
1077
- wh /= ratio;
1078
- bl /= ratio;
1079
- }
1040
+ const h = hwb[0] / 360;
1041
+ let wh = hwb[1] / 100;
1042
+ let bl = hwb[2] / 100;
1043
+ const ratio = wh + bl;
1044
+ let f;
1045
+
1046
+ // Wh + bl cant be > 1
1047
+ if (ratio > 1) {
1048
+ wh /= ratio;
1049
+ bl /= ratio;
1050
+ }
1080
1051
 
1081
- const i = Math.floor(6 * h);
1082
- const v = 1 - bl;
1083
- f = 6 * h - i;
1052
+ const i = Math.floor(6 * h);
1053
+ const v = 1 - bl;
1054
+ f = 6 * h - i;
1084
1055
 
1085
- if ((i & 0x01) !== 0) {
1086
- f = 1 - f;
1087
- }
1056
+ if ((i & 0x01) !== 0) {
1057
+ f = 1 - f;
1058
+ }
1088
1059
 
1089
- const n = wh + f * (v - wh); // Linear interpolation
1090
-
1091
- let r;
1092
- let g;
1093
- let b;
1094
- /* eslint-disable max-statements-per-line,no-multi-spaces */
1095
-
1096
- switch (i) {
1097
- default:
1098
- case 6:
1099
- case 0:
1100
- r = v;
1101
- g = n;
1102
- b = wh;
1103
- break;
1104
-
1105
- case 1:
1106
- r = n;
1107
- g = v;
1108
- b = wh;
1109
- break;
1110
-
1111
- case 2:
1112
- r = wh;
1113
- g = v;
1114
- b = n;
1115
- break;
1116
-
1117
- case 3:
1118
- r = wh;
1119
- g = n;
1120
- b = v;
1121
- break;
1122
-
1123
- case 4:
1124
- r = n;
1125
- g = wh;
1126
- b = v;
1127
- break;
1128
-
1129
- case 5:
1130
- r = v;
1131
- g = wh;
1132
- b = n;
1133
- break;
1134
- }
1135
- /* eslint-enable max-statements-per-line,no-multi-spaces */
1060
+ const n = wh + f * (v - wh); // Linear interpolation
1136
1061
 
1062
+ let r;
1063
+ let g;
1064
+ let b;
1065
+ /* eslint-disable max-statements-per-line,no-multi-spaces */
1066
+ switch (i) {
1067
+ default:
1068
+ case 6:
1069
+ case 0: r = v; g = n; b = wh; break;
1070
+ case 1: r = n; g = v; b = wh; break;
1071
+ case 2: r = wh; g = v; b = n; break;
1072
+ case 3: r = wh; g = n; b = v; break;
1073
+ case 4: r = n; g = wh; b = v; break;
1074
+ case 5: r = v; g = wh; b = n; break;
1075
+ }
1076
+ /* eslint-enable max-statements-per-line,no-multi-spaces */
1137
1077
 
1138
- return [r * 255, g * 255, b * 255];
1078
+ return [r * 255, g * 255, b * 255];
1139
1079
  };
1140
1080
 
1141
1081
  convert$1.cmyk.rgb = function (cmyk) {
1142
- const c = cmyk[0] / 100;
1143
- const m = cmyk[1] / 100;
1144
- const y = cmyk[2] / 100;
1145
- const k = cmyk[3] / 100;
1146
- const r = 1 - Math.min(1, c * (1 - k) + k);
1147
- const g = 1 - Math.min(1, m * (1 - k) + k);
1148
- const b = 1 - Math.min(1, y * (1 - k) + k);
1149
- return [r * 255, g * 255, b * 255];
1082
+ const c = cmyk[0] / 100;
1083
+ const m = cmyk[1] / 100;
1084
+ const y = cmyk[2] / 100;
1085
+ const k = cmyk[3] / 100;
1086
+
1087
+ const r = 1 - Math.min(1, c * (1 - k) + k);
1088
+ const g = 1 - Math.min(1, m * (1 - k) + k);
1089
+ const b = 1 - Math.min(1, y * (1 - k) + k);
1090
+
1091
+ return [r * 255, g * 255, b * 255];
1150
1092
  };
1151
1093
 
1152
1094
  convert$1.xyz.rgb = function (xyz) {
1153
- const x = xyz[0] / 100;
1154
- const y = xyz[1] / 100;
1155
- const z = xyz[2] / 100;
1156
- let r;
1157
- let g;
1158
- let b;
1159
- r = x * 3.2406 + y * -1.5372 + z * -0.4986;
1160
- g = x * -0.9689 + y * 1.8758 + z * 0.0415;
1161
- b = x * 0.0557 + y * -0.2040 + z * 1.0570; // Assume sRGB
1162
-
1163
- r = r > 0.0031308 ? 1.055 * r ** (1.0 / 2.4) - 0.055 : r * 12.92;
1164
- g = g > 0.0031308 ? 1.055 * g ** (1.0 / 2.4) - 0.055 : g * 12.92;
1165
- b = b > 0.0031308 ? 1.055 * b ** (1.0 / 2.4) - 0.055 : b * 12.92;
1166
- r = Math.min(Math.max(0, r), 1);
1167
- g = Math.min(Math.max(0, g), 1);
1168
- b = Math.min(Math.max(0, b), 1);
1169
- return [r * 255, g * 255, b * 255];
1095
+ const x = xyz[0] / 100;
1096
+ const y = xyz[1] / 100;
1097
+ const z = xyz[2] / 100;
1098
+ let r;
1099
+ let g;
1100
+ let b;
1101
+
1102
+ r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);
1103
+ g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);
1104
+ b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);
1105
+
1106
+ // Assume sRGB
1107
+ r = r > 0.0031308
1108
+ ? ((1.055 * (r ** (1.0 / 2.4))) - 0.055)
1109
+ : r * 12.92;
1110
+
1111
+ g = g > 0.0031308
1112
+ ? ((1.055 * (g ** (1.0 / 2.4))) - 0.055)
1113
+ : g * 12.92;
1114
+
1115
+ b = b > 0.0031308
1116
+ ? ((1.055 * (b ** (1.0 / 2.4))) - 0.055)
1117
+ : b * 12.92;
1118
+
1119
+ r = Math.min(Math.max(0, r), 1);
1120
+ g = Math.min(Math.max(0, g), 1);
1121
+ b = Math.min(Math.max(0, b), 1);
1122
+
1123
+ return [r * 255, g * 255, b * 255];
1170
1124
  };
1171
1125
 
1172
1126
  convert$1.xyz.lab = function (xyz) {
1173
- let x = xyz[0];
1174
- let y = xyz[1];
1175
- let z = xyz[2];
1176
- x /= 95.047;
1177
- y /= 100;
1178
- z /= 108.883;
1179
- x = x > 0.008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
1180
- y = y > 0.008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
1181
- z = z > 0.008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
1182
- const l = 116 * y - 16;
1183
- const a = 500 * (x - y);
1184
- const b = 200 * (y - z);
1185
- return [l, a, b];
1127
+ let x = xyz[0];
1128
+ let y = xyz[1];
1129
+ let z = xyz[2];
1130
+
1131
+ x /= 95.047;
1132
+ y /= 100;
1133
+ z /= 108.883;
1134
+
1135
+ x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);
1136
+ y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);
1137
+ z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);
1138
+
1139
+ const l = (116 * y) - 16;
1140
+ const a = 500 * (x - y);
1141
+ const b = 200 * (y - z);
1142
+
1143
+ return [l, a, b];
1186
1144
  };
1187
1145
 
1188
1146
  convert$1.lab.xyz = function (lab) {
1189
- const l = lab[0];
1190
- const a = lab[1];
1191
- const b = lab[2];
1192
- let x;
1193
- let y;
1194
- let z;
1195
- y = (l + 16) / 116;
1196
- x = a / 500 + y;
1197
- z = y - b / 200;
1198
- const y2 = y ** 3;
1199
- const x2 = x ** 3;
1200
- const z2 = z ** 3;
1201
- y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
1202
- x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
1203
- z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
1204
- x *= 95.047;
1205
- y *= 100;
1206
- z *= 108.883;
1207
- return [x, y, z];
1147
+ const l = lab[0];
1148
+ const a = lab[1];
1149
+ const b = lab[2];
1150
+ let x;
1151
+ let y;
1152
+ let z;
1153
+
1154
+ y = (l + 16) / 116;
1155
+ x = a / 500 + y;
1156
+ z = y - b / 200;
1157
+
1158
+ const y2 = y ** 3;
1159
+ const x2 = x ** 3;
1160
+ const z2 = z ** 3;
1161
+ y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
1162
+ x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
1163
+ z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
1164
+
1165
+ x *= 95.047;
1166
+ y *= 100;
1167
+ z *= 108.883;
1168
+
1169
+ return [x, y, z];
1208
1170
  };
1209
1171
 
1210
1172
  convert$1.lab.lch = function (lab) {
1211
- const l = lab[0];
1212
- const a = lab[1];
1213
- const b = lab[2];
1214
- let h;
1215
- const hr = Math.atan2(b, a);
1216
- h = hr * 360 / 2 / Math.PI;
1217
-
1218
- if (h < 0) {
1219
- h += 360;
1220
- }
1173
+ const l = lab[0];
1174
+ const a = lab[1];
1175
+ const b = lab[2];
1176
+ let h;
1177
+
1178
+ const hr = Math.atan2(b, a);
1179
+ h = hr * 360 / 2 / Math.PI;
1180
+
1181
+ if (h < 0) {
1182
+ h += 360;
1183
+ }
1184
+
1185
+ const c = Math.sqrt(a * a + b * b);
1221
1186
 
1222
- const c = Math.sqrt(a * a + b * b);
1223
- return [l, c, h];
1187
+ return [l, c, h];
1224
1188
  };
1225
1189
 
1226
1190
  convert$1.lch.lab = function (lch) {
1227
- const l = lch[0];
1228
- const c = lch[1];
1229
- const h = lch[2];
1230
- const hr = h / 360 * 2 * Math.PI;
1231
- const a = c * Math.cos(hr);
1232
- const b = c * Math.sin(hr);
1233
- return [l, a, b];
1191
+ const l = lch[0];
1192
+ const c = lch[1];
1193
+ const h = lch[2];
1194
+
1195
+ const hr = h / 360 * 2 * Math.PI;
1196
+ const a = c * Math.cos(hr);
1197
+ const b = c * Math.sin(hr);
1198
+
1199
+ return [l, a, b];
1234
1200
  };
1235
1201
 
1236
1202
  convert$1.rgb.ansi16 = function (args, saturation = null) {
1237
- const [r, g, b] = args;
1238
- let value = saturation === null ? convert$1.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization
1203
+ const [r, g, b] = args;
1204
+ let value = saturation === null ? convert$1.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization
1239
1205
 
1240
- value = Math.round(value / 50);
1206
+ value = Math.round(value / 50);
1241
1207
 
1242
- if (value === 0) {
1243
- return 30;
1244
- }
1208
+ if (value === 0) {
1209
+ return 30;
1210
+ }
1245
1211
 
1246
- let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
1212
+ let ansi = 30
1213
+ + ((Math.round(b / 255) << 2)
1214
+ | (Math.round(g / 255) << 1)
1215
+ | Math.round(r / 255));
1247
1216
 
1248
- if (value === 2) {
1249
- ansi += 60;
1250
- }
1217
+ if (value === 2) {
1218
+ ansi += 60;
1219
+ }
1251
1220
 
1252
- return ansi;
1221
+ return ansi;
1253
1222
  };
1254
1223
 
1255
1224
  convert$1.hsv.ansi16 = function (args) {
1256
- // Optimization here; we already know the value and don't need to get
1257
- // it converted for us.
1258
- return convert$1.rgb.ansi16(convert$1.hsv.rgb(args), args[2]);
1225
+ // Optimization here; we already know the value and don't need to get
1226
+ // it converted for us.
1227
+ return convert$1.rgb.ansi16(convert$1.hsv.rgb(args), args[2]);
1259
1228
  };
1260
1229
 
1261
1230
  convert$1.rgb.ansi256 = function (args) {
1262
- const r = args[0];
1263
- const g = args[1];
1264
- const b = args[2]; // We use the extended greyscale palette here, with the exception of
1265
- // black and white. normal palette only has 4 greyscale shades.
1266
-
1267
- if (r === g && g === b) {
1268
- if (r < 8) {
1269
- return 16;
1270
- }
1231
+ const r = args[0];
1232
+ const g = args[1];
1233
+ const b = args[2];
1234
+
1235
+ // We use the extended greyscale palette here, with the exception of
1236
+ // black and white. normal palette only has 4 greyscale shades.
1237
+ if (r === g && g === b) {
1238
+ if (r < 8) {
1239
+ return 16;
1240
+ }
1271
1241
 
1272
- if (r > 248) {
1273
- return 231;
1274
- }
1242
+ if (r > 248) {
1243
+ return 231;
1244
+ }
1275
1245
 
1276
- return Math.round((r - 8) / 247 * 24) + 232;
1277
- }
1246
+ return Math.round(((r - 8) / 247) * 24) + 232;
1247
+ }
1278
1248
 
1279
- const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
1280
- return ansi;
1249
+ const ansi = 16
1250
+ + (36 * Math.round(r / 255 * 5))
1251
+ + (6 * Math.round(g / 255 * 5))
1252
+ + Math.round(b / 255 * 5);
1253
+
1254
+ return ansi;
1281
1255
  };
1282
1256
 
1283
1257
  convert$1.ansi16.rgb = function (args) {
1284
- let color = args % 10; // Handle greyscale
1258
+ let color = args % 10;
1285
1259
 
1286
- if (color === 0 || color === 7) {
1287
- if (args > 50) {
1288
- color += 3.5;
1289
- }
1260
+ // Handle greyscale
1261
+ if (color === 0 || color === 7) {
1262
+ if (args > 50) {
1263
+ color += 3.5;
1264
+ }
1290
1265
 
1291
- color = color / 10.5 * 255;
1292
- return [color, color, color];
1293
- }
1266
+ color = color / 10.5 * 255;
1267
+
1268
+ return [color, color, color];
1269
+ }
1270
+
1271
+ const mult = (~~(args > 50) + 1) * 0.5;
1272
+ const r = ((color & 1) * mult) * 255;
1273
+ const g = (((color >> 1) & 1) * mult) * 255;
1274
+ const b = (((color >> 2) & 1) * mult) * 255;
1294
1275
 
1295
- const mult = (~~(args > 50) + 1) * 0.5;
1296
- const r = (color & 1) * mult * 255;
1297
- const g = (color >> 1 & 1) * mult * 255;
1298
- const b = (color >> 2 & 1) * mult * 255;
1299
- return [r, g, b];
1276
+ return [r, g, b];
1300
1277
  };
1301
1278
 
1302
1279
  convert$1.ansi256.rgb = function (args) {
1303
- // Handle greyscale
1304
- if (args >= 232) {
1305
- const c = (args - 232) * 10 + 8;
1306
- return [c, c, c];
1307
- }
1280
+ // Handle greyscale
1281
+ if (args >= 232) {
1282
+ const c = (args - 232) * 10 + 8;
1283
+ return [c, c, c];
1284
+ }
1285
+
1286
+ args -= 16;
1308
1287
 
1309
- args -= 16;
1310
- let rem;
1311
- const r = Math.floor(args / 36) / 5 * 255;
1312
- const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
1313
- const b = rem % 6 / 5 * 255;
1314
- return [r, g, b];
1288
+ let rem;
1289
+ const r = Math.floor(args / 36) / 5 * 255;
1290
+ const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
1291
+ const b = (rem % 6) / 5 * 255;
1292
+
1293
+ return [r, g, b];
1315
1294
  };
1316
1295
 
1317
1296
  convert$1.rgb.hex = function (args) {
1318
- const integer = ((Math.round(args[0]) & 0xFF) << 16) + ((Math.round(args[1]) & 0xFF) << 8) + (Math.round(args[2]) & 0xFF);
1319
- const string = integer.toString(16).toUpperCase();
1320
- return '000000'.substring(string.length) + string;
1297
+ const integer = ((Math.round(args[0]) & 0xFF) << 16)
1298
+ + ((Math.round(args[1]) & 0xFF) << 8)
1299
+ + (Math.round(args[2]) & 0xFF);
1300
+
1301
+ const string = integer.toString(16).toUpperCase();
1302
+ return '000000'.substring(string.length) + string;
1321
1303
  };
1322
1304
 
1323
1305
  convert$1.hex.rgb = function (args) {
1324
- const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
1306
+ const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
1307
+ if (!match) {
1308
+ return [0, 0, 0];
1309
+ }
1325
1310
 
1326
- if (!match) {
1327
- return [0, 0, 0];
1328
- }
1311
+ let colorString = match[0];
1329
1312
 
1330
- let colorString = match[0];
1313
+ if (match[0].length === 3) {
1314
+ colorString = colorString.split('').map(char => {
1315
+ return char + char;
1316
+ }).join('');
1317
+ }
1331
1318
 
1332
- if (match[0].length === 3) {
1333
- colorString = colorString.split('').map(char => {
1334
- return char + char;
1335
- }).join('');
1336
- }
1319
+ const integer = parseInt(colorString, 16);
1320
+ const r = (integer >> 16) & 0xFF;
1321
+ const g = (integer >> 8) & 0xFF;
1322
+ const b = integer & 0xFF;
1337
1323
 
1338
- const integer = parseInt(colorString, 16);
1339
- const r = integer >> 16 & 0xFF;
1340
- const g = integer >> 8 & 0xFF;
1341
- const b = integer & 0xFF;
1342
- return [r, g, b];
1324
+ return [r, g, b];
1343
1325
  };
1344
1326
 
1345
1327
  convert$1.rgb.hcg = function (rgb) {
1346
- const r = rgb[0] / 255;
1347
- const g = rgb[1] / 255;
1348
- const b = rgb[2] / 255;
1349
- const max = Math.max(Math.max(r, g), b);
1350
- const min = Math.min(Math.min(r, g), b);
1351
- const chroma = max - min;
1352
- let grayscale;
1353
- let hue;
1354
-
1355
- if (chroma < 1) {
1356
- grayscale = min / (1 - chroma);
1357
- } else {
1358
- grayscale = 0;
1359
- }
1328
+ const r = rgb[0] / 255;
1329
+ const g = rgb[1] / 255;
1330
+ const b = rgb[2] / 255;
1331
+ const max = Math.max(Math.max(r, g), b);
1332
+ const min = Math.min(Math.min(r, g), b);
1333
+ const chroma = (max - min);
1334
+ let grayscale;
1335
+ let hue;
1336
+
1337
+ if (chroma < 1) {
1338
+ grayscale = min / (1 - chroma);
1339
+ } else {
1340
+ grayscale = 0;
1341
+ }
1360
1342
 
1361
- if (chroma <= 0) {
1362
- hue = 0;
1363
- } else if (max === r) {
1364
- hue = (g - b) / chroma % 6;
1365
- } else if (max === g) {
1366
- hue = 2 + (b - r) / chroma;
1367
- } else {
1368
- hue = 4 + (r - g) / chroma;
1369
- }
1343
+ if (chroma <= 0) {
1344
+ hue = 0;
1345
+ } else
1346
+ if (max === r) {
1347
+ hue = ((g - b) / chroma) % 6;
1348
+ } else
1349
+ if (max === g) {
1350
+ hue = 2 + (b - r) / chroma;
1351
+ } else {
1352
+ hue = 4 + (r - g) / chroma;
1353
+ }
1354
+
1355
+ hue /= 6;
1356
+ hue %= 1;
1370
1357
 
1371
- hue /= 6;
1372
- hue %= 1;
1373
- return [hue * 360, chroma * 100, grayscale * 100];
1358
+ return [hue * 360, chroma * 100, grayscale * 100];
1374
1359
  };
1375
1360
 
1376
1361
  convert$1.hsl.hcg = function (hsl) {
1377
- const s = hsl[1] / 100;
1378
- const l = hsl[2] / 100;
1379
- const c = l < 0.5 ? 2.0 * s * l : 2.0 * s * (1.0 - l);
1380
- let f = 0;
1362
+ const s = hsl[1] / 100;
1363
+ const l = hsl[2] / 100;
1381
1364
 
1382
- if (c < 1.0) {
1383
- f = (l - 0.5 * c) / (1.0 - c);
1384
- }
1365
+ const c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l));
1366
+
1367
+ let f = 0;
1368
+ if (c < 1.0) {
1369
+ f = (l - 0.5 * c) / (1.0 - c);
1370
+ }
1385
1371
 
1386
- return [hsl[0], c * 100, f * 100];
1372
+ return [hsl[0], c * 100, f * 100];
1387
1373
  };
1388
1374
 
1389
1375
  convert$1.hsv.hcg = function (hsv) {
1390
- const s = hsv[1] / 100;
1391
- const v = hsv[2] / 100;
1392
- const c = s * v;
1393
- let f = 0;
1376
+ const s = hsv[1] / 100;
1377
+ const v = hsv[2] / 100;
1394
1378
 
1395
- if (c < 1.0) {
1396
- f = (v - c) / (1 - c);
1397
- }
1379
+ const c = s * v;
1380
+ let f = 0;
1398
1381
 
1399
- return [hsv[0], c * 100, f * 100];
1382
+ if (c < 1.0) {
1383
+ f = (v - c) / (1 - c);
1384
+ }
1385
+
1386
+ return [hsv[0], c * 100, f * 100];
1400
1387
  };
1401
1388
 
1402
1389
  convert$1.hcg.rgb = function (hcg) {
1403
- const h = hcg[0] / 360;
1404
- const c = hcg[1] / 100;
1405
- const g = hcg[2] / 100;
1390
+ const h = hcg[0] / 360;
1391
+ const c = hcg[1] / 100;
1392
+ const g = hcg[2] / 100;
1406
1393
 
1407
- if (c === 0.0) {
1408
- return [g * 255, g * 255, g * 255];
1409
- }
1394
+ if (c === 0.0) {
1395
+ return [g * 255, g * 255, g * 255];
1396
+ }
1410
1397
 
1411
- const pure = [0, 0, 0];
1412
- const hi = h % 1 * 6;
1413
- const v = hi % 1;
1414
- const w = 1 - v;
1415
- let mg = 0;
1416
- /* eslint-disable max-statements-per-line */
1417
-
1418
- switch (Math.floor(hi)) {
1419
- case 0:
1420
- pure[0] = 1;
1421
- pure[1] = v;
1422
- pure[2] = 0;
1423
- break;
1424
-
1425
- case 1:
1426
- pure[0] = w;
1427
- pure[1] = 1;
1428
- pure[2] = 0;
1429
- break;
1430
-
1431
- case 2:
1432
- pure[0] = 0;
1433
- pure[1] = 1;
1434
- pure[2] = v;
1435
- break;
1436
-
1437
- case 3:
1438
- pure[0] = 0;
1439
- pure[1] = w;
1440
- pure[2] = 1;
1441
- break;
1442
-
1443
- case 4:
1444
- pure[0] = v;
1445
- pure[1] = 0;
1446
- pure[2] = 1;
1447
- break;
1448
-
1449
- default:
1450
- pure[0] = 1;
1451
- pure[1] = 0;
1452
- pure[2] = w;
1453
- }
1454
- /* eslint-enable max-statements-per-line */
1398
+ const pure = [0, 0, 0];
1399
+ const hi = (h % 1) * 6;
1400
+ const v = hi % 1;
1401
+ const w = 1 - v;
1402
+ let mg = 0;
1403
+
1404
+ /* eslint-disable max-statements-per-line */
1405
+ switch (Math.floor(hi)) {
1406
+ case 0:
1407
+ pure[0] = 1; pure[1] = v; pure[2] = 0; break;
1408
+ case 1:
1409
+ pure[0] = w; pure[1] = 1; pure[2] = 0; break;
1410
+ case 2:
1411
+ pure[0] = 0; pure[1] = 1; pure[2] = v; break;
1412
+ case 3:
1413
+ pure[0] = 0; pure[1] = w; pure[2] = 1; break;
1414
+ case 4:
1415
+ pure[0] = v; pure[1] = 0; pure[2] = 1; break;
1416
+ default:
1417
+ pure[0] = 1; pure[1] = 0; pure[2] = w;
1418
+ }
1419
+ /* eslint-enable max-statements-per-line */
1455
1420
 
1421
+ mg = (1.0 - c) * g;
1456
1422
 
1457
- mg = (1.0 - c) * g;
1458
- return [(c * pure[0] + mg) * 255, (c * pure[1] + mg) * 255, (c * pure[2] + mg) * 255];
1423
+ return [
1424
+ (c * pure[0] + mg) * 255,
1425
+ (c * pure[1] + mg) * 255,
1426
+ (c * pure[2] + mg) * 255
1427
+ ];
1459
1428
  };
1460
1429
 
1461
1430
  convert$1.hcg.hsv = function (hcg) {
1462
- const c = hcg[1] / 100;
1463
- const g = hcg[2] / 100;
1464
- const v = c + g * (1.0 - c);
1465
- let f = 0;
1431
+ const c = hcg[1] / 100;
1432
+ const g = hcg[2] / 100;
1466
1433
 
1467
- if (v > 0.0) {
1468
- f = c / v;
1469
- }
1434
+ const v = c + g * (1.0 - c);
1435
+ let f = 0;
1470
1436
 
1471
- return [hcg[0], f * 100, v * 100];
1437
+ if (v > 0.0) {
1438
+ f = c / v;
1439
+ }
1440
+
1441
+ return [hcg[0], f * 100, v * 100];
1472
1442
  };
1473
1443
 
1474
1444
  convert$1.hcg.hsl = function (hcg) {
1475
- const c = hcg[1] / 100;
1476
- const g = hcg[2] / 100;
1477
- const l = g * (1.0 - c) + 0.5 * c;
1478
- let s = 0;
1479
-
1480
- if (l > 0.0 && l < 0.5) {
1481
- s = c / (2 * l);
1482
- } else if (l >= 0.5 && l < 1.0) {
1483
- s = c / (2 * (1 - l));
1484
- }
1445
+ const c = hcg[1] / 100;
1446
+ const g = hcg[2] / 100;
1447
+
1448
+ const l = g * (1.0 - c) + 0.5 * c;
1449
+ let s = 0;
1485
1450
 
1486
- return [hcg[0], s * 100, l * 100];
1451
+ if (l > 0.0 && l < 0.5) {
1452
+ s = c / (2 * l);
1453
+ } else
1454
+ if (l >= 0.5 && l < 1.0) {
1455
+ s = c / (2 * (1 - l));
1456
+ }
1457
+
1458
+ return [hcg[0], s * 100, l * 100];
1487
1459
  };
1488
1460
 
1489
1461
  convert$1.hcg.hwb = function (hcg) {
1490
- const c = hcg[1] / 100;
1491
- const g = hcg[2] / 100;
1492
- const v = c + g * (1.0 - c);
1493
- return [hcg[0], (v - c) * 100, (1 - v) * 100];
1462
+ const c = hcg[1] / 100;
1463
+ const g = hcg[2] / 100;
1464
+ const v = c + g * (1.0 - c);
1465
+ return [hcg[0], (v - c) * 100, (1 - v) * 100];
1494
1466
  };
1495
1467
 
1496
1468
  convert$1.hwb.hcg = function (hwb) {
1497
- const w = hwb[1] / 100;
1498
- const b = hwb[2] / 100;
1499
- const v = 1 - b;
1500
- const c = v - w;
1501
- let g = 0;
1502
-
1503
- if (c < 1) {
1504
- g = (v - c) / (1 - c);
1505
- }
1469
+ const w = hwb[1] / 100;
1470
+ const b = hwb[2] / 100;
1471
+ const v = 1 - b;
1472
+ const c = v - w;
1473
+ let g = 0;
1474
+
1475
+ if (c < 1) {
1476
+ g = (v - c) / (1 - c);
1477
+ }
1506
1478
 
1507
- return [hwb[0], c * 100, g * 100];
1479
+ return [hwb[0], c * 100, g * 100];
1508
1480
  };
1509
1481
 
1510
1482
  convert$1.apple.rgb = function (apple) {
1511
- return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
1483
+ return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];
1512
1484
  };
1513
1485
 
1514
1486
  convert$1.rgb.apple = function (rgb) {
1515
- return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
1487
+ return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];
1516
1488
  };
1517
1489
 
1518
1490
  convert$1.gray.rgb = function (args) {
1519
- return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
1491
+ return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
1520
1492
  };
1521
1493
 
1522
1494
  convert$1.gray.hsl = function (args) {
1523
- return [0, 0, args[0]];
1495
+ return [0, 0, args[0]];
1524
1496
  };
1525
1497
 
1526
1498
  convert$1.gray.hsv = convert$1.gray.hsl;
1527
1499
 
1528
1500
  convert$1.gray.hwb = function (gray) {
1529
- return [0, 100, gray[0]];
1501
+ return [0, 100, gray[0]];
1530
1502
  };
1531
1503
 
1532
1504
  convert$1.gray.cmyk = function (gray) {
1533
- return [0, 0, 0, gray[0]];
1505
+ return [0, 0, 0, gray[0]];
1534
1506
  };
1535
1507
 
1536
1508
  convert$1.gray.lab = function (gray) {
1537
- return [gray[0], 0, 0];
1509
+ return [gray[0], 0, 0];
1538
1510
  };
1539
1511
 
1540
1512
  convert$1.gray.hex = function (gray) {
1541
- const val = Math.round(gray[0] / 100 * 255) & 0xFF;
1542
- const integer = (val << 16) + (val << 8) + val;
1543
- const string = integer.toString(16).toUpperCase();
1544
- return '000000'.substring(string.length) + string;
1513
+ const val = Math.round(gray[0] / 100 * 255) & 0xFF;
1514
+ const integer = (val << 16) + (val << 8) + val;
1515
+
1516
+ const string = integer.toString(16).toUpperCase();
1517
+ return '000000'.substring(string.length) + string;
1545
1518
  };
1546
1519
 
1547
1520
  convert$1.rgb.gray = function (rgb) {
1548
- const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
1549
- return [val / 255 * 100];
1521
+ const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
1522
+ return [val / 255 * 100];
1550
1523
  };
1551
1524
 
1552
1525
  /*
@@ -1561,639 +1534,658 @@ convert$1.rgb.gray = function (rgb) {
1561
1534
  */
1562
1535
 
1563
1536
  function buildGraph() {
1564
- const graph = {}; // https://jsperf.com/object-keys-vs-for-in-with-closure/3
1565
-
1566
- const models = Object.keys(conversions);
1567
-
1568
- for (let len = models.length, i = 0; i < len; i++) {
1569
- graph[models[i]] = {
1570
- // http://jsperf.com/1-vs-infinity
1571
- // micro-opt, but this is simple.
1572
- distance: -1,
1573
- parent: null
1574
- };
1575
- }
1576
-
1577
- return graph;
1578
- } // https://en.wikipedia.org/wiki/Breadth-first_search
1537
+ const graph = {};
1538
+ // https://jsperf.com/object-keys-vs-for-in-with-closure/3
1539
+ const models = Object.keys(conversions);
1540
+
1541
+ for (let len = models.length, i = 0; i < len; i++) {
1542
+ graph[models[i]] = {
1543
+ // http://jsperf.com/1-vs-infinity
1544
+ // micro-opt, but this is simple.
1545
+ distance: -1,
1546
+ parent: null
1547
+ };
1548
+ }
1579
1549
 
1550
+ return graph;
1551
+ }
1580
1552
 
1553
+ // https://en.wikipedia.org/wiki/Breadth-first_search
1581
1554
  function deriveBFS(fromModel) {
1582
- const graph = buildGraph();
1583
- const queue = [fromModel]; // Unshift -> queue -> pop
1555
+ const graph = buildGraph();
1556
+ const queue = [fromModel]; // Unshift -> queue -> pop
1584
1557
 
1585
- graph[fromModel].distance = 0;
1558
+ graph[fromModel].distance = 0;
1586
1559
 
1587
- while (queue.length) {
1588
- const current = queue.pop();
1589
- const adjacents = Object.keys(conversions[current]);
1560
+ while (queue.length) {
1561
+ const current = queue.pop();
1562
+ const adjacents = Object.keys(conversions[current]);
1590
1563
 
1591
- for (let len = adjacents.length, i = 0; i < len; i++) {
1592
- const adjacent = adjacents[i];
1593
- const node = graph[adjacent];
1564
+ for (let len = adjacents.length, i = 0; i < len; i++) {
1565
+ const adjacent = adjacents[i];
1566
+ const node = graph[adjacent];
1594
1567
 
1595
- if (node.distance === -1) {
1596
- node.distance = graph[current].distance + 1;
1597
- node.parent = current;
1598
- queue.unshift(adjacent);
1599
- }
1600
- }
1601
- }
1568
+ if (node.distance === -1) {
1569
+ node.distance = graph[current].distance + 1;
1570
+ node.parent = current;
1571
+ queue.unshift(adjacent);
1572
+ }
1573
+ }
1574
+ }
1602
1575
 
1603
- return graph;
1576
+ return graph;
1604
1577
  }
1605
1578
 
1606
1579
  function link(from, to) {
1607
- return function (args) {
1608
- return to(from(args));
1609
- };
1580
+ return function (args) {
1581
+ return to(from(args));
1582
+ };
1610
1583
  }
1611
1584
 
1612
1585
  function wrapConversion(toModel, graph) {
1613
- const path = [graph[toModel].parent, toModel];
1614
- let fn = conversions[graph[toModel].parent][toModel];
1615
- let cur = graph[toModel].parent;
1616
-
1617
- while (graph[cur].parent) {
1618
- path.unshift(graph[cur].parent);
1619
- fn = link(conversions[graph[cur].parent][cur], fn);
1620
- cur = graph[cur].parent;
1621
- }
1586
+ const path = [graph[toModel].parent, toModel];
1587
+ let fn = conversions[graph[toModel].parent][toModel];
1588
+
1589
+ let cur = graph[toModel].parent;
1590
+ while (graph[cur].parent) {
1591
+ path.unshift(graph[cur].parent);
1592
+ fn = link(conversions[graph[cur].parent][cur], fn);
1593
+ cur = graph[cur].parent;
1594
+ }
1622
1595
 
1623
- fn.conversion = path;
1624
- return fn;
1596
+ fn.conversion = path;
1597
+ return fn;
1625
1598
  }
1626
1599
 
1627
1600
  var route = function (fromModel) {
1628
- const graph = deriveBFS(fromModel);
1629
- const conversion = {};
1630
- const models = Object.keys(graph);
1601
+ const graph = deriveBFS(fromModel);
1602
+ const conversion = {};
1631
1603
 
1632
- for (let len = models.length, i = 0; i < len; i++) {
1633
- const toModel = models[i];
1634
- const node = graph[toModel];
1604
+ const models = Object.keys(graph);
1605
+ for (let len = models.length, i = 0; i < len; i++) {
1606
+ const toModel = models[i];
1607
+ const node = graph[toModel];
1635
1608
 
1636
- if (node.parent === null) {
1637
- // No possible conversion, or this node is the source model.
1638
- continue;
1639
- }
1609
+ if (node.parent === null) {
1610
+ // No possible conversion, or this node is the source model.
1611
+ continue;
1612
+ }
1640
1613
 
1641
- conversion[toModel] = wrapConversion(toModel, graph);
1642
- }
1614
+ conversion[toModel] = wrapConversion(toModel, graph);
1615
+ }
1643
1616
 
1644
- return conversion;
1617
+ return conversion;
1645
1618
  };
1646
1619
 
1647
1620
  const convert = {};
1621
+
1648
1622
  const models = Object.keys(conversions);
1649
1623
 
1650
1624
  function wrapRaw(fn) {
1651
- const wrappedFn = function (...args) {
1652
- const arg0 = args[0];
1653
-
1654
- if (arg0 === undefined || arg0 === null) {
1655
- return arg0;
1656
- }
1657
-
1658
- if (arg0.length > 1) {
1659
- args = arg0;
1660
- }
1625
+ const wrappedFn = function (...args) {
1626
+ const arg0 = args[0];
1627
+ if (arg0 === undefined || arg0 === null) {
1628
+ return arg0;
1629
+ }
1661
1630
 
1662
- return fn(args);
1663
- }; // Preserve .conversion property if there is one
1631
+ if (arg0.length > 1) {
1632
+ args = arg0;
1633
+ }
1664
1634
 
1635
+ return fn(args);
1636
+ };
1665
1637
 
1666
- if ('conversion' in fn) {
1667
- wrappedFn.conversion = fn.conversion;
1668
- }
1638
+ // Preserve .conversion property if there is one
1639
+ if ('conversion' in fn) {
1640
+ wrappedFn.conversion = fn.conversion;
1641
+ }
1669
1642
 
1670
- return wrappedFn;
1643
+ return wrappedFn;
1671
1644
  }
1672
1645
 
1673
1646
  function wrapRounded(fn) {
1674
- const wrappedFn = function (...args) {
1675
- const arg0 = args[0];
1676
-
1677
- if (arg0 === undefined || arg0 === null) {
1678
- return arg0;
1679
- }
1647
+ const wrappedFn = function (...args) {
1648
+ const arg0 = args[0];
1680
1649
 
1681
- if (arg0.length > 1) {
1682
- args = arg0;
1683
- }
1650
+ if (arg0 === undefined || arg0 === null) {
1651
+ return arg0;
1652
+ }
1684
1653
 
1685
- const result = fn(args); // We're assuming the result is an array here.
1686
- // see notice in conversions.js; don't use box types
1687
- // in conversion functions.
1654
+ if (arg0.length > 1) {
1655
+ args = arg0;
1656
+ }
1688
1657
 
1689
- if (typeof result === 'object') {
1690
- for (let len = result.length, i = 0; i < len; i++) {
1691
- result[i] = Math.round(result[i]);
1692
- }
1693
- }
1658
+ const result = fn(args);
1694
1659
 
1695
- return result;
1696
- }; // Preserve .conversion property if there is one
1660
+ // We're assuming the result is an array here.
1661
+ // see notice in conversions.js; don't use box types
1662
+ // in conversion functions.
1663
+ if (typeof result === 'object') {
1664
+ for (let len = result.length, i = 0; i < len; i++) {
1665
+ result[i] = Math.round(result[i]);
1666
+ }
1667
+ }
1697
1668
 
1669
+ return result;
1670
+ };
1698
1671
 
1699
- if ('conversion' in fn) {
1700
- wrappedFn.conversion = fn.conversion;
1701
- }
1672
+ // Preserve .conversion property if there is one
1673
+ if ('conversion' in fn) {
1674
+ wrappedFn.conversion = fn.conversion;
1675
+ }
1702
1676
 
1703
- return wrappedFn;
1677
+ return wrappedFn;
1704
1678
  }
1705
1679
 
1706
1680
  models.forEach(fromModel => {
1707
- convert[fromModel] = {};
1708
- Object.defineProperty(convert[fromModel], 'channels', {
1709
- value: conversions[fromModel].channels
1710
- });
1711
- Object.defineProperty(convert[fromModel], 'labels', {
1712
- value: conversions[fromModel].labels
1713
- });
1714
- const routes = route(fromModel);
1715
- const routeModels = Object.keys(routes);
1716
- routeModels.forEach(toModel => {
1717
- const fn = routes[toModel];
1718
- convert[fromModel][toModel] = wrapRounded(fn);
1719
- convert[fromModel][toModel].raw = wrapRaw(fn);
1720
- });
1681
+ convert[fromModel] = {};
1682
+
1683
+ Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});
1684
+ Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});
1685
+
1686
+ const routes = route(fromModel);
1687
+ const routeModels = Object.keys(routes);
1688
+
1689
+ routeModels.forEach(toModel => {
1690
+ const fn = routes[toModel];
1691
+
1692
+ convert[fromModel][toModel] = wrapRounded(fn);
1693
+ convert[fromModel][toModel].raw = wrapRaw(fn);
1694
+ });
1721
1695
  });
1696
+
1722
1697
  var colorConvert = convert;
1723
1698
 
1724
- const _slice = [].slice;
1725
- const skippedModels = [// To be honest, I don't really feel like keyword belongs in color convert, but eh.
1726
- 'keyword', // Gray conflicts with some method names, and has its own method defined.
1727
- 'gray', // Shouldn't really be in color-convert either...
1728
- 'hex'];
1729
- const hashedModelKeys = {};
1699
+ const skippedModels = [
1700
+ // To be honest, I don't really feel like keyword belongs in color convert, but eh.
1701
+ 'keyword',
1730
1702
 
1703
+ // Gray conflicts with some method names, and has its own method defined.
1704
+ 'gray',
1705
+
1706
+ // Shouldn't really be in color-convert either...
1707
+ 'hex',
1708
+ ];
1709
+
1710
+ const hashedModelKeys = {};
1731
1711
  for (const model of Object.keys(colorConvert)) {
1732
- hashedModelKeys[_slice.call(colorConvert[model].labels).sort().join('')] = model;
1712
+ hashedModelKeys[[...colorConvert[model].labels].sort().join('')] = model;
1733
1713
  }
1734
1714
 
1735
1715
  const limiters = {};
1736
1716
 
1737
1717
  function Color(object, model) {
1738
- if (!(this instanceof Color)) {
1739
- return new Color(object, model);
1740
- }
1741
-
1742
- if (model && model in skippedModels) {
1743
- model = null;
1744
- }
1745
-
1746
- if (model && !(model in colorConvert)) {
1747
- throw new Error('Unknown model: ' + model);
1748
- }
1749
-
1750
- let i;
1751
- let channels;
1752
-
1753
- if (object == null) {
1754
- // eslint-disable-line no-eq-null,eqeqeq
1755
- this.model = 'rgb';
1756
- this.color = [0, 0, 0];
1757
- this.valpha = 1;
1758
- } else if (object instanceof Color) {
1759
- this.model = object.model;
1760
- this.color = object.color.slice();
1761
- this.valpha = object.valpha;
1762
- } else if (typeof object === 'string') {
1763
- const result = colorString.get(object);
1764
-
1765
- if (result === null) {
1766
- throw new Error('Unable to parse color from string: ' + object);
1767
- }
1718
+ if (!(this instanceof Color)) {
1719
+ return new Color(object, model);
1720
+ }
1768
1721
 
1769
- this.model = result.model;
1770
- channels = colorConvert[this.model].channels;
1771
- this.color = result.value.slice(0, channels);
1772
- this.valpha = typeof result.value[channels] === 'number' ? result.value[channels] : 1;
1773
- } else if (object.length > 0) {
1774
- this.model = model || 'rgb';
1775
- channels = colorConvert[this.model].channels;
1776
-
1777
- const newArray = _slice.call(object, 0, channels);
1778
-
1779
- this.color = zeroArray(newArray, channels);
1780
- this.valpha = typeof object[channels] === 'number' ? object[channels] : 1;
1781
- } else if (typeof object === 'number') {
1782
- // This is always RGB - can be converted later on.
1783
- this.model = 'rgb';
1784
- this.color = [object >> 16 & 0xFF, object >> 8 & 0xFF, object & 0xFF];
1785
- this.valpha = 1;
1786
- } else {
1787
- this.valpha = 1;
1788
- const keys = Object.keys(object);
1789
-
1790
- if ('alpha' in object) {
1791
- keys.splice(keys.indexOf('alpha'), 1);
1792
- this.valpha = typeof object.alpha === 'number' ? object.alpha : 0;
1793
- }
1722
+ if (model && model in skippedModels) {
1723
+ model = null;
1724
+ }
1794
1725
 
1795
- const hashedKeys = keys.sort().join('');
1726
+ if (model && !(model in colorConvert)) {
1727
+ throw new Error('Unknown model: ' + model);
1728
+ }
1796
1729
 
1797
- if (!(hashedKeys in hashedModelKeys)) {
1798
- throw new Error('Unable to parse color from object: ' + JSON.stringify(object));
1799
- }
1730
+ let i;
1731
+ let channels;
1732
+
1733
+ if (object == null) { // eslint-disable-line no-eq-null,eqeqeq
1734
+ this.model = 'rgb';
1735
+ this.color = [0, 0, 0];
1736
+ this.valpha = 1;
1737
+ } else if (object instanceof Color) {
1738
+ this.model = object.model;
1739
+ this.color = [...object.color];
1740
+ this.valpha = object.valpha;
1741
+ } else if (typeof object === 'string') {
1742
+ const result = colorString.get(object);
1743
+ if (result === null) {
1744
+ throw new Error('Unable to parse color from string: ' + object);
1745
+ }
1800
1746
 
1801
- this.model = hashedModelKeys[hashedKeys];
1802
- const labels = colorConvert[this.model].labels;
1803
- const color = [];
1747
+ this.model = result.model;
1748
+ channels = colorConvert[this.model].channels;
1749
+ this.color = result.value.slice(0, channels);
1750
+ this.valpha = typeof result.value[channels] === 'number' ? result.value[channels] : 1;
1751
+ } else if (object.length > 0) {
1752
+ this.model = model || 'rgb';
1753
+ channels = colorConvert[this.model].channels;
1754
+ const newArray = Array.prototype.slice.call(object, 0, channels);
1755
+ this.color = zeroArray(newArray, channels);
1756
+ this.valpha = typeof object[channels] === 'number' ? object[channels] : 1;
1757
+ } else if (typeof object === 'number') {
1758
+ // This is always RGB - can be converted later on.
1759
+ this.model = 'rgb';
1760
+ this.color = [
1761
+ (object >> 16) & 0xFF,
1762
+ (object >> 8) & 0xFF,
1763
+ object & 0xFF,
1764
+ ];
1765
+ this.valpha = 1;
1766
+ } else {
1767
+ this.valpha = 1;
1804
1768
 
1805
- for (i = 0; i < labels.length; i++) {
1806
- color.push(object[labels[i]]);
1807
- }
1769
+ const keys = Object.keys(object);
1770
+ if ('alpha' in object) {
1771
+ keys.splice(keys.indexOf('alpha'), 1);
1772
+ this.valpha = typeof object.alpha === 'number' ? object.alpha : 0;
1773
+ }
1808
1774
 
1809
- this.color = zeroArray(color);
1810
- } // Perform limitations (clamping, etc.)
1775
+ const hashedKeys = keys.sort().join('');
1776
+ if (!(hashedKeys in hashedModelKeys)) {
1777
+ throw new Error('Unable to parse color from object: ' + JSON.stringify(object));
1778
+ }
1811
1779
 
1780
+ this.model = hashedModelKeys[hashedKeys];
1812
1781
 
1813
- if (limiters[this.model]) {
1814
- channels = colorConvert[this.model].channels;
1782
+ const {labels} = colorConvert[this.model];
1783
+ const color = [];
1784
+ for (i = 0; i < labels.length; i++) {
1785
+ color.push(object[labels[i]]);
1786
+ }
1815
1787
 
1816
- for (i = 0; i < channels; i++) {
1817
- const limit = limiters[this.model][i];
1788
+ this.color = zeroArray(color);
1789
+ }
1818
1790
 
1819
- if (limit) {
1820
- this.color[i] = limit(this.color[i]);
1821
- }
1822
- }
1823
- }
1791
+ // Perform limitations (clamping, etc.)
1792
+ if (limiters[this.model]) {
1793
+ channels = colorConvert[this.model].channels;
1794
+ for (i = 0; i < channels; i++) {
1795
+ const limit = limiters[this.model][i];
1796
+ if (limit) {
1797
+ this.color[i] = limit(this.color[i]);
1798
+ }
1799
+ }
1800
+ }
1824
1801
 
1825
- this.valpha = Math.max(0, Math.min(1, this.valpha));
1802
+ this.valpha = Math.max(0, Math.min(1, this.valpha));
1826
1803
 
1827
- if (Object.freeze) {
1828
- Object.freeze(this);
1829
- }
1804
+ if (Object.freeze) {
1805
+ Object.freeze(this);
1806
+ }
1830
1807
  }
1831
1808
 
1832
1809
  Color.prototype = {
1833
- toString() {
1834
- return this.string();
1835
- },
1836
-
1837
- toJSON() {
1838
- return this[this.model]();
1839
- },
1840
-
1841
- string(places) {
1842
- let self = this.model in colorString.to ? this : this.rgb();
1843
- self = self.round(typeof places === 'number' ? places : 1);
1844
- const args = self.valpha === 1 ? self.color : self.color.concat(this.valpha);
1845
- return colorString.to[self.model](args);
1846
- },
1847
-
1848
- percentString(places) {
1849
- const self = this.rgb().round(typeof places === 'number' ? places : 1);
1850
- const args = self.valpha === 1 ? self.color : self.color.concat(this.valpha);
1851
- return colorString.to.rgb.percent(args);
1852
- },
1853
-
1854
- array() {
1855
- return this.valpha === 1 ? this.color.slice() : this.color.concat(this.valpha);
1856
- },
1857
-
1858
- object() {
1859
- const result = {};
1860
- const channels = colorConvert[this.model].channels;
1861
- const labels = colorConvert[this.model].labels;
1862
-
1863
- for (let i = 0; i < channels; i++) {
1864
- result[labels[i]] = this.color[i];
1865
- }
1866
-
1867
- if (this.valpha !== 1) {
1868
- result.alpha = this.valpha;
1869
- }
1870
-
1871
- return result;
1872
- },
1810
+ toString() {
1811
+ return this.string();
1812
+ },
1813
+
1814
+ toJSON() {
1815
+ return this[this.model]();
1816
+ },
1817
+
1818
+ string(places) {
1819
+ let self = this.model in colorString.to ? this : this.rgb();
1820
+ self = self.round(typeof places === 'number' ? places : 1);
1821
+ const args = self.valpha === 1 ? self.color : [...self.color, this.valpha];
1822
+ return colorString.to[self.model](args);
1823
+ },
1824
+
1825
+ percentString(places) {
1826
+ const self = this.rgb().round(typeof places === 'number' ? places : 1);
1827
+ const args = self.valpha === 1 ? self.color : [...self.color, this.valpha];
1828
+ return colorString.to.rgb.percent(args);
1829
+ },
1830
+
1831
+ array() {
1832
+ return this.valpha === 1 ? [...this.color] : [...this.color, this.valpha];
1833
+ },
1834
+
1835
+ object() {
1836
+ const result = {};
1837
+ const {channels} = colorConvert[this.model];
1838
+ const {labels} = colorConvert[this.model];
1839
+
1840
+ for (let i = 0; i < channels; i++) {
1841
+ result[labels[i]] = this.color[i];
1842
+ }
1873
1843
 
1874
- unitArray() {
1875
- const rgb = this.rgb().color;
1876
- rgb[0] /= 255;
1877
- rgb[1] /= 255;
1878
- rgb[2] /= 255;
1844
+ if (this.valpha !== 1) {
1845
+ result.alpha = this.valpha;
1846
+ }
1879
1847
 
1880
- if (this.valpha !== 1) {
1881
- rgb.push(this.valpha);
1882
- }
1848
+ return result;
1849
+ },
1883
1850
 
1884
- return rgb;
1885
- },
1851
+ unitArray() {
1852
+ const rgb = this.rgb().color;
1853
+ rgb[0] /= 255;
1854
+ rgb[1] /= 255;
1855
+ rgb[2] /= 255;
1886
1856
 
1887
- unitObject() {
1888
- const rgb = this.rgb().object();
1889
- rgb.r /= 255;
1890
- rgb.g /= 255;
1891
- rgb.b /= 255;
1857
+ if (this.valpha !== 1) {
1858
+ rgb.push(this.valpha);
1859
+ }
1892
1860
 
1893
- if (this.valpha !== 1) {
1894
- rgb.alpha = this.valpha;
1895
- }
1861
+ return rgb;
1862
+ },
1896
1863
 
1897
- return rgb;
1898
- },
1864
+ unitObject() {
1865
+ const rgb = this.rgb().object();
1866
+ rgb.r /= 255;
1867
+ rgb.g /= 255;
1868
+ rgb.b /= 255;
1899
1869
 
1900
- round(places) {
1901
- places = Math.max(places || 0, 0);
1902
- return new Color(this.color.map(roundToPlace(places)).concat(this.valpha), this.model);
1903
- },
1870
+ if (this.valpha !== 1) {
1871
+ rgb.alpha = this.valpha;
1872
+ }
1904
1873
 
1905
- alpha(value) {
1906
- if (arguments.length > 0) {
1907
- return new Color(this.color.concat(Math.max(0, Math.min(1, value))), this.model);
1908
- }
1874
+ return rgb;
1875
+ },
1909
1876
 
1910
- return this.valpha;
1911
- },
1877
+ round(places) {
1878
+ places = Math.max(places || 0, 0);
1879
+ return new Color([...this.color.map(roundToPlace(places)), this.valpha], this.model);
1880
+ },
1912
1881
 
1913
- // Rgb
1914
- red: getset('rgb', 0, maxfn(255)),
1915
- green: getset('rgb', 1, maxfn(255)),
1916
- blue: getset('rgb', 2, maxfn(255)),
1917
- hue: getset(['hsl', 'hsv', 'hsl', 'hwb', 'hcg'], 0, value => (value % 360 + 360) % 360),
1918
- saturationl: getset('hsl', 1, maxfn(100)),
1919
- lightness: getset('hsl', 2, maxfn(100)),
1920
- saturationv: getset('hsv', 1, maxfn(100)),
1921
- value: getset('hsv', 2, maxfn(100)),
1922
- chroma: getset('hcg', 1, maxfn(100)),
1923
- gray: getset('hcg', 2, maxfn(100)),
1924
- white: getset('hwb', 1, maxfn(100)),
1925
- wblack: getset('hwb', 2, maxfn(100)),
1926
- cyan: getset('cmyk', 0, maxfn(100)),
1927
- magenta: getset('cmyk', 1, maxfn(100)),
1928
- yellow: getset('cmyk', 2, maxfn(100)),
1929
- black: getset('cmyk', 3, maxfn(100)),
1930
- x: getset('xyz', 0, maxfn(100)),
1931
- y: getset('xyz', 1, maxfn(100)),
1932
- z: getset('xyz', 2, maxfn(100)),
1933
- l: getset('lab', 0, maxfn(100)),
1934
- a: getset('lab', 1),
1935
- b: getset('lab', 2),
1936
-
1937
- keyword(value) {
1938
- if (arguments.length > 0) {
1939
- return new Color(value);
1940
- }
1882
+ alpha(value) {
1883
+ if (value !== undefined) {
1884
+ return new Color([...this.color, Math.max(0, Math.min(1, value))], this.model);
1885
+ }
1941
1886
 
1942
- return colorConvert[this.model].keyword(this.color);
1943
- },
1887
+ return this.valpha;
1888
+ },
1944
1889
 
1945
- hex(value) {
1946
- if (arguments.length > 0) {
1947
- return new Color(value);
1948
- }
1890
+ // Rgb
1891
+ red: getset('rgb', 0, maxfn(255)),
1892
+ green: getset('rgb', 1, maxfn(255)),
1893
+ blue: getset('rgb', 2, maxfn(255)),
1949
1894
 
1950
- return colorString.to.hex(this.rgb().round().color);
1951
- },
1895
+ hue: getset(['hsl', 'hsv', 'hsl', 'hwb', 'hcg'], 0, value => ((value % 360) + 360) % 360),
1952
1896
 
1953
- hexa(value) {
1954
- if (arguments.length > 0) {
1955
- return new Color(value);
1956
- }
1897
+ saturationl: getset('hsl', 1, maxfn(100)),
1898
+ lightness: getset('hsl', 2, maxfn(100)),
1957
1899
 
1958
- const rgbArray = this.rgb().round().color;
1959
- let alphaHex = Math.round(this.valpha * 255).toString(16).toUpperCase();
1900
+ saturationv: getset('hsv', 1, maxfn(100)),
1901
+ value: getset('hsv', 2, maxfn(100)),
1960
1902
 
1961
- if (alphaHex.length === 1) {
1962
- alphaHex = '0' + alphaHex;
1963
- }
1903
+ chroma: getset('hcg', 1, maxfn(100)),
1904
+ gray: getset('hcg', 2, maxfn(100)),
1964
1905
 
1965
- return colorString.to.hex(rgbArray) + alphaHex;
1966
- },
1906
+ white: getset('hwb', 1, maxfn(100)),
1907
+ wblack: getset('hwb', 2, maxfn(100)),
1967
1908
 
1968
- rgbNumber() {
1969
- const rgb = this.rgb().color;
1970
- return (rgb[0] & 0xFF) << 16 | (rgb[1] & 0xFF) << 8 | rgb[2] & 0xFF;
1971
- },
1909
+ cyan: getset('cmyk', 0, maxfn(100)),
1910
+ magenta: getset('cmyk', 1, maxfn(100)),
1911
+ yellow: getset('cmyk', 2, maxfn(100)),
1912
+ black: getset('cmyk', 3, maxfn(100)),
1972
1913
 
1973
- luminosity() {
1974
- // http://www.w3.org/TR/WCAG20/#relativeluminancedef
1975
- const rgb = this.rgb().color;
1976
- const lum = [];
1914
+ x: getset('xyz', 0, maxfn(95.047)),
1915
+ y: getset('xyz', 1, maxfn(100)),
1916
+ z: getset('xyz', 2, maxfn(108.833)),
1977
1917
 
1978
- for (const [i, element] of rgb.entries()) {
1979
- const chan = element / 255;
1980
- lum[i] = chan <= 0.03928 ? chan / 12.92 : ((chan + 0.055) / 1.055) ** 2.4;
1981
- }
1918
+ l: getset('lab', 0, maxfn(100)),
1919
+ a: getset('lab', 1),
1920
+ b: getset('lab', 2),
1982
1921
 
1983
- return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
1984
- },
1922
+ keyword(value) {
1923
+ if (value !== undefined) {
1924
+ return new Color(value);
1925
+ }
1985
1926
 
1986
- contrast(color2) {
1987
- // http://www.w3.org/TR/WCAG20/#contrast-ratiodef
1988
- const lum1 = this.luminosity();
1989
- const lum2 = color2.luminosity();
1927
+ return colorConvert[this.model].keyword(this.color);
1928
+ },
1990
1929
 
1991
- if (lum1 > lum2) {
1992
- return (lum1 + 0.05) / (lum2 + 0.05);
1993
- }
1930
+ hex(value) {
1931
+ if (value !== undefined) {
1932
+ return new Color(value);
1933
+ }
1994
1934
 
1995
- return (lum2 + 0.05) / (lum1 + 0.05);
1996
- },
1935
+ return colorString.to.hex(this.rgb().round().color);
1936
+ },
1997
1937
 
1998
- level(color2) {
1999
- const contrastRatio = this.contrast(color2);
1938
+ hexa(value) {
1939
+ if (value !== undefined) {
1940
+ return new Color(value);
1941
+ }
2000
1942
 
2001
- if (contrastRatio >= 7.1) {
2002
- return 'AAA';
2003
- }
1943
+ const rgbArray = this.rgb().round().color;
2004
1944
 
2005
- return contrastRatio >= 4.5 ? 'AA' : '';
2006
- },
1945
+ let alphaHex = Math.round(this.valpha * 255).toString(16).toUpperCase();
1946
+ if (alphaHex.length === 1) {
1947
+ alphaHex = '0' + alphaHex;
1948
+ }
2007
1949
 
2008
- isDark() {
2009
- // YIQ equation from http://24ways.org/2010/calculating-color-contrast
2010
- const rgb = this.rgb().color;
2011
- const yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000;
2012
- return yiq < 128;
2013
- },
1950
+ return colorString.to.hex(rgbArray) + alphaHex;
1951
+ },
2014
1952
 
2015
- isLight() {
2016
- return !this.isDark();
2017
- },
1953
+ rgbNumber() {
1954
+ const rgb = this.rgb().color;
1955
+ return ((rgb[0] & 0xFF) << 16) | ((rgb[1] & 0xFF) << 8) | (rgb[2] & 0xFF);
1956
+ },
2018
1957
 
2019
- negate() {
2020
- const rgb = this.rgb();
1958
+ luminosity() {
1959
+ // http://www.w3.org/TR/WCAG20/#relativeluminancedef
1960
+ const rgb = this.rgb().color;
2021
1961
 
2022
- for (let i = 0; i < 3; i++) {
2023
- rgb.color[i] = 255 - rgb.color[i];
2024
- }
1962
+ const lum = [];
1963
+ for (const [i, element] of rgb.entries()) {
1964
+ const chan = element / 255;
1965
+ lum[i] = (chan <= 0.04045) ? chan / 12.92 : ((chan + 0.055) / 1.055) ** 2.4;
1966
+ }
2025
1967
 
2026
- return rgb;
2027
- },
1968
+ return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
1969
+ },
2028
1970
 
2029
- lighten(ratio) {
2030
- const hsl = this.hsl();
2031
- hsl.color[2] += hsl.color[2] * ratio;
2032
- return hsl;
2033
- },
1971
+ contrast(color2) {
1972
+ // http://www.w3.org/TR/WCAG20/#contrast-ratiodef
1973
+ const lum1 = this.luminosity();
1974
+ const lum2 = color2.luminosity();
2034
1975
 
2035
- darken(ratio) {
2036
- const hsl = this.hsl();
2037
- hsl.color[2] -= hsl.color[2] * ratio;
2038
- return hsl;
2039
- },
1976
+ if (lum1 > lum2) {
1977
+ return (lum1 + 0.05) / (lum2 + 0.05);
1978
+ }
2040
1979
 
2041
- saturate(ratio) {
2042
- const hsl = this.hsl();
2043
- hsl.color[1] += hsl.color[1] * ratio;
2044
- return hsl;
2045
- },
1980
+ return (lum2 + 0.05) / (lum1 + 0.05);
1981
+ },
2046
1982
 
2047
- desaturate(ratio) {
2048
- const hsl = this.hsl();
2049
- hsl.color[1] -= hsl.color[1] * ratio;
2050
- return hsl;
2051
- },
1983
+ level(color2) {
1984
+ // https://www.w3.org/TR/WCAG/#contrast-enhanced
1985
+ const contrastRatio = this.contrast(color2);
1986
+ if (contrastRatio >= 7) {
1987
+ return 'AAA';
1988
+ }
2052
1989
 
2053
- whiten(ratio) {
2054
- const hwb = this.hwb();
2055
- hwb.color[1] += hwb.color[1] * ratio;
2056
- return hwb;
2057
- },
1990
+ return (contrastRatio >= 4.5) ? 'AA' : '';
1991
+ },
2058
1992
 
2059
- blacken(ratio) {
2060
- const hwb = this.hwb();
2061
- hwb.color[2] += hwb.color[2] * ratio;
2062
- return hwb;
2063
- },
1993
+ isDark() {
1994
+ // YIQ equation from http://24ways.org/2010/calculating-color-contrast
1995
+ const rgb = this.rgb().color;
1996
+ const yiq = (rgb[0] * 2126 + rgb[1] * 7152 + rgb[2] * 722) / 10000;
1997
+ return yiq < 128;
1998
+ },
2064
1999
 
2065
- grayscale() {
2066
- // http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale
2067
- const rgb = this.rgb().color;
2068
- const value = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
2069
- return Color.rgb(value, value, value);
2070
- },
2000
+ isLight() {
2001
+ return !this.isDark();
2002
+ },
2071
2003
 
2072
- fade(ratio) {
2073
- return this.alpha(this.valpha - this.valpha * ratio);
2074
- },
2004
+ negate() {
2005
+ const rgb = this.rgb();
2006
+ for (let i = 0; i < 3; i++) {
2007
+ rgb.color[i] = 255 - rgb.color[i];
2008
+ }
2075
2009
 
2076
- opaquer(ratio) {
2077
- return this.alpha(this.valpha + this.valpha * ratio);
2078
- },
2010
+ return rgb;
2011
+ },
2012
+
2013
+ lighten(ratio) {
2014
+ const hsl = this.hsl();
2015
+ hsl.color[2] += hsl.color[2] * ratio;
2016
+ return hsl;
2017
+ },
2018
+
2019
+ darken(ratio) {
2020
+ const hsl = this.hsl();
2021
+ hsl.color[2] -= hsl.color[2] * ratio;
2022
+ return hsl;
2023
+ },
2024
+
2025
+ saturate(ratio) {
2026
+ const hsl = this.hsl();
2027
+ hsl.color[1] += hsl.color[1] * ratio;
2028
+ return hsl;
2029
+ },
2030
+
2031
+ desaturate(ratio) {
2032
+ const hsl = this.hsl();
2033
+ hsl.color[1] -= hsl.color[1] * ratio;
2034
+ return hsl;
2035
+ },
2036
+
2037
+ whiten(ratio) {
2038
+ const hwb = this.hwb();
2039
+ hwb.color[1] += hwb.color[1] * ratio;
2040
+ return hwb;
2041
+ },
2042
+
2043
+ blacken(ratio) {
2044
+ const hwb = this.hwb();
2045
+ hwb.color[2] += hwb.color[2] * ratio;
2046
+ return hwb;
2047
+ },
2048
+
2049
+ grayscale() {
2050
+ // http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale
2051
+ const rgb = this.rgb().color;
2052
+ const value = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
2053
+ return Color.rgb(value, value, value);
2054
+ },
2055
+
2056
+ fade(ratio) {
2057
+ return this.alpha(this.valpha - (this.valpha * ratio));
2058
+ },
2059
+
2060
+ opaquer(ratio) {
2061
+ return this.alpha(this.valpha + (this.valpha * ratio));
2062
+ },
2063
+
2064
+ rotate(degrees) {
2065
+ const hsl = this.hsl();
2066
+ let hue = hsl.color[0];
2067
+ hue = (hue + degrees) % 360;
2068
+ hue = hue < 0 ? 360 + hue : hue;
2069
+ hsl.color[0] = hue;
2070
+ return hsl;
2071
+ },
2072
+
2073
+ mix(mixinColor, weight) {
2074
+ // Ported from sass implementation in C
2075
+ // https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209
2076
+ if (!mixinColor || !mixinColor.rgb) {
2077
+ throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof mixinColor);
2078
+ }
2079
2079
 
2080
- rotate(degrees) {
2081
- const hsl = this.hsl();
2082
- let hue = hsl.color[0];
2083
- hue = (hue + degrees) % 360;
2084
- hue = hue < 0 ? 360 + hue : hue;
2085
- hsl.color[0] = hue;
2086
- return hsl;
2087
- },
2080
+ const color1 = mixinColor.rgb();
2081
+ const color2 = this.rgb();
2082
+ const p = weight === undefined ? 0.5 : weight;
2088
2083
 
2089
- mix(mixinColor, weight) {
2090
- // Ported from sass implementation in C
2091
- // https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209
2092
- if (!mixinColor || !mixinColor.rgb) {
2093
- throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof mixinColor);
2094
- }
2084
+ const w = 2 * p - 1;
2085
+ const a = color1.alpha() - color2.alpha();
2095
2086
 
2096
- const color1 = mixinColor.rgb();
2097
- const color2 = this.rgb();
2098
- const p = weight === undefined ? 0.5 : weight;
2099
- const w = 2 * p - 1;
2100
- const a = color1.alpha() - color2.alpha();
2101
- const w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2;
2102
- const w2 = 1 - w1;
2103
- return Color.rgb(w1 * color1.red() + w2 * color2.red(), w1 * color1.green() + w2 * color2.green(), w1 * color1.blue() + w2 * color2.blue(), color1.alpha() * p + color2.alpha() * (1 - p));
2104
- }
2087
+ const w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2;
2088
+ const w2 = 1 - w1;
2105
2089
 
2106
- }; // Model conversion methods and static constructors
2090
+ return Color.rgb(
2091
+ w1 * color1.red() + w2 * color2.red(),
2092
+ w1 * color1.green() + w2 * color2.green(),
2093
+ w1 * color1.blue() + w2 * color2.blue(),
2094
+ color1.alpha() * p + color2.alpha() * (1 - p));
2095
+ },
2096
+ };
2107
2097
 
2098
+ // Model conversion methods and static constructors
2108
2099
  for (const model of Object.keys(colorConvert)) {
2109
- if (skippedModels.includes(model)) {
2110
- continue;
2111
- }
2112
-
2113
- const channels = colorConvert[model].channels; // Conversion methods
2100
+ if (skippedModels.includes(model)) {
2101
+ continue;
2102
+ }
2114
2103
 
2115
- Color.prototype[model] = function () {
2116
- if (this.model === model) {
2117
- return new Color(this);
2118
- }
2104
+ const {channels} = colorConvert[model];
2119
2105
 
2120
- if (arguments.length > 0) {
2121
- return new Color(arguments, model);
2122
- }
2106
+ // Conversion methods
2107
+ Color.prototype[model] = function (...args) {
2108
+ if (this.model === model) {
2109
+ return new Color(this);
2110
+ }
2123
2111
 
2124
- const newAlpha = typeof arguments[channels] === 'number' ? channels : this.valpha;
2125
- return new Color(assertArray(colorConvert[this.model][model].raw(this.color)).concat(newAlpha), model);
2126
- }; // 'static' construction methods
2112
+ if (args.length > 0) {
2113
+ return new Color(args, model);
2114
+ }
2127
2115
 
2116
+ return new Color([...assertArray(colorConvert[this.model][model].raw(this.color)), this.valpha], model);
2117
+ };
2128
2118
 
2129
- Color[model] = function (color) {
2130
- if (typeof color === 'number') {
2131
- color = zeroArray(_slice.call(arguments), channels);
2132
- }
2119
+ // 'static' construction methods
2120
+ Color[model] = function (...args) {
2121
+ let color = args[0];
2122
+ if (typeof color === 'number') {
2123
+ color = zeroArray(args, channels);
2124
+ }
2133
2125
 
2134
- return new Color(color, model);
2135
- };
2126
+ return new Color(color, model);
2127
+ };
2136
2128
  }
2137
2129
 
2138
2130
  function roundTo(number, places) {
2139
- return Number(number.toFixed(places));
2131
+ return Number(number.toFixed(places));
2140
2132
  }
2141
2133
 
2142
2134
  function roundToPlace(places) {
2143
- return function (number) {
2144
- return roundTo(number, places);
2145
- };
2135
+ return function (number) {
2136
+ return roundTo(number, places);
2137
+ };
2146
2138
  }
2147
2139
 
2148
2140
  function getset(model, channel, modifier) {
2149
- model = Array.isArray(model) ? model : [model];
2141
+ model = Array.isArray(model) ? model : [model];
2150
2142
 
2151
- for (const m of model) {
2152
- (limiters[m] || (limiters[m] = []))[channel] = modifier;
2153
- }
2143
+ for (const m of model) {
2144
+ (limiters[m] || (limiters[m] = []))[channel] = modifier;
2145
+ }
2154
2146
 
2155
- model = model[0];
2156
- return function (value) {
2157
- let result;
2147
+ model = model[0];
2158
2148
 
2159
- if (arguments.length > 0) {
2160
- if (modifier) {
2161
- value = modifier(value);
2162
- }
2149
+ return function (value) {
2150
+ let result;
2163
2151
 
2164
- result = this[model]();
2165
- result.color[channel] = value;
2166
- return result;
2167
- }
2152
+ if (value !== undefined) {
2153
+ if (modifier) {
2154
+ value = modifier(value);
2155
+ }
2168
2156
 
2169
- result = this[model]().color[channel];
2157
+ result = this[model]();
2158
+ result.color[channel] = value;
2159
+ return result;
2160
+ }
2170
2161
 
2171
- if (modifier) {
2172
- result = modifier(result);
2173
- }
2162
+ result = this[model]().color[channel];
2163
+ if (modifier) {
2164
+ result = modifier(result);
2165
+ }
2174
2166
 
2175
- return result;
2176
- };
2167
+ return result;
2168
+ };
2177
2169
  }
2178
2170
 
2179
2171
  function maxfn(max) {
2180
- return function (v) {
2181
- return Math.max(0, Math.min(max, v));
2182
- };
2172
+ return function (v) {
2173
+ return Math.max(0, Math.min(max, v));
2174
+ };
2183
2175
  }
2184
2176
 
2185
2177
  function assertArray(value) {
2186
- return Array.isArray(value) ? value : [value];
2178
+ return Array.isArray(value) ? value : [value];
2187
2179
  }
2188
2180
 
2189
2181
  function zeroArray(array, length) {
2190
- for (let i = 0; i < length; i++) {
2191
- if (typeof array[i] !== 'number') {
2192
- array[i] = 0;
2193
- }
2194
- }
2182
+ for (let i = 0; i < length; i++) {
2183
+ if (typeof array[i] !== 'number') {
2184
+ array[i] = 0;
2185
+ }
2186
+ }
2195
2187
 
2196
- return array;
2188
+ return array;
2197
2189
  }
2198
2190
 
2199
2191
  var color = Color;
@@ -2299,7 +2291,7 @@ const DIMENSIONS = {
2299
2291
  }
2300
2292
  };
2301
2293
 
2302
- const colorPickerCss = "@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 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;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{display:inline-block;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-normal)}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([scale=s]) .container{width:160px}:host([scale=s]) .saved-colors{grid-template-columns:repeat(auto-fill, minmax(20px, 1fr))}:host([scale=s]) .channels{-ms-flex-direction:column;flex-direction:column}:host([scale=s]) .channel{width:100%;margin-bottom:4px}:host([scale=s]) .channel:last-child{margin-bottom:0}:host([scale=m]) .container{width:272px}:host([scale=l]) .header{padding-bottom:0px}:host([scale=l]){font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]) .container{width:464px}:host([scale=l]) .color-field-and-slider{margin-bottom:-20px}:host([scale=l]) .section{padding:0 16px 16px}:host([scale=l]) .section:first-of-type{padding-top:16px}:host([scale=l]) .saved-colors{grid-template-columns:repeat(auto-fill, minmax(28px, 1fr));grid-gap:12px;padding-top:16px}:host([scale=l]) .control-section{-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-align:baseline;align-items:baseline}:host([scale=l]) .control-section>:nth-child(2){-webkit-margin-start:12px;margin-inline-start:12px}:host([scale=l]) .color-hex-options{display:-ms-flexbox;display:flex;-ms-flex-negative:1;flex-shrink:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:distribute;justify-content:space-around;min-height:98px;width:160px}:host([scale=l]) .color-mode-container{-ms-flex-negative:3;flex-shrink:3}:host([appearance=minimal]) .container{border:none}.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{pointer-events:none;position:absolute;margin-bottom:0px;margin-right:0px;height:0.5rem;width:0.5rem;padding:0px;font-size:var(--calcite-font-size--1);outline-offset:0;outline-color:transparent;-webkit-transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;margin-top:-0.25rem;margin-left:-0.25rem;outline-offset:10px}.scope:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:12px}.color-field-and-slider{margin-bottom:-16px}.color-field-and-slider--interactive{cursor:pointer}.control-section{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap}.section{padding:0 12px 12px}.section:first-of-type{padding-top:12px}.color-hex-options,.section--split{-ms-flex-positive:1;flex-grow:1}.header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding-bottom:0.25rem;color:var(--calcite-ui-text-1)}.header--hex,.color-mode-container{padding-top:12px}.channels{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.channel{width:31%}.saved-colors{padding-top:12px;display:grid;grid-template-columns:repeat(auto-fill, minmax(24px, 1fr));grid-gap:8px;width:100%}.saved-colors-buttons{display:-ms-flexbox;display:flex}.saved-color{outline-offset:0;outline-color:transparent;-webkit-transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;cursor:pointer}.saved-color:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:2px}.saved-color:hover{-webkit-transition:outline-color var(--calcite-internal-animation-timing-fast) ease-in-out;transition:outline-color var(--calcite-internal-animation-timing-fast) ease-in-out;outline:2px solid var(--calcite-ui-border-2);outline-offset:2px}";
2294
+ const colorPickerCss = "@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 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;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{display:inline-block;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-normal)}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([scale=s]) .container{width:160px}:host([scale=s]) .saved-colors{grid-template-columns:repeat(auto-fill, minmax(20px, 1fr))}:host([scale=s]) .channels{-ms-flex-direction:column;flex-direction:column}:host([scale=s]) .channel{width:100%;margin-bottom:4px}:host([scale=s]) .channel:last-child{margin-bottom:0}:host([scale=m]) .container{width:272px}:host([scale=l]) .header{padding-bottom:0px}:host([scale=l]){font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]) .container{width:464px}:host([scale=l]) .color-field-and-slider{margin-bottom:-20px}:host([scale=l]) .section{padding:0 16px 16px}:host([scale=l]) .section:first-of-type{padding-top:16px}:host([scale=l]) .saved-colors{grid-template-columns:repeat(auto-fill, minmax(28px, 1fr));grid-gap:12px;padding-top:16px}:host([scale=l]) .control-section{-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-align:baseline;align-items:baseline}:host([scale=l]) .control-section>:nth-child(2){-webkit-margin-start:12px;margin-inline-start:12px}:host([scale=l]) .color-hex-options{display:-ms-flexbox;display:flex;-ms-flex-negative:1;flex-shrink:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:distribute;justify-content:space-around;min-height:98px;width:160px}:host([scale=l]) .color-mode-container{-ms-flex-negative:3;flex-shrink:3}:host([appearance=minimal]) .container{border:none}.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{pointer-events:none;position:absolute;font-size:var(--calcite-font-size--1);outline-offset:0;outline-color:transparent;-webkit-transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;outline-offset:14px}.scope:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:16px}.color-field-and-slider{margin-bottom:-16px}.color-field-and-slider--interactive{cursor:pointer}.control-section{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap}.section{padding:0 12px 12px}.section:first-of-type{padding-top:12px}.color-hex-options,.section--split{-ms-flex-positive:1;flex-grow:1}.header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding-bottom:0.25rem;color:var(--calcite-ui-text-1)}.header--hex,.color-mode-container{padding-top:12px}.channels{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.channel{width:31%}.saved-colors{padding-top:12px;display:grid;grid-template-columns:repeat(auto-fill, minmax(24px, 1fr));grid-gap:8px;width:100%}.saved-colors-buttons{display:-ms-flexbox;display:flex}.saved-color{outline-offset:0;outline-color:transparent;-webkit-transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;cursor:pointer}.saved-color:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:2px}.saved-color:hover{-webkit-transition:outline-color var(--calcite-internal-animation-timing-fast) ease-in-out;transition:outline-color var(--calcite-internal-animation-timing-fast) ease-in-out;outline:2px solid var(--calcite-ui-border-2);outline-offset:2px}";
2303
2295
 
2304
2296
  const throttleFor60FpsInMs = 16;
2305
2297
  const defaultValue = utils.normalizeHex(DEFAULT_COLOR$1.hex());
@@ -2696,9 +2688,12 @@ const ColorPicker = class {
2696
2688
  const channelAriaLabels = isRgb
2697
2689
  ? [intlRed, intlGreen, intlBlue]
2698
2690
  : [intlHue, intlSaturation, intlValue];
2699
- return (index.h("calcite-tab", { active: active, class: CSS$2.control, key: channelMode }, index.h("div", { class: CSS$2.channels }, channels.map((channel, index) => this.renderChannel(channel, index, channelLabels[index], channelAriaLabels[index])))));
2691
+ const direction = dom.getElementDir(this.el);
2692
+ return (index.h("calcite-tab", { active: active, class: CSS$2.control, key: channelMode }, index.h("div", { class: CSS$2.channels, dir: "ltr" }, channels.map((channel, index) =>
2693
+ /* the channel container is ltr, so we apply the host's direction */
2694
+ this.renderChannel(channel, index, channelLabels[index], channelAriaLabels[index], direction)))));
2700
2695
  };
2701
- this.renderChannel = (value, index$1, label, ariaLabel) => (index.h("calcite-input", { class: CSS$2.channel, "data-channel-index": index$1, label: ariaLabel, numberButtonType: "none", onCalciteInputChange: this.handleChannelChange, onCalciteInputInput: this.handleChannelInput, prefixText: label, scale: this.scale === "l" ? "m" : "s", type: "number", value: value === null || value === void 0 ? void 0 : value.toString() }));
2696
+ this.renderChannel = (value, index$1, label, ariaLabel, direction) => (index.h("calcite-input", { class: CSS$2.channel, "data-channel-index": index$1, dir: direction, label: ariaLabel, numberButtonType: "none", onCalciteInputChange: this.handleChannelChange, onCalciteInputInput: this.handleChannelInput, onKeyDown: this.handleKeyDown, prefixText: label, scale: this.scale === "l" ? "m" : "s", type: "number", value: value === null || value === void 0 ? void 0 : value.toString() }));
2702
2697
  this.deleteColor = () => {
2703
2698
  const colorToDelete = this.color.hex();
2704
2699
  const inStorage = this.savedColors.indexOf(colorToDelete) > -1;
@@ -2753,14 +2748,10 @@ const ColorPicker = class {
2753
2748
  this.drawColorFieldAndSlider();
2754
2749
  this.updateChannelsFromColor(color);
2755
2750
  this.previousColor = oldColor;
2756
- if (this.internalColorUpdateContext) {
2757
- return;
2758
- }
2759
- this.value = this.toValue(color);
2760
2751
  }
2761
2752
  handleFormatChange(format) {
2762
2753
  this.setMode(format);
2763
- this.value = this.toValue(this.color);
2754
+ this.internalColorSet(this.color, false, "internal");
2764
2755
  }
2765
2756
  handleScaleChange(scale = "m") {
2766
2757
  this.updateDimensions(scale);
@@ -2780,10 +2771,10 @@ const ColorPicker = class {
2780
2771
  this.setMode(nextMode);
2781
2772
  }
2782
2773
  const dragging = this.sliderThumbState === "drag" || this.hueThumbState === "drag";
2783
- if (this.internalColorUpdateContext) {
2784
- if (this.internalColorUpdateContext === "initial") {
2785
- return;
2786
- }
2774
+ if (this.internalColorUpdateContext === "initial") {
2775
+ return;
2776
+ }
2777
+ if (this.internalColorUpdateContext === "user-interaction") {
2787
2778
  this.calciteColorPickerInput.emit();
2788
2779
  if (!dragging) {
2789
2780
  this.calciteColorPickerChange.emit();
@@ -2793,11 +2784,7 @@ const ColorPicker = class {
2793
2784
  const color$1 = allowEmpty && !value ? null : color(value);
2794
2785
  const colorChanged = !utils.colorEqual(color$1, this.color);
2795
2786
  if (modeChanged || colorChanged) {
2796
- this.color = color$1;
2797
- this.calciteColorPickerInput.emit();
2798
- if (!dragging) {
2799
- this.calciteColorPickerChange.emit();
2800
- }
2787
+ this.internalColorSet(color$1, true, "internal");
2801
2788
  }
2802
2789
  }
2803
2790
  //--------------------------------------------------------------------------
@@ -2905,6 +2892,11 @@ const ColorPicker = class {
2905
2892
  // Private Methods
2906
2893
  //
2907
2894
  //--------------------------------------------------------------------------
2895
+ handleKeyDown(event) {
2896
+ if (event.key === "Enter") {
2897
+ event.preventDefault();
2898
+ }
2899
+ }
2908
2900
  showIncompatibleColorWarning(value, format) {
2909
2901
  console.warn(`ignoring color value (${value}) as it is not compatible with the current format (${format})`);
2910
2902
  }
@@ -2926,7 +2918,7 @@ const ColorPicker = class {
2926
2918
  }
2927
2919
  return "none";
2928
2920
  }
2929
- internalColorSet(color, skipEqual = true, context = "internal") {
2921
+ internalColorSet(color, skipEqual = true, context = "user-interaction") {
2930
2922
  if (skipEqual && utils.colorEqual(color, this.color)) {
2931
2923
  return;
2932
2924
  }
@@ -3132,32 +3124,13 @@ const ColorPickerHexInput = class {
3132
3124
  : this.formatForInternalInput(utils.rgbToHex(this.internalColor.object()));
3133
3125
  };
3134
3126
  this.onInputChange = () => {
3135
- const inputValue = this.inputNode.value;
3136
- let value;
3137
- if (inputValue) {
3138
- const hex = inputValue;
3139
- const color = utils.hexToRGB(`#${hex}`);
3140
- if (!color) {
3141
- return;
3142
- }
3143
- value = utils.normalizeHex(hex);
3144
- }
3145
- else if (this.allowEmpty) {
3146
- value = null;
3147
- }
3148
- this.value = value;
3149
- this.calciteColorPickerHexInputChange.emit();
3127
+ this.internalSetValue(this.inputNode.value, this.value);
3150
3128
  };
3151
3129
  /**
3152
3130
  * The last valid/selected color. Used as a fallback if an invalid hex code is entered.
3153
3131
  */
3154
3132
  this.internalColor = DEFAULT_COLOR;
3155
3133
  this.previousNonNullValue = this.value;
3156
- //--------------------------------------------------------------------------
3157
- //
3158
- // Private Methods
3159
- //
3160
- //--------------------------------------------------------------------------
3161
3134
  this.storeInputRef = (node) => {
3162
3135
  this.inputNode = node;
3163
3136
  };
@@ -3172,38 +3145,16 @@ const ColorPickerHexInput = class {
3172
3145
  if (value) {
3173
3146
  const normalized = utils.normalizeHex(value);
3174
3147
  if (utils.isValidHex(normalized)) {
3175
- this.internalColor = color(normalized);
3176
- this.value = normalized;
3148
+ this.internalSetValue(normalized, normalized, false);
3177
3149
  }
3178
3150
  return;
3179
3151
  }
3180
3152
  if (allowEmpty) {
3181
- this.internalColor = null;
3182
- this.value = null;
3153
+ this.internalSetValue(null, null, false);
3183
3154
  }
3184
3155
  }
3185
3156
  handleValueChange(value, oldValue) {
3186
- if (value) {
3187
- const normalized = utils.normalizeHex(value);
3188
- if (utils.isValidHex(normalized)) {
3189
- const { internalColor } = this;
3190
- const changed = !internalColor || normalized !== utils.normalizeHex(internalColor.hex());
3191
- this.internalColor = color(normalized);
3192
- this.previousNonNullValue = normalized;
3193
- this.value = normalized;
3194
- if (changed) {
3195
- this.calciteColorPickerHexInputChange.emit();
3196
- }
3197
- return;
3198
- }
3199
- }
3200
- else if (this.allowEmpty) {
3201
- this.internalColor = null;
3202
- this.value = null;
3203
- this.calciteColorPickerHexInputChange.emit();
3204
- return;
3205
- }
3206
- this.value = oldValue;
3157
+ this.internalSetValue(value, oldValue, false);
3207
3158
  }
3208
3159
  // using @Listen as a workaround for VDOM listener not firing
3209
3160
  onInputKeyDown(event) {
@@ -3215,15 +3166,16 @@ const ColorPickerHexInput = class {
3215
3166
  return;
3216
3167
  }
3217
3168
  const isNudgeKey = key === "ArrowDown" || key === "ArrowUp";
3169
+ const oldValue = this.value;
3218
3170
  if (isNudgeKey) {
3219
3171
  if (!value) {
3220
- this.value = this.previousNonNullValue;
3172
+ this.internalSetValue(this.previousNonNullValue, oldValue);
3221
3173
  event.preventDefault();
3222
3174
  return;
3223
3175
  }
3224
3176
  const direction = key === "ArrowUp" ? 1 : -1;
3225
3177
  const bump = shiftKey ? 10 : 1;
3226
- this.value = utils.normalizeHex(this.nudgeRGBChannels(internalColor, bump * direction).hex());
3178
+ this.internalSetValue(utils.normalizeHex(this.nudgeRGBChannels(internalColor, bump * direction).hex()), oldValue);
3227
3179
  event.preventDefault();
3228
3180
  return;
3229
3181
  }
@@ -3242,7 +3194,7 @@ const ColorPickerHexInput = class {
3242
3194
  render() {
3243
3195
  const { intlHex, value } = this;
3244
3196
  const hexInputValue = this.formatForInternalInput(value);
3245
- return (index.h("div", { class: CSS$1.container }, index.h("calcite-input", { class: CSS$1.input, label: intlHex, maxLength: 6, onCalciteInputBlur: this.onCalciteInputBlur, onCalciteInputChange: this.onInputChange, prefixText: "#", ref: this.storeInputRef, scale: this.scale, value: hexInputValue }), hexInputValue ? (index.h("calcite-color-picker-swatch", { active: true, class: CSS$1.preview, color: `#${hexInputValue}`, scale: this.scale })) : null));
3197
+ return (index.h("div", { class: CSS$1.container }, index.h("calcite-input", { class: CSS$1.input, label: intlHex, maxLength: 6, onCalciteInputBlur: this.onCalciteInputBlur, onCalciteInputChange: this.onInputChange, onKeyDown: this.handleKeyDown, prefixText: "#", ref: this.storeInputRef, scale: this.scale, value: hexInputValue }), hexInputValue ? (index.h("calcite-color-picker-swatch", { active: true, class: CSS$1.preview, color: `#${hexInputValue}`, scale: this.scale })) : null));
3246
3198
  }
3247
3199
  //--------------------------------------------------------------------------
3248
3200
  //
@@ -3253,12 +3205,47 @@ const ColorPickerHexInput = class {
3253
3205
  async setFocus() {
3254
3206
  dom.focusElement(this.inputNode);
3255
3207
  }
3208
+ //--------------------------------------------------------------------------
3209
+ //
3210
+ // Private Methods
3211
+ //
3212
+ //--------------------------------------------------------------------------
3213
+ internalSetValue(value, oldValue, emit = true) {
3214
+ if (value) {
3215
+ const normalized = utils.normalizeHex(value);
3216
+ if (utils.isValidHex(normalized)) {
3217
+ const { internalColor } = this;
3218
+ const changed = !internalColor || normalized !== utils.normalizeHex(internalColor.hex());
3219
+ this.internalColor = color(normalized);
3220
+ this.previousNonNullValue = normalized;
3221
+ this.value = normalized;
3222
+ if (changed && emit) {
3223
+ this.calciteColorPickerHexInputChange.emit();
3224
+ }
3225
+ return;
3226
+ }
3227
+ }
3228
+ else if (this.allowEmpty) {
3229
+ this.internalColor = null;
3230
+ this.value = null;
3231
+ if (emit) {
3232
+ this.calciteColorPickerHexInputChange.emit();
3233
+ }
3234
+ return;
3235
+ }
3236
+ this.value = oldValue;
3237
+ }
3256
3238
  formatForInternalInput(hex) {
3257
3239
  return hex ? hex.replace("#", "") : "";
3258
3240
  }
3259
3241
  nudgeRGBChannels(color$1, amount) {
3260
3242
  return color.rgb(color$1.array().map((channel) => channel + amount));
3261
3243
  }
3244
+ handleKeyDown(event) {
3245
+ if (event.key === "Enter") {
3246
+ event.preventDefault();
3247
+ }
3248
+ }
3262
3249
  get el() { return index.getElement(this); }
3263
3250
  static get watchers() { return {
3264
3251
  "value": ["handleValueChange"]