@cloud-ru/ds-list 2.0.1 → 2.0.2

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 (61) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +1 -1
  3. package/dist/cjs/components/Items/BaseItem/BaseItem.js +1 -1
  4. package/dist/cjs/components/Items/BaseItem/styles.module.css +42 -0
  5. package/dist/cjs/components/Items/SearchItem/SearchItem.js +1 -1
  6. package/dist/cjs/components/Items/SimpleItem/utils.d.ts +1 -1
  7. package/dist/cjs/components/Items/SimpleItem/utils.js +1 -1
  8. package/dist/cjs/components/Items/styles.module.css +9 -0
  9. package/dist/cjs/components/Items/types.d.ts +2 -2
  10. package/dist/cjs/components/Items/utils.js +1 -1
  11. package/dist/cjs/components/Lists/ListPrivate/ListPrivate.js +1 -1
  12. package/dist/cjs/components/Lists/ListPrivate/styles.module.css +2 -3
  13. package/dist/cjs/components/Lists/hooks.d.ts +1 -1
  14. package/dist/cjs/components/Lists/hooks.js +2 -2
  15. package/dist/cjs/helperComponents/DesktopDroplist/DesktopDroplist.js +1 -1
  16. package/dist/cjs/helperComponents/ItemContent/ItemContent.js +1 -1
  17. package/dist/cjs/helperComponents/ItemContent/styles.module.css +45 -24
  18. package/dist/cjs/helperComponents/Separator/Separator.js +3 -4
  19. package/dist/cjs/helperComponents/Separator/styles.module.css +69 -49
  20. package/dist/cjs/style.css +167 -76
  21. package/dist/esm/components/Items/BaseItem/BaseItem.js +1 -1
  22. package/dist/esm/components/Items/BaseItem/styles.module.css +42 -0
  23. package/dist/esm/components/Items/SearchItem/SearchItem.js +1 -1
  24. package/dist/esm/components/Items/SimpleItem/utils.d.ts +1 -1
  25. package/dist/esm/components/Items/SimpleItem/utils.js +1 -1
  26. package/dist/esm/components/Items/styles.module.css +9 -0
  27. package/dist/esm/components/Items/types.d.ts +2 -2
  28. package/dist/esm/components/Items/utils.js +1 -1
  29. package/dist/esm/components/Lists/ListPrivate/ListPrivate.js +1 -1
  30. package/dist/esm/components/Lists/ListPrivate/styles.module.css +2 -3
  31. package/dist/esm/components/Lists/hooks.d.ts +1 -1
  32. package/dist/esm/components/Lists/hooks.js +2 -2
  33. package/dist/esm/helperComponents/DesktopDroplist/DesktopDroplist.js +1 -1
  34. package/dist/esm/helperComponents/ItemContent/ItemContent.js +1 -1
  35. package/dist/esm/helperComponents/ItemContent/styles.module.css +45 -24
  36. package/dist/esm/helperComponents/Separator/Separator.js +3 -4
  37. package/dist/esm/helperComponents/Separator/styles.module.css +69 -49
  38. package/dist/esm/style.css +167 -76
  39. package/dist/tsconfig.cjs.tsbuildinfo +1 -1
  40. package/dist/tsconfig.esm.tsbuildinfo +1 -1
  41. package/package.json +10 -10
  42. package/src/components/Items/BaseItem/BaseItem.tsx +17 -10
  43. package/src/components/Items/BaseItem/styles.module.scss +57 -4
  44. package/src/components/Items/SearchItem/SearchItem.tsx +1 -1
  45. package/src/components/Items/SimpleItem/utils.ts +1 -1
  46. package/src/components/Items/styles.module.scss +10 -2
  47. package/src/components/Items/types.ts +3 -7
  48. package/src/components/Items/utils.ts +1 -1
  49. package/src/components/Lists/ListPrivate/ListPrivate.tsx +1 -1
  50. package/src/components/Lists/ListPrivate/styles.module.scss +5 -4
  51. package/src/components/Lists/hooks.ts +2 -2
  52. package/src/helperComponents/DesktopDroplist/DesktopDroplist.tsx +1 -1
  53. package/src/helperComponents/ItemContent/ItemContent.tsx +22 -20
  54. package/src/helperComponents/ItemContent/styles.module.scss +25 -15
  55. package/src/helperComponents/Separator/Separator.tsx +23 -22
  56. package/src/helperComponents/Separator/styles.module.scss +132 -101
  57. package/dist/cjs/helperComponents/Separator/constants.d.ts +0 -3
  58. package/dist/cjs/helperComponents/Separator/constants.js +0 -10
  59. package/dist/esm/helperComponents/Separator/constants.d.ts +0 -3
  60. package/dist/esm/helperComponents/Separator/constants.js +0 -7
  61. package/src/helperComponents/Separator/constants.ts +0 -11
