@instructure/ui-a11y-content 8.10.1-snapshot.4 → 8.10.2-snapshot.22

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.10.1](https://github.com/instructure/instructure-ui/compare/v8.10.0...v8.10.1) (2021-10-01)
7
+
8
+ **Note:** Version bump only for package @instructure/ui-a11y-content
9
+
6
10
  # [8.10.0](https://github.com/instructure/instructure-ui/compare/v8.9.1...v8.10.0) (2021-09-28)
7
11
 
8
12
  **Note:** Version bump only for package @instructure/ui-a11y-content
@@ -38,6 +38,15 @@ category: components/utilities
38
38
  @tsProps
39
39
  **/
40
40
  class AccessibleContent extends Component {
41
+ constructor(...args) {
42
+ super(...args);
43
+ this.ref = null;
44
+
45
+ this.handleRef = el => {
46
+ this.ref = el;
47
+ };
48
+ }
49
+
41
50
  render() {
42
51
  const _this$props = this.props,
43
52
  alt = _this$props.alt,
@@ -45,7 +54,9 @@ class AccessibleContent extends Component {
45
54
  props = _objectWithoutProperties(_this$props, _excluded);
46
55
 
47
56
  const ElementType = getElementType(AccessibleContent, this.props);
48
- return /*#__PURE__*/React.createElement(ElementType, passthroughProps(props), /*#__PURE__*/React.createElement(ScreenReaderContent, null, alt), /*#__PURE__*/React.createElement(PresentationContent, null, children));
57
+ return /*#__PURE__*/React.createElement(ElementType, Object.assign({}, passthroughProps(props), {
58
+ ref: this.handleRef
59
+ }), /*#__PURE__*/React.createElement(ScreenReaderContent, null, alt), /*#__PURE__*/React.createElement(PresentationContent, null, children));
49
60
  }
50
61
 
51
62
  }
@@ -36,14 +36,27 @@ category: components/utilities
36
36
  @tsProps
37
37
  **/
38
38
  class PresentationContent extends Component {
39
+ constructor(...args) {
40
+ super(...args);
41
+ this.ref = null;
42
+
43
+ this.handleRef = el => {
44
+ var _this$props$elementRe, _this$props;
45
+
46
+ this.ref = el;
47
+ (_this$props$elementRe = (_this$props = this.props).elementRef) === null || _this$props$elementRe === void 0 ? void 0 : _this$props$elementRe.call(_this$props, el);
48
+ };
49
+ }
50
+
39
51
  render() {
40
- const _this$props = this.props,
41
- children = _this$props.children,
42
- props = _objectWithoutProperties(_this$props, _excluded);
52
+ const _this$props2 = this.props,
53
+ children = _this$props2.children,
54
+ props = _objectWithoutProperties(_this$props2, _excluded);
43
55
 
44
56
  const ElementType = getElementType(PresentationContent, this.props);
45
57
  return /*#__PURE__*/React.createElement(ElementType, Object.assign({}, passthroughProps(props), {
46
- "aria-hidden": "true"
58
+ "aria-hidden": "true",
59
+ ref: this.handleRef
47
60
  }), children);
48
61
  }
49
62
 
@@ -24,7 +24,8 @@
24
24
  import PropTypes from 'prop-types';
25
25
  const propTypes = {
26
26
  as: PropTypes.elementType,
27
- children: PropTypes.node
27
+ children: PropTypes.node,
28
+ elementRef: PropTypes.func
28
29
  };
29
- const allowedProps = ['as', 'children'];
30
+ const allowedProps = ['as', 'children', 'elementRef'];
30
31
  export { propTypes, allowedProps };
@@ -42,6 +42,15 @@ category: components/utilities
42
42
  @tsProps
43
43
  **/
44
44
  let ScreenReaderContent = (_dec = withStyle(generateStyle, null), _dec(_class = (_temp = _class2 = class ScreenReaderContent extends Component {
45
+ constructor(...args) {
46
+ super(...args);
47
+ this.ref = null;
48
+
49
+ this.handleRef = el => {
50
+ this.ref = el;
51
+ };
52
+ }
53
+
45
54
  componentDidMount() {
46
55
  var _this$props$makeStyle, _this$props;
47
56
 
@@ -62,7 +71,8 @@ let ScreenReaderContent = (_dec = withStyle(generateStyle, null), _dec(_class =
62
71
 
63
72
  const ElementType = getElementType(ScreenReaderContent, props);
64
73
  return jsx(ElementType, Object.assign({}, passthroughProps(props), {
65
- css: styles === null || styles === void 0 ? void 0 : styles.screenReaderContent
74
+ css: styles === null || styles === void 0 ? void 0 : styles.screenReaderContent,
75
+ ref: this.handleRef
66
76
  }), children);
67
77
  }
68
78
 
@@ -24,7 +24,8 @@
24
24
  import PropTypes from 'prop-types';
25
25
  const propTypes = {
26
26
  as: PropTypes.elementType,
27
- children: PropTypes.node
27
+ children: PropTypes.node,
28
+ elementRef: PropTypes.func
28
29
  };
29
- const allowedProps = ['as', 'children'];
30
+ const allowedProps = ['as', 'children', 'elementRef'];
30
31
  export { propTypes, allowedProps };
@@ -33,13 +33,24 @@ category: components/utilities
33
33
  @tsProps
34
34
  **/
35
35
  class AccessibleContent extends _react.Component {
36
+ constructor(...args) {
37
+ super(...args);
38
+ this.ref = null;
39
+
40
+ this.handleRef = el => {
41
+ this.ref = el;
42
+ };
43
+ }
44
+
36
45
  render() {
37
46
  const _this$props = this.props,
38
47
  alt = _this$props.alt,
39
48
  children = _this$props.children,
40
49
  props = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
41
50
  const ElementType = (0, _getElementType.getElementType)(AccessibleContent, this.props);
42
- return /*#__PURE__*/_react.default.createElement(ElementType, (0, _passthroughProps.passthroughProps)(props), /*#__PURE__*/_react.default.createElement(_ScreenReaderContent.ScreenReaderContent, null, alt), /*#__PURE__*/_react.default.createElement(_PresentationContent.PresentationContent, null, children));
51
+ return /*#__PURE__*/_react.default.createElement(ElementType, Object.assign({}, (0, _passthroughProps.passthroughProps)(props), {
52
+ ref: this.handleRef
53
+ }), /*#__PURE__*/_react.default.createElement(_ScreenReaderContent.ScreenReaderContent, null, alt), /*#__PURE__*/_react.default.createElement(_PresentationContent.PresentationContent, null, children));
43
54
  }
44
55
 
45
56
  }
@@ -29,13 +29,26 @@ category: components/utilities
29
29
  @tsProps
30
30
  **/
31
31
  class PresentationContent extends _react.Component {
32
+ constructor(...args) {
33
+ super(...args);
34
+ this.ref = null;
35
+
36
+ this.handleRef = el => {
37
+ var _this$props$elementRe, _this$props;
38
+
39
+ 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);
41
+ };
42
+ }
43
+
32
44
  render() {
33
- const _this$props = this.props,
34
- children = _this$props.children,
35
- props = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
45
+ const _this$props2 = this.props,
46
+ children = _this$props2.children,
47
+ props = (0, _objectWithoutProperties2.default)(_this$props2, _excluded);
36
48
  const ElementType = (0, _getElementType.getElementType)(PresentationContent, this.props);
37
49
  return /*#__PURE__*/_react.default.createElement(ElementType, Object.assign({}, (0, _passthroughProps.passthroughProps)(props), {
38
- "aria-hidden": "true"
50
+ "aria-hidden": "true",
51
+ ref: this.handleRef
39
52
  }), children);
40
53
  }
41
54
 
@@ -34,8 +34,9 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
34
34
  */
35
35
  const propTypes = {
36
36
  as: _propTypes.default.elementType,
37
- children: _propTypes.default.node
37
+ children: _propTypes.default.node,
38
+ elementRef: _propTypes.default.func
38
39
  };
39
40
  exports.propTypes = propTypes;
40
- const allowedProps = ['as', 'children'];
41
+ const allowedProps = ['as', 'children', 'elementRef'];
41
42
  exports.allowedProps = allowedProps;
@@ -33,6 +33,15 @@ category: components/utilities
33
33
  @tsProps
34
34
  **/
35
35
  let ScreenReaderContent = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec(_class = (_temp = _class2 = class ScreenReaderContent extends _react.Component {
36
+ constructor(...args) {
37
+ super(...args);
38
+ this.ref = null;
39
+
40
+ this.handleRef = el => {
41
+ this.ref = el;
42
+ };
43
+ }
44
+
36
45
  componentDidMount() {
37
46
  var _this$props$makeStyle, _this$props;
38
47
 
@@ -52,7 +61,8 @@ let ScreenReaderContent = (_dec = (0, _emotion.withStyle)(_styles.default, null)
52
61
  props = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
53
62
  const ElementType = (0, _getElementType.getElementType)(ScreenReaderContent, props);
54
63
  return (0, _emotion.jsx)(ElementType, Object.assign({}, (0, _passthroughProps.passthroughProps)(props), {
55
- css: styles === null || styles === void 0 ? void 0 : styles.screenReaderContent
64
+ css: styles === null || styles === void 0 ? void 0 : styles.screenReaderContent,
65
+ ref: this.handleRef
56
66
  }), children);
57
67
  }
58
68
 
@@ -34,8 +34,9 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
34
34
  */
35
35
  const propTypes = {
36
36
  as: _propTypes.default.elementType,
37
- children: _propTypes.default.node
37
+ children: _propTypes.default.node,
38
+ elementRef: _propTypes.default.func
38
39
  };
39
40
  exports.propTypes = propTypes;
40
- const allowedProps = ['as', 'children'];
41
+ const allowedProps = ['as', 'children', 'elementRef'];
41
42
  exports.allowedProps = allowedProps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-a11y-content",
3
- "version": "8.10.1-snapshot.4+6c5c9e653",
3
+ "version": "8.10.2-snapshot.22+b84160eff",
4
4
  "description": "Utility components that enhance the user experience of those that navigate the web with a screen reader or keyboard.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "type": "commonjs",
@@ -25,20 +25,20 @@
25
25
  "license": "MIT",
26
26
  "dependencies": {
27
27
  "@babel/runtime": "^7.13.10",
28
- "@instructure/console": "8.10.1-snapshot.4+6c5c9e653",
29
- "@instructure/emotion": "8.10.1-snapshot.4+6c5c9e653",
30
- "@instructure/shared-types": "8.10.1-snapshot.4+6c5c9e653",
31
- "@instructure/ui-dom-utils": "8.10.1-snapshot.4+6c5c9e653",
32
- "@instructure/ui-prop-types": "8.10.1-snapshot.4+6c5c9e653",
33
- "@instructure/ui-react-utils": "8.10.1-snapshot.4+6c5c9e653",
34
- "@instructure/ui-utils": "8.10.1-snapshot.4+6c5c9e653",
35
- "@instructure/uid": "8.10.1-snapshot.4+6c5c9e653",
28
+ "@instructure/console": "8.10.2-snapshot.22+b84160eff",
29
+ "@instructure/emotion": "8.10.2-snapshot.22+b84160eff",
30
+ "@instructure/shared-types": "8.10.2-snapshot.22+b84160eff",
31
+ "@instructure/ui-dom-utils": "8.10.2-snapshot.22+b84160eff",
32
+ "@instructure/ui-prop-types": "8.10.2-snapshot.22+b84160eff",
33
+ "@instructure/ui-react-utils": "8.10.2-snapshot.22+b84160eff",
34
+ "@instructure/ui-utils": "8.10.2-snapshot.22+b84160eff",
35
+ "@instructure/uid": "8.10.2-snapshot.22+b84160eff",
36
36
  "keycode": "^2",
37
37
  "prop-types": "^15"
38
38
  },
39
39
  "devDependencies": {
40
- "@instructure/ui-babel-preset": "8.10.1-snapshot.4+6c5c9e653",
41
- "@instructure/ui-test-utils": "8.10.1-snapshot.4+6c5c9e653"
40
+ "@instructure/ui-babel-preset": "8.10.2-snapshot.22+b84160eff",
41
+ "@instructure/ui-test-utils": "8.10.2-snapshot.22+b84160eff"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "react": ">=16.8 <=17"
@@ -47,5 +47,5 @@
47
47
  "access": "public"
48
48
  },
49
49
  "sideEffects": false,
50
- "gitHead": "6c5c9e653f7ce3d239296f4ed19c5679fdddcd5b"
50
+ "gitHead": "b84160effefb01aeb94b754f0b7a64f8dad1b7f2"
51
51
  }
@@ -50,12 +50,21 @@ class AccessibleContent extends Component<
50
50
  children: null
51
51
  } as const
52
52
 
53
+ ref: Element | null = null
54
+
55
+ handleRef = (el: Element | null) => {
56
+ this.ref = el
57
+ }
58
+
53
59
  render() {
54
60
  const { alt, children, ...props } = this.props
55
61
  const ElementType = getElementType(AccessibleContent, this.props)
56
62
 
57
63
  return (
58
- <ElementType {...passthroughProps(props)}>
64
+ <ElementType
65
+ {...passthroughProps(props as AccessibleContentProps)}
66
+ ref={this.handleRef}
67
+ >
59
68
  <ScreenReaderContent>{alt}</ScreenReaderContent>
60
69
  <PresentationContent>{children}</PresentationContent>
61
70
  </ElementType>
@@ -47,12 +47,24 @@ class PresentationContent extends Component<
47
47
  children: null
48
48
  } as const
49
49
 
50
+ ref: Element | null = null
51
+
52
+ handleRef = (el: Element | null) => {
53
+ this.ref = el
54
+ this.props.elementRef?.(el)
55
+ }
56
+
50
57
  render() {
51
58
  const { children, ...props } = this.props
52
59
  const ElementType = getElementType(PresentationContent, this.props)
53
60
 
54
61
  return (
55
- <ElementType {...passthroughProps(props)} aria-hidden="true">
62
+ <ElementType
63
+ // @ts-expect-error TODO: `ref` prop causes: "Expression produces a union type that is too complex to represent.ts(2590)"
64
+ {...passthroughProps(props)}
65
+ aria-hidden="true"
66
+ ref={this.handleRef}
67
+ >
56
68
  {children}
57
69
  </ElementType>
58
70
  )
@@ -34,6 +34,7 @@ type PresentationContentOwnProps = {
34
34
  as: AsElementType
35
35
 
36
36
  children?: React.ReactNode
37
+ elementRef?: (element: Element | null) => void
37
38
  }
38
39
 
39
40
  type PropKeys = keyof PresentationContentOwnProps
@@ -44,10 +45,11 @@ type PresentationContentProps = PresentationContentOwnProps
44
45
 
45
46
  const propTypes: PropValidators<PropKeys> = {
46
47
  as: PropTypes.elementType,
47
- children: PropTypes.node
48
+ children: PropTypes.node,
49
+ elementRef: PropTypes.func
48
50
  }
49
51
 
50
- const allowedProps: AllowedPropKeys = ['as', 'children']
52
+ const allowedProps: AllowedPropKeys = ['as', 'children', 'elementRef']
51
53
 
52
54
  export type { PresentationContentProps }
53
55
  export { propTypes, allowedProps }
@@ -54,6 +54,12 @@ class ScreenReaderContent extends Component<ScreenReaderContentProps> {
54
54
  children: null
55
55
  } as const
56
56
 
57
+ ref: Element | null = null
58
+
59
+ handleRef = (el: Element | null) => {
60
+ this.ref = el
61
+ }
62
+
57
63
  componentDidMount() {
58
64
  this.props.makeStyles?.()
59
65
  }
@@ -70,6 +76,7 @@ class ScreenReaderContent extends Component<ScreenReaderContentProps> {
70
76
  <ElementType
71
77
  {...passthroughProps(props)}
72
78
  css={styles?.screenReaderContent}
79
+ ref={this.handleRef}
73
80
  >
74
81
  {children}
75
82
  </ElementType>
@@ -42,6 +42,11 @@ type ScreenReaderContentOwnProps = {
42
42
  * content meant for screen readers only
43
43
  */
44
44
  children?: ReactNode
45
+
46
+ /**
47
+ * provides a reference to the underlying html root element
48
+ */
49
+ elementRef?: (element: Element | null) => void
45
50
  }
46
51
 
47
52
  type PropKeys = keyof ScreenReaderContentOwnProps
@@ -56,10 +61,11 @@ type ScreenReaderContentStyle = ComponentStyle<'screenReaderContent'>
56
61
 
57
62
  const propTypes: PropValidators<PropKeys> = {
58
63
  as: PropTypes.elementType,
59
- children: PropTypes.node
64
+ children: PropTypes.node,
65
+ elementRef: PropTypes.func
60
66
  }
61
67
 
62
- const allowedProps: AllowedPropKeys = ['as', 'children']
68
+ const allowedProps: AllowedPropKeys = ['as', 'children', 'elementRef']
63
69
 
64
70
  export type { ScreenReaderContentProps, ScreenReaderContentStyle }
65
71
  export { propTypes, allowedProps }
@@ -23,6 +23,8 @@ declare class AccessibleContent extends Component<AccessibleContentProps & Other
23
23
  readonly as: "span";
24
24
  readonly children: null;
25
25
  };
26
+ ref: Element | null;
27
+ handleRef: (el: Element | null) => void;
26
28
  render(): JSX.Element;
27
29
  }
28
30
  export default AccessibleContent;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/AccessibleContent/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGxC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAMpE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAErD;;;;;;GAMG;AACH,cAAM,iBAAkB,SAAQ,SAAS,CACvC,sBAAsB,GAAG,mBAAmB,CAAC,sBAAsB,CAAC,CACrE;IACC,MAAM,CAAC,SAAS;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;MAGT;IAEV,MAAM;CAWP;AAED,eAAe,iBAAiB,CAAA;AAChC,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/AccessibleContent/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGxC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAMpE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAErD;;;;;;GAMG;AACH,cAAM,iBAAkB,SAAQ,SAAS,CACvC,sBAAsB,GAAG,mBAAmB,CAAC,sBAAsB,CAAC,CACrE;IACC,MAAM,CAAC,SAAS;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;MAGT;IAEV,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAE9B;IAED,MAAM;CAcP;AAED,eAAe,iBAAiB,CAAA;AAChC,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
@@ -12,15 +12,19 @@ declare class PresentationContent extends Component<PresentationContentProps & O
12
12
  static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
13
13
  as: import("@instructure/shared-types/types/CommonProps").AsElementType;
14
14
  children?: React.ReactNode;
15
+ elementRef?: ((element: Element | null) => void) | undefined;
15
16
  }>;
16
17
  static allowedProps: readonly (keyof {
17
18
  as: import("@instructure/shared-types/types/CommonProps").AsElementType;
18
19
  children?: React.ReactNode;
20
+ elementRef?: ((element: Element | null) => void) | undefined;
19
21
  })[];
20
22
  static defaultProps: {
21
23
  readonly as: "span";
22
24
  readonly children: null;
23
25
  };
26
+ ref: Element | null;
27
+ handleRef: (el: Element | null) => void;
24
28
  render(): JSX.Element;
25
29
  }
26
30
  export default PresentationContent;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/PresentationContent/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGxC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAGpE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAEvD;;;;;;GAMG;AACH,cAAM,mBAAoB,SAAQ,SAAS,CACzC,wBAAwB,GAAG,mBAAmB,CAAC,wBAAwB,CAAC,CACzE;IACC,MAAM,CAAC,SAAS;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;MAGT;IAEV,MAAM;CAUP;AAED,eAAe,mBAAmB,CAAA;AAClC,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/PresentationContent/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGxC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAGpE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAEvD;;;;;;GAMG;AACH,cAAM,mBAAoB,SAAQ,SAAS,CACzC,wBAAwB,GAAG,mBAAmB,CAAC,wBAAwB,CAAC,CACzE;IACC,MAAM,CAAC,SAAS;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;MAGT;IAEV,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAG9B;IAED,MAAM;CAeP;AAED,eAAe,mBAAmB,CAAA;AAClC,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
@@ -6,6 +6,7 @@ declare type PresentationContentOwnProps = {
6
6
  */
7
7
  as: AsElementType;
8
8
  children?: React.ReactNode;
9
+ elementRef?: (element: Element | null) => void;
9
10
  };
10
11
  declare type PropKeys = keyof PresentationContentOwnProps;
11
12
  declare type AllowedPropKeys = Readonly<PropKeys[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/PresentationContent/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE9E,aAAK,2BAA2B,GAAG;IACjC;;OAEG;IACH,EAAE,EAAE,aAAa,CAAA;IAEjB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,2BAA2B,CAAA;AAEjD,aAAK,eAAe,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAA;AAE3C,aAAK,wBAAwB,GAAG,2BAA2B,CAAA;AAE3D,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAGvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAAoC,CAAA;AAExD,YAAY,EAAE,wBAAwB,EAAE,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/PresentationContent/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE9E,aAAK,2BAA2B,GAAG;IACjC;;OAEG;IACH,EAAE,EAAE,aAAa,CAAA;IAEjB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAA;CAC/C,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,2BAA2B,CAAA;AAEjD,aAAK,eAAe,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAA;AAE3C,aAAK,wBAAwB,GAAG,2BAA2B,CAAA;AAE3D,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAIvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAAkD,CAAA;AAEtE,YAAY,EAAE,wBAAwB,EAAE,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
@@ -14,15 +14,19 @@ declare class ScreenReaderContent extends Component<ScreenReaderContentProps> {
14
14
  static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
15
15
  as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
16
16
  children?: import("react").ReactNode;
17
+ elementRef?: ((element: Element | null) => void) | undefined;
17
18
  }>;
18
19
  static allowedProps: readonly (keyof {
19
20
  as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
20
21
  children?: import("react").ReactNode;
22
+ elementRef?: ((element: Element | null) => void) | undefined;
21
23
  })[];
22
24
  static defaultProps: {
23
25
  readonly as: "span";
24
26
  readonly children: null;
25
27
  };
28
+ ref: Element | null;
29
+ handleRef: (el: Element | null) => void;
26
30
  componentDidMount(): void;
27
31
  componentDidUpdate(): void;
28
32
  render(): jsx.JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ScreenReaderContent/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAIjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAKrD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAEvD;;;;;;GAMG;AACH,cACM,mBAAoB,SAAQ,SAAS,CAAC,wBAAwB,CAAC;IACnE,MAAM,CAAC,QAAQ,CAAC,WAAW,yBAAwB;IAEnD,MAAM,CAAC,SAAS;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;SAAe;IAElC,MAAM,CAAC,YAAY;;;MAGT;IAEV,iBAAiB;IAIjB,kBAAkB;IAIlB,MAAM;CAaP;AAED,eAAe,mBAAmB,CAAA;AAClC,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ScreenReaderContent/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAIjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAKrD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAEvD;;;;;;GAMG;AACH,cACM,mBAAoB,SAAQ,SAAS,CAAC,wBAAwB,CAAC;IACnE,MAAM,CAAC,QAAQ,CAAC,WAAW,yBAAwB;IAEnD,MAAM,CAAC,SAAS;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;;SAAe;IAElC,MAAM,CAAC,YAAY;;;MAGT;IAEV,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAE9B;IAED,iBAAiB;IAIjB,kBAAkB;IAIlB,MAAM;CAcP;AAED,eAAe,mBAAmB,CAAA;AAClC,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
@@ -10,6 +10,10 @@ declare type ScreenReaderContentOwnProps = {
10
10
  * content meant for screen readers only
11
11
  */
12
12
  children?: ReactNode;
13
+ /**
14
+ * provides a reference to the underlying html root element
15
+ */
16
+ elementRef?: (element: Element | null) => void;
13
17
  };
14
18
  declare type PropKeys = keyof ScreenReaderContentOwnProps;
15
19
  declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/ScreenReaderContent/props.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGjC,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,cAAc,EACf,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1E,aAAK,2BAA2B,GAAG;IACjC;;OAEG;IACH,EAAE,CAAC,EAAE,aAAa,CAAA;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,2BAA2B,CAAA;AAEjD,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,wBAAwB,GAAG,2BAA2B,GACzD,mBAAmB,CAAC,2BAA2B,CAAC,GAChD,cAAc,CAAC,IAAI,EAAE,wBAAwB,CAAC,CAAA;AAEhD,aAAK,wBAAwB,GAAG,cAAc,CAAC,qBAAqB,CAAC,CAAA;AAErE,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAGvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAAoC,CAAA;AAExD,YAAY,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,CAAA;AAClE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/ScreenReaderContent/props.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGjC,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,cAAc,EACf,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1E,aAAK,2BAA2B,GAAG;IACjC;;OAEG;IACH,EAAE,CAAC,EAAE,aAAa,CAAA;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAA;CAC/C,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,2BAA2B,CAAA;AAEjD,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,wBAAwB,GAAG,2BAA2B,GACzD,mBAAmB,CAAC,2BAA2B,CAAC,GAChD,cAAc,CAAC,IAAI,EAAE,wBAAwB,CAAC,CAAA;AAEhD,aAAK,wBAAwB,GAAG,cAAc,CAAC,qBAAqB,CAAC,CAAA;AAErE,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAIvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAAkD,CAAA;AAEtE,YAAY,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,CAAA;AAClE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}