@hh.ru/magritte-ui-select 13.4.2 → 13.5.1

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.
@@ -38,7 +38,7 @@ import '@hh.ru/magritte-ui-typography';
38
38
  import '@hh.ru/magritte-ui-button';
39
39
  import '@hh.ru/magritte-ui-icon/icon';
40
40
 
41
- var styles = {"content-placeholder":"magritte-content-placeholder___rOCxd_13-4-2","contentPlaceholder":"magritte-content-placeholder___rOCxd_13-4-2","select-bottom-sheet_without-header":"magritte-select-bottom-sheet_without-header___KOKVh_13-4-2","selectBottomSheetWithoutHeader":"magritte-select-bottom-sheet_without-header___KOKVh_13-4-2"};
41
+ var styles = {"content-placeholder":"magritte-content-placeholder___rOCxd_13-5-1","contentPlaceholder":"magritte-content-placeholder___rOCxd_13-5-1","select-bottom-sheet_without-header":"magritte-select-bottom-sheet_without-header___KOKVh_13-5-1","selectBottomSheetWithoutHeader":"magritte-select-bottom-sheet_without-header___KOKVh_13-5-1"};
42
42
 
43
43
  const ACTION_BAR_DEFAULT_PROPS = BOTTOM_SHEET_ACTION_BAR_DEFAULTS;
