@instructure/ui-view 8.8.1-snapshot.3 → 8.9.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 +6 -0
- package/es/ContextView/index.js +4 -83
- package/es/ContextView/props.js +96 -0
- package/es/View/index.js +8 -4
- package/es/View/{types.js → props.js} +6 -7
- package/lib/ContextView/index.js +4 -84
- package/lib/ContextView/props.js +109 -0
- package/lib/View/index.js +8 -4
- package/lib/View/{types.js → props.js} +4 -6
- package/package.json +14 -15
- package/src/ContextView/index.tsx +6 -87
- package/src/ContextView/props.ts +156 -0
- package/src/ContextView/styles.ts +4 -4
- package/src/View/__examples__/View.examples.ts +1 -1
- package/src/View/index.tsx +18 -5
- package/src/View/{types.ts → props.ts} +23 -15
- package/src/View/styles.ts +1 -1
- package/src/index.ts +2 -2
- package/types/ContextView/index.d.ts +39 -69
- package/types/ContextView/index.d.ts.map +1 -1
- package/types/ContextView/props.d.ts +31 -0
- package/types/ContextView/props.d.ts.map +1 -0
- package/types/ContextView/styles.d.ts +1 -1
- package/types/View/__examples__/View.examples.d.ts +1 -1
- package/types/View/index.d.ts +80 -48
- package/types/View/index.d.ts.map +1 -1
- package/types/View/{types.d.ts → props.d.ts} +15 -44
- package/types/View/props.d.ts.map +1 -0
- package/types/View/styles.d.ts +1 -1
- package/types/index.d.ts +2 -2
- package/LICENSE.md +0 -27
- package/es/ContextView/types.js +0 -1
- package/lib/ContextView/types.js +0 -1
- package/src/ContextView/types.ts +0 -48
- package/types/ContextView/types.d.ts +0 -24
- package/types/ContextView/types.d.ts.map +0 -1
- package/types/View/types.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +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.9.0](https://github.com/instructure/instructure-ui/compare/v8.8.0...v8.9.0) (2021-09-15)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- fix shared-types TS errors ([7b83164](https://github.com/instructure/instructure-ui/commit/7b83164f4c5872f3a217e010563f59bf584ae4fc))
|
|
11
|
+
|
|
6
12
|
# [8.8.0](https://github.com/instructure/instructure-ui/compare/v8.7.0...v8.8.0) (2021-08-27)
|
|
7
13
|
|
|
8
14
|
**Note:** Version bump only for package @instructure/ui-view
|
package/es/ContextView/index.js
CHANGED
|
@@ -26,13 +26,12 @@ var _dec, _class, _class2, _temp;
|
|
|
26
26
|
|
|
27
27
|
/** @jsx jsx */
|
|
28
28
|
import { Component } from 'react';
|
|
29
|
-
import
|
|
30
|
-
import { jsx, withStyle, ThemeablePropTypes } from '@instructure/emotion';
|
|
31
|
-
import { PositionPropTypes } from '@instructure/ui-position';
|
|
29
|
+
import { jsx, withStyle } from '@instructure/emotion';
|
|
32
30
|
import { omitProps } from '@instructure/ui-react-utils';
|
|
33
31
|
import { View } from '../View';
|
|
34
32
|
import generateStyle from './styles';
|
|
35
33
|
import generateComponentTheme from './theme';
|
|
34
|
+
import { propTypes, allowedProps } from './props';
|
|
36
35
|
|
|
37
36
|
/**
|
|
38
37
|
---
|
|
@@ -104,78 +103,7 @@ let ContextView = (_dec = withStyle(generateStyle, generateComponentTheme), _dec
|
|
|
104
103
|
}), children));
|
|
105
104
|
}
|
|
106
105
|
|
|
107
|
-
}, _class2.displayName = "ContextView", _class2.componentId = 'ContextView', _class2.propTypes = {
|
|
108
|
-
/**
|
|
109
|
-
* The element to render as the component root
|
|
110
|
-
*/
|
|
111
|
-
as: PropTypes.elementType,
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* provides a reference to the underlying html root element
|
|
115
|
-
*/
|
|
116
|
-
elementRef: PropTypes.func,
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
|
|
120
|
-
* `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
|
|
121
|
-
* familiar CSS-like shorthand. For example: `margin="small auto large"`.
|
|
122
|
-
*/
|
|
123
|
-
margin: ThemeablePropTypes.spacing,
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Valid values are `0`, `none`, `xxx-small`, `xx-small`, `x-small`,
|
|
127
|
-
* `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
|
|
128
|
-
* familiar CSS-like shorthand. For example: `padding="small x-large large"`.
|
|
129
|
-
*/
|
|
130
|
-
padding: ThemeablePropTypes.spacing,
|
|
131
|
-
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
132
|
-
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
133
|
-
maxHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
134
|
-
maxWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
135
|
-
minHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
136
|
-
minWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* The children to render inside the `<ContextView />`
|
|
140
|
-
*/
|
|
141
|
-
children: PropTypes.node,
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Designates the text alignment within the `<ContextView />`
|
|
145
|
-
*/
|
|
146
|
-
textAlign: PropTypes.oneOf(['start', 'center', 'end']),
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Controls the shadow depth for the `<ContextView />`
|
|
150
|
-
*/
|
|
151
|
-
shadow: ThemeablePropTypes.shadow,
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Controls the z-index depth for the `<ContextView />`
|
|
155
|
-
*/
|
|
156
|
-
stacking: ThemeablePropTypes.stacking,
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* Designates the background style of the `<ContextView />`
|
|
160
|
-
*/
|
|
161
|
-
background: PropTypes.oneOf(['default', 'inverse']),
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Specifies how the arrow for `<ContextView />` will be rendered.
|
|
165
|
-
* Ex. `placement="top"` will render with an arrow pointing down.
|
|
166
|
-
*/
|
|
167
|
-
placement: PositionPropTypes.placement,
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* Activate an outline around the component to make building your
|
|
171
|
-
* layout easier
|
|
172
|
-
*/
|
|
173
|
-
debug: PropTypes.bool,
|
|
174
|
-
// eslint-disable-next-line react/require-default-props
|
|
175
|
-
makeStyles: PropTypes.func,
|
|
176
|
-
// eslint-disable-next-line react/require-default-props
|
|
177
|
-
styles: PropTypes.object
|
|
178
|
-
}, _class2.defaultProps = {
|
|
106
|
+
}, _class2.displayName = "ContextView", _class2.componentId = 'ContextView', _class2.allowedProps = allowedProps, _class2.propTypes = propTypes, _class2.defaultProps = {
|
|
179
107
|
as: 'span',
|
|
180
108
|
elementRef: () => {},
|
|
181
109
|
debug: false,
|
|
@@ -185,14 +113,7 @@ let ContextView = (_dec = withStyle(generateStyle, generateComponentTheme), _dec
|
|
|
185
113
|
textAlign: 'start',
|
|
186
114
|
background: 'default',
|
|
187
115
|
shadow: 'resting',
|
|
188
|
-
placement: 'center end'
|
|
189
|
-
margin: void 0,
|
|
190
|
-
padding: void 0,
|
|
191
|
-
stacking: void 0,
|
|
192
|
-
maxWidth: void 0,
|
|
193
|
-
minWidth: void 0,
|
|
194
|
-
maxHeight: void 0,
|
|
195
|
-
minHeight: void 0
|
|
116
|
+
placement: 'center end'
|
|
196
117
|
}, _temp)) || _class);
|
|
197
118
|
export default ContextView;
|
|
198
119
|
export { ContextView };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
import PropTypes from 'prop-types';
|
|
25
|
+
import { ThemeablePropTypes } from '@instructure/emotion';
|
|
26
|
+
import { PositionPropTypes } from '@instructure/ui-position';
|
|
27
|
+
const propTypes = {
|
|
28
|
+
/**
|
|
29
|
+
* The element to render as the component root
|
|
30
|
+
*/
|
|
31
|
+
as: PropTypes.elementType,
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* provides a reference to the underlying html root element
|
|
35
|
+
*/
|
|
36
|
+
elementRef: PropTypes.func,
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
|
|
40
|
+
* `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
|
|
41
|
+
* familiar CSS-like shorthand. For example: `margin="small auto large"`.
|
|
42
|
+
*/
|
|
43
|
+
margin: ThemeablePropTypes.spacing,
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Valid values are `0`, `none`, `xxx-small`, `xx-small`, `x-small`,
|
|
47
|
+
* `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
|
|
48
|
+
* familiar CSS-like shorthand. For example: `padding="small x-large large"`.
|
|
49
|
+
*/
|
|
50
|
+
padding: ThemeablePropTypes.spacing,
|
|
51
|
+
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
52
|
+
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
53
|
+
maxHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
54
|
+
maxWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
55
|
+
minHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
56
|
+
minWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The children to render inside the `<ContextView />`
|
|
60
|
+
*/
|
|
61
|
+
children: PropTypes.node,
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Designates the text alignment within the `<ContextView />`
|
|
65
|
+
*/
|
|
66
|
+
textAlign: PropTypes.oneOf(['start', 'center', 'end']),
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Controls the shadow depth for the `<ContextView />`
|
|
70
|
+
*/
|
|
71
|
+
shadow: ThemeablePropTypes.shadow,
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Controls the z-index depth for the `<ContextView />`
|
|
75
|
+
*/
|
|
76
|
+
stacking: ThemeablePropTypes.stacking,
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Designates the background style of the `<ContextView />`
|
|
80
|
+
*/
|
|
81
|
+
background: PropTypes.oneOf(['default', 'inverse']),
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Specifies how the arrow for `<ContextView />` will be rendered.
|
|
85
|
+
* Ex. `placement="top"` will render with an arrow pointing down.
|
|
86
|
+
*/
|
|
87
|
+
placement: PositionPropTypes.placement,
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Activate an outline around the component to make building your
|
|
91
|
+
* layout easier
|
|
92
|
+
*/
|
|
93
|
+
debug: PropTypes.bool
|
|
94
|
+
};
|
|
95
|
+
const allowedProps = ['as', 'elementRef', 'margin', 'padding', 'height', 'width', 'maxHeight', 'maxWidth', 'minHeight', 'minWidth', 'children', 'textAlign', 'shadow', 'stacking', 'background', 'placement', 'debug'];
|
|
96
|
+
export { propTypes, allowedProps };
|
package/es/View/index.js
CHANGED
|
@@ -36,7 +36,8 @@ import { getElementType, omitProps, pickProps, passthroughProps } from '@instruc
|
|
|
36
36
|
import { jsx, withStyle } from '@instructure/emotion';
|
|
37
37
|
import generateStyle from './styles';
|
|
38
38
|
import generateComponentTheme from './theme';
|
|
39
|
-
import {
|
|
39
|
+
import { propTypes, allowedProps } from './props';
|
|
40
|
+
|
|
40
41
|
/**
|
|
41
42
|
---
|
|
42
43
|
category: components
|
|
@@ -47,7 +48,6 @@ API:
|
|
|
47
48
|
@module View
|
|
48
49
|
|
|
49
50
|
**/
|
|
50
|
-
|
|
51
51
|
let View = (_dec = bidirectional(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec(_class = _dec2(_class = (_temp = _class2 = class View extends Component {
|
|
52
52
|
// TODO: Remove this code once all components are using passthroughProps in place
|
|
53
53
|
// of omitProps and have removed this function
|
|
@@ -172,13 +172,17 @@ let View = (_dec = bidirectional(), _dec2 = withStyle(generateStyle, generateCom
|
|
|
172
172
|
focusColor: 'info',
|
|
173
173
|
shouldAnimateFocus: true
|
|
174
174
|
}, _class2.omitViewProps = (props, Component) => {
|
|
175
|
+
// We don't want the theming and styling props to pass
|
|
176
|
+
// (these are added and handled by the `@withStyle` decorator)
|
|
177
|
+
const propsToOmit = [..._class2.allowedProps, 'styles', 'makeStyles', 'themeOverride'];
|
|
178
|
+
|
|
175
179
|
if (process.env.NODE_ENV !== 'production') {
|
|
176
|
-
Object.keys(pickProps(props,
|
|
180
|
+
Object.keys(pickProps(props, propsToOmit)).forEach(prop => {
|
|
177
181
|
error(false, `[${Component.name}] prop '${prop}' is not allowed.`);
|
|
178
182
|
});
|
|
179
183
|
}
|
|
180
184
|
|
|
181
|
-
return omitProps(props,
|
|
185
|
+
return omitProps(props, propsToOmit);
|
|
182
186
|
}, _temp)) || _class) || _class);
|
|
183
187
|
export default View;
|
|
184
188
|
export { View };
|
|
@@ -25,7 +25,7 @@ import PropTypes from 'prop-types';
|
|
|
25
25
|
import { cursor as cursorPropTypes } from '@instructure/ui-prop-types';
|
|
26
26
|
import { bidirectional } from '@instructure/ui-i18n';
|
|
27
27
|
import { ThemeablePropTypes } from '@instructure/emotion';
|
|
28
|
-
|
|
28
|
+
const propTypes = {
|
|
29
29
|
as: PropTypes.elementType,
|
|
30
30
|
elementRef: PropTypes.func,
|
|
31
31
|
display: PropTypes.oneOf(['auto', 'inline', 'block', 'inline-block', 'flex', 'inline-flex']),
|
|
@@ -58,11 +58,10 @@ export const propTypes = {
|
|
|
58
58
|
focusColor: PropTypes.oneOf(['info', 'inverse', 'success', 'danger']),
|
|
59
59
|
shouldAnimateFocus: PropTypes.bool,
|
|
60
60
|
withVisualDebug: PropTypes.bool,
|
|
61
|
-
makeStyles: PropTypes.func,
|
|
62
|
-
styles: PropTypes.object,
|
|
63
61
|
dir: PropTypes.oneOf(Object.values(bidirectional.DIRECTION))
|
|
64
|
-
}; //This variable will be attached as static property on the `View` component
|
|
65
|
-
//so we don't rely on the `PropTypes` validators for our internal logic.
|
|
66
|
-
//This means on prod builds the consuming applications can safely delete propTypes.
|
|
62
|
+
}; // This variable will be attached as static property on the `View` component
|
|
63
|
+
// so we don't rely on the `PropTypes` validators for our internal logic.
|
|
64
|
+
// This means on prod builds the consuming applications can safely delete propTypes.
|
|
67
65
|
|
|
68
|
-
|
|
66
|
+
const allowedProps = ['as', 'background', 'borderColor', 'borderRadius', 'borderWidth', 'children', 'cursor', 'dir', 'display', 'elementRef', 'focusColor', 'focusPosition', 'height', 'insetBlockEnd', 'insetBlockStart', 'insetInlineEnd', 'insetInlineStart', 'margin', 'maxHeight', 'maxWidth', 'minHeight', 'minWidth', 'overflowX', 'overflowY', 'padding', 'position', 'shadow', 'shouldAnimateFocus', 'stacking', 'textAlign', 'width', 'withFocusOutline', 'withVisualDebug'];
|
|
67
|
+
export { propTypes, allowedProps };
|
package/lib/ContextView/index.js
CHANGED
|
@@ -9,12 +9,8 @@ exports.ContextView = exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
|
|
12
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
12
|
var _emotion = require("@instructure/emotion");
|
|
15
13
|
|
|
16
|
-
var _PositionPropTypes = require("@instructure/ui-position/lib/PositionPropTypes.js");
|
|
17
|
-
|
|
18
14
|
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
19
15
|
|
|
20
16
|
var _View = require("../View");
|
|
@@ -23,6 +19,8 @@ var _styles = _interopRequireDefault(require("./styles"));
|
|
|
23
19
|
|
|
24
20
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
25
21
|
|
|
22
|
+
var _props = require("./props");
|
|
23
|
+
|
|
26
24
|
var _dec, _class, _class2, _temp;
|
|
27
25
|
|
|
28
26
|
/**
|
|
@@ -95,78 +93,7 @@ let ContextView = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
|
|
|
95
93
|
}), children));
|
|
96
94
|
}
|
|
97
95
|
|
|
98
|
-
}, _class2.displayName = "ContextView", _class2.componentId = 'ContextView', _class2.propTypes = {
|
|
99
|
-
/**
|
|
100
|
-
* The element to render as the component root
|
|
101
|
-
*/
|
|
102
|
-
as: _propTypes.default.elementType,
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* provides a reference to the underlying html root element
|
|
106
|
-
*/
|
|
107
|
-
elementRef: _propTypes.default.func,
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
|
|
111
|
-
* `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
|
|
112
|
-
* familiar CSS-like shorthand. For example: `margin="small auto large"`.
|
|
113
|
-
*/
|
|
114
|
-
margin: _emotion.ThemeablePropTypes.spacing,
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Valid values are `0`, `none`, `xxx-small`, `xx-small`, `x-small`,
|
|
118
|
-
* `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
|
|
119
|
-
* familiar CSS-like shorthand. For example: `padding="small x-large large"`.
|
|
120
|
-
*/
|
|
121
|
-
padding: _emotion.ThemeablePropTypes.spacing,
|
|
122
|
-
height: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
123
|
-
width: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
124
|
-
maxHeight: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
125
|
-
maxWidth: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
126
|
-
minHeight: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
127
|
-
minWidth: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* The children to render inside the `<ContextView />`
|
|
131
|
-
*/
|
|
132
|
-
children: _propTypes.default.node,
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Designates the text alignment within the `<ContextView />`
|
|
136
|
-
*/
|
|
137
|
-
textAlign: _propTypes.default.oneOf(['start', 'center', 'end']),
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Controls the shadow depth for the `<ContextView />`
|
|
141
|
-
*/
|
|
142
|
-
shadow: _emotion.ThemeablePropTypes.shadow,
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Controls the z-index depth for the `<ContextView />`
|
|
146
|
-
*/
|
|
147
|
-
stacking: _emotion.ThemeablePropTypes.stacking,
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Designates the background style of the `<ContextView />`
|
|
151
|
-
*/
|
|
152
|
-
background: _propTypes.default.oneOf(['default', 'inverse']),
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Specifies how the arrow for `<ContextView />` will be rendered.
|
|
156
|
-
* Ex. `placement="top"` will render with an arrow pointing down.
|
|
157
|
-
*/
|
|
158
|
-
placement: _PositionPropTypes.PositionPropTypes.placement,
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Activate an outline around the component to make building your
|
|
162
|
-
* layout easier
|
|
163
|
-
*/
|
|
164
|
-
debug: _propTypes.default.bool,
|
|
165
|
-
// eslint-disable-next-line react/require-default-props
|
|
166
|
-
makeStyles: _propTypes.default.func,
|
|
167
|
-
// eslint-disable-next-line react/require-default-props
|
|
168
|
-
styles: _propTypes.default.object
|
|
169
|
-
}, _class2.defaultProps = {
|
|
96
|
+
}, _class2.displayName = "ContextView", _class2.componentId = 'ContextView', _class2.allowedProps = _props.allowedProps, _class2.propTypes = _props.propTypes, _class2.defaultProps = {
|
|
170
97
|
as: 'span',
|
|
171
98
|
elementRef: () => {},
|
|
172
99
|
debug: false,
|
|
@@ -176,14 +103,7 @@ let ContextView = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
|
|
|
176
103
|
textAlign: 'start',
|
|
177
104
|
background: 'default',
|
|
178
105
|
shadow: 'resting',
|
|
179
|
-
placement: 'center end'
|
|
180
|
-
margin: void 0,
|
|
181
|
-
padding: void 0,
|
|
182
|
-
stacking: void 0,
|
|
183
|
-
maxWidth: void 0,
|
|
184
|
-
minWidth: void 0,
|
|
185
|
-
maxHeight: void 0,
|
|
186
|
-
minHeight: void 0
|
|
106
|
+
placement: 'center end'
|
|
187
107
|
}, _temp)) || _class);
|
|
188
108
|
exports.ContextView = ContextView;
|
|
189
109
|
var _default = ContextView;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.allowedProps = exports.propTypes = void 0;
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _emotion = require("@instructure/emotion");
|
|
13
|
+
|
|
14
|
+
var _PositionPropTypes = require("@instructure/ui-position/lib/PositionPropTypes.js");
|
|
15
|
+
|
|
16
|
+
/*
|
|
17
|
+
* The MIT License (MIT)
|
|
18
|
+
*
|
|
19
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
20
|
+
*
|
|
21
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
22
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
23
|
+
* in the Software without restriction, including without limitation the rights
|
|
24
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
25
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
26
|
+
* furnished to do so, subject to the following conditions:
|
|
27
|
+
*
|
|
28
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
29
|
+
* copies or substantial portions of the Software.
|
|
30
|
+
*
|
|
31
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
32
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
33
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
34
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
35
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
36
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
37
|
+
* SOFTWARE.
|
|
38
|
+
*/
|
|
39
|
+
const propTypes = {
|
|
40
|
+
/**
|
|
41
|
+
* The element to render as the component root
|
|
42
|
+
*/
|
|
43
|
+
as: _propTypes.default.elementType,
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* provides a reference to the underlying html root element
|
|
47
|
+
*/
|
|
48
|
+
elementRef: _propTypes.default.func,
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
|
|
52
|
+
* `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
|
|
53
|
+
* familiar CSS-like shorthand. For example: `margin="small auto large"`.
|
|
54
|
+
*/
|
|
55
|
+
margin: _emotion.ThemeablePropTypes.spacing,
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Valid values are `0`, `none`, `xxx-small`, `xx-small`, `x-small`,
|
|
59
|
+
* `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
|
|
60
|
+
* familiar CSS-like shorthand. For example: `padding="small x-large large"`.
|
|
61
|
+
*/
|
|
62
|
+
padding: _emotion.ThemeablePropTypes.spacing,
|
|
63
|
+
height: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
64
|
+
width: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
65
|
+
maxHeight: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
66
|
+
maxWidth: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
67
|
+
minHeight: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
68
|
+
minWidth: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The children to render inside the `<ContextView />`
|
|
72
|
+
*/
|
|
73
|
+
children: _propTypes.default.node,
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Designates the text alignment within the `<ContextView />`
|
|
77
|
+
*/
|
|
78
|
+
textAlign: _propTypes.default.oneOf(['start', 'center', 'end']),
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Controls the shadow depth for the `<ContextView />`
|
|
82
|
+
*/
|
|
83
|
+
shadow: _emotion.ThemeablePropTypes.shadow,
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Controls the z-index depth for the `<ContextView />`
|
|
87
|
+
*/
|
|
88
|
+
stacking: _emotion.ThemeablePropTypes.stacking,
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Designates the background style of the `<ContextView />`
|
|
92
|
+
*/
|
|
93
|
+
background: _propTypes.default.oneOf(['default', 'inverse']),
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Specifies how the arrow for `<ContextView />` will be rendered.
|
|
97
|
+
* Ex. `placement="top"` will render with an arrow pointing down.
|
|
98
|
+
*/
|
|
99
|
+
placement: _PositionPropTypes.PositionPropTypes.placement,
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Activate an outline around the component to make building your
|
|
103
|
+
* layout easier
|
|
104
|
+
*/
|
|
105
|
+
debug: _propTypes.default.bool
|
|
106
|
+
};
|
|
107
|
+
exports.propTypes = propTypes;
|
|
108
|
+
const allowedProps = ['as', 'elementRef', 'margin', 'padding', 'height', 'width', 'maxHeight', 'maxWidth', 'minHeight', 'minWidth', 'children', 'textAlign', 'shadow', 'stacking', 'background', 'placement', 'debug'];
|
|
109
|
+
exports.allowedProps = allowedProps;
|