es-components 21.6.91 → 21.6.92

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/index.js CHANGED
@@ -980,7 +980,7 @@ LightNotification.propTypes = process.env.NODE_ENV !== "production" ? {
980
980
 
981
981
  /** Display a dismiss button that will close the notification */
982
982
  isDismissable: PropTypes__default["default"].bool,
983
- role: PropTypes__default["default"].oneOf(['dialog', 'alert', 'text']),
983
+ role: PropTypes__default["default"].oneOf(['dialog', 'alert', 'text', 'region']),
984
984
 
985
985
  /** Function to execute when the dialog is closed */
986
986
  onDismiss: PropTypes__default["default"].func,
@@ -3175,10 +3175,8 @@ Menu.defaultProps = {
3175
3175
  };
3176
3176
 
3177
3177
  var _excluded$q = ["name", "selected", "action", "children", "simpleName", "announcerText"];
3178
- var TabButton = styled__default["default"].button(["background-color:", ";border:1px solid ", ";box-shadow:", ";color:", ";display:inline-block;font-size:inherit;line-height:", ";padding:10px;text-align:left;z-index:1;&:focus{outline:none;}@media (min-width:", "){background-color:", ";border:", ";border-bottom-color:", ";box-shadow:none;color:", ";padding:10px 15px;margin:0 2px 0px 0;&:hover,&:focus{background-color:", ";}}"], function (props) {
3178
+ var TabButton = styled__default["default"].button(["background-color:", ";box-shadow:", ";color:", ";display:inline-block;font-size:inherit;line-height:", ";padding:10px;text-align:left;z-index:1;&:focus{outline:none;}@media (max-width:", "){border:1px solid ", ";}@media (min-width:", "){background-color:", ";border:", ";border-bottom-color:", ";box-shadow:none;padding:10px 15px;margin:0 2px 0px 0;&:hover,&:focus{background-color:", ";}}"], function (props) {
3179
3179
  return props.selected ? props.theme.colors.white : props.theme.colors.gray2;
3180
- }, function (props) {
3181
- return props.theme.colors.gray4;
3182
3180
  }, function (props) {
3183
3181
  return props.selected ? '0 6px 12px rgba(0, 0, 0, 0.175)' : 'none';
3184
3182
  }, function (props) {
@@ -3187,14 +3185,16 @@ var TabButton = styled__default["default"].button(["background-color:", ";border
3187
3185
  return props.theme.font.baseLineHeight;
3188
3186
  }, function (props) {
3189
3187
  return props.theme.screenSize.desktop;
3188
+ }, function (props) {
3189
+ return props.theme.colors.gray4;
3190
+ }, function (props) {
3191
+ return props.theme.screenSize.desktop;
3190
3192
  }, function (props) {
3191
3193
  return props.theme.colors.white;
3192
3194
  }, function (props) {
3193
3195
  return props.selected ? "1px solid ".concat(props.theme.colors.gray4) : '1px solid transparent';
3194
3196
  }, function (props) {
3195
3197
  return props.selected ? ' transparent' : "".concat(props.theme.colors.gray4);
3196
- }, function (props) {
3197
- return props.selected ? props.theme.colors.black : props.theme.colors.primary;
3198
3198
  }, function (props) {
3199
3199
  return props.selected ? props.theme.colors.white : props.theme.colors.gray2;
3200
3200
  });
@@ -3210,6 +3210,7 @@ function Tab(_ref) {
3210
3210
  props = _objectWithoutProperties__default["default"](_ref, _excluded$q);
3211
3211
 
3212
3212
  return /*#__PURE__*/React__default["default"].createElement(TabButton, _extends__default["default"]({
3213
+ className: "tab-button-".concat(selected ? 'selected' : 'unselected'),
3213
3214
  onClick: function onClick() {
3214
3215
  return action(name, children, simpleName, announcerText);
3215
3216
  },
@@ -3277,7 +3278,8 @@ function TabPanel(props) {
3277
3278
  var children = props.children,
3278
3279
  selectedKey = props.selectedKey,
3279
3280
  tabChanged = props.tabChanged,
3280
- canTabChange = props.canTabChange;
3281
+ canTabChange = props.canTabChange,
3282
+ className = props.className;
3281
3283
 
3282
3284
  var _useState = React.useState(selectedKey),
3283
3285
  _useState2 = _slicedToArray__default["default"](_useState, 2),
@@ -3330,14 +3332,18 @@ function TabPanel(props) {
3330
3332
  }()
3331
3333
  });
3332
3334
  });
3333
- return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(TabList, {
3334
- role: "tablist"
3335
+ return /*#__PURE__*/React__default["default"].createElement("div", {
3336
+ className: className
3337
+ }, /*#__PURE__*/React__default["default"].createElement(TabList, {
3338
+ role: "tablist",
3339
+ className: "tab-list"
3335
3340
  }, elements), /*#__PURE__*/React__default["default"].createElement(TabContent, {
3336
- role: "tabpanel"
3341
+ role: "tabpanel",
3342
+ className: "tab-content"
3337
3343
  }, elements[selectedIndex].props.children));
3338
3344
  }
3339
3345
 
3340
- function childrenRule(props, propName, component) {
3346
+ function childrenRule(props, propName) {
3341
3347
  var children = props[propName];
3342
3348
 
3343
3349
  if (!Array.isArray(children)) {
@@ -3368,7 +3374,8 @@ TabPanel.propTypes = process.env.NODE_ENV !== "production" ? {
3368
3374
  /**
3369
3375
  * Callback when the selected tab has changed. The callback is given the name of the tab that is active
3370
3376
  */
3371
- tabChanged: PropTypes__default["default"].func
3377
+ tabChanged: PropTypes__default["default"].func,
3378
+ className: PropTypes__default["default"].string
3372
3379
  } : {};
3373
3380
  TabPanel.defaultProps = {
3374
3381
  children: undefined,
@@ -6769,6 +6776,7 @@ function ProgressItem(_ref) {
6769
6776
  }
6770
6777
 
6771
6778
  var ProgressItemType = getProgressItemType(itemType, showNav);
6779
+ var itemId = useUniqueId();
6772
6780
  var listItemProps = {
6773
6781
  numberOfSteps: numberOfSteps,
6774
6782
  disabled: !isPastStep && !canClickFutureStep,
@@ -6776,7 +6784,12 @@ function ProgressItem(_ref) {
6776
6784
  };
6777
6785
  return /*#__PURE__*/React__default["default"].createElement(ProgressLi, {
6778
6786
  numberOfSteps: numberOfSteps
6779
- }, /*#__PURE__*/React__default["default"].createElement(ProgressItemType, listItemProps, /*#__PURE__*/React__default["default"].createElement("span", null, label)));
6787
+ }, /*#__PURE__*/React__default["default"].createElement(ProgressItemType, _extends__default["default"]({}, listItemProps, {
6788
+ id: itemId,
6789
+ "aria-labelledby": "".concat(itemId, "-span")
6790
+ }), /*#__PURE__*/React__default["default"].createElement("span", {
6791
+ id: "".concat(itemId, "-span")
6792
+ }, label)));
6780
6793
  }
6781
6794
  ProgressItem.propTypes = process.env.NODE_ENV !== "production" ? {
6782
6795
  active: PropTypes__default["default"].bool.isRequired,
package/lib/index.js CHANGED
@@ -938,7 +938,7 @@ LightNotification.propTypes = process.env.NODE_ENV !== "production" ? {
938
938
 
939
939
  /** Display a dismiss button that will close the notification */
940
940
  isDismissable: PropTypes.bool,
941
- role: PropTypes.oneOf(['dialog', 'alert', 'text']),
941
+ role: PropTypes.oneOf(['dialog', 'alert', 'text', 'region']),
942
942
 
943
943
  /** Function to execute when the dialog is closed */
944
944
  onDismiss: PropTypes.func,
@@ -3133,10 +3133,8 @@ Menu.defaultProps = {
3133
3133
  };
3134
3134
 
3135
3135
  var _excluded$q = ["name", "selected", "action", "children", "simpleName", "announcerText"];
3136
- var TabButton = styled.button(["background-color:", ";border:1px solid ", ";box-shadow:", ";color:", ";display:inline-block;font-size:inherit;line-height:", ";padding:10px;text-align:left;z-index:1;&:focus{outline:none;}@media (min-width:", "){background-color:", ";border:", ";border-bottom-color:", ";box-shadow:none;color:", ";padding:10px 15px;margin:0 2px 0px 0;&:hover,&:focus{background-color:", ";}}"], function (props) {
3136
+ var TabButton = styled.button(["background-color:", ";box-shadow:", ";color:", ";display:inline-block;font-size:inherit;line-height:", ";padding:10px;text-align:left;z-index:1;&:focus{outline:none;}@media (max-width:", "){border:1px solid ", ";}@media (min-width:", "){background-color:", ";border:", ";border-bottom-color:", ";box-shadow:none;padding:10px 15px;margin:0 2px 0px 0;&:hover,&:focus{background-color:", ";}}"], function (props) {
3137
3137
  return props.selected ? props.theme.colors.white : props.theme.colors.gray2;
3138
- }, function (props) {
3139
- return props.theme.colors.gray4;
3140
3138
  }, function (props) {
3141
3139
  return props.selected ? '0 6px 12px rgba(0, 0, 0, 0.175)' : 'none';
3142
3140
  }, function (props) {
@@ -3145,14 +3143,16 @@ var TabButton = styled.button(["background-color:", ";border:1px solid ", ";box-
3145
3143
  return props.theme.font.baseLineHeight;
3146
3144
  }, function (props) {
3147
3145
  return props.theme.screenSize.desktop;
3146
+ }, function (props) {
3147
+ return props.theme.colors.gray4;
3148
+ }, function (props) {
3149
+ return props.theme.screenSize.desktop;
3148
3150
  }, function (props) {
3149
3151
  return props.theme.colors.white;
3150
3152
  }, function (props) {
3151
3153
  return props.selected ? "1px solid ".concat(props.theme.colors.gray4) : '1px solid transparent';
3152
3154
  }, function (props) {
3153
3155
  return props.selected ? ' transparent' : "".concat(props.theme.colors.gray4);
3154
- }, function (props) {
3155
- return props.selected ? props.theme.colors.black : props.theme.colors.primary;
3156
3156
  }, function (props) {
3157
3157
  return props.selected ? props.theme.colors.white : props.theme.colors.gray2;
3158
3158
  });
@@ -3168,6 +3168,7 @@ function Tab(_ref) {
3168
3168
  props = _objectWithoutProperties(_ref, _excluded$q);
3169
3169
 
3170
3170
  return /*#__PURE__*/React.createElement(TabButton, _extends({
3171
+ className: "tab-button-".concat(selected ? 'selected' : 'unselected'),
3171
3172
  onClick: function onClick() {
3172
3173
  return action(name, children, simpleName, announcerText);
3173
3174
  },
@@ -3235,7 +3236,8 @@ function TabPanel(props) {
3235
3236
  var children = props.children,
3236
3237
  selectedKey = props.selectedKey,
3237
3238
  tabChanged = props.tabChanged,
3238
- canTabChange = props.canTabChange;
3239
+ canTabChange = props.canTabChange,
3240
+ className = props.className;
3239
3241
 
3240
3242
  var _useState = useState(selectedKey),
3241
3243
  _useState2 = _slicedToArray(_useState, 2),
@@ -3288,14 +3290,18 @@ function TabPanel(props) {
3288
3290
  }()
3289
3291
  });
3290
3292
  });
3291
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TabList, {
3292
- role: "tablist"
3293
+ return /*#__PURE__*/React.createElement("div", {
3294
+ className: className
3295
+ }, /*#__PURE__*/React.createElement(TabList, {
3296
+ role: "tablist",
3297
+ className: "tab-list"
3293
3298
  }, elements), /*#__PURE__*/React.createElement(TabContent, {
3294
- role: "tabpanel"
3299
+ role: "tabpanel",
3300
+ className: "tab-content"
3295
3301
  }, elements[selectedIndex].props.children));
3296
3302
  }
3297
3303
 
3298
- function childrenRule(props, propName, component) {
3304
+ function childrenRule(props, propName) {
3299
3305
  var children = props[propName];
3300
3306
 
3301
3307
  if (!Array.isArray(children)) {
@@ -3326,7 +3332,8 @@ TabPanel.propTypes = process.env.NODE_ENV !== "production" ? {
3326
3332
  /**
3327
3333
  * Callback when the selected tab has changed. The callback is given the name of the tab that is active
3328
3334
  */
3329
- tabChanged: PropTypes.func
3335
+ tabChanged: PropTypes.func,
3336
+ className: PropTypes.string
3330
3337
  } : {};
3331
3338
  TabPanel.defaultProps = {
3332
3339
  children: undefined,
@@ -6727,6 +6734,7 @@ function ProgressItem(_ref) {
6727
6734
  }
6728
6735
 
6729
6736
  var ProgressItemType = getProgressItemType(itemType, showNav);
6737
+ var itemId = useUniqueId();
6730
6738
  var listItemProps = {
6731
6739
  numberOfSteps: numberOfSteps,
6732
6740
  disabled: !isPastStep && !canClickFutureStep,
@@ -6734,7 +6742,12 @@ function ProgressItem(_ref) {
6734
6742
  };
6735
6743
  return /*#__PURE__*/React.createElement(ProgressLi, {
6736
6744
  numberOfSteps: numberOfSteps
6737
- }, /*#__PURE__*/React.createElement(ProgressItemType, listItemProps, /*#__PURE__*/React.createElement("span", null, label)));
6745
+ }, /*#__PURE__*/React.createElement(ProgressItemType, _extends({}, listItemProps, {
6746
+ id: itemId,
6747
+ "aria-labelledby": "".concat(itemId, "-span")
6748
+ }), /*#__PURE__*/React.createElement("span", {
6749
+ id: "".concat(itemId, "-span")
6750
+ }, label)));
6738
6751
  }
6739
6752
  ProgressItem.propTypes = process.env.NODE_ENV !== "production" ? {
6740
6753
  active: PropTypes.bool.isRequired,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "es-components",
3
- "version": "21.6.91",
3
+ "version": "21.6.92",
4
4
  "description": "React components built for Exchange Solutions products",
5
5
  "author": "Willis Towers Watson - Individual Marketplace",
6
6
  "license": "MIT",
@@ -73,7 +73,7 @@
73
73
  "braces": "^3.0.2",
74
74
  "concurrently": "^6.0.2",
75
75
  "cypress": "^9.6.0",
76
- "es-components-via-theme": "^21.6.91",
76
+ "es-components-via-theme": "^21.6.92",
77
77
  "eslint": "^8.23.0",
78
78
  "eslint-config-airbnb": "^18.2.1",
79
79
  "eslint-config-prettier": "^8.2.0",
@@ -128,5 +128,5 @@
128
128
  "text-mask-addons": "3.8.0",
129
129
  "tinycolor2": "^1.4.2"
130
130
  },
131
- "gitHead": "93141487d64ae51be9dda5e54357a09900c30d3c"
131
+ "gitHead": "3862220c97a2d5068a452f672c3e4b3b2230205f"
132
132
  }