@alfalab/core-components-gallery 5.3.16 → 5.4.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 (85) hide show
  1. package/Component.d.ts +8 -0
  2. package/Component.js +21 -10
  3. package/{buttons-774a8876.js → buttons-aee8961b.js} +1 -1
  4. package/components/header/Component.js +1 -1
  5. package/components/header/buttons.js +1 -1
  6. package/components/header/index.css +6 -6
  7. package/components/header/index.js +1 -1
  8. package/components/header-info-block/Component.js +1 -1
  9. package/components/header-info-block/index.css +5 -5
  10. package/components/image-preview/Component.js +1 -1
  11. package/components/image-preview/index.css +16 -16
  12. package/components/image-viewer/component.js +2 -2
  13. package/components/image-viewer/index.css +25 -25
  14. package/components/image-viewer/index.js +1 -1
  15. package/components/image-viewer/slide.js +1 -1
  16. package/components/index.js +2 -2
  17. package/components/navigation-bar/Component.js +2 -2
  18. package/components/navigation-bar/index.css +6 -6
  19. package/context.d.ts +1 -1
  20. package/cssm/Component.d.ts +8 -0
  21. package/cssm/Component.js +18 -7
  22. package/cssm/components/image-preview/index.module.css +3 -3
  23. package/cssm/components/image-viewer/component.js +1 -1
  24. package/cssm/components/image-viewer/index.module.css +6 -6
  25. package/cssm/components/navigation-bar/Component.js +1 -1
  26. package/cssm/context.d.ts +1 -1
  27. package/cssm/index.module.css +1 -1
  28. package/esm/Component.d.ts +8 -0
  29. package/esm/Component.js +21 -10
  30. package/esm/{buttons-19c3e8bb.js → buttons-3fe223c3.js} +1 -1
  31. package/esm/components/header/Component.js +1 -1
  32. package/esm/components/header/buttons.js +1 -1
  33. package/esm/components/header/index.css +6 -6
  34. package/esm/components/header/index.js +1 -1
  35. package/esm/components/header-info-block/Component.js +1 -1
  36. package/esm/components/header-info-block/index.css +5 -5
  37. package/esm/components/image-preview/Component.js +1 -1
  38. package/esm/components/image-preview/index.css +16 -16
  39. package/esm/components/image-viewer/component.js +2 -2
  40. package/esm/components/image-viewer/index.css +25 -25
  41. package/esm/components/image-viewer/index.js +1 -1
  42. package/esm/components/image-viewer/slide.js +1 -1
  43. package/esm/components/index.js +2 -2
  44. package/esm/components/navigation-bar/Component.js +2 -2
  45. package/esm/components/navigation-bar/index.css +6 -6
  46. package/esm/context.d.ts +1 -1
  47. package/esm/index.css +4 -4
  48. package/esm/index.js +2 -2
  49. package/esm/{slide-3dfe6711.js → slide-dae17d46.js} +1 -1
  50. package/index.css +4 -4
  51. package/index.js +2 -2
  52. package/modern/Component.d.ts +8 -0
  53. package/modern/Component.js +21 -10
  54. package/modern/{buttons-843b823a.js → buttons-80612f2b.js} +1 -1
  55. package/modern/components/header/Component.js +1 -1
  56. package/modern/components/header/buttons.js +1 -1
  57. package/modern/components/header/index.css +6 -6
  58. package/modern/components/header/index.js +1 -1
  59. package/modern/components/header-info-block/Component.js +1 -1
  60. package/modern/components/header-info-block/index.css +5 -5
  61. package/modern/components/image-preview/Component.js +1 -1
  62. package/modern/components/image-preview/index.css +16 -16
  63. package/modern/components/image-viewer/component.js +2 -2
  64. package/modern/components/image-viewer/index.css +25 -25
  65. package/modern/components/image-viewer/index.js +1 -1
  66. package/modern/components/image-viewer/slide.js +1 -1
  67. package/modern/components/index.js +2 -2
  68. package/modern/components/navigation-bar/Component.js +2 -2
  69. package/modern/components/navigation-bar/index.css +6 -6
  70. package/modern/context.d.ts +1 -1
  71. package/modern/index.css +4 -4
  72. package/modern/index.js +2 -2
  73. package/modern/{slide-39ef7ba6.js → slide-060d55ad.js} +1 -1
  74. package/package.json +5 -5
  75. package/{slide-9204dd28.js → slide-2267d541.js} +1 -1
  76. package/src/Component.tsx +32 -6
  77. package/src/components/image-viewer/component.tsx +1 -1
  78. package/src/components/navigation-bar/Component.tsx +1 -1
  79. package/src/context.ts +1 -1
  80. /package/{buttons-774a8876.d.ts → buttons-aee8961b.d.ts} +0 -0
  81. /package/esm/{buttons-19c3e8bb.d.ts → buttons-3fe223c3.d.ts} +0 -0
  82. /package/esm/{slide-3dfe6711.d.ts → slide-dae17d46.d.ts} +0 -0
  83. /package/modern/{buttons-843b823a.d.ts → buttons-80612f2b.d.ts} +0 -0
  84. /package/modern/{slide-39ef7ba6.d.ts → slide-060d55ad.d.ts} +0 -0
  85. /package/{slide-9204dd28.d.ts → slide-2267d541.d.ts} +0 -0
