@instructure/ui-breadcrumb 8.8.1-snapshot.7 → 8.9.1-snapshot.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/es/Breadcrumb/BreadcrumbLink/index.js +2 -38
  3. package/{src/Breadcrumb/types.ts → es/Breadcrumb/BreadcrumbLink/props.js} +32 -8
  4. package/es/Breadcrumb/index.js +7 -36
  5. package/{src/Breadcrumb/BreadcrumbLink/types.ts → es/Breadcrumb/props.js} +27 -8
  6. package/lib/Breadcrumb/BreadcrumbLink/index.js +3 -41
  7. package/lib/Breadcrumb/BreadcrumbLink/props.js +68 -0
  8. package/lib/Breadcrumb/index.js +7 -37
  9. package/lib/Breadcrumb/props.js +66 -0
  10. package/package.json +16 -16
  11. package/src/Breadcrumb/BreadcrumbLink/index.tsx +6 -36
  12. package/src/Breadcrumb/BreadcrumbLink/props.ts +82 -0
  13. package/src/Breadcrumb/index.tsx +10 -34
  14. package/src/Breadcrumb/props.ts +72 -0
  15. package/src/Breadcrumb/styles.ts +1 -1
  16. package/src/index.ts +2 -2
  17. package/types/Breadcrumb/BreadcrumbLink/index.d.ts +19 -36
  18. package/types/Breadcrumb/BreadcrumbLink/index.d.ts.map +1 -1
  19. package/types/Breadcrumb/BreadcrumbLink/props.d.ts +18 -0
  20. package/types/Breadcrumb/BreadcrumbLink/props.d.ts.map +1 -0
  21. package/types/Breadcrumb/index.d.ts +14 -29
  22. package/types/Breadcrumb/index.d.ts.map +1 -1
  23. package/types/Breadcrumb/props.d.ts +17 -0
  24. package/types/Breadcrumb/props.d.ts.map +1 -0
  25. package/types/Breadcrumb/styles.d.ts +1 -1
  26. package/types/index.d.ts +2 -2
  27. package/es/Breadcrumb/BreadcrumbLink/types.js +0 -1
  28. package/es/Breadcrumb/types.js +0 -1
  29. package/lib/Breadcrumb/BreadcrumbLink/types.js +0 -1
  30. package/lib/Breadcrumb/types.js +0 -1
  31. package/types/Breadcrumb/BreadcrumbLink/types.d.ts +0 -9
  32. package/types/Breadcrumb/BreadcrumbLink/types.d.ts.map +0 -1
  33. package/types/Breadcrumb/types.d.ts +0 -9
  34. package/types/Breadcrumb/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-breadcrumb
@@ -24,11 +24,11 @@ var _dec, _class, _class2, _temp;
24
24
  * SOFTWARE.
25
25
  */
26
26
  import React, { Component } from 'react';
27
- import PropTypes from 'prop-types';
28
27
  import { TruncateText } from '@instructure/ui-truncate-text';
29
28
  import { Link } from '@instructure/ui-link';
30
29
  import { omitProps } from '@instructure/ui-react-utils';
31
30
  import { testable } from '@instructure/ui-testable';
31
+ import { propTypes, allowedProps } from './props';
32
32
 
33
33
  /**
34
34
  ---
@@ -56,42 +56,6 @@ let BreadcrumbLink = (_dec = testable(), _dec(_class = (_temp = _class2 = class
56
56
  }), /*#__PURE__*/React.createElement(TruncateText, null, children));
57
57
  }
58
58
 
59
- }, _class2.displayName = "BreadcrumbLink", _class2.componentId = 'Breadcrumb.Link', _class2.propTypes = {
60
- /**
61
- * Content to render as the crumb, generally should be text.
62
- */
63
- children: PropTypes.node.isRequired,
64
-
65
- /**
66
- * Link the crumb should direct to; if an href is provided, the crumb will render as a link
67
- */
68
- href: PropTypes.string,
69
-
70
- /**
71
- * If the Breadcrumb.Link has an onClick prop (and no href), it will render as a button
72
- */
73
- onClick: PropTypes.func,
74
-
75
- /**
76
- * Sets the font-size of the breadcrumb text
77
- */
78
- size: PropTypes.oneOf(['small', 'medium', 'large']),
79
-
80
- /**
81
- * Add an icon to the Breadcrumb.Link
82
- */
83
- renderIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
84
-
85
- /**
86
- * Place the icon before or after the text in the Breadcrumb.Link
87
- */
88
- iconPlacement: PropTypes.oneOf(['start', 'end'])
89
- }, _class2.defaultProps = {
90
- href: void 0,
91
- onClick: void 0,
92
- size: void 0,
93
- renderIcon: void 0,
94
- iconPlacement: void 0
95
- }, _temp)) || _class);
59
+ }, _class2.displayName = "BreadcrumbLink", _class2.componentId = 'Breadcrumb.Link', _class2.propTypes = propTypes, _class2.allowedProps = allowedProps, _class2.defaultProps = {}, _temp)) || _class);
96
60
  export default BreadcrumbLink;
97
61
  export { BreadcrumbLink };
@@ -21,13 +21,37 @@
21
21
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
  * SOFTWARE.
23
23
  */
