@instructure/ui-drilldown 8.51.1-snapshot-7 → 8.51.1-snapshot-9

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,9 +3,12 @@
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
- ## [8.51.1-snapshot-7](https://github.com/instructure/instructure-ui/compare/v8.51.0...v8.51.1-snapshot-7) (2024-01-30)
6
+ ## [8.51.1-snapshot-9](https://github.com/instructure/instructure-ui/compare/v8.51.0...v8.51.1-snapshot-9) (2024-02-01)
7
7
 
8
- **Note:** Version bump only for package @instructure/ui-drilldown
8
+
9
+ ### Features
10
+
11
+ * **ui-drilldown,ui-top-nav-bar:** add shouldCloseOnClick ([c3df722](https://github.com/instructure/instructure-ui/commit/c3df7221b185996713a05d06ef585020bfa67c6b))
9
12
 
10
13
 
11
14
 
@@ -48,7 +48,8 @@ let DrilldownOption = (_dec = withStyle(null, optionsItemThemeGenerator), _dec(_
48
48
  beforeLabelContentVAlign: 'start',
49
49
  afterLabelContentVAlign: 'start',
50
50
  as: 'li',
51
- role: 'menuitem'
51
+ role: 'menuitem',
52
+ shouldCloseOnClick: 'auto'
52
53
  }, _class2)) || _class);
53
54
  export default DrilldownOption;
54
55
  export { DrilldownOption };
@@ -42,7 +42,8 @@ const propTypes = {
42
42
  descriptionRole: PropTypes.string,
43
43
  onOptionClick: PropTypes.func,
44
44
  defaultSelected: PropTypes.bool,
45
- elementRef: PropTypes.func
45
+ elementRef: PropTypes.func,
46
+ shouldCloseOnClick: PropTypes.oneOf(['auto', 'always', 'never'])
46
47
  };
47
- const allowedProps = ['id', 'children', 'subPageId', 'disabled', 'selected', 'value', 'href', 'as', 'role', 'renderLabelInfo', 'renderBeforeLabel', 'renderAfterLabel', 'beforeLabelContentVAlign', 'afterLabelContentVAlign', 'description', 'descriptionRole', 'onOptionClick', 'defaultSelected', 'elementRef'];
48
+ const allowedProps = ['id', 'children', 'subPageId', 'disabled', 'selected', 'value', 'href', 'as', 'role', 'renderLabelInfo', 'renderBeforeLabel', 'renderAfterLabel', 'beforeLabelContentVAlign', 'afterLabelContentVAlign', 'description', 'descriptionRole', 'onOptionClick', 'defaultSelected', 'elementRef', 'shouldCloseOnClick'];
48
49
  export { propTypes, allowedProps };
@@ -53,6 +53,7 @@ let DrilldownOption = exports.DrilldownOption = (_dec = (0, _emotion.withStyle)(
53
53
  beforeLabelContentVAlign: 'start',
54
54
  afterLabelContentVAlign: 'start',
55
55
  as: 'li',
56
- role: 'menuitem'
56
+ role: 'menuitem',
57
+ shouldCloseOnClick: 'auto'
57
58
  }, _class2)) || _class);
58
59
  var _default = exports.default = DrilldownOption;
@@ -49,6 +49,7 @@ const propTypes = exports.propTypes = {
49
49
  descriptionRole: _propTypes.default.string,
50
50
  onOptionClick: _propTypes.default.func,
51
51
  defaultSelected: _propTypes.default.bool,
52
- elementRef: _propTypes.default.func
52
+ elementRef: _propTypes.default.func,
53
+ shouldCloseOnClick: _propTypes.default.oneOf(['auto', 'always', 'never'])
53
54
  };
