@instructure/ui-breadcrumb 11.7.3-snapshot-7 → 11.7.3-snapshot-26

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.
@@ -21,7 +21,7 @@ var _BreadcrumbLink = require("./BreadcrumbLink");
21
21
  var _styles = _interopRequireDefault(require("./styles"));
22
22
  var _props = require("./props");
23
23
  var _jsxRuntime = require("@emotion/react/jsx-runtime");
24
- var _dec, _class, _Breadcrumb;
24
+ var _dec, _class;
25
25
  /*
26
26
  * The MIT License (MIT)
27
27
  *
@@ -50,33 +50,37 @@ var _dec, _class, _Breadcrumb;
50
50
  category: components
51
51
  ---
52
52
  **/
53
- let Breadcrumb = exports.Breadcrumb = (_dec = (0, _emotion.withStyle)(_styles.default), _dec(_class = (_Breadcrumb = class Breadcrumb extends _react.Component {
54
- constructor(...args) {
55
- super(...args);
56
- this.ref = null;
57
- this.handleRef = el => {
58
- this.ref = el;
59
- };
60
- this.addAriaCurrent = child => {
61
- const updatedChild = (0, _safeCloneElement.safeCloneElement)(child, {
62
- 'aria-current': 'page'
63
- });
64
- return updatedChild;
65
- };
66
- }
53
+ let Breadcrumb = exports.Breadcrumb = (_dec = (0, _emotion.withStyle)(_styles.default), _dec(_class = class Breadcrumb extends _react.Component {
54
+ static displayName = "Breadcrumb";
55
+ static componentId = 'Breadcrumb';
56
+ static allowedProps = _props.allowedProps;
57
+ static defaultProps = {
58
+ size: 'medium',
59
+ children: null
60
+ };
61
+ ref = null;
62
+ handleRef = el => {
63
+ this.ref = el;
64
+ };
65
+ addAriaCurrent = child => {
66
+ const updatedChild = (0, _safeCloneElement.safeCloneElement)(child, {
67
+ 'aria-current': 'page'
68
+ });
69
+ return updatedChild;
70
+ };
67
71
  componentDidMount() {
68
- var _this$props$makeStyle, _this$props;
69
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
72
+ this.props.makeStyles?.();
70
73
  }
71
74
  componentDidUpdate() {
72
- var _this$props$makeStyle2, _this$props2;
73
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
75
+ this.props.makeStyles?.();
74
76
  }
77
+ static Link = _BreadcrumbLink.BreadcrumbLink;
75
78
  renderChildren() {
76
- const _this$props3 = this.props,
77
- styles = _this$props3.styles,
78
- children = _this$props3.children,
79
- size = _this$props3.size;
79
+ const {
80
+ styles,
81
+ children,
82
+ size
83
+ } = this.props;
80
84
  const numChildren = _react.Children.count(children);
81
85
  const inlineStyle = {
82
86
  maxWidth: `${Math.floor(100 / numChildren)}%`
@@ -106,12 +110,12 @@ let Breadcrumb = exports.Breadcrumb = (_dec = (0, _emotion.withStyle)(_styles.de
106
110
  const iconSize = breadcrumbSizeToIconSize[size || 'small'];
107
111
  return (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
108
112
  children: [(0, _jsxRuntime.jsx)("li", {
109
- css: styles === null || styles === void 0 ? void 0 : styles.crumb,
113
+ css: styles?.crumb,
110
114
  style: inlineStyle,
111
115
  children: !isAriaCurrentSet && isLastElement && child.props.isCurrentPage !== false ? this.addAriaCurrent(childWithSize) : childWithSize
112
116
  }), index < numChildren - 1 && (0, _jsxRuntime.jsx)("li", {
113
117
  "aria-hidden": "true",
114
- css: styles === null || styles === void 0 ? void 0 : styles.separator,
118
+ css: styles?.separator,
115
119
  children: (0, _jsxRuntime.jsx)(_uiIcons.ChevronRightInstUIIcon, {
116
120
  size: iconSize,
117
121
  color: 'mutedColor'
@@ -121,7 +125,9 @@ let Breadcrumb = exports.Breadcrumb = (_dec = (0, _emotion.withStyle)(_styles.de
121
125
  });
122
126
  }
123
127
  render() {
124
- const styles = this.props.styles;
128
+ const {
129
+ styles
130
+ } = this.props;
125
131
  return (0, _jsxRuntime.jsx)(_latest.View, {
126
132
  role: "navigation",
127
133
  as: "div",
@@ -130,13 +136,10 @@ let Breadcrumb = exports.Breadcrumb = (_dec = (0, _emotion.withStyle)(_styles.de
130
136
  elementRef: this.handleRef,
131
137
  "data-cid": "Breadcrumb",
132
138
  children: (0, _jsxRuntime.jsx)("ol", {
133
- css: styles === null || styles === void 0 ? void 0 : styles.breadcrumb,
139
+ css: styles?.breadcrumb,
134
140
  children: this.renderChildren()
135
141
  })
136
142
  });
137
143
  }
138
- }, _Breadcrumb.displayName = "Breadcrumb", _Breadcrumb.componentId = 'Breadcrumb', _Breadcrumb.allowedProps = _props.allowedProps, _Breadcrumb.defaultProps = {
139
- size: 'medium',
140
- children: null
141
- }, _Breadcrumb.Link = _BreadcrumbLink.BreadcrumbLink, _Breadcrumb)) || _class);
144
+ }) || _class);
142
145
  var _default = exports.default = Breadcrumb;
@@ -38,7 +38,9 @@ exports.default = void 0;
38
38
  * @return {Object} The final style object, which will be used in the component
39
39
  */
40
40
  const generateStyle = (componentTheme, props) => {
41
- const size = props.size;
41
+ const {
42
+ size
43
+ } = props;
42
44
  const gapSizeVariants = {
43
45
  small: componentTheme.gapSm,
44
46
  medium: componentTheme.gapMd,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-breadcrumb",
3
- "version": "11.7.3-snapshot-7",
3
+ "version": "11.7.3-snapshot-26",
4
4
  "description": "A breadcrumb component",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -14,25 +14,25 @@
14
14
  "bugs": "https://github.com/instructure/instructure-ui/issues",
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
- "@babel/runtime": "^7.27.6",
18
- "@instructure/shared-types": "11.7.3-snapshot-7",
19
- "@instructure/ui-icons": "11.7.3-snapshot-7",
20
- "@instructure/ui-link": "11.7.3-snapshot-7",
21
- "@instructure/ui-react-utils": "11.7.3-snapshot-7",
22
- "@instructure/emotion": "11.7.3-snapshot-7",
23
- "@instructure/ui-themes": "11.7.3-snapshot-7",
24
- "@instructure/ui-tooltip": "11.7.3-snapshot-7",
25
- "@instructure/ui-utils": "11.7.3-snapshot-7",
26
- "@instructure/ui-view": "11.7.3-snapshot-7",
27
- "@instructure/ui-truncate-text": "11.7.3-snapshot-7"
17
+ "@babel/runtime": "^7.29.2",
18
+ "@instructure/shared-types": "11.7.3-snapshot-26",
19
+ "@instructure/emotion": "11.7.3-snapshot-26",
20
+ "@instructure/ui-icons": "11.7.3-snapshot-26",
21
+ "@instructure/ui-link": "11.7.3-snapshot-26",
22
+ "@instructure/ui-react-utils": "11.7.3-snapshot-26",
23
+ "@instructure/ui-themes": "11.7.3-snapshot-26",
24
+ "@instructure/ui-truncate-text": "11.7.3-snapshot-26",
25
+ "@instructure/ui-tooltip": "11.7.3-snapshot-26",
26
+ "@instructure/ui-utils": "11.7.3-snapshot-26",
27
+ "@instructure/ui-view": "11.7.3-snapshot-26"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@testing-library/jest-dom": "^6.6.3",
31
31
  "@testing-library/react": "15.0.7",
32
32
  "vitest": "^3.2.2",
33
- "@instructure/ui-scripts": "11.7.3-snapshot-7",
34
- "@instructure/ui-babel-preset": "11.7.3-snapshot-7",
35
- "@instructure/ui-axe-check": "11.7.3-snapshot-7"
33
+ "@instructure/ui-axe-check": "11.7.3-snapshot-26",
34
+ "@instructure/ui-babel-preset": "11.7.3-snapshot-26",
35
+ "@instructure/ui-scripts": "11.7.3-snapshot-26"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "react": ">=18 <=19"