package/esm/context.d.ts CHANGED
@@ -16,7 +16,7 @@ type GalleryContext = {
16
16
  getSwiper: () => SwiperCore | undefined;
17
17
  setSwiper: (swiper: SwiperCore) => void;
18
18
  onClose: () => void;
19
- setCurrentSlideIndex: (index: number) => void;
19
+ setCurrentSlideIndex?: (index: number) => void;
20
20
  getCurrentImage: () => GalleryImage | undefined;
21
21
  getCurrentImageMeta: () => ImageMeta | undefined;
22
22
  };
package/esm/index.css CHANGED
@@ -1,7 +1,7 @@
1
- /* hash: 2xwa9 */
1
+ /* hash: 1dnkk */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
- --color-static-bg-primary-dark: #121212; /* 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-static-bg-primary-dark: #0e0e0e; /* 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 */
5
5
  } :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 */
6
6
  } :root {
7
7
  } :root {
@@ -15,14 +15,14 @@
15
15
  } :root {
16
16
  } :root {
17
17
  } :root {
18
- } .gallery__container_ljwk8 {
18
+ } .gallery__container_1hfaf {
19
19
  display: flex;
20
20
  flex-direction: column;
21
21
  justify-content: space-between;
22
22
  height: 100%;
23
23
  width: 100%;
24
24
  background-color: var(--color-static-bg-primary-dark);
25
- } .gallery__modal_ljwk8 {
25
+ } .gallery__modal_1hfaf {
26
26
  flex-grow: 1;
27
27
  width: 100%;
28
28
  height: 100%;
package/esm/index.js CHANGED
@@ -13,7 +13,7 @@ import './components/image-preview/paths.js';
13
13
  import './components/header/Component.js';
14
14
  import './components/header-info-block/Component.js';
15
15
  import '@alfalab/core-components-typography/esm';
16
- import './buttons-19c3e8bb.js';
16
+ import './buttons-3fe223c3.js';
17
17
  import 'tslib';
18
18
  import '@alfalab/core-components-icon-button/esm';
19
19
  import '@alfalab/core-components-tooltip/esm/desktop';
@@ -27,6 +27,6 @@ import 'swiper';
27
27
  import 'swiper/react';
28
28
  import '@alfalab/icons-glyph/ChevronBackHeavyMIcon';
29
29
  import '@alfalab/icons-glyph/ChevronForwardHeavyMIcon';
30
- import './slide-3dfe6711.js';
30
+ import './slide-dae17d46.js';
31
31
  import './components/image-viewer/paths.js';
32
32
  import 'swiper/swiper.min.css';
@@ -5,7 +5,7 @@ import { isSmallImage, getImageAlt } from './utils/utils.js';
5
5
  import { TestIds } from './utils/constants.js';
6
6
  import { NoImagePaths } from './components/image-viewer/paths.js';
7
7
 
8
- var styles = {"component":"gallery__component_cp5ui","swiper":"gallery__swiper_cp5ui","singleSlide":"gallery__singleSlide_cp5ui","hidden":"gallery__hidden_cp5ui","slide":"gallery__slide_cp5ui","slideLoading":"gallery__slideLoading_cp5ui","image":"gallery__image_cp5ui","smallImage":"gallery__smallImage_cp5ui","verticalImageFit":"gallery__verticalImageFit_cp5ui","horizontalImageFit":"gallery__horizontalImageFit_cp5ui","arrow":"gallery__arrow_cp5ui","focused":"gallery__focused_cp5ui","placeholder":"gallery__placeholder_cp5ui","brokenImgWrapper":"gallery__brokenImgWrapper_cp5ui","brokenImgIcon":"gallery__brokenImgIcon_cp5ui","fullScreenImage":"gallery__fullScreenImage_cp5ui"};
8
+ var styles = {"component":"gallery__component_tcbv9","swiper":"gallery__swiper_tcbv9","singleSlide":"gallery__singleSlide_tcbv9","hidden":"gallery__hidden_tcbv9","slide":"gallery__slide_tcbv9","slideLoading":"gallery__slideLoading_tcbv9","image":"gallery__image_tcbv9","smallImage":"gallery__smallImage_tcbv9","verticalImageFit":"gallery__verticalImageFit_tcbv9","horizontalImageFit":"gallery__horizontalImageFit_tcbv9","arrow":"gallery__arrow_tcbv9","focused":"gallery__focused_tcbv9","placeholder":"gallery__placeholder_tcbv9","brokenImgWrapper":"gallery__brokenImgWrapper_tcbv9","brokenImgIcon":"gallery__brokenImgIcon_tcbv9","fullScreenImage":"gallery__fullScreenImage_tcbv9"};
9
9
  require('./components/image-viewer/index.css')
10
10
 
11
11
  var SlideInner = function (_a) {
package/index.css CHANGED
@@ -1,7 +1,7 @@
1
- /* hash: 2xwa9 */
1
+ /* hash: 1dnkk */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
- --color-static-bg-primary-dark: #121212; /* 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-static-bg-primary-dark: #0e0e0e; /* 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 */
5
5
  } :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 */
6
6
  } :root {
7
7
  } :root {
@@ -15,14 +15,14 @@
15
15
  } :root {
16
16
  } :root {
17
17
  } :root {
18
- } .gallery__container_ljwk8 {
18
+ } .gallery__container_1hfaf {
19
19
  display: flex;
20
20
  flex-direction: column;
21
21
  justify-content: space-between;
22
22
  height: 100%;
23
23
  width: 100%;
24
24
  background-color: var(--color-static-bg-primary-dark);
25
- } .gallery__modal_ljwk8 {
25
+ } .gallery__modal_1hfaf {
26
26
  flex-grow: 1;
27
27
  width: 100%;
28
28
  height: 100%;
package/index.js CHANGED
@@ -17,7 +17,7 @@ require('./components/image-preview/paths.js');
17
17
  require('./components/header/Component.js');
18
18
  require('./components/header-info-block/Component.js');
19
19
  require('@alfalab/core-components-typography');
20
- require('./buttons-774a8876.js');
20
+ require('./buttons-aee8961b.js');
21
21
  require('tslib');
22
22
  require('@alfalab/core-components-icon-button');
23
23
  require('@alfalab/core-components-tooltip/desktop');
@@ -31,7 +31,7 @@ require('swiper');
31
31
  require('swiper/react');
32
32
  require('@alfalab/icons-glyph/ChevronBackHeavyMIcon');
33
33
  require('@alfalab/icons-glyph/ChevronForwardHeavyMIcon');
34
- require('./slide-9204dd28.js');
34
+ require('./slide-2267d541.js');
35
35
  require('./components/image-viewer/paths.js');
36
36
  require('swiper/swiper.min.css');
37
37
 
@@ -23,6 +23,14 @@ type GalleryProps = {
23
23
  * Обработчик закрытия
24
24
  */
25
25
  onClose: () => void;
26
+ /**
27
+ * Индекс текущего изображения
28
+ */
29
+ slideIndex?: number;
30
+ /**
31
+ * Обработчик изменения текущего изображения
32
+ */
33
+ onSlideIndexChange?: (index: number) => void;
26
34
  };
27
35
  declare const Gallery: FC<GalleryProps>;
28
36
  export { GalleryProps, Gallery };
@@ -13,7 +13,7 @@ import './components/image-preview/paths.js';
13
13
  import './components/header-info-block/Component.js';
14
14
  import '@alfalab/core-components-typography/modern';
15
15
  import './utils/split-filename.js';
16
- import './buttons-843b823a.js';
16
+ import './buttons-80612f2b.js';
17
17
  import '@alfalab/core-components-icon-button/modern';
18
18
  import '@alfalab/core-components-tooltip/modern/desktop';
19
19
  import '@alfalab/icons-glyph/ArrowsInwardMIcon';
@@ -25,27 +25,31 @@ import 'swiper';
25
25
  import 'swiper/react';
26
26
  import '@alfalab/icons-glyph/ChevronBackHeavyMIcon';
27
27
  import '@alfalab/icons-glyph/ChevronForwardHeavyMIcon';
28
- import './slide-39ef7ba6.js';
28
+ import './slide-060d55ad.js';
29
29
  import './components/image-viewer/paths.js';
30
30
  import 'swiper/swiper.min.css';
31
31
 
32
- const styles = {"container":"gallery__container_ljwk8","modal":"gallery__modal_ljwk8"};
32
+ const styles = {"container":"gallery__container_1hfaf","modal":"gallery__modal_1hfaf"};
33
33
  require('./index.css')
34
34
 
35
35
  const Backdrop = () => null;
36
- const Gallery = ({ open, images, initialSlide = 0, loop = true, onClose, }) => {
37
- const [currentSlideIndex, setCurrentSlideIndex] = useState(initialSlide);
36
+ const Gallery = ({ open, images, slideIndex, initialSlide = 0, loop = true, onClose, onSlideIndexChange, }) => {
37
+ const currentSlideIndexState = useState(initialSlide);
38
+ const uncontrolled = slideIndex === undefined;
39
+ const [currentSlideIndex, setCurrentSlideIndex] = uncontrolled
40
+ ? currentSlideIndexState
41
+ : [slideIndex, onSlideIndexChange];
38
42
  const [swiper, setSwiper] = useState();
39
43
  const [imagesMeta, setImagesMeta] = useState([]);
40
44
  const [fullScreen, setFullScreen] = useState(false);
41
45
  const slideTo = useCallback((index) => {
42
46
  if (images[index]) {
43
- setCurrentSlideIndex(index);
47
+ setCurrentSlideIndex?.(index);
44
48
  if (swiper) {
45
49
  swiper.slideTo(index);
46
50
  }
47
51
  }
48
- }, [images, swiper]);
52
+ }, [images, setCurrentSlideIndex, swiper]);
49
53
  const slideNext = useCallback(() => {
50
54
  const lastIndex = images.length - 1;
51
55
  let nextIndex = currentSlideIndex + 1;
@@ -68,9 +72,11 @@ const Gallery = ({ open, images, initialSlide = 0, loop = true, onClose, }) => {
68
72
  }, [imagesMeta]);
69
73
  const handleClose = useCallback(() => {
70
74
  onClose();
71
- setCurrentSlideIndex(initialSlide);
75
+ if (uncontrolled) {
76
+ setCurrentSlideIndex?.(initialSlide);
77
+ }
72
78
  setFullScreen(false);
73
- }, [initialSlide, onClose]);
79
+ }, [initialSlide, onClose, setCurrentSlideIndex, uncontrolled]);
74
80
  const handleEscapeKeyDown = () => {
75
81
  if (fullScreen) {
76
82
  setFullScreen(false);
@@ -92,6 +98,11 @@ const Gallery = ({ open, images, initialSlide = 0, loop = true, onClose, }) => {
92
98
  break;
93
99
  }
94
100
  }, [fullScreen, open, slideNext, slidePrev]);
