@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,14 +1,15 @@
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
- import { r as registerInstance, c as createEvent, h, g as getElement } from './index-bd94948c.js';
6
- import { f as focusElement, b as getThemeName } from './dom-e7fa77b9.js';
7
- import { n as normalizeHex, C as CSSColorMode, p as parseMode, c as colorEqual, i as isValidHex, a as isLonghandHex, r as rgbToHex, h as hexToRGB, b as hexChar } from './utils-e84055a3.js';
8
- import { c as clamp } from './math-456207f5.js';
9
- import { u as updateHostInteraction } from './interactive-48b5cc0f.js';
10
- import { d as debounce, i as isObject } from './debounce-79648d42.js';
11
- import './guid-196bd5ea.js';
6
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index-1e02e91b.js';
7
+ import { a as getElementDir, f as focusElement, b as getThemeName } from './dom-4caa79e4.js';
8
+ import { n as normalizeHex, C as CSSColorMode, p as parseMode, c as colorEqual, i as isValidHex, a as isLonghandHex, r as rgbToHex, b as hexChar } from './utils-2f763d44.js';
9
+ import { c as clamp } from './math-351ff0de.js';
10
+ import { u as updateHostInteraction } from './interactive-32803ed8.js';
11
+ import { d as debounce, i as isObject } from './debounce-9626aac0.js';
12
+ import './guid-27925469.js';
12
13
 
13
14
  /** Error message constants. */
14
15
  var FUNC_ERROR_TEXT = 'Expected a function';
@@ -526,1023 +527,995 @@ function hexDouble(num) {
526
527
  }
527
528
  });
528
529
 
529
- var colorName = {
530
- "aliceblue": [240, 248, 255],
531
- "antiquewhite": [250, 235, 215],
532
- "aqua": [0, 255, 255],
533
- "aquamarine": [127, 255, 212],
534
- "azure": [240, 255, 255],
535
- "beige": [245, 245, 220],
536
- "bisque": [255, 228, 196],
537
- "black": [0, 0, 0],
538
- "blanchedalmond": [255, 235, 205],
539
- "blue": [0, 0, 255],
540
- "blueviolet": [138, 43, 226],
541
- "brown": [165, 42, 42],
542
- "burlywood": [222, 184, 135],
543
- "cadetblue": [95, 158, 160],
544
- "chartreuse": [127, 255, 0],
545
- "chocolate": [210, 105, 30],
546
- "coral": [255, 127, 80],
547
- "cornflowerblue": [100, 149, 237],
548
- "cornsilk": [255, 248, 220],
549
- "crimson": [220, 20, 60],
550
- "cyan": [0, 255, 255],
551
- "darkblue": [0, 0, 139],
552
- "darkcyan": [0, 139, 139],
553
- "darkgoldenrod": [184, 134, 11],
554
- "darkgray": [169, 169, 169],
555
- "darkgreen": [0, 100, 0],
556
- "darkgrey": [169, 169, 169],
557
- "darkkhaki": [189, 183, 107],
558
- "darkmagenta": [139, 0, 139],
559
- "darkolivegreen": [85, 107, 47],
560
- "darkorange": [255, 140, 0],
561
- "darkorchid": [153, 50, 204],
562
- "darkred": [139, 0, 0],
563
- "darksalmon": [233, 150, 122],
564
- "darkseagreen": [143, 188, 143],
565
- "darkslateblue": [72, 61, 139],
566
- "darkslategray": [47, 79, 79],
567
- "darkslategrey": [47, 79, 79],
568
- "darkturquoise": [0, 206, 209],
569
- "darkviolet": [148, 0, 211],
570
- "deeppink": [255, 20, 147],
571
- "deepskyblue": [0, 191, 255],
572
- "dimgray": [105, 105, 105],
573
- "dimgrey": [105, 105, 105],
574
- "dodgerblue": [30, 144, 255],
575
- "firebrick": [178, 34, 34],
576
- "floralwhite": [255, 250, 240],
577
- "forestgreen": [34, 139, 34],
578
- "fuchsia": [255, 0, 255],
579
- "gainsboro": [220, 220, 220],
580
- "ghostwhite": [248, 248, 255],
581
- "gold": [255, 215, 0],
582
- "goldenrod": [218, 165, 32],
583
- "gray": [128, 128, 128],
584
- "green": [0, 128, 0],
585
- "greenyellow": [173, 255, 47],
586
- "grey": [128, 128, 128],
587
- "honeydew": [240, 255, 240],
588
- "hotpink": [255, 105, 180],
589
- "indianred": [205, 92, 92],
590
- "indigo": [75, 0, 130],
591
- "ivory": [255, 255, 240],
592
- "khaki": [240, 230, 140],
593
- "lavender": [230, 230, 250],
594
- "lavenderblush": [255, 240, 245],
595
- "lawngreen": [124, 252, 0],
596
- "lemonchiffon": [255, 250, 205],
597
- "lightblue": [173, 216, 230],
598
- "lightcoral": [240, 128, 128],
599
- "lightcyan": [224, 255, 255],
600
- "lightgoldenrodyellow": [250, 250, 210],
601
- "lightgray": [211, 211, 211],
602
- "lightgreen": [144, 238, 144],
603
- "lightgrey": [211, 211, 211],
604
- "lightpink": [255, 182, 193],
605
- "lightsalmon": [255, 160, 122],
606
- "lightseagreen": [32, 178, 170],
607
- "lightskyblue": [135, 206, 250],
608
- "lightslategray": [119, 136, 153],
609
- "lightslategrey": [119, 136, 153],
610
- "lightsteelblue": [176, 196, 222],
611
- "lightyellow": [255, 255, 224],
612
- "lime": [0, 255, 0],
613
- "limegreen": [50, 205, 50],
614
- "linen": [250, 240, 230],
615
- "magenta": [255, 0, 255],
616
- "maroon": [128, 0, 0],
617
- "mediumaquamarine": [102, 205, 170],
618
- "mediumblue": [0, 0, 205],
619
- "mediumorchid": [186, 85, 211],
620
- "mediumpurple": [147, 112, 219],
621
- "mediumseagreen": [60, 179, 113],
622
- "mediumslateblue": [123, 104, 238],
623
- "mediumspringgreen": [0, 250, 154],
624
- "mediumturquoise": [72, 209, 204],
625
- "mediumvioletred": [199, 21, 133],
626
- "midnightblue": [25, 25, 112],
627
- "mintcream": [245, 255, 250],
628
- "mistyrose": [255, 228, 225],
629
- "moccasin": [255, 228, 181],
630
- "navajowhite": [255, 222, 173],
631
- "navy": [0, 0, 128],
632
- "oldlace": [253, 245, 230],
633
- "olive": [128, 128, 0],
634
- "olivedrab": [107, 142, 35],
635
- "orange": [255, 165, 0],
636
- "orangered": [255, 69, 0],
637
- "orchid": [218, 112, 214],
638
- "palegoldenrod": [238, 232, 170],
639
- "palegreen": [152, 251, 152],
640
- "paleturquoise": [175, 238, 238],
641
- "palevioletred": [219, 112, 147],
642
- "papayawhip": [255, 239, 213],
643
- "peachpuff": [255, 218, 185],
644
- "peru": [205, 133, 63],
645
- "pink": [255, 192, 203],
646
- "plum": [221, 160, 221],
647
- "powderblue": [176, 224, 230],
648
- "purple": [128, 0, 128],
649
- "rebeccapurple": [102, 51, 153],
650
- "red": [255, 0, 0],
651
- "rosybrown": [188, 143, 143],
652
- "royalblue": [65, 105, 225],
653
- "saddlebrown": [139, 69, 19],
654
- "salmon": [250, 128, 114],
655
- "sandybrown": [244, 164, 96],
656
- "seagreen": [46, 139, 87],
657
- "seashell": [255, 245, 238],
658
- "sienna": [160, 82, 45],
659
- "silver": [192, 192, 192],
660
- "skyblue": [135, 206, 235],
661
- "slateblue": [106, 90, 205],
662
- "slategray": [112, 128, 144],
663
- "slategrey": [112, 128, 144],
664
- "snow": [255, 250, 250],
665
- "springgreen": [0, 255, 127],
666
- "steelblue": [70, 130, 180],
667
- "tan": [210, 180, 140],
668
- "teal": [0, 128, 128],
669
- "thistle": [216, 191, 216],
670
- "tomato": [255, 99, 71],
671
- "turquoise": [64, 224, 208],
672
- "violet": [238, 130, 238],
673
- "wheat": [245, 222, 179],
674
- "white": [255, 255, 255],
675
- "whitesmoke": [245, 245, 245],
676
- "yellow": [255, 255, 0],
677
- "yellowgreen": [154, 205, 50]
530
+ var colorName = {
531
+ "aliceblue": [240, 248, 255],
532
+ "antiquewhite": [250, 235, 215],
533
+ "aqua": [0, 255, 255],
534
+ "aquamarine": [127, 255, 212],
535
+ "azure": [240, 255, 255],
536
+ "beige": [245, 245, 220],
537
+ "bisque": [255, 228, 196],
538
+ "black": [0, 0, 0],
539
+ "blanchedalmond": [255, 235, 205],
540
+ "blue": [0, 0, 255],
541
+ "blueviolet": [138, 43, 226],
542
+ "brown": [165, 42, 42],
543
+ "burlywood": [222, 184, 135],
544
+ "cadetblue": [95, 158, 160],
545
+ "chartreuse": [127, 255, 0],
546
+ "chocolate": [210, 105, 30],
547
+ "coral": [255, 127, 80],
548
+ "cornflowerblue": [100, 149, 237],
549
+ "cornsilk": [255, 248, 220],
550
+ "crimson": [220, 20, 60],
551
+ "cyan": [0, 255, 255],
552
+ "darkblue": [0, 0, 139],
553
+ "darkcyan": [0, 139, 139],
554
+ "darkgoldenrod": [184, 134, 11],
555
+ "darkgray": [169, 169, 169],
556
+ "darkgreen": [0, 100, 0],
557
+ "darkgrey": [169, 169, 169],
558
+ "darkkhaki": [189, 183, 107],
559
+ "darkmagenta": [139, 0, 139],
560
+ "darkolivegreen": [85, 107, 47],
561
+ "darkorange": [255, 140, 0],
562
+ "darkorchid": [153, 50, 204],
563
+ "darkred": [139, 0, 0],
564
+ "darksalmon": [233, 150, 122],
565
+ "darkseagreen": [143, 188, 143],
566
+ "darkslateblue": [72, 61, 139],
567
+ "darkslategray": [47, 79, 79],
568
+ "darkslategrey": [47, 79, 79],
569
+ "darkturquoise": [0, 206, 209],
570
+ "darkviolet": [148, 0, 211],
571
+ "deeppink": [255, 20, 147],
572
+ "deepskyblue": [0, 191, 255],
573
+ "dimgray": [105, 105, 105],
574
+ "dimgrey": [105, 105, 105],
575
+ "dodgerblue": [30, 144, 255],
576
+ "firebrick": [178, 34, 34],
577
+ "floralwhite": [255, 250, 240],
578
+ "forestgreen": [34, 139, 34],
579
+ "fuchsia": [255, 0, 255],
580
+ "gainsboro": [220, 220, 220],
581
+ "ghostwhite": [248, 248, 255],
582
+ "gold": [255, 215, 0],
583
+ "goldenrod": [218, 165, 32],
584
+ "gray": [128, 128, 128],
585
+ "green": [0, 128, 0],
586
+ "greenyellow": [173, 255, 47],
587
+ "grey": [128, 128, 128],
588
+ "honeydew": [240, 255, 240],
589
+ "hotpink": [255, 105, 180],
590
+ "indianred": [205, 92, 92],
591
+ "indigo": [75, 0, 130],
592
+ "ivory": [255, 255, 240],
593
+ "khaki": [240, 230, 140],
594
+ "lavender": [230, 230, 250],
595
+ "lavenderblush": [255, 240, 245],
596
+ "lawngreen": [124, 252, 0],
597
+ "lemonchiffon": [255, 250, 205],
598
+ "lightblue": [173, 216, 230],
599
+ "lightcoral": [240, 128, 128],
600
+ "lightcyan": [224, 255, 255],
601
+ "lightgoldenrodyellow": [250, 250, 210],
602
+ "lightgray": [211, 211, 211],
603
+ "lightgreen": [144, 238, 144],
604
+ "lightgrey": [211, 211, 211],
605
+ "lightpink": [255, 182, 193],
606
+ "lightsalmon": [255, 160, 122],
607
+ "lightseagreen": [32, 178, 170],
608
+ "lightskyblue": [135, 206, 250],
609
+ "lightslategray": [119, 136, 153],
610
+ "lightslategrey": [119, 136, 153],
611
+ "lightsteelblue": [176, 196, 222],
612
+ "lightyellow": [255, 255, 224],
613
+ "lime": [0, 255, 0],
614
+ "limegreen": [50, 205, 50],
615
+ "linen": [250, 240, 230],
616
+ "magenta": [255, 0, 255],
617
+ "maroon": [128, 0, 0],
618
+ "mediumaquamarine": [102, 205, 170],
619
+ "mediumblue": [0, 0, 205],
620
+ "mediumorchid": [186, 85, 211],
621
+ "mediumpurple": [147, 112, 219],
622
+ "mediumseagreen": [60, 179, 113],
623
+ "mediumslateblue": [123, 104, 238],
624
+ "mediumspringgreen": [0, 250, 154],
625
+ "mediumturquoise": [72, 209, 204],
626
+ "mediumvioletred": [199, 21, 133],
627
+ "midnightblue": [25, 25, 112],
628
+ "mintcream": [245, 255, 250],
629
+ "mistyrose": [255, 228, 225],
630
+ "moccasin": [255, 228, 181],
631
+ "navajowhite": [255, 222, 173],
632
+ "navy": [0, 0, 128],
633
+ "oldlace": [253, 245, 230],
634
+ "olive": [128, 128, 0],
635
+ "olivedrab": [107, 142, 35],
636
+ "orange": [255, 165, 0],
637
+ "orangered": [255, 69, 0],
638
+ "orchid": [218, 112, 214],
639
+ "palegoldenrod": [238, 232, 170],
640
+ "palegreen": [152, 251, 152],
641
+ "paleturquoise": [175, 238, 238],
642
+ "palevioletred": [219, 112, 147],
643
+ "papayawhip": [255, 239, 213],
644
+ "peachpuff": [255, 218, 185],
645
+ "peru": [205, 133, 63],
646
+ "pink": [255, 192, 203],
647
+ "plum": [221, 160, 221],
648
+ "powderblue": [176, 224, 230],
649
+ "purple": [128, 0, 128],
650
+ "rebeccapurple": [102, 51, 153],
651
+ "red": [255, 0, 0],
652
+ "rosybrown": [188, 143, 143],
653
+ "royalblue": [65, 105, 225],
654
+ "saddlebrown": [139, 69, 19],
655
+ "salmon": [250, 128, 114],
656
+ "sandybrown": [244, 164, 96],
657
+ "seagreen": [46, 139, 87],
658
+ "seashell": [255, 245, 238],
659
+ "sienna": [160, 82, 45],
660
+ "silver": [192, 192, 192],
661
+ "skyblue": [135, 206, 235],
662
+ "slateblue": [106, 90, 205],
663
+ "slategray": [112, 128, 144],
664
+ "slategrey": [112, 128, 144],
665
+ "snow": [255, 250, 250],
666
+ "springgreen": [0, 255, 127],
667
+ "steelblue": [70, 130, 180],
668
+ "tan": [210, 180, 140],
669
+ "teal": [0, 128, 128],
670
+ "thistle": [216, 191, 216],
671
+ "tomato": [255, 99, 71],
672
+ "turquoise": [64, 224, 208],
673
+ "violet": [238, 130, 238],
674
+ "wheat": [245, 222, 179],
675
+ "white": [255, 255, 255],
676
+ "whitesmoke": [245, 245, 245],
677
+ "yellow": [255, 255, 0],
678
+ "yellowgreen": [154, 205, 50]
678
679
  };
679
680
 
680
681
  /* MIT license */
681
-
682
682
  /* eslint-disable no-mixed-operators */
683
+
684
+
683
685
  // NOTE: conversions should only return primitive values (i.e. arrays, or
684
686
  // values that give correct `typeof` results).
685
687
  // do not use box values types (i.e. Number(), String(), etc.)
686
688
 
687
689
  const reverseKeywords = {};
688
-
689
690
  for (const key of Object.keys(colorName)) {
690
- reverseKeywords[colorName[key]] = key;
691
+ reverseKeywords[colorName[key]] = key;
691
692
  }
692
693
 
693
694
  const convert$1 = {
694
- rgb: {
695
- channels: 3,
696
- labels: 'rgb'
697
- },
698
- hsl: {
699
- channels: 3,
700
- labels: 'hsl'
701
- },
702
- hsv: {
703
- channels: 3,
704
- labels: 'hsv'
705
- },
706
- hwb: {
707
- channels: 3,
708
- labels: 'hwb'
709
- },
710
- cmyk: {
711
- channels: 4,
712
- labels: 'cmyk'
713
- },
714
- xyz: {
715
- channels: 3,
716
- labels: 'xyz'
717
- },
718
- lab: {
719
- channels: 3,
720
- labels: 'lab'
721
- },
722
- lch: {
723
- channels: 3,
724
- labels: 'lch'
725
- },
726
- hex: {
727
- channels: 1,
728
- labels: ['hex']
729
- },
730
- keyword: {
731
- channels: 1,
732
- labels: ['keyword']
733
- },
734
- ansi16: {
735
- channels: 1,
736
- labels: ['ansi16']
737
- },
738
- ansi256: {
739
- channels: 1,
740
- labels: ['ansi256']
741
- },
742
- hcg: {
743
- channels: 3,
744
- labels: ['h', 'c', 'g']
745
- },
746
- apple: {
747
- channels: 3,
748
- labels: ['r16', 'g16', 'b16']
749
- },
750
- gray: {
751
- channels: 1,
752
- labels: ['gray']
753
- }
754
- };
755
- var conversions = convert$1; // Hide .channels and .labels properties
756
-
695
+ rgb: {channels: 3, labels: 'rgb'},
696
+ hsl: {channels: 3, labels: 'hsl'},
697
+ hsv: {channels: 3, labels: 'hsv'},
698
+ hwb: {channels: 3, labels: 'hwb'},
699
+ cmyk: {channels: 4, labels: 'cmyk'},
700
+ xyz: {channels: 3, labels: 'xyz'},
701
+ lab: {channels: 3, labels: 'lab'},
702
+ lch: {channels: 3, labels: 'lch'},
703
+ hex: {channels: 1, labels: ['hex']},
704
+ keyword: {channels: 1, labels: ['keyword']},
705
+ ansi16: {channels: 1, labels: ['ansi16']},
706
+ ansi256: {channels: 1, labels: ['ansi256']},
707
+ hcg: {channels: 3, labels: ['h', 'c', 'g']},
708
+ apple: {channels: 3, labels: ['r16', 'g16', 'b16']},
709
+ gray: {channels: 1, labels: ['gray']}
710
+ };
711
+
712
+ var conversions = convert$1;
713
+
714
+ // Hide .channels and .labels properties
757
715
  for (const model of Object.keys(convert$1)) {
758
- if (!('channels' in convert$1[model])) {
759
- throw new Error('missing channels property: ' + model);
760
- }
716
+ if (!('channels' in convert$1[model])) {
717
+ throw new Error('missing channels property: ' + model);
718
+ }
761
719
 
762
- if (!('labels' in convert$1[model])) {
763
- throw new Error('missing channel labels property: ' + model);
764
- }
720
+ if (!('labels' in convert$1[model])) {
721
+ throw new Error('missing channel labels property: ' + model);
722
+ }
765
723
 
766
- if (convert$1[model].labels.length !== convert$1[model].channels) {
767
- throw new Error('channel and label counts mismatch: ' + model);
768
- }
724
+ if (convert$1[model].labels.length !== convert$1[model].channels) {
725
+ throw new Error('channel and label counts mismatch: ' + model);
726
+ }
769
727
 
770
- const {
771
- channels,
772
- labels
773
- } = convert$1[model];
774
- delete convert$1[model].channels;
775
- delete convert$1[model].labels;
776
- Object.defineProperty(convert$1[model], 'channels', {
777
- value: channels
778
- });
779
- Object.defineProperty(convert$1[model], 'labels', {
780
- value: labels
781
- });
728
+ const {channels, labels} = convert$1[model];
729
+ delete convert$1[model].channels;
730
+ delete convert$1[model].labels;
731
+ Object.defineProperty(convert$1[model], 'channels', {value: channels});
732
+ Object.defineProperty(convert$1[model], 'labels', {value: labels});
782
733
  }