54
- const allowedProps = exports.allowedProps = ['id', 'children', 'subPageId', 'disabled', 'selected', 'value', 'href', 'as', 'role', 'renderLabelInfo', 'renderBeforeLabel', 'renderAfterLabel', 'beforeLabelContentVAlign', 'afterLabelContentVAlign', 'description', 'descriptionRole', 'onOptionClick', 'defaultSelected', 'elementRef'];
55
+ const allowedProps = exports.allowedProps = ['id', 'children', 'subPageId', 'disabled', 'selected', 'value', 'href', 'as', 'role', 'renderLabelInfo', 'renderBeforeLabel', 'renderAfterLabel', 'beforeLabelContentVAlign', 'afterLabelContentVAlign', 'description', 'descriptionRole', 'onOptionClick', 'defaultSelected', 'elementRef', 'shouldCloseOnClick'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-drilldown",
3
- "version": "8.51.1-snapshot-7",
3
+ "version": "8.51.1-snapshot-9",
4
4
  "description": "A drilldown menu component",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -24,28 +24,28 @@
24
24
  "license": "MIT",
25
25
  "dependencies": {
26
26
  "@babel/runtime": "^7.23.2",
27
- "@instructure/console": "8.51.1-snapshot-7",
28
- "@instructure/emotion": "8.51.1-snapshot-7",
29
- "@instructure/shared-types": "8.51.1-snapshot-7",
30
- "@instructure/ui-dom-utils": "8.51.1-snapshot-7",
31
- "@instructure/ui-icons": "8.51.1-snapshot-7",
32
- "@instructure/ui-options": "8.51.1-snapshot-7",
33
- "@instructure/ui-popover": "8.51.1-snapshot-7",
34
- "@instructure/ui-position": "8.51.1-snapshot-7",
35
- "@instructure/ui-prop-types": "8.51.1-snapshot-7",
36
- "@instructure/ui-react-utils": "8.51.1-snapshot-7",
37
- "@instructure/ui-selectable": "8.51.1-snapshot-7",
38
- "@instructure/ui-testable": "8.51.1-snapshot-7",
39
- "@instructure/ui-utils": "8.51.1-snapshot-7",
40
- "@instructure/ui-view": "8.51.1-snapshot-7",
27
+ "@instructure/console": "8.51.1-snapshot-9",
28
+ "@instructure/emotion": "8.51.1-snapshot-9",
29
+ "@instructure/shared-types": "8.51.1-snapshot-9",
30
+ "@instructure/ui-dom-utils": "8.51.1-snapshot-9",
31
+ "@instructure/ui-icons": "8.51.1-snapshot-9",
32
+ "@instructure/ui-options": "8.51.1-snapshot-9",
33
+ "@instructure/ui-popover": "8.51.1-snapshot-9",
34
+ "@instructure/ui-position": "8.51.1-snapshot-9",
35
+ "@instructure/ui-prop-types": "8.51.1-snapshot-9",
36
+ "@instructure/ui-react-utils": "8.51.1-snapshot-9",
37
+ "@instructure/ui-selectable": "8.51.1-snapshot-9",
38
+ "@instructure/ui-testable": "8.51.1-snapshot-9",
39
+ "@instructure/ui-utils": "8.51.1-snapshot-9",
40
+ "@instructure/ui-view": "8.51.1-snapshot-9",
41
41
  "prop-types": "^15.8.1"
42
42
  },
43
43
  "devDependencies": {
44
- "@instructure/ui-babel-preset": "8.51.1-snapshot-7",
45
- "@instructure/ui-color-utils": "8.51.1-snapshot-7",
46
- "@instructure/ui-test-locator": "8.51.1-snapshot-7",
47
- "@instructure/ui-test-utils": "8.51.1-snapshot-7",
48
- "@instructure/ui-themes": "8.51.1-snapshot-7"
44
+ "@instructure/ui-babel-preset": "8.51.1-snapshot-9",
45
+ "@instructure/ui-color-utils": "8.51.1-snapshot-9",
46
+ "@instructure/ui-test-locator": "8.51.1-snapshot-9",
47
+ "@instructure/ui-test-utils": "8.51.1-snapshot-9",
48
+ "@instructure/ui-themes": "8.51.1-snapshot-9"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "react": ">=16.8 <=18"
@@ -52,7 +52,8 @@ class DrilldownOption extends Component<DrilldownOptionProps> {
52
52
  beforeLabelContentVAlign: 'start',
53
53
  afterLabelContentVAlign: 'start',
54
54
  as: 'li',
55
- role: 'menuitem'
55
+ role: 'menuitem',
56
+ shouldCloseOnClick: 'auto'
56
57
  }
57
58
 
58
59
  render() {
@@ -44,6 +44,8 @@ type DrilldownOptionValue = string | number | undefined
44
44
 
45
45
  type RenderContentVAlign = 'start' | 'center' | 'end'
46
46
 
47
+ type ShouldCloseOnClick = 'auto' | 'always' | 'never'
48
+
47
49
  type DrilldownOptionVariant = Exclude<OptionsItemProps['variant'], 'selected'>
48
50
 
49
51
  type RenderContentProps = {
@@ -171,6 +173,11 @@ type DrilldownOptionOwnProps = {
171
173
  * Provides a reference to the underlying html root element
172
174
  */
173
175
  elementRef?: (element: Element | null) => void
176
+
177
+ /**
178
+ * Should close the container menu component, if clicked on the option marked with this prop
179
+ */
180
+ shouldCloseOnClick?: ShouldCloseOnClick
174
181
  }
175
182
 
176
183
  type PropKeys = keyof DrilldownOptionOwnProps
@@ -200,7 +207,8 @@ const propTypes: PropValidators<PropKeys> = {
200
207
  descriptionRole: PropTypes.string,
201
208
  onOptionClick: PropTypes.func,
202
209
  defaultSelected: PropTypes.bool,
203
- elementRef: PropTypes.func
210
+ elementRef: PropTypes.func,
211
+ shouldCloseOnClick: PropTypes.oneOf(['auto', 'always', 'never'])
204
212
  }
205
213
 
206
214
  const allowedProps: AllowedPropKeys = [
@@ -222,7 +230,8 @@ const allowedProps: AllowedPropKeys = [
222
230
  'descriptionRole',
223
231
  'onOptionClick',
224
232
  'defaultSelected',
225
- 'elementRef'
233
+ 'elementRef',
234
+ 'shouldCloseOnClick'
226
235
  ]
227
236
 
228
237
  export type { DrilldownOptionProps, DrilldownOptionValue }
@@ -146,7 +146,7 @@ type DrilldownOwnProps = {
146
146
  defaultShow?: boolean
147
147
 
148
148
  /**
149
- * Is the `<Drilldown />` open (should be accompanied by `onToggle`)
149
+ * Is the `<Drilldown />` open (should be accompanied by `onToggle` and `trigger`)
150
150
  */
151
151
  show?: boolean // TODO: type controllable(PropTypes.bool, 'onToggle', 'defaultShow')
152
152