@instructure/ui-top-nav-bar 8.46.2-snapshot-15 → 8.46.2-snapshot-17
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 +5 -2
- package/es/TopNavBar/TopNavBarItem/index.js +2 -0
- package/es/TopNavBar/TopNavBarItem/props.js +2 -1
- package/lib/TopNavBar/TopNavBarItem/index.js +2 -0
- package/lib/TopNavBar/TopNavBarItem/props.js +2 -1
- package/package.json +27 -27
- package/src/TopNavBar/TopNavBarItem/index.tsx +2 -0
- package/src/TopNavBar/TopNavBarItem/props.ts +9 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/TopNavBar/TopNavBarItem/index.d.ts.map +1 -1
- package/types/TopNavBar/TopNavBarItem/props.d.ts +5 -1
- package/types/TopNavBar/TopNavBarItem/props.d.ts.map +1 -1
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.46.2-snapshot-
|
|
6
|
+
## [8.46.2-snapshot-17](https://github.com/instructure/instructure-ui/compare/v8.46.1...v8.46.2-snapshot-17) (2023-10-27)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **ui-top-nav-bar:** add as property to TopNavBarItem ([d471c16](https://github.com/instructure/instructure-ui/commit/d471c167e2292cdfc7011194ebf855adfd0bc814))
|
|
9
12
|
|
|
10
13
|
|
|
11
14
|
|
|
@@ -260,6 +260,7 @@ let TopNavBarItem = (_dec = withDeterministicId(), _dec2 = withStyle(generateSty
|
|
|
260
260
|
get itemProps() {
|
|
261
261
|
const _this$props5 = this.props,
|
|
262
262
|
id = _this$props5.id,
|
|
263
|
+
as = _this$props5.as,
|
|
263
264
|
variant = _this$props5.variant,
|
|
264
265
|
hrefOriginal = _this$props5.href,
|
|
265
266
|
onClickOriginal = _this$props5.onClick,
|
|
@@ -308,6 +309,7 @@ let TopNavBarItem = (_dec = withDeterministicId(), _dec2 = withStyle(generateSty
|
|
|
308
309
|
}
|
|
309
310
|
return {
|
|
310
311
|
id,
|
|
312
|
+
as,
|
|
311
313
|
...this.colorProps,
|
|
312
314
|
...this.ariaProps,
|
|
313
315
|
size: this.size,
|
|
@@ -36,6 +36,7 @@ const topNavBarItemTooltipPropType = PropTypes.oneOfType([PropTypes.string, Prop
|
|
|
36
36
|
})]);
|
|
37
37
|
const propTypes = {
|
|
38
38
|
id: PropTypes.string.isRequired,
|
|
39
|
+
as: PropTypes.elementType,
|
|
39
40
|
children: PropTypes.node.isRequired,
|
|
40
41
|
variant: PropTypes.oneOf(['default', 'button', 'icon', 'avatar']),
|
|
41
42
|
status: PropTypes.oneOf(['default', 'active', 'disabled']),
|
|
@@ -61,5 +62,5 @@ const propTypes = {
|
|
|
61
62
|
elementRef: PropTypes.func,
|
|
62
63
|
itemRef: PropTypes.func
|
|
63
64
|
};
|
|
64
|
-
const allowedProps = ['id', 'children', 'variant', 'status', 'renderSubmenu', 'showSubmenuChevron', 'customPopoverConfig', 'tooltip', 'renderAvatar', 'renderIcon', 'href', 'onClick', 'onSubmenuToggle', 'onMouseOver', 'onMouseOut', 'onFocus', 'onBlur', 'onKeyDown', 'onKeyUp', 'elementRef', 'itemRef'];
|
|
65
|
+
const allowedProps = ['id', 'as', 'children', 'variant', 'status', 'renderSubmenu', 'showSubmenuChevron', 'customPopoverConfig', 'tooltip', 'renderAvatar', 'renderIcon', 'href', 'onClick', 'onSubmenuToggle', 'onMouseOver', 'onMouseOut', 'onFocus', 'onBlur', 'onKeyDown', 'onKeyUp', 'elementRef', 'itemRef'];
|
|
65
66
|
export { propTypes, allowedProps, topNavBarItemTooltipPropType };
|
|
@@ -273,6 +273,7 @@ let TopNavBarItem = exports.TopNavBarItem = (_dec = (0, _withDeterministicId.wit
|
|
|
273
273
|
get itemProps() {
|
|
274
274
|
const _this$props5 = this.props,
|
|
275
275
|
id = _this$props5.id,
|
|
276
|
+
as = _this$props5.as,
|
|
276
277
|
variant = _this$props5.variant,
|
|
277
278
|
hrefOriginal = _this$props5.href,
|
|
278
279
|
onClickOriginal = _this$props5.onClick,
|
|
@@ -321,6 +322,7 @@ let TopNavBarItem = exports.TopNavBarItem = (_dec = (0, _withDeterministicId.wit
|
|
|
321
322
|
}
|
|
322
323
|
return {
|
|
323
324
|
id,
|
|
325
|
+
as,
|
|
324
326
|
...this.colorProps,
|
|
325
327
|
...this.ariaProps,
|
|
326
328
|
size: this.size,
|
|
@@ -43,6 +43,7 @@ const topNavBarItemTooltipPropType = exports.topNavBarItemTooltipPropType = _pro
|
|
|
43
43
|
})]);
|
|
44
44
|
const propTypes = exports.propTypes = {
|
|
45
45
|
id: _propTypes.default.string.isRequired,
|
|
46
|
+
as: _propTypes.default.elementType,
|
|
46
47
|
children: _propTypes.default.node.isRequired,
|
|
47
48
|
variant: _propTypes.default.oneOf(['default', 'button', 'icon', 'avatar']),
|
|
48
49
|
status: _propTypes.default.oneOf(['default', 'active', 'disabled']),
|
|
@@ -68,4 +69,4 @@ const propTypes = exports.propTypes = {
|
|
|
68
69
|
elementRef: _propTypes.default.func,
|
|
69
70
|
itemRef: _propTypes.default.func
|
|
70
71
|
};
|
|
71
|
-
const allowedProps = exports.allowedProps = ['id', 'children', 'variant', 'status', 'renderSubmenu', 'showSubmenuChevron', 'customPopoverConfig', 'tooltip', 'renderAvatar', 'renderIcon', 'href', 'onClick', 'onSubmenuToggle', 'onMouseOver', 'onMouseOut', 'onFocus', 'onBlur', 'onKeyDown', 'onKeyUp', 'elementRef', 'itemRef'];
|
|
72
|
+
const allowedProps = exports.allowedProps = ['id', 'as', 'children', 'variant', 'status', 'renderSubmenu', 'showSubmenuChevron', 'customPopoverConfig', 'tooltip', 'renderAvatar', 'renderIcon', 'href', 'onClick', 'onSubmenuToggle', 'onMouseOver', 'onMouseOut', 'onFocus', 'onBlur', 'onKeyDown', 'onKeyUp', 'elementRef', 'itemRef'];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-top-nav-bar",
|
|
3
|
-
"version": "8.46.2-snapshot-
|
|
3
|
+
"version": "8.46.2-snapshot-17",
|
|
4
4
|
"description": "A UI component library made by Instructure Inc.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -24,35 +24,35 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime": "^7.23.2",
|
|
27
|
-
"@instructure/console": "8.46.2-snapshot-
|
|
28
|
-
"@instructure/emotion": "8.46.2-snapshot-
|
|
29
|
-
"@instructure/shared-types": "8.46.2-snapshot-
|
|
30
|
-
"@instructure/ui-a11y-content": "8.46.2-snapshot-
|
|
31
|
-
"@instructure/ui-avatar": "8.46.2-snapshot-
|
|
32
|
-
"@instructure/ui-buttons": "8.46.2-snapshot-
|
|
33
|
-
"@instructure/ui-dialog": "8.46.2-snapshot-
|
|
34
|
-
"@instructure/ui-dom-utils": "8.46.2-snapshot-
|
|
35
|
-
"@instructure/ui-drilldown": "8.46.2-snapshot-
|
|
36
|
-
"@instructure/ui-icons": "8.46.2-snapshot-
|
|
37
|
-
"@instructure/ui-link": "8.46.2-snapshot-
|
|
38
|
-
"@instructure/ui-popover": "8.46.2-snapshot-
|
|
39
|
-
"@instructure/ui-prop-types": "8.46.2-snapshot-
|
|
40
|
-
"@instructure/ui-react-utils": "8.46.2-snapshot-
|
|
41
|
-
"@instructure/ui-responsive": "8.46.2-snapshot-
|
|
42
|
-
"@instructure/ui-testable": "8.46.2-snapshot-
|
|
43
|
-
"@instructure/ui-tooltip": "8.46.2-snapshot-
|
|
44
|
-
"@instructure/ui-tray": "8.46.2-snapshot-
|
|
45
|
-
"@instructure/ui-truncate-list": "8.46.2-snapshot-
|
|
46
|
-
"@instructure/ui-utils": "8.46.2-snapshot-
|
|
47
|
-
"@instructure/ui-view": "8.46.2-snapshot-
|
|
27
|
+
"@instructure/console": "8.46.2-snapshot-17",
|
|
28
|
+
"@instructure/emotion": "8.46.2-snapshot-17",
|
|
29
|
+
"@instructure/shared-types": "8.46.2-snapshot-17",
|
|
30
|
+
"@instructure/ui-a11y-content": "8.46.2-snapshot-17",
|
|
31
|
+
"@instructure/ui-avatar": "8.46.2-snapshot-17",
|
|
32
|
+
"@instructure/ui-buttons": "8.46.2-snapshot-17",
|
|
33
|
+
"@instructure/ui-dialog": "8.46.2-snapshot-17",
|
|
34
|
+
"@instructure/ui-dom-utils": "8.46.2-snapshot-17",
|
|
35
|
+
"@instructure/ui-drilldown": "8.46.2-snapshot-17",
|
|
36
|
+
"@instructure/ui-icons": "8.46.2-snapshot-17",
|
|
37
|
+
"@instructure/ui-link": "8.46.2-snapshot-17",
|
|
38
|
+
"@instructure/ui-popover": "8.46.2-snapshot-17",
|
|
39
|
+
"@instructure/ui-prop-types": "8.46.2-snapshot-17",
|
|
40
|
+
"@instructure/ui-react-utils": "8.46.2-snapshot-17",
|
|
41
|
+
"@instructure/ui-responsive": "8.46.2-snapshot-17",
|
|
42
|
+
"@instructure/ui-testable": "8.46.2-snapshot-17",
|
|
43
|
+
"@instructure/ui-tooltip": "8.46.2-snapshot-17",
|
|
44
|
+
"@instructure/ui-tray": "8.46.2-snapshot-17",
|
|
45
|
+
"@instructure/ui-truncate-list": "8.46.2-snapshot-17",
|
|
46
|
+
"@instructure/ui-utils": "8.46.2-snapshot-17",
|
|
47
|
+
"@instructure/ui-view": "8.46.2-snapshot-17",
|
|
48
48
|
"prop-types": "^15.8.1"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@instructure/ui-babel-preset": "8.46.2-snapshot-
|
|
52
|
-
"@instructure/ui-color-utils": "8.46.2-snapshot-
|
|
53
|
-
"@instructure/ui-test-locator": "8.46.2-snapshot-
|
|
54
|
-
"@instructure/ui-test-utils": "8.46.2-snapshot-
|
|
55
|
-
"@instructure/ui-themes": "8.46.2-snapshot-
|
|
51
|
+
"@instructure/ui-babel-preset": "8.46.2-snapshot-17",
|
|
52
|
+
"@instructure/ui-color-utils": "8.46.2-snapshot-17",
|
|
53
|
+
"@instructure/ui-test-locator": "8.46.2-snapshot-17",
|
|
54
|
+
"@instructure/ui-test-utils": "8.46.2-snapshot-17",
|
|
55
|
+
"@instructure/ui-themes": "8.46.2-snapshot-17"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"react": ">=16.8 <=18"
|
|
@@ -344,6 +344,7 @@ class TopNavBarItem extends Component<TopNavBarItemProps, TopNavBarItemState> {
|
|
|
344
344
|
get itemProps(): BaseButtonProps | null {
|
|
345
345
|
const {
|
|
346
346
|
id,
|
|
347
|
+
as,
|
|
347
348
|
variant,
|
|
348
349
|
href: hrefOriginal,
|
|
349
350
|
onClick: onClickOriginal,
|
|
@@ -418,6 +419,7 @@ class TopNavBarItem extends Component<TopNavBarItemProps, TopNavBarItemState> {
|
|
|
418
419
|
|
|
419
420
|
return {
|
|
420
421
|
id,
|
|
422
|
+
as,
|
|
421
423
|
...this.colorProps,
|
|
422
424
|
...this.ariaProps,
|
|
423
425
|
size: this.size,
|
|
@@ -33,7 +33,8 @@ import type {
|
|
|
33
33
|
TopNavBarItemTheme,
|
|
34
34
|
OtherHTMLAttributes,
|
|
35
35
|
PropValidators,
|
|
36
|
-
Renderable
|
|
36
|
+
Renderable,
|
|
37
|
+
AsElementType
|
|
37
38
|
} from '@instructure/shared-types'
|
|
38
39
|
|
|
39
40
|
import { Drilldown } from '@instructure/ui-drilldown'
|
|
@@ -75,6 +76,11 @@ const topNavBarItemTooltipPropType = PropTypes.oneOfType([
|
|
|
75
76
|
])
|
|
76
77
|
|
|
77
78
|
type TopNavBarItemOwnProps = {
|
|
79
|
+
/**
|
|
80
|
+
* the element type to render as (will default to `<a>` if href is provided)
|
|
81
|
+
*/
|
|
82
|
+
as?: AsElementType
|
|
83
|
+
|
|
78
84
|
/**
|
|
79
85
|
* Required id, used for internal tracking,
|
|
80
86
|
* and it also appears as an id on the item element.
|
|
@@ -268,6 +274,7 @@ type TopNavBarItemStyleProps = {
|
|
|
268
274
|
|
|
269
275
|
const propTypes: PropValidators<PropKeys> = {
|
|
270
276
|
id: PropTypes.string.isRequired,
|
|
277
|
+
as: PropTypes.elementType,
|
|
271
278
|
children: PropTypes.node.isRequired,
|
|
272
279
|
variant: PropTypes.oneOf(['default', 'button', 'icon', 'avatar']),
|
|
273
280
|
status: PropTypes.oneOf(['default', 'active', 'disabled']),
|
|
@@ -296,6 +303,7 @@ const propTypes: PropValidators<PropKeys> = {
|
|
|
296
303
|
|
|
297
304
|
const allowedProps: AllowedPropKeys = [
|
|
298
305
|
'id',
|
|
306
|
+
'as',
|
|
299
307
|
'children',
|
|
300
308
|
'variant',
|
|
301
309
|
'status',
|