@alfalab/core-components-side-panel 4.1.3 → 5.0.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 (152) hide show
  1. package/Component.responsive.d.ts +1 -0
  2. package/Component.responsive.js +6 -3
  3. package/components/content/Component.desktop.js +3 -1
  4. package/components/content/Component.js +5 -2
  5. package/components/content/Component.mobile.js +3 -1
  6. package/components/content/desktop.css +3 -3
  7. package/components/content/index.css +4 -4
  8. package/components/content/mobile.css +3 -3
  9. package/components/controls/Component.d.ts +29 -0
  10. package/components/controls/Component.js +32 -0
  11. package/components/controls/index.css +4 -0
  12. package/components/controls/index.d.ts +1 -0
  13. package/components/controls/index.js +14 -0
  14. package/components/footer/Component.desktop.js +4 -1
  15. package/components/footer/Component.js +7 -6
  16. package/components/footer/Component.mobile.js +5 -2
  17. package/components/footer/desktop.css +3 -3
  18. package/components/footer/index.css +9 -9
  19. package/components/footer/layout.css +17 -27
  20. package/components/footer/mobile.css +4 -13
  21. package/components/header/Component.js +6 -5
  22. package/components/header/desktop.css +5 -5
  23. package/components/header/index.css +19 -19
  24. package/components/header/mobile.css +4 -4
  25. package/cssm/Component.responsive.d.ts +1 -0
  26. package/cssm/Component.responsive.js +7 -4
  27. package/cssm/components/content/Component.desktop.js +2 -0
  28. package/cssm/components/content/Component.js +4 -1
  29. package/cssm/components/content/Component.mobile.js +2 -0
  30. package/cssm/components/controls/Component.d.ts +29 -0
  31. package/cssm/components/controls/Component.js +32 -0
  32. package/cssm/components/controls/index.d.ts +1 -0
  33. package/cssm/components/controls/index.js +15 -0
  34. package/cssm/components/controls/index.module.css +3 -0
  35. package/cssm/components/footer/Component.desktop.js +2 -0
  36. package/cssm/components/footer/Component.js +4 -1
  37. package/cssm/components/footer/Component.mobile.js +3 -1
  38. package/cssm/components/footer/index.module.css +5 -5
  39. package/cssm/components/footer/layout.module.css +8 -18
  40. package/cssm/components/footer/mobile.module.css +1 -10
  41. package/cssm/components/header/Component.js +3 -2
  42. package/cssm/components/header/index.module.css +5 -5
  43. package/cssm/desktop/Component.desktop.d.ts +4 -1
  44. package/cssm/desktop/Component.desktop.js +8 -4
  45. package/cssm/desktop/index.js +5 -2
  46. package/cssm/index.js +5 -3
  47. package/cssm/mobile/Component.mobile.d.ts +2 -0
  48. package/cssm/mobile/Component.mobile.js +8 -4
  49. package/cssm/mobile/index.js +5 -2
  50. package/cssm/typings.d.ts +1 -0
  51. package/desktop/Component.desktop.d.ts +4 -1
  52. package/desktop/Component.desktop.js +9 -5
  53. package/desktop/desktop.css +3 -3
  54. package/desktop/index.js +4 -1
  55. package/desktop/transitions.desktop.css +7 -7
  56. package/esm/Component.responsive.d.ts +1 -0
  57. package/esm/Component.responsive.js +6 -3
  58. package/esm/components/content/Component.desktop.js +3 -1
  59. package/esm/components/content/Component.js +5 -2
  60. package/esm/components/content/Component.mobile.js +3 -1
  61. package/esm/components/content/desktop.css +3 -3
  62. package/esm/components/content/index.css +4 -4
  63. package/esm/components/content/mobile.css +3 -3
  64. package/esm/components/controls/Component.d.ts +29 -0
  65. package/esm/components/controls/Component.js +23 -0
  66. package/esm/components/controls/index.css +4 -0
  67. package/esm/components/controls/index.d.ts +1 -0
  68. package/esm/components/controls/index.js +6 -0
  69. package/esm/components/footer/Component.desktop.js +4 -1
  70. package/esm/components/footer/Component.js +6 -5
  71. package/esm/components/footer/Component.mobile.js +5 -2
  72. package/esm/components/footer/desktop.css +3 -3
  73. package/esm/components/footer/index.css +9 -9
  74. package/esm/components/footer/layout.css +17 -27
  75. package/esm/components/footer/mobile.css +4 -13
  76. package/esm/components/header/Component.js +6 -5
  77. package/esm/components/header/desktop.css +5 -5
  78. package/esm/components/header/index.css +19 -19
  79. package/esm/components/header/mobile.css +4 -4
  80. package/esm/desktop/Component.desktop.d.ts +4 -1
  81. package/esm/desktop/Component.desktop.js +9 -5
  82. package/esm/desktop/desktop.css +3 -3
  83. package/esm/desktop/index.js +4 -1
  84. package/esm/desktop/transitions.desktop.css +7 -7
  85. package/esm/index.js +4 -2
  86. package/esm/layout.module-31951bef.js +4 -0
  87. package/esm/mobile/Component.mobile.d.ts +2 -0
  88. package/esm/mobile/Component.mobile.js +10 -6
  89. package/esm/mobile/index.js +4 -1
  90. package/esm/mobile/mobile.css +4 -4
  91. package/esm/mobile/transitions.mobile.css +8 -8
  92. package/esm/typings.d.ts +1 -0
  93. package/index.js +4 -2
  94. package/layout.module-2f71de49.js +6 -0
  95. package/mobile/Component.mobile.d.ts +2 -0
  96. package/mobile/Component.mobile.js +9 -5
  97. package/mobile/index.js +4 -1
  98. package/mobile/mobile.css +4 -4
  99. package/mobile/transitions.mobile.css +8 -8
  100. package/modern/Component.responsive.d.ts +1 -0
  101. package/modern/Component.responsive.js +6 -3
  102. package/modern/components/content/Component.desktop.js +3 -1
  103. package/modern/components/content/Component.js +5 -2
  104. package/modern/components/content/Component.mobile.js +3 -1
  105. package/modern/components/content/desktop.css +3 -3
  106. package/modern/components/content/index.css +4 -4
  107. package/modern/components/content/mobile.css +3 -3
  108. package/modern/components/controls/Component.d.ts +29 -0
  109. package/modern/components/controls/Component.js +22 -0
  110. package/modern/components/controls/index.css +4 -0
  111. package/modern/components/controls/index.d.ts +1 -0
  112. package/modern/components/controls/index.js +6 -0
  113. package/modern/components/footer/Component.desktop.js +4 -1
  114. package/modern/components/footer/Component.js +6 -5
  115. package/modern/components/footer/Component.mobile.js +5 -2
  116. package/modern/components/footer/desktop.css +3 -3
  117. package/modern/components/footer/index.css +9 -9
  118. package/modern/components/footer/layout.css +17 -27
  119. package/modern/components/footer/mobile.css +4 -13
  120. package/modern/components/header/Component.js +6 -5
  121. package/modern/components/header/desktop.css +5 -5
  122. package/modern/components/header/index.css +19 -19
  123. package/modern/components/header/mobile.css +4 -4
  124. package/modern/desktop/Component.desktop.d.ts +4 -1
  125. package/modern/desktop/Component.desktop.js +10 -6
  126. package/modern/desktop/desktop.css +3 -3
  127. package/modern/desktop/index.js +4 -1
  128. package/modern/desktop/transitions.desktop.css +7 -7
  129. package/modern/index.js +4 -2
  130. package/modern/layout.module-a8ffdbd1.js +4 -0
  131. package/modern/mobile/Component.mobile.d.ts +2 -0
  132. package/modern/mobile/Component.mobile.js +10 -6
  133. package/modern/mobile/index.js +4 -1
  134. package/modern/mobile/mobile.css +4 -4
  135. package/modern/mobile/transitions.mobile.css +8 -8
  136. package/modern/typings.d.ts +1 -0
  137. package/package.json +5 -5
  138. package/src/Component.responsive.tsx +18 -3
  139. package/src/components/content/Component.tsx +5 -1
  140. package/src/components/controls/Component.tsx +76 -0
  141. package/src/components/controls/index.module.css +3 -0
  142. package/src/components/controls/index.ts +1 -0
  143. package/src/components/footer/Component.mobile.tsx +1 -1
  144. package/src/components/footer/Component.tsx +5 -1
  145. package/src/components/footer/layout.module.css +8 -18
  146. package/src/components/footer/mobile.module.css +0 -16
  147. package/src/components/header/Component.tsx +3 -1
  148. package/src/desktop/Component.desktop.tsx +8 -4
  149. package/src/mobile/Component.mobile.tsx +10 -4
  150. package/src/typings.ts +1 -0
  151. package/src/vars.css +6 -6
  152. package/typings.d.ts +1 -0
