@cloud-ru/uikit-product-site-hero 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 1.1.1 (2025-12-15)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **SITE-10411:** add missing HeroSlider styles ([fdc9edf](https://gitverse.ru/cloud-ru-tech/uikit-product/commits/fdc9edf140c657c6857ba9496fafe81e8ae0e32e))
12
+
13
+
14
+
15
+
16
+
6
17
  # 1.1.0 (2025-12-15)
7
18
 
8
19
 
@@ -50,5 +50,5 @@ function HeroSlider(_a) {
50
50
  return ((0, jsx_runtime_1.jsxs)("section", { className: (0, classnames_1.default)(styles_module_scss_1.default.root, className), id: id, "data-appearance": currentAppearance, "data-color": currentColor, "data-layout-type": layoutType, children: [(0, jsx_runtime_1.jsx)(carousel_1.Carousel, Object.assign({ className: styles_module_scss_1.default.heroCarousel, arrows: false, pagination: false, infiniteScroll: true, autoSwipe: autoSwipe, state: {
51
51
  page: currentPage,
52
52
  onChange: setCurrentPage,
53
- }, gap: '0' }, (0, uikit_product_utils_1.extractSupportProps)(rest), { children: items.map((item, i) => ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.carouselItemWrapper, "data-layout-type": layoutType, children: (0, jsx_runtime_1.jsx)(components_1.HeroSlide, Object.assign({}, item, { className: styles_module_scss_1.default.heroSlide, layoutType: layoutType })) }, `${item.title}${i}`))) })), (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.tabsWrapper), "data-layout-type": layoutType, children: (0, jsx_runtime_1.jsx)(components_1.TabsRowHeroSlider, { className: styles_module_scss_1.default.tabs, appearance: currentAppearance, active: currentTab, items: tabs, onTabClick: handleTabClick }) }), (0, jsx_runtime_1.jsx)(components_1.Control, { className: styles_module_scss_1.default.control, variant: 'prev', onClick: handleLeftClick }), (0, jsx_runtime_1.jsx)(components_1.Control, { className: styles_module_scss_1.default.control, variant: 'next', onClick: handleRightClick })] }));
53
+ }, gap: '0' }, (0, uikit_product_utils_1.extractSupportProps)(rest), { children: items.map((item, i) => ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.carouselItemWrapper, "data-layout-type": layoutType, children: (0, jsx_runtime_1.jsx)(components_1.HeroSlide, Object.assign({}, item, { className: styles_module_scss_1.default.heroSlide, layoutType: layoutType })) }, `${item.title}${i}`))) })), (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.tabsWrapper), "data-layout-type": layoutType, children: (0, jsx_runtime_1.jsx)(components_1.TabsRowHeroSlider, { className: styles_module_scss_1.default.tabs, appearance: currentAppearance, active: currentTab, items: tabs, animationEnabled: autoSwipe === AUTO_SWIPE, onTabClick: handleTabClick }) }), (0, jsx_runtime_1.jsx)(components_1.Control, { className: styles_module_scss_1.default.control, variant: 'prev', onClick: handleLeftClick }), (0, jsx_runtime_1.jsx)(components_1.Control, { className: styles_module_scss_1.default.control, variant: 'next', onClick: handleRightClick })] }));
54
54
  }
@@ -5,6 +5,7 @@ export type TabHeroSliderBase = {
5
5
  type TabHeroSliderProps = TabHeroSliderBase & {
6
6
  active: boolean;
7
7
  appearance: AppearanceType;
8
+ animationEnabled: boolean;
8
9
  onClick: () => void;
9
10
  };
10
11
  export declare function TabHeroSlider(props: TabHeroSliderProps): import("react/jsx-runtime").JSX.Element;
@@ -9,6 +9,6 @@ const uikit_product_site_rich_text_1 = require("@cloud-ru/uikit-product-site-ric
9
9
  const typography_1 = require("@snack-uikit/typography");
10
10
  const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
11
11
  function TabHeroSlider(props) {
12
- const { title, appearance, active, onClick } = props;
13
- return ((0, jsx_runtime_1.jsxs)("button", { className: styles_module_scss_1.default.tab, type: 'button', role: 'tab', onClick: onClick, "data-appearance": appearance, "data-active": active, children: [(0, jsx_runtime_1.jsx)(typography_1.Typography.SansBodyS, { children: (0, jsx_runtime_1.jsx)(uikit_product_site_rich_text_1.RichText, { richText: title }) }), active && (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.timeline })] }));
12
+ const { title, appearance, active, animationEnabled, onClick } = props;
13
+ return ((0, jsx_runtime_1.jsxs)("button", { className: styles_module_scss_1.default.tab, type: 'button', role: 'tab', onClick: onClick, "data-appearance": appearance, "data-active": active, children: [(0, jsx_runtime_1.jsx)(typography_1.Typography.SansBodyS, { children: (0, jsx_runtime_1.jsx)(uikit_product_site_rich_text_1.RichText, { richText: title }) }), active && (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.timeline, "data-animation-enabled": animationEnabled })] }));
14
14
  }