44
44
  const SelectBottomSheetComponentRenderFunc = ({ children, footer, header, ...props }, ref) => {
package/SelectDrop.js CHANGED
@@ -37,7 +37,7 @@ import '@hh.ru/magritte-ui-spacing';
37
37
  import '@hh.ru/magritte-ui-title';
38
38
  import '@hh.ru/magritte-ui-typography';
39
39
 
40
- var styles = {"select-drop-container-wrapper":"magritte-select-drop-container-wrapper___OHM0q_13-4-2","selectDropContainerWrapper":"magritte-select-drop-container-wrapper___OHM0q_13-4-2","select-drop-container":"magritte-select-drop-container___hee1p_13-4-2","selectDropContainer":"magritte-select-drop-container___hee1p_13-4-2","select-drop-container_with-footer":"magritte-select-drop-container_with-footer___6wp-L_13-4-2","selectDropContainerWithFooter":"magritte-select-drop-container_with-footer___6wp-L_13-4-2","select-drop-loading":"magritte-select-drop-loading___KsNuw_13-4-2","selectDropLoading":"magritte-select-drop-loading___KsNuw_13-4-2"};
40
+ var styles = {"select-drop-container-wrapper":"magritte-select-drop-container-wrapper___OHM0q_13-5-1","selectDropContainerWrapper":"magritte-select-drop-container-wrapper___OHM0q_13-5-1","select-drop-container":"magritte-select-drop-container___hee1p_13-5-1","selectDropContainer":"magritte-select-drop-container___hee1p_13-5-1","select-drop-container_with-footer":"magritte-select-drop-container_with-footer___6wp-L_13-5-1","selectDropContainerWithFooter":"magritte-select-drop-container_with-footer___6wp-L_13-5-1","select-drop-loading":"magritte-select-drop-loading___KsNuw_13-5-1","selectDropLoading":"magritte-select-drop-loading___KsNuw_13-5-1"};
41
41
 
42
42
  const DROP_PLACEMENT = ["bottom-left", "top-left", "bottom-right", "top-right"];
43
43
  const ACTION_BAR_DEFAULT_PROPS = SELECT_DROP_ACTION_BAR_DEFAULTS;
@@ -6,7 +6,7 @@ import { VSpacing } from '@hh.ru/magritte-ui-spacing';
6
6
  import { Title } from '@hh.ru/magritte-ui-title';
7
7
  import { Text } from '@hh.ru/magritte-ui-typography';
8
8
 
9
- var styles = {"select-empty-hint":"magritte-select-empty-hint___B39XJ_13-4-2","selectEmptyHint":"magritte-select-empty-hint___B39XJ_13-4-2","icon":"magritte-icon___F0GQx_13-4-2","icon-empty":"magritte-icon-empty___sAFRT_13-4-2","iconEmpty":"magritte-icon-empty___sAFRT_13-4-2","icon-empty-search":"magritte-icon-empty-search___O0pus_13-4-2","iconEmptySearch":"magritte-icon-empty-search___O0pus_13-4-2"};
9
+ var styles = {"select-empty-hint":"magritte-select-empty-hint___B39XJ_13-5-1","selectEmptyHint":"magritte-select-empty-hint___B39XJ_13-5-1","icon":"magritte-icon___F0GQx_13-5-1","icon-empty":"magritte-icon-empty___sAFRT_13-5-1","iconEmpty":"magritte-icon-empty___sAFRT_13-5-1","icon-empty-search":"magritte-icon-empty-search___O0pus_13-5-1","iconEmptySearch":"magritte-icon-empty-search___O0pus_13-5-1"};
10
10
 
11
11
  const SelectEmptyHint = (props) => {
12
12
  const { type = "init", title, children } = props;
package/SelectOptions.js CHANGED
@@ -33,7 +33,7 @@ import '@hh.ru/magritte-ui-section-header';
33
33
  import './internal/OptionControl.js';
34
34
  import '@hh.ru/magritte-ui-checkbox-radio';
35
35
 
36
- var styles = {"options":"magritte-options___E0JN-_13-4-2","options_plain":"magritte-options_plain___-ihU5_13-4-2","optionsPlain":"magritte-options_plain___-ihU5_13-4-2","options_desktop":"magritte-options_desktop___gz7kx_13-4-2","optionsDesktop":"magritte-options_desktop___gz7kx_13-4-2","options_desktop-plain":"magritte-options_desktop-plain___L0WIC_13-4-2","optionsDesktopPlain":"magritte-options_desktop-plain___L0WIC_13-4-2","chips":"magritte-chips___EAQ3O_13-4-2"};
36
+ var styles = {"options":"magritte-options___E0JN-_13-5-1","options_plain":"magritte-options_plain___-ihU5_13-5-1","optionsPlain":"magritte-options_plain___-ihU5_13-5-1","options_desktop":"magritte-options_desktop___gz7kx_13-5-1","optionsDesktop":"magritte-options_desktop___gz7kx_13-5-1","options_desktop-plain":"magritte-options_desktop-plain___L0WIC_13-5-1","optionsDesktopPlain":"magritte-options_desktop-plain___L0WIC_13-5-1","chips":"magritte-chips___EAQ3O_13-5-1"};
37
37
 
38
38
  const groupChipsAndOptions = (options) => {
39
39
  const result = [];
@@ -30,7 +30,7 @@ import './internal/SearchStateContext.js';
30
30
  import './internal/useFocusWithin.js';
31
31
  import './useSelectContentState.js';
32
32
 
33
- var styles = {"anchor":"magritte-anchor___0KOBD_13-4-2","anchor-stretched":"magritte-anchor-stretched___h7y6m_13-4-2","anchorStretched":"magritte-anchor-stretched___h7y6m_13-4-2","default-view":"magritte-default-view___3ptpo_13-4-2","defaultView":"magritte-default-view___3ptpo_13-4-2","input-view":"magritte-input-view___ZeEKh_13-4-2","inputView":"magritte-input-view___ZeEKh_13-4-2","hidden-view":"magritte-hidden-view___stvzX_13-4-2","hiddenView":"magritte-hidden-view___stvzX_13-4-2"};
33
+ var styles = {"anchor":"magritte-anchor___0KOBD_13-5-1","anchor-stretched":"magritte-anchor-stretched___h7y6m_13-5-1","anchorStretched":"magritte-anchor-stretched___h7y6m_13-5-1","default-view":"magritte-default-view___3ptpo_13-5-1","defaultView":"magritte-default-view___3ptpo_13-5-1","input-view":"magritte-input-view___ZeEKh_13-5-1","inputView":"magritte-input-view___ZeEKh_13-5-1","hidden-view":"magritte-hidden-view___stvzX_13-5-1","hiddenView":"magritte-hidden-view___stvzX_13-5-1"};
34
34
 
35
35
  const SelectSearchTriggerComponent = ({
36
36
  "aria-label": ariaLabel,
package/index.css CHANGED
@@ -1,4 +1,4 @@
1
- .magritte-error-container___ICGpQ_13-4-2{
1
+ .magritte-error-container___ICGpQ_13-5-1{
2
2
  display:flex;
3
3
  flex-direction:column;
4
4
  align-items:center;
@@ -7,19 +7,19 @@
7
7
  text-align:center;
8
8
  }
9
9
  @media (min-width: 1020px){
10
- body.magritte-old-layout .magritte-error-container___ICGpQ_13-4-2{
10
+ body.magritte-old-layout .magritte-error-container___ICGpQ_13-5-1{
11
11
  min-height:320px;
12
12
  height:auto;
13
13
  }
14
14
  }
15
15
  @media (min-width: 1024px){
16
- body:not(.magritte-old-layout) .magritte-error-container___ICGpQ_13-4-2{
16
+ body:not(.magritte-old-layout) .magritte-error-container___ICGpQ_13-5-1{
17
17
  min-height:320px;
18
18
  height:auto;
19
19
  }
20
20
  }
21
21
 
22
- .magritte-content-placeholder___rOCxd_13-4-2{
22
+ .magritte-content-placeholder___rOCxd_13-5-1{
23
23
  display:flex;
24
24
  flex-direction:column;
25
25
  align-items:center;
@@ -27,25 +27,25 @@
27
27
  height:100%;
28
28
  text-align:center;
29
29
  }
30
- .magritte-select-bottom-sheet_without-header___KOKVh_13-4-2{
30
+ .magritte-select-bottom-sheet_without-header___KOKVh_13-5-1{
31
31
  padding-top:16px;
32
32
  }
33
33
 
34
- .magritte-select-drop-container-wrapper___OHM0q_13-4-2{
34
+ .magritte-select-drop-container-wrapper___OHM0q_13-5-1{
35
35
  display:flex;
36
36
  flex-direction:column;
37
37
  }
38
- .magritte-select-drop-container___hee1p_13-4-2{
38
+ .magritte-select-drop-container___hee1p_13-5-1{
39
39
  display:flex;
40
40
  flex-direction:column;
41
41
  padding:var(--magritte-select-drop-padding);
42
42
  margin:calc(-1 * var(--magritte-select-drop-padding));
43
43
  }
44
- .magritte-select-drop-container_with-footer___6wp-L_13-4-2{
44
+ .magritte-select-drop-container_with-footer___6wp-L_13-5-1{
45
45
  margin-bottom:0;
46
46
  padding-bottom:0;
47
47
  }
48
- .magritte-select-drop-loading___KsNuw_13-4-2{
48
+ .magritte-select-drop-loading___KsNuw_13-5-1{
49
49
  display:flex;
50
50
  align-items:center;
51
51
  height:150px;
@@ -70,7 +70,7 @@
70
70
  --magritte-color-background-accent-secondary-v26-0-3:#F1F4F7;
71
71
  --magritte-color-icon-accent-v26-0-3:#7195AF;
72
72
  }
73
- .magritte-select-empty-hint___B39XJ_13-4-2{
73
+ .magritte-select-empty-hint___B39XJ_13-5-1{
74
74
  display:flex;
75
75
  flex-direction:column;
76
76
  align-items:center;
@@ -79,18 +79,18 @@
79
79
  text-align:center;
80
80
  }
81
81
  @media (min-width: 1020px){
82
- body.magritte-old-layout .magritte-select-empty-hint___B39XJ_13-4-2{
82
+ body.magritte-old-layout .magritte-select-empty-hint___B39XJ_13-5-1{
83
83
  min-height:320px;
84
84
  height:auto;
85
85
  }
86
86
  }
87
87
  @media (min-width: 1024px){
88
- body:not(.magritte-old-layout) .magritte-select-empty-hint___B39XJ_13-4-2{
88
+ body:not(.magritte-old-layout) .magritte-select-empty-hint___B39XJ_13-5-1{
89
89
  min-height:320px;
90
90
  height:auto;
91
91
  }
92
92
  }
93
- .magritte-icon___F0GQx_13-4-2{
93
+ .magritte-icon___F0GQx_13-5-1{
94
94
  display:flex;
95
95
  align-items:center;
96
96
  justify-content:center;
@@ -98,11 +98,11 @@
98
98
  height:48px;
99
99
  border-radius:50%;
100
100
  }
101
- .magritte-icon-empty___sAFRT_13-4-2{
101
+ .magritte-icon-empty___sAFRT_13-5-1{
102
102
  background-color:var(--magritte-color-background-accent-secondary-v26-0-3);
103
103
  --magritte-ui-icon-color-override:var(--magritte-color-icon-accent-v26-0-3);
104
104
  }
105
- .magritte-icon-empty-search___O0pus_13-4-2{
105
+ .magritte-icon-empty-search___O0pus_13-5-1{
106
106
  background-color:var(--magritte-color-background-secondary-v26-0-3);
107
107
  --magritte-ui-icon-color-override:var(--magritte-color-icon-tertiary-v26-0-3);
108
108
  }
@@ -110,79 +110,79 @@
110
110
  :root{
111
111
  --magritte-color-component-input-stroke-state-accent-focused-accessible-v26-0-3:#0070ff7a;
112
112
  }
113
- .magritte-select-option-plain___u9kSx_13-4-2{
113
+ .magritte-select-option-plain___u9kSx_13-5-1{
114
114
  border-radius:8px;
115
115
  }
116
- .magritte-select-option-plain___u9kSx_13-4-2.focus-visible{
116
+ .magritte-select-option-plain___u9kSx_13-5-1.focus-visible{
117
117
  outline:var(--magritte-color-component-input-stroke-state-accent-focused-accessible-v26-0-3) solid 4px;
118
118
  }
119
119
  @media (min-width: 1020px){
120
- body.magritte-old-layout .magritte-select-option-plain___u9kSx_13-4-2:hover{
120
+ body.magritte-old-layout .magritte-select-option-plain___u9kSx_13-5-1:hover{
121
121
  cursor:default;
122
122
  }
123
123
  }
124
124
  @media (min-width: 1024px){
125
- body:not(.magritte-old-layout) .magritte-select-option-plain___u9kSx_13-4-2:hover{
125
+ body:not(.magritte-old-layout) .magritte-select-option-plain___u9kSx_13-5-1:hover{
126
126
  cursor:default;
127
127
  }
128
128
  }
129
129
  @media (min-width: 1020px){
130
- body.magritte-old-layout .magritte-select-option-plain_active___ynHQP_13-4-2:hover{
130
+ body.magritte-old-layout .magritte-select-option-plain_active___ynHQP_13-5-1:hover{
131
131
  cursor:pointer;
132
132
  }
133
133
  }
134
134
  @media (min-width: 1024px){
135
- body:not(.magritte-old-layout) .magritte-select-option-plain_active___ynHQP_13-4-2:hover{
135
+ body:not(.magritte-old-layout) .magritte-select-option-plain_active___ynHQP_13-5-1:hover{
136
136
  cursor:pointer;
137
137
  }
138
138
  }
139
- .magritte-select-label-option___wyUhk_13-4-2{
139
+ .magritte-select-label-option___wyUhk_13-5-1{
140
140
  display:flex;
141
141
  justify-content:center;
142
142
  }
143
143
 
144
- .magritte-options___E0JN-_13-4-2{
144
+ .magritte-options___E0JN-_13-5-1{
145
145
  display:flex;
146
146
  flex-direction:column;
147
147
  padding:0 16px;
148
148
  padding-bottom:16px;
149
149
  gap:12px;
150
150
  }
151
- .magritte-options_plain___-ihU5_13-4-2{
151
+ .magritte-options_plain___-ihU5_13-5-1{
152
152
  gap:0;
153
153
  }
154
- .magritte-options_desktop___gz7kx_13-4-2{
154
+ .magritte-options_desktop___gz7kx_13-5-1{
155
155
  gap:8px;
156
156
  padding:0;
157
157
  }
158
- .magritte-options_desktop-plain___L0WIC_13-4-2{
158
+ .magritte-options_desktop-plain___L0WIC_13-5-1{
159
159
  gap:16px;
160
160
  }
161
- .magritte-chips___EAQ3O_13-4-2{
161
+ .magritte-chips___EAQ3O_13-5-1{
162
162
  display:flex;
163
163
  flex-wrap:wrap;
164
164
  gap:12px;
165
165
  }
166
- .magritte-chips___EAQ3O_13-4-2:not(:last-child),
167
- .magritte-options___E0JN-_13-4-2:not(:last-child) > .magritte-chips___EAQ3O_13-4-2:last-child{
166
+ .magritte-chips___EAQ3O_13-5-1:not(:last-child),
167
+ .magritte-options___E0JN-_13-5-1:not(:last-child) > .magritte-chips___EAQ3O_13-5-1:last-child{
168
168
  padding-bottom:16px;
169
169
  }
170
170
 
171
- .magritte-select-layout___3THUn_13-4-2{
171
+ .magritte-select-layout___3THUn_13-5-1{
172
172
  display:contents;
173
173
  }
174
174
 
175
- .magritte-anchor___0KOBD_13-4-2{
175
+ .magritte-anchor___0KOBD_13-5-1{
176
176
  position:relative;
177
177
  width:fit-content;
178
178
  }
179
- .magritte-anchor-stretched___h7y6m_13-4-2{
179
+ .magritte-anchor-stretched___h7y6m_13-5-1{
180
180
  width:100%;
181
181
  }
182
- .magritte-default-view___3ptpo_13-4-2{
182
+ .magritte-default-view___3ptpo_13-5-1{
183
183
  min-width:0;
184
184
  }
185
- .magritte-input-view___ZeEKh_13-4-2{
185
+ .magritte-input-view___ZeEKh_13-5-1{
186
186
  position:absolute;
187
187
  top:0;
188
188
  left:0;
@@ -190,6 +190,6 @@
190
190
  display:flex;
191
191
  min-width:0;
192
192
  }
193
- .magritte-hidden-view___stvzX_13-4-2{
193
+ .magritte-hidden-view___stvzX_13-5-1{
194
194
  visibility:hidden;
195
195
  }
@@ -22,7 +22,7 @@ import '../useSearchState.js';
22
22
  import './SearchStateContext.js';
23
23
  import './VisibilityContext.js';
24
24
 
25
- var styles = {"select-layout":"magritte-select-layout___3THUn_13-4-2","selectLayout":"magritte-select-layout___3THUn_13-4-2"};
25
+ var styles = {"select-layout":"magritte-select-layout___3THUn_13-5-1","selectLayout":"magritte-select-layout___3THUn_13-5-1"};
26
26
 
27
27
  const CLOSED_BY_USER_KEYS = [keyboardKeys.Escape, keyboardKeys.Enter, keyboardKeys.Space];
28
28
  const FocusWithinContext = createContext(false);
@@ -2,13 +2,13 @@ import { type ComponentType, type ReactElement } from 'react';
2
2
  import { StaticDataFetcherItem } from '@hh.ru/magritte-common-data-provider';
3
3
  import { SectionHeaderProps } from '@hh.ru/magritte-ui-section-header';
4
4
  import { OnChangeAction } from '../internal/OptionControl';
5
- import { SelectOptionType, DelimiterOptionType, ChipOptionType } from '../types';
5
+ import type { OptionRenderType } from '../types';
6
6
  interface OptionProps<DataType extends StaticDataFetcherItem> {
7
7
  disabled?: boolean;
8
8
  data: DataType;
9
9
  checked: boolean;
10
10
  name?: string;
11
- type: SelectOptionType | DelimiterOptionType | ChipOptionType;
11
+ type: OptionRenderType;
12
12
  optionLayoutComponent: OptionCustomLayoutComponent<DataType>;
13
13
  onChange: OnChangeAction<DataType>;
14
14
  plain: boolean;
@@ -23,7 +23,7 @@ interface OptionProps<DataType extends StaticDataFetcherItem> {
23
23
  }
24
24
  type OptionCustomLayoutBaseProps<DataType extends StaticDataFetcherItem> = Pick<OptionProps<DataType>, 'data' | 'plain' | 'checked' | 'isMobile' | 'disabled' | 'onChange' | 'multiple'>;
25
25
  export type OptionCustomLayoutProps<DataType extends StaticDataFetcherItem> = OptionCustomLayoutBaseProps<DataType> & {
26
- type: SelectOptionType | DelimiterOptionType | ChipOptionType;
26
+ type: OptionRenderType;
27
27
  input?: ReactElement;
28
28
  };
29
29
  export type OptionCustomLayoutComponent<DataType extends StaticDataFetcherItem> = ComponentType<OptionCustomLayoutProps<DataType>>;
@@ -13,7 +13,7 @@ import { SectionHeader } from '@hh.ru/magritte-ui-section-header';
13
13
  import { OptionControl } from './OptionControl.js';
14
14
  import '@hh.ru/magritte-ui-checkbox-radio';
15
15
 
16
- var styles = {"select-option-plain":"magritte-select-option-plain___u9kSx_13-4-2","selectOptionPlain":"magritte-select-option-plain___u9kSx_13-4-2","select-option-plain_active":"magritte-select-option-plain_active___ynHQP_13-4-2","selectOptionPlainActive":"magritte-select-option-plain_active___ynHQP_13-4-2","select-label-option":"magritte-select-label-option___wyUhk_13-4-2","selectLabelOption":"magritte-select-label-option___wyUhk_13-4-2"};
16
+ var styles = {"select-option-plain":"magritte-select-option-plain___u9kSx_13-5-1","selectOptionPlain":"magritte-select-option-plain___u9kSx_13-5-1","select-option-plain_active":"magritte-select-option-plain_active___ynHQP_13-5-1","selectOptionPlainActive":"magritte-select-option-plain_active___ynHQP_13-5-1","select-label-option":"magritte-select-label-option___wyUhk_13-5-1","selectLabelOption":"magritte-select-label-option___wyUhk_13-5-1"};
17
17
 
18
18
  const OptionLayoutComponentDefault = ({
19
19
  data,
@@ -1 +1 @@
1
- {"version":3,"file":"Option.js","sources":["src/internal/Option.tsx"],"sourcesContent":["import { type ComponentType, type ReactElement, useState } from 'react';\nimport classnames from 'classnames';\n\nimport { StaticDataFetcherItem } from '@hh.ru/magritte-common-data-provider';\nimport { keyboardMatches, keyboardKeys } from '@hh.ru/magritte-common-keyboard';\nimport { DisabledContext } from '@hh.ru/magritte-common-use-disabled';\nimport { Cell, CellText } from '@hh.ru/magritte-ui-cell';\nimport { CheckableCardElement } from '@hh.ru/magritte-ui-checkable-card/CheckableCardElement';\nimport { CustomChip } from '@hh.ru/magritte-ui-chips';\nimport { CheckOutlinedSize24 } from '@hh.ru/magritte-ui-icon/icon';\nimport { Link } from '@hh.ru/magritte-ui-link';\nimport { SectionHeader, SectionHeaderProps } from '@hh.ru/magritte-ui-section-header';\nimport { OptionControl, OnChangeAction } from '@hh.ru/magritte-ui-select/internal/OptionControl';\nimport { SelectOptionType, DelimiterOptionType, ChipOptionType } from '@hh.ru/magritte-ui-select/types';\n\nimport styles from './option.less';\n\ninterface OptionProps<DataType extends StaticDataFetcherItem> {\n disabled?: boolean;\n data: DataType;\n checked: boolean;\n name?: string;\n type: SelectOptionType | DelimiterOptionType | ChipOptionType;\n optionLayoutComponent: OptionCustomLayoutComponent<DataType>;\n onChange: OnChangeAction<DataType>;\n plain: boolean;\n multiple?: boolean;\n isMobile?: boolean;\n 'data-qa'?: string;\n link?: { href: string; anchor: string };\n delimiterPadding?: SectionHeaderProps['padding'];\n}\n\ntype OptionCustomLayoutBaseProps<DataType extends StaticDataFetcherItem> = Pick<\n OptionProps<DataType>,\n 'data' | 'plain' | 'checked' | 'isMobile' | 'disabled' | 'onChange' | 'multiple'\n>;\n\n// для delimiter и chip секций input не создается, но их через рендер компонент пропустить нужно\nexport type OptionCustomLayoutProps<DataType extends StaticDataFetcherItem> = OptionCustomLayoutBaseProps<DataType> & {\n type: SelectOptionType | DelimiterOptionType | ChipOptionType;\n input?: ReactElement;\n};\n\nexport type OptionCustomLayoutComponent<DataType extends StaticDataFetcherItem> = ComponentType<\n OptionCustomLayoutProps<DataType>\n>;\n\nexport const OptionLayoutComponentDefault = <DataType extends StaticDataFetcherItem>({\n data,\n type,\n plain,\n checked,\n isMobile,\n disabled,\n onChange,\n input,\n}: OptionCustomLayoutProps<DataType>): ReactElement => {\n if (type === 'delimiter') {\n return (\n <CellText maxLines={1} style=\"secondary\">\n {data.text}\n </CellText>\n );\n }\n\n if (type === 'chip') {\n return (\n <CustomChip\n role=\"option\"\n aria-selected={checked}\n disabled={disabled}\n data-qa={`magritte-select-option-${data.value}`}\n data-magritte-select-option={data.value}\n onClick={() => onChange(data)}\n >\n {data.text ?? data.value}\n </CustomChip>\n );\n }\n\n if (type === 'label') {\n return (\n <Cell Element=\"div\" right={checked && plain ? <CheckOutlinedSize24 /> : undefined} vertPadding={isMobile}>\n <div className={classnames({ [styles.selectLabelOption]: !plain })}>\n <CellText maxLines={1}>{data.text}</CellText>\n </div>\n </Cell>\n );\n }\n\n return (\n <Cell Element=\"div\" align=\"center\" left={isMobile ? undefined : input} right={isMobile ? input : undefined}>\n <CellText maxLines={1}>{data.text}</CellText>\n </Cell>\n );\n};\n\nexport const Option = <DataType extends StaticDataFetcherItem>({\n checked,\n name,\n disabled,\n optionLayoutComponent: OptionLayoutComponent,\n type,\n onChange,\n plain,\n data,\n multiple,\n isMobile,\n 'data-qa': dataQa,\n link,\n delimiterPadding,\n}: OptionProps<DataType>): ReactElement => {\n const [focusVisible, setFocusVisible] = useState(false);\n\n if (type === 'delimiter') {\n return (\n <SectionHeader\n padding={delimiterPadding ?? (plain ? 0 : 16)}\n link={link && <Link href={link.href}>{link.anchor}</Link>}\n >\n <OptionLayoutComponent\n data={data}\n type={type}\n plain={plain}\n checked={checked}\n isMobile={isMobile}\n disabled={disabled}\n onChange={onChange}\n multiple={multiple}\n />\n </SectionHeader>\n );\n }\n\n if (type === 'chip') {\n return (\n <OptionLayoutComponent\n data={data}\n type={type}\n plain={plain}\n checked={checked}\n isMobile={isMobile}\n disabled={disabled}\n onChange={onChange}\n multiple={multiple}\n />\n );\n }\n\n const optionLayoutComponentProps = {\n data,\n input: (\n <OptionControl type={type} data={data} checked={checked} name={name} onChange={onChange} data-qa={dataQa} />\n ),\n type,\n plain,\n checked,\n isMobile,\n disabled,\n onChange,\n multiple,\n };\n\n if (plain) {\n return (\n <div\n className={classnames(styles.selectOptionPlain, { [styles.selectOptionPlainActive]: !disabled })}\n data-qa={`magritte-select-option-${data.value}`}\n data-magritte-select-option={data.value}\n role=\"option\"\n aria-selected={checked}\n tabIndex={disabled ? -1 : 0}\n aria-disabled={disabled}\n onClick={() => {\n if (disabled) {\n return;\n }\n onChange(data);\n }}\n onKeyDown={(event) => {\n if (disabled) {\n return;\n }\n if (keyboardMatches(event.nativeEvent, [keyboardKeys.Enter, keyboardKeys.Space])) {\n // выбор возвращает фокус в поиск, и без preventDefault keypress отправит форму из него\n event.preventDefault();\n onChange(data);\n }\n }}\n >\n <DisabledContext.Provider value={!!disabled}>\n <OptionLayoutComponent {...optionLayoutComponentProps} />\n </DisabledContext.Provider>\n </div>\n );\n }\n return (\n <CheckableCardElement\n Element=\"label\"\n role=\"option\"\n padding={16}\n borderRadius={12}\n flexible={false}\n checked={checked}\n data-magritte-select-option={data.value}\n focusVisible={focusVisible}\n data-qa={`magritte-select-option-${data.value}`}\n disabled={disabled}\n aria-selected={checked}\n toneHover\n onClick={() => {\n if (type === 'label' && !disabled) {\n onChange(data);\n }\n }}\n onKeyDown={(event) => {\n if (keyboardMatches(event.nativeEvent, [keyboardKeys.Enter, keyboardKeys.Space])) {\n onChange(data);\n event.preventDefault();\n setFocusVisible(true);\n }\n }}\n onBlur={() => setFocusVisible(false)}\n >\n <OptionLayoutComponent {...optionLayoutComponentProps} />\n </CheckableCardElement>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAgDO,MAAM,+BAA+B,CAAyC;AAAA,EACjF,IAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AACJ,CAAuD,KAAA;AACnD,EAAA,IAAI,SAAS,WAAa,EAAA;AACtB,IAAA,2BACK,QAAS,EAAA,EAAA,QAAA,EAAU,GAAG,KAAM,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AAA,CAAA;AAAA,KAAA;AAAA,GAC3D,CAAA;AAER;;;;"}
1
+ {"version":3,"file":"Option.js","sources":["src/internal/Option.tsx"],"sourcesContent":["import { type ComponentType, type ReactElement, useState } from 'react';\nimport classnames from 'classnames';\n\nimport { StaticDataFetcherItem } from '@hh.ru/magritte-common-data-provider';\nimport { keyboardMatches, keyboardKeys } from '@hh.ru/magritte-common-keyboard';\nimport { DisabledContext } from '@hh.ru/magritte-common-use-disabled';\nimport { Cell, CellText } from '@hh.ru/magritte-ui-cell';\nimport { CheckableCardElement } from '@hh.ru/magritte-ui-checkable-card/CheckableCardElement';\nimport { CustomChip } from '@hh.ru/magritte-ui-chips';\nimport { CheckOutlinedSize24 } from '@hh.ru/magritte-ui-icon/icon';\nimport { Link } from '@hh.ru/magritte-ui-link';\nimport { SectionHeader, SectionHeaderProps } from '@hh.ru/magritte-ui-section-header';\nimport { OptionControl, OnChangeAction } from '@hh.ru/magritte-ui-select/internal/OptionControl';\nimport type { OptionRenderType } from '@hh.ru/magritte-ui-select/types';\n\nimport styles from './option.less';\n\ninterface OptionProps<DataType extends StaticDataFetcherItem> {\n disabled?: boolean;\n data: DataType;\n checked: boolean;\n name?: string;\n type: OptionRenderType;\n optionLayoutComponent: OptionCustomLayoutComponent<DataType>;\n onChange: OnChangeAction<DataType>;\n plain: boolean;\n multiple?: boolean;\n isMobile?: boolean;\n 'data-qa'?: string;\n link?: { href: string; anchor: string };\n delimiterPadding?: SectionHeaderProps['padding'];\n}\n\ntype OptionCustomLayoutBaseProps<DataType extends StaticDataFetcherItem> = Pick<\n OptionProps<DataType>,\n 'data' | 'plain' | 'checked' | 'isMobile' | 'disabled' | 'onChange' | 'multiple'\n>;\n\n// для delimiter и chip секций input не создается, но их через рендер компонент пропустить нужно\nexport type OptionCustomLayoutProps<DataType extends StaticDataFetcherItem> = OptionCustomLayoutBaseProps<DataType> & {\n type: OptionRenderType;\n input?: ReactElement;\n};\n\nexport type OptionCustomLayoutComponent<DataType extends StaticDataFetcherItem> = ComponentType<\n OptionCustomLayoutProps<DataType>\n>;\n\nexport const OptionLayoutComponentDefault = <DataType extends StaticDataFetcherItem>({\n data,\n type,\n plain,\n checked,\n isMobile,\n disabled,\n onChange,\n input,\n}: OptionCustomLayoutProps<DataType>): ReactElement => {\n if (type === 'delimiter') {\n return (\n <CellText maxLines={1} style=\"secondary\">\n {data.text}\n </CellText>\n );\n }\n\n if (type === 'chip') {\n return (\n <CustomChip\n role=\"option\"\n aria-selected={checked}\n disabled={disabled}\n data-qa={`magritte-select-option-${data.value}`}\n data-magritte-select-option={data.value}\n onClick={() => onChange(data)}\n >\n {data.text ?? data.value}\n </CustomChip>\n );\n }\n\n if (type === 'label') {\n return (\n <Cell Element=\"div\" right={checked && plain ? <CheckOutlinedSize24 /> : undefined} vertPadding={isMobile}>\n <div className={classnames({ [styles.selectLabelOption]: !plain })}>\n <CellText maxLines={1}>{data.text}</CellText>\n </div>\n </Cell>\n );\n }\n\n return (\n <Cell Element=\"div\" align=\"center\" left={isMobile ? undefined : input} right={isMobile ? input : undefined}>\n <CellText maxLines={1}>{data.text}</CellText>\n </Cell>\n );\n};\n\nexport const Option = <DataType extends StaticDataFetcherItem>({\n checked,\n name,\n disabled,\n optionLayoutComponent: OptionLayoutComponent,\n type,\n onChange,\n plain,\n data,\n multiple,\n isMobile,\n 'data-qa': dataQa,\n link,\n delimiterPadding,\n}: OptionProps<DataType>): ReactElement => {\n const [focusVisible, setFocusVisible] = useState(false);\n\n if (type === 'delimiter') {\n return (\n <SectionHeader\n padding={delimiterPadding ?? (plain ? 0 : 16)}\n link={link && <Link href={link.href}>{link.anchor}</Link>}\n >\n <OptionLayoutComponent\n data={data}\n type={type}\n plain={plain}\n checked={checked}\n isMobile={isMobile}\n disabled={disabled}\n onChange={onChange}\n multiple={multiple}\n />\n </SectionHeader>\n );\n }\n\n if (type === 'chip') {\n return (\n <OptionLayoutComponent\n data={data}\n type={type}\n plain={plain}\n checked={checked}\n isMobile={isMobile}\n disabled={disabled}\n onChange={onChange}\n multiple={multiple}\n />\n );\n }\n\n const optionLayoutComponentProps = {\n data,\n input: (\n <OptionControl type={type} data={data} checked={checked} name={name} onChange={onChange} data-qa={dataQa} />\n ),\n type,\n plain,\n checked,\n isMobile,\n disabled,\n onChange,\n multiple,\n };\n\n if (plain) {\n return (\n <div\n className={classnames(styles.selectOptionPlain, { [styles.selectOptionPlainActive]: !disabled })}\n data-qa={`magritte-select-option-${data.value}`}\n data-magritte-select-option={data.value}\n role=\"option\"\n aria-selected={checked}\n tabIndex={disabled ? -1 : 0}\n aria-disabled={disabled}\n onClick={() => {\n if (disabled) {\n return;\n }\n onChange(data);\n }}\n onKeyDown={(event) => {\n if (disabled) {\n return;\n }\n if (keyboardMatches(event.nativeEvent, [keyboardKeys.Enter, keyboardKeys.Space])) {\n // выбор возвращает фокус в поиск, и без preventDefault keypress отправит форму из него\n event.preventDefault();\n onChange(data);\n }\n }}\n >\n <DisabledContext.Provider value={!!disabled}>\n <OptionLayoutComponent {...optionLayoutComponentProps} />\n </DisabledContext.Provider>\n </div>\n );\n }\n return (\n <CheckableCardElement\n Element=\"label\"\n role=\"option\"\n padding={16}\n borderRadius={12}\n flexible={false}\n checked={checked}\n data-magritte-select-option={data.value}\n focusVisible={focusVisible}\n data-qa={`magritte-select-option-${data.value}`}\n disabled={disabled}\n aria-selected={checked}\n toneHover\n onClick={() => {\n if (type === 'label' && !disabled) {\n onChange(data);\n }\n }}\n onKeyDown={(event) => {\n if (keyboardMatches(event.nativeEvent, [keyboardKeys.Enter, keyboardKeys.Space])) {\n onChange(data);\n event.preventDefault();\n setFocusVisible(true);\n }\n }}\n onBlur={() => setFocusVisible(false)}\n >\n <OptionLayoutComponent {...optionLayoutComponentProps} />\n </CheckableCardElement>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAgDO,MAAM,+BAA+B,CAAyC;AAAA,EACjF,IAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA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AAA,CAAgB,IAAI,CAAA,CAAA;AAAA,SACxB;AAAA,OACJ;AAAA,MACA,MAAA,EAAQ,MAAM,eAAA,CAAgB,KAAK,CAAA;AAAA,MAEnC,QAAA,kBAAA,GAAA,CAAC,qBAAuB,EAAA,EAAA,GAAG,0BAA4B,EAAA,CAAA;AAAA,KAAA;AAAA,GAC3D,CAAA;AAER;;;;"}
@@ -20,7 +20,7 @@ import '../useVisibility.js';
20
20
  import './VisibilityContext.js';
21
21
  import './ConfigContext.js';
22
22
 
23
- var styles = {"error-container":"magritte-error-container___ICGpQ_13-4-2","errorContainer":"magritte-error-container___ICGpQ_13-4-2"};
23
+ var styles = {"error-container":"magritte-error-container___ICGpQ_13-5-1","errorContainer":"magritte-error-container___ICGpQ_13-5-1"};
24
24
 
25
25
  const SelectError = () => {
26
26
  const { isMobile } = useBreakpoint();
package/legacy/types.d.ts CHANGED
@@ -1,10 +1,9 @@
1
1
  import { ComponentProps, ReactElement, ReactNode, KeyboardEvent, Ref } from 'react';
2
2
  import { DataProvider, StaticDataFetcherItem } from '@hh.ru/magritte-common-data-provider';
3
3
  import { BottomSheetHeight } from '@hh.ru/magritte-ui-bottom-sheet';
4
- import type { DelimiterOptionType, ErrorState, OnOptionsChangeCallback, OptionsCount, ProviderErrorState, SelectOption, SelectOptionType, ValueTypeHelper } from '../types';
4
+ import type { ErrorState, OnOptionsChangeCallback, OptionRenderType, OptionsCount, ProviderErrorState, SelectOption, SelectOptionType, ValueTypeHelper } from '../types';
5
5
  import type { SearchContextValue } from '../useSearchState';
6
6
  import { TriggerProps, Trigger } from '@hh.ru/magritte-ui-trigger';
7
- type OptionRenderType = SelectOptionType | DelimiterOptionType;
8
7
  export type TriggerPropsWithRef = ComponentProps<typeof Trigger>;
9
8
  export type TriggerExternalProps = Omit<TriggerProps, 'values' | 'expanded' | 'onChange' | 'onClear' | 'onKeyDown' | 'onBlur' | 'onFocus'>;
10
9
  export interface OnChangeAction<DataType extends StaticDataFetcherItem> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hh.ru/magritte-ui-select",
3
- "version": "13.4.2",
3
+ "version": "13.5.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -39,27 +39,27 @@
39
39
  "@hh.ru/magritte-common-use-translation": "3.9.0",
40
40
  "@hh.ru/magritte-design-tokens": "26.0.3",
41
41
  "@hh.ru/magritte-internal-slot-registry": "1.1.2",
42
- "@hh.ru/magritte-ui-action-bar": "5.5.1",
43
- "@hh.ru/magritte-ui-bottom-sheet": "9.5.7",
42
+ "@hh.ru/magritte-ui-action-bar": "5.5.2",
43
+ "@hh.ru/magritte-ui-bottom-sheet": "9.5.9",
44
44
  "@hh.ru/magritte-ui-breakpoint": "6.1.3",
45
- "@hh.ru/magritte-ui-button": "7.4.1",
46
- "@hh.ru/magritte-ui-card": "8.9.1",
47
- "@hh.ru/magritte-ui-cell": "7.4.1",
48
- "@hh.ru/magritte-ui-checkable-card": "5.2.4",
49
- "@hh.ru/magritte-ui-checkbox-radio": "4.2.1",
50
- "@hh.ru/magritte-ui-chips": "7.1.4",
51
- "@hh.ru/magritte-ui-drop": "12.4.1",
52
- "@hh.ru/magritte-ui-icon": "15.2.1",
53
- "@hh.ru/magritte-ui-input": "9.5.2",
54
- "@hh.ru/magritte-ui-link": "7.3.1",
55
- "@hh.ru/magritte-ui-loader": "4.2.1",
45
+ "@hh.ru/magritte-ui-button": "7.4.2",
46
+ "@hh.ru/magritte-ui-card": "8.9.2",
47
+ "@hh.ru/magritte-ui-cell": "7.4.2",
48
+ "@hh.ru/magritte-ui-checkable-card": "5.2.6",
49
+ "@hh.ru/magritte-ui-checkbox-radio": "4.2.2",
50
+ "@hh.ru/magritte-ui-chips": "7.1.5",
51
+ "@hh.ru/magritte-ui-drop": "12.4.2",
52
+ "@hh.ru/magritte-ui-icon": "16.0.0",
53
+ "@hh.ru/magritte-ui-input": "9.5.3",
54
+ "@hh.ru/magritte-ui-link": "7.3.2",
55
+ "@hh.ru/magritte-ui-loader": "4.2.2",
56
56
  "@hh.ru/magritte-ui-mock-component": "1.1.9",
57
- "@hh.ru/magritte-ui-nav-bar": "2.1.1",
57
+ "@hh.ru/magritte-ui-nav-bar": "2.1.2",
58
58
  "@hh.ru/magritte-ui-section-header": "1.1.14",
59
59
  "@hh.ru/magritte-ui-spacing": "2.1.33",
60
60
  "@hh.ru/magritte-ui-title": "8.3.16",
61
- "@hh.ru/magritte-ui-trigger": "4.4.1",
61
+ "@hh.ru/magritte-ui-trigger": "4.4.2",
62
62
  "@hh.ru/magritte-ui-typography": "5.3.18"
63
63
  },
64
- "gitHead": "60830926e90be2820db9abfb45e614a9ddff94aa"
64
+ "gitHead": "65935950106d9a4084807711f544bd6ecedb382f"
65
65
  }
package/types.d.ts CHANGED
@@ -5,6 +5,8 @@ import { TriggerProps } from '@hh.ru/magritte-ui-trigger';
5
5
  export type DelimiterOptionType = 'delimiter';
6
6
  export type ChipOptionType = 'chip';
7
7
  export type SelectOptionType = 'checkbox' | 'label' | 'radio';
8
+ /** Тип опции, который получает компонент отрисовки опции (новый и legacy API) */
9
+ export type OptionRenderType = SelectOptionType | DelimiterOptionType | ChipOptionType;
8
10
  export type CommitModel = 'instant' | 'confirm';
9
11
  type ControlledTriggerKeys = 'expanded' | 'onBlur' | 'onChange' | 'onClear' | 'onFocus' | 'onKeyDown' | 'values' | 'aria-haspopup' | 'aria-controls';
10
12
  export type SelectUncontrolledTriggerProps = DistributiveOmit<TriggerProps, ControlledTriggerKeys>;