@esri/calcite-components 1.0.0-beta.80 → 1.0.0-beta.83

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 (1227) hide show
  1. package/dist/calcite/assets/date-picker/nls/ru.json +4 -4
  2. package/dist/calcite/assets/icon/compactness16.json +1 -0
  3. package/dist/calcite/assets/icon/compactness24.json +1 -0
  4. package/dist/calcite/assets/icon/compactness32.json +1 -0
  5. package/dist/calcite/assets/icon/configure16.json +1 -0
  6. package/dist/calcite/assets/icon/configure24.json +1 -0
  7. package/dist/calcite/assets/icon/configure32.json +1 -0
  8. package/dist/calcite/assets/icon/debugScript16.json +1 -0
  9. package/dist/calcite/assets/icon/debugScript24.json +1 -0
  10. package/dist/calcite/assets/icon/debugScript32.json +1 -0
  11. package/dist/calcite/assets/icon/dissolveFeatures16.json +1 -0
  12. package/dist/calcite/assets/icon/dissolveFeatures24.json +1 -0
  13. package/dist/calcite/assets/icon/dissolveFeatures32.json +1 -0
  14. package/dist/calcite/assets/icon/distanceType16.json +1 -0
  15. package/dist/calcite/assets/icon/distanceType24.json +1 -0
  16. package/dist/calcite/assets/icon/distanceType32.json +1 -0
  17. package/dist/calcite/assets/icon/fileEcd16.json +1 -0
  18. package/dist/calcite/assets/icon/fileEcd24.json +1 -0
  19. package/dist/calcite/assets/icon/fileEcd32.json +1 -0
  20. package/dist/calcite/assets/icon/gridDiamond16.json +1 -0
  21. package/dist/calcite/assets/icon/gridDiamond24.json +1 -0
  22. package/dist/calcite/assets/icon/gridDiamond32.json +1 -0
  23. package/dist/calcite/assets/icon/gridHexagon16.json +1 -0
  24. package/dist/calcite/assets/icon/gridHexagon24.json +1 -0
  25. package/dist/calcite/assets/icon/gridHexagon32.json +1 -0
  26. package/dist/calcite/assets/icon/gridTriangle16.json +1 -0
  27. package/dist/calcite/assets/icon/gridTriangle24.json +1 -0
  28. package/dist/calcite/assets/icon/gridTriangle32.json +1 -0
  29. package/dist/calcite/assets/icon/insets16.json +1 -0
  30. package/dist/calcite/assets/icon/insets24.json +1 -0
  31. package/dist/calcite/assets/icon/insets32.json +1 -0
  32. package/dist/calcite/assets/icon/listCheckAll16.json +1 -0
  33. package/dist/calcite/assets/icon/listCheckAll24.json +1 -0
  34. package/dist/calcite/assets/icon/listCheckAll32.json +1 -0
  35. package/dist/calcite/assets/icon/ltrElementsAlign16.json +1 -0
  36. package/dist/calcite/assets/icon/ltrElementsAlign24.json +1 -0
  37. package/dist/calcite/assets/icon/ltrElementsAlign32.json +1 -0
  38. package/dist/calcite/assets/icon/ltrParagraphAlign16.json +1 -0
  39. package/dist/calcite/assets/icon/ltrParagraphAlign24.json +1 -0
  40. package/dist/calcite/assets/icon/ltrParagraphAlign32.json +1 -0
  41. package/dist/calcite/assets/icon/maximumTerritoryDistance16.json +1 -0
  42. package/dist/calcite/assets/icon/maximumTerritoryDistance24.json +1 -0
  43. package/dist/calcite/assets/icon/maximumTerritoryDistance32.json +1 -0
  44. package/dist/calcite/assets/icon/minDistanceBetweenCenters16.json +1 -0
  45. package/dist/calcite/assets/icon/minDistanceBetweenCenters24.json +1 -0
  46. package/dist/calcite/assets/icon/minDistanceBetweenCenters32.json +1 -0
  47. package/dist/calcite/assets/icon/numberOfTerritories16.json +1 -0
  48. package/dist/calcite/assets/icon/numberOfTerritories24.json +1 -0
  49. package/dist/calcite/assets/icon/numberOfTerritories32.json +1 -0
  50. package/dist/calcite/assets/icon/overlapFeatures16.json +1 -0
  51. package/dist/calcite/assets/icon/overlapFeatures24.json +1 -0
  52. package/dist/calcite/assets/icon/overlapFeatures32.json +1 -0
  53. package/dist/calcite/assets/icon/profileVariables16.json +1 -0
  54. package/dist/calcite/assets/icon/profileVariables24.json +1 -0
  55. package/dist/calcite/assets/icon/profileVariables32.json +1 -0
  56. package/dist/calcite/assets/icon/rangefinder16.json +1 -0
  57. package/dist/calcite/assets/icon/rangefinder24.json +1 -0
  58. package/dist/calcite/assets/icon/rangefinder32.json +1 -0
  59. package/dist/calcite/assets/icon/rasterAnalysis16.json +1 -0
  60. package/dist/calcite/assets/icon/rasterAnalysis24.json +1 -0
  61. package/dist/calcite/assets/icon/rasterAnalysis32.json +1 -0
  62. package/dist/calcite/assets/icon/recurrence16.json +1 -0
  63. package/dist/calcite/assets/icon/recurrence24.json +1 -0
  64. package/dist/calcite/assets/icon/recurrence32.json +1 -0
  65. package/dist/calcite/assets/icon/rfid16.json +1 -0
  66. package/dist/calcite/assets/icon/rfid24.json +1 -0
  67. package/dist/calcite/assets/icon/rfid32.json +1 -0
  68. package/dist/calcite/assets/icon/rtlElementsAlign16.json +1 -0
  69. package/dist/calcite/assets/icon/rtlElementsAlign24.json +1 -0
  70. package/dist/calcite/assets/icon/rtlElementsAlign32.json +1 -0
  71. package/dist/calcite/assets/icon/rtlParagraphAlign16.json +1 -0
  72. package/dist/calcite/assets/icon/rtlParagraphAlign24.json +1 -0
  73. package/dist/calcite/assets/icon/rtlParagraphAlign32.json +1 -0
  74. package/dist/calcite/assets/icon/splitFeatures16.json +1 -0
  75. package/dist/calcite/assets/icon/splitFeatures24.json +1 -0
  76. package/dist/calcite/assets/icon/splitFeatures32.json +1 -0
  77. package/dist/calcite/assets/icon/territoryBufferDistance16.json +1 -0
  78. package/dist/calcite/assets/icon/territoryBufferDistance24.json +1 -0
  79. package/dist/calcite/assets/icon/territoryBufferDistance32.json +1 -0
  80. package/dist/calcite/assets/icon/testData16.json +1 -0
  81. package/dist/calcite/assets/icon/testData24.json +1 -0
  82. package/dist/calcite/assets/icon/testData32.json +1 -0
  83. package/dist/calcite/calcite.css +1 -1
  84. package/dist/calcite/calcite.esm.js +2 -1
  85. package/dist/calcite/calcite.js +1 -1
  86. package/dist/calcite/index.esm.js +1 -0
  87. package/dist/calcite/p-004e3dc9.js +6 -0
  88. package/dist/calcite/p-07587a94.system.entry.js +6 -0
  89. package/dist/calcite/{p-e66a8ca1.system.entry.js → p-0804ce36.system.entry.js} +3 -2
  90. package/dist/calcite/{p-9385e4b4.system.js → p-08b6213a.system.js} +2 -1
  91. package/dist/calcite/{p-9ac86d6a.entry.js → p-0cbdfc7e.entry.js} +2 -1
  92. package/dist/calcite/p-0d37d621.system.entry.js +6 -0
  93. package/dist/calcite/p-0e1c259f.system.entry.js +6 -0
  94. package/dist/calcite/p-0f41fb58.entry.js +6 -0
  95. package/dist/calcite/p-0fc84480.js +6 -0
  96. package/dist/calcite/p-132b60fd.system.entry.js +6 -0
  97. package/dist/calcite/p-1571ede3.system.entry.js +6 -0
  98. package/dist/calcite/{p-c2adeae4.entry.js → p-1755cd6f.entry.js} +2 -1
  99. package/dist/calcite/{p-6a541e77.system.js → p-191d0802.system.js} +2 -1
  100. package/dist/calcite/p-1a07da7e.system.js +6 -0
  101. package/dist/calcite/{p-b2493735.entry.js → p-1a5fc48b.entry.js} +2 -1
  102. package/dist/calcite/{p-4de6f4fd.system.js → p-1ba93966.system.js} +1 -0
  103. package/dist/calcite/{p-5958acc8.system.js → p-1bc2d58d.system.js} +1 -0
  104. package/dist/calcite/{p-5394666a.entry.js → p-1eb6cfb5.entry.js} +2 -1
  105. package/dist/calcite/p-1f94715e.entry.js +6 -0
  106. package/dist/calcite/p-2111668f.system.entry.js +6 -0
  107. package/dist/calcite/{p-5802a565.entry.js → p-23188966.entry.js} +2 -1
  108. package/dist/calcite/p-24edad61.entry.js +6 -0
  109. package/dist/calcite/p-25fd5141.entry.js +6 -0
  110. package/dist/calcite/p-2609d345.system.entry.js +6 -0
  111. package/dist/calcite/{p-052ba882.system.entry.js → p-26526a6d.system.entry.js} +2 -1
  112. package/dist/calcite/{p-8a7596e3.entry.js → p-2778cb53.entry.js} +2 -1
  113. package/dist/calcite/p-2785ecb9.system.js +6 -0
  114. package/dist/calcite/{p-6b5776af.js → p-292c567d.js} +1 -0
  115. package/dist/calcite/{p-7fc69a9d.js → p-2c974b60.js} +1 -0
  116. package/dist/calcite/{p-03c92ad2.entry.js → p-2e57803f.entry.js} +2 -1
  117. package/dist/calcite/{p-ac4aec20.system.js → p-2f82a677.system.js} +1 -0
  118. package/dist/calcite/p-2fcac2cf.system.entry.js +6 -0
  119. package/dist/calcite/p-2fd30fee.entry.js +6 -0
  120. package/dist/calcite/{p-1aded388.system.entry.js → p-358cba5a.system.entry.js} +2 -1
  121. package/dist/calcite/p-37c23e83.system.entry.js +6 -0
  122. package/dist/calcite/p-3962123d.system.entry.js +6 -0
  123. package/dist/calcite/{p-079a3322.js → p-3981a495.js} +1 -0
  124. package/dist/calcite/p-3a256056.entry.js +6 -0
  125. package/dist/calcite/{p-a11ee541.system.entry.js → p-3b54c4a0.system.entry.js} +2 -1
  126. package/dist/calcite/p-3d4548a9.js +6 -0
  127. package/dist/calcite/p-3f00dc7c.entry.js +6 -0
  128. package/dist/calcite/p-3f80afb9.system.entry.js +6 -0
  129. package/dist/calcite/p-41b0a2a1.system.js +6 -0
  130. package/dist/calcite/p-4214c119.system.entry.js +6 -0
  131. package/dist/calcite/p-45b6d321.entry.js +6 -0
  132. package/dist/calcite/p-4620ae05.entry.js +6 -0
  133. package/dist/calcite/p-462cefe9.system.entry.js +6 -0
  134. package/dist/calcite/{p-e095517f.system.js → p-46d30c39.system.js} +1 -0
  135. package/dist/calcite/p-476e276f.entry.js +6 -0
  136. package/dist/calcite/p-47bf0f7d.entry.js +6 -0
  137. package/dist/calcite/p-47dd3632.entry.js +6 -0
  138. package/dist/calcite/p-4a88016c.system.entry.js +6 -0
  139. package/dist/calcite/{p-bd38ff21.js → p-4effc6db.js} +1 -0
  140. package/dist/calcite/p-4f71c68d.js +6 -0
  141. package/dist/calcite/p-4f82d10a.system.entry.js +6 -0
  142. package/dist/calcite/{p-ef17447d.system.entry.js → p-506f5631.system.entry.js} +2 -1
  143. package/dist/calcite/p-515e5f7e.system.entry.js +6 -0
  144. package/dist/calcite/p-5207385b.system.entry.js +6 -0
  145. package/dist/calcite/p-53b147dc.system.entry.js +6 -0
  146. package/dist/calcite/{p-7ed4c551.system.js → p-57ccba45.system.js} +1 -0
  147. package/dist/calcite/{p-5bb4d012.entry.js → p-5904a047.entry.js} +2 -1
  148. package/dist/calcite/{p-97904e9a.entry.js → p-59122590.entry.js} +2 -1
  149. package/dist/calcite/p-59aae748.entry.js +6 -0
  150. package/dist/calcite/{p-b9a38a28.system.entry.js → p-5ae3ce21.system.entry.js} +2 -1
  151. package/dist/calcite/{p-05bf835f.js → p-5afb0fbb.js} +2 -1
  152. package/dist/calcite/p-5b60d64c.system.entry.js +6 -0
  153. package/dist/calcite/p-5df0640c.system.entry.js +6 -0
  154. package/dist/calcite/p-5e07a875.system.entry.js +6 -0
  155. package/dist/calcite/p-5eb016b6.system.entry.js +6 -0
  156. package/dist/calcite/p-61483431.system.entry.js +6 -0
  157. package/dist/calcite/p-623f6224.entry.js +6 -0
  158. package/dist/calcite/{p-3e9d96c6.system.entry.js → p-636e43ac.system.entry.js} +2 -1
  159. package/dist/calcite/p-63d2bcec.system.entry.js +6 -0
  160. package/dist/calcite/p-64384786.entry.js +6 -0
  161. package/dist/calcite/p-6531fb85.entry.js +6 -0
  162. package/dist/calcite/p-67af4998.entry.js +6 -0
  163. package/dist/calcite/p-67ef236d.entry.js +6 -0
  164. package/dist/calcite/{p-cb57638c.system.js → p-68e3013f.system.js} +2 -1
  165. package/dist/calcite/p-6a966c2f.entry.js +6 -0
  166. package/dist/calcite/{p-02d7cf64.system.entry.js → p-6bcb5a71.system.entry.js} +2 -1
  167. package/dist/calcite/p-6d41e372.system.entry.js +6 -0
  168. package/dist/calcite/p-717fac51.entry.js +6 -0
  169. package/dist/calcite/p-773b540e.system.entry.js +6 -0
  170. package/dist/calcite/{p-e020662f.system.js → p-77762ff3.system.js} +1 -0
  171. package/dist/calcite/p-78f2801c.entry.js +6 -0
  172. package/dist/calcite/p-799f79af.entry.js +6 -0
  173. package/dist/calcite/{p-2d09cc25.js → p-7a8cddad.js} +1 -0
  174. package/dist/calcite/p-7a95bbeb.entry.js +6 -0
  175. package/dist/calcite/p-7bbfe1a2.system.entry.js +6 -0
  176. package/dist/calcite/p-7d8fe7b3.system.entry.js +6 -0
  177. package/dist/calcite/p-7e576c74.system.entry.js +6 -0
  178. package/dist/calcite/p-800a9250.entry.js +6 -0
  179. package/dist/calcite/p-834f407d.system.entry.js +6 -0
  180. package/dist/calcite/p-85a769d3.system.entry.js +6 -0
  181. package/dist/calcite/p-878d7c09.system.js +6 -0
  182. package/dist/calcite/{p-4570cf6c.js → p-8dfe7af3.js} +2 -1
  183. package/dist/calcite/p-8e2129c6.system.entry.js +6 -0
  184. package/dist/calcite/p-900fd30e.js +6 -0
  185. package/dist/calcite/{p-eb3c084f.system.entry.js → p-912c9e61.system.entry.js} +2 -1
  186. package/dist/calcite/p-940ac25d.system.entry.js +6 -0
  187. package/dist/calcite/p-9634f60d.entry.js +6 -0
  188. package/dist/calcite/{p-a7770d75.entry.js → p-98dc9493.entry.js} +2 -1
  189. package/dist/calcite/{p-65dbbfb5.system.js → p-994d99ff.system.js} +3 -1
  190. package/dist/calcite/{p-7432e5ef.system.entry.js → p-9ba769e3.system.entry.js} +2 -1
  191. package/dist/calcite/{p-7bee4942.system.entry.js → p-9c85d763.system.entry.js} +2 -1
  192. package/dist/calcite/p-9d3f8b0c.system.entry.js +6 -0
  193. package/dist/calcite/p-9ea395ee.js +6 -0
  194. package/dist/calcite/p-a1118db1.entry.js +6 -0
  195. package/dist/calcite/p-a1176eac.system.entry.js +6 -0
  196. package/dist/calcite/p-a3e19cec.entry.js +6 -0
  197. package/dist/calcite/{p-8e0dd0af.system.entry.js → p-a5fd7a87.system.entry.js} +2 -1
  198. package/dist/calcite/p-a73419ab.js +6 -0
  199. package/dist/calcite/{p-3119ffce.system.js → p-a75ad7cb.system.js} +1 -0
  200. package/dist/calcite/p-a81ad35a.entry.js +6 -0
  201. package/dist/calcite/p-a945b681.system.js +6 -0
  202. package/dist/calcite/{p-7b8707b2.system.js → p-acafe8ca.system.js} +1 -0
  203. package/dist/calcite/p-adc2b773.entry.js +6 -0
  204. package/dist/calcite/{p-63624a01.js → p-ae6f5622.js} +1 -0
  205. package/dist/calcite/{p-1d6404b5.system.js → p-ba349f22.system.js} +1 -0
  206. package/dist/calcite/p-c1548c19.js +6 -0
  207. package/dist/calcite/p-c470cecf.entry.js +6 -0
  208. package/dist/calcite/p-c5eec108.entry.js +6 -0
  209. package/dist/calcite/{p-f344e163.entry.js → p-c84f0dec.entry.js} +2 -1
  210. package/dist/calcite/p-c86b91ca.entry.js +6 -0
  211. package/dist/calcite/{p-3c34f20d.system.js → p-c96917cb.system.js} +2 -1
  212. package/dist/calcite/p-caea0782.js +7 -0
  213. package/dist/calcite/p-cbe3c2c0.entry.js +6 -0
  214. package/dist/calcite/p-ccb27d44.system.entry.js +6 -0
  215. package/dist/calcite/{p-b06207bb.js → p-ccb5a784.js} +1 -0
  216. package/dist/calcite/p-d1d05643.entry.js +6 -0
  217. package/dist/calcite/p-d901c470.system.js +12 -0
  218. package/dist/calcite/p-db63dc35.system.entry.js +6 -0
  219. package/dist/calcite/p-dc10e8bb.system.entry.js +6 -0
  220. package/dist/calcite/p-ddb96773.system.js +6 -0
  221. package/dist/calcite/{p-cafd98e8.entry.js → p-df419c8b.entry.js} +2 -1
  222. package/dist/calcite/p-e0ff045a.js +6 -0
  223. package/dist/calcite/{p-1fc943d5.system.entry.js → p-e117fad1.system.entry.js} +2 -1
  224. package/dist/calcite/{p-c51699d3.system.js → p-e3076302.system.js} +2 -1
  225. package/dist/calcite/p-e321018b.js +12 -0
  226. package/dist/calcite/p-e6ef10e2.js +6 -0
  227. package/dist/calcite/p-e7336cab.entry.js +6 -0
  228. package/dist/calcite/{p-482885ae.system.entry.js → p-e9e34c7f.system.entry.js} +2 -1
  229. package/dist/calcite/p-ed0608ea.system.entry.js +6 -0
  230. package/dist/calcite/p-eda11878.entry.js +6 -0
  231. package/dist/calcite/{p-8ab345f2.js → p-edf3436f.js} +2 -1
  232. package/dist/calcite/p-ee47a382.system.entry.js +6 -0
  233. package/dist/calcite/p-ee8f8d7e.entry.js +6 -0
  234. package/dist/calcite/{p-cc6e7726.entry.js → p-ef4ca55d.entry.js} +2 -1
  235. package/dist/calcite/p-f1935a52.entry.js +6 -0
  236. package/dist/calcite/p-f313806e.entry.js +6 -0
  237. package/dist/calcite/p-f39d0565.system.entry.js +6 -0
  238. package/dist/calcite/{p-0a5d059d.js → p-f46cf640.js} +1 -0
  239. package/dist/calcite/{p-8a63221d.js → p-f54288ad.js} +1 -0
  240. package/dist/calcite/{p-a117af56.system.js → p-f7546789.system.js} +1 -0
  241. package/dist/calcite/p-f828bc9b.entry.js +6 -0
  242. package/dist/calcite/p-f850e63f.system.js +6 -0
  243. package/dist/calcite/{p-f68725d7.entry.js → p-f91e835d.entry.js} +2 -1
  244. package/dist/calcite/{p-f78023f1.system.js → p-f9687b03.system.js} +1 -0
  245. package/dist/calcite/p-f96d2623.system.entry.js +6 -0
  246. package/dist/calcite/{p-3b4662a5.entry.js → p-faaa959a.entry.js} +2 -1
  247. package/dist/calcite/p-fba2fa9f.system.js +6 -0
  248. package/dist/calcite/{p-78bc502f.entry.js → p-fd5a2277.entry.js} +2 -1
  249. package/dist/calcite/{p-18be4438.entry.js → p-fd70b6c1.entry.js} +2 -1
  250. package/dist/calcite/p-feb71776.system.entry.js +6 -0
  251. package/dist/cjs/{ExpandToggle-f7682a15.js → ExpandToggle-988c63cd.js} +9 -6
  252. package/dist/cjs/{Heading-ec707493.js → Heading-19d7669b.js} +2 -1
  253. package/dist/cjs/{array-a5dedf5a.js → array-d5bca414.js} +1 -0
  254. package/dist/cjs/calcite-accordion_2.cjs.entry.js +24 -17
  255. package/dist/cjs/calcite-action-bar.cjs.entry.js +17 -11
  256. package/dist/cjs/calcite-action-group.cjs.entry.js +8 -7
  257. package/dist/cjs/calcite-action-menu.cjs.entry.js +28 -23
  258. package/dist/cjs/calcite-action-pad.cjs.entry.js +15 -10
  259. package/dist/cjs/calcite-action.cjs.entry.js +11 -6
  260. package/dist/cjs/calcite-alert.cjs.entry.js +18 -14
  261. package/dist/cjs/calcite-avatar.cjs.entry.js +11 -5
  262. package/dist/cjs/calcite-block_2.cjs.entry.js +32 -15
  263. package/dist/cjs/calcite-button.cjs.entry.js +24 -20
  264. package/dist/cjs/calcite-card.cjs.entry.js +23 -13
  265. package/dist/cjs/calcite-checkbox.cjs.entry.js +11 -9
  266. package/dist/cjs/calcite-chip.cjs.entry.js +16 -12
  267. package/dist/cjs/calcite-color-picker_3.cjs.entry.js +1417 -1389
  268. package/dist/cjs/calcite-combobox_3.cjs.entry.js +105 -58
  269. package/dist/cjs/calcite-date-picker_4.cjs.entry.js +117 -44
  270. package/dist/cjs/calcite-dropdown_3.cjs.entry.js +89 -48
  271. package/dist/cjs/calcite-fab.cjs.entry.js +6 -4
  272. package/dist/cjs/calcite-filter.cjs.entry.js +28 -21
  273. package/dist/cjs/calcite-flow.cjs.entry.js +13 -18
  274. package/dist/cjs/calcite-graph_2.cjs.entry.js +123 -48
  275. package/dist/cjs/calcite-handle.cjs.entry.js +7 -4
  276. package/dist/cjs/calcite-icon.cjs.entry.js +10 -5
  277. package/dist/cjs/calcite-inline-editable.cjs.entry.js +23 -18
  278. package/dist/cjs/calcite-input-date-picker.cjs.entry.js +82 -32
  279. package/dist/cjs/calcite-input-message.cjs.entry.js +5 -4
  280. package/dist/cjs/calcite-input-time-picker_2.cjs.entry.js +90 -42
  281. package/dist/cjs/calcite-input.cjs.entry.js +76 -47
  282. package/dist/cjs/calcite-label.cjs.entry.js +7 -5
  283. package/dist/cjs/calcite-link.cjs.entry.js +8 -6
  284. package/dist/cjs/calcite-list_3.cjs.entry.js +21 -14
  285. package/dist/cjs/calcite-loader.cjs.entry.js +11 -8
  286. package/dist/cjs/calcite-modal.cjs.entry.js +31 -21
  287. package/dist/cjs/calcite-notice.cjs.entry.js +17 -14
  288. package/dist/cjs/calcite-option_3.cjs.entry.js +14 -13
  289. package/dist/cjs/calcite-pagination.cjs.entry.js +91 -5
  290. package/dist/cjs/calcite-panel.cjs.entry.js +44 -13
  291. package/dist/cjs/calcite-pick-list_3.cjs.entry.js +33 -23
  292. package/dist/cjs/calcite-popover_2.cjs.entry.js +162 -56
  293. package/dist/cjs/calcite-progress.cjs.entry.js +2 -1
  294. package/dist/cjs/calcite-radio-button-group.cjs.entry.js +3 -2
  295. package/dist/cjs/calcite-radio-button.cjs.entry.js +13 -9
  296. package/dist/cjs/calcite-radio-group_2.cjs.entry.js +12 -11
  297. package/dist/cjs/calcite-rating.cjs.entry.js +14 -9
  298. package/dist/cjs/calcite-scrim.cjs.entry.js +5 -2
  299. package/dist/cjs/calcite-shell_3.cjs.entry.js +10 -8
  300. package/dist/cjs/calcite-sortable-list.cjs.entry.js +5 -4
  301. package/dist/cjs/calcite-split-button.cjs.entry.js +9 -5
  302. package/dist/cjs/calcite-stepper_2.cjs.entry.js +140 -117
  303. package/dist/cjs/calcite-switch.cjs.entry.js +13 -9
  304. package/dist/cjs/calcite-tab_4.cjs.entry.js +122 -81
  305. package/dist/cjs/calcite-tile-select_2.cjs.entry.js +6 -5
  306. package/dist/cjs/calcite-tile.cjs.entry.js +9 -7
  307. package/dist/cjs/calcite-tip_3.cjs.entry.js +13 -10
  308. package/dist/cjs/calcite-tooltip_2.cjs.entry.js +188 -144
  309. package/dist/cjs/calcite-tree_2.cjs.entry.js +33 -21
  310. package/dist/cjs/calcite-value-list_2.cjs.entry.js +40 -31
  311. package/dist/cjs/calcite.cjs.js +4 -3
  312. package/dist/cjs/{conditionalSlot-64f9bfd3.js → conditionalSlot-462ae1f4.js} +7 -2
  313. package/dist/cjs/{debounce-95979061.js → debounce-5127bc67.js} +1 -0
  314. package/dist/cjs/{dom-f3df220d.js → dom-b0904219.js} +28 -2
  315. package/dist/cjs/{forIn-a5d553af.js → forIn-265c8eb3.js} +2 -1
  316. package/dist/cjs/{form-0ef859c8.js → form-4c32a5c7.js} +36 -2
  317. package/dist/cjs/{guid-b270f0db.js → guid-8af0f93c.js} +1 -0
  318. package/dist/cjs/{index-1af0efd3.js → index-82ee13f7.js} +7 -7
  319. package/dist/cjs/index.cjs.js +1 -0
  320. package/dist/cjs/{interactive-87406231.js → interactive-15f9fd28.js} +7 -3
  321. package/dist/cjs/{interfaces-7216af30.js → interfaces-86334104.js} +1 -0
  322. package/dist/cjs/{label-980508de.js → label-131d9cce.js} +26 -18
  323. package/dist/cjs/loader.cjs.js +4 -3
  324. package/dist/cjs/{locale-02462821.js → locale-6c28abd8.js} +31 -28
  325. package/dist/cjs/{math-145c80e2.js → math-2f83830f.js} +1 -0
  326. package/dist/cjs/{number-e813e801.js → number-6f1151e7.js} +2 -1
  327. package/dist/cjs/{observers-79bfb8bc.js → observers-f672f664.js} +1 -0
  328. package/dist/cjs/{popper-64d89ef7.js → popper-5ca144d4.js} +29 -3
  329. package/dist/cjs/{resources-ac80e82c.js → resources-06f33bd4.js} +1 -0
  330. package/dist/cjs/{resources-7d5449fb.js → resources-08dc0a5e.js} +1 -0
  331. package/dist/cjs/{resources-e43fc9f3.js → resources-0de59f13.js} +9 -8
  332. package/dist/cjs/{resources-7811eb2c.js → resources-24a7ca1a.js} +44 -2
  333. package/dist/cjs/{sortable.esm-d7a4560b.js → sortable.esm-8e944897.js} +63 -54
  334. package/dist/cjs/{utils-6579522f.js → utils-f3a37c0a.js} +1 -0
  335. package/dist/collection/collection-manifest.json +1 -1
  336. package/dist/collection/components/accordion/accordion.js +16 -10
  337. package/dist/collection/components/accordion/interfaces.js +1 -0
  338. package/dist/collection/components/accordion-item/accordion-item.css +0 -2
  339. package/dist/collection/components/accordion-item/accordion-item.js +16 -14
  340. package/dist/collection/components/action/action.css +1 -3
  341. package/dist/collection/components/action/action.js +6 -2
  342. package/dist/collection/components/action/resources.js +1 -0
  343. package/dist/collection/components/action-bar/action-bar.js +16 -4
  344. package/dist/collection/components/action-bar/resources.js +1 -0
  345. package/dist/collection/components/action-bar/utils.js +1 -0
  346. package/dist/collection/components/action-group/action-group.js +1 -0
  347. package/dist/collection/components/action-group/resources.js +1 -0
  348. package/dist/collection/components/action-menu/action-menu.css +0 -2
  349. package/dist/collection/components/action-menu/action-menu.js +21 -16
  350. package/dist/collection/components/action-menu/resources.js +1 -0
  351. package/dist/collection/components/action-pad/action-pad.js +15 -4
  352. package/dist/collection/components/action-pad/resources.js +1 -0
  353. package/dist/collection/components/alert/alert.css +11 -24
  354. package/dist/collection/components/alert/alert.js +20 -15
  355. package/dist/collection/components/alert/interfaces.js +1 -0
  356. package/dist/collection/components/alert/resources.js +1 -0
  357. package/dist/collection/components/avatar/avatar.css +1 -1
  358. package/dist/collection/components/avatar/avatar.js +1 -0
  359. package/dist/collection/components/avatar/utils.js +6 -0
  360. package/dist/collection/components/block/block.css +0 -2
  361. package/dist/collection/components/block/block.js +37 -12
  362. package/dist/collection/components/block/resources.js +1 -0
  363. package/dist/collection/components/block-section/block-section.css +0 -2
  364. package/dist/collection/components/block-section/block-section.js +3 -2
  365. package/dist/collection/components/block-section/interfaces.js +1 -0
  366. package/dist/collection/components/block-section/resources.js +1 -0
  367. package/dist/collection/components/button/button.css +1 -3
  368. package/dist/collection/components/button/button.js +20 -15
  369. package/dist/collection/components/button/interfaces.js +1 -0
  370. package/dist/collection/components/button/resources.js +1 -0
  371. package/dist/collection/components/card/card.css +19 -5
  372. package/dist/collection/components/card/card.js +45 -10
  373. package/dist/collection/components/card/resources.js +3 -2
  374. package/dist/collection/components/checkbox/checkbox.css +13 -10
  375. package/dist/collection/components/checkbox/checkbox.js +5 -2
  376. package/dist/collection/components/chip/chip.css +23 -25
  377. package/dist/collection/components/chip/chip.js +7 -4
  378. package/dist/collection/components/chip/interfaces.js +1 -0
  379. package/dist/collection/components/chip/resources.js +4 -2
  380. package/dist/collection/components/color-picker/color-picker.css +2 -12
  381. package/dist/collection/components/color-picker/color-picker.js +76 -36
  382. package/dist/collection/components/color-picker/interfaces.js +1 -0
  383. package/dist/collection/components/color-picker/resources.js +1 -0
  384. package/dist/collection/components/color-picker/utils.js +1 -0
  385. package/dist/collection/components/color-picker-hex-input/color-picker-hex-input.js +48 -50
  386. package/dist/collection/components/color-picker-hex-input/resources.js +1 -0
  387. package/dist/collection/components/color-picker-swatch/color-picker-swatch.js +1 -0
  388. package/dist/collection/components/color-picker-swatch/resources.js +1 -0
  389. package/dist/collection/components/combobox/combobox.css +0 -2
  390. package/dist/collection/components/combobox/combobox.js +95 -47
  391. package/dist/collection/components/combobox/interfaces.js +1 -0
  392. package/dist/collection/components/combobox/resources.js +5 -0
  393. package/dist/collection/components/combobox/utils.js +1 -0
  394. package/dist/collection/components/combobox-item/combobox-item.css +1 -3
  395. package/dist/collection/components/combobox-item/combobox-item.js +11 -2
  396. package/dist/collection/components/combobox-item/resources.js +1 -0
  397. package/dist/collection/components/combobox-item-group/combobox-item-group.js +1 -0
  398. package/dist/collection/components/combobox-item-group/resources.js +1 -0
  399. package/dist/collection/components/date-picker/assets/date-picker/nls/ru.json +4 -4
  400. package/dist/collection/components/date-picker/date-picker.js +36 -6
  401. package/dist/collection/components/date-picker/interfaces.js +1 -0
  402. package/dist/collection/components/date-picker/resources.js +1 -0
  403. package/dist/collection/components/date-picker/utils.js +7 -0
  404. package/dist/collection/components/date-picker-day/date-picker-day.css +7 -9
  405. package/dist/collection/components/date-picker-day/date-picker-day.js +4 -3
  406. package/dist/collection/components/date-picker-month/date-picker-month.js +38 -9
  407. package/dist/collection/components/date-picker-month-header/date-picker-month-header.css +1 -7
  408. package/dist/collection/components/date-picker-month-header/date-picker-month-header.js +35 -19
  409. package/dist/collection/components/dropdown/dropdown.css +0 -1
  410. package/dist/collection/components/dropdown/dropdown.js +76 -35
  411. package/dist/collection/components/dropdown/interfaces.js +1 -0
  412. package/dist/collection/components/dropdown/resources.js +1 -0
  413. package/dist/collection/components/dropdown-group/dropdown-group.css +4 -0
  414. package/dist/collection/components/dropdown-group/dropdown-group.js +9 -6
  415. package/dist/collection/components/dropdown-group/interfaces.js +1 -0
  416. package/dist/collection/components/dropdown-group/resources.js +1 -0
  417. package/dist/collection/components/dropdown-item/dropdown-item.css +1 -2
  418. package/dist/collection/components/dropdown-item/dropdown-item.js +19 -19
  419. package/dist/collection/components/dropdown-item/resources.js +1 -0
  420. package/dist/collection/components/fab/fab.js +2 -0
  421. package/dist/collection/components/fab/resources.js +1 -0
  422. package/dist/collection/components/filter/filter.css +2 -2
  423. package/dist/collection/components/filter/filter.js +20 -15
  424. package/dist/collection/components/filter/resources.js +3 -2
  425. package/dist/collection/components/flow/flow.css +1 -9
  426. package/dist/collection/components/flow/flow.js +12 -17
  427. package/dist/collection/components/flow/interfaces.js +1 -0
  428. package/dist/collection/components/flow/resources.js +1 -0
  429. package/dist/collection/components/functional/ExpandToggle.js +5 -2
  430. package/dist/collection/components/functional/Heading.js +1 -0
  431. package/dist/collection/components/graph/graph.css +1 -0
  432. package/dist/collection/components/graph/graph.js +1 -0
  433. package/dist/collection/components/graph/interfaces.js +1 -0
  434. package/dist/collection/components/graph/util.js +29 -0
  435. package/dist/collection/components/handle/handle.css +0 -2
  436. package/dist/collection/components/handle/handle.js +5 -3
  437. package/dist/collection/components/handle/resources.js +1 -0
  438. package/dist/collection/components/icon/assets/icon/compactness16.json +1 -0
  439. package/dist/collection/components/icon/assets/icon/compactness24.json +1 -0
  440. package/dist/collection/components/icon/assets/icon/compactness32.json +1 -0
  441. package/dist/collection/components/icon/assets/icon/configure16.json +1 -0
  442. package/dist/collection/components/icon/assets/icon/configure24.json +1 -0
  443. package/dist/collection/components/icon/assets/icon/configure32.json +1 -0
  444. package/dist/collection/components/icon/assets/icon/debugScript16.json +1 -0
  445. package/dist/collection/components/icon/assets/icon/debugScript24.json +1 -0
  446. package/dist/collection/components/icon/assets/icon/debugScript32.json +1 -0
  447. package/dist/collection/components/icon/assets/icon/dissolveFeatures16.json +1 -0
  448. package/dist/collection/components/icon/assets/icon/dissolveFeatures24.json +1 -0
  449. package/dist/collection/components/icon/assets/icon/dissolveFeatures32.json +1 -0
  450. package/dist/collection/components/icon/assets/icon/distanceType16.json +1 -0
  451. package/dist/collection/components/icon/assets/icon/distanceType24.json +1 -0
  452. package/dist/collection/components/icon/assets/icon/distanceType32.json +1 -0
  453. package/dist/collection/components/icon/assets/icon/fileEcd16.json +1 -0
  454. package/dist/collection/components/icon/assets/icon/fileEcd24.json +1 -0
  455. package/dist/collection/components/icon/assets/icon/fileEcd32.json +1 -0
  456. package/dist/collection/components/icon/assets/icon/gridDiamond16.json +1 -0
  457. package/dist/collection/components/icon/assets/icon/gridDiamond24.json +1 -0
  458. package/dist/collection/components/icon/assets/icon/gridDiamond32.json +1 -0
  459. package/dist/collection/components/icon/assets/icon/gridHexagon16.json +1 -0
  460. package/dist/collection/components/icon/assets/icon/gridHexagon24.json +1 -0
  461. package/dist/collection/components/icon/assets/icon/gridHexagon32.json +1 -0
  462. package/dist/collection/components/icon/assets/icon/gridTriangle16.json +1 -0
  463. package/dist/collection/components/icon/assets/icon/gridTriangle24.json +1 -0
  464. package/dist/collection/components/icon/assets/icon/gridTriangle32.json +1 -0
  465. package/dist/collection/components/icon/assets/icon/insets16.json +1 -0
  466. package/dist/collection/components/icon/assets/icon/insets24.json +1 -0
  467. package/dist/collection/components/icon/assets/icon/insets32.json +1 -0
  468. package/dist/collection/components/icon/assets/icon/listCheckAll16.json +1 -0
  469. package/dist/collection/components/icon/assets/icon/listCheckAll24.json +1 -0
  470. package/dist/collection/components/icon/assets/icon/listCheckAll32.json +1 -0
  471. package/dist/collection/components/icon/assets/icon/ltrElementsAlign16.json +1 -0
  472. package/dist/collection/components/icon/assets/icon/ltrElementsAlign24.json +1 -0
  473. package/dist/collection/components/icon/assets/icon/ltrElementsAlign32.json +1 -0
  474. package/dist/collection/components/icon/assets/icon/ltrParagraphAlign16.json +1 -0
  475. package/dist/collection/components/icon/assets/icon/ltrParagraphAlign24.json +1 -0
  476. package/dist/collection/components/icon/assets/icon/ltrParagraphAlign32.json +1 -0
  477. package/dist/collection/components/icon/assets/icon/maximumTerritoryDistance16.json +1 -0
  478. package/dist/collection/components/icon/assets/icon/maximumTerritoryDistance24.json +1 -0
  479. package/dist/collection/components/icon/assets/icon/maximumTerritoryDistance32.json +1 -0
  480. package/dist/collection/components/icon/assets/icon/minDistanceBetweenCenters16.json +1 -0
  481. package/dist/collection/components/icon/assets/icon/minDistanceBetweenCenters24.json +1 -0
  482. package/dist/collection/components/icon/assets/icon/minDistanceBetweenCenters32.json +1 -0
  483. package/dist/collection/components/icon/assets/icon/numberOfTerritories16.json +1 -0
  484. package/dist/collection/components/icon/assets/icon/numberOfTerritories24.json +1 -0
  485. package/dist/collection/components/icon/assets/icon/numberOfTerritories32.json +1 -0
  486. package/dist/collection/components/icon/assets/icon/overlapFeatures16.json +1 -0
  487. package/dist/collection/components/icon/assets/icon/overlapFeatures24.json +1 -0
  488. package/dist/collection/components/icon/assets/icon/overlapFeatures32.json +1 -0
  489. package/dist/collection/components/icon/assets/icon/profileVariables16.json +1 -0
  490. package/dist/collection/components/icon/assets/icon/profileVariables24.json +1 -0
  491. package/dist/collection/components/icon/assets/icon/profileVariables32.json +1 -0
  492. package/dist/collection/components/icon/assets/icon/rangefinder16.json +1 -0
  493. package/dist/collection/components/icon/assets/icon/rangefinder24.json +1 -0
  494. package/dist/collection/components/icon/assets/icon/rangefinder32.json +1 -0
  495. package/dist/collection/components/icon/assets/icon/rasterAnalysis16.json +1 -0
  496. package/dist/collection/components/icon/assets/icon/rasterAnalysis24.json +1 -0
  497. package/dist/collection/components/icon/assets/icon/rasterAnalysis32.json +1 -0
  498. package/dist/collection/components/icon/assets/icon/recurrence16.json +1 -0
  499. package/dist/collection/components/icon/assets/icon/recurrence24.json +1 -0
  500. package/dist/collection/components/icon/assets/icon/recurrence32.json +1 -0
  501. package/dist/collection/components/icon/assets/icon/rfid16.json +1 -0
  502. package/dist/collection/components/icon/assets/icon/rfid24.json +1 -0
  503. package/dist/collection/components/icon/assets/icon/rfid32.json +1 -0
  504. package/dist/collection/components/icon/assets/icon/rtlElementsAlign16.json +1 -0
  505. package/dist/collection/components/icon/assets/icon/rtlElementsAlign24.json +1 -0
  506. package/dist/collection/components/icon/assets/icon/rtlElementsAlign32.json +1 -0
  507. package/dist/collection/components/icon/assets/icon/rtlParagraphAlign16.json +1 -0
  508. package/dist/collection/components/icon/assets/icon/rtlParagraphAlign24.json +1 -0
  509. package/dist/collection/components/icon/assets/icon/rtlParagraphAlign32.json +1 -0
  510. package/dist/collection/components/icon/assets/icon/splitFeatures16.json +1 -0
  511. package/dist/collection/components/icon/assets/icon/splitFeatures24.json +1 -0
  512. package/dist/collection/components/icon/assets/icon/splitFeatures32.json +1 -0
  513. package/dist/collection/components/icon/assets/icon/territoryBufferDistance16.json +1 -0
  514. package/dist/collection/components/icon/assets/icon/territoryBufferDistance24.json +1 -0
  515. package/dist/collection/components/icon/assets/icon/territoryBufferDistance32.json +1 -0
  516. package/dist/collection/components/icon/assets/icon/testData16.json +1 -0
  517. package/dist/collection/components/icon/assets/icon/testData24.json +1 -0
  518. package/dist/collection/components/icon/assets/icon/testData32.json +1 -0
  519. package/dist/collection/components/icon/icon.js +3 -2
  520. package/dist/collection/components/icon/resources.js +1 -0
  521. package/dist/collection/components/icon/utils.js +5 -0
  522. package/dist/collection/components/inline-editable/inline-editable.css +1 -4
  523. package/dist/collection/components/inline-editable/inline-editable.js +18 -13
  524. package/dist/collection/components/inline-editable/resources.js +1 -0
  525. package/dist/collection/components/input/input.css +14 -36
  526. package/dist/collection/components/input/input.js +106 -46
  527. package/dist/collection/components/input/interfaces.js +1 -0
  528. package/dist/collection/components/input/resources.js +4 -0
  529. package/dist/collection/components/input-date-picker/input-date-picker.css +1 -1
  530. package/dist/collection/components/input-date-picker/input-date-picker.js +107 -28
  531. package/dist/collection/components/input-message/input-message.css +11 -16
  532. package/dist/collection/components/input-message/input-message.js +1 -0
  533. package/dist/collection/components/input-message/interfaces.js +1 -0
  534. package/dist/collection/components/input-time-picker/input-time-picker.js +83 -14
  535. package/dist/collection/components/interfaces.js +1 -0
  536. package/dist/collection/components/label/label.css +2 -2
  537. package/dist/collection/components/label/label.js +2 -0
  538. package/dist/collection/components/label/resources.js +1 -0
  539. package/dist/collection/components/link/link.css +3 -14
  540. package/dist/collection/components/link/link.js +3 -1
  541. package/dist/collection/components/list/list.js +4 -3
  542. package/dist/collection/components/list/resources.js +1 -0
  543. package/dist/collection/components/list-item/list-item.css +20 -7
  544. package/dist/collection/components/list-item/list-item.js +12 -6
  545. package/dist/collection/components/list-item/resources.js +3 -1
  546. package/dist/collection/components/list-item-group/list-item-group.css +1 -1
  547. package/dist/collection/components/list-item-group/list-item-group.js +3 -2
  548. package/dist/collection/components/list-item-group/resources.js +1 -0
  549. package/dist/collection/components/loader/loader.css +3 -3
  550. package/dist/collection/components/loader/loader.js +18 -15
  551. package/dist/collection/components/modal/interfaces.js +1 -0
  552. package/dist/collection/components/modal/modal.css +7 -48
  553. package/dist/collection/components/modal/modal.js +79 -64
  554. package/dist/collection/components/modal/resources.js +1 -0
  555. package/dist/collection/components/notice/notice.css +5 -16
  556. package/dist/collection/components/notice/notice.js +27 -23
  557. package/dist/collection/components/notice/resources.js +1 -0
  558. package/dist/collection/components/option/option.js +5 -4
  559. package/dist/collection/components/option-group/option-group.js +4 -3
  560. package/dist/collection/components/pagination/pagination.css +2 -7
  561. package/dist/collection/components/pagination/pagination.js +32 -4
  562. package/dist/collection/components/pagination/resources.js +1 -0
  563. package/dist/collection/components/panel/panel.css +2 -1
  564. package/dist/collection/components/panel/panel.js +73 -12
  565. package/dist/collection/components/panel/resources.js +1 -0
  566. package/dist/collection/components/pick-list/pick-list.js +23 -11
  567. package/dist/collection/components/pick-list/resources.js +1 -0
  568. package/dist/collection/components/pick-list/shared-list-logic.js +3 -2
  569. package/dist/collection/components/pick-list/shared-list-render.js +3 -1
  570. package/dist/collection/components/pick-list-group/pick-list-group.js +1 -0
  571. package/dist/collection/components/pick-list-group/resources.js +1 -0
  572. package/dist/collection/components/pick-list-item/pick-list-item.css +1 -3
  573. package/dist/collection/components/pick-list-item/pick-list-item.js +25 -14
  574. package/dist/collection/components/pick-list-item/resources.js +1 -0
  575. package/dist/collection/components/popover/PopoverManager.js +75 -0
  576. package/dist/collection/components/popover/popover.css +5 -0
  577. package/dist/collection/components/popover/popover.js +121 -27
  578. package/dist/collection/components/popover/resources.js +1 -1
  579. package/dist/collection/components/popover-manager/popover-manager.js +33 -44
  580. package/dist/collection/components/progress/progress.js +1 -0
  581. package/dist/collection/components/radio-button/radio-button.css +10 -6
  582. package/dist/collection/components/radio-button/radio-button.js +6 -2
  583. package/dist/collection/components/radio-button/resources.js +1 -0
  584. package/dist/collection/components/radio-button-group/radio-button-group.js +1 -0
  585. package/dist/collection/components/radio-group/interfaces.js +1 -0
  586. package/dist/collection/components/radio-group/radio-group.js +3 -2
  587. package/dist/collection/components/radio-group-item/radio-group-item.css +0 -2
  588. package/dist/collection/components/radio-group-item/radio-group-item.js +6 -5
  589. package/dist/collection/components/radio-group-item/resources.js +1 -0
  590. package/dist/collection/components/rating/rating.css +2 -12
  591. package/dist/collection/components/rating/rating.js +7 -2
  592. package/dist/collection/components/rating/resources.js +1 -0
  593. package/dist/collection/components/scrim/resources.js +1 -0
  594. package/dist/collection/components/scrim/scrim.js +4 -1
  595. package/dist/collection/components/select/resources.js +1 -0
  596. package/dist/collection/components/select/select.css +0 -2
  597. package/dist/collection/components/select/select.js +3 -2
  598. package/dist/collection/components/shell/resources.js +1 -0
  599. package/dist/collection/components/shell/shell.js +1 -0
  600. package/dist/collection/components/shell-center-row/resources.js +1 -0
  601. package/dist/collection/components/shell-center-row/shell-center-row.css +1 -1
  602. package/dist/collection/components/shell-center-row/shell-center-row.js +1 -0
  603. package/dist/collection/components/shell-panel/resources.js +1 -0
  604. package/dist/collection/components/shell-panel/shell-panel.css +3 -6
  605. package/dist/collection/components/shell-panel/shell-panel.js +6 -1
  606. package/dist/collection/components/slider/slider.css +29 -2
  607. package/dist/collection/components/slider/slider.js +94 -41
  608. package/dist/collection/components/sortable-list/resources.js +1 -0
  609. package/dist/collection/components/sortable-list/sortable-list.js +1 -0
  610. package/dist/collection/components/split-button/resources.js +1 -0
  611. package/dist/collection/components/split-button/split-button.css +1 -4
  612. package/dist/collection/components/split-button/split-button.js +6 -2
  613. package/dist/{calcite/p-accdb0ce.js → collection/components/stepper/interfaces.js} +2 -1
  614. package/dist/collection/components/stepper/stepper.js +107 -67
  615. package/dist/collection/components/stepper-item/stepper-item.css +27 -2
  616. package/dist/collection/components/stepper-item/stepper-item.js +83 -82
  617. package/dist/collection/components/switch/switch.css +0 -2
  618. package/dist/collection/components/switch/switch.js +8 -4
  619. package/dist/collection/components/tab/interfaces.js +1 -0
  620. package/dist/collection/components/tab/tab.js +38 -22
  621. package/dist/collection/components/tab-nav/tab-nav.css +6 -0
  622. package/dist/collection/components/tab-nav/tab-nav.js +87 -37
  623. package/dist/collection/components/tab-title/tab-title.css +30 -15
  624. package/dist/collection/components/tab-title/tab-title.js +92 -44
  625. package/dist/collection/components/tabs/interfaces.js +1 -0
  626. package/dist/collection/components/tabs/resources.js +1 -0
  627. package/dist/collection/components/tabs/tabs.css +13 -1
  628. package/dist/collection/components/tabs/tabs.js +11 -9
  629. package/dist/collection/components/tile/resources.js +1 -0
  630. package/dist/collection/components/tile/tile.css +3 -4
  631. package/dist/collection/components/tile/tile.js +2 -0
  632. package/dist/collection/components/tile-select/interfaces.js +1 -0
  633. package/dist/collection/components/tile-select/resources.js +1 -0
  634. package/dist/collection/components/tile-select/tile-select.css +7 -2
  635. package/dist/collection/components/tile-select/tile-select.js +1 -0
  636. package/dist/collection/components/tile-select-group/interfaces.js +1 -0
  637. package/dist/collection/components/tile-select-group/tile-select-group.css +1 -1
  638. package/dist/collection/components/tile-select-group/tile-select-group.js +1 -0
  639. package/dist/collection/components/time-picker/resources.js +1 -0
  640. package/dist/collection/components/time-picker/time-picker.js +61 -33
  641. package/dist/collection/components/tip/resources.js +1 -0
  642. package/dist/collection/components/tip/tip.css +0 -2
  643. package/dist/collection/components/tip/tip.js +1 -0
  644. package/dist/collection/components/tip-group/tip-group.js +1 -0
  645. package/dist/collection/components/tip-manager/resources.js +1 -0
  646. package/dist/collection/components/tip-manager/tip-manager.css +1 -13
  647. package/dist/collection/components/tip-manager/tip-manager.js +25 -5
  648. package/dist/collection/components/tooltip/TooltipManager.js +161 -0
  649. package/dist/collection/components/tooltip/resources.js +1 -1
  650. package/dist/collection/components/tooltip/tooltip.css +7 -4
  651. package/dist/collection/components/tooltip/tooltip.js +58 -29
  652. package/dist/collection/components/tooltip-manager/tooltip-manager.js +6 -163
  653. package/dist/collection/components/tree/interfaces.js +1 -0
  654. package/dist/collection/components/tree/tree.js +18 -12
  655. package/dist/collection/components/tree-item/interfaces.js +1 -0
  656. package/dist/collection/components/tree-item/resources.js +1 -0
  657. package/dist/collection/components/tree-item/tree-item.css +8 -14
  658. package/dist/collection/components/tree-item/tree-item.js +31 -24
  659. package/dist/collection/components/value-list/resources.js +1 -0
  660. package/dist/collection/components/value-list/value-list.js +41 -29
  661. package/dist/collection/components/value-list-item/resources.js +1 -0
  662. package/dist/collection/components/value-list-item/value-list-item.css +0 -2
  663. package/dist/collection/components/value-list-item/value-list-item.js +33 -23
  664. package/dist/collection/demos/_assets/demo-spacer.js +17 -0
  665. package/dist/collection/demos/_assets/demo-template.js +13 -0
  666. package/dist/collection/demos/_assets/head.js +45 -0
  667. package/dist/collection/demos/_assets/locales.js +223 -0
  668. package/dist/collection/utils/array.js +1 -0
  669. package/dist/collection/utils/conditionalSlot.js +5 -0
  670. package/dist/collection/utils/date.js +36 -0
  671. package/dist/collection/utils/dom.js +26 -1
  672. package/dist/collection/utils/filter.js +2 -1
  673. package/dist/collection/utils/form.js +32 -0
  674. package/dist/collection/utils/globalAttributes.js +6 -0
  675. package/dist/collection/utils/guid.js +1 -0
  676. package/dist/collection/utils/interactive.js +7 -3
  677. package/dist/collection/utils/key.js +1 -0
  678. package/dist/collection/utils/label.js +25 -17
  679. package/dist/collection/utils/locale.js +31 -27
  680. package/dist/collection/utils/math.js +1 -0
  681. package/dist/collection/utils/number.js +2 -1
  682. package/dist/collection/utils/observers.js +1 -0
  683. package/dist/collection/utils/popper.js +17 -2
  684. package/dist/collection/utils/resources.js +1 -0
  685. package/dist/collection/utils/time.js +1 -0
  686. package/dist/components/ExpandToggle.js +5 -2
  687. package/dist/components/Heading.js +1 -0
  688. package/dist/components/action-group.js +11 -16
  689. package/dist/components/action-menu.js +30 -31
  690. package/dist/components/action.js +7 -3
  691. package/dist/components/array.js +1 -0
  692. package/dist/components/button.js +19 -15
  693. package/dist/components/calcite-accordion-item.js +13 -11
  694. package/dist/components/calcite-accordion.js +12 -6
  695. package/dist/components/calcite-action-bar.js +20 -20
  696. package/dist/components/calcite-action-group.js +1 -0
  697. package/dist/components/calcite-action-menu.js +1 -0
  698. package/dist/components/calcite-action-pad.js +19 -20
  699. package/dist/components/calcite-action.js +1 -0
  700. package/dist/components/calcite-alert.js +16 -12
  701. package/dist/components/calcite-avatar.js +8 -2
  702. package/dist/components/calcite-block-section.js +4 -3
  703. package/dist/components/calcite-block.js +38 -27
  704. package/dist/components/calcite-button.js +1 -0
  705. package/dist/components/calcite-card.js +21 -10
  706. package/dist/components/calcite-checkbox.js +1 -0
  707. package/dist/components/calcite-chip.js +1 -0
  708. package/dist/components/calcite-color-picker-hex-input.js +1 -0
  709. package/dist/components/calcite-color-picker-swatch.js +1 -0
  710. package/dist/components/calcite-color-picker.js +77 -37
  711. package/dist/components/calcite-combobox-item-group.js +1 -0
  712. package/dist/components/calcite-combobox-item.js +4 -1
  713. package/dist/components/calcite-combobox.js +94 -48
  714. package/dist/components/calcite-date-picker-day.js +1 -0
  715. package/dist/components/calcite-date-picker-month-header.js +1 -0
  716. package/dist/components/calcite-date-picker-month.js +1 -0
  717. package/dist/components/calcite-date-picker.js +1 -0
  718. package/dist/components/calcite-dropdown-group.js +9 -6
  719. package/dist/components/calcite-dropdown-item.js +17 -17
  720. package/dist/components/calcite-dropdown.js +1 -0
  721. package/dist/components/calcite-fab.js +2 -0
  722. package/dist/components/calcite-filter.js +1 -0
  723. package/dist/components/calcite-flow.js +12 -17
  724. package/dist/components/calcite-graph.js +1 -0
  725. package/dist/components/calcite-handle.js +1 -0
  726. package/dist/components/calcite-icon.js +1 -0
  727. package/dist/components/calcite-inline-editable.js +18 -13
  728. package/dist/components/calcite-input-date-picker.js +76 -24
  729. package/dist/components/calcite-input-message.js +2 -1
  730. package/dist/components/calcite-input-time-picker.js +38 -11
  731. package/dist/components/calcite-input.js +1 -0
  732. package/dist/components/calcite-label.js +1 -0
  733. package/dist/components/calcite-link.js +1 -0
  734. package/dist/components/calcite-list-item-group.js +2 -1
  735. package/dist/components/calcite-list-item.js +12 -5
  736. package/dist/components/calcite-list.js +2 -1
  737. package/dist/components/calcite-loader.js +1 -0
  738. package/dist/components/calcite-modal.js +27 -18
  739. package/dist/components/calcite-notice.js +11 -8
  740. package/dist/components/calcite-option-group.js +3 -2
  741. package/dist/components/calcite-option.js +4 -3
  742. package/dist/components/calcite-pagination.js +90 -4
  743. package/dist/components/calcite-panel.js +50 -24
  744. package/dist/components/calcite-pick-list-group.js +2 -1
  745. package/dist/components/calcite-pick-list-item.js +1 -0
  746. package/dist/components/calcite-pick-list.js +13 -7
  747. package/dist/components/calcite-popover-manager.js +31 -37
  748. package/dist/components/calcite-popover.js +1 -0
  749. package/dist/components/calcite-progress.js +1 -0
  750. package/dist/components/calcite-radio-button-group.js +1 -0
  751. package/dist/components/calcite-radio-button.js +7 -3
  752. package/dist/components/calcite-radio-group-item.js +6 -5
  753. package/dist/components/calcite-radio-group.js +3 -2
  754. package/dist/components/calcite-rating.js +8 -3
  755. package/dist/components/calcite-scrim.js +1 -0
  756. package/dist/components/calcite-select.js +3 -2
  757. package/dist/components/calcite-shell-center-row.js +2 -1
  758. package/dist/components/calcite-shell-panel.js +3 -1
  759. package/dist/components/calcite-shell.js +1 -0
  760. package/dist/components/calcite-slider.js +86 -39
  761. package/dist/components/calcite-sortable-list.js +1 -0
  762. package/dist/components/calcite-split-button.js +7 -3
  763. package/dist/components/calcite-stepper-item.js +56 -64
  764. package/dist/components/calcite-stepper.js +83 -51
  765. package/dist/components/calcite-switch.js +1 -0
  766. package/dist/components/calcite-tab-nav.js +1 -0
  767. package/dist/components/calcite-tab-title.js +1 -0
  768. package/dist/components/calcite-tab.js +1 -0
  769. package/dist/components/calcite-tabs.js +1 -0
  770. package/dist/components/calcite-tile-select-group.js +2 -1
  771. package/dist/components/calcite-tile-select.js +2 -1
  772. package/dist/components/calcite-tile.js +1 -0
  773. package/dist/components/calcite-time-picker.js +1 -0
  774. package/dist/components/calcite-tip-group.js +1 -0
  775. package/dist/components/calcite-tip-manager.js +8 -5
  776. package/dist/components/calcite-tip.js +3 -2
  777. package/dist/components/calcite-tooltip-manager.js +48 -1
  778. package/dist/components/calcite-tooltip.js +195 -23
  779. package/dist/components/calcite-tree-item.js +19 -12
  780. package/dist/components/calcite-tree.js +12 -6
  781. package/dist/components/calcite-value-list-item.js +15 -11
  782. package/dist/components/calcite-value-list.js +20 -14
  783. package/dist/components/checkbox.js +6 -3
  784. package/dist/components/chip.js +11 -7
  785. package/dist/components/color-picker-hex-input.js +48 -50
  786. package/dist/components/color-picker-swatch.js +1337 -1345
  787. package/dist/components/conditionalSlot.js +5 -0
  788. package/dist/components/date-picker-day.js +4 -3
  789. package/dist/components/date-picker-month-header.js +36 -20
  790. package/dist/components/date-picker-month.js +36 -7
  791. package/dist/components/date-picker.js +42 -6
  792. package/dist/components/date.js +36 -0
  793. package/dist/components/debounce.js +1 -0
  794. package/dist/components/dom.js +27 -2
  795. package/dist/components/dropdown.js +65 -25
  796. package/dist/components/filter.js +22 -15
  797. package/dist/components/forIn.js +1 -0
  798. package/dist/components/form.js +34 -2
  799. package/dist/components/graph.js +30 -1
  800. package/dist/components/guid.js +1 -0
  801. package/dist/components/handle.js +5 -3
  802. package/dist/components/icon.js +7 -2
  803. package/dist/components/index.d.ts +1 -1
  804. package/dist/components/index.js +1 -0
  805. package/dist/components/input.js +71 -40
  806. package/dist/components/interactive.js +7 -3
  807. package/dist/components/interfaces.js +1 -0
  808. package/dist/components/interfaces2.js +1 -0
  809. package/dist/components/label.js +26 -18
  810. package/dist/components/label2.js +3 -1
  811. package/dist/components/link.js +4 -2
  812. package/dist/components/loader.js +9 -6
  813. package/dist/components/locale.js +31 -28
  814. package/dist/components/math.js +1 -0
  815. package/dist/components/number.js +2 -1
  816. package/dist/components/observers.js +1 -0
  817. package/dist/components/pick-list-item.js +16 -11
  818. package/dist/components/popover.js +152 -19
  819. package/dist/components/popper.js +27 -2
  820. package/dist/components/progress.js +1 -0
  821. package/dist/components/resources.js +11 -18
  822. package/dist/components/resources2.js +8 -5
  823. package/dist/components/resources3.js +25 -10
  824. package/dist/components/scrim.js +4 -1
  825. package/dist/components/shared-list-render.js +8 -7
  826. package/dist/components/sortable.esm.js +63 -54
  827. package/dist/components/switch.js +8 -4
  828. package/dist/components/tab-nav.js +53 -25
  829. package/dist/components/tab-title.js +45 -34
  830. package/dist/components/tab.js +21 -17
  831. package/dist/components/tabs.js +9 -7
  832. package/dist/components/tile.js +3 -1
  833. package/dist/components/time-picker.js +51 -27
  834. package/dist/components/utils.js +1 -0
  835. package/dist/components/utils2.js +1 -0
  836. package/dist/custom-elements/index.js +3712 -2723
  837. package/dist/esm/{ExpandToggle-af224c1e.js → ExpandToggle-ce794961.js} +9 -6
  838. package/dist/esm/{Heading-d5f1710a.js → Heading-9ccb3452.js} +2 -1
  839. package/dist/esm/{array-91a648e2.js → array-7a76d321.js} +1 -0
  840. package/dist/esm/calcite-accordion_2.entry.js +24 -17
  841. package/dist/esm/calcite-action-bar.entry.js +17 -11
  842. package/dist/esm/calcite-action-group.entry.js +8 -7
  843. package/dist/esm/calcite-action-menu.entry.js +28 -23
  844. package/dist/esm/calcite-action-pad.entry.js +15 -10
  845. package/dist/esm/calcite-action.entry.js +11 -6
  846. package/dist/esm/calcite-alert.entry.js +18 -14
  847. package/dist/esm/calcite-avatar.entry.js +11 -5
  848. package/dist/esm/calcite-block_2.entry.js +32 -15
  849. package/dist/esm/calcite-button.entry.js +24 -20
  850. package/dist/esm/calcite-card.entry.js +23 -13
  851. package/dist/esm/calcite-checkbox.entry.js +11 -9
  852. package/dist/esm/calcite-chip.entry.js +16 -12
  853. package/dist/esm/calcite-color-picker_3.entry.js +1417 -1389
  854. package/dist/esm/calcite-combobox_3.entry.js +105 -58
  855. package/dist/esm/calcite-date-picker_4.entry.js +117 -44
  856. package/dist/esm/calcite-dropdown_3.entry.js +89 -48
  857. package/dist/esm/calcite-fab.entry.js +6 -4
  858. package/dist/esm/calcite-filter.entry.js +28 -21
  859. package/dist/esm/calcite-flow.entry.js +13 -18
  860. package/dist/esm/calcite-graph_2.entry.js +123 -48
  861. package/dist/esm/calcite-handle.entry.js +7 -4
  862. package/dist/esm/calcite-icon.entry.js +10 -5
  863. package/dist/esm/calcite-inline-editable.entry.js +23 -18
  864. package/dist/esm/calcite-input-date-picker.entry.js +82 -32
  865. package/dist/esm/calcite-input-message.entry.js +5 -4
  866. package/dist/esm/calcite-input-time-picker_2.entry.js +90 -42
  867. package/dist/esm/calcite-input.entry.js +77 -48
  868. package/dist/esm/calcite-label.entry.js +7 -5
  869. package/dist/esm/calcite-link.entry.js +8 -6
  870. package/dist/esm/calcite-list_3.entry.js +21 -14
  871. package/dist/esm/calcite-loader.entry.js +11 -8
  872. package/dist/esm/calcite-modal.entry.js +31 -21
  873. package/dist/esm/calcite-notice.entry.js +17 -14
  874. package/dist/esm/calcite-option_3.entry.js +14 -13
  875. package/dist/esm/calcite-pagination.entry.js +91 -5
  876. package/dist/esm/calcite-panel.entry.js +44 -13
  877. package/dist/esm/calcite-pick-list_3.entry.js +33 -23
  878. package/dist/esm/calcite-popover_2.entry.js +162 -56
  879. package/dist/esm/calcite-progress.entry.js +2 -1
  880. package/dist/esm/calcite-radio-button-group.entry.js +3 -2
  881. package/dist/esm/calcite-radio-button.entry.js +13 -9
  882. package/dist/esm/calcite-radio-group_2.entry.js +12 -11
  883. package/dist/esm/calcite-rating.entry.js +14 -9
  884. package/dist/esm/calcite-scrim.entry.js +5 -2
  885. package/dist/esm/calcite-shell_3.entry.js +10 -8
  886. package/dist/esm/calcite-sortable-list.entry.js +5 -4
  887. package/dist/esm/calcite-split-button.entry.js +9 -5
  888. package/dist/esm/calcite-stepper_2.entry.js +140 -117
  889. package/dist/esm/calcite-switch.entry.js +13 -9
  890. package/dist/esm/calcite-tab_4.entry.js +122 -81
  891. package/dist/esm/calcite-tile-select_2.entry.js +6 -5
  892. package/dist/esm/calcite-tile.entry.js +9 -7
  893. package/dist/esm/calcite-tip_3.entry.js +13 -10
  894. package/dist/esm/calcite-tooltip_2.entry.js +188 -144
  895. package/dist/esm/calcite-tree_2.entry.js +33 -21
  896. package/dist/esm/calcite-value-list_2.entry.js +40 -31
  897. package/dist/esm/calcite.js +4 -3
  898. package/dist/esm/{conditionalSlot-67f579ff.js → conditionalSlot-6be8f3bd.js} +7 -2
  899. package/dist/esm/{debounce-79648d42.js → debounce-9626aac0.js} +1 -0
  900. package/dist/esm/{dom-e7fa77b9.js → dom-4caa79e4.js} +28 -3
  901. package/dist/esm/{forIn-48d8fb84.js → forIn-091a9d50.js} +2 -1
  902. package/dist/esm/{form-5e4609eb.js → form-7c2e444b.js} +35 -3
  903. package/dist/esm/{guid-196bd5ea.js → guid-27925469.js} +1 -0
  904. package/dist/esm/{index-bd94948c.js → index-1e02e91b.js} +7 -7
  905. package/dist/esm/index.js +1 -0
  906. package/dist/esm/{interactive-48b5cc0f.js → interactive-32803ed8.js} +7 -3
  907. package/dist/esm/{interfaces-0e5b954c.js → interfaces-64ad1cde.js} +1 -0
  908. package/dist/esm/{label-68f22660.js → label-ccf07634.js} +26 -18
  909. package/dist/esm/loader.js +4 -3
  910. package/dist/esm/{locale-fc850b7c.js → locale-705ed382.js} +31 -28
  911. package/dist/esm/{math-456207f5.js → math-351ff0de.js} +1 -0
  912. package/dist/esm/{number-8779395f.js → number-bb265f44.js} +2 -1
  913. package/dist/esm/{observers-46118290.js → observers-c18e9524.js} +1 -0
  914. package/dist/esm/polyfills/css-shim.js +1 -1
  915. package/dist/esm/{popper-da45ec93.js → popper-44b3ba83.js} +28 -3
  916. package/dist/esm/{resources-73dac782.js → resources-0aacb21d.js} +44 -2
  917. package/dist/esm/{resources-b5c3d9a7.js → resources-529884cb.js} +9 -8
  918. package/dist/esm/{resources-027bd8f9.js → resources-a2cad43d.js} +1 -0
  919. package/dist/esm/{resources-34334875.js → resources-a32d1180.js} +1 -0
  920. package/dist/esm/{sortable.esm-04824d33.js → sortable.esm-4e7d5c7b.js} +63 -54
  921. package/dist/esm/{utils-e84055a3.js → utils-2f763d44.js} +1 -0
  922. package/dist/esm-es5/{ExpandToggle-af224c1e.js → ExpandToggle-ce794961.js} +2 -1
  923. package/dist/esm-es5/{Heading-d5f1710a.js → Heading-9ccb3452.js} +2 -1
  924. package/dist/esm-es5/{array-91a648e2.js → array-7a76d321.js} +1 -0
  925. package/dist/esm-es5/calcite-accordion_2.entry.js +2 -1
  926. package/dist/esm-es5/calcite-action-bar.entry.js +2 -1
  927. package/dist/esm-es5/calcite-action-group.entry.js +2 -1
  928. package/dist/esm-es5/calcite-action-menu.entry.js +3 -2
  929. package/dist/esm-es5/calcite-action-pad.entry.js +3 -2
  930. package/dist/esm-es5/calcite-action.entry.js +2 -1
  931. package/dist/esm-es5/calcite-alert.entry.js +3 -2
  932. package/dist/esm-es5/calcite-avatar.entry.js +2 -1
  933. package/dist/esm-es5/calcite-block_2.entry.js +2 -1
  934. package/dist/esm-es5/calcite-button.entry.js +2 -1
  935. package/dist/esm-es5/calcite-card.entry.js +2 -1
  936. package/dist/esm-es5/calcite-checkbox.entry.js +3 -2
  937. package/dist/esm-es5/calcite-chip.entry.js +3 -2
  938. package/dist/esm-es5/calcite-color-picker_3.entry.js +3 -2
  939. package/dist/esm-es5/calcite-combobox_3.entry.js +3 -2
  940. package/dist/esm-es5/calcite-date-picker_4.entry.js +3 -2
  941. package/dist/esm-es5/calcite-dropdown_3.entry.js +3 -2
  942. package/dist/esm-es5/calcite-fab.entry.js +2 -1
  943. package/dist/esm-es5/calcite-filter.entry.js +2 -1
  944. package/dist/esm-es5/calcite-flow.entry.js +2 -1
  945. package/dist/esm-es5/calcite-graph_2.entry.js +2 -1
  946. package/dist/esm-es5/calcite-handle.entry.js +2 -1
  947. package/dist/esm-es5/calcite-icon.entry.js +2 -1
  948. package/dist/esm-es5/calcite-inline-editable.entry.js +3 -2
  949. package/dist/esm-es5/calcite-input-date-picker.entry.js +2 -1
  950. package/dist/esm-es5/calcite-input-message.entry.js +2 -1
  951. package/dist/esm-es5/calcite-input-time-picker_2.entry.js +3 -2
  952. package/dist/esm-es5/calcite-input.entry.js +3 -2
  953. package/dist/esm-es5/calcite-label.entry.js +2 -1
  954. package/dist/esm-es5/calcite-link.entry.js +3 -2
  955. package/dist/esm-es5/calcite-list_3.entry.js +3 -2
  956. package/dist/esm-es5/calcite-loader.entry.js +2 -1
  957. package/dist/esm-es5/calcite-modal.entry.js +3 -2
  958. package/dist/esm-es5/calcite-notice.entry.js +3 -2
  959. package/dist/esm-es5/calcite-option_3.entry.js +2 -1
  960. package/dist/esm-es5/calcite-pagination.entry.js +2 -1
  961. package/dist/esm-es5/calcite-panel.entry.js +3 -2
  962. package/dist/esm-es5/calcite-pick-list_3.entry.js +3 -2
  963. package/dist/esm-es5/calcite-popover_2.entry.js +2 -1
  964. package/dist/esm-es5/calcite-progress.entry.js +2 -1
  965. package/dist/esm-es5/calcite-radio-button-group.entry.js +2 -1
  966. package/dist/esm-es5/calcite-radio-button.entry.js +2 -1
  967. package/dist/esm-es5/calcite-radio-group_2.entry.js +2 -1
  968. package/dist/esm-es5/calcite-rating.entry.js +2 -1
  969. package/dist/esm-es5/calcite-scrim.entry.js +2 -1
  970. package/dist/esm-es5/calcite-shell_3.entry.js +2 -1
  971. package/dist/esm-es5/calcite-sortable-list.entry.js +2 -1
  972. package/dist/esm-es5/calcite-split-button.entry.js +2 -1
  973. package/dist/esm-es5/calcite-stepper_2.entry.js +3 -2
  974. package/dist/esm-es5/calcite-switch.entry.js +3 -2
  975. package/dist/esm-es5/calcite-tab_4.entry.js +3 -2
  976. package/dist/esm-es5/calcite-tile-select_2.entry.js +2 -1
  977. package/dist/esm-es5/calcite-tile.entry.js +2 -1
  978. package/dist/esm-es5/calcite-tip_3.entry.js +3 -2
  979. package/dist/esm-es5/calcite-tooltip_2.entry.js +3 -2
  980. package/dist/esm-es5/calcite-tree_2.entry.js +2 -1
  981. package/dist/esm-es5/calcite-value-list_2.entry.js +2 -1
  982. package/dist/esm-es5/calcite.js +2 -1
  983. package/dist/esm-es5/{conditionalSlot-67f579ff.js → conditionalSlot-6be8f3bd.js} +2 -1
  984. package/dist/esm-es5/{debounce-79648d42.js → debounce-9626aac0.js} +1 -0
  985. package/dist/esm-es5/dom-4caa79e4.js +6 -0
  986. package/dist/esm-es5/{forIn-48d8fb84.js → forIn-091a9d50.js} +2 -1
  987. package/dist/esm-es5/form-7c2e444b.js +6 -0
  988. package/dist/esm-es5/{guid-196bd5ea.js → guid-27925469.js} +1 -0
  989. package/dist/esm-es5/{index-bd94948c.js → index-1e02e91b.js} +4 -2
  990. package/dist/esm-es5/index.js +1 -0
  991. package/dist/esm-es5/{interactive-48b5cc0f.js → interactive-32803ed8.js} +1 -0
  992. package/dist/esm-es5/{interfaces-0e5b954c.js → interfaces-64ad1cde.js} +1 -0
  993. package/dist/esm-es5/label-ccf07634.js +6 -0
  994. package/dist/esm-es5/loader.js +2 -1
  995. package/dist/esm-es5/locale-705ed382.js +6 -0
  996. package/dist/esm-es5/{math-456207f5.js → math-351ff0de.js} +1 -0
  997. package/dist/esm-es5/number-bb265f44.js +6 -0
  998. package/dist/esm-es5/{observers-46118290.js → observers-c18e9524.js} +1 -0
  999. package/dist/esm-es5/{popper-da45ec93.js → popper-44b3ba83.js} +2 -1
  1000. package/dist/esm-es5/{resources-73dac782.js → resources-0aacb21d.js} +3 -2
  1001. package/dist/esm-es5/resources-529884cb.js +6 -0
  1002. package/dist/esm-es5/{resources-027bd8f9.js → resources-a2cad43d.js} +1 -0
  1003. package/dist/esm-es5/{resources-34334875.js → resources-a32d1180.js} +1 -0
  1004. package/dist/esm-es5/sortable.esm-4e7d5c7b.js +12 -0
  1005. package/dist/esm-es5/{utils-e84055a3.js → utils-2f763d44.js} +1 -0
  1006. package/dist/extras/docs-json.d.ts +3 -0
  1007. package/dist/extras/docs-json.json +577 -301
  1008. package/dist/loader/cdn.js +1 -0
  1009. package/dist/loader/index.cjs.js +1 -0
  1010. package/dist/loader/index.es2017.js +1 -0
  1011. package/dist/loader/index.js +1 -0
  1012. package/dist/types/components/accordion/accordion.d.ts +6 -4
  1013. package/dist/types/components/accordion-item/accordion-item.d.ts +4 -4
  1014. package/dist/types/components/action/action.d.ts +4 -1
  1015. package/dist/types/components/action-bar/action-bar.d.ts +6 -1
  1016. package/dist/types/components/action-menu/action-menu.d.ts +4 -2
  1017. package/dist/types/components/action-pad/action-pad.d.ts +5 -1
  1018. package/dist/types/components/alert/alert.d.ts +11 -6
  1019. package/dist/types/components/avatar/utils.d.ts +5 -0
  1020. package/dist/types/components/block/block.d.ts +12 -4
  1021. package/dist/types/components/button/button.d.ts +7 -4
  1022. package/dist/types/components/card/card.d.ts +13 -4
  1023. package/dist/types/components/card/resources.d.ts +1 -1
  1024. package/dist/types/components/checkbox/checkbox.d.ts +3 -1
  1025. package/dist/types/components/chip/chip.d.ts +3 -1
  1026. package/dist/types/components/chip/resources.d.ts +3 -2
  1027. package/dist/types/components/color-picker/color-picker.d.ts +58 -18
  1028. package/dist/types/components/color-picker-hex-input/color-picker-hex-input.d.ts +5 -1
  1029. package/dist/types/components/combobox/combobox.d.ts +15 -4
  1030. package/dist/types/components/combobox/resources.d.ts +4 -0
  1031. package/dist/types/components/combobox-item/combobox-item.d.ts +2 -0
  1032. package/dist/types/components/date-picker/date-picker.d.ts +32 -3
  1033. package/dist/types/components/date-picker/utils.d.ts +5 -0
  1034. package/dist/types/components/date-picker-day/date-picker-day.d.ts +2 -1
  1035. package/dist/types/components/date-picker-month/date-picker-month.d.ts +30 -2
  1036. package/dist/types/components/date-picker-month-header/date-picker-month-header.d.ts +10 -1
  1037. package/dist/types/components/dropdown/dropdown.d.ts +18 -9
  1038. package/dist/types/components/dropdown-group/dropdown-group.d.ts +5 -3
  1039. package/dist/types/components/dropdown-item/dropdown-item.d.ts +3 -3
  1040. package/dist/types/components/fab/fab.d.ts +1 -0
  1041. package/dist/types/components/filter/filter.d.ts +3 -3
  1042. package/dist/types/components/filter/resources.d.ts +1 -1
  1043. package/dist/types/components/flow/flow.d.ts +1 -4
  1044. package/dist/types/components/graph/util.d.ts +14 -0
  1045. package/dist/types/components/handle/handle.d.ts +1 -1
  1046. package/dist/types/components/icon/utils.d.ts +4 -0
  1047. package/dist/types/components/inline-editable/inline-editable.d.ts +10 -5
  1048. package/dist/types/components/input/input.d.ts +32 -13
  1049. package/dist/types/components/input/resources.d.ts +3 -0
  1050. package/dist/types/components/input-date-picker/input-date-picker.d.ts +35 -7
  1051. package/dist/types/components/input-message/input-message.d.ts +7 -3
  1052. package/dist/types/components/input-time-picker/input-time-picker.d.ts +15 -2
  1053. package/dist/types/components/interfaces.d.ts +1 -0
  1054. package/dist/types/components/label/label.d.ts +1 -0
  1055. package/dist/types/components/link/link.d.ts +2 -1
  1056. package/dist/types/components/list/list.d.ts +2 -2
  1057. package/dist/types/components/list-item/list-item.d.ts +3 -3
  1058. package/dist/types/components/list-item/resources.d.ts +1 -0
  1059. package/dist/types/components/list-item-group/list-item-group.d.ts +2 -2
  1060. package/dist/types/components/loader/loader.d.ts +11 -9
  1061. package/dist/types/components/modal/modal.d.ts +37 -28
  1062. package/dist/types/components/notice/notice.d.ts +24 -19
  1063. package/dist/types/components/option/option.d.ts +1 -1
  1064. package/dist/types/components/option-group/option-group.d.ts +1 -1
  1065. package/dist/types/components/pagination/pagination.d.ts +13 -3
  1066. package/dist/types/components/panel/panel.d.ts +18 -2
  1067. package/dist/types/components/pick-list/pick-list.d.ts +7 -3
  1068. package/dist/types/components/pick-list/shared-list-logic.d.ts +1 -1
  1069. package/dist/types/components/pick-list-item/pick-list-item.d.ts +9 -3
  1070. package/dist/types/components/popover/PopoverManager.d.ts +13 -0
  1071. package/dist/types/components/popover/popover.d.ts +32 -7
  1072. package/dist/types/components/popover/resources.d.ts +0 -1
  1073. package/dist/types/components/popover-manager/popover-manager.d.ts +7 -2
  1074. package/dist/types/components/radio-button/radio-button.d.ts +6 -0
  1075. package/dist/types/components/radio-group-item/radio-group-item.d.ts +2 -1
  1076. package/dist/types/components/rating/rating.d.ts +6 -2
  1077. package/dist/types/components/scrim/scrim.d.ts +3 -1
  1078. package/dist/types/components/shell-panel/shell-panel.d.ts +3 -0
  1079. package/dist/types/components/slider/slider.d.ts +24 -2
  1080. package/dist/types/components/split-button/split-button.d.ts +5 -2
  1081. package/dist/types/components/stepper/interfaces.d.ts +10 -0
  1082. package/dist/types/components/stepper/stepper.d.ts +20 -11
  1083. package/dist/types/components/stepper-item/stepper-item.d.ts +7 -8
  1084. package/dist/types/components/switch/switch.d.ts +3 -1
  1085. package/dist/types/components/tab/tab.d.ts +11 -8
  1086. package/dist/types/components/tab-nav/tab-nav.d.ts +34 -21
  1087. package/dist/types/components/tab-title/tab-title.d.ts +37 -28
  1088. package/dist/types/components/tabs/tabs.d.ts +7 -6
  1089. package/dist/types/components/tile/tile.d.ts +1 -0
  1090. package/dist/types/components/time-picker/time-picker.d.ts +45 -17
  1091. package/dist/types/components/tip-manager/tip-manager.d.ts +7 -1
  1092. package/dist/types/components/tooltip/TooltipManager.d.ts +28 -0
  1093. package/dist/types/components/tooltip/resources.d.ts +0 -1
  1094. package/dist/types/components/tooltip/tooltip.d.ts +15 -13
  1095. package/dist/types/components/tooltip-manager/tooltip-manager.d.ts +2 -29
  1096. package/dist/types/components/tree/tree.d.ts +14 -7
  1097. package/dist/types/components/tree-item/tree-item.d.ts +28 -14
  1098. package/dist/types/components/value-list/value-list.d.ts +20 -16
  1099. package/dist/types/components/value-list-item/value-list-item.d.ts +15 -12
  1100. package/dist/types/components.d.ts +606 -252
  1101. package/dist/types/preact.d.ts +63 -59
  1102. package/dist/types/utils/conditionalSlot.d.ts +4 -0
  1103. package/dist/types/utils/date.d.ts +35 -0
  1104. package/dist/types/utils/dom.d.ts +18 -2
  1105. package/dist/types/utils/form.d.ts +34 -5
  1106. package/dist/types/utils/globalAttributes.d.ts +5 -0
  1107. package/dist/types/utils/interactive.d.ts +7 -4
  1108. package/dist/types/utils/label.d.ts +7 -0
  1109. package/dist/types/utils/locale.d.ts +2 -1
  1110. package/dist/types/utils/popper.d.ts +6 -4
  1111. package/hydrate/index.d.ts +1 -1
  1112. package/hydrate/index.js +3805 -2797
  1113. package/package.json +49 -48
  1114. package/readme.md +4 -5
  1115. package/dist/calcite/p-07f1f162.system.entry.js +0 -5
  1116. package/dist/calcite/p-1263bcc0.entry.js +0 -5
  1117. package/dist/calcite/p-162604a0.entry.js +0 -5
  1118. package/dist/calcite/p-193749c1.entry.js +0 -5
  1119. package/dist/calcite/p-1aeca42a.system.entry.js +0 -5
  1120. package/dist/calcite/p-23145377.entry.js +0 -5
  1121. package/dist/calcite/p-28c333d0.entry.js +0 -5
  1122. package/dist/calcite/p-2bcaed33.entry.js +0 -5
  1123. package/dist/calcite/p-2dd22e8c.system.entry.js +0 -5
  1124. package/dist/calcite/p-2fae8516.system.entry.js +0 -5
  1125. package/dist/calcite/p-31c58f25.entry.js +0 -5
  1126. package/dist/calcite/p-32d6b962.entry.js +0 -5
  1127. package/dist/calcite/p-32efc4cd.system.entry.js +0 -5
  1128. package/dist/calcite/p-34730e94.entry.js +0 -5
  1129. package/dist/calcite/p-364db271.entry.js +0 -5
  1130. package/dist/calcite/p-364f0abe.system.entry.js +0 -5
  1131. package/dist/calcite/p-3915705c.entry.js +0 -5
  1132. package/dist/calcite/p-3e149640.system.entry.js +0 -5
  1133. package/dist/calcite/p-42227a04.entry.js +0 -5
  1134. package/dist/calcite/p-426f011a.entry.js +0 -5
  1135. package/dist/calcite/p-46071f17.entry.js +0 -5
  1136. package/dist/calcite/p-47d38839.entry.js +0 -5
  1137. package/dist/calcite/p-48637359.system.entry.js +0 -5
  1138. package/dist/calcite/p-4905189e.system.entry.js +0 -5
  1139. package/dist/calcite/p-496e907a.system.entry.js +0 -5
  1140. package/dist/calcite/p-4aecbaef.entry.js +0 -5
  1141. package/dist/calcite/p-4afb5a1b.system.entry.js +0 -5
  1142. package/dist/calcite/p-4eae61c5.entry.js +0 -5
  1143. package/dist/calcite/p-54c49493.entry.js +0 -5
  1144. package/dist/calcite/p-55e1a3a0.system.entry.js +0 -5
  1145. package/dist/calcite/p-569150ab.system.entry.js +0 -5
  1146. package/dist/calcite/p-588bfa74.system.js +0 -5
  1147. package/dist/calcite/p-5a8829cd.entry.js +0 -5
  1148. package/dist/calcite/p-5c637131.entry.js +0 -5
  1149. package/dist/calcite/p-5f6e35f3.entry.js +0 -5
  1150. package/dist/calcite/p-614d8925.js +0 -5
  1151. package/dist/calcite/p-6261469d.entry.js +0 -5
  1152. package/dist/calcite/p-653bd7bf.entry.js +0 -5
  1153. package/dist/calcite/p-69d2d9cf.system.entry.js +0 -5
  1154. package/dist/calcite/p-6ab3e489.entry.js +0 -5
  1155. package/dist/calcite/p-6b7b23d0.js +0 -5
  1156. package/dist/calcite/p-6c4a7041.system.entry.js +0 -5
  1157. package/dist/calcite/p-6e0103f5.system.entry.js +0 -5
  1158. package/dist/calcite/p-6ed27595.system.entry.js +0 -5
  1159. package/dist/calcite/p-6fba3e1b.system.entry.js +0 -5
  1160. package/dist/calcite/p-7247b667.system.entry.js +0 -5
  1161. package/dist/calcite/p-7260c869.system.entry.js +0 -5
  1162. package/dist/calcite/p-765c9bef.entry.js +0 -5
  1163. package/dist/calcite/p-7c88d545.js +0 -5
  1164. package/dist/calcite/p-824da4be.entry.js +0 -5
  1165. package/dist/calcite/p-867f7b7a.system.entry.js +0 -5
  1166. package/dist/calcite/p-872e82a6.system.entry.js +0 -5
  1167. package/dist/calcite/p-87888359.entry.js +0 -5
  1168. package/dist/calcite/p-895d22f3.entry.js +0 -5
  1169. package/dist/calcite/p-8b982f91.entry.js +0 -5
  1170. package/dist/calcite/p-8f3a3e4e.js +0 -5
  1171. package/dist/calcite/p-963e9aec.system.entry.js +0 -5
  1172. package/dist/calcite/p-9940b82a.system.entry.js +0 -5
  1173. package/dist/calcite/p-9ad8c7c5.system.entry.js +0 -5
  1174. package/dist/calcite/p-9c913e3a.entry.js +0 -5
  1175. package/dist/calcite/p-9e61d89d.entry.js +0 -5
  1176. package/dist/calcite/p-a9b3ef39.js +0 -5
  1177. package/dist/calcite/p-a9ea7f4f.entry.js +0 -5
  1178. package/dist/calcite/p-aaa21a84.system.entry.js +0 -5
  1179. package/dist/calcite/p-aad14a5d.system.entry.js +0 -5
  1180. package/dist/calcite/p-ac9607f2.system.js +0 -11
  1181. package/dist/calcite/p-afe59546.entry.js +0 -5
  1182. package/dist/calcite/p-b0827b8c.system.entry.js +0 -5
  1183. package/dist/calcite/p-b10af2b4.entry.js +0 -5
  1184. package/dist/calcite/p-b2b6f712.js +0 -5
  1185. package/dist/calcite/p-b3c5247b.system.entry.js +0 -5
  1186. package/dist/calcite/p-b47dc903.system.entry.js +0 -5
  1187. package/dist/calcite/p-b765d197.system.js +0 -5
  1188. package/dist/calcite/p-bb401f25.system.js +0 -5
  1189. package/dist/calcite/p-bccbf58a.entry.js +0 -5
  1190. package/dist/calcite/p-bdcb43b1.system.entry.js +0 -5
  1191. package/dist/calcite/p-bffb4da3.system.entry.js +0 -5
  1192. package/dist/calcite/p-c228a1da.system.entry.js +0 -5
  1193. package/dist/calcite/p-c2caeb2a.system.entry.js +0 -5
  1194. package/dist/calcite/p-c4cb35ba.system.entry.js +0 -5
  1195. package/dist/calcite/p-c5ec8d74.js +0 -11
  1196. package/dist/calcite/p-c9fc13b9.system.entry.js +0 -5
  1197. package/dist/calcite/p-cb847074.entry.js +0 -5
  1198. package/dist/calcite/p-cbc6fee6.entry.js +0 -5
  1199. package/dist/calcite/p-cd5f5c8f.js +0 -5
  1200. package/dist/calcite/p-cd9226a1.system.entry.js +0 -5
  1201. package/dist/calcite/p-daf5f04c.system.js +0 -5
  1202. package/dist/calcite/p-dcf33bb2.js +0 -5
  1203. package/dist/calcite/p-dd9f2e61.js +0 -5
  1204. package/dist/calcite/p-e22ab8fa.entry.js +0 -5
  1205. package/dist/calcite/p-e3280a36.system.entry.js +0 -5
  1206. package/dist/calcite/p-e43605c5.entry.js +0 -5
  1207. package/dist/calcite/p-e4d1651b.system.entry.js +0 -5
  1208. package/dist/calcite/p-e55c5bb4.entry.js +0 -5
  1209. package/dist/calcite/p-ea4119b1.system.entry.js +0 -5
  1210. package/dist/calcite/p-ec9bab33.system.js +0 -5
  1211. package/dist/calcite/p-ecc31b40.system.entry.js +0 -5
  1212. package/dist/calcite/p-edf1e815.system.entry.js +0 -5
  1213. package/dist/calcite/p-ee522afa.system.entry.js +0 -5
  1214. package/dist/calcite/p-ef6b4184.js +0 -5
  1215. package/dist/calcite/p-f09e27b0.system.js +0 -5
  1216. package/dist/calcite/p-fa922721.system.js +0 -5
  1217. package/dist/calcite/p-fe9380a0.system.js +0 -5
  1218. package/dist/components/resources4.js +0 -15
  1219. package/dist/components/resources5.js +0 -32
  1220. package/dist/components/tooltip-manager.js +0 -175
  1221. package/dist/esm-es5/dom-e7fa77b9.js +0 -5
  1222. package/dist/esm-es5/form-5e4609eb.js +0 -5
  1223. package/dist/esm-es5/label-68f22660.js +0 -5
  1224. package/dist/esm-es5/locale-fc850b7c.js +0 -5
  1225. package/dist/esm-es5/number-8779395f.js +0 -5
  1226. package/dist/esm-es5/resources-b5c3d9a7.js +0 -5
  1227. 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.83
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-82ee13f7.js');
11
+ const dom = require('./dom-b0904219.js');
12
+ const utils = require('./utils-f3a37c0a.js');
13
+ const math = require('./math-2f83830f.js');
14
+ const interactive = require('./interactive-15f9fd28.js');
15
+ const debounce = require('./debounce-5127bc67.js');
16
+ require('./guid-8af0f93c.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;
1221
1180
 
1222
- const c = Math.sqrt(a * a + b * b);
1223
- return [l, c, h];
1181
+ if (h < 0) {
1182
+ h += 360;
1183
+ }
1184
+
1185
+ const c = Math.sqrt(a * a + b * b);
1186
+
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
+ }
1248
+
1249
+ const ansi = 16
1250
+ + (36 * Math.round(r / 255 * 5))
1251
+ + (6 * Math.round(g / 255 * 5))
1252
+ + Math.round(b / 255 * 5);
1278
1253
 
