@skbkontur/react-ui 4.1.0 → 4.1.1

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 (368) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +1 -1
  3. package/cjs/components/Autocomplete/Autocomplete.js +8 -4
  4. package/cjs/components/Autocomplete/Autocomplete.js.map +1 -1
  5. package/cjs/components/Button/Button.d.ts +1 -5
  6. package/cjs/components/Button/Button.js +4 -12
  7. package/cjs/components/Button/Button.js.map +1 -1
  8. package/cjs/components/Checkbox/Checkbox.styles.js +4 -7
  9. package/cjs/components/Checkbox/Checkbox.styles.js.map +1 -1
  10. package/cjs/components/CurrencyInput/CurrencyHelper.js +18 -12
  11. package/cjs/components/CurrencyInput/CurrencyHelper.js.map +1 -1
  12. package/cjs/components/CurrencyInput/CurrencyInput.js +15 -7
  13. package/cjs/components/CurrencyInput/CurrencyInput.js.map +1 -1
  14. package/cjs/components/CurrencyInput/CurrencyInputHelper.js +7 -5
  15. package/cjs/components/CurrencyInput/CurrencyInputHelper.js.map +1 -1
  16. package/cjs/components/CurrencyInput/CursorHelper.js +19 -16
  17. package/cjs/components/CurrencyInput/CursorHelper.js.map +1 -1
  18. package/cjs/components/DateInput/helpers/InternalDateMediator.js +8 -2
  19. package/cjs/components/DateInput/helpers/InternalDateMediator.js.map +1 -1
  20. package/cjs/components/DropdownMenu/DropdownMenu.d.ts +1 -4
  21. package/cjs/components/DropdownMenu/DropdownMenu.js +2 -16
  22. package/cjs/components/DropdownMenu/DropdownMenu.js.map +1 -1
  23. package/cjs/components/FileUploader/FileUploader.js +3 -1
  24. package/cjs/components/FileUploader/FileUploader.js.map +1 -1
  25. package/cjs/components/Gapped/Gapped.js +2 -2
  26. package/cjs/components/Gapped/Gapped.js.map +1 -1
  27. package/cjs/components/GlobalLoader/GlobalLoader.js +3 -5
  28. package/cjs/components/GlobalLoader/GlobalLoader.js.map +1 -1
  29. package/cjs/components/Group/Group.js +74 -31
  30. package/cjs/components/Group/Group.js.map +1 -1
  31. package/cjs/components/Input/Input.js.map +1 -1
  32. package/cjs/components/Kebab/Kebab.d.ts +2 -13
  33. package/cjs/components/Kebab/Kebab.js +5 -29
  34. package/cjs/components/Kebab/Kebab.js.map +1 -1
  35. package/cjs/components/Modal/Modal.js +2 -1
  36. package/cjs/components/Modal/Modal.js.map +1 -1
  37. package/cjs/components/Modal/ModalFooter.js +1 -1
  38. package/cjs/components/Modal/ModalFooter.js.map +1 -1
  39. package/cjs/components/Modal/ModalHeader.js +1 -1
  40. package/cjs/components/Modal/ModalHeader.js.map +1 -1
  41. package/cjs/components/Paging/Paging.d.ts +1 -1
  42. package/cjs/components/Paging/Paging.js +3 -3
  43. package/cjs/components/Paging/Paging.js.map +1 -1
  44. package/cjs/components/PasswordInput/PasswordInput.js +2 -1
  45. package/cjs/components/PasswordInput/PasswordInput.js.map +1 -1
  46. package/cjs/components/Radio/Radio.styles.js +4 -7
  47. package/cjs/components/Radio/Radio.styles.js.map +1 -1
  48. package/cjs/components/RadioGroup/RadioGroup.js +1 -1
  49. package/cjs/components/RadioGroup/RadioGroup.js.map +1 -1
  50. package/cjs/components/ResponsiveLayout/ResponsiveLayout.js +1 -1
  51. package/cjs/components/ResponsiveLayout/ResponsiveLayout.js.map +1 -1
  52. package/cjs/components/ResponsiveLayout/ResponsiveLayoutEvents.js +3 -4
  53. package/cjs/components/ResponsiveLayout/ResponsiveLayoutEvents.js.map +1 -1
  54. package/cjs/components/Select/Select.js +30 -12
  55. package/cjs/components/Select/Select.js.map +1 -1
  56. package/cjs/components/SidePage/SidePage.js +2 -1
  57. package/cjs/components/SidePage/SidePage.js.map +1 -1
  58. package/cjs/components/Spinner/Spinner.d.ts +0 -1
  59. package/cjs/components/Spinner/Spinner.js +1 -5
  60. package/cjs/components/Spinner/Spinner.js.map +1 -1
  61. package/cjs/components/Spinner/SpinnerFallbackAnimation.js +16 -5
  62. package/cjs/components/Spinner/SpinnerFallbackAnimation.js.map +1 -1
  63. package/cjs/components/Textarea/Textarea.js.map +1 -1
  64. package/cjs/components/Textarea/TextareaCounter.d.ts +1 -2
  65. package/cjs/components/Textarea/TextareaCounter.js +5 -4
  66. package/cjs/components/Textarea/TextareaCounter.js.map +1 -1
  67. package/cjs/components/Toggle/Toggle.d.ts +1 -1
  68. package/cjs/components/Toggle/Toggle.js.map +1 -1
  69. package/cjs/components/Token/Token.js +14 -2
  70. package/cjs/components/Token/Token.js.map +1 -1
  71. package/cjs/components/Token/Token.styles.js +13 -6
  72. package/cjs/components/Token/Token.styles.js.map +1 -1
  73. package/cjs/components/TokenInput/TokenInput.js +13 -10
  74. package/cjs/components/TokenInput/TokenInput.js.map +1 -1
  75. package/cjs/components/Tooltip/Tooltip.js +5 -2
  76. package/cjs/components/Tooltip/Tooltip.js.map +1 -1
  77. package/cjs/components/TooltipMenu/TooltipMenu.d.ts +1 -1
  78. package/cjs/components/TooltipMenu/TooltipMenu.js +2 -0
  79. package/cjs/components/TooltipMenu/TooltipMenu.js.map +1 -1
  80. package/cjs/hooks/useDrop.js +3 -1
  81. package/cjs/hooks/useDrop.js.map +1 -1
  82. package/cjs/internal/Calendar/Calendar.js +3 -3
  83. package/cjs/internal/Calendar/Calendar.js.map +1 -1
  84. package/cjs/internal/Calendar/CalendarDateShape.d.ts +1 -1
  85. package/cjs/internal/Calendar/MonthViewModel.js +36 -17
  86. package/cjs/internal/Calendar/MonthViewModel.js.map +1 -1
  87. package/cjs/internal/CommonWrapper/CommonWrapper.js +3 -3
  88. package/cjs/internal/CommonWrapper/CommonWrapper.js.map +1 -1
  89. package/cjs/internal/CustomComboBox/ComboBoxMenu.js +6 -1
  90. package/cjs/internal/CustomComboBox/ComboBoxMenu.js.map +1 -1
  91. package/cjs/internal/CustomComboBox/CustomComboBox.js +3 -2
  92. package/cjs/internal/CustomComboBox/CustomComboBox.js.map +1 -1
  93. package/cjs/internal/CustomComboBox/CustomComboBoxReducer.d.ts +16 -16
  94. package/cjs/internal/CustomComboBox/CustomComboBoxReducer.js +35 -35
  95. package/cjs/internal/CustomComboBox/CustomComboBoxReducer.js.map +1 -1
  96. package/cjs/internal/DateSelect/DateSelect.js +22 -11
  97. package/cjs/internal/DateSelect/DateSelect.js.map +1 -1
  98. package/cjs/internal/FileUploaderControl/FileUploaderControlProvider.js +3 -1
  99. package/cjs/internal/FileUploaderControl/FileUploaderControlProvider.js.map +1 -1
  100. package/cjs/internal/InternalMenu/InternalMenu.js +4 -7
  101. package/cjs/internal/InternalMenu/InternalMenu.js.map +1 -1
  102. package/cjs/internal/InternalMenu/addIconPaddingIfPartOfMenu.d.ts +2 -0
  103. package/cjs/internal/InternalMenu/addIconPaddingIfPartOfMenu.js +16 -0
  104. package/cjs/internal/InternalMenu/addIconPaddingIfPartOfMenu.js.map +1 -0
  105. package/cjs/internal/MaskedInput/MaskedInput.js +7 -2
  106. package/cjs/internal/MaskedInput/MaskedInput.js.map +1 -1
  107. package/cjs/internal/Menu/Menu.js +12 -13
  108. package/cjs/internal/Menu/Menu.js.map +1 -1
  109. package/cjs/internal/Popup/Popup.d.ts +1 -0
  110. package/cjs/internal/Popup/Popup.js +8 -9
  111. package/cjs/internal/Popup/Popup.js.map +1 -1
  112. package/cjs/internal/PopupMenu/PopupMenu.d.ts +4 -0
  113. package/cjs/internal/PopupMenu/PopupMenu.js +13 -0
  114. package/cjs/internal/PopupMenu/PopupMenu.js.map +1 -1
  115. package/cjs/internal/PopupMenu/validatePositions.js +6 -6
  116. package/cjs/internal/PopupMenu/validatePositions.js.map +1 -1
  117. package/cjs/internal/RenderContainer/RenderInnerContainer.d.ts +1 -1
  118. package/cjs/internal/RenderContainer/RenderInnerContainer.js +2 -1
  119. package/cjs/internal/RenderContainer/RenderInnerContainer.js.map +1 -1
  120. package/cjs/internal/RenderLayer/RenderLayer.js +4 -1
  121. package/cjs/internal/RenderLayer/RenderLayer.js.map +1 -1
  122. package/cjs/internal/ThemePlayground/ThemeEditor.js +6 -1
  123. package/cjs/internal/ThemePlayground/ThemeEditor.js.map +1 -1
  124. package/cjs/internal/ThemePlayground/VariableValue.js +18 -6
  125. package/cjs/internal/ThemePlayground/VariableValue.js.map +1 -1
  126. package/cjs/internal/ThemeShowcase/ThemeShowcase.js +4 -7
  127. package/cjs/internal/ThemeShowcase/ThemeShowcase.js.map +1 -1
  128. package/cjs/internal/ThemeShowcase/VariablesCollector.d.ts +1 -1
  129. package/cjs/internal/ThemeShowcase/VariablesCollector.js +5 -6
  130. package/cjs/internal/ThemeShowcase/VariablesCollector.js.map +1 -1
  131. package/cjs/internal/ZIndex/ZIndexStorage.d.ts +2 -1
  132. package/cjs/internal/ZIndex/ZIndexStorage.js +13 -6
  133. package/cjs/internal/ZIndex/ZIndexStorage.js.map +1 -1
  134. package/cjs/internal/icons/16px/index.d.ts +19 -19
  135. package/cjs/internal/icons/16px/index.js +37 -38
  136. package/cjs/internal/icons/16px/index.js.map +1 -1
  137. package/cjs/lib/animation/index.d.ts +1 -1
  138. package/cjs/lib/animation/index.js +3 -3
  139. package/cjs/lib/animation/index.js.map +1 -1
  140. package/cjs/lib/date/InternalDate.js +23 -9
  141. package/cjs/lib/date/InternalDate.js.map +1 -1
  142. package/cjs/lib/date/InternalDateCalculator.js +16 -2
  143. package/cjs/lib/date/InternalDateCalculator.js.map +1 -1
  144. package/cjs/lib/date/InternalDateGetter.js +23 -6
  145. package/cjs/lib/date/InternalDateGetter.js.map +1 -1
  146. package/cjs/lib/date/InternalDateTransformer.js +11 -2
  147. package/cjs/lib/date/InternalDateTransformer.js.map +1 -1
  148. package/cjs/lib/date/InternalDateValidator.js +31 -6
  149. package/cjs/lib/date/InternalDateValidator.js.map +1 -1
  150. package/cjs/lib/events/keyboard/extractCode.js +7 -5
  151. package/cjs/lib/events/keyboard/extractCode.js.map +1 -1
  152. package/cjs/lib/rootNode/getRootNode.d.ts +9 -0
  153. package/cjs/lib/rootNode/getRootNode.js +34 -6
  154. package/cjs/lib/rootNode/getRootNode.js.map +1 -1
  155. package/cjs/lib/rootNode/rootNodeDecorator.d.ts +9 -1
  156. package/cjs/lib/rootNode/rootNodeDecorator.js +9 -1
  157. package/cjs/lib/rootNode/rootNodeDecorator.js.map +1 -1
  158. package/cjs/lib/stringUtils.js +3 -1
  159. package/cjs/lib/stringUtils.js.map +1 -1
  160. package/cjs/lib/styles/ColorFactory.js +9 -9
  161. package/cjs/lib/styles/ColorFactory.js.map +1 -1
  162. package/cjs/lib/styles/ColorHelpers.d.ts +1 -0
  163. package/cjs/lib/styles/ColorHelpers.js +33 -10
  164. package/cjs/lib/styles/ColorHelpers.js.map +1 -1
  165. package/cjs/lib/styles/ColorObject.js +3 -2
  166. package/cjs/lib/styles/ColorObject.js.map +1 -1
  167. package/cjs/lib/styles/getLabGrotesqueBaselineCompensation.d.ts +1 -0
  168. package/cjs/lib/styles/getLabGrotesqueBaselineCompensation.js +9 -0
  169. package/cjs/lib/styles/getLabGrotesqueBaselineCompensation.js.map +1 -0
  170. package/cjs/lib/taskWithDelayAndMinimalDuration.js +3 -1
  171. package/cjs/lib/taskWithDelayAndMinimalDuration.js.map +1 -1
  172. package/cjs/lib/theming/Emotion.js +5 -2
  173. package/cjs/lib/theming/Emotion.js.map +1 -1
  174. package/cjs/lib/theming/ThemeFactory.js +5 -1
  175. package/cjs/lib/theming/ThemeFactory.js.map +1 -1
  176. package/cjs/lib/theming/ThemeHelpers.js +7 -2
  177. package/cjs/lib/theming/ThemeHelpers.js.map +1 -1
  178. package/cjs/lib/utils.d.ts +15 -0
  179. package/cjs/lib/utils.js +45 -9
  180. package/cjs/lib/utils.js.map +1 -1
  181. package/components/Autocomplete/Autocomplete/Autocomplete.js +6 -5
  182. package/components/Autocomplete/Autocomplete/Autocomplete.js.map +1 -1
  183. package/components/Button/Button/Button.js +4 -10
  184. package/components/Button/Button/Button.js.map +1 -1
  185. package/components/Button/Button.d.ts +1 -5
  186. package/components/Checkbox/Checkbox.styles/Checkbox.styles.js +2 -1
  187. package/components/Checkbox/Checkbox.styles/Checkbox.styles.js.map +1 -1
  188. package/components/CurrencyInput/CurrencyHelper/CurrencyHelper.js +12 -11
  189. package/components/CurrencyInput/CurrencyHelper/CurrencyHelper.js.map +1 -1
  190. package/components/CurrencyInput/CurrencyInput/CurrencyInput.js +15 -7
  191. package/components/CurrencyInput/CurrencyInput/CurrencyInput.js.map +1 -1
  192. package/components/CurrencyInput/CurrencyInputHelper/CurrencyInputHelper.js +7 -1
  193. package/components/CurrencyInput/CurrencyInputHelper/CurrencyInputHelper.js.map +1 -1
  194. package/components/CurrencyInput/CursorHelper/CursorHelper.js +18 -11
  195. package/components/CurrencyInput/CursorHelper/CursorHelper.js.map +1 -1
  196. package/components/DateInput/helpers/InternalDateMediator/InternalDateMediator.js +7 -7
  197. package/components/DateInput/helpers/InternalDateMediator/InternalDateMediator.js.map +1 -1
  198. package/components/DropdownMenu/DropdownMenu/DropdownMenu.js +3 -16
  199. package/components/DropdownMenu/DropdownMenu/DropdownMenu.js.map +1 -1
  200. package/components/DropdownMenu/DropdownMenu.d.ts +1 -4
  201. package/components/FileUploader/FileUploader/FileUploader.js +4 -1
  202. package/components/FileUploader/FileUploader/FileUploader.js.map +1 -1
  203. package/components/Gapped/Gapped/Gapped.js +2 -2
  204. package/components/Gapped/Gapped/Gapped.js.map +1 -1
  205. package/components/GlobalLoader/GlobalLoader/GlobalLoader.js +5 -7
  206. package/components/GlobalLoader/GlobalLoader/GlobalLoader.js.map +1 -1
  207. package/components/Group/Group/Group.js +62 -30
  208. package/components/Group/Group/Group.js.map +1 -1
  209. package/components/Input/Input/Input.js.map +1 -1
  210. package/components/Kebab/Kebab/Kebab.js +3 -13
  211. package/components/Kebab/Kebab/Kebab.js.map +1 -1
  212. package/components/Kebab/Kebab.d.ts +2 -13
  213. package/components/Modal/Modal/Modal.js +2 -1
  214. package/components/Modal/Modal/Modal.js.map +1 -1
  215. package/components/Modal/ModalFooter/ModalFooter.js +1 -1
  216. package/components/Modal/ModalFooter/ModalFooter.js.map +1 -1
  217. package/components/Modal/ModalHeader/ModalHeader.js +1 -1
  218. package/components/Modal/ModalHeader/ModalHeader.js.map +1 -1
  219. package/components/Paging/Paging/Paging.js +6 -5
  220. package/components/Paging/Paging/Paging.js.map +1 -1
  221. package/components/Paging/Paging.d.ts +1 -1
  222. package/components/PasswordInput/PasswordInput/PasswordInput.js +2 -1
  223. package/components/PasswordInput/PasswordInput/PasswordInput.js.map +1 -1
  224. package/components/Radio/Radio.styles/Radio.styles.js +2 -1
  225. package/components/Radio/Radio.styles/Radio.styles.js.map +1 -1
  226. package/components/RadioGroup/RadioGroup/RadioGroup.js +2 -2
  227. package/components/RadioGroup/RadioGroup/RadioGroup.js.map +1 -1
  228. package/components/ResponsiveLayout/ResponsiveLayout/ResponsiveLayout.js +1 -1
  229. package/components/ResponsiveLayout/ResponsiveLayout/ResponsiveLayout.js.map +1 -1
  230. package/components/ResponsiveLayout/ResponsiveLayoutEvents/ResponsiveLayoutEvents.js +3 -3
  231. package/components/ResponsiveLayout/ResponsiveLayoutEvents/ResponsiveLayoutEvents.js.map +1 -1
  232. package/components/Select/Select/Select.js +26 -12
  233. package/components/Select/Select/Select.js.map +1 -1
  234. package/components/SidePage/SidePage/SidePage.js +2 -1
  235. package/components/SidePage/SidePage/SidePage.js.map +1 -1
  236. package/components/Spinner/Spinner/Spinner.js +6 -2
  237. package/components/Spinner/Spinner/Spinner.js.map +1 -1
  238. package/components/Spinner/Spinner.d.ts +0 -1
  239. package/components/Spinner/SpinnerFallbackAnimation/SpinnerFallbackAnimation.js +18 -4
  240. package/components/Spinner/SpinnerFallbackAnimation/SpinnerFallbackAnimation.js.map +1 -1
  241. package/components/Textarea/Textarea/Textarea.js.map +1 -1
  242. package/components/Textarea/TextareaCounter/TextareaCounter.js +2 -1
  243. package/components/Textarea/TextareaCounter/TextareaCounter.js.map +1 -1
  244. package/components/Textarea/TextareaCounter.d.ts +1 -2
  245. package/components/Toggle/Toggle/Toggle.js.map +1 -1
  246. package/components/Toggle/Toggle.d.ts +1 -1
  247. package/components/Token/Token/Token.js +12 -1
  248. package/components/Token/Token/Token.js.map +1 -1
  249. package/components/Token/Token.styles/Token.styles.js +11 -4
  250. package/components/Token/Token.styles/Token.styles.js.map +1 -1
  251. package/components/TokenInput/TokenInput/TokenInput.js +19 -14
  252. package/components/TokenInput/TokenInput/TokenInput.js.map +1 -1
  253. package/components/Tooltip/Tooltip/Tooltip.js +5 -2
  254. package/components/Tooltip/Tooltip/Tooltip.js.map +1 -1
  255. package/components/TooltipMenu/TooltipMenu/TooltipMenu.js +2 -0
  256. package/components/TooltipMenu/TooltipMenu/TooltipMenu.js.map +1 -1
  257. package/components/TooltipMenu/TooltipMenu.d.ts +1 -1
  258. package/hooks/useDrop/useDrop.js +5 -1
  259. package/hooks/useDrop/useDrop.js.map +1 -1
  260. package/internal/Calendar/Calendar/Calendar.js +6 -4
  261. package/internal/Calendar/Calendar/Calendar.js.map +1 -1
  262. package/internal/Calendar/CalendarDateShape.d.ts +1 -1
  263. package/internal/Calendar/MonthViewModel/MonthViewModel.js +35 -18
  264. package/internal/Calendar/MonthViewModel/MonthViewModel.js.map +1 -1
  265. package/internal/CommonWrapper/CommonWrapper/CommonWrapper.js +3 -3
  266. package/internal/CommonWrapper/CommonWrapper/CommonWrapper.js.map +1 -1
  267. package/internal/CustomComboBox/ComboBoxMenu/ComboBoxMenu.js +23 -15
  268. package/internal/CustomComboBox/ComboBoxMenu/ComboBoxMenu.js.map +1 -1
  269. package/internal/CustomComboBox/CustomComboBox/CustomComboBox.js +18 -17
  270. package/internal/CustomComboBox/CustomComboBox/CustomComboBox.js.map +1 -1
  271. package/internal/CustomComboBox/CustomComboBoxReducer/CustomComboBoxReducer.js +35 -35
  272. package/internal/CustomComboBox/CustomComboBoxReducer/CustomComboBoxReducer.js.map +1 -1
  273. package/internal/CustomComboBox/CustomComboBoxReducer.d.ts +16 -16
  274. package/internal/DateSelect/DateSelect/DateSelect.js +21 -15
  275. package/internal/DateSelect/DateSelect/DateSelect.js.map +1 -1
  276. package/internal/FileUploaderControl/FileUploaderControlProvider/FileUploaderControlProvider.js +5 -1
  277. package/internal/FileUploaderControl/FileUploaderControlProvider/FileUploaderControlProvider.js.map +1 -1
  278. package/internal/InternalMenu/InternalMenu/InternalMenu.js +13 -16
  279. package/internal/InternalMenu/InternalMenu/InternalMenu.js.map +1 -1
  280. package/internal/InternalMenu/addIconPaddingIfPartOfMenu/addIconPaddingIfPartOfMenu.js +14 -0
  281. package/internal/InternalMenu/addIconPaddingIfPartOfMenu/addIconPaddingIfPartOfMenu.js.map +1 -0
  282. package/internal/InternalMenu/addIconPaddingIfPartOfMenu/package.json +6 -0
  283. package/internal/InternalMenu/addIconPaddingIfPartOfMenu.d.ts +2 -0
  284. package/internal/MaskedInput/MaskedInput/MaskedInput.js +8 -3
  285. package/internal/MaskedInput/MaskedInput/MaskedInput.js.map +1 -1
  286. package/internal/Menu/Menu/Menu.js +9 -14
  287. package/internal/Menu/Menu/Menu.js.map +1 -1
  288. package/internal/Popup/Popup/Popup.js +8 -7
  289. package/internal/Popup/Popup/Popup.js.map +1 -1
  290. package/internal/Popup/Popup.d.ts +1 -0
  291. package/internal/PopupMenu/PopupMenu/PopupMenu.js +8 -0
  292. package/internal/PopupMenu/PopupMenu/PopupMenu.js.map +1 -1
  293. package/internal/PopupMenu/PopupMenu.d.ts +4 -0
  294. package/internal/PopupMenu/validatePositions/validatePositions.js +6 -6
  295. package/internal/PopupMenu/validatePositions/validatePositions.js.map +1 -1
  296. package/internal/RenderContainer/RenderInnerContainer/RenderInnerContainer.js +5 -2
  297. package/internal/RenderContainer/RenderInnerContainer/RenderInnerContainer.js.map +1 -1
  298. package/internal/RenderContainer/RenderInnerContainer.d.ts +1 -1
  299. package/internal/RenderLayer/RenderLayer/RenderLayer.js +5 -1
  300. package/internal/RenderLayer/RenderLayer/RenderLayer.js.map +1 -1
  301. package/internal/ThemePlayground/ThemeEditor/ThemeEditor.js +5 -1
  302. package/internal/ThemePlayground/ThemeEditor/ThemeEditor.js.map +1 -1
  303. package/internal/ThemePlayground/VariableValue/VariableValue.js +16 -5
  304. package/internal/ThemePlayground/VariableValue/VariableValue.js.map +1 -1
  305. package/internal/ThemeShowcase/ThemeShowcase/ThemeShowcase.js +3 -6
  306. package/internal/ThemeShowcase/ThemeShowcase/ThemeShowcase.js.map +1 -1
  307. package/internal/ThemeShowcase/VariablesCollector/VariablesCollector.js +4 -6
  308. package/internal/ThemeShowcase/VariablesCollector/VariablesCollector.js.map +1 -1
  309. package/internal/ThemeShowcase/VariablesCollector.d.ts +1 -1
  310. package/internal/ZIndex/ZIndexStorage/ZIndexStorage.js +12 -6
  311. package/internal/ZIndex/ZIndexStorage/ZIndexStorage.js.map +1 -1
  312. package/internal/ZIndex/ZIndexStorage.d.ts +2 -1
  313. package/internal/icons/16px/index/index.js +21 -20
  314. package/internal/icons/16px/index/index.js.map +1 -1
  315. package/internal/icons/16px/index.d.ts +19 -19
  316. package/lib/animation/index/index.js +1 -1
  317. package/lib/animation/index/index.js.map +1 -1
  318. package/lib/animation/index.d.ts +1 -1
  319. package/lib/date/InternalDate/InternalDate.js +16 -1
  320. package/lib/date/InternalDate/InternalDate.js.map +1 -1
  321. package/lib/date/InternalDateCalculator/InternalDateCalculator.js +14 -2
  322. package/lib/date/InternalDateCalculator/InternalDateCalculator.js.map +1 -1
  323. package/lib/date/InternalDateGetter/InternalDateGetter.js +20 -6
  324. package/lib/date/InternalDateGetter/InternalDateGetter.js.map +1 -1
  325. package/lib/date/InternalDateTransformer/InternalDateTransformer.js +11 -1
  326. package/lib/date/InternalDateTransformer/InternalDateTransformer.js.map +1 -1
  327. package/lib/date/InternalDateValidator/InternalDateValidator.js +31 -4
  328. package/lib/date/InternalDateValidator/InternalDateValidator.js.map +1 -1
  329. package/lib/events/keyboard/extractCode/extractCode.js +5 -5
  330. package/lib/events/keyboard/extractCode/extractCode.js.map +1 -1
  331. package/lib/rootNode/getRootNode/getRootNode.js +35 -8
  332. package/lib/rootNode/getRootNode/getRootNode.js.map +1 -1
  333. package/lib/rootNode/getRootNode.d.ts +9 -0
  334. package/lib/rootNode/rootNodeDecorator/rootNodeDecorator.js +1 -1
  335. package/lib/rootNode/rootNodeDecorator/rootNodeDecorator.js.map +1 -1
  336. package/lib/rootNode/rootNodeDecorator.d.ts +9 -1
  337. package/lib/stringUtils/stringUtils.js +4 -1
  338. package/lib/stringUtils/stringUtils.js.map +1 -1
  339. package/lib/styles/ColorFactory/ColorFactory.js +9 -9
  340. package/lib/styles/ColorFactory/ColorFactory.js.map +1 -1
  341. package/lib/styles/ColorHelpers/ColorHelpers.js +26 -9
  342. package/lib/styles/ColorHelpers/ColorHelpers.js.map +1 -1
  343. package/lib/styles/ColorHelpers.d.ts +1 -0
  344. package/lib/styles/ColorObject/ColorObject.js +2 -2
  345. package/lib/styles/ColorObject/ColorObject.js.map +1 -1
  346. package/lib/styles/getLabGrotesqueBaselineCompensation/getLabGrotesqueBaselineCompensation.js +9 -0
  347. package/lib/styles/getLabGrotesqueBaselineCompensation/getLabGrotesqueBaselineCompensation.js.map +1 -0
  348. package/lib/styles/getLabGrotesqueBaselineCompensation/package.json +6 -0
  349. package/lib/styles/getLabGrotesqueBaselineCompensation.d.ts +1 -0
  350. package/lib/taskWithDelayAndMinimalDuration/taskWithDelayAndMinimalDuration.js +4 -1
  351. package/lib/taskWithDelayAndMinimalDuration/taskWithDelayAndMinimalDuration.js.map +1 -1
  352. package/lib/theming/Emotion/Emotion.js +5 -2
  353. package/lib/theming/Emotion/Emotion.js.map +1 -1
  354. package/lib/theming/ThemeFactory/ThemeFactory.js +5 -2
  355. package/lib/theming/ThemeFactory/ThemeFactory.js.map +1 -1
  356. package/lib/theming/ThemeHelpers/ThemeHelpers.js +5 -1
  357. package/lib/theming/ThemeHelpers/ThemeHelpers.js.map +1 -1
  358. package/lib/utils/utils.js +42 -6
  359. package/lib/utils/utils.js.map +1 -1
  360. package/lib/utils.d.ts +15 -0
  361. package/package.json +4 -3
  362. package/cjs/components/Button/Corners.d.ts +0 -6
  363. package/cjs/components/Button/Corners.js +0 -5
  364. package/cjs/components/Button/Corners.js.map +0 -1
  365. package/components/Button/Corners/Corners.js +0 -6
  366. package/components/Button/Corners/Corners.js.map +0 -1
  367. package/components/Button/Corners/package.json +0 -6
  368. package/components/Button/Corners.d.ts +0 -6
