@superdispatch/ui-lab 0.26.1 → 0.27.0
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-node/index.js +8 -24
- package/dist-node/index.js.map +1 -1
- package/dist-src/sidebar/SidebarMenuItem.js +8 -24
- package/dist-web/index.js +8 -24
- package/dist-web/index.js.map +1 -1
- package/package.json +3 -3
package/dist-node/index.js
CHANGED
|
@@ -1928,10 +1928,6 @@ var SidebarMenuItemBadge = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
1928
1928
|
displayName: "SidebarMenuItem__SidebarMenuItemBadge",
|
|
1929
1929
|
componentId: "SD__sc-1sb5zqa-1"
|
|
1930
1930
|
})(["font-size:12px;font-weight:500;line-height:16px;padding-left:4px;padding-right:4px;border-radius:100px;color:", ";background-color:", ";"], ui.Color.Dark500, ui.Color.Silver400);
|
|
1931
|
-
var SidebarMenuItemSecondaryAction = /*#__PURE__*/styled__default.div.withConfig({
|
|
1932
|
-
displayName: "SidebarMenuItem__SidebarMenuItemSecondaryAction",
|
|
1933
|
-
componentId: "SD__sc-1sb5zqa-2"
|
|
1934
|
-
})(["top:50%;right:24px;position:absolute;transform:translate3d(0,-50%,0);"]);
|
|
1935
1931
|
var SidebarMenuItem = /*#__PURE__*/react.forwardRef((_ref2, ref) => {
|
|
1936
1932
|
var {
|
|
1937
1933
|
action,
|
|
@@ -1947,19 +1943,12 @@ var SidebarMenuItem = /*#__PURE__*/react.forwardRef((_ref2, ref) => {
|
|
|
1947
1943
|
} = _ref2;
|
|
1948
1944
|
var [hovered, setHovered] = react.useState(false);
|
|
1949
1945
|
var rootRef = react.useRef(null);
|
|
1950
|
-
var actionsRef = react.useRef(null);
|
|
1951
|
-
var actionsPlaceholderRef = react.useRef(null);
|
|
1952
1946
|
var {
|
|
1953
1947
|
openSidebarContent
|
|
1954
1948
|
} = useSidebarContext();
|
|
1955
1949
|
var {
|
|
1956
1950
|
matches: isHoverSupported
|
|
1957
1951
|
} = matchMedia('(hover: hover)');
|
|
1958
|
-
react.useLayoutEffect(() => {
|
|
1959
|
-
if (actionsRef.current && actionsPlaceholderRef.current) {
|
|
1960
|
-
actionsPlaceholderRef.current.style.width = "".concat(Math.max(0, actionsRef.current.offsetWidth - 8), "px");
|
|
1961
|
-
}
|
|
1962
|
-
});
|
|
1963
1952
|
react.useLayoutEffect(() => {
|
|
1964
1953
|
var rootNode = rootRef.current;
|
|
1965
1954
|
if (rootNode) {
|
|
@@ -1976,10 +1965,10 @@ var SidebarMenuItem = /*#__PURE__*/react.forwardRef((_ref2, ref) => {
|
|
|
1976
1965
|
}
|
|
1977
1966
|
}, [isHoverSupported]);
|
|
1978
1967
|
var badge = !badgeProp || !Number.isFinite(badgeProp) ? null : badgeProp > 999 ? '999+' : badgeProp;
|
|
1979
|
-
return /*#__PURE__*/jsxRuntime.
|
|
1968
|
+
return /*#__PURE__*/jsxRuntime.jsx(SidebarMenuItemRoot, {
|
|
1980
1969
|
ref: ui.mergeRefs(ref, rootRef),
|
|
1981
1970
|
hasAvatar: !!avatar,
|
|
1982
|
-
children:
|
|
1971
|
+
children: /*#__PURE__*/jsxRuntime.jsx(core.ButtonBase, {
|
|
1983
1972
|
disabled: disabled,
|
|
1984
1973
|
"aria-current": selected,
|
|
1985
1974
|
onClick: event => {
|
|
@@ -2024,24 +2013,19 @@ var SidebarMenuItem = /*#__PURE__*/react.forwardRef((_ref2, ref) => {
|
|
|
2024
2013
|
})
|
|
2025
2014
|
})
|
|
2026
2015
|
})
|
|
2016
|
+
}), (!!action || !!secondaryActions) && /*#__PURE__*/jsxRuntime.jsx(ui.Column, {
|
|
2017
|
+
width: "content",
|
|
2018
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(ui.Inline, {
|
|
2019
|
+
children: [(selected || hovered) && secondaryActions, action]
|
|
2020
|
+
})
|
|
2027
2021
|
}), !!badge && /*#__PURE__*/jsxRuntime.jsx(ui.Column, {
|
|
2028
2022
|
width: "content",
|
|
2029
2023
|
children: /*#__PURE__*/jsxRuntime.jsx(SidebarMenuItemBadge, {
|
|
2030
2024
|
children: badge
|
|
2031
2025
|
})
|
|
2032
|
-
}), (!!action || !!secondaryActions) && /*#__PURE__*/jsxRuntime.jsx(ui.Column, {
|
|
2033
|
-
width: "content",
|
|
2034
|
-
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2035
|
-
ref: actionsPlaceholderRef
|
|
2036
|
-
})
|
|
2037
2026
|
})]
|
|
2038
2027
|
})
|
|
2039
|
-
})
|
|
2040
|
-
ref: actionsRef,
|
|
2041
|
-
children: /*#__PURE__*/jsxRuntime.jsxs(ui.Inline, {
|
|
2042
|
-
children: [hovered && secondaryActions, action]
|
|
2043
|
-
})
|
|
2044
|
-
})]
|
|
2028
|
+
})
|
|
2045
2029
|
});
|
|
2046
2030
|
});
|
|
2047
2031
|
if (process.env.NODE_ENV !== "production") SidebarMenuItem.displayName = "SidebarMenuItem";
|