@@ -1,24 +1,24 @@
1
- /* hash: mn72t */
2
- .side-panel__appear_48wvn,
3
- .side-panel__enter_48wvn {
1
+ /* hash: ntku8 */
2
+ .side-panel__appear_1lrki,
3
+ .side-panel__enter_1lrki {
4
4
  opacity: 0;
5
5
  transform: translateY(15px);
6
6
  }
7
7
 
8
- .side-panel__appearActive_48wvn,
9
- .side-panel__enterActive_48wvn {
8
+ .side-panel__appearActive_1lrki,
9
+ .side-panel__enterActive_1lrki {
10
10
  opacity: 1;
11
11
  transform: translateY(0);
12
12
  transition: opacity 200ms ease-in, transform 200ms ease-in;
13
13
  }
14
14
 
15
- .side-panel__exit_48wvn {
15
+ .side-panel__exit_1lrki {
16
16
  opacity: 1;
17
17
  transform: translateY(0);
18
18
  }
19
19
 
20
- .side-panel__exitActive_48wvn,
21
- .side-panel__exitDone_48wvn {
20
+ .side-panel__exitActive_1lrki,
21
+ .side-panel__exitDone_1lrki {
22
22
  opacity: 0;
23
23
  transform: translateY(15px);
24
24
  transition: opacity 200ms ease-out, transform 200ms ease-out;
package/esm/typings.d.ts CHANGED
@@ -2,5 +2,6 @@ type View = 'desktop' | 'mobile';
2
2
  type TResponsiveModalContext = {
3
3
  view: View;
4
4
  size: 's';
5
+ dataTestId?: string;
5
6
  } | null;
6
7
  export { View, TResponsiveModalContext };
package/index.js CHANGED
@@ -7,12 +7,14 @@ require('tslib');
7
7
  require('react');
8
8
  require('@alfalab/core-components-mq');
9
9
  require('@alfalab/core-components-shared');
10
- require('./components/header/Component.js');
10
+ require('./components/controls/Component.js');
11
11
  require('classnames');
12
+ require('./ResponsiveContext.js');
13
+ require('./layout.module-2f71de49.js');
14
+ require('./components/header/Component.js');
12
15
  require('@alfalab/core-components-navigation-bar');
13
16
  require('./Context.js');
14
17
  require('@alfalab/core-components-base-modal');
15
- require('./ResponsiveContext.js');
16
18
  require('./desktop/Component.desktop.js');
17
19
  require('react-merge-refs');
18
20
  require('@alfalab/core-components-drawer');
@@ -0,0 +1,6 @@
1
+ 'use strict';
2
+
3
+ var layoutStyles = {"column":"side-panel__column_16gdu","gap-16":"side-panel__gap-16_16gdu","gap-24":"side-panel__gap-24_16gdu","gap-32":"side-panel__gap-32_16gdu","start":"side-panel__start_16gdu","center":"side-panel__center_16gdu","space-between":"side-panel__space-between_16gdu"};
4
+ require('./components/footer/layout.css')
5
+
6
+ exports.layoutStyles = layoutStyles;
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import React from 'react';
3
3
  import { BaseModalProps } from "@alfalab/core-components-base-modal";
4
+ import { ControlsProps } from "../components/controls/index";
4
5
  type SidePanelMobileProps = BaseModalProps & {
5
6
  /**
6
7
  * Управление наличием закрывающего крестика
@@ -18,5 +19,6 @@ declare const SidePanelMobile: React.ForwardRefExoticComponent<BaseModalProps &
18
19
  Content: React.FC<import("../components/content/Component").ContentProps>;
19
20
  Header: React.FC<import("../components/header/Component").HeaderProps>;
20
21
  Footer: React.FC<import("../components/footer/Component").FooterProps>;
22
+ Controls: React.FC<Omit<ControlsProps, "mobileLayout">>;
21
23
  };
22
24
  export { SidePanelMobileProps, SidePanelMobile };
@@ -7,11 +7,14 @@ var React = require('react');
7
7
  var cn = require('classnames');
8
8
  var coreComponentsBaseModal = require('@alfalab/core-components-base-modal');
9
9
  var components_content_Component_mobile = require('../components/content/Component.mobile.js');
10
+ var components_controls_Component = require('../components/controls/Component.js');
10
11
  var components_footer_Component_mobile = require('../components/footer/Component.mobile.js');
11
12
  var components_header_Component = require('../components/header/Component.js');
12
13
  var ResponsiveContext = require('../ResponsiveContext.js');
13
14
  require('../components/content/Component.js');
15
+ require('@alfalab/core-components-shared');
14
16
  require('../Context.js');
17
+ require('../layout.module-2f71de49.js');
15
18
  require('../components/footer/Component.js');
16
19
  require('@alfalab/core-components-navigation-bar');
17
20
 
@@ -20,17 +23,17 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
20
23
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
21
24
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
22
25
 
23
- var styles = {"component":"side-panel__component_19cvm","mobileContent":"side-panel__mobileContent_19cvm"};
26
+ var styles = {"component":"side-panel__component_1050h","mobileContent":"side-panel__mobileContent_1050h"};
24
27
  require('./mobile.css')
25
28
 
26
- var transitions = {"appear":"side-panel__appear_48wvn","enter":"side-panel__enter_48wvn","appearActive":"side-panel__appearActive_48wvn","enterActive":"side-panel__enterActive_48wvn","exit":"side-panel__exit_48wvn","exitActive":"side-panel__exitActive_48wvn","exitDone":"side-panel__exitDone_48wvn"};
29
+ var transitions = {"appear":"side-panel__appear_1lrki","enter":"side-panel__enter_1lrki","appearActive":"side-panel__appearActive_1lrki","enterActive":"side-panel__enterActive_1lrki","exit":"side-panel__exit_1lrki","exitActive":"side-panel__exitActive_1lrki","exitDone":"side-panel__exitDone_1lrki"};
27
30
  require('./transitions.mobile.css')
28
31
 
29
- var contextValue = { size: 's', view: 'mobile' };
30
32
  var SidePanelMobileComponent = React.forwardRef(function (_a, ref) {
31
- var children = _a.children, className = _a.className, transitionProps = _a.transitionProps, restProps = tslib.__rest(_a, ["children", "className", "transitionProps"]);
33
+ var children = _a.children, className = _a.className, transitionProps = _a.transitionProps, dataTestId = _a.dataTestId, restProps = tslib.__rest(_a, ["children", "className", "transitionProps", "dataTestId"]);
32
34
  var responsiveContext = React.useContext(ResponsiveContext.ResponsiveContext);
33
- var renderContent = function () { return (React__default.default.createElement(coreComponentsBaseModal.BaseModal, tslib.__assign({}, restProps, { ref: ref, transitionProps: tslib.__assign({ classNames: transitions }, transitionProps), className: cn__default.default(className, styles.component), scrollHandler: 'content' }),
35
+ var contextValue = React.useMemo(function () { return ({ size: 's', view: 'mobile', dataTestId: dataTestId }); }, [dataTestId]);
36
+ var renderContent = function () { return (React__default.default.createElement(coreComponentsBaseModal.BaseModal, tslib.__assign({}, restProps, { dataTestId: dataTestId, ref: ref, transitionProps: tslib.__assign({ classNames: transitions }, transitionProps), className: cn__default.default(className, styles.component), scrollHandler: 'content' }),
34
37
  React__default.default.createElement("div", { className: styles.mobileContent }, children))); };
35
38
  var renderWithContext = function () { return (React__default.default.createElement(ResponsiveContext.ResponsiveContext.Provider, { value: contextValue }, renderContent())); };
36
39
  return responsiveContext ? renderContent() : renderWithContext();
@@ -39,6 +42,7 @@ var SidePanelMobile = Object.assign(SidePanelMobileComponent, {
39
42
  Content: components_content_Component_mobile.ContentMobile,
40
43
  Header: components_header_Component.Header,
41
44
  Footer: components_footer_Component_mobile.FooterMobile,
45
+ Controls: components_controls_Component.Controls,
42
46
  });
43
47
 
44
48
  exports.SidePanelMobile = SidePanelMobile;
package/mobile/index.js CHANGED
@@ -9,12 +9,15 @@ require('classnames');
9
9
  require('@alfalab/core-components-base-modal');
10
10
  require('../components/content/Component.mobile.js');
11
11
  require('../components/content/Component.js');
12
+ require('@alfalab/core-components-shared');
12
13
  require('../Context.js');
14
+ require('../ResponsiveContext.js');
15
+ require('../components/controls/Component.js');
16
+ require('../layout.module-2f71de49.js');
13
17
  require('../components/footer/Component.mobile.js');
14
18
  require('../components/footer/Component.js');
15
19
  require('../components/header/Component.js');
16
20
  require('@alfalab/core-components-navigation-bar');
17
- require('../ResponsiveContext.js');
18
21
 
19
22
 
20
23
 
package/mobile/mobile.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 7ui7p */
1
+ /* hash: uxsui */
2
2
  :root {
3
3
  } /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
4
4
  } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -27,17 +27,17 @@
27
27
  /* mobile */
28
28
 
29
29
  /* paddings */
30
- } .side-panel__component_19cvm {
30
+ } .side-panel__component_1050h {
31
31
  top: 0;
32
32
  height: 100%;
33
33
  width: 100%;
34
34
  overflow-x: hidden;
35
35
  overflow-y: auto;
36
36
  max-width: 600px;
37
- } .side-panel__component_19cvm.side-panel__component_19cvm {
37
+ } .side-panel__component_1050h.side-panel__component_1050h {
38
38
  position: fixed;
39
39
  flex: 1;
40
- } .side-panel__mobileContent_19cvm {
40
+ } .side-panel__mobileContent_1050h {
41
41
  display: flex;
42
42
  flex-direction: column;
43
43
  width: 100%;
@@ -1,24 +1,24 @@
1
- /* hash: mn72t */
2
- .side-panel__appear_48wvn,
3
- .side-panel__enter_48wvn {
1
+ /* hash: ntku8 */
2
+ .side-panel__appear_1lrki,
3
+ .side-panel__enter_1lrki {
4
4
  opacity: 0;
5
5
  transform: translateY(15px);
6
6
  }
7
7
 
8
- .side-panel__appearActive_48wvn,
9
- .side-panel__enterActive_48wvn {
8
+ .side-panel__appearActive_1lrki,
9
+ .side-panel__enterActive_1lrki {
10
10
  opacity: 1;
11
11
  transform: translateY(0);
12
12
  transition: opacity 200ms ease-in, transform 200ms ease-in;
13
13
  }
14
14
 
15
- .side-panel__exit_48wvn {
15
+ .side-panel__exit_1lrki {
16
16
  opacity: 1;
17
17
  transform: translateY(0);
18
18
  }
19
19
 
20
- .side-panel__exitActive_48wvn,
21
- .side-panel__exitDone_48wvn {
20
+ .side-panel__exitActive_1lrki,
21
+ .side-panel__exitDone_1lrki {
22
22
  opacity: 0;
23
23
  transform: translateY(15px);
24
24
  transition: opacity 200ms ease-out, transform 200ms ease-out;
@@ -45,6 +45,7 @@ declare const SidePanelResponsive: React.ForwardRefExoticComponent<BaseModalProp
45
45
  defaultMatchMediaValue?: boolean | (() => boolean) | undefined;
46
46
  } & React.RefAttributes<HTMLDivElement>> & {
47
47
  Header: React.FC<import("./components/header/Component").HeaderProps>;
48
+ Controls: React.FC<import("./components/controls/index").ControlsProps>;
48
49
  Content: React.FC<import("./components/content/Component").ContentProps> | React.FC<import("./components/content/Component.desktop").ContentDesktopProps>;
49
50
  Footer: React.FC<import("./components/footer/Component").FooterProps> | React.FC<import("./components/footer/Component.desktop").FooterDesktopProps>;
50
51
  };
@@ -1,11 +1,13 @@
1
1
  import React, { forwardRef, useMemo, useContext } from 'react';
2
2
  import { useMatchMedia } from '@alfalab/core-components-mq/modern';
3
3
  import { isClient } from '@alfalab/core-components-shared/modern';
4
+ import { Controls } from './components/controls/Component.js';
4
5
  import { Header } from './components/header/Component.js';
5
6
  import { SidePanelDesktop } from './desktop/Component.desktop.js';
6
7
  import { SidePanelMobile } from './mobile/Component.mobile.js';
7
8
  import { ResponsiveContext } from './ResponsiveContext.js';
8
9
  import 'classnames';
10
+ import './layout.module-a8ffdbd1.js';
9
11
  import '@alfalab/core-components-navigation-bar/modern';
10
12
  import './Context.js';
11
13
  import '@alfalab/core-components-base-modal/modern';
@@ -27,18 +29,19 @@ function createResponsive(desktop, mobile) {
27
29
  }
28
30
  return ResponsiveChild;
29
31
  }
30
- const SidePanelResponsiveComponent = forwardRef(({ children, breakpoint = 1024, size = 's', defaultMatchMediaValue, ...restProps }, ref) => {
32
+ const SidePanelResponsiveComponent = forwardRef(({ children, breakpoint = 1024, size = 's', defaultMatchMediaValue, dataTestId, ...restProps }, ref) => {
31
33
  const query = `(min-width: ${breakpoint}px)`;
32
34
  const getDefaultValue = () => (isClient() ? window.matchMedia(query).matches : false);
33
35
  const [isDesktop] = useMatchMedia(query, defaultMatchMediaValue ?? getDefaultValue);
34
36
  const view = isDesktop ? 'desktop' : 'mobile';
35
- const contextValue = useMemo(() => ({ view, size }), [view, size]);
37
+ const contextValue = useMemo(() => ({ view, size, dataTestId }), [view, size, dataTestId]);
36
38
  const Component = isDesktop ? SidePanelDesktop : SidePanelMobile;
37
39
  return (React.createElement(ResponsiveContext.Provider, { value: contextValue },
38
- React.createElement(Component, { ref: ref, size: size, ...restProps }, children)));
40
+ React.createElement(Component, { ref: ref, size: size, dataTestId: dataTestId, ...restProps }, children)));
39
41
  });
40
42
  const SidePanelResponsive = Object.assign(SidePanelResponsiveComponent, {
41
43
  Header,
44
+ Controls,
42
45
  Content: createResponsive(SidePanelDesktop.Content, SidePanelMobile.Content),
43
46
  Footer: createResponsive(SidePanelDesktop.Footer, SidePanelMobile.Footer),
44
47
  });
@@ -1,10 +1,12 @@
1
1
  import React from 'react';
2
2
  import cn from 'classnames';
3
3
  import { Content } from './Component.js';
4
+ import '@alfalab/core-components-shared/modern';
4
5
  import '../../Context.js';
5
6
  import '@alfalab/core-components-base-modal/modern';
7
+ import '../../ResponsiveContext.js';
6
8
 
7
- const styles = {"s":"side-panel__s_cqees"};
9
+ const styles = {"s":"side-panel__s_39vrx"};
8
10
  require('./desktop.css')
9
11
 
10
12
  const ContentDesktop = ({ size = 's', className, ...restProps }) => React.createElement(Content, { className: cn(className, size && styles[size]), ...restProps });
@@ -1,16 +1,19 @@
1
1
  import React, { useContext } from 'react';
2
2
  import cn from 'classnames';
3
+ import { getDataTestId } from '@alfalab/core-components-shared/modern';
3
4
  import { ModalContext } from '../../Context.js';
5
+ import { ResponsiveContext } from '../../ResponsiveContext.js';
4
6
  import '@alfalab/core-components-base-modal/modern';
5
7
 
6
- const styles = {"content":"side-panel__content_12bco","withHeader":"side-panel__withHeader_12bco","flex":"side-panel__flex_12bco"};
8
+ const styles = {"content":"side-panel__content_1vagu","withHeader":"side-panel__withHeader_1vagu","flex":"side-panel__flex_1vagu"};
7
9
  require('./index.css')
8
10
 
9
11
  const Content = ({ children, className, dataTestId }) => {
10
12
  const { contentRef, hasHeader } = useContext(ModalContext);
13
+ const responsiveContext = useContext(ResponsiveContext);
11
14
  return (React.createElement("div", { className: cn(styles.content, className, styles.flex, {
12
15
  [styles.withHeader]: hasHeader,
13
- }), ref: contentRef, "data-test-id": dataTestId }, children));
16
+ }), ref: contentRef, "data-test-id": dataTestId || getDataTestId(responsiveContext?.dataTestId, 'content') }, children));
14
17
  };
15
18
 
16
19
  export { Content };
@@ -1,10 +1,12 @@
1
1
  import React from 'react';
2
2
  import cn from 'classnames';
3
3
  import { Content } from './Component.js';
4
+ import '@alfalab/core-components-shared/modern';
4
5
  import '../../Context.js';
5
6
  import '@alfalab/core-components-base-modal/modern';
7
+ import '../../ResponsiveContext.js';
6
8
 
7
- const styles = {"content":"side-panel__content_15i3m"};
9
+ const styles = {"content":"side-panel__content_1hc2n"};
8
10
  require('./mobile.css')
9
11
 
10
12
  const ContentMobile = ({ className, ...restProps }) => (React.createElement(Content, { className: cn(className, styles.content), ...restProps }));
@@ -1,4 +1,4 @@
1
- /* hash: 1cfr7 */
1
+ /* hash: 1dure */
2
2
  :root {
3
3
  } /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
4
4
  } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -30,8 +30,8 @@
30
30
  /* mobile */
31
31
 
32
32
  /* paddings */
33
- } .side-panel__s_cqees {
33
+ } .side-panel__s_39vrx {
34
34
  padding: var(--side-panel-s-content-paddings)
35
- } .side-panel__s_cqees:last-child {
35
+ } .side-panel__s_39vrx:last-child {
36
36
  padding-bottom: var(--gap-2xl);
37
37
  }
@@ -1,4 +1,4 @@
1
- /* hash: 1y9mj */
1
+ /* hash: nio5e */
2
2
  :root {
3
3
  } /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
4
4
  } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -27,13 +27,13 @@