@@ -86,6 +86,9 @@ RenderLayer = (0, _rootNode.rootNode)(_class = (_temp = _class2 = /*#__PURE__*/f
86
86
 
87
87
 
88
88
 
89
+
90
+
91
+
89
92
 
90
93
 
91
94
 
@@ -107,4 +110,4 @@ RenderLayer = (0, _rootNode.rootNode)(_class = (_temp = _class2 = /*#__PURE__*/f
107
110
  if (_this.props.onClickOutside) {
108
111
  _this.props.onClickOutside(event);
109
112
  }
110
- };return _this;}var _proto = RenderLayer.prototype;_proto.componentDidMount = function componentDidMount() {if (this.props.active) {this.attachListeners();}};_proto.componentDidUpdate = function componentDidUpdate(prevProps) {if (!prevProps.active && this.props.active) {this.attachListeners();}if (prevProps.active && !this.props.active) {this.detachListeners();}};_proto.componentWillUnmount = function componentWillUnmount() {if (this.props.active) {this.detachListeners();}};_proto.render = function render() {return /*#__PURE__*/_react.default.createElement(_CommonWrapper.CommonWrapper, (0, _extends2.default)({ rootNodeRef: this.setRootNode }, this.props), _react.default.Children.only(this.props.children));};_proto.attachListeners = function attachListeners() {var _this$props$getAnchor, _this$props;var rootNode = (0, _rootNode.getRootNode)(this) || ((_this$props$getAnchor = (_this$props = this.props).getAnchorElement) == null ? void 0 : _this$props$getAnchor.call(_this$props));if (!rootNode) return;this.focusOutsideListenerToken = (0, _listenFocusOutside.listen)(function () {return [rootNode];}, this.handleFocusOutside);window.addEventListener('blur', this.handleFocusOutside);document.addEventListener('ontouchstart' in document.documentElement ? 'touchstart' : 'mousedown', this.handleNativeDocClick);};_proto.detachListeners = function detachListeners() {if (this.focusOutsideListenerToken) {this.focusOutsideListenerToken.remove();this.focusOutsideListenerToken = null;}window.removeEventListener('blur', this.handleFocusOutside);document.removeEventListener('ontouchstart' in document.documentElement ? 'touchstart' : 'mousedown', this.handleNativeDocClick);};return RenderLayer;}(_react.default.Component), _class2.__KONTUR_REACT_UI__ = 'RenderLayer', _class2.propTypes = { active: function active(props, propName, componentName) {var active = props.active,onClickOutside = props.onClickOutside,onFocusOutside = props.onFocusOutside;if (active && !(onClickOutside || onFocusOutside)) {return new Error("[" + componentName + "]: using the component without either 'onClickOutside' or 'onFocusOutside' callback is pointless.");}} }, _class2.defaultProps = { active: true }, _temp)) || _class;exports.RenderLayer = RenderLayer;
113
+ };return _this;}var _proto = RenderLayer.prototype;_proto.componentDidMount = function componentDidMount() {if (this.props.active) {this.attachListeners();}};_proto.componentDidUpdate = function componentDidUpdate(prevProps) {if (!prevProps.active && this.props.active) {this.attachListeners();}if (prevProps.active && !this.props.active) {this.detachListeners();}};_proto.componentWillUnmount = function componentWillUnmount() {if (this.props.active) {this.detachListeners();}};_proto.render = function render() {return /*#__PURE__*/_react.default.createElement(_CommonWrapper.CommonWrapper, (0, _extends2.default)({ rootNodeRef: this.setRootNode }, this.props), _react.default.Children.only(this.props.children));};_proto.attachListeners = function attachListeners() {var _this$props$getAnchor, _this$props;var rootNode = (0, _rootNode.getRootNode)(this) || ((_this$props$getAnchor = (_this$props = this.props).getAnchorElement) == null ? void 0 : _this$props$getAnchor.call(_this$props));if (!rootNode) {return;}this.focusOutsideListenerToken = (0, _listenFocusOutside.listen)(function () {return [rootNode];}, this.handleFocusOutside);window.addEventListener('blur', this.handleFocusOutside);document.addEventListener('ontouchstart' in document.documentElement ? 'touchstart' : 'mousedown', this.handleNativeDocClick);};_proto.detachListeners = function detachListeners() {if (this.focusOutsideListenerToken) {this.focusOutsideListenerToken.remove();this.focusOutsideListenerToken = null;}window.removeEventListener('blur', this.handleFocusOutside);document.removeEventListener('ontouchstart' in document.documentElement ? 'touchstart' : 'mousedown', this.handleNativeDocClick);};return RenderLayer;}(_react.default.Component), _class2.__KONTUR_REACT_UI__ = 'RenderLayer', _class2.propTypes = { active: function active(props, propName, componentName) {var active = props.active,onClickOutside = props.onClickOutside,onFocusOutside = props.onFocusOutside;if (active && !(onClickOutside || onFocusOutside)) {return new Error("[" + componentName + "]: using the component without either 'onClickOutside' or 'onFocusOutside' callback is pointless.");}} }, _class2.defaultProps = { active: true }, _temp)) || _class;exports.RenderLayer = RenderLayer;
@@ -1 +1 @@
1
- {"version":3,"sources":["RenderLayer.tsx"],"names":["RenderLayer","rootNode","focusOutsideListenerToken","handleFocusOutside","event","props","onFocusOutside","handleNativeDocClick","target","srcElement","node","getAnchorElement","Element","onClickOutside","componentDidMount","active","attachListeners","componentDidUpdate","prevProps","detachListeners","componentWillUnmount","render","setRootNode","React","Children","only","children","window","addEventListener","document","documentElement","remove","removeEventListener","Component","__KONTUR_REACT_UI__","propTypes","propName","componentName","Error","defaultProps"],"mappings":"ubAAA;;AAEA;AACA;AACA,8C;;;;;;;;;;;;AAYaA,W,OADZC,kB;;;;;;;;;;;;;;;;;;AAmBSC,IAAAA,yB;;AAEG,Q;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDHC,IAAAA,kB,GAAqB,UAACC,KAAD,EAAkB;AAC7C,UAAI,MAAKC,KAAL,CAAWC,cAAf,EAA+B;AAC7B,cAAKD,KAAL,CAAWC,cAAX,CAA0BF,KAA1B;AACD;AACF,K;;AAEOG,IAAAA,oB,GAAuB,UAACH,KAAD,EAAkB;AAC/C,UAAMI,MAAM,GAAGJ,KAAK,CAACI,MAAN,IAAgBJ,KAAK,CAACK,UAArC;AACA,UAAMC,IAAI,GAAG,2EAAqB,2BAAY,MAAKL,KAAL,CAAWM,gBAAvB,oBAAY,MAAKN,KAAL,CAAWM,gBAAX,EAAZ,CAAlC;;AAEA,UAAI,CAACD,IAAD,IAAUF,MAAM,YAAYI,OAAlB,IAA6B,yDAAgCJ,MAAhC,EAAwCE,IAAxC,CAA3C,EAA2F;AACzF;AACD;;AAED,UAAI,MAAKL,KAAL,C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C,CAClC,KAAKA,yBAAL,CAA+B6B,MAA/B,GACA,KAAK7B,yBAAL,GAAiC,IAAjC,CACD,CAEDyB,MAAM,CAACK,mBAAP,CAA2B,MAA3B,EAAmC,KAAK7B,kBAAxC,EACA0B,QAAQ,CAACG,mBAAT,CACE,kBAAkBH,QAAQ,CAACC,eAA3B,GAA6C,YAA7C,GAA4D,WAD9D,EAEE,KAAKvB,oBAFP,EAID,C,sBA1E8BgB,eAAMU,S,WACvBC,mB,GAAsB,a,UAEtBC,S,GAAY,EACxBpB,MADwB,kBACjBV,KADiB,EACQ+B,QADR,EAC0CC,aAD1C,EACiE,CACvF,IAAQtB,MAAR,GAAmDV,KAAnD,CAAQU,MAAR,CAAgBF,cAAhB,GAAmDR,KAAnD,CAAgBQ,cAAhB,CAAgCP,cAAhC,GAAmDD,KAAnD,CAAgCC,cAAhC,CACA,IAAIS,MAAM,IAAI,EAAEF,cAAc,IAAIP,cAApB,CAAd,EAAmD,CACjD,OAAO,IAAIgC,KAAJ,OACDD,aADC,uGAAP,CAGD,CACF,CARuB,E,UAWZE,Y,GAAe,EAC3BxB,MAAM,EAAE,IADmB,E","sourcesContent":["import React from 'react';\n\nimport { listen as listenFocusOutside, containsTargetOrRenderContainer } from '../../lib/listenFocusOutside';\nimport { CommonProps, CommonWrapper } from '../CommonWrapper';\nimport { getRootNode, rootNode, TSetRootNode } from '../../lib/rootNode';\nimport { Nullable } from '../../typings/utility-types';\n\nexport interface RenderLayerProps extends CommonProps {\n children: JSX.Element;\n onClickOutside?: (e: Event) => void;\n onFocusOutside?: (e: Event) => void;\n active?: boolean;\n getAnchorElement?: () => Nullable<HTMLElement>;\n}\n\n@rootNode\nexport class RenderLayer extends React.Component<RenderLayerProps> {\n public static __KONTUR_REACT_UI__ = 'RenderLayer';\n\n public static propTypes = {\n active(props: RenderLayerProps, propName: keyof RenderLayerProps, componentName: string) {\n const { active, onClickOutside, onFocusOutside } = props;\n if (active && !(onClickOutside || onFocusOutside)) {\n return new Error(\n `[${componentName}]: using the component without either 'onClickOutside' or 'onFocusOutside' callback is pointless.`,\n );\n }\n },\n };\n\n public static defaultProps = {\n active: true,\n };\n\n private focusOutsideListenerToken: {\n remove: () => void;\n } | null = null;\n private setRootNode!: TSetRootNode;\n\n public componentDidMount() {\n if (this.props.active) {\n this.attachListeners();\n }\n }\n\n public componentDidUpdate(prevProps: RenderLayerProps) {\n if (!prevProps.active && this.props.active) {\n this.attachListeners();\n }\n if (prevProps.active && !this.props.active) {\n this.detachListeners();\n }\n }\n\n public componentWillUnmount() {\n if (this.props.active) {\n this.detachListeners();\n }\n }\n\n public render() {\n return (\n <CommonWrapper rootNodeRef={this.setRootNode} {...this.props}>\n {React.Children.only(this.props.children)}\n </CommonWrapper>\n );\n }\n\n private attachListeners() {\n const rootNode = getRootNode(this) || this.props.getAnchorElement?.();\n if (!rootNode) return;\n this.focusOutsideListenerToken = listenFocusOutside(() => [rootNode], this.handleFocusOutside);\n window.addEventListener('blur', this.handleFocusOutside);\n document.addEventListener(\n 'ontouchstart' in document.documentElement ? 'touchstart' : 'mousedown',\n this.handleNativeDocClick,\n );\n }\n\n private detachListeners() {\n if (this.focusOutsideListenerToken) {\n this.focusOutsideListenerToken.remove();\n this.focusOutsideListenerToken = null;\n }\n\n window.removeEventListener('blur', this.handleFocusOutside);\n document.removeEventListener(\n 'ontouchstart' in document.documentElement ? 'touchstart' : 'mousedown',\n this.handleNativeDocClick,\n );\n }\n\n private handleFocusOutside = (event: Event) => {\n if (this.props.onFocusOutside) {\n this.props.onFocusOutside(event);\n }\n };\n\n private handleNativeDocClick = (event: Event) => {\n const target = event.target || event.srcElement;\n const node = getRootNode(this) || getRootNode(this.props.getAnchorElement?.());\n\n if (!node || (target instanceof Element && containsTargetOrRenderContainer(target)(node))) {\n return;\n }\n\n if (this.props.onClickOutside) {\n this.props.onClickOutside(event);\n }\n };\n}\n"]}
1
+ {"version":3,"sources":["RenderLayer.tsx"],"names":["RenderLayer","rootNode","focusOutsideListenerToken","handleFocusOutside","event","props","onFocusOutside","handleNativeDocClick","target","srcElement","node","getAnchorElement","Element","onClickOutside","componentDidMount","active","attachListeners","componentDidUpdate","prevProps","detachListeners","componentWillUnmount","render","setRootNode","React","Children","only","children","window","addEventListener","document","documentElement","remove","removeEventListener","Component","__KONTUR_REACT_UI__","propTypes","propName","componentName","Error","defaultProps"],"mappings":"ubAAA;;AAEA;AACA;AACA,8C;;;;;;;;;;;;AAYaA,W,OADZC,kB;;;;;;;;;;;;;;;;;;AAmBSC,IAAAA,yB;;AAEG,Q;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DHC,IAAAA,kB,GAAqB,UAACC,KAAD,EAAkB;AAC7C,UAAI,MAAKC,KAAL,CAAWC,cAAf,EAA+B;AAC7B,cAAKD,KAAL,CAAWC,cAAX,CAA0BF,KAA1B;AACD;AACF,K;;AAEOG,IAAAA,oB,GAAuB,UAACH,KAAD,EAAkB;AAC/C,UAAMI,MAAM,GAAGJ,KAAK,CAACI,MAAN,IAAgBJ,KAAK,CAACK,UAArC;AACA,UAAMC,IAAI,GAAG,2EAAqB,2BAAY,MAAKL,KAAL,CAAWM,gBAAvB,oBAAY,MAAKN,KAAL,CAAWM,gBAAX,EAAZ,CAAlC;;AAEA,UAAI,CAACD,IAAD,IAAUF,MAAM,YAAYI,OAAlB,IAA6B,yDAAgCJ,MAAhC,EAAwCE,IAAxC,CAA3C,EAA2F;AACzF;AACD;;AAED,UAAI,MAAKL,KAAL,CAAWQ,cAAf,EAA+B;AAC7B,cAAKR,KAAL,CAAWQ,cAAX,CAA0BT,KAA1B;AACD;AACF,K,yDAzEMU,iB,GAAP,6BAA2B,CACzB,IAAI,KAAKT,KAAL,CAAWU,MAAf,EAAuB,CACrB,KAAKC,eAAL,GACD,CACF,C,QAEMC,kB,GAAP,4BAA0BC,SAA1B,EAAuD,CACrD,IAAI,CAACA,SAAS,CAACH,MAAX,IAAqB,KAAKV,KAAL,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B,eAAMU,S,WACvBC,mB,GAAsB,a,UAEtBC,S,GAAY,EACxBpB,MADwB,kBACjBV,KADiB,EACQ+B,QADR,EAC0CC,aAD1C,EACiE,CACvF,IAAQtB,MAAR,GAAmDV,KAAnD,CAAQU,MAAR,CAAgBF,cAAhB,GAAmDR,KAAnD,CAAgBQ,cAAhB,CAAgCP,cAAhC,GAAmDD,KAAnD,CAAgCC,cAAhC,CACA,IAAIS,MAAM,IAAI,EAAEF,cAAc,IAAIP,cAApB,CAAd,EAAmD,CACjD,OAAO,IAAIgC,KAAJ,OACDD,aADC,uGAAP,CAGD,CACF,CARuB,E,UAWZE,Y,GAAe,EAC3BxB,MAAM,EAAE,IADmB,E","sourcesContent":["import React from 'react';\n\nimport { listen as listenFocusOutside, containsTargetOrRenderContainer } from '../../lib/listenFocusOutside';\nimport { CommonProps, CommonWrapper } from '../CommonWrapper';\nimport { getRootNode, rootNode, TSetRootNode } from '../../lib/rootNode';\nimport { Nullable } from '../../typings/utility-types';\n\nexport interface RenderLayerProps extends CommonProps {\n children: JSX.Element;\n onClickOutside?: (e: Event) => void;\n onFocusOutside?: (e: Event) => void;\n active?: boolean;\n getAnchorElement?: () => Nullable<HTMLElement>;\n}\n\n@rootNode\nexport class RenderLayer extends React.Component<RenderLayerProps> {\n public static __KONTUR_REACT_UI__ = 'RenderLayer';\n\n public static propTypes = {\n active(props: RenderLayerProps, propName: keyof RenderLayerProps, componentName: string) {\n const { active, onClickOutside, onFocusOutside } = props;\n if (active && !(onClickOutside || onFocusOutside)) {\n return new Error(\n `[${componentName}]: using the component without either 'onClickOutside' or 'onFocusOutside' callback is pointless.`,\n );\n }\n },\n };\n\n public static defaultProps = {\n active: true,\n };\n\n private focusOutsideListenerToken: {\n remove: () => void;\n } | null = null;\n private setRootNode!: TSetRootNode;\n\n public componentDidMount() {\n if (this.props.active) {\n this.attachListeners();\n }\n }\n\n public componentDidUpdate(prevProps: RenderLayerProps) {\n if (!prevProps.active && this.props.active) {\n this.attachListeners();\n }\n if (prevProps.active && !this.props.active) {\n this.detachListeners();\n }\n }\n\n public componentWillUnmount() {\n if (this.props.active) {\n this.detachListeners();\n }\n }\n\n public render() {\n return (\n <CommonWrapper rootNodeRef={this.setRootNode} {...this.props}>\n {React.Children.only(this.props.children)}\n </CommonWrapper>\n );\n }\n\n private attachListeners() {\n const rootNode = getRootNode(this) || this.props.getAnchorElement?.();\n if (!rootNode) {\n return;\n }\n\n this.focusOutsideListenerToken = listenFocusOutside(() => [rootNode], this.handleFocusOutside);\n window.addEventListener('blur', this.handleFocusOutside);\n document.addEventListener(\n 'ontouchstart' in document.documentElement ? 'touchstart' : 'mousedown',\n this.handleNativeDocClick,\n );\n }\n\n private detachListeners() {\n if (this.focusOutsideListenerToken) {\n this.focusOutsideListenerToken.remove();\n this.focusOutsideListenerToken = null;\n }\n\n window.removeEventListener('blur', this.handleFocusOutside);\n document.removeEventListener(\n 'ontouchstart' in document.documentElement ? 'touchstart' : 'mousedown',\n this.handleNativeDocClick,\n );\n }\n\n private handleFocusOutside = (event: Event) => {\n if (this.props.onFocusOutside) {\n this.props.onFocusOutside(event);\n }\n };\n\n private handleNativeDocClick = (event: Event) => {\n const target = event.target || event.srcElement;\n const node = getRootNode(this) || getRootNode(this.props.getAnchorElement?.());\n\n if (!node || (target instanceof Element && containsTargetOrRenderContainer(target)(node))) {\n return;\n }\n\n if (this.props.onClickOutside) {\n this.props.onClickOutside(event);\n }\n };\n}\n"]}
@@ -4,6 +4,7 @@ var _ThemeFactory = require("../../lib/theming/ThemeFactory");
4
4
 