783
734
 
784
735
  convert$1.rgb.hsl = function (rgb) {
785
- const r = rgb[0] / 255;
786
- const g = rgb[1] / 255;
787
- const b = rgb[2] / 255;
788
- const min = Math.min(r, g, b);
789
- const max = Math.max(r, g, b);
790
- const delta = max - min;
791
- let h;
792
- let s;
793
-
794
- if (max === min) {
795
- h = 0;
796
- } else if (r === max) {
797
- h = (g - b) / delta;
798
- } else if (g === max) {
799
- h = 2 + (b - r) / delta;
800
- } else if (b === max) {
801
- h = 4 + (r - g) / delta;
802
- }
736
+ const r = rgb[0] / 255;
737
+ const g = rgb[1] / 255;
738
+ const b = rgb[2] / 255;
739
+ const min = Math.min(r, g, b);
740
+ const max = Math.max(r, g, b);
741
+ const delta = max - min;
742
+ let h;
743
+ let s;
744
+
745
+ if (max === min) {
746
+ h = 0;
747
+ } else if (r === max) {
748
+ h = (g - b) / delta;
749
+ } else if (g === max) {
750
+ h = 2 + (b - r) / delta;
751
+ } else if (b === max) {
752
+ h = 4 + (r - g) / delta;
753
+ }
803
754
 
804
- h = Math.min(h * 60, 360);
755
+ h = Math.min(h * 60, 360);
805
756
 
806
- if (h < 0) {
807
- h += 360;
808
- }
757
+ if (h < 0) {
758
+ h += 360;
759
+ }
809
760
 
810
- const l = (min + max) / 2;
761
+ const l = (min + max) / 2;
811
762
 
812
- if (max === min) {
813
- s = 0;
814
- } else if (l <= 0.5) {
815
- s = delta / (max + min);
816
- } else {
817
- s = delta / (2 - max - min);
818
- }
763
+ if (max === min) {
764
+ s = 0;
765
+ } else if (l <= 0.5) {
766
+ s = delta / (max + min);
767
+ } else {
768
+ s = delta / (2 - max - min);
769
+ }
819
770
 
820
- return [h, s * 100, l * 100];
771
+ return [h, s * 100, l * 100];
821
772
  };
822
773
 
823
774
  convert$1.rgb.hsv = function (rgb) {
824
- let rdif;
825
- let gdif;
826
- let bdif;
827
- let h;
828
- let s;
829
- const r = rgb[0] / 255;
830
- const g = rgb[1] / 255;
831
- const b = rgb[2] / 255;
832
- const v = Math.max(r, g, b);
833
- const diff = v - Math.min(r, g, b);
834
-
835
- const diffc = function (c) {
836
- return (v - c) / 6 / diff + 1 / 2;
837
- };
838
-
839
- if (diff === 0) {
840
- h = 0;
841
- s = 0;
842
- } else {
843
- s = diff / v;
844
- rdif = diffc(r);
845
- gdif = diffc(g);
846
- bdif = diffc(b);
847
-
848
- if (r === v) {
849
- h = bdif - gdif;
850
- } else if (g === v) {
851
- h = 1 / 3 + rdif - bdif;
852
- } else if (b === v) {
853
- h = 2 / 3 + gdif - rdif;
854
- }
775
+ let rdif;
776
+ let gdif;
777
+ let bdif;
778
+ let h;
779
+ let s;
780
+
781
+ const r = rgb[0] / 255;
782
+ const g = rgb[1] / 255;
783
+ const b = rgb[2] / 255;
784
+ const v = Math.max(r, g, b);
785
+ const diff = v - Math.min(r, g, b);
786
+ const diffc = function (c) {
787
+ return (v - c) / 6 / diff + 1 / 2;
788
+ };
855
789
 
856
- if (h < 0) {
857
- h += 1;
858
- } else if (h > 1) {
859
- h -= 1;
860
- }
861
- }
790
+ if (diff === 0) {
791
+ h = 0;
792
+ s = 0;
793
+ } else {
794
+ s = diff / v;
795
+ rdif = diffc(r);
796
+ gdif = diffc(g);
797
+ bdif = diffc(b);
798
+
799
+ if (r === v) {
800
+ h = bdif - gdif;
801
+ } else if (g === v) {
802
+ h = (1 / 3) + rdif - bdif;
803
+ } else if (b === v) {
804
+ h = (2 / 3) + gdif - rdif;
805
+ }
862
806
 
863
- return [h * 360, s * 100, v * 100];
807
+ if (h < 0) {
808
+ h += 1;
809
+ } else if (h > 1) {
810
+ h -= 1;
811
+ }
812
+ }
813
+
814
+ return [
815
+ h * 360,
816
+ s * 100,
817
+ v * 100
818
+ ];
864
819
  };
865
820
 
866
821
  convert$1.rgb.hwb = function (rgb) {
867
- const r = rgb[0];
868
- const g = rgb[1];
869
- let b = rgb[2];
870
- const h = convert$1.rgb.hsl(rgb)[0];
871
- const w = 1 / 255 * Math.min(r, Math.min(g, b));
872
- b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
873
- return [h, w * 100, b * 100];
822
+ const r = rgb[0];
823
+ const g = rgb[1];
824
+ let b = rgb[2];
825
+ const h = convert$1.rgb.hsl(rgb)[0];
826
+ const w = 1 / 255 * Math.min(r, Math.min(g, b));
827
+
828
+ b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
829
+
830
+ return [h, w * 100, b * 100];
874
831
  };
875
832
 
876
833
  convert$1.rgb.cmyk = function (rgb) {
877
- const r = rgb[0] / 255;
878
- const g = rgb[1] / 255;
879
- const b = rgb[2] / 255;
880
- const k = Math.min(1 - r, 1 - g, 1 - b);
881
- const c = (1 - r - k) / (1 - k) || 0;
882
- const m = (1 - g - k) / (1 - k) || 0;
883
- const y = (1 - b - k) / (1 - k) || 0;
884
- return [c * 100, m * 100, y * 100, k * 100];
834
+ const r = rgb[0] / 255;
835
+ const g = rgb[1] / 255;
836
+ const b = rgb[2] / 255;
837
+
838
+ const k = Math.min(1 - r, 1 - g, 1 - b);
839
+ const c = (1 - r - k) / (1 - k) || 0;
840
+ const m = (1 - g - k) / (1 - k) || 0;
841
+ const y = (1 - b - k) / (1 - k) || 0;
842
+
843
+ return [c * 100, m * 100, y * 100, k * 100];
885
844
  };
886
845
 
887
846
  function comparativeDistance(x, y) {
888
- /*
889
- See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
890
- */
891
- return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
847
+ /*
848
+ See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
849
+ */
850
+ return (
851
+ ((x[0] - y[0]) ** 2) +
852
+ ((x[1] - y[1]) ** 2) +
853
+ ((x[2] - y[2]) ** 2)
854
+ );
892
855
  }
893
856
 
894
857
  convert$1.rgb.keyword = function (rgb) {
895
- const reversed = reverseKeywords[rgb];
896
-
897
- if (reversed) {
898
- return reversed;
899
- }
858
+ const reversed = reverseKeywords[rgb];
859
+ if (reversed) {
860
+ return reversed;
861
+ }
900
862
 
901
- let currentClosestDistance = Infinity;
902
- let currentClosestKeyword;
863
+ let currentClosestDistance = Infinity;
864
+ let currentClosestKeyword;
903
865
 
904
- for (const keyword of Object.keys(colorName)) {
905
- const value = colorName[keyword]; // Compute comparative distance
866
+ for (const keyword of Object.keys(colorName)) {
867
+ const value = colorName[keyword];
906
868
 
907
- const distance = comparativeDistance(rgb, value); // Check if its less, if so set as closest
869
+ // Compute comparative distance
870
+ const distance = comparativeDistance(rgb, value);
908
871
 
909
- if (distance < currentClosestDistance) {
910
- currentClosestDistance = distance;
911
- currentClosestKeyword = keyword;
912
- }
913
- }
872
+ // Check if its less, if so set as closest
873
+ if (distance < currentClosestDistance) {
874
+ currentClosestDistance = distance;
875
+ currentClosestKeyword = keyword;
876
+ }
877
+ }
914
878
 
915
- return currentClosestKeyword;
879
+ return currentClosestKeyword;
916
880
  };
917
881
 
918
882
  convert$1.keyword.rgb = function (keyword) {
919
- return colorName[keyword];
883
+ return colorName[keyword];
920
884
  };
921
885
 
922
886
  convert$1.rgb.xyz = function (rgb) {
923
- let r = rgb[0] / 255;
924
- let g = rgb[1] / 255;
925
- let b = rgb[2] / 255; // Assume sRGB
887
+ let r = rgb[0] / 255;
888
+ let g = rgb[1] / 255;
889
+ let b = rgb[2] / 255;
926
890
 
927
- r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
928
- g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
929
- b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
930
- const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
931
- const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
932
- const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
933
- return [x * 100, y * 100, z * 100];
891
+ // Assume sRGB
892
+ r = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92);
893
+ g = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92);
894
+ b = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92);
895
+
896
+ const x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);
897
+ const y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);
898
+ const z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);
899
+
900
+ return [x * 100, y * 100, z * 100];
934
901
  };
935
902
 
936
903
  convert$1.rgb.lab = function (rgb) {
937
- const xyz = convert$1.rgb.xyz(rgb);
938
- let x = xyz[0];
939
- let y = xyz[1];
940
- let z = xyz[2];
941
- x /= 95.047;
942
- y /= 100;
943
- z /= 108.883;
944
- x = x > 0.008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
945
- y = y > 0.008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
946
- z = z > 0.008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
947
- const l = 116 * y - 16;
948
- const a = 500 * (x - y);
949
- const b = 200 * (y - z);
950
- return [l, a, b];
904
+ const xyz = convert$1.rgb.xyz(rgb);
905
+ let x = xyz[0];
906
+ let y = xyz[1];
907
+ let z = xyz[2];
908
+
909
+ x /= 95.047;
910
+ y /= 100;
911
+ z /= 108.883;
912
+
913
+ x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);
914
+ y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);
915
+ z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);
916
+
917
+ const l = (116 * y) - 16;
918
+ const a = 500 * (x - y);
919
+ const b = 200 * (y - z);
920
+
921
+ return [l, a, b];
951
922
  };
952
923
 
953
924
  convert$1.hsl.rgb = function (hsl) {
954
- const h = hsl[0] / 360;
955
- const s = hsl[1] / 100;
956
- const l = hsl[2] / 100;
957
- let t2;
958
- let t3;
959
- let val;
960
-
961
- if (s === 0) {
962
- val = l * 255;
963
- return [val, val, val];
964
- }
965
-
966
- if (l < 0.5) {
967
- t2 = l * (1 + s);
968
- } else {
969
- t2 = l + s - l * s;
970
- }
925
+ const h = hsl[0] / 360;
926
+ const s = hsl[1] / 100;
927
+ const l = hsl[2] / 100;
928
+ let t2;
929
+ let t3;
930
+ let val;
931
+
932
+ if (s === 0) {
933
+ val = l * 255;
934
+ return [val, val, val];
935
+ }
971
936
 
972
- const t1 = 2 * l - t2;
973
- const rgb = [0, 0, 0];
937
+ if (l < 0.5) {
938
+ t2 = l * (1 + s);
939
+ } else {
940
+ t2 = l + s - l * s;
941
+ }
974
942
 
975
- for (let i = 0; i < 3; i++) {
976
- t3 = h + 1 / 3 * -(i - 1);
943
+ const t1 = 2 * l - t2;
977
944
 
978
- if (t3 < 0) {
979
- t3++;
980
- }
945
+ const rgb = [0, 0, 0];
946
+ for (let i = 0; i < 3; i++) {
947
+ t3 = h + 1 / 3 * -(i - 1);
948
+ if (t3 < 0) {
949
+ t3++;
950
+ }
981
951
 
982
- if (t3 > 1) {
983
- t3--;
984
- }
952
+ if (t3 > 1) {
953
+ t3--;
954
+ }
985
955
 
986
- if (6 * t3 < 1) {
987
- val = t1 + (t2 - t1) * 6 * t3;
988
- } else if (2 * t3 < 1) {
989
- val = t2;
990
- } else if (3 * t3 < 2) {
991
- val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
992
- } else {
993
- val = t1;
994
- }
956
+ if (6 * t3 < 1) {
957
+ val = t1 + (t2 - t1) * 6 * t3;
958
+ } else if (2 * t3 < 1) {
959
+ val = t2;
960
+ } else if (3 * t3 < 2) {
961
+ val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
962
+ } else {
963
+ val = t1;
964
+ }
995
965
 
996
- rgb[i] = val * 255;
997
- }
966
+ rgb[i] = val * 255;
967
+ }
998
968
 
999
- return rgb;
969
+ return rgb;
1000
970
  };
