@instructure/ui-view 8.25.1-snapshot-10 → 8.25.1-snapshot-13

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,7 +3,7 @@
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.25.1-snapshot-10](https://github.com/instructure/instructure-ui/compare/v8.25.0...v8.25.1-snapshot-10) (2022-06-20)
6
+ ## [8.25.1-snapshot-13](https://github.com/instructure/instructure-ui/compare/v8.25.0...v8.25.1-snapshot-13) (2022-06-22)
7
7
 
8
8
  **Note:** Version bump only for package @instructure/ui-view
9
9
 
@@ -1,4 +1,4 @@
1
- var _dec, _class;
1
+ var _dec, _class, _class2;
2
2
 
3
3
  /*
4
4
  * The MIT License (MIT)
@@ -39,23 +39,20 @@ category: components
39
39
  ---
40
40
  @tsProps
41
41
  **/
42
- let ContextView = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class ContextView extends Component {
43
- static displayName = "ContextView";
44
- static componentId = 'ContextView';
45
- static allowedProps = allowedProps;
46
- static propTypes = propTypes;
47
- static defaultProps = {
48
- as: 'span',
49
- elementRef: () => {},
50
- debug: false,
51
- width: 'auto',
52
- height: 'auto',
53
- children: null,
54
- textAlign: 'start',
55
- background: 'default',
56
- shadow: 'resting',
57
- placement: 'center end'
58
- };
42
+ let ContextView = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_class2 = class ContextView extends Component {
43
+ constructor() {
44
+ super(...arguments);
45
+ this.ref = null;
46
+
47
+ this.handleRef = el => {
48
+ const elementRef = this.props.elementRef;
49
+ this.ref = el;
50
+
51
+ if (typeof elementRef === 'function') {
52
+ elementRef(el);
53
+ }
54
+ };
55
+ }
59
56
 
60
57
  componentDidMount() {
61
58
  var _this$props$makeStyle, _this$props;
@@ -69,16 +66,6 @@ let ContextView = (_dec = withStyle(generateStyle, generateComponentTheme), _dec
69
66
  (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
70
67
  }
71
68
 
72
- ref = null;
73
- handleRef = el => {
74
- const elementRef = this.props.elementRef;
75
- this.ref = el;
76
-
77
- if (typeof elementRef === 'function') {
78
- elementRef(el);
79
- }
80
- };
81
-
82
69
  render() {
83
70
  const _this$props3 = this.props,
84
71
  as = _this$props3.as,
@@ -130,6 +117,17 @@ let ContextView = (_dec = withStyle(generateStyle, generateComponentTheme), _dec
130
117
  }), children));
131
118
  }
132
119
 
133
- }) || _class);
120
+ }, _class2.displayName = "ContextView", _class2.componentId = 'ContextView', _class2.allowedProps = allowedProps, _class2.propTypes = propTypes, _class2.defaultProps = {
121
+ as: 'span',
122
+ elementRef: () => {},
123
+ debug: false,
124
+ width: 'auto',
125
+ height: 'auto',
126
+ children: null,
127
+ textAlign: 'start',
128
+ background: 'default',
129
+ shadow: 'resting',
130
+ placement: 'center end'
131
+ }, _class2)) || _class);
134
132
  export default ContextView;
135
133
  export { ContextView };
package/es/View/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  const _excluded = ["children", "textAlign", "background", "display", "withVisualDebug", "width", "height", "minWidth", "minHeight", "maxWidth", "maxHeight", "overflowX", "overflowY", "stacking", "shadow", "position", "focusPosition", "focusColor", "shouldAnimateFocus", "borderColor", "className", "styles", "makeStyles"];
3
3
 
4
- var _dec, _dec2, _class;
4
+ var _dec, _dec2, _class, _class2;
5
5
 
6
6
  /*
7
7
  * The MIT License (MIT)
@@ -45,22 +45,8 @@ category: components
45
45
  @module View
46
46
  @tsProps
47
47
  **/
