@instructure/ui-byline 8.10.3-snapshot.9 → 8.11.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 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.11.0](https://github.com/instructure/instructure-ui/compare/v8.10.2...v8.11.0) (2021-10-15)
7
+
8
+ **Note:** Version bump only for package @instructure/ui-byline
9
+
6
10
  ## [8.10.2](https://github.com/instructure/instructure-ui/compare/v8.10.1...v8.10.2) (2021-10-01)
7
11
 
8
12
  **Note:** Version bump only for package @instructure/ui-byline
@@ -44,10 +44,12 @@ let Byline = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_cla
44
44
  this.ref = null;
45
45
 
46
46
  this.handleRef = el => {
47
- var _this$props$elementRe, _this$props;
48
-
47
+ const elementRef = this.props.elementRef;
49
48
  this.ref = el;
50
- (_this$props$elementRe = (_this$props = this.props).elementRef) === null || _this$props$elementRe === void 0 ? void 0 : _this$props$elementRe.call(_this$props, el);
49
+
50
+ if (typeof elementRef === 'function') {
51
+ elementRef(el);
52
+ }
51
53
  };
52
54
  }
53
55
 
@@ -51,6 +51,10 @@ const propTypes = {
51
51
  */
52
52
  margin: ThemeablePropTypes.spacing,
53
53
  size: PropTypes.oneOf(['small', 'medium', 'large']),
54
+
55
+ /**
56
+ * provides a reference to the underlying html root element
57
+ */
54
58
  elementRef: PropTypes.func
55
59
  };
56
60
  const allowedProps = ['alignContent', 'children', 'description', 'elementRef', 'margin', 'size', 'title'];
@@ -34,10 +34,12 @@ let Byline = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _
34
34
  this.ref = null;
35
35
 
36
36
  this.handleRef = el => {
37
- var _this$props$elementRe, _this$props;
38
-
37
+ const elementRef = this.props.elementRef;
39
38
  this.ref = el;
40
- (_this$props$elementRe = (_this$props = this.props).elementRef) === null || _this$props$elementRe === void 0 ? void 0 : _this$props$elementRe.call(_this$props, el);
39
+
40
+ if (typeof elementRef === 'function') {
41
+ elementRef(el);
42
+ }
41
43
  };
42
44
  }
43
45
 
@@ -62,6 +62,10 @@ const propTypes = {
62
62
  */
63
63
  margin: _emotion.ThemeablePropTypes.spacing,
64
64
  size: _propTypes.default.oneOf(['small', 'medium', 'large']),
65
+
66
+ /**
67
+ * provides a reference to the underlying html root element
68
+ */
65
69
  elementRef: _propTypes.default.func
66
70
  };
67
71
  exports.propTypes = propTypes;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-byline",
3
- "version": "8.10.3-snapshot.9+47592ffa9",
3
+ "version": "8.11.0",
4
4
  "description": "A Byline component.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "type": "commonjs",
@@ -25,18 +25,18 @@
25
25
  "license": "MIT",
26
26
  "dependencies": {
27
27
  "@babel/runtime": "^7.13.10",
28
- "@instructure/emotion": "8.10.3-snapshot.9+47592ffa9",
29
- "@instructure/shared-types": "8.10.3-snapshot.9+47592ffa9",
30
- "@instructure/ui-react-utils": "8.10.3-snapshot.9+47592ffa9",
31
- "@instructure/ui-testable": "8.10.3-snapshot.9+47592ffa9",
32
- "@instructure/ui-view": "8.10.3-snapshot.9+47592ffa9",
28
+ "@instructure/emotion": "8.11.0",
29
+ "@instructure/shared-types": "8.11.0",
30
+ "@instructure/ui-react-utils": "8.11.0",
31
+ "@instructure/ui-testable": "8.11.0",
32
+ "@instructure/ui-view": "8.11.0",
33
33
  "prop-types": "^15"
34
34
  },
35
35
  "devDependencies": {
36
- "@instructure/ui-babel-preset": "8.10.3-snapshot.9+47592ffa9",
37
- "@instructure/ui-color-utils": "8.10.3-snapshot.9+47592ffa9",
38
- "@instructure/ui-test-utils": "8.10.3-snapshot.9+47592ffa9",
39
- "@instructure/ui-themes": "8.10.3-snapshot.9+47592ffa9"
36
+ "@instructure/ui-babel-preset": "8.11.0",
37
+ "@instructure/ui-color-utils": "8.11.0",
38
+ "@instructure/ui-test-utils": "8.11.0",
39
+ "@instructure/ui-themes": "8.11.0"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "react": ">=16.8 <=17"
@@ -44,6 +44,5 @@
44
44
  "publishConfig": {
45
45
  "access": "public"
46
46
  },
47
- "sideEffects": false,
48
- "gitHead": "47592ffa9fed565a9df0677c77e6d890d5e964ea"
47
+ "sideEffects": false
49
48
  }
