baseui 10.5.0 → 10.7.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.
Files changed (165) hide show
  1. package/app-nav-bar/user-menu.js +1 -0
  2. package/app-nav-bar/user-menu.js.flow +1 -0
  3. package/button/styled-components.js +1 -1
  4. package/button/styled-components.js.flow +4 -1
  5. package/card/styled-components.js +0 -1
  6. package/card/styled-components.js.flow +0 -1
  7. package/combobox/combobox.js +5 -1
  8. package/combobox/combobox.js.flow +4 -0
  9. package/combobox/index.d.ts +6 -3
  10. package/data-table/column-datetime.js +2 -0
  11. package/data-table/column-datetime.js.flow +2 -0
  12. package/datepicker/calendar-header.js +255 -109
  13. package/datepicker/calendar-header.js.flow +282 -145
  14. package/datepicker/calendar.js +6 -1
  15. package/datepicker/calendar.js.flow +5 -1
  16. package/datepicker/constants.js +9 -2
  17. package/datepicker/constants.js.flow +7 -0
  18. package/datepicker/datepicker.js +135 -73
  19. package/datepicker/datepicker.js.flow +161 -62
  20. package/datepicker/day.js +2 -0
  21. package/datepicker/day.js.flow +2 -0
  22. package/datepicker/index.d.ts +8 -0
  23. package/datepicker/month.js +4 -0
  24. package/datepicker/month.js.flow +3 -0
  25. package/datepicker/styled-components.js +116 -56
  26. package/datepicker/styled-components.js.flow +101 -36
  27. package/datepicker/types.js.flow +18 -1
  28. package/datepicker/utils/calendar-header-helpers.js +51 -0
  29. package/datepicker/utils/calendar-header-helpers.js.flow +53 -0
  30. package/datepicker/utils/date-helpers.js +1 -1
  31. package/datepicker/utils/date-helpers.js.flow +1 -1
  32. package/datepicker/week.js +1 -0
  33. package/datepicker/week.js.flow +1 -0
  34. package/dnd-list/index.js.flow +2 -1
  35. package/dnd-list/list.js +1 -2
  36. package/dnd-list/list.js.flow +1 -1
  37. package/dnd-list/styled-components.js +1 -1
  38. package/dnd-list/styled-components.js.flow +1 -0
  39. package/drawer/drawer.js +2 -1
  40. package/drawer/drawer.js.flow +1 -1
  41. package/es/app-nav-bar/user-menu.js +1 -0
  42. package/es/button/styled-components.js +1 -1
  43. package/es/card/styled-components.js +0 -1
  44. package/es/combobox/combobox.js +5 -1
  45. package/es/data-table/column-datetime.js +2 -0
  46. package/es/datepicker/calendar-header.js +204 -93
  47. package/es/datepicker/calendar.js +7 -2
  48. package/es/datepicker/constants.js +6 -1
  49. package/es/datepicker/datepicker.js +70 -42
  50. package/es/datepicker/day.js +2 -0
  51. package/es/datepicker/month.js +3 -0
  52. package/es/datepicker/styled-components.js +98 -37
  53. package/es/datepicker/types.js +1 -1
  54. package/es/datepicker/utils/calendar-header-helpers.js +34 -0
  55. package/es/datepicker/utils/date-helpers.js +1 -1
  56. package/es/datepicker/week.js +1 -0
  57. package/es/dnd-list/index.js +2 -1
  58. package/es/dnd-list/list.js +1 -2
  59. package/es/dnd-list/styled-components.js +1 -0
  60. package/es/drawer/drawer.js +2 -1
  61. package/es/helper/helper.js +1 -0
  62. package/es/layer/layer.js +8 -0
  63. package/es/menu/maybe-child-menu.js +1 -0
  64. package/es/popover/popover.js +6 -5
  65. package/es/popover/stateful-container.js +8 -2
  66. package/es/rating/emoticon-rating.js +3 -1
  67. package/es/rating/star-rating.js +3 -1
  68. package/es/select/select-component.js +5 -5
  69. package/es/select/styled-components.js +34 -4
  70. package/es/snackbar/snackbar-context.js +16 -4
  71. package/es/table-semantic/styled-components.js +6 -4
  72. package/es/table-semantic/table-builder.js +3 -0
  73. package/es/themes/dark-theme/color-component-tokens.js +1 -1
  74. package/es/themes/light-theme/color-component-tokens.js +9 -9
  75. package/es/themes/shared/lighting.js +5 -1
  76. package/es/timepicker/timepicker.js +16 -11
  77. package/es/tooltip/styled-components.js +8 -0
  78. package/es/tooltip/tooltip.js +1 -0
  79. package/esm/app-nav-bar/user-menu.js +1 -0
  80. package/esm/button/styled-components.js +1 -1
  81. package/esm/card/styled-components.js +0 -1
  82. package/esm/combobox/combobox.js +5 -1
  83. package/esm/data-table/column-datetime.js +2 -0
  84. package/esm/datepicker/calendar-header.js +255 -110
  85. package/esm/datepicker/calendar.js +7 -2
  86. package/esm/datepicker/constants.js +6 -1
  87. package/esm/datepicker/datepicker.js +136 -74
  88. package/esm/datepicker/day.js +2 -0
  89. package/esm/datepicker/month.js +3 -0
  90. package/esm/datepicker/styled-components.js +112 -55
  91. package/esm/datepicker/types.js +1 -1
  92. package/esm/datepicker/utils/calendar-header-helpers.js +45 -0
  93. package/esm/datepicker/utils/date-helpers.js +1 -1
  94. package/esm/datepicker/week.js +1 -0
  95. package/esm/dnd-list/index.js +2 -1
  96. package/esm/dnd-list/list.js +1 -2
  97. package/esm/dnd-list/styled-components.js +1 -1
  98. package/esm/drawer/drawer.js +2 -1
  99. package/esm/helper/helper.js +1 -0
  100. package/esm/layer/layer.js +8 -0
  101. package/esm/menu/maybe-child-menu.js +1 -0
  102. package/esm/popover/popover.js +6 -5
  103. package/esm/popover/stateful-container.js +8 -2
  104. package/esm/rating/emoticon-rating.js +2 -2
  105. package/esm/rating/star-rating.js +2 -2
  106. package/esm/select/select-component.js +5 -5
  107. package/esm/select/styled-components.js +28 -4
  108. package/esm/snackbar/snackbar-context.js +16 -4
  109. package/esm/table-semantic/styled-components.js +6 -4
  110. package/esm/table-semantic/table-builder.js +3 -0
  111. package/esm/themes/dark-theme/color-component-tokens.js +1 -1
  112. package/esm/themes/light-theme/color-component-tokens.js +9 -9
  113. package/esm/themes/shared/lighting.js +5 -1
  114. package/esm/timepicker/timepicker.js +17 -11
  115. package/esm/tooltip/styled-components.js +8 -0
  116. package/esm/tooltip/tooltip.js +1 -0
  117. package/helper/helper.js +1 -0
  118. package/helper/helper.js.flow +1 -0
  119. package/layer/layer.js +8 -0
  120. package/layer/layer.js.flow +9 -0
  121. package/link/index.d.ts +1 -0
  122. package/map-marker/index.d.ts +6 -5
  123. package/menu/index.d.ts +7 -0
  124. package/menu/maybe-child-menu.js +1 -0
  125. package/menu/maybe-child-menu.js.flow +1 -0
  126. package/menu/types.js.flow +12 -0
  127. package/modal/index.d.ts +1 -1
  128. package/modal/types.js.flow +4 -1
  129. package/package.json +4 -3
  130. package/popover/index.d.ts +2 -1
  131. package/popover/popover.js +6 -5
  132. package/popover/popover.js.flow +11 -4
  133. package/popover/stateful-container.js +8 -2
  134. package/popover/stateful-container.js.flow +5 -0
  135. package/popover/types.js.flow +6 -1
  136. package/rating/emoticon-rating.js +2 -2
  137. package/rating/emoticon-rating.js.flow +4 -1
  138. package/rating/star-rating.js +2 -2
  139. package/rating/star-rating.js.flow +4 -1
  140. package/select/select-component.js +5 -5
  141. package/select/select-component.js.flow +5 -5
  142. package/select/styled-components.js +28 -4
  143. package/select/styled-components.js.flow +30 -2
  144. package/snackbar/index.d.ts +21 -16
  145. package/snackbar/snackbar-context.js +15 -4
  146. package/snackbar/snackbar-context.js.flow +15 -3
  147. package/table-semantic/styled-components.js +6 -4
  148. package/table-semantic/styled-components.js.flow +6 -4
  149. package/table-semantic/table-builder.js +3 -0
  150. package/table-semantic/table-builder.js.flow +3 -0
  151. package/themes/dark-theme/color-component-tokens.js +1 -1
  152. package/themes/dark-theme/color-component-tokens.js.flow +1 -1
  153. package/themes/light-theme/color-component-tokens.js +9 -9
  154. package/themes/light-theme/color-component-tokens.js.flow +9 -9
  155. package/themes/shared/lighting.js +5 -1
  156. package/themes/shared/lighting.js.flow +4 -0
  157. package/themes/types.js.flow +4 -0
  158. package/timepicker/index.d.ts +1 -0
  159. package/timepicker/timepicker.js +17 -11
  160. package/timepicker/timepicker.js.flow +31 -12
  161. package/timepicker/types.js.flow +10 -0
  162. package/tooltip/styled-components.js +8 -0
  163. package/tooltip/styled-components.js.flow +8 -0
  164. package/tooltip/tooltip.js +1 -0
  165. 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
