@storybook/components 6.5.0-alpha.34 → 6.5.0-alpha.39

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 (790) hide show
  1. package/dist/cjs/Color-032a9349.js +2457 -0
  2. package/dist/cjs/GlobalScrollAreaStyles-ff4bd929.js +463 -0
  3. package/dist/cjs/OverlayScrollbars-1d39092f.js +6618 -0
  4. package/dist/cjs/WithTooltip-2a2b04d5.js +3148 -0
  5. package/dist/cjs/index-8d1d6047.js +2144 -0
  6. package/dist/cjs/index.js +121 -574
  7. package/dist/cjs/syntaxhighlighter-30038dbf.js +5717 -0
  8. package/dist/esm/Color-9cc21275.js +2574 -0
  9. package/dist/esm/{ScrollArea/GlobalScrollAreaStyles.js → GlobalScrollAreaStyles-8793ce4a.js} +6 -6
  10. package/dist/esm/OverlayScrollbars-2e9764c4.js +6708 -0
  11. package/dist/esm/WithTooltip-86b3ed65.js +3177 -0
  12. package/dist/esm/index-3a270aad.js +2087 -0
  13. package/dist/esm/index.js +5 -75
  14. package/dist/esm/syntaxhighlighter-9715c171.js +5793 -0
  15. package/dist/modern/Color-2006be6b.js +2442 -0
  16. package/dist/modern/{ScrollArea/GlobalScrollAreaStyles.js → GlobalScrollAreaStyles-8793ce4a.js} +6 -6
  17. package/dist/modern/OverlayScrollbars-b3c4c6b9.js +6602 -0
  18. package/dist/modern/WithTooltip-895fead5.js +3108 -0
  19. package/dist/modern/index-0404c596.js +2144 -0
  20. package/dist/modern/index.js +5 -69
  21. package/dist/modern/syntaxhighlighter-9e124c2a.js +5700 -0
  22. package/dist/ts-tmp/index.d.ts +901 -0
  23. package/dist/ts3.4/_modules/@popperjs-core-index.d.ts +1 -0
  24. package/dist/ts3.4/_modules/@popperjs-core-lib-createPopper.d.ts +9 -0
  25. package/dist/ts3.4/_modules/@popperjs-core-lib-enums.d.ts +34 -0
  26. package/dist/ts3.4/_modules/@popperjs-core-lib-index.d.ts +6 -0
  27. package/dist/ts3.4/_modules/@popperjs-core-lib-modifiers-applyStyles.d.ts +4 -0
  28. package/dist/ts3.4/_modules/@popperjs-core-lib-modifiers-arrow.d.ts +13 -0
  29. package/dist/ts3.4/_modules/@popperjs-core-lib-modifiers-computeStyles.d.ts +38 -0
  30. package/dist/ts3.4/_modules/@popperjs-core-lib-modifiers-eventListeners.d.ts +8 -0
  31. package/dist/ts3.4/_modules/@popperjs-core-lib-modifiers-flip.d.ts +16 -0
  32. package/dist/ts3.4/_modules/@popperjs-core-lib-modifiers-hide.d.ts +4 -0
  33. package/dist/ts3.4/_modules/@popperjs-core-lib-modifiers-index.d.ts +9 -0
  34. package/dist/ts3.4/_modules/@popperjs-core-lib-modifiers-offset.d.ts +24 -0
  35. package/dist/ts3.4/_modules/@popperjs-core-lib-modifiers-popperOffsets.d.ts +4 -0
  36. package/dist/ts3.4/_modules/@popperjs-core-lib-modifiers-preventOverflow.d.ts +30 -0
  37. package/dist/ts3.4/_modules/@popperjs-core-lib-popper-lite.d.ts +5 -0
  38. package/dist/ts3.4/_modules/@popperjs-core-lib-popper.d.ts +7 -0
  39. package/dist/ts3.4/_modules/@popperjs-core-lib-types.d.ts +167 -0
  40. package/dist/ts3.4/_modules/@popperjs-core-lib-utils-detectOverflow.d.ts +11 -0
  41. package/dist/ts3.4/_modules/react-textarea-autosize-dist-declarations-src-index.d.ts +17 -0
  42. package/dist/ts3.4/_modules/react-textarea-autosize-dist-react-textarea-autosize.cjs.d.ts +2 -0
  43. package/dist/ts3.4/index.d.ts +875 -54
  44. package/dist/ts3.9/_modules/@popperjs-core-index.d.ts +1 -0
  45. package/dist/ts3.9/_modules/@popperjs-core-lib-createPopper.d.ts +9 -0
  46. package/dist/ts3.9/_modules/@popperjs-core-lib-enums.d.ts +34 -0
  47. package/dist/ts3.9/_modules/@popperjs-core-lib-index.d.ts +6 -0
  48. package/dist/ts3.9/_modules/@popperjs-core-lib-modifiers-applyStyles.d.ts +4 -0
  49. package/dist/ts3.9/_modules/@popperjs-core-lib-modifiers-arrow.d.ts +13 -0
  50. package/dist/ts3.9/_modules/@popperjs-core-lib-modifiers-computeStyles.d.ts +38 -0
  51. package/dist/ts3.9/_modules/@popperjs-core-lib-modifiers-eventListeners.d.ts +8 -0
  52. package/dist/ts3.9/_modules/@popperjs-core-lib-modifiers-flip.d.ts +16 -0
  53. package/dist/ts3.9/_modules/@popperjs-core-lib-modifiers-hide.d.ts +4 -0
  54. package/dist/ts3.9/_modules/@popperjs-core-lib-modifiers-index.d.ts +9 -0
  55. package/dist/ts3.9/_modules/@popperjs-core-lib-modifiers-offset.d.ts +18 -0
  56. package/dist/ts3.9/_modules/@popperjs-core-lib-modifiers-popperOffsets.d.ts +4 -0
  57. package/dist/ts3.9/_modules/@popperjs-core-lib-modifiers-preventOverflow.d.ts +30 -0
  58. package/dist/ts3.9/_modules/@popperjs-core-lib-popper-lite.d.ts +5 -0
  59. package/dist/ts3.9/_modules/@popperjs-core-lib-popper.d.ts +7 -0
  60. package/dist/ts3.9/_modules/@popperjs-core-lib-types.d.ts +167 -0
  61. package/dist/ts3.9/_modules/@popperjs-core-lib-utils-detectOverflow.d.ts +11 -0
  62. package/dist/ts3.9/_modules/react-textarea-autosize-dist-declarations-src-index.d.ts +17 -0
  63. package/dist/ts3.9/_modules/react-textarea-autosize-dist-react-textarea-autosize.cjs.d.ts +2 -0
  64. package/dist/ts3.9/index.d.ts +875 -54
  65. package/package.json +14 -12
  66. package/dist/cjs/ActionBar/ActionBar.js +0 -106
  67. package/dist/cjs/ActionBar/ActionBar.stories.js +0 -66
  68. package/dist/cjs/Badge/Badge.js +0 -97
  69. package/dist/cjs/Badge/Badge.stories.js +0 -19
  70. package/dist/cjs/Button/Button.js +0 -281
  71. package/dist/cjs/Button/Button.stories.js +0 -74
  72. package/dist/cjs/Colors/SideBySide.js +0 -25
  73. package/dist/cjs/Loader/Loader.js +0 -278
  74. package/dist/cjs/Loader/Loader.stories.js +0 -86
  75. package/dist/cjs/ScrollArea/GlobalScrollAreaStyles.js +0 -477
  76. package/dist/cjs/ScrollArea/OverlayScrollbars.js +0 -150
  77. package/dist/cjs/ScrollArea/ScrollArea.js +0 -99
  78. package/dist/cjs/ScrollArea/ScrollArea.stories.js +0 -136
  79. package/dist/cjs/Zoom/Zoom.js +0 -31
  80. package/dist/cjs/Zoom/Zoom.stories.js +0 -187
  81. package/dist/cjs/Zoom/ZoomElement.js +0 -97
  82. package/dist/cjs/Zoom/ZoomIFrame.js +0 -142
  83. package/dist/cjs/Zoom/browserSupportsCssZoom.js +0 -20
  84. package/dist/cjs/addon-panel/addon-panel.js +0 -65
  85. package/dist/cjs/bar/bar.js +0 -156
  86. package/dist/cjs/bar/button.js +0 -162
  87. package/dist/cjs/bar/button.stories.js +0 -90
  88. package/dist/cjs/bar/separator.js +0 -68
  89. package/dist/cjs/blocks/ArgsTable/ArgControl.js +0 -140
  90. package/dist/cjs/blocks/ArgsTable/ArgJsDoc.js +0 -102
  91. package/dist/cjs/blocks/ArgsTable/ArgRow.js +0 -139
  92. package/dist/cjs/blocks/ArgsTable/ArgRow.stories.js +0 -399
  93. package/dist/cjs/blocks/ArgsTable/ArgValue.js +0 -298
  94. package/dist/cjs/blocks/ArgsTable/ArgsTable.js +0 -501
  95. package/dist/cjs/blocks/ArgsTable/ArgsTable.stories.js +0 -217
  96. package/dist/cjs/blocks/ArgsTable/NoControlsWarning.js +0 -37
  97. package/dist/cjs/blocks/ArgsTable/SectionRow.js +0 -197
  98. package/dist/cjs/blocks/ArgsTable/SectionRow.stories.js +0 -59
  99. package/dist/cjs/blocks/ArgsTable/TabbedArgsTable.js +0 -96
  100. package/dist/cjs/blocks/ArgsTable/TabbedArgsTable.stories.js +0 -50
  101. package/dist/cjs/blocks/ArgsTable/index.js +0 -63
  102. package/dist/cjs/blocks/ArgsTable/types.js +0 -1
  103. package/dist/cjs/blocks/BlockBackgroundStyles.js +0 -17
  104. package/dist/cjs/blocks/ColorPalette.js +0 -236
  105. package/dist/cjs/blocks/ColorPalette.stories.js +0 -87
  106. package/dist/cjs/blocks/Description.js +0 -33
  107. package/dist/cjs/blocks/Description.stories.js +0 -48
  108. package/dist/cjs/blocks/DocsPage.js +0 -85
  109. package/dist/cjs/blocks/DocsPage.stories.js +0 -120
  110. package/dist/cjs/blocks/EmptyBlock.js +0 -45
  111. package/dist/cjs/blocks/EmptyBlock.stories.js +0 -25
  112. package/dist/cjs/blocks/IFrame.js +0 -150
  113. package/dist/cjs/blocks/IconGallery.js +0 -101
  114. package/dist/cjs/blocks/IconGallery.stories.js +0 -53
  115. package/dist/cjs/blocks/Preview.js +0 -442
  116. package/dist/cjs/blocks/Preview.stories.js +0 -345
  117. package/dist/cjs/blocks/Source.js +0 -145
  118. package/dist/cjs/blocks/Source.stories.js +0 -76
  119. package/dist/cjs/blocks/Story.js +0 -149
  120. package/dist/cjs/blocks/Story.stories.js +0 -127
  121. package/dist/cjs/blocks/Toolbar.js +0 -135
  122. package/dist/cjs/blocks/Typeset.js +0 -96
  123. package/dist/cjs/blocks/Typeset.stories.js +0 -61
  124. package/dist/cjs/blocks/ZoomContext.js +0 -13
  125. package/dist/cjs/blocks/index.js +0 -141
  126. package/dist/cjs/brand/StorybookIcon.js +0 -44
  127. package/dist/cjs/brand/StorybookIcon.stories.js +0 -13
  128. package/dist/cjs/brand/StorybookLogo.js +0 -63
  129. package/dist/cjs/brand/StorybookLogo.stories.js +0 -27
  130. package/dist/cjs/controls/Boolean.js +0 -154
  131. package/dist/cjs/controls/Boolean.stories.js +0 -93
  132. package/dist/cjs/controls/Color.js +0 -510
  133. package/dist/cjs/controls/Color.stories.js +0 -148
  134. package/dist/cjs/controls/Date.js +0 -193
  135. package/dist/cjs/controls/Date.stories.js +0 -87
  136. package/dist/cjs/controls/Files.js +0 -83
  137. package/dist/cjs/controls/Number.js +0 -161
  138. package/dist/cjs/controls/Number.stories.js +0 -93
  139. package/dist/cjs/controls/Object.js +0 -418
  140. package/dist/cjs/controls/Object.stories.js +0 -126
  141. package/dist/cjs/controls/Range.js +0 -224
  142. package/dist/cjs/controls/Range.stories.js +0 -128
  143. package/dist/cjs/controls/Text.js +0 -108
  144. package/dist/cjs/controls/Text.stories.js +0 -93
  145. package/dist/cjs/controls/helpers.js +0 -35
  146. package/dist/cjs/controls/index.js +0 -182
  147. package/dist/cjs/controls/options/Checkbox.js +0 -169
  148. package/dist/cjs/controls/options/Options.js +0 -94
  149. package/dist/cjs/controls/options/Options.stories.js +0 -216
  150. package/dist/cjs/controls/options/Radio.js +0 -102
  151. package/dist/cjs/controls/options/Select.js +0 -175
  152. package/dist/cjs/controls/options/helpers.js +0 -83
  153. package/dist/cjs/controls/options/index.js +0 -24
  154. package/dist/cjs/controls/react-editable-json-tree/JsonNodes.js +0 -1748
  155. package/dist/cjs/controls/react-editable-json-tree/index.js +0 -284
  156. package/dist/cjs/controls/react-editable-json-tree/types/dataTypes.js +0 -28
  157. package/dist/cjs/controls/react-editable-json-tree/types/deltaTypes.js +0 -12
  158. package/dist/cjs/controls/react-editable-json-tree/types/inputUsageTypes.js +0 -10
  159. package/dist/cjs/controls/react-editable-json-tree/utils/objectTypes.js +0 -51
  160. package/dist/cjs/controls/react-editable-json-tree/utils/parse.js +0 -26
  161. package/dist/cjs/controls/react-editable-json-tree/utils/styles.js +0 -68
  162. package/dist/cjs/controls/types.js +0 -5
  163. package/dist/cjs/form/field/field.js +0 -64
  164. package/dist/cjs/form/form.stories.js +0 -225
  165. package/dist/cjs/form/index.js +0 -27
  166. package/dist/cjs/form/input/input.js +0 -272
  167. package/dist/cjs/html.js +0 -60
  168. package/dist/cjs/icon/icon.js +0 -95
  169. package/dist/cjs/icon/icon.stories.js +0 -78
  170. package/dist/cjs/icon/icons.js +0 -182
  171. package/dist/cjs/icon/svg.js +0 -24
  172. package/dist/cjs/placeholder/placeholder.js +0 -100
  173. package/dist/cjs/placeholder/placeholder.stories.js +0 -64
  174. package/dist/cjs/shared/animation.js +0 -19
  175. package/dist/cjs/spaced/Spaced.js +0 -103
  176. package/dist/cjs/spaced/Spaced.stories.js +0 -73
  177. package/dist/cjs/syntaxhighlighter/formatter.js +0 -17
  178. package/dist/cjs/syntaxhighlighter/lazy-syntaxhighlighter.js +0 -49
  179. package/dist/cjs/syntaxhighlighter/syntaxhighlighter-types.js +0 -5
  180. package/dist/cjs/syntaxhighlighter/syntaxhighlighter.js +0 -320
  181. package/dist/cjs/syntaxhighlighter/syntaxhighlighter.stories.js +0 -112
  182. package/dist/cjs/tabs/tabs.js +0 -317
  183. package/dist/cjs/tabs/tabs.stories.js +0 -310
  184. package/dist/cjs/tooltip/ListItem.js +0 -227
  185. package/dist/cjs/tooltip/ListItem.stories.js +0 -95
  186. package/dist/cjs/tooltip/Tooltip.js +0 -145
  187. package/dist/cjs/tooltip/Tooltip.stories.js +0 -52
  188. package/dist/cjs/tooltip/TooltipLinkList.js +0 -110
  189. package/dist/cjs/tooltip/TooltipLinkList.stories.js +0 -100
  190. package/dist/cjs/tooltip/TooltipMessage.js +0 -87
  191. package/dist/cjs/tooltip/TooltipMessage.stories.js +0 -54
  192. package/dist/cjs/tooltip/TooltipNote.js +0 -52
  193. package/dist/cjs/tooltip/TooltipNote.stories.js +0 -29
  194. package/dist/cjs/tooltip/WithTooltip.js +0 -234
  195. package/dist/cjs/tooltip/WithTooltip.stories.js +0 -95
  196. package/dist/cjs/tooltip/lazy-WithTooltip.js +0 -71
  197. package/dist/cjs/typography/DocumentFormatting.js +0 -28
  198. package/dist/cjs/typography/DocumentWrapper.js +0 -298
  199. package/dist/cjs/typography/DocumentWrapper.stories.js +0 -89
  200. package/dist/cjs/typography/ResetWrapper.js +0 -21
  201. package/dist/cjs/typography/components.js +0 -126
  202. package/dist/cjs/typography/elements/A.js +0 -36
  203. package/dist/cjs/typography/elements/Blockquote.js +0 -27
  204. package/dist/cjs/typography/elements/Code.js +0 -109
  205. package/dist/cjs/typography/elements/DL.js +0 -44
  206. package/dist/cjs/typography/elements/Div.js +0 -14
  207. package/dist/cjs/typography/elements/H1.js +0 -20
  208. package/dist/cjs/typography/elements/H2.js +0 -21
  209. package/dist/cjs/typography/elements/H3.js +0 -19
  210. package/dist/cjs/typography/elements/H4.js +0 -19
  211. package/dist/cjs/typography/elements/H5.js +0 -19
  212. package/dist/cjs/typography/elements/H6.js +0 -20
  213. package/dist/cjs/typography/elements/HR.js +0 -20
  214. package/dist/cjs/typography/elements/Img.js +0 -14
  215. package/dist/cjs/typography/elements/LI.js +0 -31
  216. package/dist/cjs/typography/elements/Link.js +0 -44
  217. package/dist/cjs/typography/elements/OL.js +0 -28
  218. package/dist/cjs/typography/elements/P.js +0 -24
  219. package/dist/cjs/typography/elements/Pre.js +0 -53
  220. package/dist/cjs/typography/elements/Span.js +0 -92
  221. package/dist/cjs/typography/elements/TT.js +0 -14
  222. package/dist/cjs/typography/elements/Table.js +0 -50
  223. package/dist/cjs/typography/elements/UL.js +0 -28
  224. package/dist/cjs/typography/lib/common.js +0 -67
  225. package/dist/cjs/typography/lib/isReactChildString.js +0 -12
  226. package/dist/cjs/typography/link/link.js +0 -209
  227. package/dist/cjs/typography/link/link.stories.js +0 -71
  228. package/dist/cjs/utils/getStoryHref.js +0 -71
  229. package/dist/esm/ActionBar/ActionBar.js +0 -85
  230. package/dist/esm/ActionBar/ActionBar.stories.js +0 -47
  231. package/dist/esm/Badge/Badge.js +0 -81
  232. package/dist/esm/Badge/Badge.stories.js +0 -12
  233. package/dist/esm/Button/Button.js +0 -241
  234. package/dist/esm/Button/Button.stories.js +0 -65
  235. package/dist/esm/Colors/SideBySide.js +0 -15
  236. package/dist/esm/Loader/Loader.js +0 -225
  237. package/dist/esm/Loader/Loader.stories.js +0 -63
  238. package/dist/esm/ScrollArea/OverlayScrollbars.js +0 -104
  239. package/dist/esm/ScrollArea/ScrollArea.js +0 -60
  240. package/dist/esm/ScrollArea/ScrollArea.stories.js +0 -88
  241. package/dist/esm/Zoom/Zoom.js +0 -15
  242. package/dist/esm/Zoom/Zoom.stories.js +0 -150
  243. package/dist/esm/Zoom/ZoomElement.js +0 -65
  244. package/dist/esm/Zoom/ZoomIFrame.js +0 -121
  245. package/dist/esm/Zoom/browserSupportsCssZoom.js +0 -9
  246. package/dist/esm/addon-panel/addon-panel.js +0 -32
  247. package/dist/esm/bar/bar.js +0 -117
  248. package/dist/esm/bar/button.js +0 -140
  249. package/dist/esm/bar/button.stories.js +0 -56
  250. package/dist/esm/bar/separator.js +0 -31
  251. package/dist/esm/blocks/ArgsTable/ArgControl.js +0 -108
  252. package/dist/esm/blocks/ArgsTable/ArgJsDoc.js +0 -79
  253. package/dist/esm/blocks/ArgsTable/ArgRow.js +0 -110
  254. package/dist/esm/blocks/ArgsTable/ArgRow.stories.js +0 -358
  255. package/dist/esm/blocks/ArgsTable/ArgValue.js +0 -246
  256. package/dist/esm/blocks/ArgsTable/ArgsTable.js +0 -454
  257. package/dist/esm/blocks/ArgsTable/ArgsTable.stories.js +0 -159
  258. package/dist/esm/blocks/ArgsTable/NoControlsWarning.js +0 -22
  259. package/dist/esm/blocks/ArgsTable/SectionRow.js +0 -154
  260. package/dist/esm/blocks/ArgsTable/SectionRow.stories.js +0 -38
  261. package/dist/esm/blocks/ArgsTable/TabbedArgsTable.js +0 -68
  262. package/dist/esm/blocks/ArgsTable/TabbedArgsTable.stories.js +0 -34
  263. package/dist/esm/blocks/ArgsTable/index.js +0 -4
  264. package/dist/esm/blocks/ArgsTable/types.js +0 -0
  265. package/dist/esm/blocks/BlockBackgroundStyles.js +0 -8
  266. package/dist/esm/blocks/ColorPalette.js +0 -198
  267. package/dist/esm/blocks/ColorPalette.stories.js +0 -69
  268. package/dist/esm/blocks/Description.js +0 -19
  269. package/dist/esm/blocks/Description.stories.js +0 -32
  270. package/dist/esm/blocks/DocsPage.js +0 -57
  271. package/dist/esm/blocks/DocsPage.stories.js +0 -60
  272. package/dist/esm/blocks/EmptyBlock.js +0 -29
  273. package/dist/esm/blocks/EmptyBlock.stories.js +0 -10
  274. package/dist/esm/blocks/IFrame.js +0 -117
  275. package/dist/esm/blocks/IconGallery.js +0 -77
  276. package/dist/esm/blocks/IconGallery.stories.js +0 -37
  277. package/dist/esm/blocks/Preview.js +0 -383
  278. package/dist/esm/blocks/Preview.stories.js +0 -255
  279. package/dist/esm/blocks/Source.js +0 -126
  280. package/dist/esm/blocks/Source.stories.js +0 -49
  281. package/dist/esm/blocks/Story.js +0 -104
  282. package/dist/esm/blocks/Story.stories.js +0 -84
  283. package/dist/esm/blocks/Toolbar.js +0 -95
  284. package/dist/esm/blocks/Typeset.js +0 -73
  285. package/dist/esm/blocks/Typeset.stories.js +0 -37
  286. package/dist/esm/blocks/ZoomContext.js +0 -4
  287. package/dist/esm/blocks/index.js +0 -10
  288. package/dist/esm/brand/StorybookIcon.js +0 -31
  289. package/dist/esm/brand/StorybookIcon.stories.js +0 -6
  290. package/dist/esm/brand/StorybookLogo.js +0 -48
  291. package/dist/esm/brand/StorybookLogo.stories.js +0 -12
  292. package/dist/esm/controls/Boolean.js +0 -114
  293. package/dist/esm/controls/Boolean.stories.js +0 -55
  294. package/dist/esm/controls/Color.js +0 -448
  295. package/dist/esm/controls/Color.stories.js +0 -110
  296. package/dist/esm/controls/Date.js +0 -158
  297. package/dist/esm/controls/Date.stories.js +0 -52
  298. package/dist/esm/controls/Files.js +0 -57
  299. package/dist/esm/controls/Number.js +0 -118
  300. package/dist/esm/controls/Number.stories.js +0 -55
  301. package/dist/esm/controls/Object.js +0 -370
  302. package/dist/esm/controls/Object.stories.js +0 -82
  303. package/dist/esm/controls/Range.js +0 -179
  304. package/dist/esm/controls/Range.stories.js +0 -84
  305. package/dist/esm/controls/Text.js +0 -73
  306. package/dist/esm/controls/Text.stories.js +0 -55
  307. package/dist/esm/controls/helpers.js +0 -22
  308. package/dist/esm/controls/index.js +0 -21
  309. package/dist/esm/controls/options/Checkbox.js +0 -124
  310. package/dist/esm/controls/options/Options.js +0 -71
  311. package/dist/esm/controls/options/Options.stories.js +0 -127
  312. package/dist/esm/controls/options/Radio.js +0 -77
  313. package/dist/esm/controls/options/Select.js +0 -144
  314. package/dist/esm/controls/options/helpers.js +0 -51
  315. package/dist/esm/controls/options/index.js +0 -1
  316. package/dist/esm/controls/react-editable-json-tree/JsonNodes.js +0 -1703
  317. package/dist/esm/controls/react-editable-json-tree/index.js +0 -223
  318. package/dist/esm/controls/react-editable-json-tree/types/dataTypes.js +0 -12
  319. package/dist/esm/controls/react-editable-json-tree/types/deltaTypes.js +0 -4
  320. package/dist/esm/controls/react-editable-json-tree/types/inputUsageTypes.js +0 -3
  321. package/dist/esm/controls/react-editable-json-tree/utils/objectTypes.js +0 -35
  322. package/dist/esm/controls/react-editable-json-tree/utils/parse.js +0 -19
  323. package/dist/esm/controls/react-editable-json-tree/utils/styles.js +0 -59
  324. package/dist/esm/controls/types.js +0 -1
  325. package/dist/esm/form/field/field.js +0 -46
  326. package/dist/esm/form/form.stories.js +0 -199
  327. package/dist/esm/form/index.js +0 -15
  328. package/dist/esm/form/input/input.js +0 -230
  329. package/dist/esm/html.js +0 -13
  330. package/dist/esm/icon/icon.js +0 -53
  331. package/dist/esm/icon/icon.stories.js +0 -63
  332. package/dist/esm/icon/icons.js +0 -174
  333. package/dist/esm/icon/svg.js +0 -15
  334. package/dist/esm/placeholder/placeholder.js +0 -62
  335. package/dist/esm/placeholder/placeholder.stories.js +0 -23
  336. package/dist/esm/shared/animation.js +0 -9
  337. package/dist/esm/spaced/Spaced.js +0 -86
  338. package/dist/esm/spaced/Spaced.stories.js +0 -63
  339. package/dist/esm/syntaxhighlighter/formatter.js +0 -5
  340. package/dist/esm/syntaxhighlighter/lazy-syntaxhighlighter.js +0 -12
  341. package/dist/esm/syntaxhighlighter/syntaxhighlighter-types.js +0 -1
  342. package/dist/esm/syntaxhighlighter/syntaxhighlighter.js +0 -253
  343. package/dist/esm/syntaxhighlighter/syntaxhighlighter.stories.js +0 -82
  344. package/dist/esm/tabs/tabs.js +0 -270
  345. package/dist/esm/tabs/tabs.stories.js +0 -278
  346. package/dist/esm/tooltip/ListItem.js +0 -204
  347. package/dist/esm/tooltip/ListItem.stories.js +0 -87
  348. package/dist/esm/tooltip/Tooltip.js +0 -121
  349. package/dist/esm/tooltip/Tooltip.stories.js +0 -42
  350. package/dist/esm/tooltip/TooltipLinkList.js +0 -69
  351. package/dist/esm/tooltip/TooltipLinkList.stories.js +0 -60
  352. package/dist/esm/tooltip/TooltipMessage.js +0 -64
  353. package/dist/esm/tooltip/TooltipMessage.stories.js +0 -46
  354. package/dist/esm/tooltip/TooltipNote.js +0 -35
  355. package/dist/esm/tooltip/TooltipNote.stories.js +0 -21
  356. package/dist/esm/tooltip/WithTooltip.js +0 -194
  357. package/dist/esm/tooltip/WithTooltip.stories.js +0 -83
  358. package/dist/esm/tooltip/lazy-WithTooltip.js +0 -29
  359. package/dist/esm/typography/DocumentFormatting.js +0 -14
  360. package/dist/esm/typography/DocumentWrapper.js +0 -288
  361. package/dist/esm/typography/DocumentWrapper.stories.js +0 -70
  362. package/dist/esm/typography/ResetWrapper.js +0 -11
  363. package/dist/esm/typography/components.js +0 -92
  364. package/dist/esm/typography/elements/A.js +0 -25
  365. package/dist/esm/typography/elements/Blockquote.js +0 -16
  366. package/dist/esm/typography/elements/Code.js +0 -64
  367. package/dist/esm/typography/elements/DL.js +0 -32
  368. package/dist/esm/typography/elements/Div.js +0 -3
  369. package/dist/esm/typography/elements/H1.js +0 -9
  370. package/dist/esm/typography/elements/H2.js +0 -10
  371. package/dist/esm/typography/elements/H3.js +0 -8
  372. package/dist/esm/typography/elements/H4.js +0 -8
  373. package/dist/esm/typography/elements/H5.js +0 -8
  374. package/dist/esm/typography/elements/H6.js +0 -9
  375. package/dist/esm/typography/elements/HR.js +0 -10
  376. package/dist/esm/typography/elements/Img.js +0 -4
  377. package/dist/esm/typography/elements/LI.js +0 -20
  378. package/dist/esm/typography/elements/Link.js +0 -29
  379. package/dist/esm/typography/elements/OL.js +0 -15
  380. package/dist/esm/typography/elements/P.js +0 -13
  381. package/dist/esm/typography/elements/Pre.js +0 -42
  382. package/dist/esm/typography/elements/Span.js +0 -81
  383. package/dist/esm/typography/elements/TT.js +0 -3
  384. package/dist/esm/typography/elements/Table.js +0 -39
  385. package/dist/esm/typography/elements/UL.js +0 -15
  386. package/dist/esm/typography/lib/common.js +0 -50
  387. package/dist/esm/typography/lib/isReactChildString.js +0 -3
  388. package/dist/esm/typography/link/link.js +0 -189
  389. package/dist/esm/typography/link/link.stories.js +0 -62
  390. package/dist/esm/utils/getStoryHref.js +0 -46
  391. package/dist/modern/ActionBar/ActionBar.js +0 -76
  392. package/dist/modern/ActionBar/ActionBar.stories.js +0 -41
  393. package/dist/modern/Badge/Badge.js +0 -78
  394. package/dist/modern/Badge/Badge.stories.js +0 -10
  395. package/dist/modern/Button/Button.js +0 -233
  396. package/dist/modern/Button/Button.stories.js +0 -65
  397. package/dist/modern/Colors/SideBySide.js +0 -15
  398. package/dist/modern/Loader/Loader.js +0 -187
  399. package/dist/modern/Loader/Loader.stories.js +0 -53
  400. package/dist/modern/ScrollArea/OverlayScrollbars.js +0 -88
  401. package/dist/modern/ScrollArea/ScrollArea.js +0 -45
  402. package/dist/modern/ScrollArea/ScrollArea.stories.js +0 -70
  403. package/dist/modern/Zoom/Zoom.js +0 -17
  404. package/dist/modern/Zoom/Zoom.stories.js +0 -113
  405. package/dist/modern/Zoom/ZoomElement.js +0 -35
  406. package/dist/modern/Zoom/ZoomIFrame.js +0 -71
  407. package/dist/modern/Zoom/browserSupportsCssZoom.js +0 -11
  408. package/dist/modern/addon-panel/addon-panel.js +0 -33
  409. package/dist/modern/bar/bar.js +0 -82
  410. package/dist/modern/bar/button.js +0 -126
  411. package/dist/modern/bar/button.stories.js +0 -42
  412. package/dist/modern/bar/separator.js +0 -25
  413. package/dist/modern/blocks/ArgsTable/ArgControl.js +0 -71
  414. package/dist/modern/blocks/ArgsTable/ArgJsDoc.js +0 -71
  415. package/dist/modern/blocks/ArgsTable/ArgRow.js +0 -105
  416. package/dist/modern/blocks/ArgsTable/ArgRow.stories.js +0 -361
  417. package/dist/modern/blocks/ArgsTable/ArgValue.js +0 -191
  418. package/dist/modern/blocks/ArgsTable/ArgsTable.js +0 -394
  419. package/dist/modern/blocks/ArgsTable/ArgsTable.stories.js +0 -151
  420. package/dist/modern/blocks/ArgsTable/NoControlsWarning.js +0 -19
  421. package/dist/modern/blocks/ArgsTable/SectionRow.js +0 -110
  422. package/dist/modern/blocks/ArgsTable/SectionRow.stories.js +0 -31
  423. package/dist/modern/blocks/ArgsTable/TabbedArgsTable.js +0 -36
  424. package/dist/modern/blocks/ArgsTable/TabbedArgsTable.stories.js +0 -32
  425. package/dist/modern/blocks/ArgsTable/index.js +0 -4
  426. package/dist/modern/blocks/ArgsTable/types.js +0 -0
  427. package/dist/modern/blocks/BlockBackgroundStyles.js +0 -6
  428. package/dist/modern/blocks/ColorPalette.js +0 -177
  429. package/dist/modern/blocks/ColorPalette.stories.js +0 -65
  430. package/dist/modern/blocks/Description.js +0 -18
  431. package/dist/modern/blocks/Description.stories.js +0 -65
  432. package/dist/modern/blocks/DocsPage.js +0 -53
  433. package/dist/modern/blocks/DocsPage.stories.js +0 -46
  434. package/dist/modern/blocks/EmptyBlock.js +0 -24
  435. package/dist/modern/blocks/EmptyBlock.stories.js +0 -8
  436. package/dist/modern/blocks/IFrame.js +0 -67
  437. package/dist/modern/blocks/IconGallery.js +0 -70
  438. package/dist/modern/blocks/IconGallery.stories.js +0 -35
  439. package/dist/modern/blocks/Preview.js +0 -276
  440. package/dist/modern/blocks/Preview.stories.js +0 -219
  441. package/dist/modern/blocks/Source.js +0 -119
  442. package/dist/modern/blocks/Source.stories.js +0 -55
  443. package/dist/modern/blocks/Story.js +0 -98
  444. package/dist/modern/blocks/Story.stories.js +0 -44
  445. package/dist/modern/blocks/Toolbar.js +0 -88
  446. package/dist/modern/blocks/Typeset.js +0 -65
  447. package/dist/modern/blocks/Typeset.stories.js +0 -29
  448. package/dist/modern/blocks/ZoomContext.js +0 -4
  449. package/dist/modern/blocks/index.js +0 -10
  450. package/dist/modern/brand/StorybookIcon.js +0 -30
  451. package/dist/modern/brand/StorybookIcon.stories.js +0 -4
  452. package/dist/modern/brand/StorybookLogo.js +0 -45
  453. package/dist/modern/brand/StorybookLogo.stories.js +0 -10
  454. package/dist/modern/controls/Boolean.js +0 -104
  455. package/dist/modern/controls/Boolean.stories.js +0 -19
  456. package/dist/modern/controls/Color.js +0 -345
  457. package/dist/modern/controls/Color.stories.js +0 -74
  458. package/dist/modern/controls/Date.js +0 -118
  459. package/dist/modern/controls/Date.stories.js +0 -18
  460. package/dist/modern/controls/Files.js +0 -43
  461. package/dist/modern/controls/Number.js +0 -79
  462. package/dist/modern/controls/Number.stories.js +0 -19
  463. package/dist/modern/controls/Object.js +0 -315
  464. package/dist/modern/controls/Object.stories.js +0 -38
  465. package/dist/modern/controls/Range.js +0 -184
  466. package/dist/modern/controls/Range.stories.js +0 -44
  467. package/dist/modern/controls/Text.js +0 -46
  468. package/dist/modern/controls/Text.stories.js +0 -19
  469. package/dist/modern/controls/helpers.js +0 -15
  470. package/dist/modern/controls/index.js +0 -15
  471. package/dist/modern/controls/options/Checkbox.js +0 -81
  472. package/dist/modern/controls/options/Options.js +0 -67
  473. package/dist/modern/controls/options/Options.stories.js +0 -55
  474. package/dist/modern/controls/options/Radio.js +0 -70
  475. package/dist/modern/controls/options/Select.js +0 -143
  476. package/dist/modern/controls/options/helpers.js +0 -6
  477. package/dist/modern/controls/options/index.js +0 -1
  478. package/dist/modern/controls/react-editable-json-tree/JsonNodes.js +0 -1539
  479. package/dist/modern/controls/react-editable-json-tree/index.js +0 -153
  480. package/dist/modern/controls/react-editable-json-tree/types/dataTypes.js +0 -12
  481. package/dist/modern/controls/react-editable-json-tree/types/deltaTypes.js +0 -4
  482. package/dist/modern/controls/react-editable-json-tree/types/inputUsageTypes.js +0 -3
  483. package/dist/modern/controls/react-editable-json-tree/utils/objectTypes.js +0 -24
  484. package/dist/modern/controls/react-editable-json-tree/utils/parse.js +0 -19
  485. package/dist/modern/controls/react-editable-json-tree/utils/styles.js +0 -59
  486. package/dist/modern/controls/types.js +0 -1
  487. package/dist/modern/form/field/field.js +0 -41
  488. package/dist/modern/form/form.stories.js +0 -126
  489. package/dist/modern/form/index.js +0 -14
  490. package/dist/modern/form/input/input.js +0 -208
  491. package/dist/modern/html.js +0 -10
  492. package/dist/modern/icon/icon.js +0 -45
  493. package/dist/modern/icon/icon.stories.js +0 -51
  494. package/dist/modern/icon/icons.js +0 -174
  495. package/dist/modern/icon/svg.js +0 -14
  496. package/dist/modern/placeholder/placeholder.js +0 -30
  497. package/dist/modern/placeholder/placeholder.stories.js +0 -19
  498. package/dist/modern/shared/animation.js +0 -9
  499. package/dist/modern/spaced/Spaced.js +0 -78
  500. package/dist/modern/spaced/Spaced.stories.js +0 -51
  501. package/dist/modern/syntaxhighlighter/formatter.js +0 -3
  502. package/dist/modern/syntaxhighlighter/lazy-syntaxhighlighter.js +0 -6
  503. package/dist/modern/syntaxhighlighter/syntaxhighlighter-types.js +0 -1
  504. package/dist/modern/syntaxhighlighter/syntaxhighlighter.js +0 -174
  505. package/dist/modern/syntaxhighlighter/syntaxhighlighter.stories.js +0 -187
  506. package/dist/modern/tabs/tabs.js +0 -214
  507. package/dist/modern/tabs/tabs.stories.js +0 -196
  508. package/dist/modern/tooltip/ListItem.js +0 -186
  509. package/dist/modern/tooltip/ListItem.stories.js +0 -71
  510. package/dist/modern/tooltip/Tooltip.js +0 -112
  511. package/dist/modern/tooltip/Tooltip.stories.js +0 -30
  512. package/dist/modern/tooltip/TooltipLinkList.js +0 -67
  513. package/dist/modern/tooltip/TooltipLinkList.stories.js +0 -54
  514. package/dist/modern/tooltip/TooltipMessage.js +0 -58
  515. package/dist/modern/tooltip/TooltipMessage.stories.js +0 -36
  516. package/dist/modern/tooltip/TooltipNote.js +0 -31
  517. package/dist/modern/tooltip/TooltipNote.stories.js +0 -17
  518. package/dist/modern/tooltip/WithTooltip.js +0 -155
  519. package/dist/modern/tooltip/WithTooltip.stories.js +0 -68
  520. package/dist/modern/tooltip/lazy-WithTooltip.js +0 -15
  521. package/dist/modern/typography/DocumentFormatting.js +0 -9
  522. package/dist/modern/typography/DocumentWrapper.js +0 -287
  523. package/dist/modern/typography/DocumentWrapper.stories.js +0 -64
  524. package/dist/modern/typography/ResetWrapper.js +0 -11
  525. package/dist/modern/typography/components.js +0 -48
  526. package/dist/modern/typography/elements/A.js +0 -24
  527. package/dist/modern/typography/elements/Blockquote.js +0 -15
  528. package/dist/modern/typography/elements/Code.js +0 -52
  529. package/dist/modern/typography/elements/DL.js +0 -31
  530. package/dist/modern/typography/elements/Div.js +0 -3
  531. package/dist/modern/typography/elements/H1.js +0 -8
  532. package/dist/modern/typography/elements/H2.js +0 -9
  533. package/dist/modern/typography/elements/H3.js +0 -7
  534. package/dist/modern/typography/elements/H4.js +0 -7
  535. package/dist/modern/typography/elements/H5.js +0 -7
  536. package/dist/modern/typography/elements/H6.js +0 -8
  537. package/dist/modern/typography/elements/HR.js +0 -9
  538. package/dist/modern/typography/elements/Img.js +0 -4
  539. package/dist/modern/typography/elements/LI.js +0 -19
  540. package/dist/modern/typography/elements/Link.js +0 -24
  541. package/dist/modern/typography/elements/OL.js +0 -14
  542. package/dist/modern/typography/elements/P.js +0 -12
  543. package/dist/modern/typography/elements/Pre.js +0 -41
  544. package/dist/modern/typography/elements/Span.js +0 -80
  545. package/dist/modern/typography/elements/TT.js +0 -3
  546. package/dist/modern/typography/elements/Table.js +0 -38
  547. package/dist/modern/typography/elements/UL.js +0 -14
  548. package/dist/modern/typography/lib/common.js +0 -47
  549. package/dist/modern/typography/lib/isReactChildString.js +0 -1
  550. package/dist/modern/typography/link/link.js +0 -177
  551. package/dist/modern/typography/link/link.stories.js +0 -52
  552. package/dist/modern/utils/getStoryHref.js +0 -13
  553. package/dist/ts3.4/ActionBar/ActionBar.d.ts +0 -14
  554. package/dist/ts3.4/Badge/Badge.d.ts +0 -5
  555. package/dist/ts3.4/Button/Button.d.ts +0 -18
  556. package/dist/ts3.4/Colors/SideBySide.d.ts +0 -2
  557. package/dist/ts3.4/Loader/Loader.d.ts +0 -18
  558. package/dist/ts3.4/ScrollArea/GlobalScrollAreaStyles.d.ts +0 -5
  559. package/dist/ts3.4/ScrollArea/OverlayScrollbars.d.ts +0 -15
  560. package/dist/ts3.4/ScrollArea/ScrollArea.d.ts +0 -7
  561. package/dist/ts3.4/Zoom/Zoom.d.ts +0 -7
  562. package/dist/ts3.4/Zoom/ZoomElement.d.ts +0 -7
  563. package/dist/ts3.4/Zoom/ZoomIFrame.d.ts +0 -15
  564. package/dist/ts3.4/Zoom/browserSupportsCssZoom.d.ts +0 -1
  565. package/dist/ts3.4/addon-panel/addon-panel.d.ts +0 -6
  566. package/dist/ts3.4/bar/bar.d.ts +0 -12
  567. package/dist/ts3.4/bar/button.d.ts +0 -27
  568. package/dist/ts3.4/bar/separator.d.ts +0 -6
  569. package/dist/ts3.4/blocks/ArgsTable/ArgControl.d.ts +0 -8
  570. package/dist/ts3.4/blocks/ArgsTable/ArgJsDoc.d.ts +0 -8
  571. package/dist/ts3.4/blocks/ArgsTable/ArgRow.d.ts +0 -12
  572. package/dist/ts3.4/blocks/ArgsTable/ArgValue.d.ts +0 -8
  573. package/dist/ts3.4/blocks/ArgsTable/ArgsTable.d.ts +0 -38
  574. package/dist/ts3.4/blocks/ArgsTable/NoControlsWarning.d.ts +0 -2
  575. package/dist/ts3.4/blocks/ArgsTable/SectionRow.d.ts +0 -10
  576. package/dist/ts3.4/blocks/ArgsTable/TabbedArgsTable.d.ts +0 -7
  577. package/dist/ts3.4/blocks/ArgsTable/index.d.ts +0 -4
  578. package/dist/ts3.4/blocks/ArgsTable/types.d.ts +0 -36
  579. package/dist/ts3.4/blocks/BlockBackgroundStyles.d.ts +0 -2
  580. package/dist/ts3.4/blocks/ColorPalette.d.ts +0 -20
  581. package/dist/ts3.4/blocks/Description.d.ts +0 -9
  582. package/dist/ts3.4/blocks/DocsPage.d.ts +0 -11
  583. package/dist/ts3.4/blocks/EmptyBlock.d.ts +0 -2
  584. package/dist/ts3.4/blocks/IFrame.d.ts +0 -24
  585. package/dist/ts3.4/blocks/IconGallery.d.ts +0 -13
  586. package/dist/ts3.4/blocks/Preview.d.ts +0 -20
  587. package/dist/ts3.4/blocks/Source.d.ts +0 -22
  588. package/dist/ts3.4/blocks/Story.d.ts +0 -26
  589. package/dist/ts3.4/blocks/Toolbar.d.ts +0 -18
  590. package/dist/ts3.4/blocks/Typeset.d.ts +0 -12
  591. package/dist/ts3.4/blocks/ZoomContext.d.ts +0 -4
  592. package/dist/ts3.4/blocks/index.d.ts +0 -10
  593. package/dist/ts3.4/brand/StorybookIcon.d.ts +0 -2
  594. package/dist/ts3.4/brand/StorybookLogo.d.ts +0 -5
  595. package/dist/ts3.4/controls/Boolean.d.ts +0 -4
  596. package/dist/ts3.4/controls/Color.d.ts +0 -5
  597. package/dist/ts3.4/controls/Date.d.ts +0 -4
  598. package/dist/ts3.4/controls/Files.d.ts +0 -6
  599. package/dist/ts3.4/controls/Number.d.ts +0 -7
  600. package/dist/ts3.4/controls/Object.d.ts +0 -6
  601. package/dist/ts3.4/controls/Range.d.ts +0 -5
  602. package/dist/ts3.4/controls/Text.d.ts +0 -4
  603. package/dist/ts3.4/controls/helpers.d.ts +0 -14
  604. package/dist/ts3.4/controls/index.d.ts +0 -14
  605. package/dist/ts3.4/controls/options/Checkbox.d.ts +0 -8
  606. package/dist/ts3.4/controls/options/Options.d.ts +0 -4
  607. package/dist/ts3.4/controls/options/Radio.d.ts +0 -8
  608. package/dist/ts3.4/controls/options/Select.d.ts +0 -8
  609. package/dist/ts3.4/controls/options/helpers.d.ts +0 -4
  610. package/dist/ts3.4/controls/options/index.d.ts +0 -1
  611. package/dist/ts3.4/controls/react-editable-json-tree/JsonNodes.d.ts +0 -247
  612. package/dist/ts3.4/controls/react-editable-json-tree/index.d.ts +0 -42
  613. package/dist/ts3.4/controls/react-editable-json-tree/types/dataTypes.d.ts +0 -12
  614. package/dist/ts3.4/controls/react-editable-json-tree/types/deltaTypes.d.ts +0 -4
  615. package/dist/ts3.4/controls/react-editable-json-tree/types/inputUsageTypes.d.ts +0 -3
  616. package/dist/ts3.4/controls/react-editable-json-tree/utils/objectTypes.d.ts +0 -13
  617. package/dist/ts3.4/controls/react-editable-json-tree/utils/parse.d.ts +0 -6
  618. package/dist/ts3.4/controls/react-editable-json-tree/utils/styles.d.ts +0 -59
  619. package/dist/ts3.4/controls/types.d.ts +0 -56
  620. package/dist/ts3.4/form/field/field.d.ts +0 -5
  621. package/dist/ts3.4/form/index.d.ts +0 -15
  622. package/dist/ts3.4/form/input/input.d.ts +0 -26
  623. package/dist/ts3.4/html.d.ts +0 -2
  624. package/dist/ts3.4/icon/icon.d.ts +0 -12
  625. package/dist/ts3.4/icon/icons.d.ts +0 -174
  626. package/dist/ts3.4/icon/svg.d.ts +0 -6
  627. package/dist/ts3.4/placeholder/placeholder.d.ts +0 -2
  628. package/dist/ts3.4/shared/animation.d.ts +0 -1
  629. package/dist/ts3.4/spaced/Spaced.d.ts +0 -12
  630. package/dist/ts3.4/syntaxhighlighter/formatter.d.ts +0 -1
  631. package/dist/ts3.4/syntaxhighlighter/lazy-syntaxhighlighter.d.ts +0 -4
  632. package/dist/ts3.4/syntaxhighlighter/syntaxhighlighter-types.d.ts +0 -15
  633. package/dist/ts3.4/syntaxhighlighter/syntaxhighlighter.d.ts +0 -18
  634. package/dist/ts3.4/tabs/tabs.d.ts +0 -52
  635. package/dist/ts3.4/tooltip/ListItem.d.ts +0 -34
  636. package/dist/ts3.4/tooltip/Tooltip.d.ts +0 -21
  637. package/dist/ts3.4/tooltip/TooltipLinkList.d.ts +0 -12
  638. package/dist/ts3.4/tooltip/TooltipMessage.d.ts +0 -11
  639. package/dist/ts3.4/tooltip/TooltipNote.d.ts +0 -5
  640. package/dist/ts3.4/tooltip/WithTooltip.d.ts +0 -23
  641. package/dist/ts3.4/tooltip/lazy-WithTooltip.d.ts +0 -8
  642. package/dist/ts3.4/typography/DocumentFormatting.d.ts +0 -5
  643. package/dist/ts3.4/typography/DocumentWrapper.d.ts +0 -2
  644. package/dist/ts3.4/typography/ResetWrapper.d.ts +0 -9
  645. package/dist/ts3.4/typography/components.d.ts +0 -25
  646. package/dist/ts3.4/typography/elements/A.d.ts +0 -6
  647. package/dist/ts3.4/typography/elements/Blockquote.d.ts +0 -6
  648. package/dist/ts3.4/typography/elements/Code.d.ts +0 -6
  649. package/dist/ts3.4/typography/elements/DL.d.ts +0 -4
  650. package/dist/ts3.4/typography/elements/Div.d.ts +0 -4
  651. package/dist/ts3.4/typography/elements/H1.d.ts +0 -6
  652. package/dist/ts3.4/typography/elements/H2.d.ts +0 -6
  653. package/dist/ts3.4/typography/elements/H3.d.ts +0 -6
  654. package/dist/ts3.4/typography/elements/H4.d.ts +0 -6
  655. package/dist/ts3.4/typography/elements/H5.d.ts +0 -6
  656. package/dist/ts3.4/typography/elements/H6.d.ts +0 -6
  657. package/dist/ts3.4/typography/elements/HR.d.ts +0 -2
  658. package/dist/ts3.4/typography/elements/Img.d.ts +0 -2
  659. package/dist/ts3.4/typography/elements/LI.d.ts +0 -6
  660. package/dist/ts3.4/typography/elements/Link.d.ts +0 -2
  661. package/dist/ts3.4/typography/elements/OL.d.ts +0 -4
  662. package/dist/ts3.4/typography/elements/P.d.ts +0 -6
  663. package/dist/ts3.4/typography/elements/Pre.d.ts +0 -6
  664. package/dist/ts3.4/typography/elements/Span.d.ts +0 -6
  665. package/dist/ts3.4/typography/elements/TT.d.ts +0 -4
  666. package/dist/ts3.4/typography/elements/Table.d.ts +0 -6
  667. package/dist/ts3.4/typography/elements/UL.d.ts +0 -4
  668. package/dist/ts3.4/typography/lib/common.d.ts +0 -11
  669. package/dist/ts3.4/typography/lib/isReactChildString.d.ts +0 -2
  670. package/dist/ts3.4/typography/link/link.d.ts +0 -22
  671. package/dist/ts3.4/utils/getStoryHref.d.ts +0 -1
  672. package/dist/ts3.9/ActionBar/ActionBar.d.ts +0 -14
  673. package/dist/ts3.9/Badge/Badge.d.ts +0 -5
  674. package/dist/ts3.9/Button/Button.d.ts +0 -18
  675. package/dist/ts3.9/Colors/SideBySide.d.ts +0 -2
  676. package/dist/ts3.9/Loader/Loader.d.ts +0 -18
  677. package/dist/ts3.9/ScrollArea/GlobalScrollAreaStyles.d.ts +0 -5
  678. package/dist/ts3.9/ScrollArea/OverlayScrollbars.d.ts +0 -15
  679. package/dist/ts3.9/ScrollArea/ScrollArea.d.ts +0 -7
  680. package/dist/ts3.9/Zoom/Zoom.d.ts +0 -7
  681. package/dist/ts3.9/Zoom/ZoomElement.d.ts +0 -7
  682. package/dist/ts3.9/Zoom/ZoomIFrame.d.ts +0 -15
  683. package/dist/ts3.9/Zoom/browserSupportsCssZoom.d.ts +0 -1
  684. package/dist/ts3.9/addon-panel/addon-panel.d.ts +0 -6
  685. package/dist/ts3.9/bar/bar.d.ts +0 -12
  686. package/dist/ts3.9/bar/button.d.ts +0 -27
  687. package/dist/ts3.9/bar/separator.d.ts +0 -6
  688. package/dist/ts3.9/blocks/ArgsTable/ArgControl.d.ts +0 -8
  689. package/dist/ts3.9/blocks/ArgsTable/ArgJsDoc.d.ts +0 -8
  690. package/dist/ts3.9/blocks/ArgsTable/ArgRow.d.ts +0 -12
  691. package/dist/ts3.9/blocks/ArgsTable/ArgValue.d.ts +0 -8
  692. package/dist/ts3.9/blocks/ArgsTable/ArgsTable.d.ts +0 -38
  693. package/dist/ts3.9/blocks/ArgsTable/NoControlsWarning.d.ts +0 -2
  694. package/dist/ts3.9/blocks/ArgsTable/SectionRow.d.ts +0 -10
  695. package/dist/ts3.9/blocks/ArgsTable/TabbedArgsTable.d.ts +0 -7
  696. package/dist/ts3.9/blocks/ArgsTable/index.d.ts +0 -4
  697. package/dist/ts3.9/blocks/ArgsTable/types.d.ts +0 -36
  698. package/dist/ts3.9/blocks/BlockBackgroundStyles.d.ts +0 -2
  699. package/dist/ts3.9/blocks/ColorPalette.d.ts +0 -20
  700. package/dist/ts3.9/blocks/Description.d.ts +0 -9
  701. package/dist/ts3.9/blocks/DocsPage.d.ts +0 -11
  702. package/dist/ts3.9/blocks/EmptyBlock.d.ts +0 -2
  703. package/dist/ts3.9/blocks/IFrame.d.ts +0 -24
  704. package/dist/ts3.9/blocks/IconGallery.d.ts +0 -13
  705. package/dist/ts3.9/blocks/Preview.d.ts +0 -20
  706. package/dist/ts3.9/blocks/Source.d.ts +0 -22
  707. package/dist/ts3.9/blocks/Story.d.ts +0 -26
  708. package/dist/ts3.9/blocks/Toolbar.d.ts +0 -18
  709. package/dist/ts3.9/blocks/Typeset.d.ts +0 -12
  710. package/dist/ts3.9/blocks/ZoomContext.d.ts +0 -4
  711. package/dist/ts3.9/blocks/index.d.ts +0 -10
  712. package/dist/ts3.9/brand/StorybookIcon.d.ts +0 -2
  713. package/dist/ts3.9/brand/StorybookLogo.d.ts +0 -5
  714. package/dist/ts3.9/controls/Boolean.d.ts +0 -4
  715. package/dist/ts3.9/controls/Color.d.ts +0 -5
  716. package/dist/ts3.9/controls/Date.d.ts +0 -4
  717. package/dist/ts3.9/controls/Files.d.ts +0 -6
  718. package/dist/ts3.9/controls/Number.d.ts +0 -7
  719. package/dist/ts3.9/controls/Object.d.ts +0 -6
  720. package/dist/ts3.9/controls/Range.d.ts +0 -5
  721. package/dist/ts3.9/controls/Text.d.ts +0 -4
  722. package/dist/ts3.9/controls/helpers.d.ts +0 -14
  723. package/dist/ts3.9/controls/index.d.ts +0 -14
  724. package/dist/ts3.9/controls/options/Checkbox.d.ts +0 -8
  725. package/dist/ts3.9/controls/options/Options.d.ts +0 -4
  726. package/dist/ts3.9/controls/options/Radio.d.ts +0 -8
  727. package/dist/ts3.9/controls/options/Select.d.ts +0 -8
  728. package/dist/ts3.9/controls/options/helpers.d.ts +0 -4
  729. package/dist/ts3.9/controls/options/index.d.ts +0 -1
  730. package/dist/ts3.9/controls/react-editable-json-tree/JsonNodes.d.ts +0 -247
  731. package/dist/ts3.9/controls/react-editable-json-tree/index.d.ts +0 -42
  732. package/dist/ts3.9/controls/react-editable-json-tree/types/dataTypes.d.ts +0 -12
  733. package/dist/ts3.9/controls/react-editable-json-tree/types/deltaTypes.d.ts +0 -4
  734. package/dist/ts3.9/controls/react-editable-json-tree/types/inputUsageTypes.d.ts +0 -3
  735. package/dist/ts3.9/controls/react-editable-json-tree/utils/objectTypes.d.ts +0 -13
  736. package/dist/ts3.9/controls/react-editable-json-tree/utils/parse.d.ts +0 -6
  737. package/dist/ts3.9/controls/react-editable-json-tree/utils/styles.d.ts +0 -59
  738. package/dist/ts3.9/controls/types.d.ts +0 -56
  739. package/dist/ts3.9/form/field/field.d.ts +0 -5
  740. package/dist/ts3.9/form/index.d.ts +0 -15
  741. package/dist/ts3.9/form/input/input.d.ts +0 -26
  742. package/dist/ts3.9/html.d.ts +0 -2
  743. package/dist/ts3.9/icon/icon.d.ts +0 -12
  744. package/dist/ts3.9/icon/icons.d.ts +0 -174
  745. package/dist/ts3.9/icon/svg.d.ts +0 -6
  746. package/dist/ts3.9/placeholder/placeholder.d.ts +0 -2
  747. package/dist/ts3.9/shared/animation.d.ts +0 -1
  748. package/dist/ts3.9/spaced/Spaced.d.ts +0 -12
  749. package/dist/ts3.9/syntaxhighlighter/formatter.d.ts +0 -1
  750. package/dist/ts3.9/syntaxhighlighter/lazy-syntaxhighlighter.d.ts +0 -4
  751. package/dist/ts3.9/syntaxhighlighter/syntaxhighlighter-types.d.ts +0 -15
  752. package/dist/ts3.9/syntaxhighlighter/syntaxhighlighter.d.ts +0 -18
  753. package/dist/ts3.9/tabs/tabs.d.ts +0 -52
  754. package/dist/ts3.9/tooltip/ListItem.d.ts +0 -34
  755. package/dist/ts3.9/tooltip/Tooltip.d.ts +0 -21
  756. package/dist/ts3.9/tooltip/TooltipLinkList.d.ts +0 -12
  757. package/dist/ts3.9/tooltip/TooltipMessage.d.ts +0 -11
  758. package/dist/ts3.9/tooltip/TooltipNote.d.ts +0 -5
  759. package/dist/ts3.9/tooltip/WithTooltip.d.ts +0 -23
  760. package/dist/ts3.9/tooltip/lazy-WithTooltip.d.ts +0 -8
  761. package/dist/ts3.9/typography/DocumentFormatting.d.ts +0 -5
  762. package/dist/ts3.9/typography/DocumentWrapper.d.ts +0 -2
  763. package/dist/ts3.9/typography/ResetWrapper.d.ts +0 -9
  764. package/dist/ts3.9/typography/components.d.ts +0 -25
  765. package/dist/ts3.9/typography/elements/A.d.ts +0 -6
  766. package/dist/ts3.9/typography/elements/Blockquote.d.ts +0 -6
  767. package/dist/ts3.9/typography/elements/Code.d.ts +0 -6
  768. package/dist/ts3.9/typography/elements/DL.d.ts +0 -4
  769. package/dist/ts3.9/typography/elements/Div.d.ts +0 -4
  770. package/dist/ts3.9/typography/elements/H1.d.ts +0 -6
  771. package/dist/ts3.9/typography/elements/H2.d.ts +0 -6
  772. package/dist/ts3.9/typography/elements/H3.d.ts +0 -6
  773. package/dist/ts3.9/typography/elements/H4.d.ts +0 -6
  774. package/dist/ts3.9/typography/elements/H5.d.ts +0 -6
  775. package/dist/ts3.9/typography/elements/H6.d.ts +0 -6
  776. package/dist/ts3.9/typography/elements/HR.d.ts +0 -2
  777. package/dist/ts3.9/typography/elements/Img.d.ts +0 -2
  778. package/dist/ts3.9/typography/elements/LI.d.ts +0 -6
  779. package/dist/ts3.9/typography/elements/Link.d.ts +0 -2
  780. package/dist/ts3.9/typography/elements/OL.d.ts +0 -4
  781. package/dist/ts3.9/typography/elements/P.d.ts +0 -6
  782. package/dist/ts3.9/typography/elements/Pre.d.ts +0 -6
  783. package/dist/ts3.9/typography/elements/Span.d.ts +0 -6
  784. package/dist/ts3.9/typography/elements/TT.d.ts +0 -4
  785. package/dist/ts3.9/typography/elements/Table.d.ts +0 -6
  786. package/dist/ts3.9/typography/elements/UL.d.ts +0 -4
  787. package/dist/ts3.9/typography/lib/common.d.ts +0 -11
  788. package/dist/ts3.9/typography/lib/isReactChildString.d.ts +0 -2
  789. package/dist/ts3.9/typography/link/link.d.ts +0 -22
  790. package/dist/ts3.9/utils/getStoryHref.d.ts +0 -1
