@instructure/ui-drilldown 10.19.2-snapshot-12 → 10.20.0

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/CHANGELOG.md CHANGED
@@ -3,12 +3,13 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [10.19.2-snapshot-12](https://github.com/instructure/instructure-ui/compare/v10.19.1...v10.19.2-snapshot-12) (2025-06-13)
6
+ # [10.20.0](https://github.com/instructure/instructure-ui/compare/v10.19.1...v10.20.0) (2025-06-13)
7
7
 
8
8
 
9
9
  ### Bug Fixes
10
10
 
11
11
  * **many:** update dependencies, browsersdb and moment timezone database ([3813636](https://github.com/instructure/instructure-ui/commit/3813636458c901ad4bc74a4d5ae015cb55defcb2))
12
+ * **ui-top-nav-bar,ui-popover,ui-drilldown:** automatically set aria-expanded, allow override with shouldSetAriaExpanded ([b8e1367](https://github.com/instructure/instructure-ui/commit/b8e13674a2e700e44162a29ca61ead4fd98ce193))
12
13
 
13
14
 
14
15
 
@@ -1171,8 +1171,10 @@ let Drilldown = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle,
1171
1171
  onFocus = _this$props7.onFocus,
1172
1172
  onMouseOver = _this$props7.onMouseOver,
1173
1173
  offsetX = _this$props7.offsetX,
1174
- offsetY = _this$props7.offsetY;
1174
+ offsetY = _this$props7.offsetY,
1175
+ shouldSetAriaExpanded = _this$props7.shouldSetAriaExpanded;
1175
1176
  return trigger ? _jsx(Popover, {
1177
+ shouldSetAriaExpanded: shouldSetAriaExpanded,
1176
1178
  isShowingContent: show,
1177
1179
  defaultIsShowingContent: defaultShow,
1178
1180
  shouldCloseOnDocumentClick: true,
@@ -1246,7 +1248,8 @@ let Drilldown = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle,
1246
1248
  shouldReturnFocus: true,
1247
1249
  withArrow: true,
1248
1250
  offsetX: 0,
1249
- offsetY: 0
1251
+ offsetY: 0,
1252
+ shouldSetAriaExpanded: true
1250
1253
  }, _Drilldown.Group = DrilldownGroup, _Drilldown.Option = DrilldownOption, _Drilldown.Page = DrilldownPage, _Drilldown.Separator = DrilldownSeparator, _Drilldown)) || _class) || _class) || _class);
1251
1254
  export default Drilldown;
1252
1255
  export { Drilldown };
@@ -64,7 +64,8 @@ const propTypes = {
64
64
  shouldReturnFocus: PropTypes.bool,
65
65
  withArrow: PropTypes.bool,
66
66
  offsetX: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
67
- offsetY: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
67
+ offsetY: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
68
+ shouldSetAriaExpanded: PropTypes.bool
68
69
  };
69
70
  const allowedProps = ['rootPageId', 'children', 'id', 'label', 'disabled', 'rotateFocus', 'as', 'role', 'overflowX', 'overflowY', 'height', 'width', 'minHeight', 'minWidth', 'maxHeight', 'maxWidth',
70
71
  // Popover version props
@@ -1180,8 +1180,10 @@ let Drilldown = exports.Drilldown = (_dec = (0, _withDeterministicId.withDetermi
1180
1180
  onFocus = _this$props7.onFocus,
1181
1181
  onMouseOver = _this$props7.onMouseOver,
1182
1182
  offsetX = _this$props7.offsetX,
1183
- offsetY = _this$props7.offsetY;
1183
+ offsetY = _this$props7.offsetY,
1184
+ shouldSetAriaExpanded = _this$props7.shouldSetAriaExpanded;
1184
1185
  return trigger ? (0, _jsxRuntime.jsx)(_Popover.Popover, {
1186
+ shouldSetAriaExpanded: shouldSetAriaExpanded,
1185
1187
  isShowingContent: show,
1186
1188
  defaultIsShowingContent: defaultShow,
1187
1189
  shouldCloseOnDocumentClick: true,
@@ -1255,6 +1257,7 @@ let Drilldown = exports.Drilldown = (_dec = (0, _withDeterministicId.withDetermi
1255
1257
  shouldReturnFocus: true,
1256
1258
  withArrow: true,
1257
1259
  offsetX: 0,
1258
- offsetY: 0
1260
+ offsetY: 0,
1261
+ shouldSetAriaExpanded: true
1259
1262
  }, _Drilldown.Group = _DrilldownGroup.DrilldownGroup, _Drilldown.Option = _DrilldownOption.DrilldownOption, _Drilldown.Page = _DrilldownPage.DrilldownPage, _Drilldown.Separator = _DrilldownSeparator.DrilldownSeparator, _Drilldown)) || _class) || _class) || _class);
1260
1263
  var _default = exports.default = Drilldown;
@@ -72,7 +72,8 @@ const propTypes = exports.propTypes = {
72
72
  shouldReturnFocus: _propTypes.default.bool,
73
73
  withArrow: _propTypes.default.bool,
74
74
  offsetX: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
75
- offsetY: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number])
75
+ offsetY: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
76
+ shouldSetAriaExpanded: _propTypes.default.bool
76
77
  };
