baseui 10.6.0 → 10.7.3
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/app-nav-bar/user-menu.js +1 -0
- package/app-nav-bar/user-menu.js.flow +1 -0
- package/card/styled-components.js +0 -1
- package/card/styled-components.js.flow +0 -1
- package/combobox/combobox.js +5 -1
- package/combobox/combobox.js.flow +4 -0
- package/combobox/index.d.ts +6 -3
- package/data-table/column-datetime.js +2 -0
- package/data-table/column-datetime.js.flow +2 -0
- package/datepicker/calendar-header.js +29 -15
- package/datepicker/calendar-header.js.flow +13 -7
- package/datepicker/calendar.js +6 -1
- package/datepicker/calendar.js.flow +5 -1
- package/datepicker/constants.js +7 -2
- package/datepicker/constants.js.flow +5 -0
- package/datepicker/datepicker.js +135 -73
- package/datepicker/datepicker.js.flow +161 -62
- package/datepicker/day.js +1 -0
- package/datepicker/day.js.flow +1 -0
- package/datepicker/index.d.ts +7 -0
- package/datepicker/month.js +4 -0
- package/datepicker/month.js.flow +3 -0
- package/datepicker/styled-components.js +116 -56
- package/datepicker/styled-components.js.flow +101 -36
- package/datepicker/types.js.flow +17 -1
- package/datepicker/utils/date-helpers.js +1 -1
- package/datepicker/utils/date-helpers.js.flow +1 -1
- package/datepicker/week.js +1 -0
- package/datepicker/week.js.flow +1 -0
- package/dnd-list/list.js +1 -2
- package/dnd-list/list.js.flow +1 -1
- package/dnd-list/styled-components.js +1 -1
- package/dnd-list/styled-components.js.flow +1 -0
- package/es/app-nav-bar/user-menu.js +1 -0
- package/es/card/styled-components.js +0 -1
- package/es/combobox/combobox.js +5 -1
- package/es/data-table/column-datetime.js +2 -0
- package/es/datepicker/calendar-header.js +21 -10
- package/es/datepicker/calendar.js +7 -2
- package/es/datepicker/constants.js +5 -1
- package/es/datepicker/datepicker.js +70 -42
- package/es/datepicker/day.js +1 -0
- package/es/datepicker/month.js +3 -0
- package/es/datepicker/styled-components.js +98 -37
- package/es/datepicker/types.js +1 -1
- package/es/datepicker/utils/date-helpers.js +1 -1
- package/es/datepicker/week.js +1 -0
- package/es/dnd-list/list.js +1 -2
- package/es/dnd-list/styled-components.js +1 -0
- package/es/helper/helper.js +1 -0
- package/es/layer/layer.js +8 -0
- package/es/menu/maybe-child-menu.js +1 -0
- package/es/popover/popover.js +8 -5
- package/es/popover/stateful-container.js +4 -2
- package/es/select/select-component.js +1 -0
- package/es/themes/shared/lighting.js +5 -1
- package/es/timepicker/timepicker.js +16 -11
- package/es/tooltip/tooltip.js +1 -0
- package/esm/app-nav-bar/user-menu.js +1 -0
- package/esm/card/styled-components.js +0 -1
- package/esm/combobox/combobox.js +5 -1
- package/esm/data-table/column-datetime.js +2 -0
- package/esm/datepicker/calendar-header.js +30 -16
- package/esm/datepicker/calendar.js +7 -2
- package/esm/datepicker/constants.js +5 -1
- package/esm/datepicker/datepicker.js +136 -74
- package/esm/datepicker/day.js +1 -0
- package/esm/datepicker/month.js +3 -0
- package/esm/datepicker/styled-components.js +112 -55
- package/esm/datepicker/types.js +1 -1
- package/esm/datepicker/utils/date-helpers.js +1 -1
- package/esm/datepicker/week.js +1 -0
- package/esm/dnd-list/list.js +1 -2
- package/esm/dnd-list/styled-components.js +1 -1
- package/esm/helper/helper.js +1 -0
- package/esm/layer/layer.js +8 -0
- package/esm/menu/maybe-child-menu.js +1 -0
- package/esm/popover/popover.js +8 -5
- package/esm/popover/stateful-container.js +4 -2
- package/esm/select/select-component.js +1 -0
- package/esm/themes/shared/lighting.js +5 -1
- package/esm/timepicker/timepicker.js +17 -11
- package/esm/tooltip/tooltip.js +1 -0
- package/helper/helper.js +1 -0
- package/helper/helper.js.flow +1 -0
- package/layer/layer.js +8 -0
- package/layer/layer.js.flow +9 -0
- package/map-marker/index.d.ts +6 -5
- package/menu/maybe-child-menu.js +1 -0
- package/menu/maybe-child-menu.js.flow +1 -0
- package/modal/index.d.ts +1 -1
- package/modal/types.js.flow +4 -1
- package/package.json +3 -2
- package/popover/index.d.ts +2 -1
- package/popover/popover.js +8 -5
- package/popover/popover.js.flow +22 -11
- package/popover/stateful-container.js +4 -2
- package/popover/stateful-container.js.flow +2 -0
- package/popover/types.js.flow +6 -1
- package/select/select-component.js +1 -0
- package/select/select-component.js.flow +1 -0
- package/snackbar/index.d.ts +21 -16
- package/themes/shared/lighting.js +5 -1
- package/themes/shared/lighting.js.flow +4 -0
- package/themes/types.js.flow +4 -0
- package/timepicker/index.d.ts +1 -0
- package/timepicker/timepicker.js +17 -11
- package/timepicker/timepicker.js.flow +31 -12
- package/timepicker/types.js.flow +10 -0
- package/tooltip/tooltip.js +1 -0
- package/tooltip/tooltip.js.flow +6 -1
|
@@ -12,12 +12,38 @@ LICENSE file in the root directory of this source tree.
|
|
|
12
12
|
*/
|
|
13
13
|
import { styled } from '../styles/index.js';
|
|
14
14
|
import getDayStateCode from './utils/day-state.js';
|
|
15
|
-
import { ORIENTATION } from './constants.js';
|
|
15
|
+
import { ORIENTATION, DENSITY } from './constants.js';
|
|
16
16
|
/**
|
|
17
17
|
* Main component container element
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
export var StyledInputWrapper = styled('div', function () {
|
|
20
|
+
export var StyledInputWrapper = styled('div', function (props) {
|
|
21
|
+
var $separateRangeInputs = props.$separateRangeInputs;
|
|
22
|
+
return _objectSpread({
|
|
23
|
+
width: '100%'
|
|
24
|
+
}, $separateRangeInputs ? {
|
|
25
|
+
display: 'flex',
|
|
26
|
+
justifyContent: 'center'
|
|
27
|
+
} : {});
|
|
28
|
+
});
|
|
29
|
+
StyledInputWrapper.displayName = "StyledInputWrapper";
|
|
30
|
+
export var StyledInputLabel = styled('div', function (_ref) {
|
|
31
|
+
var $theme = _ref.$theme;
|
|
32
|
+
return _objectSpread(_objectSpread({}, $theme.typography.LabelMedium), {}, {
|
|
33
|
+
marginBottom: $theme.sizing.scale300
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
StyledInputLabel.displayName = "StyledInputLabel";
|
|
37
|
+
export var StyledStartDate = styled('div', function (_ref2) {
|
|
38
|
+
var $theme = _ref2.$theme;
|
|
39
|
+
return {
|
|
40
|
+
width: '100%',
|
|
41
|
+
marginRight: $theme.sizing.scale300
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
StyledStartDate.displayName = "StyledStartDate";
|
|
45
|
+
export var StyledEndDate = styled('div', function (_ref3) {
|
|
46
|
+
var $theme = _ref3.$theme;
|
|
21
47
|
return {
|
|
22
48
|
width: '100%'
|
|
23
49
|
};
|
|
@@ -26,7 +52,7 @@ export var StyledInputWrapper = styled('div', function () {
|
|
|
26
52
|
* Main component container element
|
|
27
53
|
*/
|
|
28
54
|
|
|
29
|
-
|
|
55
|
+
StyledEndDate.displayName = "StyledEndDate";
|
|
30
56
|
export var StyledRoot = styled('div', function (props) {
|
|
31
57
|
var _props$$theme = props.$theme,
|
|
32
58
|
typography = _props$$theme.typography,
|
|
@@ -53,17 +79,18 @@ export var StyledMonthContainer = styled('div', function (props) {
|
|
|
53
79
|
});
|
|
54
80
|
StyledMonthContainer.displayName = "StyledMonthContainer";
|
|
55
81
|
export var StyledCalendarContainer = styled('div', function (props) {
|
|
56
|
-
var sizing = props.$theme.sizing
|
|
82
|
+
var sizing = props.$theme.sizing,
|
|
83
|
+
$density = props.$density;
|
|
57
84
|
return {
|
|
58
|
-
paddingTop: sizing.
|
|
59
|
-
paddingBottom: sizing.
|
|
60
|
-
paddingLeft: sizing.
|
|
61
|
-
paddingRight: sizing.
|
|
85
|
+
paddingTop: sizing.scale300,
|
|
86
|
+
paddingBottom: $density === DENSITY.high ? sizing.scale400 : sizing.scale300,
|
|
87
|
+
paddingLeft: sizing.scale500,
|
|
88
|
+
paddingRight: sizing.scale500
|
|
62
89
|
};
|
|
63
90
|
});
|
|
64
91
|
StyledCalendarContainer.displayName = "StyledCalendarContainer";
|
|
65
|
-
export var StyledSelectorContainer = styled('div', function (
|
|
66
|
-
var $theme =
|
|
92
|
+
export var StyledSelectorContainer = styled('div', function (_ref4) {
|
|
93
|
+
var $theme = _ref4.$theme;
|
|
67
94
|
var textAlign = $theme.direction === 'rtl' ? 'right' : 'left';
|
|
68
95
|
return {
|
|
69
96
|
marginBottom: $theme.sizing.scale600,
|
|
@@ -75,16 +102,18 @@ export var StyledSelectorContainer = styled('div', function (_ref) {
|
|
|
75
102
|
StyledSelectorContainer.displayName = "StyledSelectorContainer";
|
|
76
103
|
export var StyledCalendarHeader = styled('div', function (props) {
|
|
77
104
|
var _props$$theme2 = props.$theme,
|
|
105
|
+
typography = _props$$theme2.typography,
|
|
78
106
|
borders = _props$$theme2.borders,
|
|
79
107
|
colors = _props$$theme2.colors,
|
|
80
|
-
sizing = _props$$theme2.sizing
|
|
81
|
-
|
|
108
|
+
sizing = _props$$theme2.sizing,
|
|
109
|
+
$density = props.$density;
|
|
110
|
+
return _objectSpread(_objectSpread({}, $density === DENSITY.high ? typography.LabelMedium : typography.LabelLarge), {}, {
|
|
82
111
|
color: colors.calendarHeaderForeground,
|
|
83
112
|
display: 'flex',
|
|
84
113
|
justifyContent: 'space-between',
|
|
85
114
|
alignItems: 'center',
|
|
86
|
-
paddingTop: sizing.
|
|
87
|
-
paddingBottom: sizing.
|
|
115
|
+
paddingTop: sizing.scale600,
|
|
116
|
+
paddingBottom: sizing.scale300,
|
|
88
117
|
paddingLeft: sizing.scale600,
|
|
89
118
|
paddingRight: sizing.scale600,
|
|
90
119
|
backgroundColor: colors.calendarHeaderBackground,
|
|
@@ -93,8 +122,8 @@ export var StyledCalendarHeader = styled('div', function (props) {
|
|
|
93
122
|
borderBottomRightRadius: 0,
|
|
94
123
|
borderBottomLeftRadius: 0,
|
|
95
124
|
// account for the left/right arrow heights
|
|
96
|
-
minHeight: "calc(".concat(sizing.scale800, " + ").concat(sizing.scale0, ")")
|
|
97
|
-
};
|
|
125
|
+
minHeight: $density === DENSITY.high ? "calc(".concat(sizing.scale800, " + ").concat(sizing.scale0, ")") : sizing.scale950
|
|
126
|
+
});
|
|
98
127
|
});
|
|
99
128
|
StyledCalendarHeader.displayName = "StyledCalendarHeader";
|
|
100
129
|
export var StyledMonthHeader = styled('div', function (props) {
|
|
@@ -106,19 +135,24 @@ export var StyledMonthHeader = styled('div', function (props) {
|
|
|
106
135
|
});
|
|
107
136
|
StyledMonthHeader.displayName = "StyledMonthHeader";
|
|
108
137
|
export var StyledMonthYearSelectButton = styled('button', function (props) {
|
|
109
|
-
|
|
138
|
+
var _props$$theme3 = props.$theme,
|
|
139
|
+
typography = _props$$theme3.typography,
|
|
140
|
+
colors = _props$$theme3.colors,
|
|
141
|
+
$isFocusVisible = props.$isFocusVisible,
|
|
142
|
+
$density = props.$density;
|
|
143
|
+
return _objectSpread(_objectSpread({}, $density === DENSITY.high ? typography.LabelMedium : typography.LabelLarge), {}, {
|
|
110
144
|
alignItems: 'center',
|
|
111
145
|
backgroundColor: 'transparent',
|
|
112
146
|
borderLeftWidth: 0,
|
|
113
147
|
borderRightWidth: 0,
|
|
114
148
|
borderTopWidth: 0,
|
|
115
149
|
borderBottomWidth: 0,
|
|
116
|
-
color:
|
|
150
|
+
color: colors.calendarHeaderForeground,
|
|
117
151
|
cursor: 'pointer',
|
|
118
152
|
display: 'flex',
|
|
119
153
|
outline: 'none',
|
|
120
154
|
':focus': {
|
|
121
|
-
boxShadow:
|
|
155
|
+
boxShadow: $isFocusVisible ? "0 0 0 3px ".concat(colors.accent) : 'none'
|
|
122
156
|
}
|
|
123
157
|
});
|
|
124
158
|
});
|
|
@@ -132,12 +166,13 @@ export var StyledMonthYearSelectIconContainer = styled('span', function (props)
|
|
|
132
166
|
});
|
|
133
167
|
StyledMonthYearSelectIconContainer.displayName = "StyledMonthYearSelectIconContainer";
|
|
134
168
|
|
|
135
|
-
function getArrowBtnStyle(
|
|
136
|
-
var $theme =
|
|
137
|
-
$disabled =
|
|
138
|
-
$isFocusVisible =
|
|
169
|
+
function getArrowBtnStyle(_ref6) {
|
|
170
|
+
var $theme = _ref6.$theme,
|
|
171
|
+
$disabled = _ref6.$disabled,
|
|
172
|
+
$isFocusVisible = _ref6.$isFocusVisible;
|
|
139
173
|
return {
|
|
140
174
|
boxSizing: 'border-box',
|
|
175
|
+
display: 'flex',
|
|
141
176
|
color: $disabled ? $theme.colors.calendarHeaderForegroundDisabled : $theme.colors.calendarHeaderForeground,
|
|
142
177
|
cursor: $disabled ? 'default' : 'pointer',
|
|
143
178
|
backgroundColor: 'transparent',
|
|
@@ -149,8 +184,6 @@ function getArrowBtnStyle(_ref3) {
|
|
|
149
184
|
paddingBottom: '0',
|
|
150
185
|
paddingLeft: '0',
|
|
151
186
|
paddingRight: '0',
|
|
152
|
-
marginLeft: '6px',
|
|
153
|
-
marginRight: '6px',
|
|
154
187
|
marginBottom: 0,
|
|
155
188
|
marginTop: 0,
|
|
156
189
|
outline: 'none',
|
|
@@ -175,22 +208,22 @@ export var StyledWeek = styled('div', function (props) {
|
|
|
175
208
|
return {
|
|
176
209
|
whiteSpace: 'nowrap',
|
|
177
210
|
display: 'flex',
|
|
178
|
-
marginBottom: sizing.
|
|
211
|
+
marginBottom: sizing.scale0
|
|
179
212
|
};
|
|
180
213
|
});
|
|
181
214
|
StyledWeek.displayName = "StyledWeek";
|
|
182
215
|
|
|
183
216
|
function generateDayStyles(defaultCode, defaultStyle) {
|
|
184
|
-
var
|
|
217
|
+
var _ref7;
|
|
185
218
|
|
|
186
219
|
var codeForSM = defaultCode.substr(0, 12) + '1' + defaultCode.substr(12 + 1);
|
|
187
220
|
var codeForEM = defaultCode.substr(0, 13) + '1' + defaultCode.substr(13 + 1);
|
|
188
|
-
return
|
|
221
|
+
return _ref7 = {}, _defineProperty(_ref7, defaultCode, defaultStyle), _defineProperty(_ref7, codeForSM, defaultStyle), _defineProperty(_ref7, codeForEM, defaultStyle), _ref7;
|
|
189
222
|
} // eslint-disable-next-line flowtype/no-weak-types
|
|
190
223
|
|
|
191
224
|
|
|
192
|
-
function getDayStyles(code,
|
|
193
|
-
var colors =
|
|
225
|
+
function getDayStyles(code, _ref8) {
|
|
226
|
+
var colors = _ref8.colors;
|
|
194
227
|
var undefinedDayStyle = {
|
|
195
228
|
':before': {
|
|
196
229
|
content: null
|
|
@@ -393,24 +426,43 @@ export var StyledDay = styled('div', function (props) {
|
|
|
393
426
|
$outsideMonth = props.$outsideMonth,
|
|
394
427
|
$outsideMonthWithinRange = props.$outsideMonthWithinRange,
|
|
395
428
|
$hasDateLabel = props.$hasDateLabel,
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
429
|
+
$density = props.$density,
|
|
430
|
+
_props$$theme4 = props.$theme,
|
|
431
|
+
colors = _props$$theme4.colors,
|
|
432
|
+
typography = _props$$theme4.typography,
|
|
433
|
+
sizing = _props$$theme4.sizing;
|
|
399
434
|
var code = getDayStateCode(props);
|
|
400
|
-
|
|
435
|
+
var height;
|
|
436
|
+
|
|
437
|
+
if ($hasDateLabel) {
|
|
438
|
+
if ($density === DENSITY.high) {
|
|
439
|
+
height = '60px';
|
|
440
|
+
} else {
|
|
441
|
+
height = '70px';
|
|
442
|
+
}
|
|
443
|
+
} else {
|
|
444
|
+
if ($density === DENSITY.high) {
|
|
445
|
+
height = '40px';
|
|
446
|
+
} else {
|
|
447
|
+
height = '48px';
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
return _objectSpread(_objectSpread(_objectSpread({}, $density === DENSITY.high ? typography.ParagraphSmall : typography.ParagraphMedium), {}, {
|
|
401
452
|
boxSizing: 'border-box',
|
|
402
453
|
position: 'relative',
|
|
403
454
|
cursor: $disabled || !$peekNextMonth && $outsideMonth ? 'default' : 'pointer',
|
|
404
455
|
color: colors.calendarForeground,
|
|
405
456
|
display: 'inline-block',
|
|
406
|
-
width:
|
|
407
|
-
height:
|
|
408
|
-
lineHeight
|
|
457
|
+
width: $density === DENSITY.high ? '42px' : '50px',
|
|
458
|
+
height: height,
|
|
459
|
+
// setting lineHeight equal to the contents height to vertically center the text
|
|
460
|
+
lineHeight: $density === DENSITY.high ? sizing.scale700 : sizing.scale900,
|
|
409
461
|
textAlign: 'center',
|
|
410
462
|
paddingTop: sizing.scale300,
|
|
411
463
|
paddingBottom: sizing.scale300,
|
|
412
|
-
paddingLeft: sizing.
|
|
413
|
-
paddingRight: sizing.
|
|
464
|
+
paddingLeft: sizing.scale300,
|
|
465
|
+
paddingRight: sizing.scale300,
|
|
414
466
|
marginTop: 0,
|
|
415
467
|
marginBottom: 0,
|
|
416
468
|
marginLeft: 0,
|
|
@@ -431,10 +483,10 @@ export var StyledDay = styled('div', function (props) {
|
|
|
431
483
|
display: 'inline-block',
|
|
432
484
|
boxShadow: $isFocusVisible ? "0 0 0 3px ".concat(colors.accent) : 'none',
|
|
433
485
|
backgroundColor: $selected ? colors.calendarDayBackgroundSelectedHighlighted : $pseudoSelected && $isHighlighted ? colors.calendarDayBackgroundPseudoSelectedHighlighted : colors.calendarBackground,
|
|
434
|
-
height: '100%',
|
|
486
|
+
height: $hasDateLabel ? '100%' : $density === DENSITY.high ? '42px' : '50px',
|
|
435
487
|
width: '100%',
|
|
436
488
|
position: 'absolute',
|
|
437
|
-
top: 0,
|
|
489
|
+
top: $hasDateLabel ? 0 : '-1px',
|
|
438
490
|
left: 0,
|
|
439
491
|
paddingTop: sizing.scale200,
|
|
440
492
|
paddingBottom: sizing.scale200,
|
|
@@ -450,10 +502,10 @@ export var StyledDay = styled('div', function (props) {
|
|
|
450
502
|
borderBottomColor: colors.borderSelected,
|
|
451
503
|
borderRightColor: colors.borderSelected,
|
|
452
504
|
borderLeftColor: colors.borderSelected,
|
|
453
|
-
borderTopLeftRadius: $hasDateLabel ? sizing.
|
|
454
|
-
borderTopRightRadius: $hasDateLabel ? sizing.
|
|
455
|
-
borderBottomLeftRadius: $hasDateLabel ? sizing.
|
|
456
|
-
borderBottomRightRadius: $hasDateLabel ? sizing.
|
|
505
|
+
borderTopLeftRadius: $hasDateLabel ? sizing.scale800 : '100%',
|
|
506
|
+
borderTopRightRadius: $hasDateLabel ? sizing.scale800 : '100%',
|
|
507
|
+
borderBottomLeftRadius: $hasDateLabel ? sizing.scale800 : '100%',
|
|
508
|
+
borderBottomRightRadius: $hasDateLabel ? sizing.scale800 : '100%'
|
|
457
509
|
}, getDayStyles(code, props.$theme)[':after'] || {}), $outsideMonthWithinRange ? {
|
|
458
510
|
content: null
|
|
459
511
|
} : {})
|
|
@@ -495,9 +547,9 @@ export var StyledDay = styled('div', function (props) {
|
|
|
495
547
|
});
|
|
496
548
|
StyledDay.displayName = "StyledDay";
|
|
497
549
|
export var StyledDayLabel = styled('div', function (props) {
|
|
498
|
-
var _props$$
|
|
499
|
-
typography = _props$$
|
|
500
|
-
colors = _props$$
|
|
550
|
+
var _props$$theme5 = props.$theme,
|
|
551
|
+
typography = _props$$theme5.typography,
|
|
552
|
+
colors = _props$$theme5.colors,
|
|
501
553
|
$selected = props.$selected;
|
|
502
554
|
return _objectSpread(_objectSpread({}, typography.ParagraphXSmall), {}, {
|
|
503
555
|
color: $selected ? colors.contentInverseTertiary : colors.contentTertiary
|
|
@@ -505,16 +557,22 @@ export var StyledDayLabel = styled('div', function (props) {
|
|
|
505
557
|
});
|
|
506
558
|
StyledDayLabel.displayName = "StyledDayLabel";
|
|
507
559
|
export var StyledWeekdayHeader = styled('div', function (props) {
|
|
508
|
-
var
|
|
509
|
-
|
|
560
|
+
var _props$$theme6 = props.$theme,
|
|
561
|
+
typography = _props$$theme6.typography,
|
|
562
|
+
colors = _props$$theme6.colors,
|
|
563
|
+
sizing = _props$$theme6.sizing,
|
|
564
|
+
$density = props.$density;
|
|
565
|
+
return _objectSpread(_objectSpread({}, typography.LabelMedium), {}, {
|
|
566
|
+
color: colors.contentTertiary,
|
|
510
567
|
boxSizing: 'border-box',
|
|
511
568
|
position: 'relative',
|
|
512
569
|
cursor: 'default',
|
|
513
570
|
display: 'inline-block',
|
|
514
|
-
width:
|
|
515
|
-
height:
|
|
516
|
-
lineHeight: sizing.scale800,
|
|
571
|
+
width: $density === DENSITY.high ? '42px' : '50px',
|
|
572
|
+
height: $density === DENSITY.high ? '40px' : '48px',
|
|
517
573
|
textAlign: 'center',
|
|
574
|
+
// setting lineHeight equal to the contents height to vertically center the text
|
|
575
|
+
lineHeight: sizing.scale900,
|
|
518
576
|
paddingTop: sizing.scale300,
|
|
519
577
|
paddingBottom: sizing.scale300,
|
|
520
578
|
paddingLeft: sizing.scale200,
|
|
@@ -523,8 +581,7 @@ export var StyledWeekdayHeader = styled('div', function (props) {
|
|
|
523
581
|
marginBottom: 0,
|
|
524
582
|
marginLeft: 0,
|
|
525
583
|
marginRight: 0,
|
|
526
|
-
color: 'inherit',
|
|
527
584
|
backgroundColor: 'transparent'
|
|
528
|
-
};
|
|
585
|
+
});
|
|
529
586
|
});
|
|
530
587
|
StyledWeekdayHeader.displayName = "StyledWeekdayHeader";
|
package/esm/datepicker/types.js
CHANGED
|
@@ -7,4 +7,4 @@ LICENSE file in the root directory of this source tree.
|
|
|
7
7
|
|
|
8
8
|
/* eslint-disable flowtype/generic-spacing */
|
|
9
9
|
import * as React from 'react';
|
|
10
|
-
import { ORIENTATION, STATE_CHANGE_TYPE } from './constants.js';
|
|
10
|
+
import { ORIENTATION, STATE_CHANGE_TYPE, DENSITY } from './constants.js';
|
package/esm/datepicker/week.js
CHANGED
|
@@ -79,6 +79,7 @@ var Week = /*#__PURE__*/function (_React$Component) {
|
|
|
79
79
|
adapter: _this.props.adapter,
|
|
80
80
|
date: day,
|
|
81
81
|
dateLabel: _this.props.dateLabel,
|
|
82
|
+
density: _this.props.density,
|
|
82
83
|
disabled: _this.dateHelpers.isDayDisabled(day, _this.props),
|
|
83
84
|
excludeDates: _this.props.excludeDates,
|
|
84
85
|
filterDate: _this.props.filterDate,
|
package/esm/dnd-list/list.js
CHANGED
|
@@ -206,8 +206,7 @@ var StatelessList = /*#__PURE__*/function (_React$Component) {
|
|
|
206
206
|
display: 'flex'
|
|
207
207
|
})
|
|
208
208
|
}), /*#__PURE__*/React.createElement(DragHandle, _extends({}, sharedProps, dragHandleProps), /*#__PURE__*/React.createElement(Grab, {
|
|
209
|
-
size: 24
|
|
210
|
-
color: "#CCC"
|
|
209
|
+
size: 24
|
|
211
210
|
})), /*#__PURE__*/React.createElement(Label, _extends({}, sharedProps, labelProps), value), removable && /*#__PURE__*/React.createElement(CloseHandle, _extends({}, sharedProps, {
|
|
212
211
|
onClick: function onClick(evt) {
|
|
213
212
|
evt.preventDefault();
|
|
@@ -90,7 +90,7 @@ export var DragHandle = styled('div', function (_ref4) {
|
|
|
90
90
|
|
|
91
91
|
var $theme = _ref4.$theme;
|
|
92
92
|
var marginDir = $theme.direction === 'rtl' ? 'marginLeft' : 'marginRight';
|
|
93
|
-
return _ref5 = {}, _defineProperty(_ref5, marginDir, $theme.sizing.scale600), _defineProperty(_ref5, "width", $theme.sizing.scale800), _defineProperty(_ref5, "display", 'flex'), _defineProperty(_ref5, "alignItems", 'center'), _ref5;
|
|
93
|
+
return _ref5 = {}, _defineProperty(_ref5, marginDir, $theme.sizing.scale600), _defineProperty(_ref5, "width", $theme.sizing.scale800), _defineProperty(_ref5, "color", '#CCC'), _defineProperty(_ref5, "display", 'flex'), _defineProperty(_ref5, "alignItems", 'center'), _ref5;
|
|
94
94
|
});
|
|
95
95
|
DragHandle.displayName = "DragHandle";
|
|
96
96
|
DragHandle.displayName = 'StyledDragHandle';
|
package/esm/helper/helper.js
CHANGED
package/esm/layer/layer.js
CHANGED
|
@@ -132,6 +132,14 @@ var LayerComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
132
132
|
if (host && host !== prevProps.host && prevProps.host === null) {
|
|
133
133
|
this.addContainer(host);
|
|
134
134
|
}
|
|
135
|
+
|
|
136
|
+
if (prevProps.isHoverLayer != this.props.isHoverLayer) {
|
|
137
|
+
if (this.props.isHoverLayer) {
|
|
138
|
+
this.context.removeDocClickHandler(this.onDocumentClick);
|
|
139
|
+
} else {
|
|
140
|
+
this.context.addDocClickHandler(this.onDocumentClick);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
135
143
|
}
|
|
136
144
|
}, {
|
|
137
145
|
key: "componentWillUnmount",
|
|
@@ -44,6 +44,7 @@ export default function MaybeChildMenu(props) {
|
|
|
44
44
|
return /*#__PURE__*/React.createElement(NestedMenuContext.Consumer, null, function (ctx) {
|
|
45
45
|
return /*#__PURE__*/React.createElement(PopoverOverride, _extends({
|
|
46
46
|
focusLock: false,
|
|
47
|
+
autoFocus: false,
|
|
47
48
|
isOpen: props.isOpen,
|
|
48
49
|
renderAll: props.renderAll,
|
|
49
50
|
content: ChildMenu,
|
package/esm/popover/popover.js
CHANGED
|
@@ -39,7 +39,7 @@ LICENSE file in the root directory of this source tree.
|
|
|
39
39
|
|
|
40
40
|
/* eslint-disable cup/no-undef */
|
|
41
41
|
import * as React from 'react';
|
|
42
|
-
import FocusLock from 'react-focus-lock';
|
|
42
|
+
import FocusLock, { MoveFocusInside } from 'react-focus-lock';
|
|
43
43
|
import { getOverride, getOverrideProps } from '../helpers/overrides.js';
|
|
44
44
|
import { ACCESSIBILITY_TYPE, PLACEMENT, TRIGGER_TYPE, ANIMATE_OUT_TIME, ANIMATE_IN_TIME, POPOVER_MARGIN } from './constants.js';
|
|
45
45
|
import { Layer, TetherBehavior } from '../layer/index.js';
|
|
@@ -202,7 +202,7 @@ var PopoverInner = /*#__PURE__*/function (_React$Component) {
|
|
|
202
202
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
203
203
|
this.init(prevProps, prevState);
|
|
204
204
|
|
|
205
|
-
if (this.props.autoFocus &&
|
|
205
|
+
if (this.props.autoFocus && !this.state.autoFocusAfterPositioning && this.popperRef.current !== null && this.popperRef.current.getBoundingClientRect().top > 0) {
|
|
206
206
|
this.setState({
|
|
207
207
|
autoFocusAfterPositioning: true
|
|
208
208
|
});
|
|
@@ -510,12 +510,15 @@ var PopoverInner = /*#__PURE__*/function (_React$Component) {
|
|
|
510
510
|
popperOptions: _objectSpread(_objectSpread({}, defaultPopperOptions), this.props.popperOptions),
|
|
511
511
|
onPopperUpdate: this.onPopperUpdate,
|
|
512
512
|
placement: this.state.placement
|
|
513
|
-
}, /*#__PURE__*/React.createElement(FocusLock, {
|
|
513
|
+
}, this.props.focusLock ? /*#__PURE__*/React.createElement(FocusLock, {
|
|
514
514
|
disabled: !this.props.focusLock,
|
|
515
515
|
noFocusGuards: false // see popover-focus-loop.scenario.js for why hover cannot return focus
|
|
516
516
|
,
|
|
517
|
-
returnFocus: this.
|
|
518
|
-
autoFocus: this.state.autoFocusAfterPositioning
|
|
517
|
+
returnFocus: !this.isHoverTrigger() && this.props.returnFocus,
|
|
518
|
+
autoFocus: this.state.autoFocusAfterPositioning,
|
|
519
|
+
focusOptions: this.props.focusOptions
|
|
520
|
+
}, this.renderPopover(renderedContent)) : /*#__PURE__*/React.createElement(MoveFocusInside, {
|
|
521
|
+
disabled: !this.props.autoFocus && !this.state.autoFocusAfterPositioning
|
|
519
522
|
}, this.renderPopover(renderedContent)))));
|
|
520
523
|
} else {
|
|
521
524
|
rendered.push( /*#__PURE__*/React.createElement(Hidden, {
|
|
@@ -206,7 +206,8 @@ var StatefulContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
206
206
|
returnFocus = _this$props.returnFocus,
|
|
207
207
|
showArrow = _this$props.showArrow,
|
|
208
208
|
triggerType = _this$props.triggerType,
|
|
209
|
-
popoverMargin = _this$props.popoverMargin
|
|
209
|
+
popoverMargin = _this$props.popoverMargin,
|
|
210
|
+
focusOptions = _this$props.focusOptions;
|
|
210
211
|
var popoverProps = {
|
|
211
212
|
accessibilityType: accessibilityType,
|
|
212
213
|
autoFocus: autoFocus,
|
|
@@ -229,7 +230,8 @@ var StatefulContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
229
230
|
returnFocus: returnFocus,
|
|
230
231
|
showArrow: showArrow,
|
|
231
232
|
triggerType: triggerType,
|
|
232
|
-
popoverMargin: popoverMargin
|
|
233
|
+
popoverMargin: popoverMargin,
|
|
234
|
+
focusOptions: focusOptions
|
|
233
235
|
};
|
|
234
236
|
|
|
235
237
|
if (dismissOnClickOutside) {
|
|
@@ -15,6 +15,10 @@ var lighting = {
|
|
|
15
15
|
overlay300: 'inset 0 0 0 1000px hsla(0, 0%, 0%, 0.12)',
|
|
16
16
|
overlay400: 'inset 0 0 0 1000px hsla(0, 0%, 0%, 0.16)',
|
|
17
17
|
overlay500: 'inset 0 0 0 1000px hsla(0, 0%, 0%, 0.2)',
|
|
18
|
-
overlay600: 'inset 0 0 0 1000px hsla(0, 0%, 0%, 0.24)'
|
|
18
|
+
overlay600: 'inset 0 0 0 1000px hsla(0, 0%, 0%, 0.24)',
|
|
19
|
+
shallowAbove: '0px -4px 16px rgba(0, 0, 0, 0.12)',
|
|
20
|
+
shallowBelow: '0px 4px 16px rgba(0, 0, 0, 0.12)',
|
|
21
|
+
deepAbove: '0px -16px 48px rgba(0, 0, 0, 0.22)',
|
|
22
|
+
deepBelow: '0px 16px 48px rgba(0, 0, 0, 0.22)'
|
|
19
23
|
};
|
|
20
24
|
export default lighting;
|
|
@@ -206,26 +206,31 @@ var TimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
206
206
|
_defineProperty(_assertThisInitialized(_this), "getTimeWindowInSeconds", function (step) {
|
|
207
207
|
var _this$props = _this.props,
|
|
208
208
|
min = _this$props.minTime,
|
|
209
|
-
max = _this$props.maxTime
|
|
209
|
+
max = _this$props.maxTime,
|
|
210
|
+
ignoreMinMaxDateComponent = _this$props.ignoreMinMaxDateComponent;
|
|
210
211
|
|
|
211
|
-
var
|
|
212
|
+
var dayStart = _this.setTime(_this.props.value, 0, 0, 0);
|
|
212
213
|
|
|
213
|
-
|
|
214
|
-
|
|
214
|
+
var dayEnd = _this.setTime(_this.props.value, 24, 0, 0);
|
|
215
|
+
|
|
216
|
+
if (!min || _this.props.adapter.isBefore(min, dayStart) && !ignoreMinMaxDateComponent) {
|
|
217
|
+
min = dayStart;
|
|
218
|
+
} else {
|
|
219
|
+
min = _this.setTime(_this.props.value, _this.props.adapter.getHours(min), _this.props.adapter.getMinutes(min), _this.props.adapter.getSeconds(min));
|
|
215
220
|
}
|
|
216
221
|
|
|
217
|
-
if (!max) {
|
|
218
|
-
max =
|
|
222
|
+
if (!max || _this.props.adapter.isAfter(max, dayEnd) && !ignoreMinMaxDateComponent) {
|
|
223
|
+
max = dayEnd;
|
|
219
224
|
} else {
|
|
220
|
-
// maxTime (if provided) should be inclusive, so add an extra
|
|
221
|
-
|
|
225
|
+
max = _this.setTime(_this.props.value, _this.props.adapter.getHours(max), _this.props.adapter.getMinutes(max), // maxTime (if provided) should be inclusive, so add an extra second here
|
|
226
|
+
_this.props.adapter.getSeconds(max) + 1);
|
|
222
227
|
}
|
|
223
228
|
|
|
224
229
|
var minDate = _this.props.adapter.toJsDate(min);
|
|
225
230
|
|
|
226
231
|
var maxDate = _this.props.adapter.toJsDate(max);
|
|
227
232
|
|
|
228
|
-
var midnightDate = _this.props.adapter.toJsDate(
|
|
233
|
+
var midnightDate = _this.props.adapter.toJsDate(dayStart);
|
|
229
234
|
|
|
230
235
|
return {
|
|
231
236
|
start: (minDate - midnightDate) / 1000,
|
|
@@ -312,7 +317,7 @@ var TimePicker = /*#__PURE__*/function (_React$Component) {
|
|
|
312
317
|
steps: steps,
|
|
313
318
|
value: this.props.nullable ? undefined : {
|
|
314
319
|
id: closestStep,
|
|
315
|
-
label: this.secondsToLabel(closestStep,
|
|
320
|
+
label: this.secondsToLabel(closestStep, this.props.format)
|
|
316
321
|
}
|
|
317
322
|
});
|
|
318
323
|
|
|
@@ -414,7 +419,8 @@ _defineProperty(TimePicker, "defaultProps", {
|
|
|
414
419
|
format: '12',
|
|
415
420
|
step: 900,
|
|
416
421
|
creatable: false,
|
|
417
|
-
adapter: dateFnsAdapter
|
|
422
|
+
adapter: dateFnsAdapter,
|
|
423
|
+
ignoreMinMaxDateComponent: false
|
|
418
424
|
});
|
|
419
425
|
|
|
420
426
|
export default TimePicker;
|
package/esm/tooltip/tooltip.js
CHANGED
|
@@ -62,6 +62,7 @@ var Tooltip = /*#__PURE__*/function (_React$Component) {
|
|
|
62
62
|
Inner: StyledInner
|
|
63
63
|
}, this.props.overrides);
|
|
64
64
|
return /*#__PURE__*/React.createElement(Popover, _extends({
|
|
65
|
+
autoFocus: false,
|
|
65
66
|
"data-baseweb": "tooltip"
|
|
66
67
|
}, this.props, {
|
|
67
68
|
overrides: overrides
|
package/helper/helper.js
CHANGED
package/helper/helper.js.flow
CHANGED
package/layer/layer.js
CHANGED
|
@@ -141,6 +141,14 @@ var LayerComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
141
141
|
if (host && host !== prevProps.host && prevProps.host === null) {
|
|
142
142
|
this.addContainer(host);
|
|
143
143
|
}
|
|
144
|
+
|
|
145
|
+
if (prevProps.isHoverLayer != this.props.isHoverLayer) {
|
|
146
|
+
if (this.props.isHoverLayer) {
|
|
147
|
+
this.context.removeDocClickHandler(this.onDocumentClick);
|
|
148
|
+
} else {
|
|
149
|
+
this.context.addDocClickHandler(this.onDocumentClick);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
144
152
|
}
|
|
145
153
|
}, {
|
|
146
154
|
key: "componentWillUnmount",
|
package/layer/layer.js.flow
CHANGED
|
@@ -61,9 +61,18 @@ class LayerComponent extends React.Component<
|
|
|
61
61
|
if (mountNode) {
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
|
+
|
|
64
65
|
if (host && host !== prevProps.host && prevProps.host === null) {
|
|
65
66
|
this.addContainer(host);
|
|
66
67
|
}
|
|
68
|
+
|
|
69
|
+
if (prevProps.isHoverLayer != this.props.isHoverLayer) {
|
|
70
|
+
if (this.props.isHoverLayer) {
|
|
71
|
+
this.context.removeDocClickHandler(this.onDocumentClick);
|
|
72
|
+
} else {
|
|
73
|
+
this.context.addDocClickHandler(this.onDocumentClick);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
67
76
|
}
|
|
68
77
|
|
|
69
78
|
componentWillUnmount() {
|
package/map-marker/index.d.ts
CHANGED
|
@@ -40,11 +40,12 @@ export interface FLOATING_MARKER_ANCHOR_TYPES {
|
|
|
40
40
|
square: 'square';
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
export type NeedleSizeT =
|
|
44
|
-
export type PinHeadT =
|
|
45
|
-
export type PinHeadSizeT =
|
|
46
|
-
export type AnchorPositionsT =
|
|
47
|
-
export type FloatingMarkerSizeT =
|
|
43
|
+
export type NeedleSizeT = NEEDLE_SIZES[keyof NEEDLE_SIZES];
|
|
44
|
+
export type PinHeadT = PINHEAD_TYPES[keyof PINHEAD_TYPES];
|
|
45
|
+
export type PinHeadSizeT = PINHEAD_SIZES_SHAPES[keyof PINHEAD_SIZES_SHAPES];
|
|
46
|
+
export type AnchorPositionsT = FLOATING_MARKER_ANCHOR_POSITIONS[keyof FLOATING_MARKER_ANCHOR_POSITIONS];
|
|
47
|
+
export type FloatingMarkerSizeT = FLOATING_MARKER_SIZES[keyof FLOATING_MARKER_SIZES];
|
|
48
|
+
export type FloatingMarkerAnchorTypeT = FLOATING_MARKER_ANCHOR_TYPES[keyof FLOATING_MARKER_ANCHOR_TYPES];
|
|
48
49
|
|
|
49
50
|
export type FixedMarkerOverridesT = {
|
|
50
51
|
Root?: Override<any>;
|
package/menu/maybe-child-menu.js
CHANGED
|
@@ -55,6 +55,7 @@ function MaybeChildMenu(props) {
|
|
|
55
55
|
return /*#__PURE__*/React.createElement(_nestedMenus.NestedMenuContext.Consumer, null, function (ctx) {
|
|
56
56
|
return /*#__PURE__*/React.createElement(PopoverOverride, _extends({
|
|
57
57
|
focusLock: false,
|
|
58
|
+
autoFocus: false,
|
|
58
59
|
isOpen: props.isOpen,
|
|
59
60
|
renderAll: props.renderAll,
|
|
60
61
|
content: ChildMenu,
|
package/modal/index.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export interface ModalProps {
|
|
|
47
47
|
autofocus?: boolean;
|
|
48
48
|
autoFocus?: boolean;
|
|
49
49
|
focusLock?: boolean;
|
|
50
|
-
returnFocus?: boolean | FocusOptions;
|
|
50
|
+
returnFocus?: boolean | FocusOptions | ((returnTo: Element) => boolean | FocusOptions);
|
|
51
51
|
children?: React.ReactNode;
|
|
52
52
|
closeable?: boolean;
|
|
53
53
|
isOpen?: boolean;
|