@@ -0,0 +1,2442 @@
1
+ import { x as _root, y as isObject_1, z as isSymbol_1, W as WithTooltip, T as TooltipNote, F as Form, I as Icons, B as getControlId, e as __rest } from './index-0404c596.js';
2
+ import React__default, { useRef, useMemo, useEffect, useState, useCallback, useLayoutEffect } from 'react';
3
+ import { styled } from '@storybook/theming';
4
+ import '@storybook/csf';
5
+ import '@storybook/client-logger';
6
+
7
+ function u() {
8
+ return (u = Object.assign || function (e) {
9
+ for (var r = 1; r < arguments.length; r++) {
10
+ var t = arguments[r];
11
+
12
+ for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
13
+ }
14
+
15
+ return e;
16
+ }).apply(this, arguments);
17
+ }
18
+
19
+ function c(e, r) {
20
+ if (null == e) return {};
21
+ var t,
22
+ n,
23
+ o = {},
24
+ a = Object.keys(e);
25
+
26
+ for (n = 0; n < a.length; n++) r.indexOf(t = a[n]) >= 0 || (o[t] = e[t]);
27
+
28
+ return o;
29
+ }
30
+
31
+ function i(e) {
32
+ var t = useRef(e),
33
+ n = useRef(function (e) {
34
+ t.current && t.current(e);
35
+ });
36
+ return t.current = e, n.current;
37
+ }
38
+
39
+ var s = function (e, r, t) {
40
+ return void 0 === r && (r = 0), void 0 === t && (t = 1), e > t ? t : e < r ? r : e;
41
+ },
42
+ f = function (e) {
43
+ return "touches" in e;
44
+ },
45
+ v = function (e) {
46
+ return e && e.ownerDocument.defaultView || self;
47
+ },
48
+ d = function (e, r, t) {
49
+ var n = e.getBoundingClientRect(),
50
+ o = f(r) ? function (e, r) {
51
+ for (var t = 0; t < e.length; t++) if (e[t].identifier === r) return e[t];
52
+
53
+ return e[0];
54
+ }(r.touches, t) : r;
55
+ return {
56
+ left: s((o.pageX - (n.left + v(e).pageXOffset)) / n.width),
57
+ top: s((o.pageY - (n.top + v(e).pageYOffset)) / n.height)
58
+ };
59
+ },
60
+ h = function (e) {
61
+ !f(e) && e.preventDefault();
62
+ },
63
+ m = React__default.memo(function (o) {
64
+ var a = o.onMove,
65
+ l = o.onKey,
66
+ s = c(o, ["onMove", "onKey"]),
67
+ m = useRef(null),
68
+ g = i(a),
69
+ p = i(l),
70
+ b = useRef(null),
71
+ _ = useRef(!1),
72
+ x = useMemo(function () {
73
+ var e = function (e) {
74
+ h(e), (f(e) ? e.touches.length > 0 : e.buttons > 0) && m.current ? g(d(m.current, e, b.current)) : t(!1);
75
+ },
76
+ r = function () {
77
+ return t(!1);
78
+ };
79
+
80
+ function t(t) {
81
+ var n = _.current,
82
+ o = v(m.current),
83
+ a = t ? o.addEventListener : o.removeEventListener;
84
+ a(n ? "touchmove" : "mousemove", e), a(n ? "touchend" : "mouseup", r);
85
+ }
86
+
87
+ return [function (e) {
88
+ var r = e.nativeEvent,
89
+ n = m.current;
90
+
91
+ if (n && (h(r), !function (e, r) {
92
+ return r && !f(e);
93
+ }(r, _.current) && n)) {
94
+ if (f(r)) {
95
+ _.current = !0;
96
+ var o = r.changedTouches || [];
97
+ o.length && (b.current = o[0].identifier);
98
+ }
99
+
100
+ n.focus(), g(d(n, r, b.current)), t(!0);
101
+ }
102
+ }, function (e) {
103
+ var r = e.which || e.keyCode;
104
+ r < 37 || r > 40 || (e.preventDefault(), p({
105
+ left: 39 === r ? .05 : 37 === r ? -.05 : 0,
106
+ top: 40 === r ? .05 : 38 === r ? -.05 : 0
107
+ }));
108
+ }, t];
109
+ }, [p, g]),
110
+ C = x[0],
111
+ E = x[1],
112
+ H = x[2];
113
+
114
+ return useEffect(function () {
115
+ return H;
116
+ }, [H]), React__default.createElement("div", u({}, s, {
117
+ onTouchStart: C,
118
+ onMouseDown: C,
119
+ className: "react-colorful__interactive",
120
+ ref: m,
121
+ onKeyDown: E,
122
+ tabIndex: 0,
123
+ role: "slider"
124
+ }));
125
+ }),
126
+ g = function (e) {
127
+ return e.filter(Boolean).join(" ");
128
+ },
129
+ p = function (r) {
130
+ var t = r.color,
131
+ n = r.left,
132
+ o = r.top,
133
+ a = void 0 === o ? .5 : o,
134
+ l = g(["react-colorful__pointer", r.className]);
135
+ return React__default.createElement("div", {
136
+ className: l,
137
+ style: {
138
+ top: 100 * a + "%",
139
+ left: 100 * n + "%"
140
+ }
141
+ }, React__default.createElement("div", {
142
+ className: "react-colorful__pointer-fill",
143
+ style: {
144
+ backgroundColor: t
145
+ }
146
+ }));
147
+ },
148
+ b = function (e, r, t) {
149
+ return void 0 === r && (r = 0), void 0 === t && (t = Math.pow(10, r)), Math.round(t * e) / t;
150
+ },
151
+ _ = {
152
+ grad: .9,
153
+ turn: 360,
154
+ rad: 360 / (2 * Math.PI)
155
+ },
156
+ x = function (e) {
157
+ return "#" === e[0] && (e = e.substr(1)), e.length < 6 ? {
158
+ r: parseInt(e[0] + e[0], 16),
159
+ g: parseInt(e[1] + e[1], 16),
160
+ b: parseInt(e[2] + e[2], 16),
161
+ a: 1
162
+ } : {
163
+ r: parseInt(e.substr(0, 2), 16),
164
+ g: parseInt(e.substr(2, 2), 16),
165
+ b: parseInt(e.substr(4, 2), 16),
166
+ a: 1
167
+ };
168
+ },
169
+ C = function (e, r) {
170
+ return void 0 === r && (r = "deg"), Number(e) * (_[r] || 1);
171
+ },
172
+ E = function (e) {
173
+ var r = /hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);
174
+ return r ? M({
175
+ h: C(r[1], r[2]),
176
+ s: Number(r[3]),
177
+ l: Number(r[4]),
178
+ a: void 0 === r[5] ? 1 : Number(r[5]) / (r[6] ? 100 : 1)
179
+ }) : {
180
+ h: 0,
181
+ s: 0,
182
+ v: 0,
183
+ a: 1
184
+ };
185
+ },
186
+ M = function (e) {
187
+ var r = e.s,
188
+ t = e.l;
189
+ return {
190
+ h: e.h,
191
+ s: (r *= (t < 50 ? t : 100 - t) / 100) > 0 ? 2 * r / (t + r) * 100 : 0,
192
+ v: t + r,
193
+ a: e.a
194
+ };
195
+ },
196
+ N = function (e) {
197
+ var r = e.s,
198
+ t = e.v,
199
+ n = e.a,
200
+ o = (200 - r) * t / 100;
201
+ return {
202
+ h: b(e.h),
203
+ s: b(o > 0 && o < 200 ? r * t / 100 / (o <= 100 ? o : 200 - o) * 100 : 0),
204
+ l: b(o / 2),
205
+ a: b(n, 2)
206
+ };
207
+ },
208
+ w = function (e) {
209
+ var r = N(e);
210
+ return "hsl(" + r.h + ", " + r.s + "%, " + r.l + "%)";
211
+ },
212
+ y = function (e) {
213
+ var r = N(e);
214
+ return "hsla(" + r.h + ", " + r.s + "%, " + r.l + "%, " + r.a + ")";
215
+ },
216
+ q = function (e) {
217
+ var r = e.h,
218
+ t = e.s,
219
+ n = e.v,
220
+ o = e.a;
221
+ r = r / 360 * 6, t /= 100, n /= 100;
222
+ var a = Math.floor(r),
223
+ l = n * (1 - t),
224
+ u = n * (1 - (r - a) * t),
225
+ c = n * (1 - (1 - r + a) * t),
226
+ i = a % 6;
227
+ return {
228
+ r: b(255 * [n, u, l, l, c, n][i]),
229
+ g: b(255 * [c, n, n, u, l, l][i]),
230
+ b: b(255 * [l, l, c, n, n, u][i]),
231
+ a: b(o, 2)
232
+ };
233
+ },
234
+ I = function (e) {
235
+ var r = /rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);
236
+ return r ? B({
237
+ r: Number(r[1]) / (r[2] ? 100 / 255 : 1),
238
+ g: Number(r[3]) / (r[4] ? 100 / 255 : 1),
239
+ b: Number(r[5]) / (r[6] ? 100 / 255 : 1),
240
+ a: void 0 === r[7] ? 1 : Number(r[7]) / (r[8] ? 100 : 1)
241
+ }) : {
242
+ h: 0,
243
+ s: 0,
244
+ v: 0,
245
+ a: 1
246
+ };
247
+ },
248
+ z = function (e) {
249
+ var r = e.toString(16);
250
+ return r.length < 2 ? "0" + r : r;
251
+ },
252
+ B = function (e) {
253
+ var r = e.r,
254
+ t = e.g,
255
+ n = e.b,
256
+ o = e.a,
257
+ a = Math.max(r, t, n),
258
+ l = a - Math.min(r, t, n),
259
+ u = l ? a === r ? (t - n) / l : a === t ? 2 + (n - r) / l : 4 + (r - t) / l : 0;
260
+ return {
261
+ h: b(60 * (u < 0 ? u + 6 : u)),
262
+ s: b(a ? l / a * 100 : 0),
263
+ v: b(a / 255 * 100),
264
+ a: o
265
+ };
266
+ },
267
+ K = React__default.memo(function (r) {
268
+ var t = r.hue,
269
+ n = r.onChange,
270
+ o = g(["react-colorful__hue", r.className]);
271
+ return React__default.createElement("div", {
272
+ className: o
273
+ }, React__default.createElement(m, {
274
+ onMove: function (e) {
275
+ n({
276
+ h: 360 * e.left
277
+ });
278
+ },
279
+ onKey: function (e) {
280
+ n({
281
+ h: s(t + 360 * e.left, 0, 360)
282
+ });
283
+ },
284
+ "aria-label": "Hue",
285
+ "aria-valuetext": b(t)
286
+ }, React__default.createElement(p, {
287
+ className: "react-colorful__hue-pointer",
288
+ left: t / 360,
289
+ color: w({
290
+ h: t,
291
+ s: 100,
292
+ v: 100,
293
+ a: 1
294
+ })
295
+ })));
296
+ }),
297
+ L = React__default.memo(function (r) {
298
+ var t = r.hsva,
299
+ n = r.onChange,
300
+ o = {
301
+ backgroundColor: w({
302
+ h: t.h,
303
+ s: 100,
304
+ v: 100,
305
+ a: 1
306
+ })
307
+ };
308
+ return React__default.createElement("div", {
309
+ className: "react-colorful__saturation",
310
+ style: o
311
+ }, React__default.createElement(m, {
312
+ onMove: function (e) {
313
+ n({
314
+ s: 100 * e.left,
315
+ v: 100 - 100 * e.top
316
+ });
317
+ },
318
+ onKey: function (e) {
319
+ n({
320
+ s: s(t.s + 100 * e.left, 0, 100),
321
+ v: s(t.v - 100 * e.top, 0, 100)
322
+ });
323
+ },
324
+ "aria-label": "Color",
325
+ "aria-valuetext": "Saturation " + b(t.s) + "%, Brightness " + b(t.v) + "%"
326
+ }, React__default.createElement(p, {
327
+ className: "react-colorful__saturation-pointer",
328
+ top: 1 - t.v / 100,
329
+ left: t.s / 100,
330
+ color: w(t)
331
+ })));
332
+ }),
333
+ A = function (e, r) {
334
+ if (e === r) return !0;
335
+
336
+ for (var t in e) if (e[t] !== r[t]) return !1;
337
+
338
+ return !0;
339
+ },
340
+ S = function (e, r) {
341
+ return e.replace(/\s/g, "") === r.replace(/\s/g, "");
342
+ };
343
+
344
+ function T(e, t, l) {
345
+ var u = i(l),
346
+ c = useState(function () {
347
+ return e.toHsva(t);
348
+ }),
349
+ s = c[0],
350
+ f = c[1],
351
+ v = useRef({
352
+ color: t,
353
+ hsva: s
354
+ });
355
+ useEffect(function () {
356
+ if (!e.equal(t, v.current.color)) {
357
+ var r = e.toHsva(t);
358
+ v.current = {
359
+ hsva: r,
360
+ color: t
361
+ }, f(r);
362
+ }
363
+ }, [t, e]), useEffect(function () {
364
+ var r;
365
+ A(s, v.current.hsva) || e.equal(r = e.fromHsva(s), v.current.color) || (v.current = {
366
+ hsva: s,
367
+ color: r
368
+ }, u(r));
369
+ }, [s, e, u]);
370
+ var d = useCallback(function (e) {
371
+ f(function (r) {
372
+ return Object.assign({}, r, e);
373
+ });
374
+ }, []);
375
+ return [s, d];
376
+ }
377
+
378
+ var P = "undefined" != typeof window ? useLayoutEffect : useEffect,
379
+ X = function () {
380
+ return "undefined" != typeof __webpack_nonce__ ? __webpack_nonce__ : void 0;
381
+ },
382
+ R = new Map(),
383
+ V = function (e) {
384
+ P(function () {
385
+ var r = e.current ? e.current.ownerDocument : document;
386
+
387
+ if (void 0 !== r && !R.has(r)) {
388
+ var t = r.createElement("style");
389
+ t.innerHTML = '.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}', R.set(r, t);
390
+ var n = X();
391
+ n && t.setAttribute("nonce", n), r.head.appendChild(t);
392
+ }
393
+ }, []);
394
+ },
395
+ $ = function (t) {
396
+ var n = t.className,
397
+ o = t.colorModel,
398
+ a = t.color,
399
+ l = void 0 === a ? o.defaultColor : a,
400
+ i = t.onChange,
401
+ s = c(t, ["className", "colorModel", "color", "onChange"]),
402
+ f = useRef(null);
403
+ V(f);
404
+ var v = T(o, l, i),
405
+ d = v[0],
406
+ h = v[1],
407
+ m = g(["react-colorful", n]);
408
+ return React__default.createElement("div", u({}, s, {
409
+ ref: f,
410
+ className: m
411
+ }), React__default.createElement(L, {
412
+ hsva: d,
413
+ onChange: h
414
+ }), React__default.createElement(K, {
415
+ hue: d.h,
416
+ onChange: h,
417
+ className: "react-colorful__last-control"
418
+ }));
419
+ },
420
+ G = {
421
+ defaultColor: "000",
422
+ toHsva: function (e) {
423
+ return B(x(e));
424
+ },
425
+ fromHsva: function (e) {
426
+ return t = (r = q(e)).g, n = r.b, "#" + z(r.r) + z(t) + z(n);
427
+ var r, t, n;
428
+ },
429
+ equal: function (e, r) {
430
+ return e.toLowerCase() === r.toLowerCase() || A(x(e), x(r));
431
+ }
432
+ },
433
+ J = function (r) {
434
+ return React__default.createElement($, u({}, r, {
435
+ colorModel: G
436
+ }));
437
+ },
438
+ Q = function (r) {
439
+ var t = r.className,
440
+ n = r.hsva,
441
+ o = r.onChange,
442
+ a = {
443
+ backgroundImage: "linear-gradient(90deg, " + y(Object.assign({}, n, {
444
+ a: 0
445
+ })) + ", " + y(Object.assign({}, n, {
446
+ a: 1
447
+ })) + ")"
448
+ },
449
+ l = g(["react-colorful__alpha", t]);
450
+ return React__default.createElement("div", {
451
+ className: l
452
+ }, React__default.createElement("div", {
453
+ className: "react-colorful__alpha-gradient",
454
+ style: a
455
+ }), React__default.createElement(m, {
456
+ onMove: function (e) {
457
+ o({
458
+ a: e.left
459
+ });
460
+ },
461
+ onKey: function (e) {
462
+ o({
463
+ a: s(n.a + e.left)
464
+ });
465
+ },
466
+ "aria-label": "Alpha",
467
+ "aria-valuetext": b(100 * n.a) + "%"
468
+ }, React__default.createElement(p, {
469
+ className: "react-colorful__alpha-pointer",
470
+ left: n.a,
471
+ color: y(n)
472
+ })));
473
+ },
474
+ U = function (t) {
475
+ var n = t.className,
476
+ o = t.colorModel,
477
+ a = t.color,
478
+ l = void 0 === a ? o.defaultColor : a,
479
+ i = t.onChange,
480
+ s = c(t, ["className", "colorModel", "color", "onChange"]),
481
+ f = useRef(null);
482
+ V(f);
483
+ var v = T(o, l, i),
484
+ d = v[0],
485
+ h = v[1],
486
+ m = g(["react-colorful", n]);
487
+ return React__default.createElement("div", u({}, s, {
488
+ ref: f,
489
+ className: m
490
+ }), React__default.createElement(L, {
491
+ hsva: d,
492
+ onChange: h
493
+ }), React__default.createElement(K, {
494
+ hue: d.h,
495
+ onChange: h
496
+ }), React__default.createElement(Q, {
497
+ hsva: d,
498
+ onChange: h,
499
+ className: "react-colorful__last-control"
500
+ }));
501
+ },
502
+ ee = {
503
+ defaultColor: "hsla(0, 0%, 0%, 1)",
504
+ toHsva: E,
505
+ fromHsva: y,
506
+ equal: S
507
+ },
508
+ re = function (r) {
509
+ return React__default.createElement(U, u({}, r, {
510
+ colorModel: ee
511
+ }));
512
+ },
513
+ ge = {
514
+ defaultColor: "rgba(0, 0, 0, 1)",
515
+ toHsva: I,
516
+ fromHsva: function (e) {
517
+ var r = q(e);
518
+ return "rgba(" + r.r + ", " + r.g + ", " + r.b + ", " + r.a + ")";
519
+ },
520
+ equal: S
521
+ },
522
+ pe = function (r) {
523
+ return React__default.createElement(U, u({}, r, {
524
+ colorModel: ge
525
+ }));
526
+ };
527
+
528
+ var colorName = {
529
+ "aliceblue": [240, 248, 255],
530
+ "antiquewhite": [250, 235, 215],
531
+ "aqua": [0, 255, 255],
532
+ "aquamarine": [127, 255, 212],
533
+ "azure": [240, 255, 255],
534
+ "beige": [245, 245, 220],
535
+ "bisque": [255, 228, 196],
536
+ "black": [0, 0, 0],
537
+ "blanchedalmond": [255, 235, 205],
538
+ "blue": [0, 0, 255],
539
+ "blueviolet": [138, 43, 226],
540
+ "brown": [165, 42, 42],
541
+ "burlywood": [222, 184, 135],
542
+ "cadetblue": [95, 158, 160],
543
+ "chartreuse": [127, 255, 0],
544
+ "chocolate": [210, 105, 30],
545
+ "coral": [255, 127, 80],
546
+ "cornflowerblue": [100, 149, 237],
547
+ "cornsilk": [255, 248, 220],
548
+ "crimson": [220, 20, 60],
549
+ "cyan": [0, 255, 255],
550
+ "darkblue": [0, 0, 139],
551
+ "darkcyan": [0, 139, 139],
552
+ "darkgoldenrod": [184, 134, 11],
553
+ "darkgray": [169, 169, 169],
554
+ "darkgreen": [0, 100, 0],
555
+ "darkgrey": [169, 169, 169],
556
+ "darkkhaki": [189, 183, 107],
557
+ "darkmagenta": [139, 0, 139],
558
+ "darkolivegreen": [85, 107, 47],
559
+ "darkorange": [255, 140, 0],
560
+ "darkorchid": [153, 50, 204],
561
+ "darkred": [139, 0, 0],
562
+ "darksalmon": [233, 150, 122],
563
+ "darkseagreen": [143, 188, 143],
564
+ "darkslateblue": [72, 61, 139],
565
+ "darkslategray": [47, 79, 79],
566
+ "darkslategrey": [47, 79, 79],
567
+ "darkturquoise": [0, 206, 209],
568
+ "darkviolet": [148, 0, 211],
569
+ "deeppink": [255, 20, 147],
570
+ "deepskyblue": [0, 191, 255],
571
+ "dimgray": [105, 105, 105],
572
+ "dimgrey": [105, 105, 105],
573
+ "dodgerblue": [30, 144, 255],
574
+ "firebrick": [178, 34, 34],
575
+ "floralwhite": [255, 250, 240],
576
+ "forestgreen": [34, 139, 34],
577
+ "fuchsia": [255, 0, 255],
578
+ "gainsboro": [220, 220, 220],
579
+ "ghostwhite": [248, 248, 255],
580
+ "gold": [255, 215, 0],
581
+ "goldenrod": [218, 165, 32],
582
+ "gray": [128, 128, 128],
583
+ "green": [0, 128, 0],
584
+ "greenyellow": [173, 255, 47],
585
+ "grey": [128, 128, 128],
586
+ "honeydew": [240, 255, 240],
587
+ "hotpink": [255, 105, 180],
588
+ "indianred": [205, 92, 92],
589
+ "indigo": [75, 0, 130],
590
+ "ivory": [255, 255, 240],
591
+ "khaki": [240, 230, 140],
592
+ "lavender": [230, 230, 250],
593
+ "lavenderblush": [255, 240, 245],
594
+ "lawngreen": [124, 252, 0],
595
+ "lemonchiffon": [255, 250, 205],
596
+ "lightblue": [173, 216, 230],
597
+ "lightcoral": [240, 128, 128],
598
+ "lightcyan": [224, 255, 255],
599
+ "lightgoldenrodyellow": [250, 250, 210],
600
+ "lightgray": [211, 211, 211],
601
+ "lightgreen": [144, 238, 144],
602
+ "lightgrey": [211, 211, 211],
603
+ "lightpink": [255, 182, 193],
604
+ "lightsalmon": [255, 160, 122],
605
+ "lightseagreen": [32, 178, 170],
606
+ "lightskyblue": [135, 206, 250],
607
+ "lightslategray": [119, 136, 153],
608
+ "lightslategrey": [119, 136, 153],
609
+ "lightsteelblue": [176, 196, 222],
610
+ "lightyellow": [255, 255, 224],
611
+ "lime": [0, 255, 0],
612
+ "limegreen": [50, 205, 50],
613
+ "linen": [250, 240, 230],
614
+ "magenta": [255, 0, 255],
615
+ "maroon": [128, 0, 0],
616
+ "mediumaquamarine": [102, 205, 170],
617
+ "mediumblue": [0, 0, 205],
618
+ "mediumorchid": [186, 85, 211],
619
+ "mediumpurple": [147, 112, 219],
620
+ "mediumseagreen": [60, 179, 113],
621
+ "mediumslateblue": [123, 104, 238],
622
+ "mediumspringgreen": [0, 250, 154],
623
+ "mediumturquoise": [72, 209, 204],
624
+ "mediumvioletred": [199, 21, 133],
625
+ "midnightblue": [25, 25, 112],
626
+ "mintcream": [245, 255, 250],
627
+ "mistyrose": [255, 228, 225],
628
+ "moccasin": [255, 228, 181],
629
+ "navajowhite": [255, 222, 173],
630
+ "navy": [0, 0, 128],
631
+ "oldlace": [253, 245, 230],
632
+ "olive": [128, 128, 0],
633
+ "olivedrab": [107, 142, 35],
634
+ "orange": [255, 165, 0],
635
+ "orangered": [255, 69, 0],
636
+ "orchid": [218, 112, 214],
637
+ "palegoldenrod": [238, 232, 170],
638
+ "palegreen": [152, 251, 152],
639
+ "paleturquoise": [175, 238, 238],
640
+ "palevioletred": [219, 112, 147],
641
+ "papayawhip": [255, 239, 213],
642
+ "peachpuff": [255, 218, 185],
643
+ "peru": [205, 133, 63],
644
+ "pink": [255, 192, 203],
645
+ "plum": [221, 160, 221],
646
+ "powderblue": [176, 224, 230],
647
+ "purple": [128, 0, 128],
648
+ "rebeccapurple": [102, 51, 153],
649
+ "red": [255, 0, 0],
650
+ "rosybrown": [188, 143, 143],
651
+ "royalblue": [65, 105, 225],
652
+ "saddlebrown": [139, 69, 19],
653
+ "salmon": [250, 128, 114],
654
+ "sandybrown": [244, 164, 96],
655
+ "seagreen": [46, 139, 87],
656
+ "seashell": [255, 245, 238],
657
+ "sienna": [160, 82, 45],
658
+ "silver": [192, 192, 192],
659
+ "skyblue": [135, 206, 235],
660
+ "slateblue": [106, 90, 205],
661
+ "slategray": [112, 128, 144],
662
+ "slategrey": [112, 128, 144],
663
+ "snow": [255, 250, 250],
664
+ "springgreen": [0, 255, 127],
665
+ "steelblue": [70, 130, 180],
666
+ "tan": [210, 180, 140],
667
+ "teal": [0, 128, 128],
668
+ "thistle": [216, 191, 216],
669
+ "tomato": [255, 99, 71],
670
+ "turquoise": [64, 224, 208],
671
+ "violet": [238, 130, 238],
672
+ "wheat": [245, 222, 179],
673
+ "white": [255, 255, 255],
674
+ "whitesmoke": [245, 245, 245],
675
+ "yellow": [255, 255, 0],
676
+ "yellowgreen": [154, 205, 50]
677
+ };
678
+ /* MIT license */
679
+
680
+ /* eslint-disable no-mixed-operators */
681
+
682
+ const cssKeywords = colorName; // NOTE: conversions should only return primitive values (i.e. arrays, or
683
+ // values that give correct `typeof` results).
684
+ // do not use box values types (i.e. Number(), String(), etc.)
685
+
686
+ const reverseKeywords = {};
687
+
688
+ for (const key of Object.keys(cssKeywords)) {
689
+ reverseKeywords[cssKeywords[key]] = key;
690
+ }
691
+
692
+ const convert$1 = {
693
+ rgb: {
694
+ channels: 3,
695
+ labels: 'rgb'
696
+ },
697
+ hsl: {
698
+ channels: 3,
699
+ labels: 'hsl'
700
+ },
701
+ hsv: {
702
+ channels: 3,
703
+ labels: 'hsv'
704
+ },
705
+ hwb: {
706
+ channels: 3,
707
+ labels: 'hwb'
708
+ },
709
+ cmyk: {
710
+ channels: 4,
711
+ labels: 'cmyk'
712
+ },
713
+ xyz: {
714
+ channels: 3,
715
+ labels: 'xyz'
716
+ },
717
+ lab: {
718
+ channels: 3,
719
+ labels: 'lab'
720
+ },
721
+ lch: {
722
+ channels: 3,
723
+ labels: 'lch'
724
+ },
725
+ hex: {
726
+ channels: 1,
727
+ labels: ['hex']
728
+ },
729
+ keyword: {
730
+ channels: 1,
731
+ labels: ['keyword']
732
+ },
733
+ ansi16: {
734
+ channels: 1,
735
+ labels: ['ansi16']
736
+ },
737
+ ansi256: {
738
+ channels: 1,
739
+ labels: ['ansi256']
740
+ },
741
+ hcg: {
742
+ channels: 3,
743
+ labels: ['h', 'c', 'g']
744
+ },
745
+ apple: {
746
+ channels: 3,
747
+ labels: ['r16', 'g16', 'b16']
748
+ },
749
+ gray: {
750
+ channels: 1,
751
+ labels: ['gray']
752
+ }
753
+ };
754
+ var conversions$2 = convert$1; // Hide .channels and .labels properties
755
+
756
+ for (const model of Object.keys(convert$1)) {
757
+ if (!('channels' in convert$1[model])) {
758
+ throw new Error('missing channels property: ' + model);
759
+ }
760
+
761
+ if (!('labels' in convert$1[model])) {
762
+ throw new Error('missing channel labels property: ' + model);
763
+ }
764
+
765
+ if (convert$1[model].labels.length !== convert$1[model].channels) {
766
+ throw new Error('channel and label counts mismatch: ' + model);
767
+ }
768
+
769
+ const {
770
+ channels,
771
+ labels
772
+ } = convert$1[model];
773
+ delete convert$1[model].channels;
774
+ delete convert$1[model].labels;
775
+ Object.defineProperty(convert$1[model], 'channels', {
776
+ value: channels
777
+ });
778
+ Object.defineProperty(convert$1[model], 'labels', {
779
+ value: labels
780
+ });
781
+ }
782
+
783
+ convert$1.rgb.hsl = function (rgb) {
784
+ const r = rgb[0] / 255;
785
+ const g = rgb[1] / 255;
786
+ const b = rgb[2] / 255;
787
+ const min = Math.min(r, g, b);
788
+ const max = Math.max(r, g, b);
789
+ const delta = max - min;
790
+ let h;
791
+ let s;
792
+
793
+ if (max === min) {
794
+ h = 0;
795
+ } else if (r === max) {
796
+ h = (g - b) / delta;
797
+ } else if (g === max) {
798
+ h = 2 + (b - r) / delta;
799
+ } else if (b === max) {
800
+ h = 4 + (r - g) / delta;
801
+ }
802
+
803
+ h = Math.min(h * 60, 360);
804
+
805
+ if (h < 0) {
806
+ h += 360;
807
+ }
808
+
809
+ const l = (min + max) / 2;
810
+
811
+ if (max === min) {
812
+ s = 0;
813
+ } else if (l <= 0.5) {
814
+ s = delta / (max + min);
815
+ } else {
816
+ s = delta / (2 - max - min);
817
+ }
818
+
819
+ return [h, s * 100, l * 100];
820
+ };
821
+
822
+ convert$1.rgb.hsv = function (rgb) {
823
+ let rdif;
824
+ let gdif;
825
+ let bdif;
826
+ let h;
827
+ let s;
828
+ const r = rgb[0] / 255;
829
+ const g = rgb[1] / 255;
830
+ const b = rgb[2] / 255;
831
+ const v = Math.max(r, g, b);
832
+ const diff = v - Math.min(r, g, b);
833
+
834
+ const diffc = function (c) {
835
+ return (v - c) / 6 / diff + 1 / 2;
836
+ };
837
+
838
+ if (diff === 0) {
839
+ h = 0;
840
+ s = 0;
841
+ } else {
842
+ s = diff / v;
843
+ rdif = diffc(r);
844
+ gdif = diffc(g);
845
+ bdif = diffc(b);
846
+
847
+ if (r === v) {
848
+ h = bdif - gdif;
849
+ } else if (g === v) {
850
+ h = 1 / 3 + rdif - bdif;
851
+ } else if (b === v) {
852
+ h = 2 / 3 + gdif - rdif;
853
+ }
854
+
855
+ if (h < 0) {
856
+ h += 1;
857
+ } else if (h > 1) {
858
+ h -= 1;
859
+ }
860
+ }
861
+
862
+ return [h * 360, s * 100, v * 100];
863
+ };
864
+
865
+ convert$1.rgb.hwb = function (rgb) {
866
+ const r = rgb[0];
867
+ const g = rgb[1];
868
+ let b = rgb[2];
869
+ const h = convert$1.rgb.hsl(rgb)[0];
870
+ const w = 1 / 255 * Math.min(r, Math.min(g, b));
871
+ b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
872
+ return [h, w * 100, b * 100];
873
+ };
874
+
875
+ convert$1.rgb.cmyk = function (rgb) {
876
+ const r = rgb[0] / 255;
877
+ const g = rgb[1] / 255;
878
+ const b = rgb[2] / 255;
879
+ const k = Math.min(1 - r, 1 - g, 1 - b);
880
+ const c = (1 - r - k) / (1 - k) || 0;
881
+ const m = (1 - g - k) / (1 - k) || 0;
882
+ const y = (1 - b - k) / (1 - k) || 0;
883
+ return [c * 100, m * 100, y * 100, k * 100];
884
+ };
885
+
886
+ function comparativeDistance(x, y) {
887
+ /*
888
+ See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
889
+ */
890
+ return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
891
+ }
892
+
893
+ convert$1.rgb.keyword = function (rgb) {
894
+ const reversed = reverseKeywords[rgb];
895
+
896
+ if (reversed) {
897
+ return reversed;
898
+ }
899
+
900
+ let currentClosestDistance = Infinity;
901
+ let currentClosestKeyword;
902
+
903
+ for (const keyword of Object.keys(cssKeywords)) {
904
+ const value = cssKeywords[keyword]; // Compute comparative distance
905
+
906
+ const distance = comparativeDistance(rgb, value); // Check if its less, if so set as closest
907
+
908
+ if (distance < currentClosestDistance) {
909
+ currentClosestDistance = distance;
910
+ currentClosestKeyword = keyword;
911
+ }
912
+ }
913
+
914
+ return currentClosestKeyword;
915
+ };
916
+
917
+ convert$1.keyword.rgb = function (keyword) {
918
+ return cssKeywords[keyword];
919
+ };
920
+
921
+ convert$1.rgb.xyz = function (rgb) {
922
+ let r = rgb[0] / 255;
923
+ let g = rgb[1] / 255;
924
+ let b = rgb[2] / 255; // Assume sRGB
925
+
926
+ r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
927
+ g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
928
+ b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
929
+ const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
930
+ const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
931
+ const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
932
+ return [x * 100, y * 100, z * 100];
933
+ };
934
+
935
+ convert$1.rgb.lab = function (rgb) {
936
+ const xyz = convert$1.rgb.xyz(rgb);
937
+ let x = xyz[0];
938
+ let y = xyz[1];
939
+ let z = xyz[2];
940
+ x /= 95.047;
941
+ y /= 100;
942
+ z /= 108.883;
943
+ x = x > 0.008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
944
+ y = y > 0.008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
945
+ z = z > 0.008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
946
+ const l = 116 * y - 16;
947
+ const a = 500 * (x - y);
948
+ const b = 200 * (y - z);
949
+ return [l, a, b];
950
+ };
951
+
952
+ convert$1.hsl.rgb = function (hsl) {
953
+ const h = hsl[0] / 360;
954
+ const s = hsl[1] / 100;
955
+ const l = hsl[2] / 100;
956
+ let t2;
957
+ let t3;
958
+ let val;
959
+
960
+ if (s === 0) {
961
+ val = l * 255;
962
+ return [val, val, val];
963
+ }
964
+
965
+ if (l < 0.5) {
966
+ t2 = l * (1 + s);
967
+ } else {
968
+ t2 = l + s - l * s;
969
+ }
970
+
971
+ const t1 = 2 * l - t2;
972
+ const rgb = [0, 0, 0];
973
+
974
+ for (let i = 0; i < 3; i++) {
975
+ t3 = h + 1 / 3 * -(i - 1);
976
+
977
+ if (t3 < 0) {
978
+ t3++;
979
+ }
980
+
981
+ if (t3 > 1) {
982
+ t3--;
983
+ }
984
+
985
+ if (6 * t3 < 1) {
986
+ val = t1 + (t2 - t1) * 6 * t3;
987
+ } else if (2 * t3 < 1) {
988
+ val = t2;
989
+ } else if (3 * t3 < 2) {
990
+ val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
991
+ } else {
992
+ val = t1;
993
+ }
994
+
995
+ rgb[i] = val * 255;
996
+ }
997
+
998
+ return rgb;
999
+ };
1000
+
1001
+ convert$1.hsl.hsv = function (hsl) {
1002
+ const h = hsl[0];
1003
+ let s = hsl[1] / 100;
1004
+ let l = hsl[2] / 100;
1005
+ let smin = s;
1006
+ const lmin = Math.max(l, 0.01);
1007
+ l *= 2;
1008
+ s *= l <= 1 ? l : 2 - l;
1009
+ smin *= lmin <= 1 ? lmin : 2 - lmin;
1010
+ const v = (l + s) / 2;
1011
+ const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
1012
+ return [h, sv * 100, v * 100];
1013
+ };
1014
+
1015
+ convert$1.hsv.rgb = function (hsv) {
1016
+ const h = hsv[0] / 60;
1017
+ const s = hsv[1] / 100;
1018
+ let v = hsv[2] / 100;
1019
+ const hi = Math.floor(h) % 6;
1020
+ const f = h - Math.floor(h);
1021
+ const p = 255 * v * (1 - s);
1022
+ const q = 255 * v * (1 - s * f);
1023
+ const t = 255 * v * (1 - s * (1 - f));
1024
+ v *= 255;
1025
+
1026
+ switch (hi) {
1027
+ case 0:
1028
+ return [v, t, p];
1029
+
1030
+ case 1:
1031
+ return [q, v, p];
1032
+
1033
+ case 2:
1034
+ return [p, v, t];
1035
+
1036
+ case 3:
1037
+ return [p, q, v];
1038
+
1039
+ case 4:
1040
+ return [t, p, v];
1041
+
1042
+ case 5:
1043
+ return [v, p, q];
1044
+ }
1045
+ };
1046
+
1047
+ convert$1.hsv.hsl = function (hsv) {
1048
+ const h = hsv[0];
1049
+ const s = hsv[1] / 100;
1050
+ const v = hsv[2] / 100;
1051
+ const vmin = Math.max(v, 0.01);
1052
+ let sl;
1053
+ let l;
1054
+ l = (2 - s) * v;
1055
+ const lmin = (2 - s) * vmin;
1056
+ sl = s * vmin;
1057
+ sl /= lmin <= 1 ? lmin : 2 - lmin;
1058
+ sl = sl || 0;
1059
+ l /= 2;
1060
+ return [h, sl * 100, l * 100];
1061
+ }; // http://dev.w3.org/csswg/css-color/#hwb-to-rgb
1062
+
1063
+
1064
+ convert$1.hwb.rgb = function (hwb) {
1065
+ const h = hwb[0] / 360;
1066
+ let wh = hwb[1] / 100;
1067
+ let bl = hwb[2] / 100;
1068
+ const ratio = wh + bl;
1069
+ let f; // Wh + bl cant be > 1
1070
+
1071
+ if (ratio > 1) {
1072
+ wh /= ratio;
1073
+ bl /= ratio;
1074
+ }
1075
+
1076
+ const i = Math.floor(6 * h);
1077
+ const v = 1 - bl;
1078
+ f = 6 * h - i;
1079
+
1080
+ if ((i & 0x01) !== 0) {
1081
+ f = 1 - f;
1082
+ }
1083
+
1084
+ const n = wh + f * (v - wh); // Linear interpolation
1085
+
1086
+ let r;
1087
+ let g;
1088
+ let b;
1089
+ /* eslint-disable max-statements-per-line,no-multi-spaces */
1090
+
1091
+ switch (i) {
1092
+ default:
1093
+ case 6:
1094
+ case 0:
1095
+ r = v;
1096
+ g = n;
1097
+ b = wh;
1098
+ break;
1099
+
1100
+ case 1:
1101
+ r = n;
1102
+ g = v;
1103
+ b = wh;
1104
+ break;
1105
+
1106
+ case 2:
1107
+ r = wh;
1108
+ g = v;
1109
+ b = n;
1110
+ break;
1111
+
1112
+ case 3:
1113
+ r = wh;
1114
+ g = n;
1115
+ b = v;
1116
+ break;
1117
+
1118
+ case 4:
1119
+ r = n;
1120
+ g = wh;
1121
+ b = v;
1122
+ break;
1123
+
1124
+ case 5:
1125
+ r = v;
1126
+ g = wh;
1127
+ b = n;
1128
+ break;
1129
+ }
1130
+ /* eslint-enable max-statements-per-line,no-multi-spaces */
1131
+
1132
+
1133
+ return [r * 255, g * 255, b * 255];
1134
+ };
1135
+
1136
+ convert$1.cmyk.rgb = function (cmyk) {
1137
+ const c = cmyk[0] / 100;
1138
+ const m = cmyk[1] / 100;
1139
+ const y = cmyk[2] / 100;
1140
+ const k = cmyk[3] / 100;
1141
+ const r = 1 - Math.min(1, c * (1 - k) + k);
1142
+ const g = 1 - Math.min(1, m * (1 - k) + k);
1143
+ const b = 1 - Math.min(1, y * (1 - k) + k);
1144
+ return [r * 255, g * 255, b * 255];
1145
+ };
1146
+
1147
+ convert$1.xyz.rgb = function (xyz) {
1148
+ const x = xyz[0] / 100;
1149
+ const y = xyz[1] / 100;
1150
+ const z = xyz[2] / 100;
1151
+ let r;
1152
+ let g;
1153
+ let b;
1154
+ r = x * 3.2406 + y * -1.5372 + z * -0.4986;
1155
+ g = x * -0.9689 + y * 1.8758 + z * 0.0415;
1156
+ b = x * 0.0557 + y * -0.2040 + z * 1.0570; // Assume sRGB
1157
+
1158
+ r = r > 0.0031308 ? 1.055 * r ** (1.0 / 2.4) - 0.055 : r * 12.92;
1159
+ g = g > 0.0031308 ? 1.055 * g ** (1.0 / 2.4) - 0.055 : g * 12.92;
1160
+ b = b > 0.0031308 ? 1.055 * b ** (1.0 / 2.4) - 0.055 : b * 12.92;
1161
+ r = Math.min(Math.max(0, r), 1);
1162
+ g = Math.min(Math.max(0, g), 1);
1163
+ b = Math.min(Math.max(0, b), 1);
1164
+ return [r * 255, g * 255, b * 255];
1165
+ };
1166
+
1167
+ convert$1.xyz.lab = function (xyz) {
1168
+ let x = xyz[0];
1169
+ let y = xyz[1];
1170
+ let z = xyz[2];
1171
+ x /= 95.047;
1172
+ y /= 100;
1173
+ z /= 108.883;
1174
+ x = x > 0.008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
1175
+ y = y > 0.008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
1176
+ z = z > 0.008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
1177
+ const l = 116 * y - 16;
1178
+ const a = 500 * (x - y);
1179
+ const b = 200 * (y - z);
1180
+ return [l, a, b];
1181
+ };
1182
+
1183
+ convert$1.lab.xyz = function (lab) {
1184
+ const l = lab[0];
1185
+ const a = lab[1];
1186
+ const b = lab[2];
1187
+ let x;
1188
+ let y;
1189
+ let z;
1190
+ y = (l + 16) / 116;
1191
+ x = a / 500 + y;
1192
+ z = y - b / 200;
1193
+ const y2 = y ** 3;
1194
+ const x2 = x ** 3;
1195
+ const z2 = z ** 3;
1196
+ y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
1197
+ x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
1198
+ z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
1199
+ x *= 95.047;
1200
+ y *= 100;
1201
+ z *= 108.883;
1202
+ return [x, y, z];
1203
+ };
1204
+
1205
+ convert$1.lab.lch = function (lab) {
1206
+ const l = lab[0];
1207
+ const a = lab[1];
1208
+ const b = lab[2];
1209
+ let h;
1210
+ const hr = Math.atan2(b, a);
1211
+ h = hr * 360 / 2 / Math.PI;
1212
+
1213
+ if (h < 0) {
1214
+ h += 360;
1215
+ }
1216
+
1217
+ const c = Math.sqrt(a * a + b * b);
1218
+ return [l, c, h];
1219
+ };
1220
+
1221
+ convert$1.lch.lab = function (lch) {
1222
+ const l = lch[0];
1223
+ const c = lch[1];
1224
+ const h = lch[2];
1225
+ const hr = h / 360 * 2 * Math.PI;
1226
+ const a = c * Math.cos(hr);
1227
+ const b = c * Math.sin(hr);
1228
+ return [l, a, b];
1229
+ };
1230
+
1231
+ convert$1.rgb.ansi16 = function (args, saturation = null) {
1232
+ const [r, g, b] = args;
1233
+ let value = saturation === null ? convert$1.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization
1234
+
1235
+ value = Math.round(value / 50);
1236
+
1237
+ if (value === 0) {
1238
+ return 30;
1239
+ }
1240
+
1241
+ let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
1242
+
1243
+ if (value === 2) {
1244
+ ansi += 60;
1245
+ }
1246
+
1247
+ return ansi;
1248
+ };
1249
+
1250
+ convert$1.hsv.ansi16 = function (args) {
1251
+ // Optimization here; we already know the value and don't need to get
1252
+ // it converted for us.
1253
+ return convert$1.rgb.ansi16(convert$1.hsv.rgb(args), args[2]);
1254
+ };
1255
+
1256
+ convert$1.rgb.ansi256 = function (args) {
1257
+ const r = args[0];
1258
+ const g = args[1];
1259
+ const b = args[2]; // We use the extended greyscale palette here, with the exception of
1260
+ // black and white. normal palette only has 4 greyscale shades.
1261
+
1262
+ if (r === g && g === b) {
1263
+ if (r < 8) {
1264
+ return 16;
1265
+ }
1266
+
1267
+ if (r > 248) {
1268
+ return 231;
1269
+ }
1270
+
1271
+ return Math.round((r - 8) / 247 * 24) + 232;
1272
+ }
1273
+
1274
+ const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
1275
+ return ansi;
1276
+ };
1277
+
1278
+ convert$1.ansi16.rgb = function (args) {
1279
+ let color = args % 10; // Handle greyscale
1280
+
1281
+ if (color === 0 || color === 7) {
1282
+ if (args > 50) {
1283
+ color += 3.5;
1284
+ }
1285
+
1286
+ color = color / 10.5 * 255;
1287
+ return [color, color, color];
1288
+ }
1289
+
1290
+ const mult = (~~(args > 50) + 1) * 0.5;
1291
+ const r = (color & 1) * mult * 255;
1292
+ const g = (color >> 1 & 1) * mult * 255;
1293
+ const b = (color >> 2 & 1) * mult * 255;
1294
+ return [r, g, b];
1295
+ };
1296
+
1297
+ convert$1.ansi256.rgb = function (args) {
1298
+ // Handle greyscale
1299
+ if (args >= 232) {
1300
+ const c = (args - 232) * 10 + 8;
1301
+ return [c, c, c];
1302
+ }
1303
+
1304
+ args -= 16;
1305
+ let rem;
1306
+ const r = Math.floor(args / 36) / 5 * 255;
1307
+ const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
1308
+ const b = rem % 6 / 5 * 255;
1309
+ return [r, g, b];
1310
+ };
1311
+
1312
+ convert$1.rgb.hex = function (args) {
1313
+ const integer = ((Math.round(args[0]) & 0xFF) << 16) + ((Math.round(args[1]) & 0xFF) << 8) + (Math.round(args[2]) & 0xFF);
1314
+ const string = integer.toString(16).toUpperCase();
1315
+ return '000000'.substring(string.length) + string;
1316
+ };
1317
+
1318
+ convert$1.hex.rgb = function (args) {
1319
+ const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
1320
+
1321
+ if (!match) {
1322
+ return [0, 0, 0];
1323
+ }
1324
+
1325
+ let colorString = match[0];
1326
+
1327
+ if (match[0].length === 3) {
1328
+ colorString = colorString.split('').map(char => {
1329
+ return char + char;
1330
+ }).join('');
1331
+ }
1332
+
1333
+ const integer = parseInt(colorString, 16);
1334
+ const r = integer >> 16 & 0xFF;
1335
+ const g = integer >> 8 & 0xFF;
1336
+ const b = integer & 0xFF;
1337
+ return [r, g, b];
1338
+ };
1339
+
1340
+ convert$1.rgb.hcg = function (rgb) {
1341
+ const r = rgb[0] / 255;
1342
+ const g = rgb[1] / 255;
1343
+ const b = rgb[2] / 255;
1344
+ const max = Math.max(Math.max(r, g), b);
1345
+ const min = Math.min(Math.min(r, g), b);
1346
+ const chroma = max - min;
1347
+ let grayscale;
1348
+ let hue;
1349
+
1350
+ if (chroma < 1) {
1351
+ grayscale = min / (1 - chroma);
1352
+ } else {
1353
+ grayscale = 0;
1354
+ }
1355
+
1356
+ if (chroma <= 0) {
1357
+ hue = 0;
1358
+ } else if (max === r) {
1359
+ hue = (g - b) / chroma % 6;
1360
+ } else if (max === g) {
1361
+ hue = 2 + (b - r) / chroma;
1362
+ } else {
1363
+ hue = 4 + (r - g) / chroma;
1364
+ }
1365
+
1366
+ hue /= 6;
1367
+ hue %= 1;
1368
+ return [hue * 360, chroma * 100, grayscale * 100];
1369
+ };
1370
+
1371
+ convert$1.hsl.hcg = function (hsl) {
1372
+ const s = hsl[1] / 100;
1373
+ const l = hsl[2] / 100;
1374
+ const c = l < 0.5 ? 2.0 * s * l : 2.0 * s * (1.0 - l);
1375
+ let f = 0;
1376
+
1377
+ if (c < 1.0) {
1378
+ f = (l - 0.5 * c) / (1.0 - c);
1379
+ }
1380
+
1381
+ return [hsl[0], c * 100, f * 100];
1382
+ };
1383
+
1384
+ convert$1.hsv.hcg = function (hsv) {
1385
+ const s = hsv[1] / 100;
1386
+ const v = hsv[2] / 100;
1387
+ const c = s * v;
1388
+ let f = 0;
1389
+
1390
+ if (c < 1.0) {
1391
+ f = (v - c) / (1 - c);
1392
+ }
1393
+
1394
+ return [hsv[0], c * 100, f * 100];
1395
+ };
1396
+
1397
+ convert$1.hcg.rgb = function (hcg) {
1398
+ const h = hcg[0] / 360;
1399
+ const c = hcg[1] / 100;
1400
+ const g = hcg[2] / 100;
1401
+
1402
+ if (c === 0.0) {
1403
+ return [g * 255, g * 255, g * 255];
1404
+ }
1405
+
1406
+ const pure = [0, 0, 0];
1407
+ const hi = h % 1 * 6;
1408
+ const v = hi % 1;
1409
+ const w = 1 - v;
1410
+ let mg = 0;
1411
+ /* eslint-disable max-statements-per-line */
1412
+
1413
+ switch (Math.floor(hi)) {
1414
+ case 0:
1415
+ pure[0] = 1;
1416
+ pure[1] = v;
1417
+ pure[2] = 0;
1418
+ break;
1419
+
1420
+ case 1:
1421
+ pure[0] = w;
1422
+ pure[1] = 1;
1423
+ pure[2] = 0;
1424
+ break;
1425
+
1426
+ case 2:
1427
+ pure[0] = 0;
1428
+ pure[1] = 1;
1429
+ pure[2] = v;
1430
+ break;
1431
+
1432
+ case 3:
1433
+ pure[0] = 0;
1434
+ pure[1] = w;
1435
+ pure[2] = 1;
1436
+ break;
1437
+
1438
+ case 4:
1439
+ pure[0] = v;
1440
+ pure[1] = 0;
1441
+ pure[2] = 1;
1442
+ break;
1443
+
1444
+ default:
1445
+ pure[0] = 1;
1446
+ pure[1] = 0;
1447
+ pure[2] = w;
1448
+ }
1449
+ /* eslint-enable max-statements-per-line */
1450
+
1451
+
1452
+ mg = (1.0 - c) * g;
1453
+ return [(c * pure[0] + mg) * 255, (c * pure[1] + mg) * 255, (c * pure[2] + mg) * 255];
1454
+ };
1455
+
1456
+ convert$1.hcg.hsv = function (hcg) {
1457
+ const c = hcg[1] / 100;
1458
+ const g = hcg[2] / 100;
1459
+ const v = c + g * (1.0 - c);
1460
+ let f = 0;
1461
+
1462
+ if (v > 0.0) {
1463
+ f = c / v;
1464
+ }
1465
+
1466
+ return [hcg[0], f * 100, v * 100];
1467
+ };
1468
+
1469
+ convert$1.hcg.hsl = function (hcg) {
1470
+ const c = hcg[1] / 100;
1471
+ const g = hcg[2] / 100;
1472
+ const l = g * (1.0 - c) + 0.5 * c;
1473
+ let s = 0;
1474
+
1475
+ if (l > 0.0 && l < 0.5) {
1476
+ s = c / (2 * l);
1477
+ } else if (l >= 0.5 && l < 1.0) {
1478
+ s = c / (2 * (1 - l));
1479
+ }
1480
+
1481
+ return [hcg[0], s * 100, l * 100];
1482
+ };
1483
+
1484
+ convert$1.hcg.hwb = function (hcg) {
1485
+ const c = hcg[1] / 100;
1486
+ const g = hcg[2] / 100;
1487
+ const v = c + g * (1.0 - c);
1488
+ return [hcg[0], (v - c) * 100, (1 - v) * 100];
1489
+ };
1490
+
1491
+ convert$1.hwb.hcg = function (hwb) {
1492
+ const w = hwb[1] / 100;
1493
+ const b = hwb[2] / 100;
1494
+ const v = 1 - b;
1495
+ const c = v - w;
1496
+ let g = 0;
1497
+
1498
+ if (c < 1) {
1499
+ g = (v - c) / (1 - c);
1500
+ }
1501
+
1502
+ return [hwb[0], c * 100, g * 100];
1503
+ };
1504
+
1505
+ convert$1.apple.rgb = function (apple) {
1506
+ return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
1507
+ };
1508
+
1509
+ convert$1.rgb.apple = function (rgb) {
1510
+ return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
1511
+ };
1512
+
1513
+ convert$1.gray.rgb = function (args) {
1514
+ return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
1515
+ };
1516
+
1517
+ convert$1.gray.hsl = function (args) {
1518
+ return [0, 0, args[0]];
1519
+ };
1520
+
1521
+ convert$1.gray.hsv = convert$1.gray.hsl;
1522
+
1523
+ convert$1.gray.hwb = function (gray) {
1524
+ return [0, 100, gray[0]];
1525
+ };
1526
+
1527
+ convert$1.gray.cmyk = function (gray) {
1528
+ return [0, 0, 0, gray[0]];
1529
+ };
1530
+
1531
+ convert$1.gray.lab = function (gray) {
1532
+ return [gray[0], 0, 0];
1533
+ };
1534
+
1535
+ convert$1.gray.hex = function (gray) {
1536
+ const val = Math.round(gray[0] / 100 * 255) & 0xFF;
1537
+ const integer = (val << 16) + (val << 8) + val;
1538
+ const string = integer.toString(16).toUpperCase();
1539
+ return '000000'.substring(string.length) + string;
1540
+ };
1541
+
1542
+ convert$1.rgb.gray = function (rgb) {
1543
+ const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
1544
+ return [val / 255 * 100];
1545
+ };
1546
+
1547
+ const conversions$1 = conversions$2;
1548
+ /*
1549
+ This function routes a model to all other models.
1550
+
1551
+ all functions that are routed have a property `.conversion` attached
1552
+ to the returned synthetic function. This property is an array
1553
+ of strings, each with the steps in between the 'from' and 'to'
1554
+ color models (inclusive).
1555
+
1556
+ conversions that are not possible simply are not included.
1557
+ */
1558
+
1559
+ function buildGraph() {
1560
+ const graph = {}; // https://jsperf.com/object-keys-vs-for-in-with-closure/3
1561
+
1562
+ const models = Object.keys(conversions$1);
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
1575
+
1576
+
1577
+ function deriveBFS(fromModel) {
1578
+ const graph = buildGraph();
1579
+ const queue = [fromModel]; // Unshift -> queue -> pop
1580
+
1581
+ graph[fromModel].distance = 0;
1582
+
1583
+ while (queue.length) {
1584
+ const current = queue.pop();
1585
+ const adjacents = Object.keys(conversions$1[current]);
1586
+
1587
+ for (let len = adjacents.length, i = 0; i < len; i++) {
1588
+ const adjacent = adjacents[i];
1589
+ const node = graph[adjacent];
1590
+
1591
+ if (node.distance === -1) {
1592
+ node.distance = graph[current].distance + 1;
1593
+ node.parent = current;
1594
+ queue.unshift(adjacent);
1595
+ }
1596
+ }
1597
+ }
1598
+
1599
+ return graph;
1600
+ }
1601
+
1602
+ function link(from, to) {
1603
+ return function (args) {
1604
+ return to(from(args));
1605
+ };
1606
+ }
1607
+
1608
+ function wrapConversion(toModel, graph) {
1609
+ const path = [graph[toModel].parent, toModel];
1610
+ let fn = conversions$1[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$1[graph[cur].parent][cur], fn);
1616
+ cur = graph[cur].parent;
1617
+ }
1618
+
1619
+ fn.conversion = path;
1620
+ return fn;
1621
+ }
1622
+
1623
+ var route$1 = function (fromModel) {
1624
+ const graph = deriveBFS(fromModel);
1625
+ const conversion = {};
1626
+ const models = Object.keys(graph);
1627
+
1628
+ for (let len = models.length, i = 0; i < len; i++) {
1629
+ const toModel = models[i];
1630
+ const node = graph[toModel];
1631
+
1632
+ if (node.parent === null) {
1633
+ // No possible conversion, or this node is the source model.
1634
+ continue;
1635
+ }
1636
+
1637
+ conversion[toModel] = wrapConversion(toModel, graph);
1638
+ }
1639
+
1640
+ return conversion;
1641
+ };
1642
+
1643
+ const conversions = conversions$2;
1644
+ const route = route$1;
1645
+ const convert = {};
1646
+ const models = Object.keys(conversions);
1647
+
1648
+ function wrapRaw(fn) {
1649
+ const wrappedFn = function (...args) {
1650
+ const arg0 = args[0];
1651
+
1652
+ if (arg0 === undefined || arg0 === null) {
1653
+ return arg0;
1654
+ }
1655
+
1656
+ if (arg0.length > 1) {
1657
+ args = arg0;
1658
+ }
1659
+
1660
+ return fn(args);
1661
+ }; // Preserve .conversion property if there is one
1662
+
1663
+
1664
+ if ('conversion' in fn) {
1665
+ wrappedFn.conversion = fn.conversion;
1666
+ }
1667
+
1668
+ return wrappedFn;
1669
+ }
1670
+
1671
+ function wrapRounded(fn) {
1672
+ const wrappedFn = function (...args) {
1673
+ const arg0 = args[0];
1674
+
1675
+ if (arg0 === undefined || arg0 === null) {
1676
+ return arg0;
1677
+ }
1678
+
1679
+ if (arg0.length > 1) {
1680
+ args = arg0;
1681
+ }
1682
+
1683
+ const result = fn(args); // We're assuming the result is an array here.
1684
+ // see notice in conversions.js; don't use box types
1685
+ // in conversion functions.
1686
+
1687
+ if (typeof result === 'object') {
1688
+ for (let len = result.length, i = 0; i < len; i++) {
1689
+ result[i] = Math.round(result[i]);
1690
+ }
1691
+ }
1692
+
1693
+ return result;
1694
+ }; // Preserve .conversion property if there is one
1695
+
1696
+
1697
+ if ('conversion' in fn) {
1698
+ wrappedFn.conversion = fn.conversion;
1699
+ }
1700
+
1701
+ return wrappedFn;
1702
+ }
1703
+
1704
+ models.forEach(fromModel => {
1705
+ convert[fromModel] = {};
1706
+ Object.defineProperty(convert[fromModel], 'channels', {
1707
+ value: conversions[fromModel].channels
1708
+ });
1709
+ Object.defineProperty(convert[fromModel], 'labels', {
1710
+ value: conversions[fromModel].labels
1711
+ });
1712
+ const routes = route(fromModel);
1713
+ const routeModels = Object.keys(routes);
1714
+ routeModels.forEach(toModel => {
1715
+ const fn = routes[toModel];
1716
+ convert[fromModel][toModel] = wrapRounded(fn);
1717
+ convert[fromModel][toModel].raw = wrapRaw(fn);
1718
+ });
1719
+ });
1720
+ var colorConvert = convert;
1721
+ var root = _root;
1722
+ /**
1723
+ * Gets the timestamp of the number of milliseconds that have elapsed since
1724
+ * the Unix epoch (1 January 1970 00:00:00 UTC).
1725
+ *
1726
+ * @static
1727
+ * @memberOf _
1728
+ * @since 2.4.0
1729
+ * @category Date
1730
+ * @returns {number} Returns the timestamp.
1731
+ * @example
1732
+ *
1733
+ * _.defer(function(stamp) {
1734
+ * console.log(_.now() - stamp);
1735
+ * }, _.now());
1736
+ * // => Logs the number of milliseconds it took for the deferred invocation.
1737
+ */
1738
+
1739
+ var now$1 = function () {
1740
+ return root.Date.now();
1741
+ };
1742
+
1743
+ var now_1 = now$1;
1744
+ /** Used to match a single whitespace character. */
1745
+
1746
+ var reWhitespace = /\s/;
1747
+ /**
1748
+ * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
1749
+ * character of `string`.
1750
+ *
1751
+ * @private
1752
+ * @param {string} string The string to inspect.
1753
+ * @returns {number} Returns the index of the last non-whitespace character.
1754
+ */
1755
+
1756
+ function trimmedEndIndex$1(string) {
1757
+ var index = string.length;
1758
+
1759
+ while (index-- && reWhitespace.test(string.charAt(index))) {}
1760
+
1761
+ return index;
1762
+ }
1763
+
1764
+ var _trimmedEndIndex = trimmedEndIndex$1;
1765
+ var trimmedEndIndex = _trimmedEndIndex;
1766
+ /** Used to match leading whitespace. */
1767
+
1768
+ var reTrimStart = /^\s+/;
1769
+ /**
1770
+ * The base implementation of `_.trim`.
1771
+ *
1772
+ * @private
1773
+ * @param {string} string The string to trim.
1774
+ * @returns {string} Returns the trimmed string.
1775
+ */
1776
+
1777
+ function baseTrim$1(string) {
1778
+ return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') : string;
1779
+ }
1780
+
1781
+ var _baseTrim = baseTrim$1;
1782
+ var baseTrim = _baseTrim,
1783
+ isObject$2 = isObject_1,
1784
+ isSymbol = isSymbol_1;
1785
+ /** Used as references for various `Number` constants. */
1786
+
1787
+ var NAN = 0 / 0;
1788
+ /** Used to detect bad signed hexadecimal string values. */
1789
+
1790
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
1791
+ /** Used to detect binary string values. */
1792
+
1793
+ var reIsBinary = /^0b[01]+$/i;
1794
+ /** Used to detect octal string values. */
1795
+
1796
+ var reIsOctal = /^0o[0-7]+$/i;
1797
+ /** Built-in method references without a dependency on `root`. */
1798
+
1799
+ var freeParseInt = parseInt;
1800
+ /**
1801
+ * Converts `value` to a number.
1802
+ *
1803
+ * @static
1804
+ * @memberOf _
1805
+ * @since 4.0.0
1806
+ * @category Lang
1807
+ * @param {*} value The value to process.
1808
+ * @returns {number} Returns the number.
1809
+ * @example
1810
+ *
1811
+ * _.toNumber(3.2);
1812
+ * // => 3.2
1813
+ *
1814
+ * _.toNumber(Number.MIN_VALUE);
1815
+ * // => 5e-324
1816
+ *
1817
+ * _.toNumber(Infinity);
1818
+ * // => Infinity
1819
+ *
1820
+ * _.toNumber('3.2');
1821
+ * // => 3.2
1822
+ */
1823
+
1824
+ function toNumber$1(value) {
1825
+ if (typeof value == 'number') {
1826
+ return value;
1827
+ }
1828
+
1829
+ if (isSymbol(value)) {
1830
+ return NAN;
1831
+ }
1832
+
1833
+ if (isObject$2(value)) {
1834
+ var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
1835
+ value = isObject$2(other) ? other + '' : other;
1836
+ }
1837
+
1838
+ if (typeof value != 'string') {
1839
+ return value === 0 ? value : +value;
1840
+ }
1841
+
1842
+ value = baseTrim(value);
1843
+ var isBinary = reIsBinary.test(value);
1844
+ return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
1845
+ }
1846
+
1847
+ var toNumber_1 = toNumber$1;
1848
+ var isObject$1 = isObject_1,
1849
+ now = now_1,
1850
+ toNumber = toNumber_1;
1851
+ /** Error message constants. */
1852
+
1853
+ var FUNC_ERROR_TEXT$1 = 'Expected a function';
1854
+ /* Built-in method references for those with the same name as other `lodash` methods. */
1855
+
1856
+ var nativeMax = Math.max,
1857
+ nativeMin = Math.min;
1858
+ /**
1859
+ * Creates a debounced function that delays invoking `func` until after `wait`
1860
+ * milliseconds have elapsed since the last time the debounced function was
1861
+ * invoked. The debounced function comes with a `cancel` method to cancel
1862
+ * delayed `func` invocations and a `flush` method to immediately invoke them.
1863
+ * Provide `options` to indicate whether `func` should be invoked on the
1864
+ * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
1865
+ * with the last arguments provided to the debounced function. Subsequent
1866
+ * calls to the debounced function return the result of the last `func`
1867
+ * invocation.
1868
+ *
1869
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is
1870
+ * invoked on the trailing edge of the timeout only if the debounced function
1871
+ * is invoked more than once during the `wait` timeout.
1872
+ *
1873
+ * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
1874
+ * until to the next tick, similar to `setTimeout` with a timeout of `0`.
1875
+ *
1876
+ * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
1877
+ * for details over the differences between `_.debounce` and `_.throttle`.
1878
+ *
1879
+ * @static
1880
+ * @memberOf _
1881
+ * @since 0.1.0
1882
+ * @category Function
1883
+ * @param {Function} func The function to debounce.
1884
+ * @param {number} [wait=0] The number of milliseconds to delay.
1885
+ * @param {Object} [options={}] The options object.
1886
+ * @param {boolean} [options.leading=false]
1887
+ * Specify invoking on the leading edge of the timeout.
1888
+ * @param {number} [options.maxWait]
1889
+ * The maximum time `func` is allowed to be delayed before it's invoked.
1890
+ * @param {boolean} [options.trailing=true]
1891
+ * Specify invoking on the trailing edge of the timeout.
1892
+ * @returns {Function} Returns the new debounced function.
1893
+ * @example
1894
+ *
1895
+ * // Avoid costly calculations while the window size is in flux.
1896
+ * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
1897
+ *
1898
+ * // Invoke `sendMail` when clicked, debouncing subsequent calls.
1899
+ * jQuery(element).on('click', _.debounce(sendMail, 300, {
1900
+ * 'leading': true,
1901
+ * 'trailing': false
1902
+ * }));
1903
+ *
1904
+ * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
1905
+ * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
1906
+ * var source = new EventSource('/stream');
1907
+ * jQuery(source).on('message', debounced);
1908
+ *
1909
+ * // Cancel the trailing debounced invocation.
1910
+ * jQuery(window).on('popstate', debounced.cancel);
1911
+ */
1912
+
1913
+ function debounce$1(func, wait, options) {
1914
+ var lastArgs,
1915
+ lastThis,
1916
+ maxWait,
1917
+ result,
1918
+ timerId,
1919
+ lastCallTime,
1920
+ lastInvokeTime = 0,
1921
+ leading = false,
1922
+ maxing = false,
1923
+ trailing = true;
1924
+
1925
+ if (typeof func != 'function') {
1926
+ throw new TypeError(FUNC_ERROR_TEXT$1);
1927
+ }
1928
+
1929
+ wait = toNumber(wait) || 0;
1930
+
1931
+ if (isObject$1(options)) {
1932
+ leading = !!options.leading;
1933
+ maxing = 'maxWait' in options;
1934
+ maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
1935
+ trailing = 'trailing' in options ? !!options.trailing : trailing;
1936
+ }
1937
+
1938
+ function invokeFunc(time) {
1939
+ var args = lastArgs,
1940
+ thisArg = lastThis;
1941
+ lastArgs = lastThis = undefined;
1942
+ lastInvokeTime = time;
1943
+ result = func.apply(thisArg, args);
1944
+ return result;
1945
+ }
1946
+
1947
+ function leadingEdge(time) {
1948
+ // Reset any `maxWait` timer.
1949
+ lastInvokeTime = time; // Start the timer for the trailing edge.
1950
+
1951
+ timerId = setTimeout(timerExpired, wait); // Invoke the leading edge.
1952
+
1953
+ return leading ? invokeFunc(time) : result;
1954
+ }
1955
+
1956
+ function remainingWait(time) {
1957
+ var timeSinceLastCall = time - lastCallTime,
1958
+ timeSinceLastInvoke = time - lastInvokeTime,
1959
+ timeWaiting = wait - timeSinceLastCall;
1960
+ return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
1961
+ }
1962
+
1963
+ function shouldInvoke(time) {
1964
+ var timeSinceLastCall = time - lastCallTime,
1965
+ timeSinceLastInvoke = time - lastInvokeTime; // Either this is the first call, activity has stopped and we're at the
1966
+ // trailing edge, the system time has gone backwards and we're treating
1967
+ // it as the trailing edge, or we've hit the `maxWait` limit.
1968
+
1969
+ return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
1970
+ }
1971
+
1972
+ function timerExpired() {
1973
+ var time = now();
1974
+
1975
+ if (shouldInvoke(time)) {
1976
+ return trailingEdge(time);
1977
+ } // Restart the timer.
1978
+
1979
+
1980
+ timerId = setTimeout(timerExpired, remainingWait(time));
1981
+ }
1982
+
1983
+ function trailingEdge(time) {
1984
+ timerId = undefined; // Only invoke if we have `lastArgs` which means `func` has been
1985
+ // debounced at least once.
1986
+
1987
+ if (trailing && lastArgs) {
1988
+ return invokeFunc(time);
1989
+ }
1990
+
1991
+ lastArgs = lastThis = undefined;
1992
+ return result;
1993
+ }
1994
+
1995
+ function cancel() {
1996
+ if (timerId !== undefined) {
1997
+ clearTimeout(timerId);
1998
+ }
1999
+
2000
+ lastInvokeTime = 0;
2001
+ lastArgs = lastCallTime = lastThis = timerId = undefined;
2002
+ }
2003
+
2004
+ function flush() {
2005
+ return timerId === undefined ? result : trailingEdge(now());
2006
+ }
2007
+
2008
+ function debounced() {
2009
+ var time = now(),
2010
+ isInvoking = shouldInvoke(time);
2011
+ lastArgs = arguments;
2012
+ lastThis = this;
2013
+ lastCallTime = time;
2014
+
2015
+ if (isInvoking) {
2016
+ if (timerId === undefined) {
2017
+ return leadingEdge(lastCallTime);
2018
+ }
2019
+
2020
+ if (maxing) {
2021
+ // Handle invocations in a tight loop.
2022
+ clearTimeout(timerId);
2023
+ timerId = setTimeout(timerExpired, wait);
2024
+ return invokeFunc(lastCallTime);
2025
+ }
2026
+ }
2027
+
2028
+ if (timerId === undefined) {
2029
+ timerId = setTimeout(timerExpired, wait);
2030
+ }
2031
+
2032
+ return result;
2033
+ }
2034
+
2035
+ debounced.cancel = cancel;
2036
+ debounced.flush = flush;
2037
+ return debounced;
2038
+ }
2039
+
2040
+ var debounce_1 = debounce$1;
2041
+ var debounce = debounce_1,
2042
+ isObject = isObject_1;
2043
+ /** Error message constants. */
2044
+
2045
+ var FUNC_ERROR_TEXT = 'Expected a function';
2046
+ /**
2047
+ * Creates a throttled function that only invokes `func` at most once per
2048
+ * every `wait` milliseconds. The throttled function comes with a `cancel`
2049
+ * method to cancel delayed `func` invocations and a `flush` method to
2050
+ * immediately invoke them. Provide `options` to indicate whether `func`
2051
+ * should be invoked on the leading and/or trailing edge of the `wait`
2052
+ * timeout. The `func` is invoked with the last arguments provided to the
2053
+ * throttled function. Subsequent calls to the throttled function return the
2054
+ * result of the last `func` invocation.
2055
+ *
2056
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is
2057
+ * invoked on the trailing edge of the timeout only if the throttled function
2058
+ * is invoked more than once during the `wait` timeout.
2059
+ *
2060
+ * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
2061
+ * until to the next tick, similar to `setTimeout` with a timeout of `0`.
2062
+ *
2063
+ * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
2064
+ * for details over the differences between `_.throttle` and `_.debounce`.
2065
+ *
2066
+ * @static
2067
+ * @memberOf _
2068
+ * @since 0.1.0
2069
+ * @category Function
2070
+ * @param {Function} func The function to throttle.
2071
+ * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
2072
+ * @param {Object} [options={}] The options object.
2073
+ * @param {boolean} [options.leading=true]
2074
+ * Specify invoking on the leading edge of the timeout.
2075
+ * @param {boolean} [options.trailing=true]
2076
+ * Specify invoking on the trailing edge of the timeout.
2077
+ * @returns {Function} Returns the new throttled function.
2078
+ * @example
2079
+ *
2080
+ * // Avoid excessively updating the position while scrolling.
2081
+ * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
2082
+ *
2083
+ * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
2084
+ * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
2085
+ * jQuery(element).on('click', throttled);
2086
+ *
2087
+ * // Cancel the trailing throttled invocation.
2088
+ * jQuery(window).on('popstate', throttled.cancel);
2089
+ */
2090
+
2091
+ function throttle(func, wait, options) {
2092
+ var leading = true,
2093
+ trailing = true;
2094
+
2095
+ if (typeof func != 'function') {
2096
+ throw new TypeError(FUNC_ERROR_TEXT);
2097
+ }
2098
+
2099
+ if (isObject(options)) {
2100
+ leading = 'leading' in options ? !!options.leading : leading;
2101
+ trailing = 'trailing' in options ? !!options.trailing : trailing;
2102
+ }
2103
+
2104
+ return debounce(func, wait, {
2105
+ 'leading': leading,
2106
+ 'maxWait': wait,
2107
+ 'trailing': trailing
2108
+ });
2109
+ }
2110
+
2111
+ var throttle_1 = throttle;
2112
+ const Wrapper = styled.div({
2113
+ position: 'relative',
2114
+ maxWidth: 250
2115
+ });
2116
+ const PickerTooltip = styled(WithTooltip)({
2117
+ position: 'absolute',
2118
+ zIndex: 1,
2119
+ top: 4,
2120
+ left: 4
2121
+ });
2122
+ const TooltipContent = styled.div({
2123
+ width: 200,
2124
+ margin: 5,
2125
+ '.react-colorful__saturation': {
2126
+ borderRadius: '4px 4px 0 0'
2127
+ },
2128
+ '.react-colorful__hue': {
2129
+ boxShadow: 'inset 0 0 0 1px rgb(0 0 0 / 5%)'
2130
+ },
2131
+ '.react-colorful__last-control': {
2132
+ borderRadius: '0 0 4px 4px'
2133
+ }
2134
+ });
2135
+ const Note = styled(TooltipNote)(({
2136
+ theme
2137
+ }) => ({
2138
+ fontFamily: theme.typography.fonts.base
2139
+ }));
2140
+ const Swatches = styled.div({
2141
+ display: 'grid',
2142
+ gridTemplateColumns: 'repeat(9, 16px)',
2143
+ gap: 6,
2144
+ padding: 3,
2145
+ marginTop: 5,
2146
+ width: 200
2147
+ });
2148
+ const SwatchColor = styled.div(({
2149
+ theme,
2150
+ active
2151
+ }) => ({
2152
+ width: 16,
2153
+ height: 16,
2154
+ boxShadow: active ? `${theme.appBorderColor} 0 0 0 1px inset, ${theme.color.mediumdark}50 0 0 0 4px` : `${theme.appBorderColor} 0 0 0 1px inset`,
2155
+ borderRadius: theme.appBorderRadius
2156
+ }));
2157
+ const swatchBackground = `url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')`;
2158
+
2159
+ const Swatch = _a => {
2160
+ var {
2161
+ value,
2162
+ active,
2163
+ onClick,
2164
+ style
2165
+ } = _a,
2166
+ props = __rest(_a, ["value", "active", "onClick", "style"]);
2167
+
2168
+ const backgroundImage = `linear-gradient(${value}, ${value}), ${swatchBackground}, linear-gradient(#fff, #fff)`;
2169
+ return React__default.createElement(SwatchColor, Object.assign({}, props, {
2170
+ active,
2171
+ onClick
2172
+ }, {
2173
+ style: Object.assign(Object.assign({}, style), {
2174
+ backgroundImage
2175
+ })
2176
+ }));
2177
+ };
2178
+
2179
+ const Input = styled(Form.Input)(({
2180
+ theme
2181
+ }) => ({
2182
+ width: '100%',
2183
+ paddingLeft: 30,
2184
+ paddingRight: 30,
2185
+ boxSizing: 'border-box',
2186
+ fontFamily: theme.typography.fonts.base
2187
+ }));
2188
+ const ToggleIcon = styled(Icons)(({
2189
+ theme
2190
+ }) => ({
2191
+ position: 'absolute',
2192
+ zIndex: 1,
2193
+ top: 6,
2194
+ right: 7,
2195
+ width: 20,
2196
+ height: 20,
2197
+ padding: 4,
2198
+ boxSizing: 'border-box',
2199
+ cursor: 'pointer',
2200
+ color: theme.input.color
2201
+ }));
2202
+ var ColorSpace;
2203
+
2204
+ (function (ColorSpace) {
2205
+ ColorSpace["RGB"] = "rgb";
2206
+ ColorSpace["HSL"] = "hsl";
2207
+ ColorSpace["HEX"] = "hex";
2208
+ })(ColorSpace || (ColorSpace = {}));
2209
+
2210
+ const COLOR_SPACES = Object.values(ColorSpace);
2211
+ const COLOR_REGEXP = /\(([0-9]+),\s*([0-9]+)%?,\s*([0-9]+)%?,?\s*([0-9.]+)?\)/;
2212
+ const RGB_REGEXP = /^\s*rgba?\(([0-9]+),\s*([0-9]+),\s*([0-9]+),?\s*([0-9.]+)?\)\s*$/i;
2213
+ const HSL_REGEXP = /^\s*hsla?\(([0-9]+),\s*([0-9]+)%,\s*([0-9]+)%,?\s*([0-9.]+)?\)\s*$/i;
2214
+ const HEX_REGEXP = /^\s*#?([0-9a-f]{3}|[0-9a-f]{6})\s*$/i;
2215
+ const SHORTHEX_REGEXP = /^\s*#?([0-9a-f]{3})\s*$/i;
2216
+ const ColorPicker = {
2217
+ [ColorSpace.HEX]: J,
2218
+ [ColorSpace.RGB]: pe,
2219
+ [ColorSpace.HSL]: re
2220
+ };
2221
+ const fallbackColor = {
2222
+ [ColorSpace.HEX]: 'transparent',
2223
+ [ColorSpace.RGB]: 'rgba(0, 0, 0, 0)',
2224
+ [ColorSpace.HSL]: 'hsla(0, 0%, 0%, 0)'
2225
+ };
2226
+
2227
+ const stringToArgs = value => {
2228
+ const match = value === null || value === void 0 ? void 0 : value.match(COLOR_REGEXP);
2229
+ if (!match) return [0, 0, 0, 1];
2230
+ const [, x, y, z, a = 1] = match;
2231
+ return [x, y, z, a].map(Number);
2232
+ };
2233
+
2234
+ const parseValue = value => {
2235
+ if (!value) return undefined;
2236
+ let valid = true;
2237
+
2238
+ if (RGB_REGEXP.test(value)) {
2239
+ const [r, g, b, a] = stringToArgs(value);
2240
+ const [h, s, l] = colorConvert.rgb.hsl([r, g, b]) || [0, 0, 0];
2241
+ return {
2242
+ valid,
2243
+ value,
2244
+ keyword: colorConvert.rgb.keyword([r, g, b]),
2245
+ colorSpace: ColorSpace.RGB,
2246
+ [ColorSpace.RGB]: value,
2247
+ [ColorSpace.HSL]: `hsla(${h}, ${s}%, ${l}%, ${a})`,
2248
+ [ColorSpace.HEX]: `#${colorConvert.rgb.hex([r, g, b]).toLowerCase()}`
2249
+ };
2250
+ }
2251
+
2252
+ if (HSL_REGEXP.test(value)) {
2253
+ const [h, s, l, a] = stringToArgs(value);
2254
+ const [r, g, b] = colorConvert.hsl.rgb([h, s, l]) || [0, 0, 0];
2255
+ return {
2256
+ valid,
2257
+ value,
2258
+ keyword: colorConvert.hsl.keyword([h, s, l]),
2259
+ colorSpace: ColorSpace.HSL,
2260
+ [ColorSpace.RGB]: `rgba(${r}, ${g}, ${b}, ${a})`,
2261
+ [ColorSpace.HSL]: value,
2262
+ [ColorSpace.HEX]: `#${colorConvert.hsl.hex([h, s, l]).toLowerCase()}`
2263
+ };
2264
+ }
2265
+
2266
+ const plain = value.replace('#', '');
2267
+ const rgb = colorConvert.keyword.rgb(plain) || colorConvert.hex.rgb(plain);
2268
+ const hsl = colorConvert.rgb.hsl(rgb);
2269
+ let mapped = value;
2270
+ if (/[^#a-f0-9]/i.test(value)) mapped = plain;else if (HEX_REGEXP.test(value)) mapped = `#${plain}`;
2271
+
2272
+ if (mapped.startsWith('#')) {
2273
+ valid = HEX_REGEXP.test(mapped);
2274
+ } else {
2275
+ try {
2276
+ colorConvert.keyword.hex(mapped);
2277
+ } catch (e) {
2278
+ valid = false;
2279
+ }
2280
+ }
2281
+
2282
+ return {
2283
+ valid,
2284
+ value: mapped,
2285
+ keyword: colorConvert.rgb.keyword(rgb),
2286
+ colorSpace: ColorSpace.HEX,
2287
+ [ColorSpace.RGB]: `rgba(${rgb[0]}, ${rgb[1]}, ${rgb[2]}, 1)`,
2288
+ [ColorSpace.HSL]: `hsla(${hsl[0]}, ${hsl[1]}%, ${hsl[2]}%, 1)`,
2289
+ [ColorSpace.HEX]: mapped
2290
+ };
2291
+ };
2292
+
2293
+ const getRealValue = (value, color, colorSpace) => {
2294
+ if (!value || !(color === null || color === void 0 ? void 0 : color.valid)) return fallbackColor[colorSpace];
2295
+ if (colorSpace !== ColorSpace.HEX) return (color === null || color === void 0 ? void 0 : color[colorSpace]) || fallbackColor[colorSpace];
2296
+
2297
+ if (!color.hex.startsWith('#')) {
2298
+ try {
2299
+ return `#${colorConvert.keyword.hex(color.hex)}`;
2300
+ } catch (e) {
2301
+ return fallbackColor.hex;
2302
+ }
2303
+ }
2304
+
2305
+ const short = color.hex.match(SHORTHEX_REGEXP);
2306
+ if (!short) return HEX_REGEXP.test(color.hex) ? color.hex : fallbackColor.hex;
2307
+ const [r, g, b] = short[1].split('');
2308
+ return `#${r}${r}${g}${g}${b}${b}`;
2309
+ };
2310
+
2311
+ const useColorInput = (initialValue, onChange) => {
2312
+ const [value, setValue] = useState(initialValue || '');
2313
+ const [color, setColor] = useState(() => parseValue(value));
2314
+ const [colorSpace, setColorSpace] = useState((color === null || color === void 0 ? void 0 : color.colorSpace) || ColorSpace.HEX); // Reset state when initialValue becomes undefined (when resetting controls)
2315
+
2316
+ useEffect(() => {
2317
+ if (initialValue !== undefined) return;
2318
+ setValue('');
2319
+ setColor(undefined);
2320
+ setColorSpace(ColorSpace.HEX);
2321
+ }, [initialValue]);
2322
+ const realValue = useMemo(() => getRealValue(value, color, colorSpace).toLowerCase(), [value, color, colorSpace]);
2323
+ const updateValue = useCallback(update => {
2324
+ const parsed = parseValue(update);
2325
+ setValue((parsed === null || parsed === void 0 ? void 0 : parsed.value) || update || '');
2326
+ if (!parsed) return;
2327
+ setColor(parsed);
2328
+ setColorSpace(parsed.colorSpace);
2329
+ onChange(parsed.value);
2330
+ }, [onChange]);
2331
+ const cycleColorSpace = useCallback(() => {
2332
+ let next = COLOR_SPACES.indexOf(colorSpace) + 1;
2333
+ if (next >= COLOR_SPACES.length) next = 0;
2334
+ setColorSpace(COLOR_SPACES[next]);
2335
+ const update = (color === null || color === void 0 ? void 0 : color[COLOR_SPACES[next]]) || '';
2336
+ setValue(update);
2337
+ onChange(update);
2338
+ }, [color, colorSpace, onChange]);
2339
+ return {
2340
+ value,
2341
+ realValue,
2342
+ updateValue,
2343
+ color,
2344
+ colorSpace,
2345
+ cycleColorSpace
2346
+ };
2347
+ };
2348
+
2349
+ const id = value => value.replace(/\s*/, '').toLowerCase();
2350
+
2351
+ const usePresets = (presetColors, currentColor, colorSpace) => {
2352
+ const [selectedColors, setSelectedColors] = useState((currentColor === null || currentColor === void 0 ? void 0 : currentColor.valid) ? [currentColor] : []); // Reset state when currentColor becomes undefined (when resetting controls)
2353
+
2354
+ useEffect(() => {
2355
+ if (currentColor !== undefined) return;
2356
+ setSelectedColors([]);
2357
+ }, [currentColor]);
2358
+ const presets = useMemo(() => {
2359
+ const initialPresets = (presetColors || []).map(preset => {
2360
+ if (typeof preset === 'string') return parseValue(preset);
2361
+ if (preset.title) return Object.assign(Object.assign({}, parseValue(preset.color)), {
2362
+ keyword: preset.title
2363
+ });
2364
+ return parseValue(preset.color);
2365
+ });
2366
+ return initialPresets.concat(selectedColors).filter(Boolean).slice(-27);
2367
+ }, [presetColors, selectedColors]);
2368
+ const addPreset = useCallback(color => {
2369
+ if (!(color === null || color === void 0 ? void 0 : color.valid)) return;
2370
+ if (presets.some(preset => id(preset[colorSpace]) === id(color[colorSpace]))) return;
2371
+ setSelectedColors(arr => arr.concat(color));
2372
+ }, [colorSpace, presets]);
2373
+ return {
2374
+ presets,
2375
+ addPreset
2376
+ };
2377
+ };
2378
+
2379
+ const ColorControl = ({
2380
+ name,
2381
+ value: initialValue,
2382
+ onChange,
2383
+ onFocus,
2384
+ onBlur,
2385
+ presetColors,
2386
+ startOpen
2387
+ }) => {
2388
+ const {
2389
+ value,
2390
+ realValue,
2391
+ updateValue,
2392
+ color,
2393
+ colorSpace,
2394
+ cycleColorSpace
2395
+ } = useColorInput(initialValue, throttle_1(onChange, 200));
2396
+ const {
2397
+ presets,
2398
+ addPreset
2399
+ } = usePresets(presetColors, color, colorSpace);
2400
+ const Picker = ColorPicker[colorSpace];
2401
+ return React__default.createElement(Wrapper, null, React__default.createElement(PickerTooltip, {
2402
+ trigger: "click",
2403
+ startOpen: startOpen,
2404
+ closeOnClick: true,
2405
+ onVisibilityChange: () => addPreset(color),
2406
+ tooltip: React__default.createElement(TooltipContent, null, React__default.createElement(Picker, Object.assign({
2407
+ color: realValue === 'transparent' ? '#000000' : realValue
2408
+ }, {
2409
+ onChange: updateValue,
2410
+ onFocus,
2411
+ onBlur
2412
+ })), presets.length > 0 && React__default.createElement(Swatches, null, presets.map((preset, index) => React__default.createElement(WithTooltip // eslint-disable-next-line react/no-array-index-key
2413
+ , {
2414
+ // eslint-disable-next-line react/no-array-index-key
2415
+ key: `${preset.value}-${index}`,
2416
+ hasChrome: false,
2417
+ tooltip: React__default.createElement(Note, {
2418
+ note: preset.keyword || preset.value
2419
+ })
2420
+ }, React__default.createElement(Swatch, {
2421
+ value: preset[colorSpace],
2422
+ active: color && id(preset[colorSpace]) === id(color[colorSpace]),
2423
+ onClick: () => updateValue(preset.value)
2424
+ })))))
2425
+ }, React__default.createElement(Swatch, {
2426
+ value: realValue,
2427
+ style: {
2428
+ margin: 4
2429
+ }
2430
+ })), React__default.createElement(Input, {
2431
+ id: getControlId(name),
2432
+ value: value,
2433
+ onChange: e => updateValue(e.target.value),
2434
+ onFocus: e => e.target.select(),
2435
+ placeholder: "Choose color..."
2436
+ }), value ? React__default.createElement(ToggleIcon, {
2437
+ icon: "markup",
2438
+ onClick: cycleColorSpace
2439
+ }) : null);
2440
+ };
2441
+
2442
+ export { ColorControl, ColorControl as default };