@equinor/eds-core-react 0.14.3 → 0.15.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/core-react.cjs.js +82 -44
- package/dist/core-react.esm.js +82 -44
- package/dist/core-react.umd.js +82 -44
- package/dist/types/components/Card/CardContent.d.ts +3 -0
- package/dist/types/components/Card/index.d.ts +3 -1
- package/dist/types/components/Menu/Menu.d.ts +2 -2
- package/dist/types/components/Menu/MenuItem.d.ts +2 -2
- package/dist/types/components/Menu/MenuList.d.ts +1 -1
- package/dist/types/components/Table/Cell.d.ts +2 -2
- package/dist/types/components/Table/DataCell/DataCell.d.ts +1 -1
- package/dist/types/components/Table/HeaderCell/HeaderCell.d.ts +1 -1
- package/package.json +1 -2
package/dist/core-react.cjs.js
CHANGED
|
@@ -2256,7 +2256,7 @@ var shape$3 = {
|
|
|
2256
2256
|
borderRadius: ''
|
|
2257
2257
|
}
|
|
2258
2258
|
};
|
|
2259
|
-
var spacings$
|
|
2259
|
+
var spacings$9 = {
|
|
2260
2260
|
comfortable: {
|
|
2261
2261
|
xxx_large: '48px',
|
|
2262
2262
|
xx_large: '40px',
|
|
@@ -2711,7 +2711,7 @@ var tokens$6 = {
|
|
|
2711
2711
|
elevation: elevation$1,
|
|
2712
2712
|
interactions: interactions,
|
|
2713
2713
|
shape: shape$3,
|
|
2714
|
-
spacings: spacings$
|
|
2714
|
+
spacings: spacings$9,
|
|
2715
2715
|
typography: typography$j
|
|
2716
2716
|
};
|
|
2717
2717
|
|
|
@@ -2730,7 +2730,7 @@ var buttonTypography = tokens$6.typography.navigation.button,
|
|
|
2730
2730
|
_tokens$clickbounds$3 = tokens$6.clickbounds,
|
|
2731
2731
|
clicboundHeight$1 = _tokens$clickbounds$3.default__base,
|
|
2732
2732
|
compactClickboundHeight$1 = _tokens$clickbounds$3.compact__standard;
|
|
2733
|
-
var button = {
|
|
2733
|
+
var button$1 = {
|
|
2734
2734
|
background: 'transparent',
|
|
2735
2735
|
height: buttonHeight,
|
|
2736
2736
|
typography: Object.assign(Object.assign({}, buttonTypography), {
|
|
@@ -3045,7 +3045,7 @@ var _tokens$colors$i = tokens$6.colors,
|
|
|
3045
3045
|
dangerColor$3 = _tokens$colors$intera$j.danger__resting.rgba,
|
|
3046
3046
|
dangerHoverColor$3 = _tokens$colors$intera$j.danger__hover.rgba,
|
|
3047
3047
|
buttonBorderRadius$1 = tokens$6.shape.button.borderRadius;
|
|
3048
|
-
var primary$9 = mergeDeepRight(button, {
|
|
3048
|
+
var primary$9 = mergeDeepRight(button$1, {
|
|
3049
3049
|
background: primaryColor$8,
|
|
3050
3050
|
typography: {
|
|
3051
3051
|
color: primaryWhite
|
|
@@ -3103,7 +3103,7 @@ var _tokens$colors$intera$i = tokens$6.colors.interactive,
|
|
|
3103
3103
|
dangerHoverColor$2 = _tokens$colors$intera$i.danger__hover.rgba,
|
|
3104
3104
|
dangerHoverAltColor$2 = _tokens$colors$intera$i.danger__highlight.rgba,
|
|
3105
3105
|
buttonBorderRadius = tokens$6.shape.button.borderRadius;
|
|
3106
|
-
var primary$8 = mergeDeepRight(button, {
|
|
3106
|
+
var primary$8 = mergeDeepRight(button$1, {
|
|
3107
3107
|
typography: {
|
|
3108
3108
|
color: primaryColor$7
|
|
3109
3109
|
},
|
|
@@ -3181,7 +3181,7 @@ var _tokens$colors$intera$h = tokens$6.colors.interactive,
|
|
|
3181
3181
|
dangerColor$1 = _tokens$colors$intera$h.danger__resting.rgba,
|
|
3182
3182
|
dangerHoverColor$1 = _tokens$colors$intera$h.danger__hover.rgba,
|
|
3183
3183
|
dangerHoverAltColor$1 = _tokens$colors$intera$h.danger__highlight.rgba;
|
|
3184
|
-
var primary$7 = mergeDeepRight(button, {
|
|
3184
|
+
var primary$7 = mergeDeepRight(button$1, {
|
|
3185
3185
|
typography: {
|
|
3186
3186
|
color: primaryColor$6
|
|
3187
3187
|
},
|
|
@@ -3240,7 +3240,7 @@ var _tokens$colors$intera$g = tokens$6.colors.interactive,
|
|
|
3240
3240
|
clicboundHeight = _tokens$clickbounds$2.default__base,
|
|
3241
3241
|
compactClickboundHeight = _tokens$clickbounds$2.compact__standard,
|
|
3242
3242
|
shape$2 = tokens$6.shape;
|
|
3243
|
-
var primary$6 = mergeDeepRight(button, {
|
|
3243
|
+
var primary$6 = mergeDeepRight(button$1, {
|
|
3244
3244
|
height: shape$2.icon_button.minHeight,
|
|
3245
3245
|
width: shape$2.icon_button.minWidth,
|
|
3246
3246
|
typography: {
|
|
@@ -7815,7 +7815,7 @@ var List$2 = /*#__PURE__*/React.forwardRef(function List(_a, ref) {
|
|
|
7815
7815
|
}), void 0);
|
|
7816
7816
|
}); // List.displayName = 'List'
|
|
7817
7817
|
|
|
7818
|
-
var ListItem$
|
|
7818
|
+
var ListItem$2 = /*#__PURE__*/React.forwardRef(function ListItem(_a, ref) {
|
|
7819
7819
|
var children = _a.children,
|
|
7820
7820
|
props = __rest(_a, ["children"]);
|
|
7821
7821
|
|
|
@@ -7827,7 +7827,7 @@ var ListItem$4 = /*#__PURE__*/React.forwardRef(function ListItem(_a, ref) {
|
|
|
7827
7827
|
}); // ListItem.displayName = 'ListItem'
|
|
7828
7828
|
|
|
7829
7829
|
var List$1 = List$2;
|
|
7830
|
-
List$1.Item = ListItem$
|
|
7830
|
+
List$1.Item = ListItem$2;
|
|
7831
7831
|
List$1.Item.displayName = 'List.Item';
|
|
7832
7832
|
|
|
7833
7833
|
var Accordion$1 = /*#__PURE__*/React.forwardRef(function Accordion(_a, ref) {
|
|
@@ -8672,13 +8672,13 @@ var primary$3 = primary$4;
|
|
|
8672
8672
|
var StyledCard = styled__default['default'].div.withConfig({
|
|
8673
8673
|
displayName: "Card__StyledCard",
|
|
8674
8674
|
componentId: "sc-bjucjn-0"
|
|
8675
|
-
})(["height:fit-content;width:100%;position:relative;background-color:", ";box-sizing:border-box;display:grid;grid-gap:16px;grid-auto-columns:auto;align-items:center;align-content:start;cursor:", ";", ";"
|
|
8675
|
+
})(["height:fit-content;width:100%;position:relative;background-color:", ";box-sizing:border-box;display:grid;grid-gap:16px;grid-auto-columns:auto;align-items:center;align-content:start;cursor:", ";", ";"], function (_ref) {
|
|
8676
8676
|
var background = _ref.background;
|
|
8677
8677
|
return background;
|
|
8678
8678
|
}, function (_ref2) {
|
|
8679
8679
|
var cursor = _ref2.cursor;
|
|
8680
8680
|
return cursor;
|
|
8681
|
-
}, bordersTemplate(primary$3.border)
|
|
8681
|
+
}, bordersTemplate(primary$3.border));
|
|
8682
8682
|
var Card$1 = /*#__PURE__*/React.forwardRef(function Card(_a, ref) {
|
|
8683
8683
|
var children = _a.children,
|
|
8684
8684
|
_a$variant = _a.variant,
|
|
@@ -8701,13 +8701,14 @@ var Card$1 = /*#__PURE__*/React.forwardRef(function Card(_a, ref) {
|
|
|
8701
8701
|
}), void 0);
|
|
8702
8702
|
});
|
|
8703
8703
|
|
|
8704
|
+
var spacings$8 = primary$4.spacings;
|
|
8704
8705
|
var StyledCardActions = styled__default['default'].div.withConfig({
|
|
8705
8706
|
displayName: "CardActions__StyledCardActions",
|
|
8706
8707
|
componentId: "sc-1d5vskp-0"
|
|
8707
|
-
})(["display:grid;grid-gap:8px;grid-auto-flow:column;align-items:center;justify-content:", ";"], function (_ref) {
|
|
8708
|
+
})(["display:grid;grid-gap:8px;grid-auto-flow:column;align-items:center;justify-content:", ";padding:0 ", " 0 ", ";:first-child{padding-top:", ";}:last-child{padding-bottom:", ";}"], function (_ref) {
|
|
8708
8709
|
var justifyContent = _ref.justifyContent;
|
|
8709
8710
|
return justifyContent;
|
|
8710
|
-
});
|
|
8711
|
+
}, spacings$8.right, spacings$8.left, spacings$8.top, spacings$8.bottom);
|
|
8711
8712
|
var CardActions = /*#__PURE__*/React.forwardRef(function CardActions(_a, ref) {
|
|
8712
8713
|
var children = _a.children,
|
|
8713
8714
|
_a$alignRight = _a.alignRight,
|
|
@@ -8730,14 +8731,30 @@ var CardActions = /*#__PURE__*/React.forwardRef(function CardActions(_a, ref) {
|
|
|
8730
8731
|
}), void 0);
|
|
8731
8732
|
});
|
|
8732
8733
|
|
|
8734
|
+
var spacings$7 = primary$4.spacings;
|
|
8735
|
+
var StyledCardContent = styled__default['default'].div.withConfig({
|
|
8736
|
+
displayName: "CardContent__StyledCardContent",
|
|
8737
|
+
componentId: "sc-esm4ym-0"
|
|
8738
|
+
})(["display:grid;padding:0 ", " 0 ", ";:last-child{padding-bottom:", ";}"], spacings$7.right, spacings$7.left, spacings$7.bottom);
|
|
8739
|
+
var CardContent = /*#__PURE__*/React.forwardRef(function CardContent(_a, ref) {
|
|
8740
|
+
var children = _a.children,
|
|
8741
|
+
props = __rest(_a, ["children"]);
|
|
8742
|
+
|
|
8743
|
+
return jsxRuntime.exports.jsx(StyledCardContent, Object.assign({
|
|
8744
|
+
ref: ref
|
|
8745
|
+
}, props, {
|
|
8746
|
+
children: children
|
|
8747
|
+
}), void 0);
|
|
8748
|
+
});
|
|
8749
|
+
|
|
8733
8750
|
var spacings$6 = primary$4.spacings,
|
|
8734
8751
|
border$5 = primary$4.border;
|
|
8735
8752
|
var StyledCardMedia = styled__default['default'].div.withConfig({
|
|
8736
8753
|
displayName: "CardMedia__StyledCardMedia",
|
|
8737
8754
|
componentId: "sc-kr8q9c-0"
|
|
8738
|
-
})(["display:flex;width:
|
|
8755
|
+
})(["display:flex;width:auto;", ""], function (_ref) {
|
|
8739
8756
|
var fullWidth = _ref.fullWidth;
|
|
8740
|
-
return fullWidth ? styled.css(["> *{width:
|
|
8757
|
+
return fullWidth ? styled.css(["> *{width:100%;}&:first-child{img{border-top-right-radius:", ";border-top-left-radius:", ";}}&:last-child{img{border-bottom-right-radius:", ";border-bottom-left-radius:", ";}}"], border$5.type === 'border' && border$5.radius, border$5.type === 'border' && border$5.radius, border$5.type === 'border' && border$5.radius, border$5.type === 'border' && border$5.radius) : styled.css(["padding:0 ", " 0 ", ";&:first-child{padding:", " ", " 0 ", ";}&:last-child{padding:0 ", " ", " ", ";}> *{width:100%;}"], spacings$6.right, spacings$6.left, spacings$6.top, spacings$6.right, spacings$6.left, spacings$6.right, spacings$6.bottom, spacings$6.left);
|
|
8741
8758
|
});
|
|
8742
8759
|
var CardMedia = /*#__PURE__*/React.forwardRef(function CardMedia(_a, ref) {
|
|
8743
8760
|
var children = _a.children,
|
|
@@ -8758,7 +8775,7 @@ var spacings$5 = primary$4.spacings;
|
|
|
8758
8775
|
var StyledCardHeader = styled__default['default'].div.withConfig({
|
|
8759
8776
|
displayName: "CardHeader__StyledCardHeader",
|
|
8760
8777
|
componentId: "sc-15k8edh-0"
|
|
8761
|
-
})(["display:flex;justify-content:space-between;align-items:center;>:not(:first-child){margin-left:", ";}"], spacings$5.left);
|
|
8778
|
+
})(["display:flex;justify-content:space-between;align-items:center;padding:0 ", " 0 ", ";>:not(:first-child){margin-left:", ";}:first-child{padding-top:", ";}:last-child{padding-bottom:", ";}"], spacings$5.right, spacings$5.left, spacings$5.left, spacings$5.top, spacings$5.bottom);
|
|
8762
8779
|
var CardHeader = /*#__PURE__*/React.forwardRef(function CardHeader(_a, ref) {
|
|
8763
8780
|
var children = _a.children,
|
|
8764
8781
|
rest = __rest(_a, ["children"]);
|
|
@@ -8789,10 +8806,12 @@ var CardHeaderTitle = /*#__PURE__*/React.forwardRef(function CardHeaderTitle(_a,
|
|
|
8789
8806
|
|
|
8790
8807
|
var Card = Card$1;
|
|
8791
8808
|
Card.Actions = CardActions;
|
|
8809
|
+
Card.Content = CardContent;
|
|
8792
8810
|
Card.Header = CardHeader;
|
|
8793
8811
|
Card.Media = CardMedia;
|
|
8794
8812
|
Card.HeaderTitle = CardHeaderTitle;
|
|
8795
8813
|
Card.Actions.displayName = 'Card.Actions';
|
|
8814
|
+
Card.Content.displayName = 'Card.Content';
|
|
8796
8815
|
Card.Header.displayName = 'Card.Header';
|
|
8797
8816
|
Card.Media.displayName = 'Card.Media';
|
|
8798
8817
|
Card.HeaderTitle.displayName = 'Card.HeaderTitle';
|
|
@@ -8843,7 +8862,7 @@ var TopBar$1 = /*#__PURE__*/React.forwardRef(function TopBar(_a, ref) {
|
|
|
8843
8862
|
var StyledActions$1 = styled__default['default'].div.withConfig({
|
|
8844
8863
|
displayName: "Actions__StyledActions",
|
|
8845
8864
|
componentId: "sc-1251ang-0"
|
|
8846
|
-
})(["grid-area:right;text-align:right;"]);
|
|
8865
|
+
})(["grid-area:right;text-align:right;align-items:center;display:flex;"]);
|
|
8847
8866
|
var Actions$1 = /*#__PURE__*/React.forwardRef(function Actions(_a, ref) {
|
|
8848
8867
|
var children = _a.children,
|
|
8849
8868
|
props = __rest(_a, ["children"]);
|
|
@@ -8859,7 +8878,7 @@ var StyledHeader = styled__default['default'].div.withConfig({
|
|
|
8859
8878
|
displayName: "Header__StyledHeader",
|
|
8860
8879
|
componentId: "sc-1fpllve-0"
|
|
8861
8880
|
})(["grid-area:left;display:grid;grid-template-columns:auto auto;grid-gap:24px;align-items:center;"]);
|
|
8862
|
-
var Header$
|
|
8881
|
+
var Header$2 = /*#__PURE__*/React.forwardRef(function Header(_a, ref) {
|
|
8863
8882
|
var children = _a.children,
|
|
8864
8883
|
props = __rest(_a, ["children"]);
|
|
8865
8884
|
|
|
@@ -8887,7 +8906,7 @@ var CustomContent$1 = /*#__PURE__*/React.forwardRef(function CustomContent(_a, r
|
|
|
8887
8906
|
|
|
8888
8907
|
var TopBar = TopBar$1;
|
|
8889
8908
|
TopBar.Actions = Actions$1;
|
|
8890
|
-
TopBar.Header = Header$
|
|
8909
|
+
TopBar.Header = Header$2;
|
|
8891
8910
|
TopBar.CustomContent = CustomContent$1;
|
|
8892
8911
|
TopBar.Actions.displayName = 'Topbar.Actions';
|
|
8893
8912
|
TopBar.Header.displayName = 'Topbar.Header';
|
|
@@ -9315,7 +9334,7 @@ var StyledSideSheet = styled__default['default'].div.withConfig({
|
|
|
9315
9334
|
var width = _ref.width;
|
|
9316
9335
|
return width;
|
|
9317
9336
|
}, bordersTemplate(border$3), spacingsTemplate(spacings$3));
|
|
9318
|
-
var Header = styled__default['default'].div.withConfig({
|
|
9337
|
+
var Header$1 = styled__default['default'].div.withConfig({
|
|
9319
9338
|
displayName: "SideSheet__Header",
|
|
9320
9339
|
componentId: "sc-wkzlnn-1"
|
|
9321
9340
|
})(["display:flex;flex-wrap:nowrap;justify-content:space-between;align-items:center;padding-bottom:24px;padding-right:10px;"]);
|
|
@@ -9338,7 +9357,7 @@ var SideSheet = /*#__PURE__*/React.forwardRef(function SideSheet(_a, ref) {
|
|
|
9338
9357
|
return open && jsxRuntime.exports.jsxs(StyledSideSheet, Object.assign({}, props, {
|
|
9339
9358
|
id: "side-sheet"
|
|
9340
9359
|
}, {
|
|
9341
|
-
children: [jsxRuntime.exports.jsxs(Header, {
|
|
9360
|
+
children: [jsxRuntime.exports.jsxs(Header$1, {
|
|
9342
9361
|
children: [jsxRuntime.exports.jsx(Typography, Object.assign({
|
|
9343
9362
|
variant: "h2"
|
|
9344
9363
|
}, {
|
|
@@ -9723,6 +9742,13 @@ var search = {
|
|
|
9723
9742
|
},
|
|
9724
9743
|
height: '36px'
|
|
9725
9744
|
}
|
|
9745
|
+
},
|
|
9746
|
+
button: {
|
|
9747
|
+
height: '24px',
|
|
9748
|
+
width: '24px',
|
|
9749
|
+
spacings: {
|
|
9750
|
+
right: small$2
|
|
9751
|
+
}
|
|
9726
9752
|
}
|
|
9727
9753
|
}
|
|
9728
9754
|
};
|
|
@@ -9736,6 +9762,7 @@ var height = search.height,
|
|
|
9736
9762
|
_tokens$entities$4 = search.entities,
|
|
9737
9763
|
icon$1 = _tokens$entities$4.icon,
|
|
9738
9764
|
placeholder = _tokens$entities$4.placeholder,
|
|
9765
|
+
button = _tokens$entities$4.button,
|
|
9739
9766
|
states$2 = search.states;
|
|
9740
9767
|
var Container$2 = styled__default['default'].span.withConfig({
|
|
9741
9768
|
displayName: "Search__Container",
|
|
@@ -9754,12 +9781,12 @@ var Input$4 = styled__default['default'].input.withConfig({
|
|
|
9754
9781
|
var disabled = _ref3.disabled;
|
|
9755
9782
|
return disabled && styled.css(["cursor:not-allowed;"]);
|
|
9756
9783
|
});
|
|
9757
|
-
var InsideButton = styled__default['default'].
|
|
9784
|
+
var InsideButton = styled__default['default'](Button).withConfig({
|
|
9758
9785
|
displayName: "Search__InsideButton",
|
|
9759
9786
|
componentId: "sc-v8l23u-2"
|
|
9760
|
-
})(["
|
|
9787
|
+
})(["visibility:hidden;position:absolute;right:", ";height:", ";width:", ";", ""], button.spacings.right, button.height, button.width, function (_ref4) {
|
|
9761
9788
|
var isActive = _ref4.isActive;
|
|
9762
|
-
return isActive && styled.css(["visibility:visible
|
|
9789
|
+
return isActive && styled.css(["visibility:visible;"]);
|
|
9763
9790
|
});
|
|
9764
9791
|
var Search = /*#__PURE__*/React.forwardRef(function Search(_a, ref) {
|
|
9765
9792
|
var _onChange = _a.onChange,
|
|
@@ -9892,8 +9919,6 @@ var Search = /*#__PURE__*/React.forwardRef(function Search(_a, ref) {
|
|
|
9892
9919
|
}), value, defaultValue);
|
|
9893
9920
|
var clearButtonProps = {
|
|
9894
9921
|
isActive: state.isActive,
|
|
9895
|
-
size: size,
|
|
9896
|
-
role: 'button',
|
|
9897
9922
|
onClick: function onClick(e) {
|
|
9898
9923
|
e.stopPropagation();
|
|
9899
9924
|
|
|
@@ -9908,11 +9933,13 @@ var Search = /*#__PURE__*/React.forwardRef(function Search(_a, ref) {
|
|
|
9908
9933
|
"aria-hidden": true,
|
|
9909
9934
|
size: size
|
|
9910
9935
|
}, void 0), jsxRuntime.exports.jsx(Input$4, Object.assign({}, inputProps), void 0), jsxRuntime.exports.jsx(InsideButton, Object.assign({}, clearButtonProps, {
|
|
9911
|
-
"aria-label":
|
|
9936
|
+
"aria-label": 'clear search',
|
|
9937
|
+
title: "clear",
|
|
9938
|
+
variant: "ghost_icon"
|
|
9912
9939
|
}, {
|
|
9913
9940
|
children: jsxRuntime.exports.jsx(Icon$1, {
|
|
9914
9941
|
data: close,
|
|
9915
|
-
size:
|
|
9942
|
+
size: 16
|
|
9916
9943
|
}, void 0)
|
|
9917
9944
|
}), void 0)]
|
|
9918
9945
|
}), void 0);
|
|
@@ -11397,7 +11424,7 @@ var OrderedList$1 = styled__default['default'].ol.withConfig({
|
|
|
11397
11424
|
displayName: "Breadcrumbs__OrderedList",
|
|
11398
11425
|
componentId: "sc-12awlbz-0"
|
|
11399
11426
|
})(["list-style:none;display:flex;padding:0;margin:0;flex-wrap:wrap;"]);
|
|
11400
|
-
var ListItem$
|
|
11427
|
+
var ListItem$1 = styled__default['default'].li.withConfig({
|
|
11401
11428
|
displayName: "Breadcrumbs__ListItem",
|
|
11402
11429
|
componentId: "sc-12awlbz-1"
|
|
11403
11430
|
})(["display:inline-block;"]);
|
|
@@ -11438,7 +11465,7 @@ var Breadcrumbs$1 = /*#__PURE__*/React.forwardRef(function Breadcrumbs(_a, ref)
|
|
|
11438
11465
|
}
|
|
11439
11466
|
|
|
11440
11467
|
return [allCrumbs[0], jsxRuntime.exports.jsxs(React.Fragment, {
|
|
11441
|
-
children: [jsxRuntime.exports.jsx(ListItem$
|
|
11468
|
+
children: [jsxRuntime.exports.jsx(ListItem$1, {
|
|
11442
11469
|
children: jsxRuntime.exports.jsx(Collapsed, Object.assign({
|
|
11443
11470
|
link: true,
|
|
11444
11471
|
role: "button",
|
|
@@ -11464,7 +11491,7 @@ var Breadcrumbs$1 = /*#__PURE__*/React.forwardRef(function Breadcrumbs(_a, ref)
|
|
|
11464
11491
|
var allCrumbs = React.Children.toArray(children).map(function (child, index) {
|
|
11465
11492
|
return (// eslint-disable-next-line react/no-array-index-key
|
|
11466
11493
|
jsxRuntime.exports.jsxs(React.Fragment, {
|
|
11467
|
-
children: [jsxRuntime.exports.jsx(ListItem$
|
|
11494
|
+
children: [jsxRuntime.exports.jsx(ListItem$1, {
|
|
11468
11495
|
children: child
|
|
11469
11496
|
}, void 0), index !== React.Children.toArray(children).length - 1 && jsxRuntime.exports.jsx("li", Object.assign({
|
|
11470
11497
|
"aria-hidden": true
|
|
@@ -11557,9 +11584,14 @@ var MenuProvider = function MenuProvider(_ref) {
|
|
|
11557
11584
|
};
|
|
11558
11585
|
|
|
11559
11586
|
var setOnClose = function setOnClose(onClose) {
|
|
11587
|
+
var onCloseHelper = function onCloseHelper() {
|
|
11588
|
+
onClose();
|
|
11589
|
+
setFocusedIndex(-1);
|
|
11590
|
+
};
|
|
11591
|
+
|
|
11560
11592
|
setState(function (prevState) {
|
|
11561
11593
|
return Object.assign(Object.assign({}, prevState), {
|
|
11562
|
-
onClose:
|
|
11594
|
+
onClose: onCloseHelper
|
|
11563
11595
|
});
|
|
11564
11596
|
});
|
|
11565
11597
|
};
|
|
@@ -11686,16 +11718,16 @@ var typography$2 = menu.typography,
|
|
|
11686
11718
|
hover = _tokens$entities$item.hover,
|
|
11687
11719
|
disabledToken = _tokens$entities$item.disabled,
|
|
11688
11720
|
icon = _tokens$entities.icon;
|
|
11689
|
-
var
|
|
11721
|
+
var Item = styled__default['default'].button.attrs(function (_ref) {
|
|
11690
11722
|
var isFocused = _ref.isFocused;
|
|
11691
11723
|
return {
|
|
11692
11724
|
role: 'menuitem',
|
|
11693
11725
|
tabIndex: isFocused ? -1 : 0
|
|
11694
11726
|
};
|
|
11695
11727
|
}).withConfig({
|
|
11696
|
-
displayName: "
|
|
11728
|
+
displayName: "MenuItem__Item",
|
|
11697
11729
|
componentId: "sc-1g9fpbe-0"
|
|
11698
|
-
})(["width:auto;position:relative;z-index:2;", " ", " ", " ", ""], typographyTemplate(typography$2), function (_ref2) {
|
|
11730
|
+
})(["border:0;background-color:transparent;width:auto;position:relative;z-index:2;", " ", " ", " ", ""], typographyTemplate(typography$2), function (_ref2) {
|
|
11699
11731
|
var theme = _ref2.theme;
|
|
11700
11732
|
return spacingsTemplate(theme.entities.item.spacings);
|
|
11701
11733
|
}, function (_ref3) {
|
|
@@ -11703,7 +11735,7 @@ var ListItem$2 = styled__default['default'].li.attrs(function (_ref) {
|
|
|
11703
11735
|
return active && styled.css(["background:", ";*{color:", ";}"], activeToken.background, activeToken.typography.color);
|
|
11704
11736
|
}, function (_ref4) {
|
|
11705
11737
|
var disabled = _ref4.disabled;
|
|
11706
|
-
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{", "}"], hover.background, outlineTemplate(focus.outline));
|
|
11738
|
+
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, outlineTemplate(focus.outline));
|
|
11707
11739
|
});
|
|
11708
11740
|
var Content = styled__default['default'].div.withConfig({
|
|
11709
11741
|
displayName: "MenuItem__Content",
|
|
@@ -11733,7 +11765,7 @@ var MenuItem = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function M
|
|
|
11733
11765
|
disabled: disabled,
|
|
11734
11766
|
isFocused: isFocused
|
|
11735
11767
|
});
|
|
11736
|
-
return jsxRuntime.exports.jsx(
|
|
11768
|
+
return jsxRuntime.exports.jsx(Item, Object.assign({}, props, {
|
|
11737
11769
|
ref: useCombinedRefs(ref, function (el) {
|
|
11738
11770
|
if (el !== null && isFocused) {
|
|
11739
11771
|
el.focus();
|
|
@@ -11743,7 +11775,7 @@ var MenuItem = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function M
|
|
|
11743
11775
|
return toggleFocus(index);
|
|
11744
11776
|
},
|
|
11745
11777
|
onClick: function onClick(e) {
|
|
11746
|
-
if (
|
|
11778
|
+
if (_onClick) {
|
|
11747
11779
|
_onClick(e);
|
|
11748
11780
|
|
|
11749
11781
|
if (onClose !== null) {
|
|
@@ -11759,12 +11791,12 @@ var MenuItem = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function M
|
|
|
11759
11791
|
}));
|
|
11760
11792
|
MenuItem.displayName = 'MenuItem';
|
|
11761
11793
|
|
|
11762
|
-
var
|
|
11794
|
+
var Header = styled__default['default'].div.attrs(function () {
|
|
11763
11795
|
return {
|
|
11764
11796
|
tabIndex: 0
|
|
11765
11797
|
};
|
|
11766
11798
|
}).withConfig({
|
|
11767
|
-
displayName: "
|
|
11799
|
+
displayName: "MenuSection__Header",
|
|
11768
11800
|
componentId: "sc-gfcbvg-0"
|
|
11769
11801
|
})(["", " &:focus{outline:none;}"], spacingsTemplate(menu.entities.title.spacings));
|
|
11770
11802
|
var MenuSection = /*#__PURE__*/React__namespace.memo(function MenuSection(props) {
|
|
@@ -11772,11 +11804,11 @@ var MenuSection = /*#__PURE__*/React__namespace.memo(function MenuSection(props)
|
|
|
11772
11804
|
title = props.title,
|
|
11773
11805
|
index = props.index;
|
|
11774
11806
|
return jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment, {
|
|
11775
|
-
children: [index !== 0 && jsxRuntime.exports.jsx("
|
|
11807
|
+
children: [index !== 0 && jsxRuntime.exports.jsx("div", {
|
|
11776
11808
|
children: jsxRuntime.exports.jsx(Divider, {
|
|
11777
11809
|
variant: "small"
|
|
11778
11810
|
}, void 0)
|
|
11779
|
-
}, void 0), title && jsxRuntime.exports.jsx(
|
|
11811
|
+
}, void 0), title && jsxRuntime.exports.jsx(Header, {
|
|
11780
11812
|
children: jsxRuntime.exports.jsx(Typography, Object.assign({
|
|
11781
11813
|
group: "navigation",
|
|
11782
11814
|
variant: "label"
|
|
@@ -11787,10 +11819,10 @@ var MenuSection = /*#__PURE__*/React__namespace.memo(function MenuSection(props)
|
|
|
11787
11819
|
}, void 0);
|
|
11788
11820
|
});
|
|
11789
11821
|
|
|
11790
|
-
var List = styled__default['default'].
|
|
11822
|
+
var List = styled__default['default'].div.withConfig({
|
|
11791
11823
|
displayName: "MenuList__List",
|
|
11792
11824
|
componentId: "sc-104rzof-0"
|
|
11793
|
-
})(["position:relative;list-style:none;margin:0;", " li:first-child{z-index:3;}"], spacingsTemplate(menu.spacings));
|
|
11825
|
+
})(["position:relative;list-style:none;display:flex;flex-direction:column;margin:0;", " li:first-child{z-index:3;}"], spacingsTemplate(menu.spacings));
|
|
11794
11826
|
|
|
11795
11827
|
function isIndexable(item) {
|
|
11796
11828
|
if ( /*#__PURE__*/React.isValidElement(item) && !item.props.disabled && item.type === MenuItem) return true;
|
|
@@ -11911,6 +11943,12 @@ var MenuContainer = /*#__PURE__*/React.forwardRef(function MenuContainer(_a, ref
|
|
|
11911
11943
|
useGlobalKeyPress('Escape', function () {
|
|
11912
11944
|
if (open && onClose !== null) {
|
|
11913
11945
|
onClose();
|
|
11946
|
+
anchorEl.focus();
|
|
11947
|
+
}
|
|
11948
|
+
});
|
|
11949
|
+
useGlobalKeyPress('Enter', function () {
|
|
11950
|
+
if (open && onClose !== null) {
|
|
11951
|
+
if (window.document.contains(anchorEl)) anchorEl.focus();
|
|
11914
11952
|
}
|
|
11915
11953
|
});
|
|
11916
11954
|
return jsxRuntime.exports.jsx(MenuList, Object.assign({}, rest, {
|