@broxus/react-uikit 0.16.1 → 0.17.0
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/dist/cjs/components/ConfigProvider/index.d.ts +4 -0
- package/dist/cjs/components/Control/Select/index.d.ts +3 -2
- package/dist/cjs/components/Control/types.d.ts +1 -0
- package/dist/cjs/components/DatePicker/index.scss +107 -80
- package/dist/cjs/components/Drop/index.d.ts +2 -1
- package/dist/cjs/styles/mixins.scss +23 -0
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/components/ConfigProvider/index.d.ts +4 -0
- package/dist/esm/components/Control/Select/index.d.ts +3 -2
- package/dist/esm/components/Control/types.d.ts +1 -0
- package/dist/esm/components/DatePicker/index.scss +107 -80
- package/dist/esm/components/Drop/index.d.ts +2 -1
- package/dist/esm/styles/mixins.scss +23 -0
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type ButtonProps } from '../../components/Button';
|
|
3
|
+
import { type PickerLocale } from '../../components/DatePicker';
|
|
3
4
|
import { type ColorMode } from '../../components/Inverse';
|
|
5
|
+
import { type TimePickerLocale } from '../../components/TimePicker';
|
|
4
6
|
import { type BreakpointsConfig, type Direction, type TooltipOptions } from '../../types';
|
|
5
7
|
type PropsWithMouseHandler = {
|
|
6
8
|
onClick: React.HTMLAttributes<HTMLElement>['onClick'];
|
|
@@ -31,6 +33,7 @@ export type ConfigContextConsumedProps = {
|
|
|
31
33
|
};
|
|
32
34
|
datePicker?: {
|
|
33
35
|
direction?: Direction;
|
|
36
|
+
locale?: PickerLocale;
|
|
34
37
|
prefixCls?: string;
|
|
35
38
|
clearIcon?: React.ReactNode | (() => React.ReactElement);
|
|
36
39
|
nextIcon?: React.ReactNode;
|
|
@@ -71,6 +74,7 @@ export type ConfigContextConsumedProps = {
|
|
|
71
74
|
};
|
|
72
75
|
timePicker?: {
|
|
73
76
|
direction?: Direction;
|
|
77
|
+
locale?: TimePickerLocale;
|
|
74
78
|
prefixCls?: string;
|
|
75
79
|
clearIcon?: React.ReactNode | (() => React.ReactElement);
|
|
76
80
|
suffixIcon?: React.ReactNode;
|
|
@@ -2,17 +2,18 @@ import { type BaseSelectRef, OptGroup, Option, type SelectProps as RcSelectProps
|
|
|
2
2
|
import { type OptionProps } from 'rc-select/lib/Option';
|
|
3
3
|
import { type BaseOptionType, type DefaultOptionType } from 'rc-select/lib/Select';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import { type ControlProps } from '../../../components/Control/types';
|
|
5
|
+
import { type ControlProps, type SelectPlacement } from '../../../components/Control/types';
|
|
6
6
|
import { type SizeType } from '../../../types';
|
|
7
7
|
import './index.scss';
|
|
8
8
|
import '../index.scss';
|
|
9
9
|
export type { BaseSelectRef, OptionProps };
|
|
10
|
-
export interface InternalSelectProps<ValueType = any, OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType> extends Omit<RcSelectProps<ValueType, OptionType>, 'allowClear' | 'mode'> {
|
|
10
|
+
export interface InternalSelectProps<ValueType = any, OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType> extends Omit<RcSelectProps<ValueType, OptionType>, 'allowClear' | 'mode' | 'placement'> {
|
|
11
11
|
mode?: 'multiple' | 'tags' | 'SECRET_COMBOBOX_MODE_DO_NOT_USE';
|
|
12
12
|
size?: SizeType;
|
|
13
13
|
}
|
|
14
14
|
export interface SelectProps<ValueType = any, OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType> extends Omit<ControlProps<ValueType>, 'value' | 'defaultValue'>, Omit<InternalSelectProps<ValueType, OptionType>, 'inputIcon' | 'mode' | 'getInputElement' | 'backfill'> {
|
|
15
15
|
mode?: 'multiple' | 'tags';
|
|
16
|
+
placement?: SelectPlacement;
|
|
16
17
|
showArrow?: boolean;
|
|
17
18
|
}
|
|
18
19
|
export declare const Select: (<ValueType = any, OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType>(props: SelectProps<ValueType, OptionType> & {
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
@import '../../styles/variables.scss';
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
|
|
20
|
+
/* Picker
|
|
20
21
|
========================================================================== */
|
|
21
22
|
|
|
22
23
|
[class^='uk-datepicker'],
|
|
@@ -35,7 +36,7 @@
|
|
|
35
36
|
border-radius: var(--control-border-radius);
|
|
36
37
|
color: var(--control-color);
|
|
37
38
|
cursor: text;
|
|
38
|
-
display:
|
|
39
|
+
display: flex;
|
|
39
40
|
font-size: inherit;
|
|
40
41
|
min-height: var(--control-height);
|
|
41
42
|
padding-left: var(--control-padding-horizontal);
|
|
@@ -88,6 +89,9 @@
|
|
|
88
89
|
display: inline-flex;
|
|
89
90
|
position: relative;
|
|
90
91
|
width: 100%;
|
|
92
|
+
@if mixin-exists(hook-datepicker-input) {
|
|
93
|
+
@include hook-datepicker-input;
|
|
94
|
+
}
|
|
91
95
|
}
|
|
92
96
|
|
|
93
97
|
.uk-datepicker .uk-datepicker-input .uk-control {
|
|
@@ -95,7 +99,9 @@
|
|
|
95
99
|
padding: 0;
|
|
96
100
|
}
|
|
97
101
|
|
|
98
|
-
|
|
102
|
+
|
|
103
|
+
/* Panel
|
|
104
|
+
========================================================================== */
|
|
99
105
|
|
|
100
106
|
.uk-datepicker-panel-layout {
|
|
101
107
|
align-items: stretch;
|
|
@@ -147,6 +153,43 @@
|
|
|
147
153
|
}
|
|
148
154
|
}
|
|
149
155
|
|
|
156
|
+
.uk-datepicker-date-panel {
|
|
157
|
+
@if mixin-exists(hook-datepicker-date-panel) {
|
|
158
|
+
@include hook-datepicker-date-panel;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.uk-datepicker-month-panel {
|
|
163
|
+
@if mixin-exists(hook-datepicker-month-panel) {
|
|
164
|
+
@include hook-datepicker-month-panel;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.uk-datepicker-quarter-panel {
|
|
169
|
+
@if mixin-exists(hook-datepicker-quarter-panel) {
|
|
170
|
+
@include hook-datepicker-quarter-panel;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.uk-datepicker-decade-panel {
|
|
175
|
+
@if mixin-exists(hook-datepicker-decade-panel) {
|
|
176
|
+
@include hook-datepicker-decade-panel;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.uk-datepicker-week-panel {
|
|
181
|
+
@if mixin-exists(hook-datepicker-week-panel) {
|
|
182
|
+
@include hook-datepicker-week-panel;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.uk-datepicker-year-panel {
|
|
187
|
+
@if mixin-exists(hook-datepicker-year-panel) {
|
|
188
|
+
@include hook-datepicker-year-panel;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/* Header */
|
|
150
193
|
.uk-datepicker-header {
|
|
151
194
|
align-items: center;
|
|
152
195
|
border-bottom: var(--datepicker-border-width) var(--datepicker-border-style) var(--datepicker-border);
|
|
@@ -171,6 +214,7 @@
|
|
|
171
214
|
}
|
|
172
215
|
}
|
|
173
216
|
|
|
217
|
+
/* Body and content */
|
|
174
218
|
.uk-datepicker-body {
|
|
175
219
|
padding: var(--datepicker-body-padding-vertical) var(--datepicker-body-padding-horizontal);
|
|
176
220
|
@if mixin-exists(hook-datepicker-body) {
|
|
@@ -188,14 +232,7 @@
|
|
|
188
232
|
}
|
|
189
233
|
}
|
|
190
234
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
.uk-datepicker-content th {
|
|
194
|
-
box-sizing: border-box;
|
|
195
|
-
height: var(--datepicker-cell-height);
|
|
196
|
-
padding: 0;
|
|
197
|
-
}
|
|
198
|
-
|
|
235
|
+
// Elements
|
|
199
236
|
.uk-datepicker-header button {
|
|
200
237
|
align-items: center;
|
|
201
238
|
appearance: none;
|
|
@@ -215,30 +252,18 @@
|
|
|
215
252
|
padding: 0 var(--datepicker-header-button-padding-horizontal);
|
|
216
253
|
text-align: center;
|
|
217
254
|
transition: color var(--transition-medium-fast-duration);
|
|
218
|
-
@if mixin-exists(hook-datepicker-header-button) {
|
|
219
|
-
@include hook-datepicker-header-button;
|
|
220
|
-
}
|
|
221
255
|
}
|
|
222
256
|
|
|
223
257
|
.uk-datepicker-header-view button {
|
|
224
258
|
color: inherit;
|
|
225
|
-
@if mixin-exists(hook-datepicker-header-view-button) {
|
|
226
|
-
@include hook-datepicker-header-view-button;
|
|
227
|
-
}
|
|
228
259
|
}
|
|
229
260
|
|
|
230
261
|
.uk-datepicker-header-view button:hover {
|
|
231
262
|
color: var(--datepicker-header-view-button-hover-color);
|
|
232
|
-
@if mixin-exists(hook-datepicker-header-view-button-hover) {
|
|
233
|
-
@include hook-datepicker-header-view-button-hover;
|
|
234
|
-
}
|
|
235
263
|
}
|
|
236
264
|
|
|
237
265
|
.uk-datepicker-header > button:hover {
|
|
238
266
|
color: var(--datepicker-header-button-hover-color);
|
|
239
|
-
@if mixin-exists(hook-datepicker-header-button-hover) {
|
|
240
|
-
@include hook-datepicker-header-button-hover;
|
|
241
|
-
}
|
|
242
267
|
}
|
|
243
268
|
|
|
244
269
|
.uk-datepicker-prev-icon,
|
|
@@ -291,48 +316,13 @@
|
|
|
291
316
|
width: 7px;
|
|
292
317
|
}
|
|
293
318
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
.uk-datepicker-time-panel .uk-datepicker-content {
|
|
299
|
-
display: flex;
|
|
300
|
-
flex: auto;
|
|
301
|
-
height: var(--datepicker-time-column-height);
|
|
302
|
-
@if mixin-exists(hook-datepicker-time-panel-content) {
|
|
303
|
-
@include hook-datepicker-time-panel-content;
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
.uk-datepicker-time-panel-column {
|
|
308
|
-
flex: 1 0 auto;
|
|
309
|
-
margin: var(--global-xsmall-margin) 0;
|
|
310
|
-
overflow: hidden;
|
|
311
|
-
padding: 0;
|
|
312
|
-
scrollbar-color: var(--global-scroll-background, var(--global-muted-backgrounf, rgba(#000, 0.15))) transparent;
|
|
313
|
-
scrollbar-width: thin;
|
|
314
|
-
text-align: start;
|
|
315
|
-
transition: background var(--transition-medium-fast-duration);
|
|
316
|
-
width: var(--datepicker-time-column-width);
|
|
317
|
-
@if mixin-exists(hook-datepicker-time-panel-column) {
|
|
318
|
-
@include hook-datepicker-time-panel-column;
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
.uk-datepicker-time-panel-column:hover {
|
|
323
|
-
overflow-y: auto;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
.uk-datepicker-time-panel-column ul {
|
|
327
|
-
list-style: none;
|
|
328
|
-
margin: 0;
|
|
319
|
+
.uk-datepicker-content th {
|
|
320
|
+
box-sizing: border-box;
|
|
321
|
+
height: var(--datepicker-cell-height);
|
|
329
322
|
padding: 0;
|
|
330
323
|
}
|
|
331
324
|
|
|
332
|
-
/*
|
|
333
|
-
* Footer
|
|
334
|
-
*/
|
|
335
|
-
|
|
325
|
+
/* Footer */
|
|
336
326
|
.uk-datepicker-footer {
|
|
337
327
|
border-top: var(--datepicker-border-width) var(--datepicker-border-style) var(--datepicker-border);
|
|
338
328
|
padding: var(--datepicker-footer-padding-vertical) var(--datepicker-footer-padding-horizontal);
|
|
@@ -386,6 +376,10 @@
|
|
|
386
376
|
z-index: 1;
|
|
387
377
|
}
|
|
388
378
|
|
|
379
|
+
.uk-datepicker-cell-in-view {
|
|
380
|
+
color: var(--datepicker-cell-color);
|
|
381
|
+
}
|
|
382
|
+
|
|
389
383
|
.uk-datepicker-cell-inner {
|
|
390
384
|
border-radius: var(--datepicker-cell-border-radius);
|
|
391
385
|
display: inline-block;
|
|
@@ -394,13 +388,12 @@
|
|
|
394
388
|
min-width: var(--datepicker-cell-height);
|
|
395
389
|
position: relative;
|
|
396
390
|
z-index: 2;
|
|
391
|
+
@if mixin-exists(hook-datepicker-cell-inner) {
|
|
392
|
+
@include hook-datepicker-cell-inner;
|
|
393
|
+
}
|
|
397
394
|
}
|
|
398
395
|
|
|
399
|
-
|
|
400
|
-
color: var(--datepicker-cell-color);
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
/* Hover Cell */
|
|
396
|
+
/* Hover cell state */
|
|
404
397
|
.uk-datepicker-cell:hover:not(.uk-datepicker-cell-in-view, .uk-datepicker-cell-disabled) .uk-datepicker-cell-inner,
|
|
405
398
|
.uk-datepicker-cell:hover:not(
|
|
406
399
|
.uk-datepicker-cell-selected,
|
|
@@ -418,17 +411,7 @@
|
|
|
418
411
|
color: var(--datepicker-cell-active-color);
|
|
419
412
|
}
|
|
420
413
|
|
|
421
|
-
|
|
422
|
-
border: var(--datepicker-border-width) var(--datepicker-border-style) var(--datepicker-border);
|
|
423
|
-
border-radius: var(--datepicker-cell-border-radius);
|
|
424
|
-
bottom: 0;
|
|
425
|
-
content: '';
|
|
426
|
-
inset-inline: 0;
|
|
427
|
-
position: absolute;
|
|
428
|
-
top: 0;
|
|
429
|
-
z-index: 1;
|
|
430
|
-
}
|
|
431
|
-
|
|
414
|
+
/* Disabled cell state */
|
|
432
415
|
.uk-datepicker-cell-disabled:not(.uk-datepicker-cell-selected) {
|
|
433
416
|
color: var(--datepicker-cell-disabled-color);
|
|
434
417
|
cursor: not-allowed;
|
|
@@ -442,6 +425,18 @@
|
|
|
442
425
|
background: none;
|
|
443
426
|
}
|
|
444
427
|
|
|
428
|
+
/* Today */
|
|
429
|
+
.uk-datepicker-cell-in-view.uk-datepicker-cell-today .uk-datepicker-cell-inner::before {
|
|
430
|
+
border: var(--datepicker-border-width) var(--datepicker-border-style) var(--datepicker-border);
|
|
431
|
+
border-radius: var(--datepicker-cell-border-radius);
|
|
432
|
+
bottom: 0;
|
|
433
|
+
content: '';
|
|
434
|
+
inset-inline: 0;
|
|
435
|
+
position: absolute;
|
|
436
|
+
top: 0;
|
|
437
|
+
z-index: 1;
|
|
438
|
+
}
|
|
439
|
+
|
|
445
440
|
.uk-datepicker-cell-disabled.uk-datepicker-cell-today .uk-datepicker-cell-inner::before {
|
|
446
441
|
border-color: var(--datepicker-cell-disabled-border);
|
|
447
442
|
}
|
|
@@ -490,6 +485,39 @@
|
|
|
490
485
|
}
|
|
491
486
|
|
|
492
487
|
|
|
488
|
+
/* Time panel */
|
|
489
|
+
.uk-datepicker-time-panel .uk-datepicker-content {
|
|
490
|
+
display: flex;
|
|
491
|
+
flex: auto;
|
|
492
|
+
height: var(--datepicker-time-column-height);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
.uk-datepicker-time-panel-column {
|
|
496
|
+
flex: 1 0 auto;
|
|
497
|
+
margin: var(--global-xsmall-margin) 0;
|
|
498
|
+
overflow: hidden;
|
|
499
|
+
padding: 0;
|
|
500
|
+
scrollbar-color: var(--global-scroll-background, var(--global-muted-backgrounf, rgba(#000, 0.15))) transparent;
|
|
501
|
+
scrollbar-width: thin;
|
|
502
|
+
text-align: start;
|
|
503
|
+
transition: background var(--transition-medium-fast-duration);
|
|
504
|
+
width: var(--datepicker-time-column-width);
|
|
505
|
+
@if mixin-exists(hook-datepicker-time-panel-column) {
|
|
506
|
+
@include hook-datepicker-time-panel-column;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
.uk-datepicker-time-panel-column:hover {
|
|
511
|
+
overflow-y: auto;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
.uk-datepicker-time-panel-column ul {
|
|
515
|
+
list-style: none;
|
|
516
|
+
margin: 0;
|
|
517
|
+
padding: 0;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
|
|
493
521
|
/* Time
|
|
494
522
|
========================================================================== */
|
|
495
523
|
|
|
@@ -570,8 +598,7 @@
|
|
|
570
598
|
|
|
571
599
|
.uk-datepicker-dropdown {
|
|
572
600
|
background-color: var(--datepicker-dropdown-background);
|
|
573
|
-
border: var(--datepicker-dropdown-border-width) var(--datepicker-dropdown-border-style)
|
|
574
|
-
var(--datepicker-dropdown-border);
|
|
601
|
+
border: var(--datepicker-dropdown-border-width) var(--datepicker-dropdown-border-style) var(--datepicker-dropdown-border);
|
|
575
602
|
border-radius: var(--datepicker-dropdown-border-radius);
|
|
576
603
|
font-variant: initial;
|
|
577
604
|
left: -9999px;
|
|
@@ -3,6 +3,7 @@ import { type BuildInPlacements, type TriggerProps } from 'rc-trigger';
|
|
|
3
3
|
import { type AlignType } from 'rc-trigger/lib/interface';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import './index.scss';
|
|
6
|
+
export type DropPlacement = 'bottom-center' | 'bottom-left' | 'bottom-right' | 'top-center' | 'top-left' | 'top-right';
|
|
6
7
|
export interface DropProps extends Pick<TriggerProps, 'alignPoint' | 'action' | 'autoDestroy' | 'blurDelay' | 'children' | 'focusDelay' | 'getPopupContainer' | 'hideAction' | 'mask' | 'maskClosable' | 'maskMotion' | 'mouseEnterDelay' | 'mouseLeaveDelay' | 'prefixCls' | 'showAction' | 'stretch' | 'zIndex'> {
|
|
7
8
|
align?: AlignType;
|
|
8
9
|
arrow?: boolean;
|
|
@@ -16,7 +17,7 @@ export interface DropProps extends Pick<TriggerProps, 'alignPoint' | 'action' |
|
|
|
16
17
|
overlay?: (() => React.ReactElement) | React.ReactElement;
|
|
17
18
|
overlayClassName?: string;
|
|
18
19
|
overlayStyle?: React.CSSProperties;
|
|
19
|
-
placement?:
|
|
20
|
+
placement?: DropPlacement;
|
|
20
21
|
rootCls?: string;
|
|
21
22
|
visible?: boolean;
|
|
22
23
|
onAlign?: (element: HTMLElement, align: AlignType) => void;
|
|
@@ -824,6 +824,29 @@
|
|
|
824
824
|
|
|
825
825
|
@mixin hook-cover-misc() {}
|
|
826
826
|
|
|
827
|
+
@mixin hook-datepicker() {}
|
|
828
|
+
@mixin hook-datepicker-hover() {}
|
|
829
|
+
@mixin hook-datepicker-focus() {}
|
|
830
|
+
@mixin hook-datepicker-input() {}
|
|
831
|
+
@mixin hook-datepicker-panel-layout() {}
|
|
832
|
+
@mixin hook-datepicker-panel() {}
|
|
833
|
+
@mixin hook-datepicker-datetime-panel() {}
|
|
834
|
+
@mixin hook-datepicker-time-panel() {}
|
|
835
|
+
@mixin hook-datepicker-date-panel() {}
|
|
836
|
+
@mixin hook-datepicker-month-panel() {}
|
|
837
|
+
@mixin hook-datepicker-quarter-panel() {}
|
|
838
|
+
@mixin hook-datepicker-decade-panel() {}
|
|
839
|
+
@mixin hook-datepicker-week-panel() {}
|
|
840
|
+
@mixin hook-datepicker-year-panel() {}
|
|
841
|
+
@mixin hook-datepicker-header() {}
|
|
842
|
+
@mixin hook-datepicker-header-view() {}
|
|
843
|
+
@mixin hook-datepicker-body() {}
|
|
844
|
+
@mixin hook-datepicker-content() {}
|
|
845
|
+
@mixin hook-datepicker-footer() {}
|
|
846
|
+
@mixin hook-datepicker-ranges() {}
|
|
847
|
+
@mixin hook-datepicker-cell() {}
|
|
848
|
+
@mixin hook-datepicker-cell-inner() {}
|
|
849
|
+
@mixin hook-datepicker-time-panel-column() {}
|
|
827
850
|
@mixin hook-datepicker-dropdown() {}
|
|
828
851
|
|
|
829
852
|
@mixin hook-description-list-term() {}
|