24
+ import PropTypes from 'prop-types';
25
+ const propTypes = {
26
+ /**
27
+ * Content to render as the crumb, generally should be text.
28
+ */
29
+ children: PropTypes.node.isRequired,
24
30
 
25
- import type { Spacing } from '@instructure/emotion'
31
+ /**
32
+ * Link the crumb should direct to; if an href is provided, the crumb will render as a link
33
+ */
34
+ href: PropTypes.string,
26
35
 
27
- export type BreadcrumbProps = {
28
- makeStyles?: (...args: any[]) => any
29
- styles?: any
30
- label: string
31
- size?: 'small' | 'medium' | 'large'
32
- margin?: Spacing
33
- }
36
+ /**
37
+ * If the Breadcrumb.Link has an onClick prop (and no href), it will render as a button
38
+ */
39
+ onClick: PropTypes.func,
40
+
41
+ /**
42
+ * Sets the font-size of the breadcrumb text
43
+ */
44
+ size: PropTypes.oneOf(['small', 'medium', 'large']),
45
+
46
+ /**
47
+ * Add an icon to the Breadcrumb.Link
48
+ */
49
+ renderIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
50
+
51
+ /**
52
+ * Place the icon before or after the text in the Breadcrumb.Link
53
+ */
54
+ iconPlacement: PropTypes.oneOf(['start', 'end'])
55
+ };
56
+ const allowedProps = ['children', 'href', 'iconPlacement', 'onClick', 'renderIcon', 'size'];
57
+ export { propTypes, allowedProps };
@@ -26,15 +26,14 @@ var _dec, _dec2, _class, _class2, _temp;
26
26
 
27
27
  /** @jsx jsx */
28
28
  import React, { Component } from 'react';
29
- import PropTypes from 'prop-types';
30
29
  import { View } from '@instructure/ui-view';
31
30
  import { IconArrowOpenEndSolid } from '@instructure/ui-icons';
32
- import { Children } from '@instructure/ui-prop-types';
33
31
  import { testable } from '@instructure/ui-testable';
34
- import { withStyle, jsx, ThemeablePropTypes } from '@instructure/emotion';
32
+ import { withStyle, jsx } from '@instructure/emotion';
35
33
  import { BreadcrumbLink } from './BreadcrumbLink';
36
34
  import generateStyle from './styles';
37
35
  import generateComponentTheme from './theme';
36
+ import { propTypes, allowedProps } from './props';
38
37
 
39
38
  /**
40
39
  ---
@@ -60,11 +59,11 @@ let Breadcrumb = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2
60
59
  };
61
60
  return React.Children.map(children, (child, index) => {
62
61
  return jsx("li", {
63
- css: styles.crumb,
62
+ css: styles === null || styles === void 0 ? void 0 : styles.crumb,
64
63
  style: inlineStyle
65
64
  }, child, index < numChildren - 1 && jsx(IconArrowOpenEndSolid, {
66
65
  color: "auto",
67
- css: styles.separator
66
+ css: styles === null || styles === void 0 ? void 0 : styles.separator
68
67
  }));
69
68
  });
70
69
  }
@@ -77,41 +76,13 @@ let Breadcrumb = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2
77
76
  margin: this.props.margin,
78
77
  "aria-label": this.props.label
79
78
  }, jsx("ol", {
80
- css: styles.breadcrumb
79
+ css: styles === null || styles === void 0 ? void 0 : styles.breadcrumb
81
80
  }, this.renderChildren()));
82
81
  }
83
82
 
84
- }, _class2.displayName = "Breadcrumb", _class2.componentId = 'Breadcrumb', _class2.propTypes = {
85
- // eslint-disable-next-line react/require-default-props
86
- makeStyles: PropTypes.func,
87
- // eslint-disable-next-line react/require-default-props
88
- styles: PropTypes.object,
89
-
90
- /**
91
- * children of type Breadcrumb.Link
92
- */
93
- children: Children.oneOf([BreadcrumbLink]),
94
-
95
- /**
96
- * An accessible label for the navigation
97
- */
98
- label: PropTypes.string.isRequired,
99
-
100
- /**
101
- * Sets the font-size of the breadcrumb text
102
- */
103
- size: PropTypes.oneOf(['small', 'medium', 'large']),
104
-
105
- /**
106
- * Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
107
- * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
108
- * familiar CSS-like shorthand. For example: `margin="small auto large"`.
109
- */
110
- margin: ThemeablePropTypes.spacing
111
- }, _class2.defaultProps = {
83
+ }, _class2.displayName = "Breadcrumb", _class2.componentId = 'Breadcrumb', _class2.propTypes = propTypes, _class2.allowedProps = allowedProps, _class2.defaultProps = {
112
84
  size: 'medium',
113
- children: null,
114
- margin: void 0
85
+ children: null
115
86
  }, _class2.Link = BreadcrumbLink, _temp)) || _class) || _class);
116
87
  export default Breadcrumb;
117
88
  export { Breadcrumb, BreadcrumbLink };
@@ -21,13 +21,32 @@
21
21
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
  * SOFTWARE.
23
23
  */
24
+ import PropTypes from 'prop-types';
25
+ import { Children } from '@instructure/ui-prop-types';
26
+ import { ThemeablePropTypes } from '@instructure/emotion';
27
+ import { BreadcrumbLink } from './BreadcrumbLink';
28
+ const propTypes = {
29
+ /**
30
+ * children of type Breadcrumb.Link
31
+ */
32
+ children: Children.oneOf([BreadcrumbLink]),
24
33
 
25
- import React from 'react'
34
+ /**
35
+ * An accessible label for the navigation
36
+ */
37
+ label: PropTypes.string.isRequired,
26
38
 
27
- export type BreadcrumbLinkProps = {
28
- href?: string
29
- onClick?: (...args: any[]) => any
30
- size?: 'small' | 'medium' | 'large'
31
- renderIcon?: React.ReactNode | ((...args: any[]) => any)
32
- iconPlacement?: 'start' | 'end'
33
- }
39
+ /**
40
+ * Sets the font-size of the breadcrumb text
41
+ */
42
+ size: PropTypes.oneOf(['small', 'medium', 'large']),
43
+
44
+ /**
45
+ * Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
46
+ * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
47
+ * familiar CSS-like shorthand. For example: `margin="small auto large"`.
48
+ */
49
+ margin: ThemeablePropTypes.spacing
50
+ };
51
+ const allowedProps = ['children', 'label', 'margin', 'size'];
52
+ export { propTypes, allowedProps };
@@ -2,8 +2,6 @@
2
2
 
3
3
  var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
4
 
5
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
@@ -11,8 +9,6 @@ exports.BreadcrumbLink = exports.default = void 0;
11
9
 