1279
- const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
1280
- return ansi;
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;
1287
+
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;
1308
1292
 
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];
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
+ }
1370
1354
 
1371
- hue /= 6;
1372
- hue %= 1;
1373
- return [hue * 360, chroma * 100, grayscale * 100];
1355
+ hue /= 6;
1356
+ hue %= 1;
1357
+
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));
1385
1366
 
1386
- return [hsl[0], c * 100, f * 100];
1367
+ let f = 0;
1368
+ if (c < 1.0) {
1369
+ f = (l - 0.5 * c) / (1.0 - c);
1370
+ }
1371
+
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;
1450
+
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
+ }
1485
1457
 
1486
- return [hcg[0], s * 100, l * 100];
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];
1625
+ const wrappedFn = function (...args) {
1626
+ const arg0 = args[0];
1627
+ if (arg0 === undefined || arg0 === null) {
1628
+ return arg0;
1629
+ }
1653
1630
 
1654
- if (arg0 === undefined || arg0 === null) {
1655
- return arg0;
1656
- }
1631
+ if (arg0.length > 1) {
1632
+ args = arg0;
1633
+ }
1657
1634
 
1658
- if (arg0.length > 1) {
1659
- args = arg0;
1660
- }
1635
+ return fn(args);
1636
+ };
1661
1637
 
