@hh.ru/magritte-ui-alert 4.0.12 → 4.0.14

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.
package/Alert.js CHANGED
@@ -15,7 +15,7 @@ import { Layer } from '@hh.ru/magritte-ui-layer';
15
15
  import { Placeholder } from '@hh.ru/magritte-ui-placeholder';
16
16
  import { ThemeWrapper } from '@hh.ru/magritte-ui-theme-wrapper';
17
17
 
18
- var styles = {"animation-timeout":"magritte-animation-timeout___cwIwT_4-0-12","animationTimeout":"magritte-animation-timeout___cwIwT_4-0-12","enter-animation-active":"magritte-enter-animation-active___Qti02_4-0-12","enterAnimationActive":"magritte-enter-animation-active___Qti02_4-0-12","exit-animation-active":"magritte-exit-animation-active___deHqY_4-0-12","exitAnimationActive":"magritte-exit-animation-active___deHqY_4-0-12","opacity-animation":"magritte-opacity-animation___m7RYi_4-0-12","opacityAnimation":"magritte-opacity-animation___m7RYi_4-0-12","enter-animation":"magritte-enter-animation___CbUHN_4-0-12","enterAnimation":"magritte-enter-animation___CbUHN_4-0-12","exit-animation":"magritte-exit-animation___d2AJ4_4-0-12","exitAnimation":"magritte-exit-animation___d2AJ4_4-0-12","overlay":"magritte-overlay___hMlKJ_4-0-12","mobile-container":"magritte-mobile-container___dQRCl_4-0-12","mobileContainer":"magritte-mobile-container___dQRCl_4-0-12","desktop-container":"magritte-desktop-container___26vkq_4-0-12","desktopContainer":"magritte-desktop-container___26vkq_4-0-12","main":"magritte-main___iCU-E_4-0-12"};
18
+ var styles = {"animation-timeout":"magritte-animation-timeout___cwIwT_4-0-14","animationTimeout":"magritte-animation-timeout___cwIwT_4-0-14","enter-animation-active":"magritte-enter-animation-active___Qti02_4-0-14","enterAnimationActive":"magritte-enter-animation-active___Qti02_4-0-14","exit-animation-active":"magritte-exit-animation-active___deHqY_4-0-14","exitAnimationActive":"magritte-exit-animation-active___deHqY_4-0-14","opacity-animation":"magritte-opacity-animation___m7RYi_4-0-14","opacityAnimation":"magritte-opacity-animation___m7RYi_4-0-14","enter-animation":"magritte-enter-animation___CbUHN_4-0-14","enterAnimation":"magritte-enter-animation___CbUHN_4-0-14","exit-animation":"magritte-exit-animation___d2AJ4_4-0-14","exitAnimation":"magritte-exit-animation___d2AJ4_4-0-14","overlay":"magritte-overlay___hMlKJ_4-0-14","mobile-container":"magritte-mobile-container___dQRCl_4-0-14","mobileContainer":"magritte-mobile-container___dQRCl_4-0-14","desktop-container":"magritte-desktop-container___26vkq_4-0-14","desktopContainer":"magritte-desktop-container___26vkq_4-0-14","main":"magritte-main___iCU-E_4-0-14"};
19
19
 
20
20
  const OPACITY_ANIMATION_CLASSES = {
21
21
  enter: classnames(styles.opacityAnimation, styles.enterAnimation),
package/index.css CHANGED
@@ -12,42 +12,42 @@
12
12
  --magritte-color-background-primary-v24-6-0:#1B1B1B;
13
13
  --magritte-color-component-_overlay-background-content-v24-6-0:#26262699;
14
14
  }
15
- .magritte-animation-timeout___cwIwT_4-0-12{
15
+ .magritte-animation-timeout___cwIwT_4-0-14{
16
16
  --enter-animation-duration:0ms;
17
17
  --exit-animation-duration:0ms;
18
18
  }
19
19
  @media (prefers-reduced-motion: no-preference){
20
- .magritte-animation-timeout___cwIwT_4-0-12{
20
+ .magritte-animation-timeout___cwIwT_4-0-14{
21
21
  --enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v24-6-0);
22
22
  --exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v24-6-0);
23
23
  }
24
24
  }