1001
971
 
1002
972
  convert$1.hsl.hsv = function (hsl) {
1003
- const h = hsl[0];
1004
- let s = hsl[1] / 100;
1005
- let l = hsl[2] / 100;
1006
- let smin = s;
1007
- const lmin = Math.max(l, 0.01);
1008
- l *= 2;
1009
- s *= l <= 1 ? l : 2 - l;
1010
- smin *= lmin <= 1 ? lmin : 2 - lmin;
1011
- const v = (l + s) / 2;
1012
- const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
1013
- return [h, sv * 100, v * 100];
973
+ const h = hsl[0];
974
+ let s = hsl[1] / 100;
975
+ let l = hsl[2] / 100;
976
+ let smin = s;
977
+ const lmin = Math.max(l, 0.01);
978
+
979
+ l *= 2;
980
+ s *= (l <= 1) ? l : 2 - l;
981
+ smin *= lmin <= 1 ? lmin : 2 - lmin;
982
+ const v = (l + s) / 2;
983
+ const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);
984
+
985
+ return [h, sv * 100, v * 100];
1014
986
  };
1015
987
 
1016
988
  convert$1.hsv.rgb = function (hsv) {
1017
- const h = hsv[0] / 60;
1018
- const s = hsv[1] / 100;
1019
- let v = hsv[2] / 100;
1020
- const hi = Math.floor(h) % 6;
1021
- const f = h - Math.floor(h);
1022
- const p = 255 * v * (1 - s);
1023
- const q = 255 * v * (1 - s * f);
1024
- const t = 255 * v * (1 - s * (1 - f));
1025
- v *= 255;
1026
-
1027
- switch (hi) {
1028
- case 0:
1029
- return [v, t, p];
1030
-
1031
- case 1:
1032
- return [q, v, p];
1033
-
1034
- case 2:
1035
- return [p, v, t];
1036
-
1037
- case 3:
1038
- return [p, q, v];
1039
-
1040
- case 4:
1041
- return [t, p, v];
1042
-
1043
- case 5:
1044
- return [v, p, q];
1045
- }
989
+ const h = hsv[0] / 60;
990
+ const s = hsv[1] / 100;
991
+ let v = hsv[2] / 100;
992
+ const hi = Math.floor(h) % 6;
993
+
994
+ const f = h - Math.floor(h);
995
+ const p = 255 * v * (1 - s);
996
+ const q = 255 * v * (1 - (s * f));
997
+ const t = 255 * v * (1 - (s * (1 - f)));
998
+ v *= 255;
999
+
1000
+ switch (hi) {
1001
+ case 0:
1002
+ return [v, t, p];
1003
+ case 1:
1004
+ return [q, v, p];
1005
+ case 2:
1006
+ return [p, v, t];
1007
+ case 3:
1008
+ return [p, q, v];
1009
+ case 4:
1010
+ return [t, p, v];
1011
+ case 5:
1012
+ return [v, p, q];
1013
+ }
1046
1014
  };
1047
1015
 
1048
1016
  convert$1.hsv.hsl = function (hsv) {
1049
- const h = hsv[0];
1050
- const s = hsv[1] / 100;
1051
- const v = hsv[2] / 100;
1052
- const vmin = Math.max(v, 0.01);
1053
- let sl;
1054
- let l;
1055
- l = (2 - s) * v;
1056
- const lmin = (2 - s) * vmin;
1057
- sl = s * vmin;
1058
- sl /= lmin <= 1 ? lmin : 2 - lmin;
1059
- sl = sl || 0;
1060
- l /= 2;
1061
- return [h, sl * 100, l * 100];
1062
- }; // http://dev.w3.org/csswg/css-color/#hwb-to-rgb
1017
+ const h = hsv[0];
1018
+ const s = hsv[1] / 100;
1019
+ const v = hsv[2] / 100;
1020
+ const vmin = Math.max(v, 0.01);
1021
+ let sl;
1022
+ let l;
1023
+
1024
+ l = (2 - s) * v;
1025
+ const lmin = (2 - s) * vmin;
1026
+ sl = s * vmin;
1027
+ sl /= (lmin <= 1) ? lmin : 2 - lmin;
1028
+ sl = sl || 0;
1029
+ l /= 2;
1063
1030
 
1031
+ return [h, sl * 100, l * 100];
1032
+ };
1064
1033
 
1034
+ // http://dev.w3.org/csswg/css-color/#hwb-to-rgb
1065
1035
  convert$1.hwb.rgb = function (hwb) {
1066
- const h = hwb[0] / 360;
1067
- let wh = hwb[1] / 100;
1068
- let bl = hwb[2] / 100;
1069
- const ratio = wh + bl;
1070
- let f; // Wh + bl cant be > 1
1071
-
1072
- if (ratio > 1) {
1073
- wh /= ratio;
1074
- bl /= ratio;
1075
- }
1036
+ const h = hwb[0] / 360;
1037
+ let wh = hwb[1] / 100;
1038
+ let bl = hwb[2] / 100;
1039
+ const ratio = wh + bl;
1040
+ let f;
1041
+
1042
+ // Wh + bl cant be > 1
1043
+ if (ratio > 1) {
1044
+ wh /= ratio;
1045
+ bl /= ratio;
1046
+ }
1076
1047
 
1077
- const i = Math.floor(6 * h);
1078
- const v = 1 - bl;
1079
- f = 6 * h - i;
1048
+ const i = Math.floor(6 * h);
1049
+ const v = 1 - bl;
1050
+ f = 6 * h - i;
1080
1051
 
1081
- if ((i & 0x01) !== 0) {
1082
- f = 1 - f;
1083
- }
1052
+ if ((i & 0x01) !== 0) {
1053
+ f = 1 - f;
1054
+ }
1084
1055
 
1085
- const n = wh + f * (v - wh); // Linear interpolation
1086
-
1087
- let r;
1088
- let g;
1089
- let b;
1090
- /* eslint-disable max-statements-per-line,no-multi-spaces */
1091
-
1092
- switch (i) {
1093
- default:
1094
- case 6:
1095
- case 0:
1096
- r = v;
1097
- g = n;
1098
- b = wh;
1099
- break;
1100
-
1101
- case 1:
1102
- r = n;
1103
- g = v;
1104
- b = wh;
1105
- break;
1106
-
1107
- case 2:
1108
- r = wh;
1109
- g = v;
1110
- b = n;
1111
- break;
1112
-
1113
- case 3:
1114
- r = wh;
1115
- g = n;
1116
- b = v;
1117
- break;
1118
-
1119
- case 4:
1120
- r = n;
1121
- g = wh;
1122
- b = v;
1123
- break;
1124
-
1125
- case 5:
1126
- r = v;
1127
- g = wh;
1128
- b = n;
1129
- break;
1130
- }
1131
- /* eslint-enable max-statements-per-line,no-multi-spaces */
1056
+ const n = wh + f * (v - wh); // Linear interpolation
1132
1057
 
1058
+ let r;
1059
+ let g;
1060
+ let b;
1061
+ /* eslint-disable max-statements-per-line,no-multi-spaces */
1062
+ switch (i) {
1063
+ default:
1064
+ case 6:
1065
+ case 0: r = v; g = n; b = wh; break;
1066
+ case 1: r = n; g = v; b = wh; break;
1067
+ case 2: r = wh; g = v; b = n; break;
1068
+ case 3: r = wh; g = n; b = v; break;
1069
+ case 4: r = n; g = wh; b = v; break;
1070
+ case 5: r = v; g = wh; b = n; break;
1071
+ }
1072
+ /* eslint-enable max-statements-per-line,no-multi-spaces */
1133
1073
 
1134
- return [r * 255, g * 255, b * 255];
1074
+ return [r * 255, g * 255, b * 255];
1135
1075
  };
1136
1076
 
1137
1077
  convert$1.cmyk.rgb = function (cmyk) {
1138
- const c = cmyk[0] / 100;
1139
- const m = cmyk[1] / 100;
1140
- const y = cmyk[2] / 100;
1141
- const k = cmyk[3] / 100;
1142
- const r = 1 - Math.min(1, c * (1 - k) + k);
1143
- const g = 1 - Math.min(1, m * (1 - k) + k);
1144
- const b = 1 - Math.min(1, y * (1 - k) + k);
1145
- return [r * 255, g * 255, b * 255];
1078
+ const c = cmyk[0] / 100;
1079
+ const m = cmyk[1] / 100;
1080
+ const y = cmyk[2] / 100;
1081
+ const k = cmyk[3] / 100;
1082
+
1083
+ const r = 1 - Math.min(1, c * (1 - k) + k);
1084
+ const g = 1 - Math.min(1, m * (1 - k) + k);
1085
+ const b = 1 - Math.min(1, y * (1 - k) + k);
1086
+
1087
+ return [r * 255, g * 255, b * 255];
1146
1088
  };
1147
1089
 
1148
1090
  convert$1.xyz.rgb = function (xyz) {
1149
- const x = xyz[0] / 100;
1150
- const y = xyz[1] / 100;
1151
- const z = xyz[2] / 100;
1152
- let r;
1153
- let g;
1154
- let b;
1155
- r = x * 3.2406 + y * -1.5372 + z * -0.4986;
1156
- g = x * -0.9689 + y * 1.8758 + z * 0.0415;
1157
- b = x * 0.0557 + y * -0.2040 + z * 1.0570; // Assume sRGB
1158
-
1159
- r = r > 0.0031308 ? 1.055 * r ** (1.0 / 2.4) - 0.055 : r * 12.92;
1160
- g = g > 0.0031308 ? 1.055 * g ** (1.0 / 2.4) - 0.055 : g * 12.92;
1161
- b = b > 0.0031308 ? 1.055 * b ** (1.0 / 2.4) - 0.055 : b * 12.92;
1162
- r = Math.min(Math.max(0, r), 1);
1163
- g = Math.min(Math.max(0, g), 1);
1164
- b = Math.min(Math.max(0, b), 1);
1165
- return [r * 255, g * 255, b * 255];
1091
+ const x = xyz[0] / 100;
1092
+ const y = xyz[1] / 100;
1093
+ const z = xyz[2] / 100;
1094
+ let r;
1095
+ let g;
1096
+ let b;
1097
+
1098
+ r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);
1099
+ g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);
1100
+ b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);
1101
+
1102
+ // Assume sRGB
1103
+ r = r > 0.0031308
1104
+ ? ((1.055 * (r ** (1.0 / 2.4))) - 0.055)
1105
+ : r * 12.92;
1106
+
1107
+ g = g > 0.0031308
1108
+ ? ((1.055 * (g ** (1.0 / 2.4))) - 0.055)
1109
+ : g * 12.92;
1110
+
1111
+ b = b > 0.0031308
1112
+ ? ((1.055 * (b ** (1.0 / 2.4))) - 0.055)
1113
+ : b * 12.92;
1114
+
1115
+ r = Math.min(Math.max(0, r), 1);
1116
+ g = Math.min(Math.max(0, g), 1);
1117
+ b = Math.min(Math.max(0, b), 1);
1118
+
1119
+ return [r * 255, g * 255, b * 255];
1166
1120
  };
1167
1121
 
1168
1122
  convert$1.xyz.lab = function (xyz) {
1169
- let x = xyz[0];
1170
- let y = xyz[1];
1171
- let z = xyz[2];
1172
- x /= 95.047;
1173
- y /= 100;
1174
- z /= 108.883;
1175
- x = x > 0.008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
1176
- y = y > 0.008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
1177
- z = z > 0.008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
1178
- const l = 116 * y - 16;
1179
- const a = 500 * (x - y);
1180
- const b = 200 * (y - z);
1181
- return [l, a, b];
1123
+ let x = xyz[0];
1124
+ let y = xyz[1];
1125
+ let z = xyz[2];
1126
+
1127
+ x /= 95.047;
1128
+ y /= 100;
1129
+ z /= 108.883;
1130
+
1131
+ x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);
1132
+ y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);
1133
+ z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);
1134
+
1135
+ const l = (116 * y) - 16;
1136
+ const a = 500 * (x - y);
1137
+ const b = 200 * (y - z);
1138
+
1139
+ return [l, a, b];
1182
1140
  };
1183
1141
 
1184
1142
  convert$1.lab.xyz = function (lab) {
1185
- const l = lab[0];
1186
- const a = lab[1];
1187
- const b = lab[2];
1188
- let x;
1189
- let y;
1190
- let z;
1191
- y = (l + 16) / 116;
1192
- x = a / 500 + y;
1193
- z = y - b / 200;
1194
- const y2 = y ** 3;
1195
- const x2 = x ** 3;
1196
- const z2 = z ** 3;
1197
- y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
1198
- x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
1199
- z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
1200
- x *= 95.047;
1201
- y *= 100;
1202
- z *= 108.883;
1203
- return [x, y, z];
1143
+ const l = lab[0];
1144
+ const a = lab[1];
1145
+ const b = lab[2];
1146
+ let x;
1147
+ let y;
1148
+ let z;
1149
+
1150
+ y = (l + 16) / 116;
1151
+ x = a / 500 + y;
1152
+ z = y - b / 200;
1153
+
1154
+ const y2 = y ** 3;
1155
+ const x2 = x ** 3;
1156
+ const z2 = z ** 3;
1157
+ y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
1158
+ x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
1159
+ z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
1160
+
1161
+ x *= 95.047;
1162
+ y *= 100;
1163
+ z *= 108.883;
1164
+
1165
+ return [x, y, z];
1204
1166
  };
1205
1167
 
1206
1168
  convert$1.lab.lch = function (lab) {
1207
- const l = lab[0];
1208
- const a = lab[1];
1209
- const b = lab[2];
1210
- let h;
1211
- const hr = Math.atan2(b, a);
1212
- h = hr * 360 / 2 / Math.PI;
1213
-
1214
- if (h < 0) {
1215
- h += 360;
1216
- }
1169
+ const l = lab[0];
1170
+ const a = lab[1];
1171
+ const b = lab[2];
1172
+ let h;
1173
+
1174
+ const hr = Math.atan2(b, a);
1175
+ h = hr * 360 / 2 / Math.PI;
1217
1176
 
1218
- const c = Math.sqrt(a * a + b * b);
1219
- return [l, c, h];
1177
+ if (h < 0) {
1178
+ h += 360;
1179
+ }
1180
+
1181
+ const c = Math.sqrt(a * a + b * b);
1182
+
1183
+ return [l, c, h];
1220
1184
  };
1221
1185
 
1222
1186
  convert$1.lch.lab = function (lch) {
1223
- const l = lch[0];
1224
- const c = lch[1];
1225
- const h = lch[2];
1226
- const hr = h / 360 * 2 * Math.PI;
1227
- const a = c * Math.cos(hr);
1228
- const b = c * Math.sin(hr);
1229
- return [l, a, b];
1187
+ const l = lch[0];
1188
+ const c = lch[1];
1189
+ const h = lch[2];
1190
+
1191
+ const hr = h / 360 * 2 * Math.PI;
1192
+ const a = c * Math.cos(hr);
1193
+ const b = c * Math.sin(hr);
1194
+
1195
+ return [l, a, b];
1230
1196
  };