1662
- return fn(args);
1663
- }; // Preserve .conversion property if there is one
1638
+ // Preserve .conversion property if there is one
1639
+ if ('conversion' in fn) {
1640
+ wrappedFn.conversion = fn.conversion;
1641
+ }
1664
1642
 
1643
+ return wrappedFn;
1644
+ }
1665
1645
 
1666
- if ('conversion' in fn) {
1667
- wrappedFn.conversion = fn.conversion;
1668
- }
1646
+ function wrapRounded(fn) {
1647
+ const wrappedFn = function (...args) {
1648
+ const arg0 = args[0];
1649
+
1650
+ if (arg0 === undefined || arg0 === null) {
1651
+ return arg0;
1652
+ }
1653
+
1654
+ if (arg0.length > 1) {
1655
+ args = arg0;
1656
+ }
1657
+
1658
+ const result = fn(args);
1659
+
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
+ }
1668
+
1669
+ return result;
1670
+ };
1671
+
1672
+ // Preserve .conversion property if there is one
1673
+ if ('conversion' in fn) {
1674
+ wrappedFn.conversion = fn.conversion;
1675
+ }
1669
1676
 
1670
- return wrappedFn;
1677
+ return wrappedFn;
1671
1678
  }
1672
1679
 
1673
- function wrapRounded(fn) {
1674
- const wrappedFn = function (...args) {
1675
- const arg0 = args[0];
1676
-
1677
- if (arg0 === undefined || arg0 === null) {
1678
- return arg0;
1679
- }
1680
+ models.forEach(fromModel => {
1681
+ convert[fromModel] = {};
1680
1682
 
1681
- if (arg0.length > 1) {
1682
- args = arg0;
1683
- }
1683
+ Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});
1684
+ Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});
1684
1685
 
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.
1686
+ const routes = route(fromModel);
1687
+ const routeModels = Object.keys(routes);
1688
1688
 
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
- }
1689
+ routeModels.forEach(toModel => {
1690
+ const fn = routes[toModel];
1694
1691
 
1695
- return result;
1696
- }; // Preserve .conversion property if there is one
1692
+ convert[fromModel][toModel] = wrapRounded(fn);
1693
+ convert[fromModel][toModel].raw = wrapRaw(fn);
1694
+ });
1695
+ });
1697
1696
 
