@instructure/ui-billboard 8.33.2-snapshot-0 → 8.33.2

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,14 +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.33.2-snapshot-0](https://github.com/instructure/instructure-ui/compare/v8.33.1...v8.33.2-snapshot-0) (2023-01-13)
6
+ ## [8.33.2](https://github.com/instructure/instructure-ui/compare/v8.33.1...v8.33.2) (2023-01-25)
7
7
 
8
8
  **Note:** Version bump only for package @instructure/ui-billboard
9
9
 
10
-
11
-
12
-
13
-
14
10
  ## [8.33.1](https://github.com/instructure/instructure-ui/compare/v8.33.0...v8.33.1) (2023-01-06)
15
11
 
16
12
  **Note:** Version bump only for package @instructure/ui-billboard
@@ -1,5 +1,4 @@
1
1
  var _dec, _class, _class2;
2
-
3
2
  /*
4
3
  * The MIT License (MIT)
5
4
  *
@@ -33,7 +32,6 @@ import { withStyle, jsx } from '@instructure/emotion';
33
32
  import generateStyle from './styles';
34
33
  import generateComponentTheme from './theme';
35
34
  import { propTypes, allowedProps } from './props';
36
-
37
35
  /**
38
36
  ---
39
37
  category: components
@@ -44,21 +42,17 @@ let Billboard = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_
44
42
  constructor() {
45
43
  super(...arguments);
46
44
  this.ref = null;
47
-
48
45
  this.handleRef = el => {
49
46
  const elementRef = this.props.elementRef;
50
47
  this.ref = el;
51
-
52
48
  if (typeof elementRef === 'function') {
53
49
  elementRef(el);
54
50
  }
55
51
  };
56
-
57
52
  this.handleClick = e => {
58
53
  const _this$props = this.props,
59
- readOnly = _this$props.readOnly,
60
- onClick = _this$props.onClick;
61
-
54
+ readOnly = _this$props.readOnly,
55
+ onClick = _this$props.onClick;
62
56
  if (readOnly) {
63
57
  e.preventDefault();
64
58
  e.stopPropagation();
@@ -67,25 +61,20 @@ let Billboard = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_
67
61
  }
68
62
  };
69
63
  }
70
-
71
64
  componentDidMount() {
72
65
  var _this$props$makeStyle, _this$props2;
73
-
74
66
  (_this$props$makeStyle = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props2);
75
67
  }
76
-
77
68
  componentDidUpdate() {
78
69
  var _this$props$makeStyle2, _this$props3;
79
-
80
70
  (_this$props$makeStyle2 = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props3);
81
71
  }
82
-
83
72
  renderHeading() {
84
73
  const _this$props4 = this.props,
85
- headingLevel = _this$props4.headingLevel,
86
- headingAs = _this$props4.headingAs,
87
- heading = _this$props4.heading,
88
- styles = _this$props4.styles;
74
+ headingLevel = _this$props4.headingLevel,
75
+ headingAs = _this$props4.headingAs,
76
+ heading = _this$props4.heading,
77
+ styles = _this$props4.styles;
89
78
  return jsx("span", {
90
79
  css: styles === null || styles === void 0 ? void 0 : styles.heading
91
80
  }, jsx(Heading, {
@@ -94,10 +83,10 @@ let Billboard = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_
94
83
  color: "primary"
95
84
  }, heading));
96
85
  }
97
-
98
86
  get SVGIconSize() {
99
- const size = this.props.size; // serve up appropriate SVGIcon size for each Billboard size
87
+ const size = this.props.size;
100
88
 
89
+ // serve up appropriate SVGIcon size for each Billboard size
101
90
  if (size === 'small') {
102
91
  return 'medium';
103
92
  } else if (size === 'large') {
@@ -106,7 +95,6 @@ let Billboard = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_
106
95
  return 'large';
107
96
  }
108
97
  }
109
-
110
98
  renderHero() {
111
99
  if (typeof this.props.hero === 'function') {
112
100
  return this.props.hero(this.SVGIconSize);
@@ -114,13 +102,12 @@ let Billboard = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_
114
102
  return this.props.hero;
115
103
  }
116
104
  }
117
-
118
105
  renderContent() {
119
106
  const _this$props5 = this.props,
120
- heading = _this$props5.heading,
121
- message = _this$props5.message,
122
- hero = _this$props5.hero,
123
- styles = _this$props5.styles;
107
+ heading = _this$props5.heading,
108
+ message = _this$props5.message,
109
+ hero = _this$props5.hero,
110
+ styles = _this$props5.styles;
124
111
  return jsx("span", {
125
112
  css: styles === null || styles === void 0 ? void 0 : styles.content
126
113
  }, hero && jsx("span", {
@@ -129,14 +116,13 @@ let Billboard = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_
129
116
  css: styles === null || styles === void 0 ? void 0 : styles.message
130
117
  }, callRenderProp(message)));
131
118
  }
132
-
133
119
  render() {
134
120
  const _this$props6 = this.props,
135
- href = _this$props6.href,
136
- disabled = _this$props6.disabled,
137
- readOnly = _this$props6.readOnly,
138
- margin = _this$props6.margin,
139
- styles = _this$props6.styles;
121
+ href = _this$props6.href,
122
+ disabled = _this$props6.disabled,
123
+ readOnly = _this$props6.readOnly,
124
+ margin = _this$props6.margin,
125
+ styles = _this$props6.styles;
140
126
  const Element = getElementType(Billboard, this.props);
141
127
  return jsx(View, {
142
128
  as: "div",
@@ -152,7 +138,6 @@ let Billboard = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_
152
138
  "aria-disabled": disabled || readOnly ? 'true' : void 0
153
139
  }), this.renderContent()));
154
140
  }
155
-
156
141
  }, _class2.displayName = "Billboard", _class2.componentId = 'Billboard', _class2.propTypes = propTypes, _class2.allowedProps = allowedProps, _class2.defaultProps = {
157
142
  disabled: false,
158
143
  readOnly: false,
@@ -21,6 +21,7 @@
21
21
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
  * SOFTWARE.
23
23
  */
24
+
24
25
  import PropTypes from 'prop-types';
25
26
  import { ThemeablePropTypes } from '@instructure/emotion';
26
27
  const propTypes = {
@@ -34,11 +34,11 @@
34
34
  */
35
35
  const generateStyle = (componentTheme, props) => {
36
36
  const size = props.size,
37
- href = props.href,
38
- onClick = props.onClick,
39
- disabled = props.disabled,
40
- hero = props.hero,
41
- heading = props.heading;
37
+ href = props.href,
38
+ onClick = props.onClick,
39
+ disabled = props.disabled,
40
+ hero = props.hero,
41
+ heading = props.heading;
42
42
  const clickable = href || onClick;
43
43
  const sizeVariants = {
44
44
  small: {
@@ -51,7 +51,8 @@ const generateStyle = (componentTheme, props) => {
51
51
  message: {
52
52
  fontSize: componentTheme.messageFontSizeSmall
53
53
  },
54
- heading: { ...(hero && {
54
+ heading: {
55
+ ...(hero && {
55
56
  margin: `${componentTheme.mediumMargin} 0 0`
56
57
  })
57
58
  }
@@ -169,5 +170,4 @@ const generateStyle = (componentTheme, props) => {
169
170
  }
170
171
  };
171
172
  };
172
-
173
173
  export default generateStyle;
@@ -31,10 +31,10 @@
31
31
  */
32
32
  const generateComponentTheme = theme => {
33
33
  const borders = theme.borders,
34
- colors = theme.colors,
35
- spacing = theme.spacing,
36
- typography = theme.typography,
37
- themeName = theme.key;
34
+ colors = theme.colors,
35
+ spacing = theme.spacing,
36
+ typography = theme.typography,
37
+ themeName = theme.key;
38
38
  const themeSpecificStyle = {
39
39
  canvas: {
40
40
  iconHoverColor: theme['ic-link-color'],
@@ -66,9 +66,9 @@ const generateComponentTheme = theme => {
66
66
  buttonBorderStyle: borders === null || borders === void 0 ? void 0 : borders.style,
67
67
  buttonHoverBorderStyle: 'dashed'
68
68
  };
69
- return { ...componentVariables,
69
+ return {
70
+ ...componentVariables,
70
71
  ...themeSpecificStyle[themeName]
71
72
  };
72
73
  };
73
-
74
74
  export default generateComponentTheme;
@@ -1,34 +1,21 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = exports.Billboard = void 0;
9
-
10
8
  var _react = require("react");
11
-
12
9
  var _Heading = require("@instructure/ui-heading/lib/Heading");
13
-
14
10
  var _View = require("@instructure/ui-view/lib/View");
15
-
16
11
  var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
17
-
18
12
  var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
19
-
20
13
  var _getElementType = require("@instructure/ui-react-utils/lib/getElementType.js");
21
-
22
14
  var _emotion = require("@instructure/emotion");
23
-
24
15
  var _styles = _interopRequireDefault(require("./styles"));
25
-
26
16
  var _theme = _interopRequireDefault(require("./theme"));
27
-
28
17
  var _props = require("./props");
29
-
30
18
  var _dec, _class, _class2;
31
-
32
19
  /**
33
20
  ---
34
21
  category: components
@@ -39,21 +26,17 @@ let Billboard = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
39
26
  constructor() {
40
27
  super(...arguments);
41
28
  this.ref = null;
42
-
43
29
  this.handleRef = el => {
44
30
  const elementRef = this.props.elementRef;
45
31
  this.ref = el;
46
-
47
32
  if (typeof elementRef === 'function') {
48
33
  elementRef(el);
49
34
  }
50
35
  };
51
-
52
36
  this.handleClick = e => {
53
37
  const _this$props = this.props,
54
- readOnly = _this$props.readOnly,
55
- onClick = _this$props.onClick;
56
-
38
+ readOnly = _this$props.readOnly,
39
+ onClick = _this$props.onClick;
57
40
  if (readOnly) {
58
41
  e.preventDefault();
59
42
  e.stopPropagation();
@@ -62,25 +45,20 @@ let Billboard = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
62
45
  }
63
46
  };
64
47
  }
65
-
66
48
  componentDidMount() {
67
49
  var _this$props$makeStyle, _this$props2;
68
-
69
50
  (_this$props$makeStyle = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props2);
70
51
  }
71
-
72
52
  componentDidUpdate() {
73
53
  var _this$props$makeStyle2, _this$props3;
74
-
75
54
  (_this$props$makeStyle2 = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props3);
76
55
  }
77
-
78
56
  renderHeading() {
79
57
  const _this$props4 = this.props,
80
- headingLevel = _this$props4.headingLevel,
81
- headingAs = _this$props4.headingAs,
82
- heading = _this$props4.heading,
83
- styles = _this$props4.styles;
58
+ headingLevel = _this$props4.headingLevel,
59
+ headingAs = _this$props4.headingAs,
60
+ heading = _this$props4.heading,
61
+ styles = _this$props4.styles;
84
62
  return (0, _emotion.jsx)("span", {
85
63
  css: styles === null || styles === void 0 ? void 0 : styles.heading
86
64
  }, (0, _emotion.jsx)(_Heading.Heading, {
@@ -89,10 +67,10 @@ let Billboard = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
89
67
  color: "primary"
90
68
  }, heading));
91
69
  }
92
-
93
70
  get SVGIconSize() {
94
- const size = this.props.size; // serve up appropriate SVGIcon size for each Billboard size
71
+ const size = this.props.size;
95
72
 
73
+ // serve up appropriate SVGIcon size for each Billboard size
96
74
  if (size === 'small') {
97
75
  return 'medium';
98
76
  } else if (size === 'large') {
@@ -101,7 +79,6 @@ let Billboard = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
101
79
  return 'large';
102
80
  }
103
81
  }
104
-
105
82
  renderHero() {
106
83
  if (typeof this.props.hero === 'function') {
107
84
  return this.props.hero(this.SVGIconSize);
@@ -109,13 +86,12 @@ let Billboard = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
109
86
  return this.props.hero;
110
87
  }
111
88
  }
112
-
113
89
  renderContent() {
114
90
  const _this$props5 = this.props,
115
- heading = _this$props5.heading,
116
- message = _this$props5.message,
117
- hero = _this$props5.hero,
118
- styles = _this$props5.styles;
91
+ heading = _this$props5.heading,
92
+ message = _this$props5.message,
93
+ hero = _this$props5.hero,
94
+ styles = _this$props5.styles;
119
95
  return (0, _emotion.jsx)("span", {
120
96
  css: styles === null || styles === void 0 ? void 0 : styles.content
121
97
  }, hero && (0, _emotion.jsx)("span", {
@@ -124,14 +100,13 @@ let Billboard = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
124
100
  css: styles === null || styles === void 0 ? void 0 : styles.message
125
101
  }, (0, _callRenderProp.callRenderProp)(message)));
126
102
  }
127
-
128
103
  render() {
129
104
  const _this$props6 = this.props,
130
- href = _this$props6.href,
131
- disabled = _this$props6.disabled,
132
- readOnly = _this$props6.readOnly,
133
- margin = _this$props6.margin,
134
- styles = _this$props6.styles;
105
+ href = _this$props6.href,
106
+ disabled = _this$props6.disabled,
107
+ readOnly = _this$props6.readOnly,
108
+ margin = _this$props6.margin,
109
+ styles = _this$props6.styles;
135
110
  const Element = (0, _getElementType.getElementType)(Billboard, this.props);
136
111
  return (0, _emotion.jsx)(_View.View, {
137
112
  as: "div",
@@ -147,7 +122,6 @@ let Billboard = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
147
122
  "aria-disabled": disabled || readOnly ? 'true' : void 0
148
123
  }), this.renderContent()));
149
124
  }
150
-
151
125
  }, _class2.displayName = "Billboard", _class2.componentId = 'Billboard', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {
152
126
  disabled: false,
153
127
  readOnly: false,
@@ -1,16 +1,12 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.propTypes = exports.allowedProps = void 0;
9
-
10
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
9
  var _emotion = require("@instructure/emotion");
13
-
14
10
  /*
15
11
  * The MIT License (MIT)
16
12
  *
@@ -34,6 +30,7 @@ var _emotion = require("@instructure/emotion");
34
30
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35
31
  * SOFTWARE.
36
32
  */
33
+
37
34
  const propTypes = {
38
35
  hero: _propTypes.default.oneOfType([_propTypes.default.element, _propTypes.default.func]),
39
36
  size: _propTypes.default.oneOf(['small', 'medium', 'large']),
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  /*
9
8
  * The MIT License (MIT)
10
9
  *
@@ -41,11 +40,11 @@ exports.default = void 0;
41
40
  */
42
41
  const generateStyle = (componentTheme, props) => {
43
42
  const size = props.size,
44
- href = props.href,
45
- onClick = props.onClick,
46
- disabled = props.disabled,
47
- hero = props.hero,
48
- heading = props.heading;
43
+ href = props.href,
44
+ onClick = props.onClick,
45
+ disabled = props.disabled,
46
+ hero = props.hero,
47
+ heading = props.heading;
49
48
  const clickable = href || onClick;
50
49
  const sizeVariants = {
51
50
  small: {
@@ -58,7 +57,8 @@ const generateStyle = (componentTheme, props) => {
58
57
  message: {
59
58
  fontSize: componentTheme.messageFontSizeSmall
60
59
  },
61
- heading: { ...(hero && {
60
+ heading: {
61
+ ...(hero && {
62
62
  margin: `${componentTheme.mediumMargin} 0 0`
63
63
  })
64
64
  }
@@ -176,6 +176,5 @@ const generateStyle = (componentTheme, props) => {
176
176
  }
177
177
  };
178
178
  };
179
-
180
179
  var _default = generateStyle;
181
180
  exports.default = _default;
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  /*
9
8
  * The MIT License (MIT)
10
9
  *
@@ -38,10 +37,10 @@ exports.default = void 0;
38
37
  */
39
38
  const generateComponentTheme = theme => {
40
39
  const borders = theme.borders,
41
- colors = theme.colors,
42
- spacing = theme.spacing,
43
- typography = theme.typography,
44
- themeName = theme.key;
40
+ colors = theme.colors,
41
+ spacing = theme.spacing,
42
+ typography = theme.typography,
43
+ themeName = theme.key;
45
44
  const themeSpecificStyle = {
46
45
  canvas: {
47
46
  iconHoverColor: theme['ic-link-color'],
@@ -73,10 +72,10 @@ const generateComponentTheme = theme => {
73
72
  buttonBorderStyle: borders === null || borders === void 0 ? void 0 : borders.style,
74
73
  buttonHoverBorderStyle: 'dashed'
75
74
  };
76
- return { ...componentVariables,
75
+ return {
76
+ ...componentVariables,
77
77
  ...themeSpecificStyle[themeName]
78
78
  };
79
79
  };
80
-
81
80
  var _default = generateComponentTheme;
82
81
  exports.default = _default;
package/lib/index.js CHANGED
@@ -9,5 +9,4 @@ Object.defineProperty(exports, "Billboard", {
9
9
  return _Billboard.Billboard;
10
10
  }
11
11
  });
12
-
13
12
  var _Billboard = require("./Billboard");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-billboard",
3
- "version": "8.33.2-snapshot-0",
3
+ "version": "8.33.2",
4
4
  "description": "A UI component to display empty states, 404 pages, redirects, etc.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -23,20 +23,20 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@instructure/ui-babel-preset": "8.33.2-snapshot-0",
27
- "@instructure/ui-color-utils": "8.33.2-snapshot-0",
28
- "@instructure/ui-icons": "8.33.2-snapshot-0",
29
- "@instructure/ui-test-utils": "8.33.2-snapshot-0",
30
- "@instructure/ui-themes": "8.33.2-snapshot-0"
26
+ "@instructure/ui-babel-preset": "8.33.2",
27
+ "@instructure/ui-color-utils": "8.33.2",
28
+ "@instructure/ui-icons": "8.33.2",
29
+ "@instructure/ui-test-utils": "8.33.2",
30
+ "@instructure/ui-themes": "8.33.2"
31
31
  },
32
32
  "dependencies": {
33
33
  "@babel/runtime": "^7.13.10",
34
- "@instructure/emotion": "8.33.2-snapshot-0",
35
- "@instructure/shared-types": "8.33.2-snapshot-0",
36
- "@instructure/ui-heading": "8.33.2-snapshot-0",
37
- "@instructure/ui-img": "8.33.2-snapshot-0",
38
- "@instructure/ui-react-utils": "8.33.2-snapshot-0",
39
- "@instructure/ui-view": "8.33.2-snapshot-0",
34
+ "@instructure/emotion": "8.33.2",
35
+ "@instructure/shared-types": "8.33.2",
36
+ "@instructure/ui-heading": "8.33.2",
37
+ "@instructure/ui-img": "8.33.2",
38
+ "@instructure/ui-react-utils": "8.33.2",
39
+ "@instructure/ui-view": "8.33.2",
40
40
  "prop-types": "^15"
41
41
  },
42
42
  "peerDependencies": {