@@ -19,14 +19,14 @@
19
19
  color:var(--sys-graphite-text-disabled, #a3a3a3);
20
20
  border-color:var(--sys-graphite-accent-pressed, #4e4e4e);
21
21
  }
22
- .tab[data-appearance=graphite][data-active=true]{
22
+ .tab[data-appearance=graphite]:hover, .tab[data-appearance=graphite][data-active=true]{
23
23
  color:var(--sys-graphite-on-accent, #ffffff);
24
24
  }
25
25
  .tab[data-appearance=decor]{
26
26
  color:var(--sys-neutral-text-support, #656774);
27
27
  border-color:var(--sys-invert-neutral-decor-activated, #6d707f);
28
28
  }
29
- .tab[data-appearance=decor][data-active=true]{
29
+ .tab[data-appearance=decor]:hover, .tab[data-appearance=decor][data-active=true]{
30
30
  color:var(--sys-neutral-text-main, #41424e);
31
31
  }
32
32
  .tab[data-appearance=brand]{
@@ -36,7 +36,7 @@
36
36
  .tab[data-appearance=brand] .timeline{
37
37
  border-color:var(--sys-fluorescent-yellow-accent-default, #cff500);
38
38
  }
39
- .tab[data-appearance=brand][data-active=true]{
39
+ .tab[data-appearance=brand]:hover, .tab[data-appearance=brand][data-active=true]{
40
40
  color:var(--sys-primary-text-main, #0d402b);
41
41
  }
42
42
 
@@ -45,8 +45,11 @@
45
45
  top:-1px;
46
46
  left:0px;
47
47
  z-index:1;
48
- width:0;
48
+ width:100%;
49
49
  border-top:3px solid var(--sys-primary-accent-default, #26d07c);
50
+ }
51
+ .timeline[data-animation-enabled=true]{
52
+ width:0;
50
53
  animation:growTimeline 5s linear forwards;
51
54
  }
52
55
 
@@ -5,6 +5,7 @@ type TabsRowHeroSliderProps = {
5
5
  appearance: AppearanceType;
6
6
  active: TabHeroSliderBase;
7
7
  items: TabHeroSliderBase[];
8
+ animationEnabled: boolean;
8
9
  onTabClick: (page: TabHeroSliderBase) => void;
9
10
  };
10
11
  export declare function TabsRowHeroSlider(props: TabsRowHeroSliderProps): import("react/jsx-runtime").JSX.Element;
@@ -10,7 +10,7 @@ const react_1 = require("react");
10
10
  const TabHeroSlider_1 = require("../TabHeroSlider");
11
11
  const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
12
12
  function TabsRowHeroSlider(props) {
13
- const { className, items, appearance, active, onTabClick } = props;
13
+ const { className, items, appearance, active, animationEnabled, onTabClick } = props;
14
14
  const containerRef = (0, react_1.useRef)(null);
15
15
  (0, react_1.useEffect)(() => {
16
16
  const container = containerRef.current;
@@ -31,5 +31,5 @@ function TabsRowHeroSlider(props) {
31
31
  const handleTabClick = (tab) => () => {
32
32
  onTabClick(tab);
33
33
  };
34
- return ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.tabs, className), ref: containerRef, children: items.map((tab, i) => ((0, jsx_runtime_1.jsx)(TabHeroSlider_1.TabHeroSlider, Object.assign({ appearance: appearance, active: tab === active, onClick: handleTabClick(tab) }, tab), `tab-${i}-${tab.title}`))) }));
34
+ return ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.tabs, className), ref: containerRef, children: items.map((tab, i) => ((0, jsx_runtime_1.jsx)(TabHeroSlider_1.TabHeroSlider, Object.assign({ appearance: appearance, active: tab === active, animationEnabled: animationEnabled, onClick: handleTabClick(tab) }, tab), `tab-${i}-${tab.title}`))) }));
35
35
  }
@@ -44,5 +44,5 @@ export function HeroSlider(_a) {
44
44
  return (_jsxs("section", { className: cn(styles.root, className), id: id, "data-appearance": currentAppearance, "data-color": currentColor, "data-layout-type": layoutType, children: [_jsx(Carousel, Object.assign({ className: styles.heroCarousel, arrows: false, pagination: false, infiniteScroll: true, autoSwipe: autoSwipe, state: {
45
45
  page: currentPage,
46
46
  onChange: setCurrentPage,
47
- }, gap: '0' }, extractSupportProps(rest), { children: items.map((item, i) => (_jsx("div", { className: styles.carouselItemWrapper, "data-layout-type": layoutType, children: _jsx(HeroSlide, Object.assign({}, item, { className: styles.heroSlide, layoutType: layoutType })) }, `${item.title}${i}`))) })), _jsx("div", { className: cn(styles.tabsWrapper), "data-layout-type": layoutType, children: _jsx(TabsRowHeroSlider, { className: styles.tabs, appearance: currentAppearance, active: currentTab, items: tabs, onTabClick: handleTabClick }) }), _jsx(Control, { className: styles.control, variant: 'prev', onClick: handleLeftClick }), _jsx(Control, { className: styles.control, variant: 'next', onClick: handleRightClick })] }));
47
+ }, gap: '0' }, extractSupportProps(rest), { children: items.map((item, i) => (_jsx("div", { className: styles.carouselItemWrapper, "data-layout-type": layoutType, children: _jsx(HeroSlide, Object.assign({}, item, { className: styles.heroSlide, layoutType: layoutType })) }, `${item.title}${i}`))) })), _jsx("div", { className: cn(styles.tabsWrapper), "data-layout-type": layoutType, children: _jsx(TabsRowHeroSlider, { className: styles.tabs, appearance: currentAppearance, active: currentTab, items: tabs, animationEnabled: autoSwipe === AUTO_SWIPE, onTabClick: handleTabClick }) }), _jsx(Control, { className: styles.control, variant: 'prev', onClick: handleLeftClick }), _jsx(Control, { className: styles.control, variant: 'next', onClick: handleRightClick })] }));
48
48
  }