48
- let View = (_dec = textDirectionContextConsumer(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec(_class = _dec2(_class = class View extends Component {
49
- static displayName = "View";
50
- static componentId = 'View';
51
- static allowedProps = allowedProps;
52
- static propTypes = propTypes;
53
- static defaultProps = {
54
- display: 'auto',
55
- overflowX: 'visible',
56
- overflowY: 'visible',
57
- withVisualDebug: false,
58
- borderColor: 'primary',
59
- position: 'static',
60
- focusPosition: 'offset',
61
- focusColor: 'info',
62
- shouldAnimateFocus: true
63
- }; // TODO: Remove this code once all components are using passthroughProps in place
48
+ let View = (_dec = textDirectionContextConsumer(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec(_class = _dec2(_class = (_class2 = class View extends Component {
49
+ // TODO: Remove this code once all components are using passthroughProps in place
64
50
  // of omitProps and have removed this function
65
51
  // omitViewProps needs to be called on the composed View component so that the
66
52
  // View.allowedProps in the method matches the View.allowedProps that will be called in
@@ -72,28 +58,23 @@ let View = (_dec = textDirectionContextConsumer(), _dec2 = withStyle(generateSty
72
58
  // @param props the object to process
73
59
  // @param Component The component whose props are processed.
74
60
  // Only needed for debug logging in non-production builds.
75
-
76
- static omitViewProps = (props, Component) => {
77
- // We don't want the theming and styling props to pass
78
- // (these are added and handled by the `@withStyle` decorator)
79
- const propsToOmit = [...View.allowedProps, 'styles', 'makeStyles', 'themeOverride'];
80
-
81
- if (process.env.NODE_ENV !== 'production') {
82
- Object.keys(pickProps(props, propsToOmit)).forEach(prop => {
83
- error(false, `[${Component.name}] prop '${prop}' is not allowed.`);
84
- });
85
- }
86
-
87
- return omitProps(props, propsToOmit);
88
- };
89
- spanMarginVerified;
90
-
91
61
  get _element() {
92
62
  return this.ref;
93
63
  }
94
64
 
95
65
  constructor(props) {
96
66
  super(props);
67
+ this.spanMarginVerified = void 0;
68
+ this.ref = null;
69
+
70
+ this.handleElementRef = el => {
71
+ if (typeof this.props.elementRef === 'function') {
72
+ this.props.elementRef(el);
73
+ }
74
+
75
+ this.ref = el;
76
+ };
77
+
97
78
  this.spanMarginVerified = false;
98
79
  }
99
80
 
@@ -142,15 +123,6 @@ let View = (_dec = textDirectionContextConsumer(), _dec2 = withStyle(generateSty
142
123
  }
143
124
  }
144
125
 
145
- ref = null;
146
- handleElementRef = el => {
147
- if (typeof this.props.elementRef === 'function') {
148
- this.props.elementRef(el);
149
- }
150
-
151
- this.ref = el;
152
- };
153
-
154
126
  render() {
155
127
  const _this$props3 = this.props,
156
128
  children = _this$props3.children,
@@ -186,6 +158,28 @@ let View = (_dec = textDirectionContextConsumer(), _dec2 = withStyle(generateSty
186
158
  }), children);
187
159
  }
188
160
 
189
- }) || _class) || _class);
161
+ }, _class2.displayName = "View", _class2.componentId = 'View', _class2.allowedProps = allowedProps, _class2.propTypes = propTypes, _class2.defaultProps = {
162
+ display: 'auto',
163
+ overflowX: 'visible',
164
+ overflowY: 'visible',
165
+ withVisualDebug: false,
166
+ borderColor: 'primary',
167
+ position: 'static',
168
+ focusPosition: 'offset',
169
+ focusColor: 'info',
170
+ shouldAnimateFocus: true
171
+ }, _class2.omitViewProps = (props, Component) => {
172
+ // We don't want the theming and styling props to pass
173
+ // (these are added and handled by the `@withStyle` decorator)
174
+ const propsToOmit = [..._class2.allowedProps, 'styles', 'makeStyles', 'themeOverride'];
175
+
176
+ if (process.env.NODE_ENV !== 'production') {
177
+ Object.keys(pickProps(props, propsToOmit)).forEach(prop => {
178
+ error(false, `[${Component.name}] prop '${prop}' is not allowed.`);
179
+ });
180
+ }
181
+
182
+ return omitProps(props, propsToOmit);
183
+ }, _class2)) || _class) || _class);
190
184
  export default View;
191
185
  export { View };
@@ -21,7 +21,7 @@ var _theme = _interopRequireDefault(require("./theme"));
21
21
 
22
22
  var _props = require("./props");
23
23
 
24
- var _dec, _class;
24
+ var _dec, _class, _class2;
25
25
 
26
26
  /**
27
27
  ---
@@ -29,23 +29,20 @@ category: components
29
29
  ---
30
30
  @tsProps
31
31
  **/
32
- let ContextView = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = class ContextView extends _react.Component {
33
- static displayName = "ContextView";
34
- static componentId = 'ContextView';
35
- static allowedProps = _props.allowedProps;
36
- static propTypes = _props.propTypes;
37
- static defaultProps = {
38
- as: 'span',
39
- elementRef: () => {},
40
- debug: false,
41
- width: 'auto',
42
- height: 'auto',
43
- children: null,
44
- textAlign: 'start',
45
- background: 'default',
46
- shadow: 'resting',
47
- placement: 'center end'
48
- };
32
+ let ContextView = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_class2 = class ContextView extends _react.Component {
33
+ constructor() {
34
+ super(...arguments);
35
+ this.ref = null;
36
+
37
+ this.handleRef = el => {
38
+ const elementRef = this.props.elementRef;
39
+ this.ref = el;
40
+
41
+ if (typeof elementRef === 'function') {
42
+ elementRef(el);
43
+ }
44
+ };
45
+ }
49
46
 
50
47
  componentDidMount() {
51
48
  var _this$props$makeStyle, _this$props;
@@ -59,16 +56,6 @@ let ContextView = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
59
56
  (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
60
57
  }
61
58
 
62
- ref = null;
63
- handleRef = el => {
64
- const elementRef = this.props.elementRef;
65
- this.ref = el;
66
-
67
- if (typeof elementRef === 'function') {
68
- elementRef(el);
69
- }
70
- };
71
-
72
59
  render() {
73
60
  const _this$props3 = this.props,
74
61
  as = _this$props3.as,
@@ -120,7 +107,18 @@ let ContextView = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
120
107
  }), children));
121
108
  }
122
109
 
123
- }) || _class);
110
+ }, _class2.displayName = "ContextView", _class2.componentId = 'ContextView', _class2.allowedProps = _props.allowedProps, _class2.propTypes = _props.propTypes, _class2.defaultProps = {
111
+ as: 'span',
112
+ elementRef: () => {},
113
+ debug: false,
114
+ width: 'auto',
115
+ height: 'auto',
116
+ children: null,
117
+ textAlign: 'start',
118
+ background: 'default',
119
+ shadow: 'resting',
120
+ placement: 'center end'
121
+ }, _class2)) || _class);
124
122
  exports.ContextView = ContextView;