12
10
  var _react = _interopRequireWildcard(require("react"));
13
11
 
14
- var _propTypes = _interopRequireDefault(require("prop-types"));
15
-
16
12
  var _TruncateText = require("@instructure/ui-truncate-text/lib/TruncateText");
17
13
 
18
14
  var _Link = require("@instructure/ui-link/lib/Link");
@@ -21,6 +17,8 @@ var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
21
17
 
22
18
  var _testable = require("@instructure/ui-testable/lib/testable.js");
23
19
 
20
+ var _props = require("./props");
21
+
24
22
  var _dec, _class, _class2, _temp;
25
23
 
26
24
  /**
@@ -49,43 +47,7 @@ let BreadcrumbLink = (_dec = (0, _testable.testable)(), _dec(_class = (_temp = _
49
47
  }), /*#__PURE__*/_react.default.createElement(_TruncateText.TruncateText, null, children));
50
48
  }
51
49
 
52
- }, _class2.displayName = "BreadcrumbLink", _class2.componentId = 'Breadcrumb.Link', _class2.propTypes = {
53
- /**
54
- * Content to render as the crumb, generally should be text.
55
- */
56
- children: _propTypes.default.node.isRequired,
57
-
58
- /**
59
- * Link the crumb should direct to; if an href is provided, the crumb will render as a link
60
- */
61
- href: _propTypes.default.string,
62
-
63
- /**
64
- * If the Breadcrumb.Link has an onClick prop (and no href), it will render as a button
65
- */
66
- onClick: _propTypes.default.func,
67
-
68
- /**
69
- * Sets the font-size of the breadcrumb text
70
- */
71
- size: _propTypes.default.oneOf(['small', 'medium', 'large']),
72
-
73
- /**
74
- * Add an icon to the Breadcrumb.Link
75
- */
76
- renderIcon: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
77
-
78
- /**
79
- * Place the icon before or after the text in the Breadcrumb.Link
80
- */
81
- iconPlacement: _propTypes.default.oneOf(['start', 'end'])
82
- }, _class2.defaultProps = {
83
- href: void 0,
84
- onClick: void 0,
85
- size: void 0,
86
- renderIcon: void 0,
87
- iconPlacement: void 0
88
- }, _temp)) || _class);
50
+ }, _class2.displayName = "BreadcrumbLink", _class2.componentId = 'Breadcrumb.Link', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {}, _temp)) || _class);
89
51
  exports.BreadcrumbLink = BreadcrumbLink;
90
52
  var _default = BreadcrumbLink;
91
53
  exports.default = _default;
@@ -0,0 +1,68 @@
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
+ /**
37
+ * Content to render as the crumb, generally should be text.
38
+ */
39
+ children: _propTypes.default.node.isRequired,
40
+
41
+ /**
42
+ * Link the crumb should direct to; if an href is provided, the crumb will render as a link
43
+ */
44
+ href: _propTypes.default.string,
45
+
46
+ /**
47
+ * If the Breadcrumb.Link has an onClick prop (and no href), it will render as a button
48
+ */
49
+ onClick: _propTypes.default.func,
50
+
51
+ /**
52
+ * Sets the font-size of the breadcrumb text
53
+ */
54
+ size: _propTypes.default.oneOf(['small', 'medium', 'large']),
55
+
56
+ /**
57
+ * Add an icon to the Breadcrumb.Link
58
+ */
59
+ renderIcon: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
60
+
61
+ /**
62
+ * Place the icon before or after the text in the Breadcrumb.Link
63
+ */
64
+ iconPlacement: _propTypes.default.oneOf(['start', 'end'])
65
+ };
66
+ exports.propTypes = propTypes;
67
+ const allowedProps = ['children', 'href', 'iconPlacement', 'onClick', 'renderIcon', 'size'];
68
+ exports.allowedProps = allowedProps;
@@ -17,14 +17,10 @@ exports.Breadcrumb = exports.default = void 0;
17
17
 
18
18
  var _react = _interopRequireWildcard(require("react"));
19
19
 
20
- var _propTypes = _interopRequireDefault(require("prop-types"));
21
-
22
20
  var _View = require("@instructure/ui-view/lib/View");
23
21
 
24
22
  var _IconArrowOpenEndSolid = require("@instructure/ui-icons/lib/IconArrowOpenEndSolid.js");
25
23
 
26
- var _Children = require("@instructure/ui-prop-types/lib/Children.js");
27
-
28
24
  var _testable = require("@instructure/ui-testable/lib/testable.js");
29
25
 
30
26
  var _emotion = require("@instructure/emotion");
@@ -35,6 +31,8 @@ var _styles = _interopRequireDefault(require("./styles"));
35
31
 
36
32
  var _theme = _interopRequireDefault(require("./theme"));
37
33
 
34
+ var _props = require("./props");
35
+
38
36
  var _dec, _dec2, _class, _class2, _temp;
39
37
 