25
- .magritte-enter-animation-active___Qti02_4-0-12{
25
+ .magritte-enter-animation-active___Qti02_4-0-14{
26
26
  transition-property:transform, opacity;
27
27
  transition-duration:var(--enter-animation-duration);
28
28
  transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v24-6-0);
29
29
  }
30
- .magritte-exit-animation-active___deHqY_4-0-12{
30
+ .magritte-exit-animation-active___deHqY_4-0-14{
31
31
  transition-property:transform, opacity;
32
32
  transition-duration:var(--exit-animation-duration);
33
33
  transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v24-6-0);
34
34
  }
35
- .magritte-opacity-animation___m7RYi_4-0-12{
35
+ .magritte-opacity-animation___m7RYi_4-0-14{
36
36
  pointer-events:none;
37
37
  }
38
- .magritte-opacity-animation___m7RYi_4-0-12.magritte-enter-animation___CbUHN_4-0-12{
38
+ .magritte-opacity-animation___m7RYi_4-0-14.magritte-enter-animation___CbUHN_4-0-14{
39
39
  opacity:0;
40
40
  }
41
- .magritte-opacity-animation___m7RYi_4-0-12.magritte-enter-animation-active___Qti02_4-0-12{
41
+ .magritte-opacity-animation___m7RYi_4-0-14.magritte-enter-animation-active___Qti02_4-0-14{
42
42
  opacity:1;
43
43
  }
44
- .magritte-opacity-animation___m7RYi_4-0-12.magritte-exit-animation___d2AJ4_4-0-12{
44
+ .magritte-opacity-animation___m7RYi_4-0-14.magritte-exit-animation___d2AJ4_4-0-14{
45
45
  opacity:1;
46
46
  }
47
- .magritte-opacity-animation___m7RYi_4-0-12.magritte-exit-animation-active___deHqY_4-0-12{
47
+ .magritte-opacity-animation___m7RYi_4-0-14.magritte-exit-animation-active___deHqY_4-0-14{
48
48
  opacity:0;
49
49
  }
50
- .magritte-overlay___hMlKJ_4-0-12{
50
+ .magritte-overlay___hMlKJ_4-0-14{
51
51
  display:flex;
52
52
  align-items:center;
53
53
  justify-content:center;
@@ -55,20 +55,20 @@
55
55
  inset:0;
56
56
  background-color:var(--magritte-color-component-_overlay-background-content-v24-6-0);
57
57
  }
58
- .magritte-mobile-container___dQRCl_4-0-12,
59
- .magritte-desktop-container___26vkq_4-0-12{
58
+ .magritte-mobile-container___dQRCl_4-0-14,
59
+ .magritte-desktop-container___26vkq_4-0-14{
60
60
  background-color:var(--magritte-color-background-primary-v24-6-0);
61
61
  border-radius:24px;
62
62
  }
63
- .magritte-mobile-container___dQRCl_4-0-12{
63
+ .magritte-mobile-container___dQRCl_4-0-14{
64
64
  position:fixed;
65
65
  inset:auto 12px 16px;
66
66
  max-width:400px;
67
67
  margin:auto;
68
68
  }
69
- .magritte-desktop-container___26vkq_4-0-12{
69
+ .magritte-desktop-container___26vkq_4-0-14{
70
70
  width:400px;
71
71
  }
72
- .magritte-main___iCU-E_4-0-12{
72
+ .magritte-main___iCU-E_4-0-14{
73
73
  padding:32px 12px 12px;
74
74
  }
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ export * from '@hh.ru/magritte-ui-alert/types';
3
+ export declare const Alert: FC<Record<string, unknown>>;
package/index.mock.js ADDED
@@ -0,0 +1,39 @@
1
+ import './index.css';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { forwardRef } from 'react';
4
+
5
+ function enhance(mockComponent, staticProps) {
6
+ // удаляем внутренний свойства реакта, чтобы не перезаписать ими mockComponent
7
+ delete staticProps.type;
8
+ delete staticProps.$$typeof;
9
+ delete staticProps.render;
10
+ for (const prop in staticProps) {
11
+ mockComponent[prop] = staticProps[prop];
12
+ }
13
+ }
14
+ const MockComponent = ({ style, ...props }) => (
15
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
16
+ // @ts-ignore
17
+ // eslint-disable-next-line react/jsx-no-undef
18
+ jsx("magritte-component-mock", { "style-data": style, ...props }));
19
+ /**
20
+ * Возвращает mock React компонента
21
+ */
22
+ const mockComponent = (componentName, staticProps = {}, { withChildren, innerDependence, WrapperComponent } = {}) => {
23
+ const mockWrapper = forwardRef(({ children, ...props }, ref) => {
24
+ const mock = (
25
+ // eslint-disable-next-line react/jsx-no-undef
26
+ jsxs(MockComponent, { ...props, _component: componentName, children: [innerDependence ? innerDependence(props, ref) : null, withChildren ? children : null] }));
27
+ return WrapperComponent ? jsx(WrapperComponent, { ...props, children: mock }) : mock;
28
+ });
29
+ staticProps && enhance(mockWrapper, staticProps);
30
+ mockWrapper.displayName = 'magritte-ref';
31
+ return mockWrapper;
32
+ };
33
+
34
+ const Alert = mockComponent('Alert', undefined, {
35
+ withChildren: true,
36
+ });
37
+
38
+ export { Alert };
39
+ //# sourceMappingURL=index.mock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mock.js","sources":["../mock-component/lib/setupMockComponent.js","src/index.mock.ts"],"sourcesContent":["import { jsxs, jsx } from 'react/jsx-runtime';\nimport { forwardRef } from 'react';\n\nfunction enhance(mockComponent, staticProps) {\n // удаляем внутренний свойства реакта, чтобы не перезаписать ими mockComponent\n delete staticProps.type;\n delete staticProps.$$typeof;\n delete staticProps.render;\n for (const prop in staticProps) {\n mockComponent[prop] = staticProps[prop];\n }\n}\nconst MockComponent = ({ style, ...props }) => (\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\n// eslint-disable-next-line react/jsx-no-undef\njsx(\"magritte-component-mock\", { \"style-data\": style, ...props }));\nconst MockComponentRenderProp = ({ style, ...props }) => (\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\n// eslint-disable-next-line react/jsx-no-undef\njsx(\"magritte-component-mock-render-prop\", { \"style-data\": style, ...props }));\n/**\n * Возвращает mock React компонента\n */\nconst mockComponent = (componentName, staticProps = {}, { withChildren, innerDependence, WrapperComponent } = {}) => {\n const mockWrapper = forwardRef(({ children, ...props }, ref) => {\n const mock = (\n // eslint-disable-next-line react/jsx-no-undef\n jsxs(MockComponent, { ...props, _component: componentName, children: [innerDependence ? innerDependence(props, ref) : null, withChildren ? children : null] }));\n return WrapperComponent ? jsx(WrapperComponent, { ...props, children: mock }) : mock;\n });\n staticProps && enhance(mockWrapper, staticProps);\n mockWrapper.displayName = 'magritte-ref';\n return mockWrapper;\n};\n/**\n * Возвращает mock React компонента, который рендерит переданный в него пропс render\n *\n * @param {String} componentName наименование компонента\n * @param {Object} [staticProps] объект со свойствами, которыми необходимо усилить mock\n * @param {Object} [options] параметры мока\n * @param {boolean} [options.withChildren] флаг отвечает за рендеринг children компонента\n * @param {React.Component} [options.innerDependence] Реакт компонент, который рендерится внутри мока.\n * Необходим, когда mock компоненту требуется иметь\n * дополнительные элементы\n */\nconst mockComponentRenderProp = (componentName, staticProps, { withChildren, innerDependence, renderArguments } = { renderArguments: [] }) => {\n const mockWrapper = ({ render, children, ...props }) => (jsxs(MockComponentRenderProp, { ...props, _component: componentName, children: [innerDependence ? innerDependence(props) : null, withChildren ? children : null, render?.(...(renderArguments || []))] }));\n staticProps && enhance(mockWrapper, staticProps);\n mockWrapper.displayName = 'magritte-component-mock-render-prop';\n return mockWrapper;\n};\n\nexport { mockComponent, mockComponentRenderProp };\n//# sourceMappingURL=setupMockComponent.js.map\n","import { FC } from 'react';\n\nimport { mockComponent } from '@hh.ru/magritte-ui-mock-component';\n\nexport * from '@hh.ru/magritte-ui-alert/types';\n\nexport const Alert: FC<Record<string, unknown>> = mockComponent('Alert', undefined, {\n withChildren: true,\n});\n"],"names":[],"mappings":";;;AAGA,SAAS,OAAO,CAAC,aAAa,EAAE,WAAW,EAAE;AAC7C;AACA,IAAI,OAAO,WAAW,CAAC,IAAI,CAAC;AAC5B,IAAI,OAAO,WAAW,CAAC,QAAQ,CAAC;AAChC,IAAI,OAAO,WAAW,CAAC,MAAM,CAAC;AAC9B,IAAI,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE;AACpC,QAAQ,aAAa,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;AAChD,KAAK;AACL,CAAC;AACD,MAAM,aAAa,GAAG,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE;AAC1C;AACA;AACA;AACA,GAAG,CAAC,yBAAyB,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC;AAMnE;AACA;AACA;AACA,MAAM,aAAa,GAAG,CAAC,aAAa,EAAE,WAAW,GAAG,EAAE,EAAE,EAAE,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,GAAG,EAAE,KAAK;AACrH,IAAI,MAAM,WAAW,GAAG,UAAU,CAAC,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAK;AACpE,QAAQ,MAAM,IAAI;AAClB;AACA,QAAQ,IAAI,CAAC,aAAa,EAAE,EAAE,GAAG,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC,eAAe,GAAG,eAAe,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,IAAI,EAAE,YAAY,GAAG,QAAQ,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AACxK,QAAQ,OAAO,gBAAgB,GAAG,GAAG,CAAC,gBAAgB,EAAE,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;AAC7F,KAAK,CAAC,CAAC;AACP,IAAI,WAAW,IAAI,OAAO,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AACrD,IAAI,WAAW,CAAC,WAAW,GAAG,cAAc,CAAC;AAC7C,IAAI,OAAO,WAAW,CAAC;AACvB,CAAC;;MC7BY,KAAK,GAAgC,aAAa,CAAC,OAAO,EAAE,SAAS,EAAE;AAChF,IAAA,YAAY,EAAE,IAAI;AACrB,CAAA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hh.ru/magritte-ui-alert",
3
- "version": "4.0.12",
3
+ "version": "4.0.14",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -21,15 +21,15 @@
21
21
  "dependencies": {
22
22
  "@hh.ru/magritte-common-is-server-env": "1.0.8",
23
23
  "@hh.ru/magritte-common-keyboard": "4.3.3",
24
- "@hh.ru/magritte-common-modal-helper": "1.3.1",
24
+ "@hh.ru/magritte-common-modal-helper": "1.3.2",
25
25
  "@hh.ru/magritte-common-use-multiple-refs": "1.1.11",
26
26
  "@hh.ru/magritte-common-use-no-bubbling": "1.0.8",
27
27
  "@hh.ru/magritte-common-use-swipe": "3.1.9",
28
28
  "@hh.ru/magritte-design-tokens": "24.6.0",
29
29
  "@hh.ru/magritte-internal-layer-name": "3.4.1",
30
30
  "@hh.ru/magritte-ui-breakpoint": "6.0.8",
31
- "@hh.ru/magritte-ui-layer": "3.2.3",
32
- "@hh.ru/magritte-ui-placeholder": "11.1.8",
31
+ "@hh.ru/magritte-ui-layer": "3.2.4",
32
+ "@hh.ru/magritte-ui-placeholder": "11.1.9",
33
33
  "@hh.ru/magritte-ui-theme-wrapper": "1.1.15"
34
34
  },
35
35
  "peerDependencies": {
@@ -41,5 +41,5 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "b65af31dd81516396082133c8fefd2404ae7c071"
44
+ "gitHead": "cadaa9dd9ed52159fedbaf7e7111b70cdf6bb05c"
45
45
  }