1231
1197
 
1232
1198
  convert$1.rgb.ansi16 = function (args, saturation = null) {
1233
- const [r, g, b] = args;
1234
- let value = saturation === null ? convert$1.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization
1199
+ const [r, g, b] = args;
1200
+ let value = saturation === null ? convert$1.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization
1235
1201
 
1236
- value = Math.round(value / 50);
1202
+ value = Math.round(value / 50);
1237
1203
 
1238
- if (value === 0) {
1239
- return 30;
1240
- }
1204
+ if (value === 0) {
1205
+ return 30;
1206
+ }
1241
1207
 
1242
- let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
1208
+ let ansi = 30
1209
+ + ((Math.round(b / 255) << 2)
1210
+ | (Math.round(g / 255) << 1)
1211
+ | Math.round(r / 255));
1243
1212
 
1244
- if (value === 2) {
1245
- ansi += 60;
1246
- }
1213
+ if (value === 2) {
1214
+ ansi += 60;
1215
+ }
1247
1216
 
1248
- return ansi;
1217
+ return ansi;
1249
1218
  };
1250
1219
 
1251
1220
  convert$1.hsv.ansi16 = function (args) {
1252
- // Optimization here; we already know the value and don't need to get
1253
- // it converted for us.
1254
- return convert$1.rgb.ansi16(convert$1.hsv.rgb(args), args[2]);
1221
+ // Optimization here; we already know the value and don't need to get
1222
+ // it converted for us.
1223
+ return convert$1.rgb.ansi16(convert$1.hsv.rgb(args), args[2]);
1255
1224
  };
1256
1225
 
1257
1226
  convert$1.rgb.ansi256 = function (args) {
1258
- const r = args[0];
1259
- const g = args[1];
1260
- const b = args[2]; // We use the extended greyscale palette here, with the exception of
1261
- // black and white. normal palette only has 4 greyscale shades.
1262
-
1263
- if (r === g && g === b) {
1264
- if (r < 8) {
1265
- return 16;
1266
- }
1227
+ const r = args[0];
1228
+ const g = args[1];
1229
+ const b = args[2];
1230
+
1231
+ // We use the extended greyscale palette here, with the exception of
1232
+ // black and white. normal palette only has 4 greyscale shades.
1233
+ if (r === g && g === b) {
1234
+ if (r < 8) {
1235
+ return 16;
1236
+ }
1267
1237
 
1268
- if (r > 248) {
1269
- return 231;
1270
- }
1238
+ if (r > 248) {
1239
+ return 231;
1240
+ }
1271
1241
 
1272
- return Math.round((r - 8) / 247 * 24) + 232;
1273
- }
1242
+ return Math.round(((r - 8) / 247) * 24) + 232;
1243
+ }
1244
+
1245
+ const ansi = 16
1246
+ + (36 * Math.round(r / 255 * 5))
1247
+ + (6 * Math.round(g / 255 * 5))
1248
+ + Math.round(b / 255 * 5);
1274
1249
 
1275
- const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
1276
- return ansi;
1250
+ return ansi;
1277
1251
  };
1278
1252
 
1279
1253
  convert$1.ansi16.rgb = function (args) {
1280
- let color = args % 10; // Handle greyscale
1254
+ let color = args % 10;
1281
1255
 
1282
- if (color === 0 || color === 7) {
1283
- if (args > 50) {
1284
- color += 3.5;
1285
- }
1256
+ // Handle greyscale
1257
+ if (color === 0 || color === 7) {
1258
+ if (args > 50) {
1259
+ color += 3.5;
1260
+ }
1286
1261
 
1287
- color = color / 10.5 * 255;
1288
- return [color, color, color];
1289
- }
1262
+ color = color / 10.5 * 255;
1263
+
1264
+ return [color, color, color];
1265
+ }
1266
+
1267
+ const mult = (~~(args > 50) + 1) * 0.5;
1268
+ const r = ((color & 1) * mult) * 255;
1269
+ const g = (((color >> 1) & 1) * mult) * 255;
1270
+ const b = (((color >> 2) & 1) * mult) * 255;
1290
1271
 
1291
- const mult = (~~(args > 50) + 1) * 0.5;
1292
- const r = (color & 1) * mult * 255;
1293
- const g = (color >> 1 & 1) * mult * 255;
1294
- const b = (color >> 2 & 1) * mult * 255;
1295
- return [r, g, b];
1272
+ return [r, g, b];
1296
1273
  };
1297
1274
 
1298
1275
  convert$1.ansi256.rgb = function (args) {
1299
- // Handle greyscale
1300
- if (args >= 232) {
1301
- const c = (args - 232) * 10 + 8;
1302
- return [c, c, c];
1303
- }
1276
+ // Handle greyscale
1277
+ if (args >= 232) {
1278
+ const c = (args - 232) * 10 + 8;
1279
+ return [c, c, c];
1280
+ }
1281
+
1282
+ args -= 16;
1283
+
1284
+ let rem;
1285
+ const r = Math.floor(args / 36) / 5 * 255;
1286
+ const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
1287
+ const b = (rem % 6) / 5 * 255;
1304
1288
 
1305
- args -= 16;
1306
- let rem;
1307
- const r = Math.floor(args / 36) / 5 * 255;
1308
- const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
1309
- const b = rem % 6 / 5 * 255;
1310
- return [r, g, b];
1289
+ return [r, g, b];
1311
1290
  };
1312
1291
 
1313
1292
  convert$1.rgb.hex = function (args) {
1314
- const integer = ((Math.round(args[0]) & 0xFF) << 16) + ((Math.round(args[1]) & 0xFF) << 8) + (Math.round(args[2]) & 0xFF);
1315
- const string = integer.toString(16).toUpperCase();
1316
- return '000000'.substring(string.length) + string;
1293
+ const integer = ((Math.round(args[0]) & 0xFF) << 16)
1294
+ + ((Math.round(args[1]) & 0xFF) << 8)
1295
+ + (Math.round(args[2]) & 0xFF);
1296
+
1297
+ const string = integer.toString(16).toUpperCase();
1298
+ return '000000'.substring(string.length) + string;
1317
1299
  };
1318
1300
 
1319
1301
  convert$1.hex.rgb = function (args) {
1320
- const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
1302
+ const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
1303
+ if (!match) {
1304
+ return [0, 0, 0];
1305
+ }
1321
1306
 
1322
- if (!match) {
1323
- return [0, 0, 0];
1324
- }
1307
+ let colorString = match[0];
1325
1308
 
1326
- let colorString = match[0];
1309
+ if (match[0].length === 3) {
1310
+ colorString = colorString.split('').map(char => {
1311
+ return char + char;
1312
+ }).join('');
1313
+ }
1327
1314
 
1328
- if (match[0].length === 3) {
1329
- colorString = colorString.split('').map(char => {
1330
- return char + char;
1331
- }).join('');
1332
- }
1315
+ const integer = parseInt(colorString, 16);
1316
+ const r = (integer >> 16) & 0xFF;
1317
+ const g = (integer >> 8) & 0xFF;
1318
+ const b = integer & 0xFF;
1333
1319
 
1334
- const integer = parseInt(colorString, 16);
1335
- const r = integer >> 16 & 0xFF;
1336
- const g = integer >> 8 & 0xFF;
1337
- const b = integer & 0xFF;
1338
- return [r, g, b];
1320
+ return [r, g, b];
1339
1321
  };
1340
1322
 
1341
1323
  convert$1.rgb.hcg = function (rgb) {
1342
- const r = rgb[0] / 255;
1343
- const g = rgb[1] / 255;
1344
- const b = rgb[2] / 255;
1345
- const max = Math.max(Math.max(r, g), b);
1346
- const min = Math.min(Math.min(r, g), b);
1347
- const chroma = max - min;
1348
- let grayscale;
1349
- let hue;
1350
-
1351
- if (chroma < 1) {
1352
- grayscale = min / (1 - chroma);
1353
- } else {
1354
- grayscale = 0;
1355
- }
1324
+ const r = rgb[0] / 255;
1325
+ const g = rgb[1] / 255;
1326
+ const b = rgb[2] / 255;
1327
+ const max = Math.max(Math.max(r, g), b);
1328
+ const min = Math.min(Math.min(r, g), b);
1329
+ const chroma = (max - min);
1330
+ let grayscale;
1331
+ let hue;
1332
+
1333
+ if (chroma < 1) {
1334
+ grayscale = min / (1 - chroma);
1335
+ } else {
1336
+ grayscale = 0;
1337
+ }
1356
1338
 
1357
- if (chroma <= 0) {
1358
- hue = 0;
1359
- } else if (max === r) {
1360
- hue = (g - b) / chroma % 6;
1361
- } else if (max === g) {
1362
- hue = 2 + (b - r) / chroma;
1363
- } else {
1364
- hue = 4 + (r - g) / chroma;
1365
- }
1339
+ if (chroma <= 0) {
1340
+ hue = 0;
1341
+ } else
1342
+ if (max === r) {
1343
+ hue = ((g - b) / chroma) % 6;
1344
+ } else
1345
+ if (max === g) {
1346
+ hue = 2 + (b - r) / chroma;
1347
+ } else {
1348
+ hue = 4 + (r - g) / chroma;
1349
+ }
1366
1350
 
1367
- hue /= 6;
1368
- hue %= 1;
1369
- return [hue * 360, chroma * 100, grayscale * 100];
1351
+ hue /= 6;
1352
+ hue %= 1;
1353
+
1354
+ return [hue * 360, chroma * 100, grayscale * 100];
1370
1355
  };
1371
1356
 
1372
1357
  convert$1.hsl.hcg = function (hsl) {
1373
- const s = hsl[1] / 100;
1374
- const l = hsl[2] / 100;
1375
- const c = l < 0.5 ? 2.0 * s * l : 2.0 * s * (1.0 - l);
1376
- let f = 0;
1358
+ const s = hsl[1] / 100;
1359
+ const l = hsl[2] / 100;
1377
1360
 
1378
- if (c < 1.0) {
1379
- f = (l - 0.5 * c) / (1.0 - c);
1380
- }
1361
+ const c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l));
1381
1362
 
1382
- return [hsl[0], c * 100, f * 100];
1363
+ let f = 0;
1364
+ if (c < 1.0) {
1365
+ f = (l - 0.5 * c) / (1.0 - c);
1366
+ }
1367
+
1368
+ return [hsl[0], c * 100, f * 100];
1383
1369
  };
1384
1370
 
1385
1371
  convert$1.hsv.hcg = function (hsv) {
1386
- const s = hsv[1] / 100;
1387
- const v = hsv[2] / 100;
1388
- const c = s * v;
1389
- let f = 0;
1372
+ const s = hsv[1] / 100;
1373
+ const v = hsv[2] / 100;
1390
1374
 
1391
- if (c < 1.0) {
1392
- f = (v - c) / (1 - c);
1393
- }
1375
+ const c = s * v;
1376
+ let f = 0;
1394
1377
 
1395
- return [hsv[0], c * 100, f * 100];
1378
+ if (c < 1.0) {
1379
+ f = (v - c) / (1 - c);
1380
+ }
1381
+
1382
+ return [hsv[0], c * 100, f * 100];
1396
1383
  };
1397
1384
 
1398
1385
  convert$1.hcg.rgb = function (hcg) {
1399
- const h = hcg[0] / 360;
1400
- const c = hcg[1] / 100;
1401
- const g = hcg[2] / 100;
1386
+ const h = hcg[0] / 360;
1387
+ const c = hcg[1] / 100;
1388
+ const g = hcg[2] / 100;
1402
1389
 
1403
- if (c === 0.0) {
1404
- return [g * 255, g * 255, g * 255];
1405
- }
1390
+ if (c === 0.0) {
1391
+ return [g * 255, g * 255, g * 255];
1392
+ }
1406
1393
 
1407
- const pure = [0, 0, 0];
1408
- const hi = h % 1 * 6;
1409
- const v = hi % 1;
1410
- const w = 1 - v;
1411
- let mg = 0;
1412
- /* eslint-disable max-statements-per-line */
1413
-
1414
- switch (Math.floor(hi)) {
1415
- case 0:
1416
- pure[0] = 1;
1417
- pure[1] = v;
1418
- pure[2] = 0;
1419
- break;
1420
-
1421
- case 1:
1422
- pure[0] = w;
1423
- pure[1] = 1;
1424
- pure[2] = 0;
1425
- break;
1426
-
1427
- case 2:
1428
- pure[0] = 0;
1429
- pure[1] = 1;
1430
- pure[2] = v;
1431
- break;
1432
-
1433
- case 3:
1434
- pure[0] = 0;
1435
- pure[1] = w;
1436
- pure[2] = 1;
1437
- break;
1438
-
1439
- case 4:
1440
- pure[0] = v;
1441
- pure[1] = 0;
1442
- pure[2] = 1;
1443
- break;
1444
-
1445
- default:
1446
- pure[0] = 1;
1447
- pure[1] = 0;
1448
- pure[2] = w;
1449
- }
1450
- /* eslint-enable max-statements-per-line */
1394
+ const pure = [0, 0, 0];
1395
+ const hi = (h % 1) * 6;
1396
+ const v = hi % 1;
1397
+ const w = 1 - v;
1398
+ let mg = 0;
1399
+
1400
+ /* eslint-disable max-statements-per-line */
1401
+ switch (Math.floor(hi)) {
1402
+ case 0:
1403
+ pure[0] = 1; pure[1] = v; pure[2] = 0; break;
1404
+ case 1:
1405
+ pure[0] = w; pure[1] = 1; pure[2] = 0; break;
1406
+ case 2:
1407
+ pure[0] = 0; pure[1] = 1; pure[2] = v; break;
1408
+ case 3:
1409
+ pure[0] = 0; pure[1] = w; pure[2] = 1; break;
1410
+ case 4:
1411
+ pure[0] = v; pure[1] = 0; pure[2] = 1; break;
1412
+ default:
1413
+ pure[0] = 1; pure[1] = 0; pure[2] = w;
1414
+ }
1415
+ /* eslint-enable max-statements-per-line */
1451
1416
 
1417
+ mg = (1.0 - c) * g;
1452
1418
 
1453
- mg = (1.0 - c) * g;
1454
- return [(c * pure[0] + mg) * 255, (c * pure[1] + mg) * 255, (c * pure[2] + mg) * 255];
1419
+ return [
1420
+ (c * pure[0] + mg) * 255,
1421
+ (c * pure[1] + mg) * 255,
1422
+ (c * pure[2] + mg) * 255
1423
+ ];
1455
1424
  };
1456
1425
 
1457
1426
  convert$1.hcg.hsv = function (hcg) {
1458
- const c = hcg[1] / 100;
1459
- const g = hcg[2] / 100;
1460
- const v = c + g * (1.0 - c);
1461
- let f = 0;
1427
+ const c = hcg[1] / 100;
1428
+ const g = hcg[2] / 100;
1462
1429
 
1463
- if (v > 0.0) {
1464
- f = c / v;
1465
- }
1430
+ const v = c + g * (1.0 - c);
1431
+ let f = 0;
1466
1432
 
1467
- return [hcg[0], f * 100, v * 100];
1433
+ if (v > 0.0) {
1434
+ f = c / v;
1435
+ }
1436
+
1437
+ return [hcg[0], f * 100, v * 100];
1468
1438
  };
1469
1439
 
1470
1440
  convert$1.hcg.hsl = function (hcg) {
1471
- const c = hcg[1] / 100;
1472
- const g = hcg[2] / 100;
1473
- const l = g * (1.0 - c) + 0.5 * c;
1474
- let s = 0;
1475
-
1476
- if (l > 0.0 && l < 0.5) {
1477
- s = c / (2 * l);
1478
- } else if (l >= 0.5 && l < 1.0) {
1479
- s = c / (2 * (1 - l));
1480
- }
1441
+ const c = hcg[1] / 100;
1442
+ const g = hcg[2] / 100;
1443
+
1444
+ const l = g * (1.0 - c) + 0.5 * c;
1445
+ let s = 0;
1446
+
1447
+ if (l > 0.0 && l < 0.5) {
1448
+ s = c / (2 * l);
1449
+ } else
1450
+ if (l >= 0.5 && l < 1.0) {
1451
+ s = c / (2 * (1 - l));
1452
+ }
1481
1453
 
1482
- return [hcg[0], s * 100, l * 100];
1454
+ return [hcg[0], s * 100, l * 100];
1483
1455
  };
