@instructure/ui-navigation 8.9.1-snapshot.0 → 8.9.2-snapshot.12
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 +4 -0
- package/README.md +0 -1
- package/es/AppNav/index.js +1 -1
- package/es/Navigation/NavigationItem/index.js +1 -1
- package/es/Navigation/index.js +1 -1
- package/lib/AppNav/index.js +1 -1
- package/lib/Navigation/NavigationItem/index.js +1 -1
- package/lib/Navigation/index.js +1 -1
- package/package.json +24 -24
- package/src/AppNav/Item/props.ts +11 -4
- package/src/AppNav/Item/styles.ts +3 -3
- package/src/AppNav/index.tsx +1 -1
- package/src/AppNav/props.ts +17 -4
- package/src/AppNav/styles.ts +3 -2
- package/src/Navigation/NavigationItem/index.tsx +1 -1
- package/src/Navigation/NavigationItem/props.ts +11 -4
- package/src/Navigation/NavigationItem/styles.ts +3 -3
- package/src/Navigation/index.tsx +1 -1
- package/src/Navigation/props.ts +9 -4
- package/src/Navigation/styles.ts +3 -3
- package/types/AppNav/Item/props.d.ts +5 -4
- package/types/AppNav/Item/props.d.ts.map +1 -1
- package/types/AppNav/Item/styles.d.ts +3 -79
- package/types/AppNav/Item/styles.d.ts.map +1 -1
- package/types/AppNav/props.d.ts +5 -4
- package/types/AppNav/props.d.ts.map +1 -1
- package/types/AppNav/styles.d.ts +3 -41
- package/types/AppNav/styles.d.ts.map +1 -1
- package/types/Navigation/NavigationItem/props.d.ts +5 -4
- package/types/Navigation/NavigationItem/props.d.ts.map +1 -1
- package/types/Navigation/NavigationItem/styles.d.ts +3 -69
- package/types/Navigation/NavigationItem/styles.d.ts.map +1 -1
- package/types/Navigation/props.d.ts +5 -4
- package/types/Navigation/props.d.ts.map +1 -1
- package/types/Navigation/styles.d.ts +3 -35
- package/types/Navigation/styles.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
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.9.1](https://github.com/instructure/instructure-ui/compare/v8.9.0...v8.9.1) (2021-09-16)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-navigation
|
|
9
|
+
|
|
6
10
|
# [8.9.0](https://github.com/instructure/instructure-ui/compare/v8.8.0...v8.9.0) (2021-09-15)
|
|
7
11
|
|
|
8
12
|
### Bug Fixes
|
package/README.md
CHANGED
package/es/AppNav/index.js
CHANGED
|
@@ -182,7 +182,7 @@ let AppNav = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = t
|
|
|
182
182
|
screenReaderLabel = _this$props3.screenReaderLabel,
|
|
183
183
|
margin = _this$props3.margin,
|
|
184
184
|
elementRef = _this$props3.elementRef;
|
|
185
|
-
const passthroughProps = View.omitViewProps(omitProps(this.props, AppNav.
|
|
185
|
+
const passthroughProps = View.omitViewProps(omitProps(this.props, AppNav.allowedProps), AppNav);
|
|
186
186
|
const isMeasuring = this.state.isMeasuring;
|
|
187
187
|
const childrenArray = Children.toArray(children);
|
|
188
188
|
const visibleChildren = isMeasuring ? childrenArray : childrenArray.splice(0, visibleItemsCount);
|
|
@@ -67,7 +67,7 @@ let NavigationItem = (_dec = withStyle(generateStyle, generateComponentTheme), _
|
|
|
67
67
|
onClick = _this$props3.onClick,
|
|
68
68
|
icon = _this$props3.icon,
|
|
69
69
|
label = _this$props3.label;
|
|
70
|
-
const props = omitProps(this.props, NavigationItem.
|
|
70
|
+
const props = omitProps(this.props, NavigationItem.allowedProps);
|
|
71
71
|
return jsx(ElementType, Object.assign({}, props, {
|
|
72
72
|
href: href,
|
|
73
73
|
onClick: onClick,
|
package/es/Navigation/index.js
CHANGED
|
@@ -114,7 +114,7 @@ let Navigation = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2
|
|
|
114
114
|
var _this$props$styles2, _this$props$styles3, _this$props$styles4, _this$props$styles5;
|
|
115
115
|
|
|
116
116
|
const label = this.props.label;
|
|
117
|
-
const props = omitProps(this.props, Navigation.
|
|
117
|
+
const props = omitProps(this.props, Navigation.allowedProps, ['minimized']);
|
|
118
118
|
return jsx("nav", Object.assign({}, props, {
|
|
119
119
|
css: (_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.navigation,
|
|
120
120
|
"aria-label": label
|
package/lib/AppNav/index.js
CHANGED
|
@@ -181,7 +181,7 @@ let AppNav = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _
|
|
|
181
181
|
margin = _this$props3.margin,
|
|
182
182
|
elementRef = _this$props3.elementRef;
|
|
183
183
|
|
|
184
|
-
const passthroughProps = _View.View.omitViewProps((0, _omitProps.omitProps)(this.props, AppNav.
|
|
184
|
+
const passthroughProps = _View.View.omitViewProps((0, _omitProps.omitProps)(this.props, AppNav.allowedProps), AppNav);
|
|
185
185
|
|
|
186
186
|
const isMeasuring = this.state.isMeasuring;
|
|
187
187
|
|
|
@@ -61,7 +61,7 @@ let NavigationItem = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.def
|
|
|
61
61
|
onClick = _this$props3.onClick,
|
|
62
62
|
icon = _this$props3.icon,
|
|
63
63
|
label = _this$props3.label;
|
|
64
|
-
const props = (0, _omitProps.omitProps)(this.props, NavigationItem.
|
|
64
|
+
const props = (0, _omitProps.omitProps)(this.props, NavigationItem.allowedProps);
|
|
65
65
|
return (0, _emotion.jsx)(ElementType, Object.assign({}, props, {
|
|
66
66
|
href: href,
|
|
67
67
|
onClick: onClick,
|
package/lib/Navigation/index.js
CHANGED
|
@@ -115,7 +115,7 @@ let Navigation = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default
|
|
|
115
115
|
var _this$props$styles2, _this$props$styles3, _this$props$styles4, _this$props$styles5;
|
|
116
116
|
|
|
117
117
|
const label = this.props.label;
|
|
118
|
-
const props = (0, _omitProps.omitProps)(this.props, Navigation.
|
|
118
|
+
const props = (0, _omitProps.omitProps)(this.props, Navigation.allowedProps, ['minimized']);
|
|
119
119
|
return (0, _emotion.jsx)("nav", Object.assign({}, props, {
|
|
120
120
|
css: (_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.navigation,
|
|
121
121
|
"aria-label": label
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-navigation",
|
|
3
|
-
"version": "8.9.
|
|
3
|
+
"version": "8.9.2-snapshot.12+6231ada93",
|
|
4
4
|
"description": "Main and application level navigational components",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -24,31 +24,31 @@
|
|
|
24
24
|
},
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@instructure/ui-babel-preset": "8.9.
|
|
28
|
-
"@instructure/ui-color-utils": "8.9.
|
|
29
|
-
"@instructure/ui-test-locator": "8.9.
|
|
30
|
-
"@instructure/ui-test-utils": "8.9.
|
|
31
|
-
"@instructure/ui-themes": "8.9.
|
|
27
|
+
"@instructure/ui-babel-preset": "8.9.2-snapshot.12+6231ada93",
|
|
28
|
+
"@instructure/ui-color-utils": "8.9.2-snapshot.12+6231ada93",
|
|
29
|
+
"@instructure/ui-test-locator": "8.9.2-snapshot.12+6231ada93",
|
|
30
|
+
"@instructure/ui-test-utils": "8.9.2-snapshot.12+6231ada93",
|
|
31
|
+
"@instructure/ui-themes": "8.9.2-snapshot.12+6231ada93"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.13.10",
|
|
35
|
-
"@instructure/console": "8.9.
|
|
36
|
-
"@instructure/debounce": "8.9.
|
|
37
|
-
"@instructure/emotion": "8.9.
|
|
38
|
-
"@instructure/shared-types": "8.9.
|
|
39
|
-
"@instructure/ui-a11y-content": "8.9.
|
|
40
|
-
"@instructure/ui-a11y-utils": "8.9.
|
|
41
|
-
"@instructure/ui-badge": "8.9.
|
|
42
|
-
"@instructure/ui-dom-utils": "8.9.
|
|
43
|
-
"@instructure/ui-focusable": "8.9.
|
|
44
|
-
"@instructure/ui-icons": "8.9.
|
|
45
|
-
"@instructure/ui-menu": "8.9.
|
|
46
|
-
"@instructure/ui-prop-types": "8.9.
|
|
47
|
-
"@instructure/ui-react-utils": "8.9.
|
|
48
|
-
"@instructure/ui-testable": "8.9.
|
|
49
|
-
"@instructure/ui-tooltip": "8.9.
|
|
50
|
-
"@instructure/ui-utils": "8.9.
|
|
51
|
-
"@instructure/ui-view": "8.9.
|
|
35
|
+
"@instructure/console": "8.9.2-snapshot.12+6231ada93",
|
|
36
|
+
"@instructure/debounce": "8.9.2-snapshot.12+6231ada93",
|
|
37
|
+
"@instructure/emotion": "8.9.2-snapshot.12+6231ada93",
|
|
38
|
+
"@instructure/shared-types": "8.9.2-snapshot.12+6231ada93",
|
|
39
|
+
"@instructure/ui-a11y-content": "8.9.2-snapshot.12+6231ada93",
|
|
40
|
+
"@instructure/ui-a11y-utils": "8.9.2-snapshot.12+6231ada93",
|
|
41
|
+
"@instructure/ui-badge": "8.9.2-snapshot.12+6231ada93",
|
|
42
|
+
"@instructure/ui-dom-utils": "8.9.2-snapshot.12+6231ada93",
|
|
43
|
+
"@instructure/ui-focusable": "8.9.2-snapshot.12+6231ada93",
|
|
44
|
+
"@instructure/ui-icons": "8.9.2-snapshot.12+6231ada93",
|
|
45
|
+
"@instructure/ui-menu": "8.9.2-snapshot.12+6231ada93",
|
|
46
|
+
"@instructure/ui-prop-types": "8.9.2-snapshot.12+6231ada93",
|
|
47
|
+
"@instructure/ui-react-utils": "8.9.2-snapshot.12+6231ada93",
|
|
48
|
+
"@instructure/ui-testable": "8.9.2-snapshot.12+6231ada93",
|
|
49
|
+
"@instructure/ui-tooltip": "8.9.2-snapshot.12+6231ada93",
|
|
50
|
+
"@instructure/ui-utils": "8.9.2-snapshot.12+6231ada93",
|
|
51
|
+
"@instructure/ui-view": "8.9.2-snapshot.12+6231ada93",
|
|
52
52
|
"prop-types": "^15"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
60
|
"sideEffects": false,
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "6231ada93bd4299d640b5d39d7e44b0f54852b2a"
|
|
62
62
|
}
|
package/src/AppNav/Item/props.ts
CHANGED
|
@@ -23,8 +23,12 @@
|
|
|
23
23
|
*/
|
|
24
24
|
import PropTypes from 'prop-types'
|
|
25
25
|
|
|
26
|
-
import type {
|
|
27
|
-
|
|
26
|
+
import type {
|
|
27
|
+
AsElementType,
|
|
28
|
+
PropValidators,
|
|
29
|
+
AppNavItemTheme
|
|
30
|
+
} from '@instructure/shared-types'
|
|
31
|
+
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
|
|
28
32
|
|
|
29
33
|
type AppNavItemOwnProps = {
|
|
30
34
|
renderLabel: React.ReactNode | ((...args: any[]) => any)
|
|
@@ -43,7 +47,10 @@ type PropKeys = keyof AppNavItemOwnProps
|
|
|
43
47
|
|
|
44
48
|
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
45
49
|
|
|
46
|
-
type AppNavItemProps = AppNavItemOwnProps &
|
|
50
|
+
type AppNavItemProps = AppNavItemOwnProps &
|
|
51
|
+
WithStyleProps<AppNavItemTheme, AppNavItemStyle>
|
|
52
|
+
|
|
53
|
+
type AppNavItemStyle = ComponentStyle<'item' | 'label'>
|
|
47
54
|
|
|
48
55
|
const propTypes: PropValidators<PropKeys> = {
|
|
49
56
|
/**
|
|
@@ -103,5 +110,5 @@ const allowedProps: AllowedPropKeys = [
|
|
|
103
110
|
'isDisabled'
|
|
104
111
|
]
|
|
105
112
|
|
|
106
|
-
export type { AppNavItemProps }
|
|
113
|
+
export type { AppNavItemProps, AppNavItemStyle }
|
|
107
114
|
export { propTypes, allowedProps }
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import { AppNavItemTheme } from '@instructure/shared-types'
|
|
26
|
-
import { AppNavItemProps } from './props'
|
|
25
|
+
import type { AppNavItemTheme } from '@instructure/shared-types'
|
|
26
|
+
import type { AppNavItemProps, AppNavItemStyle } from './props'
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* ---
|
|
@@ -38,7 +38,7 @@ import { AppNavItemProps } from './props'
|
|
|
38
38
|
const generateStyle = (
|
|
39
39
|
componentTheme: AppNavItemTheme,
|
|
40
40
|
props: AppNavItemProps
|
|
41
|
-
) => {
|
|
41
|
+
): AppNavItemStyle => {
|
|
42
42
|
const { isSelected, isDisabled } = props
|
|
43
43
|
|
|
44
44
|
const itemStyles = {
|
package/src/AppNav/index.tsx
CHANGED
package/src/AppNav/props.ts
CHANGED
|
@@ -29,8 +29,12 @@ import { ThemeablePropTypes } from '@instructure/emotion'
|
|
|
29
29
|
|
|
30
30
|
import { Item } from './Item'
|
|
31
31
|
|
|
32
|
-
import type {
|
|
33
|
-
|
|
32
|
+
import type {
|
|
33
|
+
Spacing,
|
|
34
|
+
WithStyleProps,
|
|
35
|
+
ComponentStyle
|
|
36
|
+
} from '@instructure/emotion'
|
|
37
|
+
import type { PropValidators, AppNavTheme } from '@instructure/shared-types'
|
|
34
38
|
|
|
35
39
|
type AppNavOwnProps = {
|
|
36
40
|
screenReaderLabel: string
|
|
@@ -49,7 +53,16 @@ type PropKeys = keyof AppNavOwnProps
|
|
|
49
53
|
|
|
50
54
|
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
51
55
|
|
|
52
|
-
type AppNavProps = AppNavOwnProps & WithStyleProps
|
|
56
|
+
type AppNavProps = AppNavOwnProps & WithStyleProps<AppNavTheme, AppNavStyle>
|
|
57
|
+
|
|
58
|
+
type AppNavStyle = ComponentStyle<
|
|
59
|
+
| 'appNav'
|
|
60
|
+
| 'alignCenter'
|
|
61
|
+
| 'listItemWithMenuTrigger'
|
|
62
|
+
| 'listItem'
|
|
63
|
+
| 'list'
|
|
64
|
+
| 'menuTriggerWidth'
|
|
65
|
+
>
|
|
53
66
|
|
|
54
67
|
const propTypes: PropValidators<PropKeys> = {
|
|
55
68
|
/**
|
|
@@ -114,5 +127,5 @@ const allowedProps: AllowedPropKeys = [
|
|
|
114
127
|
'visibleItemsCount'
|
|
115
128
|
]
|
|
116
129
|
|
|
117
|
-
export type { AppNavProps }
|
|
130
|
+
export type { AppNavProps, AppNavStyle }
|
|
118
131
|
export { propTypes, allowedProps }
|
package/src/AppNav/styles.ts
CHANGED
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import { AppNavTheme } from '@instructure/shared-types'
|
|
25
|
+
import type { AppNavTheme } from '@instructure/shared-types'
|
|
26
|
+
import type { AppNavStyle } from './props'
|
|
26
27
|
|
|
27
28
|
/**
|
|
28
29
|
* ---
|
|
@@ -34,7 +35,7 @@ import { AppNavTheme } from '@instructure/shared-types'
|
|
|
34
35
|
* @param {Object} state the state of the component, the style is applied to
|
|
35
36
|
* @return {Object} The final style object, which will be used in the component
|
|
36
37
|
*/
|
|
37
|
-
const generateStyle = (componentTheme: AppNavTheme) => {
|
|
38
|
+
const generateStyle = (componentTheme: AppNavTheme): AppNavStyle => {
|
|
38
39
|
return {
|
|
39
40
|
appNav: {
|
|
40
41
|
label: 'appNav',
|
|
@@ -70,7 +70,7 @@ class NavigationItem extends Component<NavigationItemProps> {
|
|
|
70
70
|
|
|
71
71
|
const { href, onClick, icon, label } = this.props
|
|
72
72
|
|
|
73
|
-
const props = omitProps(this.props, NavigationItem.
|
|
73
|
+
const props = omitProps(this.props, NavigationItem.allowedProps)
|
|
74
74
|
|
|
75
75
|
return (
|
|
76
76
|
<ElementType
|
|
@@ -23,8 +23,12 @@
|
|
|
23
23
|
*/
|
|
24
24
|
import PropTypes from 'prop-types'
|
|
25
25
|
|
|
26
|
-
import type {
|
|
27
|
-
|
|
26
|
+
import type {
|
|
27
|
+
AsElementType,
|
|
28
|
+
PropValidators,
|
|
29
|
+
NavigationItemTheme
|
|
30
|
+
} from '@instructure/shared-types'
|
|
31
|
+
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
|
|
28
32
|
|
|
29
33
|
type NavigationItemOwnProps = {
|
|
30
34
|
icon: React.ReactNode
|
|
@@ -40,7 +44,10 @@ type PropKeys = keyof NavigationItemOwnProps
|
|
|
40
44
|
|
|
41
45
|
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
42
46
|
|
|
43
|
-
type NavigationItemProps = NavigationItemOwnProps &
|
|
47
|
+
type NavigationItemProps = NavigationItemOwnProps &
|
|
48
|
+
WithStyleProps<NavigationItemTheme, NavigationItemStyle>
|
|
49
|
+
|
|
50
|
+
type NavigationItemStyle = ComponentStyle<'navigationItem' | 'icon' | 'label'>
|
|
44
51
|
|
|
45
52
|
const propTypes: PropValidators<PropKeys> = {
|
|
46
53
|
/**
|
|
@@ -83,5 +90,5 @@ const allowedProps: AllowedPropKeys = [
|
|
|
83
90
|
'minimized'
|
|
84
91
|
]
|
|
85
92
|
|
|
86
|
-
export type { NavigationItemProps }
|
|
93
|
+
export type { NavigationItemProps, NavigationItemStyle }
|
|
87
94
|
export { propTypes, allowedProps }
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import { NavigationItemTheme } from '@instructure/shared-types'
|
|
26
|
-
import { NavigationItemProps } from './props'
|
|
25
|
+
import type { NavigationItemTheme } from '@instructure/shared-types'
|
|
26
|
+
import type { NavigationItemProps, NavigationItemStyle } from './props'
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* ---
|
|
@@ -38,7 +38,7 @@ import { NavigationItemProps } from './props'
|
|
|
38
38
|
const generateStyle = (
|
|
39
39
|
componentTheme: NavigationItemTheme,
|
|
40
40
|
props: NavigationItemProps
|
|
41
|
-
) => {
|
|
41
|
+
): NavigationItemStyle => {
|
|
42
42
|
const { selected } = props
|
|
43
43
|
|
|
44
44
|
return {
|
package/src/Navigation/index.tsx
CHANGED
|
@@ -124,7 +124,7 @@ class Navigation extends Component<NavigationProps, NavigationState> {
|
|
|
124
124
|
render() {
|
|
125
125
|
const { label } = this.props
|
|
126
126
|
|
|
127
|
-
const props = omitProps(this.props, Navigation.
|
|
127
|
+
const props = omitProps(this.props, Navigation.allowedProps, ['minimized'])
|
|
128
128
|
|
|
129
129
|
return (
|
|
130
130
|
<nav {...props} css={this.props.styles?.navigation} aria-label={label}>
|
package/src/Navigation/props.ts
CHANGED
|
@@ -31,8 +31,8 @@ import {
|
|
|
31
31
|
|
|
32
32
|
import { NavigationItem } from './NavigationItem'
|
|
33
33
|
|
|
34
|
-
import type { PropValidators } from '@instructure/shared-types'
|
|
35
|
-
import type { WithStyleProps } from '@instructure/emotion'
|
|
34
|
+
import type { PropValidators, NavigationTheme } from '@instructure/shared-types'
|
|
35
|
+
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
|
|
36
36
|
|
|
37
37
|
type NavigationOwnProps = {
|
|
38
38
|
minimized?: any // TODO: controllable(PropTypes.bool, 'onMinimized', 'defaultMinimized')
|
|
@@ -56,7 +56,12 @@ type PropKeys = keyof NavigationOwnProps
|
|
|
56
56
|
|
|
57
57
|
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
58
58
|
|
|
59
|
-
type NavigationProps = NavigationOwnProps &
|
|
59
|
+
type NavigationProps = NavigationOwnProps &
|
|
60
|
+
WithStyleProps<NavigationTheme, NavigationStyle>
|
|
61
|
+
|
|
62
|
+
type NavigationStyle = ComponentStyle<
|
|
63
|
+
'navigation' | 'list' | 'content' | 'toggle' | 'toggleIcon'
|
|
64
|
+
>
|
|
60
65
|
|
|
61
66
|
const propTypes: PropValidators<PropKeys> = {
|
|
62
67
|
/**
|
|
@@ -104,5 +109,5 @@ const allowedProps: AllowedPropKeys = [
|
|
|
104
109
|
'onClick'
|
|
105
110
|
]
|
|
106
111
|
|
|
107
|
-
export type { NavigationProps, NavigationState }
|
|
112
|
+
export type { NavigationProps, NavigationState, NavigationStyle }
|
|
108
113
|
export { propTypes, allowedProps }
|
package/src/Navigation/styles.ts
CHANGED
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import { NavigationTheme } from '@instructure/shared-types'
|
|
26
|
-
import { NavigationProps, NavigationState } from './props'
|
|
25
|
+
import type { NavigationTheme } from '@instructure/shared-types'
|
|
26
|
+
import type { NavigationProps, NavigationState, NavigationStyle } from './props'
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* ---
|
|
@@ -40,7 +40,7 @@ const generateStyle = (
|
|
|
40
40
|
// @ts-expect-error no props used here
|
|
41
41
|
props: NavigationProps,
|
|
42
42
|
state: NavigationState
|
|
43
|
-
) => {
|
|
43
|
+
): NavigationStyle => {
|
|
44
44
|
const { minimized } = state
|
|
45
45
|
|
|
46
46
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { AsElementType, PropValidators } from '@instructure/shared-types';
|
|
3
|
-
import type { WithStyleProps } from '@instructure/emotion';
|
|
2
|
+
import type { AsElementType, PropValidators, AppNavItemTheme } from '@instructure/shared-types';
|
|
3
|
+
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
4
4
|
declare type AppNavItemOwnProps = {
|
|
5
5
|
renderLabel: React.ReactNode | ((...args: any[]) => any);
|
|
6
6
|
renderAfter?: React.ReactNode | ((...args: any[]) => any);
|
|
@@ -15,9 +15,10 @@ declare type AppNavItemOwnProps = {
|
|
|
15
15
|
};
|
|
16
16
|
declare type PropKeys = keyof AppNavItemOwnProps;
|
|
17
17
|
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
18
|
-
declare type AppNavItemProps = AppNavItemOwnProps & WithStyleProps
|
|
18
|
+
declare type AppNavItemProps = AppNavItemOwnProps & WithStyleProps<AppNavItemTheme, AppNavItemStyle>;
|
|
19
|
+
declare type AppNavItemStyle = ComponentStyle<'item' | 'label'>;
|
|
19
20
|
declare const propTypes: PropValidators<PropKeys>;
|
|
20
21
|
declare const allowedProps: AllowedPropKeys;
|
|
21
|
-
export type { AppNavItemProps };
|
|
22
|
+
export type { AppNavItemProps, AppNavItemStyle };
|
|
22
23
|
export { propTypes, allowedProps };
|
|
23
24
|
//# sourceMappingURL=props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/AppNav/Item/props.ts"],"names":[],"mappings":";AAyBA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/AppNav/Item/props.ts"],"names":[],"mappings":";AAyBA,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,eAAe,EAChB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1E,aAAK,kBAAkB,GAAG;IACxB,WAAW,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAA;IACxD,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAA;IACzD,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAA;IACxD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACjC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,UAAU,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACpC,EAAE,CAAC,EAAE,aAAa,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,kBAAkB,CAAA;AAExC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,eAAe,GAAG,kBAAkB,GACvC,cAAc,CAAC,eAAe,EAAE,eAAe,CAAC,CAAA;AAElD,aAAK,eAAe,GAAG,cAAc,CAAC,MAAM,GAAG,OAAO,CAAC,CAAA;AAEvD,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CA2CvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAWnB,CAAA;AAED,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,CAAA;AAChD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AppNavItemTheme } from '@instructure/shared-types';
|
|
2
|
-
import { AppNavItemProps } from './props';
|
|
1
|
+
import type { AppNavItemTheme } from '@instructure/shared-types';
|
|
2
|
+
import type { AppNavItemProps, AppNavItemStyle } from './props';
|
|
3
3
|
/**
|
|
4
4
|
* ---
|
|
5
5
|
* private: true
|
|
@@ -10,82 +10,6 @@ import { AppNavItemProps } from './props';
|
|
|
10
10
|
* @param {Object} state the state of the component, the style is applied to
|
|
11
11
|
* @return {Object} The final style object, which will be used in the component
|
|
12
12
|
*/
|
|
13
|
-
declare const generateStyle: (componentTheme: AppNavItemTheme, props: AppNavItemProps) =>
|
|
14
|
-
item: {
|
|
15
|
-
'&:is(a), &:is(button)': {
|
|
16
|
-
pointerEvents?: string | undefined;
|
|
17
|
-
opacity?: number | undefined;
|
|
18
|
-
appearance: string;
|
|
19
|
-
overflow: string;
|
|
20
|
-
direction: string;
|
|
21
|
-
margin: string;
|
|
22
|
-
textDecoration: string;
|
|
23
|
-
userSelect: string;
|
|
24
|
-
touchAction: string;
|
|
25
|
-
background: string;
|
|
26
|
-
border: string;
|
|
27
|
-
outline: string;
|
|
28
|
-
lineHeight: string | 0;
|
|
29
|
-
padding: string;
|
|
30
|
-
alignItems: string;
|
|
31
|
-
'&:hover': {
|
|
32
|
-
textDecoration: string;
|
|
33
|
-
textDecorationColor: string;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
'&:-webkit-any(a), &:-webkit-any(button)': {
|
|
37
|
-
pointerEvents?: string | undefined;
|
|
38
|
-
opacity?: number | undefined;
|
|
39
|
-
appearance: string;
|
|
40
|
-
overflow: string;
|
|
41
|
-
direction: string;
|
|
42
|
-
margin: string;
|
|
43
|
-
textDecoration: string;
|
|
44
|
-
userSelect: string;
|
|
45
|
-
touchAction: string;
|
|
46
|
-
background: string;
|
|
47
|
-
border: string;
|
|
48
|
-
outline: string;
|
|
49
|
-
lineHeight: string | 0;
|
|
50
|
-
padding: string;
|
|
51
|
-
alignItems: string;
|
|
52
|
-
'&:hover': {
|
|
53
|
-
textDecoration: string;
|
|
54
|
-
textDecorationColor: string;
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
pointerEvents?: string | undefined;
|
|
58
|
-
opacity?: number | undefined;
|
|
59
|
-
appearance: string;
|
|
60
|
-
overflow: string;
|
|
61
|
-
direction: string;
|
|
62
|
-
margin: string;
|
|
63
|
-
textDecoration: string;
|
|
64
|
-
userSelect: string;
|
|
65
|
-
touchAction: string;
|
|
66
|
-
background: string;
|
|
67
|
-
border: string;
|
|
68
|
-
outline: string;
|
|
69
|
-
lineHeight: string | 0;
|
|
70
|
-
padding: string;
|
|
71
|
-
alignItems: string;
|
|
72
|
-
'&:hover': {
|
|
73
|
-
textDecoration: string;
|
|
74
|
-
textDecorationColor: string;
|
|
75
|
-
};
|
|
76
|
-
label: string;
|
|
77
|
-
};
|
|
78
|
-
label: {
|
|
79
|
-
color: string;
|
|
80
|
-
textDecoration?: string | undefined;
|
|
81
|
-
label: string;
|
|
82
|
-
whiteSpace: string;
|
|
83
|
-
overflow: string;
|
|
84
|
-
textOverflow: string;
|
|
85
|
-
fontFamily: string;
|
|
86
|
-
fontSize: string | 0;
|
|
87
|
-
fontWeight: number;
|
|
88
|
-
};
|
|
89
|
-
};
|
|
13
|
+
declare const generateStyle: (componentTheme: AppNavItemTheme, props: AppNavItemProps) => AppNavItemStyle;
|
|
90
14
|
export default generateStyle;
|
|
91
15
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/AppNav/Item/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/AppNav/Item/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE/D;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,mBACD,eAAe,SACxB,eAAe,KACrB,eAsDF,CAAA;AAED,eAAe,aAAa,CAAA"}
|
package/types/AppNav/props.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { Spacing, WithStyleProps } from '@instructure/emotion';
|
|
3
|
-
import type { PropValidators } from '@instructure/shared-types';
|
|
2
|
+
import type { Spacing, WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
3
|
+
import type { PropValidators, AppNavTheme } from '@instructure/shared-types';
|
|
4
4
|
declare type AppNavOwnProps = {
|
|
5
5
|
screenReaderLabel: string;
|
|
6
6
|
debounce?: number;
|
|
@@ -15,9 +15,10 @@ declare type AppNavOwnProps = {
|
|
|
15
15
|
};
|
|
16
16
|
declare type PropKeys = keyof AppNavOwnProps;
|
|
17
17
|
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
18
|
-
declare type AppNavProps = AppNavOwnProps & WithStyleProps
|
|
18
|
+
declare type AppNavProps = AppNavOwnProps & WithStyleProps<AppNavTheme, AppNavStyle>;
|
|
19
|
+
declare type AppNavStyle = ComponentStyle<'appNav' | 'alignCenter' | 'listItemWithMenuTrigger' | 'listItem' | 'list' | 'menuTriggerWidth'>;
|
|
19
20
|
declare const propTypes: PropValidators<PropKeys>;
|
|
20
21
|
declare const allowedProps: AllowedPropKeys;
|
|
21
|
-
export type { AppNavProps };
|
|
22
|
+
export type { AppNavProps, AppNavStyle };
|
|
22
23
|
export { propTypes, allowedProps };
|
|
23
24
|
//# sourceMappingURL=props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/AppNav/props.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/AppNav/props.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAE5E,aAAK,cAAc,GAAG;IACpB,iBAAiB,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAA;IAC/D,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAA;IAC9D,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,UAAU,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACpC,mBAAmB,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAA;IACjE,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IAClC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,cAAc,CAAA;AAEpC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,WAAW,GAAG,cAAc,GAAG,cAAc,CAAC,WAAW,EAAE,WAAW,CAAC,CAAA;AAE5E,aAAK,WAAW,GAAG,cAAc,CAC7B,QAAQ,GACR,aAAa,GACb,yBAAyB,GACzB,UAAU,GACV,MAAM,GACN,kBAAkB,CACrB,CAAA;AAED,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAgDvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAWnB,CAAA;AAED,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
package/types/AppNav/styles.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AppNavTheme } from '@instructure/shared-types';
|
|
1
|
+
import type { AppNavTheme } from '@instructure/shared-types';
|
|
2
|
+
import type { AppNavStyle } from './props';
|
|
2
3
|
/**
|
|
3
4
|
* ---
|
|
4
5
|
* private: true
|
|
@@ -9,45 +10,6 @@ import { AppNavTheme } from '@instructure/shared-types';
|
|
|
9
10
|
* @param {Object} state the state of the component, the style is applied to
|
|
10
11
|
* @return {Object} The final style object, which will be used in the component
|
|
11
12
|
*/
|
|
12
|
-
declare const generateStyle: (componentTheme: AppNavTheme) =>
|
|
13
|
-
appNav: {
|
|
14
|
-
label: string;
|
|
15
|
-
fontFamily: string;
|
|
16
|
-
borderBottom: string;
|
|
17
|
-
};
|
|
18
|
-
alignCenter: {
|
|
19
|
-
alignItems: string;
|
|
20
|
-
};
|
|
21
|
-
listItemWithMenuTrigger: {
|
|
22
|
-
label: string;
|
|
23
|
-
minWidth: string;
|
|
24
|
-
marginInlineStart: string | 0;
|
|
25
|
-
marginInlineEnd: string;
|
|
26
|
-
flexShrink: number;
|
|
27
|
-
flexBasis: string | 0;
|
|
28
|
-
};
|
|
29
|
-
listItem: {
|
|
30
|
-
label: string;
|
|
31
|
-
minWidth: string;
|
|
32
|
-
marginInlineStart: string | 0;
|
|
33
|
-
marginInlineEnd: string;
|
|
34
|
-
flexShrink: number;
|
|
35
|
-
};
|
|
36
|
-
list: {
|
|
37
|
-
label: string;
|
|
38
|
-
boxSizing: string;
|
|
39
|
-
listStyleType: string;
|
|
40
|
-
height: string | 0;
|
|
41
|
-
margin: string;
|
|
42
|
-
padding: string;
|
|
43
|
-
display: string;
|
|
44
|
-
alignItems: string;
|
|
45
|
-
flexGrow: number;
|
|
46
|
-
flexShrink: number;
|
|
47
|
-
flexBasis: string;
|
|
48
|
-
minWidth: string;
|
|
49
|
-
};
|
|
50
|
-
menuTriggerWidth: string | 0;
|
|
51
|
-
};
|
|
13
|
+
declare const generateStyle: (componentTheme: AppNavTheme) => AppNavStyle;
|
|
52
14
|
export default generateStyle;
|
|
53
15
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/AppNav/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/AppNav/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,mBAAoB,WAAW,KAAG,WAyCpD,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { AsElementType, PropValidators } from '@instructure/shared-types';
|
|
3
|
-
import type { WithStyleProps } from '@instructure/emotion';
|
|
2
|
+
import type { AsElementType, PropValidators, NavigationItemTheme } from '@instructure/shared-types';
|
|
3
|
+
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
4
4
|
declare type NavigationItemOwnProps = {
|
|
5
5
|
icon: React.ReactNode;
|
|
6
6
|
label: React.ReactNode;
|
|
@@ -12,9 +12,10 @@ declare type NavigationItemOwnProps = {
|
|
|
12
12
|
};
|
|
13
13
|
declare type PropKeys = keyof NavigationItemOwnProps;
|
|
14
14
|
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
15
|
-
declare type NavigationItemProps = NavigationItemOwnProps & WithStyleProps
|
|
15
|
+
declare type NavigationItemProps = NavigationItemOwnProps & WithStyleProps<NavigationItemTheme, NavigationItemStyle>;
|
|
16
|
+
declare type NavigationItemStyle = ComponentStyle<'navigationItem' | 'icon' | 'label'>;
|
|
16
17
|
declare const propTypes: PropValidators<PropKeys>;
|
|
17
18
|
declare const allowedProps: AllowedPropKeys;
|
|
18
|
-
export type { NavigationItemProps };
|
|
19
|
+
export type { NavigationItemProps, NavigationItemStyle };
|
|
19
20
|
export { propTypes, allowedProps };
|
|
20
21
|
//# sourceMappingURL=props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Navigation/NavigationItem/props.ts"],"names":[],"mappings":";AAyBA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Navigation/NavigationItem/props.ts"],"names":[],"mappings":";AAyBA,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1E,aAAK,sBAAsB,GAAG;IAC5B,IAAI,EAAE,KAAK,CAAC,SAAS,CAAA;IACrB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,EAAE,CAAC,EAAE,aAAa,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,sBAAsB,CAAA;AAE5C,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,mBAAmB,GAAG,sBAAsB,GAC/C,cAAc,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,CAAA;AAE1D,aAAK,mBAAmB,GAAG,cAAc,CAAC,gBAAgB,GAAG,MAAM,GAAG,OAAO,CAAC,CAAA;AAE9E,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CA6BvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAQnB,CAAA;AAED,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NavigationItemTheme } from '@instructure/shared-types';
|
|
2
|
-
import { NavigationItemProps } from './props';
|
|
1
|
+
import type { NavigationItemTheme } from '@instructure/shared-types';
|
|
2
|
+
import type { NavigationItemProps, NavigationItemStyle } from './props';
|
|
3
3
|
/**
|
|
4
4
|
* ---
|
|
5
5
|
* private: true
|
|
@@ -10,72 +10,6 @@ import { NavigationItemProps } from './props';
|
|
|
10
10
|
* @param {Object} state the state of the component, the style is applied to
|
|
11
11
|
* @return {Object} The final style object, which will be used in the component
|
|
12
12
|
*/
|
|
13
|
-
declare const generateStyle: (componentTheme: NavigationItemTheme, props: NavigationItemProps) =>
|
|
14
|
-
navigationItem: {
|
|
15
|
-
backgroundColor: string;
|
|
16
|
-
fill: string;
|
|
17
|
-
color: string;
|
|
18
|
-
'&:active, &:hover': {
|
|
19
|
-
backgroundColor: string;
|
|
20
|
-
};
|
|
21
|
-
'&:focus': {
|
|
22
|
-
backgroundColor: string;
|
|
23
|
-
boxShadow: string;
|
|
24
|
-
outline: string;
|
|
25
|
-
};
|
|
26
|
-
label: string;
|
|
27
|
-
fontFamily: string;
|
|
28
|
-
fontWeight: number;
|
|
29
|
-
display: string;
|
|
30
|
-
width: string;
|
|
31
|
-
textAlign: string;
|
|
32
|
-
padding: string | 0;
|
|
33
|
-
cursor: string;
|
|
34
|
-
border: string;
|
|
35
|
-
boxSizing: string;
|
|
36
|
-
textDecoration: string;
|
|
37
|
-
overflowWrap: string;
|
|
38
|
-
wordWrap: string;
|
|
39
|
-
hyphens: string;
|
|
40
|
-
} | {
|
|
41
|
-
backgroundColor: string;
|
|
42
|
-
color: string;
|
|
43
|
-
'&:active': {
|
|
44
|
-
backgroundColor: string;
|
|
45
|
-
};
|
|
46
|
-
'&:hover': {
|
|
47
|
-
backgroundColor: string;
|
|
48
|
-
};
|
|
49
|
-
'&:focus': {
|
|
50
|
-
backgroundColor: string;
|
|
51
|
-
boxShadow: string;
|
|
52
|
-
outline: string;
|
|
53
|
-
};
|
|
54
|
-
label: string;
|
|
55
|
-
fontFamily: string;
|
|
56
|
-
fontWeight: number;
|
|
57
|
-
display: string;
|
|
58
|
-
width: string;
|
|
59
|
-
textAlign: string;
|
|
60
|
-
padding: string | 0;
|
|
61
|
-
cursor: string;
|
|
62
|
-
border: string;
|
|
63
|
-
boxSizing: string;
|
|
64
|
-
textDecoration: string;
|
|
65
|
-
overflowWrap: string;
|
|
66
|
-
wordWrap: string;
|
|
67
|
-
hyphens: string;
|
|
68
|
-
};
|
|
69
|
-
icon: {
|
|
70
|
-
label: string;
|
|
71
|
-
fontSize: string | 0;
|
|
72
|
-
fill: string;
|
|
73
|
-
};
|
|
74
|
-
label: {
|
|
75
|
-
label: string;
|
|
76
|
-
fontSize: string | 0;
|
|
77
|
-
lineHeight: string | number;
|
|
78
|
-
};
|
|
79
|
-
};
|
|
13
|
+
declare const generateStyle: (componentTheme: NavigationItemTheme, props: NavigationItemProps) => NavigationItemStyle;
|
|
80
14
|
export default generateStyle;
|
|
81
15
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/Navigation/NavigationItem/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/Navigation/NavigationItem/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AACpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAEvE;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,mBACD,mBAAmB,SAC5B,mBAAmB,KACzB,mBA4DF,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { PropValidators } from '@instructure/shared-types';
|
|
3
|
-
import type { WithStyleProps } from '@instructure/emotion';
|
|
2
|
+
import type { PropValidators, NavigationTheme } from '@instructure/shared-types';
|
|
3
|
+
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
4
4
|
declare type NavigationOwnProps = {
|
|
5
5
|
minimized?: any;
|
|
6
6
|
defaultMinimized?: boolean;
|
|
@@ -19,9 +19,10 @@ declare type NavigationState = {
|
|
|
19
19
|
};
|
|
20
20
|
declare type PropKeys = keyof NavigationOwnProps;
|
|
21
21
|
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
22
|
-
declare type NavigationProps = NavigationOwnProps & WithStyleProps
|
|
22
|
+
declare type NavigationProps = NavigationOwnProps & WithStyleProps<NavigationTheme, NavigationStyle>;
|
|
23
|
+
declare type NavigationStyle = ComponentStyle<'navigation' | 'list' | 'content' | 'toggle' | 'toggleIcon'>;
|
|
23
24
|
declare const propTypes: PropValidators<PropKeys>;
|
|
24
25
|
declare const allowedProps: AllowedPropKeys;
|
|
25
|
-
export type { NavigationProps, NavigationState };
|
|
26
|
+
export type { NavigationProps, NavigationState, NavigationStyle };
|
|
26
27
|
export { propTypes, allowedProps };
|
|
27
28
|
//# sourceMappingURL=props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Navigation/props.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAUzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Navigation/props.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAUzB,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1E,aAAK,kBAAkB,GAAG;IACxB,SAAS,CAAC,EAAE,GAAG,CAAA;IACf,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,WAAW,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACrC,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE;QACX,aAAa,CAAC,EAAE,MAAM,CAAA;QACtB,cAAc,CAAC,EAAE,MAAM,CAAA;KACxB,CAAA;IACD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACjC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,aAAK,eAAe,GAAG;IACrB,SAAS,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,kBAAkB,CAAA;AAExC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,eAAe,GAAG,kBAAkB,GACvC,cAAc,CAAC,eAAe,EAAE,eAAe,CAAC,CAAA;AAElD,aAAK,eAAe,GAAG,cAAc,CACnC,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,YAAY,CAC5D,CAAA;AAED,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAiCvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eASnB,CAAA;AAED,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,CAAA;AACjE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NavigationTheme } from '@instructure/shared-types';
|
|
2
|
-
import { NavigationProps, NavigationState } from './props';
|
|
1
|
+
import type { NavigationTheme } from '@instructure/shared-types';
|
|
2
|
+
import type { NavigationProps, NavigationState, NavigationStyle } from './props';
|
|
3
3
|
/**
|
|
4
4
|
* ---
|
|
5
5
|
* private: true
|
|
@@ -10,38 +10,6 @@ import { NavigationProps, NavigationState } from './props';
|
|
|
10
10
|
* @param {Object} state the state of the component, the style is applied to
|
|
11
11
|
* @return {Object} The final style object, which will be used in the component
|
|
12
12
|
*/
|
|
13
|
-
declare const generateStyle: (componentTheme: NavigationTheme, props: NavigationProps, state: NavigationState) =>
|
|
14
|
-
navigation: {
|
|
15
|
-
width: string;
|
|
16
|
-
label: string;
|
|
17
|
-
color: string;
|
|
18
|
-
backgroundColor: string;
|
|
19
|
-
boxSizing: string;
|
|
20
|
-
display: string;
|
|
21
|
-
flexDirection: string;
|
|
22
|
-
height: string;
|
|
23
|
-
overflowY: string;
|
|
24
|
-
};
|
|
25
|
-
list: {
|
|
26
|
-
label: string;
|
|
27
|
-
padding: number;
|
|
28
|
-
margin: number;
|
|
29
|
-
};
|
|
30
|
-
content: {
|
|
31
|
-
label: string;
|
|
32
|
-
listStyleType: string;
|
|
33
|
-
margin: string;
|
|
34
|
-
padding: string;
|
|
35
|
-
flex: string;
|
|
36
|
-
};
|
|
37
|
-
toggle: {
|
|
38
|
-
transform: string;
|
|
39
|
-
transition: string;
|
|
40
|
-
};
|
|
41
|
-
toggleIcon: {
|
|
42
|
-
fill: string;
|
|
43
|
-
margin: string;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
13
|
+
declare const generateStyle: (componentTheme: NavigationTheme, props: NavigationProps, state: NavigationState) => NavigationStyle;
|
|
46
14
|
export default generateStyle;
|
|
47
15
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/Navigation/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/Navigation/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAEhF;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,mBACD,eAAe,SAExB,eAAe,SACf,eAAe,KACrB,eAsCF,CAAA;AAED,eAAe,aAAa,CAAA"}
|