@zohodesk/components 1.0.0-temp-109 → 1.0.0-temp-110

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 (40) hide show
  1. package/README.md +3 -1
  2. package/assets/Appearance/dark/themes/blue/blueDarkComponentTheme.module.css +3 -0
  3. package/assets/Appearance/dark/themes/green/greenDarkComponentTheme.module.css +3 -0
  4. package/assets/Appearance/dark/themes/orange/orangeDarkComponentTheme.module.css +3 -0
  5. package/assets/Appearance/dark/themes/red/redDarkComponentTheme.module.css +3 -0
  6. package/assets/Appearance/dark/themes/yellow/yellowDarkComponentTheme.module.css +3 -0
  7. package/assets/Appearance/default/themes/blue/blueDefaultComponentTheme.module.css +3 -0
  8. package/assets/Appearance/default/themes/green/greenDefaultComponentTheme.module.css +3 -0
  9. package/assets/Appearance/default/themes/orange/orangeDefaultComponentTheme.module.css +3 -0
  10. package/assets/Appearance/default/themes/red/redDefaultComponentTheme.module.css +3 -0
  11. package/assets/Appearance/default/themes/yellow/yellowDefaultComponentTheme.module.css +3 -0
  12. package/assets/Appearance/pureDark/themes/blue/bluePureDarkComponentTheme.module.css +3 -0
  13. package/assets/Appearance/pureDark/themes/green/greenPureDarkComponentTheme.module.css +3 -0
  14. package/assets/Appearance/pureDark/themes/orange/orangePureDarkComponentTheme.module.css +3 -0
  15. package/assets/Appearance/pureDark/themes/red/redPureDarkComponentTheme.module.css +3 -0
  16. package/assets/Appearance/pureDark/themes/yellow/yellowPureDarkComponentTheme.module.css +3 -0
  17. package/css_error.log +0 -0
  18. package/es/AppContainer/AppContainer.js +1 -0
  19. package/es/Button/Button.js +5 -3
  20. package/es/DateTime/CalendarView.js +2 -3
  21. package/es/DropBox/DropBox.js +24 -4
  22. package/es/DropBox/props/defaultProps.js +2 -1
  23. package/es/DropBox/props/propTypes.js +1 -0
  24. package/es/ListItem/ListContainer.js +1 -0
  25. package/es/Switch/Switch.js +7 -5
  26. package/es/Tab/TabContent.js +1 -1
  27. package/es/Tab/Tabs.js +7 -8
  28. package/es/common/a11y.module.css +4 -0
  29. package/lib/AppContainer/AppContainer.js +1 -0
  30. package/lib/Button/Button.js +5 -3
  31. package/lib/DateTime/CalendarView.js +2 -3
  32. package/lib/DropBox/DropBox.js +24 -4
  33. package/lib/DropBox/props/defaultProps.js +2 -1
  34. package/lib/DropBox/props/propTypes.js +1 -0
  35. package/lib/ListItem/ListContainer.js +1 -0
  36. package/lib/Switch/Switch.js +7 -5
  37. package/lib/Tab/TabContent.js +1 -1
  38. package/lib/Tab/Tabs.js +7 -8
  39. package/lib/common/a11y.module.css +4 -0
  40. package/package.json +8 -11
package/README.md CHANGED
@@ -34,7 +34,9 @@ In this Package, we Provide Some Basic Components to Build Web App
34
34
 
35
35
  # 1.0.0-alpha-253
36
36
 
37
- - Tabs, Tooltip => if condition check added to reduce murphy error logs
37
+ - **Tabs, Tooltip** - If condition check added to reduce murphy error logs.
38
+
39
+ - `Accesssility`- Screen Reader support for some components.
38
40
 
39
41
  # 1.0.0-alpha-252
40
42
 
@@ -39,4 +39,7 @@
39
39
 
40
40
  /* dropdown */
41
41
  --zdt_dropdown_darkheading_text: var(--dot_cadetblue);
42
+
43
+ /* focusscope */
44
+ --zdt_a11y_focusScope_focus_border: var(--dot_butterflyblue);
42
45
  }
@@ -39,4 +39,7 @@
39
39
 
40
40
  /* dropdown */
41
41
  --zdt_dropdown_darkheading_text: var(--dot_cadetblue);
42
+
43
+ /* focusscope */
44
+ --zdt_a11y_focusScope_focus_border: #45a159;
42
45
  }
@@ -39,4 +39,7 @@
39
39
 
40
40
  /* dropdown */
41
41
  --zdt_dropdown_darkheading_text: var(--dot_cadetblue);
42
+
43
+ /* focusscope */
44
+ --zdt_a11y_focusScope_focus_border: #ff801f;
42
45
  }
@@ -39,4 +39,7 @@
39
39
 
40
40
  /* dropdown */
41
41
  --zdt_dropdown_darkheading_text: var(--dot_cadetblue);
42
+
43
+ /* focusscope */
44
+ --zdt_a11y_focusScope_focus_border: #e94f4f;
42
45
  }