40
38
  /**
@@ -61,11 +59,11 @@ let Breadcrumb = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default
61
59
  };
62
60
  return _react.default.Children.map(children, (child, index) => {
63
61
  return (0, _emotion.jsx)("li", {
64
- css: styles.crumb,
62
+ css: styles === null || styles === void 0 ? void 0 : styles.crumb,
65
63
  style: inlineStyle
66
64
  }, child, index < numChildren - 1 && (0, _emotion.jsx)(_IconArrowOpenEndSolid.IconArrowOpenEndSolid, {
67
65
  color: "auto",
68
- css: styles.separator
66
+ css: styles === null || styles === void 0 ? void 0 : styles.separator
69
67
  }));
70
68
  });
71
69
  }
@@ -78,41 +76,13 @@ let Breadcrumb = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default
78
76
  margin: this.props.margin,
79
77
  "aria-label": this.props.label
80
78
  }, (0, _emotion.jsx)("ol", {
81
- css: styles.breadcrumb
79
+ css: styles === null || styles === void 0 ? void 0 : styles.breadcrumb
82
80
  }, this.renderChildren()));
83
81
  }
84
82
 
85
- }, _class2.displayName = "Breadcrumb", _class2.componentId = 'Breadcrumb', _class2.propTypes = {
86
- // eslint-disable-next-line react/require-default-props
87
- makeStyles: _propTypes.default.func,
88
- // eslint-disable-next-line react/require-default-props
89
- styles: _propTypes.default.object,
90
-
91
- /**
92
- * children of type Breadcrumb.Link
93
- */
94
- children: _Children.Children.oneOf([_BreadcrumbLink.BreadcrumbLink]),
95
-
96
- /**
97
- * An accessible label for the navigation
98
- */
99
- label: _propTypes.default.string.isRequired,
100
-
101
- /**
102
- * Sets the font-size of the breadcrumb text
103
- */
104
- size: _propTypes.default.oneOf(['small', 'medium', 'large']),
105
-
106
- /**
107
- * Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
108
- * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
109
- * familiar CSS-like shorthand. For example: `margin="small auto large"`.
110
- */
111
- margin: _emotion.ThemeablePropTypes.spacing
112
- }, _class2.defaultProps = {
83
+ }, _class2.displayName = "Breadcrumb", _class2.componentId = 'Breadcrumb', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {
113
84
  size: 'medium',
114
- children: null,
115
- margin: void 0
85
+ children: null
116
86
  }, _class2.Link = _BreadcrumbLink.BreadcrumbLink, _temp)) || _class) || _class);
117
87
  exports.Breadcrumb = Breadcrumb;
118
88
  var _default = Breadcrumb;
@@ -0,0 +1,66 @@
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
+ var _Children = require("@instructure/ui-prop-types/lib/Children.js");
13
+
14
+ var _emotion = require("@instructure/emotion");
15
+
16
+ var _BreadcrumbLink = require("./BreadcrumbLink");
17
+
18
+ /*
19
+ * The MIT License (MIT)
20
+ *
21
+ * Copyright (c) 2015 - present Instructure, Inc.
22
+ *
23
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
24
+ * of this software and associated documentation files (the "Software"), to deal
25
+ * in the Software without restriction, including without limitation the rights
26
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
27
+ * copies of the Software, and to permit persons to whom the Software is
28
+ * furnished to do so, subject to the following conditions:
29
+ *
30
+ * The above copyright notice and this permission notice shall be included in all
31
+ * copies or substantial portions of the Software.
32
+ *
33
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
36
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
37
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
38
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
39
+ * SOFTWARE.
40
+ */
41
+ const propTypes = {
42
+ /**
43
+ * children of type Breadcrumb.Link
44
+ */
45
+ children: _Children.Children.oneOf([_BreadcrumbLink.BreadcrumbLink]),
46
+
47
+ /**
48
+ * An accessible label for the navigation
49
+ */
50
+ label: _propTypes.default.string.isRequired,
51
+
52
+ /**
53
+ * Sets the font-size of the breadcrumb text
54
+ */
55
+ size: _propTypes.default.oneOf(['small', 'medium', 'large']),
56
+
57
+ /**
58
+ * Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
59
+ * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
60
+ * familiar CSS-like shorthand. For example: `margin="small auto large"`.
61
+ */
62
+ margin: _emotion.ThemeablePropTypes.spacing
63
+ };
64
+ exports.propTypes = propTypes;
65
+ const allowedProps = ['children', 'label', 'margin', 'size'];
66
+ exports.allowedProps = allowedProps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-breadcrumb",
3
- "version": "8.8.1-snapshot.7+90b251d58",
3
+ "version": "8.9.1-snapshot.2+7f5faa3df",
4
4
  "description": "A breadcrumb component",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "type": "commonjs",
@@ -24,23 +24,23 @@
24
24
  },
25
25
  "license": "MIT",
26
26
  "devDependencies": {
27
- "@instructure/shared-types": "8.8.1-snapshot.7+90b251d58",
28
- "@instructure/ui-babel-preset": "8.8.1-snapshot.7+90b251d58",
29
- "@instructure/ui-test-locator": "8.8.1-snapshot.7+90b251d58",
30
- "@instructure/ui-test-utils": "8.8.1-snapshot.7+90b251d58",
31
- "@instructure/ui-themes": "8.8.1-snapshot.7+90b251d58"
27
+ "@instructure/ui-babel-preset": "8.9.1-snapshot.2+7f5faa3df",
28
+ "@instructure/ui-test-locator": "8.9.1-snapshot.2+7f5faa3df",
29
+ "@instructure/ui-test-utils": "8.9.1-snapshot.2+7f5faa3df",
30
+ "@instructure/ui-themes": "8.9.1-snapshot.2+7f5faa3df"
32
31
  },
33
32
  "dependencies": {
34
33
  "@babel/runtime": "^7.13.10",
35
- "@instructure/emotion": "8.8.1-snapshot.7+90b251d58",
36
- "@instructure/ui-icons": "8.8.1-snapshot.7+90b251d58",
37
- "@instructure/ui-link": "8.8.1-snapshot.7+90b251d58",
38
- "@instructure/ui-prop-types": "8.8.1-snapshot.7+90b251d58",
39
- "@instructure/ui-react-utils": "8.8.1-snapshot.7+90b251d58",
40
- "@instructure/ui-testable": "8.8.1-snapshot.7+90b251d58",
41
- "@instructure/ui-truncate-text": "8.8.1-snapshot.7+90b251d58",
42
- "@instructure/ui-utils": "8.8.1-snapshot.7+90b251d58",
43
- "@instructure/ui-view": "8.8.1-snapshot.7+90b251d58",
34
+ "@instructure/emotion": "8.9.1-snapshot.2+7f5faa3df",
35
+ "@instructure/shared-types": "8.9.1-snapshot.2+7f5faa3df",
36
+ "@instructure/ui-icons": "8.9.1-snapshot.2+7f5faa3df",
37
+ "@instructure/ui-link": "8.9.1-snapshot.2+7f5faa3df",
38
+ "@instructure/ui-prop-types": "8.9.1-snapshot.2+7f5faa3df",
39
+ "@instructure/ui-react-utils": "8.9.1-snapshot.2+7f5faa3df",
40
+ "@instructure/ui-testable": "8.9.1-snapshot.2+7f5faa3df",
41
+ "@instructure/ui-truncate-text": "8.9.1-snapshot.2+7f5faa3df",
42
+ "@instructure/ui-utils": "8.9.1-snapshot.2+7f5faa3df",
43
+ "@instructure/ui-view": "8.9.1-snapshot.2+7f5faa3df",
44
44
  "prop-types": "^15"
45
45
  },