@@ -55,8 +55,13 @@ class Byline extends Component<BylineProps> {
55
55
  ref: Element | null = null
56
56
 
57
57
  handleRef = (el: Element | null) => {
58
+ const { elementRef } = this.props
59
+
58
60
  this.ref = el
59
- this.props.elementRef?.(el)
61
+
62
+ if (typeof elementRef === 'function') {
63
+ elementRef(el)
64
+ }
60
65
  }
61
66
 
62
67
  componentDidMount() {
@@ -32,7 +32,11 @@ import type {
32
32
  WithStyleProps,
33
33
  ComponentStyle
34
34
  } from '@instructure/emotion'
35
- import type { PropValidators, BylineTheme } from '@instructure/shared-types'
35
+ import type {
36
+ PropValidators,
37
+ BylineTheme,
38
+ OtherHTMLAttributes
39
+ } from '@instructure/shared-types'
36
40
 
37
41
  type BylineOwnProps = {
38
42
  children: React.ReactNode
@@ -48,7 +52,9 @@ type PropKeys = keyof BylineOwnProps
48
52
 
49
53
  type AllowedPropKeys = Readonly<Array<PropKeys>>
50
54
 
51
- type BylineProps = BylineOwnProps & WithStyleProps<BylineTheme, BylineStyle>
55
+ type BylineProps = BylineOwnProps &
56
+ WithStyleProps<BylineTheme, BylineStyle> &
57
+ OtherHTMLAttributes<BylineOwnProps>
52
58
 
53
59
  type BylineStyle = ComponentStyle<
54
60
  'byline' | 'figure' | 'caption' | 'title' | 'description' | 'maxWidth'
@@ -78,6 +84,9 @@ const propTypes: PropValidators<PropKeys> = {
78
84
  */
79
85
  margin: ThemeablePropTypes.spacing,
80
86
  size: PropTypes.oneOf(['small', 'medium', 'large']),
87
+ /**
88
+ * provides a reference to the underlying html root element
89
+ */
81
90
  elementRef: PropTypes.func
82
91
  }
83
92
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Byline/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAMrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;GAIG;AAEH,cACM,MAAO,SAAQ,SAAS,CAAC,WAAW,CAAC;IACzC,MAAM,CAAC,QAAQ,CAAC,WAAW,YAAW;IAEtC,MAAM,CAAC,SAAS;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;MAElB;IAED,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAG9B;IAED,iBAAiB;IAMjB,kBAAkB,CAAC,SAAS,KAAA,EAAE,SAAS,KAAA,EAAE,QAAQ,KAAA;IAKjD,MAAM;CA8BP;AAED,eAAe,MAAM,CAAA;AACrB,OAAO,EAAE,MAAM,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Byline/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAMrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;GAIG;AAEH,cACM,MAAO,SAAQ,SAAS,CAAC,WAAW,CAAC;IACzC,MAAM,CAAC,QAAQ,CAAC,WAAW,YAAW;IAEtC,MAAM,CAAC,SAAS;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;MAElB;IAED,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAQ9B;IAED,iBAAiB;IAMjB,kBAAkB,CAAC,SAAS,KAAA,EAAE,SAAS,KAAA,EAAE,QAAQ,KAAA;IAKjD,MAAM;CA8BP;AAED,eAAe,MAAM,CAAA;AACrB,OAAO,EAAE,MAAM,EAAE,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { Spacing, WithStyleProps, ComponentStyle } from '@instructure/emotion';
3
- import type { PropValidators, BylineTheme } from '@instructure/shared-types';
3
+ import type { PropValidators, BylineTheme, OtherHTMLAttributes } from '@instructure/shared-types';
4
4
  declare type BylineOwnProps = {
5
5
  children: React.ReactNode;
6
6
  title?: React.ReactNode;
@@ -12,7 +12,7 @@ declare type BylineOwnProps = {
12
12
  };
13
13
  declare type PropKeys = keyof BylineOwnProps;
14
14
  declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
15
- declare type BylineProps = BylineOwnProps & WithStyleProps<BylineTheme, BylineStyle>;
15
+ declare type BylineProps = BylineOwnProps & WithStyleProps<BylineTheme, BylineStyle> & OtherHTMLAttributes<BylineOwnProps>;
16
16
  declare type BylineStyle = ComponentStyle<'byline' | 'figure' | 'caption' | 'title' | 'description' | 'maxWidth'>;
17
17
  declare const propTypes: PropValidators<PropKeys>;
18
18
  declare const allowedProps: AllowedPropKeys;
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Byline/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,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,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB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AAS,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAA;IACtC,YAAY,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAA;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAA;CAC/C,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,GAC/B,cAAc,CAAC,WAAW,EAAE,WAAW,CAAC,GACxC,mBAAmB,CAAC,cAAc,CAAC,CAAA;AAErC,aAAK,WAAW,GAAG,cAAc,CAC/B,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,aAAa,GAAG,UAAU,CACvE,CAAA;AAED,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CA4BvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAQnB,CAAA;AAED,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
package/LICENSE.md DELETED
@@ -1,27 +0,0 @@
1
- ---
2
- title: The MIT License (MIT)
3
- category: Getting Started
4
- order: 9
5
- ---
6
-
7
- # The MIT License (MIT)
8
-
9
- Copyright (c) 2015 Instructure, Inc.
10
-
11
- **Permission is hereby granted, free of charge, to any person obtaining a copy
12
- of this software and associated documentation files (the "Software"), to deal
13
- in the Software without restriction, including without limitation the rights
14
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
- copies of the Software, and to permit persons to whom the Software is
16
- furnished to do so, subject to the following conditions.**
17
-
18
- The above copyright notice and this permission notice shall be included in all
19
- copies or substantial portions of the Software.
20
-
21
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
- SOFTWARE.