@lt-ui/uikit 0.0.1 → 0.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.
- package/_internal/base-button/styles.module.css +1 -1
- package/_internal/field/_motion.css +0 -0
- package/_internal/field/field.module.css +21 -23
- package/_internal/picker/picker-field.module.css +1 -1
- package/_internal/picker/picker-sheet.module.css +1 -1
- package/accordion/styles.module.css +3 -4
- package/alert/styles/alert.module.css +8 -8
- package/avatar/avatar-group.module.css +1 -1
- package/avatar/styles.module.css +3 -3
- package/badge/styles.module.css +3 -3
- package/breadcrumbs/styles.module.css +4 -4
- package/button/styles.module.css +7 -7
- package/calendar/styles.module.css +11 -11
- package/caption/styles.module.css +1 -1
- package/checkbox/styles/style.module.css +10 -12
- package/chip/styles.module.css +3 -3
- package/cjs/_internal/base-button/styles.module.css +1 -1
- package/cjs/_internal/field/_motion.css +0 -0
- package/cjs/_internal/field/field.module.css +21 -23
- package/cjs/_internal/picker/picker-field.module.css +1 -1
- package/cjs/_internal/picker/picker-sheet.module.css +1 -1
- package/cjs/accordion/styles.module.css +3 -4
- package/cjs/alert/styles/alert.module.css +8 -8
- package/cjs/avatar/avatar-group.module.css +1 -1
- package/cjs/avatar/styles.module.css +3 -3
- package/cjs/badge/styles.module.css +3 -3
- package/cjs/breadcrumbs/styles.module.css +4 -4
- package/cjs/button/styles.module.css +7 -7
- package/cjs/calendar/styles.module.css +11 -11
- package/cjs/caption/styles.module.css +1 -1
- package/cjs/checkbox/styles/style.module.css +10 -12
- package/cjs/chip/styles.module.css +3 -3
- package/cjs/date-picker/styles.module.css +10 -10
- package/cjs/drawer/styles.module.css +10 -12
- package/cjs/file/styles.module.css +3 -4
- package/cjs/hint/styles/buttons.module.css +2 -2
- package/cjs/hint/styles/hint-content.module.css +3 -3
- package/cjs/hint/styles/hint.module.css +2 -2
- package/cjs/image/viewer.module.css +1 -1
- package/cjs/list/list-divider/styles.module.css +2 -2
- package/cjs/list/list-item/styles.module.css +2 -2
- package/cjs/list/list-section/styles.module.css +4 -4
- package/cjs/modal/styles/modal-footer.module.css +3 -3
- package/cjs/modal/styles/modal-header.module.css +5 -5
- package/cjs/modal/styles/modal.module.css +2 -2
- package/cjs/navigation/navigation.js +2 -1
- package/cjs/navigation/styles/navigation.module.css +96 -81
- package/cjs/pagination/styles.module.css +2 -2
- package/cjs/pin-input/styles.module.css +2 -2
- package/cjs/progress-bar/styles.module.css +1 -1
- package/cjs/quantity-input/styles.module.css +3 -3
- package/cjs/radio/styles.module.css +4 -5
- package/cjs/radio-group/styles.module.css +1 -1
- package/cjs/segmented-control/styles/segmented-control-item.module.css +9 -9
- package/cjs/segmented-control/styles/segmented-control.module.css +4 -4
- package/cjs/select/components/select-field-multiselect-value.js +2 -2
- package/cjs/select/components/select-field.js +8 -6
- package/cjs/select/hooks/use-select-view-model.js +3 -1
- package/cjs/select/styles/select-field.module.css +20 -1
- package/cjs/select/styles/select.module.css +2 -2
- package/cjs/select/views/select-view.js +2 -2
- package/cjs/select/views/styles.module.css +1 -1
- package/cjs/snackbar/styles/snack.module.css +1 -1
- package/cjs/switch/styles/base.module.css +2 -2
- package/cjs/tabs/styles/tab-list.module.css +1 -1
- package/cjs/tabs/styles/tab.module.css +6 -6
- package/cjs/textarea/styles.module.css +1 -1
- package/cjs/theme-provider/styles.module.css +6 -6
- package/cjs/time-picker/styles.module.css +9 -9
- package/cjs/tree/styles.module.css +5 -5
- package/cjs/tree/tree-select.module.css +2 -2
- package/date-picker/styles.module.css +10 -10
- package/drawer/styles.module.css +10 -12
- package/file/styles.module.css +3 -4
- package/hint/styles/buttons.module.css +2 -2
- package/hint/styles/hint-content.module.css +3 -3
- package/hint/styles/hint.module.css +2 -2
- package/image/viewer.module.css +1 -1
- package/list/list-divider/styles.module.css +2 -2
- package/list/list-item/styles.module.css +2 -2
- package/list/list-section/styles.module.css +4 -4
- package/modal/styles/modal-footer.module.css +3 -3
- package/modal/styles/modal-header.module.css +5 -5
- package/modal/styles/modal.module.css +2 -2
- package/navigation/navigation.d.ts +1 -0
- package/navigation/navigation.js +2 -1
- package/navigation/styles/navigation.module.css +96 -81
- package/navigation/types.d.ts +2 -2
- package/package.json +6 -2
- package/pagination/styles.module.css +2 -2
- package/pin-input/styles.module.css +2 -2
- package/progress-bar/styles.module.css +1 -1
- package/quantity-input/styles.module.css +3 -3
- package/radio/styles.module.css +4 -5
- package/radio-group/styles.module.css +1 -1
- package/scss/_functions.scss +12 -24
- package/scss/_grid.scss +2 -2
- package/scss/_index.scss +1 -6
- package/scss/_interaction.scss +3 -3
- package/scss/_mixins.scss +5 -51
- package/scss/_tokens.generated.scss +578 -0
- package/scss/_tokens.scss +2 -396
- package/scss/_typography.scss +0 -1
- package/segmented-control/styles/segmented-control-item.module.css +9 -9
- package/segmented-control/styles/segmented-control.module.css +4 -4
- package/select/components/select-field-multiselect-value.d.ts +1 -0
- package/select/components/select-field-multiselect-value.js +2 -2
- package/select/components/select-field.d.ts +3 -1
- package/select/components/select-field.js +8 -6
- package/select/hooks/use-select-view-model.d.ts +3 -1
- package/select/hooks/use-select-view-model.js +3 -1
- package/select/select.d.ts +2 -1
- package/select/styles/select-field.module.css +20 -1
- package/select/styles/select.module.css +2 -2
- package/select/types.d.ts +3 -1
- package/select/views/select-view.js +2 -2
- package/select/views/styles.module.css +1 -1
- package/snackbar/styles/snack.module.css +1 -1
- package/switch/styles/base.module.css +2 -2
- package/tabs/styles/tab-list.module.css +1 -1
- package/tabs/styles/tab.module.css +6 -6
- package/textarea/styles.module.css +1 -1
- package/theme-provider/styles.module.css +6 -6
- package/time-picker/styles.module.css +9 -9
- package/tree/styles.module.css +5 -5
- package/tree/tree-select.module.css +2 -2
package/scss/_tokens.scss
CHANGED
|
@@ -1,396 +1,2 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
$colors: (
|
|
5
|
-
'text-primary': #21282B,
|
|
6
|
-
'text-secondary': #5A5E60,
|
|
7
|
-
'text-minor': #666B6E,
|
|
8
|
-
'text-invert': #FFFFFF,
|
|
9
|
-
'text-invert-secondary': #FFFFFFBF,
|
|
10
|
-
'text-invert-minor': #FFFFFF80,
|
|
11
|
-
'text-on-accent': #21282B,
|
|
12
|
-
'background-primary': #FFFFFF,
|
|
13
|
-
'background-secondary': #F5F4F1,
|
|
14
|
-
'background-elevated': #FFFFFF,
|
|
15
|
-
'background-accent': #21282B,
|
|
16
|
-
'background-invert-secondary': #FFFFFF1A,
|
|
17
|
-
'background-scrim': #000000,
|
|
18
|
-
'control-primary': #21282B,
|
|
19
|
-
'control-secondary': #817D72,
|
|
20
|
-
'control-minor': #E3E1D8,
|
|
21
|
-
'control-accent': #FDC300,
|
|
22
|
-
'control-invert': #FFFFFF,
|
|
23
|
-
'control-invert-secondary': #FFFFFF80,
|
|
24
|
-
'control-invert-minor': #FFFFFF40,
|
|
25
|
-
'control-hover-primary': #000000,
|
|
26
|
-
'control-hover-secondary': #6F6A60,
|
|
27
|
-
'control-hover-minor': #CCC6B8,
|
|
28
|
-
'control-hover-accent': #E79F26,
|
|
29
|
-
'control-hover-invert': #FFFFFFBF,
|
|
30
|
-
'control-hover-invert-secondary': #FFFFFF99,
|
|
31
|
-
'control-hover-invert-minor': #FFFFFF80,
|
|
32
|
-
'success-primary': #007F46,
|
|
33
|
-
'success-dark': #006836,
|
|
34
|
-
'success-light': #BEF4DC,
|
|
35
|
-
'attention-primary': #BC3044,
|
|
36
|
-
'attention-dark': #98273A,
|
|
37
|
-
'attention-light': #FFE1E4,
|
|
38
|
-
'brand-primary': #FDC300,
|
|
39
|
-
'brand-dark': #BD7229,
|
|
40
|
-
'brand-light': #FBE2A2,
|
|
41
|
-
'accent-primary': #FFE55A,
|
|
42
|
-
'accent-dark': #B09D37,
|
|
43
|
-
'accent-light': #F9EFBD,
|
|
44
|
-
'service-primary': #60A3BD,
|
|
45
|
-
'service-dark': #0D5263,
|
|
46
|
-
'service-light': #C2E5F4,
|
|
47
|
-
'b2b-primary': #AE6849,
|
|
48
|
-
'b2b-dark': #913300,
|
|
49
|
-
'b2b-light': #E5CDC3,
|
|
50
|
-
'palette-green-primary': #A0B9B1,
|
|
51
|
-
'palette-green-dark': #426B61,
|
|
52
|
-
'palette-green-light': #D5ECE3,
|
|
53
|
-
'palette-blue-primary': #1563C5,
|
|
54
|
-
'palette-blue-dark': #294877,
|
|
55
|
-
'palette-blue-light': #D5E8FF,
|
|
56
|
-
'palette-orange-primary': #B24D00,
|
|
57
|
-
'palette-orange-dark': #944000,
|
|
58
|
-
'palette-orange-light': #F7DECC,
|
|
59
|
-
'palette-purple-primary': #992D7A,
|
|
60
|
-
'palette-purple-dark': #740354,
|
|
61
|
-
'palette-purple-light': #EDDEEA,
|
|
62
|
-
'palette-red-primary': #CE0019,
|
|
63
|
-
'palette-red-dark': #8C030C,
|
|
64
|
-
'palette-red-light': #FFD7D4,
|
|
65
|
-
'palette-black': #000000,
|
|
66
|
-
'palette-white': #FFFFFF
|
|
67
|
-
);
|
|
68
|
-
|
|
69
|
-
// Тёмная схема: только изменённые цвета
|
|
70
|
-
$colors-dark: (
|
|
71
|
-
'text-primary': #F5F4F1,
|
|
72
|
-
'text-secondary': #C3C5C6,
|
|
73
|
-
'text-minor': #A0A6AA,
|
|
74
|
-
'text-invert': #21282B,
|
|
75
|
-
'text-invert-secondary': #21282BBF,
|
|
76
|
-
'text-invert-minor': #21282BAD,
|
|
77
|
-
'background-primary': #171C1F,
|
|
78
|
-
'background-secondary': #21282B,
|
|
79
|
-
'background-elevated': #262E32,
|
|
80
|
-
'background-accent': #F5F4F1,
|
|
81
|
-
'background-invert-secondary': #21282B1A,
|
|
82
|
-
'background-scrim': #000000,
|
|
83
|
-
'control-primary': #F5F4F1,
|
|
84
|
-
'control-secondary': #7C878D,
|
|
85
|
-
'control-minor': #364045,
|
|
86
|
-
'control-accent': #FDC300,
|
|
87
|
-
'control-invert': #21282B,
|
|
88
|
-
'control-invert-secondary': #21282B80,
|
|
89
|
-
'control-invert-minor': #21282B40,
|
|
90
|
-
'control-hover-primary': #FFFFFF,
|
|
91
|
-
'control-hover-secondary': #8A9498,
|
|
92
|
-
'control-hover-minor': #475258,
|
|
93
|
-
'control-hover-accent': #E79F26,
|
|
94
|
-
'control-hover-invert': #21282BBF,
|
|
95
|
-
'control-hover-invert-secondary': #21282B99,
|
|
96
|
-
'control-hover-invert-minor': #21282B80,
|
|
97
|
-
'success-primary': #35C27F,
|
|
98
|
-
'success-dark': #5FD9A0,
|
|
99
|
-
'success-light': #0F3A27,
|
|
100
|
-
'attention-primary': #F26D7D,
|
|
101
|
-
'attention-dark': #FF9AA4,
|
|
102
|
-
'attention-light': #43202A,
|
|
103
|
-
'brand-dark': #FFD84D,
|
|
104
|
-
'brand-light': #3D3012,
|
|
105
|
-
'accent-dark': #FFF08A,
|
|
106
|
-
'accent-light': #3D3714,
|
|
107
|
-
'service-primary': #7FC1DC,
|
|
108
|
-
'service-dark': #A6D8EC,
|
|
109
|
-
'service-light': #17333F,
|
|
110
|
-
'b2b-primary': #D08A6A,
|
|
111
|
-
'b2b-dark': #E5A98E,
|
|
112
|
-
'b2b-light': #3D2A22,
|
|
113
|
-
'palette-green-dark': #B5D1C6,
|
|
114
|
-
'palette-green-light': #1D3A31,
|
|
115
|
-
'palette-blue-primary': #6AA7FF,
|
|
116
|
-
'palette-blue-dark': #9CC3FF,
|
|
117
|
-
'palette-blue-light': #172C47,
|
|
118
|
-
'palette-orange-primary': #FF9A4D,
|
|
119
|
-
'palette-orange-dark': #FFB680,
|
|
120
|
-
'palette-orange-light': #40260F,
|
|
121
|
-
'palette-purple-primary': #D36CB5,
|
|
122
|
-
'palette-purple-dark': #E594CB,
|
|
123
|
-
'palette-purple-light': #3A1B33,
|
|
124
|
-
'palette-red-primary': #FF6B7A,
|
|
125
|
-
'palette-red-dark': #FF9AA4,
|
|
126
|
-
'palette-red-light': #46201E
|
|
127
|
-
);
|
|
128
|
-
|
|
129
|
-
$spacings: (
|
|
130
|
-
2: 2px,
|
|
131
|
-
4: 4px,
|
|
132
|
-
8: 8px,
|
|
133
|
-
12: 12px,
|
|
134
|
-
16: 16px,
|
|
135
|
-
20: 20px,
|
|
136
|
-
24: 24px,
|
|
137
|
-
32: 32px,
|
|
138
|
-
40: 40px,
|
|
139
|
-
48: 48px,
|
|
140
|
-
64: 64px,
|
|
141
|
-
80: 80px
|
|
142
|
-
);
|
|
143
|
-
|
|
144
|
-
$roundings: (
|
|
145
|
-
's': 2px,
|
|
146
|
-
'm': 4px,
|
|
147
|
-
'l': 8px,
|
|
148
|
-
'xl': 16px,
|
|
149
|
-
'circular': 100vmin
|
|
150
|
-
);
|
|
151
|
-
|
|
152
|
-
$shadows: (
|
|
153
|
-
's': (0 1px 4px rgba(0, 0, 0, 0.16), 0 2px 9px rgba(0, 0, 0, 0.02)),
|
|
154
|
-
'm': (0 1.17px 2px rgba(0, 0, 0, 0.0196802), 0 1.4px 5px rgba(0, 0, 0, 0.03), 0 2px 10px rgba(0, 0, 0, 0.03), 0 2px 18px rgba(0, 0, 0, 0.04), 0 9px 33px rgba(0, 0, 0, 0.03)),
|
|
155
|
-
'l': (0 0.166035px 2.21381px rgba(0, 0, 0, 0.0196802), 0 0.399006px 5.32008px rgba(0, 0, 0, 0.0282725), 0 0.751293px 10.0172px rgba(0, 0, 0, 0.035), 0 12px 40px rgba(0, 0, 0, 0.08)),
|
|
156
|
-
's-up': (0 -1px 4px rgba(0, 0, 0, 0.16), 0 -2px 9px rgba(0, 0, 0, 0.02)),
|
|
157
|
-
'm-up': (0 -1.17px 2px rgba(0, 0, 0, 0.0196802), 0 -1.4px 5px rgba(0, 0, 0, 0.03), 0 -2px 10px rgba(0, 0, 0, 0.03), 0 -2px 18px rgba(0, 0, 0, 0.04), 0 -9px 33px rgba(0, 0, 0, 0.03)),
|
|
158
|
-
'l-up': (0 -0.166035px 2.21381px rgba(0, 0, 0, 0.0196802), 0 -0.399006px 5.32008px rgba(0, 0, 0, 0.0282725), 0 -0.751293px 10.0172px rgba(0, 0, 0, 0.035), 0 -12px 40px rgba(0, 0, 0, 0.08))
|
|
159
|
-
);
|
|
160
|
-
|
|
161
|
-
// Тени тёмной схемы
|
|
162
|
-
$shadows-dark: (
|
|
163
|
-
's': (0 0 0 1px rgba(255, 255, 255, 0.08), 0 1px 4px rgba(0, 0, 0, 0.5)),
|
|
164
|
-
'm': (0 0 0 1px rgba(255, 255, 255, 0.08), 0 2px 6px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.45)),
|
|
165
|
-
'l': (0 0 0 1px rgba(255, 255, 255, 0.1), 0 4px 12px rgba(0, 0, 0, 0.5), 0 16px 48px rgba(0, 0, 0, 0.6)),
|
|
166
|
-
's-up': (0 0 0 1px rgba(255, 255, 255, 0.08), 0 -1px 4px rgba(0, 0, 0, 0.5)),
|
|
167
|
-
'm-up': (0 0 0 1px rgba(255, 255, 255, 0.08), 0 -2px 6px rgba(0, 0, 0, 0.4), 0 -8px 24px rgba(0, 0, 0, 0.45)),
|
|
168
|
-
'l-up': (0 0 0 1px rgba(255, 255, 255, 0.1), 0 -4px 12px rgba(0, 0, 0, 0.5), 0 -16px 48px rgba(0, 0, 0, 0.6))
|
|
169
|
-
);
|
|
170
|
-
|
|
171
|
-
$opacities: (
|
|
172
|
-
40: 0.4,
|
|
173
|
-
60: 0.6,
|
|
174
|
-
80: 0.8
|
|
175
|
-
);
|
|
176
|
-
|
|
177
|
-
$control-heights: (
|
|
178
|
-
's': 32px,
|
|
179
|
-
'm': 40px,
|
|
180
|
-
'l': 48px
|
|
181
|
-
);
|
|
182
|
-
|
|
183
|
-
$target-sizes: (
|
|
184
|
-
'min': 24px,
|
|
185
|
-
'touch': 44px
|
|
186
|
-
);
|
|
187
|
-
|
|
188
|
-
$breakpoints: (
|
|
189
|
-
'xs': 320px,
|
|
190
|
-
'sm': 480px,
|
|
191
|
-
'md': 768px,
|
|
192
|
-
'lg': 1024px,
|
|
193
|
-
'xl': 1200px,
|
|
194
|
-
'2xl': 1280px,
|
|
195
|
-
'3xl': 1764px
|
|
196
|
-
);
|
|
197
|
-
|
|
198
|
-
$layers: (
|
|
199
|
-
'sticky': 100,
|
|
200
|
-
'drawer': 1000,
|
|
201
|
-
'modal': 1100,
|
|
202
|
-
'popover': 1200,
|
|
203
|
-
'tooltip': 1300,
|
|
204
|
-
'toast': 1400
|
|
205
|
-
);
|
|
206
|
-
|
|
207
|
-
$fonts: (
|
|
208
|
-
'base': (LTSans,Roboto, -apple-system, BlinkMacSystemFont, Segoe UI, Oxygen, Ubuntu, Cantarell, Open Sans, Helvetica Neue, sans-serif),
|
|
209
|
-
'title': (LTTitle, Roboto, -apple-system, BlinkMacSystemFont, Segoe UI, Oxygen, Ubuntu, Cantarell, Open Sans, Helvetica Neue, sans-serif)
|
|
210
|
-
);
|
|
211
|
-
|
|
212
|
-
$grids: (
|
|
213
|
-
'fixed': (
|
|
214
|
-
'xs': (gutter: 16, gap: 12, columns: 12, width: auto, align: center),
|
|
215
|
-
'md': (gutter: 54, gap: 12, columns: 12, width: 660, align: center),
|
|
216
|
-
'lg': (gutter: 42, gap: 20, columns: 12, width: 940, align: center),
|
|
217
|
-
'xl': (gutter: 10, gap: 20, columns: 12, width: 1180, align: center)
|
|
218
|
-
),
|
|
219
|
-
'fluid': (
|
|
220
|
-
'xs': (gutter: 32, gap: 32, columns: 1, width: auto, align: center),
|
|
221
|
-
'lg': (gutter: 32, gap: 32, columns: 4, width: auto, align: center),
|
|
222
|
-
'2xl': (gutter: 32, gap: 32, columns: 4, width: auto, align: start),
|
|
223
|
-
'3xl': (gutter: 32, gap: 32, columns: 12, width: auto, align: start)
|
|
224
|
-
)
|
|
225
|
-
);
|
|
226
|
-
|
|
227
|
-
$component-tokens: (
|
|
228
|
-
'button-radius': var(--rounding-m),
|
|
229
|
-
'button-primary-bg': var(--control-primary),
|
|
230
|
-
'button-primary-color': var(--text-invert),
|
|
231
|
-
'button-primary-hover-bg': var(--control-hover-primary),
|
|
232
|
-
'button-secondary-bg': var(--control-minor),
|
|
233
|
-
'button-secondary-hover-bg': var(--control-hover-minor),
|
|
234
|
-
'button-accent-bg': var(--control-accent),
|
|
235
|
-
'button-accent-color': var(--text-on-accent),
|
|
236
|
-
'button-accent-hover-bg': var(--control-hover-accent),
|
|
237
|
-
'button-danger-bg': var(--attention-primary),
|
|
238
|
-
'button-danger-hover-bg': var(--attention-dark),
|
|
239
|
-
'field-height-s': 32px,
|
|
240
|
-
'field-height-m': 40px,
|
|
241
|
-
'field-height-l': 48px,
|
|
242
|
-
'field-border-color': var(--control-secondary),
|
|
243
|
-
'field-radius': var(--rounding-m),
|
|
244
|
-
'tabs-color': var(--text-minor),
|
|
245
|
-
'tabs-active-color': var(--text-primary),
|
|
246
|
-
'tabs-accent': var(--control-accent),
|
|
247
|
-
'navigation-width': 264px,
|
|
248
|
-
'navigation-rail-width': calc(2 * var(--navigation-padding) + var(--navigation-icon-size) + 17px),
|
|
249
|
-
'navigation-item-height-s': var(--control-height-s),
|
|
250
|
-
'navigation-item-height-m': var(--control-height-m),
|
|
251
|
-
'navigation-item-height-l': var(--control-height-l),
|
|
252
|
-
'navigation-bg': var(--background-primary),
|
|
253
|
-
'navigation-color': var(--text-secondary),
|
|
254
|
-
'navigation-active-color': var(--text-primary),
|
|
255
|
-
'navigation-hover-bg': var(--background-secondary),
|
|
256
|
-
'navigation-selected-bg': var(--accent-light),
|
|
257
|
-
'navigation-accent': var(--control-accent),
|
|
258
|
-
'navigation-border-color': var(--background-secondary),
|
|
259
|
-
'navigation-radius': var(--rounding-m),
|
|
260
|
-
'checkbox-color': var(--control-primary),
|
|
261
|
-
'checkbox-hover-color': var(--control-hover-primary),
|
|
262
|
-
'checkbox-border-color': var(--control-secondary),
|
|
263
|
-
'checkbox-hover-border-color': var(--control-hover-secondary),
|
|
264
|
-
'checkbox-size-m': 20px,
|
|
265
|
-
'checkbox-size-l': 24px,
|
|
266
|
-
'radio-color': var(--control-primary),
|
|
267
|
-
'radio-border-color': var(--control-secondary),
|
|
268
|
-
'radio-hover-border-color': var(--control-hover-secondary),
|
|
269
|
-
'radio-size-m': 20px,
|
|
270
|
-
'radio-size-l': 24px,
|
|
271
|
-
'switch-track-color': var(--control-secondary),
|
|
272
|
-
'switch-hover-track-color': var(--control-hover-secondary),
|
|
273
|
-
'switch-thumb-color': var(--control-invert),
|
|
274
|
-
'switch-primary-color': var(--control-primary),
|
|
275
|
-
'switch-accent-color': var(--control-accent),
|
|
276
|
-
'chip-max-width': 280px,
|
|
277
|
-
'chip-delete-color': var(--control-primary),
|
|
278
|
-
'chip-delete-hover-color': var(--control-hover-primary),
|
|
279
|
-
'badge-primary-color': var(--attention-primary),
|
|
280
|
-
'badge-secondary-color': var(--background-accent),
|
|
281
|
-
'badge-info-color': var(--palette-blue-primary),
|
|
282
|
-
'badge-success-color': var(--success-primary),
|
|
283
|
-
'badge-warning-color': var(--palette-orange-primary),
|
|
284
|
-
'label-height': 24px,
|
|
285
|
-
'label-radius': var(--rounding-l),
|
|
286
|
-
'divider-thickness': 1px,
|
|
287
|
-
'divider-color': var(--control-minor),
|
|
288
|
-
'loader-color': var(--brand-primary),
|
|
289
|
-
'loader-secondary-color': var(--control-primary),
|
|
290
|
-
'loader-size-s': 20px,
|
|
291
|
-
'loader-size-m': 24px,
|
|
292
|
-
'loader-size-l': 40px,
|
|
293
|
-
'loader-size-xl': 80px,
|
|
294
|
-
'caption-color': var(--text-minor),
|
|
295
|
-
'caption-error-color': var(--attention-primary),
|
|
296
|
-
'caption-padding-x': 10px,
|
|
297
|
-
'card-padding': var(--space-16),
|
|
298
|
-
'card-radius': var(--rounding-l),
|
|
299
|
-
'card-background': var(--background-primary),
|
|
300
|
-
'card-color': var(--text-primary),
|
|
301
|
-
'alert-padding': 12px,
|
|
302
|
-
'alert-radius': var(--rounding-l),
|
|
303
|
-
'alert-background': var(--background-secondary),
|
|
304
|
-
'alert-neutral-background': var(--background-primary),
|
|
305
|
-
'alert-success-background': var(--success-light),
|
|
306
|
-
'alert-warning-background': var(--accent-light),
|
|
307
|
-
'alert-error-background': var(--attention-light),
|
|
308
|
-
'alert-info-background': var(--palette-blue-light),
|
|
309
|
-
'avatar-name-color': var(--text-primary),
|
|
310
|
-
'avatar-description-color': var(--text-secondary),
|
|
311
|
-
'avatar-picture-radius': var(--rounding-circular),
|
|
312
|
-
'progress-bar-color': var(--control-primary),
|
|
313
|
-
'progress-bar-track-color': var(--control-minor),
|
|
314
|
-
'progress-bar-radius': var(--rounding-m),
|
|
315
|
-
'progress-bar-height-s': 4px,
|
|
316
|
-
'progress-bar-height-m': 6px,
|
|
317
|
-
'progress-bar-height-l': 8px,
|
|
318
|
-
'skeleton-base-color': var(--control-secondary),
|
|
319
|
-
'skeleton-shine-color': var(--background-primary),
|
|
320
|
-
'skeleton-radius': var(--rounding-m),
|
|
321
|
-
'skeleton-duration': 1.5s,
|
|
322
|
-
'tooltip-color': var(--text-primary),
|
|
323
|
-
'tooltip-border-color': var(--control-secondary),
|
|
324
|
-
'tooltip-max-width': 51ch,
|
|
325
|
-
'tooltip-padding': 4px 8px,
|
|
326
|
-
'popover-background': var(--background-elevated),
|
|
327
|
-
'popover-radius-m': var(--rounding-m),
|
|
328
|
-
'popover-radius-l': var(--rounding-l),
|
|
329
|
-
'hint-padding': 16px,
|
|
330
|
-
'hint-radius': var(--rounding-l),
|
|
331
|
-
'hint-min-width': 240px,
|
|
332
|
-
'stepper-marker-size-m': 32px,
|
|
333
|
-
'stepper-marker-size-s': 24px,
|
|
334
|
-
'stepper-rail-width': 2px,
|
|
335
|
-
'stepper-gap': var(--space-8),
|
|
336
|
-
'drawer-duration-in': 320ms,
|
|
337
|
-
'drawer-duration-out': 220ms,
|
|
338
|
-
'drawer-scrim-opacity': 0.6,
|
|
339
|
-
'drawer-padding': 24px,
|
|
340
|
-
'drawer-size-xs': 360px,
|
|
341
|
-
'drawer-size-s': 480px,
|
|
342
|
-
'drawer-size-m': 680px,
|
|
343
|
-
'drawer-size-l': 1024px,
|
|
344
|
-
'modal-background': var(--background-elevated),
|
|
345
|
-
'modal-radius': var(--rounding-xl),
|
|
346
|
-
'modal-scrim-color': var(--background-scrim),
|
|
347
|
-
'breadcrumbs-color': var(--text-secondary),
|
|
348
|
-
'breadcrumbs-hover-color': var(--control-hover-primary),
|
|
349
|
-
'breadcrumbs-current-color': var(--text-primary),
|
|
350
|
-
'breadcrumbs-separator-color': var(--text-minor),
|
|
351
|
-
'pagination-gap': 8px,
|
|
352
|
-
'pagination-color': var(--text-secondary),
|
|
353
|
-
'pagination-ellipsis-color': var(--text-minor),
|
|
354
|
-
'pagination-current-border-color': var(--control-primary),
|
|
355
|
-
'pagination-button-min-width': 40px,
|
|
356
|
-
'segmented-control-radius': var(--rounding-m),
|
|
357
|
-
'segmented-control-fade-width': 24px,
|
|
358
|
-
'list-padding-block': 8px,
|
|
359
|
-
'list-item-hover-color': var(--background-secondary),
|
|
360
|
-
'list-item-pressed-color': var(--control-minor),
|
|
361
|
-
'list-item-description-color': var(--text-minor),
|
|
362
|
-
'dropdown-menu-padding': 8px,
|
|
363
|
-
'dropdown-menu-max-height': 40vh,
|
|
364
|
-
'snack-padding': var(--space-12),
|
|
365
|
-
'snack-radius': var(--rounding-l),
|
|
366
|
-
'snack-progress-height': 3px,
|
|
367
|
-
'snackbar-width': 344px,
|
|
368
|
-
'pin-input-cell-radius': var(--rounding-s),
|
|
369
|
-
'pin-input-cell-font-size': 20px,
|
|
370
|
-
'pin-input-cell-border-color': var(--control-secondary),
|
|
371
|
-
'quantity-input-gap': 8px,
|
|
372
|
-
'calendar-cell-width': 38px,
|
|
373
|
-
'calendar-day-size': 32px,
|
|
374
|
-
'calendar-range-color': var(--brand-light),
|
|
375
|
-
'image-placeholder-color': var(--background-secondary),
|
|
376
|
-
'image-error-min-size': 100px,
|
|
377
|
-
'file-background': var(--background-primary),
|
|
378
|
-
'file-border-color': var(--control-secondary),
|
|
379
|
-
'file-error-border-color': var(--attention-primary),
|
|
380
|
-
'file-upload-gap': var(--space-8),
|
|
381
|
-
'file-upload-drop-zone-gap': var(--space-4),
|
|
382
|
-
'tree-indent': 28px,
|
|
383
|
-
'tree-gap': 8px,
|
|
384
|
-
'tree-radius': var(--rounding-l),
|
|
385
|
-
'tree-hover-color': var(--background-secondary),
|
|
386
|
-
'tree-selected-color': var(--accent-light),
|
|
387
|
-
'accordion-gap': var(--space-8),
|
|
388
|
-
'accordion-content-offset': 0px,
|
|
389
|
-
'accordion-border-color': var(--control-minor),
|
|
390
|
-
'accordion-radius': var(--rounding-l),
|
|
391
|
-
'accordion-control-highlight': var(--control-minor),
|
|
392
|
-
'accordion-control-radius': var(--rounding-m),
|
|
393
|
-
'accordion-duration': 0.25s,
|
|
394
|
-
'accordion-easing': cubic-bezier(0.4, 0, 0.2, 1),
|
|
395
|
-
'show-more-easing': cubic-bezier(0.4, 0, 0.2, 1)
|
|
396
|
-
);
|
|
1
|
+
// Общие токены; значения не дублируются в исходниках UIKit.
|
|
2
|
+
@forward './tokens.generated';
|
package/scss/_typography.scss
CHANGED
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
align-items: center;
|
|
45
45
|
justify-content: center;
|
|
46
46
|
padding: var(--item-padding, 0);
|
|
47
|
-
margin:
|
|
47
|
+
margin: var(--space-4);
|
|
48
48
|
font-family: inherit;
|
|
49
49
|
font-size: 1rem;
|
|
50
50
|
font-weight: 600;
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
}
|
|
83
83
|
.segmentedControlItem.extraClickZone::before {
|
|
84
84
|
position: absolute;
|
|
85
|
-
inset:
|
|
85
|
+
inset: -8px -8px;
|
|
86
86
|
content: "";
|
|
87
87
|
}
|
|
88
88
|
.segmentedControlItem.splitted {
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
font-weight: 400;
|
|
124
124
|
line-height: 1.3333333333;
|
|
125
125
|
letter-spacing: 0.2px;
|
|
126
|
-
--item-padding: 5px
|
|
126
|
+
--item-padding: 5px var(--space-12);
|
|
127
127
|
--item-square: var(--control-height-s);
|
|
128
128
|
}
|
|
129
129
|
.segmentedControlItem.m {
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
font-weight: 400;
|
|
132
132
|
line-height: 1.3333333333;
|
|
133
133
|
letter-spacing: 0.2px;
|
|
134
|
-
--item-padding: 9px
|
|
134
|
+
--item-padding: 9px var(--space-20);
|
|
135
135
|
--item-square: var(--control-height-m);
|
|
136
136
|
}
|
|
137
137
|
.segmentedControlItem.l {
|
|
@@ -139,11 +139,11 @@
|
|
|
139
139
|
font-weight: 400;
|
|
140
140
|
line-height: 1.4117647059;
|
|
141
141
|
letter-spacing: 0.2px;
|
|
142
|
-
--item-padding: 11px
|
|
142
|
+
--item-padding: 11px var(--space-24);
|
|
143
143
|
--item-square: var(--control-height-l);
|
|
144
144
|
}
|
|
145
145
|
.segmentedControlItem.composite {
|
|
146
|
-
--item-padding:
|
|
146
|
+
--item-padding: var(--space-16);
|
|
147
147
|
--button-border-radius: var(--rounding-l);
|
|
148
148
|
}
|
|
149
149
|
.segmentedControlItem.composite .contentWrap {
|
|
@@ -167,14 +167,14 @@
|
|
|
167
167
|
line-height: 0;
|
|
168
168
|
}
|
|
169
169
|
.segmentedControlItem .iconLeft {
|
|
170
|
-
margin-inline-end:
|
|
170
|
+
margin-inline-end: var(--space-4);
|
|
171
171
|
}
|
|
172
172
|
.segmentedControlItem .iconRight {
|
|
173
|
-
margin-inline-start:
|
|
173
|
+
margin-inline-start: var(--space-4);
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
.extraCheck {
|
|
177
|
-
margin-inline-end:
|
|
177
|
+
margin-inline-end: var(--space-8);
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
.extraCheckItem {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
.segmentedControl {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-wrap: wrap;
|
|
4
|
-
margin: -
|
|
4
|
+
margin: calc(-1 * var(--space-4));
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
.scrollable {
|
|
8
8
|
--segmented-control-fade: var(--lt-ui-segmented-control-fade-width, 24px);
|
|
9
9
|
flex-wrap: nowrap;
|
|
10
|
-
padding:
|
|
11
|
-
margin: -
|
|
10
|
+
padding: var(--space-4);
|
|
11
|
+
margin: calc(-1 * var(--space-4));
|
|
12
12
|
overflow-x: auto;
|
|
13
13
|
overscroll-behavior-x: contain;
|
|
14
|
-
scroll-padding-inline:
|
|
14
|
+
scroll-padding-inline: var(--space-4);
|
|
15
15
|
scrollbar-width: none;
|
|
16
16
|
}
|
|
17
17
|
.scrollable::-webkit-scrollbar {
|
|
@@ -12,6 +12,7 @@ export type SelectFieldMultiselectValueProps = {
|
|
|
12
12
|
listboxId?: string;
|
|
13
13
|
/** `id` подписи поля: по ней скринридер называет комбобокс (`div` не связывается с `<label for>`) */
|
|
14
14
|
labelledBy?: string;
|
|
15
|
+
ariaLabel?: string;
|
|
15
16
|
/** Активный вариант списка для скринридера (`aria-activedescendant`) */
|
|
16
17
|
activeDescendantId?: string;
|
|
17
18
|
onClick?: () => void;
|
|
@@ -6,10 +6,10 @@ import { withRef } from '../../_internal/compat';
|
|
|
6
6
|
import { Typography } from '../../typography';
|
|
7
7
|
import { useMultiselectCollapsedDisplay } from '../hooks/use-multiselect-collapsed-display';
|
|
8
8
|
import fieldStyles from '../styles/select-field.module.css';
|
|
9
|
-
export const SelectFieldMultiselectValue = withRef(function SelectFieldMultiselectValue({ labels, size = 'l', overflowSelectedLabel, className, id, open = false, disabled, listboxId, labelledBy, activeDescendantId, onClick, onKeyDown, onFocus, onBlur, }, ref) {
|
|
9
|
+
export const SelectFieldMultiselectValue = withRef(function SelectFieldMultiselectValue({ labels, size = 'l', overflowSelectedLabel, className, id, open = false, disabled, listboxId, labelledBy, ariaLabel, activeDescendantId, onClick, onKeyDown, onFocus, onBlur, }, ref) {
|
|
10
10
|
const rowRef = useRef(null);
|
|
11
11
|
const { visibleText, hiddenCount, overflowLabel, setMeasureTarget, setSuffixMeasureTarget } = useMultiselectCollapsedDisplay(labels, rowRef, overflowSelectedLabel);
|
|
12
|
-
return (_jsx("div", { ref: ref, id: id, role: "combobox", tabIndex: disabled ? undefined : 0, "aria-expanded": open, "aria-haspopup": "listbox", "aria-controls": listboxId, "aria-labelledby": labelledBy, "aria-activedescendant": open && activeDescendantId ? activeDescendantId : undefined, "aria-disabled": disabled || undefined, className: clsx(className, fieldStyles.multiselectValueOuter, {
|
|
12
|
+
return (_jsx("div", { ref: ref, id: id, role: "combobox", tabIndex: disabled ? undefined : 0, "aria-expanded": open, "aria-haspopup": "listbox", "aria-controls": listboxId, "aria-labelledby": labelledBy, "aria-label": ariaLabel, "aria-activedescendant": open && activeDescendantId ? activeDescendantId : undefined, "aria-disabled": disabled || undefined, className: clsx(className, fieldStyles.multiselectValueOuter, {
|
|
13
13
|
[fieldStyles.selectValueDisabled]: disabled,
|
|
14
14
|
}), onClick: onClick, onKeyDown: onKeyDown, onFocus: onFocus, onBlur: onBlur, children: _jsxs("div", { ref: rowRef, className: fieldStyles.multiselectValue, children: [_jsxs(Typography, { ref: setMeasureTarget, as: "span", variant: size === 'l' ? 'body-m' : 'body-s', className: clsx(fieldStyles.multiselectValueText, {
|
|
15
15
|
[fieldStyles.multiselectValueTextEllipsis]: hiddenCount === 0,
|
|
@@ -4,6 +4,8 @@ import type { FieldStatus } from '../../status';
|
|
|
4
4
|
export type SelectFieldSize = 's' | 'm' | 'l';
|
|
5
5
|
export type SelectFieldProps = {
|
|
6
6
|
label?: string;
|
|
7
|
+
'aria-label'?: string;
|
|
8
|
+
startAdornment?: React.ReactNode;
|
|
7
9
|
placeholder?: string;
|
|
8
10
|
displayValue?: string;
|
|
9
11
|
mode?: 'single' | 'multiple';
|
|
@@ -17,7 +19,7 @@ export type SelectFieldProps = {
|
|
|
17
19
|
filled?: boolean;
|
|
18
20
|
size?: SelectFieldSize;
|
|
19
21
|
/** Вид поля: рамка или подчёркивание (как `variant` у `Input`) */
|
|
20
|
-
variant?: 'outline' | 'underline';
|
|
22
|
+
variant?: 'outline' | 'underline' | 'trigger';
|
|
21
23
|
fullWidth?: boolean;
|
|
22
24
|
allowClear?: boolean;
|
|
23
25
|
onClear?: (event: React.MouseEvent) => void;
|
|
@@ -47,7 +47,7 @@ function useRestoreFocusAfterClose(open, focused, comboboxRef, inputRef) {
|
|
|
47
47
|
return () => cancelAnimationFrame(frame);
|
|
48
48
|
}, [open, comboboxRef, inputRef]);
|
|
49
49
|
}
|
|
50
|
-
export const SelectField = withRef(function SelectField({ label, placeholder, displayValue, mode = 'single', multiselectLabels = [], chipsVariant = 'none', open, disabled, status, theme, filled, size = 'l', variant = 'outline', fullWidth, allowClear, onClear, showSearch, searchValue = '', selectedValueText, onSearchChange, onOpen, onToggle, overflowSelectedLabel, caption, className, controlRef, activeDescendantId, onComboboxKeyDown, 'data-testid': testId = 'select-field', listboxId, }, ref) {
|
|
50
|
+
export const SelectField = withRef(function SelectField({ label, 'aria-label': ariaLabel, startAdornment, placeholder, displayValue, mode = 'single', multiselectLabels = [], chipsVariant = 'none', open, disabled, status, theme, filled, size = 'l', variant = 'outline', fullWidth, allowClear, onClear, showSearch, searchValue = '', selectedValueText, onSearchChange, onOpen, onToggle, overflowSelectedLabel, caption, className, controlRef, activeDescendantId, onComboboxKeyDown, 'data-testid': testId = 'select-field', listboxId, }, ref) {
|
|
51
51
|
const { t } = useLocale();
|
|
52
52
|
// По умолчанию свёрнутый multiselect подписывает скрытые значения: «ещё 2»
|
|
53
53
|
const defaultOverflowLabel = useCallback((hiddenCount) => t('select.moreSelected', { count: hiddenCount }), [t]);
|
|
@@ -83,6 +83,7 @@ export const SelectField = withRef(function SelectField({ label, placeholder, di
|
|
|
83
83
|
const openPlaceholderOverride = selectedValueText !== null && selectedValueText !== void 0 ? selectedValueText : multiselectPlaceholderText;
|
|
84
84
|
const mergedSearchInputRef = useMemo(() => mergeRefs([mergedControlRef, setMultiselectPlaceholderMeasureTarget]), [mergedControlRef, setMultiselectPlaceholderMeasureTarget]);
|
|
85
85
|
const comboboxA11yProps = {
|
|
86
|
+
'aria-label': ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : (variant === 'trigger' ? label : undefined),
|
|
86
87
|
'aria-activedescendant': open && activeDescendantId ? activeDescendantId : undefined,
|
|
87
88
|
'aria-disabled': disabled || undefined,
|
|
88
89
|
};
|
|
@@ -152,14 +153,15 @@ export const SelectField = withRef(function SelectField({ label, placeholder, di
|
|
|
152
153
|
const inactiveValueText = getInactiveValueText({
|
|
153
154
|
hasDisplayValue,
|
|
154
155
|
fieldActive,
|
|
155
|
-
hasLabel: !!label,
|
|
156
|
+
hasLabel: !!label && variant !== 'trigger',
|
|
156
157
|
placeholder,
|
|
157
158
|
displayValue,
|
|
158
159
|
});
|
|
159
|
-
const showPlaceholderStyle = !hasDisplayValue && (fieldActive || !label);
|
|
160
|
-
const labelledBy = label ? `${fieldId}-label` : undefined;
|
|
160
|
+
const showPlaceholderStyle = !hasDisplayValue && (fieldActive || !label || variant === 'trigger');
|
|
161
|
+
const labelledBy = label && variant !== 'trigger' ? `${fieldId}-label` : undefined;
|
|
161
162
|
const multiselectValueProps = {
|
|
162
163
|
labelledBy,
|
|
164
|
+
ariaLabel: ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : (variant === 'trigger' ? label : undefined),
|
|
163
165
|
labels: multiselectLabels,
|
|
164
166
|
size,
|
|
165
167
|
overflowSelectedLabel: overflowLabel,
|
|
@@ -175,6 +177,6 @@ export const SelectField = withRef(function SelectField({ label, placeholder, di
|
|
|
175
177
|
onBlur: onInputBlur,
|
|
176
178
|
ref: mergedComboboxRef,
|
|
177
179
|
};
|
|
178
|
-
const valueContent = (_jsx(SelectFieldValue, { fieldId: fieldId, testId: testId, mode: mode, showSearch: showSearch, open: open, disabled: disabled, listboxId: listboxId, labelledBy: labelledBy, valueClassName: valueClassName, showPlaceholderStyle: showPlaceholderStyle, hasLabel: Boolean(label), hasDisplayValue: hasDisplayValue, displayValue: displayValue, inactiveValueText: inactiveValueText, searchValue: searchValue, placeholder: placeholder, openPlaceholderOverride: openPlaceholderOverride, collapsedMultiselect: showSearch ? showMultiselectCollapsedValue : showMultiselectCollapsedValueNonSearch, multiselectValueProps: multiselectValueProps, searchInputRef: mergedSearchInputRef, comboboxRef: mergedComboboxRef, comboboxA11yProps: comboboxA11yProps, onSearchChange: onSearchChange, onOpen: onOpen, onFieldClick: onFieldClick, onFieldKeyDown: onFieldKeyDown, onInputFocus: onInputFocus, onInputBlur: onInputBlur, onSearchInputMouseDown: onSearchInputMouseDown }));
|
|
179
|
-
return (_jsx(FieldFrame, { ref: ref, size: size, label: label, controlId: fieldId, active: fieldActive, focused: focused || open, status: status, theme: theme, disabled: disabled, underline: variant === 'underline', fullWidth: fullWidth, withClear: showClear, caption: caption, className: clsx(fieldStyles.selectRoot, classNames.root, className), clear: showClear ? (_jsx(FieldClearButton, { size: size, disabled: disabled, label: t('select.clearValue'), onClear: onClearClick, className: classNames.clear })) : undefined, endAdornment: _jsx("button", { type: "button", tabIndex: -1, className: clsx(fieldStyles.arrowButton, disabled && fieldStyles.arrowButtonDisabled, classNames.arrow), disabled: disabled, "aria-disabled": disabled, "aria-label": open ? t('select.close') : t('select.open'), onMouseDown: onAdornmentMouseDown, onClick: onArrowClick, children: _jsx(Icon, { size: size === 's' ? 16 : 20, color: disabled ? 'text-minor' : 'text-primary', children: _jsx(ArrowIcon, { direction: open ? 'top' : 'bottom' }) }) }), children: valueContent }));
|
|
180
|
+
const valueContent = (_jsx(SelectFieldValue, { fieldId: fieldId, testId: testId, mode: mode, showSearch: showSearch, open: open, disabled: disabled, listboxId: listboxId, labelledBy: labelledBy, valueClassName: valueClassName, showPlaceholderStyle: showPlaceholderStyle, hasLabel: Boolean(label) && variant !== 'trigger', hasDisplayValue: hasDisplayValue, displayValue: displayValue, inactiveValueText: inactiveValueText, searchValue: searchValue, placeholder: placeholder, openPlaceholderOverride: openPlaceholderOverride, collapsedMultiselect: showSearch ? showMultiselectCollapsedValue : showMultiselectCollapsedValueNonSearch, multiselectValueProps: multiselectValueProps, searchInputRef: mergedSearchInputRef, comboboxRef: mergedComboboxRef, comboboxA11yProps: comboboxA11yProps, onSearchChange: onSearchChange, onOpen: onOpen, onFieldClick: onFieldClick, onFieldKeyDown: onFieldKeyDown, onInputFocus: onInputFocus, onInputBlur: onInputBlur, onSearchInputMouseDown: onSearchInputMouseDown }));
|
|
181
|
+
return (_jsx(FieldFrame, { ref: ref, size: size, label: variant === 'trigger' ? undefined : label, startAdornment: startAdornment, controlId: fieldId, active: fieldActive, focused: focused || open, status: status, theme: theme, disabled: disabled, underline: variant === 'underline', fullWidth: fullWidth, withClear: showClear, caption: caption, className: clsx(fieldStyles.selectRoot, variant === 'trigger' && fieldStyles.trigger, classNames.root, className), clear: showClear ? (_jsx(FieldClearButton, { size: size, disabled: disabled, label: t('select.clearValue'), onClear: onClearClick, className: classNames.clear })) : undefined, endAdornment: _jsx("button", { type: "button", tabIndex: -1, className: clsx(fieldStyles.arrowButton, disabled && fieldStyles.arrowButtonDisabled, classNames.arrow), disabled: disabled, "aria-disabled": disabled, "aria-label": open ? t('select.close') : t('select.open'), onMouseDown: onAdornmentMouseDown, onClick: onArrowClick, children: _jsx(Icon, { size: size === 's' ? 16 : 20, color: disabled ? 'text-minor' : 'text-primary', children: _jsx(ArrowIcon, { direction: open ? 'top' : 'bottom' }) }) }), children: valueContent }));
|
|
180
182
|
});
|
|
@@ -5,9 +5,11 @@ export type SelectViewModel = ReturnType<typeof useSelectViewModel>;
|
|
|
5
5
|
export declare function useSelectViewModel(props: SelectProps, ref: React.Ref<SelectHandle>): {
|
|
6
6
|
readonly testId: string;
|
|
7
7
|
readonly dataProps: import("../..").DataAttributes;
|
|
8
|
+
readonly ariaLabel: any;
|
|
8
9
|
readonly select: import("..").UseSelectReturn<string | number>;
|
|
9
10
|
readonly isMultiple: boolean;
|
|
10
11
|
readonly label: string | undefined;
|
|
12
|
+
readonly startAdornment: import("react").ReactNode;
|
|
11
13
|
readonly status: import("../..").FieldStatus | undefined;
|
|
12
14
|
readonly theme: import("../..").ThemeSetting | undefined;
|
|
13
15
|
readonly caption: import("react").ReactNode;
|
|
@@ -25,7 +27,7 @@ export declare function useSelectViewModel(props: SelectProps, ref: React.Ref<Se
|
|
|
25
27
|
readonly container: import("../..").PortalContainer | undefined;
|
|
26
28
|
readonly children: import("react").ReactNode;
|
|
27
29
|
readonly presentation: import("../../_internal/picker").PickerPresentation;
|
|
28
|
-
readonly variant: "underline" | "outline";
|
|
30
|
+
readonly variant: "underline" | "outline" | "trigger";
|
|
29
31
|
readonly listSize: "m" | "l";
|
|
30
32
|
readonly onOpen: () => void;
|
|
31
33
|
readonly onToggle: () => void;
|
|
@@ -8,7 +8,7 @@ import { normalizeSelectedValues } from '../utils/normalize-value';
|
|
|
8
8
|
import { useSelect } from './use-select';
|
|
9
9
|
import { useSelectMultiselectPanelState } from './use-select-multiselect-panel-state';
|
|
10
10
|
export function useSelectViewModel(props, ref) {
|
|
11
|
-
const { value, defaultValue, onUpdate, mode, options, showSearch, strict, filterOption, disabled, open, defaultOpen, onOpenChange, allowClear: allowClearProp, placeholder, searchValue, onSearch, searchDelay, closeOnSelect, clearSearchOnSelect, loading, fetching, minCharsToSearch, notFoundContent, minCharsContent, loadingContent, onListScroll: onListScrollProp, hasMore = false, onLoadMore, chipsVariant = 'none', defaultChipsExpanded = false, chipsExpandedMode = 'auto', showPanelHeader: showPanelHeaderProp, hideHeaderOnSearch = false, emptySelectionLabel, selectedCountLabel, overflowSelectedLabel, collapseLabel, clearLabel, dropdownMaxHeight, virtualized, multiselectChipsMaxRows, label, status, theme, caption, mobile, variant: variantProp, fullWidth, className, size: sizeProp, popoverClassName, dropdownWidth = 'field', placement = 'bottom-start', container, children, 'data-testid': testId = 'select', } = props;
|
|
11
|
+
const { value, defaultValue, onUpdate, mode, options, showSearch, strict, filterOption, disabled, open, defaultOpen, onOpenChange, allowClear: allowClearProp, placeholder, searchValue, onSearch, searchDelay, closeOnSelect, clearSearchOnSelect, loading, fetching, minCharsToSearch, notFoundContent, minCharsContent, loadingContent, onListScroll: onListScrollProp, hasMore = false, onLoadMore, chipsVariant = 'none', defaultChipsExpanded = false, chipsExpandedMode = 'auto', showPanelHeader: showPanelHeaderProp, hideHeaderOnSearch = false, emptySelectionLabel, selectedCountLabel, overflowSelectedLabel, collapseLabel, clearLabel, dropdownMaxHeight, virtualized, multiselectChipsMaxRows, label, startAdornment, status, theme, caption, mobile, variant: variantProp, fullWidth, className, size: sizeProp, popoverClassName, dropdownWidth = 'field', placement = 'bottom-start', container, children, 'data-testid': testId = 'select', } = props;
|
|
12
12
|
// Подгрузка порциями: `onLoadMore` вызывается при прокрутке списка к концу, пока `hasMore` и не `fetching`
|
|
13
13
|
const loadMore = useLoadMore({
|
|
14
14
|
hasMore,
|
|
@@ -117,9 +117,11 @@ export function useSelectViewModel(props, ref) {
|
|
|
117
117
|
return {
|
|
118
118
|
testId,
|
|
119
119
|
dataProps: getDataAttributes(props),
|
|
120
|
+
ariaLabel: props['aria-label'],
|
|
120
121
|
select,
|
|
121
122
|
isMultiple,
|
|
122
123
|
label,
|
|
124
|
+
startAdornment,
|
|
123
125
|
status,
|
|
124
126
|
theme,
|
|
125
127
|
caption,
|
package/select/select.d.ts
CHANGED
|
@@ -10,7 +10,8 @@ export declare const Select: React.ForwardRefExoticComponent<import("..").DataAt
|
|
|
10
10
|
theme?: import("..").ThemeSetting;
|
|
11
11
|
caption?: React.ReactNode;
|
|
12
12
|
mobile?: import("../_internal/picker").PickerMobile;
|
|
13
|
-
variant?: "outline" | "underline";
|
|
13
|
+
variant?: "outline" | "underline" | "trigger";
|
|
14
|
+
startAdornment?: React.ReactNode;
|
|
14
15
|
fullWidth?: boolean;
|
|
15
16
|
className?: string;
|
|
16
17
|
id?: string;
|