@instructure/ui-breadcrumb 11.6.0 → 11.6.1-snapshot-129

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 (78) hide show
  1. package/CHANGELOG.md +38 -287
  2. package/es/Breadcrumb/{BreadcrumbLink → v1/BreadcrumbLink}/index.js +3 -3
  3. package/es/Breadcrumb/{index.js → v1/index.js} +2 -2
  4. package/es/Breadcrumb/v2/BreadcrumbLink/index.js +118 -0
  5. package/{src/index.ts → es/Breadcrumb/v2/BreadcrumbLink/props.js} +2 -3
  6. package/es/Breadcrumb/v2/index.js +130 -0
  7. package/es/Breadcrumb/v2/props.js +26 -0
  8. package/es/Breadcrumb/v2/styles.js +75 -0
  9. package/es/{index.js → exports/a.js} +1 -1
  10. package/es/exports/b.js +24 -0
  11. package/lib/Breadcrumb/{BreadcrumbLink → v1/BreadcrumbLink}/index.js +6 -6
  12. package/lib/Breadcrumb/{index.js → v1/index.js} +4 -4
  13. package/lib/Breadcrumb/v2/BreadcrumbLink/index.js +124 -0
  14. package/lib/Breadcrumb/v2/BreadcrumbLink/props.js +31 -0
  15. package/lib/Breadcrumb/v2/index.js +142 -0
  16. package/lib/Breadcrumb/v2/props.js +31 -0
  17. package/lib/Breadcrumb/v2/styles.js +81 -0
  18. package/lib/{index.js → exports/a.js} +3 -3
  19. package/lib/exports/b.js +18 -0
  20. package/package.json +43 -21
  21. package/src/Breadcrumb/{BreadcrumbLink → v1/BreadcrumbLink}/index.tsx +3 -3
  22. package/src/Breadcrumb/{BreadcrumbLink → v1/BreadcrumbLink}/props.ts +2 -2
  23. package/src/Breadcrumb/{index.tsx → v1/index.tsx} +2 -2
  24. package/src/Breadcrumb/v2/BreadcrumbLink/index.tsx +122 -0
  25. package/src/Breadcrumb/v2/BreadcrumbLink/props.ts +101 -0
  26. package/src/Breadcrumb/v2/README.md +141 -0
  27. package/src/Breadcrumb/v2/index.tsx +156 -0
  28. package/src/Breadcrumb/v2/props.ts +64 -0
  29. package/src/Breadcrumb/v2/styles.ts +86 -0
  30. package/src/exports/a.ts +27 -0
  31. package/src/exports/b.ts +27 -0
  32. package/tsconfig.build.tsbuildinfo +1 -1
  33. package/types/Breadcrumb/{BreadcrumbLink → v1/BreadcrumbLink}/index.d.ts +2 -2
  34. package/types/Breadcrumb/v1/BreadcrumbLink/index.d.ts.map +1 -0
  35. package/types/Breadcrumb/{BreadcrumbLink → v1/BreadcrumbLink}/props.d.ts +2 -2
  36. package/types/Breadcrumb/v1/BreadcrumbLink/props.d.ts.map +1 -0
  37. package/types/Breadcrumb/v1/index.d.ts.map +1 -0
  38. package/types/Breadcrumb/v1/props.d.ts.map +1 -0
  39. package/types/Breadcrumb/v1/styles.d.ts.map +1 -0
  40. package/types/Breadcrumb/v1/theme.d.ts.map +1 -0
  41. package/types/Breadcrumb/v2/BreadcrumbLink/index.d.ts +30 -0
  42. package/types/Breadcrumb/v2/BreadcrumbLink/index.d.ts.map +1 -0
  43. package/types/Breadcrumb/v2/BreadcrumbLink/props.d.ts +49 -0
  44. package/types/Breadcrumb/v2/BreadcrumbLink/props.d.ts.map +1 -0
  45. package/types/Breadcrumb/v2/index.d.ts +34 -0
  46. package/types/Breadcrumb/v2/index.d.ts.map +1 -0
  47. package/types/Breadcrumb/v2/props.d.ts +30 -0
  48. package/types/Breadcrumb/v2/props.d.ts.map +1 -0
  49. package/types/Breadcrumb/v2/styles.d.ts +14 -0
  50. package/types/Breadcrumb/v2/styles.d.ts.map +1 -0
  51. package/types/exports/a.d.ts +4 -0
  52. package/types/exports/a.d.ts.map +1 -0
  53. package/types/exports/b.d.ts +4 -0
  54. package/types/exports/b.d.ts.map +1 -0
  55. package/types/Breadcrumb/BreadcrumbLink/index.d.ts.map +0 -1
  56. package/types/Breadcrumb/BreadcrumbLink/props.d.ts.map +0 -1
  57. package/types/Breadcrumb/index.d.ts.map +0 -1
  58. package/types/Breadcrumb/props.d.ts.map +0 -1
  59. package/types/Breadcrumb/styles.d.ts.map +0 -1
  60. package/types/Breadcrumb/theme.d.ts.map +0 -1
  61. package/types/index.d.ts +0 -4
  62. package/types/index.d.ts.map +0 -1
  63. /package/es/Breadcrumb/{BreadcrumbLink → v1/BreadcrumbLink}/props.js +0 -0
  64. /package/es/Breadcrumb/{props.js → v1/props.js} +0 -0
  65. /package/es/Breadcrumb/{styles.js → v1/styles.js} +0 -0
  66. /package/es/Breadcrumb/{theme.js → v1/theme.js} +0 -0
  67. /package/lib/Breadcrumb/{BreadcrumbLink → v1/BreadcrumbLink}/props.js +0 -0
  68. /package/lib/Breadcrumb/{props.js → v1/props.js} +0 -0
  69. /package/lib/Breadcrumb/{styles.js → v1/styles.js} +0 -0
  70. /package/lib/Breadcrumb/{theme.js → v1/theme.js} +0 -0
  71. /package/src/Breadcrumb/{README.md → v1/README.md} +0 -0
  72. /package/src/Breadcrumb/{props.ts → v1/props.ts} +0 -0
  73. /package/src/Breadcrumb/{styles.ts → v1/styles.ts} +0 -0
  74. /package/src/Breadcrumb/{theme.ts → v1/theme.ts} +0 -0
  75. /package/types/Breadcrumb/{index.d.ts → v1/index.d.ts} +0 -0
  76. /package/types/Breadcrumb/{props.d.ts → v1/props.d.ts} +0 -0
  77. /package/types/Breadcrumb/{styles.d.ts → v1/styles.d.ts} +0 -0
  78. /package/types/Breadcrumb/{theme.d.ts → v1/theme.d.ts} +0 -0
