baseui 0.0.0-next-31e82a8 → 0.0.0-next-e90bd38

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.
@@ -11,6 +11,8 @@ var React = _interopRequireWildcard(require("react"));
11
11
 
12
12
  var _checkbox = require("../checkbox");
13
13
 
14
+ var _locale = require("../locale");
15
+
14
16
  var _styles = require("../styles");
15
17
 
16
18
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -52,6 +54,8 @@ function Column(options) {
52
54
  // todo(flow->ts) add proper type annotation
53
55
  // eslint-disable-next-line @typescript-eslint/no-explicit-any,react/display-name
54
56
  renderCell: /*#__PURE__*/React.forwardRef(function (props, ref) {
57
+ var locale = React.useContext(_locale.LocaleContext);
58
+
55
59
  var _useStyletron = (0, _styles.useStyletron)(),
56
60
  _useStyletron2 = _slicedToArray(_useStyletron, 2),
57
61
  css = _useStyletron2[0],
@@ -90,6 +94,7 @@ function Column(options) {
90
94
  paddingRight: theme.sizing.scale300
91
95
  })
92
96
  }, /*#__PURE__*/React.createElement(_checkbox.Checkbox, {
97
+ "aria-label": locale.datatable.selectRow,
93
98
  onChange: props.onSelect,
94
99
  checked: props.isSelected,
95
100
  overrides: {
@@ -11,6 +11,8 @@ var React = _interopRequireWildcard(require("react"));
11
11
 
12
12
  var _checkbox = require("../checkbox");
13
13
 
14
+ var _locale = require("../locale");
15
+
14
16
  var _styles = require("../styles");
15
17
 
16
18
  var _chevronDown = _interopRequireDefault(require("../icon/chevron-down"));
@@ -46,6 +48,8 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
46
48
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
47
49
 
48
50
  var HeaderCell = /*#__PURE__*/React.forwardRef(function (props, ref) {
51
+ var locale = React.useContext(_locale.LocaleContext);
52
+
49
53
  var _useStyletron = (0, _styles.useStyletron)(),
50
54
  _useStyletron2 = _slicedToArray(_useStyletron, 2),
51
55
  css = _useStyletron2[0],
@@ -62,10 +66,9 @@ var HeaderCell = /*#__PURE__*/React.forwardRef(function (props, ref) {
62
66
  if ((0, _focusVisible.isFocusVisible)(event)) {
63
67
  setFocusVisible(true);
64
68
  }
65
- }; // eslint-disable-next-line @typescript-eslint/no-unused-vars
66
-
69
+ };
67
70
 
68
- var handleBlur = function handleBlur(event) {
71
+ var handleBlur = function handleBlur() {
69
72
  if (focusVisible !== false) {
70
73
  setFocusVisible(false);
71
74
  }
@@ -74,60 +77,64 @@ var HeaderCell = /*#__PURE__*/React.forwardRef(function (props, ref) {
74
77
  var backgroundColor = props.isHovered ? theme.colors.backgroundSecondary : theme.colors.backgroundPrimary;
75
78
  return /*#__PURE__*/React.createElement("div", {
76
79
  ref: ref,
77
- role: "button",
78
- tabIndex: 0,
79
80
  className: css(_objectSpread(_objectSpread({}, theme.typography.font350), {}, {
80
81
  alignItems: 'center',
81
82
  backgroundColor: backgroundColor,
82
- boxSizing: 'border-box',
83
83
  color: theme.colors.contentPrimary,
84
- cursor: props.sortable ? 'pointer' : null,
85
84
  display: props.isMeasured ? 'inline-flex' : 'flex',
86
85
  flexGrow: 1,
87
86
  height: '100%',
88
- paddingLeft: theme.sizing.scale500,
89
- paddingRight: theme.sizing.scale500,
90
- flexWrap: 'nowrap',
91
- whiteSpace: 'nowrap',
92
- outline: focusVisible ? "3px solid ".concat(theme.colors.accent) : 'none',
93
- outlineOffset: '-3px'
94
- })),
95
- onMouseEnter: props.onMouseEnter,
96
- onMouseLeave: props.onMouseLeave,
97
- onKeyUp: function onKeyUp(event) {
98
- if (event.key === 'Enter') {
99
- props.onSort(props.index);
100
- }
101
- },
102
- onClick: function onClick(event) {
103
- // Avoid column sort if select-all checkbox click.
104
- if (checkboxRef.current && checkboxRef.current.contains(event.target)) {
105
- return;
106
- }
107
-
108
- if (props.sortable) {
109
- props.onSort(props.index);
110
- }
111
- },
112
- onFocus: handleFocus,
113
- onBlur: handleBlur
87
+ paddingLeft: theme.sizing.scale500
88
+ }))
114
89
  }, props.isSelectable && /*#__PURE__*/React.createElement("span", {
115
90
  className: css({
116
91
  paddingRight: theme.sizing.scale300
117
92
  }),
118
93
  ref: checkboxRef
119
- }, /*#__PURE__*/React.createElement(_checkbox.Checkbox // eslint-disable-next-line @typescript-eslint/no-unused-vars
120
- , {
121
- onChange: function onChange(e) {
94
+ }, /*#__PURE__*/React.createElement(_checkbox.Checkbox, {
95
+ onChange: function onChange() {
122
96
  if (props.isSelectedAll || props.isSelectedIndeterminate) {
123
97
  props.onSelectNone();
124
98
  } else {
125
99
  props.onSelectAll();
126
100
  }
127
101
  },
102
+ "aria-label": locale.datatable.selectAllRows,
128
103
  checked: props.isSelectedAll || props.isSelectedIndeterminate,
129
104
  isIndeterminate: props.isSelectedIndeterminate
130
- })), props.title, /*#__PURE__*/React.createElement("div", {
105
+ })), /*#__PURE__*/React.createElement("div", {
106
+ className: css({
107
+ alignItems: 'center',
108
+ backgroundColor: 'transparent',
109
+ border: 'none',
110
+ boxSizing: 'border-box',
111
+ cursor: props.sortable ? 'pointer' : null,
112
+ display: 'flex',
113
+ flexGrow: 1,
114
+ height: '100%',
115
+ outline: focusVisible ? "3px solid ".concat(theme.colors.accent) : 'none',
116
+ outlineOffset: '-3px',
117
+ // paddingLeft: theme.sizing.scale500,
118
+ paddingRight: theme.sizing.scale500,
119
+ whiteSpace: 'nowrap'
120
+ }),
121
+ onMouseEnter: props.onMouseEnter,
122
+ onMouseLeave: props.onMouseLeave,
123
+ onKeyUp: function onKeyUp(event) {
124
+ if (event.key === 'Enter') {
125
+ props.onSort(props.index);
126
+ }
127
+ },
128
+ onClick: function onClick() {
129
+ if (props.sortable) {
130
+ props.onSort(props.index);
131
+ }
132
+ },
133
+ onFocus: handleFocus,
134
+ onBlur: handleBlur,
135
+ role: "button",
136
+ tabIndex: 0
137
+ }, props.title, /*#__PURE__*/React.createElement("div", {
131
138
  className: css({
132
139
  position: 'relative',
133
140
  width: '100%',
@@ -146,7 +153,7 @@ var HeaderCell = /*#__PURE__*/React.forwardRef(function (props, ref) {
146
153
  color: props.sortDirection ? theme.colors.contentPrimary : theme.colors.contentSecondary
147
154
  }), (props.sortDirection === _constants.SORT_DIRECTIONS.ASC || !props.sortDirection) && /*#__PURE__*/React.createElement(_chevronUp.default, {
148
155
  color: props.sortDirection ? theme.colors.contentPrimary : theme.colors.contentSecondary
149
- }))));
156
+ })))));
150
157
  });
151
158
  HeaderCell.displayName = 'HeaderCell';
152
159
  var _default = HeaderCell;
@@ -32,6 +32,8 @@ export declare type DataTableLocale = {
32
32
  booleanFilterFalse: string;
33
33
  booleanColumnTrueShort: string;
34
34
  booleanColumnFalseShort: string;
35
+ selectRow: string;
36
+ selectAllRows: string;
35
37
  };
36
38
  declare const locale: {
37
39
  emptyState: string;
@@ -67,5 +69,7 @@ declare const locale: {
67
69
  booleanFilterFalse: string;
68
70
  booleanColumnTrueShort: string;
69
71
  booleanColumnFalseShort: string;
72
+ selectRow: string;
73
+ selectAllRows: string;
70
74
  };
71
75
  export default locale;
@@ -44,7 +44,9 @@ var locale = {
44
44
  booleanFilterTrue: 'true',
45
45
  booleanFilterFalse: 'false',
46
46
  booleanColumnTrueShort: 'T',
47
- booleanColumnFalseShort: 'F'
47
+ booleanColumnFalseShort: 'F',
48
+ selectRow: 'Select row',
49
+ selectAllRows: 'Select all rows'
48
50
  };
49
51
  var _default = locale;
50
52
  exports.default = _default;
@@ -40,6 +40,8 @@ export type DataTableLocaleT = {|
40
40
  booleanFilterFalse: string,
41
41
  booleanColumnTrueShort: string,
42
42
  booleanColumnFalseShort: string,
43
+ selectRow: string,
44
+ selectAllRows: string,
43
45
  |};
44
46
 
45
47
  const locale = {
@@ -77,6 +79,9 @@ const locale = {
77
79
  booleanFilterFalse: 'false',
78
80
  booleanColumnTrueShort: 'T',
79
81
  booleanColumnFalseShort: 'F',
82
+ selectRow: 'Select row',
83
+ selectAllRows: 'Select all rows',
84
+
80
85
  };
81
86
 
82
87
  export default locale;
@@ -277,12 +277,12 @@ function StatefulDataTable(props) {
277
277
  title: title
278
278
  });
279
279
  }))), Boolean(selectedRowIds.size) && props.batchActions && /*#__PURE__*/React.createElement("div", {
280
- style: {
280
+ className: css({
281
281
  display: 'flex',
282
282
  alignItems: 'center',
283
- paddingTop: theme.sizing.scale400,
284
- paddingBottom: theme.sizing.scale400
285
- }
283
+ paddingTop: theme.sizing.scale300,
284
+ paddingBottom: theme.sizing.scale300
285
+ })
286
286
  }, props.batchActions.map(function (action) {
287
287
  function onClick(event) {
288
288
  action.onClick({
@@ -619,6 +619,7 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
619
619
 
620
620
  return /*#__PURE__*/React.createElement(_locale.LocaleContext.Consumer, null, function (locale) {
621
621
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(PopoverComponent, _extends({
622
+ accessibilityType: _popover.ACCESSIBILITY_TYPE.none,
622
623
  focusLock: false,
623
624
  autoFocus: false,
624
625
  mountNode: _this4.props.mountNode,
@@ -6,6 +6,7 @@ LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import * as React from 'react';
8
8
  import { Checkbox } from '../checkbox';
9
+ import { LocaleContext } from '../locale';
9
10
  import { useStyletron } from '../styles';
10
11
 
11
12
  function Column(options) {
@@ -21,6 +22,7 @@ function Column(options) {
21
22
  // todo(flow->ts) add proper type annotation
22
23
  // eslint-disable-next-line @typescript-eslint/no-explicit-any,react/display-name
23
24
  renderCell: /*#__PURE__*/React.forwardRef((props, ref) => {
25
+ const locale = React.useContext(LocaleContext);
24
26
  const [css, theme] = useStyletron();
25
27
  const ProvidedCell = options.renderCell;
26
28
  let cellBlockAlign = 'flex-start';
@@ -55,6 +57,7 @@ function Column(options) {
55
57
  paddingRight: theme.sizing.scale300
56
58
  })
57
59
  }, /*#__PURE__*/React.createElement(Checkbox, {
60
+ "aria-label": locale.datatable.selectRow,
58
61
  onChange: props.onSelect,
59
62
  checked: props.isSelected,
60
63
  overrides: {
@@ -6,12 +6,14 @@ LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import * as React from 'react';
8
8
  import { Checkbox } from '../checkbox';
9
+ import { LocaleContext } from '../locale';
9
10
  import { useStyletron } from '../styles';
10
11
  import ChevronDown from '../icon/chevron-down';
11
12
  import ChevronUp from '../icon/chevron-up';
12
13
  import { SORT_DIRECTIONS } from './constants';
13
14
  import { isFocusVisible } from '../utils/focusVisible';
14
15
  const HeaderCell = /*#__PURE__*/React.forwardRef((props, ref) => {
16
+ const locale = React.useContext(LocaleContext);
15
17
  const [css, theme] = useStyletron();
16
18
  const [focusVisible, setFocusVisible] = React.useState(false);
17
19
  const checkboxRef = React.useRef(null);
@@ -20,10 +22,9 @@ const HeaderCell = /*#__PURE__*/React.forwardRef((props, ref) => {
20
22
  if (isFocusVisible(event)) {
21
23
  setFocusVisible(true);
22
24
  }
23
- }; // eslint-disable-next-line @typescript-eslint/no-unused-vars
24
-
25
+ };
25
26
 
26
- const handleBlur = event => {
27
+ const handleBlur = () => {
27
28
  if (focusVisible !== false) {
28
29
  setFocusVisible(false);
29
30
  }
@@ -32,23 +33,46 @@ const HeaderCell = /*#__PURE__*/React.forwardRef((props, ref) => {
32
33
  const backgroundColor = props.isHovered ? theme.colors.backgroundSecondary : theme.colors.backgroundPrimary;
33
34
  return /*#__PURE__*/React.createElement("div", {
34
35
  ref: ref,
35
- role: "button",
36
- tabIndex: 0,
37
36
  className: css({ ...theme.typography.font350,
38
37
  alignItems: 'center',
39
38
  backgroundColor,
40
- boxSizing: 'border-box',
41
39
  color: theme.colors.contentPrimary,
42
- cursor: props.sortable ? 'pointer' : null,
43
40
  display: props.isMeasured ? 'inline-flex' : 'flex',
44
41
  flexGrow: 1,
45
42
  height: '100%',
46
- paddingLeft: theme.sizing.scale500,
47
- paddingRight: theme.sizing.scale500,
48
- flexWrap: 'nowrap',
49
- whiteSpace: 'nowrap',
43
+ paddingLeft: theme.sizing.scale500
44
+ })
45
+ }, props.isSelectable && /*#__PURE__*/React.createElement("span", {
46
+ className: css({
47
+ paddingRight: theme.sizing.scale300
48
+ }),
49
+ ref: checkboxRef
50
+ }, /*#__PURE__*/React.createElement(Checkbox, {
51
+ onChange: () => {
52
+ if (props.isSelectedAll || props.isSelectedIndeterminate) {
53
+ props.onSelectNone();
54
+ } else {
55
+ props.onSelectAll();
56
+ }
57
+ },
58
+ "aria-label": locale.datatable.selectAllRows,
59
+ checked: props.isSelectedAll || props.isSelectedIndeterminate,
60
+ isIndeterminate: props.isSelectedIndeterminate
61
+ })), /*#__PURE__*/React.createElement("div", {
62
+ className: css({
63
+ alignItems: 'center',
64
+ backgroundColor: 'transparent',
65
+ border: 'none',
66
+ boxSizing: 'border-box',
67
+ cursor: props.sortable ? 'pointer' : null,
68
+ display: 'flex',
69
+ flexGrow: 1,
70
+ height: '100%',
50
71
  outline: focusVisible ? `3px solid ${theme.colors.accent}` : 'none',
51
- outlineOffset: '-3px'
72
+ outlineOffset: '-3px',
73
+ // paddingLeft: theme.sizing.scale500,
74
+ paddingRight: theme.sizing.scale500,
75
+ whiteSpace: 'nowrap'
52
76
  }),
53
77
  onMouseEnter: props.onMouseEnter,
54
78
  onMouseLeave: props.onMouseLeave,
@@ -57,35 +81,16 @@ const HeaderCell = /*#__PURE__*/React.forwardRef((props, ref) => {
57
81
  props.onSort(props.index);
58
82
  }
59
83
  },
60
- onClick: event => {
61
- // Avoid column sort if select-all checkbox click.
62
- if (checkboxRef.current && checkboxRef.current.contains(event.target)) {
63
- return;
64
- }
65
-
84
+ onClick: () => {
66
85
  if (props.sortable) {
67
86
  props.onSort(props.index);
68
87
  }
69
88
  },
70
89
  onFocus: handleFocus,
71
- onBlur: handleBlur
72
- }, props.isSelectable && /*#__PURE__*/React.createElement("span", {
73
- className: css({
74
- paddingRight: theme.sizing.scale300
75
- }),
76
- ref: checkboxRef
77
- }, /*#__PURE__*/React.createElement(Checkbox // eslint-disable-next-line @typescript-eslint/no-unused-vars
78
- , {
79
- onChange: e => {
80
- if (props.isSelectedAll || props.isSelectedIndeterminate) {
81
- props.onSelectNone();
82
- } else {
83
- props.onSelectAll();
84
- }
85
- },
86
- checked: props.isSelectedAll || props.isSelectedIndeterminate,
87
- isIndeterminate: props.isSelectedIndeterminate
88
- })), props.title, /*#__PURE__*/React.createElement("div", {
90
+ onBlur: handleBlur,
91
+ role: "button",
92
+ tabIndex: 0
93
+ }, props.title, /*#__PURE__*/React.createElement("div", {
89
94
  className: css({
90
95
  position: 'relative',
91
96
  width: '100%',
@@ -104,7 +109,7 @@ const HeaderCell = /*#__PURE__*/React.forwardRef((props, ref) => {
104
109
  color: props.sortDirection ? theme.colors.contentPrimary : theme.colors.contentSecondary
105
110
  }), (props.sortDirection === SORT_DIRECTIONS.ASC || !props.sortDirection) && /*#__PURE__*/React.createElement(ChevronUp, {
106
111
  color: props.sortDirection ? theme.colors.contentPrimary : theme.colors.contentSecondary
107
- }))));
112
+ })))));
108
113
  });
109
114
  HeaderCell.displayName = 'HeaderCell';
110
115
  export default HeaderCell;
@@ -37,6 +37,8 @@ const locale = {
37
37
  booleanFilterTrue: 'true',
38
38
  booleanFilterFalse: 'false',
39
39
  booleanColumnTrueShort: 'T',
40
- booleanColumnFalseShort: 'F'
40
+ booleanColumnFalseShort: 'F',
41
+ selectRow: 'Select row',
42
+ selectAllRows: 'Select all rows'
41
43
  };
42
44
  export default locale;
@@ -190,12 +190,12 @@ export function StatefulDataTable(props) {
190
190
  rows: props.rows,
191
191
  title: title
192
192
  })))), Boolean(selectedRowIds.size) && props.batchActions && /*#__PURE__*/React.createElement("div", {
193
- style: {
193
+ className: css({
194
194
  display: 'flex',
195
195
  alignItems: 'center',
196
- paddingTop: theme.sizing.scale400,
197
- paddingBottom: theme.sizing.scale400
198
- }
196
+ paddingTop: theme.sizing.scale300,
197
+ paddingBottom: theme.sizing.scale300
198
+ })
199
199
  }, props.batchActions.map(action => {
200
200
  function onClick(event) {
201
201
  action.onClick({
@@ -10,7 +10,7 @@ LICENSE file in the root directory of this source tree.
10
10
  */
11
11
  import * as React from 'react';
12
12
  import { MaskedInput } from '../input';
13
- import { Popover, PLACEMENT } from '../popover';
13
+ import { Popover, PLACEMENT, ACCESSIBILITY_TYPE } from '../popover';
14
14
  import Calendar from './calendar';
15
15
  import { getOverrides } from '../helpers/overrides';
16
16
  import getInterpolatedString from '../helpers/i18n-interpolation';
@@ -463,6 +463,7 @@ export default class Datepicker extends React.Component {
463
463
  const [EndDate, endDateProps] = getOverrides(overrides.EndDate, StyledEndDate);
464
464
  const [InputLabel, inputLabelProps] = getOverrides(overrides.InputLabel, StyledInputLabel);
465
465
  return /*#__PURE__*/React.createElement(LocaleContext.Consumer, null, locale => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(PopoverComponent, _extends({
466
+ accessibilityType: ACCESSIBILITY_TYPE.none,
466
467
  focusLock: false,
467
468
  autoFocus: false,
468
469
  mountNode: this.props.mountNode,
@@ -77,7 +77,9 @@ const es_AR = {
77
77
  booleanFilterTrue: 'verdadero',
78
78
  booleanFilterFalse: 'falso',
79
79
  booleanColumnTrueShort: 'V',
80
- booleanColumnFalseShort: 'F'
80
+ booleanColumnFalseShort: 'F',
81
+ selectRow: 'Seleccionar fila',
82
+ selectAllRows: 'Seleccionar todas las filas'
81
83
  },
82
84
  buttongroup: {
83
85
  ariaLabel: 'grupo de botones'
@@ -77,7 +77,9 @@ const tr_TR = {
77
77
  booleanFilterTrue: 'doğru',
78
78
  booleanFilterFalse: 'yanlış',
79
79
  booleanColumnTrueShort: 'D',
80
- booleanColumnFalseShort: 'Y'
80
+ booleanColumnFalseShort: 'Y',
81
+ selectRow: 'satır seç',
82
+ selectAllRows: 'Tüm satırları seç'
81
83
  },
82
84
  buttongroup: {
83
85
  ariaLabel: 'buton grup'
@@ -151,7 +151,7 @@ class PopoverInner extends React.Component {
151
151
  componentDidUpdate(prevProps, prevState) {
152
152
  this.init(prevProps, prevState);
153
153
 
154
- if (this.props.autoFocus && !this.state.autoFocusAfterPositioning && this.popperRef.current !== null && this.popperRef.current.getBoundingClientRect().top > 0) {
154
+ if (this.props.accessibilityType !== ACCESSIBILITY_TYPE.tooltip && this.props.autoFocus && !this.state.autoFocusAfterPositioning && this.popperRef.current !== null && this.popperRef.current.getBoundingClientRect().top > 0) {
155
155
  this.setState({
156
156
  autoFocusAfterPositioning: true
157
157
  });
@@ -270,10 +270,6 @@ class PopoverInner extends React.Component {
270
270
  isOpen
271
271
  } = this.props;
272
272
  const anchorProps = {
273
- 'aria-haspopup': true,
274
- 'aria-expanded': isOpen ? true : false,
275
- // @ts-expect-error todo(flow->ts): should it be here?
276
- key: 'popover-anchor',
277
273
  ref: this.anchorRef
278
274
  };
279
275
  const popoverId = this.getPopoverIdAttr();
@@ -281,6 +277,8 @@ class PopoverInner extends React.Component {
281
277
  if (this.isAccessibilityTypeMenu()) {
282
278
  const relationAttr = this.isClickTrigger() ? 'aria-controls' : 'aria-owns';
283
279
  anchorProps[relationAttr] = isOpen ? popoverId : null;
280
+ anchorProps['aria-haspopup'] = true;
281
+ anchorProps['aria-expanded'] = Boolean(isOpen);
284
282
  } else if (this.isAccessibilityTypeTooltip()) {
285
283
  anchorProps.id = this.getAnchorIdAttr();
286
284
  anchorProps['aria-describedby'] = isOpen ? popoverId : null;
@@ -307,7 +305,6 @@ class PopoverInner extends React.Component {
307
305
  bodyProps.id = popoverId;
308
306
  } else if (this.isAccessibilityTypeTooltip()) {
309
307
  bodyProps.id = popoverId;
310
- bodyProps.role = 'tooltip';
311
308
  }
312
309
 
313
310
  if (this.isHoverTrigger()) {
@@ -371,7 +368,9 @@ class PopoverInner extends React.Component {
371
368
  return /*#__PURE__*/React.cloneElement(anchor, anchorProps);
372
369
  }
373
370
 
374
- return /*#__PURE__*/React.createElement("span", anchorProps, anchor);
371
+ return /*#__PURE__*/React.createElement("span", _extends({
372
+ key: "popover-anchor"
373
+ }, anchorProps), anchor);
375
374
  }
376
375
 
377
376
  renderPopover(renderedContent) {
@@ -444,7 +443,7 @@ class PopoverInner extends React.Component {
444
443
  },
445
444
  onPopperUpdate: this.onPopperUpdate,
446
445
  placement: this.state.placement
447
- }, this.props.focusLock ? /*#__PURE__*/React.createElement(FocusLock, {
446
+ }, this.props.focusLock && this.props.accessibilityType !== ACCESSIBILITY_TYPE.tooltip ? /*#__PURE__*/React.createElement(FocusLock, {
448
447
  disabled: !this.props.focusLock,
449
448
  noFocusGuards: false // see popover-focus-loop.scenario.js for why hover cannot return focus
450
449
  ,
@@ -14,7 +14,7 @@ import DeleteAlt from '../icon/delete-alt';
14
14
  import TriangleDownIcon from '../icon/triangle-down';
15
15
  import SearchIconComponent from '../icon/search';
16
16
  import { LocaleContext } from '../locale';
17
- import { Popover, PLACEMENT } from '../popover';
17
+ import { Popover, PLACEMENT, ACCESSIBILITY_TYPE } from '../popover';
18
18
  import { UIDConsumer } from 'react-uid';
19
19
  import AutosizeInput from './autosize-input';
20
20
  import { TYPE, STATE_CHANGE_TYPE, SIZE } from './constants';
@@ -693,9 +693,7 @@ class Select extends React.Component {
693
693
  }, "Loading"));
694
694
  }
695
695
 
696
- renderValue(valueArray, // eslint-disable-next-line @typescript-eslint/no-unused-vars
697
- isOpen, // eslint-disable-next-line @typescript-eslint/no-unused-vars
698
- locale) {
696
+ renderValue(valueArray) {
699
697
  const {
700
698
  overrides = {}
701
699
  } = this.props;
@@ -752,13 +750,10 @@ class Select extends React.Component {
752
750
 
753
751
  if (!this.props.searchable) {
754
752
  return /*#__PURE__*/React.createElement(InputContainer, _extends({
755
- role: "listbox",
756
753
  "aria-activedescendant": this.state.activeDescendant,
757
- "aria-expanded": isOpen,
758
754
  "aria-describedby": this.props['aria-describedby'],
759
755
  "aria-errormessage": this.props['aria-errormessage'],
760
756
  "aria-disabled": this.props.disabled,
761
- "aria-label": label,
762
757
  "aria-labelledby": this.props['aria-labelledby'],
763
758
  "aria-owns": this.state.isOpen ? listboxId : null,
764
759
  "aria-required": this.props.required || null,
@@ -1006,6 +1001,7 @@ class Select extends React.Component {
1006
1001
  if (!ref) return;
1007
1002
  this.anchor = ref.anchorRef;
1008
1003
  },
1004
+ accessibilityType: ACCESSIBILITY_TYPE.none,
1009
1005
  autoFocus: false,
1010
1006
  focusLock: false,
1011
1007
  mountNode: this.props.mountNode,
@@ -1050,7 +1046,7 @@ class Select extends React.Component {
1050
1046
  onTouchEnd: this.handleTouchEnd,
1051
1047
  onTouchMove: this.handleTouchMove,
1052
1048
  onTouchStart: this.handleTouchStart
1053
- }, sharedProps, controlContainerProps), type === TYPE.search ? this.renderSearch() : null, /*#__PURE__*/React.createElement(ValueContainer, _extends({}, sharedProps, valueContainerProps), this.renderValue(valueArray, isOpen, locale), this.renderInput(listboxId), this.shouldShowPlaceholder() ? /*#__PURE__*/React.createElement(Placeholder, _extends({}, sharedProps, placeholderProps), typeof this.props.placeholder !== 'undefined' ? this.props.placeholder : locale.select.placeholder) : null), /*#__PURE__*/React.createElement(IconsContainer, _extends({}, sharedProps, iconsContainerProps), this.renderLoading(), this.renderClear(), type === TYPE.select ? this.renderArrow() : null))))));
1049
+ }, sharedProps, controlContainerProps), type === TYPE.search ? this.renderSearch() : null, /*#__PURE__*/React.createElement(ValueContainer, _extends({}, sharedProps, valueContainerProps), this.renderValue(valueArray), this.renderInput(listboxId), this.shouldShowPlaceholder() ? /*#__PURE__*/React.createElement(Placeholder, _extends({}, sharedProps, placeholderProps), typeof this.props.placeholder !== 'undefined' ? this.props.placeholder : locale.select.placeholder) : null), /*#__PURE__*/React.createElement(IconsContainer, _extends({}, sharedProps, iconsContainerProps), this.renderLoading(), this.renderClear(), type === TYPE.select ? this.renderArrow() : null))))));
1054
1050
  }
1055
1051
 
1056
1052
  }
@@ -10,11 +10,11 @@ import * as React from 'react';
10
10
  import SelectComponent from './select-component';
11
11
  import Value from './value';
12
12
 
13
- function MultiSelect(props) {
13
+ function SingleSelect(props) {
14
14
  return /*#__PURE__*/React.createElement(SelectComponent, _extends({}, props, {
15
15
  multi: false,
16
16
  valueComponent: Value
17
17
  }));
18
18
  }
19
19
 
20
- export default MultiSelect;
20
+ export default SingleSelect;
@@ -16,7 +16,5 @@ export default function Value(props) {
16
16
  ...restProps
17
17
  } = props;
18
18
  const [SingleValue, singleValueProps] = getOverrides(overrides.SingleValue, StyledSingleValue);
19
- return /*#__PURE__*/React.createElement(SingleValue, _extends({
20
- "aria-selected": "true"
21
- }, restProps, singleValueProps), props.children);
19
+ return /*#__PURE__*/React.createElement(SingleValue, _extends({}, restProps, singleValueProps), props.children);
22
20
  }
@@ -24,6 +24,7 @@ LICENSE file in the root directory of this source tree.
24
24
  */
25
25
  import * as React from 'react';
26
26
  import { Checkbox } from '../checkbox';
27
+ import { LocaleContext } from '../locale';
27
28
  import { useStyletron } from '../styles';
28
29
 
29
30
  function Column(options) {
@@ -43,6 +44,8 @@ function Column(options) {
43
44
  // todo(flow->ts) add proper type annotation
44
45
  // eslint-disable-next-line @typescript-eslint/no-explicit-any,react/display-name
45
46
  renderCell: /*#__PURE__*/React.forwardRef(function (props, ref) {
47
+ var locale = React.useContext(LocaleContext);
48
+
46
49
  var _useStyletron = useStyletron(),
47
50
  _useStyletron2 = _slicedToArray(_useStyletron, 2),
48
51
  css = _useStyletron2[0],
@@ -81,6 +84,7 @@ function Column(options) {
81
84
  paddingRight: theme.sizing.scale300
82
85
  })
83
86
  }, /*#__PURE__*/React.createElement(Checkbox, {
87
+ "aria-label": locale.datatable.selectRow,
84
88
  onChange: props.onSelect,
85
89
  checked: props.isSelected,
86
90
  overrides: {
@@ -24,12 +24,15 @@ LICENSE file in the root directory of this source tree.
24
24
  */
25
25
  import * as React from 'react';
26
26
  import { Checkbox } from '../checkbox';
27
+ import { LocaleContext } from '../locale';
27
28
  import { useStyletron } from '../styles';
28
29
  import ChevronDown from '../icon/chevron-down';
29
30
  import ChevronUp from '../icon/chevron-up';
30
31
  import { SORT_DIRECTIONS } from './constants';
31
32
  import { isFocusVisible } from '../utils/focusVisible';
32
33
  var HeaderCell = /*#__PURE__*/React.forwardRef(function (props, ref) {
34
+ var locale = React.useContext(LocaleContext);
35
+
33
36
  var _useStyletron = useStyletron(),
34
37
  _useStyletron2 = _slicedToArray(_useStyletron, 2),
35
38
  css = _useStyletron2[0],
@@ -46,10 +49,9 @@ var HeaderCell = /*#__PURE__*/React.forwardRef(function (props, ref) {
46
49
  if (isFocusVisible(event)) {
47
50
  setFocusVisible(true);
48
51
  }
49
- }; // eslint-disable-next-line @typescript-eslint/no-unused-vars
50
-
52
+ };
51
53
 
52
- var handleBlur = function handleBlur(event) {
54
+ var handleBlur = function handleBlur() {
53
55
  if (focusVisible !== false) {
54
56
  setFocusVisible(false);
55
57
  }
@@ -58,60 +60,64 @@ var HeaderCell = /*#__PURE__*/React.forwardRef(function (props, ref) {
58
60
  var backgroundColor = props.isHovered ? theme.colors.backgroundSecondary : theme.colors.backgroundPrimary;
59
61
  return /*#__PURE__*/React.createElement("div", {
60
62
  ref: ref,
61
- role: "button",
62
- tabIndex: 0,
63
63
  className: css(_objectSpread(_objectSpread({}, theme.typography.font350), {}, {
64
64
  alignItems: 'center',
65
65
  backgroundColor: backgroundColor,
66
- boxSizing: 'border-box',
67
66
  color: theme.colors.contentPrimary,
68
- cursor: props.sortable ? 'pointer' : null,
69
67
  display: props.isMeasured ? 'inline-flex' : 'flex',
70
68
  flexGrow: 1,
71
69
  height: '100%',
72
- paddingLeft: theme.sizing.scale500,
73
- paddingRight: theme.sizing.scale500,
74
- flexWrap: 'nowrap',
75
- whiteSpace: 'nowrap',
76
- outline: focusVisible ? "3px solid ".concat(theme.colors.accent) : 'none',
77
- outlineOffset: '-3px'
78
- })),
79
- onMouseEnter: props.onMouseEnter,
80
- onMouseLeave: props.onMouseLeave,
81
- onKeyUp: function onKeyUp(event) {
82
- if (event.key === 'Enter') {
83
- props.onSort(props.index);
84
- }
85
- },
86
- onClick: function onClick(event) {
87
- // Avoid column sort if select-all checkbox click.
88
- if (checkboxRef.current && checkboxRef.current.contains(event.target)) {
89
- return;
90
- }
91
-
92
- if (props.sortable) {
93
- props.onSort(props.index);
94
- }
95
- },
96
- onFocus: handleFocus,
97
- onBlur: handleBlur
70
+ paddingLeft: theme.sizing.scale500
71
+ }))
98
72
  }, props.isSelectable && /*#__PURE__*/React.createElement("span", {
99
73
  className: css({
100
74
  paddingRight: theme.sizing.scale300
101
75
  }),
102
76
  ref: checkboxRef
103
- }, /*#__PURE__*/React.createElement(Checkbox // eslint-disable-next-line @typescript-eslint/no-unused-vars
104
- , {
105
- onChange: function onChange(e) {
77
+ }, /*#__PURE__*/React.createElement(Checkbox, {
78
+ onChange: function onChange() {
106
79
  if (props.isSelectedAll || props.isSelectedIndeterminate) {
107
80
  props.onSelectNone();
108
81
  } else {
109
82
  props.onSelectAll();
110
83
  }
111
84
  },
85
+ "aria-label": locale.datatable.selectAllRows,
112
86
  checked: props.isSelectedAll || props.isSelectedIndeterminate,
113
87
  isIndeterminate: props.isSelectedIndeterminate
114
- })), props.title, /*#__PURE__*/React.createElement("div", {
88
+ })), /*#__PURE__*/React.createElement("div", {
89
+ className: css({
90
+ alignItems: 'center',
91
+ backgroundColor: 'transparent',
92
+ border: 'none',
93
+ boxSizing: 'border-box',
94
+ cursor: props.sortable ? 'pointer' : null,
95
+ display: 'flex',
96
+ flexGrow: 1,
97
+ height: '100%',
98
+ outline: focusVisible ? "3px solid ".concat(theme.colors.accent) : 'none',
99
+ outlineOffset: '-3px',
100
+ // paddingLeft: theme.sizing.scale500,
101
+ paddingRight: theme.sizing.scale500,
102
+ whiteSpace: 'nowrap'
103
+ }),
104
+ onMouseEnter: props.onMouseEnter,
105
+ onMouseLeave: props.onMouseLeave,
106
+ onKeyUp: function onKeyUp(event) {
107
+ if (event.key === 'Enter') {
108
+ props.onSort(props.index);
109
+ }
110
+ },
111
+ onClick: function onClick() {
112
+ if (props.sortable) {
113
+ props.onSort(props.index);
114
+ }
115
+ },
116
+ onFocus: handleFocus,
117
+ onBlur: handleBlur,
118
+ role: "button",
119
+ tabIndex: 0
120
+ }, props.title, /*#__PURE__*/React.createElement("div", {
115
121
  className: css({
116
122
  position: 'relative',
117
123
  width: '100%',
@@ -130,7 +136,7 @@ var HeaderCell = /*#__PURE__*/React.forwardRef(function (props, ref) {
130
136
  color: props.sortDirection ? theme.colors.contentPrimary : theme.colors.contentSecondary
131
137
  }), (props.sortDirection === SORT_DIRECTIONS.ASC || !props.sortDirection) && /*#__PURE__*/React.createElement(ChevronUp, {
132
138
  color: props.sortDirection ? theme.colors.contentPrimary : theme.colors.contentSecondary
133
- }))));
139
+ })))));
134
140
  });
135
141
  HeaderCell.displayName = 'HeaderCell';
136
142
  export default HeaderCell;
@@ -37,6 +37,8 @@ var locale = {
37
37
  booleanFilterTrue: 'true',
38
38
  booleanFilterFalse: 'false',
39
39
  booleanColumnTrueShort: 'T',
40
- booleanColumnFalseShort: 'F'
40
+ booleanColumnFalseShort: 'F',
41
+ selectRow: 'Select row',
42
+ selectAllRows: 'Select all rows'
41
43
  };
42
44
  export default locale;
@@ -257,12 +257,12 @@ export function StatefulDataTable(props) {
257
257
  title: title
258
258
  });
259
259
  }))), Boolean(selectedRowIds.size) && props.batchActions && /*#__PURE__*/React.createElement("div", {
260
- style: {
260
+ className: css({
261
261
  display: 'flex',
262
262
  alignItems: 'center',
263
- paddingTop: theme.sizing.scale400,
264
- paddingBottom: theme.sizing.scale400
265
- }
263
+ paddingTop: theme.sizing.scale300,
264
+ paddingBottom: theme.sizing.scale300
265
+ })
266
266
  }, props.batchActions.map(function (action) {
267
267
  function onClick(event) {
268
268
  action.onClick({
@@ -56,7 +56,7 @@ LICENSE file in the root directory of this source tree.
56
56
  */
57
57
  import * as React from 'react';
58
58
  import { MaskedInput } from '../input';
59
- import { Popover, PLACEMENT } from '../popover';
59
+ import { Popover, PLACEMENT, ACCESSIBILITY_TYPE } from '../popover';
60
60
  import Calendar from './calendar';
61
61
  import { getOverrides } from '../helpers/overrides';
62
62
  import getInterpolatedString from '../helpers/i18n-interpolation';
@@ -600,6 +600,7 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
600
600
 
601
601
  return /*#__PURE__*/React.createElement(LocaleContext.Consumer, null, function (locale) {
602
602
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(PopoverComponent, _extends({
603
+ accessibilityType: ACCESSIBILITY_TYPE.none,
603
604
  focusLock: false,
604
605
  autoFocus: false,
605
606
  mountNode: _this4.props.mountNode,
@@ -77,7 +77,9 @@ var es_AR = {
77
77
  booleanFilterTrue: 'verdadero',
78
78
  booleanFilterFalse: 'falso',
79
79
  booleanColumnTrueShort: 'V',
80
- booleanColumnFalseShort: 'F'
80
+ booleanColumnFalseShort: 'F',
81
+ selectRow: 'Seleccionar fila',
82
+ selectAllRows: 'Seleccionar todas las filas'
81
83
  },
82
84
  buttongroup: {
83
85
  ariaLabel: 'grupo de botones'
@@ -77,7 +77,9 @@ var tr_TR = {
77
77
  booleanFilterTrue: 'doğru',
78
78
  booleanFilterFalse: 'yanlış',
79
79
  booleanColumnTrueShort: 'D',
80
- booleanColumnFalseShort: 'Y'
80
+ booleanColumnFalseShort: 'Y',
81
+ selectRow: 'satır seç',
82
+ selectAllRows: 'Tüm satırları seç'
81
83
  },
82
84
  buttongroup: {
83
85
  ariaLabel: 'buton grup'
@@ -197,7 +197,7 @@ var PopoverInner = /*#__PURE__*/function (_React$Component) {
197
197
  value: function componentDidUpdate(prevProps, prevState) {
198
198
  this.init(prevProps, prevState);
199
199
 
200
- if (this.props.autoFocus && !this.state.autoFocusAfterPositioning && this.popperRef.current !== null && this.popperRef.current.getBoundingClientRect().top > 0) {
200
+ if (this.props.accessibilityType !== ACCESSIBILITY_TYPE.tooltip && this.props.autoFocus && !this.state.autoFocusAfterPositioning && this.popperRef.current !== null && this.popperRef.current.getBoundingClientRect().top > 0) {
201
201
  this.setState({
202
202
  autoFocusAfterPositioning: true
203
203
  });
@@ -329,10 +329,6 @@ var PopoverInner = /*#__PURE__*/function (_React$Component) {
329
329
  value: function getAnchorProps() {
330
330
  var isOpen = this.props.isOpen;
331
331
  var anchorProps = {
332
- 'aria-haspopup': true,
333
- 'aria-expanded': isOpen ? true : false,
334
- // @ts-expect-error todo(flow->ts): should it be here?
335
- key: 'popover-anchor',
336
332
  ref: this.anchorRef
337
333
  };
338
334
  var popoverId = this.getPopoverIdAttr();
@@ -340,6 +336,8 @@ var PopoverInner = /*#__PURE__*/function (_React$Component) {
340
336
  if (this.isAccessibilityTypeMenu()) {
341
337
  var relationAttr = this.isClickTrigger() ? 'aria-controls' : 'aria-owns';
342
338
  anchorProps[relationAttr] = isOpen ? popoverId : null;
339
+ anchorProps['aria-haspopup'] = true;
340
+ anchorProps['aria-expanded'] = Boolean(isOpen);
343
341
  } else if (this.isAccessibilityTypeTooltip()) {
344
342
  anchorProps.id = this.getAnchorIdAttr();
345
343
  anchorProps['aria-describedby'] = isOpen ? popoverId : null;
@@ -367,7 +365,6 @@ var PopoverInner = /*#__PURE__*/function (_React$Component) {
367
365
  bodyProps.id = popoverId;
368
366
  } else if (this.isAccessibilityTypeTooltip()) {
369
367
  bodyProps.id = popoverId;
370
- bodyProps.role = 'tooltip';
371
368
  }
372
369
 
373
370
  if (this.isHoverTrigger()) {
@@ -431,7 +428,9 @@ var PopoverInner = /*#__PURE__*/function (_React$Component) {
431
428
  return /*#__PURE__*/React.cloneElement(anchor, anchorProps);
432
429
  }
433
430
 
434
- return /*#__PURE__*/React.createElement("span", anchorProps, anchor);
431
+ return /*#__PURE__*/React.createElement("span", _extends({
432
+ key: "popover-anchor"
433
+ }, anchorProps), anchor);
435
434
  }
436
435
  }, {
437
436
  key: "renderPopover",
@@ -507,7 +506,7 @@ var PopoverInner = /*#__PURE__*/function (_React$Component) {
507
506
  popperOptions: _objectSpread(_objectSpread({}, defaultPopperOptions), this.props.popperOptions),
508
507
  onPopperUpdate: this.onPopperUpdate,
509
508
  placement: this.state.placement
510
- }, this.props.focusLock ? /*#__PURE__*/React.createElement(FocusLock, {
509
+ }, this.props.focusLock && this.props.accessibilityType !== ACCESSIBILITY_TYPE.tooltip ? /*#__PURE__*/React.createElement(FocusLock, {
511
510
  disabled: !this.props.focusLock,
512
511
  noFocusGuards: false // see popover-focus-loop.scenario.js for why hover cannot return focus
513
512
  ,
@@ -63,7 +63,7 @@ import DeleteAlt from '../icon/delete-alt';
63
63
  import TriangleDownIcon from '../icon/triangle-down';
64
64
  import SearchIconComponent from '../icon/search';
65
65
  import { LocaleContext } from '../locale';
66
- import { Popover, PLACEMENT } from '../popover';
66
+ import { Popover, PLACEMENT, ACCESSIBILITY_TYPE } from '../popover';
67
67
  import { UIDConsumer } from 'react-uid';
68
68
  import AutosizeInput from './autosize-input';
69
69
  import { TYPE, STATE_CHANGE_TYPE, SIZE } from './constants';
@@ -818,9 +818,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
818
818
  }
819
819
  }, {
820
820
  key: "renderValue",
821
- value: function renderValue(valueArray, // eslint-disable-next-line @typescript-eslint/no-unused-vars
822
- isOpen, // eslint-disable-next-line @typescript-eslint/no-unused-vars
823
- locale) {
821
+ value: function renderValue(valueArray) {
824
822
  var _this4 = this;
825
823
 
826
824
  var _this$props$overrides2 = this.props.overrides,
@@ -889,13 +887,10 @@ var Select = /*#__PURE__*/function (_React$Component) {
889
887
 
890
888
  if (!this.props.searchable) {
891
889
  return /*#__PURE__*/React.createElement(InputContainer, _extends({
892
- role: "listbox",
893
890
  "aria-activedescendant": this.state.activeDescendant,
894
- "aria-expanded": isOpen,
895
891
  "aria-describedby": this.props['aria-describedby'],
896
892
  "aria-errormessage": this.props['aria-errormessage'],
897
893
  "aria-disabled": this.props.disabled,
898
- "aria-label": label,
899
894
  "aria-labelledby": this.props['aria-labelledby'],
900
895
  "aria-owns": this.state.isOpen ? listboxId : null,
901
896
  "aria-required": this.props.required || null,
@@ -1189,6 +1184,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
1189
1184
  if (!ref) return;
1190
1185
  _this7.anchor = ref.anchorRef;
1191
1186
  },
1187
+ accessibilityType: ACCESSIBILITY_TYPE.none,
1192
1188
  autoFocus: false,
1193
1189
  focusLock: false,
1194
1190
  mountNode: _this7.props.mountNode,
@@ -1235,7 +1231,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
1235
1231
  onTouchEnd: _this7.handleTouchEnd,
1236
1232
  onTouchMove: _this7.handleTouchMove,
1237
1233
  onTouchStart: _this7.handleTouchStart
1238
- }, sharedProps, controlContainerProps), type === TYPE.search ? _this7.renderSearch() : null, /*#__PURE__*/React.createElement(ValueContainer, _extends({}, sharedProps, valueContainerProps), _this7.renderValue(valueArray, isOpen, locale), _this7.renderInput(listboxId), _this7.shouldShowPlaceholder() ? /*#__PURE__*/React.createElement(Placeholder, _extends({}, sharedProps, placeholderProps), typeof _this7.props.placeholder !== 'undefined' ? _this7.props.placeholder : locale.select.placeholder) : null), /*#__PURE__*/React.createElement(IconsContainer, _extends({}, sharedProps, iconsContainerProps), _this7.renderLoading(), _this7.renderClear(), type === TYPE.select ? _this7.renderArrow() : null))));
1234
+ }, sharedProps, controlContainerProps), type === TYPE.search ? _this7.renderSearch() : null, /*#__PURE__*/React.createElement(ValueContainer, _extends({}, sharedProps, valueContainerProps), _this7.renderValue(valueArray), _this7.renderInput(listboxId), _this7.shouldShowPlaceholder() ? /*#__PURE__*/React.createElement(Placeholder, _extends({}, sharedProps, placeholderProps), typeof _this7.props.placeholder !== 'undefined' ? _this7.props.placeholder : locale.select.placeholder) : null), /*#__PURE__*/React.createElement(IconsContainer, _extends({}, sharedProps, iconsContainerProps), _this7.renderLoading(), _this7.renderClear(), type === TYPE.select ? _this7.renderArrow() : null))));
1239
1235
  });
1240
1236
  });
1241
1237
  }
@@ -10,11 +10,11 @@ import * as React from 'react';
10
10
  import SelectComponent from './select-component';
11
11
  import Value from './value';
12
12
 
13
- function MultiSelect(props) {
13
+ function SingleSelect(props) {
14
14
  return /*#__PURE__*/React.createElement(SelectComponent, _extends({}, props, {
15
15
  multi: false,
16
16
  valueComponent: Value
17
17
  }));
18
18
  }
19
19
 
20
- export default MultiSelect;
20
+ export default SingleSelect;
@@ -38,7 +38,5 @@ export default function Value(props) {
38
38
  SingleValue = _getOverrides2[0],
39
39
  singleValueProps = _getOverrides2[1];
40
40
 
41
- return /*#__PURE__*/React.createElement(SingleValue, _extends({
42
- "aria-selected": "true"
43
- }, restProps, singleValueProps), props.children);
41
+ return /*#__PURE__*/React.createElement(SingleValue, _extends({}, restProps, singleValueProps), props.children);
44
42
  }
package/locale/es_AR.js CHANGED
@@ -84,7 +84,9 @@ var es_AR = {
84
84
  booleanFilterTrue: 'verdadero',
85
85
  booleanFilterFalse: 'falso',
86
86
  booleanColumnTrueShort: 'V',
87
- booleanColumnFalseShort: 'F'
87
+ booleanColumnFalseShort: 'F',
88
+ selectRow: 'Seleccionar fila',
89
+ selectAllRows: 'Seleccionar todas las filas'
88
90
  },
89
91
  buttongroup: {
90
92
  ariaLabel: 'grupo de botones'
package/locale/tr_TR.js CHANGED
@@ -84,7 +84,9 @@ var tr_TR = {
84
84
  booleanFilterTrue: 'doğru',
85
85
  booleanFilterFalse: 'yanlış',
86
86
  booleanColumnTrueShort: 'D',
87
- booleanColumnFalseShort: 'Y'
87
+ booleanColumnFalseShort: 'Y',
88
+ selectRow: 'satır seç',
89
+ selectAllRows: 'Tüm satırları seç'
88
90
  },
89
91
  buttongroup: {
90
92
  ariaLabel: 'buton grup'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baseui",
3
- "version": "0.0.0-next-31e82a8",
3
+ "version": "0.0.0-next-e90bd38",
4
4
  "description": "A React Component library implementing the Base design language",
5
5
  "keywords": [
6
6
  "react",
@@ -117,7 +117,7 @@
117
117
  "@typescript-eslint/parser": "^5.26.0",
118
118
  "@zeit/next-css": "^1.0.1",
119
119
  "@zeit/next-mdx": "^1.2.0",
120
- "axe-core": "^4.2.2",
120
+ "axe-core": "^4.4.3",
121
121
  "babel-core": "^7.0.0-bridge.0",
122
122
  "babel-eslint": "10.1.0",
123
123
  "babel-jest": "^24.0.0",
@@ -212,7 +212,7 @@ var PopoverInner = /*#__PURE__*/function (_React$Component) {
212
212
  value: function componentDidUpdate(prevProps, prevState) {
213
213
  this.init(prevProps, prevState);
214
214
 
215
- if (this.props.autoFocus && !this.state.autoFocusAfterPositioning && this.popperRef.current !== null && this.popperRef.current.getBoundingClientRect().top > 0) {
215
+ if (this.props.accessibilityType !== _constants.ACCESSIBILITY_TYPE.tooltip && this.props.autoFocus && !this.state.autoFocusAfterPositioning && this.popperRef.current !== null && this.popperRef.current.getBoundingClientRect().top > 0) {
216
216
  this.setState({
217
217
  autoFocusAfterPositioning: true
218
218
  });
@@ -344,10 +344,6 @@ var PopoverInner = /*#__PURE__*/function (_React$Component) {
344
344
  value: function getAnchorProps() {
345
345
  var isOpen = this.props.isOpen;
346
346
  var anchorProps = {
347
- 'aria-haspopup': true,
348
- 'aria-expanded': isOpen ? true : false,
349
- // @ts-expect-error todo(flow->ts): should it be here?
350
- key: 'popover-anchor',
351
347
  ref: this.anchorRef
352
348
  };
353
349
  var popoverId = this.getPopoverIdAttr();
@@ -355,6 +351,8 @@ var PopoverInner = /*#__PURE__*/function (_React$Component) {
355
351
  if (this.isAccessibilityTypeMenu()) {
356
352
  var relationAttr = this.isClickTrigger() ? 'aria-controls' : 'aria-owns';
357
353
  anchorProps[relationAttr] = isOpen ? popoverId : null;
354
+ anchorProps['aria-haspopup'] = true;
355
+ anchorProps['aria-expanded'] = Boolean(isOpen);
358
356
  } else if (this.isAccessibilityTypeTooltip()) {
359
357
  anchorProps.id = this.getAnchorIdAttr();
360
358
  anchorProps['aria-describedby'] = isOpen ? popoverId : null;
@@ -382,7 +380,6 @@ var PopoverInner = /*#__PURE__*/function (_React$Component) {
382
380
  bodyProps.id = popoverId;
383
381
  } else if (this.isAccessibilityTypeTooltip()) {
384
382
  bodyProps.id = popoverId;
385
- bodyProps.role = 'tooltip';
386
383
  }
387
384
 
388
385
  if (this.isHoverTrigger()) {
@@ -446,7 +443,9 @@ var PopoverInner = /*#__PURE__*/function (_React$Component) {
446
443
  return /*#__PURE__*/React.cloneElement(anchor, anchorProps);
447
444
  }
448
445
 
449
- return /*#__PURE__*/React.createElement("span", anchorProps, anchor);
446
+ return /*#__PURE__*/React.createElement("span", _extends({
447
+ key: "popover-anchor"
448
+ }, anchorProps), anchor);
450
449
  }
451
450
  }, {
452
451
  key: "renderPopover",
@@ -526,7 +525,7 @@ var PopoverInner = /*#__PURE__*/function (_React$Component) {
526
525
  popperOptions: _objectSpread(_objectSpread({}, defaultPopperOptions), this.props.popperOptions),
527
526
  onPopperUpdate: this.onPopperUpdate,
528
527
  placement: this.state.placement
529
- }, this.props.focusLock ? /*#__PURE__*/React.createElement(_reactFocusLock.default, {
528
+ }, this.props.focusLock && this.props.accessibilityType !== _constants.ACCESSIBILITY_TYPE.tooltip ? /*#__PURE__*/React.createElement(_reactFocusLock.default, {
530
529
  disabled: !this.props.focusLock,
531
530
  noFocusGuards: false // see popover-focus-loop.scenario.js for why hover cannot return focus
532
531
  ,
@@ -145,7 +145,7 @@ declare class Select extends React.Component<SelectProps, SelectState> {
145
145
  shouldShowPlaceholder: () => boolean;
146
146
  shouldShowValue: () => boolean;
147
147
  renderLoading(): JSX.Element;
148
- renderValue(valueArray: Value, isOpen: boolean, locale: Locale): React.ReactNode | undefined | null | Array<React.ReactNode | undefined | null>;
148
+ renderValue(valueArray: Value): React.ReactNode | undefined | null | Array<React.ReactNode | undefined | null>;
149
149
  renderInput(listboxId: string): JSX.Element;
150
150
  renderClear(): JSX.Element;
151
151
  renderArrow(): JSX.Element;
@@ -839,9 +839,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
839
839
  }
840
840
  }, {
841
841
  key: "renderValue",
842
- value: function renderValue(valueArray, // eslint-disable-next-line @typescript-eslint/no-unused-vars
843
- isOpen, // eslint-disable-next-line @typescript-eslint/no-unused-vars
844
- locale) {
842
+ value: function renderValue(valueArray) {
845
843
  var _this4 = this;
846
844
 
847
845
  var _this$props$overrides2 = this.props.overrides,
@@ -910,13 +908,10 @@ var Select = /*#__PURE__*/function (_React$Component) {
910
908
 
911
909
  if (!this.props.searchable) {
912
910
  return /*#__PURE__*/React.createElement(InputContainer, _extends({
913
- role: "listbox",
914
911
  "aria-activedescendant": this.state.activeDescendant,
915
- "aria-expanded": isOpen,
916
912
  "aria-describedby": this.props['aria-describedby'],
917
913
  "aria-errormessage": this.props['aria-errormessage'],
918
914
  "aria-disabled": this.props.disabled,
919
- "aria-label": label,
920
915
  "aria-labelledby": this.props['aria-labelledby'],
921
916
  "aria-owns": this.state.isOpen ? listboxId : null,
922
917
  "aria-required": this.props.required || null,
@@ -1210,6 +1205,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
1210
1205
  if (!ref) return;
1211
1206
  _this7.anchor = ref.anchorRef;
1212
1207
  },
1208
+ accessibilityType: _popover.ACCESSIBILITY_TYPE.none,
1213
1209
  autoFocus: false,
1214
1210
  focusLock: false,
1215
1211
  mountNode: _this7.props.mountNode,
@@ -1256,7 +1252,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
1256
1252
  onTouchEnd: _this7.handleTouchEnd,
1257
1253
  onTouchMove: _this7.handleTouchMove,
1258
1254
  onTouchStart: _this7.handleTouchStart
1259
- }, sharedProps, controlContainerProps), type === _constants.TYPE.search ? _this7.renderSearch() : null, /*#__PURE__*/React.createElement(ValueContainer, _extends({}, sharedProps, valueContainerProps), _this7.renderValue(valueArray, isOpen, locale), _this7.renderInput(listboxId), _this7.shouldShowPlaceholder() ? /*#__PURE__*/React.createElement(Placeholder, _extends({}, sharedProps, placeholderProps), typeof _this7.props.placeholder !== 'undefined' ? _this7.props.placeholder : locale.select.placeholder) : null), /*#__PURE__*/React.createElement(IconsContainer, _extends({}, sharedProps, iconsContainerProps), _this7.renderLoading(), _this7.renderClear(), type === _constants.TYPE.select ? _this7.renderArrow() : null))));
1255
+ }, sharedProps, controlContainerProps), type === _constants.TYPE.search ? _this7.renderSearch() : null, /*#__PURE__*/React.createElement(ValueContainer, _extends({}, sharedProps, valueContainerProps), _this7.renderValue(valueArray), _this7.renderInput(listboxId), _this7.shouldShowPlaceholder() ? /*#__PURE__*/React.createElement(Placeholder, _extends({}, sharedProps, placeholderProps), typeof _this7.props.placeholder !== 'undefined' ? _this7.props.placeholder : locale.select.placeholder) : null), /*#__PURE__*/React.createElement(IconsContainer, _extends({}, sharedProps, iconsContainerProps), _this7.renderLoading(), _this7.renderClear(), type === _constants.TYPE.select ? _this7.renderArrow() : null))));
1260
1256
  });
1261
1257
  });
1262
1258
  }
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import type { SelectProps } from './types';
3
- declare function MultiSelect(props: Partial<SelectProps>): JSX.Element;
4
- export default MultiSelect;
3
+ declare function SingleSelect(props: Partial<SelectProps>): JSX.Element;
4
+ export default SingleSelect;
@@ -21,12 +21,12 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
21
21
 
22
22
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
23
23
 
24
- function MultiSelect(props) {
24
+ function SingleSelect(props) {
25
25
  return /*#__PURE__*/React.createElement(_selectComponent.default, _extends({}, props, {
26
26
  multi: false,
27
27
  valueComponent: _value.default
28
28
  }));
29
29
  }
30
30
 
31
- var _default = MultiSelect;
31
+ var _default = SingleSelect;
32
32
  exports.default = _default;
package/select/value.js CHANGED
@@ -48,7 +48,5 @@ function Value(props) {
48
48
  SingleValue = _getOverrides2[0],
49
49
  singleValueProps = _getOverrides2[1];
50
50
 
51
- return /*#__PURE__*/React.createElement(SingleValue, _extends({
52
- "aria-selected": "true"
53
- }, restProps, singleValueProps), props.children);
51
+ return /*#__PURE__*/React.createElement(SingleValue, _extends({}, restProps, singleValueProps), props.children);
54
52
  }