1484
1456
 
1485
1457
  convert$1.hcg.hwb = function (hcg) {
1486
- const c = hcg[1] / 100;
1487
- const g = hcg[2] / 100;
1488
- const v = c + g * (1.0 - c);
1489
- return [hcg[0], (v - c) * 100, (1 - v) * 100];
1458
+ const c = hcg[1] / 100;
1459
+ const g = hcg[2] / 100;
1460
+ const v = c + g * (1.0 - c);
1461
+ return [hcg[0], (v - c) * 100, (1 - v) * 100];
1490
1462
  };
1491
1463
 
1492
1464
  convert$1.hwb.hcg = function (hwb) {
1493
- const w = hwb[1] / 100;
1494
- const b = hwb[2] / 100;
1495
- const v = 1 - b;
1496
- const c = v - w;
1497
- let g = 0;
1498
-
1499
- if (c < 1) {
1500
- g = (v - c) / (1 - c);
1501
- }
1465
+ const w = hwb[1] / 100;
1466
+ const b = hwb[2] / 100;
1467
+ const v = 1 - b;
1468
+ const c = v - w;
1469
+ let g = 0;
1470
+
1471
+ if (c < 1) {
1472
+ g = (v - c) / (1 - c);
1473
+ }
1502
1474
 
1503
- return [hwb[0], c * 100, g * 100];
1475
+ return [hwb[0], c * 100, g * 100];
1504
1476
  };
1505
1477
 
1506
1478
  convert$1.apple.rgb = function (apple) {
1507
- return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
1479
+ return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];
1508
1480
  };
1509
1481
 
1510
1482
  convert$1.rgb.apple = function (rgb) {
1511
- return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
1483
+ return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];
1512
1484
  };
1513
1485
 
1514
1486
  convert$1.gray.rgb = function (args) {
1515
- return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
1487
+ return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
1516
1488
  };
1517
1489
 
1518
1490
  convert$1.gray.hsl = function (args) {
1519
- return [0, 0, args[0]];
1491
+ return [0, 0, args[0]];
1520
1492
  };
1521
1493
 
1522
1494
  convert$1.gray.hsv = convert$1.gray.hsl;
1523
1495
 
1524
1496
  convert$1.gray.hwb = function (gray) {
1525
- return [0, 100, gray[0]];
1497
+ return [0, 100, gray[0]];
1526
1498
  };
1527
1499
 
1528
1500
  convert$1.gray.cmyk = function (gray) {
1529
- return [0, 0, 0, gray[0]];
1501
+ return [0, 0, 0, gray[0]];
1530
1502
  };
1531
1503
 
1532
1504
  convert$1.gray.lab = function (gray) {
1533
- return [gray[0], 0, 0];
1505
+ return [gray[0], 0, 0];
1534
1506
  };
1535
1507
 
1536
1508
  convert$1.gray.hex = function (gray) {
1537
- const val = Math.round(gray[0] / 100 * 255) & 0xFF;
1538
- const integer = (val << 16) + (val << 8) + val;
1539
- const string = integer.toString(16).toUpperCase();
1540
- return '000000'.substring(string.length) + string;
1509
+ const val = Math.round(gray[0] / 100 * 255) & 0xFF;
1510
+ const integer = (val << 16) + (val << 8) + val;
1511
+
1512
+ const string = integer.toString(16).toUpperCase();
1513
+ return '000000'.substring(string.length) + string;
1541
1514
  };
1542
1515
 
1543
1516
  convert$1.rgb.gray = function (rgb) {
1544
- const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
1545
- return [val / 255 * 100];
1517
+ const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
1518
+ return [val / 255 * 100];
1546
1519
  };
1547
1520
 
1548
1521
  /*
@@ -1557,639 +1530,658 @@ convert$1.rgb.gray = function (rgb) {
1557
1530
  */
1558
1531
 
1559
1532
  function buildGraph() {
1560
- const graph = {}; // https://jsperf.com/object-keys-vs-for-in-with-closure/3
1561
-
1562
- const models = Object.keys(conversions);
1563
-
1564
- for (let len = models.length, i = 0; i < len; i++) {
1565
- graph[models[i]] = {
1566
- // http://jsperf.com/1-vs-infinity
1567
- // micro-opt, but this is simple.
1568
- distance: -1,
1569
- parent: null
1570
- };
1571
- }
1572
-
1573
- return graph;
1574
- } // https://en.wikipedia.org/wiki/Breadth-first_search
1533
+ const graph = {};
1534
+ // https://jsperf.com/object-keys-vs-for-in-with-closure/3
1535
+ const models = Object.keys(conversions);
1536
+
1537
+ for (let len = models.length, i = 0; i < len; i++) {
1538
+ graph[models[i]] = {
1539
+ // http://jsperf.com/1-vs-infinity
1540
+ // micro-opt, but this is simple.
1541
+ distance: -1,
1542
+ parent: null
1543
+ };
1544
+ }
1575
1545
 
1546
+ return graph;
1547
+ }
1576
1548
 
1549
+ // https://en.wikipedia.org/wiki/Breadth-first_search
1577
1550
  function deriveBFS(fromModel) {
1578
- const graph = buildGraph();
1579
- const queue = [fromModel]; // Unshift -> queue -> pop
1551
+ const graph = buildGraph();
1552
+ const queue = [fromModel]; // Unshift -> queue -> pop
1580
1553
 
1581
- graph[fromModel].distance = 0;
1554
+ graph[fromModel].distance = 0;
1582
1555
 
1583
- while (queue.length) {
1584
- const current = queue.pop();
1585
- const adjacents = Object.keys(conversions[current]);
1556
+ while (queue.length) {
1557
+ const current = queue.pop();
1558
+ const adjacents = Object.keys(conversions[current]);
1586
1559
 
1587
- for (let len = adjacents.length, i = 0; i < len; i++) {
1588
- const adjacent = adjacents[i];
1589
- const node = graph[adjacent];
1560
+ for (let len = adjacents.length, i = 0; i < len; i++) {
1561
+ const adjacent = adjacents[i];
1562
+ const node = graph[adjacent];
1590
1563
 
1591
- if (node.distance === -1) {
1592
- node.distance = graph[current].distance + 1;
1593
- node.parent = current;
1594
- queue.unshift(adjacent);
1595
- }
1596
- }
1597
- }
1564
+ if (node.distance === -1) {
1565
+ node.distance = graph[current].distance + 1;
1566
+ node.parent = current;
1567
+ queue.unshift(adjacent);
1568
+ }
1569
+ }
1570
+ }
1598
1571
 
1599
- return graph;
1572
+ return graph;
1600
1573
  }
1601
1574
 
1602
1575
  function link(from, to) {
1603
- return function (args) {
1604
- return to(from(args));
1605
- };
1576
+ return function (args) {
1577
+ return to(from(args));
1578
+ };
1606
1579
  }
1607
1580
 
1608
1581
  function wrapConversion(toModel, graph) {
1609
- const path = [graph[toModel].parent, toModel];
1610
- let fn = conversions[graph[toModel].parent][toModel];
1611
- let cur = graph[toModel].parent;
1612
-
1613
- while (graph[cur].parent) {
1614
- path.unshift(graph[cur].parent);
1615
- fn = link(conversions[graph[cur].parent][cur], fn);
1616
- cur = graph[cur].parent;
1617
- }
1582
+ const path = [graph[toModel].parent, toModel];
1583
+ let fn = conversions[graph[toModel].parent][toModel];
1584
+
1585
+ let cur = graph[toModel].parent;
1586
+ while (graph[cur].parent) {
1587
+ path.unshift(graph[cur].parent);
1588
+ fn = link(conversions[graph[cur].parent][cur], fn);
1589
+ cur = graph[cur].parent;
1590
+ }
1618
1591
 
1619
- fn.conversion = path;
1620
- return fn;
1592
+ fn.conversion = path;
1593
+ return fn;
1621
1594
  }
1622
1595
 
1623
1596
  var route = function (fromModel) {
1624
- const graph = deriveBFS(fromModel);
1625
- const conversion = {};
1626
- const models = Object.keys(graph);
1597
+ const graph = deriveBFS(fromModel);
1598
+ const conversion = {};
1627
1599
 
1628
- for (let len = models.length, i = 0; i < len; i++) {
1629
- const toModel = models[i];
1630
- const node = graph[toModel];
1600
+ const models = Object.keys(graph);
1601
+ for (let len = models.length, i = 0; i < len; i++) {
1602
+ const toModel = models[i];
1603
+ const node = graph[toModel];
1631
1604
 
1632
- if (node.parent === null) {
1633
- // No possible conversion, or this node is the source model.
1634
- continue;
1635
- }
1605
+ if (node.parent === null) {
1606
+ // No possible conversion, or this node is the source model.
1607
+ continue;
1608
+ }
1636
1609
 
1637
- conversion[toModel] = wrapConversion(toModel, graph);
1638
- }
1610
+ conversion[toModel] = wrapConversion(toModel, graph);
1611
+ }
1639
1612
 
1640
- return conversion;
1613
+ return conversion;
1641
1614
  };
1642
1615
 
1643
1616
  const convert = {};
1617
+
1644
1618
  const models = Object.keys(conversions);
1645
1619
 
1646
1620
  function wrapRaw(fn) {
1647
- const wrappedFn = function (...args) {
1648
- const arg0 = args[0];
1621
+ const wrappedFn = function (...args) {
1622
+ const arg0 = args[0];
1623
+ if (arg0 === undefined || arg0 === null) {
1624
+ return arg0;
1625
+ }
1649
1626
 
1650
- if (arg0 === undefined || arg0 === null) {
1651
- return arg0;
1652
- }
1627
+ if (arg0.length > 1) {
1628
+ args = arg0;
1629
+ }
1653
1630
 
1654
- if (arg0.length > 1) {
1655
- args = arg0;
1656
- }
1631
+ return fn(args);
1632
+ };
1657
1633
 
1658
- return fn(args);
1659
- }; // Preserve .conversion property if there is one
1634
+ // Preserve .conversion property if there is one
1635
+ if ('conversion' in fn) {
1636
+ wrappedFn.conversion = fn.conversion;
1637
+ }
1660
1638
 
1639
+ return wrappedFn;
1640
+ }
1661
1641
 
1662
- if ('conversion' in fn) {
1663
- wrappedFn.conversion = fn.conversion;
1664
- }
1642
+ function wrapRounded(fn) {
1643
+ const wrappedFn = function (...args) {
1644
+ const arg0 = args[0];
1645
+
1646
+ if (arg0 === undefined || arg0 === null) {
1647
+ return arg0;
1648
+ }
1649
+
1650
+ if (arg0.length > 1) {
1651
+ args = arg0;
1652
+ }
1653
+
1654
+ const result = fn(args);
1655
+
1656
+ // We're assuming the result is an array here.
1657
+ // see notice in conversions.js; don't use box types
1658
+ // in conversion functions.
1659
+ if (typeof result === 'object') {
1660
+ for (let len = result.length, i = 0; i < len; i++) {
1661
+ result[i] = Math.round(result[i]);
1662
+ }
1663
+ }
1664
+
1665
+ return result;
1666
+ };
1667
+
1668
+ // Preserve .conversion property if there is one
1669
+ if ('conversion' in fn) {
1670
+ wrappedFn.conversion = fn.conversion;
1671
+ }
1665
1672
 
1666
- return wrappedFn;
1673
+ return wrappedFn;
1667
1674
  }
1668
1675
 
1669
- function wrapRounded(fn) {
1670
- const wrappedFn = function (...args) {
1671
- const arg0 = args[0];
1672
-
1673
- if (arg0 === undefined || arg0 === null) {
1674
- return arg0;
1675
- }
1676
+ models.forEach(fromModel => {
1677
+ convert[fromModel] = {};
1676
1678
 
1677
- if (arg0.length > 1) {
1678
- args = arg0;
1679
- }
1679
+ Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});
1680
+ Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});
1680
1681
 
1681
- const result = fn(args); // We're assuming the result is an array here.
1682
- // see notice in conversions.js; don't use box types
1683
- // in conversion functions.
1682
+ const routes = route(fromModel);
1683
+ const routeModels = Object.keys(routes);
1684
1684
 
1685
- if (typeof result === 'object') {
1686
- for (let len = result.length, i = 0; i < len; i++) {
1687
- result[i] = Math.round(result[i]);
1688
- }
1689
- }
1685
+ routeModels.forEach(toModel => {
1686
+ const fn = routes[toModel];
1690
1687
 
1691
- return result;
1692
- }; // Preserve .conversion property if there is one
1688
+ convert[fromModel][toModel] = wrapRounded(fn);
1689
+ convert[fromModel][toModel].raw = wrapRaw(fn);
1690
+ });
1691
+ });
1693
1692
 
1693
+ var colorConvert = convert;
1694
1694
 
1695
- if ('conversion' in fn) {
1696
- wrappedFn.conversion = fn.conversion;
1697
- }
1695
+ const skippedModels = [
1696
+ // To be honest, I don't really feel like keyword belongs in color convert, but eh.
1697
+ 'keyword',
1698
1698
 
1699
- return wrappedFn;
1700
- }
1699
+ // Gray conflicts with some method names, and has its own method defined.
1700
+ 'gray',
1701
1701
 
1702
- models.forEach(fromModel => {
1703
- convert[fromModel] = {};
1704
- Object.defineProperty(convert[fromModel], 'channels', {
1705
- value: conversions[fromModel].channels
1706
- });
1707
- Object.defineProperty(convert[fromModel], 'labels', {
1708
- value: conversions[fromModel].labels
1709
- });
1710
- const routes = route(fromModel);
1711
- const routeModels = Object.keys(routes);
1712
- routeModels.forEach(toModel => {
1713
- const fn = routes[toModel];
1714
- convert[fromModel][toModel] = wrapRounded(fn);
1715
- convert[fromModel][toModel].raw = wrapRaw(fn);
1716
- });
1717
- });
1718
- var colorConvert = convert;
1702
+ // Shouldn't really be in color-convert either...
1703
+ 'hex',
1704
+ ];
1719
1705
 
1720
- const _slice = [].slice;
1721
- const skippedModels = [// To be honest, I don't really feel like keyword belongs in color convert, but eh.
1722
- 'keyword', // Gray conflicts with some method names, and has its own method defined.
1723
- 'gray', // Shouldn't really be in color-convert either...
1724
- 'hex'];
1725
1706
  const hashedModelKeys = {};
1726
-
1727
1707
  for (const model of Object.keys(colorConvert)) {
1728
- hashedModelKeys[_slice.call(colorConvert[model].labels).sort().join('')] = model;
1708
+ hashedModelKeys[[...colorConvert[model].labels].sort().join('')] = model;
1729
1709
  }
1730
1710
 
1731
1711
  const limiters = {};
1732
1712
 
