@dust-tt/sparkle 0.2.284 → 0.2.285-rc-1
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/dist/cjs/index.js +5 -8
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/NavigationList.d.ts +1 -1
- package/dist/esm/components/NavigationList.d.ts.map +1 -1
- package/dist/esm/components/NavigationList.js +6 -10
- package/dist/esm/components/NavigationList.js.map +1 -1
- package/dist/esm/stories/NavigationList.stories.d.ts.map +1 -1
- package/dist/esm/stories/NavigationList.stories.js +9 -6
- package/dist/esm/stories/NavigationList.stories.js.map +1 -1
- package/package.json +1 -1
- package/src/components/NavigationList.tsx +6 -21
- package/src/stories/NavigationList.stories.tsx +31 -4
package/dist/cjs/index.js
CHANGED
|
@@ -106717,11 +106717,10 @@ var NavigationList = React__namespace.forwardRef(function (_a, ref) {
|
|
|
106717
106717
|
});
|
|
106718
106718
|
NavigationList.displayName = "NavigationList";
|
|
106719
106719
|
var NavigationListItem = React__namespace.forwardRef(function (_a, ref) {
|
|
106720
|
-
var className = _a.className, selected = _a.selected, label = _a.label, icon = _a.icon, href = _a.href, target = _a.target, rel = _a.rel, replace = _a.replace, shallow = _a.shallow, props = __rest(_a, ["className", "selected", "label", "icon", "href", "target", "rel", "replace", "shallow"]);
|
|
106721
|
-
var _b = __read(React__namespace.useState(false), 2),
|
|
106722
|
-
var _c = __read(React__namespace.useState(false), 2), isPressed = _c[0], setIsPressed = _c[1];
|
|
106720
|
+
var className = _a.className, selected = _a.selected, label = _a.label, icon = _a.icon, href = _a.href, target = _a.target, rel = _a.rel, replace = _a.replace, shallow = _a.shallow, moreMenu = _a.moreMenu, props = __rest(_a, ["className", "selected", "label", "icon", "href", "target", "rel", "replace", "shallow", "moreMenu"]);
|
|
106721
|
+
var _b = __read(React__namespace.useState(false), 2), isPressed = _b[0], setIsPressed = _b[1];
|
|
106723
106722
|
var handleMouseDown = function (event) {
|
|
106724
|
-
if (!event.target.closest(".
|
|
106723
|
+
if (!event.target.closest(".button-class")) {
|
|
106725
106724
|
setIsPressed(true);
|
|
106726
106725
|
}
|
|
106727
106726
|
};
|
|
@@ -106729,14 +106728,12 @@ var NavigationListItem = React__namespace.forwardRef(function (_a, ref) {
|
|
|
106729
106728
|
React__namespace.createElement("div", { className: listStyles({
|
|
106730
106729
|
layout: "item",
|
|
106731
106730
|
state: selected ? "selected" : isPressed ? "active" : "unselected",
|
|
106732
|
-
}),
|
|
106733
|
-
setIsHovered(false);
|
|
106731
|
+
}), onMouseLeave: function () {
|
|
106734
106732
|
setIsPressed(false);
|
|
106735
106733
|
}, onMouseDown: handleMouseDown, onMouseUp: function () { return setIsPressed(false); } },
|
|
106736
106734
|
icon && React__namespace.createElement(Icon, { visual: icon, size: "sm" }),
|
|
106737
106735
|
label && (React__namespace.createElement("span", { className: "s-grow s-overflow-hidden s-text-ellipsis s-whitespace-nowrap" }, label)),
|
|
106738
|
-
|
|
106739
|
-
React__namespace.createElement(Button, { variant: "ghost", icon: MoreIcon, size: "xs", onClick: function (e) { return e.stopPropagation(); }, onMouseDown: function (e) { return e.stopPropagation(); }, onMouseUp: function (e) { return e.stopPropagation(); } }))))));
|
|
106736
|
+
selected && moreMenu && (React__namespace.createElement("div", { className: "-s-mr-2 s-flex s-h-4 s-items-center" }, moreMenu)))));
|
|
106740
106737
|
return (React__namespace.createElement(LinkWrapper, { href: href, target: target, rel: rel, replace: replace, shallow: shallow, className: className }, content));
|
|
106741
106738
|
});
|
|
106742
106739
|
NavigationListItem.displayName = "NavigationListItem";
|