@cloud-ru/ds-list 3.1.5-preview-f18129b6.0 → 3.1.5

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,10 @@
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
+ ## 3.1.5 (2026-11-18)
7
+
8
+ **Note:** Version bump only for package @ds/list
9
+
6
10
  ## 3.1.4 (2026-11-17)
7
11
 
8
12
  **Note:** Version bump only for package @ds/list
package/README.md CHANGED
@@ -683,10 +683,13 @@ List в popover. Оборачивает триггер (кнопку / поле)
683
683
 
684
684
  ### Анатомия
685
685
 
686
- #### Размер строк
686
+ #### Size (default `s`)
687
+
688
+ Размер задаёт высоту строки списка (Figma `listItem`): `s` = 40px, `m` = 52px, `l` = 66px. Совпадает с `size` у **List**.
687
689
 
688
- `size` задаёт размер строк: `s`, `m` или `l`. Фактическая высота зависит от платформы и плотности темы.
689
- Дефолты по раскладкам и их переопределение описаны в разделе [Адаптивность](#adaptive).
690
+ - `s` — дефолт. Компактные селекторы у кнопок toolbar/header.
691
+ - `m` — списки объектов с описанием.
692
+ - `l` — крупные меню, mobile.
690
693
 
691
694
  #### Selection mode (default off)
692
695
 
@@ -963,7 +966,6 @@ export function DroplistWithHeader() {
963
966
  | `itemRender` | `((props: ItemRenderProps) => ReactNode)` | — | Рендер-функция оболочки строки вместо дефолтной разметки `BaseItem`. <br/> Не задана — строка рисуется как раньше. `itemWrapRender` по-прежнему оборачивает результат. |
964
967
  | `items` | `BaseItemWithoutNonGroup` \| `CommonGroupItem` \| `Item` \| `ScrollProps` | — | Основные элементы списка |
965
968
  | `label` | `string` | — | Только mobile (`BottomSheet`): заголовок шапки. |
966
- | `layoutPresets` | `DroplistLayoutDefaults` \| `LayoutPresets` | — | Переопределение размера списка по раскладке. На mobile по умолчанию `l`. |
967
969
  | `limitedScrollHeight` | `boolean` | — | Ограничить максимальную высоту скролл-контейнера в зависимости от `size` |
968
970
  | `listRef` | `RefObject<HTMLElement>` | — | Ссылка на элемент выпадающего списка |
969
971
  | `loading` | `boolean` | — | Флаг, отвечающий за состояние загрузки списка |
@@ -1041,12 +1043,6 @@ export function DroplistWithHeader() {
1041
1043
  | `label` | `string \| undefined` | — | Заголовок группы |
1042
1044
  | `truncate` | `{ variant?: TruncateStringProps["variant"]; } \| undefined` | — | Настройки усечения длинного заголовка группы |
1043
1045
 
1044
- **DroplistLayoutDefaults**
1045
-
1046
- | Prop | Type | Default | Description |
1047
- |------|------|---------|-------------|
1048
- | `size` | `"l"` \| `"m"` \| `"s"` | — | Размер списка |
1049
-
1050
1046
  **EmptyStateProps**
1051
1047
 
1052
1048
  | Prop | Type | Default | Description |
@@ -1073,6 +1069,8 @@ export function DroplistWithHeader() {
1073
1069
 
1074
1070
  - `ItemId` = `string | number`
1075
1071
 
1072
+ - `OnChangeHandler` = `(value: T) => void`
1073
+
1076
1074
  **ScrollProps**
1077
1075
 
1078
1076
  | Prop | Type | Default | Description |
@@ -1156,25 +1154,6 @@ export function DroplistWithHeader() {
1156
1154
 
1157
1155
  Верстайте под desktop и поставьте один `<AdaptiveProvider>` в корне приложения — mobile-поверхность включается автоматически (desktop-first). Пропа `layoutType` у компонента нет: источник раскладки — только контекст.
1158
1156
 
1159
- #### Размер по раскладке
1160
-
1161
- | Проп | desktop | mobile |
1162
- |------|---------|--------|
1163
- | `size` | `m` по умолчанию; можно задать обычным пропом | `l` по умолчанию; переопределяется через `layoutPresets.mobile.size` |
1164
-
1165
- Приоритет: `layoutPresets` для текущей раскладки → пресет компонента → обычный проп → базовый дефолт.
1166
- Поэтому `size='s'` задаёт размер S на desktop, а на mobile сохраняется L.
1167
-
1168
- ```tsx
1169
- // S на desktop, L на mobile
1170
- <Droplist size='s' items={items}>{trigger}</Droplist>
1171
-
1172
- // S на обеих раскладках
1173
- <Droplist size='s' layoutPresets={{ mobile: { size: 's' } }} items={items}>
1174
- {trigger}
1175
- </Droplist>
1176
- ```
1177
-
1178
1157
  #### Как форсировать платформу
1179
1158
 
1180
1159
  Форс — только контекстом, не пропом:
@@ -1204,8 +1183,7 @@ export function DroplistWithHeader() {
1204
1183
  | `trigger`, `placement`, `widthStrategy`, `triggerElemRef`, `listRef`, `triggerClassName` | используется | игнорируется |
1205
1184
  | `label`, `actionButton`, `slotAfterTitle`, `onBackButtonClick` | игнорируется | используется |
1206
1185
  | `items`, `selection`, `collapse`, `search`, `footer`, `headerDivider`, `footerDivider` | используется | используется |
1207
- | `open`, `onOpenChange`, `closeOnPopstate` | используется | используется |
1208
- | `size`, `layoutPresets` | размер определяется с учётом пресетов | размер определяется с учётом пресетов |
1186
+ | `open`, `onOpenChange`, `closeOnPopstate`, `size` | используется | используется |
1209
1187
 
1210
1188
  #### Mobile — BottomSheet
1211
1189
 
@@ -1,7 +1,7 @@
1
1
  import { DroplistProps, ReorderableDroplistProps } from '../types';
2
2
  /**
3
3
  * Адаптивный `Droplist`: раскладку берёт из `AdaptiveProvider` (контекст). На `mobile` рендерит
4
- * список (по умолчанию размера `l`) в `BottomSheet` (`MobileDroplist`), иначе — анкорный popover (`DesktopDroplist`).
4
+ * список (size `m`) в `BottomSheet` (`MobileDroplist`), иначе — анкорный popover (`DesktopDroplist`).
5
5
  * Слоты `label` / `actionButton` / `slotAfterTitle` / `onBackButtonClick` применяются только на mobile.
6
6
  * Чтобы всегда был popover — `withLayoutType(Droplist, 'desktop')` либо вложенный
7
7
  * `<AdaptiveProvider layoutType='desktop'>`. Пропа `layoutType` у компонента нет.
@@ -6,19 +6,17 @@ const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  const adaptive_1 = require("@cloud-ru/ds-adaptive");
7
7
  const DesktopDroplist_1 = require("../../../helperComponents/DesktopDroplist");
8
8
  const MobileDroplist_1 = require("../../../helperComponents/MobileDroplist");
9
- const DROPLIST_LAYOUT_PRESETS = { mobile: { size: 'l' } };
10
9
  /** @internal Общая реализация `Droplist`/`ReorderableDroplist`: свап поверхности по раскладке. */
11
- function DroplistImpl({ children, size, layoutPresets, label, actionButton, slotAfterTitle, onBackButtonClick, ...rest }) {
10
+ function DroplistImpl({ children, size = 'm', label, actionButton, slotAfterTitle, onBackButtonClick, ...rest }) {
12
11
  const { layoutType } = (0, adaptive_1.useAdaptiveLayout)();
13
- const { size: resolvedSize } = (0, adaptive_1.useLayoutDefaults)({ size: 'm' }, (0, adaptive_1.mergePresets)(DROPLIST_LAYOUT_PRESETS, layoutPresets), { size });
14
12
  if ((0, adaptive_1.isMobileLayout)(layoutType)) {
15
- return ((0, jsx_runtime_1.jsx)(MobileDroplist_1.MobileDroplist, { ...rest, size: resolvedSize, label: label, actionButton: actionButton, slotAfterTitle: slotAfterTitle, onBackButtonClick: onBackButtonClick, children: children }));
13
+ return ((0, jsx_runtime_1.jsx)(MobileDroplist_1.MobileDroplist, { ...rest, size: 'm', label: label, actionButton: actionButton, slotAfterTitle: slotAfterTitle, onBackButtonClick: onBackButtonClick, children: children }));
16
14
  }
17
- return ((0, jsx_runtime_1.jsx)(DesktopDroplist_1.DesktopDroplist, { ...rest, size: resolvedSize, children: children }));
15
+ return ((0, jsx_runtime_1.jsx)(DesktopDroplist_1.DesktopDroplist, { ...rest, size: size, children: children }));
18
16
  }
19
17
  /**
20
18
  * Адаптивный `Droplist`: раскладку берёт из `AdaptiveProvider` (контекст). На `mobile` рендерит
21
- * список (по умолчанию размера `l`) в `BottomSheet` (`MobileDroplist`), иначе — анкорный popover (`DesktopDroplist`).
19
+ * список (size `m`) в `BottomSheet` (`MobileDroplist`), иначе — анкорный popover (`DesktopDroplist`).
22
20
  * Слоты `label` / `actionButton` / `slotAfterTitle` / `onBackButtonClick` применяются только на mobile.
23
21
  * Чтобы всегда был popover — `withLayoutType(Droplist, 'desktop')` либо вложенный
24
22
  * `<AdaptiveProvider layoutType='desktop'>`. Пропа `layoutType` у компонента нет.
@@ -1,5 +1,4 @@
1
1
  import { DragEndEvent } from '@dnd-kit/core';
2
- import { LayoutPresets } from '@cloud-ru/ds-adaptive';
3
2
  import { BottomSheetProps } from '@cloud-ru/ds-bottom-sheet';
4
3
  import { DropdownProps } from '@cloud-ru/ds-dropdown';
5
4
  import { WithSupportProps } from '@cloud-ru/ds-utils';
@@ -146,11 +145,6 @@ export type ReorderableBaseDroplistProps = DroplistOwnProps & DroplistListProps<
146
145
  * модели айтемов. Публичные `DroplistProps`/`ReorderableDroplistProps` плоские, см. `ListImplProps`.
147
146
  */
148
147
  export type DesktopDroplistProps = DroplistOwnProps & DroplistListProps<ListImplProps>;
149
- export type DroplistLayoutDefaults = Pick<ListProps, 'size'>;
150
- type DroplistAdaptiveProps = {
151
- /** Переопределение размера списка по раскладке. На mobile по умолчанию `l`. */
152
- layoutPresets?: LayoutPresets<DroplistLayoutDefaults>;
153
- };
154
148
  /** Только mobile (`BottomSheet`)-слоты адаптивного `Droplist`. */
155
149
  type DroplistMobileSlots = {
156
150
  /** Только mobile (`BottomSheet`): заголовок шапки. */
@@ -165,17 +159,17 @@ type DroplistMobileSlots = {
165
159
  /**
166
160
  * Props адаптивного `Droplist` (дефолтный droplist): базовые props + mobile-слоты `BottomSheet`.
167
161
  * Раскладку берёт из `AdaptiveProvider` (контекст): на `mobile` рендерит `MobileDroplist`
168
- * (список размера `l` по умолчанию в `BottomSheet`), иначе — `DesktopDroplist` (анкорный popover). Mobile-слоты
162
+ * (список size `m` в `BottomSheet`), иначе — `DesktopDroplist` (анкорный popover). Mobile-слоты
169
163
  * применяются только на mobile.
170
164
  */
171
- export type DroplistProps = BaseDroplistProps & DroplistAdaptiveProps & DroplistMobileSlots & Pick<BottomSheetProps, 'snapPoints' | 'withDividers'>;
165
+ export type DroplistProps = BaseDroplistProps & DroplistMobileSlots & Pick<BottomSheetProps, 'snapPoints' | 'withDividers'>;
172
166
  /**
173
167
  * Props адаптивного `ReorderableDroplist`: props `ReorderableList` + popover/mobile-обвязка
174
168
  * `Droplist`. Отдельный компонент по той же причине, что и `ReorderableList`.
175
169
  */
176
- export type ReorderableDroplistProps = ReorderableBaseDroplistProps & DroplistMobileSlots & DroplistAdaptiveProps;
170
+ export type ReorderableDroplistProps = ReorderableBaseDroplistProps & DroplistMobileSlots;
177
171
  /** @internal Props общей реализации адаптивного дроплиста: реализация + mobile-слоты. */
178
- export type DroplistImplProps = DesktopDroplistProps & DroplistMobileSlots & DroplistAdaptiveProps;
172
+ export type DroplistImplProps = DesktopDroplistProps & DroplistMobileSlots;
179
173
  /**
180
174
  * @internal Props mobile-реализации (`BottomSheet`): реализация дроплиста без popover-пропов
181
175
  * + mobile-слоты.
@@ -1,7 +1,7 @@
1
1
  import { DroplistProps, ReorderableDroplistProps } from '../types.js';
2
2
  /**
3
3
  * Адаптивный `Droplist`: раскладку берёт из `AdaptiveProvider` (контекст). На `mobile` рендерит
4
- * список (по умолчанию размера `l`) в `BottomSheet` (`MobileDroplist`), иначе — анкорный popover (`DesktopDroplist`).
4
+ * список (size `m`) в `BottomSheet` (`MobileDroplist`), иначе — анкорный popover (`DesktopDroplist`).
5
5
  * Слоты `label` / `actionButton` / `slotAfterTitle` / `onBackButtonClick` применяются только на mobile.
6
6
  * Чтобы всегда был popover — `withLayoutType(Droplist, 'desktop')` либо вложенный
7
7
  * `<AdaptiveProvider layoutType='desktop'>`. Пропа `layoutType` у компонента нет.
@@ -1,20 +1,18 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { isMobileLayout, mergePresets, useAdaptiveLayout, useLayoutDefaults } from '@cloud-ru/ds-adaptive';
2
+ import { isMobileLayout, useAdaptiveLayout } from '@cloud-ru/ds-adaptive';
3
3
  import { DesktopDroplist } from '../../../helperComponents/DesktopDroplist/index.js';
4
4
  import { MobileDroplist } from '../../../helperComponents/MobileDroplist/index.js';
5
- const DROPLIST_LAYOUT_PRESETS = { mobile: { size: 'l' } };
6
5
  /** @internal Общая реализация `Droplist`/`ReorderableDroplist`: свап поверхности по раскладке. */
7
- function DroplistImpl({ children, size, layoutPresets, label, actionButton, slotAfterTitle, onBackButtonClick, ...rest }) {
6
+ function DroplistImpl({ children, size = 'm', label, actionButton, slotAfterTitle, onBackButtonClick, ...rest }) {
8
7
  const { layoutType } = useAdaptiveLayout();
9
- const { size: resolvedSize } = useLayoutDefaults({ size: 'm' }, mergePresets(DROPLIST_LAYOUT_PRESETS, layoutPresets), { size });
10
8
  if (isMobileLayout(layoutType)) {
11
- return (_jsx(MobileDroplist, { ...rest, size: resolvedSize, label: label, actionButton: actionButton, slotAfterTitle: slotAfterTitle, onBackButtonClick: onBackButtonClick, children: children }));
9
+ return (_jsx(MobileDroplist, { ...rest, size: 'm', label: label, actionButton: actionButton, slotAfterTitle: slotAfterTitle, onBackButtonClick: onBackButtonClick, children: children }));
12
10
  }
13
- return (_jsx(DesktopDroplist, { ...rest, size: resolvedSize, children: children }));
11
+ return (_jsx(DesktopDroplist, { ...rest, size: size, children: children }));
14
12
  }
15
13
  /**
16
14
  * Адаптивный `Droplist`: раскладку берёт из `AdaptiveProvider` (контекст). На `mobile` рендерит
17
- * список (по умолчанию размера `l`) в `BottomSheet` (`MobileDroplist`), иначе — анкорный popover (`DesktopDroplist`).
15
+ * список (size `m`) в `BottomSheet` (`MobileDroplist`), иначе — анкорный popover (`DesktopDroplist`).
18
16
  * Слоты `label` / `actionButton` / `slotAfterTitle` / `onBackButtonClick` применяются только на mobile.
19
17
  * Чтобы всегда был popover — `withLayoutType(Droplist, 'desktop')` либо вложенный
20
18
  * `<AdaptiveProvider layoutType='desktop'>`. Пропа `layoutType` у компонента нет.
@@ -1,5 +1,4 @@
1
1
  import { DragEndEvent } from '@dnd-kit/core';
2
- import { LayoutPresets } from '@cloud-ru/ds-adaptive';
3
2
  import { BottomSheetProps } from '@cloud-ru/ds-bottom-sheet';
4
3
  import { DropdownProps } from '@cloud-ru/ds-dropdown';
5
4
  import { WithSupportProps } from '@cloud-ru/ds-utils';
@@ -146,11 +145,6 @@ export type ReorderableBaseDroplistProps = DroplistOwnProps & DroplistListProps<
146
145
  * модели айтемов. Публичные `DroplistProps`/`ReorderableDroplistProps` плоские, см. `ListImplProps`.
147
146
  */
148
147
  export type DesktopDroplistProps = DroplistOwnProps & DroplistListProps<ListImplProps>;
149
- export type DroplistLayoutDefaults = Pick<ListProps, 'size'>;
150
- type DroplistAdaptiveProps = {
151
- /** Переопределение размера списка по раскладке. На mobile по умолчанию `l`. */
152
- layoutPresets?: LayoutPresets<DroplistLayoutDefaults>;
153
- };
154
148
  /** Только mobile (`BottomSheet`)-слоты адаптивного `Droplist`. */
155
149
  type DroplistMobileSlots = {
156
150
  /** Только mobile (`BottomSheet`): заголовок шапки. */
@@ -165,17 +159,17 @@ type DroplistMobileSlots = {
165
159
  /**
166
160
  * Props адаптивного `Droplist` (дефолтный droplist): базовые props + mobile-слоты `BottomSheet`.
167
161
  * Раскладку берёт из `AdaptiveProvider` (контекст): на `mobile` рендерит `MobileDroplist`
168
- * (список размера `l` по умолчанию в `BottomSheet`), иначе — `DesktopDroplist` (анкорный popover). Mobile-слоты
162
+ * (список size `m` в `BottomSheet`), иначе — `DesktopDroplist` (анкорный popover). Mobile-слоты
169
163
  * применяются только на mobile.
170
164
  */
171
- export type DroplistProps = BaseDroplistProps & DroplistAdaptiveProps & DroplistMobileSlots & Pick<BottomSheetProps, 'snapPoints' | 'withDividers'>;
165
+ export type DroplistProps = BaseDroplistProps & DroplistMobileSlots & Pick<BottomSheetProps, 'snapPoints' | 'withDividers'>;
172
166
  /**
173
167
  * Props адаптивного `ReorderableDroplist`: props `ReorderableList` + popover/mobile-обвязка
174
168
  * `Droplist`. Отдельный компонент по той же причине, что и `ReorderableList`.
175
169
  */
176
- export type ReorderableDroplistProps = ReorderableBaseDroplistProps & DroplistMobileSlots & DroplistAdaptiveProps;
170
+ export type ReorderableDroplistProps = ReorderableBaseDroplistProps & DroplistMobileSlots;
177
171
  /** @internal Props общей реализации адаптивного дроплиста: реализация + mobile-слоты. */
178
- export type DroplistImplProps = DesktopDroplistProps & DroplistMobileSlots & DroplistAdaptiveProps;
172
+ export type DroplistImplProps = DesktopDroplistProps & DroplistMobileSlots;
179
173
  /**
180
174
  * @internal Props mobile-реализации (`BottomSheet`): реализация дроплиста без popover-пропов
181
175
  * + mobile-слоты.