@sima-land/moleculas 15.1.0 → 15.2.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.
@@ -29,6 +29,9 @@ export declare const Parts: {
29
29
  readonly Title: ({ children, href, onClick }: Pick<LinkProps, 'children' | 'href' | 'onClick'>) => JSX.Element;
30
30
  readonly TrademarkLink: ({ href, children, onClick, }: Pick<LinkProps, 'href' | 'children' | 'onClick'>) => JSX.Element;
31
31
  readonly Footer: React.FC<{}>;
32
+ readonly FooterContext: React.Context<{
33
+ className?: string | undefined;
34
+ }>;
32
35
  readonly CartControl: ({ children, stepText, markupText, loading, }: {
33
36
  children?: React.ReactNode;
34
37
  stepText?: string | undefined;
@@ -111,12 +111,18 @@ const Title = ({ children, href, onClick }) => {
111
111
  * @return Элемент.
112
112
  */
113
113
  const TrademarkLink = ({ href, children, onClick, }) => (react_1.default.createElement(link_1.Link, { className: cx('trademark-link'), href: href, children: children, onClick: onClick, color: 'basic-blue', "data-testid": 'product-info:trademark-link' }));
114
+ const FooterContext = (0, react_1.createContext)({
115
+ className: undefined,
116
+ });
114
117
  /**
115
118
  * Слот - футер.
116
119
  * @param props Свойства.
117
120
  * @return Элемент.
118
121
  */
119
- const Footer = ({ children }) => (react_1.default.createElement("div", { className: cx('footer'), "data-testid": 'product-info:footer' }, children));
122
+ const Footer = ({ children }) => {
123
+ const { className = cx('footer') } = (0, react_1.useContext)(FooterContext);
124
+ return (react_1.default.createElement("div", { className: className, "data-testid": 'product-info:footer' }, children));
125
+ };
120
126
  /**
121
127
  * Блок управления корзиной.
122
128
  * @param props Свойства.
@@ -169,6 +175,7 @@ exports.Parts = {
169
175
  TrademarkLink,
170
176
  // компоненты-слоты и компоненты-запчасти, предназначенные для вывода футера (dcе что ниже ссылки на торговую марку)
171
177
  Footer,
178
+ FooterContext,
172
179
  CartControl,
173
180
  AdultConfirmButton,
174
181
  WaitListAddButton,
@@ -45,11 +45,12 @@ const ProductSlider = ({ children, onInViewport, onNeedRequest }) => {
45
45
  entry.isIntersecting && (onInViewport === null || onInViewport === void 0 ? void 0 : onInViewport());
46
46
  });
47
47
  return (react_1.default.createElement("div", { ref: rootRef, "data-testid": 'product-slider:root' },
48
- react_1.default.createElement(touch_slider_1.TouchSlider, null, react_1.Children.toArray(children).reduce((list, item) => {
49
- (0, react_1.isValidElement)(item) &&
50
- item.type === product_info_1.ProductInfo &&
51
- list.push(react_1.default.createElement("div", { key: item.key, className: product_slider_module_scss_1.default.item, "data-testid": 'product-slider:item' }, item));
52
- return list;
53
- }, []))));
48
+ react_1.default.createElement(touch_slider_1.TouchSlider, null,
49
+ react_1.default.createElement(product_info_1.Parts.FooterContext.Provider, { value: { className: product_slider_module_scss_1.default.footer } }, react_1.Children.toArray(children).reduce((list, item) => {
50
+ (0, react_1.isValidElement)(item) &&
51
+ item.type === product_info_1.ProductInfo &&
52
+ list.push(react_1.default.createElement("div", { key: item.key, className: product_slider_module_scss_1.default.item, "data-testid": 'product-slider:item' }, item));
53
+ return list;
54
+ }, [])))));
54
55
  };
55
56
  exports.ProductSlider = ProductSlider;
@@ -1,6 +1,8 @@
1
1
  @use 'node_modules/@sima-land/ui-nucleons/breakpoints';
2
2
 
3
3
  .item {
4
+ display: flex;
5
+ flex-direction: column;
4
6
  position: relative;
5
7
  flex-shrink: 0;
6
8
  width: 160px;
@@ -11,3 +13,8 @@
11
13
  margin-right: 16px;
12
14
  }
13
15
  }
16
+
17
+ .footer {
18
+ margin-top: auto;
19
+ padding-top: 16px;
20
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sima-land/moleculas",
3
- "version": "15.1.0",
3
+ "version": "15.2.0",
4
4
  "repository": "ssh://git@github.com:sima-land/moleculas.git",
5
5
  "author": "www.sima-land.ru team",
6
6
  "license": "Apache-2.0",