77
78
  const allowedProps = exports.allowedProps = ['rootPageId', 'children', 'id', 'label', 'disabled', 'rotateFocus', 'as', 'role', 'overflowX', 'overflowY', 'height', 'width', 'minHeight', 'minWidth', 'maxHeight', 'maxWidth',
78
79
  // Popover version props
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-drilldown",
3
- "version": "10.19.2-snapshot-12",
3
+ "version": "10.20.0",
4
4
  "description": "A drilldown menu component",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -24,29 +24,29 @@
24
24
  "license": "MIT",
25
25
  "dependencies": {
26
26
  "@babel/runtime": "^7.27.6",
27
- "@instructure/console": "10.19.2-snapshot-12",
28
- "@instructure/emotion": "10.19.2-snapshot-12",
29
- "@instructure/shared-types": "10.19.2-snapshot-12",
30
- "@instructure/ui-dom-utils": "10.19.2-snapshot-12",
31
- "@instructure/ui-icons": "10.19.2-snapshot-12",
32
- "@instructure/ui-options": "10.19.2-snapshot-12",
33
- "@instructure/ui-popover": "10.19.2-snapshot-12",
34
- "@instructure/ui-position": "10.19.2-snapshot-12",
35
- "@instructure/ui-prop-types": "10.19.2-snapshot-12",
36
- "@instructure/ui-react-utils": "10.19.2-snapshot-12",
37
- "@instructure/ui-selectable": "10.19.2-snapshot-12",
38
- "@instructure/ui-testable": "10.19.2-snapshot-12",
39
- "@instructure/ui-utils": "10.19.2-snapshot-12",
40
- "@instructure/ui-view": "10.19.2-snapshot-12",
27
+ "@instructure/console": "10.20.0",
28
+ "@instructure/emotion": "10.20.0",
29
+ "@instructure/shared-types": "10.20.0",
30
+ "@instructure/ui-dom-utils": "10.20.0",
31
+ "@instructure/ui-icons": "10.20.0",
32
+ "@instructure/ui-options": "10.20.0",
33
+ "@instructure/ui-popover": "10.20.0",
34
+ "@instructure/ui-position": "10.20.0",
35
+ "@instructure/ui-prop-types": "10.20.0",
36
+ "@instructure/ui-react-utils": "10.20.0",
37
+ "@instructure/ui-selectable": "10.20.0",
38
+ "@instructure/ui-testable": "10.20.0",
39
+ "@instructure/ui-utils": "10.20.0",
40
+ "@instructure/ui-view": "10.20.0",
41
41
  "prop-types": "^15.8.1"
42
42
  },
43
43
  "devDependencies": {
44
- "@instructure/ui-axe-check": "10.19.2-snapshot-12",
45
- "@instructure/ui-babel-preset": "10.19.2-snapshot-12",
46
- "@instructure/ui-color-utils": "10.19.2-snapshot-12",
47
- "@instructure/ui-scripts": "10.19.2-snapshot-12",
48
- "@instructure/ui-test-utils": "10.19.2-snapshot-12",
49
- "@instructure/ui-themes": "10.19.2-snapshot-12",
44
+ "@instructure/ui-axe-check": "10.20.0",
45
+ "@instructure/ui-babel-preset": "10.20.0",
46
+ "@instructure/ui-color-utils": "10.20.0",
47
+ "@instructure/ui-scripts": "10.20.0",
48
+ "@instructure/ui-test-utils": "10.20.0",
49
+ "@instructure/ui-themes": "10.20.0",
50
50
  "@testing-library/jest-dom": "^6.6.3",
51
51
  "@testing-library/react": "^16.0.1",
52
52
  "@testing-library/user-event": "^14.6.1",
@@ -121,7 +121,8 @@ class Drilldown extends Component<DrilldownProps, DrilldownState> {
121
121
  shouldReturnFocus: true,
122
122
  withArrow: true,
123
123
  offsetX: 0,
124
- offsetY: 0
124
+ offsetY: 0,
125
+ shouldSetAriaExpanded: true
125
126
  }
126
127
 
127
128
  static Group = DrilldownGroup
@@ -1494,11 +1495,13 @@ class Drilldown extends Component<DrilldownProps, DrilldownState> {
1494
1495
  onFocus,
1495
1496
  onMouseOver,
1496
1497
  offsetX,
1497
- offsetY
1498
+ offsetY,
1499
+ shouldSetAriaExpanded
1498
1500
  } = this.props
1499
1501
 
1500
1502
  return trigger ? (
1501
1503
  <Popover
1504
+ shouldSetAriaExpanded={shouldSetAriaExpanded}
1502
1505
  isShowingContent={show}
1503
1506
  defaultIsShowingContent={defaultShow}
1504
1507
  shouldCloseOnDocumentClick={true}
@@ -261,6 +261,12 @@ type DrilldownOwnProps = {
261
261
  * Works only if `trigger` is provided.
262
262
  */
263
263
  offsetY?: string | number
264
+ /**
265
+ * If true (default), then the aria-expanded prop is added to the trigger.
266
+ * If its supplied via the aria-expanded prop then it takes the given value,
267
+ * otherwise its calculated automatically based on whether the content is shown.
268
+ */
269
+ shouldSetAriaExpanded?: boolean
264
270
  }
265
271
 
266
272
  type PropKeys = keyof DrilldownOwnProps
@@ -338,7 +344,8 @@ const propTypes: PropValidators<PropKeys> = {
338
344
  shouldReturnFocus: PropTypes.bool,
339
345
  withArrow: PropTypes.bool,
340
346
  offsetX: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
341
- offsetY: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
347
+ offsetY: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
348
+ shouldSetAriaExpanded: PropTypes.bool
342
349
  }
343
350
 
344
351
  const allowedProps: AllowedPropKeys = [