@@ -39,4 +39,7 @@
39
39
 
40
40
  /* dropdown */
41
41
  --zdt_dropdown_darkheading_text: var(--dot_cadetblue);
42
+
43
+ /* focusscope */
44
+ --zdt_a11y_focusScope_focus_border: #d79835;
42
45
  }
@@ -39,4 +39,7 @@
39
39
 
40
40
  /* dropdown */
41
41
  --zdt_dropdown_darkheading_text: var(--dot_white);
42
+
43
+ /* focusscope */
44
+ --zdt_a11y_focusScope_focus_border: var(--dot_primary);
42
45
  }
@@ -39,4 +39,7 @@
39
39
 
40
40
  /* dropdown */
41
41
  --zdt_dropdown_darkheading_text: var(--dot_white);
42
+
43
+ /* focusscope */
44
+ --zdt_a11y_focusScope_focus_border: #26a942;
42
45
  }
@@ -39,4 +39,7 @@
39
39
 
40
40
  /* dropdown */
41
41
  --zdt_dropdown_darkheading_text: var(--dot_white);
42
+
43
+ /* focusscope */
44
+ --zdt_a11y_focusScope_focus_border: #e57717;
42
45
  }
@@ -39,4 +39,7 @@
39
39
 
40
40
  /* dropdown */
41
41
  --zdt_dropdown_darkheading_text: var(--dot_white);
42
+
43
+ /* focusscope */
44
+ --zdt_a11y_focusScope_focus_border: var(--dot_brightRed);
42
45
  }
@@ -39,4 +39,7 @@
39
39
 
40
40
  /* dropdown */
41
41
  --zdt_dropdown_darkheading_text: var(--dot_white);
42
+
43
+ /* focusscope */
44
+ --zdt_a11y_focusScope_focus_border: #e8b923;
42
45
  }
@@ -39,4 +39,7 @@
39
39
 
40
40
  /* dropdown */
41
41
  --zdt_dropdown_darkheading_text: #999;
42
+
43
+ /* focusscope */
44
+ --zdt_a11y_focusScope_focus_border: var(--dot_butterflyblue);
42
45
  }
@@ -39,4 +39,7 @@
39
39
 
40
40
  /* dropdown */
41
41
  --zdt_dropdown_darkheading_text: #999;
42
+
43
+ /* focusscope */
44
+ --zdt_a11y_focusScope_focus_border: #45a159;
42
45
  }
@@ -39,4 +39,7 @@
39
39
 
40
40
  /* dropdown */
41
41
  --zdt_dropdown_darkheading_text: #999;
42
+
43
+ /* focusscope */
44
+ --zdt_a11y_focusScope_focus_border: #ff801f;
42
45
  }
@@ -39,4 +39,7 @@
39
39
 
40
40
  /* dropdown */
41
41
  --zdt_dropdown_darkheading_text: #999;
42
+
43
+ /* focusscope */
44
+ --zdt_a11y_focusScope_focus_border: #e94f4f;
42
45
  }
@@ -39,4 +39,7 @@
39
39
 
40
40
  /* dropdown */
41
41
  --zdt_dropdown_darkheading_text: #999;
42
+
43
+ /* focusscope */
44
+ --zdt_a11y_focusScope_focus_border: #d79835;
42
45
  }
package/css_error.log ADDED
File without changes
@@ -12,6 +12,7 @@ import '@zohodesk/variables/assets/fontsizeVariables.module.css';
12
12
  import '@zohodesk/variables/lib/fontFamilyVariables.module.css';
13
13
  import '@zohodesk/variables/assets/transitionVariables.module.css';
14
14
  import '@zohodesk/variables/assets/no_transitionVariables.module.css';
15
+ import '../common/a11y.module.css';
15
16
  import style from './AppContainer.module.css';
16
17
  import { getLibraryConfig, setLibraryConfig } from '../Provider/Config';
17
18
  export default class AppContainer extends React.Component {
@@ -1,3 +1,4 @@
1
+ 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); }
1
2
  import React from 'react';
2
3
  import { defaultProps } from './props/defaultProps';
3
4
  import { propTypes } from './props/propTypes';
@@ -24,7 +25,8 @@ export default class Button extends React.Component {
24
25
  needAppearance,
25
26
  getRef,
26
27
  title,
27
- customClass
28
+ customClass,
29
+ customProps
28
30
  } = this.props;