27
27
  /* mobile */
28
28
 
29
29
  /* paddings */
30
- } .side-panel__content_12bco {
30
+ } .side-panel__content_1vagu {
31
31
  position: relative;
32
32
  box-sizing: border-box;
33
33
  width: 100%;
34
34
  z-index: 0
35
- } .side-panel__content_12bco.side-panel__withHeader_12bco {
35
+ } .side-panel__content_1vagu.side-panel__withHeader_1vagu {
36
36
  padding-top: 0;
37
- } .side-panel__flex_12bco {
37
+ } .side-panel__flex_1vagu {
38
38
  flex: 1 1 auto;
39
39
  }
@@ -1,4 +1,4 @@
1
- /* hash: shnyn */
1
+ /* hash: 1bbeb */
2
2
  :root {
3
3
  } /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
4
4
  } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -28,8 +28,8 @@
28
28
  /* mobile */
29
29
 
30
30
  /* paddings */
31
- } .side-panel__content_15i3m {
31
+ } .side-panel__content_1hc2n {
32
32
  padding: var(--gap-m) var(--gap-m) 0
33
- } .side-panel__content_15i3m:last-child {
33
+ } .side-panel__content_1hc2n:last-child {
34
34
  padding-bottom: var(--gap-m);
35
35
  }
