itube-specs 0.0.852 → 0.0.854

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.
@@ -2,4 +2,5 @@
2
2
  @forward 'accessibility';
3
3
  @forward 'breakpoints';
4
4
  @forward 'page';
5
+ @forward 'surface';
5
6
  @forward 'video-card';
@@ -0,0 +1,61 @@
1
+ @use 'sass:map';
2
+ @use 'sass:meta';
3
+
4
+ // Контракт подложки ("островка"): блок объявляет цвета для того, что лежит
5
+ // внутри, и всё подхватывает это каскадом.
6
+ //
7
+ // Каждый цвет компонента читается своей переменной — var(--input-bg, <токен темы>).
8
+ // Один уровень, никакой вложенности. Значит любой цвет можно переопределить
9
+ // поштучно, не задевая остальные:
10
+ //
11
+ // .promo-card {
12
+ // --input-s-border: transparent;
13
+ // }
14
+ //
15
+ // Роли ниже — сокращение для частого случая: одна роль расписывается сразу на
16
+ // все переменные, которые ей соответствуют. Тема без островков передаёт null,
17
+ // тогда роль не раскрывается и компоненты остаются на своих базовых токенах.
18
+ //
19
+ // Новый компонент не добавляет ролей — дописывает свои переменные в готовые.
20
+ // Новая роль нужна только когда тема должна развести то, что сейчас склеено.
21
+ $surface-roles: (
22
+ text: (--video-mini-card-title,),
23
+ text-muted: (--video-mini-card-channel, --video-mini-card-duration),
24
+ control-bg: (--input-bg, --select-bg),
25
+ control-compact-bg: (--input-s-bg,),
26
+ control-bg--disabled: (--input-bg--disabled,),
27
+ control-text: (--input-text, --select-text),
28
+ control-text--disabled: (--input-text--disabled,),
29
+ control-placeholder: (--input-placeholder, --select-placeholder),
30
+ control-label: (--input-label, --select-label),
31
+ control-compact-label: (--select-label-secondary,),
32
+ control-border: (--input-border, --select-border),
33
+ control-compact-border: (--input-s-border, --select-border-secondary),
34
+ control-border--focus: (--input-border--focus,),
35
+ control-compact-border--focus: (--input-s-border--focus,),
36
+ control-border--error: (--input-border--error,),
37
+ control-icon: (--input-icon, --input-pre-icon, --input-button-text, --select-icon),
38
+ control-icon--hover: (--input-button-text--hover,),
39
+ option-bg: (--select-option-bg,),
40
+ option-text: (--select-option-text,),
41
+ accent: (--select-count-bg--active,),
42
+ accent-text: (--select-count-text--active,),
43
+ accent-bg-subtle: (--select-bg--active,),
44
+ accent-border: (--select-border--active,)
45
+ );
46
+
47
+ @mixin surface($roles...) {
48
+ @each $role, $value in meta.keywords($roles) {
49
+ $props: map.get($surface-roles, $role);
50
+
51
+ @if not $props {
52
+ @error 'surface(): неизвестная роль `#{$role}`. Допустимые: #{map.keys($surface-roles)}';
53
+ }
54
+
55
+ @if $value {
56
+ @each $prop in $props {
57
+ #{$prop}: #{$value};
58
+ }
59
+ }
60
+ }
61
+ }
@@ -97,7 +97,7 @@ function onPosterError() {
97
97
  @include font-md;
98
98
 
99
99
  max-width: 270px;
100
- color: $video-mini-card-title;
100
+ color: var(--video-mini-card-title, #{$video-mini-card-title});
101
101
 
102
102
  @include from-br(sm) {
103
103
  @include font-sm;
@@ -114,7 +114,7 @@ function onPosterError() {
114
114
  .card-video-mini__channel {
115
115
  @include font-2xs;
116
116
 
117
- color: $video-mini-card-channel;
117
+ color: var(--video-mini-card-channel, #{$video-mini-card-channel});
118
118
 
119
119
  @include from-br(sm) {
120
120
  @include font-xs;
@@ -128,7 +128,7 @@ function onPosterError() {
128
128
  align-items: center;
129
129
  column-gap: 6px;
130
130
  margin-top: 2px;
131
- color: $video-mini-card-duration;
131
+ color: var(--video-mini-card-duration, #{$video-mini-card-duration});
132
132
 
133
133
  @include from-br(sm) {
134
134
  @include font-xs;
@@ -134,6 +134,16 @@ const currentType = computed({
134
134
  .playlist-input__back {
135
135
  grid-column: 2;
136
136
  grid-row: 1;
137
+ position: relative;
138
+ color: $playlist-input-back;
139
+
140
+ &::after {
141
+ @include area-point;
142
+ }
143
+
144
+ @include hover(color) {
145
+ color: $playlist-input-back--hover;
146
+ }
137
147
  }
138
148
 
139
149
  .playlist-input__tooltip {
@@ -160,19 +170,6 @@ const currentType = computed({
160
170
  }
161
171
  }
162
172
 
163
- .playlist-input__back {
164
- position: relative;
165
- color: $playlist-input-back;
166
-
167
- &::after {
168
- @include area-point;
169
- }
170
-
171
- @include hover(color) {
172
- color: $playlist-input-back--hover;
173
- }
174
- }
175
-
176
173
  .playlist-input__tooltip-text:not(:last-child) {
177
174
  margin-bottom: 8px;
178
175
  }
@@ -179,7 +179,7 @@ $icon-size: 16px;
179
179
  }
180
180
 
181
181
  .search-field__search-icon {
182
- color: $input-text;
182
+ color: $search-input-icon;
183
183
  }
184
184
 
185
185
  .search-field__clear {
@@ -201,10 +201,10 @@ const normalizedValue = computed(() => {
201
201
 
202
202
  position: relative;
203
203
  width: 100%;
204
- background-color: $input-bg;
205
- color: $input-text;
204
+ background-color: var(--input-bg, #{$input-bg});
205
+ color: var(--input-text, #{$input-text});
206
206
  border-radius: $radius + 4px;
207
- border: 1px solid $input-border;
207
+ border: 1px solid var(--input-border, #{$input-border});
208
208
  transition: var(--transition) border-color;
209
209
  overflow: hidden;
210
210
 
@@ -220,7 +220,7 @@ const normalizedValue = computed(() => {
220
220
  flex-wrap: nowrap;
221
221
  column-gap: 8px;
222
222
  align-items: center;
223
- color: $input-label;
223
+ color: var(--input-label, #{$input-label});
224
224
  margin-bottom: 8px;
225
225
  }
226
226
 
@@ -232,7 +232,7 @@ const normalizedValue = computed(() => {
232
232
  overflow: hidden;
233
233
  text-overflow: ellipsis;
234
234
  white-space: nowrap;
235
- color: $input-text;;
235
+ color: var(--input-text, #{$input-text});
236
236
  transition: var(--transition) transform;
237
237
  resize: none;
238
238
  font: inherit;
@@ -251,7 +251,7 @@ const normalizedValue = computed(() => {
251
251
  }
252
252
 
253
253
  .ui-input__input::placeholder {
254
- color: $input-placeholder;
254
+ color: var(--input-placeholder, #{$input-placeholder});
255
255
 
256
256
  @include to-br(sm) {
257
257
  @include font-sm;
@@ -259,23 +259,23 @@ const normalizedValue = computed(() => {
259
259
  }
260
260
 
261
261
  .ui-input.ui-input--focused .ui-input__wrapper {
262
- border-color: $input-border--active;
262
+ border-color: var(--input-border--focus, #{$input-border--focus});
263
263
  }
264
264
 
265
265
  .ui-input.ui-input--disabled .ui-input__wrapper {
266
- background-color: transparent;
267
- outline: 1px solid $input-text--disabled;
266
+ background-color: var(--input-bg--disabled, transparent);
267
+ outline: 1px solid var(--input-text--disabled, #{$input-text--disabled});
268
268
  user-select: none;
269
269
  pointer-events: none;
270
270
  }
271
271
 
272
272
  .ui-input.ui-input--disabled .ui-input__wrapper,
273
273
  .ui-input.ui-input--disabled .ui-input__input {
274
- color: $input-text--disabled;
274
+ color: var(--input-text--disabled, #{$input-text--disabled});
275
275
  }
276
276
 
277
277
  .ui-input.ui-input--error .ui-input__wrapper {
278
- border-color: $input-border--error;
278
+ border-color: var(--input-border--error, #{$input-border--error});
279
279
  }
280
280
 
281
281
  .ui-input__button {
@@ -286,7 +286,7 @@ const normalizedValue = computed(() => {
286
286
  padding: 0;
287
287
  background-color: transparent;
288
288
  border: none;
289
- color: $input-button-text;
289
+ color: var(--input-button-text, #{$input-button-text});
290
290
 
291
291
  &::after {
292
292
  @include area-point;
@@ -300,7 +300,7 @@ const normalizedValue = computed(() => {
300
300
  .ui-input__button-icon {
301
301
  width: 20px;
302
302
  height: 20px;
303
- color: $input-icon;
303
+ color: var(--input-icon, #{$input-icon});
304
304
 
305
305
  @include from-br(sm) {
306
306
  transition: var(--transition) color;
@@ -309,7 +309,7 @@ const normalizedValue = computed(() => {
309
309
 
310
310
  .ui-input__button:is(:hover, :focus-visible) .ui-input__button-icon {
311
311
  @include from-br(sm) {
312
- color: $input-button-text--hover;
312
+ color: var(--input-button-text--hover, #{$input-button-text--hover});
313
313
  }
314
314
  }
315
315
 
@@ -333,13 +333,13 @@ const normalizedValue = computed(() => {
333
333
  top: 50%;
334
334
  transform: translateY(-50%);
335
335
  left: 12px;
336
- color: $input-pre-icon;
336
+ color: var(--input-pre-icon, #{$input-pre-icon});
337
337
  }
338
338
 
339
339
  .ui-input.ui-input--s .ui-input__input {
340
340
  padding: 8px 16px;
341
- background-color: $input-s-bg;
342
- border: 1px solid $input-s-border;
341
+ background-color: var(--input-s-bg, #{$input-s-bg});
342
+ border: 1px solid var(--input-s-border, #{$input-s-border});
343
343
 
344
344
  @include from-br(sm) {
345
345
  @include font-sm;
@@ -351,12 +351,12 @@ const normalizedValue = computed(() => {
351
351
  }
352
352
 
353
353
  .ui-input.ui-input--s .ui-input__wrapper {
354
- border-color: transparent;
355
- background-color: $input-s-bg;
354
+ border-color: var(--input-s-border, #{$input-s-border});
355
+ background-color: var(--input-s-bg, #{$input-s-bg});
356
356
  }
357
357
 
358
358
  .ui-input--s.ui-input--focused .ui-input__wrapper {
359
- border-color: $input-s-border--active;
359
+ border-color: var(--input-s-border--focus, #{$input-s-border--focus});
360
360
  }
361
361
 
362
362
  .ui-input.ui-input--icon .ui-input__input {
@@ -123,6 +123,34 @@ const { snackbarText, isSnackBarInPopup } = useSnackbar();
123
123
  </script>
124
124
 
125
125
  <style lang="scss">
126
+ .ui-popup {
127
+ @include surface(
128
+ $text: $surface-overlay-text,
129
+ $text-muted: $surface-overlay-text-muted,
130
+ $control-bg: $surface-overlay-control-bg,
131
+ $control-compact-bg: $surface-overlay-control-compact-bg,
132
+ $control-bg--disabled: $surface-overlay-control-bg--disabled,
133
+ $control-text: $surface-overlay-control-text,
134
+ $control-text--disabled: $surface-overlay-control-text--disabled,
135
+ $control-placeholder: $surface-overlay-control-placeholder,
136
+ $control-label: $surface-overlay-control-label,
137
+ $control-compact-label: $surface-overlay-control-compact-label,
138
+ $control-border: $surface-overlay-control-border,
139
+ $control-compact-border: $surface-overlay-control-compact-border,
140
+ $control-border--focus: $surface-overlay-control-border--focus,
141
+ $control-compact-border--focus: $surface-overlay-control-compact-border--focus,
142
+ $control-border--error: $surface-overlay-control-border--error,
143
+ $control-icon: $surface-overlay-control-icon,
144
+ $control-icon--hover: $surface-overlay-control-icon--hover,
145
+ $option-bg: $surface-overlay-option-bg,
146
+ $option-text: $surface-overlay-option-text,
147
+ $accent: $surface-overlay-accent,
148
+ $accent-text: $surface-overlay-accent-text,
149
+ $accent-bg-subtle: $surface-overlay-accent-bg-subtle,
150
+ $accent-border: $surface-overlay-accent-border
151
+ );
152
+ }
153
+
126
154
  .ui-popup[open] {
127
155
  position: fixed;
128
156
  inset: 0;
@@ -110,8 +110,6 @@ const isChecked = computed(() => properties.modelValue === properties.value);
110
110
 
111
111
  @include from-br(sm) {
112
112
  @include font-sm;
113
-
114
- color: $radio-label--hover;
115
113
  }
116
114
  }
117
115
 
@@ -128,7 +128,7 @@ function capitalize(text: string) {
128
128
  top: 50%;
129
129
  transform: translateY(-50%);
130
130
  pointer-events: none;
131
- color: $select-icon;
131
+ color: var(--select-icon, #{$select-icon});
132
132
  }
133
133
 
134
134
  .ui-select__icon {
@@ -144,14 +144,14 @@ function capitalize(text: string) {
144
144
 
145
145
  border-radius: $radius-xl;
146
146
  padding: 10px 32px 10px 12px;
147
- background: $select-bg;
147
+ background: var(--select-bg, #{$select-bg});
148
148
  outline: none;
149
- border: 1px solid $select-border;
149
+ border: 1px solid var(--select-border, #{$select-border});
150
150
  user-select: none;
151
151
  box-sizing: border-box;
152
152
  appearance: none;
153
153
  font-family: inherit;
154
- color: $select-text;
154
+ color: var(--select-text, #{$select-text});
155
155
  cursor: inherit;
156
156
  margin: 0;
157
157
  width: 100%;
@@ -171,7 +171,7 @@ function capitalize(text: string) {
171
171
 
172
172
  .ui-select__button:invalid,
173
173
  .ui-select__button.--placeholder {
174
- color: $select-placeholder;
174
+ color: var(--select-placeholder, #{$select-placeholder});
175
175
  }
176
176
 
177
177
  .ui-select__button.--icon {
@@ -187,7 +187,7 @@ function capitalize(text: string) {
187
187
  flex-grow: 1;
188
188
  align-items: center;
189
189
  margin-bottom: 8px;
190
- color: $select-label;
190
+ color: var(--select-label, #{$select-label});
191
191
 
192
192
  &::first-letter {
193
193
  text-transform: uppercase;
@@ -200,7 +200,7 @@ function capitalize(text: string) {
200
200
 
201
201
  .ui-select.--s .ui-select__label {
202
202
  margin-bottom: 8px;
203
- color: $select-label-secondary;
203
+ color: var(--select-label-secondary, #{$select-label-secondary});
204
204
  }
205
205
 
206
206
  .ui-select.--wide {
@@ -212,23 +212,23 @@ function capitalize(text: string) {
212
212
  @include font-sm;
213
213
 
214
214
  padding: 8px 32px 8px 12px;
215
- border-color: $select-border-secondary;
215
+ border-color: var(--select-border-secondary, #{$select-border-secondary});
216
216
  border-radius: $radius;
217
217
  }
218
218
  }
219
219
 
220
220
  .ui-select__option {
221
- background: $select-option-bg;
222
- color: $select-option-text;
221
+ background: var(--select-option-bg, #{$select-option-bg});
222
+ color: var(--select-option-text, #{$select-option-text});
223
223
  }
224
224
 
225
225
  .ui-select.--active .ui-select__count {
226
- background-color: $select-count-bg--active;
227
- color: $select-count-text--active;
226
+ background-color: var(--select-count-bg--active, #{$select-count-bg--active});
227
+ color: var(--select-count-text--active, #{$select-count-text--active});
228
228
  }
229
229
 
230
230
  .ui-select.--active .ui-select__button {
231
- background-color: $select-bg--active;
232
- border-color: $select-border--active;
231
+ background-color: var(--select-bg--active, #{$select-bg--active});
232
+ border-color: var(--select-border--active, #{$select-border--active});
233
233
  }
234
234
  </style>
@@ -76,8 +76,8 @@
76
76
  <LazyGridVideos
77
77
  :items="otherItems"
78
78
  :class="{'_loading': statusOther === 'pending'}"
79
+ :hydrate-on-visible="HYDRATE_MARGIN"
79
80
  class="view-model-videos__grid"
80
- hydrate-on-visible
81
81
  />
82
82
  <UiLink
83
83
  v-if="dataOther && dataOther?.total > 12"
@@ -120,6 +120,9 @@ import { computed } from 'vue';
120
120
 
121
121
  const featureFlags = useRuntimeConfig().public.featureFlags;
122
122
 
123
+ /** Запас гидрации грида: без него тап по карточке у нижнего края экрана уходит по негидрированной разметке. */
124
+ const HYDRATE_MARGIN = { rootMargin: '300px' };
125
+
123
126
  const props = defineProps<{
124
127
  title: string
125
128
  data: PaginatedResponse<IVideoCard> | null
@@ -61,7 +61,7 @@
61
61
  :hide-first-row="page !== 'playlist'"
62
62
  :items="related"
63
63
  :top-chips="topChipsStrings"
64
- hydrate-on-visible
64
+ :hydrate-on-visible="HYDRATE_MARGIN"
65
65
  >
66
66
  <template #grid-start>
67
67
  <LazyAdvNativePlayer
@@ -120,6 +120,9 @@ import type { AsyncDataRequestStatus } from '#app';
120
120
 
121
121
  const featureFlags = useRuntimeConfig().public.featureFlags;
122
122
 
123
+ /** Запас гидрации релейтед-грида: без него тап по карточке у нижнего края экрана уходит по негидрированной разметке. */
124
+ const HYDRATE_MARGIN = { rootMargin: '300px' };
125
+
123
126
  const props = defineProps<{
124
127
  related?: Array<IVideoCard> | undefined,
125
128
  status: AsyncDataRequestStatus
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "itube-specs",
3
3
  "type": "module",
4
- "version": "0.0.852",
4
+ "version": "0.0.854",
5
5
  "main": "./nuxt.config.ts",
6
6
  "types": "./types/index.d.ts",
7
7
  "scripts": {