@skbkontur/react-ui 6.0.0-beta.4 → 6.0.1-cd7d7.0

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 (75) hide show
  1. package/CHANGELOG.md +135 -0
  2. package/README.md +2 -2
  3. package/components/DateInput/DateInput.js +1 -1
  4. package/components/DateInput/DateInput.js.map +1 -1
  5. package/components/FileUploader/FileUploader.js +1 -0
  6. package/components/FileUploader/FileUploader.js.map +1 -1
  7. package/components/FileUploader/FileUploader.styles.d.ts +1 -0
  8. package/components/FileUploader/FileUploader.styles.js +7 -4
  9. package/components/FileUploader/FileUploader.styles.js.map +1 -1
  10. package/components/SingleToast/SingleToast.js +1 -1
  11. package/components/SingleToast/SingleToast.js.map +1 -1
  12. package/components/Textarea/Textarea.styles.js +1 -1
  13. package/components/Textarea/Textarea.styles.js.map +1 -1
  14. package/components/TokenInput/TokenInput.js +1 -1
  15. package/components/TokenInput/TokenInput.js.map +1 -1
  16. package/components/TokenInput/TokenInput.styles.d.ts +1 -0
  17. package/components/TokenInput/TokenInput.styles.js +6 -2
  18. package/components/TokenInput/TokenInput.styles.js.map +1 -1
  19. package/components/Tooltip/Tooltip.js +5 -6
  20. package/components/Tooltip/Tooltip.js.map +1 -1
  21. package/internal/CustomComboBox/ComboBoxView.d.ts +1 -4
  22. package/internal/CustomComboBox/ComboBoxView.js +1 -1
  23. package/internal/CustomComboBox/ComboBoxView.js.map +1 -1
  24. package/internal/CustomComboBox/CustomComboBox.js +1 -1
  25. package/internal/CustomComboBox/CustomComboBox.js.map +1 -1
  26. package/internal/FocusTrap/FocusTrap.d.ts +1 -0
  27. package/internal/FocusTrap/FocusTrap.js +6 -6
  28. package/internal/FocusTrap/FocusTrap.js.map +1 -1
  29. package/internal/InputLikeText/InputLikeText.js +1 -1
  30. package/internal/InputLikeText/InputLikeText.js.map +1 -1
  31. package/internal/InternalTextareaWithLayout/InternalTextareaWithLayout.js +0 -1
  32. package/internal/InternalTextareaWithLayout/InternalTextareaWithLayout.js.map +1 -1
  33. package/internal/MobilePopup/MobilePopup.d.ts +7 -0
  34. package/internal/MobilePopup/MobilePopup.js +14 -1
  35. package/internal/MobilePopup/MobilePopup.js.map +1 -1
  36. package/internal/MobilePopup/MobilePopup.styles.js +1 -1
  37. package/internal/MobilePopup/MobilePopup.styles.js.map +1 -1
  38. package/internal/Popup/Popup.d.ts +15 -1
  39. package/internal/Popup/Popup.js +169 -33
  40. package/internal/Popup/Popup.js.map +1 -1
  41. package/internal/Popup/PopupHelper.d.ts +29 -2
  42. package/internal/Popup/PopupHelper.js +109 -7
  43. package/internal/Popup/PopupHelper.js.map +1 -1
  44. package/internal/RenderContainer/RenderContainer.d.ts +4 -0
  45. package/internal/RenderContainer/RenderContainer.js +52 -5
  46. package/internal/RenderContainer/RenderContainer.js.map +1 -1
  47. package/internal/RenderLayer/RenderLayer.d.ts +1 -0
  48. package/internal/RenderLayer/RenderLayer.js +5 -7
  49. package/internal/RenderLayer/RenderLayer.js.map +1 -1
  50. package/internal/themes/BasicTheme.d.ts +0 -2
  51. package/internal/themes/BasicTheme.js +7 -9
  52. package/internal/themes/BasicTheme.js.map +1 -1
  53. package/internal/themes/DarkTheme6_0.js +3 -3
  54. package/internal/themes/DarkTheme6_0.js.map +1 -1
  55. package/lib/getElementRef.js +1 -4
  56. package/lib/getElementRef.js.map +1 -1
  57. package/lib/listenFocusOutside.d.ts +2 -0
  58. package/lib/listenFocusOutside.js +19 -2
  59. package/lib/listenFocusOutside.js.map +1 -1
  60. package/lib/renderEnvironment/RenderEnvironmentContext.d.ts +5 -0
  61. package/lib/renderEnvironment/RenderEnvironmentContext.js +17 -11
  62. package/lib/renderEnvironment/RenderEnvironmentContext.js.map +1 -1
  63. package/lib/shadowDom/isShadowRoot.d.ts +1 -0
  64. package/lib/shadowDom/isShadowRoot.js +2 -0
  65. package/lib/shadowDom/isShadowRoot.js.map +1 -0
  66. package/lib/styles/ColorFunctions.d.ts +20 -0
  67. package/lib/styles/ColorFunctions.js +20 -1
  68. package/lib/styles/ColorFunctions.js.map +1 -1
  69. package/lib/styles/ColorKeywords.d.ts +1 -0
  70. package/lib/styles/ColorKeywords.js +1 -0
  71. package/lib/styles/ColorKeywords.js.map +1 -1
  72. package/lib/theming/Emotion.d.ts +27 -1
  73. package/lib/theming/Emotion.js +20 -5
  74. package/lib/theming/Emotion.js.map +1 -1
  75. package/package.json +5 -5
@@ -43,14 +43,21 @@ var shiftColor = function (colorString, a, sign, method) {
43
43
  }
44
44
  return newColor.toColorString(color.type);
45
45
  };
46
+ /**
47
+ * @deprecated Устарело в пользу нативного CSS color-mix(). Будет удалено в версии 7.0.
48
+ * Пример: color: color-mix(in srgb, #3498db, white 20%);
49
+ */
46
50
  export function lighten(colorString, amount, method) {
47
51
  var key = buildCacheKey('lighten', colorString, amount, method);
48
52
  if (ColorFunctionsCache[key] === undefined) {
49
53
  ColorFunctionsCache[key] = shiftColor(colorString, amount, '+', method);
50
- return ColorFunctionsCache[key];
51
54
  }
52
55
  return ColorFunctionsCache[key];
53
56
  }