1733
1713
  function Color(object, model) {
1734
- if (!(this instanceof Color)) {
1735
- return new Color(object, model);
1736
- }
1737
-
1738
- if (model && model in skippedModels) {
1739
- model = null;
1740
- }
1741
-
1742
- if (model && !(model in colorConvert)) {
1743
- throw new Error('Unknown model: ' + model);
1744
- }
1745
-
1746
- let i;
1747
- let channels;
1748
-
1749
- if (object == null) {
1750
- // eslint-disable-line no-eq-null,eqeqeq
1751
- this.model = 'rgb';
1752
- this.color = [0, 0, 0];
1753
- this.valpha = 1;
1754
- } else if (object instanceof Color) {
1755
- this.model = object.model;
1756
- this.color = object.color.slice();
1757
- this.valpha = object.valpha;
1758
- } else if (typeof object === 'string') {
1759
- const result = colorString.get(object);
1760
-
1761
- if (result === null) {
1762
- throw new Error('Unable to parse color from string: ' + object);
1763
- }
1714
+ if (!(this instanceof Color)) {
1715
+ return new Color(object, model);
1716
+ }
1764
1717
 
1765
- this.model = result.model;
1766
- channels = colorConvert[this.model].channels;
1767
- this.color = result.value.slice(0, channels);
1768
- this.valpha = typeof result.value[channels] === 'number' ? result.value[channels] : 1;
1769
- } else if (object.length > 0) {
1770
- this.model = model || 'rgb';
1771
- channels = colorConvert[this.model].channels;
1772
-
1773
- const newArray = _slice.call(object, 0, channels);
1774
-
1775
- this.color = zeroArray(newArray, channels);
1776
- this.valpha = typeof object[channels] === 'number' ? object[channels] : 1;
1777
- } else if (typeof object === 'number') {
1778
- // This is always RGB - can be converted later on.
1779
- this.model = 'rgb';
1780
- this.color = [object >> 16 & 0xFF, object >> 8 & 0xFF, object & 0xFF];
1781
- this.valpha = 1;
1782
- } else {
1783
- this.valpha = 1;
1784
- const keys = Object.keys(object);
1785
-
1786
- if ('alpha' in object) {
1787
- keys.splice(keys.indexOf('alpha'), 1);
1788
- this.valpha = typeof object.alpha === 'number' ? object.alpha : 0;
1789
- }
1718
+ if (model && model in skippedModels) {
1719
+ model = null;
1720
+ }
1790
1721
 
1791
- const hashedKeys = keys.sort().join('');
1722
+ if (model && !(model in colorConvert)) {
1723
+ throw new Error('Unknown model: ' + model);
1724
+ }
1792
1725
 
1793
- if (!(hashedKeys in hashedModelKeys)) {
1794
- throw new Error('Unable to parse color from object: ' + JSON.stringify(object));
1795
- }
1726
+ let i;
1727
+ let channels;
1728
+
1729
+ if (object == null) { // eslint-disable-line no-eq-null,eqeqeq
1730
+ this.model = 'rgb';
1731
+ this.color = [0, 0, 0];
1732
+ this.valpha = 1;
1733
+ } else if (object instanceof Color) {
1734
+ this.model = object.model;
1735
+ this.color = [...object.color];
1736
+ this.valpha = object.valpha;
1737
+ } else if (typeof object === 'string') {
1738
+ const result = colorString.get(object);
1739
+ if (result === null) {
1740
+ throw new Error('Unable to parse color from string: ' + object);
1741
+ }
1796
1742
 
1797
- this.model = hashedModelKeys[hashedKeys];
1798
- const labels = colorConvert[this.model].labels;
1799
- const color = [];
1743
+ this.model = result.model;
1744
+ channels = colorConvert[this.model].channels;
1745
+ this.color = result.value.slice(0, channels);
1746
+ this.valpha = typeof result.value[channels] === 'number' ? result.value[channels] : 1;
1747
+ } else if (object.length > 0) {
1748
+ this.model = model || 'rgb';
1749
+ channels = colorConvert[this.model].channels;
1750
+ const newArray = Array.prototype.slice.call(object, 0, channels);
1751
+ this.color = zeroArray(newArray, channels);
1752
+ this.valpha = typeof object[channels] === 'number' ? object[channels] : 1;
1753
+ } else if (typeof object === 'number') {
1754
+ // This is always RGB - can be converted later on.
1755
+ this.model = 'rgb';
1756
+ this.color = [
1757
+ (object >> 16) & 0xFF,
1758
+ (object >> 8) & 0xFF,
1759
+ object & 0xFF,
1760
+ ];
1761
+ this.valpha = 1;
1762
+ } else {
1763
+ this.valpha = 1;
1800
1764
 
1801
- for (i = 0; i < labels.length; i++) {
1802
- color.push(object[labels[i]]);
1803
- }
1765
+ const keys = Object.keys(object);
1766
+ if ('alpha' in object) {
1767
+ keys.splice(keys.indexOf('alpha'), 1);
1768
+ this.valpha = typeof object.alpha === 'number' ? object.alpha : 0;
1769
+ }
1804
1770
 
1805
- this.color = zeroArray(color);
1806
- } // Perform limitations (clamping, etc.)
1771
+ const hashedKeys = keys.sort().join('');
1772
+ if (!(hashedKeys in hashedModelKeys)) {
1773
+ throw new Error('Unable to parse color from object: ' + JSON.stringify(object));
1774
+ }
1807
1775
 
1776
+ this.model = hashedModelKeys[hashedKeys];
1808
1777
 
1809
- if (limiters[this.model]) {
1810
- channels = colorConvert[this.model].channels;
1778
+ const {labels} = colorConvert[this.model];
1779
+ const color = [];
1780
+ for (i = 0; i < labels.length; i++) {
1781
+ color.push(object[labels[i]]);
1782
+ }
1811
1783
 
1812
- for (i = 0; i < channels; i++) {
1813
- const limit = limiters[this.model][i];
1784
+ this.color = zeroArray(color);
1785
+ }
1814
1786
 
1815
- if (limit) {
1816
- this.color[i] = limit(this.color[i]);
1817
- }
1818
- }
1819
- }
1787
+ // Perform limitations (clamping, etc.)
1788
+ if (limiters[this.model]) {
1789
+ channels = colorConvert[this.model].channels;
1790
+ for (i = 0; i < channels; i++) {
1791
+ const limit = limiters[this.model][i];
1792
+ if (limit) {
1793
+ this.color[i] = limit(this.color[i]);
1794
+ }
1795
+ }
1796
+ }
1820
1797
 
1821
- this.valpha = Math.max(0, Math.min(1, this.valpha));
1798
+ this.valpha = Math.max(0, Math.min(1, this.valpha));
1822
1799
 
1823
- if (Object.freeze) {
1824
- Object.freeze(this);
1825
- }
1800
+ if (Object.freeze) {
1801
+ Object.freeze(this);
1802
+ }
1826
1803
  }
1827
1804
 
1828
1805
  Color.prototype = {
1829
- toString() {
1830
- return this.string();
1831
- },
1832
-
1833
- toJSON() {
1834
- return this[this.model]();
1835
- },
1836
-
1837
- string(places) {
1838
- let self = this.model in colorString.to ? this : this.rgb();
1839
- self = self.round(typeof places === 'number' ? places : 1);
1840
- const args = self.valpha === 1 ? self.color : self.color.concat(this.valpha);
1841
- return colorString.to[self.model](args);
1842
- },
1843
-
1844
- percentString(places) {
1845
- const self = this.rgb().round(typeof places === 'number' ? places : 1);
1846
- const args = self.valpha === 1 ? self.color : self.color.concat(this.valpha);
1847
- return colorString.to.rgb.percent(args);
1848
- },
1849
-
1850
- array() {
1851
- return this.valpha === 1 ? this.color.slice() : this.color.concat(this.valpha);
1852
- },
1853
-
1854
- object() {
1855
- const result = {};
1856
- const channels = colorConvert[this.model].channels;
1857
- const labels = colorConvert[this.model].labels;
1858
-
1859
- for (let i = 0; i < channels; i++) {
1860
- result[labels[i]] = this.color[i];
1861
- }
1862
-
1863
- if (this.valpha !== 1) {
1864
- result.alpha = this.valpha;
1865
- }
1866
-
1867
- return result;
1868
- },
1806
+ toString() {
1807
+ return this.string();
1808
+ },
1809
+
1810
+ toJSON() {
1811
+ return this[this.model]();
1812
+ },
1813
+
1814
+ string(places) {
1815
+ let self = this.model in colorString.to ? this : this.rgb();
1816
+ self = self.round(typeof places === 'number' ? places : 1);
1817
+ const args = self.valpha === 1 ? self.color : [...self.color, this.valpha];
1818
+ return colorString.to[self.model](args);
1819
+ },
1820
+
1821
+ percentString(places) {
1822
+ const self = this.rgb().round(typeof places === 'number' ? places : 1);
1823
+ const args = self.valpha === 1 ? self.color : [...self.color, this.valpha];
1824
+ return colorString.to.rgb.percent(args);
1825
+ },
1826
+
1827
+ array() {
1828
+ return this.valpha === 1 ? [...this.color] : [...this.color, this.valpha];
1829
+ },
1830
+
1831
+ object() {
1832
+ const result = {};
1833
+ const {channels} = colorConvert[this.model];
1834
+ const {labels} = colorConvert[this.model];
1835
+
1836
+ for (let i = 0; i < channels; i++) {
1837
+ result[labels[i]] = this.color[i];
1838
+ }
1869
1839
 
1870
- unitArray() {
1871
- const rgb = this.rgb().color;
1872
- rgb[0] /= 255;
1873
- rgb[1] /= 255;
1874
- rgb[2] /= 255;
1840
+ if (this.valpha !== 1) {
1841
+ result.alpha = this.valpha;
1842
+ }
1875
1843
 
1876
- if (this.valpha !== 1) {
1877
- rgb.push(this.valpha);
1878
- }
1844
+ return result;
1845
+ },
1879
1846
 
1880
- return rgb;
1881
- },
1847
+ unitArray() {
1848
+ const rgb = this.rgb().color;
1849
+ rgb[0] /= 255;
1850
+ rgb[1] /= 255;
1851
+ rgb[2] /= 255;
1882
1852
 
1883
- unitObject() {
1884
- const rgb = this.rgb().object();
1885
- rgb.r /= 255;
1886
- rgb.g /= 255;
1887
- rgb.b /= 255;
1853
+ if (this.valpha !== 1) {
1854
+ rgb.push(this.valpha);
1855
+ }
1888
1856
 
1889
- if (this.valpha !== 1) {
1890
- rgb.alpha = this.valpha;
1891
- }
1857
+ return rgb;
1858
+ },
1892
1859
 
1893
- return rgb;
1894
- },
1860
+ unitObject() {
1861
+ const rgb = this.rgb().object();
1862
+ rgb.r /= 255;
1863
+ rgb.g /= 255;
1864
+ rgb.b /= 255;
1895
1865
 
1896
- round(places) {
1897
- places = Math.max(places || 0, 0);
1898
- return new Color(this.color.map(roundToPlace(places)).concat(this.valpha), this.model);
1899
- },
1866
+ if (this.valpha !== 1) {
1867
+ rgb.alpha = this.valpha;
1868
+ }
1900
1869
 
1901
- alpha(value) {
1902
- if (arguments.length > 0) {
1903
- return new Color(this.color.concat(Math.max(0, Math.min(1, value))), this.model);
1904
- }
1870
+ return rgb;
1871
+ },
1905
1872
 
1906
- return this.valpha;
1907
- },
1873
+ round(places) {
1874
+ places = Math.max(places || 0, 0);
1875
+ return new Color([...this.color.map(roundToPlace(places)), this.valpha], this.model);
1876
+ },
1908
1877
 
1909
- // Rgb
1910
- red: getset('rgb', 0, maxfn(255)),
1911
- green: getset('rgb', 1, maxfn(255)),
1912
- blue: getset('rgb', 2, maxfn(255)),
1913
- hue: getset(['hsl', 'hsv', 'hsl', 'hwb', 'hcg'], 0, value => (value % 360 + 360) % 360),
1914
- saturationl: getset('hsl', 1, maxfn(100)),
1915
- lightness: getset('hsl', 2, maxfn(100)),
1916
- saturationv: getset('hsv', 1, maxfn(100)),
1917
- value: getset('hsv', 2, maxfn(100)),
1918
- chroma: getset('hcg', 1, maxfn(100)),
1919
- gray: getset('hcg', 2, maxfn(100)),
1920
- white: getset('hwb', 1, maxfn(100)),
1921
- wblack: getset('hwb', 2, maxfn(100)),
1922
- cyan: getset('cmyk', 0, maxfn(100)),
1923
- magenta: getset('cmyk', 1, maxfn(100)),
1924
- yellow: getset('cmyk', 2, maxfn(100)),
1925
- black: getset('cmyk', 3, maxfn(100)),
1926
- x: getset('xyz', 0, maxfn(100)),
1927
- y: getset('xyz', 1, maxfn(100)),
1928
- z: getset('xyz', 2, maxfn(100)),
1929
- l: getset('lab', 0, maxfn(100)),
1930
- a: getset('lab', 1),
1931
- b: getset('lab', 2),
1932
-
1933
- keyword(value) {
1934
- if (arguments.length > 0) {
1935
- return new Color(value);
1936
- }
1878
+ alpha(value) {
1879
+ if (value !== undefined) {
1880
+ return new Color([...this.color, Math.max(0, Math.min(1, value))], this.model);
1881
+ }
1937
1882
 
1938
- return colorConvert[this.model].keyword(this.color);
1939
- },
1883
+ return this.valpha;
1884
+ },
1940
1885
 
1941
- hex(value) {
1942
- if (arguments.length > 0) {
1943
- return new Color(value);
1944
- }
1886
+ // Rgb
1887
+ red: getset('rgb', 0, maxfn(255)),
1888
+ green: getset('rgb', 1, maxfn(255)),
1889
+ blue: getset('rgb', 2, maxfn(255)),
1945
1890
 
1946
- return colorString.to.hex(this.rgb().round().color);
1947
- },
1891
+ hue: getset(['hsl', 'hsv', 'hsl', 'hwb', 'hcg'], 0, value => ((value % 360) + 360) % 360),
1948
1892
 
1949
- hexa(value) {
1950
- if (arguments.length > 0) {
1951
- return new Color(value);
1952
- }
1893
+ saturationl: getset('hsl', 1, maxfn(100)),
1894
+ lightness: getset('hsl', 2, maxfn(100)),
1953
1895
 
1954
- const rgbArray = this.rgb().round().color;
1955
- let alphaHex = Math.round(this.valpha * 255).toString(16).toUpperCase();
1896
+ saturationv: getset('hsv', 1, maxfn(100)),
1897
+ value: getset('hsv', 2, maxfn(100)),
1956
1898
 
1957
- if (alphaHex.length === 1) {
1958
- alphaHex = '0' + alphaHex;
1959
- }
1899
+ chroma: getset('hcg', 1, maxfn(100)),
1900
+ gray: getset('hcg', 2, maxfn(100)),
1960
1901
 
1961
- return colorString.to.hex(rgbArray) + alphaHex;
1962
- },
1902
+ white: getset('hwb', 1, maxfn(100)),
1903
+ wblack: getset('hwb', 2, maxfn(100)),
1963
1904
 
1964
- rgbNumber() {
1965
- const rgb = this.rgb().color;
1966
- return (rgb[0] & 0xFF) << 16 | (rgb[1] & 0xFF) << 8 | rgb[2] & 0xFF;
1967
- },
1905
+ cyan: getset('cmyk', 0, maxfn(100)),
1906
+ magenta: getset('cmyk', 1, maxfn(100)),
1907
+ yellow: getset('cmyk', 2, maxfn(100)),
1908
+ black: getset('cmyk', 3, maxfn(100)),
1968
1909
 
1969
- luminosity() {
1970
- // http://www.w3.org/TR/WCAG20/#relativeluminancedef
1971
- const rgb = this.rgb().color;
1972
- const lum = [];
1910
+ x: getset('xyz', 0, maxfn(95.047)),
1911
+ y: getset('xyz', 1, maxfn(100)),
1912
+ z: getset('xyz', 2, maxfn(108.833)),
1973
1913
 
1974
- for (const [i, element] of rgb.entries()) {
1975
- const chan = element / 255;
1976
- lum[i] = chan <= 0.03928 ? chan / 12.92 : ((chan + 0.055) / 1.055) ** 2.4;
1977
- }
1914
+ l: getset('lab', 0, maxfn(100)),
1915
+ a: getset('lab', 1),
1916
+ b: getset('lab', 2),
1978
1917
 
1979
- return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
1980
- },
1918
+ keyword(value) {
1919
+ if (value !== undefined) {
1920
+ return new Color(value);
1921
+ }
1981
1922
 
1982
- contrast(color2) {
1983
- // http://www.w3.org/TR/WCAG20/#contrast-ratiodef
1984
- const lum1 = this.luminosity();
1985
- const lum2 = color2.luminosity();
1923
+ return colorConvert[this.model].keyword(this.color);
1924
+ },
1986
1925
 
1987
- if (lum1 > lum2) {
1988
- return (lum1 + 0.05) / (lum2 + 0.05);
1989
- }
1926
+ hex(value) {
1927
+ if (value !== undefined) {
1928
+ return new Color(value);
1929
+ }
1990
1930
 
1991
- return (lum2 + 0.05) / (lum1 + 0.05);
1992
- },
1931
+ return colorString.to.hex(this.rgb().round().color);
1932
+ },
1993
1933
 
1994
- level(color2) {
1995
- const contrastRatio = this.contrast(color2);
1934
+ hexa(value) {
1935
+ if (value !== undefined) {
1936
+ return new Color(value);
1937
+ }
1996
1938
 
1997
- if (contrastRatio >= 7.1) {
1998
- return 'AAA';
1999
- }
1939
+ const rgbArray = this.rgb().round().color;
2000
1940
 
2001
- return contrastRatio >= 4.5 ? 'AA' : '';
2002
- },
1941
+ let alphaHex = Math.round(this.valpha * 255).toString(16).toUpperCase();
1942
+ if (alphaHex.length === 1) {
1943
+ alphaHex = '0' + alphaHex;
1944
+ }
2003
1945
 
2004
- isDark() {
2005
- // YIQ equation from http://24ways.org/2010/calculating-color-contrast
2006
- const rgb = this.rgb().color;
2007
- const yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000;
2008
- return yiq < 128;
2009
- },
1946
+ return colorString.to.hex(rgbArray) + alphaHex;
1947
+ },
2010
1948
 
2011
- isLight() {
2012
- return !this.isDark();
2013
- },
1949
+ rgbNumber() {
1950
+ const rgb = this.rgb().color;
1951
+ return ((rgb[0] & 0xFF) << 16) | ((rgb[1] & 0xFF) << 8) | (rgb[2] & 0xFF);
1952
+ },
2014
1953
 
2015
- negate() {
2016
- const rgb = this.rgb();
1954
+ luminosity() {
1955
+ // http://www.w3.org/TR/WCAG20/#relativeluminancedef
1956
+ const rgb = this.rgb().color;
2017
1957
 
2018
- for (let i = 0; i < 3; i++) {
2019
- rgb.color[i] = 255 - rgb.color[i];
2020
- }
1958
+ const lum = [];
1959
+ for (const [i, element] of rgb.entries()) {
1960
+ const chan = element / 255;
1961
+ lum[i] = (chan <= 0.04045) ? chan / 12.92 : ((chan + 0.055) / 1.055) ** 2.4;
1962
+ }
2021
1963
 
2022
- return rgb;
2023
- },
1964
+ return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
1965
+ },
2024
1966
 
2025
- lighten(ratio) {
2026
- const hsl = this.hsl();
2027
- hsl.color[2] += hsl.color[2] * ratio;
2028
- return hsl;
2029
- },
1967
+ contrast(color2) {
1968
+ // http://www.w3.org/TR/WCAG20/#contrast-ratiodef
1969
+ const lum1 = this.luminosity();
1970
+ const lum2 = color2.luminosity();
2030
1971
 
2031
- darken(ratio) {
2032
- const hsl = this.hsl();
2033
- hsl.color[2] -= hsl.color[2] * ratio;
2034
- return hsl;
2035
- },
1972
+ if (lum1 > lum2) {
1973
+ return (lum1 + 0.05) / (lum2 + 0.05);
1974
+ }
2036
1975
 
2037
- saturate(ratio) {
2038
- const hsl = this.hsl();
2039
- hsl.color[1] += hsl.color[1] * ratio;
2040
- return hsl;
2041
- },
1976
+ return (lum2 + 0.05) / (lum1 + 0.05);
1977
+ },
2042
1978
 
2043
- desaturate(ratio) {
2044
- const hsl = this.hsl();
2045
- hsl.color[1] -= hsl.color[1] * ratio;
2046
- return hsl;
2047
- },
1979
+ level(color2) {
1980
+ // https://www.w3.org/TR/WCAG/#contrast-enhanced
1981
+ const contrastRatio = this.contrast(color2);
1982
+ if (contrastRatio >= 7) {
1983
+ return 'AAA';
1984
+ }
2048
1985
 
2049
- whiten(ratio) {
2050
- const hwb = this.hwb();
2051
- hwb.color[1] += hwb.color[1] * ratio;
2052
- return hwb;
2053
- },
1986
+ return (contrastRatio >= 4.5) ? 'AA' : '';
1987
+ },
2054
1988
 
2055
- blacken(ratio) {
2056
- const hwb = this.hwb();
2057
- hwb.color[2] += hwb.color[2] * ratio;
2058
- return hwb;
2059
- },
1989
+ isDark() {
1990
+ // YIQ equation from http://24ways.org/2010/calculating-color-contrast
1991
+ const rgb = this.rgb().color;
1992
+ const yiq = (rgb[0] * 2126 + rgb[1] * 7152 + rgb[2] * 722) / 10000;
1993
+ return yiq < 128;
1994
+ },
2060
1995
 
2061
- grayscale() {
2062
- // http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale
2063
- const rgb = this.rgb().color;
2064
- const value = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
2065
- return Color.rgb(value, value, value);
2066
- },
1996
+ isLight() {
1997
+ return !this.isDark();
1998
+ },
2067
1999
 
2068
- fade(ratio) {
2069
- return this.alpha(this.valpha - this.valpha * ratio);
2070
- },
2000
+ negate() {
2001
+ const rgb = this.rgb();
2002
+ for (let i = 0; i < 3; i++) {
2003
+ rgb.color[i] = 255 - rgb.color[i];
2004
+ }
2071
2005
 
2072
- opaquer(ratio) {
2073
- return this.alpha(this.valpha + this.valpha * ratio);
2074
- },
2006
+ return rgb;
2007
+ },
2008
+
2009
+ lighten(ratio) {
2010
+ const hsl = this.hsl();
2011
+ hsl.color[2] += hsl.color[2] * ratio;
2012
+ return hsl;
2013
+ },
2014
+
2015
+ darken(ratio) {
2016
+ const hsl = this.hsl();
2017
+ hsl.color[2] -= hsl.color[2] * ratio;
2018
+ return hsl;
2019
+ },
2020
+
2021
+ saturate(ratio) {
2022
+ const hsl = this.hsl();
2023
+ hsl.color[1] += hsl.color[1] * ratio;
2024
+ return hsl;
2025
+ },
2026
+
2027
+ desaturate(ratio) {
2028
+ const hsl = this.hsl();
2029
+ hsl.color[1] -= hsl.color[1] * ratio;
2030
+ return hsl;
2031
+ },
2032
+
2033
+ whiten(ratio) {
2034
+ const hwb = this.hwb();
2035
+ hwb.color[1] += hwb.color[1] * ratio;
2036
+ return hwb;
2037
+ },
2038
+
2039
+ blacken(ratio) {
2040
+ const hwb = this.hwb();
2041
+ hwb.color[2] += hwb.color[2] * ratio;
2042
+ return hwb;
2043
+ },
2044
+
2045
+ grayscale() {
2046
+ // http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale
2047
+ const rgb = this.rgb().color;
2048
+ const value = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
2049
+ return Color.rgb(value, value, value);
2050
+ },
2051
+
2052
+ fade(ratio) {
2053
+ return this.alpha(this.valpha - (this.valpha * ratio));
2054
+ },
2055
+
2056
+ opaquer(ratio) {
2057
+ return this.alpha(this.valpha + (this.valpha * ratio));
2058
+ },
2059
+
2060
+ rotate(degrees) {
2061
+ const hsl = this.hsl();
2062
+ let hue = hsl.color[0];
2063
+ hue = (hue + degrees) % 360;
2064
+ hue = hue < 0 ? 360 + hue : hue;
2065
+ hsl.color[0] = hue;
2066
+ return hsl;
2067
+ },
2068
+
2069
+ mix(mixinColor, weight) {
2070
+ // Ported from sass implementation in C
2071
+ // https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209
2072
+ if (!mixinColor || !mixinColor.rgb) {
2073
+ throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof mixinColor);
2074
+ }
2075
2075
 
2076
- rotate(degrees) {
2077
- const hsl = this.hsl();
2078
- let hue = hsl.color[0];
2079
- hue = (hue + degrees) % 360;
2080
- hue = hue < 0 ? 360 + hue : hue;
2081
- hsl.color[0] = hue;
2082
- return hsl;
2083
- },
2076
+ const color1 = mixinColor.rgb();
2077
+ const color2 = this.rgb();
2078
+ const p = weight === undefined ? 0.5 : weight;
2084
2079
 
2085
- mix(mixinColor, weight) {
2086
- // Ported from sass implementation in C
2087
- // https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209
2088
- if (!mixinColor || !mixinColor.rgb) {
2089
- throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof mixinColor);
2090
- }
2080
+ const w = 2 * p - 1;
2081
+ const a = color1.alpha() - color2.alpha();
2091
2082
 
2092
- const color1 = mixinColor.rgb();
2093
- const color2 = this.rgb();
2094
- const p = weight === undefined ? 0.5 : weight;
2095
- const w = 2 * p - 1;
2096
- const a = color1.alpha() - color2.alpha();
2097
- const w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2;
2098
- const w2 = 1 - w1;
2099
- 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));
2100
- }
2083
+ const w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2;
2084
+ const w2 = 1 - w1;
2101
2085
 
