@instructure/ui-pill 8.10.3-snapshot.3 → 8.11.1-snapshot.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-pill
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-pill
package/es/Pill/index.js CHANGED
@@ -51,10 +51,12 @@ let Pill = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = tes
51
51
  this.ref = null;
52
52
 
53
53
  this.handleRef = el => {
54
- var _this$props$elementRe, _this$props;
55
-
54
+ const elementRef = this.props.elementRef;
56
55
  this.ref = el;
57
- (_this$props$elementRe = (_this$props = this.props).elementRef) === null || _this$props$elementRe === void 0 ? void 0 : _this$props$elementRe.call(_this$props, el);
56
+
57
+ if (typeof elementRef === 'function') {
58
+ elementRef(el);
59
+ }
58
60
  };
59
61
 
60
62
  this.state = {
@@ -63,15 +65,15 @@ let Pill = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = tes
63
65
  }
64
66
 
65
67
  componentDidMount() {
66
- var _this$props$makeStyle, _this$props2;
68
+ var _this$props$makeStyle, _this$props;
67
69
 
68
- (_this$props$makeStyle = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props2);
70
+ (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
69
71
  }
70
72
 
71
73
  componentDidUpdate() {
72
- var _this$props$makeStyle2, _this$props3;
74
+ var _this$props$makeStyle2, _this$props2;
73
75
 
74
- (_this$props$makeStyle2 = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props3);
76
+ (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
75
77
  }
76
78
 
77
79
  handleTruncation(truncated) {
@@ -83,15 +85,15 @@ let Pill = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = tes
83
85
  }
84
86
 
85
87
  renderPill(focused, getTriggerProps) {
86
- const _this$props4 = this.props,
87
- margin = _this$props4.margin,
88
- children = _this$props4.children,
89
- color = _this$props4.color,
90
- as = _this$props4.as,
91
- elementRef = _this$props4.elementRef,
92
- styles = _this$props4.styles,
93
- makeStyles = _this$props4.makeStyles,
94
- props = _objectWithoutProperties(_this$props4, _excluded);
88
+ const _this$props3 = this.props,
89
+ margin = _this$props3.margin,
90
+ children = _this$props3.children,
91
+ color = _this$props3.color,
92
+ as = _this$props3.as,
93
+ elementRef = _this$props3.elementRef,
94
+ styles = _this$props3.styles,
95
+ makeStyles = _this$props3.makeStyles,
96
+ props = _objectWithoutProperties(_this$props3, _excluded);
95
97
 
96
98
  const filteredProps = passthroughProps(props);
97
99
  const containerProps = typeof getTriggerProps === 'function' ? getTriggerProps(filteredProps) : filteredProps;
package/lib/Pill/index.js CHANGED
@@ -45,10 +45,12 @@ let Pill = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
45
45
  this.ref = null;
46
46
 
47
47
  this.handleRef = el => {
48
- var _this$props$elementRe, _this$props;
49
-
48
+ const elementRef = this.props.elementRef;
50
49
  this.ref = el;
51
- (_this$props$elementRe = (_this$props = this.props).elementRef) === null || _this$props$elementRe === void 0 ? void 0 : _this$props$elementRe.call(_this$props, el);
50
+
51
+ if (typeof elementRef === 'function') {
52
+ elementRef(el);
53
+ }
52
54
  };
53
55
 
54
56
  this.state = {
@@ -57,15 +59,15 @@ let Pill = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
57
59
  }
58
60
 
59
61
  componentDidMount() {
60
- var _this$props$makeStyle, _this$props2;
62
+ var _this$props$makeStyle, _this$props;
61
63
 
62
- (_this$props$makeStyle = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props2);
64
+ (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
63
65
  }
64
66
 
65
67
  componentDidUpdate() {
66
- var _this$props$makeStyle2, _this$props3;
68
+ var _this$props$makeStyle2, _this$props2;
67
69
 
68
- (_this$props$makeStyle2 = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props3);
70
+ (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
69
71
  }
70
72
 
71
73
  handleTruncation(truncated) {
@@ -77,15 +79,15 @@ let Pill = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
77
79
  }
78
80
 
79
81
  renderPill(focused, getTriggerProps) {
80
- const _this$props4 = this.props,
81
- margin = _this$props4.margin,
82
- children = _this$props4.children,
83
- color = _this$props4.color,
84
- as = _this$props4.as,
85
- elementRef = _this$props4.elementRef,
86
- styles = _this$props4.styles,
87
- makeStyles = _this$props4.makeStyles,
88
- props = (0, _objectWithoutProperties2.default)(_this$props4, _excluded);
82
+ const _this$props3 = this.props,
83
+ margin = _this$props3.margin,
84
+ children = _this$props3.children,
85
+ color = _this$props3.color,
86
+ as = _this$props3.as,
87
+ elementRef = _this$props3.elementRef,
88
+ styles = _this$props3.styles,
89
+ makeStyles = _this$props3.makeStyles,
90
+ props = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
89
91
  const filteredProps = (0, _passthroughProps.passthroughProps)(props);
90
92
  const containerProps = typeof getTriggerProps === 'function' ? getTriggerProps(filteredProps) : filteredProps;
91
93
  return (0, _emotion.jsx)(_View.View, Object.assign({}, containerProps, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-pill",
3
- "version": "8.10.3-snapshot.3+2ee813492",
3
+ "version": "8.11.1-snapshot.0+8536a1c9b",
4
4
  "description": "A UI component to communicate concise status.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "type": "commonjs",
@@ -25,24 +25,24 @@
25
25
  "license": "MIT",
26
26
  "dependencies": {
27
27
  "@babel/runtime": "^7.13.10",
28
- "@instructure/console": "8.10.3-snapshot.3+2ee813492",
29
- "@instructure/emotion": "8.10.3-snapshot.3+2ee813492",
30
- "@instructure/shared-types": "8.10.3-snapshot.3+2ee813492",
31
- "@instructure/ui-react-utils": "8.10.3-snapshot.3+2ee813492",
32
- "@instructure/ui-testable": "8.10.3-snapshot.3+2ee813492",
33
- "@instructure/ui-tooltip": "8.10.3-snapshot.3+2ee813492",
34
- "@instructure/ui-truncate-text": "8.10.3-snapshot.3+2ee813492",
35
- "@instructure/ui-utils": "8.10.3-snapshot.3+2ee813492",
36
- "@instructure/ui-view": "8.10.3-snapshot.3+2ee813492",
28
+ "@instructure/console": "8.11.1-snapshot.0+8536a1c9b",
29
+ "@instructure/emotion": "8.11.1-snapshot.0+8536a1c9b",
30
+ "@instructure/shared-types": "8.11.1-snapshot.0+8536a1c9b",
31
+ "@instructure/ui-react-utils": "8.11.1-snapshot.0+8536a1c9b",
32
+ "@instructure/ui-testable": "8.11.1-snapshot.0+8536a1c9b",
33
+ "@instructure/ui-tooltip": "8.11.1-snapshot.0+8536a1c9b",
34
+ "@instructure/ui-truncate-text": "8.11.1-snapshot.0+8536a1c9b",
35
+ "@instructure/ui-utils": "8.11.1-snapshot.0+8536a1c9b",
36
+ "@instructure/ui-view": "8.11.1-snapshot.0+8536a1c9b",
37
37
  "prop-types": "^15"
38
38
  },
39
39
  "devDependencies": {
40
- "@instructure/ui-babel-preset": "8.10.3-snapshot.3+2ee813492",
41
- "@instructure/ui-color-utils": "8.10.3-snapshot.3+2ee813492",
42
- "@instructure/ui-test-locator": "8.10.3-snapshot.3+2ee813492",
43
- "@instructure/ui-test-queries": "8.10.3-snapshot.3+2ee813492",
44
- "@instructure/ui-test-utils": "8.10.3-snapshot.3+2ee813492",
45
- "@instructure/ui-themes": "8.10.3-snapshot.3+2ee813492"
40
+ "@instructure/ui-babel-preset": "8.11.1-snapshot.0+8536a1c9b",
41
+ "@instructure/ui-color-utils": "8.11.1-snapshot.0+8536a1c9b",
42
+ "@instructure/ui-test-locator": "8.11.1-snapshot.0+8536a1c9b",
43
+ "@instructure/ui-test-queries": "8.11.1-snapshot.0+8536a1c9b",
44
+ "@instructure/ui-test-utils": "8.11.1-snapshot.0+8536a1c9b",
45
+ "@instructure/ui-themes": "8.11.1-snapshot.0+8536a1c9b"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "react": ">=16.8 <=17"
@@ -51,5 +51,5 @@
51
51
  "access": "public"
52
52
  },
53
53
  "sideEffects": false,
54
- "gitHead": "2ee8134925b02efbc5d39662a8b1edb2c83a420d"
54
+ "gitHead": "8536a1c9badcd8c1d2ce55dfb462d1899e3ca500"
55
55
  }
@@ -85,8 +85,13 @@ class Pill extends Component<PillProps, PillState> {
85
85
  }
86
86
 
87
87
  handleRef = (el: Element | null) => {
88
+ const { elementRef } = this.props
89
+
88
90
  this.ref = el
89
- this.props.elementRef?.(el)
91
+
92
+ if (typeof elementRef === 'function') {
93
+ elementRef(el)
94
+ }
90
95
  }
91
96
 
92
97
  renderPill(
package/src/Pill/props.ts CHANGED
@@ -34,7 +34,8 @@ import type {
34
34
  import type {
35
35
  PropValidators,
36
36
  AsElementType,
37
- PillTheme
37
+ PillTheme,
38
+ OtherHTMLAttributes
38
39
  } from '@instructure/shared-types'
39
40
 
40
41
  type PillOwnProps = {
@@ -56,7 +57,9 @@ type PropKeys = keyof PillOwnProps
56
57
 
57
58
  type AllowedPropKeys = Readonly<Array<PropKeys>>
58
59
 
59
- type PillProps = PillOwnProps & WithStyleProps<PillTheme, PillStyle>
60
+ type PillProps = PillOwnProps &
61
+ WithStyleProps<PillTheme, PillStyle> &
62
+ OtherHTMLAttributes<PillOwnProps>
60
63
 
61
64
  type PillStyle = ComponentStyle<'pill' | 'text' | 'maxWidth'>
62
65
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Pill/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOjC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AAExE,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAKrD,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAGnD;;;;;GAKG;AACH,cAEM,IAAK,SAAQ,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC;IAChD,MAAM,CAAC,QAAQ,CAAC,WAAW,UAAS;IAEpC,MAAM,CAAC,YAAY;;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;MAElB;IAED,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;gBAEd,KAAK,EAAE,SAAS;IAQ5B,iBAAiB;IAIjB,kBAAkB;IAIlB,gBAAgB,CAAC,SAAS,EAAE,OAAO;IAQnC,SAAS,OAAQ,OAAO,GAAG,IAAI,UAG9B;IAED,UAAU,CACR,OAAO,CAAC,EAAE,yBAAyB,CAAC,SAAS,CAAC,EAC9C,eAAe,CAAC,EAAE,yBAAyB,CAAC,iBAAiB,CAAC;IAmDhE,MAAM;CAaP;AAED,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Pill/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOjC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AAExE,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAKrD,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAGnD;;;;;GAKG;AACH,cAEM,IAAK,SAAQ,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC;IAChD,MAAM,CAAC,QAAQ,CAAC,WAAW,UAAS;IAEpC,MAAM,CAAC,YAAY;;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;MAElB;IAED,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;gBAEd,KAAK,EAAE,SAAS;IAQ5B,iBAAiB;IAIjB,kBAAkB;IAIlB,gBAAgB,CAAC,SAAS,EAAE,OAAO;IAQnC,SAAS,OAAQ,OAAO,GAAG,IAAI,UAQ9B;IAED,UAAU,CACR,OAAO,CAAC,EAAE,yBAAyB,CAAC,SAAS,CAAC,EAC9C,eAAe,CAAC,EAAE,yBAAyB,CAAC,iBAAiB,CAAC;IAmDhE,MAAM;CAaP;AAED,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,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, AsElementType, PillTheme } from '@instructure/shared-types';
3
+ import type { PropValidators, AsElementType, PillTheme, OtherHTMLAttributes } from '@instructure/shared-types';
4
4
  declare type PillOwnProps = {
5
5
  as?: AsElementType;
6
6
  color?: 'primary' | 'success' | 'danger' | 'info' | 'warning' | 'alert';
@@ -18,7 +18,7 @@ declare type PillOwnProps = {
18
18
  };
19
19
  declare type PropKeys = keyof PillOwnProps;
20
20
  declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
21
- declare type PillProps = PillOwnProps & WithStyleProps<PillTheme, PillStyle>;
21
+ declare type PillProps = PillOwnProps & WithStyleProps<PillTheme, PillStyle> & OtherHTMLAttributes<PillOwnProps>;
22
22
  declare type PillStyle = ComponentStyle<'pill' | 'text' | 'maxWidth'>;
23
23
  declare const propTypes: PropValidators<PropKeys>;
24
24
  declare const allowedProps: AllowedPropKeys;
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Pill/props.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,SAAS,EACV,MAAM,2BAA2B,CAAA;AAElC,aAAK,YAAY,GAAG;IAClB,EAAE,CAAC,EAAE,aAAa,CAAA;IAClB,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAA;IACvE;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAA;IAC9C;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,CAAA;AACD,aAAK,QAAQ,GAAG,MAAM,YAAY,CAAA;AAElC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,SAAS,GAAG,YAAY,GAAG,cAAc,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;AAEpE,aAAK,SAAS,GAAG,cAAc,CAAC,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC,CAAA;AAE7D,QAAA,MAA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