46
46
  "peerDependencies": {
@@ -50,5 +50,5 @@
50
50
  "access": "public"
51
51
  },
52
52
  "sideEffects": false,
53
- "gitHead": "90b251d580c75205b6cbb884fe922059cfc494dd"
53
+ "gitHead": "7f5faa3df83667636304e0901ef1008d98dffc9a"
54
54
  }
@@ -23,13 +23,14 @@
23
23
  */
24
24
 
25
25
  import React, { Component } from 'react'
26
- import PropTypes from 'prop-types'
27
26
 
28
27
  import { TruncateText } from '@instructure/ui-truncate-text'
29
28
  import { Link } from '@instructure/ui-link'
30
29
  import { omitProps } from '@instructure/ui-react-utils'
31
30
  import { testable } from '@instructure/ui-testable'
32
- import { BreadcrumbLinkProps } from './types'
31
+
32
+ import { propTypes, allowedProps } from './props'
33
+ import type { BreadcrumbLinkProps } from './props'
33
34
 
34
35
  /**
35
36
  ---
@@ -42,40 +43,9 @@ id: Breadcrumb.Link
42
43
  class BreadcrumbLink extends Component<BreadcrumbLinkProps> {
43
44
  static readonly componentId = 'Breadcrumb.Link'
44
45
 
45
- static propTypes = {
46
- /**
47
- * Content to render as the crumb, generally should be text.
48
- */
49
- children: PropTypes.node.isRequired,
50
- /**
51
- * Link the crumb should direct to; if an href is provided, the crumb will render as a link
52
- */
53
- href: PropTypes.string,
54
- /**
55
- * If the Breadcrumb.Link has an onClick prop (and no href), it will render as a button
56
- */
57
- onClick: PropTypes.func,
58
- /**
59
- * Sets the font-size of the breadcrumb text
60
- */
61
- size: PropTypes.oneOf(['small', 'medium', 'large']),
62
- /**
63
- * Add an icon to the Breadcrumb.Link
64
- */
65
- renderIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
66
- /**
67
- * Place the icon before or after the text in the Breadcrumb.Link
68
- */
69
- iconPlacement: PropTypes.oneOf(['start', 'end'])
70
- }
71
-
72
- static defaultProps = {
73
- href: undefined,
74
- onClick: undefined,
75
- size: undefined,
76
- renderIcon: undefined,
77
- iconPlacement: undefined
78
- }
46
+ static propTypes = propTypes
47
+ static allowedProps = allowedProps
48
+ static defaultProps = {}
79
49
 
80
50
  render() {
81
51
  const { children, href, renderIcon, iconPlacement, onClick } = this.props
@@ -0,0 +1,82 @@
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 { PropValidators } from '@instructure/shared-types'
29
+
30
+ type BreadcrumbLinkOwnProps = {
31
+ children: React.ReactNode
32
+ href?: string
33
+ onClick?: (...args: any[]) => any
34
+ size?: 'small' | 'medium' | 'large'
35
+ renderIcon?: React.ReactNode | ((...args: any[]) => any)
36
+ iconPlacement?: 'start' | 'end'
37
+ }
38
+
39
+ type PropKeys = keyof BreadcrumbLinkOwnProps
40
+
41
+ type AllowedPropKeys = Readonly<Array<PropKeys>>
42
+
43
+ type BreadcrumbLinkProps = BreadcrumbLinkOwnProps
44
+
45
+ const propTypes: PropValidators<PropKeys> = {
46
+ /**
47
+ * Content to render as the crumb, generally should be text.
48
+ */
49
+ children: PropTypes.node.isRequired,
50
+ /**
51
+ * Link the crumb should direct to; if an href is provided, the crumb will render as a link
52
+ */
53
+ href: PropTypes.string,
54
+ /**
55
+ * If the Breadcrumb.Link has an onClick prop (and no href), it will render as a button
56
+ */
57
+ onClick: PropTypes.func,
58
+ /**
59
+ * Sets the font-size of the breadcrumb text
60
+ */
61
+ size: PropTypes.oneOf(['small', 'medium', 'large']),
62
+ /**
63
+ * Add an icon to the Breadcrumb.Link
64
+ */
65
+ renderIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
66
+ /**
67
+ * Place the icon before or after the text in the Breadcrumb.Link
68
+ */
69
+ iconPlacement: PropTypes.oneOf(['start', 'end'])
70
+ }
71
+
72
+ const allowedProps: AllowedPropKeys = [
73
+ 'children',
74
+ 'href',
75
+ 'iconPlacement',
76
+ 'onClick',
77
+ 'renderIcon',
78
+ 'size'
79
+ ]
80
+
81
+ export type { BreadcrumbLinkProps }
82
+ export { propTypes, allowedProps }
@@ -24,19 +24,19 @@
24
24
 
25
25
  /** @jsx jsx */
26
26
  import React, { Component } from 'react'
27
- import PropTypes from 'prop-types'
28
27
 
29
28
  import { View } from '@instructure/ui-view'
30
29
  import { IconArrowOpenEndSolid } from '@instructure/ui-icons'
31
- import { Children } from '@instructure/ui-prop-types'
32
30
  import { testable } from '@instructure/ui-testable'
33
31
 
34
- import { withStyle, jsx, ThemeablePropTypes } from '@instructure/emotion'
32
+ import { withStyle, jsx } from '@instructure/emotion'
35
33
  import { BreadcrumbLink } from './BreadcrumbLink'
36
34
 
37
35
  import generateStyle from './styles'
38
36
  import generateComponentTheme from './theme'
39
- import { BreadcrumbProps } from './types'
37
+
38
+ import { propTypes, allowedProps } from './props'
39
+ import type { BreadcrumbProps } from './props'
40
40
 
41
41
  /**
42
42
  ---
@@ -49,35 +49,11 @@ category: components
49
49
  class Breadcrumb extends Component<BreadcrumbProps> {
50
50
  static readonly componentId = 'Breadcrumb'
51
51
 
52
- static propTypes = {
53
- // eslint-disable-next-line react/require-default-props
54
- makeStyles: PropTypes.func,
55
- // eslint-disable-next-line react/require-default-props
56
- styles: PropTypes.object,
57
- /**
58
- * children of type Breadcrumb.Link
59
- */
60
- children: Children.oneOf([BreadcrumbLink]),
61
- /**
62
- * An accessible label for the navigation
63
- */
64
- label: PropTypes.string.isRequired,
65
- /**
66
- * Sets the font-size of the breadcrumb text
67
- */
68
- size: PropTypes.oneOf(['small', 'medium', 'large']),
69
- /**
70
- * Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
71
- * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
72
- * familiar CSS-like shorthand. For example: `margin="small auto large"`.
73
- */
74
- margin: ThemeablePropTypes.spacing
75
- }
76
-
52
+ static propTypes = propTypes
53
+ static allowedProps = allowedProps
77
54
  static defaultProps = {
78
55
  size: 'medium',
79
- children: null,
80
- margin: undefined
56
+ children: null
81
57
  }