2102
- }; // Model conversion methods and static constructors
2086
+ return Color.rgb(
2087
+ w1 * color1.red() + w2 * color2.red(),
2088
+ w1 * color1.green() + w2 * color2.green(),
2089
+ w1 * color1.blue() + w2 * color2.blue(),
2090
+ color1.alpha() * p + color2.alpha() * (1 - p));
2091
+ },
2092
+ };
2103
2093
 
2094
+ // Model conversion methods and static constructors
2104
2095
  for (const model of Object.keys(colorConvert)) {
2105
- if (skippedModels.includes(model)) {
2106
- continue;
2107
- }
2108
-
2109
- const channels = colorConvert[model].channels; // Conversion methods
2096
+ if (skippedModels.includes(model)) {
2097
+ continue;
2098
+ }
2110
2099
 
2111
- Color.prototype[model] = function () {
2112
- if (this.model === model) {
2113
- return new Color(this);
2114
- }
2100
+ const {channels} = colorConvert[model];
2115
2101
 
2116
- if (arguments.length > 0) {
2117
- return new Color(arguments, model);
2118
- }
2102
+ // Conversion methods
2103
+ Color.prototype[model] = function (...args) {
2104
+ if (this.model === model) {
2105
+ return new Color(this);
2106
+ }
2119
2107
 
2120
- const newAlpha = typeof arguments[channels] === 'number' ? channels : this.valpha;
2121
- return new Color(assertArray(colorConvert[this.model][model].raw(this.color)).concat(newAlpha), model);
2122
- }; // 'static' construction methods
2108
+ if (args.length > 0) {
2109
+ return new Color(args, model);
2110
+ }
2123
2111
 
2112
+ return new Color([...assertArray(colorConvert[this.model][model].raw(this.color)), this.valpha], model);
2113
+ };
2124
2114
 
2125
- Color[model] = function (color) {
2126
- if (typeof color === 'number') {
2127
- color = zeroArray(_slice.call(arguments), channels);
2128
- }
2115
+ // 'static' construction methods
2116
+ Color[model] = function (...args) {
2117
+ let color = args[0];
2118
+ if (typeof color === 'number') {
2119
+ color = zeroArray(args, channels);
2120
+ }
2129
2121
 
2130
- return new Color(color, model);
2131
- };
2122
+ return new Color(color, model);
2123
+ };
2132
2124
  }
2133
2125
 
2134
2126
  function roundTo(number, places) {
2135
- return Number(number.toFixed(places));
2127
+ return Number(number.toFixed(places));
2136
2128
  }
2137
2129
 
2138
2130
  function roundToPlace(places) {
2139
- return function (number) {
2140
- return roundTo(number, places);
2141
- };
2131
+ return function (number) {
2132
+ return roundTo(number, places);
2133
+ };
2142
2134
  }
2143
2135
 
2144
2136
  function getset(model, channel, modifier) {
2145
- model = Array.isArray(model) ? model : [model];
2137
+ model = Array.isArray(model) ? model : [model];
2146
2138
 
2147
- for (const m of model) {
2148
- (limiters[m] || (limiters[m] = []))[channel] = modifier;
2149
- }
2139
+ for (const m of model) {
2140
+ (limiters[m] || (limiters[m] = []))[channel] = modifier;
2141
+ }
2150
2142
 
2151
- model = model[0];
2152
- return function (value) {
2153
- let result;
2143
+ model = model[0];
2154
2144
 
2155
- if (arguments.length > 0) {
2156
- if (modifier) {
2157
- value = modifier(value);
2158
- }
2145
+ return function (value) {
2146
+ let result;
2159
2147
 
2160
- result = this[model]();
2161
- result.color[channel] = value;
2162
- return result;
2163
- }
2148
+ if (value !== undefined) {
2149
+ if (modifier) {
2150
+ value = modifier(value);
2151
+ }
2164
2152
 
2165
- result = this[model]().color[channel];
2153
+ result = this[model]();
2154
+ result.color[channel] = value;
2155
+ return result;
2156
+ }
2166
2157
 
2167
- if (modifier) {
2168
- result = modifier(result);
2169
- }
2158
+ result = this[model]().color[channel];
2159
+ if (modifier) {
2160
+ result = modifier(result);
2161
+ }
2170
2162
 
2171
- return result;
2172
- };
2163
+ return result;
2164
+ };
2173
2165
  }
2174
2166
 
2175
2167
  function maxfn(max) {
2176
- return function (v) {
2177
- return Math.max(0, Math.min(max, v));
2178
- };
2168
+ return function (v) {
2169
+ return Math.max(0, Math.min(max, v));
2170
+ };
2179
2171
  }
2180
2172
 
2181
2173
  function assertArray(value) {
2182
- return Array.isArray(value) ? value : [value];
2174
+ return Array.isArray(value) ? value : [value];
2183
2175
  }
2184
2176
 
2185
2177
  function zeroArray(array, length) {
2186
- for (let i = 0; i < length; i++) {
2187
- if (typeof array[i] !== 'number') {
2188
- array[i] = 0;
2189
- }
2190
- }
2178
+ for (let i = 0; i < length; i++) {
2179
+ if (typeof array[i] !== 'number') {
2180
+ array[i] = 0;
2181
+ }
2182
+ }
2191
2183
 
2192
- return array;
2184
+ return array;
2193
2185
  }
2194
2186
 
2195
2187
  var color = Color;
@@ -2295,7 +2287,7 @@ const DIMENSIONS = {
2295
2287
  }
2296
2288
  };
2297
2289
 
2298
- 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}";
2290
+ 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}";
2299
2291
 
2300
2292
  const throttleFor60FpsInMs = 16;
2301
2293
  const defaultValue = normalizeHex(DEFAULT_COLOR$1.hex());