@@ -0,0 +1,118 @@
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 { Component } from 'react';
26
+ import { TruncateText } from '@instructure/ui-truncate-text/latest';
27
+ import { Link } from '@instructure/ui-link/latest';
28
+ import { omitProps } from '@instructure/ui-react-utils';
29
+ import { Tooltip } from '@instructure/ui-tooltip/latest';
30
+ import { allowedProps } from "./props.js";
31
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
32
+ /**
33
+ ---
34
+ parent: Breadcrumb
35
+ id: Breadcrumb.Link
36
+ ---
37
+ **/
38
+
39
+ class BreadcrumbLink extends Component {
40
+ constructor(props) {
41
+ super(props);
42
+ this.ref = null;
43
+ this.handleRef = el => {
44
+ this.ref = el;
45
+ };
46
+ this.state = {
47
+ isTruncated: false
48
+ };
49
+ }
50
+ handleTruncation(isTruncated) {
51
+ if (isTruncated !== this.state.isTruncated) {
52
+ this.setState({
53
+ isTruncated
54
+ });
55
+ }
56
+ }
57
+ render() {
58
+ const _this$props = this.props,
59
+ children = _this$props.children,
60
+ href = _this$props.href,
61
+ renderIcon = _this$props.renderIcon,
62
+ iconPlacement = _this$props.iconPlacement,
63
+ onClick = _this$props.onClick,
64
+ onMouseEnter = _this$props.onMouseEnter,
65
+ isCurrentPage = _this$props.isCurrentPage,
66
+ size = _this$props.size;
67
+ const isTruncated = this.state.isTruncated;
68
+ const props = omitProps(this.props, BreadcrumbLink.allowedProps);
69
+ const isInteractive = onClick || href;
70
+ return _jsx(Tooltip, {
71
+ renderTip: children,
72
+ preventTooltip: !isTruncated
73
+ // this wraps the achor/button tag in a span and puts the aria-describedby on that instead of the anchor/button tag
74
+ // to avoid SRs reading the text twice when there is already an aria-label
75
+ ,
76
+ ...(isInteractive && {
77
+ as: 'span'
78
+ }),
79
+ children: _jsx(Link, {
80
+ ...props,
81
+ href: href,
82
+ renderIcon: renderIcon,
83
+ iconPlacement: iconPlacement,
84
+ onClick: onClick,
85
+ onMouseEnter: onMouseEnter,
86
+ variant: "standalone",
87
+ elementRef: this.handleRef,
88
+ forceButtonRole: false,
89
+ size: size,
90
+ ...(isCurrentPage && {
91
+ 'aria-current': 'page'
92
+ }),
93
+ ...(isTruncated && {
94
+ ...(typeof children === 'string' && {
95
+ 'aria-label': children
96
+ }),
97
+ ...(!isInteractive && {
98
+ role: 'text'
99
+ })
100
+ }),
101
+ "data-cid": "BreadcrumbLink",
102
+ children: _jsx(TruncateText, {
103
+ onUpdate: isTruncated => this.handleTruncation(isTruncated),
104
+ children: _jsx("span", {
105
+ "aria-hidden": isTruncated,
106
+ children: children
107
+ })
108
+ })
109
+ })
110
+ });
111
+ }
112
+ }
113
+ BreadcrumbLink.displayName = "BreadcrumbLink";
114
+ BreadcrumbLink.componentId = 'Breadcrumb.Link';
115
+ BreadcrumbLink.allowedProps = allowedProps;
116
+ BreadcrumbLink.defaultProps = {};
117
+ export default BreadcrumbLink;
118
+ export { BreadcrumbLink };
@@ -21,7 +21,6 @@
21
21
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
  * SOFTWARE.