125
123
  var _default = ContextView;
126
124
  exports.default = _default;
package/lib/View/index.js CHANGED
@@ -35,7 +35,7 @@ var _props = require("./props");
35
35
 
36
36
  const _excluded = ["children", "textAlign", "background", "display", "withVisualDebug", "width", "height", "minWidth", "minHeight", "maxWidth", "maxHeight", "overflowX", "overflowY", "stacking", "shadow", "position", "focusPosition", "focusColor", "shouldAnimateFocus", "borderColor", "className", "styles", "makeStyles"];
37
37
 
38
- var _dec, _dec2, _class;
38
+ var _dec, _dec2, _class, _class2;
39
39
 
40
40
  /**
41
41
  ---
@@ -44,22 +44,8 @@ category: components
44
44
  @module View
45
45
  @tsProps
46
46
  **/
47
- let View = (_dec = (0, _textDirectionContextConsumer.textDirectionContextConsumer)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = _dec2(_class = class View extends _react.Component {
48
- static displayName = "View";
49
- static componentId = 'View';
50
- static allowedProps = _props.allowedProps;
51
- static propTypes = _props.propTypes;
52
- static defaultProps = {
53
- display: 'auto',
54
- overflowX: 'visible',
55
- overflowY: 'visible',
56
- withVisualDebug: false,
57
- borderColor: 'primary',
58
- position: 'static',
59
- focusPosition: 'offset',
60
- focusColor: 'info',
61
- shouldAnimateFocus: true
62
- }; // TODO: Remove this code once all components are using passthroughProps in place
47
+ let View = (_dec = (0, _textDirectionContextConsumer.textDirectionContextConsumer)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = _dec2(_class = (_class2 = class View extends _react.Component {
48
+ // TODO: Remove this code once all components are using passthroughProps in place
63
49
  // of omitProps and have removed this function
64
50
  // omitViewProps needs to be called on the composed View component so that the
65
51
  // View.allowedProps in the method matches the View.allowedProps that will be called in
@@ -71,28 +57,23 @@ let View = (_dec = (0, _textDirectionContextConsumer.textDirectionContextConsume
71
57
  // @param props the object to process
72
58
  // @param Component The component whose props are processed.
73
59
  // Only needed for debug logging in non-production builds.
74
-
75
- static omitViewProps = (props, Component) => {
76
- // We don't want the theming and styling props to pass
77
- // (these are added and handled by the `@withStyle` decorator)
78
- const propsToOmit = [...View.allowedProps, 'styles', 'makeStyles', 'themeOverride'];
79
-
80
- if (process.env.NODE_ENV !== 'production') {
81
- Object.keys((0, _pickProps.pickProps)(props, propsToOmit)).forEach(prop => {
82
- (0, _console.logError)(false, `[${Component.name}] prop '${prop}' is not allowed.`);
83
- });
84
- }
85
-
86
- return (0, _omitProps.omitProps)(props, propsToOmit);
87
- };
88
- spanMarginVerified;
89
-
90
60
  get _element() {
91
61
  return this.ref;
92
62
  }
93
63
 
94
64
  constructor(props) {
95
65
  super(props);
66
+ this.spanMarginVerified = void 0;
67
+ this.ref = null;
68
+
69
+ this.handleElementRef = el => {
70
+ if (typeof this.props.elementRef === 'function') {
71
+ this.props.elementRef(el);
72
+ }
73
+
74
+ this.ref = el;
75
+ };
76
+
96
77
  this.spanMarginVerified = false;
97
78
  }
98
79
 
@@ -141,15 +122,6 @@ let View = (_dec = (0, _textDirectionContextConsumer.textDirectionContextConsume
141
122
  }
142
123
  }
143
124
 
144
- ref = null;
145
- handleElementRef = el => {
146
- if (typeof this.props.elementRef === 'function') {
147
- this.props.elementRef(el);
148
- }
149
-
150
- this.ref = el;
151
- };
152
-
153
125
  render() {
154
126
  const _this$props3 = this.props,
155
127
  children = _this$props3.children,
@@ -184,7 +156,29 @@ let View = (_dec = (0, _textDirectionContextConsumer.textDirectionContextConsume
184
156
  }), children);
185
157
  }
186
158
 
187
- }) || _class) || _class);
159
+ }, _class2.displayName = "View", _class2.componentId = 'View', _class2.allowedProps = _props.allowedProps, _class2.propTypes = _props.propTypes, _class2.defaultProps = {
160
+ display: 'auto',
161
+ overflowX: 'visible',
162
+ overflowY: 'visible',
163
+ withVisualDebug: false,
164
+ borderColor: 'primary',
165
+ position: 'static',
166
+ focusPosition: 'offset',
167
+ focusColor: 'info',
168
+ shouldAnimateFocus: true
169
+ }, _class2.omitViewProps = (props, Component) => {
170
+ // We don't want the theming and styling props to pass
171
+ // (these are added and handled by the `@withStyle` decorator)
172
+ const propsToOmit = [..._class2.allowedProps, 'styles', 'makeStyles', 'themeOverride'];
173
+
174
+ if (process.env.NODE_ENV !== 'production') {
175
+ Object.keys((0, _pickProps.pickProps)(props, propsToOmit)).forEach(prop => {
176
+ (0, _console.logError)(false, `[${Component.name}] prop '${prop}' is not allowed.`);
177
+ });
178
+ }
179
+
180
+ return (0, _omitProps.omitProps)(props, propsToOmit);
181
+ }, _class2)) || _class) || _class);
188
182
  exports.View = View;