1697
+ var colorConvert = convert;
1698
1698
 
1699
- if ('conversion' in fn) {
1700
- wrappedFn.conversion = fn.conversion;
1701
- }
1699
+ const skippedModels = [
1700
+ // To be honest, I don't really feel like keyword belongs in color convert, but eh.
1701
+ 'keyword',
1702
1702
 
1703
- return wrappedFn;
1704
- }
1703
+ // Gray conflicts with some method names, and has its own method defined.
1704
+ 'gray',
1705
1705
 
1706
- 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
- });
1721
- });
1722
- var colorConvert = convert;
1706
+ // Shouldn't really be in color-convert either...
1707
+ 'hex',
1708
+ ];
1723
1709
 
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
1710
  const hashedModelKeys = {};
1730
-
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-color:transparent;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;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());
@@ -2336,6 +2328,7 @@ const ColorPicker = class {
2336
2328
  * The format of the value property.
2337
2329
  *
2338
2330
  * When "auto", the format will be inferred from `value` when set.
2331
+ *
2339
2332
  * @default "auto"
2340
2333
  */
2341
2334
  this.format = defaultFormat;
@@ -2345,80 +2338,117 @@ const ColorPicker = class {
2345
2338
  this.hideChannels = false;
2346
2339
  /** When true, hides the saved colors section */
2347
2340
  this.hideSaved = false;
2348
- /** Label used for the blue channel
2341
+ /**
2342
+ * Label used for the blue channel
2343
+ *
2349
2344
  * @default "B"
2350
2345
  */
2351
2346
  this.intlB = TEXT.b;
2352
- /** Label used for the blue channel description
2347
+ /**
2348
+ * Label used for the blue channel description
2349
+ *
2353
2350
  * @default "Blue"
2354
2351
  */
2355
2352
  this.intlBlue = TEXT.blue;
2356
- /** Label used for the delete color button.
2353
+ /**
2354
+ * Label used for the delete color button.
2355
+ *
2357
2356
  * @default "Delete color"
2358
2357
  */
2359
2358
  this.intlDeleteColor = TEXT.deleteColor;
2360
- /** Label used for the green channel
2359
+ /**
2360
+ * Label used for the green channel
2361
+ *
2361
2362
  * @default "G"
2362
2363
  */
2363
2364
  this.intlG = TEXT.g;
2364
- /** Label used for the green channel description
2365
+ /**
2366
+ * Label used for the green channel description
2367
+ *
2365
2368
  * @default "Green"
2366
2369
  */
2367
2370
  this.intlGreen = TEXT.green;
2368
- /** Label used for the hue channel
2371
+ /**
2372
+ * Label used for the hue channel
2373
+ *
2369
2374
  * @default "H"
2370
2375
  */
2371
2376
  this.intlH = TEXT.h;
2372
- /** Label used for the HSV mode
2377
+ /**
2378
+ * Label used for the HSV mode
2379
+ *
2373
2380
  * @default "HSV"
2374
2381
  */
2375
2382
  this.intlHsv = TEXT.hsv;
2376
- /** Label used for the hex input
2383
+ /**
2384
+ * Label used for the hex input
2385
+ *
2377
2386
  * @default "Hex"
2378
2387
  */
2379
2388
  this.intlHex = TEXT.hex;
2380
- /** Label used for the hue channel description
2389
+ /**
2390
+ * Label used for the hue channel description
2391
+ *
2381
2392
  * @default "Hue"
2382
2393
  */
2383
2394
  this.intlHue = TEXT.hue;
2384
2395
  /**
2385
2396
  * Label used for the hex input when there is no color selected.
2397
+ *
2386
2398
  * @default "No color"
2387
2399
  */
2388
2400
  this.intlNoColor = TEXT.noColor;
2389
- /** Label used for the red channel
2401
+ /**
2402
+ * Label used for the red channel
2403
+ *
2390
2404
  * @default "R"
2391
2405
  */
2392
2406
  this.intlR = TEXT.r;
2393
- /** Label used for the red channel description
2407
+ /**
2408
+ * Label used for the red channel description
2409
+ *
2394
2410
  * @default "Red"
2395
2411
  */
2396
2412
  this.intlRed = TEXT.red;
2397
- /** Label used for the RGB mode
2413
+ /**
2414
+ * Label used for the RGB mode
2415
+ *
2398
2416
  * @default "RGB"
2399
2417
  */
2400
2418
  this.intlRgb = TEXT.rgb;
2401
- /** Label used for the saturation channel
2419
+ /**
2420
+ * Label used for the saturation channel
2421
+ *
2402
2422
  * @default "S"
2403
2423
  */
2404
2424
  this.intlS = TEXT.s;
2405
- /** Label used for the saturation channel description
2425
+ /**
2426
+ * Label used for the saturation channel description
2427
+ *
2406
2428
  * @default "Saturation"
2407
2429
  */
2408
2430
  this.intlSaturation = TEXT.saturation;
2409
- /** Label used for the save color button.
2431
+ /**
2432
+ * Label used for the save color button.
2433
+ *
2410
2434
  * @default "Save color"
2411
2435
  */
2412
2436
  this.intlSaveColor = TEXT.saveColor;
2413
- /** Label used for the saved colors section
2437
+ /**
2438
+ * Label used for the saved colors section
2439
+ *
2414
2440
  * @default "Saved"
2415
2441
  */
2416
2442
  this.intlSaved = TEXT.saved;
2417
- /** Label used for the value channel
2443
+ /**
2444
+ * Label used for the value channel
2445
+ *
2418
2446
  * @default "V"
2419
2447
  */
2420
2448
  this.intlV = TEXT.v;
2421
- /** Label used for the
2449
+ /**
2450
+ * Label used for the
2451
+ *
2422
2452
  * @default "Value"
2423
2453
  */
2424
2454
  this.intlValue = TEXT.value;
@@ -2433,6 +2463,7 @@ const ColorPicker = class {
2433
2463
  * a RGB, HSL or HSV object.
2434
2464
  *
2435
2465
  * The type will be preserved as the color is updated.
2466
+ *
2436
2467
  * @default "#007ac2"
2437
2468
  * @see [ColorValue](https://github.com/Esri/calcite-components/blob/master/src/components/color-picker/interfaces.ts#L10)
2438
2469
  */
@@ -2696,9 +2727,12 @@ const ColorPicker = class {
2696
2727
  const channelAriaLabels = isRgb
2697
2728
  ? [intlRed, intlGreen, intlBlue]
2698
2729
  : [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])))));