5
5
  var _Gapped = require("../../components/Gapped");
6
6
  var _Loader = require("../../components/Loader");
7
+ var _utils = require("../../lib/utils");
7
8
 
8
9
  var _VariableValue = require("./VariableValue");
9
10
  var _constants = require("./constants");
@@ -151,7 +152,10 @@ var prefixesReducer = function prefixesReducer(acc, current) {
151
152
 
152
153
 
153
154
  var getBaseVariables = function getBaseVariables(theme, variable) {
154
- for (; theme != null; theme = Object.getPrototypeOf(theme)) {
155
+ // TODO: Rewrite for loop.
156
+ // TODO: Enable `no-param-reassign` rule.
157
+ // eslint-disable-next-line no-param-reassign
158
+ for (; (0, _utils.isNonNullable)(theme); theme = Object.getPrototypeOf(theme)) {
155
159
  if (Object.prototype.hasOwnProperty.call(theme, variable)) {
156
160
  var descriptor = Object.getOwnPropertyDescriptor(theme, variable);
157
161
 
@@ -163,5 +167,6 @@ var getBaseVariables = function getBaseVariables(theme, variable) {
163
167
  break;
164
168
  }
165
169
  }
170
+
166
171
  return [];
167
172
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["ThemeEditor.tsx"],"names":["ThemeEditor","state","groups","isLoading","renderGroups","props","editingTheme","currentTheme","currentErrors","onValueChange","keys","ThemeFactory","getKeys","filter","key","isDeprecatedVariable","map","i","title","isCommon","isCommonVariable","bind","reduce","prefixesReducer","isGroupVariable","prefix","DEPRECATED_VARIABLES","length","render","styles","loaderWrapper","loader","componentDidMount","updateTimeout","window","setTimeout","setState","VARIABLES_GROUPS","componentWillUnmount","clearTimeout","React","Component","Group","variables","editorGroupHeader","variable","value","isError","getBaseVariables","name","includes","splitPrefix","split","item","startsWith","trim","prefixes","acc","current","theme","Object","getPrototypeOf","prototype","hasOwnProperty","call","descriptor","getOwnPropertyDescriptor","get","getterBody","toString","variableNameMatchArray","match","v","replace"],"mappings":"uPAAA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA,iD;;;;;;;;;;;;;;;;;AAiBaA,W;AACJC,IAAAA,K,GAAQ;AACbC,MAAAA,MAAM,EAAE,EADK;AAEbC,MAAAA,SAAS,EAAE,IAFE,E;;;;;;;;;;;;;;;;;;;;;;;;AA0BPC,IAAAA,Y,GAAe,YAAM;AAC3B,wBAAqE,MAAKC,KAA1E,CAAQC,YAAR,eAAQA,YAAR,CAAsBC,YAAtB,eAAsBA,YAAtB,CAAoCC,aAApC,eAAoCA,aAApC,CAAmDC,aAAnD,eAAmDA,aAAnD;AACA,UAAMC,IAAI,GAAGC,2BAAaC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AgB,GAAG,SAAnBA,gBAAmB,CAACW,KAAD,EAAed,QAAf,EAAqE;AAC5F,SAAOc,KAAK,IAAI,IAAhB,EAAsBA,KAAK,GAAGC,MAAM,CAACC,cAAP,CAAsBF,KAAtB,CAA9B,EAA4D;AAC1D,QAAIC,MAAM,CAACE,SAAP,CAAiBC,cAAjB,CAAgCC,IAAhC,CAAqCL,KAArC,EAA4Cd,QAA5C,CAAJ,EAA2D;AACzD,UAAMoB,UAAU,GAAGL,MAAM,CAACM,wBAAP,CAAgCP,KAAhC,EAAuCd,QAAvC,CAAnB;;AAEA,UAAIoB,UAAU,IAAI,OAAOA,UAAU,CAACE,GAAlB,KAA0B,WAA5C,EAAyD;AACvD,YAAMC,UAAU,GAAGH,UAAU,CAACE,GAAX,CAAeE,QAAf,EAAnB;AACA,YAAMC,sBAAsB,GAAGF,UAAU,CAACG,KAAX,CAAiB,iBAAjB,KAAuC,EAAtE;AACA,eAAO,CAACD,sBAAsB,IAAI,EAA3B,EAA+BtD,GAA/B,CAAmC,UAACwD,CAAD,UAAOA,CAAC,CAACC,OAAF,CAAU,SAAV,EAAqB,EAArB,CAAP,EAAnC,CAAP;AACD;AACD;AACD;AACF;AACD,SAAO,EAAP;AACD,CAdD","sourcesContent":["import React from 'react';\n\nimport { ThemeFactory } from '../../lib/theming/ThemeFactory';\nimport { Theme } from '../../lib/theming/Theme';\nimport { Gapped } from '../../components/Gapped';\nimport { Loader } from '../../components/Loader';\n\nimport { VariableValue } from './VariableValue';\nimport { VARIABLES_GROUPS, DEPRECATED_VARIABLES } from './constants';\nimport { ThemeErrorsType } from './ThemeContextPlayground';\nimport { styles } from './Playground.styles';\n\ninterface ThemeEditorProps {\n editingTheme: Theme;\n currentTheme: Theme;\n currentErrors: ThemeErrorsType;\n onValueChange: (variable: keyof Theme, value: string) => void;\n}\ninterface ThemeEditorState {\n groups: Group[];\n isLoading: boolean;\n}\ninterface Group {\n title: string;\n prefix: string;\n isCommon?: boolean;\n}\nexport class ThemeEditor extends React.Component<ThemeEditorProps, ThemeEditorState> {\n public state = {\n groups: [],\n isLoading: true,\n };\n private updateTimeout?: number;\n\n public render() {\n return this.state.isLoading ? (\n <div className={styles.loaderWrapper()}>\n <Loader type=\"big\" active className={styles.loader()} />\n </div>\n ) : (\n this.renderGroups()\n );\n }\n\n public componentDidMount() {\n this.updateTimeout = window.setTimeout(() => {\n this.setState({ groups: VARIABLES_GROUPS, isLoading: false });\n }, 500);\n }\n\n public componentWillUnmount(): void {\n clearTimeout(this.updateTimeout);\n }\n\n private renderGroups = () => {\n const { editingTheme, currentTheme, currentErrors, onValueChange } = this.props;\n const keys = ThemeFactory.getKeys(editingTheme).filter((key) => !isDeprecatedVariable(key));\n\n return (\n <Gapped vertical>\n {this.state.groups.map((i: Group) => (\n <Group\n editingTheme={editingTheme}\n currentTheme={currentTheme}\n currentErrors={currentErrors}\n onValueChange={onValueChange}\n title={i.title}\n variables={keys.filter(\n i.isCommon\n ? isCommonVariable.bind(null, this.state.groups.reduce(prefixesReducer, []))\n : isGroupVariable.bind(null, i.prefix),\n )}\n key={i.title}\n />\n ))}\n {DEPRECATED_VARIABLES.length > 0 ? (\n <Group\n editingTheme={editingTheme}\n currentTheme={currentTheme}\n currentErrors={currentErrors}\n onValueChange={onValueChange}\n title={'Deprecated Variables'}\n variables={DEPRECATED_VARIABLES}\n />\n ) : null}\n </Gapped>\n );\n };\n}\n\ninterface GroupProps {\n editingTheme: Theme;\n currentTheme: Theme;\n currentErrors: ThemeErrorsType;\n title: string;\n variables: Array<keyof Theme>;\n onValueChange: (variable: keyof Theme, value: string) => void;\n}\nconst Group = (props: GroupProps) => {\n const { editingTheme, currentTheme, currentErrors, onValueChange, title, variables } = props;\n\n return variables.length > 0 ? (\n <React.Fragment>\n <h2 className={styles.editorGroupHeader(currentTheme)}>{title}</h2>\n {variables.map((variable) => {\n const value = editingTheme[variable] as string;\n const isError = currentErrors[variable];\n return (\n <VariableValue\n theme={currentTheme}\n onChange={onValueChange}\n value={value}\n isError={isError || false}\n variable={variable}\n key={variable}\n baseVariables={getBaseVariables(editingTheme, variable)}\n deprecated={isDeprecatedVariable(variable)}\n />\n );\n })}\n </React.Fragment>\n ) : null;\n};\n\nconst isDeprecatedVariable = (name: keyof Theme) => {\n return DEPRECATED_VARIABLES.includes(name);\n};\n\nconst isGroupVariable = (prefix: string, name: string) => {\n const splitPrefix = prefix.split(' ') || [];\n\n for (const item of splitPrefix) {\n if (name.startsWith(item.trim())) {\n return true;\n }\n }\n return false;\n};\nconst isCommonVariable = (prefixes: string[], name: string) => {\n for (const item of prefixes) {\n if (name.startsWith(item.trim())) {\n return false;\n }\n }\n return true;\n};\nconst prefixesReducer = (acc: string[], current: { title: string; prefix: string }): string[] => {\n const splitPrefix = current.prefix.split(' ');\n return [...acc, ...splitPrefix];\n};\n\ntype GetBaseVariablesReturnType = Array<keyof Theme>;\nconst getBaseVariables = (theme: Theme, variable: keyof Theme): GetBaseVariablesReturnType => {\n for (; theme != null; theme = Object.getPrototypeOf(theme)) {\n if (Object.prototype.hasOwnProperty.call(theme, variable)) {\n const descriptor = Object.getOwnPropertyDescriptor(theme, variable);\n\n if (descriptor && typeof descriptor.get !== 'undefined') {\n const getterBody = descriptor.get.toString();\n const variableNameMatchArray = getterBody.match(/this\\.(\\w+)\\b/gm) || [];\n return (variableNameMatchArray || []).map((v) => v.replace(/this\\./g, '')) as GetBaseVariablesReturnType;\n }\n break;\n }\n }\n return [];\n};\n"]}
1
+ {"version":3,"sources":["ThemeEditor.tsx"],"names":["ThemeEditor","state","groups","isLoading","renderGroups","props","editingTheme","currentTheme","currentErrors","onValueChange","keys","ThemeFactory","getKeys","filter","key","isDeprecatedVariable","map","i","title","isCommon","isCommonVariable","bind","reduce","prefixesReducer","isGroupVariable","prefix","DEPRECATED_VARIABLES","length","render","styles","loaderWrapper","loader","componentDidMount","updateTimeout","window","setTimeout","setState","VARIABLES_GROUPS","componentWillUnmount","clearTimeout","React","Component","Group","variables","editorGroupHeader","variable","value","isError","getBaseVariables","name","includes","splitPrefix","split","item","startsWith","trim","prefixes","acc","current","theme","Object","getPrototypeOf","prototype","hasOwnProperty","call","descriptor","getOwnPropertyDescriptor","get","getterBody","toString","variableNameMatchArray","match","v","replace"],"mappings":"uPAAA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,iD;;;;;;;;;;;;;;;;;AAiBaA,W;AACJC,IAAAA,K,GAAQ;AACbC,MAAAA,MAAM,EAAE,EADK;AAEbC,MAAAA,SAAS,EAAE,IAFE,E;;;;;;;;;;;;;;;;;;;;;;;;AA0BPC,IAAAA,Y,GAAe,YAAM;AAC3B,wBAAqE,MAAKC,KAA1E,CAAQC,YAAR,eAAQA,YAAR,CAAsBC,YAAtB,eAAsBA,YAAtB,CAAoCC,aAApC,eAAoCA,aAApC,CAAmDC,aAAnD,eAAmDA,aAAnD;AACA,UAAMC,IAAI,GAAGC,2BAAaC,OAAb,CAAqBN,YAArB,EAAmCO,MAAnC,CAA0C,UAACC,GAAD,UAAS,CAACC,oBAAoB,CAACD,GAAD,CAA9B,EAA1C,CAAb;;AAEA;AACE,qCAAC,cAAD,IAAQ,QAAQ,MAAhB;AACG,cAAKb,KAAL,CAAWC,MAAX,CAAkBc,GAAlB,CAAsB,UAACC,CAAD;AACrB,yCAAC,KAAD;AACE,cAAA,YAAY,EAAEX,YADhB;AAEE,cAAA,YAAY,EAAEC,YAFhB;AAGE,cAAA,aAAa,EAAEC,aAHjB;AAIE,cAAA,aAAa,EAAEC,aAJjB;AAKE,cAAA,KAAK,EAAEQ,CAAC,CAACC,KALX;AAME,cAAA,SAAS,EAAER,IAAI,CAACG,MAAL;AACTI,cAAAA,CAAC,CAACE,QAAF;AACIC,cAAAA,gBAAgB,CAACC,IAAjB,CAAsB,IAAtB,EAA4B,MAAKpB,KAAL,CAAWC,MAAX,CAAkBoB,MAAlB,CAAyBC,eAAzB,EAA0C,EAA1C,CAA5B,CADJ;AAEIC,cAAAA,eAAe,CAACH,IAAhB,CAAq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,CAAC,CAACC,OAAF,CAAU,SAAV,EAAqB,EAArB,CAAP,EAAnC,CAAP;AACD;AACD;AACD;AACF;;AAED,SAAO,EAAP;AACD,CAlBD","sourcesContent":["import React from 'react';\n\nimport { ThemeFactory } from '../../lib/theming/ThemeFactory';\nimport { Theme } from '../../lib/theming/Theme';\nimport { Gapped } from '../../components/Gapped';\nimport { Loader } from '../../components/Loader';\nimport { isNonNullable } from '../../lib/utils';\n\nimport { VariableValue } from './VariableValue';\nimport { VARIABLES_GROUPS, DEPRECATED_VARIABLES } from './constants';\nimport { ThemeErrorsType } from './ThemeContextPlayground';\nimport { styles } from './Playground.styles';\n\ninterface ThemeEditorProps {\n editingTheme: Theme;\n currentTheme: Theme;\n currentErrors: ThemeErrorsType;\n onValueChange: (variable: keyof Theme, value: string) => void;\n}\ninterface ThemeEditorState {\n groups: Group[];\n isLoading: boolean;\n}\ninterface Group {\n title: string;\n prefix: string;\n isCommon?: boolean;\n}\nexport class ThemeEditor extends React.Component<ThemeEditorProps, ThemeEditorState> {\n public state = {\n groups: [],\n isLoading: true,\n };\n private updateTimeout?: number;\n\n public render() {\n return this.state.isLoading ? (\n <div className={styles.loaderWrapper()}>\n <Loader type=\"big\" active className={styles.loader()} />\n </div>\n ) : (\n this.renderGroups()\n );\n }\n\n public componentDidMount() {\n this.updateTimeout = window.setTimeout(() => {\n this.setState({ groups: VARIABLES_GROUPS, isLoading: false });\n }, 500);\n }\n\n public componentWillUnmount(): void {\n clearTimeout(this.updateTimeout);\n }\n\n private renderGroups = () => {\n const { editingTheme, currentTheme, currentErrors, onValueChange } = this.props;\n const keys = ThemeFactory.getKeys(editingTheme).filter((key) => !isDeprecatedVariable(key));\n\n return (\n <Gapped vertical>\n {this.state.groups.map((i: Group) => (\n <Group\n editingTheme={editingTheme}\n currentTheme={currentTheme}\n currentErrors={currentErrors}\n onValueChange={onValueChange}\n title={i.title}\n variables={keys.filter(\n i.isCommon\n ? isCommonVariable.bind(null, this.state.groups.reduce(prefixesReducer, []))\n : isGroupVariable.bind(null, i.prefix),\n )}\n key={i.title}\n />\n ))}\n {DEPRECATED_VARIABLES.length > 0 ? (\n <Group\n editingTheme={editingTheme}\n currentTheme={currentTheme}\n currentErrors={currentErrors}\n onValueChange={onValueChange}\n title={'Deprecated Variables'}\n variables={DEPRECATED_VARIABLES}\n />\n ) : null}\n </Gapped>\n );\n };\n}\n\ninterface GroupProps {\n editingTheme: Theme;\n currentTheme: Theme;\n currentErrors: ThemeErrorsType;\n title: string;\n variables: Array<keyof Theme>;\n onValueChange: (variable: keyof Theme, value: string) => void;\n}\nconst Group = (props: GroupProps) => {\n const { editingTheme, currentTheme, currentErrors, onValueChange, title, variables } = props;\n\n return variables.length > 0 ? (\n <React.Fragment>\n <h2 className={styles.editorGroupHeader(currentTheme)}>{title}</h2>\n {variables.map((variable) => {\n const value = editingTheme[variable] as string;\n const isError = currentErrors[variable];\n return (\n <VariableValue\n theme={currentTheme}\n onChange={onValueChange}\n value={value}\n isError={isError || false}\n variable={variable}\n key={variable}\n baseVariables={getBaseVariables(editingTheme, variable)}\n deprecated={isDeprecatedVariable(variable)}\n />\n );\n })}\n </React.Fragment>\n ) : null;\n};\n\nconst isDeprecatedVariable = (name: keyof Theme) => {\n return DEPRECATED_VARIABLES.includes(name);\n};\n\nconst isGroupVariable = (prefix: string, name: string) => {\n const splitPrefix = prefix.split(' ') || [];\n\n for (const item of splitPrefix) {\n if (name.startsWith(item.trim())) {\n return true;\n }\n }\n return false;\n};\nconst isCommonVariable = (prefixes: string[], name: string) => {\n for (const item of prefixes) {\n if (name.startsWith(item.trim())) {\n return false;\n }\n }\n return true;\n};\nconst prefixesReducer = (acc: string[], current: { title: string; prefix: string }): string[] => {\n const splitPrefix = current.prefix.split(' ');\n return [...acc, ...splitPrefix];\n};\n\ntype GetBaseVariablesReturnType = Array<keyof Theme>;\nconst getBaseVariables = (theme: Theme, variable: keyof Theme): GetBaseVariablesReturnType => {\n // TODO: Rewrite for loop.\n // TODO: Enable `no-param-reassign` rule.\n // eslint-disable-next-line no-param-reassign\n for (; isNonNullable(theme); theme = Object.getPrototypeOf(theme)) {\n if (Object.prototype.hasOwnProperty.call(theme, variable)) {\n const descriptor = Object.getOwnPropertyDescriptor(theme, variable);\n\n if (descriptor && typeof descriptor.get !== 'undefined') {\n const getterBody = descriptor.get.toString();\n const variableNameMatchArray = getterBody.match(/this\\.(\\w+)\\b/gm) || [];\n return (variableNameMatchArray || []).map((v) => v.replace(/this\\./g, '')) as GetBaseVariablesReturnType;\n }\n break;\n }\n }\n\n return [];\n};\n"]}
@@ -3,6 +3,7 @@ var _Edit = _interopRequireDefault(require("@skbkontur/react-icons/Edit"));
3
3
  var _Delete = _interopRequireDefault(require("@skbkontur/react-icons/Delete"));
4
4
  var _eventemitter = _interopRequireDefault(require("eventemitter3"));
5
5
 
6
+ var _ColorHelpers = require("../../lib/styles/ColorHelpers");
6
7
  var _Input = require("../../components/Input");
7
8
  var _Gapped = require("../../components/Gapped");
8
9
 
@@ -193,7 +194,7 @@ VariableValue = /*#__PURE__*/function (_React$Component) {(0, _inheritsLoose2.de
193
194
  if (name === _this.props.variable && _this.rootElement) {
194
195
  _this.rootElement.focus();
195
196
  }
196
- };return _this;}var _proto = VariableValue.prototype;_proto.render = function render() {var _cx;var _this$props2 = this.props,variable = _this$props2.variable,theme = _this$props2.theme,baseVariables = _this$props2.baseVariables,deprecated = _this$props2.deprecated;return /*#__PURE__*/_react.default.createElement("div", { className: _Playground.styles.variable(theme), ref: this.rootRef, tabIndex: 0 }, /*#__PURE__*/_react.default.createElement("div", { className: (0, _Emotion.cx)(_Playground.styles.variableName(theme), (_cx = {}, _cx[_Playground.styles.deprecated()] = deprecated, _cx)), title: variable }, variable + ": "), baseVariables.length > 0 && !this.state.editing ? this.renderBaseVariableLink() : this.renderInputWrapper());};_proto.componentDidMount = function componentDidMount() {var _this2 = this;if (!this.subscription) {emitter.addListener('clicked', this.emitterEventHandler);this.subscription = { remove: function remove() {emitter.removeListener('clicked', _this2.emitterEventHandler);} };}};_proto.componentDidUpdate = function componentDidUpdate(prevProps) {if (prevProps.value !== this.props.value) {this.setState({ value: this.props.value });}};_proto.componentWillUnmount = function componentWillUnmount() {if (this.subscription) {this.subscription.remove();}if (this.debounceInterval !== undefined) {clearInterval(this.debounceInterval);}};_proto.renderInput = function renderInput() {return /*#__PURE__*/_react.default.createElement(_Input.Input, { leftIcon: isColor(this.state.value) && this.colorIcon(), value: this.state.value, onValueChange: this.handleChange, onBlur: this.handleBlur, align: 'right', width: this.state.editing ? 225 : 250, error: this.props.isError });};_proto.renderRollbackIcon = function renderRollbackIcon() {return /*#__PURE__*/_react.default.createElement(_Hint.Hint, { text: 'Вернуться к базовой переменной' }, /*#__PURE__*/_react.default.createElement("div", { className: _Playground.styles.linkRoot() }, /*#__PURE__*/_react.default.createElement(_Link.Link, { icon: /*#__PURE__*/_react.default.createElement(_Delete.default, null), onClick: this.rollbackToBaseVariable })));};return VariableValue;}(_react.default.Component);exports.VariableValue = VariableValue;VariableValue.defaultProps = { deprecated: false };var
197
+ };return _this;}var _proto = VariableValue.prototype;_proto.render = function render() {var _cx;var _this$props2 = this.props,variable = _this$props2.variable,theme = _this$props2.theme,baseVariables = _this$props2.baseVariables,deprecated = _this$props2.deprecated;return /*#__PURE__*/_react.default.createElement("div", { className: _Playground.styles.variable(theme), ref: this.rootRef, tabIndex: 0 }, /*#__PURE__*/_react.default.createElement("div", { className: (0, _Emotion.cx)(_Playground.styles.variableName(theme), (_cx = {}, _cx[_Playground.styles.deprecated()] = deprecated, _cx)), title: variable }, variable + ": "), baseVariables.length > 0 && !this.state.editing ? this.renderBaseVariableLink() : this.renderInputWrapper());};_proto.componentDidMount = function componentDidMount() {var _this2 = this;if (!this.subscription) {emitter.addListener('clicked', this.emitterEventHandler);this.subscription = { remove: function remove() {emitter.removeListener('clicked', _this2.emitterEventHandler);} };}};_proto.componentDidUpdate = function componentDidUpdate(prevProps) {if (prevProps.value !== this.props.value) {this.setState({ value: this.props.value });}};_proto.componentWillUnmount = function componentWillUnmount() {if (this.subscription) {this.subscription.remove();}if (this.debounceInterval !== undefined) {clearInterval(this.debounceInterval);}};_proto.renderInput = function renderInput() {return /*#__PURE__*/_react.default.createElement(_Input.Input, { leftIcon: isColorExtended(this.state.value) && this.colorIcon(), value: this.state.value, onValueChange: this.handleChange, onBlur: this.handleBlur, align: 'right', width: this.state.editing ? 225 : 250, error: this.props.isError });};_proto.renderRollbackIcon = function renderRollbackIcon() {return /*#__PURE__*/_react.default.createElement(_Hint.Hint, { text: 'Вернуться к базовой переменной' }, /*#__PURE__*/_react.default.createElement("div", { className: _Playground.styles.linkRoot() }, /*#__PURE__*/_react.default.createElement(_Link.Link, { icon: /*#__PURE__*/_react.default.createElement(_Delete.default, null), onClick: this.rollbackToBaseVariable })));};return VariableValue;}(_react.default.Component);exports.VariableValue = VariableValue;VariableValue.defaultProps = { deprecated: false };var
197
198
 