189
183
  var _default = View;
190
184
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-view",
3
- "version": "8.25.1-snapshot-10",
3
+ "version": "8.25.1-snapshot-13",
4
4
  "description": "A component for basic styles including spacing, sizing, borders, display, positioning, and focus states.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -24,21 +24,21 @@
24
24
  "license": "MIT",
25
25
  "dependencies": {
26
26
  "@babel/runtime": "^7.13.10",
27
- "@instructure/console": "8.25.1-snapshot-10",
28
- "@instructure/emotion": "8.25.1-snapshot-10",
29
- "@instructure/shared-types": "8.25.1-snapshot-10",
30
- "@instructure/ui-color-utils": "8.25.1-snapshot-10",
31
- "@instructure/ui-dom-utils": "8.25.1-snapshot-10",
32
- "@instructure/ui-i18n": "8.25.1-snapshot-10",
33
- "@instructure/ui-position": "8.25.1-snapshot-10",
34
- "@instructure/ui-prop-types": "8.25.1-snapshot-10",
35
- "@instructure/ui-react-utils": "8.25.1-snapshot-10",
27
+ "@instructure/console": "8.25.1-snapshot-13",
28
+ "@instructure/emotion": "8.25.1-snapshot-13",
29
+ "@instructure/shared-types": "8.25.1-snapshot-13",
30
+ "@instructure/ui-color-utils": "8.25.1-snapshot-13",
31
+ "@instructure/ui-dom-utils": "8.25.1-snapshot-13",
32
+ "@instructure/ui-i18n": "8.25.1-snapshot-13",
33
+ "@instructure/ui-position": "8.25.1-snapshot-13",
34
+ "@instructure/ui-prop-types": "8.25.1-snapshot-13",
35
+ "@instructure/ui-react-utils": "8.25.1-snapshot-13",
36
36
  "prop-types": "^15"
37
37
  },
38
38
  "devDependencies": {
39
- "@instructure/ui-babel-preset": "8.25.1-snapshot-10",
40
- "@instructure/ui-test-utils": "8.25.1-snapshot-10",
41
- "@instructure/ui-themes": "8.25.1-snapshot-10"
39
+ "@instructure/ui-babel-preset": "8.25.1-snapshot-13",
40
+ "@instructure/ui-test-utils": "8.25.1-snapshot-13",
41
+ "@instructure/ui-themes": "8.25.1-snapshot-13"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "react": ">=16.8 <=17"