@@ -4,7 +4,8 @@
4
4
 
5
5
  $sizes: 's', 'm', 'l';
6
6
 
7
- // Typography map (legacy separator primary = sans-label/title, secondary = light-label/title)
7
+ // Оба варианта группы (`subtitle` / `subtitleTertiary`) в мастере используют один и тот же
8
+ // текстовый стиль и различаются только цветом — см. `.label[data-group-variant]`.
8
9
  $subtitle-typography-map: (
9
10
  's': (
10
11
  'weight': 'regular',
@@ -23,38 +24,18 @@ $subtitle-typography-map: (
23
24
  ),
24
25
  );
25
26
 
26
- // 'light' weight в base-styles отсутствует — используем 'regular', subtitleTertiary
27
- // отличаем цветом (см. .label[data-group-variant='subtitleTertiary']).
28
- $subtitle-tertiary-typography-map: (
29
- 's': (
30
- 'weight': 'regular',
31
- 'role': 'label',
32
- 'size': 'm',
33
- ),
34
- 'm': (
35
- 'weight': 'regular',
36
- 'role': 'label',
37
- 'size': 'l',
38
- ),
39
- 'l': (
40
- 'weight': 'regular',
41
- 'role': 'title',
42
- 'size': 'm',
43
- ),
44
- );
45
-
46
27
  $level: var(--level, 0);
47
28
 
48
29
  // Composites dropList item.<size>.container-separator(-subheader) в токен-наборе отсутствуют —
49
30
  // приближаем через list anatomy.size.<size>.listItem.padding-*.
50
- // Figma listItemGroup: root flex, align-items: flex-start, gap=listItem.gap,
31
+ // Figma listItemGroup: root flex, align-items: center, gap=listItem.gap,
51
32
  // padding-top=subtitle.paddingTop, padding-bottom=listItem.paddingVertical,
52
33
  // padding-horizontal=listItem.paddingHorizontal. Иконка и label — на одной линии по центру (textWrapper).
53
34
 
54
35
  // Figma centeredWrapper (list.listItem.centeredWrapper): padding-vertical вокруг иконки.
55
36
  // Размер иконочного слота — общий с listItem (см. icons.$iconSizeMap).
56
37
  // Используем content-box, чтобы padding не зажимал SVG.
57
- .beforeContent {
38
+ .centeredWrapper {
58
39
  display: inline-flex;
59
40
  flex-grow: 0;
60
41
  flex-shrink: 0;
@@ -93,7 +74,6 @@ $level: var(--level, 0);
93
74
  @each $size in $sizes {
94
75
  &[data-size='#{$size}'] {
95
76
  $subtitle: base.simple-var($subtitle-typography-map, $size);
96
- $subtitleTertiary: base.simple-var($subtitle-tertiary-typography-map, $size);
97
77
  $itemPaddingLeft: base.simple-var(list.$list, 'anatomy', 'size', $size, 'listItem', 'padding-left');
98
78
  $itemGap: base.simple-var(list.$list, 'anatomy', 'size', $size, 'listItem', 'gap');
99
79
 
@@ -112,7 +92,7 @@ $level: var(--level, 0);
112
92
  );
113
93
  }
114
94
 
115
- .beforeContent {
95
+ .centeredWrapper {
116
96
  width: base.simple-var(icons.$iconSizeMap, $size);
117
97
  height: base.simple-var(icons.$iconSizeMap, $size);
118
98
  padding-top: base.simple-var(
@@ -135,69 +115,101 @@ $level: var(--level, 0);
135
115
  );
136
116
  }
137
117
 
138
- .label {
139
- padding: base.simple-var(
140
- list.$list,
141
- 'anatomy',
142
- 'size',
143
- $size,
144
- 'listItem',
145
- 'contentWrapper',
146
- 'textWrapper',
147
- 'padding-top'
148
- )
149
- base.simple-var(
150
- list.$list,
151
- 'anatomy',
152
- 'size',
153
- $size,
154
- 'listItem',
155
- 'contentWrapper',
156
- 'textWrapper',
157
- 'textContent',
158
- 'padding-right'
159
- )
160
- base.simple-var(
161
- list.$list,
162
- 'anatomy',
163
- 'size',
164
- $size,
165
- 'listItem',
166
- 'contentWrapper',
167
- 'textWrapper',
168
- 'padding-bottom'
169
- )
170
- base.simple-var(
171
- list.$list,
172
- 'anatomy',
173
- 'size',
174
- $size,
175
- 'listItem',
176
- 'contentWrapper',
177
- 'textWrapper',
178
- 'textContent',
179
- 'padding-left'
180
- );
181
-
182
- &[data-group-variant='subtitle'] {
183
- @include base.composite-var(
184
- base.$base-styles,
185
- 'sn',
186
- base.simple-var($subtitle, 'weight'),
187
- base.simple-var($subtitle, 'role'),
188
- base.simple-var($subtitle, 'size')
189
- );
190
- }
191
-
192
- &[data-group-variant='subtitleTertiary'] {
193
- @include base.composite-var(
194
- base.$base-styles,
195
- 'sn',
196
- base.simple-var($subtitleTertiary, 'weight'),
197
- base.simple-var($subtitleTertiary, 'role'),
198
- base.simple-var($subtitleTertiary, 'size')
199
- );
200
- }
118
+ // Раскладка повторяет мастер listItemGroup: root → contentWrapper → textWrapper →
119
+ // textContent → headline. Вертикальные поля несёт textWrapper, горизонтальные — textContent.
120
+ .textWrapper {
121
+ gap: $itemGap;
122
+ padding-top: base.simple-var(
123
+ list.$list,
124
+ 'anatomy',
125
+ 'size',
126
+ $size,
127
+ 'listItem',
128
+ 'contentWrapper',
129
+ 'textWrapper',
130
+ 'padding-top'
131
+ );
132
+ padding-bottom: base.simple-var(
133
+ list.$list,
134
+ 'anatomy',
135
+ 'size',
136
+ $size,
137
+ 'listItem',
138
+ 'contentWrapper',
139
+ 'textWrapper',
140
+ 'padding-bottom'
141
+ );
142
+ }
143
+
144
+ .textContent {
145
+ gap: base.simple-var(
146
+ list.$list,
147
+ 'anatomy',
148
+ 'size',
149
+ $size,
150
+ 'listItem',
151
+ 'contentWrapper',
152
+ 'textWrapper',
153
+ 'textContent',
154
+ 'gap'
155
+ );
156
+ padding-right: base.simple-var(
157
+ list.$list,
158
+ 'anatomy',
159
+ 'size',
160
+ $size,
161
+ 'listItem',
162
+ 'contentWrapper',
163
+ 'textWrapper',
164
+ 'textContent',
165
+ 'padding-right'
166
+ );
167
+ padding-left: base.simple-var(
168
+ list.$list,
169
+ 'anatomy',
170
+ 'size',
171
+ $size,
172
+ 'listItem',
173
+ 'contentWrapper',
174
+ 'textWrapper',
175
+ 'textContent',
176
+ 'padding-left'
177
+ );
178
+ }
179
+
180
+ .headline {
181
+ @include base.composite-var(
182
+ base.$base-styles,
183
+ 'sn',
184
+ base.simple-var($subtitle, 'weight'),
185
+ base.simple-var($subtitle, 'role'),
186
+ base.simple-var($subtitle, 'size')
187
+ );
188
+
189
+ gap: base.simple-var(
190
+ list.$list,
191
+ 'anatomy',
192
+ 'size',
193
+ $size,
194
+ 'listItem',
195
+ 'contentWrapper',
196
+ 'textWrapper',
197
+ 'textContent',
198
+ 'headline',
199
+ 'gap'
200
+ );
201
+ min-height: base.simple-var(
202
+ list.$list,
203
+ 'anatomy',
204
+ 'size',
205
+ $size,
206
+ 'listItem',
207
+ 'contentWrapper',
208
+ 'textWrapper',
209
+ 'textContent',
210
+ 'headline',
211
+ 'min-height'
212
+ );
201
213
  }
202
214
  }
203
215
  }
@@ -220,9 +232,30 @@ $level: var(--level, 0);
220
232
  }
221
233
  }
222
234
 
223
- .label {
235
+ .contentWrapper {
236
+ display: flex;
237
+ flex: 1 1 auto;
238
+ align-items: center;
239
+ min-width: 0;
240
+ }
241
+
242
+ .textWrapper {
243
+ display: flex;
244
+ flex: 1 1 auto;
245
+ align-items: center;
246
+ min-width: 0;
247
+ }
248
+
249
+ .textContent {
250
+ display: flex;
251
+ flex-direction: column;
252
+ min-width: 0;
253
+ }
254
+
255
+ .headline {
224
256
  overflow: hidden;
225
- flex-shrink: 1;
257
+ display: flex;
258
+ align-items: center;
226
259
 
227
260
  &[data-group-variant='subtitle'] {
228
261
  color: base.$sn-theme-color-available-version-textMain;
@@ -234,22 +267,20 @@ $level: var(--level, 0);
234
267
  }
235
268
 
236
269
  .divider {
237
- flex: 1;
238
- width: auto;
239
- min-width: 0;
240
- }
241
-
242
- .labelEnd {
243
- display: flex;
244
- flex: 1 0 0;
245
- flex-direction: column;
246
- align-items: flex-end;
247
- justify-content: center;
270
+ position: absolute;
271
+ right: 0;
272
+ bottom: 0;
273
+ left: 0;
248
274
 
275
+ width: auto;
249
276
  min-width: 0;
250
277
  }
251
278
 
252
279
  .selectButton {
253
280
  display: flex;
281
+ flex-shrink: 0;
254
282
  justify-content: flex-end;
283
+
284
+ // Кнопка выравнивается по правому краю строки заголовка.
285
+ margin-left: auto;
255
286
  }
@@ -1,3 +0,0 @@
1
- import { ButtonProps } from '@cloud-ru/ds-button';
2
- import { Size } from '../../types';
3
- export declare const SELECT_BUTTON_SIZE_MAP: Record<Size, ButtonProps['size']>;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SELECT_BUTTON_SIZE_MAP = void 0;
4
- // @cloud-ru/ds-button пока без выделенного ButtonFunction и размера `xs` (Phase 5 cross-package blocker):
5
- // маппим размеры списка на ближайшие доступные `Button` size.
6
- exports.SELECT_BUTTON_SIZE_MAP = {
7
- s: 's',
8
- m: 's',
9
- l: 'm',
10
- };
@@ -1,3 +0,0 @@
1
- import { ButtonProps } from '@cloud-ru/ds-button';
2
- import { Size } from '../../types.js';
3
- export declare const SELECT_BUTTON_SIZE_MAP: Record<Size, ButtonProps['size']>;
@@ -1,7 +0,0 @@
1
- // @cloud-ru/ds-button пока без выделенного ButtonFunction и размера `xs` (Phase 5 cross-package blocker):
2
- // маппим размеры списка на ближайшие доступные `Button` size.
3
- export const SELECT_BUTTON_SIZE_MAP = {
4
- s: 's',
5
- m: 's',
6
- l: 'm',
7
- };
@@ -1,11 +0,0 @@
1
- import { ButtonProps } from '@cloud-ru/ds-button';
2
-
3
- import { Size } from '../../types';
4
-
5
- // @cloud-ru/ds-button пока без выделенного ButtonFunction и размера `xs` (Phase 5 cross-package blocker):
6
- // маппим размеры списка на ближайшие доступные `Button` size.
7
- export const SELECT_BUTTON_SIZE_MAP: Record<Size, ButtonProps['size']> = {
8
- s: 's',
9
- m: 's',
10
- l: 'm',
11
- };