82
58
 
83
59
  componentDidMount() {
@@ -102,10 +78,10 @@ class Breadcrumb extends Component<BreadcrumbProps> {
102
78
  }
103
79
  return React.Children.map(children, (child, index) => {
104
80
  return (
105
- <li css={styles.crumb} style={inlineStyle}>
81
+ <li css={styles?.crumb} style={inlineStyle}>
106
82
  {child}
107
83
  {index < numChildren - 1 && (
108
- <IconArrowOpenEndSolid color="auto" css={styles.separator} />
84
+ <IconArrowOpenEndSolid color="auto" css={styles?.separator} />
109
85
  )}
110
86
  </li>
111
87
  )
@@ -122,7 +98,7 @@ class Breadcrumb extends Component<BreadcrumbProps> {
122
98
  margin={this.props.margin}
123
99
  aria-label={this.props.label}
124
100
  >
125
- <ol css={styles.breadcrumb}>{this.renderChildren()}</ol>
101
+ <ol css={styles?.breadcrumb}>{this.renderChildren()}</ol>
126
102
  </View>
127
103
  )
128
104
  }
@@ -0,0 +1,72 @@
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 { Children } from '@instructure/ui-prop-types'
28
+ import { ThemeablePropTypes } from '@instructure/emotion'
29
+
30
+ import { BreadcrumbLink } from './BreadcrumbLink'
31
+
32
+ import type { Spacing, WithStyleProps } from '@instructure/emotion'
33
+ import type { PropValidators } from '@instructure/shared-types'
34
+
35
+ type BreadcrumbOwnProps = {
36
+ children?: React.ReactNode // TODO: oneOf([BreadcrumbLink])
37
+ label: string
38
+ size?: 'small' | 'medium' | 'large'
39
+ margin?: Spacing
40
+ }
41
+
42
+ type PropKeys = keyof BreadcrumbOwnProps
43
+
44
+ type AllowedPropKeys = Readonly<Array<PropKeys>>
45
+
46
+ type BreadcrumbProps = BreadcrumbOwnProps & WithStyleProps
47
+
48
+ const propTypes: PropValidators<PropKeys> = {
49
+ /**
50
+ * children of type Breadcrumb.Link
51
+ */
52
+ children: Children.oneOf([BreadcrumbLink]),
53
+ /**
54
+ * An accessible label for the navigation
55
+ */
56
+ label: PropTypes.string.isRequired,
57
+ /**
58
+ * Sets the font-size of the breadcrumb text
59
+ */
60
+ size: PropTypes.oneOf(['small', 'medium', 'large']),
61
+ /**
62
+ * Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
63
+ * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
64
+ * familiar CSS-like shorthand. For example: `margin="small auto large"`.
65
+ */
66
+ margin: ThemeablePropTypes.spacing
67
+ }
68
+
69
+ const allowedProps: AllowedPropKeys = ['children', 'label', 'margin', 'size']
70
+
71
+ export type { BreadcrumbProps }
72
+ export { propTypes, allowedProps }
@@ -23,7 +23,7 @@
23
23
  */
24
24
 
25
25
  import { BreadcrumbTheme } from '@instructure/shared-types'
26
- import { BreadcrumbProps } from './types'
26
+ import { BreadcrumbProps } from './props'
27
27
 
28
28
  /**
29
29
  * ---
package/src/index.ts CHANGED
@@ -23,5 +23,5 @@
23
23
  */
24
24
  export { Breadcrumb, BreadcrumbLink } from './Breadcrumb'
25
25
 
26
- export type { BreadcrumbProps } from './Breadcrumb/types'
27
- export type { BreadcrumbLinkProps } from './Breadcrumb/BreadcrumbLink/types'
26
+ export type { BreadcrumbProps } from './Breadcrumb/props'
27
+ export type { BreadcrumbLinkProps } from './Breadcrumb/BreadcrumbLink/props'
@@ -1,6 +1,5 @@
1
- import { Component } from 'react';
2
- import PropTypes from 'prop-types';
3
- import { BreadcrumbLinkProps } from './types';
1
+ import React, { Component } from 'react';
2
+ import type { BreadcrumbLinkProps } from './props';
4
3
  /**
5
4
  ---
6
5
  parent: Breadcrumb
@@ -9,39 +8,23 @@ id: Breadcrumb.Link
9
8
  **/
10
9
  declare class BreadcrumbLink extends Component<BreadcrumbLinkProps> {
11
10
  static readonly componentId = "Breadcrumb.Link";
12
- static propTypes: {
13
- /**
14
- * Content to render as the crumb, generally should be text.
15
- */
16
- children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
17
- /**
18
- * Link the crumb should direct to; if an href is provided, the crumb will render as a link
19
- */
20
- href: PropTypes.Requireable<string>;
21
- /**
22
- * If the Breadcrumb.Link has an onClick prop (and no href), it will render as a button
23
- */
24
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
25
- /**
26
- * Sets the font-size of the breadcrumb text
27
- */
28
- size: PropTypes.Requireable<string>;
29
- /**
30
- * Add an icon to the Breadcrumb.Link
31
- */
32
- renderIcon: PropTypes.Requireable<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
33
- /**
34
- * Place the icon before or after the text in the Breadcrumb.Link
35
- */
36
- iconPlacement: PropTypes.Requireable<string>;
37
- };
38
- static defaultProps: {
39
- href: undefined;
40
- onClick: undefined;
41
- size: undefined;
42
- renderIcon: undefined;
43
- iconPlacement: undefined;
44
- };
11
+ static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
12
+ children: React.ReactNode;
13
+ href?: string | undefined;
14
+ onClick?: ((...args: any[]) => any) | undefined;
15
+ size?: "small" | "medium" | "large" | undefined;
16
+ renderIcon?: React.ReactNode | ((...args: any[]) => any);
17
+ iconPlacement?: "start" | "end" | undefined;
18
+ }>;
19
+ static allowedProps: readonly (keyof {
20
+ children: React.ReactNode;
21
+ href?: string | undefined;
22
+ onClick?: ((...args: any[]) => any) | undefined;
23
+ size?: "small" | "medium" | "large" | undefined;
24
+ renderIcon?: React.ReactNode | ((...args: any[]) => any);
25
+ iconPlacement?: "start" | "end" | undefined;
26
+ })[];
27
+ static defaultProps: {};
45
28
  render(): JSX.Element;
46
29
  }
47
30
  export default BreadcrumbLink;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Breadcrumb/BreadcrumbLink/index.tsx"],"names":[],"mappings":"AAwBA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,SAAS,MAAM,YAAY,CAAA;AAMlC,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAE7C;;;;;GAKG;AAEH,cACM,cAAe,SAAQ,SAAS,CAAC,mBAAmB,CAAC;IACzD,MAAM,CAAC,QAAQ,CAAC,WAAW,qBAAoB;IAE/C,MAAM,CAAC,SAAS;QACd;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;MAEJ;IAED,MAAM,CAAC,YAAY;;;;;;MAMlB;IAED,MAAM;CAoBP;AAED,eAAe,cAAc,CAAA;AAC7B,OAAO,EAAE,cAAc,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Breadcrumb/BreadcrumbLink/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAQxC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAElD;;;;;GAKG;AAEH,cACM,cAAe,SAAQ,SAAS,CAAC,mBAAmB,CAAC;IACzD,MAAM,CAAC,QAAQ,CAAC,WAAW,qBAAoB;IAE/C,MAAM,CAAC,SAAS;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY,KAAK;IAExB,MAAM;CAoBP;AAED,eAAe,cAAc,CAAA;AAC7B,OAAO,EAAE,cAAc,EAAE,CAAA"}
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import type { PropValidators } from '@instructure/shared-types';
3
+ declare type BreadcrumbLinkOwnProps = {
4
+ children: React.ReactNode;
5
+ href?: string;
6
+ onClick?: (...args: any[]) => any;
7
+ size?: 'small' | 'medium' | 'large';
8
+ renderIcon?: React.ReactNode | ((...args: any[]) => any);
9
+ iconPlacement?: 'start' | 'end';
10
+ };
11
+ declare type PropKeys = keyof BreadcrumbLinkOwnProps;
12
+ declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
13
+ declare type BreadcrumbLinkProps = BreadcrumbLinkOwnProps;
14
+ declare const propTypes: PropValidators<PropKeys>;
15
+ declare const allowedProps: AllowedPropKeys;
16
+ export type { BreadcrumbLinkProps };
17
+ export { propTypes, allowedProps };
18
+ //# sourceMappingURL=props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Breadcrumb/BreadcrumbLink/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE/D,aAAK,sBAAsB,GAAG;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACjC,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAA;IACxD,aAAa,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;CAChC,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,sBAAsB,CAAA;AAE5C,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,mBAAmB,GAAG,sBAAsB,CAAA;AAEjD,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAyBvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAOnB,CAAA;AAED,YAAY,EAAE,mBAAmB,EAAE,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
@@ -1,9 +1,8 @@
1
1
  /** @jsx jsx */
2
- import { Component } from 'react';
3
- import PropTypes from 'prop-types';
2
+ import React, { Component } from 'react';
4
3
  import { jsx } from '@instructure/emotion';
5
4
  import { BreadcrumbLink } from './BreadcrumbLink';
6
- import { BreadcrumbProps } from './types';
5
+ import type { BreadcrumbProps } from './props';
7
6
  /**
8
7
  ---
9
8
  category: components
@@ -11,35 +10,21 @@ category: components
11
10
  **/
12
11
  declare class Breadcrumb extends Component<BreadcrumbProps> {
13
12
  static readonly componentId = "Breadcrumb";
14
- static propTypes: {
15
- makeStyles: PropTypes.Requireable<(...args: any[]) => any>;
16
- styles: PropTypes.Requireable<object>;
17
- /**
18
- * children of type Breadcrumb.Link
19
- */
20
- children: {
21
- (props: Record<string, any>, propName: string, componentName: string): Error | null;
22
- isRequired: (props: Record<string, any>, propName: string, componentName: string, location?: string | undefined, propFullName?: string | undefined) => Error | null;
23
- };
24
- /**
25
- * An accessible label for the navigation
26
- */
27
- label: PropTypes.Validator<string>;
28
- /**
29
- * Sets the font-size of the breadcrumb text
30
- */
31
- size: PropTypes.Requireable<string>;
32
- /**
33
- * Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
34
- * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
35
- * familiar CSS-like shorthand. For example: `margin="small auto large"`.
36
- */
37
- margin: (props: any, propName: any, componentName: any, location: any) => any;
38
- };
13
+ static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
14
+ children?: React.ReactNode;
15
+ label: string;
16
+ size?: "small" | "medium" | "large" | undefined;
17
+ margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
18
+ }>;
19
+ static allowedProps: readonly (keyof {
20
+ children?: React.ReactNode;
21
+ label: string;
22
+ size?: "small" | "medium" | "large" | undefined;
23
+ margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
24
+ })[];
39
25
  static defaultProps: {
40
26
  size: string;
41
27
  children: null;
42
- margin: undefined;
43
28
  };
44
29
  componentDidMount(): void;
45
30
  componentDidUpdate(prevProps: any, prevState: any, snapshot: any): void;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Breadcrumb/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,SAAS,MAAM,YAAY,CAAA;AAOlC,OAAO,EAAa,GAAG,EAAsB,MAAM,sBAAsB,CAAA;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAIjD,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAEzC;;;;GAIG;AAEH,cAEM,UAAW,SAAQ,SAAS,CAAC,eAAe,CAAC;IACjD,MAAM,CAAC,QAAQ,CAAC,WAAW,gBAAe;IAE1C,MAAM,CAAC,SAAS;;;QAKd;;WAEG;;;;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;;;WAIG;;MAEJ;IAED,MAAM,CAAC,YAAY;;;;MAIlB;IAED,iBAAiB;IAMjB,kBAAkB,CAAC,SAAS,KAAA,EAAE,SAAS,KAAA,EAAE,QAAQ,KAAA;IAKjD,MAAM,CAAC,IAAI,wBAAiB;IAE5B,cAAc;IAmBd,MAAM;CAcP;AAED,eAAe,UAAU,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Breadcrumb/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMxC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAMjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C;;;;GAIG;AAEH,cAEM,UAAW,SAAQ,SAAS,CAAC,eAAe,CAAC;IACjD,MAAM,CAAC,QAAQ,CAAC,WAAW,gBAAe;IAE1C,MAAM,CAAC,SAAS;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;MAGlB;IAED,iBAAiB;IAMjB,kBAAkB,CAAC,SAAS,KAAA,EAAE,SAAS,KAAA,EAAE,QAAQ,KAAA;IAKjD,MAAM,CAAC,IAAI,wBAAiB;IAE5B,cAAc;IAmBd,MAAM;CAcP;AAED,eAAe,UAAU,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAA"}
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ import type { Spacing, WithStyleProps } from '@instructure/emotion';
3
+ import type { PropValidators } from '@instructure/shared-types';
4
+ declare type BreadcrumbOwnProps = {
5
+ children?: React.ReactNode;
6
+ label: string;
7
+ size?: 'small' | 'medium' | 'large';
8
+ margin?: Spacing;
9
+ };
10
+ declare type PropKeys = keyof BreadcrumbOwnProps;
11
+ declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
12
+ declare type BreadcrumbProps = BreadcrumbOwnProps & WithStyleProps;
13
+ declare const propTypes: PropValidators<PropKeys>;
14
+ declare const allowedProps: AllowedPropKeys;
15
+ export type { BreadcrumbProps };
16
+ export { propTypes, allowedProps };
17
+ //# sourceMappingURL=props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Breadcrumb/props.ts"],"names":[],"mappings":";AA+BA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE/D,aAAK,kBAAkB,GAAG;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,kBAAkB,CAAA;AAExC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,eAAe,GAAG,kBAAkB,GAAG,cAAc,CAAA;AAE1D,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAmBvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAAyD,CAAA;AAE7E,YAAY,EAAE,eAAe,EAAE,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { BreadcrumbTheme } from '@instructure/shared-types';
2
- import { BreadcrumbProps } from './types';
2
+ import { BreadcrumbProps } from './props';
3
3
  /**
4
4
  * ---
5
5
  * private: true
package/types/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { Breadcrumb, BreadcrumbLink } from './Breadcrumb';
2
- export type { BreadcrumbProps } from './Breadcrumb/types';
3
- export type { BreadcrumbLinkProps } from './Breadcrumb/BreadcrumbLink/types';
2
+ export type { BreadcrumbProps } from './Breadcrumb/props';
3
+ export type { BreadcrumbLinkProps } from './Breadcrumb/BreadcrumbLink/props';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- "use strict";
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- export declare type BreadcrumbLinkProps = {
3
- href?: string;
4
- onClick?: (...args: any[]) => any;
5
- size?: 'small' | 'medium' | 'large';
6
- renderIcon?: React.ReactNode | ((...args: any[]) => any);
7
- iconPlacement?: 'start' | 'end';
8
- };
9
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/Breadcrumb/BreadcrumbLink/types.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,oBAAY,mBAAmB,GAAG;IAChC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACjC,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAA;IACxD,aAAa,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;CAChC,CAAA"}
@@ -1,9 +0,0 @@
1
- import type { Spacing } from '@instructure/emotion';
2
- export declare type BreadcrumbProps = {
3
- makeStyles?: (...args: any[]) => any;
4
- styles?: any;
5
- label: string;
6
- size?: 'small' | 'medium' | 'large';
7
- margin?: Spacing;
8
- };
9
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/Breadcrumb/types.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAEnD,oBAAY,eAAe,GAAG;IAC5B,UAAU,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACpC,MAAM,CAAC,EAAE,GAAG,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA"}