29
31
  let {
30
32
  customButton = '',
@@ -35,7 +37,7 @@ export default class Button extends React.Component {
35
37
  let statusLower = status.toLowerCase();
36
38
  let classList = needAppearance ? `${style[paletteLower]} ${rounded ? style.rounded : ''} ${!children ? style[size.toLowerCase()] : `${style[`${size}Btn`]}
37
39
  ${rounded ? style[`${size}Btn${paletteLower}`] : ''}`} ${statusLower !== 'none' ? style.loader : ''}` : `${style.default}`;
38
- return /*#__PURE__*/React.createElement("button", {
40
+ return /*#__PURE__*/React.createElement("button", _extends({
39
41
  className: `${customButton} ${classList} ${isBold ? style.bold : ''} `,
40
42
  "data-id": disabled ? `${dataId}_disabled` : dataId,
41
43
  disabled: disabled || statusLower === 'loading',
@@ -43,7 +45,7 @@ export default class Button extends React.Component {
43
45
  "data-title": title,
44
46
  type: "button",
45
47
  ref: getRef
46
- }, children ? children : text, statusLower !== 'none' && needAppearance && /*#__PURE__*/React.createElement("div", {
48
+ }, customProps), children ? children : text, statusLower !== 'none' && needAppearance && /*#__PURE__*/React.createElement("div", {
47
49
  className: style.overlay
48
50
  }, /*#__PURE__*/React.createElement("div", {
49
51
  className: `${customStatusSize} ${statusLower === 'loading' ? `${style.loading} ${style[`${size}loading`] ? style[`${size}loading`] : ''}` : style.success}`
@@ -94,7 +94,6 @@ export default class CalendarView extends React.PureComponent {
94
94
  const prevMonthEnd = getMonthEnd(prevMonth, prevYear);
95
95
  const prevDate = prevMonthEnd - (userSeeDay - 1) + incremleti;
96
96
  isSelectedDay = prevDate === parseInt(date) && parseInt(month) === prevMonth && parseInt(year) === prevYear ? true : false;
97
- isToday = prevDate === incremday && todayMonth === userSeeMonth && todayYear === userSeeYear ? true : false;
98
97
  output = /*#__PURE__*/React.createElement(Span, {
99
98
  i: i,
100
99
  isActive: isSelectedDay,
@@ -115,7 +114,6 @@ export default class CalendarView extends React.PureComponent {
115
114
  }
116
115
  const nextDate = incremleti - (userSeeDay - 1) - monthEnd;
117
116
  isSelectedDay = nextDate === parseInt(date) && parseInt(month) === nextMonth && parseInt(year) === nextYear ? true : false;
118
- isToday = nextDate === incremday && todayMonth === userSeeMonth && todayYear === userSeeYear ? true : false;
119
117
  output = /*#__PURE__*/React.createElement(Span, {
120
118
  i: i,
121
119
  isActive: isSelectedDay,
@@ -149,7 +147,8 @@ export default class CalendarView extends React.PureComponent {
149
147
  })();
150
148
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DaysRow, {
151
149
  dayNames: dayNames,
152
- dayNamesShort: dayNamesShort
150
+ dayNamesShort: dayNamesShort,
151
+ ariaLabel: dayNamesShort
153
152
  }), /*#__PURE__*/React.createElement("div", {
154
153
  "data-id": `${dataId}_dateContainer`,
155
154
  className: `${style.dateContainer} ${needBorder ? style.separator : ''}`
@@ -9,6 +9,7 @@ import { positionMapping } from './DropBoxPositionMapping.json';
9
9
  import { getZIndex } from '../Provider/ZindexProvider';
10
10
  import { getLibraryConfig } from '../Provider/Config';
11
11
  import LibraryContext from '../Provider/LibraryContextInit';
12
+ import FocusScope from '@zohodesk/a11y/es/FocusScope/FocusScope';
12
13
  export class DropBoxElement extends React.Component {
13
14
  constructor(props) {
14
15
  super(props);
@@ -59,7 +60,8 @@ export class DropBoxElement extends React.Component {
59
60
  positionsOffset,
60
61
  targetOffset,
61
62
  zIndexStyle,
62
- customStyle
63
+ customStyle,
64
+ subContainerRef
63
65
  } = this.props;
64
66
  let {
65
67
  isReducedMotion
@@ -146,9 +148,11 @@ export class DropBoxElement extends React.Component {
146
148
  "aria-labelledby": ariaLabelledby,
147
149
  tabIndex: tabIndex
148
150
  }, /*#__PURE__*/React.createElement("div", {
151
+ tabIndex: "-1",
149
152
  className: `${subContainerClass} ${style[`${palette}Palette`]}`,
150
153
  onClick: onClick,
151
- "data-id": `${dataId}_subcontainer`
154
+ "data-id": `${dataId}_subcontainer`,
155
+ ref: subContainerRef
152
156
  }, isModel ? /*#__PURE__*/React.createElement("div", {
153
157
  className: style.closeBar
154
158
  }) : null, isArrow && !isModel && /*#__PURE__*/React.createElement("div", {
@@ -165,6 +169,7 @@ export default class DropBox extends React.Component {
165
169
  super(props);
166
170
  this.getNextIndex = getZIndex(this);
167
171
  this.onFreezeClick = this.onFreezeClick.bind(this);
172
+ this.createRef = /*#__PURE__*/React.createRef();
168
173
  }
169
174
  onFreezeClick(e) {
170
175
  e && e.stopPropagation();
@@ -176,7 +181,9 @@ export default class DropBox extends React.Component {
176
181
  isActive,
177
182
  isAbsolutePositioningNeeded,
178
183
  needAutoZindex,
179
- isRestrictScroll
184
+ isRestrictScroll,
185
+ needFocusScope,
186
+ onClose
180
187
  } = this.props;
181
188
  let windowWidth,
182
189
  mobileWidth = getLibraryConfig('mobileWidth'),
@@ -193,7 +200,20 @@ export default class DropBox extends React.Component {
193
200
  const {
194
201
  direction
195
202
  } = this.context || {};
196
- const dropBoxEle = /*#__PURE__*/React.createElement(DropBoxElement, _extends({
203
+ const dropBoxEle = needFocusScope ? /*#__PURE__*/React.createElement(FocusScope, {
204
+ focusClose: onClose,
205
+ elementRef: this.createRef,
206
+ autoFocus: true,
207
+ restoreFocus: true,
208
+ focusArrowLoop: true,
209
+ enableEnterAction: true
210
+ }, /*#__PURE__*/React.createElement(DropBoxElement, _extends({
211
+ isModel: isModel,
212
+ direction: direction
213
+ }, this.props, {
214
+ zIndexStyle: zIndexStyle,
215
+ subContainerRef: this.createRef
216
+ }))) : /*#__PURE__*/React.createElement(DropBoxElement, _extends({
197
217
  isModel: isModel,
198
218
  direction: direction
199
219
  }, this.props, {
@@ -16,5 +16,6 @@ export const defaultProps = {
16
16
  palette: 'default',
17
17
  needAutoZindex: true,
18
18
  portalId: 'portal1',
19
- isRestrictScroll: false
19
+ isRestrictScroll: false,
20
+ needFocusScope: false
20
21
  };
@@ -22,6 +22,7 @@ export const propTypes = {
22
22
  left: PropTypes.number,
23
23
  needResponsive: PropTypes.bool,
24
24
  onClick: PropTypes.func,
25
+ needFocusScope: PropTypes.bool,
25
26
  right: PropTypes.number,
26
27
  size: PropTypes.oneOf(['mini', 'xmini', 'xsmall', 'small', 'medium', 'large', 'mlarge', 'xlarge', 'xxlarge', 'default']),
27
28
  top: PropTypes.number,
@@ -66,6 +66,7 @@ const ListContainer = props => {
66
66
  }
67
67
  return /*#__PURE__*/React.createElement(Container, _extends({
68
68
  role: role,
69
+ "data-a11y-inside-focus": true,
69
70
  "aria-selected": ariaSelected,
70
71
  "aria-label": ariaLabel,
71
72
  isCover: false,
@@ -55,7 +55,8 @@ export default class Switch extends React.Component {
55
55
  "data-title": disabled ? disableTitle : title,
56
56
  "aria-checked": checked,
57
57
  role: "switch",
58
- tabIndex: isReadOnly || disabled ? '-1' : '0'
58
+ tabIndex: isReadOnly || disabled ? '-1' : '0',
59
+ onClick: !disabled || !isReadOnly ? this.onChange : null
59
60
  }, SwitchProps), /*#__PURE__*/React.createElement(Box, {
60
61
  className: `${style[size]} ${customSwitchSize}`
61
62
  }, /*#__PURE__*/React.createElement("input", {
@@ -66,8 +67,8 @@ export default class Switch extends React.Component {
66
67
  value: value,
67
68
  checked: checked,
68
69
  disabled: disabled,
69
- readOnly: isReadOnly,
70
- onClick: !disabled || !isReadOnly ? this.onChange : null
70
+ readOnly: isReadOnly
71
+ // onClick={!disabled || !isReadOnly ? this.onChange : null}
71
72
  }), /*#__PURE__*/React.createElement("label", {
72
73
  htmlFor: id,
73
74
  "data-id": dataId,
@@ -77,8 +78,9 @@ export default class Switch extends React.Component {
77
78
  palette: labelPalette,
78
79
  id: id,
79
80
  size: labelSize,
80
- type: "subtitle",
81
- onClick: !disabled || !isReadOnly ? this.onChange : null,
81
+ type: "subtitle"
82
+ // onClick={!disabled || !isReadOnly ? this.onChange : null}
83
+ ,
82
84
  customClass: customLabel
83
85
  }, LabelProps)));
84
86
  }
@@ -18,7 +18,7 @@ const TabContent = _ref => {
18
18
  dataId: `${dataId}_TabContent`,
19
19
  isScrollAttribute: true,
20
20
  "aria-labelledby": id,
21
- tabindex: "0",
21
+ tabindex: "-1",
22
22
  role: "tabpanel"
23
23
  }, children);
24
24
  };
package/es/Tab/Tabs.js CHANGED
@@ -424,19 +424,16 @@ class Tabs extends React.Component {
424
424
  }, classProps));
425
425
  }), React.Children.count(moreTabs) ? /*#__PURE__*/React.createElement(Box, {
426
426
  className: `${tabsStyle.menu} `
427
- }, /*#__PURE__*/React.createElement(Container, _extends({
428
- className: `${btnstyle.buttonReset} ${moreButtonClass} ${isPopupOpen ? {
429
- moreButtonActiveClass
430
- } : ''}`,
427
+ }, /*#__PURE__*/React.createElement(Container, {
428
+ className: `${btnstyle.buttonReset} ${moreButtonClass} ${isPopupOpen ? moreButtonActiveClass : ''}`,
431
429
  align: "both",
432
430
  onClick: this.togglePopup,
433
431
  dataId: "moreTabs",
434
- eleRef: getTargetRef
435
- }, MoreButtonProps, {
432
+ eleRef: getTargetRef,
436
433
  "aria-label": "MoreTabs",
437
434
  role: "tab",
438
435
  tagName: "button"
439
- }), /*#__PURE__*/React.createElement(Icon, {
436
+ }, /*#__PURE__*/React.createElement(Icon, {
440
437
  name: iconName,
441
438
  size: iconSize
442
439
  })), isPopupOpen && /*#__PURE__*/React.createElement(ResponsiveReceiver, {
@@ -458,7 +455,9 @@ class Tabs extends React.Component {
458
455
  isBoxPaddingNeed: true,
459
456
  isArrow: false
460
457
  }, DropBoxProps, {
461
- isResponsivePadding: true
458
+ isResponsivePadding: true,
459
+ needFocusScope: true,
460
+ onClose: this.togglePopup
462
461
  }), getCustomDropBoxHeaderPlaceHolder && getCustomDropBoxHeaderPlaceHolder(this.props), /*#__PURE__*/React.createElement(Box, {
463
462
  flexible: true,
464
463
  shrink: true,
@@ -0,0 +1,4 @@
1
+ :root {
2
+ --lib_a11y_focusScope_focus_border:var(--zdt_a11y_focusScope_focus_border);
3
+ --lib_a11y_focusScope_focus_bg:var(--zdt_listitem_highlight_bg);
4
+ }
@@ -18,6 +18,7 @@ require("@zohodesk/variables/assets/fontsizeVariables.module.css");
18
18
  require("@zohodesk/variables/lib/fontFamilyVariables.module.css");
19
19
  require("@zohodesk/variables/assets/transitionVariables.module.css");
20
20
  require("@zohodesk/variables/assets/no_transitionVariables.module.css");
21
+ require("../common/a11y.module.css");
21
22
  var _AppContainerModule = _interopRequireDefault(require("./AppContainer.module.css"));
22
23
  var _Config = require("../Provider/Config");
23
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -10,6 +10,7 @@ var _defaultProps = require("./props/defaultProps");
10
10
  var _propTypes = require("./props/propTypes");
11
11
  var _ButtonModule = _interopRequireDefault(require("./Button.module.css"));
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
+ 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); }
13
14
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
14
15
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
15
16
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
@@ -50,7 +51,8 @@ var Button = /*#__PURE__*/function (_React$Component) {
50
51
  needAppearance = _this$props.needAppearance,
51
52
  getRef = _this$props.getRef,
52
53
  title = _this$props.title,
53
- customClass = _this$props.customClass;
54
+ customClass = _this$props.customClass,
55
+ customProps = _this$props.customProps;
54
56
  var _customClass$customBu = customClass.customButton,
55
57
  customButton = _customClass$customBu === void 0 ? '' : _customClass$customBu,
56
58
  _customClass$customSt = customClass.customStatus,
@@ -60,7 +62,7 @@ var Button = /*#__PURE__*/function (_React$Component) {
60
62
  var paletteLower = palette.toLowerCase();
61
63
  var statusLower = status.toLowerCase();
62
64
  var classList = needAppearance ? "".concat(_ButtonModule["default"][paletteLower], " ").concat(rounded ? _ButtonModule["default"].rounded : '', " ").concat(!children ? _ButtonModule["default"][size.toLowerCase()] : "".concat(_ButtonModule["default"]["".concat(size, "Btn")], " \n ").concat(rounded ? _ButtonModule["default"]["".concat(size, "Btn").concat(paletteLower)] : ''), " ").concat(statusLower !== 'none' ? _ButtonModule["default"].loader : '') : "".concat(_ButtonModule["default"]["default"]);
63
- return /*#__PURE__*/_react["default"].createElement("button", {
65
+ return /*#__PURE__*/_react["default"].createElement("button", _extends({
64
66
  className: "".concat(customButton, " ").concat(classList, " ").concat(isBold ? _ButtonModule["default"].bold : '', " "),
65
67
  "data-id": disabled ? "".concat(dataId, "_disabled") : dataId,
66
68
  disabled: disabled || statusLower === 'loading',
@@ -68,7 +70,7 @@ var Button = /*#__PURE__*/function (_React$Component) {
68
70
  "data-title": title,
69
71
  type: "button",
70
72
  ref: getRef
71
- }, children ? children : text, statusLower !== 'none' && needAppearance && /*#__PURE__*/_react["default"].createElement("div", {
73
+ }, customProps), children ? children : text, statusLower !== 'none' && needAppearance && /*#__PURE__*/_react["default"].createElement("div", {
72
74
  className: _ButtonModule["default"].overlay
73
75
  }, /*#__PURE__*/_react["default"].createElement("div", {
74
76
  className: "".concat(customStatusSize, " ").concat(statusLower === 'loading' ? "".concat(_ButtonModule["default"].loading, " ").concat(_ButtonModule["default"]["".concat(size, "loading")] ? _ButtonModule["default"]["".concat(size, "loading")] : '') : _ButtonModule["default"].success)
@@ -117,7 +117,6 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
117
117
  var prevMonthEnd = (0, _common.getMonthEnd)(prevMonth, prevYear);
118
118
  var prevDate = prevMonthEnd - (userSeeDay - 1) + incremleti;
119
119
  isSelectedDay = prevDate === parseInt(date) && parseInt(month) === prevMonth && parseInt(year) === prevYear ? true : false;
120
- isToday = prevDate === incremday && todayMonth === userSeeMonth && todayYear === userSeeYear ? true : false;
121
120
  output = /*#__PURE__*/_react["default"].createElement(Span, {
122
121
  i: i,
123
122
  isActive: isSelectedDay,
@@ -138,7 +137,6 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
138
137
  }
139
138
  var nextDate = incremleti - (userSeeDay - 1) - monthEnd;
140
139
  isSelectedDay = nextDate === parseInt(date) && parseInt(month) === nextMonth && parseInt(year) === nextYear ? true : false;
141
- isToday = nextDate === incremday && todayMonth === userSeeMonth && todayYear === userSeeYear ? true : false;
142
140
  output = /*#__PURE__*/_react["default"].createElement(Span, {
143
141
  i: i,
144
142
  isActive: isSelectedDay,
@@ -172,7 +170,8 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
172
170
  }();
173
171
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_DaysRow["default"], {
174
172
  dayNames: dayNames,
175
- dayNamesShort: dayNamesShort
173
+ dayNamesShort: dayNamesShort,
174
+ ariaLabel: dayNamesShort
176
175
  }), /*#__PURE__*/_react["default"].createElement("div", {
177
176
  "data-id": "".concat(dataId, "_dateContainer"),
178
177
  className: "".concat(_DateTimeModule["default"].dateContainer, " ").concat(needBorder ? _DateTimeModule["default"].separator : '')
@@ -15,6 +15,7 @@ var _DropBoxPositionMapping = require("./DropBoxPositionMapping.json");
15
15
  var _ZindexProvider = require("../Provider/ZindexProvider");
16
16
  var _Config = require("../Provider/Config");
17
17
  var _LibraryContextInit = _interopRequireDefault(require("../Provider/LibraryContextInit"));
18
+ var _FocusScope = _interopRequireDefault(require("@zohodesk/a11y/es/FocusScope/FocusScope"));
18
19
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
20
  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); }
20
21
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -87,7 +88,8 @@ var DropBoxElement = /*#__PURE__*/function (_React$Component) {
87
88
  positionsOffset = _this$props2.positionsOffset,
88
89
  targetOffset = _this$props2.targetOffset,
89
90
  zIndexStyle = _this$props2.zIndexStyle,
90
- customStyle = _this$props2.customStyle;
91
+ customStyle = _this$props2.customStyle,
92
+ subContainerRef = _this$props2.subContainerRef;
91
93
  var _ref = this.context || {},
92
94
  isReducedMotion = _ref.isReducedMotion;
93
95
  if (!isAbsolutePositioningNeeded && size === 'default' && !isActive) {
@@ -172,9 +174,11 @@ var DropBoxElement = /*#__PURE__*/function (_React$Component) {
172
174
  "aria-labelledby": ariaLabelledby,
173
175
  tabIndex: tabIndex
174
176
  }, /*#__PURE__*/_react["default"].createElement("div", {
177
+ tabIndex: "-1",
175
178
  className: "".concat(subContainerClass, " ").concat(_DropBoxModule["default"]["".concat(palette, "Palette")]),
176
179
  onClick: onClick,
177
- "data-id": "".concat(dataId, "_subcontainer")
180
+ "data-id": "".concat(dataId, "_subcontainer"),
181
+ ref: subContainerRef
178
182
  }, isModel ? /*#__PURE__*/_react["default"].createElement("div", {
179
183
  className: _DropBoxModule["default"].closeBar
180
184
  }) : null, isArrow && !isModel && /*#__PURE__*/_react["default"].createElement("div", {
@@ -198,6 +202,7 @@ var DropBox = /*#__PURE__*/function (_React$Component2) {
198
202
  _this2 = _super2.call(this, props);
199
203
  _this2.getNextIndex = (0, _ZindexProvider.getZIndex)(_assertThisInitialized(_this2));
200
204
  _this2.onFreezeClick = _this2.onFreezeClick.bind(_assertThisInitialized(_this2));
205
+ _this2.createRef = /*#__PURE__*/_react["default"].createRef();
201
206
  return _this2;
202
207
  }
203
208
  _createClass(DropBox, [{
@@ -214,7 +219,9 @@ var DropBox = /*#__PURE__*/function (_React$Component2) {
214
219
  isActive = _this$props3.isActive,
215
220
  isAbsolutePositioningNeeded = _this$props3.isAbsolutePositioningNeeded,
216
221
  needAutoZindex = _this$props3.needAutoZindex,
217
- isRestrictScroll = _this$props3.isRestrictScroll;
222
+ isRestrictScroll = _this$props3.isRestrictScroll,
223
+ needFocusScope = _this$props3.needFocusScope,
224
+ onClose = _this$props3.onClose;
218
225
  var windowWidth,
219
226
  mobileWidth = (0, _Config.getLibraryConfig)('mobileWidth'),
220
227
  isModel = false;
@@ -229,7 +236,20 @@ var DropBox = /*#__PURE__*/function (_React$Component2) {
229
236
  } : {};
230
237
  var _ref2 = this.context || {},
231
238
  direction = _ref2.direction;
232
- var dropBoxEle = /*#__PURE__*/_react["default"].createElement(DropBoxElement, _extends({
239
+ var dropBoxEle = needFocusScope ? /*#__PURE__*/_react["default"].createElement(_FocusScope["default"], {
240
+ focusClose: onClose,
241
+ elementRef: this.createRef,
242
+ autoFocus: true,
243
+ restoreFocus: true,
244
+ focusArrowLoop: true,
245
+ enableEnterAction: true
246
+ }, /*#__PURE__*/_react["default"].createElement(DropBoxElement, _extends({
247
+ isModel: isModel,
248
+ direction: direction
249
+ }, this.props, {
250
+ zIndexStyle: zIndexStyle,
251
+ subContainerRef: this.createRef
252
+ }))) : /*#__PURE__*/_react["default"].createElement(DropBoxElement, _extends({
233
253
  isModel: isModel,
234
254
  direction: direction
235
255
  }, this.props, {
@@ -22,6 +22,7 @@ var defaultProps = {
22
22
  palette: 'default',
23
23
  needAutoZindex: true,
24
24
  portalId: 'portal1',
25
- isRestrictScroll: false
25
+ isRestrictScroll: false,
26
+ needFocusScope: false
26
27
  };
27
28
  exports.defaultProps = defaultProps;
@@ -29,6 +29,7 @@ var propTypes = {
29
29
  left: _propTypes["default"].number,
30
30
  needResponsive: _propTypes["default"].bool,
31
31
  onClick: _propTypes["default"].func,
32
+ needFocusScope: _propTypes["default"].bool,
32
33
  right: _propTypes["default"].number,
33
34
  size: _propTypes["default"].oneOf(['mini', 'xmini', 'xsmall', 'small', 'medium', 'large', 'mlarge', 'xlarge', 'xxlarge', 'default']),
34
35
  top: _propTypes["default"].number,
@@ -68,6 +68,7 @@ var ListContainer = function ListContainer(props) {
68
68
  }
69
69
  return /*#__PURE__*/_react["default"].createElement(_Layout.Container, _extends({
70
70
  role: role,
71
+ "data-a11y-inside-focus": true,
71
72
  "aria-selected": ariaSelected,
72
73
  "aria-label": ariaLabel,
73
74
  isCover: false,
@@ -82,7 +82,8 @@ var Switch = /*#__PURE__*/function (_React$Component) {
82
82
  "data-title": disabled ? disableTitle : title,
83
83
  "aria-checked": checked,
84
84
  role: "switch",
85
- tabIndex: isReadOnly || disabled ? '-1' : '0'
85
+ tabIndex: isReadOnly || disabled ? '-1' : '0',
86
+ onClick: !disabled || !isReadOnly ? this.onChange : null
86
87
  }, SwitchProps), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
87
88
  className: "".concat(_SwitchModule["default"][size], " ").concat(customSwitchSize)
88
89
  }, /*#__PURE__*/_react["default"].createElement("input", {
@@ -93,8 +94,8 @@ var Switch = /*#__PURE__*/function (_React$Component) {
93
94
  value: value,
94
95
  checked: checked,
95
96
  disabled: disabled,
96
- readOnly: isReadOnly,
97
- onClick: !disabled || !isReadOnly ? this.onChange : null
97
+ readOnly: isReadOnly
98
+ // onClick={!disabled || !isReadOnly ? this.onChange : null}
98
99
  }), /*#__PURE__*/_react["default"].createElement("label", {
99
100
  htmlFor: id,
100
101
  "data-id": dataId,
@@ -104,8 +105,9 @@ var Switch = /*#__PURE__*/function (_React$Component) {
104
105
  palette: labelPalette,
105
106
  id: id,
106
107
  size: labelSize,
107
- type: "subtitle",
108
- onClick: !disabled || !isReadOnly ? this.onChange : null,
108
+ type: "subtitle"
109
+ // onClick={!disabled || !isReadOnly ? this.onChange : null}
110
+ ,
109
111
  customClass: customLabel
110
112
  }, LabelProps)));
111
113
  }
@@ -23,7 +23,7 @@ var TabContent = function TabContent(_ref) {
23
23
  dataId: "".concat(dataId, "_TabContent"),
24
24
  isScrollAttribute: true,
25
25
  "aria-labelledby": id,
26
- tabindex: "0",
26
+ tabindex: "-1",
27
27
  role: "tabpanel"
28
28
  }, children);
29
29
  };
package/lib/Tab/Tabs.js CHANGED
@@ -459,19 +459,16 @@ var Tabs = /*#__PURE__*/function (_React$Component) {
459
459
  }, classProps));
460
460
  }), _react["default"].Children.count(moreTabs) ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
461
461
  className: "".concat(_TabsModule["default"].menu, " ")
462
- }, /*#__PURE__*/_react["default"].createElement(_Layout.Container, _extends({
463
- className: "".concat(_semanticButtonModule["default"].buttonReset, " ").concat(moreButtonClass, " ").concat(isPopupOpen ? {
464
- moreButtonActiveClass: moreButtonActiveClass
465
- } : ''),
462
+ }, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
463
+ className: "".concat(_semanticButtonModule["default"].buttonReset, " ").concat(moreButtonClass, " ").concat(isPopupOpen ? moreButtonActiveClass : ''),
466
464
  align: "both",
467
465
  onClick: this.togglePopup,
468
466
  dataId: "moreTabs",
469
- eleRef: getTargetRef
470
- }, MoreButtonProps, {
467
+ eleRef: getTargetRef,
471
468
  "aria-label": "MoreTabs",
472
469
  role: "tab",
473
470
  tagName: "button"
474
- }), /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
471
+ }, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
475
472
  name: iconName,
476
473
  size: iconSize
477
474
  })), isPopupOpen && /*#__PURE__*/_react["default"].createElement(_CustomResponsive.ResponsiveReceiver, {
@@ -491,7 +488,9 @@ var Tabs = /*#__PURE__*/function (_React$Component) {
491
488
  isBoxPaddingNeed: true,
492
489
  isArrow: false
493
490
  }, DropBoxProps, {
494
- isResponsivePadding: true
491
+ isResponsivePadding: true,
492
+ needFocusScope: true,
493
+ onClose: _this8.togglePopup
495
494
  }), getCustomDropBoxHeaderPlaceHolder && getCustomDropBoxHeaderPlaceHolder(_this8.props), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
496
495
  flexible: true,
497
496
  shrink: true,
@@ -0,0 +1,4 @@
1
+ :root {
2
+ --lib_a11y_focusScope_focus_border:var(--zdt_a11y_focusScope_focus_border);
3
+ --lib_a11y_focusScope_focus_bg:var(--zdt_listitem_highlight_bg);
4
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/components",
3
- "version": "1.0.0-temp-109",
3
+ "version": "1.0.0-temp-110",
4
4
  "main": "es/index.js",
5
5
  "module": "es/index.js",
6
6
  "private": false,
@@ -8,14 +8,9 @@
8
8
  "access": "public"
9
9
  },
10
10
  "author": "Z Team",
11
- "homepage": "https://www.npmjs.com/search?q=@zohodesk",
11
+ "homepage":"https://www.npmjs.com/search?q=@zohodesk",
12
12
  "license": "ISC",
13
- "keywords": [
14
- "DOT",
15
- "ZOHODESK",
16
- "ZTEAM",
17
- "LIBRARY"
18
- ],
13
+ "keywords":["DOT","ZOHODESK","ZTEAM","LIBRARY"],
19
14
  "scripts": {
20
15
  "build:docs": "react-cli build:docs",
21
16
  "lint": "react-cli lint",
@@ -52,7 +47,8 @@
52
47
  "@zohodesk/virtualizer": "1.0.3",
53
48
  "velocity-react": "1.4.3",
54
49
  "react-sortable-hoc": "^0.8.3",
55
- "@zohodesk/svg": "1.0.0-beta.48"
50
+ "@zohodesk/svg": "1.0.0-beta.48",
51
+ "@zohodesk/a11y": "1.3.4"
56
52
  },
57
53
  "dependencies": {
58
54
  "hoist-non-react-statics": "3.0.1",
@@ -66,7 +62,8 @@
66
62
  "@zohodesk/svg": "1.0.0-beta.49",
67
63
  "@zohodesk/virtualizer": "1.0.3",
68
64
  "velocity-react": "1.4.3",
69
- "react-sortable-hoc": "^0.8.3"
65
+ "react-sortable-hoc": "^0.8.3",
66
+ "@zohodesk/a11y": "1.3.4"
70
67
  },
71
68
  "react-cli": {
72
69
  "preprocess": {
@@ -83,4 +80,4 @@
83
80
  "hasRTL": true
84
81
  }
85
82
  }
86
- }
83
+ }