@@ -0,0 +1,29 @@
1
+ /// <reference types="react" />
2
+ import React from 'react';
3
+ import { ReactNode } from "react";
4
+ interface ControlsProps {
5
+ /**
6
+ * Основной слот
7
+ */
8
+ primary?: ReactNode;
9
+ /**
10
+ * Дополнительный слот
11
+ */
12
+ secondary?: ReactNode;
13
+ /**
14
+ * Выравнивание элементов футера
15
+ * @default start
16
+ */
17
+ layout?: 'start' | 'center' | 'space-between' | 'column';
18
+ /**
19
+ * Выравнивание элементов футера (мобильный view)
20
+ * @default start
21
+ */
22
+ mobileLayout?: 'start' | 'center' | 'space-between' | 'column';
23
+ /**
24
+ * Отступы между элементами футера
25
+ */
26
+ gap?: 16 | 24 | 32;
27
+ }
28
+ declare const Controls: React.FC<ControlsProps>;
29
+ export { ControlsProps, Controls };
@@ -0,0 +1,22 @@
1
+ import React, { useContext } from 'react';
2
+ import cn from 'classnames';
3
+ import { getDataTestId } from '@alfalab/core-components-shared/modern';
4
+ import { ResponsiveContext } from '../../ResponsiveContext.js';
5
+ import { l as layoutStyles } from '../../layout.module-a8ffdbd1.js';
6
+
7
+ const styles = {"component":"side-panel__component_scwve"};
8
+ require('./index.css')
9
+
10
+ const Controls = ({ primary, secondary, gap = 16, layout: layoutProp = 'start', mobileLayout = layoutProp, }) => {
11
+ const context = useContext(ResponsiveContext);
12
+ const { view = 'desktop', dataTestId } = context || {};
13
+ const layout = view === 'mobile' ? mobileLayout : layoutProp;
14
+ const shouldReverse = view === 'mobile' && layout !== 'column';
15
+ return (React.createElement("div", { "data-test-id": getDataTestId(dataTestId, 'controls'), className: cn(styles.component, layoutStyles[layout], gap && layoutStyles[`gap-${gap}`]) }, shouldReverse ? (React.createElement(React.Fragment, null,
16
+ secondary,
17
+ primary)) : (React.createElement(React.Fragment, null,
18
+ primary,
19
+ secondary))));
20
+ };
21
+
22
+ export { Controls };
@@ -0,0 +1,4 @@
1
+ /* hash: 1amh1 */
2
+ .side-panel__component_scwve {
3
+ width: 100%;
4
+ }
@@ -0,0 +1 @@
1
+ export * from "./Component";
@@ -0,0 +1,6 @@
1
+ export { Controls } from './Component.js';
2
+ import 'react';
3
+ import 'classnames';
4
+ import '@alfalab/core-components-shared/modern';
5
+ import '../../ResponsiveContext.js';
6
+ import '../../layout.module-a8ffdbd1.js';
@@ -1,10 +1,13 @@
1
1
  import React from 'react';
