@faststore/ui 1.5.17 → 1.5.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/ui.cjs.development.js +16 -8
- package/dist/ui.cjs.development.js.map +1 -1
- package/dist/ui.cjs.production.min.js +1 -1
- package/dist/ui.cjs.production.min.js.map +1 -1
- package/dist/ui.esm.js +17 -9
- package/dist/ui.esm.js.map +1 -1
- package/package.json +3 -3
- package/src/molecules/Breadcrumb/Breadcrumb.test.tsx +34 -0
- package/src/molecules/Breadcrumb/Breadcrumb.tsx +27 -13
- package/src/molecules/Breadcrumb/stories/Breadcrumb.mdx +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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
|
+
## 1.5.18 (2022-02-23)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **ui:** Use valid HTML for the Breadcrumb's divider ([#1143](https://github.com/vtex/faststore/issues/1143)) ([b40c3b1](https://github.com/vtex/faststore/commit/b40c3b1405e6aa9a0f2006de9f37a903e40a2103))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## 1.5.17 (2022-02-22)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -1117,6 +1117,7 @@ const Divider = ({
|
|
|
1117
1117
|
const ListItem = ({
|
|
1118
1118
|
children,
|
|
1119
1119
|
isLastItem,
|
|
1120
|
+
divider,
|
|
1120
1121
|
testId
|
|
1121
1122
|
}) => {
|
|
1122
1123
|
const props = {
|
|
@@ -1126,10 +1127,20 @@ const ListItem = ({
|
|
|
1126
1127
|
};
|
|
1127
1128
|
|
|
1128
1129
|
if (!React__default.isValidElement(children)) {
|
|
1129
|
-
return React__default.createElement("li",
|
|
1130
|
+
return React__default.createElement("li", {
|
|
1131
|
+
"data-breadcrumb-list-item": true
|
|
1132
|
+
}, React__default.createElement("span", Object.assign({}, props), children, isLastItem ? null : React__default.createElement(Divider, {
|
|
1133
|
+
divider: divider,
|
|
1134
|
+
testId: testId
|
|
1135
|
+
})));
|
|
1130
1136
|
}
|
|
1131
1137
|
|
|
1132
|
-
return React__default.createElement("li",
|
|
1138
|
+
return React__default.createElement("li", {
|
|
1139
|
+
"data-breadcrumb-list-item": true
|
|
1140
|
+
}, React__default.cloneElement(children, props), isLastItem ? null : React__default.createElement(Divider, {
|
|
1141
|
+
divider: divider,
|
|
1142
|
+
testId: testId
|
|
1143
|
+
}));
|
|
1133
1144
|
};
|
|
1134
1145
|
|
|
1135
1146
|
const Breadcrumb = /*#__PURE__*/React.forwardRef(function Breadcrumb({
|
|
@@ -1150,15 +1161,12 @@ const Breadcrumb = /*#__PURE__*/React.forwardRef(function Breadcrumb({
|
|
|
1150
1161
|
variant: "ordered"
|
|
1151
1162
|
}, React__default.Children.map(children, (child, index) => {
|
|
1152
1163
|
const isLastItem = index === lastIndex - 1;
|
|
1153
|
-
return React__default.createElement(
|
|
1154
|
-
key: `breadcrumb-${index}`
|
|
1155
|
-
}, React__default.createElement(ListItem, {
|
|
1164
|
+
return React__default.createElement(ListItem, {
|
|
1156
1165
|
isLastItem: isLastItem,
|
|
1157
|
-
testId: testId
|
|
1158
|
-
}, child), isLastItem ? null : React__default.createElement(Divider, {
|
|
1159
1166
|
divider: rawDivider,
|
|
1167
|
+
key: `breadcrumb-${index}`,
|
|
1160
1168
|
testId: testId
|
|
1161
|
-
})
|
|
1169
|
+
}, child);
|
|
1162
1170
|
})));
|
|
1163
1171
|
});
|
|
1164
1172
|
|