@equinor/eds-core-react 0.31.0 → 0.31.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.
|
@@ -6628,7 +6628,7 @@ var menu = {
|
|
|
6628
6628
|
}
|
|
6629
6629
|
};
|
|
6630
6630
|
|
|
6631
|
-
var _excluded$k = ["children", "disabled", "index", "as", "onClick", "closeMenuOnClick"];
|
|
6631
|
+
var _excluded$k = ["children", "disabled", "active", "index", "as", "onClick", "closeMenuOnClick"];
|
|
6632
6632
|
var typography$2 = menu.typography,
|
|
6633
6633
|
_tokens$entities = menu.entities,
|
|
6634
6634
|
_tokens$entities$item = _tokens$entities.item.states,
|
|
@@ -6650,8 +6650,8 @@ var Item = styled__default["default"].button.attrs(function (_ref) {
|
|
|
6650
6650
|
var theme = _ref2.theme;
|
|
6651
6651
|
return edsUtils.spacingsTemplate(theme.entities.item.spacings);
|
|
6652
6652
|
}, function (_ref3) {
|
|
6653
|
-
var active = _ref3
|
|
6654
|
-
return active && styled.css(["background:", ";*{color:", ";}"], activeToken.background, activeToken.typography.color);
|
|
6653
|
+
var $active = _ref3.$active;
|
|
6654
|
+
return $active && styled.css(["background:", ";*{color:", ";}"], activeToken.background, activeToken.typography.color);
|
|
6655
6655
|
}, function (_ref4) {
|
|
6656
6656
|
var disabled = _ref4.disabled;
|
|
6657
6657
|
return disabled ? styled.css(["*{color:", ";}svg{fill:", ";}&:focus{outline:none;}@media (hover:hover) and (pointer:fine){&:hover{cursor:not-allowed;}}"], disabledToken.typography.color, icon.states.disabled.typography.color) : styled.css(["@media (hover:hover) and (pointer:fine){&:hover{z-index:1;cursor:pointer;background:", ";}}&:focus{z-index:3;", "}"], hover.background, edsUtils.outlineTemplate(focus$2.outline));
|
|
@@ -6663,6 +6663,7 @@ var Content = styled__default["default"].div.withConfig({
|
|
|
6663
6663
|
var MenuItem$1 = /*#__PURE__*/react.forwardRef(function MenuItem(_ref5, ref) {
|
|
6664
6664
|
var children = _ref5.children,
|
|
6665
6665
|
disabled = _ref5.disabled,
|
|
6666
|
+
active = _ref5.active,
|
|
6666
6667
|
_ref5$index = _ref5.index,
|
|
6667
6668
|
index = _ref5$index === void 0 ? 0 : _ref5$index,
|
|
6668
6669
|
_ref5$as = _ref5.as,
|
|
@@ -6687,6 +6688,7 @@ var MenuItem$1 = /*#__PURE__*/react.forwardRef(function MenuItem(_ref5, ref) {
|
|
|
6687
6688
|
$isFocused: isFocused
|
|
6688
6689
|
});
|
|
6689
6690
|
return /*#__PURE__*/jsxRuntime.jsx(Item, _objectSpread__default["default"](_objectSpread__default["default"]({}, props), {}, {
|
|
6691
|
+
$active: active,
|
|
6690
6692
|
ref: edsUtils.mergeRefs(ref, function (el) {
|
|
6691
6693
|
if (isFocused) {
|
|
6692
6694
|
requestAnimationFrame(function () {
|
|
@@ -7,7 +7,7 @@ import { typographyTemplate, spacingsTemplate, outlineTemplate, mergeRefs } from
|
|
|
7
7
|
import { useMenu } from './Menu.context.js';
|
|
8
8
|
import { jsx } from 'react/jsx-runtime';
|
|
9
9
|
|
|
10
|
-
var _excluded = ["children", "disabled", "index", "as", "onClick", "closeMenuOnClick"];
|
|
10
|
+
var _excluded = ["children", "disabled", "active", "index", "as", "onClick", "closeMenuOnClick"];
|
|
11
11
|
var typography = menu.typography,
|
|
12
12
|
_tokens$entities = menu.entities,
|
|
13
13
|
_tokens$entities$item = _tokens$entities.item.states,
|
|
@@ -29,8 +29,8 @@ var Item = styled.button.attrs(function (_ref) {
|
|
|
29
29
|
var theme = _ref2.theme;
|
|
30
30
|
return spacingsTemplate(theme.entities.item.spacings);
|
|
31
31
|
}, function (_ref3) {
|
|
32
|
-
var active = _ref3
|
|
33
|
-
return active && css(["background:", ";*{color:", ";}"], activeToken.background, activeToken.typography.color);
|
|
32
|
+
var $active = _ref3.$active;
|
|
33
|
+
return $active && css(["background:", ";*{color:", ";}"], activeToken.background, activeToken.typography.color);
|
|
34
34
|
}, function (_ref4) {
|
|
35
35
|
var disabled = _ref4.disabled;
|
|
36
36
|
return disabled ? css(["*{color:", ";}svg{fill:", ";}&:focus{outline:none;}@media (hover:hover) and (pointer:fine){&:hover{cursor:not-allowed;}}"], disabledToken.typography.color, icon.states.disabled.typography.color) : css(["@media (hover:hover) and (pointer:fine){&:hover{z-index:1;cursor:pointer;background:", ";}}&:focus{z-index:3;", "}"], hover.background, outlineTemplate(focus.outline));
|
|
@@ -42,6 +42,7 @@ var Content = styled.div.withConfig({
|
|
|
42
42
|
var MenuItem = /*#__PURE__*/forwardRef(function MenuItem(_ref5, ref) {
|
|
43
43
|
var children = _ref5.children,
|
|
44
44
|
disabled = _ref5.disabled,
|
|
45
|
+
active = _ref5.active,
|
|
45
46
|
_ref5$index = _ref5.index,
|
|
46
47
|
index = _ref5$index === void 0 ? 0 : _ref5$index,
|
|
47
48
|
_ref5$as = _ref5.as,
|
|
@@ -66,6 +67,7 @@ var MenuItem = /*#__PURE__*/forwardRef(function MenuItem(_ref5, ref) {
|
|
|
66
67
|
$isFocused: isFocused
|
|
67
68
|
});
|
|
68
69
|
return /*#__PURE__*/jsx(Item, _objectSpread(_objectSpread({}, props), {}, {
|
|
70
|
+
$active: active,
|
|
69
71
|
ref: mergeRefs(ref, function (el) {
|
|
70
72
|
if (isFocused) {
|
|
71
73
|
requestAnimationFrame(function () {
|