2
2
  import cn from 'classnames';
3
3
  import { Footer } from './Component.js';
4
+ import '@alfalab/core-components-shared/modern';
4
5
  import '../../Context.js';
5
6
  import '@alfalab/core-components-base-modal/modern';
7
+ import '../../ResponsiveContext.js';
8
+ import '../../layout.module-a8ffdbd1.js';
6
9
 
7
- const styles = {"sticky":"side-panel__sticky_1bvwv","s":"side-panel__s_1bvwv"};
10
+ const styles = {"sticky":"side-panel__sticky_62kfr","s":"side-panel__s_62kfr"};
8
11
  require('./desktop.css')
9
12
 
10
13
  const FooterDesktop = ({ size = 's', className, sticky, ...restProps }) => (React.createElement(Footer, { className: cn(className, size && styles[size], {
@@ -1,23 +1,24 @@
1
1
  import React, { useContext, useEffect } from 'react';
2
2
  import cn from 'classnames';
3
+ import { getDataTestId } from '@alfalab/core-components-shared/modern';
3
4
  import { ModalContext } from '../../Context.js';
5
+ import { ResponsiveContext } from '../../ResponsiveContext.js';
6
+ import { l as layoutStyles } from '../../layout.module-a8ffdbd1.js';
4
7
  import '@alfalab/core-components-base-modal/modern';
5
8
 
6
- const styles = {"footer":"side-panel__footer_cr8pp","sticky":"side-panel__sticky_cr8pp","highlighted":"side-panel__highlighted_cr8pp"};
9
+ const styles = {"footer":"side-panel__footer_3jdk9","sticky":"side-panel__sticky_3jdk9","highlighted":"side-panel__highlighted_3jdk9"};
7
10
  require('./index.css')
8
11
 
9
- const layoutStyles = {"column":"side-panel__column_d8m7q","gap-16":"side-panel__gap-16_d8m7q","gap-24":"side-panel__gap-24_d8m7q","gap-32":"side-panel__gap-32_d8m7q","start":"side-panel__start_d8m7q","center":"side-panel__center_d8m7q","space-between":"side-panel__space-between_d8m7q"};
10
- require('./layout.css')
11
-
12
12
  const Footer = ({ children, className, sticky, layout = 'start', gap, dataTestId, }) => {
13
13
  const { footerHighlighted, setHasFooter } = useContext(ModalContext);
14
+ const responsiveContext = useContext(ResponsiveContext);
14
15
  useEffect(() => {
15
16
  setHasFooter(true);
16
17
  }, [setHasFooter]);
17
18
  return (React.createElement("div", { className: cn(styles.footer, className, layoutStyles[layout], gap && layoutStyles[`gap-${gap}`], {
18
19
  [styles.highlighted]: sticky && footerHighlighted,
19
20
  [styles.sticky]: sticky,
20
- }), "data-test-id": dataTestId }, children));
21
+ }), "data-test-id": dataTestId || getDataTestId(responsiveContext?.dataTestId, 'footer') }, children));
21
22
  };