23
23
  */
24
- export { Breadcrumb, BreadcrumbLink } from './Breadcrumb'
25
24
 
26
- export type { BreadcrumbProps } from './Breadcrumb/props'
27
- export type { BreadcrumbLinkProps } from './Breadcrumb/BreadcrumbLink/props'
25
+ const allowedProps = ['children', 'href', 'iconPlacement', 'onClick', 'onMouseEnter', 'renderIcon', 'size', 'isCurrentPage'];
26
+ export { allowedProps };
@@ -0,0 +1,130 @@
1
+ var _dec, _class, _Breadcrumb;
2
+ /*
3
+ * The MIT License (MIT)
4
+ *
5
+ * Copyright (c) 2015 - present Instructure, Inc.
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in all
15
+ * copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ * SOFTWARE.
24
+ */
25
+
26
+ import { isValidElement, Children, Component } from 'react';
27
+ import { View } from '@instructure/ui-view/latest';
28
+ import { safeCloneElement } from '@instructure/ui-react-utils';
29
+ import { withStyle } from '@instructure/emotion';
30
+ import { ChevronRightInstUIIcon } from '@instructure/ui-icons';
31
+ import { BreadcrumbLink } from "./BreadcrumbLink/index.js";
32
+ import generateStyle from "./styles.js";
33
+ import { allowedProps } from "./props.js";
34
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
35
+ /**
36
+ ---
37
+ category: components
38
+ ---
39
+ **/
40
+ let Breadcrumb = (_dec = withStyle(generateStyle), _dec(_class = (_Breadcrumb = class Breadcrumb extends Component {
41
+ constructor(...args) {
42
+ super(...args);
43
+ this.ref = null;
44
+ this.handleRef = el => {
45
+ this.ref = el;
46
+ };
47
+ this.addAriaCurrent = child => {
48
+ const updatedChild = safeCloneElement(child, {
49
+ 'aria-current': 'page'
50
+ });
51
+ return updatedChild;
52
+ };
53
+ }
54
+ componentDidMount() {
55
+ var _this$props$makeStyle, _this$props;
56
+ (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
57
+ }
58
+ componentDidUpdate() {
59
+ var _this$props$makeStyle2, _this$props2;
60
+ (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
61
+ }
62
+ renderChildren() {
63
+ const _this$props3 = this.props,
64
+ styles = _this$props3.styles,
65
+ children = _this$props3.children,
66
+ size = _this$props3.size;
67
+ const numChildren = Children.count(children);
68
+ const inlineStyle = {
69
+ maxWidth: `${Math.floor(100 / numChildren)}%`
70
+ };
71
+ let isAriaCurrentSet = false;
72
+ return Children.map(children, (child, index) => {
73
+ const isLastElement = index === numChildren - 1;
74
+ if (/*#__PURE__*/isValidElement(child)) {
75
+ const isCurrentPage = child.props.isCurrentPage || false;
76
+ if (isAriaCurrentSet && isCurrentPage) {}
77
+ if (isCurrentPage) {
78
+ isAriaCurrentSet = true;
79
+ }
80
+ }
81
+
82
+ // Clone child (BreadcrumbLink) and pass size prop
83
+ const childWithSize = /*#__PURE__*/isValidElement(child) ? safeCloneElement(child, {
84
+ size
85
+ }) : child;
86
+
87
+ // Map Breadcrumb sizes to icon size tokens
88
+ const breadcrumbSizeToIconSize = {
89
+ small: 'sm',
90
+ medium: 'md',
91
+ large: 'lg'
92
+ };
93
+ const iconSize = breadcrumbSizeToIconSize[size || 'small'];
94
+ return _jsxs(_Fragment, {
95
+ children: [_jsx("li", {
96
+ css: styles === null || styles === void 0 ? void 0 : styles.crumb,
97
+ style: inlineStyle,
98
+ children: !isAriaCurrentSet && isLastElement && child.props.isCurrentPage !== false ? this.addAriaCurrent(childWithSize) : childWithSize
99
+ }), index < numChildren - 1 && _jsx("li", {
100
+ "aria-hidden": "true",
101
+ css: styles === null || styles === void 0 ? void 0 : styles.separator,
102
+ children: _jsx(ChevronRightInstUIIcon, {
103
+ size: iconSize,
104
+ color: 'mutedColor'
105
+ })
106
+ })]
107
+ });
108
+ });
109
+ }
110
+ render() {
111
+ const styles = this.props.styles;
112
+ return _jsx(View, {
113
+ role: "navigation",
114
+ as: "div",
115
+ margin: this.props.margin,
116
+ "aria-label": this.props.label,
117
+ elementRef: this.handleRef,
118
+ "data-cid": "Breadcrumb",
119
+ children: _jsx("ol", {
120
+ css: styles === null || styles === void 0 ? void 0 : styles.breadcrumb,
121
+ children: this.renderChildren()
122
+ })
123
+ });
124
+ }
125
+ }, _Breadcrumb.displayName = "Breadcrumb", _Breadcrumb.componentId = 'Breadcrumb', _Breadcrumb.allowedProps = allowedProps, _Breadcrumb.defaultProps = {
126
+ size: 'medium',
127
+ children: null
128
+ }, _Breadcrumb.Link = BreadcrumbLink, _Breadcrumb)) || _class);
129
+ export default Breadcrumb;
130
+ export { Breadcrumb, BreadcrumbLink };
@@ -0,0 +1,26 @@
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
+ const allowedProps = ['children', 'label', 'margin', 'size'];
26
+ export { allowedProps };
@@ -0,0 +1,75 @@
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
+ /**
26
+ * ---
27
+ * private: true
28
+ * ---
29
+ * Generates the style object from the theme and provided additional information
30
+ * @param {Object} componentTheme The theme variable object.
31
+ * @param {Object} props the props of the component, the style is applied to
32
+ * @return {Object} The final style object, which will be used in the component
33
+ */
34
+ const generateStyle = (componentTheme, props) => {
35
+ const size = props.size;
36
+ const gapSizeVariants = {
37
+ small: componentTheme.gapSm,
38
+ medium: componentTheme.gapMd,
39
+ large: componentTheme.gapLg
40
+ };
41
+ return {
42
+ breadcrumb: {
43
+ label: 'breadcrumb',
44
+ margin: 0,
45
+ padding: 0,
46
+ listStyleType: 'none',
47
+ overflow: 'visible',
48
+ display: 'flex',
49
+ alignItems: 'center',
50
+ gap: gapSizeVariants[size]
51
+ },
52
+ crumb: {
53
+ label: 'breadcrumb__crumb',
54
+ boxSizing: 'border-box',
55
+ display: 'flex',
56
+ alignItems: 'center',
57
+ // prevent text clipping
58
+ '[data-cid~="TruncateText"]': {
59
+ overflow: 'visible',
60
+ // prevent extra spacing after the '...'
61
+ '& [class*="truncateText__spacer"]': {
62
+ display: 'inline'
63
+ }
64
+ }
65
+ },
66
+ separator: {
67
+ label: 'breadcrumb__separator',
68
+ boxSizing: 'border-box',
69
+ display: 'inline-flex',
70
+ alignItems: 'center',
71
+ flexShrink: 0
72
+ }
73
+ };
74
+ };
75
+ export default generateStyle;
@@ -21,4 +21,4 @@
21
21
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
  * SOFTWARE.
23
23
  */
24
- export { Breadcrumb, BreadcrumbLink } from "./Breadcrumb/index.js";
24
+ export { Breadcrumb, BreadcrumbLink } from "../Breadcrumb/v1/index.js";
@@ -0,0 +1,24 @@
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
+ export { Breadcrumb, BreadcrumbLink } from "../Breadcrumb/v2/index.js";
@@ -5,10 +5,10 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = exports.BreadcrumbLink = void 0;
7
7
  var _react = require("react");
8
- var _TruncateText = require("@instructure/ui-truncate-text/lib/TruncateText");
9
- var _Link = require("@instructure/ui-link/lib/Link");
8
+ var _v11_ = require("@instructure/ui-truncate-text/v11_6");
9
+ var _v11_2 = require("@instructure/ui-link/v11_6");
10
10
  var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
11
- var _Tooltip = require("@instructure/ui-tooltip/lib/Tooltip");
11
+ var _v11_3 = require("@instructure/ui-tooltip/v11_6");
12
12
  var _props = require("./props");
13
13
  var _jsxRuntime = require("@emotion/react/jsx-runtime");
14
14
  /*
@@ -72,7 +72,7 @@ class BreadcrumbLink extends _react.Component {
72
72
  const isTruncated = this.state.isTruncated;
73
73
  const props = (0, _omitProps.omitProps)(this.props, BreadcrumbLink.allowedProps);
74
74
  const isInteractive = onClick || href;
75
- return (0, _jsxRuntime.jsx)(_Tooltip.Tooltip, {
75
+ return (0, _jsxRuntime.jsx)(_v11_3.Tooltip, {
76
76
  renderTip: children,
77
77
  preventTooltip: !isTruncated
78
78
  // this wraps the achor/button tag in a span and puts the aria-describedby on that instead of the anchor/button tag
@@ -81,7 +81,7 @@ class BreadcrumbLink extends _react.Component {
81
81
  ...(isInteractive && {
82
82
  as: 'span'
83
83
  }),
84
- children: (0, _jsxRuntime.jsx)(_Link.Link, {
84
+ children: (0, _jsxRuntime.jsx)(_v11_2.Link, {
85
85
  ...props,
86
86
  href: href,
87
87
  renderIcon: renderIcon,
@@ -103,7 +103,7 @@ class BreadcrumbLink extends _react.Component {
103
103
  })
104
104
  }),
105
105
  "data-cid": "BreadcrumbLink",
106
- children: (0, _jsxRuntime.jsx)(_TruncateText.TruncateText, {
106
+ children: (0, _jsxRuntime.jsx)(_v11_.TruncateText, {
107
107
  onUpdate: isTruncated => this.handleTruncation(isTruncated),
108
108
  children: (0, _jsxRuntime.jsx)("span", {
109
109
  "aria-hidden": isTruncated,
@@ -13,9 +13,9 @@ Object.defineProperty(exports, "BreadcrumbLink", {
13
13
  });
14
14
  exports.default = void 0;
15
15
  var _react = require("react");
16
- var _View = require("@instructure/ui-view/lib/View");
16
+ var _v11_ = require("@instructure/ui-view/v11_6");
17
17
  var _emotion = require("@instructure/emotion");
18
- var _IconArrowOpenEndSolid = require("@instructure/ui-icons/lib/IconArrowOpenEndSolid.js");
18
+ var _IconArrowOpenEndSolid = require("@instructure/ui-icons/lib/generated/IconArrowOpenEndSolid.js");
19
19
  var _BreadcrumbLink = require("./BreadcrumbLink");
20
20
  var _styles = _interopRequireDefault(require("./styles"));
21
21
  var _theme = _interopRequireDefault(require("./theme"));
@@ -50,7 +50,7 @@ var _dec, _class, _Breadcrumb;
50
50
  category: components
51
51
  ---
52
52
  **/
53
- let Breadcrumb = exports.Breadcrumb = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_Breadcrumb = class Breadcrumb extends _react.Component {
53
+ let Breadcrumb = exports.Breadcrumb = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = (_Breadcrumb = class Breadcrumb extends _react.Component {
54
54
  constructor(...args) {
55
55
  super(...args);
56
56
  this.ref = null;
@@ -102,7 +102,7 @@ let Breadcrumb = exports.Breadcrumb = (_dec = (0, _emotion.withStyle)(_styles.de
102
102
  }
103
103
  render() {
104
104
  const styles = this.props.styles;
105
- return (0, _jsxRuntime.jsx)(_View.View, {
105
+ return (0, _jsxRuntime.jsx)(_v11_.View, {
106
106
  role: "navigation",
107
107
  as: "div",
108
108
  margin: this.props.margin,
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.BreadcrumbLink = void 0;
7
+ var _react = require("react");
8
+ var _latest = require("@instructure/ui-truncate-text/latest");
9
+ var _latest2 = require("@instructure/ui-link/latest");
10
+ var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
11
+ var _latest3 = require("@instructure/ui-tooltip/latest");
12
+ var _props = require("./props");
13
+ var _jsxRuntime = require("@emotion/react/jsx-runtime");
14
+ /*
15
+ * The MIT License (MIT)
16
+ *
17
+ * Copyright (c) 2015 - present Instructure, Inc.
18
+ *
19
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
20
+ * of this software and associated documentation files (the "Software"), to deal
21
+ * in the Software without restriction, including without limitation the rights
22
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
23
+ * copies of the Software, and to permit persons to whom the Software is
24
+ * furnished to do so, subject to the following conditions:
25
+ *
26
+ * The above copyright notice and this permission notice shall be included in all
27
+ * copies or substantial portions of the Software.
28
+ *
29
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35
+ * SOFTWARE.
36
+ */
37
+
38
+ /**
39
+ ---
40
+ parent: Breadcrumb
41
+ id: Breadcrumb.Link
42
+ ---
43
+ **/
44
+
45
+ class BreadcrumbLink extends _react.Component {
46
+ constructor(props) {
47
+ super(props);
48
+ this.ref = null;
49
+ this.handleRef = el => {
50
+ this.ref = el;
51
+ };
52
+ this.state = {
53
+ isTruncated: false
54
+ };
55
+ }
56
+ handleTruncation(isTruncated) {
57
+ if (isTruncated !== this.state.isTruncated) {
58
+ this.setState({
59
+ isTruncated
60
+ });
61
+ }
62
+ }
63
+ render() {
64
+ const _this$props = this.props,
65
+ children = _this$props.children,
66
+ href = _this$props.href,
67
+ renderIcon = _this$props.renderIcon,
68
+ iconPlacement = _this$props.iconPlacement,
69
+ onClick = _this$props.onClick,
70
+ onMouseEnter = _this$props.onMouseEnter,
71
+ isCurrentPage = _this$props.isCurrentPage,
72
+ size = _this$props.size;
73
+ const isTruncated = this.state.isTruncated;
74
+ const props = (0, _omitProps.omitProps)(this.props, BreadcrumbLink.allowedProps);
75
+ const isInteractive = onClick || href;
76
+ return (0, _jsxRuntime.jsx)(_latest3.Tooltip, {
77
+ renderTip: children,
78
+ preventTooltip: !isTruncated
79
+ // this wraps the achor/button tag in a span and puts the aria-describedby on that instead of the anchor/button tag
80
+ // to avoid SRs reading the text twice when there is already an aria-label
81
+ ,
82
+ ...(isInteractive && {
83
+ as: 'span'
84
+ }),
85
+ children: (0, _jsxRuntime.jsx)(_latest2.Link, {
86
+ ...props,
87
+ href: href,
88
+ renderIcon: renderIcon,
89
+ iconPlacement: iconPlacement,
90
+ onClick: onClick,
91
+ onMouseEnter: onMouseEnter,
92
+ variant: "standalone",
93
+ elementRef: this.handleRef,
94
+ forceButtonRole: false,
95
+ size: size,
96
+ ...(isCurrentPage && {
97
+ 'aria-current': 'page'
98
+ }),
99
+ ...(isTruncated && {
100
+ ...(typeof children === 'string' && {
101
+ 'aria-label': children
102
+ }),
103
+ ...(!isInteractive && {
104
+ role: 'text'
105
+ })
106
+ }),
107
+ "data-cid": "BreadcrumbLink",
108
+ children: (0, _jsxRuntime.jsx)(_latest.TruncateText, {
109
+ onUpdate: isTruncated => this.handleTruncation(isTruncated),
110
+ children: (0, _jsxRuntime.jsx)("span", {
111
+ "aria-hidden": isTruncated,
112
+ children: children
113
+ })
114
+ })
115
+ })
116
+ });
117
+ }
118
+ }
119
+ exports.BreadcrumbLink = BreadcrumbLink;
120
+ BreadcrumbLink.displayName = "BreadcrumbLink";
121
+ BreadcrumbLink.componentId = 'Breadcrumb.Link';
122
+ BreadcrumbLink.allowedProps = _props.allowedProps;
123
+ BreadcrumbLink.defaultProps = {};
124
+ var _default = exports.default = BreadcrumbLink;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.allowedProps = void 0;
7
+ /*
8
+ * The MIT License (MIT)
9
+ *
10
+ * Copyright (c) 2015 - present Instructure, Inc.
11
+ *
12
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ * of this software and associated documentation files (the "Software"), to deal
14
+ * in the Software without restriction, including without limitation the rights
15
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ * copies of the Software, and to permit persons to whom the Software is
17
+ * furnished to do so, subject to the following conditions:
18
+ *
19
+ * The above copyright notice and this permission notice shall be included in all
20
+ * copies or substantial portions of the Software.
21
+ *
22
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ * SOFTWARE.
29
+ */
30
+
31
+ const allowedProps = exports.allowedProps = ['children', 'href', 'iconPlacement', 'onClick', 'onMouseEnter', 'renderIcon', 'size', 'isCurrentPage'];