@@ -5,6 +5,7 @@ export type TabHeroSliderBase = {
5
5
  type TabHeroSliderProps = TabHeroSliderBase & {
6
6
  active: boolean;
7
7
  appearance: AppearanceType;
8
+ animationEnabled: boolean;
8
9
  onClick: () => void;
9
10
  };
10
11
  export declare function TabHeroSlider(props: TabHeroSliderProps): import("react/jsx-runtime").JSX.Element;
@@ -3,6 +3,6 @@ import { RichText } from '@cloud-ru/uikit-product-site-rich-text';
3
3
  import { Typography } from '@snack-uikit/typography';
4
4
  import styles from './styles.module.css';
5
5
  export function TabHeroSlider(props) {
6
- const { title, appearance, active, onClick } = props;
7
- return (_jsxs("button", { className: styles.tab, type: 'button', role: 'tab', onClick: onClick, "data-appearance": appearance, "data-active": active, children: [_jsx(Typography.SansBodyS, { children: _jsx(RichText, { richText: title }) }), active && _jsx("div", { className: styles.timeline })] }));
6
+ const { title, appearance, active, animationEnabled, onClick } = props;
7
+ return (_jsxs("button", { className: styles.tab, type: 'button', role: 'tab', onClick: onClick, "data-appearance": appearance, "data-active": active, children: [_jsx(Typography.SansBodyS, { children: _jsx(RichText, { richText: title }) }), active && _jsx("div", { className: styles.timeline, "data-animation-enabled": animationEnabled })] }));
8
8
  }
@@ -19,14 +19,14 @@
19
19
  color:var(--sys-graphite-text-disabled, #a3a3a3);
20
20
  border-color:var(--sys-graphite-accent-pressed, #4e4e4e);
21
21
  }
22
- .tab[data-appearance=graphite][data-active=true]{
22
+ .tab[data-appearance=graphite]:hover, .tab[data-appearance=graphite][data-active=true]{
23
23
  color:var(--sys-graphite-on-accent, #ffffff);
24
24
  }
25
25
  .tab[data-appearance=decor]{
26
26
  color:var(--sys-neutral-text-support, #656774);
27
27
  border-color:var(--sys-invert-neutral-decor-activated, #6d707f);
28
28
  }
29
- .tab[data-appearance=decor][data-active=true]{
29
+ .tab[data-appearance=decor]:hover, .tab[data-appearance=decor][data-active=true]{
30
30
  color:var(--sys-neutral-text-main, #41424e);
31
31
  }
32
32
  .tab[data-appearance=brand]{
@@ -36,7 +36,7 @@
36
36
  .tab[data-appearance=brand] .timeline{
37
37
  border-color:var(--sys-fluorescent-yellow-accent-default, #cff500);
38
38
  }
39
- .tab[data-appearance=brand][data-active=true]{
39
+ .tab[data-appearance=brand]:hover, .tab[data-appearance=brand][data-active=true]{
40
40
  color:var(--sys-primary-text-main, #0d402b);
41
41
  }
42
42
 
@@ -45,8 +45,11 @@
45
45
  top:-1px;
46
46
  left:0px;
47
47
  z-index:1;
48
- width:0;
48
+ width:100%;
49
49
  border-top:3px solid var(--sys-primary-accent-default, #26d07c);
50
+ }
51
+ .timeline[data-animation-enabled=true]{
52
+ width:0;
50
53
  animation:growTimeline 5s linear forwards;
51
54
  }
52
55
 
@@ -5,6 +5,7 @@ type TabsRowHeroSliderProps = {
5
5
  appearance: AppearanceType;
6
6
  active: TabHeroSliderBase;
7
7
  items: TabHeroSliderBase[];
8
+ animationEnabled: boolean;
8
9
  onTabClick: (page: TabHeroSliderBase) => void;
9
10
  };
10
11
  export declare function TabsRowHeroSlider(props: TabsRowHeroSliderProps): import("react/jsx-runtime").JSX.Element;
@@ -4,7 +4,7 @@ import { useEffect, useRef } from 'react';
4
4
  import { TabHeroSlider } from '../TabHeroSlider';
5
5
  import styles from './styles.module.css';
6
6
  export function TabsRowHeroSlider(props) {
7
- const { className, items, appearance, active, onTabClick } = props;
7
+ const { className, items, appearance, active, animationEnabled, onTabClick } = props;
8
8
  const containerRef = useRef(null);
9
9
  useEffect(() => {
10
10
  const container = containerRef.current;
@@ -25,5 +25,5 @@ export function TabsRowHeroSlider(props) {
25
25
  const handleTabClick = (tab) => () => {
26
26
  onTabClick(tab);
27
27
  };
28
- return (_jsx("div", { className: cn(styles.tabs, className), ref: containerRef, children: items.map((tab, i) => (_jsx(TabHeroSlider, Object.assign({ appearance: appearance, active: tab === active, onClick: handleTabClick(tab) }, tab), `tab-${i}-${tab.title}`))) }));
28
+ return (_jsx("div", { className: cn(styles.tabs, className), ref: containerRef, children: items.map((tab, i) => (_jsx(TabHeroSlider, Object.assign({ appearance: appearance, active: tab === active, animationEnabled: animationEnabled, onClick: handleTabClick(tab) }, tab), `tab-${i}-${tab.title}`))) }));
29
29
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloud-ru/uikit-product-site-hero",
3
3
  "title": "Site Hero",
4
- "version": "1.1.0",
4
+ "version": "1.1.1",
5
5
  "sideEffects": [
6
6
  "*.css",
7
7
  "*.woff",
@@ -56,5 +56,5 @@
56
56
  "peerDependencies": {
57
57
  "@cloud-ru/uikit-product-locale": "*"
58
58
  },
59
- "gitHead": "fdcf94a6757e590c66ace1a43667bb29ce748d64"
59
+ "gitHead": "acf24c0bfa98c4117bf6b90eb9927d1cf4f6038c"
60
60
  }
@@ -87,6 +87,7 @@ export function HeroSlider({ id, tabs: tabsProp, layoutType, items: itemsProp, c
87
87
  appearance={currentAppearance}
88
88
  active={currentTab}
89
89
  items={tabs}
90
+ animationEnabled={autoSwipe === AUTO_SWIPE}
90
91
  onTabClick={handleTabClick}
91
92
  />
92
93
  </div>
@@ -11,11 +11,12 @@ export type TabHeroSliderBase = {
11
11
  type TabHeroSliderProps = TabHeroSliderBase & {
12
12
  active: boolean;
13
13
  appearance: AppearanceType;
14
+ animationEnabled: boolean;
14
15
  onClick: () => void;
15
16
  };
16
17
 
17
18
  export function TabHeroSlider(props: TabHeroSliderProps) {
18
- const { title, appearance, active, onClick } = props;
19
+ const { title, appearance, active, animationEnabled, onClick } = props;
19
20
 
20
21
  return (
21
22
  <button
@@ -29,7 +30,7 @@ export function TabHeroSlider(props: TabHeroSliderProps) {
29
30
  <Typography.SansBodyS>
30
31
  <RichText richText={title} />
31
32
  </Typography.SansBodyS>
32
- {active && <div className={styles.timeline} />}
33
+ {active && <div className={styles.timeline} data-animation-enabled={animationEnabled} />}
33
34
  </button>
34
35
  );
35
36
  }
@@ -32,6 +32,7 @@ $brand: 'brand';
32
32
  color: var.$sys-graphite-text-disabled;
33
33
  border-color: var.$sys-graphite-accent-pressed;
34
34
 
35
+ &:hover,
35
36
  &[data-active='true'] {
36
37
  color: var.$sys-graphite-on-accent;
37
38
  }
@@ -41,6 +42,7 @@ $brand: 'brand';
41
42
  color: var.$sys-neutral-text-support;
42
43
  border-color: var.$sys-invert-neutral-decor-activated;
43
44
 
45
+ &:hover,
44
46
  &[data-active='true'] {
45
47
  color: var.$sys-neutral-text-main;
46
48
  }
@@ -54,6 +56,7 @@ $brand: 'brand';
54
56
  border-color: var.$sys-fluorescent-yellow-accent-default;
55
57
  }
56
58
 
59
+ &:hover,
57
60
  &[data-active='true'] {
58
61
  color: var.$sys-primary-text-main;
59
62
  }
@@ -69,11 +72,14 @@ $brand: 'brand';
69
72
  /* stylelint-disable-next-line declaration-property-value-allowed-list */
70
73
  z-index: 1;
71
74
 
72
- width: 0;
75
+ width: 100%;
73
76
 
74
77
  border-top: 3px solid var.$sys-primary-accent-default;
75
78
 
76
- animation: growTimeline 5s linear forwards;
79
+ &[data-animation-enabled='true'] {
80
+ width: 0;
81
+ animation: growTimeline 5s linear forwards;
82
+ }
77
83
  }
78
84
 
79
85
  @keyframes growTimeline {
@@ -10,11 +10,12 @@ type TabsRowHeroSliderProps = {
10
10
  appearance: AppearanceType;
11
11
  active: TabHeroSliderBase;
12
12
  items: TabHeroSliderBase[];
13
+ animationEnabled: boolean;
13
14
  onTabClick: (page: TabHeroSliderBase) => void;
14
15
  };
15
16
 
16
17
  export function TabsRowHeroSlider(props: TabsRowHeroSliderProps) {
17
- const { className, items, appearance, active, onTabClick } = props;
18
+ const { className, items, appearance, active, animationEnabled, onTabClick } = props;
18
19
 
19
20
  const containerRef = useRef<HTMLDivElement>(null);
20
21
 
@@ -49,6 +50,7 @@ export function TabsRowHeroSlider(props: TabsRowHeroSliderProps) {
49
50
  key={`tab-${i}-${tab.title}`}
50
51
  appearance={appearance}
51
52
  active={tab === active}
53
+ animationEnabled={animationEnabled}
52
54
  onClick={handleTabClick(tab)}
53
55
  {...tab}
54
56
  />