22
23
 
23
24
  export { Footer };
@@ -1,13 +1,16 @@
1
1
  import React from 'react';
2
2
  import cn from 'classnames';
3
3
  import { Footer } from './Component.js';
4
+ import '@alfalab/core-components-shared/modern';
4
5
  import '../../Context.js';
5
6
  import '@alfalab/core-components-base-modal/modern';
7
+ import '../../ResponsiveContext.js';
8
+ import '../../layout.module-a8ffdbd1.js';
6
9
 
7
- const styles = {"footer":"side-panel__footer_13o6w","sticky":"side-panel__sticky_13o6w","column":"side-panel__column_13o6w"};
10
+ const styles = {"footer":"side-panel__footer_1e4vh","sticky":"side-panel__sticky_1e4vh"};
8
11
  require('./mobile.css')
9
12
 
10
- const FooterMobile = ({ className, sticky, layout = 'start', ...restProps }) => (React.createElement(Footer, { className: cn(className, styles.footer, styles[layout], {
13
+ const FooterMobile = ({ className, sticky, layout = 'start', ...restProps }) => (React.createElement(Footer, { className: cn(className, styles.footer, {
11
14
  [styles.sticky]: sticky,
12
15
  }), sticky: sticky, layout: layout, ...restProps }));
13
16
 
@@ -1,4 +1,4 @@
1
- /* hash: xg1mo */
1
+ /* hash: 1kjc9 */
2
2
  :root {
3
3
  } /* deprecated */ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
4
4
  } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -30,8 +30,8 @@
30
30
  /* mobile */
31
31
 
32
32
  /* paddings */
33
- } .side-panel__sticky_1bvwv {
33
+ } .side-panel__sticky_62kfr {
34
34
  bottom: 0;
35
- } .side-panel__s_1bvwv {
35
+ } .side-panel__s_62kfr {
36
36
  padding: var(--side-panel-s-footer-paddings);
37
37
  }
@@ -1,8 +1,8 @@
1
- /* hash: bbrc0 */
1
+ /* hash: yf1yt */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
- --color-light-bg-primary: #fff;
5
- --color-light-border-secondary: #e7e8ec; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
4
+ --color-light-modal-bg-primary: #fff;
5
+ --color-light-neutral-300: #e7e8eb; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
6
6
  } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
7
7
  } :root {
8
8
  } :root {
@@ -17,30 +17,30 @@
17
17
  } :root {
18
18
  } :root {
19
19
  } :root {
20
- --side-panel-footer-background: var(--color-light-bg-primary);
20
+ --side-panel-footer-background: var(--color-light-modal-bg-primary);
21
21
 
22
22
  /* sizes */
23
23
 
24
24
  /* paddings */
25
25
 
26
26
  /* scroll */
27
- --side-panel-footer-highlight-background: var(--color-light-bg-primary);
28
- --side-panel-footer-highlight-box-shadow: 0 -1px 0 0 var(--color-light-border-secondary);
27
+ --side-panel-footer-highlight-background: var(--color-light-modal-bg-primary);
28
+ --side-panel-footer-highlight-box-shadow: 0 -1px 0 0 var(--color-light-neutral-300);
29
29
 
30
30
  /* desktop */
31
31
 
32
32
  /* mobile */
33
33
 
34
34
  /* paddings */
35
- } .side-panel__footer_cr8pp {
35
+ } .side-panel__footer_3jdk9 {
36
36
  width: 100%;
37
37
  box-sizing: border-box;
38
38
  transition: box-shadow 0.2s ease, background 0.2s ease;
39
- } .side-panel__sticky_cr8pp {
39
+ } .side-panel__sticky_3jdk9 {
40
40
  background: var(--side-panel-footer-background);
41
41
  position: sticky;
42
42
  z-index: 1;
43
- } .side-panel__highlighted_cr8pp {
43
+ } .side-panel__highlighted_3jdk9 {
44
44
  background: var(--side-panel-footer-highlight-background);
45
45
  box-shadow: var(--side-panel-footer-highlight-box-shadow);
46
46
  }