198
199
 
199
200
 
@@ -209,14 +210,25 @@ BaseVariableLink = /*#__PURE__*/function (_React$Component2) {(0, _inheritsLoose
209
210
  };return _this3;}var _proto2 = BaseVariableLink.prototype;_proto2.render = function render() {return /*#__PURE__*/_react.default.createElement(_Link.Link, { onClick: this.emitClickEvent }, this.props.baseVariable);};return BaseVariableLink;}(_react.default.Component);
210
211
 
211
212
 
212
- function isColor(color) {
213
+
214
+
215
+ var getColorValue = function getColorValue(color) {
213
216
  if ((0, _utils.isFunction)(color)) {
214
- color = color();
217
+ return color();
215
218
  }
219
+
220
+ return color;
221
+ };
222
+
223
+ function isColorExtended(color) {
224
+ var colorValue = getColorValue(color);
225
+
216
226
  var style = new Option().style;
217
- style.color = color;
227
+ style.color = colorValue;
218
228
 
219
- return (
220
- !!color && (color.startsWith('#') || color.startsWith('rgb') || color.startsWith('hsl') || style.color === color));
229
+ if (colorValue) {
230
+ return (0, _ColorHelpers.isColor)(colorValue) || style.color === colorValue;
231
+ }
221
232
 
233
+ return false;
222
234
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["VariableValue.tsx"],"names":["emitter","EventEmitter","VariableValue","state","value","props","editing","subscription","rootElement","debounceTimeout","debounceInterval","undefined","renderBaseVariableLink","baseVariables","styles","baseVariableRoot","colorIcon","baseLinkWrapper","textAlign","map","v","emitClickEvent","handleEditLinkClick","renderInputWrapper","renderInput","renderRollbackIcon","rootRef","instance","background","setState","rollbackToBaseVariable","variable","emit","handleChange","window","setInterval","debounceHandler","onChange","clearInterval","handleBlur","emitterEventHandler","name","focus","render","theme","deprecated","variableName","length","componentDidMount","addListener","remove","removeListener","componentDidUpdate","prevProps","componentWillUnmount","isColor","isError","linkRoot","React","Component","defaultProps","BaseVariableLink","baseVariable","color","style","Option","startsWith"],"mappings":"yPAAA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,IAAMA,OAAO,GAAG,IAAIC,qBAAJ,EAAhB,C;;;;;;;;;;;;;;;;;AAiBaC,a;;;;AAIJC,IAAAA,K,GAAQ;AACbC,MAAAA,KAAK,EAAE,MAAKC,KAAL,CAAWD,KADL;AAEbE,MAAAA,OAAO,EAAE,KAFI,E;;AAIPC,IAAAA,Y,GAA8C,I;AAC9CC,IAAAA,W,GAAkC,I;AACzBC,IAAAA,e,GAAkB,G;AAC3BC,IAAAA,gB,GAAuCC,S;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCvCC,IAAAA,sB,GAAyB,YAAM;AACrC,UAAMC,aAAa,GAAG,MAAKR,KAAL,CAAWQ,aAAjC;AACA;AACE,8CAAK,SAAS,EAAEC,mBAAOC,gBAAP,EAAhB;AACG,cAAKC,SAAL,EADH;AAEE,8CAAK,SAAS,EAAEF,mBAAOG,eAAP,EAAhB;AACE,qCAAC,cAAD;AACE,8CAAK,KAAK,EAAE,EAAEC,SAAS,EAAE,OAAb,EAAZ;AACE,qCAAC,cAAD,IAAQ,QAAQ,MAAhB;AACGL,QAAAA,aAAa,CAACM,GAAd,CAAkB,UAACC,CAA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pC,EAOE,KAAK,EAAE,KAAKD,KAAL,CAAWmD,OAPpB,GADF,CAWD,C,QAEO/B,kB,GAAR,8BAA6B,CAC3B,oBACE,6BAAC,UAAD,IAAM,IAAI,EAAE,gCAAZ,iBACE,sCAAK,SAAS,EAAEX,mBAAO2C,QAAP,EAAhB,iBACE,6BAAC,UAAD,IAAM,IAAI,eAAE,6BAAC,eAAD,OAAZ,EAA4B,OAAO,EAAE,KAAK3B,sBAA1C,GADF,CADF,CADF,CAOD,C,wBA5GgC4B,eAAMC,S,wCAA5BzD,a,CACG0D,Y,GAAe,EAC3Bf,UAAU,EAAE,KADe,E;;;;;;;AAyKzBgB,gB;;;;AAIIxC,IAAAA,c,GAAiB,YAAM;AAC7B,aAAKhB,KAAL,CAAWgB,cAAX,CAA0B,OAAKhB,KAAL,CAAWyD,YAArC;AACD,K,iEALMnB,M,GAAP,kBAAgB,CACd,oBAAO,6BAAC,UAAD,IAAM,OAAO,EAAE,KAAKtB,cAApB,IAAqC,KAAKhB,KAAL,CAAWyD,YAAhD,CAAP,CACD,C,2BAH4BJ,eAAMC,S;;;AASrC,SAASJ,OAAT,CAAiBQ,KAAjB,EAAiD;AAC/C,MAAI,uBAAWA,KAAX,CAAJ,EAAuB;AACrBA,IAAAA,KAAK,GAAGA,KAAK,EAAb;AACD;AACD,MAAMC,KAAK,GAAG,IAAIC,MAAJ,GAAaD,KAA3B;AACAA,EAAAA,KAAK,CAACD,KAAN,GAAcA,KAAd;;AAEA;AACE,KAAC,CAACA,KAAF,KAAYA,KAAK,CAACG,UAAN,CAAiB,GAAjB,KAAyBH,KAAK,CAACG,UAAN,CAAiB,KAAjB,CAAzB,IAAoDH,KAAK,CAACG,UAAN,CAAiB,KAAjB,CAApD,IAA+EF,KAAK,CAACD,KAAN,KAAgBA,KAA3G,CADF;;AAGD","sourcesContent":["import React from 'react';\nimport EditIcon from '@skbkontur/react-icons/Edit';\nimport DeleteIcon from '@skbkontur/react-icons/Delete';\nimport EventEmitter from 'eventemitter3';\n\nimport { Input } from '../../components/Input';\nimport { Gapped } from '../../components/Gapped';\nimport { Theme } from '../../lib/theming/Theme';\nimport { Link } from '../../components/Link';\nimport { Hint } from '../../components/Hint';\nimport { isFunction } from '../../lib/utils';\nimport { cx } from '../../lib/theming/Emotion';\n\nimport { styles } from './Playground.styles';\n\nconst emitter = new EventEmitter();\n\nexport interface VariableValueProps {\n onChange: (variable: keyof Theme, value: string) => void;\n value: string;\n isError: boolean;\n variable: string;\n theme: Theme;\n baseVariables: Array<keyof Theme>;\n deprecated: boolean;\n}\n\nexport interface VariableValueState {\n value: string;\n editing: boolean;\n}\n\nexport class VariableValue extends React.Component<VariableValueProps, VariableValueState> {\n public static defaultProps = {\n deprecated: false,\n };\n public state = {\n value: this.props.value,\n editing: false,\n };\n private subscription: { remove: () => void } | null = null;\n private rootElement: HTMLElement | null = null;\n private readonly debounceTimeout = 500;\n private debounceInterval: number | undefined = undefined;\n\n public render() {\n const { variable, theme, baseVariables, deprecated } = this.props;\n return (\n <div className={styles.variable(theme)} ref={this.rootRef} tabIndex={0}>\n <div\n className={cx(styles.variableName(theme), { [styles.deprecated()]: deprecated })}\n title={variable}\n >{`${variable}: `}</div>\n {baseVariables.length > 0 && !this.state.editing ? this.renderBaseVariableLink() : this.renderInputWrapper()}\n </div>\n );\n }\n\n public componentDidMount(): void {\n if (!this.subscription) {\n emitter.addListener('clicked', this.emitterEventHandler);\n this.subscription = {\n remove: () => {\n emitter.removeListener('clicked', this.emitterEventHandler);\n },\n };\n }\n }\n\n public componentDidUpdate(prevProps: VariableValueProps) {\n if (prevProps.value !== this.props.value) {\n this.setState({ value: this.props.value });\n }\n }\n\n public componentWillUnmount(): void {\n if (this.subscription) {\n this.subscription.remove();\n }\n if (this.debounceInterval !== undefined) {\n clearInterval(this.debounceInterval);\n }\n }\n\n private renderBaseVariableLink = () => {\n const baseVariables = this.props.baseVariables;\n return (\n <div className={styles.baseVariableRoot()}>\n {this.colorIcon()}\n <div className={styles.baseLinkWrapper()}>\n <Gapped>\n <div style={{ textAlign: 'right' }}>\n <Gapped vertical>\n {baseVariables.map((v) => (\n <BaseVariableLink key={v} baseVariable={v} emitClickEvent={this.emitClickEvent} />\n ))}\n </Gapped>\n </div>\n <Hint text={'Изменить значение'}>\n <Link icon={<EditIcon />} onClick={this.handleEditLinkClick} />\n </Hint>\n </Gapped>\n </div>\n </div>\n );\n };\n\n private renderInputWrapper = () => {\n return this.state.editing ? (\n <Gapped>\n {this.renderInput()}\n {this.renderRollbackIcon()}\n </Gapped>\n ) : (\n this.renderInput()\n );\n };\n\n private renderInput() {\n return (\n <Input\n leftIcon={isColor(this.state.value) && this.colorIcon()}\n value={this.state.value}\n onValueChange={this.handleChange}\n onBlur={this.handleBlur}\n align={'right'}\n width={this.state.editing ? 225 : 250}\n error={this.props.isError}\n />\n );\n }\n\n private renderRollbackIcon() {\n return (\n <Hint text={'Вернуться к базовой переменной'}>\n <div className={styles.linkRoot()}>\n <Link icon={<DeleteIcon />} onClick={this.rollbackToBaseVariable} />\n </div>\n </Hint>\n );\n }\n\n private rootRef = (instance: HTMLElement | null) => {\n this.rootElement = instance;\n };\n\n private colorIcon = () => {\n return <div className={styles.colorIcon()} style={{ background: this.state.value }} />;\n };\n\n private handleEditLinkClick = () => {\n this.setState({\n editing: true,\n });\n };\n\n private rollbackToBaseVariable = () => {\n this.setState({\n editing: false,\n value: this.props.value,\n });\n };\n\n private emitClickEvent = (variable: string | number) => {\n emitter.emit('clicked', variable);\n };\n\n private handleChange = (value: string) => {\n this.setState({\n value,\n });\n\n if (this.debounceInterval === undefined) {\n this.debounceInterval = window.setInterval(this.debounceHandler, this.debounceTimeout);\n }\n };\n\n private debounceHandler = () => {\n const { variable, onChange } = this.props;\n\n onChange(variable as keyof Theme, this.state.value);\n clearInterval(this.debounceInterval);\n this.debounceInterval = undefined;\n };\n\n private handleBlur = () => {\n this.setState({\n editing: false,\n });\n };\n\n private emitterEventHandler = (name: keyof Theme) => {\n if (name === this.props.variable && this.rootElement) {\n this.rootElement.focus();\n }\n };\n}\n\ninterface BaseVariableLinkProps {\n baseVariable: string | number;\n emitClickEvent: (baseVariable: string | number) => void;\n}\nclass BaseVariableLink extends React.Component<BaseVariableLinkProps> {\n public render() {\n return <Link onClick={this.emitClickEvent}>{this.props.baseVariable}</Link>;\n }\n private emitClickEvent = () => {\n this.props.emitClickEvent(this.props.baseVariable);\n };\n}\n\nfunction isColor(color: string | (() => string)) {\n if (isFunction(color)) {\n color = color();\n }\n const style = new Option().style;\n style.color = color;\n\n return (\n !!color && (color.startsWith('#') || color.startsWith('rgb') || color.startsWith('hsl') || style.color === color)\n );\n}\n"]}
1
+ {"version":3,"sources":["VariableValue.tsx"],"names":["emitter","EventEmitter","VariableValue","state","value","props","editing","subscription","rootElement","debounceTimeout","debounceInterval","undefined","renderBaseVariableLink","baseVariables","styles","baseVariableRoot","colorIcon","baseLinkWrapper","textAlign","map","v","emitClickEvent","handleEditLinkClick","renderInputWrapper","renderInput","renderRollbackIcon","rootRef","instance","background","setState","rollbackToBaseVariable","variable","emit","handleChange","window","setInterval","debounceHandler","onChange","clearInterval","handleBlur","emitterEventHandler","name","focus","render","theme","deprecated","variableName","length","componentDidMount","addListener","remove","removeListener","componentDidUpdate","prevProps","componentWillUnmount","isColorExtended","isError","linkRoot","React","Component","defaultProps","BaseVariableLink","baseVariable","getColorValue","color","colorValue","style","Option"],"mappings":"yPAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,IAAMA,OAAO,GAAG,IAAIC,qBAAJ,EAAhB,C;;;;;;;;;;;;;;;;;AAiBaC,a;;;;AAIJC,IAAAA,K,GAAQ;AACbC,MAAAA,KAAK,EAAE,MAAKC,KAAL,CAAWD,KADL;AAEbE,MAAAA,OAAO,EAAE,KAFI,E;;AAIPC,IAAAA,Y,GAA8C,I;AAC9CC,IAAAA,W,GAAkC,I;AACzBC,IAAAA,e,GAAkB,G;AAC3BC,IAAAA,gB,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,KAAK,EAAZ;AACD;;AAED,SAAOA,KAAP;AACD,CAND;;AAQA,SAAST,eAAT,CAAyBS,KAAzB,EAAuC;AACrC,MAAMC,UAAU,GAAGF,aAAa,CAACC,KAAD,CAAhC;;AAEA,MAAME,KAAK,GAAG,IAAIC,MAAJ,GAAaD,KAA3B;AACAA,EAAAA,KAAK,CAACF,KAAN,GAAcC,UAAd;;AAEA,MAAIA,UAAJ,EAAgB;AACd,WAAO,2BAAQA,UAAR,KAAuBC,KAAK,CAACF,KAAN,KAAgBC,UAA9C;AACD;;AAED,SAAO,KAAP;AACD","sourcesContent":["import React from 'react';\nimport EditIcon from '@skbkontur/react-icons/Edit';\nimport DeleteIcon from '@skbkontur/react-icons/Delete';\nimport EventEmitter from 'eventemitter3';\n\nimport { isColor } from '../../lib/styles/ColorHelpers';\nimport { Input } from '../../components/Input';\nimport { Gapped } from '../../components/Gapped';\nimport { Theme } from '../../lib/theming/Theme';\nimport { Link } from '../../components/Link';\nimport { Hint } from '../../components/Hint';\nimport { isFunction } from '../../lib/utils';\nimport { cx } from '../../lib/theming/Emotion';\n\nimport { styles } from './Playground.styles';\n\nconst emitter = new EventEmitter();\n\nexport interface VariableValueProps {\n onChange: (variable: keyof Theme, value: string) => void;\n value: string;\n isError: boolean;\n variable: string;\n theme: Theme;\n baseVariables: Array<keyof Theme>;\n deprecated: boolean;\n}\n\nexport interface VariableValueState {\n value: string;\n editing: boolean;\n}\n\nexport class VariableValue extends React.Component<VariableValueProps, VariableValueState> {\n public static defaultProps = {\n deprecated: false,\n };\n public state = {\n value: this.props.value,\n editing: false,\n };\n private subscription: { remove: () => void } | null = null;\n private rootElement: HTMLElement | null = null;\n private readonly debounceTimeout = 500;\n private debounceInterval: number | undefined = undefined;\n\n public render() {\n const { variable, theme, baseVariables, deprecated } = this.props;\n return (\n <div className={styles.variable(theme)} ref={this.rootRef} tabIndex={0}>\n <div\n className={cx(styles.variableName(theme), { [styles.deprecated()]: deprecated })}\n title={variable}\n >{`${variable}: `}</div>\n {baseVariables.length > 0 && !this.state.editing ? this.renderBaseVariableLink() : this.renderInputWrapper()}\n </div>\n );\n }\n\n public componentDidMount(): void {\n if (!this.subscription) {\n emitter.addListener('clicked', this.emitterEventHandler);\n this.subscription = {\n remove: () => {\n emitter.removeListener('clicked', this.emitterEventHandler);\n },\n };\n }\n }\n\n public componentDidUpdate(prevProps: VariableValueProps) {\n if (prevProps.value !== this.props.value) {\n this.setState({ value: this.props.value });\n }\n }\n\n public componentWillUnmount(): void {\n if (this.subscription) {\n this.subscription.remove();\n }\n if (this.debounceInterval !== undefined) {\n clearInterval(this.debounceInterval);\n }\n }\n\n private renderBaseVariableLink = () => {\n const baseVariables = this.props.baseVariables;\n return (\n <div className={styles.baseVariableRoot()}>\n {this.colorIcon()}\n <div className={styles.baseLinkWrapper()}>\n <Gapped>\n <div style={{ textAlign: 'right' }}>\n <Gapped vertical>\n {baseVariables.map((v) => (\n <BaseVariableLink key={v} baseVariable={v} emitClickEvent={this.emitClickEvent} />\n ))}\n </Gapped>\n </div>\n <Hint text={'Изменить значение'}>\n <Link icon={<EditIcon />} onClick={this.handleEditLinkClick} />\n </Hint>\n </Gapped>\n </div>\n </div>\n );\n };\n\n private renderInputWrapper = () => {\n return this.state.editing ? (\n <Gapped>\n {this.renderInput()}\n {this.renderRollbackIcon()}\n </Gapped>\n ) : (\n this.renderInput()\n );\n };\n\n private renderInput() {\n return (\n <Input\n leftIcon={isColorExtended(this.state.value) && this.colorIcon()}\n value={this.state.value}\n onValueChange={this.handleChange}\n onBlur={this.handleBlur}\n align={'right'}\n width={this.state.editing ? 225 : 250}\n error={this.props.isError}\n />\n );\n }\n\n private renderRollbackIcon() {\n return (\n <Hint text={'Вернуться к базовой переменной'}>\n <div className={styles.linkRoot()}>\n <Link icon={<DeleteIcon />} onClick={this.rollbackToBaseVariable} />\n </div>\n </Hint>\n );\n }\n\n private rootRef = (instance: HTMLElement | null) => {\n this.rootElement = instance;\n };\n\n private colorIcon = () => {\n return <div className={styles.colorIcon()} style={{ background: this.state.value }} />;\n };\n\n private handleEditLinkClick = () => {\n this.setState({\n editing: true,\n });\n };\n\n private rollbackToBaseVariable = () => {\n this.setState({\n editing: false,\n value: this.props.value,\n });\n };\n\n private emitClickEvent = (variable: string | number) => {\n emitter.emit('clicked', variable);\n };\n\n private handleChange = (value: string) => {\n this.setState({\n value,\n });\n\n if (this.debounceInterval === undefined) {\n this.debounceInterval = window.setInterval(this.debounceHandler, this.debounceTimeout);\n }\n };\n\n private debounceHandler = () => {\n const { variable, onChange } = this.props;\n\n onChange(variable as keyof Theme, this.state.value);\n clearInterval(this.debounceInterval);\n this.debounceInterval = undefined;\n };\n\n private handleBlur = () => {\n this.setState({\n editing: false,\n });\n };\n\n private emitterEventHandler = (name: keyof Theme) => {\n if (name === this.props.variable && this.rootElement) {\n this.rootElement.focus();\n }\n };\n}\n\ninterface BaseVariableLinkProps {\n baseVariable: string | number;\n emitClickEvent: (baseVariable: string | number) => void;\n}\nclass BaseVariableLink extends React.Component<BaseVariableLinkProps> {\n public render() {\n return <Link onClick={this.emitClickEvent}>{this.props.baseVariable}</Link>;\n }\n private emitClickEvent = () => {\n this.props.emitClickEvent(this.props.baseVariable);\n };\n}\n\ntype Color = string | (() => string);\n\nconst getColorValue = (color: Color) => {\n if (isFunction(color)) {\n return color();\n }\n\n return color;\n};\n\nfunction isColorExtended(color: Color) {\n const colorValue = getColorValue(color);\n\n const style = new Option().style;\n style.color = colorValue;\n\n if (colorValue) {\n return isColor(colorValue) || style.color === colorValue;\n }\n\n return false;\n}\n"]}
@@ -1,5 +1,6 @@
1
1
  "use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule = true;exports.ThemeShowcase = void 0;var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _react = _interopRequireDefault(require("react"));
2
2
 
3
+ var _ColorHelpers = require("../../lib/styles/ColorHelpers");
3
4
  var _DefaultTheme = require("../../lib/theming/themes/DefaultTheme");
4
5
  var _DarkTheme = require("../../lib/theming/themes/DarkTheme");
5
6
  var _ComboBox = require("../../components/ComboBox");
@@ -141,9 +142,9 @@ ThemeShowcase = /*#__PURE__*/function (_React$Component) {(0, _inheritsLoose2.de
141
142
  var values = _this.getValues(query);
142
143
  if (values.length > 0) {
143
144
  return values[0];
144
- } else {
145
- return _this.resetVariable();
146
145
  }
146
+
147
+ return _this.resetVariable();
147
148
  };_this.
148
149
  resetVariable = function () {
149
150
  if (!_this.isUnmounting) {
@@ -364,7 +365,7 @@ DependencyName = /*#__PURE__*/function (_React$Component5) {(0, _inheritsLoose2.
364
365
 
365
366
  var VariableValue = function VariableValue(props) {var _cx4;
366
367
  var value = props.value;
367
- var valueIsColor = isColor(value);
368
+ var valueIsColor = (0, _ColorHelpers.isColor)(value);
368
369
  var valueIsGradient = isGradient(value);
369
370
  var hasExample = valueIsColor || valueIsGradient;
370
371
  var borderColor = 'transparent';
@@ -398,10 +399,6 @@ var ShowUnusedVariables = function ShowUnusedVariables(props) {
398
399
 
399
400
  };
400
401
 
401
- function isColor(input) {
402
- return !!input && (input.startsWith('#') || input.startsWith('rgb') || input.startsWith('hsl'));
403
- }
404
-
405
402
  function isGradient(input) {
406
403
  return !!input && input.startsWith('linear-gradient');
407
404
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["ThemeShowcase.tsx"],"names":["EMPTY_ARRAY","ALL_VARIABLES","Object","keys","defaultVariables","ThemeShowcase","props","state","isUnmounting","variablesDiff","getItems","query","Promise","resolve","getValues","handleVariableChange","item","setState","selectedVariable","handleUnexpectedVariableInput","values","length","resetVariable","undefined","isDebugMode","forEach","variable","found","ALL_USED_VARIABLES","includes","push","render","IS_PROXY_SUPPORTED","descriptionsToRender","COMPONENT_DESCRIPTIONS_BY_VARIABLE","value","COMPONENT_DESCRIPTIONS","callsCount","CALLS_COUNT","executionTime","EXECUTION_TIME","toFixed","theme","styles","searchBar","sort","map","componentName","componentWillUnmount","lowerCaseQuery","toLowerCase","trim","allItems","filter","usedVariable","startsWith","usedVariableName","label","React","Component","ComponentShowcase","name","description","onVariableSelect","elements","isSticky","heading","headingSticky","table","headerCell","width","el","ComponentShowcaseRow","element","row","rowSpan","variables","invisibleRow","invisibleDarkRow","darkVariables","cell","majorCell","elementName","invisibleCell","varName","dependencies","variableDefault","variableDark","hasNoVariables","suspiciousRow","darkRow","VariableName","handleVariableSelect","variableName","renderDependencies","dependency","DependencyName","dependencyName","dependencyDefault","dependencyDark","handleDependencySelect","onDependencySelect","VariableValue","valueIsColor","isColor","valueIsGradient","isGradient","hasExample","borderColor","ColorFunctions","contrast","colorExample","background","ShowUnusedVariables","diff","unusedVariablesWarning","v","input"],"mappings":"yPAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;AASA,uD;;AAEA,IAAMA,WAAqB,GAAG,EAA9B;;AAEA,IAAMC,aAAa,GAAGC,MAAM,CAACC,IAAP,CAAYC,2BAAZ,CAAtB,C;;;;;;;;;AASaC,a;;;;;;AAMX,yBAAYC,KAAZ,EAAkC;AAChC,wCAAMA,KAAN,UADgC,MAL3BC,KAK2B,GALJ,EAKI,OAH1BC,YAG0B,GAHX,KAGW,OAF1BC,aAE0B,GAFA,EAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwF1BC,IAAAA,QAxF0B,GAwFf,UAACC,KAAD,EAAmB;AACpC,aAAOC,OAAO,CAACC,OAAR,CAAgB,MAAKC,SAAL,CAAeH,KAAf,CAAhB,CAAP;AACD,KA1FiC;AA2F1BI,IAAAA,oBA3F0B,GA2FH,UAACC,IAAD,EAAwB;AACrD,UAAI,CAAC,MAAKR,YAAV,EAAwB;AACtB,cAAKS,QAAL,CAAc,EAAEC,gBAAgB,EAAEF,IAApB,EAAd;AACD;AACF,KA/FiC;AAgG1BG,IAAAA,6BA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","sourcesContent":["import React from 'react';\n\nimport { DEFAULT_THEME as defaultVariables } from '../../lib/theming/themes/DefaultTheme';\nimport { DARK_THEME as darkVariables } from '../../lib/theming/themes/DarkTheme';\nimport { ComboBox, ComboBoxItem } from '../../components/ComboBox';\nimport { Gapped } from '../../components/Gapped';\nimport { Link } from '../../components/Link';\nimport { Sticky } from '../../components/Sticky';\nimport * as ColorFunctions from '../../lib/styles/ColorFunctions';\nimport { Tooltip } from '../../components/Tooltip';\nimport { IS_PROXY_SUPPORTED } from '../../lib/Supports';\nimport { Theme } from '../../lib/theming/Theme';\nimport { cx } from '../../lib/theming/Emotion';\nimport { ThemeContext } from '../../lib/theming/ThemeContext';\n\nimport {\n ALL_USED_VARIABLES,\n CALLS_COUNT,\n COMPONENT_DESCRIPTIONS,\n COMPONENT_DESCRIPTIONS_BY_VARIABLE,\n ComponentDescriptionType,\n ComponentRowDescriptionType,\n EXECUTION_TIME,\n} from './VariablesCollector';\nimport { styles } from './ThemeShowcase.styles';\n\nconst EMPTY_ARRAY: string[] = [];\n\nconst ALL_VARIABLES = Object.keys(defaultVariables) as Array<keyof Theme>;\n\ninterface ShowcaseProps {\n isDebugMode?: boolean;\n}\ninterface ShowcaseState {\n selectedVariable?: ComboBoxItem;\n}\n\nexport class ThemeShowcase extends React.Component<ShowcaseProps, ShowcaseState> {\n public state: ShowcaseState = {};\n\n private isUnmounting = false;\n private variablesDiff: string[] = [];\n\n constructor(props: ShowcaseProps) {\n super(props);\n if (props.isDebugMode) {\n ALL_VARIABLES.forEach((variable) => {\n const found = ALL_USED_VARIABLES.includes(variable);\n if (!found) {\n this.variablesDiff.push(variable);\n }\n });\n }\n }\n\n public render() {\n if (!IS_PROXY_SUPPORTED) {\n return (\n <div>\n Таблица использования переменных доступна только в{' '}\n <Link href={'https://caniuse.com/#feat=proxy'} target={'_blank'}>\n браузерах с поддержкой Proxy\n </Link>\n .\n </div>\n );\n }\n\n const selectedVariable = this.state.selectedVariable;\n const descriptionsToRender = selectedVariable\n ? COMPONENT_DESCRIPTIONS_BY_VARIABLE[selectedVariable.value] || {}\n : COMPONENT_DESCRIPTIONS;\n\n const isDebugMode = this.props.isDebugMode;\n const callsCount = isDebugMode ? `(${CALLS_COUNT} вызовов)` : '';\n const executionTime = isDebugMode ? `Сгенерировано за ${EXECUTION_TIME.toFixed(3)}ms` : '';\n\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n return (\n <Gapped wrap gap={30} verticalAlign={'top'}>\n <div>\n <Sticky side={'top'}>\n <div className={styles.searchBar(theme)} data-perf-info={`${executionTime} ${callsCount}`}>\n <Gapped gap={15}>\n <ComboBox\n getItems={this.getItems}\n value={selectedVariable}\n onValueChange={this.handleVariableChange}\n onUnexpectedInput={this.handleUnexpectedVariableInput}\n placeholder={'поиск по названию переменной'}\n />\n {!!selectedVariable && <Link onClick={this.resetVariable}>сбросить</Link>}\n </Gapped>\n </div>\n </Sticky>\n {Object.keys(descriptionsToRender)\n .sort()\n .map((componentName) => (\n <ComponentShowcase\n key={componentName}\n name={componentName}\n description={descriptionsToRender[componentName]}\n isDebugMode={isDebugMode}\n onVariableSelect={this.handleVariableChange}\n />\n ))}\n </div>\n <ShowUnusedVariables diff={this.variablesDiff} />\n </Gapped>\n );\n }}\n </ThemeContext.Consumer>\n );\n }\n public componentWillUnmount(): void {\n this.isUnmounting = true;\n }\n\n private getValues(query: string) {\n const lowerCaseQuery = query && query.toLowerCase().trim();\n let allItems = ALL_USED_VARIABLES;\n if (lowerCaseQuery) {\n allItems = ALL_USED_VARIABLES.filter((usedVariable) => usedVariable.toLowerCase().startsWith(lowerCaseQuery));\n }\n return allItems.map((usedVariableName) => ({\n value: usedVariableName,\n label: usedVariableName,\n }));\n }\n private getItems = (query: string) => {\n return Promise.resolve(this.getValues(query));\n };\n private handleVariableChange = (item: ComboBoxItem) => {\n if (!this.isUnmounting) {\n this.setState({ selectedVariable: item });\n }\n };\n private handleUnexpectedVariableInput = (query: string) => {\n const values = this.getValues(query);\n if (values.length > 0) {\n return values[0];\n } else {\n return this.resetVariable();\n }\n };\n private resetVariable = () => {\n if (!this.isUnmounting) {\n this.setState({ selectedVariable: undefined });\n }\n };\n}\n\ninterface ComponentShowcaseProps {\n name: string;\n description: ComponentDescriptionType;\n isDebugMode?: boolean;\n onVariableSelect: (item: ComboBoxItem) => void;\n}\nclass ComponentShowcase extends React.Component<ComponentShowcaseProps, {}> {\n public render() {\n const { name, description, onVariableSelect, isDebugMode } = this.props;\n const elements = Object.keys(description);\n\n return elements.length ? (\n <ThemeContext.Consumer>\n {(theme) => {\n return (\n <React.Fragment>\n <Sticky side={'top'} offset={40}>\n {(isSticky) => (\n <h2\n className={cx({\n [styles.heading(theme)]: true,\n [styles.headingSticky()]: isSticky,\n })}\n >\n {this.props.name}\n </h2>\n )}\n </Sticky>\n <table className={styles.table()}>\n <thead>\n <tr>\n <th className={styles.headerCell()} style={{ width: 170 }}>\n ClassName\n </th>\n <th className={styles.headerCell()} style={{ width: 210 }}>\n Variable Name\n </th>\n <th className={styles.headerCell()} style={{ width: 250 }}>\n Default Value\n </th>\n <th className={styles.headerCell()} style={{ width: 250 }}>\n Dark Value\n </th>\n </tr>\n </thead>\n <tbody>\n {elements.map((el) => (\n <ComponentShowcaseRow\n key={`${name}_${el}`}\n element={el}\n row={description[el]}\n onVariableSelect={onVariableSelect}\n isDebugMode={isDebugMode}\n />\n ))}\n </tbody>\n </table>\n </React.Fragment>\n );\n }}\n </ThemeContext.Consumer>\n ) : null;\n }\n}\n\ninterface ComponentShowcaseRowProps {\n element: string;\n row: ComponentRowDescriptionType;\n isDebugMode?: boolean;\n onVariableSelect: (item: ComboBoxItem) => void;\n}\n\nclass ComponentShowcaseRow extends React.Component<ComponentShowcaseRowProps> {\n public render() {\n const { element: el, row, isDebugMode } = this.props;\n const rowSpan = row.variables.length + 1;\n\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n return (\n <React.Fragment>\n <tr className={cx(styles.invisibleRow(), { [styles.invisibleDarkRow()]: theme === darkVariables })}>\n <td className={cx(styles.cell(), styles.majorCell())} rowSpan={rowSpan}>\n <span className={styles.elementName()}>.{el}</span>\n </td>\n <td className={styles.invisibleCell()} />\n <td className={styles.invisibleCell()} />\n <td className={styles.invisibleCell()} />\n </tr>\n {row.variables.map((varName) => {\n const dependencies = row.dependencies[varName] || EMPTY_ARRAY;\n const variableDefault = defaultVariables[varName] as string;\n const variableDark = darkVariables[varName] as string;\n const hasNoVariables = isDebugMode && !variableDefault;\n return (\n <tr\n key={`${el}_${varName}`}\n className={cx(styles.row(), {\n [styles.suspiciousRow()]: hasNoVariables,\n [styles.darkRow()]: theme === darkVariables,\n })}\n >\n <td className={styles.cell()}>\n <VariableName\n variableName={varName as string}\n dependencies={dependencies}\n onVariableSelect={this.props.onVariableSelect}\n />\n </td>\n <td className={styles.cell()}>\n <VariableValue value={variableDefault} />\n </td>\n <td className={styles.cell()}>\n <VariableValue value={variableDark} />\n </td>\n </tr>\n );\n })}\n </React.Fragment>\n );\n }}\n </ThemeContext.Consumer>\n );\n }\n}\n\ninterface VariableNameProps {\n variableName: string;\n dependencies: Array<keyof Theme>;\n onVariableSelect: (item: ComboBoxItem) => void;\n}\n\nclass VariableName extends React.Component<VariableNameProps> {\n public render() {\n return (\n <span>\n <span className={styles.variableName()} onClick={this.handleVariableSelect}>\n {this.props.variableName}\n </span>\n {this.props.dependencies.length > 0 && this.renderDependencies()}\n </span>\n );\n }\n\n private renderDependencies() {\n const { dependencies, onVariableSelect } = this.props;\n return (\n <React.Fragment>\n <br />\n <br />\n зависит от:\n {dependencies.map((dependency) => (\n <DependencyName\n key={`dependency_${dependency}`}\n dependencyName={dependency}\n onDependencySelect={onVariableSelect}\n />\n ))}\n </React.Fragment>\n );\n }\n\n private handleVariableSelect = () => {\n const { variableName, onVariableSelect } = this.props;\n if (onVariableSelect) {\n onVariableSelect({ value: variableName, label: variableName });\n }\n };\n}\n\ninterface DependencyNameProps {\n dependencyName: keyof Theme;\n onDependencySelect: (item: ComboBoxItem) => void;\n}\nclass DependencyName extends React.Component<DependencyNameProps> {\n public render() {\n return (\n <React.Fragment>\n <br />\n &ndash;{' '}\n <Tooltip trigger={'hover'} render={this.getValues} pos={'right middle'}>\n <span className={styles.variableName()} onClick={this.handleDependencySelect}>\n {this.props.dependencyName}\n </span>\n </Tooltip>\n </React.Fragment>\n );\n }\n\n private getValues = () => {\n const dependencyName = this.props.dependencyName;\n const dependencyDefault = defaultVariables[dependencyName] as string;\n const dependencyDark = darkVariables[dependencyName] as string;\n return (\n <React.Fragment>\n <span>Default value: {<VariableValue value={dependencyDefault} />}</span>\n <span>Dark value: {<VariableValue value={dependencyDark} />}</span>\n </React.Fragment>\n );\n };\n\n private handleDependencySelect = () => {\n const { dependencyName, onDependencySelect } = this.props;\n if (onDependencySelect) {\n onDependencySelect({ value: dependencyName, label: dependencyName });\n }\n };\n}\n\nconst VariableValue = (props: { value: string }) => {\n const value = props.value;\n const valueIsColor = isColor(value);\n const valueIsGradient = isGradient(value);\n const hasExample = valueIsColor || valueIsGradient;\n let borderColor = 'transparent';\n if (hasExample) {\n borderColor = valueIsColor ? ColorFunctions.contrast(value) : '#000';\n }\n\n return (\n <span className={cx({ [styles.undefined()]: !value })}>\n {hasExample && <span className={styles.colorExample()} style={{ background: value, borderColor }} />}\n {value || 'undefined'}\n </span>\n );\n};\n\nconst ShowUnusedVariables = (props: { diff: string[] }) => {\n if (props.diff.length === 0) {\n return null;\n }\n\n return (\n <div className={styles.unusedVariablesWarning()}>\n Неиспользованные переменные ({props.diff.length}\n ):\n <ul>\n {props.diff.sort().map((v) => (\n <li key={v}>{v}</li>\n ))}\n </ul>\n </div>\n );\n};\n\nfunction isColor(input: string) {\n return !!input && (input.startsWith('#') || input.startsWith('rgb') || input.startsWith('hsl'));\n}\n\nfunction isGradient(input: string) {\n return !!input && input.startsWith('linear-gradient');\n}\n"]}
1
+ {"version":3,"sources":["ThemeShowcase.tsx"],"names":["EMPTY_ARRAY","ALL_VARIABLES","Object","keys","defaultVariables","ThemeShowcase","props","state","isUnmounting","variablesDiff","getItems","query","Promise","resolve","getValues","handleVariableChange","item","setState","selectedVariable","handleUnexpectedVariableInput","values","length","resetVariable","undefined","isDebugMode","forEach","variable","found","ALL_USED_VARIABLES","includes","push","render","IS_PROXY_SUPPORTED","descriptionsToRender","COMPONENT_DESCRIPTIONS_BY_VARIABLE","value","COMPONENT_DESCRIPTIONS","callsCount","CALLS_COUNT","executionTime","EXECUTION_TIME","toFixed","theme","styles","searchBar","sort","map","componentName","componentWillUnmount","lowerCaseQuery","toLowerCase","trim","allItems","filter","usedVariable","startsWith","usedVariableName","label","React","Component","ComponentShowcase","name","description","onVariableSelect","elements","isSticky","heading","headingSticky","table","headerCell","width","el","ComponentShowcaseRow","element","row","rowSpan","variables","invisibleRow","invisibleDarkRow","darkVariables","cell","majorCell","elementName","invisibleCell","varName","dependencies","variableDefault","variableDark","hasNoVariables","suspiciousRow","darkRow","VariableName","handleVariableSelect","variableName","renderDependencies","dependency","DependencyName","dependencyName","dependencyDefault","dependencyDark","handleDependencySelect","onDependencySelect","VariableValue","valueIsColor","valueIsGradient","isGradient","hasExample","borderColor","ColorFunctions","contrast","colorExample","background","ShowUnusedVariables","diff","unusedVariablesWarning","v","input"],"mappings":"yPAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;AASA,uD;;AAEA,IAAMA,WAAqB,GAAG,EAA9B;;AAEA,IAAMC,aAAa,GAAGC,MAAM,CAACC,IAAP,CAAYC,2BAAZ,CAAtB,C;;;;;;;;;AASaC,a;;;;;;AAMX,yBAAYC,KAAZ,EAAkC;AAChC,wCAAMA,KAAN,UADgC,MAL3BC,KAK2B,GALJ,EAKI,OAH1BC,YAG0B,GAHX,KAGW,OAF1BC,aAE0B,GAFA,EAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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EAAmC;AACjC,SAAO,CAAC,CAACA,KAAF,IAAWA,KAAK,CAAC7D,UAAN,CAAiB,iBAAjB,CAAlB;AACD","sourcesContent":["import React from 'react';\n\nimport { isColor } from '../../lib/styles/ColorHelpers';\nimport { DEFAULT_THEME as defaultVariables } from '../../lib/theming/themes/DefaultTheme';\nimport { DARK_THEME as darkVariables } from '../../lib/theming/themes/DarkTheme';\nimport { ComboBox, ComboBoxItem } from '../../components/ComboBox';\nimport { Gapped } from '../../components/Gapped';\nimport { Link } from '../../components/Link';\nimport { Sticky } from '../../components/Sticky';\nimport * as ColorFunctions from '../../lib/styles/ColorFunctions';\nimport { Tooltip } from '../../components/Tooltip';\nimport { IS_PROXY_SUPPORTED } from '../../lib/Supports';\nimport { Theme } from '../../lib/theming/Theme';\nimport { cx } from '../../lib/theming/Emotion';\nimport { ThemeContext } from '../../lib/theming/ThemeContext';\n\nimport {\n ALL_USED_VARIABLES,\n CALLS_COUNT,\n COMPONENT_DESCRIPTIONS,\n COMPONENT_DESCRIPTIONS_BY_VARIABLE,\n ComponentDescriptionType,\n ComponentRowDescriptionType,\n EXECUTION_TIME,\n} from './VariablesCollector';\nimport { styles } from './ThemeShowcase.styles';\n\nconst EMPTY_ARRAY: string[] = [];\n\nconst ALL_VARIABLES = Object.keys(defaultVariables) as Array<keyof Theme>;\n\ninterface ShowcaseProps {\n isDebugMode?: boolean;\n}\ninterface ShowcaseState {\n selectedVariable?: ComboBoxItem;\n}\n\nexport class ThemeShowcase extends React.Component<ShowcaseProps, ShowcaseState> {\n public state: ShowcaseState = {};\n\n private isUnmounting = false;\n private variablesDiff: string[] = [];\n\n constructor(props: ShowcaseProps) {\n super(props);\n if (props.isDebugMode) {\n ALL_VARIABLES.forEach((variable) => {\n const found = ALL_USED_VARIABLES.includes(variable);\n if (!found) {\n this.variablesDiff.push(variable);\n }\n });\n }\n }\n\n public render() {\n if (!IS_PROXY_SUPPORTED) {\n return (\n <div>\n Таблица использования переменных доступна только в{' '}\n <Link href={'https://caniuse.com/#feat=proxy'} target={'_blank'}>\n браузерах с поддержкой Proxy\n </Link>\n .\n </div>\n );\n }\n\n const selectedVariable = this.state.selectedVariable;\n const descriptionsToRender = selectedVariable\n ? COMPONENT_DESCRIPTIONS_BY_VARIABLE[selectedVariable.value] || {}\n : COMPONENT_DESCRIPTIONS;\n\n const isDebugMode = this.props.isDebugMode;\n const callsCount = isDebugMode ? `(${CALLS_COUNT} вызовов)` : '';\n const executionTime = isDebugMode ? `Сгенерировано за ${EXECUTION_TIME.toFixed(3)}ms` : '';\n\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n return (\n <Gapped wrap gap={30} verticalAlign={'top'}>\n <div>\n <Sticky side={'top'}>\n <div className={styles.searchBar(theme)} data-perf-info={`${executionTime} ${callsCount}`}>\n <Gapped gap={15}>\n <ComboBox\n getItems={this.getItems}\n value={selectedVariable}\n onValueChange={this.handleVariableChange}\n onUnexpectedInput={this.handleUnexpectedVariableInput}\n placeholder={'поиск по названию переменной'}\n />\n {!!selectedVariable && <Link onClick={this.resetVariable}>сбросить</Link>}\n </Gapped>\n </div>\n </Sticky>\n {Object.keys(descriptionsToRender)\n .sort()\n .map((componentName) => (\n <ComponentShowcase\n key={componentName}\n name={componentName}\n description={descriptionsToRender[componentName]}\n isDebugMode={isDebugMode}\n onVariableSelect={this.handleVariableChange}\n />\n ))}\n </div>\n <ShowUnusedVariables diff={this.variablesDiff} />\n </Gapped>\n );\n }}\n </ThemeContext.Consumer>\n );\n }\n public componentWillUnmount(): void {\n this.isUnmounting = true;\n }\n\n private getValues(query: string) {\n const lowerCaseQuery = query && query.toLowerCase().trim();\n let allItems = ALL_USED_VARIABLES;\n if (lowerCaseQuery) {\n allItems = ALL_USED_VARIABLES.filter((usedVariable) => usedVariable.toLowerCase().startsWith(lowerCaseQuery));\n }\n return allItems.map((usedVariableName) => ({\n value: usedVariableName,\n label: usedVariableName,\n }));\n }\n private getItems = (query: string) => {\n return Promise.resolve(this.getValues(query));\n };\n private handleVariableChange = (item: ComboBoxItem) => {\n if (!this.isUnmounting) {\n this.setState({ selectedVariable: item });\n }\n };\n private handleUnexpectedVariableInput = (query: string) => {\n const values = this.getValues(query);\n if (values.length > 0) {\n return values[0];\n }\n\n return this.resetVariable();\n };\n private resetVariable = () => {\n if (!this.isUnmounting) {\n this.setState({ selectedVariable: undefined });\n }\n };\n}\n\ninterface ComponentShowcaseProps {\n name: string;\n description: ComponentDescriptionType;\n isDebugMode?: boolean;\n onVariableSelect: (item: ComboBoxItem) => void;\n}\nclass ComponentShowcase extends React.Component<ComponentShowcaseProps, {}> {\n public render() {\n const { name, description, onVariableSelect, isDebugMode } = this.props;\n const elements = Object.keys(description);\n\n return elements.length ? (\n <ThemeContext.Consumer>\n {(theme) => {\n return (\n <React.Fragment>\n <Sticky side={'top'} offset={40}>\n {(isSticky) => (\n <h2\n className={cx({\n [styles.heading(theme)]: true,\n [styles.headingSticky()]: isSticky,\n })}\n >\n {this.props.name}\n </h2>\n )}\n </Sticky>\n <table className={styles.table()}>\n <thead>\n <tr>\n <th className={styles.headerCell()} style={{ width: 170 }}>\n ClassName\n </th>\n <th className={styles.headerCell()} style={{ width: 210 }}>\n Variable Name\n </th>\n <th className={styles.headerCell()} style={{ width: 250 }}>\n Default Value\n </th>\n <th className={styles.headerCell()} style={{ width: 250 }}>\n Dark Value\n </th>\n </tr>\n </thead>\n <tbody>\n {elements.map((el) => (\n <ComponentShowcaseRow\n key={`${name}_${el}`}\n element={el}\n row={description[el]}\n onVariableSelect={onVariableSelect}\n isDebugMode={isDebugMode}\n />\n ))}\n </tbody>\n </table>\n </React.Fragment>\n );\n }}\n </ThemeContext.Consumer>\n ) : null;\n }\n}\n\ninterface ComponentShowcaseRowProps {\n element: string;\n row: ComponentRowDescriptionType;\n isDebugMode?: boolean;\n onVariableSelect: (item: ComboBoxItem) => void;\n}\n\nclass ComponentShowcaseRow extends React.Component<ComponentShowcaseRowProps> {\n public render() {\n const { element: el, row, isDebugMode } = this.props;\n const rowSpan = row.variables.length + 1;\n\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n return (\n <React.Fragment>\n <tr className={cx(styles.invisibleRow(), { [styles.invisibleDarkRow()]: theme === darkVariables })}>\n <td className={cx(styles.cell(), styles.majorCell())} rowSpan={rowSpan}>\n <span className={styles.elementName()}>.{el}</span>\n </td>\n <td className={styles.invisibleCell()} />\n <td className={styles.invisibleCell()} />\n <td className={styles.invisibleCell()} />\n </tr>\n {row.variables.map((varName) => {\n const dependencies = row.dependencies[varName] || EMPTY_ARRAY;\n const variableDefault = defaultVariables[varName] as string;\n const variableDark = darkVariables[varName] as string;\n const hasNoVariables = isDebugMode && !variableDefault;\n return (\n <tr\n key={`${el}_${varName}`}\n className={cx(styles.row(), {\n [styles.suspiciousRow()]: hasNoVariables,\n [styles.darkRow()]: theme === darkVariables,\n })}\n >\n <td className={styles.cell()}>\n <VariableName\n variableName={varName as string}\n dependencies={dependencies}\n onVariableSelect={this.props.onVariableSelect}\n />\n </td>\n <td className={styles.cell()}>\n <VariableValue value={variableDefault} />\n </td>\n <td className={styles.cell()}>\n <VariableValue value={variableDark} />\n </td>\n </tr>\n );\n })}\n </React.Fragment>\n );\n }}\n </ThemeContext.Consumer>\n );\n }\n}\n\ninterface VariableNameProps {\n variableName: string;\n dependencies: Array<keyof Theme>;\n onVariableSelect: (item: ComboBoxItem) => void;\n}\n\nclass VariableName extends React.Component<VariableNameProps> {\n public render() {\n return (\n <span>\n <span className={styles.variableName()} onClick={this.handleVariableSelect}>\n {this.props.variableName}\n </span>\n {this.props.dependencies.length > 0 && this.renderDependencies()}\n </span>\n );\n }\n\n private renderDependencies() {\n const { dependencies, onVariableSelect } = this.props;\n return (\n <React.Fragment>\n <br />\n <br />\n зависит от:\n {dependencies.map((dependency) => (\n <DependencyName\n key={`dependency_${dependency}`}\n dependencyName={dependency}\n onDependencySelect={onVariableSelect}\n />\n ))}\n </React.Fragment>\n );\n }\n\n private handleVariableSelect = () => {\n const { variableName, onVariableSelect } = this.props;\n if (onVariableSelect) {\n onVariableSelect({ value: variableName, label: variableName });\n }\n };\n}\n\ninterface DependencyNameProps {\n dependencyName: keyof Theme;\n onDependencySelect: (item: ComboBoxItem) => void;\n}\nclass DependencyName extends React.Component<DependencyNameProps> {\n public render() {\n return (\n <React.Fragment>\n <br />\n &ndash;{' '}\n <Tooltip trigger={'hover'} render={this.getValues} pos={'right middle'}>\n <span className={styles.variableName()} onClick={this.handleDependencySelect}>\n {this.props.dependencyName}\n </span>\n </Tooltip>\n </React.Fragment>\n );\n }\n\n private getValues = () => {\n const dependencyName = this.props.dependencyName;\n const dependencyDefault = defaultVariables[dependencyName] as string;\n const dependencyDark = darkVariables[dependencyName] as string;\n return (\n <React.Fragment>\n <span>Default value: {<VariableValue value={dependencyDefault} />}</span>\n <span>Dark value: {<VariableValue value={dependencyDark} />}</span>\n </React.Fragment>\n );\n };\n\n private handleDependencySelect = () => {\n const { dependencyName, onDependencySelect } = this.props;\n if (onDependencySelect) {\n onDependencySelect({ value: dependencyName, label: dependencyName });\n }\n };\n}\n\nconst VariableValue = (props: { value: string }) => {\n const value = props.value;\n const valueIsColor = isColor(value);\n const valueIsGradient = isGradient(value);\n const hasExample = valueIsColor || valueIsGradient;\n let borderColor = 'transparent';\n if (hasExample) {\n borderColor = valueIsColor ? ColorFunctions.contrast(value) : '#000';\n }\n\n return (\n <span className={cx({ [styles.undefined()]: !value })}>\n {hasExample && <span className={styles.colorExample()} style={{ background: value, borderColor }} />}\n {value || 'undefined'}\n </span>\n );\n};\n\nconst ShowUnusedVariables = (props: { diff: string[] }) => {\n if (props.diff.length === 0) {\n return null;\n }\n\n return (\n <div className={styles.unusedVariablesWarning()}>\n Неиспользованные переменные ({props.diff.length}\n ):\n <ul>\n {props.diff.sort().map((v) => (\n <li key={v}>{v}</li>\n ))}\n </ul>\n </div>\n );\n};\n\nfunction isGradient(input: string) {\n return !!input && input.startsWith('linear-gradient');\n}\n"]}
@@ -17,6 +17,6 @@ export interface VariableDependencies {
17
17
  }
18
18
  export declare const COMPONENT_DESCRIPTIONS: DescriptionsType;
19
19
  export declare const COMPONENT_DESCRIPTIONS_BY_VARIABLE: VariableNameToComponentsMap;
20
- export declare const ALL_USED_VARIABLES: ("black" | "blue" | "gray" | "green" | "red" | "white" | "yellow" | "prototype" | "fontFamilyCompensationBaseline" | "labGrotesqueBaselineCompensation" | "brandXLight" | "brandLight" | "brand" | "brandDark" | "brandXDark" | "grayXxLight" | "grayXLight" | "grayLight" | "grayDark" | "blueXxLight" | "blueLight" | "blueDark" | "blueXDark" | "greenXxLight" | "greenDark" | "redXxLight" | "redDark" | "yellowXxLight" | "yellowDark" | "bgDefault" | "bgSecondary" | "bgDisabled" | "errorMain" | "errorSecondary" | "errorText" | "warningMain" | "warningSecondary" | "warningText" | "borderColorFocusLight" | "borderColorGrayDark" | "borderColorGrayLight" | "borderColorDisabled" | "placeholderColor" | "outlineColorFocus" | "placeholderColorLight" | "blinkColor" | "controlBorderWidth" | "controlOutlineWidth" | "controlLineHeightSmall" | "controlLineHeightMedium" | "controlLineHeightLarge" | "controlPaddingYSmall" | "controlPaddingYMedium" | "controlPaddingYLarge" | "textColorDefault" | "textColorInvert" | "textColorDisabled" | "textColorDisabledContrast" | "fontSizeSmall" | "fontSizeMedium" | "fontSizeLarge" | "fontSizeMobile" | "lineHeightMobile" | "specificityLevel" | "fixedPanelShadow" | "bgActive" | "borderColorFocus" | "borderColorError" | "borderColorWarning" | "controlHeightSmall" | "controlHeightMedium" | "controlHeightLarge" | "mobileMediaQuery" | "linkColor" | "linkActiveColor" | "linkHoverTextDecoration" | "linkSuccessColor" | "linkSuccessHoverColor" | "linkSuccessActiveColor" | "linkDangerColor" | "linkDangerHoverColor" | "linkDangerActiveColor" | "linkIconMarginRight" | "linkHoverColor" | "linkDisabledColor" | "linkButtonLineHeight" | "linkButtonPaddingX" | "tokenDisabledBg" | "tokenTextColorDisabled" | "tokenFontSize" | "tokenMarginY" | "tokenMarginX" | "tokenLineHeight" | "tokenPaddingY" | "tokenPaddingX" | "tokenMarginBeforeIcon" | "tokenRemoveIconSize" | "tokenRemoveIconPaddingY" | "tokenRemoveIconPaddingX" | "tokenRemoveIconGap" | "tokenRemoveIconBoxSizing" | "tokenBorderRadius" | "tokenBorderWidth" | "tokenBorderColorDisabled" | "tokenDefaultIdle" | "tokenDefaultActive" | "tokenGrayIdle" | "tokenGrayActive" | "tokenBlueIdle" | "tokenBlueActive" | "tokenGreenIdle" | "tokenGreenActive" | "tokenYellowIdle" | "tokenYellowActive" | "tokenRedIdle" | "tokenRedActive" | "tokenWhite" | "tokenBlack" | "tokenBorderColorWarning" | "tokenBorderColorError" | "tokenOutlineWidth" | "tokenLegacyTextShift" | "tokenPaddingYDisabled" | "tokenPaddingXDisabled" | "tokenMarginYDisabled" | "tokenMarginXDisabled" | "tokenShadowDisabled" | "tokenInputBorderColor" | "tokenInputBorderColorFocus" | "tokenInputBorderColorError" | "tokenInputBorderColorWarning" | "tokenInputBorderTopColor" | "tokenInputBorderRadius" | "tokenInputPlaceholderColor" | "tokenInputPlaceholderColorLight" | "tokenInputDisabledBg" | "tokenInputDisabledBorderColor" | "tokenInputBorderWidth" | "tokenInputOutlineWidth" | "tokenInputBg" | "tokenInputShadow" | "tokenInputTextColor" | "tokenInputTextColorDisabled" | "tokenInputPlaceholderColorDisabled" | "tokenInputPaddingY" | "tokenInputPaddingX" | "tokenInputFontSize" | "tokenInputLineHeight" | "tokenInputInputPaddingLeft" | "tokenInputInputPaddingRight" | "loaderBg" | "loaderOpacity" | "btnBackgroundClip" | "btnArrowBgImageActive" | "btnArrowBgImageChecked" | "btnLinkBorderRadius" | "btnFocusShadowWidth" | "btnDisabledBorderColor" | "btnCheckedBg" | "btnCheckedDisabledBg" | "btnCheckedDisabledColor" | "btnCheckedTextColor" | "btnCheckedDisabledBorderColor" | "btnCheckedShadow" | "btnCheckedDisabledShadow" | "btnBorderRadiusSmall" | "btnBorderRadiusMedium" | "btnBorderRadiusLarge" | "btnBorderWidth" | "btnInsetWidth" | "btnOutlineWidth" | "btnPaddingXSmall" | "btnPaddingXMedium" | "btnPaddingXLarge" | "btnIconGapSmall" | "btnIconGapMedium" | "btnIconGapLarge" | "btnIconSizeSmall" | "btnIconSizeMedium" | "btnIconSizeLarge" | "btnDefaultBg" | "btnDefaultBgStart" | "btnDefaultBgEnd" | "btnDefaultCheckedBorderColor" | "btnDefaultTextColor" | "btnDefaultHoverBg" | "btnDefaultHoverBgStart" | "btnDefaultHoverBgEnd" | "btnDefaultActiveBg" | "btnDefaultHoverBorderColor" | "btnDefaultHoverBorderBottomColor" | "btnDefaultActiveBorderColor" | "btnDefaultActiveBorderTopColor" | "btnDefaultBorderColor" | "btnDefaultBorderBottomColor" | "btnDefaultActiveShadow" | "btnSuccessBg" | "btnSuccessHoverBg" | "btnSuccessHoverBorderColor" | "btnSuccessHoverBorderBottomColor" | "btnSuccessBorderColor" | "btnSuccessBorderBottomColor" | "btnSuccessBgStart" | "btnSuccessBgEnd" | "btnSuccessTextColor" | "btnSuccessHoverBgStart" | "btnSuccessHoverBgEnd" | "btnSuccessActiveBg" | "btnSuccessActiveBorderColor" | "btnSuccessActiveBorderTopColor" | "btnSuccessActiveShadow" | "btnPrimaryBg" | "btnPrimaryHoverBg" | "btnPrimaryHoverBorderColor" | "btnPrimaryHoverBorderBottomColor" | "btnPrimaryBorderColor" | "btnPrimaryBorderBottomColor" | "btnPrimaryBgStart" | "btnPrimaryBgEnd" | "btnPrimaryTextColor" | "btnPrimaryHoverBgStart" | "btnPrimaryHoverBgEnd" | "btnPrimaryActiveBg" | "btnPrimaryActiveBorderColor" | "btnPrimaryActiveBorderTopColor" | "btnPrimaryActiveShadow" | "btnDangerBg" | "btnDangerHoverBg" | "btnDangerHoverBorderColor" | "btnDangerHoverBorderBottomColor" | "btnDangerBorderColor" | "btnDangerBorderBottomColor" | "btnDangerBgStart" | "btnDangerBgEnd" | "btnDangerTextColor" | "btnDangerHoverBgStart" | "btnDangerHoverBgEnd" | "btnDangerActiveBg" | "btnDangerActiveBorderColor" | "btnDangerActiveBorderTopColor" | "btnDangerActiveShadow" | "btnPayBg" | "btnPayHoverBg" | "btnPayHoverBorderColor" | "btnPayHoverBorderBottomColor" | "btnPayBorderColor" | "btnPayBorderBottomColor" | "btnPayBgStart" | "btnPayBgEnd" | "btnPayTextColor" | "btnPayHoverBgStart" | "btnPayHoverBgEnd" | "btnPayActiveBg" | "btnPayActiveBorderColor" | "btnPayActiveBorderTopColor" | "btnPayActiveShadow" | "btnMenuArrowColor" | "btnFontSizeSmall" | "btnFontSizeMedium" | "btnFontSizeLarge" | "btnLineHeightSmall" | "btnLineHeightMedium" | "btnLineHeightLarge" | "btnPaddingYSmall" | "btnPaddingYMedium" | "btnPaddingYLarge" | "btnDisabledBg" | "btnBorderColorWarning" | "btnBorderColorError" | "btnHeightSmall" | "btnHeightMedium" | "btnHeightLarge" | "btnLinkColor" | "btnLinkHoverColor" | "btnLinkActiveColor" | "btnLinkHoverTextDecoration" | "btnLinkIconMarginRight" | "btnErrorSecondary" | "btnWarningSecondary" | "btnOutlineColorFocus" | "btnInsetColor" | "btnBorderColorFocus" | "btnLinkDisabledColor" | "btnDisabledTextColor" | "selectPlaceholderColor" | "selectBorderWidth" | "selectPlaceholderColorDisabled" | "selectOutlineWidth" | "selectLineHeightSmall" | "selectFontSizeSmall" | "selectPaddingXSmall" | "selectPaddingYSmall" | "selectBorderRadiusSmall" | "selectIconGapSmall" | "selectLineHeightMedium" | "selectFontSizeMedium" | "selectPaddingXMedium" | "selectPaddingYMedium" | "selectBorderRadiusMedium" | "selectIconGapMedium" | "selectLineHeightLarge" | "selectFontSizeLarge" | "selectPaddingXLarge" | "selectPaddingYLarge" | "selectBorderRadiusLarge" | "selectIconGapLarge" | "selectMenuArrowColor" | "selectMenuArrowColorDisabled" | "selectIconSizeSmall" | "selectIconSizeMedium" | "selectIconSizeLarge" | "selectRootWidthMobile" | "selectTextColorDisabled" | "selectBgDisabled" | "selectBorderColorDisabled" | "tooltipPaddingY" | "tooltipPaddingX" | "tooltipCloseBtnPadding" | "tooltipCloseBtnColor" | "tooltipCloseBtnHoverColor" | "tooltipTextColor" | "tooltipBorder" | "tooltipBorderRadius" | "tooltipPinOffset" | "tooltipPinOffsetX" | "tooltipPinOffsetY" | "tooltipMargin" | "tooltipPinSize" | "tooltipFontSize" | "tooltipLineHeight" | "tooltipMenuPinOffset" | "tooltipMenuMargin" | "tooltipMenuPinSize" | "kebabPinOffset" | "kebabPinSize" | "kebabMargin" | "kebabBackground" | "kebabBackgroundHover" | "kebabBorderRadius" | "kebabBorder" | "modalBackBg" | "modalBg" | "modalBackOpacity" | "modalCloseButtonColor" | "modalCloseButtonDisabledColor" | "modalCloseButtonHoverColor" | "modalCloseButtonPadding" | "modalCloseButtonLegacyShift" | "modalCloseButtonBottomPadding" | "modalCloseButtonClickArea" | "modalCloseIconSize" | "modalCloseLegacyGap" | "modalCloseWrapperLegacyGap" | "modalBorderRadius" | "modalFixedHeaderBg" | "modalFixedHeaderShadow" | "modalFixedHeaderBorder" | "modalFixedFooterBorder" | "modalFixedFooterShadow" | "modalFixedPanelShadow" | "modalFooterBg" | "modalAdaptiveThreshold" | "modalPaddingTop" | "modalPaddingLeft" | "modalPaddingRight" | "modalHeaderFontSize" | "modalHeaderTextColor" | "modalHeaderLineHeight" | "modalHeaderPaddingBottom" | "modalHeaderPaddingTop" | "modalFixedHeaderPaddingBottom" | "modalBodyTextColor" | "modalFooterTextColor" | "modalBodyPaddingBottom" | "modalFooterPaddingTop" | "modalFooterPaddingBottom" | "modalPaddingBottom" | "modalFooterPanelPaddingTop" | "modalFooterPanelPaddingBottom" | "mobileModalCloseButtonRightPadding" | "mobileModalCloseButtonTopPadding" | "mobileModalCloseButtonClickArea" | "mobileModalCloseIconSize" | "mobileModalHeaderFontSize" | "mobileModalHeaderLineHeight" | "mobileModalHeaderPadding" | "mobileModalBodyPadding" | "mobileModalBodyFontSize" | "mobileModalFooterPadding" | "mobileModalPaddingBottom" | "sidePageFooterPanelBg" | "sidePageBackingBg" | "sidePageBackingBgOpacity" | "sidePageCloseButtonColor" | "sidePageCloseButtonHoverColor" | "sidePageContainerShadow" | "mobileSidePagePaddingLeft" | "mobileSidePagePaddingRight" | "mobileSidePagePaddingTop" | "mobileSidePagePaddingBottom" | "mobileSidePageFooterPadding" | "sidePagePaddingLeft" | "sidePagePaddingRight" | "sidePagePaddingTop" | "sidePagePaddingBottom" | "sidePageFooterPaddingTop" | "sidePageFooterPaddingBottom" | "sidePageBgDefault" | "sidePageHeaderTextColor" | "sidePageBodyTextColor" | "sidePageFooterTextColor" | "sidePageHeaderFontSize" | "sidePageHeaderLineHeight" | "sidePageHeaderPaddingBottom" | "sidePageHeaderPaddingTop" | "sidePageHeaderFixedFontSize" | "sidePageHeaderFixedLineHeight" | "sidePageHeaderFixedPaddingY" | "sidePageHeaderStickyOffset" | "sidePageCloseButtonPadding" | "mobileSidePageCloseButtonPadding" | "sidePageCloseButtonLegacyPaddingLeft" | "sidePageFooterPanelPaddingTop" | "sidePageFooterPanelPaddingBottom" | "sidePageCloseIconSize" | "sidePageCloseButtonClickArea" | "mobileSidePageCloseButtonClickArea" | "sidePageFixedHeaderShadow" | "sidePageFixedFooterShadow" | "sidePageFixedPanelShadow" | "mobileSidePageHeaderFontSize" | "mobileSidePageHeaderLineHeight" | "mobileSidePageHeaderPaddingBottom" | "mobileSidePageHeaderPaddingTop" | "dateInputIconColor" | "dateInputMaskColor" | "dateInputComponentSelectedBgColor" | "calendarCellBg" | "calendarCellHoverColor" | "calendarCellActiveHoverColor" | "calendarCellWeekendColor" | "calendarCellTodayBorder" | "calendarCellSelectedBgColor" | "calendarCellSelectedFontColor" | "calendarCellSize" | "calendarCellLineHeight" | "calendarMonthHeaderStickedBgColor" | "calendarMonthTitleBorderBottomColor" | "calendarCellHoverBgColor" | "calendarPaddingX" | "calendarMonthTitleLineHeight" | "calendarMonthTitlePaddingTop" | "calendarMonthTitlePaddingBottom" | "calendarMonthTitleMarginX" | "calendarMonthTitleMarginBottom" | "calendarWrapperHeight" | "calendarMonthMarginBottom" | "calendarMaxMonthsToAppendOnScroll" | "dateSelectLineHeight" | "dateSelectFontSize" | "dateSelectFontWeight" | "dateSelectMenuItemBgSelected" | "dateSelectTextColorDisabled" | "dateSelectTextColorDefault" | "dateSelectLinkColor" | "dateSelectPopupBoxShadow" | "dateSelectTextColorInvert" | "datePickerOpenBtnColor" | "pickerBg" | "pickerShadow" | "pickerTodayWrapperBgColor" | "pickerTodayWrapperBorderTop" | "pickerTodayWrapperHoverBgColor" | "pickerTodayWrapperFontSize" | "pickerTodayWrapperLineHeight" | "pickerTodayWrapperPaddingTop" | "pickerTodayWrapperPaddingBottom" | "dateSelectMenuBg" | "dateSelectMenuItemBgActive" | "dateSelectMenuItemBgDisabled" | "dateSelectMenuItemFontActive" | "dateSelectMenuItemFontSelected" | "dateSelectMenuItemFontDisabled" | "pagingFontSize" | "pagingForwardIconSize" | "pagingForwardIconMarginTop" | "pagingPageLinkPaddingX" | "pagingPageLinkPaddingY" | "pagingPageLinkLegacyPaddingY" | "pagingPageLinkMinWidth" | "pagingPageForwardLinkMarginTop" | "pagingPageForwardLinkMarginLeft" | "pagingPageForwardLinkPaddingRight" | "pagingLineHeight" | "pagingDotsColor" | "pagingDotsPadding" | "pagingPageLinkActiveBg" | "pagingPageLinkActiveColor" | "pagingPageLinkHoverBg" | "pagingPageLinkBorderRadius" | "pagingPageLinkHintColor" | "pagingPageLinkHintFontSize" | "pagingPageLinkHintLineHeight" | "pagingPageLinkMargin" | "pagingForwardLinkColor" | "pagingForwardLinkDisabledColor" | "hintColor" | "mobileHintColor" | "hintFontSize" | "hintLineHeight" | "hintMaxWidth" | "hintPaddingY" | "hintPaddingX" | "hintTextAlign" | "hintBgColor" | "hintBorder" | "hintBorderRadius" | "hintPinOffset" | "hintMargin" | "toastFontSize" | "toastLineHeight" | "toastPaddingY" | "toastPaddingX" | "toastBorderRadius" | "toastBorder" | "toastTop" | "toastBg" | "toastColor" | "toastLinkColor" | "toastClosePadding" | "toastCloseColor" | "toastCloseHoverColor" | "toastCloseSize" | "dropdownMenuSelectedBg" | "dropdownMenuHoverBg" | "menuBgDefault" | "menuBorderRadius" | "menuBorder" | "menuShadow" | "menuPaddingY" | "menuPaddingX" | "menuItemTextColor" | "menuItemSelectedBg" | "menuItemHoverBg" | "menuItemIconWidth" | "menuItemIconGap" | "menuItemIconLegacyMargin" | "menuItemIconLegacyShift" | "menuItemPaddingForIcon" | "menuItemLineHeight" | "menuItemFontSize" | "menuItemPaddingX" | "menuItemPaddingY" | "menuItemBorderRadius" | "menuItemLegacyPaddingX" | "menuItemLegacyPaddingY" | "menuItemHoverColor" | "menuItemDisabledColor" | "menuItemLinkColor" | "menuItemCommentColor" | "menuItemCommentColorHover" | "menuItemPaddingMobile" | "menuHeaderColor" | "menuHeaderLineHeight" | "menuHeaderFontSize" | "menuHeaderPaddingX" | "menuHeaderPaddingTop" | "menuHeaderPaddingBottom" | "menuHeaderLegacyPaddingRight" | "menuSeparatorBorderColor" | "menuSeparatorMarginY" | "menuSeparatorBorderWidth" | "toggleFontSize" | "toggleLineHeight" | "toggleTextColor" | "toggleHandleActiveWidthIncrement" | "toggleHandleBorderRadius" | "toggleHeight" | "toggleWidth" | "toggleBorderRadius" | "toggleBg" | "toggleHandleBg" | "toggleCheckedBg" | "toggleDisabledHandleBg" | "toggleBaseBg" | "toggleBgDisabled" | "toggleBgDisabledChecked" | "toggleBgHover" | "toggleCheckedBgHover" | "toggleBgChecked" | "toggleBorderWidth" | "toggleOutlineWidth" | "toggleBorderColor" | "toggleBorderColorDisabled" | "toggleBorderColorDisabledChecked" | "toggleHandleSize" | "toggleHandleLeft" | "toggleHandleTop" | "toggleBgFocus" | "toggleBgActive" | "toggleShadowColorError" | "toggleShadowColorWarning" | "toggleFocusShadowColor" | "toggleCaptionGap" | "toggleButtonOffsetY" | "popupBorder" | "popupBorderRadius" | "popupBorderColor" | "popupDropShadow" | "popupBoxShadow" | "popupTextColor" | "popupBackground" | "popupPinOffset" | "popupPinOffsetX" | "popupPinOffsetY" | "popupMargin" | "popupPinSize" | "inputTextColor" | "inputShadow" | "inputBg" | "inputIconColor" | "inputColor" | "inputWidth" | "inputTextColorDisabled" | "inputFontSizeSmall" | "inputFontSizeMedium" | "inputFontSizeLarge" | "inputLineHeightSmall" | "inputLineHeightMedium" | "inputLineHeightLarge" | "inputHeightSmall" | "inputHeightMedium" | "inputHeightLarge" | "inputPaddingYSmall" | "inputPaddingYMedium" | "inputPaddingYLarge" | "inputPaddingXSmall" | "inputPaddingXMedium" | "inputPaddingXLarge" | "inputIconGapSmall" | "inputIconGapMedium" | "inputIconGapLarge" | "inputIconSizeSmall" | "inputIconSizeMedium" | "inputIconSizeLarge" | "inputFocusShadow" | "inputDisabledBg" | "inputDisabledBorderColor" | "inputFocusOutline" | "inputBorderWidth" | "inputOutlineWidth" | "inputBorderRadiusSmall" | "inputBorderRadiusMedium" | "inputBorderRadiusLarge" | "inputBorderColor" | "inputBorderColorFocus" | "inputBorderColorError" | "inputBorderColorWarning" | "inputBorderTopColor" | "inputPlaceholderColor" | "inputPlaceholderColorDisabled" | "inputPlaceholderColorLight" | "inputBlinkColor" | "checkboxFontSize" | "checkboxLineHeight" | "checkboxBoxSize" | "checkboxCaptionGap" | "checkboxPaddingY" | "checkboxBoxOffsetY" | "checkboxBgStart" | "checkboxBgEnd" | "checkboxTextColorDefault" | "checkboxTextColorDisabled" | "checkboxShadowDisabled" | "checkboxBorder" | "checkboxBorderWidth" | "checkboxShadow" | "checkboxShadowHover" | "checkboxCheckedColor" | "checkboxOutlineColorFocus" | "checkboxBorderColorWarning" | "checkboxBorderColorError" | "checkboxCheckedHoverShadow" | "checkboxBorderRadius" | "checkboxOutlineWidth" | "checkboxCheckedShadow" | "checkboxCheckedActiveShadow" | "checkboxBorderColorFocus" | "checkboxBg" | "checkboxHoverBg" | "checkboxActiveBg" | "checkboxCheckedBg" | "checkboxBgDisabled" | "checkboxCheckedHoverBg" | "checkboxCheckedActiveBg" | "checkboxShadowActive" | "textareaBg" | "textareaColor" | "textareaTextColorDisabled" | "textareaPlaceholderColorLight" | "textareaPlaceholderColor" | "textareaPlaceholderColorDisabled" | "textareaShadow" | "textareaFontSize" | "textareaLineHeight" | "textareaBorderRadius" | "textareaBorderWidth" | "textareaOutlineWidth" | "textareaMinHeight" | "textareaWidth" | "textareaPaddingX" | "textareaPaddingY" | "textareaBorderColor" | "textareaBorderTopColor" | "textareaBorderColorFocus" | "textareaBorderColorWarning" | "textareaBorderColorError" | "textareaDisabledBg" | "textareaDisabledBorderColor" | "textareaCounterColor" | "textareaCounterBg" | "textareaCounterErrorColor" | "textareaCounterHelpIconColor" | "radioBulletSize" | "radioOutlineWidth" | "radioTextColor" | "radioSize" | "radioSizeAfter" | "radioFontSize" | "radioLineHeight" | "radioCaptionGap" | "radioPaddingY" | "radioVerticalAlign" | "radioBgImage" | "radioBgColor" | "radioHoverBg" | "radioActiveBg" | "radioBorderWidth" | "radioBorderColor" | "radioBoxShadow" | "radioBorder" | "radioBorderColorFocus" | "radioBorderColorWarning" | "radioBorderColorError" | "radioHoverShadow" | "radioActiveShadow" | "radioFocusShadow" | "radioCheckedBgColor" | "radioCheckedBorderColor" | "radioCheckedBulletColor" | "radioCheckedHoverBgColor" | "radioDisabledBg" | "radioDisabledShadow" | "radioCaptionDisplay" | "radioBorderWidthCompensation" | "radioCircleOffsetY" | "radioGroupLegacyItemGap" | "tabFontSize" | "tabPaddingX" | "tabsMarginX" | "tabPaddingY" | "tabLineHeight" | "tabBorderWidth" | "tabOutlineWidth" | "tabTextColorDefault" | "tabColorFocus" | "tabColorError" | "tabColorWarning" | "tabColorSuccess" | "tabColorPrimary" | "tabColorHover" | "tabColorHoverError" | "tabColorHoverWarning" | "tabColorHoverSuccess" | "tabColorHoverPrimary" | "spinnerBgColor" | "spinnerColor" | "spinnerDimmedColor" | "spinnerCaptionColor" | "spinnerFontSizeSmall" | "spinnerFontSizeMedium" | "spinnerFontSizeLarge" | "spinnerLineHeightSmall" | "spinnerLineHeightMedium" | "spinnerLineHeightLarge" | "spinnerCaptionGapSmall" | "spinnerCaptionGapMedium" | "spinnerCaptionGapLarge" | "switcherBorderRadius" | "switcherTextColor" | "switcherOutlineWidth" | "switcherCaptionFontSizeSmall" | "switcherCaptionFontSizeMedium" | "switcherCaptionFontSizeLarge" | "switcherCaptionLineHeightSmall" | "switcherCaptionLineHeightMedium" | "switcherCaptionLineHeightLarge" | "switcherCaptionGapSmall" | "switcherCaptionGapMedium" | "switcherCaptionGapLarge" | "switcherButtonPaddingXSmall" | "switcherButtonPaddingXMedium" | "switcherButtonPaddingXLarge" | "switcherButtonPaddingYSmall" | "switcherButtonPaddingYMedium" | "switcherButtonPaddingYLarge" | "switcherButtonLineHeightSmall" | "switcherButtonLineHeightMedium" | "switcherButtonLineHeightLarge" | "switcherButtonFontSizeSmall" | "switcherButtonFontSizeMedium" | "switcherButtonFontSizeLarge" | "switcherButtonBorderRadiusSmall" | "switcherButtonBorderRadiusMedium" | "switcherButtonBorderRadiusLarge" | "switcherButtonBorderWidth" | "switcherButtonDisabledBorderColor" | "switcherButtonCheckedDisabledShadow" | "mobilePopupTopPadding" | "mobilePopupHeaderPadding" | "mobilePopupHeaderBorderRadius" | "mobilePopupHeaderShadow" | "mobilePopupHeaderFontSize" | "mobilePopupHeaderLineHeight" | "mobilePopupHeaderFontWeight" | "mobilePopupHeaderChildPadding" | "scrollContainerScrollBarSize" | "scrollContainerScrollBarHoverSize" | "scrollContainerScrollBarColor" | "scrollContainerScrollBarInvertColor" | "passwordInputVisibilityIconColor" | "passwordInputVisibilityIconOpacity" | "passwordInputVisibilityIconHoverColor" | "passwordInputVisibilityIconHoverOpacity" | "globalLoaderColor" | "globalLoaderHeight" | "globalLoaderWidth" | "globalLoaderPosition" | "globalLoaderTop" | "globalLoaderLeft" | "globalLoaderBottom" | "globalLoaderRight" | "globalLoaderBackgroundColor" | "globalLoaderTransitionToSpinnerDuration" | "globalLoaderSpinnerAnimationDuration" | "globalLoaderSlowAnimationDuration" | "globalLoaderTransitionFromSpinnerDuration" | "fileUploaderWidth" | "fileUploaderBg" | "fileUploaderFontSize" | "fileUploaderLineHeight" | "fileUploaderTextColorDefault" | "fileUploaderPaddingX" | "fileUploaderPaddingY" | "fileUploaderBorderRadius" | "fileUploaderBorderColor" | "fileUploaderBorderWidth" | "fileUploaderBorderStyle" | "fileUploaderBorderColorFocus" | "fileUploaderLinkColor" | "fileUploaderIconSize" | "fileUploaderIconColor" | "fileUploaderIconHoverColor" | "fileUploaderBorderColorError" | "fileUploaderBorderColorWarning" | "fileUploaderDisabledBg" | "fileUploaderDisabledBorderColor" | "fileUploaderDisabledTextColor" | "fileUploaderDisabledLinkColor" | "fileUploaderDisabledIconColor" | "fileUploaderLinkHoverTextDecoration" | "fileUploaderHoveredBg")[];
20
+ export declare const ALL_USED_VARIABLES: ("prototype" | "black" | "blue" | "gray" | "green" | "red" | "white" | "yellow" | "fontFamilyCompensationBaseline" | "labGrotesqueBaselineCompensation" | "brandXLight" | "brandLight" | "brand" | "brandDark" | "brandXDark" | "grayXxLight" | "grayXLight" | "grayLight" | "grayDark" | "blueXxLight" | "blueLight" | "blueDark" | "blueXDark" | "greenXxLight" | "greenDark" | "redXxLight" | "redDark" | "yellowXxLight" | "yellowDark" | "bgDefault" | "bgSecondary" | "bgDisabled" | "errorMain" | "errorSecondary" | "errorText" | "warningMain" | "warningSecondary" | "warningText" | "borderColorFocusLight" | "borderColorGrayDark" | "borderColorGrayLight" | "borderColorDisabled" | "placeholderColor" | "outlineColorFocus" | "placeholderColorLight" | "blinkColor" | "controlBorderWidth" | "controlOutlineWidth" | "controlLineHeightSmall" | "controlLineHeightMedium" | "controlLineHeightLarge" | "controlPaddingYSmall" | "controlPaddingYMedium" | "controlPaddingYLarge" | "textColorDefault" | "textColorInvert" | "textColorDisabled" | "textColorDisabledContrast" | "fontSizeSmall" | "fontSizeMedium" | "fontSizeLarge" | "fontSizeMobile" | "lineHeightMobile" | "specificityLevel" | "fixedPanelShadow" | "bgActive" | "borderColorFocus" | "borderColorError" | "borderColorWarning" | "controlHeightSmall" | "controlHeightMedium" | "controlHeightLarge" | "mobileMediaQuery" | "linkColor" | "linkActiveColor" | "linkHoverTextDecoration" | "linkSuccessColor" | "linkSuccessHoverColor" | "linkSuccessActiveColor" | "linkDangerColor" | "linkDangerHoverColor" | "linkDangerActiveColor" | "linkIconMarginRight" | "linkHoverColor" | "linkDisabledColor" | "linkButtonLineHeight" | "linkButtonPaddingX" | "tokenDisabledBg" | "tokenTextColorDisabled" | "tokenFontSize" | "tokenMarginY" | "tokenMarginX" | "tokenLineHeight" | "tokenPaddingY" | "tokenPaddingX" | "tokenMarginBeforeIcon" | "tokenRemoveIconSize" | "tokenRemoveIconPaddingY" | "tokenRemoveIconPaddingX" | "tokenRemoveIconGap" | "tokenRemoveIconBoxSizing" | "tokenBorderRadius" | "tokenBorderWidth" | "tokenBorderColorDisabled" | "tokenDefaultIdle" | "tokenDefaultActive" | "tokenGrayIdle" | "tokenGrayActive" | "tokenBlueIdle" | "tokenBlueActive" | "tokenGreenIdle" | "tokenGreenActive" | "tokenYellowIdle" | "tokenYellowActive" | "tokenRedIdle" | "tokenRedActive" | "tokenWhite" | "tokenBlack" | "tokenBorderColorWarning" | "tokenBorderColorError" | "tokenOutlineWidth" | "tokenLegacyTextShift" | "tokenPaddingYDisabled" | "tokenPaddingXDisabled" | "tokenMarginYDisabled" | "tokenMarginXDisabled" | "tokenShadowDisabled" | "tokenInputBorderColor" | "tokenInputBorderColorFocus" | "tokenInputBorderColorError" | "tokenInputBorderColorWarning" | "tokenInputBorderTopColor" | "tokenInputBorderRadius" | "tokenInputPlaceholderColor" | "tokenInputPlaceholderColorLight" | "tokenInputDisabledBg" | "tokenInputDisabledBorderColor" | "tokenInputBorderWidth" | "tokenInputOutlineWidth" | "tokenInputBg" | "tokenInputShadow" | "tokenInputTextColor" | "tokenInputTextColorDisabled" | "tokenInputPlaceholderColorDisabled" | "tokenInputPaddingY" | "tokenInputPaddingX" | "tokenInputFontSize" | "tokenInputLineHeight" | "tokenInputInputPaddingLeft" | "tokenInputInputPaddingRight" | "loaderBg" | "loaderOpacity" | "btnBackgroundClip" | "btnArrowBgImageActive" | "btnArrowBgImageChecked" | "btnLinkBorderRadius" | "btnFocusShadowWidth" | "btnDisabledBorderColor" | "btnCheckedBg" | "btnCheckedDisabledBg" | "btnCheckedDisabledColor" | "btnCheckedTextColor" | "btnCheckedDisabledBorderColor" | "btnCheckedShadow" | "btnCheckedDisabledShadow" | "btnBorderRadiusSmall" | "btnBorderRadiusMedium" | "btnBorderRadiusLarge" | "btnBorderWidth" | "btnInsetWidth" | "btnOutlineWidth" | "btnPaddingXSmall" | "btnPaddingXMedium" | "btnPaddingXLarge" | "btnIconGapSmall" | "btnIconGapMedium" | "btnIconGapLarge" | "btnIconSizeSmall" | "btnIconSizeMedium" | "btnIconSizeLarge" | "btnDefaultBg" | "btnDefaultBgStart" | "btnDefaultBgEnd" | "btnDefaultCheckedBorderColor" | "btnDefaultTextColor" | "btnDefaultHoverBg" | "btnDefaultHoverBgStart" | "btnDefaultHoverBgEnd" | "btnDefaultActiveBg" | "btnDefaultHoverBorderColor" | "btnDefaultHoverBorderBottomColor" | "btnDefaultActiveBorderColor" | "btnDefaultActiveBorderTopColor" | "btnDefaultBorderColor" | "btnDefaultBorderBottomColor" | "btnDefaultActiveShadow" | "btnSuccessBg" | "btnSuccessHoverBg" | "btnSuccessHoverBorderColor" | "btnSuccessHoverBorderBottomColor" | "btnSuccessBorderColor" | "btnSuccessBorderBottomColor" | "btnSuccessBgStart" | "btnSuccessBgEnd" | "btnSuccessTextColor" | "btnSuccessHoverBgStart" | "btnSuccessHoverBgEnd" | "btnSuccessActiveBg" | "btnSuccessActiveBorderColor" | "btnSuccessActiveBorderTopColor" | "btnSuccessActiveShadow" | "btnPrimaryBg" | "btnPrimaryHoverBg" | "btnPrimaryHoverBorderColor" | "btnPrimaryHoverBorderBottomColor" | "btnPrimaryBorderColor" | "btnPrimaryBorderBottomColor" | "btnPrimaryBgStart" | "btnPrimaryBgEnd" | "btnPrimaryTextColor" | "btnPrimaryHoverBgStart" | "btnPrimaryHoverBgEnd" | "btnPrimaryActiveBg" | "btnPrimaryActiveBorderColor" | "btnPrimaryActiveBorderTopColor" | "btnPrimaryActiveShadow" | "btnDangerBg" | "btnDangerHoverBg" | "btnDangerHoverBorderColor" | "btnDangerHoverBorderBottomColor" | "btnDangerBorderColor" | "btnDangerBorderBottomColor" | "btnDangerBgStart" | "btnDangerBgEnd" | "btnDangerTextColor" | "btnDangerHoverBgStart" | "btnDangerHoverBgEnd" | "btnDangerActiveBg" | "btnDangerActiveBorderColor" | "btnDangerActiveBorderTopColor" | "btnDangerActiveShadow" | "btnPayBg" | "btnPayHoverBg" | "btnPayHoverBorderColor" | "btnPayHoverBorderBottomColor" | "btnPayBorderColor" | "btnPayBorderBottomColor" | "btnPayBgStart" | "btnPayBgEnd" | "btnPayTextColor" | "btnPayHoverBgStart" | "btnPayHoverBgEnd" | "btnPayActiveBg" | "btnPayActiveBorderColor" | "btnPayActiveBorderTopColor" | "btnPayActiveShadow" | "btnMenuArrowColor" | "btnFontSizeSmall" | "btnFontSizeMedium" | "btnFontSizeLarge" | "btnLineHeightSmall" | "btnLineHeightMedium" | "btnLineHeightLarge" | "btnPaddingYSmall" | "btnPaddingYMedium" | "btnPaddingYLarge" | "btnDisabledBg" | "btnBorderColorWarning" | "btnBorderColorError" | "btnHeightSmall" | "btnHeightMedium" | "btnHeightLarge" | "btnLinkColor" | "btnLinkHoverColor" | "btnLinkActiveColor" | "btnLinkHoverTextDecoration" | "btnLinkIconMarginRight" | "btnErrorSecondary" | "btnWarningSecondary" | "btnOutlineColorFocus" | "btnInsetColor" | "btnBorderColorFocus" | "btnLinkDisabledColor" | "btnDisabledTextColor" | "selectPlaceholderColor" | "selectBorderWidth" | "selectPlaceholderColorDisabled" | "selectOutlineWidth" | "selectLineHeightSmall" | "selectFontSizeSmall" | "selectPaddingXSmall" | "selectPaddingYSmall" | "selectBorderRadiusSmall" | "selectIconGapSmall" | "selectLineHeightMedium" | "selectFontSizeMedium" | "selectPaddingXMedium" | "selectPaddingYMedium" | "selectBorderRadiusMedium" | "selectIconGapMedium" | "selectLineHeightLarge" | "selectFontSizeLarge" | "selectPaddingXLarge" | "selectPaddingYLarge" | "selectBorderRadiusLarge" | "selectIconGapLarge" | "selectMenuArrowColor" | "selectMenuArrowColorDisabled" | "selectIconSizeSmall" | "selectIconSizeMedium" | "selectIconSizeLarge" | "selectRootWidthMobile" | "selectTextColorDisabled" | "selectBgDisabled" | "selectBorderColorDisabled" | "tooltipPaddingY" | "tooltipPaddingX" | "tooltipCloseBtnPadding" | "tooltipCloseBtnColor" | "tooltipCloseBtnHoverColor" | "tooltipTextColor" | "tooltipBorder" | "tooltipBorderRadius" | "tooltipPinOffset" | "tooltipPinOffsetX" | "tooltipPinOffsetY" | "tooltipMargin" | "tooltipPinSize" | "tooltipFontSize" | "tooltipLineHeight" | "tooltipMenuPinOffset" | "tooltipMenuMargin" | "tooltipMenuPinSize" | "kebabPinOffset" | "kebabPinSize" | "kebabMargin" | "kebabBackground" | "kebabBackgroundHover" | "kebabBorderRadius" | "kebabBorder" | "modalBackBg" | "modalBg" | "modalBackOpacity" | "modalCloseButtonColor" | "modalCloseButtonDisabledColor" | "modalCloseButtonHoverColor" | "modalCloseButtonPadding" | "modalCloseButtonLegacyShift" | "modalCloseButtonBottomPadding" | "modalCloseButtonClickArea" | "modalCloseIconSize" | "modalCloseLegacyGap" | "modalCloseWrapperLegacyGap" | "modalBorderRadius" | "modalFixedHeaderBg" | "modalFixedHeaderShadow" | "modalFixedHeaderBorder" | "modalFixedFooterBorder" | "modalFixedFooterShadow" | "modalFixedPanelShadow" | "modalFooterBg" | "modalAdaptiveThreshold" | "modalPaddingTop" | "modalPaddingLeft" | "modalPaddingRight" | "modalHeaderFontSize" | "modalHeaderTextColor" | "modalHeaderLineHeight" | "modalHeaderPaddingBottom" | "modalHeaderPaddingTop" | "modalFixedHeaderPaddingBottom" | "modalBodyTextColor" | "modalFooterTextColor" | "modalBodyPaddingBottom" | "modalFooterPaddingTop" | "modalFooterPaddingBottom" | "modalPaddingBottom" | "modalFooterPanelPaddingTop" | "modalFooterPanelPaddingBottom" | "mobileModalCloseButtonRightPadding" | "mobileModalCloseButtonTopPadding" | "mobileModalCloseButtonClickArea" | "mobileModalCloseIconSize" | "mobileModalHeaderFontSize" | "mobileModalHeaderLineHeight" | "mobileModalHeaderPadding" | "mobileModalBodyPadding" | "mobileModalBodyFontSize" | "mobileModalFooterPadding" | "mobileModalPaddingBottom" | "sidePageFooterPanelBg" | "sidePageBackingBg" | "sidePageBackingBgOpacity" | "sidePageCloseButtonColor" | "sidePageCloseButtonHoverColor" | "sidePageContainerShadow" | "mobileSidePagePaddingLeft" | "mobileSidePagePaddingRight" | "mobileSidePagePaddingTop" | "mobileSidePagePaddingBottom" | "mobileSidePageFooterPadding" | "sidePagePaddingLeft" | "sidePagePaddingRight" | "sidePagePaddingTop" | "sidePagePaddingBottom" | "sidePageFooterPaddingTop" | "sidePageFooterPaddingBottom" | "sidePageBgDefault" | "sidePageHeaderTextColor" | "sidePageBodyTextColor" | "sidePageFooterTextColor" | "sidePageHeaderFontSize" | "sidePageHeaderLineHeight" | "sidePageHeaderPaddingBottom" | "sidePageHeaderPaddingTop" | "sidePageHeaderFixedFontSize" | "sidePageHeaderFixedLineHeight" | "sidePageHeaderFixedPaddingY" | "sidePageHeaderStickyOffset" | "sidePageCloseButtonPadding" | "mobileSidePageCloseButtonPadding" | "sidePageCloseButtonLegacyPaddingLeft" | "sidePageFooterPanelPaddingTop" | "sidePageFooterPanelPaddingBottom" | "sidePageCloseIconSize" | "sidePageCloseButtonClickArea" | "mobileSidePageCloseButtonClickArea" | "sidePageFixedHeaderShadow" | "sidePageFixedFooterShadow" | "sidePageFixedPanelShadow" | "mobileSidePageHeaderFontSize" | "mobileSidePageHeaderLineHeight" | "mobileSidePageHeaderPaddingBottom" | "mobileSidePageHeaderPaddingTop" | "dateInputIconColor" | "dateInputMaskColor" | "dateInputComponentSelectedBgColor" | "calendarCellBg" | "calendarCellHoverColor" | "calendarCellActiveHoverColor" | "calendarCellWeekendColor" | "calendarCellTodayBorder" | "calendarCellSelectedBgColor" | "calendarCellSelectedFontColor" | "calendarCellSize" | "calendarCellLineHeight" | "calendarMonthHeaderStickedBgColor" | "calendarMonthTitleBorderBottomColor" | "calendarCellHoverBgColor" | "calendarPaddingX" | "calendarMonthTitleLineHeight" | "calendarMonthTitlePaddingTop" | "calendarMonthTitlePaddingBottom" | "calendarMonthTitleMarginX" | "calendarMonthTitleMarginBottom" | "calendarWrapperHeight" | "calendarMonthMarginBottom" | "calendarMaxMonthsToAppendOnScroll" | "dateSelectLineHeight" | "dateSelectFontSize" | "dateSelectFontWeight" | "dateSelectMenuItemBgSelected" | "dateSelectTextColorDisabled" | "dateSelectTextColorDefault" | "dateSelectLinkColor" | "dateSelectPopupBoxShadow" | "dateSelectTextColorInvert" | "datePickerOpenBtnColor" | "pickerBg" | "pickerShadow" | "pickerTodayWrapperBgColor" | "pickerTodayWrapperBorderTop" | "pickerTodayWrapperHoverBgColor" | "pickerTodayWrapperFontSize" | "pickerTodayWrapperLineHeight" | "pickerTodayWrapperPaddingTop" | "pickerTodayWrapperPaddingBottom" | "dateSelectMenuBg" | "dateSelectMenuItemBgActive" | "dateSelectMenuItemBgDisabled" | "dateSelectMenuItemFontActive" | "dateSelectMenuItemFontSelected" | "dateSelectMenuItemFontDisabled" | "pagingFontSize" | "pagingForwardIconSize" | "pagingForwardIconMarginTop" | "pagingPageLinkPaddingX" | "pagingPageLinkPaddingY" | "pagingPageLinkLegacyPaddingY" | "pagingPageLinkMinWidth" | "pagingPageForwardLinkMarginTop" | "pagingPageForwardLinkMarginLeft" | "pagingPageForwardLinkPaddingRight" | "pagingLineHeight" | "pagingDotsColor" | "pagingDotsPadding" | "pagingPageLinkActiveBg" | "pagingPageLinkActiveColor" | "pagingPageLinkHoverBg" | "pagingPageLinkBorderRadius" | "pagingPageLinkHintColor" | "pagingPageLinkHintFontSize" | "pagingPageLinkHintLineHeight" | "pagingPageLinkMargin" | "pagingForwardLinkColor" | "pagingForwardLinkDisabledColor" | "hintColor" | "mobileHintColor" | "hintFontSize" | "hintLineHeight" | "hintMaxWidth" | "hintPaddingY" | "hintPaddingX" | "hintTextAlign" | "hintBgColor" | "hintBorder" | "hintBorderRadius" | "hintPinOffset" | "hintMargin" | "toastFontSize" | "toastLineHeight" | "toastPaddingY" | "toastPaddingX" | "toastBorderRadius" | "toastBorder" | "toastTop" | "toastBg" | "toastColor" | "toastLinkColor" | "toastClosePadding" | "toastCloseColor" | "toastCloseHoverColor" | "toastCloseSize" | "dropdownMenuSelectedBg" | "dropdownMenuHoverBg" | "menuBgDefault" | "menuBorderRadius" | "menuBorder" | "menuShadow" | "menuPaddingY" | "menuPaddingX" | "menuItemTextColor" | "menuItemSelectedBg" | "menuItemHoverBg" | "menuItemIconWidth" | "menuItemIconGap" | "menuItemIconLegacyMargin" | "menuItemIconLegacyShift" | "menuItemPaddingForIcon" | "menuItemLineHeight" | "menuItemFontSize" | "menuItemPaddingX" | "menuItemPaddingY" | "menuItemBorderRadius" | "menuItemLegacyPaddingX" | "menuItemLegacyPaddingY" | "menuItemHoverColor" | "menuItemDisabledColor" | "menuItemLinkColor" | "menuItemCommentColor" | "menuItemCommentColorHover" | "menuItemPaddingMobile" | "menuHeaderColor" | "menuHeaderLineHeight" | "menuHeaderFontSize" | "menuHeaderPaddingX" | "menuHeaderPaddingTop" | "menuHeaderPaddingBottom" | "menuHeaderLegacyPaddingRight" | "menuSeparatorBorderColor" | "menuSeparatorMarginY" | "menuSeparatorBorderWidth" | "toggleFontSize" | "toggleLineHeight" | "toggleTextColor" | "toggleHandleActiveWidthIncrement" | "toggleHandleBorderRadius" | "toggleHeight" | "toggleWidth" | "toggleBorderRadius" | "toggleBg" | "toggleHandleBg" | "toggleCheckedBg" | "toggleDisabledHandleBg" | "toggleBaseBg" | "toggleBgDisabled" | "toggleBgDisabledChecked" | "toggleBgHover" | "toggleCheckedBgHover" | "toggleBgChecked" | "toggleBorderWidth" | "toggleOutlineWidth" | "toggleBorderColor" | "toggleBorderColorDisabled" | "toggleBorderColorDisabledChecked" | "toggleHandleSize" | "toggleHandleLeft" | "toggleHandleTop" | "toggleBgFocus" | "toggleBgActive" | "toggleShadowColorError" | "toggleShadowColorWarning" | "toggleFocusShadowColor" | "toggleCaptionGap" | "toggleButtonOffsetY" | "popupBorder" | "popupBorderRadius" | "popupBorderColor" | "popupDropShadow" | "popupBoxShadow" | "popupTextColor" | "popupBackground" | "popupPinOffset" | "popupPinOffsetX" | "popupPinOffsetY" | "popupMargin" | "popupPinSize" | "inputTextColor" | "inputShadow" | "inputBg" | "inputIconColor" | "inputColor" | "inputWidth" | "inputTextColorDisabled" | "inputFontSizeSmall" | "inputFontSizeMedium" | "inputFontSizeLarge" | "inputLineHeightSmall" | "inputLineHeightMedium" | "inputLineHeightLarge" | "inputHeightSmall" | "inputHeightMedium" | "inputHeightLarge" | "inputPaddingYSmall" | "inputPaddingYMedium" | "inputPaddingYLarge" | "inputPaddingXSmall" | "inputPaddingXMedium" | "inputPaddingXLarge" | "inputIconGapSmall" | "inputIconGapMedium" | "inputIconGapLarge" | "inputIconSizeSmall" | "inputIconSizeMedium" | "inputIconSizeLarge" | "inputFocusShadow" | "inputDisabledBg" | "inputDisabledBorderColor" | "inputFocusOutline" | "inputBorderWidth" | "inputOutlineWidth" | "inputBorderRadiusSmall" | "inputBorderRadiusMedium" | "inputBorderRadiusLarge" | "inputBorderColor" | "inputBorderColorFocus" | "inputBorderColorError" | "inputBorderColorWarning" | "inputBorderTopColor" | "inputPlaceholderColor" | "inputPlaceholderColorDisabled" | "inputPlaceholderColorLight" | "inputBlinkColor" | "checkboxFontSize" | "checkboxLineHeight" | "checkboxBoxSize" | "checkboxCaptionGap" | "checkboxPaddingY" | "checkboxBoxOffsetY" | "checkboxBgStart" | "checkboxBgEnd" | "checkboxTextColorDefault" | "checkboxTextColorDisabled" | "checkboxShadowDisabled" | "checkboxBorder" | "checkboxBorderWidth" | "checkboxShadow" | "checkboxShadowHover" | "checkboxCheckedColor" | "checkboxOutlineColorFocus" | "checkboxBorderColorWarning" | "checkboxBorderColorError" | "checkboxCheckedHoverShadow" | "checkboxBorderRadius" | "checkboxOutlineWidth" | "checkboxCheckedShadow" | "checkboxCheckedActiveShadow" | "checkboxBorderColorFocus" | "checkboxBg" | "checkboxHoverBg" | "checkboxActiveBg" | "checkboxCheckedBg" | "checkboxBgDisabled" | "checkboxCheckedHoverBg" | "checkboxCheckedActiveBg" | "checkboxShadowActive" | "textareaBg" | "textareaColor" | "textareaTextColorDisabled" | "textareaPlaceholderColorLight" | "textareaPlaceholderColor" | "textareaPlaceholderColorDisabled" | "textareaShadow" | "textareaFontSize" | "textareaLineHeight" | "textareaBorderRadius" | "textareaBorderWidth" | "textareaOutlineWidth" | "textareaMinHeight" | "textareaWidth" | "textareaPaddingX" | "textareaPaddingY" | "textareaBorderColor" | "textareaBorderTopColor" | "textareaBorderColorFocus" | "textareaBorderColorWarning" | "textareaBorderColorError" | "textareaDisabledBg" | "textareaDisabledBorderColor" | "textareaCounterColor" | "textareaCounterBg" | "textareaCounterErrorColor" | "textareaCounterHelpIconColor" | "radioBulletSize" | "radioOutlineWidth" | "radioTextColor" | "radioSize" | "radioSizeAfter" | "radioFontSize" | "radioLineHeight" | "radioCaptionGap" | "radioPaddingY" | "radioVerticalAlign" | "radioBgImage" | "radioBgColor" | "radioHoverBg" | "radioActiveBg" | "radioBorderWidth" | "radioBorderColor" | "radioBoxShadow" | "radioBorder" | "radioBorderColorFocus" | "radioBorderColorWarning" | "radioBorderColorError" | "radioHoverShadow" | "radioActiveShadow" | "radioFocusShadow" | "radioCheckedBgColor" | "radioCheckedBorderColor" | "radioCheckedBulletColor" | "radioCheckedHoverBgColor" | "radioDisabledBg" | "radioDisabledShadow" | "radioCaptionDisplay" | "radioBorderWidthCompensation" | "radioCircleOffsetY" | "radioGroupLegacyItemGap" | "tabFontSize" | "tabPaddingX" | "tabsMarginX" | "tabPaddingY" | "tabLineHeight" | "tabBorderWidth" | "tabOutlineWidth" | "tabTextColorDefault" | "tabColorFocus" | "tabColorError" | "tabColorWarning" | "tabColorSuccess" | "tabColorPrimary" | "tabColorHover" | "tabColorHoverError" | "tabColorHoverWarning" | "tabColorHoverSuccess" | "tabColorHoverPrimary" | "spinnerBgColor" | "spinnerColor" | "spinnerDimmedColor" | "spinnerCaptionColor" | "spinnerFontSizeSmall" | "spinnerFontSizeMedium" | "spinnerFontSizeLarge" | "spinnerLineHeightSmall" | "spinnerLineHeightMedium" | "spinnerLineHeightLarge" | "spinnerCaptionGapSmall" | "spinnerCaptionGapMedium" | "spinnerCaptionGapLarge" | "switcherBorderRadius" | "switcherTextColor" | "switcherOutlineWidth" | "switcherCaptionFontSizeSmall" | "switcherCaptionFontSizeMedium" | "switcherCaptionFontSizeLarge" | "switcherCaptionLineHeightSmall" | "switcherCaptionLineHeightMedium" | "switcherCaptionLineHeightLarge" | "switcherCaptionGapSmall" | "switcherCaptionGapMedium" | "switcherCaptionGapLarge" | "switcherButtonPaddingXSmall" | "switcherButtonPaddingXMedium" | "switcherButtonPaddingXLarge" | "switcherButtonPaddingYSmall" | "switcherButtonPaddingYMedium" | "switcherButtonPaddingYLarge" | "switcherButtonLineHeightSmall" | "switcherButtonLineHeightMedium" | "switcherButtonLineHeightLarge" | "switcherButtonFontSizeSmall" | "switcherButtonFontSizeMedium" | "switcherButtonFontSizeLarge" | "switcherButtonBorderRadiusSmall" | "switcherButtonBorderRadiusMedium" | "switcherButtonBorderRadiusLarge" | "switcherButtonBorderWidth" | "switcherButtonDisabledBorderColor" | "switcherButtonCheckedDisabledShadow" | "mobilePopupTopPadding" | "mobilePopupHeaderPadding" | "mobilePopupHeaderBorderRadius" | "mobilePopupHeaderShadow" | "mobilePopupHeaderFontSize" | "mobilePopupHeaderLineHeight" | "mobilePopupHeaderFontWeight" | "mobilePopupHeaderChildPadding" | "scrollContainerScrollBarSize" | "scrollContainerScrollBarHoverSize" | "scrollContainerScrollBarColor" | "scrollContainerScrollBarInvertColor" | "passwordInputVisibilityIconColor" | "passwordInputVisibilityIconOpacity" | "passwordInputVisibilityIconHoverColor" | "passwordInputVisibilityIconHoverOpacity" | "globalLoaderColor" | "globalLoaderHeight" | "globalLoaderWidth" | "globalLoaderPosition" | "globalLoaderTop" | "globalLoaderLeft" | "globalLoaderBottom" | "globalLoaderRight" | "globalLoaderBackgroundColor" | "globalLoaderTransitionToSpinnerDuration" | "globalLoaderSpinnerAnimationDuration" | "globalLoaderSlowAnimationDuration" | "globalLoaderTransitionFromSpinnerDuration" | "fileUploaderWidth" | "fileUploaderBg" | "fileUploaderFontSize" | "fileUploaderLineHeight" | "fileUploaderTextColorDefault" | "fileUploaderPaddingX" | "fileUploaderPaddingY" | "fileUploaderBorderRadius" | "fileUploaderBorderColor" | "fileUploaderBorderWidth" | "fileUploaderBorderStyle" | "fileUploaderBorderColorFocus" | "fileUploaderLinkColor" | "fileUploaderIconSize" | "fileUploaderIconColor" | "fileUploaderIconHoverColor" | "fileUploaderBorderColorError" | "fileUploaderBorderColorWarning" | "fileUploaderDisabledBg" | "fileUploaderDisabledBorderColor" | "fileUploaderDisabledTextColor" | "fileUploaderDisabledLinkColor" | "fileUploaderDisabledIconColor" | "fileUploaderLinkHoverTextDecoration" | "fileUploaderHoveredBg")[];
21
21
  export declare const CALLS_COUNT: number;
22
22
  export declare const EXECUTION_TIME: number;