Skip to content

Commit 28b1ca7

Browse files
authored
feat(Gallery): add Gallery component (#247)
1 parent 208415f commit 28b1ca7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1402
-5
lines changed

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@
1313
/src/components/StoreBadge @NikitaCG
1414
/src/components/Stories @darkgenius
1515
/src/components/ConfirmDialog @kseniya57
16+
/src/components/Gallery @kseniya57

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"@gravity-ui/prettier-config": "^1.1.0",
7272
"@gravity-ui/stylelint-config": "^4.0.1",
7373
"@gravity-ui/tsconfig": "^1.0.0",
74-
"@gravity-ui/uikit": "^7.0.0",
74+
"@gravity-ui/uikit": "^7.6.0",
7575
"@storybook/addon-a11y": "^8.4.7",
7676
"@storybook/addon-actions": "^8.4.7",
7777
"@storybook/addon-docs": "^8.4.7",

src/components/Gallery/Gallery.scss

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
@use '../variables';
2+
3+
$block: '.#{variables.$ns}gallery';
4+
5+
$horizontalGalleryMargin: 132px;
6+
$verticalGalleryMargin: 28px;
7+
8+
#{$block} {
9+
--g-modal-margin: 0;
10+
11+
&__content {
12+
display: flex;
13+
flex-direction: column;
14+
15+
width: calc(100vw - $horizontalGalleryMargin * 2);
16+
height: calc(100vh - $verticalGalleryMargin * 2);
17+
}
18+
19+
&__header {
20+
display: flex;
21+
align-items: start;
22+
23+
padding: var(--g-spacing-2) var(--g-spacing-3) var(--g-spacing-2) var(--g-spacing-5);
24+
25+
> * {
26+
flex: 1;
27+
min-width: 0;
28+
}
29+
}
30+
31+
&__navigation {
32+
display: flex;
33+
gap: var(--g-spacing-2);
34+
align-items: center;
35+
justify-content: center;
36+
}
37+
38+
&__actions {
39+
display: flex;
40+
gap: var(--g-spacing-1);
41+
align-items: stretch;
42+
justify-content: flex-end;
43+
}
44+
45+
&__active-item-info {
46+
align-self: stretch;
47+
align-items: center;
48+
display: flex;
49+
}
50+
51+
&__body {
52+
position: relative;
53+
54+
display: flex;
55+
align-items: center;
56+
justify-content: center;
57+
58+
flex: 1;
59+
min-height: 0;
60+
61+
padding: 0 var(--g-spacing-2);
62+
}
63+
64+
&__body-navigation-button {
65+
position: absolute;
66+
inset-block: 0 60px;
67+
z-index: 2;
68+
69+
width: 200px;
70+
max-width: 20%;
71+
padding: 0;
72+
margin: 0;
73+
74+
appearance: none;
75+
cursor: pointer;
76+
77+
background-color: transparent;
78+
border: none;
79+
outline: none;
80+
81+
&_direction_start {
82+
inset-inline-start: 0;
83+
84+
cursor:
85+
url('./assets/arrow-left.svg') 2 2,
86+
default;
87+
}
88+
89+
&_direction_end {
90+
inset-inline-end: var(--g-spacing-7);
91+
92+
cursor:
93+
url('./assets/arrow-right.svg') 2 2,
94+
default;
95+
}
96+
}
97+
98+
&__footer {
99+
padding: var(--g-spacing-2) var(--g-spacing-5) var(--g-spacing-4) var(--g-spacing-5);
100+
}
101+
102+
&__preview-list {
103+
display: flex;
104+
gap: var(--g-spacing-2);
105+
align-items: stretch;
106+
overflow: auto hidden;
107+
-ms-overflow-style: none;
108+
scrollbar-width: none;
109+
110+
&::-webkit-scrollbar {
111+
display: none;
112+
}
113+
}
114+
115+
&__preview-list-item {
116+
width: 50px;
117+
min-width: 50px;
118+
height: 50px;
119+
box-sizing: border-box;
120+
border: 1px solid transparent;
121+
border-radius: var(--g-border-radius-l);
122+
padding: 0;
123+
margin: 0;
124+
125+
appearance: none;
126+
cursor: pointer;
127+
128+
background-color: transparent;
129+
outline: none;
130+
overflow: hidden;
131+
132+
&_selected {
133+
border-color: var(--g-color-line-brand);
134+
}
135+
}
136+
137+
&_mode_full-screen {
138+
overflow: hidden;
139+
140+
--g-modal-border-radius: 0;
141+
142+
#{$block} {
143+
&__content {
144+
width: 100vw;
145+
height: 100vh;
146+
}
147+
148+
&__body {
149+
padding: 0;
150+
}
151+
152+
&__header {
153+
position: absolute;
154+
inset-block-start: 0;
155+
inset-inline: 0;
156+
z-index: 3;
157+
158+
opacity: 0;
159+
160+
&:hover {
161+
opacity: 1;
162+
}
163+
}
164+
165+
&__footer {
166+
position: absolute;
167+
inset-inline: 0;
168+
inset-block-end: 0;
169+
z-index: 1;
170+
171+
opacity: 0;
172+
background-color: rgba(0, 0, 0, 0.45);
173+
174+
&:hover {
175+
opacity: 1;
176+
}
177+
}
178+
}
179+
}
180+
}
181+
182+
.g-root_theme_light,
183+
.g-root_theme_light-hc {
184+
#{$block}_mode_full-screen {
185+
#{$block}__header {
186+
background-color: rgba(255, 255, 255, 0.45);
187+
}
188+
}
189+
}
190+
191+
.g-root_theme_dark,
192+
.g-root_theme_dark-hc {
193+
#{$block}_mode_full-screen {
194+
#{$block}__header {
195+
background-color: rgba(0, 0, 0, 0.45);
196+
}
197+
}
198+
}

0 commit comments

Comments
 (0)