2730
+ const direction = dom.getElementDir(this.el);
2731
+ 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) =>
2732
+ /* the channel container is ltr, so we apply the host's direction */
2733
+ this.renderChannel(channel, index, channelLabels[index], channelAriaLabels[index], direction)))));
2700
2734
  };
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() }));
2735
+ 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
2736
  this.deleteColor = () => {
2703
2737
  const colorToDelete = this.color.hex();
2704
2738
  const inStorage = this.savedColors.indexOf(colorToDelete) > -1;
@@ -2753,14 +2787,10 @@ const ColorPicker = class {
2753
2787
  this.drawColorFieldAndSlider();
2754
2788
  this.updateChannelsFromColor(color);
2755
2789
  this.previousColor = oldColor;
2756
- if (this.internalColorUpdateContext) {
2757
- return;
2758
- }
2759
- this.value = this.toValue(color);
2760
2790
  }
2761
2791
  handleFormatChange(format) {
2762
2792
  this.setMode(format);
2763
- this.value = this.toValue(this.color);
2793
+ this.internalColorSet(this.color, false, "internal");
2764
2794
  }
2765
2795
  handleScaleChange(scale = "m") {
2766
2796
  this.updateDimensions(scale);
@@ -2780,10 +2810,10 @@ const ColorPicker = class {
2780
2810
  this.setMode(nextMode);
2781
2811
  }
2782
2812
  const dragging = this.sliderThumbState === "drag" || this.hueThumbState === "drag";
2783
- if (this.internalColorUpdateContext) {
2784
- if (this.internalColorUpdateContext === "initial") {
2785
- return;
2786
- }
2813
+ if (this.internalColorUpdateContext === "initial") {
2814
+ return;
2815
+ }
2816
+ if (this.internalColorUpdateContext === "user-interaction") {
2787
2817
  this.calciteColorPickerInput.emit();
2788
2818
  if (!dragging) {
2789
2819
  this.calciteColorPickerChange.emit();
@@ -2793,11 +2823,7 @@ const ColorPicker = class {
2793
2823
  const color$1 = allowEmpty && !value ? null : color(value);
2794
2824
  const colorChanged = !utils.colorEqual(color$1, this.color);
2795
2825
  if (modeChanged || colorChanged) {
2796
- this.color = color$1;
2797
- this.calciteColorPickerInput.emit();
2798
- if (!dragging) {
2799
- this.calciteColorPickerChange.emit();
2800
- }
2826
+ this.internalColorSet(color$1, true, "internal");
2801
2827
  }
2802
2828
  }
2803
2829
  //--------------------------------------------------------------------------
@@ -2905,6 +2931,11 @@ const ColorPicker = class {
2905
2931
  // Private Methods
2906
2932
  //
2907
2933
  //--------------------------------------------------------------------------
2934
+ handleKeyDown(event) {
2935
+ if (event.key === "Enter") {
2936
+ event.preventDefault();
2937
+ }
2938
+ }
2908
2939
  showIncompatibleColorWarning(value, format) {
2909
2940
  console.warn(`ignoring color value (${value}) as it is not compatible with the current format (${format})`);
2910
2941
  }
@@ -2926,7 +2957,7 @@ const ColorPicker = class {
2926
2957
  }
2927
2958
  return "none";
2928
2959
  }
2929
- internalColorSet(color, skipEqual = true, context = "internal") {
2960
+ internalColorSet(color, skipEqual = true, context = "user-interaction") {
2930
2961
  if (skipEqual && utils.colorEqual(color, this.color)) {
2931
2962
  return;
2932
2963
  }
@@ -3101,11 +3132,13 @@ const ColorPickerHexInput = class {
3101
3132
  this.allowEmpty = false;
3102
3133
  /**
3103
3134
  * Label used for the hex input.
3135
+ *
3104
3136
  * @default "Hex"
3105
3137
  */
3106
3138
  this.intlHex = TEXT.hex;
3107
3139
  /**
3108
3140
  * Label used for the hex input when there is no color selected.
3141
+ *
3109
3142
  * @default "No color"
3110
3143
  */
3111
3144
  this.intlNoColor = TEXT.noColor;
@@ -3117,7 +3150,7 @@ const ColorPickerHexInput = class {
3117
3150
  * The hex value.
3118
3151
  */
3119
3152
  this.value = utils.normalizeHex(DEFAULT_COLOR.hex());
3120
- this.onCalciteInputBlur = () => {
3153
+ this.onCalciteInternalInputBlur = () => {
3121
3154
  const node = this.inputNode;
3122
3155
  const inputValue = node.value;
3123
3156
  const hex = `#${inputValue}`;
@@ -3132,32 +3165,13 @@ const ColorPickerHexInput = class {
3132
3165
  : this.formatForInternalInput(utils.rgbToHex(this.internalColor.object()));
3133
3166
  };
3134
3167
  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();
3168
+ this.internalSetValue(this.inputNode.value, this.value);
3150
3169
  };
3151
3170
  /**
3152
3171
  * The last valid/selected color. Used as a fallback if an invalid hex code is entered.
3153
3172
  */
3154
3173
  this.internalColor = DEFAULT_COLOR;
3155
3174
  this.previousNonNullValue = this.value;
3156
- //--------------------------------------------------------------------------
3157
- //
3158
- // Private Methods
3159
- //
3160
- //--------------------------------------------------------------------------
3161
3175
  this.storeInputRef = (node) => {
3162
3176
  this.inputNode = node;
3163
3177
  };
@@ -3172,38 +3186,16 @@ const ColorPickerHexInput = class {
3172
3186
  if (value) {
3173
3187
  const normalized = utils.normalizeHex(value);
3174
3188
  if (utils.isValidHex(normalized)) {
3175
- this.internalColor = color(normalized);
3176
- this.value = normalized;
3189
+ this.internalSetValue(normalized, normalized, false);
3177
3190
  }
3178
3191
  return;
3179
3192
  }
3180
3193
  if (allowEmpty) {
3181
- this.internalColor = null;
3182
- this.value = null;
3194
+ this.internalSetValue(null, null, false);
3183
3195
  }
3184
3196
  }
3185
3197
  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;
3198
+ this.internalSetValue(value, oldValue, false);
3207
3199
  }
3208
3200
  // using @Listen as a workaround for VDOM listener not firing
3209
3201
  onInputKeyDown(event) {
@@ -3215,15 +3207,16 @@ const ColorPickerHexInput = class {
3215
3207
  return;
3216
3208
  }
3217
3209
  const isNudgeKey = key === "ArrowDown" || key === "ArrowUp";
3210
+ const oldValue = this.value;
3218
3211
  if (isNudgeKey) {
3219
3212
  if (!value) {
3220
- this.value = this.previousNonNullValue;
3213
+ this.internalSetValue(this.previousNonNullValue, oldValue);
3221
3214
  event.preventDefault();
3222
3215
  return;
3223
3216
  }
3224
3217
  const direction = key === "ArrowUp" ? 1 : -1;
3225
3218
  const bump = shiftKey ? 10 : 1;
3226
- this.value = utils.normalizeHex(this.nudgeRGBChannels(internalColor, bump * direction).hex());
3219
+ this.internalSetValue(utils.normalizeHex(this.nudgeRGBChannels(internalColor, bump * direction).hex()), oldValue);
3227
3220
  event.preventDefault();
3228
3221
  return;
3229
3222
  }
@@ -3242,7 +3235,7 @@ const ColorPickerHexInput = class {
3242
3235
  render() {
3243
3236
  const { intlHex, value } = this;
3244
3237
  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));
3238
+ return (index.h("div", { class: CSS$1.container }, index.h("calcite-input", { class: CSS$1.input, label: intlHex, maxLength: 6, onCalciteInputChange: this.onInputChange, onCalciteInternalInputBlur: this.onCalciteInternalInputBlur, 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
3239
  }
3247
3240
  //--------------------------------------------------------------------------
3248
3241
  //
@@ -3253,12 +3246,47 @@ const ColorPickerHexInput = class {
3253
3246
  async setFocus() {
3254
3247
  dom.focusElement(this.inputNode);
3255
3248
  }
3249
+ //--------------------------------------------------------------------------
3250
+ //
3251
+ // Private Methods
3252
+ //
3253
+ //--------------------------------------------------------------------------
3254
+ internalSetValue(value, oldValue, emit = true) {
3255
+ if (value) {
3256
+ const normalized = utils.normalizeHex(value);
3257
+ if (utils.isValidHex(normalized)) {
3258
+ const { internalColor } = this;
3259
+ const changed = !internalColor || normalized !== utils.normalizeHex(internalColor.hex());
3260
+ this.internalColor = color(normalized);
3261
+ this.previousNonNullValue = normalized;
3262
+ this.value = normalized;
3263
+ if (changed && emit) {
3264
+ this.calciteColorPickerHexInputChange.emit();
3265
+ }
3266
+ return;
3267
+ }
3268
+ }
3269
+ else if (this.allowEmpty) {
3270
+ this.internalColor = null;
3271
+ this.value = null;
3272
+ if (emit) {
3273
+ this.calciteColorPickerHexInputChange.emit();
3274
+ }
3275
+ return;
3276
+ }
3277
+ this.value = oldValue;
3278
+ }
3256
3279
  formatForInternalInput(hex) {
3257
3280
  return hex ? hex.replace("#", "") : "";
3258
3281
  }
3259
3282
  nudgeRGBChannels(color$1, amount) {
3260
3283
  return color.rgb(color$1.array().map((channel) => channel + amount));
3261
3284
  }
3285
+ handleKeyDown(event) {
3286
+ if (event.key === "Enter") {
3287
+ event.preventDefault();
3288
+ }
3289
+ }
3262
3290
  get el() { return index.getElement(this); }
3263
3291
  static get watchers() { return {
3264
3292
  "value": ["handleValueChange"]