@instructure/ui-a11y-content 8.8.1-snapshot.3 → 8.9.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.
Files changed (47) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/es/AccessibleContent/index.js +3 -7
  3. package/{src/PresentationContent/types.ts → es/AccessibleContent/props.js} +8 -10
  4. package/es/PresentationContent/index.js +3 -5
  5. package/{src/AccessibleContent/types.ts → es/PresentationContent/props.js} +7 -13
  6. package/es/ScreenReaderContent/index.js +13 -16
  7. package/{src/ScreenReaderContent/types.ts → es/ScreenReaderContent/props.js} +7 -16
  8. package/lib/AccessibleContent/index.js +4 -8
  9. package/lib/AccessibleContent/props.js +42 -0
  10. package/lib/PresentationContent/index.js +4 -6
  11. package/lib/PresentationContent/props.js +41 -0
  12. package/lib/ScreenReaderContent/index.js +14 -17
  13. package/lib/ScreenReaderContent/props.js +41 -0
  14. package/package.json +12 -13
  15. package/src/AccessibleContent/index.tsx +7 -11
  16. package/src/AccessibleContent/props.ts +55 -0
  17. package/src/PresentationContent/index.tsx +6 -9
  18. package/src/PresentationContent/props.ts +53 -0
  19. package/src/ScreenReaderContent/index.tsx +11 -20
  20. package/src/ScreenReaderContent/props.ts +63 -0
  21. package/src/index.ts +3 -3
  22. package/types/AccessibleContent/index.d.ts +15 -12
  23. package/types/AccessibleContent/index.d.ts.map +1 -1
  24. package/types/AccessibleContent/props.d.ts +18 -0
  25. package/types/AccessibleContent/props.d.ts.map +1 -0
  26. package/types/PresentationContent/index.d.ts +13 -10
  27. package/types/PresentationContent/index.d.ts.map +1 -1
  28. package/types/PresentationContent/props.d.ts +17 -0
  29. package/types/PresentationContent/props.d.ts.map +1 -0
  30. package/types/ScreenReaderContent/index.d.ts +12 -12
  31. package/types/ScreenReaderContent/index.d.ts.map +1 -1
  32. package/types/ScreenReaderContent/props.d.ts +21 -0
  33. package/types/ScreenReaderContent/props.d.ts.map +1 -0
  34. package/types/index.d.ts +3 -3
  35. package/LICENSE.md +0 -27
  36. package/es/AccessibleContent/types.js +0 -1
  37. package/es/PresentationContent/types.js +0 -1
  38. package/es/ScreenReaderContent/types.js +0 -1
  39. package/lib/AccessibleContent/types.js +0 -1
  40. package/lib/PresentationContent/types.js +0 -1
  41. package/lib/ScreenReaderContent/types.js +0 -1
  42. package/types/AccessibleContent/types.d.ts +0 -10
  43. package/types/AccessibleContent/types.d.ts.map +0 -1
  44. package/types/PresentationContent/types.d.ts +0 -9
  45. package/types/PresentationContent/types.d.ts.map +0 -1
  46. package/types/ScreenReaderContent/types.d.ts +0 -15
  47. package/types/ScreenReaderContent/types.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
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.9.0](https://github.com/instructure/instructure-ui/compare/v8.8.0...v8.9.0) (2021-09-15)
7
+
8
+ ### Bug Fixes
9
+
10
+ - fix shared-types TS errors ([7b83164](https://github.com/instructure/instructure-ui/commit/7b83164f4c5872f3a217e010563f59bf584ae4fc))
11
+
6
12
  # [8.8.0](https://github.com/instructure/instructure-ui/compare/v8.7.0...v8.8.0) (2021-08-27)
7
13
 
8
14
  **Note:** Version bump only for package @instructure/ui-a11y-content
@@ -25,10 +25,10 @@ const _excluded = ["alt", "children"];
25
25
  * SOFTWARE.
26
26
  */
27
27
  import React, { Component } from 'react';
28
- import PropTypes from 'prop-types';
29
28
  import { passthroughProps, getElementType } from '@instructure/ui-react-utils';
30
29
  import { PresentationContent } from '../PresentationContent';
31
30
  import { ScreenReaderContent } from '../ScreenReaderContent';
31
+ import { propTypes, allowedProps } from './props';
32
32
 
33
33
  /**
34
34
  ---
@@ -51,13 +51,9 @@ class AccessibleContent extends Component {
51
51
  }
52
52
 
53
53
  AccessibleContent.displayName = "AccessibleContent";
54
- AccessibleContent.propTypes = {
55
- alt: PropTypes.string,
56
- as: PropTypes.elementType,
57
- children: PropTypes.node
58
- };
54
+ AccessibleContent.propTypes = propTypes;
55
+ AccessibleContent.allowedProps = allowedProps;
59
56
  AccessibleContent.defaultProps = {
60
- alt: void 0,
61
57
  as: 'span',
62
58
  children: null
63
59
  };
@@ -21,13 +21,11 @@
21
21
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
  * SOFTWARE.
23
23
  */
24
-
25
- import { AsElementType } from '@instructure/shared-types'
26
- import { PropsWithChildren } from 'react'
27
-
28
- export type PresentationContentProps = PropsWithChildren<{
29
- /**
30
- * the element type to render as
31
- */
32
- as: AsElementType
33
- }>
24
+ import PropTypes from 'prop-types';
25
+ const propTypes = {
26
+ alt: PropTypes.string,
27
+ as: PropTypes.elementType,
28
+ children: PropTypes.node
29
+ };
30
+ const allowedProps = ['alt', 'as', 'children'];
31
+ export { propTypes, allowedProps };
@@ -25,8 +25,8 @@ const _excluded = ["children"];
25
25
  * SOFTWARE.
26
26
  */
27
27
  import React, { Component } from 'react';
28
- import PropTypes from 'prop-types';
29
28
  import { passthroughProps, getElementType } from '@instructure/ui-react-utils';
29
+ import { propTypes, allowedProps } from './props';
30
30
 
31
31
  /**
32
32
  ---
@@ -50,10 +50,8 @@ class PresentationContent extends Component {
50
50
  }
51
51
 
52
52
  PresentationContent.displayName = "PresentationContent";
53
- PresentationContent.propTypes = {
54
- as: PropTypes.elementType,
55
- children: PropTypes.node
56
- };
53
+ PresentationContent.propTypes = propTypes;
54
+ PresentationContent.allowedProps = allowedProps;
57
55
  PresentationContent.defaultProps = {
58
56
  as: 'span',
59
57
  children: null
@@ -21,16 +21,10 @@
21
21
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
  * SOFTWARE.
23
23
  */
24
-
25
- import { PropsWithChildren } from 'react'
26
-
27
- import { AsElementType } from '@instructure/shared-types'
28
-
29
- export type AccessibleContentProps = PropsWithChildren<{
30
- alt?: string
31
-
32
- /**
33
- * the element type to render the screen reader content as
34
- */
35
- as: AsElementType
36
- }>
24
+ import PropTypes from 'prop-types';
25
+ const propTypes = {
26
+ as: PropTypes.elementType,
27
+ children: PropTypes.node
28
+ };
29
+ const allowedProps = ['as', 'children'];
30
+ export { propTypes, allowedProps };
@@ -29,10 +29,10 @@ var _dec, _class, _class2, _temp;
29
29
 
30
30
  /** @jsx jsx */
31
31
  import { Component } from 'react';
32
- import PropTypes from 'prop-types';
33
32
  import { passthroughProps, getElementType } from '@instructure/ui-react-utils';
34
33
  import { withStyle, jsx } from '@instructure/emotion';
35
34
  import generateStyle from './styles';
35
+ import { propTypes, allowedProps } from './props';
36
36
 
37
37
  /**
38
38
  ---
@@ -43,33 +43,30 @@ category: components/utilities
43
43
  **/
44
44
  let ScreenReaderContent = (_dec = withStyle(generateStyle, null), _dec(_class = (_temp = _class2 = class ScreenReaderContent extends Component {
45
45
  componentDidMount() {
46
- this.props.makeStyles();
46
+ var _this$props$makeStyle, _this$props;
47
+
48
+ (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
47
49
  }
48
50
 
49
51
  componentDidUpdate() {
50
- this.props.makeStyles();
52
+ var _this$props$makeStyle2, _this$props2;
53
+
54
+ (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
51
55
  }
52
56
 
53
57
  render() {
54
- const _this$props = this.props,
55
- children = _this$props.children,
56
- styles = _this$props.styles,
57
- props = _objectWithoutProperties(_this$props, _excluded);
58
+ const _this$props3 = this.props,
59
+ children = _this$props3.children,
60
+ styles = _this$props3.styles,
61
+ props = _objectWithoutProperties(_this$props3, _excluded);
58
62
 
59
63
  const ElementType = getElementType(ScreenReaderContent, props);
60
64
  return jsx(ElementType, Object.assign({}, passthroughProps(props), {
61
- css: styles.screenReaderContent
65
+ css: styles === null || styles === void 0 ? void 0 : styles.screenReaderContent
62
66
  }), children);
63
67
  }
64
68
 
65
- }, _class2.displayName = "ScreenReaderContent", _class2.componentId = 'ScreenReaderContent', _class2.propTypes = {
66
- // eslint-disable-next-line react/require-default-props
67
- makeStyles: PropTypes.func,
68
- // eslint-disable-next-line react/require-default-props
69
- styles: PropTypes.object,
70
- as: PropTypes.elementType,
71
- children: PropTypes.node
72
- }, _class2.defaultProps = {
69
+ }, _class2.displayName = "ScreenReaderContent", _class2.componentId = 'ScreenReaderContent', _class2.propTypes = propTypes, _class2.allowedProps = allowedProps, _class2.defaultProps = {
73
70
  as: 'span',
74
71
  children: null
75
72
  }, _temp)) || _class);
@@ -21,19 +21,10 @@
21
21
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
  * SOFTWARE.
23
23
  */
24
-
25
- import { AsElementType } from '@instructure/shared-types'
26
- import { PropsWithChildren, ReactNode } from 'react'
27
-
28
- export type ScreenReaderContentProps = PropsWithChildren<{
29
- makeStyles?: (...args: any[]) => any
30
- styles?: any
31
- /**
32
- * the element type to render as
33
- */
34
- as: AsElementType
35
- /**
36
- * content meant for screen readers only
37
- */
38
- children: ReactNode
39
- }>
24
+ import PropTypes from 'prop-types';
25
+ const propTypes = {
26
+ as: PropTypes.elementType,
27
+ children: PropTypes.node
28
+ };
29
+ const allowedProps = ['as', 'children'];
30
+ export { propTypes, allowedProps };
@@ -13,8 +13,6 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
13
13
 
14
14
  var _react = _interopRequireWildcard(require("react"));
15
15
 
16
- var _propTypes = _interopRequireDefault(require("prop-types"));
17
-
18
16
  var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
19
17
 
20
18
  var _getElementType = require("@instructure/ui-react-utils/lib/getElementType.js");
@@ -23,6 +21,8 @@ var _PresentationContent = require("../PresentationContent");
23
21
 
24
22
  var _ScreenReaderContent = require("../ScreenReaderContent");
25
23
 
24
+ var _props = require("./props");
25
+
26
26
  const _excluded = ["alt", "children"];
27
27
 
28
28
  /**
@@ -46,13 +46,9 @@ class AccessibleContent extends _react.Component {
46
46
 
47
47
  exports.AccessibleContent = AccessibleContent;
48
48
  AccessibleContent.displayName = "AccessibleContent";
49
- AccessibleContent.propTypes = {
50
- alt: _propTypes.default.string,
51
- as: _propTypes.default.elementType,
52
- children: _propTypes.default.node
53
- };
49
+ AccessibleContent.propTypes = _props.propTypes;
50
+ AccessibleContent.allowedProps = _props.allowedProps;
54
51
  AccessibleContent.defaultProps = {
55
- alt: void 0,
56
52
  as: 'span',
57
53
  children: null
58
54
  };
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.allowedProps = exports.propTypes = void 0;
9
+
10
+ var _propTypes = _interopRequireDefault(require("prop-types"));
11
+
12
+ /*
13
+ * The MIT License (MIT)
14
+ *
15
+ * Copyright (c) 2015 - present Instructure, Inc.
16
+ *
17
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
18
+ * of this software and associated documentation files (the "Software"), to deal
19
+ * in the Software without restriction, including without limitation the rights
20
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
21
+ * copies of the Software, and to permit persons to whom the Software is
22
+ * furnished to do so, subject to the following conditions:
23
+ *
24
+ * The above copyright notice and this permission notice shall be included in all
25
+ * copies or substantial portions of the Software.
26
+ *
27
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
30
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
32
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33
+ * SOFTWARE.
34
+ */
35
+ const propTypes = {
36
+ alt: _propTypes.default.string,
37
+ as: _propTypes.default.elementType,
38
+ children: _propTypes.default.node
39
+ };
40
+ exports.propTypes = propTypes;
41
+ const allowedProps = ['alt', 'as', 'children'];
42
+ exports.allowedProps = allowedProps;
@@ -13,12 +13,12 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
13
13
 
14
14
  var _react = _interopRequireWildcard(require("react"));
15
15
 
16
- var _propTypes = _interopRequireDefault(require("prop-types"));
17
-
18
16
  var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
19
17
 
20
18
  var _getElementType = require("@instructure/ui-react-utils/lib/getElementType.js");
21
19
 
20
+ var _props = require("./props");
21
+
22
22
  const _excluded = ["children"];
23
23
 
24
24
  /**
@@ -43,10 +43,8 @@ class PresentationContent extends _react.Component {
43
43
 
44
44
  exports.PresentationContent = PresentationContent;
45
45
  PresentationContent.displayName = "PresentationContent";
46
- PresentationContent.propTypes = {
47
- as: _propTypes.default.elementType,
48
- children: _propTypes.default.node
49
- };
46
+ PresentationContent.propTypes = _props.propTypes;
47
+ PresentationContent.allowedProps = _props.allowedProps;
50
48
  PresentationContent.defaultProps = {
51
49
  as: 'span',
52
50
  children: null
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.allowedProps = exports.propTypes = void 0;
9
+
10
+ var _propTypes = _interopRequireDefault(require("prop-types"));
11
+
12
+ /*
13
+ * The MIT License (MIT)
14
+ *
15
+ * Copyright (c) 2015 - present Instructure, Inc.
16
+ *
17
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
18
+ * of this software and associated documentation files (the "Software"), to deal
19
+ * in the Software without restriction, including without limitation the rights
20
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
21
+ * copies of the Software, and to permit persons to whom the Software is
22
+ * furnished to do so, subject to the following conditions:
23
+ *
24
+ * The above copyright notice and this permission notice shall be included in all
25
+ * copies or substantial portions of the Software.
26
+ *
27
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
30
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
32
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33
+ * SOFTWARE.
34
+ */
35
+ const propTypes = {
36
+ as: _propTypes.default.elementType,
37
+ children: _propTypes.default.node
38
+ };
39
+ exports.propTypes = propTypes;
40
+ const allowedProps = ['as', 'children'];
41
+ exports.allowedProps = allowedProps;
@@ -11,8 +11,6 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
11
11
 
12
12
  var _react = require("react");
13
13
 
14
- var _propTypes = _interopRequireDefault(require("prop-types"));
15
-
16
14
  var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
17
15
 
18
16
  var _getElementType = require("@instructure/ui-react-utils/lib/getElementType.js");
@@ -21,6 +19,8 @@ var _emotion = require("@instructure/emotion");
21
19
 
22
20
  var _styles = _interopRequireDefault(require("./styles"));
23
21
 
22
+ var _props = require("./props");
23
+
24
24
  const _excluded = ["children", "styles"];
25
25
 
26
26
  var _dec, _class, _class2, _temp;
@@ -34,32 +34,29 @@ category: components/utilities
34
34
  **/
35
35
  let ScreenReaderContent = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec(_class = (_temp = _class2 = class ScreenReaderContent extends _react.Component {
36
36
  componentDidMount() {
37
- this.props.makeStyles();
37
+ var _this$props$makeStyle, _this$props;
38
+
39
+ (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
38
40
  }
39
41
 
40
42
  componentDidUpdate() {
41
- this.props.makeStyles();
43
+ var _this$props$makeStyle2, _this$props2;
44
+
45
+ (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
42
46
  }
43
47
 
44
48
  render() {
45
- const _this$props = this.props,
46
- children = _this$props.children,
47
- styles = _this$props.styles,
48
- props = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
49
+ const _this$props3 = this.props,
50
+ children = _this$props3.children,
51
+ styles = _this$props3.styles,
52
+ props = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
49
53
  const ElementType = (0, _getElementType.getElementType)(ScreenReaderContent, props);
50
54
  return (0, _emotion.jsx)(ElementType, Object.assign({}, (0, _passthroughProps.passthroughProps)(props), {
51
- css: styles.screenReaderContent
55
+ css: styles === null || styles === void 0 ? void 0 : styles.screenReaderContent
52
56
  }), children);
53
57
  }
54
58
 
55
- }, _class2.displayName = "ScreenReaderContent", _class2.componentId = 'ScreenReaderContent', _class2.propTypes = {
56
- // eslint-disable-next-line react/require-default-props
57
- makeStyles: _propTypes.default.func,
58
- // eslint-disable-next-line react/require-default-props
59
- styles: _propTypes.default.object,
60
- as: _propTypes.default.elementType,
61
- children: _propTypes.default.node
62
- }, _class2.defaultProps = {
59
+ }, _class2.displayName = "ScreenReaderContent", _class2.componentId = 'ScreenReaderContent', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {
63
60
  as: 'span',
64
61
  children: null
65
62
  }, _temp)) || _class);
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.allowedProps = exports.propTypes = void 0;
9
+
10
+ var _propTypes = _interopRequireDefault(require("prop-types"));
11
+
12
+ /*
13
+ * The MIT License (MIT)
14
+ *
15
+ * Copyright (c) 2015 - present Instructure, Inc.
16
+ *
17
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
18
+ * of this software and associated documentation files (the "Software"), to deal
19
+ * in the Software without restriction, including without limitation the rights
20
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
21
+ * copies of the Software, and to permit persons to whom the Software is
22
+ * furnished to do so, subject to the following conditions:
23
+ *
24
+ * The above copyright notice and this permission notice shall be included in all
25
+ * copies or substantial portions of the Software.
26
+ *
27
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
30
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
32
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33
+ * SOFTWARE.
34
+ */
35
+ const propTypes = {
36
+ as: _propTypes.default.elementType,
37
+ children: _propTypes.default.node
38
+ };
39
+ exports.propTypes = propTypes;
40
+ const allowedProps = ['as', 'children'];
41
+ exports.allowedProps = allowedProps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-a11y-content",
3
- "version": "8.8.1-snapshot.3+d5d6d4cd8",
3
+ "version": "8.9.0",
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.8.1-snapshot.3+d5d6d4cd8",
29
- "@instructure/emotion": "8.8.1-snapshot.3+d5d6d4cd8",
30
- "@instructure/ui-dom-utils": "8.8.1-snapshot.3+d5d6d4cd8",
31
- "@instructure/ui-prop-types": "8.8.1-snapshot.3+d5d6d4cd8",
32
- "@instructure/ui-react-utils": "8.8.1-snapshot.3+d5d6d4cd8",
33
- "@instructure/ui-utils": "8.8.1-snapshot.3+d5d6d4cd8",
34
- "@instructure/uid": "8.8.1-snapshot.3+d5d6d4cd8",
28
+ "@instructure/console": "8.9.0",
29
+ "@instructure/emotion": "8.9.0",
30
+ "@instructure/shared-types": "8.9.0",
31
+ "@instructure/ui-dom-utils": "8.9.0",
32
+ "@instructure/ui-prop-types": "8.9.0",
33
+ "@instructure/ui-react-utils": "8.9.0",
34
+ "@instructure/ui-utils": "8.9.0",
35
+ "@instructure/uid": "8.9.0",
35
36
  "keycode": "^2",
36
37
  "prop-types": "^15"
37
38
  },
38
39
  "devDependencies": {
39
- "@instructure/shared-types": "8.8.1-snapshot.3+d5d6d4cd8",
40
- "@instructure/ui-babel-preset": "8.8.1-snapshot.3+d5d6d4cd8",
41
- "@instructure/ui-test-utils": "8.8.1-snapshot.3+d5d6d4cd8"
40
+ "@instructure/ui-babel-preset": "8.9.0",
41
+ "@instructure/ui-test-utils": "8.9.0"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "react": ">=16.8 <=17"
@@ -46,6 +46,5 @@
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  },
49
- "sideEffects": false,
50
- "gitHead": "d5d6d4cd8f300e8635c69248f5d794c002269e08"
49
+ "sideEffects": false
51
50
  }
@@ -23,14 +23,15 @@
23
23
  */
24
24
 
25
25
  import React, { Component } from 'react'
26
- import PropTypes from 'prop-types'
27
26
 
28
27
  import { passthroughProps, getElementType } from '@instructure/ui-react-utils'
29
- import { OtherHTMLAttributes } from '@instructure/shared-types'
28
+ import type { OtherHTMLAttributes } from '@instructure/shared-types'
30
29
 
31
30
  import { PresentationContent } from '../PresentationContent'
32
31
  import { ScreenReaderContent } from '../ScreenReaderContent'
33
- import { AccessibleContentProps } from './types'
32
+
33
+ import { propTypes, allowedProps } from './props'
34
+ import type { AccessibleContentProps } from './props'
34
35
 
35
36
  /**
36
37
  ---
@@ -42,17 +43,12 @@ category: components/utilities
42
43
  class AccessibleContent extends Component<
43
44
  AccessibleContentProps & OtherHTMLAttributes<AccessibleContentProps>
44
45
  > {
45
- static propTypes = {
46
- alt: PropTypes.string,
47
- as: PropTypes.elementType,
48
- children: PropTypes.node
49
- }
50
-
46
+ static propTypes = propTypes
47
+ static allowedProps = allowedProps
51
48
  static defaultProps = {
52
- alt: undefined,
53
49
  as: 'span',
54
50
  children: null
55
- }
51
+ } as const
56
52
 
57
53
  render() {
58
54
  const { alt, children, ...props } = this.props
@@ -0,0 +1,55 @@
1
+ /*
2
+ * The MIT License (MIT)
3
+ *
4
+ * Copyright (c) 2015 - present Instructure, Inc.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+
25
+ import PropTypes from 'prop-types'
26
+
27
+ import type { AsElementType, PropValidators } from '@instructure/shared-types'
28
+
29
+ type AccessibleContentOwnProps = {
30
+ alt?: string
31
+
32
+ /**
33
+ * the element type to render the screen reader content as
34
+ */
35
+ as: AsElementType
36
+
37
+ children?: React.ReactNode
38
+ }
39
+
40
+ type PropKeys = keyof AccessibleContentOwnProps
41
+
42
+ type AllowedPropKeys = Readonly<Array<PropKeys>>
43
+
44
+ type AccessibleContentProps = AccessibleContentOwnProps
45
+
46
+ const propTypes: PropValidators<PropKeys> = {
47
+ alt: PropTypes.string,
48
+ as: PropTypes.elementType,
49
+ children: PropTypes.node
50
+ }
51
+
52
+ const allowedProps: AllowedPropKeys = ['alt', 'as', 'children']
53
+
54
+ export type { AccessibleContentProps }
55
+ export { propTypes, allowedProps }
@@ -23,12 +23,12 @@
23
23
  */
24
24
 
25
25
  import React, { Component } from 'react'
26
- import PropTypes from 'prop-types'
27
26
 
28
27
  import { passthroughProps, getElementType } from '@instructure/ui-react-utils'
29
- import { OtherHTMLAttributes } from '@instructure/shared-types'
28
+ import type { OtherHTMLAttributes } from '@instructure/shared-types'
30
29
 
31
- import { PresentationContentProps } from './types'
30
+ import { propTypes, allowedProps } from './props'
31
+ import type { PresentationContentProps } from './props'
32
32
 
33
33
  /**
34
34
  ---
@@ -40,15 +40,12 @@ category: components/utilities
40
40
  class PresentationContent extends Component<
41
41
  PresentationContentProps & OtherHTMLAttributes<PresentationContentProps>
42
42
  > {
43
- static propTypes = {
44
- as: PropTypes.elementType,
45
- children: PropTypes.node
46
- }
47
-
43
+ static propTypes = propTypes
44
+ static allowedProps = allowedProps
48
45
  static defaultProps = {
49
46
  as: 'span',
50
47
  children: null
51
- }
48
+ } as const
52
49
 
53
50
  render() {
54
51
  const { children, ...props } = this.props
@@ -0,0 +1,53 @@
1
+ /*
2
+ * The MIT License (MIT)
3
+ *
4
+ * Copyright (c) 2015 - present Instructure, Inc.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+
25
+ import React from 'react'
26
+ import PropTypes from 'prop-types'
27
+
28
+ import type { AsElementType, PropValidators } from '@instructure/shared-types'
29
+
30
+ type PresentationContentOwnProps = {
31
+ /**
32
+ * the element type to render as
33
+ */
34
+ as: AsElementType
35
+
36
+ children?: React.ReactNode
37
+ }
38
+
39
+ type PropKeys = keyof PresentationContentOwnProps
40
+
41
+ type AllowedPropKeys = Readonly<PropKeys[]>
42
+
43
+ type PresentationContentProps = PresentationContentOwnProps
44
+
45
+ const propTypes: PropValidators<PropKeys> = {
46
+ as: PropTypes.elementType,
47
+ children: PropTypes.node
48
+ }
49
+
50
+ const allowedProps: AllowedPropKeys = ['as', 'children']
51
+
52
+ export type { PresentationContentProps }
53
+ export { propTypes, allowedProps }
@@ -24,15 +24,15 @@
24
24
 
25
25
  /** @jsx jsx */
26
26
  import { Component } from 'react'
27
- import PropTypes from 'prop-types'
28
27
 
29
28
  import { passthroughProps, getElementType } from '@instructure/ui-react-utils'
30
- import { OtherHTMLAttributes } from '@instructure/shared-types'
31
29
 
32
30
  import { withStyle, jsx } from '@instructure/emotion'
33
31
 
34
32
  import generateStyle from './styles'
35
- import { ScreenReaderContentProps } from './types'
33
+
34
+ import { propTypes, allowedProps } from './props'
35
+ import type { ScreenReaderContentProps } from './props'
36
36
 
37
37
  /**
38
38
  ---
@@ -42,33 +42,24 @@ category: components/utilities
42
42
  @tsProps
43
43
  **/
44
44
  @withStyle(generateStyle, null)
45
- class ScreenReaderContent extends Component<
46
- ScreenReaderContentProps & OtherHTMLAttributes<ScreenReaderContentProps>
47
- > {
45
+ class ScreenReaderContent extends Component<ScreenReaderContentProps> {
48
46
  static readonly componentId = 'ScreenReaderContent'
49
47
 
50
- static propTypes = {
51
- // eslint-disable-next-line react/require-default-props
52
- makeStyles: PropTypes.func,
53
- // eslint-disable-next-line react/require-default-props
54
- styles: PropTypes.object,
55
- as: PropTypes.elementType,
56
- children: PropTypes.node
57
- }
48
+ static propTypes = propTypes
49
+
50
+ static allowedProps = allowedProps
58
51
 
59
52
  static defaultProps = {
60
53
  as: 'span',
61
54
  children: null
62
- }
55
+ } as const
63
56
 
64
57
  componentDidMount() {
65
- // @ts-expect-error ts-migrate(2722) FIXME: Cannot invoke an object which is possibly 'undefin... Remove this comment to see the full error message
66
- this.props.makeStyles()
58
+ this.props.makeStyles?.()
67
59
  }
68
60
 
69
61
  componentDidUpdate() {
70
- // @ts-expect-error ts-migrate(2722) FIXME: Cannot invoke an object which is possibly 'undefin... Remove this comment to see the full error message
71
- this.props.makeStyles()
62
+ this.props.makeStyles?.()
72
63
  }
73
64
 
74
65
  render() {
@@ -78,7 +69,7 @@ class ScreenReaderContent extends Component<
78
69
  return (
79
70
  <ElementType
80
71
  {...passthroughProps(props)}
81
- css={styles.screenReaderContent}
72
+ css={styles?.screenReaderContent}
82
73
  >
83
74
  {children}
84
75
  </ElementType>
@@ -0,0 +1,63 @@
1
+ /*
2
+ * The MIT License (MIT)
3
+ *
4
+ * Copyright (c) 2015 - present Instructure, Inc.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+
25
+ import { ReactNode } from 'react'
26
+ import PropTypes from 'prop-types'
27
+
28
+ import type {
29
+ AsElementType,
30
+ OtherHTMLAttributes,
31
+ PropValidators
32
+ } from '@instructure/shared-types'
33
+ import type { WithStyleProps } from '@instructure/emotion'
34
+
35
+ type ScreenReaderContentOwnProps = {
36
+ /**
37
+ * the element type to render as
38
+ */
39
+ as?: AsElementType
40
+
41
+ /**
42
+ * content meant for screen readers only
43
+ */
44
+ children?: ReactNode
45
+ }
46
+
47
+ type PropKeys = keyof ScreenReaderContentOwnProps
48
+
49
+ type AllowedPropKeys = Readonly<Array<PropKeys>>
50
+
51
+ type ScreenReaderContentProps = ScreenReaderContentOwnProps &
52
+ OtherHTMLAttributes<ScreenReaderContentOwnProps> &
53
+ WithStyleProps
54
+
55
+ const propTypes: PropValidators<PropKeys> = {
56
+ as: PropTypes.elementType,
57
+ children: PropTypes.node
58
+ }
59
+
60
+ const allowedProps: AllowedPropKeys = ['as', 'children']
61
+
62
+ export type { ScreenReaderContentProps }
63
+ export { propTypes, allowedProps }
package/src/index.ts CHANGED
@@ -26,6 +26,6 @@ export { AccessibleContent } from './AccessibleContent'
26
26
  export { PresentationContent } from './PresentationContent'
27
27
  export { ScreenReaderContent } from './ScreenReaderContent'
28
28
 
29
- export type { AccessibleContentProps } from './AccessibleContent/types'
30
- export type { PresentationContentProps } from './PresentationContent/types'
31
- export type { ScreenReaderContentProps } from './ScreenReaderContent/types'
29
+ export type { AccessibleContentProps } from './AccessibleContent/props'
30
+ export type { PresentationContentProps } from './PresentationContent/props'
31
+ export type { ScreenReaderContentProps } from './ScreenReaderContent/props'
@@ -1,7 +1,6 @@
1
- import { Component } from 'react';
2
- import PropTypes from 'prop-types';
3
- import { OtherHTMLAttributes } from '@instructure/shared-types';
4
- import { AccessibleContentProps } from './types';
1
+ import React, { Component } from 'react';
2
+ import type { OtherHTMLAttributes } from '@instructure/shared-types';
3
+ import type { AccessibleContentProps } from './props';
5
4
  /**
6
5
  ---
7
6
  category: components/utilities
@@ -10,15 +9,19 @@ category: components/utilities
10
9
  @tsProps
11
10
  **/
12
11
  declare class AccessibleContent extends Component<AccessibleContentProps & OtherHTMLAttributes<AccessibleContentProps>> {
13
- static propTypes: {
14
- alt: PropTypes.Requireable<string>;
15
- as: PropTypes.Requireable<PropTypes.ReactComponentLike>;
16
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
17
- };
12
+ static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
13
+ alt?: string | undefined;
14
+ as: import("@instructure/shared-types/types/CommonProps").AsElementType;
15
+ children?: React.ReactNode;
16
+ }>;
17
+ static allowedProps: readonly (keyof {
18
+ alt?: string | undefined;
19
+ as: import("@instructure/shared-types/types/CommonProps").AsElementType;
20
+ children?: React.ReactNode;
21
+ })[];
18
22
  static defaultProps: {
19
- alt: undefined;
20
- as: string;
21
- children: null;
23
+ readonly as: "span";
24
+ readonly children: null;
22
25
  };
23
26
  render(): JSX.Element;
24
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/AccessibleContent/index.tsx"],"names":[],"mappings":"AAwBA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,SAAS,MAAM,YAAY,CAAA;AAGlC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAI/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAEhD;;;;;;GAMG;AACH,cAAM,iBAAkB,SAAQ,SAAS,CACvC,sBAAsB,GAAG,mBAAmB,CAAC,sBAAsB,CAAC,CACrE;IACC,MAAM,CAAC,SAAS;;;;MAIf;IAED,MAAM,CAAC,YAAY;;;;MAIlB;IAED,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,MAAM;CAWP;AAED,eAAe,iBAAiB,CAAA;AAChC,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import type { AsElementType, PropValidators } from '@instructure/shared-types';
3
+ declare type AccessibleContentOwnProps = {
4
+ alt?: string;
5
+ /**
6
+ * the element type to render the screen reader content as
7
+ */
8
+ as: AsElementType;
9
+ children?: React.ReactNode;
10
+ };
11
+ declare type PropKeys = keyof AccessibleContentOwnProps;
12
+ declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
13
+ declare type AccessibleContentProps = AccessibleContentOwnProps;
14
+ declare const propTypes: PropValidators<PropKeys>;
15
+ declare const allowedProps: AllowedPropKeys;
16
+ export type { AccessibleContentProps };
17
+ export { propTypes, allowedProps };
18
+ //# sourceMappingURL=props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/AccessibleContent/props.ts"],"names":[],"mappings":";AA0BA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE9E,aAAK,yBAAyB,GAAG;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,EAAE,EAAE,aAAa,CAAA;IAEjB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,yBAAyB,CAAA;AAE/C,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,sBAAsB,GAAG,yBAAyB,CAAA;AAEvD,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAIvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAA2C,CAAA;AAE/D,YAAY,EAAE,sBAAsB,EAAE,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
@@ -1,7 +1,6 @@
1
- import { Component } from 'react';
2
- import PropTypes from 'prop-types';
3
- import { OtherHTMLAttributes } from '@instructure/shared-types';
4
- import { PresentationContentProps } from './types';
1
+ import React, { Component } from 'react';
2
+ import type { OtherHTMLAttributes } from '@instructure/shared-types';
3
+ import type { PresentationContentProps } from './props';
5
4
  /**
6
5
  ---
7
6
  category: components/utilities
@@ -10,13 +9,17 @@ category: components/utilities
10
9
  @tsProps
11
10
  **/
12
11
  declare class PresentationContent extends Component<PresentationContentProps & OtherHTMLAttributes<PresentationContentProps>> {
13
- static propTypes: {
14
- as: PropTypes.Requireable<PropTypes.ReactComponentLike>;
15
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
16
- };
12
+ static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
13
+ as: import("@instructure/shared-types/types/CommonProps").AsElementType;
14
+ children?: React.ReactNode;
15
+ }>;
16
+ static allowedProps: readonly (keyof {
17
+ as: import("@instructure/shared-types/types/CommonProps").AsElementType;
18
+ children?: React.ReactNode;
19
+ })[];
17
20
  static defaultProps: {
18
- as: string;
19
- children: null;
21
+ readonly as: "span";
22
+ readonly children: null;
20
23
  };
21
24
  render(): JSX.Element;
22
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/PresentationContent/index.tsx"],"names":[],"mappings":"AAwBA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,SAAS,MAAM,YAAY,CAAA;AAGlC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAE/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAElD;;;;;;GAMG;AACH,cAAM,mBAAoB,SAAQ,SAAS,CACzC,wBAAwB,GAAG,mBAAmB,CAAC,wBAAwB,CAAC,CACzE;IACC,MAAM,CAAC,SAAS;;;MAGf;IAED,MAAM,CAAC,YAAY;;;MAGlB;IAED,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,MAAM;CAUP;AAED,eAAe,mBAAmB,CAAA;AAClC,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import type { AsElementType, PropValidators } from '@instructure/shared-types';
3
+ declare type PresentationContentOwnProps = {
4
+ /**
5
+ * the element type to render as
6
+ */
7
+ as: AsElementType;
8
+ children?: React.ReactNode;
9
+ };
10
+ declare type PropKeys = keyof PresentationContentOwnProps;
11
+ declare type AllowedPropKeys = Readonly<PropKeys[]>;
12
+ declare type PresentationContentProps = PresentationContentOwnProps;
13
+ declare const propTypes: PropValidators<PropKeys>;
14
+ declare const allowedProps: AllowedPropKeys;
15
+ export type { PresentationContentProps };
16
+ export { propTypes, allowedProps };
17
+ //# sourceMappingURL=props.d.ts.map
@@ -0,0 +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,9 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { Component } from 'react';
3
- import PropTypes from 'prop-types';
4
- import { OtherHTMLAttributes } from '@instructure/shared-types';
5
3
  import { jsx } from '@instructure/emotion';
6
- import { ScreenReaderContentProps } from './types';
4
+ import type { ScreenReaderContentProps } from './props';
7
5
  /**
8
6
  ---
9
7
  category: components/utilities
@@ -11,17 +9,19 @@ category: components/utilities
11
9
  @module ScreenReaderContent
12
10
  @tsProps
13
11
  **/
14
- declare class ScreenReaderContent extends Component<ScreenReaderContentProps & OtherHTMLAttributes<ScreenReaderContentProps>> {
12
+ declare class ScreenReaderContent extends Component<ScreenReaderContentProps> {
15
13
  static readonly componentId = "ScreenReaderContent";
16
- static propTypes: {
17
- makeStyles: PropTypes.Requireable<(...args: any[]) => any>;
18
- styles: PropTypes.Requireable<object>;
19
- as: PropTypes.Requireable<PropTypes.ReactComponentLike>;
20
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
21
- };
14
+ static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
15
+ as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
16
+ children?: import("react").ReactNode;
17
+ }>;
18
+ static allowedProps: readonly (keyof {
19
+ as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
20
+ children?: import("react").ReactNode;
21
+ })[];
22
22
  static defaultProps: {
23
- as: string;
24
- children: null;
23
+ readonly as: "span";
24
+ readonly children: null;
25
25
  };
26
26
  componentDidMount(): void;
27
27
  componentDidUpdate(): void;
@@ -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;AACjC,OAAO,SAAS,MAAM,YAAY,CAAA;AAGlC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAE/D,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAGrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAElD;;;;;;GAMG;AACH,cACM,mBAAoB,SAAQ,SAAS,CACzC,wBAAwB,GAAG,mBAAmB,CAAC,wBAAwB,CAAC,CACzE;IACC,MAAM,CAAC,QAAQ,CAAC,WAAW,yBAAwB;IAEnD,MAAM,CAAC,SAAS;;;;;MAOf;IAED,MAAM,CAAC,YAAY;;;MAGlB;IAED,iBAAiB;IAKjB,kBAAkB;IAKlB,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,iBAAiB;IAIjB,kBAAkB;IAIlB,MAAM;CAaP;AAED,eAAe,mBAAmB,CAAA;AAClC,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
@@ -0,0 +1,21 @@
1
+ import { ReactNode } from 'react';
2
+ import type { AsElementType, OtherHTMLAttributes, PropValidators } from '@instructure/shared-types';
3
+ import type { WithStyleProps } from '@instructure/emotion';
4
+ declare type ScreenReaderContentOwnProps = {
5
+ /**
6
+ * the element type to render as
7
+ */
8
+ as?: AsElementType;
9
+ /**
10
+ * content meant for screen readers only
11
+ */
12
+ children?: ReactNode;
13
+ };
14
+ declare type PropKeys = keyof ScreenReaderContentOwnProps;
15
+ declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
16
+ declare type ScreenReaderContentProps = ScreenReaderContentOwnProps & OtherHTMLAttributes<ScreenReaderContentOwnProps> & WithStyleProps;
17
+ declare const propTypes: PropValidators<PropKeys>;
18
+ declare const allowedProps: AllowedPropKeys;
19
+ export type { ScreenReaderContentProps };
20
+ export { propTypes, allowedProps };
21
+ //# sourceMappingURL=props.d.ts.map
@@ -0,0 +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,MAAM,sBAAsB,CAAA;AAE1D,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,CAAA;AAEhB,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"}
package/types/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { AccessibleContent } from './AccessibleContent';
2
2
  export { PresentationContent } from './PresentationContent';
3
3
  export { ScreenReaderContent } from './ScreenReaderContent';
4
- export type { AccessibleContentProps } from './AccessibleContent/types';
5
- export type { PresentationContentProps } from './PresentationContent/types';
6
- export type { ScreenReaderContentProps } from './ScreenReaderContent/types';
4
+ export type { AccessibleContentProps } from './AccessibleContent/props';
5
+ export type { PresentationContentProps } from './PresentationContent/props';
6
+ export type { ScreenReaderContentProps } from './ScreenReaderContent/props';
7
7
  //# sourceMappingURL=index.d.ts.map
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.
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- "use strict";
@@ -1 +0,0 @@
1
- "use strict";
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,10 +0,0 @@
1
- import { PropsWithChildren } from 'react';
2
- import { AsElementType } from '@instructure/shared-types';
3
- export declare type AccessibleContentProps = PropsWithChildren<{
4
- alt?: string;
5
- /**
6
- * the element type to render the screen reader content as
7
- */
8
- as: AsElementType;
9
- }>;
10
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/AccessibleContent/types.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAEzD,oBAAY,sBAAsB,GAAG,iBAAiB,CAAC;IACrD,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,EAAE,EAAE,aAAa,CAAA;CAClB,CAAC,CAAA"}
@@ -1,9 +0,0 @@
1
- import { AsElementType } from '@instructure/shared-types';
2
- import { PropsWithChildren } from 'react';
3
- export declare type PresentationContentProps = PropsWithChildren<{
4
- /**
5
- * the element type to render as
6
- */
7
- as: AsElementType;
8
- }>;
9
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/PresentationContent/types.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAEzC,oBAAY,wBAAwB,GAAG,iBAAiB,CAAC;IACvD;;OAEG;IACH,EAAE,EAAE,aAAa,CAAA;CAClB,CAAC,CAAA"}
@@ -1,15 +0,0 @@
1
- import { AsElementType } from '@instructure/shared-types';
2
- import { PropsWithChildren, ReactNode } from 'react';
3
- export declare type ScreenReaderContentProps = PropsWithChildren<{
4
- makeStyles?: (...args: any[]) => any;
5
- styles?: any;
6
- /**
7
- * the element type to render as
8
- */
9
- as: AsElementType;
10
- /**
11
- * content meant for screen readers only
12
- */
13
- children: ReactNode;
14
- }>;
15
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ScreenReaderContent/types.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEpD,oBAAY,wBAAwB,GAAG,iBAAiB,CAAC;IACvD,UAAU,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACpC,MAAM,CAAC,EAAE,GAAG,CAAA;IACZ;;OAEG;IACH,EAAE,EAAE,aAAa,CAAA;IACjB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAA;CACpB,CAAC,CAAA"}