- StyledInputWrapper.displayName = "StyledInputWrapper";
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.scale400,
59
- paddingBottom: sizing.scale500,
60
- paddingLeft: sizing.scale600,
61
- paddingRight: sizing.scale600
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 (_ref) {
66
- var $theme = _ref.$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
- return {
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.scale500,
87
- paddingBottom: sizing.scale500,
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
- return _objectSpread(_objectSpread({}, props.$theme.typography.font200), {}, {
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: props.$theme.colors.calendarHeaderForeground,
150
+ color: colors.calendarHeaderForeground,
117
151
  cursor: 'pointer',
118
152
  display: 'flex',
119
153
  outline: 'none',
120
154
  ':focus': {
121
- boxShadow: props.$isFocusVisible ? "0 0 0 3px ".concat(props.$theme.colors.accent) : 'none'
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(_ref3) {
136
- var $theme = _ref3.$theme,
137
- $disabled = _ref3.$disabled,
138
- $isFocusVisible = _ref3.$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.scale100
211
+ marginBottom: sizing.scale0
179
212
  };
180
213
  });
181
214
  StyledWeek.displayName = "StyledWeek";
182
215
 
183
216
  function generateDayStyles(defaultCode, defaultStyle) {
184
- var _ref4;
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 _ref4 = {}, _defineProperty(_ref4, defaultCode, defaultStyle), _defineProperty(_ref4, codeForSM, defaultStyle), _defineProperty(_ref4, codeForEM, defaultStyle), _ref4;
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, _ref5) {
193
- var colors = _ref5.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
- _props$$theme3 = props.$theme,
397
- colors = _props$$theme3.colors,
398
- sizing = _props$$theme3.sizing;
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
- return _objectSpread(_objectSpread({
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: sizing.scale1000,
407
- height: $hasDateLabel ? '60px' : sizing.scale1000,
408
- lineHeight: sizing.scale800,
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.scale200,
413
- paddingRight: sizing.scale200,
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.scale700 : '100%',
454
- borderTopRightRadius: $hasDateLabel ? sizing.scale700 : '100%',
455
- borderBottomLeftRadius: $hasDateLabel ? sizing.scale700 : '100%',
456
- borderBottomRightRadius: $hasDateLabel ? sizing.scale700 : '100%'
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$$theme4 = props.$theme,
499
- typography = _props$$theme4.typography,
500
- colors = _props$$theme4.colors,
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 sizing = props.$theme.sizing;
509
- return {
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: sizing.scale1000,
515
- height: sizing.scale1000,
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";
@@ -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';
@@ -0,0 +1,45 @@
1
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
2
+
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
4
+
5
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+
7
+ /*
8
+ Copyright (c) Uber Technologies, Inc.
9
+
10
+ This source code is licensed under the MIT license found in the
11
+ LICENSE file in the root directory of this source tree.
12
+ */
13
+ import { DEFAULT_MONTHS } from '../constants.js';
14
+
15
+ var getDefaultMonthItems = function getDefaultMonthItems(formatMonthLabel) {
16
+ return DEFAULT_MONTHS.map(function (month) {
17
+ return {
18
+ id: month.toString(),
19
+ label: formatMonthLabel(month)
20
+ };
21
+ });
22
+ };
23
+
24
+ export var filterMonthItems = function filterMonthItems(monthItems, filterList) {
25
+ return monthItems.map(function (month) {
26
+ if (!filterList.includes(Number(month.id))) {
27
+ return _objectSpread(_objectSpread({}, month), {}, {
28
+ disabled: true
29
+ });
30
+ }
31
+
32
+ return month;
33
+ });
34
+ };
35
+ export var getFilteredMonthItems = function getFilteredMonthItems(_ref) {
36
+ var filterMonthsList = _ref.filterMonthsList,
37
+ formatMonthLabel = _ref.formatMonthLabel;
38
+ var monthItems = getDefaultMonthItems(formatMonthLabel);
39
+
40
+ if (filterMonthsList) {
41
+ monthItems = filterMonthItems(monthItems, filterMonthsList);
42
+ }
43
+
44
+ return monthItems;
45
+ };
@@ -44,7 +44,7 @@ var DateHelpers = function DateHelpers(_adapter) {
44
44
  monthNumber: 'M',
45
45
  dayOfMonthNumber: 'd',
46
46
  weekday: 'EEEE',
47
- weekdaymin: 'EEEEE',
47
+ weekdaymin: 'EEEEEE',
48
48
  slashDate: 'yyyy/MM/dd',
49
49
  fullOrdinalWeek: 'EEEE, MMMM do yyyy',
50
50
  quarter: 'QQQ'
@@ -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,
@@ -4,7 +4,8 @@ Copyright (c) Uber Technologies, Inc.
4
4
  This source code is licensed under the MIT license found in the
5
5
  LICENSE file in the root directory of this source tree.
6
6
  */
7
- export { arrayMove, arrayRemove } from 'react-movable';
7
+ import { arrayMove, arrayRemove } from 'react-movable';
8
+ export { arrayMove, arrayRemove };
8
9
  export { default as StatefulList } from './stateful-list.js';
9
10
  export { default as StatefulListContainer } from './stateful-list-container.js';
10
11
  export { default as List } from './list.js'; // Constants
@@ -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';
@@ -331,7 +331,8 @@ var Drawer = /*#__PURE__*/function (_React$Component) {
331
331
  return /*#__PURE__*/React.createElement(LocaleContext.Consumer, null, function (locale) {
332
332
  return /*#__PURE__*/React.createElement(FocusLock, {
333
333
  returnFocus: true,
334
- autoFocus: autoFocus
334
+ autoFocus: autoFocus,
335
+ noFocusGuards: true
335
336
  }, /*#__PURE__*/React.createElement(Root, _extends({
336
337
  "data-baseweb": "drawer",
337
338
  ref: _this3.getRef('Root')
@@ -44,6 +44,7 @@ export function Helper(props) {
44
44
  React.createElement(Popover, _extends({
45
45
  "data-baseweb": "helper"
46
46
  }, restProps, {
47
+ autoFocus: false,
47
48
  placement: placement,
48
49
  overrides: mergedOverrides
49
50
  }))
@@ -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,
@@ -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 && this.props.focusLock && !this.state.autoFocusAfterPositioning && this.popperRef.current !== null && this.popperRef.current.getBoundingClientRect().top > 0) {
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
  });
@@ -514,9 +514,10 @@ var PopoverInner = /*#__PURE__*/function (_React$Component) {
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.props.returnFocus && !this.isHoverTrigger(),
518
- autoFocus: this.state.autoFocusAfterPositioning
519
- }, this.renderPopover(renderedContent)))));
517
+ returnFocus: !this.isHoverTrigger() && this.props.returnFocus,
518
+ autoFocus: this.state.autoFocusAfterPositioning,
519
+ focusOptions: this.props.focusOptions
520
+ }, !this.props.focusLock && this.state.autoFocusAfterPositioning ? /*#__PURE__*/React.createElement(MoveFocusInside, null, this.renderPopover(renderedContent)) : this.renderPopover(renderedContent)))));
520
521
  } else {
521
522
  rendered.push( /*#__PURE__*/React.createElement(Hidden, {
522
523
  key: "hidden-layer"
@@ -64,6 +64,10 @@ var StatefulContainer = /*#__PURE__*/function (_React$Component) {
64
64
  _this.props.onBlur(e);
65
65
  }
66
66
 
67
+ if (_this.props.focusLock || _this.props.autoFocus) {
68
+ return;
69
+ }
70
+
67
71
  _this.close();
68
72
  });
69
73
 
@@ -202,7 +206,8 @@ var StatefulContainer = /*#__PURE__*/function (_React$Component) {
202
206
  returnFocus = _this$props.returnFocus,
203
207
  showArrow = _this$props.showArrow,
204
208
  triggerType = _this$props.triggerType,
205
- popoverMargin = _this$props.popoverMargin;
209
+ popoverMargin = _this$props.popoverMargin,
210
+ focusOptions = _this$props.focusOptions;
206
211
  var popoverProps = {
207
212
  accessibilityType: accessibilityType,
208
213
  autoFocus: autoFocus,
@@ -225,7 +230,8 @@ var StatefulContainer = /*#__PURE__*/function (_React$Component) {
225
230
  returnFocus: returnFocus,
226
231
  showArrow: showArrow,
227
232
  triggerType: triggerType,
228
- popoverMargin: popoverMargin
233
+ popoverMargin: popoverMargin,
234
+ focusOptions: focusOptions
229
235
  };
230
236
 
231
237
  if (dismissOnClickOutside) {
@@ -213,8 +213,8 @@ var EmoticonRating = /*#__PURE__*/function (_React$Component) {
213
213
  return /*#__PURE__*/React.createElement(Root, _extends({
214
214
  "data-baseweb": "emoticon-rating",
215
215
  role: "radiogroup",
216
- onBlur: function onBlur() {
217
- return _this2.updatePreview(undefined);
216
+ onBlur: function onBlur(e) {
217
+ if (!e.currentTarget.contains(e.relatedTarget)) _this2.updatePreview(undefined);
218
218
  },
219
219
  onMouseLeave: function onMouseLeave() {
220
220
  return _this2.updatePreview(undefined);
@@ -216,8 +216,8 @@ var StarRating = /*#__PURE__*/function (_React$Component) {
216
216
  return /*#__PURE__*/React.createElement(Root, _extends({
217
217
  "data-baseweb": "star-rating",
218
218
  role: "radiogroup",
219
- onBlur: function onBlur() {
220
- return _this2.updatePreview(undefined);
219
+ onBlur: function onBlur(e) {
220
+ if (!e.currentTarget.contains(e.relatedTarget)) _this2.updatePreview(undefined);
221
221
  },
222
222
  onMouseLeave: function onMouseLeave() {
223
223
  return _this2.updatePreview(undefined);
@@ -159,7 +159,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
159
159
  isPseudoFocused: false
160
160
  });
161
161
 
162
- _defineProperty(_assertThisInitialized(_this), "isMounted", false);
162
+ _defineProperty(_assertThisInitialized(_this), "isItMounted", false);
163
163
 
164
164
  _defineProperty(_assertThisInitialized(_this), "handleTouchOutside", function (event) {
165
165
  if (containsNode(_this.dropdown.current, event.target)) return;
@@ -307,7 +307,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
307
307
  _this.props.onBlur(event);
308
308
  }
309
309
 
310
- if (_this.isMounted) {
310
+ if (_this.isItMounted) {
311
311
  _this.setState({
312
312
  isFocused: false,
313
313
  isOpen: false,
@@ -661,7 +661,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
661
661
  this.focus();
662
662
  }
663
663
 
664
- this.isMounted = true;
664
+ this.isItMounted = true;
665
665
 
666
666
  if (this.props.methodsRef) {
667
667
  var methodsRef = this.props.methodsRef;
@@ -697,7 +697,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
697
697
  document.removeEventListener('click', this.handleClickOutside);
698
698
  }
699
699
 
700
- this.isMounted = false;
700
+ this.isItMounted = false;
701
701
  }
702
702
  }, {
703
703
  key: "focus",
@@ -926,7 +926,6 @@ var Select = /*#__PURE__*/function (_React$Component) {
926
926
 
927
927
  var ariaLabel = this.props.multi ? 'Clear all' : 'Clear value';
928
928
  return /*#__PURE__*/React.createElement(ClearIcon, _extends({
929
- size: 16,
930
929
  title: ariaLabel,
931
930
  "aria-label": ariaLabel,
932
931
  onClick: this.clearValue,
@@ -1148,6 +1147,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
1148
1147
  if (!ref) return;
1149
1148
  _this6.anchor = ref.anchorRef;
1150
1149
  },
1150
+ autoFocus: false,
1151
1151
  focusLock: false,
1152
1152
  mountNode: _this6.props.mountNode,
1153
1153
  onEsc: function onEsc() {