57
+ /**
58
+ * @deprecated Устарело в пользу нативного CSS color-mix(). Будет удалено в версии 7.0.
59
+ * Пример: color: color-mix(in srgb, #3498db, black 20%);
60
+ */
54
61
  export function darken(colorString, amount, method) {
55
62
  var key = buildCacheKey('darken', colorString, amount, method);
56
63
  if (ColorFunctionsCache[key] === undefined) {
@@ -59,6 +66,9 @@ export function darken(colorString, amount, method) {
59
66
  }
60
67
  return ColorFunctionsCache[key];
61
68
  }
69
+ /**
70
+ * @deprecated Устарело. Рекомендуется использовать CSS Relative Color Syntax или CSS-переменные. Будет удалено в версии 7.0.
71
+ */
62
72
  export function contrast(colorString, darkString, lightString, threshold) {
63
73
  var _a;
64
74
  if (threshold === void 0) { threshold = 0.43; }
@@ -83,22 +93,27 @@ export function contrast(colorString, darkString, lightString, threshold) {
83
93
  }
84
94
  return ColorFunctionsCache[key];
85
95
  }
96
+ /** @deprecated Устарело в пользу CSS Relative Color Syntax (например, from #3498db r). Будет удалено в версии 7.0. */
86
97
  export var red = function (colorString) {
87
98
  var color = ColorFactory.create(colorString);
88
99
  return color.rgb[0];
89
100
  };
101
+ /** @deprecated Устарело в пользу CSS Relative Color Syntax (например, from #3498db g). Будет удалено в версии 7.0. */
90
102
  export var green = function (colorString) {
91
103
  var color = ColorFactory.create(colorString);
92
104
  return color.rgb[1];
93
105
  };
106
+ /** @deprecated Устарело в пользу CSS Relative Color Syntax (например, from #3498db b). Будет удалено в версии 7.0. */
94
107
  export var blue = function (colorString) {
95
108
  var color = ColorFactory.create(colorString);
96
109
  return color.rgb[2];
97
110
  };
111
+ /** @deprecated Устарело в пользу CSS Relative Color Syntax или color-mix. Будет удалено в версии 7.0. */
98
112
  export var alpha = function (colorString) {
99
113
  var color = ColorFactory.create(colorString);
100
114
  return color.alpha;
101
115
  };
116
+ /** @deprecated Устарело. Валидация на стороне JS не требуется при использовании нативного CSS. Будет удалено в версии 7.0. */
102
117
  export var isValid = function (colorString) {
103
118
  try {
104
119
  ColorFactory.create(colorString);
@@ -108,6 +123,10 @@ export var isValid = function (colorString) {
108
123
  return false;
109
124
  }
110
125
  };
126
+ /**
127
+ * @deprecated Устарело в пользу нативного CSS color-mix(). Будет удалено в версии 7.0.
128
+ * Пример: color: color-mix(in srgb, #3498db, transparent 50%);
129
+ */
111
130
  export var fade = function (colorString, alpha) {
112
131
  var key = buildCacheKey('fade', colorString, alpha);
113
132
  if (ColorFunctionsCache[key] === undefined) {
@@ -1 +1 @@
1
- {"version":3,"file":"ColorFunctions.js","sourceRoot":"","sources":["../../../lib/styles/ColorFunctions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAMjD,IAAM,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AACpD,IAAM,aAAa,GAAG,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;IACzC,IAAI,CAAC;QACH,YAAY,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC;AACF,MAAM,CAAC,IAAM,IAAI,GAAG,UAAC,WAAmB,EAAE,KAAa;IACrD,IAAM,GAAG,GAAG,aAAa,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;IAEtD,IAAI,mBAAmB,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE,CAAC;QAC3C,IAAM,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,KAAK,EAAE,CAAC;QACvD,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;QACpB,mBAAmB,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7F,CAAC;IACD,OAAO,mBAAmB,CAAC,GAAG,CAAC,CAAC;AAClC,CAAC,CAAC","sourcesContent":["import { clamp, floatFromPercent } from './ColorHelpers.js';\nimport { ColorFactory } from './ColorFactory.js';\nimport type { ColorObject } from './ColorObject.js';\n\ntype SignType = '+' | '-';\ntype MethodType = 'absolute' | 'relative';\n\nconst DEFAULT_DARK = ColorFactory.create('#333333');\nconst DEFAULT_LIGHT = ColorFactory.create('#fff');\nconst ColorFunctionsCache: { [key: string]: string } = Object.create(null);\n\nconst buildCacheKey = (name: string, ...args: any[]) => `${name}(${args.join()})`;\n\nconst shiftColor = (colorString: string, a: number | string, sign: SignType, method?: MethodType): string => {\n if (!colorString) {\n return '';\n }\n\n if (colorString.toLowerCase() === 'transparent') {\n return 'transparent';\n }\n\n let amount: number;\n if (typeof a === 'string') {\n amount = a.endsWith('%') ? floatFromPercent(a) : parseFloat(a);\n } else {\n amount = a;\n }\n amount = clamp(amount, 1);\n\n const color = ColorFactory.create(colorString);\n const hsl = color.toHSL();\n\n if (sign === '+') {\n hsl.l += method === 'relative' ? hsl.l * amount : amount;\n } else {\n hsl.l -= method === 'relative' ? hsl.l * amount : amount;\n }\n\n hsl.l = clamp(hsl.l);\n\n let newColor: ColorObject;\n if (color.alpha < 1) {\n newColor = ColorFactory.create(`hsla(${hsl.h}, ${hsl.s}, ${hsl.l}, ${hsl.a})`);\n } else {\n newColor = ColorFactory.create(`hsl(${hsl.h}, ${hsl.s}, ${hsl.l})`);\n }\n return newColor.toColorString(color.type);\n};\n\nexport function lighten(colorString: string, amount: number | string, method?: MethodType): string {\n const key = buildCacheKey('lighten', colorString, amount, method);\n if (ColorFunctionsCache[key] === undefined) {\n ColorFunctionsCache[key] = shiftColor(colorString, amount, '+', method);\n return ColorFunctionsCache[key];\n }\n return ColorFunctionsCache[key];\n}\nexport function darken(colorString: string, amount: number | string, method?: MethodType): string {\n const key = buildCacheKey('darken', colorString, amount, method);\n if (ColorFunctionsCache[key] === undefined) {\n ColorFunctionsCache[key] = shiftColor(colorString, amount, '-', method);\n return ColorFunctionsCache[key];\n }\n\n return ColorFunctionsCache[key];\n}\nexport function contrast(colorString: string, darkString?: string, lightString?: string, threshold = 0.43): string {\n const key = buildCacheKey('contrast', colorString, darkString, lightString, threshold);\n if (!colorString) {\n ColorFunctionsCache[key] = '';\n }\n if (ColorFunctionsCache[key] === undefined) {\n const color = ColorFactory.create(colorString);\n let dark = typeof darkString === 'undefined' ? DEFAULT_DARK : ColorFactory.create(darkString);\n let light = typeof lightString === 'undefined' ? DEFAULT_LIGHT : ColorFactory.create(lightString);\n\n // Figure out which is actually light and dark:\n if (dark.luma() > light.luma()) {\n [dark, light] = [light, dark];\n }\n\n if (color.luma() < threshold) {\n ColorFunctionsCache[key] = light.alpha < 1 ? light.toRGBString() : light.toHEXString();\n } else {\n ColorFunctionsCache[key] = dark.alpha < 1 ? dark.toRGBString() : dark.toHEXString();\n }\n }\n return ColorFunctionsCache[key];\n}\n\nexport const red = (colorString: string): number => {\n const color = ColorFactory.create(colorString);\n return color.rgb[0];\n};\nexport const green = (colorString: string): number => {\n const color = ColorFactory.create(colorString);\n return color.rgb[1];\n};\nexport const blue = (colorString: string): number => {\n const color = ColorFactory.create(colorString);\n return color.rgb[2];\n};\nexport const alpha = (colorString: string): number => {\n const color = ColorFactory.create(colorString);\n return color.alpha;\n};\nexport const isValid = (colorString: string): boolean => {\n try {\n ColorFactory.create(colorString);\n return true;\n } catch (e) {\n return false;\n }\n};\nexport const fade = (colorString: string, alpha: number): string => {\n const key = buildCacheKey('fade', colorString, alpha);\n\n if (ColorFunctionsCache[key] === undefined) {\n const color = ColorFactory.create(colorString).clone();\n color.alpha = alpha;\n ColorFunctionsCache[key] = color.toColorString(color.type === 'hex' ? 'rgba' : color.type);\n }\n return ColorFunctionsCache[key];\n};\n"]}
1
+ {"version":3,"file":"ColorFunctions.js","sourceRoot":"","sources":["../../../lib/styles/ColorFunctions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAMjD,IAAM,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AACpD,IAAM,aAAa,GAAG,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAClD,IAAM,mBAAmB,GAA8B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAE3E,IAAM,aAAa,GAAG,UAAC,IAAY;IAAE,cAAc;SAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;QAAd,6BAAc;;IAAK,OAAA,UAAG,IAAI,cAAI,IAAI,CAAC,IAAI,EAAE,MAAG;AAAzB,CAAyB,CAAC;AAElF,IAAM,UAAU,GAAG,UAAC,WAAmB,EAAE,CAAkB,EAAE,IAAc,E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a,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;IAEtD,IAAI,mBAAmB,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE,CAAC;QAC3C,IAAM,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,KAAK,EAAE,CAAC;QACvD,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;QACpB,mBAAmB,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7F,CAAC;IACD,OAAO,mBAAmB,CAAC,GAAG,CAAC,CAAC;AAClC,CAAC,CAAC","sourcesContent":["import { clamp, floatFromPercent } from './ColorHelpers.js';\nimport { ColorFactory } from './ColorFactory.js';\nimport type { ColorObject } from './ColorObject.js';\n\ntype SignType = '+' | '-';\ntype MethodType = 'absolute' | 'relative';\n\nconst DEFAULT_DARK = ColorFactory.create('#333333');\nconst DEFAULT_LIGHT = ColorFactory.create('#fff');\nconst ColorFunctionsCache: { [key: string]: string } = Object.create(null);\n\nconst buildCacheKey = (name: string, ...args: any[]) => `${name}(${args.join()})`;\n\nconst shiftColor = (colorString: string, a: number | string, sign: SignType, method?: MethodType): string => {\n if (!colorString) {\n return '';\n }\n\n if (colorString.toLowerCase() === 'transparent') {\n return 'transparent';\n }\n\n let amount: number;\n if (typeof a === 'string') {\n amount = a.endsWith('%') ? floatFromPercent(a) : parseFloat(a);\n } else {\n amount = a;\n }\n amount = clamp(amount, 1);\n\n const color = ColorFactory.create(colorString);\n const hsl = color.toHSL();\n\n if (sign === '+') {\n hsl.l += method === 'relative' ? hsl.l * amount : amount;\n } else {\n hsl.l -= method === 'relative' ? hsl.l * amount : amount;\n }\n\n hsl.l = clamp(hsl.l);\n\n let newColor: ColorObject;\n if (color.alpha < 1) {\n newColor = ColorFactory.create(`hsla(${hsl.h}, ${hsl.s}, ${hsl.l}, ${hsl.a})`);\n } else {\n newColor = ColorFactory.create(`hsl(${hsl.h}, ${hsl.s}, ${hsl.l})`);\n }\n return newColor.toColorString(color.type);\n};\n\n/**\n * @deprecated Устарело в пользу нативного CSS color-mix(). Будет удалено в версии 7.0.\n * Пример: color: color-mix(in srgb, #3498db, white 20%);\n */\nexport function lighten(colorString: string, amount: number | string, method?: MethodType): string {\n const key = buildCacheKey('lighten', colorString, amount, method);\n if (ColorFunctionsCache[key] === undefined) {\n ColorFunctionsCache[key] = shiftColor(colorString, amount, '+', method);\n }\n return ColorFunctionsCache[key];\n}\n\n/**\n * @deprecated Устарело в пользу нативного CSS color-mix(). Будет удалено в версии 7.0.\n * Пример: color: color-mix(in srgb, #3498db, black 20%);\n */\nexport function darken(colorString: string, amount: number | string, method?: MethodType): string {\n const key = buildCacheKey('darken', colorString, amount, method);\n if (ColorFunctionsCache[key] === undefined) {\n ColorFunctionsCache[key] = shiftColor(colorString, amount, '-', method);\n return ColorFunctionsCache[key];\n }\n\n return ColorFunctionsCache[key];\n}\n\n/**\n * @deprecated Устарело. Рекомендуется использовать CSS Relative Color Syntax или CSS-переменные. Будет удалено в версии 7.0.\n */\nexport function contrast(colorString: string, darkString?: string, lightString?: string, threshold = 0.43): string {\n const key = buildCacheKey('contrast', colorString, darkString, lightString, threshold);\n if (!colorString) {\n ColorFunctionsCache[key] = '';\n }\n if (ColorFunctionsCache[key] === undefined) {\n const color = ColorFactory.create(colorString);\n let dark = typeof darkString === 'undefined' ? DEFAULT_DARK : ColorFactory.create(darkString);\n let light = typeof lightString === 'undefined' ? DEFAULT_LIGHT : ColorFactory.create(lightString);\n\n // Figure out which is actually light and dark:\n if (dark.luma() > light.luma()) {\n [dark, light] = [light, dark];\n }\n\n if (color.luma() < threshold) {\n ColorFunctionsCache[key] = light.alpha < 1 ? light.toRGBString() : light.toHEXString();\n } else {\n ColorFunctionsCache[key] = dark.alpha < 1 ? dark.toRGBString() : dark.toHEXString();\n }\n }\n return ColorFunctionsCache[key];\n}\n\n/** @deprecated Устарело в пользу CSS Relative Color Syntax (например, from #3498db r). Будет удалено в версии 7.0. */\nexport const red = (colorString: string): number => {\n const color = ColorFactory.create(colorString);\n return color.rgb[0];\n};\n\n/** @deprecated Устарело в пользу CSS Relative Color Syntax (например, from #3498db g). Будет удалено в версии 7.0. */\nexport const green = (colorString: string): number => {\n const color = ColorFactory.create(colorString);\n return color.rgb[1];\n};\n\n/** @deprecated Устарело в пользу CSS Relative Color Syntax (например, from #3498db b). Будет удалено в версии 7.0. */\nexport const blue = (colorString: string): number => {\n const color = ColorFactory.create(colorString);\n return color.rgb[2];\n};\n\n/** @deprecated Устарело в пользу CSS Relative Color Syntax или color-mix. Будет удалено в версии 7.0. */\nexport const alpha = (colorString: string): number => {\n const color = ColorFactory.create(colorString);\n return color.alpha;\n};\n\n/** @deprecated Устарело. Валидация на стороне JS не требуется при использовании нативного CSS. Будет удалено в версии 7.0. */\nexport const isValid = (colorString: string): boolean => {\n try {\n ColorFactory.create(colorString);\n return true;\n } catch (e) {\n return false;\n }\n};\n\n/**\n * @deprecated Устарело в пользу нативного CSS color-mix(). Будет удалено в версии 7.0.\n * Пример: color: color-mix(in srgb, #3498db, transparent 50%);\n */\nexport const fade = (colorString: string, alpha: number): string => {\n const key = buildCacheKey('fade', colorString, alpha);\n\n if (ColorFunctionsCache[key] === undefined) {\n const color = ColorFactory.create(colorString).clone();\n color.alpha = alpha;\n ColorFunctionsCache[key] = color.toColorString(color.type === 'hex' ? 'rgba' : color.type);\n }\n return ColorFunctionsCache[key];\n};\n"]}
@@ -1,3 +1,4 @@
1
+ /** @deprecated Используйте библиотеку цветов Colors 2.x. Будет удалено в 7.0 */
1
2
  export declare const ColorKeywords: {
2
3
  aliceblue: string;
3
4
  antiquewhite: string;
@@ -1,3 +1,4 @@
1
+ /** @deprecated Используйте библиотеку цветов Colors 2.x. Будет удалено в 7.0 */
1
2
  export var ColorKeywords = {
2
3
  aliceblue: '#f0f8ff',
3
4
  antiquewhite: '#faebd7',
@@ -1 +1 @@
1
- {"version":3,"file":"ColorKeywords.js","sourceRoot":"","sources":["../../../lib/styles/ColorKeywords.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,aAAa,GAAG;IAC3B,SAAS,EAAE,SAAS;IACpB,YAAY,EAAE,SAAS;IACvB,IAAI,EAAE,SAAS;IACf,UAAU,EAAE,SAAS;IACrB,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,SAAS;IAChB,cAAc,EAAE,SAAS;IACzB,IAAI,EAAE,SAAS;IACf,UAAU,EAAE,SAAS;IACrB,KAAK,EAAE,SAAS;IAChB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IACpB,UAAU,EAAE,SAAS;IACrB,SAAS,EAAE,SAAS;IACpB,KAAK,EAAE,SAAS;IAChB,cAAc,EAAE,SAAS;IACzB,QAAQ,EAAE,SAAS;IACnB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,SAAS;IACnB,aAAa,EAAE,SAAS;IACxB,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,SAAS;IACnB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IACpB,WAAW,EAAE,SAAS;IACtB,cAAc,EAAE,SAAS;IACzB,UAAU,EAAE,SAAS;IACrB,UAAU,EAAE,SAAS;IACrB,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,SAAS;IACrB,YAAY,EAAE,SAAS;IACvB,aAAa,EAAE,SAAS;IACxB,aAAa,EAAE,SAAS;IACxB,aAAa,EAAE,SAAS;IACxB,aAAa,EAAE,SAAS;IACxB,UAAU,EAAE,SAAS;IACrB,QAAQ,EAAE,SAAS;IACnB,WAAW,EAAE,SAAS;IACtB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;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B,MAAM,EAAE,SAAS;IACjB,WAAW,EAAE,SAAS;CACvB,CAAC","sourcesContent":["export const ColorKeywords = {\n aliceblue: '#f0f8ff',\n antiquewhite: '#faebd7',\n aqua: '#00ffff',\n aquamarine: '#7fffd4',\n azure: '#f0ffff',\n beige: '#f5f5dc',\n bisque: '#ffe4c4',\n black: '#000000',\n blanchedalmond: '#ffebcd',\n blue: '#0000ff',\n blueviolet: '#8a2be2',\n brown: '#a52a2a',\n burlywood: '#deb887',\n cadetblue: '#5f9ea0',\n chartreuse: '#7fff00',\n chocolate: '#d2691e',\n coral: '#ff7f50',\n cornflowerblue: '#6495ed',\n cornsilk: '#fff8dc',\n crimson: '#dc143c',\n cyan: '#00ffff',\n darkblue: '#00008b',\n darkcyan: '#008b8b',\n darkgoldenrod: '#b8860b',\n darkgray: '#a9a9a9',\n darkgrey: '#a9a9a9',\n darkgreen: '#006400',\n darkkhaki: '#bdb76b',\n darkmagenta: '#8b008b',\n darkolivegreen: '#556b2f',\n darkorange: '#ff8c00',\n darkorchid: '#9932cc',\n darkred: '#8b0000',\n darksalmon: '#e9967a',\n darkseagreen: '#8fbc8f',\n darkslateblue: '#483d8b',\n darkslategray: '#2f4f4f',\n darkslategrey: '#2f4f4f',\n darkturquoise: '#00ced1',\n darkviolet: '#9400d3',\n deeppink: '#ff1493',\n deepskyblue: '#00bfff',\n dimgray: '#696969',\n dimgrey: '#696969',\n dodgerblue: '#1e90ff',\n firebrick: '#b22222',\n floralwhite: '#fffaf0',\n forestgreen: '#228b22',\n fuchsia: '#ff00ff',\n gainsboro: '#dcdcdc',\n ghostwhite: '#f8f8ff',\n gold: '#ffd700',\n goldenrod: '#daa520',\n gray: '#808080',\n grey: '#808080',\n green: '#008000',\n greenyellow: '#adff2f',\n honeydew: '#f0fff0',\n hotpink: '#ff69b4',\n indianred: '#cd5c5c',\n indigo: '#4b0082',\n ivory: '#fffff0',\n khaki: '#f0e68c',\n lavender: '#e6e6fa',\n lavenderblush: '#fff0f5',\n lawngreen: '#7cfc00',\n lemonchiffon: '#fffacd',\n lightblue: '#add8e6',\n lightcoral: '#f08080',\n lightcyan: '#e0ffff',\n lightgoldenrodyellow: '#fafad2',\n lightgray: '#d3d3d3',\n lightgrey: '#d3d3d3',\n lightgreen: '#90ee90',\n lightpink: '#ffb6c1',\n lightsalmon: '#ffa07a',\n lightseagreen: '#20b2aa',\n lightskyblue: '#87cefa',\n lightslategray: '#778899',\n lightslategrey: '#778899',\n lightsteelblue: '#b0c4de',\n lightyellow: '#ffffe0',\n lime: '#00ff00',\n limegreen: '#32cd32',\n linen: '#faf0e6',\n magenta: '#ff00ff',\n maroon: '#800000',\n mediumaquamarine: '#66cdaa',\n mediumblue: '#0000cd',\n mediumorchid: '#ba55d3',\n mediumpurple: '#9370d8',\n mediumseagreen: '#3cb371',\n mediumslateblue: '#7b68ee',\n mediumspringgreen: '#00fa9a',\n mediumturquoise: '#48d1cc',\n mediumvioletred: '#c71585',\n midnightblue: '#191970',\n mintcream: '#f5fffa',\n mistyrose: '#ffe4e1',\n moccasin: '#ffe4b5',\n navajowhite: '#ffdead',\n navy: '#000080',\n oldlace: '#fdf5e6',\n olive: '#808000',\n olivedrab: '#6b8e23',\n orange: '#ffa500',\n orangered: '#ff4500',\n orchid: '#da70d6',\n palegoldenrod: '#eee8aa',\n palegreen: '#98fb98',\n paleturquoise: '#afeeee',\n palevioletred: '#d87093',\n papayawhip: '#ffefd5',\n peachpuff: '#ffdab9',\n peru: '#cd853f',\n pink: '#ffc0cb',\n plum: '#dda0dd',\n powderblue: '#b0e0e6',\n purple: '#800080',\n rebeccapurple: '#663399',\n red: '#ff0000',\n rosybrown: '#bc8f8f',\n royalblue: '#4169e1',\n saddlebrown: '#8b4513',\n salmon: '#fa8072',\n sandybrown: '#f4a460',\n seagreen: '#2e8b57',\n seashell: '#fff5ee',\n sienna: '#a0522d',\n silver: '#c0c0c0',\n skyblue: '#87ceeb',\n slateblue: '#6a5acd',\n slategray: '#708090',\n slategrey: '#708090',\n snow: '#fffafa',\n springgreen: '#00ff7f',\n steelblue: '#4682b4',\n tan: '#d2b48c',\n teal: '#008080',\n thistle: '#d8bfd8',\n tomato: '#ff6347',\n turquoise: '#40e0d0',\n violet: '#ee82ee',\n wheat: '#f5deb3',\n white: '#ffffff',\n whitesmoke: '#f5f5f5',\n yellow: '#ffff00',\n yellowgreen: '#9acd32',\n};\n"]}
1
+ {"version":3,"file":"ColorKeywords.js","sourceRoot":"","sources":["../../../lib/styles/ColorKeywords.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,MAAM,CAAC,IAAM,aAAa,GAAG;IAC3B,SAAS,EAAE,SAAS;IACpB,YAAY,EAAE,SAAS;IACvB,IAAI,EAAE,SAAS;IACf,UAAU,EAAE,SAAS;IACrB,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,SAAS;IAChB,cAAc,EAAE,SAAS;IACzB,IAAI,EAAE,SAAS;IACf,UAAU,EAAE,SAAS;IACrB,KAAK,EAAE,SAAS;IAChB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IACpB,UAAU,EAAE,SAAS;IACrB,SAAS,EAAE,SAAS;IACpB,KAAK,EAAE,SAAS;IAChB,cAAc,EAAE,SAAS;IACzB,QAAQ,EAAE,SAAS;IACnB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,SAAS;IACnB,aAAa,EAAE,SAAS;IACxB,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,SAAS;IACnB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IACpB,WAAW,EAAE,SAAS;IACtB,cAAc,EAAE,SAAS;IACzB,UAAU,EAAE,SAAS;IACrB,UAAU,EAAE,SAAS;IACrB,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,SAAS;IACrB,YAAY,EAAE,SAAS;IACvB,aAA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G,EAAE,SAAS;IACd,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,SAAS;IACjB,SAAS,EAAE,SAAS;IACpB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;IAChB,UAAU,EAAE,SAAS;IACrB,MAAM,EAAE,SAAS;IACjB,WAAW,EAAE,SAAS;CACvB,CAAC","sourcesContent":["/** @deprecated Используйте библиотеку цветов Colors 2.x. Будет удалено в 7.0 */\nexport const ColorKeywords = {\n aliceblue: '#f0f8ff',\n antiquewhite: '#faebd7',\n aqua: '#00ffff',\n aquamarine: '#7fffd4',\n azure: '#f0ffff',\n beige: '#f5f5dc',\n bisque: '#ffe4c4',\n black: '#000000',\n blanchedalmond: '#ffebcd',\n blue: '#0000ff',\n blueviolet: '#8a2be2',\n brown: '#a52a2a',\n burlywood: '#deb887',\n cadetblue: '#5f9ea0',\n chartreuse: '#7fff00',\n chocolate: '#d2691e',\n coral: '#ff7f50',\n cornflowerblue: '#6495ed',\n cornsilk: '#fff8dc',\n crimson: '#dc143c',\n cyan: '#00ffff',\n darkblue: '#00008b',\n darkcyan: '#008b8b',\n darkgoldenrod: '#b8860b',\n darkgray: '#a9a9a9',\n darkgrey: '#a9a9a9',\n darkgreen: '#006400',\n darkkhaki: '#bdb76b',\n darkmagenta: '#8b008b',\n darkolivegreen: '#556b2f',\n darkorange: '#ff8c00',\n darkorchid: '#9932cc',\n darkred: '#8b0000',\n darksalmon: '#e9967a',\n darkseagreen: '#8fbc8f',\n darkslateblue: '#483d8b',\n darkslategray: '#2f4f4f',\n darkslategrey: '#2f4f4f',\n darkturquoise: '#00ced1',\n darkviolet: '#9400d3',\n deeppink: '#ff1493',\n deepskyblue: '#00bfff',\n dimgray: '#696969',\n dimgrey: '#696969',\n dodgerblue: '#1e90ff',\n firebrick: '#b22222',\n floralwhite: '#fffaf0',\n forestgreen: '#228b22',\n fuchsia: '#ff00ff',\n gainsboro: '#dcdcdc',\n ghostwhite: '#f8f8ff',\n gold: '#ffd700',\n goldenrod: '#daa520',\n gray: '#808080',\n grey: '#808080',\n green: '#008000',\n greenyellow: '#adff2f',\n honeydew: '#f0fff0',\n hotpink: '#ff69b4',\n indianred: '#cd5c5c',\n indigo: '#4b0082',\n ivory: '#fffff0',\n khaki: '#f0e68c',\n lavender: '#e6e6fa',\n lavenderblush: '#fff0f5',\n lawngreen: '#7cfc00',\n lemonchiffon: '#fffacd',\n lightblue: '#add8e6',\n lightcoral: '#f08080',\n lightcyan: '#e0ffff',\n lightgoldenrodyellow: '#fafad2',\n lightgray: '#d3d3d3',\n lightgrey: '#d3d3d3',\n lightgreen: '#90ee90',\n lightpink: '#ffb6c1',\n lightsalmon: '#ffa07a',\n lightseagreen: '#20b2aa',\n lightskyblue: '#87cefa',\n lightslategray: '#778899',\n lightslategrey: '#778899',\n lightsteelblue: '#b0c4de',\n lightyellow: '#ffffe0',\n lime: '#00ff00',\n limegreen: '#32cd32',\n linen: '#faf0e6',\n magenta: '#ff00ff',\n maroon: '#800000',\n mediumaquamarine: '#66cdaa',\n mediumblue: '#0000cd',\n mediumorchid: '#ba55d3',\n mediumpurple: '#9370d8',\n mediumseagreen: '#3cb371',\n mediumslateblue: '#7b68ee',\n mediumspringgreen: '#00fa9a',\n mediumturquoise: '#48d1cc',\n mediumvioletred: '#c71585',\n midnightblue: '#191970',\n mintcream: '#f5fffa',\n mistyrose: '#ffe4e1',\n moccasin: '#ffe4b5',\n navajowhite: '#ffdead',\n navy: '#000080',\n oldlace: '#fdf5e6',\n olive: '#808000',\n olivedrab: '#6b8e23',\n orange: '#ffa500',\n orangered: '#ff4500',\n orchid: '#da70d6',\n palegoldenrod: '#eee8aa',\n palegreen: '#98fb98',\n paleturquoise: '#afeeee',\n palevioletred: '#d87093',\n papayawhip: '#ffefd5',\n peachpuff: '#ffdab9',\n peru: '#cd853f',\n pink: '#ffc0cb',\n plum: '#dda0dd',\n powderblue: '#b0e0e6',\n purple: '#800080',\n rebeccapurple: '#663399',\n red: '#ff0000',\n rosybrown: '#bc8f8f',\n royalblue: '#4169e1',\n saddlebrown: '#8b4513',\n salmon: '#fa8072',\n sandybrown: '#f4a460',\n seagreen: '#2e8b57',\n seashell: '#fff5ee',\n sienna: '#a0522d',\n silver: '#c0c0c0',\n skyblue: '#87ceeb',\n slateblue: '#6a5acd',\n slategray: '#708090',\n slategrey: '#708090',\n snow: '#fffafa',\n springgreen: '#00ff7f',\n steelblue: '#4682b4',\n tan: '#d2b48c',\n teal: '#008080',\n thistle: '#d8bfd8',\n tomato: '#ff6347',\n turquoise: '#40e0d0',\n violet: '#ee82ee',\n wheat: '#f5deb3',\n white: '#ffffff',\n whitesmoke: '#f5f5f5',\n yellow: '#ffff00',\n yellowgreen: '#9acd32',\n};\n"]}
@@ -1,11 +1,22 @@
1
1
  import type { Emotion } from '@emotion/css/create-instance';
2
+ import type { GetOffsetParent, PopupStrategy } from '../renderEnvironment/RenderEnvironmentContext.js';
2
3
  import type { Theme } from './Theme.js';
3
4
  export declare const REACT_UI_PREFIX: string;
4
5
  export declare const getEmotion: ({ key, container, nonce, }: {
5
- container: HTMLElement;
6
+ container?: HTMLElement | null;
6
7
  key?: string;
7
8
  nonce?: string;
8
9
  }) => Emotion;
10
+ export declare const injectGlobal: {
11
+ (template: TemplateStringsArray, ...args: Array<import("@emotion/css/create-instance").CSSInterpolation>): void;
12
+ (...args: Array<import("@emotion/css/create-instance").CSSInterpolation>): void;
13
+ }, cache: import("@emotion/css/create-instance").EmotionCache, css: {
14
+ (template: TemplateStringsArray, ...args: Array<import("@emotion/css/create-instance").CSSInterpolation>): string;
15
+ (...args: Array<import("@emotion/css/create-instance").CSSInterpolation>): string;
16
+ }, cx: (...classNames: Array<import("@emotion/css/create-instance").ClassNamesArg>) => string, keyframes: {
17
+ (template: TemplateStringsArray, ...args: Array<import("@emotion/css/create-instance").CSSInterpolation>): string;
18
+ (...args: Array<import("@emotion/css/create-instance").CSSInterpolation>): string;
19
+ }, getRegisteredStyles: (registeredStyles: Array<string>, className: string) => string, hydrate: (ids: Array<string>) => void, sheet: import("@emotion/css/create-instance").CSSStyleSheet, merge: (className: string) => string, flush: () => void;
9
20
  export interface StylesObject {
10
21
  [className: string]: (() => string) | ((t: Theme) => string);
11
22
  }
@@ -13,3 +24,18 @@ export type StylesGetter<S> = (emotion: Emotion) => S;
13
24
  export declare const memoizeStyle: <S extends StylesObject>(styles: S) => S;
14
25
  export declare const memoizeGetStyles: <S extends StylesObject>(getStyles: StylesGetter<S>) => StylesGetter<S>;
15
26
  export declare const prefix: (component: string, app?: string) => <T extends Record<string, string>>(classes: T) => T;
27
+ export declare const EmotionContext: import("react").Context<Emotion>;
28
+ export declare const EmotionConsumer: import("react").Consumer<Emotion>;
29
+ export declare const EmotionProvider: import("react").Provider<Emotion>;
30
+ export declare const PopupContext: import("react").Context<{
31
+ getOffsetParent?: GetOffsetParent;
32
+ popupStrategy?: PopupStrategy;
33
+ }>;
34
+ export declare const PopupConsumer: import("react").Consumer<{
35
+ getOffsetParent?: GetOffsetParent;
36
+ popupStrategy?: PopupStrategy;
37
+ }>;
38
+ export declare const PopupProvider: import("react").Provider<{
39
+ getOffsetParent?: GetOffsetParent;
40
+ popupStrategy?: PopupStrategy;
41
+ }>;
@@ -9,8 +9,10 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ var _a;
12
13
  import createEmotion from '@emotion/css/create-instance';
13
14
  import extraScopePlugin from 'stylis-plugin-extra-scope';
15
+ import { createContext } from 'react';
14
16
  import { Upgrade } from '../Upgrades.js';
15
17
  export var REACT_UI_PREFIX = Upgrade.getSpecificityClassName();
16
18
  var scope = new Array(Upgrade.getSpecificityLevel()).fill(".".concat(REACT_UI_PREFIX)).join('');
@@ -20,21 +22,24 @@ export var getEmotion = function (_a) {
20
22
  key: key,
21
23
  prepend: true,
22
24
  stylisPlugins: scope ? [extraScopePlugin(scope)] : undefined,
23
- container: container,
25
+ container: container !== null && container !== void 0 ? container : undefined,
24
26
  nonce: nonce,
25
27
  });
26
28
  };
29
+ // breaking changes
30
+ // todo убрать все экспорты, чтобы все компоненты управлялись через EmotionContext, пока оставили для обратной совместимости с icons/side-menu/Fias
31
+ export var injectGlobal = (_a = getEmotion({}), _a.injectGlobal), cache = _a.cache, css = _a.css, cx = _a.cx, keyframes = _a.keyframes, getRegisteredStyles = _a.getRegisteredStyles, hydrate = _a.hydrate, sheet = _a.sheet, merge = _a.merge, flush = _a.flush;
27
32
  function isZeroArgs(fn) {
28
33
  return fn.length === 0;
29
34
  }
30
- var memoize = function (fn) {
35
+ var memoize = function (fn, context) {
31
36
  if (isZeroArgs(fn)) {
32
37
  var isCalled_1 = false;
33
38
  var result_1;
34
39
  return function () {
35
40
  if (!isCalled_1) {
36
41
  isCalled_1 = true;
37
- result_1 = fn();
42
+ result_1 = fn.call(context);
38
43
  }
39
44
  return result_1;
40
45
  };
@@ -42,13 +47,13 @@ var memoize = function (fn) {
42
47
  var cache = new WeakMap();
43
48
  return function (arg) {
44
49
  if (!cache.has(arg)) {
45
- cache.set(arg, fn(arg));
50
+ cache.set(arg, fn.call(context, arg));
46
51
  }
47
52
  return cache.get(arg);
48
53
  };
49
54
  };
50
55
  export var memoizeStyle = function (styles) {
51
- Object.keys(styles).forEach(function (className) { return (styles[className] = memoize(styles[className])); });
56
+ Object.keys(styles).forEach(function (className) { return (styles[className] = memoize(styles[className], styles)); });
52
57
  return styles;
53
58
  };
54
59
  export var memoizeGetStyles = function (getStyles) {
@@ -69,4 +74,14 @@ export var prefix = function (component, app) {
69
74
  }, {});
70
75
  };
71
76
  };
77
+ export var EmotionContext = createContext(getEmotion({}));
78
+ export var EmotionConsumer = EmotionContext.Consumer;
79
+ export var EmotionProvider = EmotionContext.Provider;
80
+ export var PopupContext = createContext({
81
+ getOffsetParent: function () { return null; },
82
+ });
83
+ export var PopupConsumer = PopupContext.Consumer;
84
+ export var PopupProvider = PopupContext.Provider;
85
+ EmotionContext.displayName = 'EmotionContext';
86
+ EmotionContext.__KONTUR_REACT_UI__ = 'EmotionContext';
72
87
  //# sourceMappingURL=Emotion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Emotion.js","sourceRoot":"","sources":["../../../lib/theming/Emotion.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,aAAa,MAAM,8BAA8B,CAAC;AACzD,OAAO,gBAAgB,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAKzC,MAAM,CAAC,IAAM,eAAe,GAAG,OAAO,CAAC,uBAAuB,EAAE,CAAC;AAEjE,IAAM,KAAK,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC,IAAI,CAAC,WAAI,eAAe,CAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAE5F,MAAM,CAAC,IAAM,UAAU,GAAG,UAAC,EAQ1B;QAPC,WAAqB,EAArB,GAAG,mBAAG,eAAe,KAAA,EACrB,SAAS,eAAA,EACT,KAAK,WAAA;IAML,OAAA,aAAa,CAAC;QACZ,GAAG,KAAA;QACH,OAAO,EAAE,IAAI;QACb,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;QAC5D,SAAS,WAAA;QACT,KAAK,OAAA;KACN,CAAC;AANF,CAME,CAAC;AAEL,SAAS,UAAU,CAAqC,EAA6B;IACnF,OAAO,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC;AACzB,CAAC;AAED,IAAM,OAAO,GAAG,UAAyB,EAA+B;IACtE,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC;QACnB,IAAI,UAAQ,GAAG,KAAK,CAAC;QACrB,IAAI,QAAS,CAAC;QACd,OAAO;YACL,IAAI,CAAC,UAAQ,EAAE,CAAC;gBACd,UAAQ,GAAG,IAAI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,OAAA,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,UAAC,GAAG,EAAE,GAAG;;YACnC,6BAAY,GAAG,gBAAG,GAAG,IAAG,UAAG,GAAG,cAAI,SAAS,cAAI,OAAO,CAAC,GAAG,CAAC,CAAE,OAAG;QAClE,CAAC,EAAE,EAAO,CAAC;IAFX,CAEW;AAHb,CAGa,CAAC","sourcesContent":["import type { Emotion } from '@emotion/css/create-instance';\nimport createEmotion from '@emotion/css/create-instance';\nimport extraScopePlugin from 'stylis-plugin-extra-scope';\n\nimport { Upgrade } from '../Upgrades.js';\nimport type { AnyObject, FunctionWithParams } from '../utils.js';\n\nimport type { Theme } from './Theme.js';\n\nexport const REACT_UI_PREFIX = Upgrade.getSpecificityClassName();\n\nconst scope = new Array(Upgrade.getSpecificityLevel()).fill(`.${REACT_UI_PREFIX}`).join('');\n\nexport const getEmotion = ({\n key = REACT_UI_PREFIX,\n container,\n nonce,\n}: {\n container: HTMLElement;\n key?: string;\n nonce?: string;\n}): Emotion =>\n createEmotion({\n key,\n prepend: true,\n stylisPlugins: scope ? [extraScopePlugin(scope)] : undefined,\n container,\n nonce,\n });\n\nfunction isZeroArgs<R, T extends FunctionWithParams<R>>(fn: T | FunctionWithParams<R>): fn is () => R {\n return fn.length === 0;\n}\n\nconst memoize = <A extends AnyObject, R>(fn: (() => R) | ((arg: A) => R)): (() => R) | ((arg: A) => R) => {\n if (isZeroArgs(fn)) {\n let isCalled = false;\n let result: R;\n return () => {\n if (!isCalled) {\n isCalled = true;\n result = fn();\n }\n return result;\n };\n }\n\n const cache = new WeakMap();\n return (arg: A) => {\n if (!cache.has(arg)) {\n cache.set(arg, fn(arg));\n }\n\n return cache.get(arg);\n };\n};\n\nexport interface StylesObject {\n [className: string]: (() => string) | ((t: Theme) => string);\n}\n\nexport type StylesGetter<S> = (emotion: Emotion) => S;\n\nexport const memoizeStyle = <S extends StylesObject>(styles: S): S => {\n Object.keys(styles).forEach((className) => (styles[className as keyof S] = memoize(styles[className]) as S[keyof S]));\n return styles;\n};\n\nexport const memoizeGetStyles = <S extends StylesObject>(getStyles: StylesGetter<S>): StylesGetter<S> => {\n const stylesCache = new WeakMap<Emotion, S>();\n return (emotion: Emotion): S => {\n if (!stylesCache.has(emotion)) {\n stylesCache.set(emotion, memoizeStyle(getStyles(emotion)));\n }\n\n return stylesCache.get(emotion) as S;\n };\n};\n\nexport const prefix =\n (component: string, app = REACT_UI_PREFIX) =>\n <T extends Record<string, string>>(classes: T): T =>\n Object.keys(classes).reduce((acc, key) => {\n return { ...acc, [key]: `${app}-${component}-${classes[key]}` };\n }, {} as T);\n"]}
1
+ {"version":3,"file":"Emotion.js","sourceRoot":"","sources":["../../../lib/theming/Emotion.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,aAAa,MAAM,8BAA8B,CAAC;AACzD,OAAO,gBAAgB,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAMzC,MAAM,CAAC,IAAM,eAAe,GAAG,OAAO,CAAC,uBAAuB,EAAE,CAAC;AAEjE,IAAM,KAAK,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC,IAAI,CAAC,WAAI,eAAe,CAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAE5F,MAAM,CAAC,IAAM,UAAU,GAAG,UAAC,EAQ1B;QAPC,WAAqB,EAArB,GAAG,mBAAG,eAAe,KAAA,EACrB,SAAS,eAAA,EACT,KAAK,WAAA;IAML,OAAA,aAAa,CAAC;QACZ,GAAG,KAAA;QACH,OAAO,EAAE,IAAI;QACb,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;QAC5D,SAAS,EAAE,SAAS,aAAT,SAAS,c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tC;IACD,eAAe,EAAE,cAAM,OAAA,IAAI,EAAJ,CAAI;CAC5B,CAAC,CAAC;AACH,MAAM,CAAC,IAAM,aAAa,GAAG,YAAY,CAAC,QAAQ,CAAC;AACnD,MAAM,CAAC,IAAM,aAAa,GAAG,YAAY,CAAC,QAAQ,CAAC;AAEnD,cAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC;AAC9C,cAAc,CAAC,mBAAmB,GAAG,gBAAgB,CAAC","sourcesContent":["import type { Emotion } from '@emotion/css/create-instance';\nimport createEmotion from '@emotion/css/create-instance';\nimport extraScopePlugin from 'stylis-plugin-extra-scope';\nimport { createContext } from 'react';\n\nimport { Upgrade } from '../Upgrades.js';\nimport type { AnyObject, FunctionWithParams } from '../utils.js';\nimport type { GetOffsetParent, PopupStrategy } from '../renderEnvironment/RenderEnvironmentContext.js';\n\nimport type { Theme } from './Theme.js';\n\nexport const REACT_UI_PREFIX = Upgrade.getSpecificityClassName();\n\nconst scope = new Array(Upgrade.getSpecificityLevel()).fill(`.${REACT_UI_PREFIX}`).join('');\n\nexport const getEmotion = ({\n key = REACT_UI_PREFIX,\n container,\n nonce,\n}: {\n container?: HTMLElement | null;\n key?: string;\n nonce?: string;\n}): Emotion =>\n createEmotion({\n key,\n prepend: true,\n stylisPlugins: scope ? [extraScopePlugin(scope)] : undefined,\n container: container ?? undefined,\n nonce,\n });\n\n// breaking changes\n// todo убрать все экспорты, чтобы все компоненты управлялись через EmotionContext, пока оставили для обратной совместимости с icons/side-menu/Fias\nexport const { injectGlobal, cache, css, cx, keyframes, getRegisteredStyles, hydrate, sheet, merge, flush } =\n getEmotion({});\n\nfunction isZeroArgs<R, T extends FunctionWithParams<R>>(fn: T | FunctionWithParams<R>): fn is () => R {\n return fn.length === 0;\n}\n\nconst memoize = <A extends AnyObject, R>(\n fn: (() => R) | ((arg: A) => R),\n context: Record<string, unknown>,\n): (() => R) | ((arg: A) => R) => {\n if (isZeroArgs(fn)) {\n let isCalled = false;\n let result: R;\n return () => {\n if (!isCalled) {\n isCalled = true;\n result = fn.call(context);\n }\n return result;\n };\n }\n\n const cache = new WeakMap();\n return (arg: A) => {\n if (!cache.has(arg)) {\n cache.set(arg, fn.call(context, arg));\n }\n\n return cache.get(arg);\n };\n};\n\nexport interface StylesObject {\n [className: string]: (() => string) | ((t: Theme) => string);\n}\n\nexport type StylesGetter<S> = (emotion: Emotion) => S;\n\nexport const memoizeStyle = <S extends StylesObject>(styles: S): S => {\n Object.keys(styles).forEach(\n (className) => (styles[className as keyof S] = memoize(styles[className], styles) as S[keyof S]),\n );\n return styles;\n};\n\nexport const memoizeGetStyles = <S extends StylesObject>(getStyles: StylesGetter<S>): StylesGetter<S> => {\n const stylesCache = new WeakMap<Emotion, S>();\n return (emotion: Emotion): S => {\n if (!stylesCache.has(emotion)) {\n stylesCache.set(emotion, memoizeStyle(getStyles(emotion)));\n }\n\n return stylesCache.get(emotion) as S;\n };\n};\n\nexport const prefix =\n (component: string, app = REACT_UI_PREFIX) =>\n <T extends Record<string, string>>(classes: T): T =>\n Object.keys(classes).reduce((acc, key) => {\n return { ...acc, [key]: `${app}-${component}-${classes[key]}` };\n }, {} as T);\n\nexport const EmotionContext = createContext<Emotion>(getEmotion({}));\nexport const EmotionConsumer = EmotionContext.Consumer;\nexport const EmotionProvider = EmotionContext.Provider;\n\nexport const PopupContext = createContext<{\n getOffsetParent?: GetOffsetParent;\n popupStrategy?: PopupStrategy;\n}>({\n getOffsetParent: () => null,\n});\nexport const PopupConsumer = PopupContext.Consumer;\nexport const PopupProvider = PopupContext.Provider;\n\nEmotionContext.displayName = 'EmotionContext';\nEmotionContext.__KONTUR_REACT_UI__ = 'EmotionContext';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skbkontur/react-ui",
3
- "version": "6.0.0-beta.4",
3
+ "version": "6.0.1-cd7d7.0",
4
4
  "description": "UI Components",
5
5
  "sideEffects": false,
6
6
  "homepage": "https://tech.skbkontur.ru/kontur-ui",
@@ -262,11 +262,11 @@
262
262
  "dependencies": {
263
263
  "@babel/runtime": "^7.24.6",
264
264
  "@emotion/css": "^11.11.2",
265
- "@skbkontur/colors": "^2.1.1",
265
+ "@skbkontur/colors": "^2.1.5",
266
266
  "@skbkontur/react-imask": "^7.6.5",
267
267
  "eventemitter3": "^5.0.1",
268
- "invariant": "^2.2.4",
269
268
  "focus-lock": "^1.3.5",
269
+ "invariant": "^2.2.4",
270
270
  "lodash.debounce": "^4.0.8",
271
271
  "lodash.isequal": "^4.5.0",
272
272
  "lodash.throttle": "^4.1.1",
@@ -338,10 +338,10 @@
338
338
  "jsdom": "^26.1.0",
339
339
  "npm-run-all": "^4.1.5",
340
340
  "output-file-sync": "^2.0.1",
341
- "react": "19.2.1",
342
- "react-dom": "19.2.1",
343
341
  "playwright-core": "1.57.0",
342
+ "react": "19.2.1",
344
343
  "react-docgen-typescript": "^2.2.2",
344
+ "react-dom": "19.2.1",
345
345
  "rimraf": "^5.0.7",
346
346
  "selenium-webdriver": "^4.27.0",
347
347
  "semver": "^7.6.2",