@@ -2332,6 +2324,7 @@ const ColorPicker = class {
2332
2324
  * The format of the value property.
2333
2325
  *
2334
2326
  * When "auto", the format will be inferred from `value` when set.
2327
+ *
2335
2328
  * @default "auto"
2336
2329
  */
2337
2330
  this.format = defaultFormat;
@@ -2341,80 +2334,117 @@ const ColorPicker = class {
2341
2334
  this.hideChannels = false;
2342
2335
  /** When true, hides the saved colors section */
2343
2336
  this.hideSaved = false;
2344
- /** Label used for the blue channel
2337
+ /**
2338
+ * Label used for the blue channel
2339
+ *
2345
2340
  * @default "B"
2346
2341
  */
2347
2342
  this.intlB = TEXT.b;
2348
- /** Label used for the blue channel description
2343
+ /**
2344
+ * Label used for the blue channel description
2345
+ *
2349
2346
  * @default "Blue"
2350
2347
  */
2351
2348
  this.intlBlue = TEXT.blue;
2352
- /** Label used for the delete color button.
2349
+ /**
2350
+ * Label used for the delete color button.
2351
+ *
2353
2352
  * @default "Delete color"
2354
2353
  */
2355
2354
  this.intlDeleteColor = TEXT.deleteColor;
2356
- /** Label used for the green channel
2355
+ /**
2356
+ * Label used for the green channel
2357
+ *
2357
2358
  * @default "G"
2358
2359
  */
2359
2360
  this.intlG = TEXT.g;
2360
- /** Label used for the green channel description
2361
+ /**
2362
+ * Label used for the green channel description
2363
+ *
2361
2364
  * @default "Green"
2362
2365
  */
2363
2366
  this.intlGreen = TEXT.green;
2364
- /** Label used for the hue channel
2367
+ /**
2368
+ * Label used for the hue channel
2369
+ *
2365
2370
  * @default "H"
2366
2371
  */
2367
2372
  this.intlH = TEXT.h;
2368
- /** Label used for the HSV mode
2373
+ /**
2374
+ * Label used for the HSV mode
2375
+ *
2369
2376
  * @default "HSV"
2370
2377
  */
2371
2378
  this.intlHsv = TEXT.hsv;
2372
- /** Label used for the hex input
2379
+ /**
2380
+ * Label used for the hex input
2381
+ *
2373
2382
  * @default "Hex"
2374
2383
  */
2375
2384
  this.intlHex = TEXT.hex;
2376
- /** Label used for the hue channel description
2385
+ /**
2386
+ * Label used for the hue channel description
2387
+ *
2377
2388
  * @default "Hue"
2378
2389
  */
2379
2390
  this.intlHue = TEXT.hue;
2380
2391
  /**
2381
2392
  * Label used for the hex input when there is no color selected.
2393
+ *
2382
2394
  * @default "No color"
2383
2395
  */
2384
2396
  this.intlNoColor = TEXT.noColor;
2385
- /** Label used for the red channel
2397
+ /**
2398
+ * Label used for the red channel
2399
+ *
2386
2400
  * @default "R"
2387
2401
  */
2388
2402
  this.intlR = TEXT.r;
2389
- /** Label used for the red channel description
2403
+ /**
2404
+ * Label used for the red channel description
2405
+ *
2390
2406
  * @default "Red"
2391
2407
  */
2392
2408
  this.intlRed = TEXT.red;
2393
- /** Label used for the RGB mode
2409
+ /**
2410
+ * Label used for the RGB mode
2411
+ *
2394
2412
  * @default "RGB"
2395
2413
  */
2396
2414
  this.intlRgb = TEXT.rgb;
2397
- /** Label used for the saturation channel
2415
+ /**
2416
+ * Label used for the saturation channel
2417
+ *
2398
2418
  * @default "S"
2399
2419
  */
2400
2420
  this.intlS = TEXT.s;
2401
- /** Label used for the saturation channel description
2421
+ /**
2422
+ * Label used for the saturation channel description
2423
+ *
2402
2424
  * @default "Saturation"
2403
2425
  */
2404
2426
  this.intlSaturation = TEXT.saturation;
2405
- /** Label used for the save color button.
2427
+ /**
2428
+ * Label used for the save color button.
2429
+ *
2406
2430
  * @default "Save color"
2407
2431
  */
2408
2432
  this.intlSaveColor = TEXT.saveColor;
2409
- /** Label used for the saved colors section
2433
+ /**
2434
+ * Label used for the saved colors section
2435
+ *
2410
2436
  * @default "Saved"
2411
2437
  */
2412
2438
  this.intlSaved = TEXT.saved;
2413
- /** Label used for the value channel
2439
+ /**
2440
+ * Label used for the value channel
2441
+ *
2414
2442
  * @default "V"
2415
2443
  */
2416
2444
  this.intlV = TEXT.v;
2417
- /** Label used for the
2445
+ /**
2446
+ * Label used for the
2447
+ *
2418
2448
  * @default "Value"
2419
2449
  */
2420
2450
  this.intlValue = TEXT.value;
@@ -2429,6 +2459,7 @@ const ColorPicker = class {
2429
2459
  * a RGB, HSL or HSV object.
2430
2460
  *
2431
2461
  * The type will be preserved as the color is updated.
2462
+ *
2432
2463
  * @default "#007ac2"
2433
2464
  * @see [ColorValue](https://github.com/Esri/calcite-components/blob/master/src/components/color-picker/interfaces.ts#L10)
2434
2465
  */
@@ -2692,9 +2723,12 @@ const ColorPicker = class {
2692
2723
  const channelAriaLabels = isRgb
2693
2724
  ? [intlRed, intlGreen, intlBlue]
2694
2725
  : [intlHue, intlSaturation, intlValue];
2695
- return (h("calcite-tab", { active: active, class: CSS$2.control, key: channelMode }, h("div", { class: CSS$2.channels }, channels.map((channel, index) => this.renderChannel(channel, index, channelLabels[index], channelAriaLabels[index])))));
2726
+ const direction = getElementDir(this.el);
2727
+ return (h("calcite-tab", { active: active, class: CSS$2.control, key: channelMode }, h("div", { class: CSS$2.channels, dir: "ltr" }, channels.map((channel, index) =>
2728
+ /* the channel container is ltr, so we apply the host's direction */
2729
+ this.renderChannel(channel, index, channelLabels[index], channelAriaLabels[index], direction)))));
2696
2730
  };
2697
- this.renderChannel = (value, index, label, ariaLabel) => (h("calcite-input", { class: CSS$2.channel, "data-channel-index": index, 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() }));
2731
+ this.renderChannel = (value, index, label, ariaLabel, direction) => (h("calcite-input", { class: CSS$2.channel, "data-channel-index": index, 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() }));
2698
2732
  this.deleteColor = () => {
2699
2733
  const colorToDelete = this.color.hex();
2700
2734
  const inStorage = this.savedColors.indexOf(colorToDelete) > -1;
@@ -2749,14 +2783,10 @@ const ColorPicker = class {
2749
2783
  this.drawColorFieldAndSlider();
2750
2784
  this.updateChannelsFromColor(color);
2751
2785
  this.previousColor = oldColor;
2752
- if (this.internalColorUpdateContext) {
2753
- return;
2754
- }
2755
- this.value = this.toValue(color);
2756
2786
  }
2757
2787
  handleFormatChange(format) {
2758
2788
  this.setMode(format);
2759
- this.value = this.toValue(this.color);
2789
+ this.internalColorSet(this.color, false, "internal");
2760
2790
  }
2761
2791
  handleScaleChange(scale = "m") {
2762
2792
  this.updateDimensions(scale);
@@ -2776,10 +2806,10 @@ const ColorPicker = class {
2776
2806
  this.setMode(nextMode);
2777
2807
  }
2778
2808
  const dragging = this.sliderThumbState === "drag" || this.hueThumbState === "drag";
2779
- if (this.internalColorUpdateContext) {
2780
- if (this.internalColorUpdateContext === "initial") {
2781
- return;
2782
- }
2809
+ if (this.internalColorUpdateContext === "initial") {
2810
+ return;
2811
+ }
2812
+ if (this.internalColorUpdateContext === "user-interaction") {
2783
2813
  this.calciteColorPickerInput.emit();
2784
2814
  if (!dragging) {
2785
2815
  this.calciteColorPickerChange.emit();
@@ -2789,11 +2819,7 @@ const ColorPicker = class {
2789
2819
  const color$1 = allowEmpty && !value ? null : color(value);
2790
2820
  const colorChanged = !colorEqual(color$1, this.color);
2791
2821
  if (modeChanged || colorChanged) {
2792
- this.color = color$1;
2793
- this.calciteColorPickerInput.emit();
2794
- if (!dragging) {
2795
- this.calciteColorPickerChange.emit();
2796
- }
2822
+ this.internalColorSet(color$1, true, "internal");
2797
2823
  }
2798
2824
  }
2799
2825
  //--------------------------------------------------------------------------
@@ -2901,6 +2927,11 @@ const ColorPicker = class {
2901
2927
  // Private Methods
2902
2928
  //
2903
2929
  //--------------------------------------------------------------------------
2930
+ handleKeyDown(event) {
2931
+ if (event.key === "Enter") {
2932
+ event.preventDefault();
2933
+ }
2934
+ }
2904
2935
  showIncompatibleColorWarning(value, format) {
2905
2936
  console.warn(`ignoring color value (${value}) as it is not compatible with the current format (${format})`);
2906
2937
  }
@@ -2922,7 +2953,7 @@ const ColorPicker = class {
2922
2953
  }
2923
2954
  return "none";
2924
2955
  }
2925
- internalColorSet(color, skipEqual = true, context = "internal") {
2956
+ internalColorSet(color, skipEqual = true, context = "user-interaction") {
2926
2957
  if (skipEqual && colorEqual(color, this.color)) {
2927
2958
  return;
2928
2959
  }
@@ -3097,11 +3128,13 @@ const ColorPickerHexInput = class {
3097
3128
  this.allowEmpty = false;
3098
3129
  /**
3099
3130
  * Label used for the hex input.
3131
+ *
3100
3132
  * @default "Hex"
3101
3133
  */
3102
3134
  this.intlHex = TEXT.hex;
3103
3135
  /**
3104
3136
  * Label used for the hex input when there is no color selected.
3137
+ *
3105
3138
  * @default "No color"
3106
3139
  */
3107
3140
  this.intlNoColor = TEXT.noColor;
@@ -3113,7 +3146,7 @@ const ColorPickerHexInput = class {
3113
3146
  * The hex value.
3114
3147
  */
3115
3148
  this.value = normalizeHex(DEFAULT_COLOR.hex());
3116
- this.onCalciteInputBlur = () => {
3149
+ this.onCalciteInternalInputBlur = () => {
3117
3150
  const node = this.inputNode;
3118
3151
  const inputValue = node.value;
3119
3152
  const hex = `#${inputValue}`;
@@ -3128,32 +3161,13 @@ const ColorPickerHexInput = class {
3128
3161
  : this.formatForInternalInput(rgbToHex(this.internalColor.object()));
3129
3162
  };
3130
3163
  this.onInputChange = () => {
3131
- const inputValue = this.inputNode.value;
3132
- let value;
3133
- if (inputValue) {
3134
- const hex = inputValue;
3135
- const color = hexToRGB(`#${hex}`);
3136
- if (!color) {
3137
- return;
3138
- }
3139
- value = normalizeHex(hex);
3140
- }
3141
- else if (this.allowEmpty) {
3142
- value = null;
3143
- }
3144
- this.value = value;
3145
- this.calciteColorPickerHexInputChange.emit();
3164
+ this.internalSetValue(this.inputNode.value, this.value);
3146
3165
  };
3147
3166
  /**
3148
3167
  * The last valid/selected color. Used as a fallback if an invalid hex code is entered.
3149
3168
  */
3150
3169
  this.internalColor = DEFAULT_COLOR;
3151
3170
  this.previousNonNullValue = this.value;
3152
- //--------------------------------------------------------------------------
3153
- //
3154
- // Private Methods
3155
- //
3156
- //--------------------------------------------------------------------------
3157
3171
  this.storeInputRef = (node) => {
3158
3172
  this.inputNode = node;
3159
3173
  };
@@ -3168,38 +3182,16 @@ const ColorPickerHexInput = class {
3168
3182
  if (value) {
3169
3183
  const normalized = normalizeHex(value);
3170
3184
  if (isValidHex(normalized)) {
3171
- this.internalColor = color(normalized);
3172
- this.value = normalized;
3185
+ this.internalSetValue(normalized, normalized, false);
3173
3186
  }
3174
3187
  return;
3175
3188
  }
3176
3189
  if (allowEmpty) {
3177
- this.internalColor = null;
3178
- this.value = null;
3190
+ this.internalSetValue(null, null, false);
3179
3191
  }
3180
3192
  }
3181
3193
  handleValueChange(value, oldValue) {
3182
- if (value) {
3183
- const normalized = normalizeHex(value);
3184
- if (isValidHex(normalized)) {
3185
- const { internalColor } = this;
3186
- const changed = !internalColor || normalized !== normalizeHex(internalColor.hex());
3187
- this.internalColor = color(normalized);
3188
- this.previousNonNullValue = normalized;
3189
- this.value = normalized;
3190
- if (changed) {
3191
- this.calciteColorPickerHexInputChange.emit();
3192
- }
3193
- return;
3194
- }
3195
- }
3196
- else if (this.allowEmpty) {
3197
- this.internalColor = null;
3198
- this.value = null;
3199
- this.calciteColorPickerHexInputChange.emit();
3200
- return;
3201
- }
3202
- this.value = oldValue;
3194
+ this.internalSetValue(value, oldValue, false);
3203
3195
  }
3204
3196
  // using @Listen as a workaround for VDOM listener not firing
3205
3197
  onInputKeyDown(event) {
@@ -3211,15 +3203,16 @@ const ColorPickerHexInput = class {
3211
3203
  return;
3212
3204
  }
3213
3205
  const isNudgeKey = key === "ArrowDown" || key === "ArrowUp";
3206
+ const oldValue = this.value;
3214
3207
  if (isNudgeKey) {
3215
3208
  if (!value) {
3216
- this.value = this.previousNonNullValue;
3209
+ this.internalSetValue(this.previousNonNullValue, oldValue);
3217
3210
  event.preventDefault();
3218
3211
  return;
3219
3212
  }
3220
3213
  const direction = key === "ArrowUp" ? 1 : -1;
3221
3214
  const bump = shiftKey ? 10 : 1;
3222
- this.value = normalizeHex(this.nudgeRGBChannels(internalColor, bump * direction).hex());
3215
+ this.internalSetValue(normalizeHex(this.nudgeRGBChannels(internalColor, bump * direction).hex()), oldValue);
3223
3216
  event.preventDefault();
3224
3217
  return;
3225
3218
  }
@@ -3238,7 +3231,7 @@ const ColorPickerHexInput = class {
3238
3231
  render() {
3239
3232
  const { intlHex, value } = this;
3240
3233
  const hexInputValue = this.formatForInternalInput(value);
3241
- return (h("div", { class: CSS$1.container }, 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 ? (h("calcite-color-picker-swatch", { active: true, class: CSS$1.preview, color: `#${hexInputValue}`, scale: this.scale })) : null));
3234
+ return (h("div", { class: CSS$1.container }, 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 ? (h("calcite-color-picker-swatch", { active: true, class: CSS$1.preview, color: `#${hexInputValue}`, scale: this.scale })) : null));
3242
3235
  }
3243
3236
  //--------------------------------------------------------------------------
3244
3237
  //
@@ -3249,12 +3242,47 @@ const ColorPickerHexInput = class {
3249
3242
  async setFocus() {
3250
3243
  focusElement(this.inputNode);
3251
3244
  }
3245
+ //--------------------------------------------------------------------------
3246
+ //
3247
+ // Private Methods
3248
+ //
3249
+ //--------------------------------------------------------------------------
3250
+ internalSetValue(value, oldValue, emit = true) {
3251
+ if (value) {
3252
+ const normalized = normalizeHex(value);
3253
+ if (isValidHex(normalized)) {
3254
+ const { internalColor } = this;
3255
+ const changed = !internalColor || normalized !== normalizeHex(internalColor.hex());
3256
+ this.internalColor = color(normalized);
3257
+ this.previousNonNullValue = normalized;
3258
+ this.value = normalized;
3259
+ if (changed && emit) {
3260
+ this.calciteColorPickerHexInputChange.emit();
3261
+ }
3262
+ return;
3263
+ }
3264
+ }
3265
+ else if (this.allowEmpty) {
3266
+ this.internalColor = null;
3267
+ this.value = null;
3268
+ if (emit) {
3269
+ this.calciteColorPickerHexInputChange.emit();
3270
+ }
3271
+ return;
3272
+ }
3273
+ this.value = oldValue;
3274
+ }
3252
3275
  formatForInternalInput(hex) {
3253
3276
  return hex ? hex.replace("#", "") : "";
3254
3277
  }
3255
3278
  nudgeRGBChannels(color$1, amount) {
3256
3279
  return color.rgb(color$1.array().map((channel) => channel + amount));
3257
3280
  }
3281
+ handleKeyDown(event) {
3282
+ if (event.key === "Enter") {
3283
+ event.preventDefault();
3284
+ }
3285
+ }
3258
3286
  get el() { return getElement(this); }
3259
3287
  static get watchers() { return {
3260
3288
  "value": ["handleValueChange"]