101
+ useEffect(() => {
102
+ if (!uncontrolled && !swiper?.destroyed) {
103
+ swiper?.slideTo(currentSlideIndex);
104
+ }
105
+ }, [uncontrolled, currentSlideIndex, swiper]);
95
106
  useEffect(() => {
96
107
  document.addEventListener('keydown', handleKeyDown);
97
108
  return () => {
@@ -107,7 +118,7 @@ const Gallery = ({ open, images, initialSlide = 0, loop = true, onClose, }) => {
107
118
  images,
108
119
  imagesMeta,
109
120
  fullScreen,
110
- initialSlide,
121
+ initialSlide: uncontrolled ? initialSlide : currentSlideIndex,
111
122
  setFullScreen,
112
123
  setImageMeta,
113
124
  slideNext,
@@ -6,7 +6,7 @@ import { ArrowsOutwardMIcon } from '@alfalab/icons-glyph/ArrowsOutwardMIcon';
6
6
  import { CrossMIcon } from '@alfalab/icons-glyph/CrossMIcon';
7
7
  import { PointerDownMIcon } from '@alfalab/icons-glyph/PointerDownMIcon';
8
8
 
9
- const styles = {"header":"gallery__header_yt4qn","buttons":"gallery__buttons_yt4qn","iconButton":"gallery__iconButton_yt4qn"};
9
+ const styles = {"header":"gallery__header_wjlmy","buttons":"gallery__buttons_wjlmy","iconButton":"gallery__iconButton_wjlmy"};
10
10
  require('./components/header/index.css')
11
11
 
12
12
  const Fullscreen = ({ buttonRef, ...restProps }) => (React.createElement(TooltipDesktop, { trigger: 'hover', position: 'bottom', content: '\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0432 \u043F\u043E\u043B\u043D\u043E\u044D\u043A\u0440\u0430\u043D\u043D\u043E\u043C \u0440\u0435\u0436\u0438\u043C\u0435', fallbackPlacements: ['bottom-end'] },
@@ -3,7 +3,7 @@ import { GalleryContext } from '../../context.js';
3
3
  import { isSmallImage } from '../../utils/utils.js';
4
4
  import { TestIds } from '../../utils/constants.js';
5
5
  import { HeaderInfoBlock } from '../header-info-block/Component.js';
6
- import { s as styles, D as Download, E as Exit, a as ExitFullscreen, F as Fullscreen } from '../../buttons-843b823a.js';
6
+ import { s as styles, D as Download, E as Exit, a as ExitFullscreen, F as Fullscreen } from '../../buttons-80612f2b.js';
7
7
  import '@alfalab/core-components-typography/modern';
8
8
  import '../../utils/split-filename.js';
9
9
  import '@alfalab/core-components-icon-button/modern';
@@ -5,4 +5,4 @@ import '@alfalab/icons-glyph/ArrowsInwardMIcon';
5
5
  import '@alfalab/icons-glyph/ArrowsOutwardMIcon';
6
6
  import '@alfalab/icons-glyph/CrossMIcon';
7
7
  import '@alfalab/icons-glyph/PointerDownMIcon';
8
- export { D as Download, E as Exit, a as ExitFullscreen, F as Fullscreen } from '../../buttons-843b823a.js';
8
+ export { D as Download, E as Exit, a as ExitFullscreen, F as Fullscreen } from '../../buttons-80612f2b.js';
@@ -1,4 +1,4 @@
1
- /* hash: tn3av */
1
+ /* hash: 3lcw5 */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-static-graphic-light: #fff; /* 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 */
@@ -20,20 +20,20 @@
20
20
  --gap-2xl: 32px;
21
21
  } :root {
22
22
  } :root {
23
- } .gallery__header_yt4qn {
23
+ } .gallery__header_wjlmy {
24
24
  display: flex;
25
25
  justify-content: space-between;
26
26
  flex-shrink: 0;
27
27
  width: 100%;
28
28
  padding: var(--gap-m) var(--gap-xl);
29
29
  box-sizing: border-box;
30
- } .gallery__buttons_yt4qn {
30
+ } .gallery__buttons_wjlmy {
31
31
  display: flex;
32
32
  padding-left: var(--gap-2xl)
33
- } .gallery__buttons_yt4qn path {
33
+ } .gallery__buttons_wjlmy path {
34
34
  color: var(--color-static-graphic-light);
35
- } /* TODO: применять static цвет через prop IconButton'а */ .gallery__iconButton_yt4qn:hover path {
35
+ } /* TODO: применять static цвет через prop IconButton'а */ .gallery__iconButton_wjlmy:hover path {
36
36
  color: var(--color-static-graphic-light-shade-7);
37
- } .gallery__iconButton_yt4qn:active path {
37
+ } .gallery__iconButton_wjlmy:active path {
38
38
  color: var(--color-static-graphic-light-shade-15);
39
39
  }
@@ -6,7 +6,7 @@ import '../../utils/constants.js';
6
6
  import '../header-info-block/Component.js';
7
7
  import '@alfalab/core-components-typography/modern';
8
8
  import '../../utils/split-filename.js';
9
- import '../../buttons-843b823a.js';
9
+ import '../../buttons-80612f2b.js';
10
10
  import '@alfalab/core-components-icon-button/modern';
11
11
  import '@alfalab/core-components-tooltip/modern/desktop';
12
12
  import '@alfalab/icons-glyph/ArrowsInwardMIcon';
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { Typography } from '@alfalab/core-components-typography/modern';
3
3
  import { splitFilename } from '../../utils/split-filename.js';
4
4
 
5
- const styles = {"info":"gallery__info_1b6iz","filenameHead":"gallery__filenameHead_1b6iz","filenameContainer":"gallery__filenameContainer_1b6iz","description":"gallery__description_1b6iz"};
5
+ const styles = {"info":"gallery__info_1062w","filenameHead":"gallery__filenameHead_1062w","filenameContainer":"gallery__filenameContainer_1062w","description":"gallery__description_1062w"};
6
6
  require('./index.css')
7
7
 
8
8
  const HeaderInfoBlock = ({ filename, description }) => {
@@ -1,4 +1,4 @@
1
- /* hash: m3s2q */
1
+ /* hash: fimry */
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 */
@@ -15,21 +15,21 @@
15
15
  --gap-2xs: 4px;
16
16
  } :root {
17
17
  } :root {
18
- } .gallery__info_1b6iz {
18
+ } .gallery__info_1062w {
19
19
  height: 100%;
20
20
  display: flex;
21
21
  flex-direction: column;
22
22
  justify-content: center;
23
23
  overflow: hidden;
24
- } .gallery__filenameHead_1b6iz {
24
+ } .gallery__filenameHead_1062w {
25
25
  display: inline;
26
26
  text-overflow: ellipsis;
27
27
  overflow: hidden;
28
28
  white-space: nowrap;
29
- } .gallery__filenameContainer_1b6iz {
29
+ } .gallery__filenameContainer_1062w {
30
30
  overflow: hidden;
31
31
  display: inline-flex;
32
- } .gallery__description_1b6iz {
32
+ } .gallery__description_1062w {
33
33
  display: inline;
34
34
  text-overflow: ellipsis;
35
35
  overflow: hidden;
@@ -4,7 +4,7 @@ import { useFocus } from '@alfalab/hooks';
4
4
  import { GalleryContext } from '../../context.js';
5
5
  import { NoImagePaths } from './paths.js';
6
6
 
7
- const styles = {"component":"gallery__component_6vdai","active":"gallery__active_6vdai","image":"gallery__image_6vdai","preview":"gallery__preview_6vdai","loading":"gallery__loading_6vdai","brokenImageWrapper":"gallery__brokenImageWrapper_6vdai","brokenIcon":"gallery__brokenIcon_6vdai","focused":"gallery__focused_6vdai"};
7
+ const styles = {"component":"gallery__component_1fk9r","active":"gallery__active_1fk9r","image":"gallery__image_1fk9r","preview":"gallery__preview_1fk9r","loading":"gallery__loading_1fk9r","brokenImageWrapper":"gallery__brokenImageWrapper_1fk9r","brokenIcon":"gallery__brokenIcon_1fk9r","focused":"gallery__focused_1fk9r"};
8
8
  require('./index.css')
9
9
 
10
10
  const ImagePreview = ({ image, active = false, index, onSelect, className }) => {
@@ -1,10 +1,10 @@
1
- /* hash: ckkd0 */
1
+ /* hash: 1pxez */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-bg-primary: #fff;
5
- --color-light-border-link: #0072ef;
6
- --color-static-bg-quaternary-dark: #3a3a3c;
7
- --color-static-bg-secondary-dark: #202022; /* 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 */
5
+ --color-light-border-link: #2288fa;
6
+ --color-static-bg-quaternary-dark: #36363a;
7
+ --color-static-bg-secondary-dark: #1c1c1e; /* 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 */
8
8
  } :root {
9
9
  --color-static-overlay-white-xhigh: rgba(255, 255, 255, 0.4); /* 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 */
10
10
  } :root {
@@ -23,7 +23,7 @@
23
23
  } :root {
24
24
  } :root {
25
25
  --focus-color: var(--color-light-border-link);
26
- } .gallery__component_6vdai {
26
+ } .gallery__component_1fk9r {
27
27
  display: flex;
28
28
  padding: var(--gap-2xs);
29
29
  border: 2px solid rgba(0, 0, 0, 0);
@@ -31,11 +31,11 @@
31
31
  overflow: hidden;
32
32
  transition: border 0.15s ease-in-out;
33
33
  outline: none;
34
- } .gallery__active_6vdai {
34
+ } .gallery__active_1fk9r {
35
35
  border-color: var(--color-static-overlay-white-xhigh)
36
- } .gallery__active_6vdai > .gallery__image_6vdai {
36
+ } .gallery__active_1fk9r > .gallery__image_1fk9r {
37
37
  opacity: 0.7;
38
- } .gallery__preview_6vdai {
38
+ } .gallery__preview_1fk9r {
39
39
  width: 56px;
40
40
  height: 56px;
41
41
  flex-shrink: 0;
@@ -43,29 +43,29 @@
43
43
  cursor: pointer;
44
44
  -webkit-user-select: none;
45
45
  user-select: none;
46
- } .gallery__image_6vdai {
46
+ } .gallery__image_1fk9r {
47
47
  background-color: var(--color-light-bg-primary);
48
48
  background-size: cover;
49
49
  background-repeat: no-repeat;
50
50
  background-position: center;
51
51
  transition: opacity 0.15s ease-in-out
52
- } .gallery__image_6vdai:hover {
52
+ } .gallery__image_1fk9r:hover {
53
53
  opacity: 0.7;
54
- } .gallery__loading_6vdai {
54
+ } .gallery__loading_1fk9r {
55
55
  background-color: var(--color-static-bg-secondary-dark)
56
- } .gallery__loading_6vdai .gallery__active_6vdai {
56
+ } .gallery__loading_1fk9r .gallery__active_1fk9r {
57
57
  background-color: var(--color-static-bg-quaternary-dark);
58
- } .gallery__brokenImageWrapper_6vdai {
58
+ } .gallery__brokenImageWrapper_1fk9r {
59
59
  display: flex;
60
60
  justify-content: center;
61
61
  align-items: center;
62
62
  background-color: var(--color-static-bg-quaternary-dark)
63
- } .gallery__brokenImageWrapper_6vdai:hover {
63
+ } .gallery__brokenImageWrapper_1fk9r:hover {
64
64
  opacity: 0.7;
65
- } .gallery__brokenIcon_6vdai {
65
+ } .gallery__brokenIcon_1fk9r {
66
66
  width: 40px;
67
67
  height: 40px;
68
- } .gallery__focused_6vdai {
68
+ } .gallery__focused_1fk9r {
69
69
  outline: 2px solid var(--focus-color);
70
70
  outline-offset: 2px;
71
71
  }
@@ -9,7 +9,7 @@ import { ChevronForwardHeavyMIcon } from '@alfalab/icons-glyph/ChevronForwardHea
9
9
  import { GalleryContext } from '../../context.js';
10
10
  import { getImageAlt, getImageKey } from '../../utils/utils.js';
11
11
  import { TestIds } from '../../utils/constants.js';
12
- import { s as styles, S as Slide } from '../../slide-39ef7ba6.js';
12
+ import { s as styles, S as Slide } from '../../slide-060d55ad.js';
13
13
  import 'swiper/swiper.min.css';
14
14
  import '@alfalab/core-components-typography/modern';
15
15
  import './paths.js';
@@ -23,7 +23,7 @@ const ImageViewer = () => {
23
23
  const [rightArrowFocused] = useFocus(rightArrowRef, 'keyboard');
24
24
  const swiper = getSwiper();
25
25
  const handleSlideChange = useCallback(() => {
26
- setCurrentSlideIndex(swiper?.activeIndex ?? initialSlide);
26
+ setCurrentSlideIndex?.(swiper?.activeIndex ?? initialSlide);
27
27
  }, [setCurrentSlideIndex, swiper, initialSlide]);
28
28
  const handlePrevClick = () => {
29
29
  slidePrev();
@@ -1,14 +1,14 @@
1
- /* hash: ng82a */
1
+ /* hash: 1g54s */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-bg-primary: #fff;
5
- --color-light-border-link: #0072ef;
6
- --color-static-bg-primary-dark: #121212;
7
- --color-static-bg-quaternary-dark: #3a3a3c;
8
- --color-static-bg-secondary-dark: #202022;
5
+ --color-light-border-link: #2288fa;
6
+ --color-static-bg-primary-dark: #0e0e0e;
7
+ --color-static-bg-quaternary-dark: #36363a;
8
+ --color-static-bg-secondary-dark: #1c1c1e;
9
9
  --color-static-graphic-light: #fff; /* 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 */
10
- --color-static-bg-primary-dark-tint-15: rgb(54, 54, 54);
11
- --color-static-bg-primary-dark-tint-20: rgb(65, 65, 65);
10
+ --color-static-bg-primary-dark-tint-15: rgb(50, 50, 50);
11
+ --color-static-bg-primary-dark-tint-20: rgb(62, 62, 62);
12
12
  } :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 */
13
13
  } :root {
14
14
  } :root {
@@ -27,13 +27,13 @@
27
27
  } :root {
28
28
  } :root {
29
29
  --focus-color: var(--color-light-border-link);
30
- } .gallery__component_cp5ui {
30
+ } .gallery__component_tcbv9 {
31
31
  display: flex;
32
32
  flex-grow: 1;
33
33
  justify-content: center;
34
34
  align-items: center;
35
35
  background-color: var(--color-static-bg-primary-dark);
36
- } .gallery__swiper_cp5ui {
36
+ } .gallery__swiper_tcbv9 {
37
37
  display: flex;
38
38
  width: 100%;
39
39
  height: 100%;
@@ -42,42 +42,42 @@
42
42
  max-height: calc(100vh - 168px);
43
43
  padding: var(--gap-2xl) var(--gap-m);
44
44
  box-sizing: border-box;
45
- } .gallery__singleSlide_cp5ui .gallery__swiper_cp5ui {
45
+ } .gallery__singleSlide_tcbv9 .gallery__swiper_tcbv9 {
46
46
  max-height: calc(100vh - 80px);
47
47
  padding: var(--gap-2xl);
48
- } .gallery__hidden_cp5ui {
48
+ } .gallery__hidden_tcbv9 {
49
49
  display: none;
50
- } .gallery__slide_cp5ui {
50
+ } .gallery__slide_tcbv9 {
51
51
  position: relative;
52
52
  display: flex;
53
53
  justify-content: center;
54
54
  align-items: center;
55
55
  width: 100%;
56
56
  height: 100%;
57
- } .gallery__slideLoading_cp5ui {
57
+ } .gallery__slideLoading_tcbv9 {
58
58
  background-color: var(--color-static-bg-secondary-dark);
59
59
  border-radius: var(--border-radius-m);
60
- } .gallery__image_cp5ui {
60
+ } .gallery__image_tcbv9 {
61
61
  width: 0;
62
62
  height: 0;
63
63
  -webkit-user-select: none;
64
64
  user-select: none;
65
65
  background-color: var(--color-light-bg-primary);
66
66
  border-radius: var(--border-radius-m);
67
- } .gallery__smallImage_cp5ui {
67
+ } .gallery__smallImage_tcbv9 {
68
68
  position: relative;
69
69
  width: auto;
70
70
  height: auto;
71
71
  -webkit-user-select: none;
72
72
  user-select: none;
73
73
  background-color: var(--color-light-bg-primary);
74
- } .gallery__verticalImageFit_cp5ui {
74
+ } .gallery__verticalImageFit_tcbv9 {
75
75
  width: auto;
76
76
  height: 100%;
77
- } .gallery__horizontalImageFit_cp5ui {
77
+ } .gallery__horizontalImageFit_tcbv9 {
78
78
  width: 100%;
79
79
  height: auto;
80
- } .gallery__arrow_cp5ui {
80
+ } .gallery__arrow_tcbv9 {
81
81
  display: flex;
82
82
  flex-direction: column;
83
83
  justify-content: center;
@@ -89,14 +89,14 @@
89
89
  color: var(--color-static-graphic-light);
90
90
  transition: background-color 0.15s ease-in-out;
91
91
  outline: none
92
- } .gallery__arrow_cp5ui:hover {
92
+ } .gallery__arrow_tcbv9:hover {
93
93
  background-color: var(--color-static-bg-primary-dark-tint-15);
94
- } .gallery__arrow_cp5ui:active {
94
+ } .gallery__arrow_tcbv9:active {
95
95
  background-color: var(--color-static-bg-primary-dark-tint-20);
96
- } .gallery__focused_cp5ui {
96
+ } .gallery__focused_tcbv9 {
97
97
  outline: 2px solid var(--focus-color);
98
98
  outline-offset: 2px;
99
- } .gallery__placeholder_cp5ui {
99
+ } .gallery__placeholder_tcbv9 {
100
100
  display: flex;
101
101
  justify-content: center;
102
102
  align-items: center;
@@ -104,18 +104,18 @@
104
104
  height: 300px;
105
105
  border-radius: var(--border-radius-m);
106
106
  background-color: var(--color-static-bg-quaternary-dark);
107
- } .gallery__brokenImgWrapper_cp5ui {
107
+ } .gallery__brokenImgWrapper_tcbv9 {
108
108
  position: relative;
109
109
  display: flex;
110
110
  flex-direction: column;
111
111
  align-items: center;
112
112
  width: 150px;
113
113
  text-align: center;
114
- } .gallery__brokenImgIcon_cp5ui {
114
+ } .gallery__brokenImgIcon_tcbv9 {
115
115
  width: 80px;
116
116
  height: 80px;
117
117
  margin-bottom: var(--gap-2xs);
118
- } .gallery__fullScreenImage_cp5ui {
118
+ } .gallery__fullScreenImage_tcbv9 {
119
119
  width: 100%;
120
120
  height: auto;
121
121
  background-color: var(--color-light-bg-primary);
@@ -10,7 +10,7 @@ import '@alfalab/icons-glyph/ChevronForwardHeavyMIcon';
10
10
  import '../../context.js';
11
11
  import '../../utils/utils.js';
12
12
  import '../../utils/constants.js';
13
- import '../../slide-39ef7ba6.js';
13
+ import '../../slide-060d55ad.js';
14
14
  import '@alfalab/core-components-typography/modern';
15
15
  import './paths.js';
16
16
  import 'swiper/swiper.min.css';
@@ -4,4 +4,4 @@ import '@alfalab/core-components-typography/modern';
4
4
  import '../../utils/utils.js';
5
5
  import '../../utils/constants.js';
6
6
  import './paths.js';
7
- export { S as Slide } from '../../slide-39ef7ba6.js';
7
+ export { S as Slide } from '../../slide-060d55ad.js';
@@ -9,7 +9,7 @@ import '../utils/constants.js';
9
9
  import './header-info-block/Component.js';
10
10
  import '@alfalab/core-components-typography/modern';
11
11
  import '../utils/split-filename.js';
12
- import '../buttons-843b823a.js';
12
+ import '../buttons-80612f2b.js';
13
13
  import '@alfalab/core-components-icon-button/modern';
14
14
  import '@alfalab/core-components-tooltip/modern/desktop';
15
15
  import '@alfalab/icons-glyph/ArrowsInwardMIcon';
@@ -24,6 +24,6 @@ import 'swiper';
24
24
  import 'swiper/react';
25
25
  import '@alfalab/icons-glyph/ChevronBackHeavyMIcon';
26
26
  import '@alfalab/icons-glyph/ChevronForwardHeavyMIcon';
27
- import '../slide-39ef7ba6.js';
27
+ import '../slide-060d55ad.js';
28
28
  import './image-viewer/paths.js';
29
29
  import 'swiper/swiper.min.css';
@@ -7,7 +7,7 @@ import 'classnames';
7
7
  import '@alfalab/hooks';
8
8
  import '../image-preview/paths.js';
9
9
 
10
- const styles = {"component":"gallery__component_95ojm","preview":"gallery__preview_95ojm"};
10
+ const styles = {"component":"gallery__component_1amje","preview":"gallery__preview_1amje"};
11
11
  require('./index.css')
12
12
 
13
13
  const MIN_SCROLL_STEP = 24;
@@ -16,7 +16,7 @@ const NavigationBar = () => {
16
16
  const { images, currentSlideIndex, setCurrentSlideIndex, getSwiper } = useContext(GalleryContext);
17
17
  const swiper = getSwiper();
18
18
  const handlePreviewSelect = (index) => {
19
- setCurrentSlideIndex(index);
19
+ setCurrentSlideIndex?.(index);
20
20
  if (swiper) {
21
21
  swiper.slideTo(index);
22
22
  }