@equinor/eds-core-react 0.20.1 → 0.20.3
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/eds-core-react.cjs.js +230 -96
- package/dist/esm/components/Accordion/AccordionHeader.js +58 -27
- package/dist/esm/components/Accordion/AccordionHeaderActions.js +43 -0
- package/dist/esm/components/Accordion/AccordionHeaderTitle.js +7 -2
- package/dist/esm/components/Accordion/index.js +3 -0
- package/dist/esm/components/Autocomplete/Autocomplete.js +61 -16
- package/dist/esm/components/Banner/Banner.js +6 -7
- package/dist/esm/components/Card/Card.js +6 -2
- package/dist/esm/components/Paper/Paper.js +1 -1
- package/dist/esm/components/Paper/Paper.tokens.js +0 -2
- package/dist/esm/components/Tabs/Tab.js +2 -2
- package/dist/esm/components/Tabs/TabPanel.js +2 -2
- package/dist/esm/components/Tabs/Tabs.tokens.js +10 -1
- package/dist/esm/components/TopBar/TopBar.js +10 -3
- package/dist/types/components/Accordion/AccordionHeaderActions.d.ts +14 -0
- package/dist/types/components/Accordion/index.d.ts +3 -1
- package/dist/types/components/Autocomplete/Autocomplete.d.ts +3 -2
- package/dist/types/components/Banner/Banner.d.ts +5 -0
- package/dist/types/components/Card/Card.d.ts +7 -0
- package/dist/types/components/TopBar/TopBar.d.ts +9 -2
- package/package.json +5 -5
|
@@ -3172,14 +3172,19 @@ const StyledAccordionHeaderTitle = styled__default["default"].span.withConfig({
|
|
|
3172
3172
|
displayName: "AccordionHeaderTitle__StyledAccordionHeaderTitle",
|
|
3173
3173
|
componentId: "sc-g27uve-0"
|
|
3174
3174
|
})(_ref => {
|
|
3175
|
-
var
|
|
3175
|
+
var _header$states$active;
|
|
3176
3176
|
|
|
3177
3177
|
let {
|
|
3178
3178
|
theme,
|
|
3179
3179
|
isExpanded,
|
|
3180
3180
|
disabled
|
|
3181
3181
|
} = _ref;
|
|
3182
|
-
|
|
3182
|
+
const {
|
|
3183
|
+
entities: {
|
|
3184
|
+
header
|
|
3185
|
+
}
|
|
3186
|
+
} = theme;
|
|
3187
|
+
return styled.css(["display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;flex-grow:1;overflow:hidden;text-align:left;color:", ";"], isExpanded && !disabled ? (_header$states$active = header.states.active.typography) === null || _header$states$active === void 0 ? void 0 : _header$states$active.color : 'inherit');
|
|
3183
3188
|
});
|
|
3184
3189
|
const AccordionHeaderTitle = /*#__PURE__*/react.forwardRef(function AccordionHeaderTitle(_ref2, ref) {
|
|
3185
3190
|
let {
|
|
@@ -3195,6 +3200,44 @@ const AccordionHeaderTitle = /*#__PURE__*/react.forwardRef(function AccordionHea
|
|
|
3195
3200
|
});
|
|
3196
3201
|
}); // AccordionHeaderTitle.displayName = 'AccordionHeaderTitle'
|
|
3197
3202
|
|
|
3203
|
+
const StyledAccordionHeaderActions = styled__default["default"].span.withConfig({
|
|
3204
|
+
displayName: "AccordionHeaderActions__StyledAccordionHeaderActions",
|
|
3205
|
+
componentId: "sc-klu9el-0"
|
|
3206
|
+
})(_ref => {
|
|
3207
|
+
var _header$states$active;
|
|
3208
|
+
|
|
3209
|
+
let {
|
|
3210
|
+
theme,
|
|
3211
|
+
isExpanded,
|
|
3212
|
+
disabled
|
|
3213
|
+
} = _ref;
|
|
3214
|
+
const {
|
|
3215
|
+
entities: {
|
|
3216
|
+
header
|
|
3217
|
+
}
|
|
3218
|
+
} = theme;
|
|
3219
|
+
return styled.css(["display:flex;align-items:center;justify-content:flex-end;padding-right:", ";", " color:", ";"], header.spacings.right, disabled ? styled.css({
|
|
3220
|
+
color: header.states.disabled.typography.color,
|
|
3221
|
+
cursor: 'not-allowed'
|
|
3222
|
+
}) : styled.css({
|
|
3223
|
+
color: header.typography.color,
|
|
3224
|
+
cursor: 'pointer'
|
|
3225
|
+
}), isExpanded && !disabled ? (_header$states$active = header.states.active.typography) === null || _header$states$active === void 0 ? void 0 : _header$states$active.color : 'inherit');
|
|
3226
|
+
});
|
|
3227
|
+
const AccordionHeaderActions = /*#__PURE__*/react.forwardRef(function AccordionHeaderActions(_ref2, ref) {
|
|
3228
|
+
let {
|
|
3229
|
+
isExpanded,
|
|
3230
|
+
disabled,
|
|
3231
|
+
children
|
|
3232
|
+
} = _ref2;
|
|
3233
|
+
return /*#__PURE__*/jsxRuntime.jsx(StyledAccordionHeaderActions, {
|
|
3234
|
+
ref: ref,
|
|
3235
|
+
isExpanded: isExpanded,
|
|
3236
|
+
disabled: disabled,
|
|
3237
|
+
children: children
|
|
3238
|
+
});
|
|
3239
|
+
});
|
|
3240
|
+
|
|
3198
3241
|
const {
|
|
3199
3242
|
entities: {
|
|
3200
3243
|
chevron: chevronToken
|
|
@@ -3203,13 +3246,37 @@ const {
|
|
|
3203
3246
|
const StyledAccordionHeader = styled__default["default"].div.withConfig({
|
|
3204
3247
|
displayName: "AccordionHeader__StyledAccordionHeader",
|
|
3205
3248
|
componentId: "sc-cu2e95-0"
|
|
3206
|
-
})(
|
|
3207
|
-
|
|
3249
|
+
})(_ref => {
|
|
3250
|
+
let {
|
|
3251
|
+
theme,
|
|
3252
|
+
disabled,
|
|
3253
|
+
parentIndex
|
|
3254
|
+
} = _ref;
|
|
3255
|
+
const {
|
|
3256
|
+
entities: {
|
|
3257
|
+
header
|
|
3258
|
+
},
|
|
3259
|
+
border
|
|
3260
|
+
} = theme;
|
|
3261
|
+
return styled.css(["margin:0;padding:0;height:", ";box-sizing:border-box;display:flex;flex-wrap:nowrap;justify-content:space-between;background-color:", ";", " border-top:", ";", ""], header.height, header.background, edsUtils.bordersTemplate(border), parentIndex === 0 ? null : 'none', disabled ? styled.css({
|
|
3262
|
+
color: header.states.disabled.typography.color,
|
|
3263
|
+
cursor: 'not-allowed'
|
|
3264
|
+
}) : styled.css({
|
|
3265
|
+
color: header.typography.color,
|
|
3266
|
+
cursor: 'pointer',
|
|
3267
|
+
'@media (hover: hover) and (pointer: fine)': {
|
|
3268
|
+
':hover': {
|
|
3269
|
+
background: header.states.hover.background
|
|
3270
|
+
}
|
|
3271
|
+
}
|
|
3272
|
+
}));
|
|
3273
|
+
});
|
|
3274
|
+
const StyledAccordionHeaderButton = styled__default["default"].button.attrs(_ref2 => {
|
|
3208
3275
|
let {
|
|
3209
3276
|
panelId,
|
|
3210
3277
|
isExpanded,
|
|
3211
3278
|
disabled
|
|
3212
|
-
} =
|
|
3279
|
+
} = _ref2;
|
|
3213
3280
|
return {
|
|
3214
3281
|
'aria-expanded': isExpanded,
|
|
3215
3282
|
'aria-controls': panelId,
|
|
@@ -3220,46 +3287,39 @@ const StyledAccordionHeaderButton = styled__default["default"].button.attrs(_ref
|
|
|
3220
3287
|
}).withConfig({
|
|
3221
3288
|
displayName: "AccordionHeader__StyledAccordionHeaderButton",
|
|
3222
3289
|
componentId: "sc-cu2e95-1"
|
|
3223
|
-
})(
|
|
3290
|
+
})(_ref3 => {
|
|
3224
3291
|
let {
|
|
3225
3292
|
theme,
|
|
3226
|
-
disabled
|
|
3227
|
-
|
|
3228
|
-
} = _ref2;
|
|
3293
|
+
disabled
|
|
3294
|
+
} = _ref3;
|
|
3229
3295
|
const {
|
|
3230
3296
|
entities: {
|
|
3231
3297
|
header,
|
|
3232
3298
|
icon: iconToken
|
|
3233
|
-
}
|
|
3234
|
-
border
|
|
3299
|
+
}
|
|
3235
3300
|
} = theme;
|
|
3236
|
-
return styled.css(["", " ", "
|
|
3301
|
+
return styled.css(["", " ", " &[data-focus-visible-added]:focus{", "}&:focus-visible{", "}border:0;background-color:transparent;margin:0;display:flex;align-items:center;flex-grow:1;", " > svg{color:", ";}"], edsUtils.typographyTemplate(header.typography), edsUtils.spacingsTemplate(header.spacings), edsUtils.outlineTemplate(header.states.focus.outline), edsUtils.outlineTemplate(header.states.focus.outline), disabled ? styled.css({
|
|
3237
3302
|
color: header.states.disabled.typography.color,
|
|
3238
3303
|
cursor: 'not-allowed'
|
|
3239
3304
|
}) : styled.css({
|
|
3240
3305
|
color: header.typography.color,
|
|
3241
|
-
cursor: 'pointer'
|
|
3242
|
-
'@media (hover: hover) and (pointer: fine)': {
|
|
3243
|
-
':hover': {
|
|
3244
|
-
background: header.states.hover.background
|
|
3245
|
-
}
|
|
3246
|
-
}
|
|
3306
|
+
cursor: 'pointer'
|
|
3247
3307
|
}), iconToken.typography.color);
|
|
3248
3308
|
});
|
|
3249
3309
|
const StyledIcon$1 = styled__default["default"](Icon$1).withConfig({
|
|
3250
3310
|
displayName: "AccordionHeader__StyledIcon",
|
|
3251
3311
|
componentId: "sc-cu2e95-2"
|
|
3252
|
-
})(
|
|
3312
|
+
})(_ref4 => {
|
|
3253
3313
|
let {
|
|
3254
3314
|
chevronPosition
|
|
3255
|
-
} =
|
|
3315
|
+
} = _ref4;
|
|
3256
3316
|
return chevronPosition === 'left' ? {
|
|
3257
3317
|
marginRight: '32px'
|
|
3258
3318
|
} : {
|
|
3259
3319
|
marginLeft: '16px'
|
|
3260
3320
|
};
|
|
3261
3321
|
});
|
|
3262
|
-
const AccordionHeader = /*#__PURE__*/react.forwardRef(function AccordionHeader(
|
|
3322
|
+
const AccordionHeader = /*#__PURE__*/react.forwardRef(function AccordionHeader(_ref5, ref) {
|
|
3263
3323
|
let {
|
|
3264
3324
|
parentIndex,
|
|
3265
3325
|
headerLevel,
|
|
@@ -3271,7 +3331,7 @@ const AccordionHeader = /*#__PURE__*/react.forwardRef(function AccordionHeader(_
|
|
|
3271
3331
|
toggleExpanded,
|
|
3272
3332
|
disabled,
|
|
3273
3333
|
...props
|
|
3274
|
-
} =
|
|
3334
|
+
} = _ref5;
|
|
3275
3335
|
|
|
3276
3336
|
const handleClick = () => {
|
|
3277
3337
|
if (!disabled) {
|
|
@@ -3322,14 +3382,27 @@ const AccordionHeader = /*#__PURE__*/react.forwardRef(function AccordionHeader(_
|
|
|
3322
3382
|
});
|
|
3323
3383
|
}
|
|
3324
3384
|
|
|
3385
|
+
if (child.type === AccordionHeaderActions) {
|
|
3386
|
+
return;
|
|
3387
|
+
}
|
|
3388
|
+
|
|
3325
3389
|
return child;
|
|
3326
3390
|
});
|
|
3391
|
+
const headerActions = react.Children.map(children, child => {
|
|
3392
|
+
if ( /*#__PURE__*/react.isValidElement(child) && child.type === AccordionHeaderActions) {
|
|
3393
|
+
return /*#__PURE__*/react.cloneElement(child, {
|
|
3394
|
+
isExpanded,
|
|
3395
|
+
disabled
|
|
3396
|
+
});
|
|
3397
|
+
}
|
|
3398
|
+
});
|
|
3327
3399
|
const newChildren = [chevron, headerChildren];
|
|
3328
|
-
return /*#__PURE__*/jsxRuntime.
|
|
3400
|
+
return /*#__PURE__*/jsxRuntime.jsxs(StyledAccordionHeader, {
|
|
3401
|
+
disabled: disabled,
|
|
3402
|
+
parentIndex: parentIndex,
|
|
3329
3403
|
as: headerLevel,
|
|
3330
|
-
children: /*#__PURE__*/jsxRuntime.jsx(StyledAccordionHeaderButton, {
|
|
3404
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(StyledAccordionHeaderButton, {
|
|
3331
3405
|
isExpanded: isExpanded,
|
|
3332
|
-
parentIndex: parentIndex,
|
|
3333
3406
|
disabled: disabled,
|
|
3334
3407
|
panelId: panelId,
|
|
3335
3408
|
onClick: handleClick,
|
|
@@ -3337,9 +3410,9 @@ const AccordionHeader = /*#__PURE__*/react.forwardRef(function AccordionHeader(_
|
|
|
3337
3410
|
ref: ref,
|
|
3338
3411
|
...props,
|
|
3339
3412
|
children: chevronPosition === 'left' ? newChildren : newChildren.reverse()
|
|
3340
|
-
})
|
|
3413
|
+
}), headerActions && headerActions]
|
|
3341
3414
|
});
|
|
3342
|
-
});
|
|
3415
|
+
});
|
|
3343
3416
|
|
|
3344
3417
|
const StyledAccordionPanel = styled__default["default"].div.attrs(_ref => {
|
|
3345
3418
|
let {
|
|
@@ -3387,10 +3460,12 @@ const Accordion = Accordion$1;
|
|
|
3387
3460
|
Accordion.Item = AccordionItem;
|
|
3388
3461
|
Accordion.Header = AccordionHeader;
|
|
3389
3462
|
Accordion.HeaderTitle = AccordionHeaderTitle;
|
|
3463
|
+
Accordion.HeaderActions = AccordionHeaderActions;
|
|
3390
3464
|
Accordion.Panel = AccordionPanel;
|
|
3391
3465
|
Accordion.Item.displayName = 'Accordion.Item';
|
|
3392
3466
|
Accordion.Header.displayName = 'Accordion.Header';
|
|
3393
3467
|
Accordion.HeaderTitle.displayName = 'Accordion.HeaderTitle';
|
|
3468
|
+
Accordion.HeaderActions.displayName = 'Accordion.HeaderActions';
|
|
3394
3469
|
Accordion.Panel.displayName = 'Accordion.Panel';
|
|
3395
3470
|
|
|
3396
3471
|
const TabsContext = /*#__PURE__*/react.createContext({
|
|
@@ -3443,6 +3518,12 @@ const {
|
|
|
3443
3518
|
focused: {
|
|
3444
3519
|
width: focusOutlineWidth$5
|
|
3445
3520
|
}
|
|
3521
|
+
},
|
|
3522
|
+
typography: {
|
|
3523
|
+
navigation: {
|
|
3524
|
+
menu_tabs,
|
|
3525
|
+
menu_title
|
|
3526
|
+
}
|
|
3446
3527
|
}
|
|
3447
3528
|
} = edsTokens.tokens;
|
|
3448
3529
|
const token$1 = {
|
|
@@ -3461,6 +3542,8 @@ const token$1 = {
|
|
|
3461
3542
|
color: focusOutlineColor$5
|
|
3462
3543
|
}
|
|
3463
3544
|
}
|
|
3545
|
+
},
|
|
3546
|
+
typography: { ...menu_title
|
|
3464
3547
|
}
|
|
3465
3548
|
},
|
|
3466
3549
|
tab: {
|
|
@@ -3478,7 +3561,8 @@ const token$1 = {
|
|
|
3478
3561
|
},
|
|
3479
3562
|
typography: {
|
|
3480
3563
|
color: defaultColor,
|
|
3481
|
-
textAlign: 'center'
|
|
3564
|
+
textAlign: 'center',
|
|
3565
|
+
...menu_tabs
|
|
3482
3566
|
},
|
|
3483
3567
|
border: {
|
|
3484
3568
|
type: 'bordergroup',
|
|
@@ -3755,7 +3839,7 @@ const StyledTab = styled__default["default"].button.attrs(_ref => {
|
|
|
3755
3839
|
tab
|
|
3756
3840
|
}
|
|
3757
3841
|
} = theme;
|
|
3758
|
-
return styled.css(["appearance:none;box-sizing:border-box;
|
|
3842
|
+
return styled.css(["appearance:none;box-sizing:border-box;border:none;outline:none;height:", ";", " ", " color:", ";background-color:", ";position:relative;white-space:nowrap;text-overflow:ellipsis;overflow-x:hidden;scroll-snap-align:end;scroll-snap-stop:always;&:focus{outline:none;}&[data-focus],&[data-focus-visible-added]:focus{", "}&:focus-visible{", "}&::-moz-focus-inner{border:0;}@media (hover:hover) and (pointer:fine){&[data-hover],&:hover{color:", ";", "}}", " ", ""], tab.height, edsUtils.spacingsTemplate(tab.spacings), edsUtils.typographyTemplate(tab.typography), active ? tab.states.active.typography.color : tab.typography.color, tab.background, edsUtils.outlineTemplate(tab.states.focus.outline), edsUtils.outlineTemplate(tab.states.focus.outline), active ? tab.states.active.states.hover.typography.color : tab.typography.color, disabled ? styled.css(["background:", ";cursor:not-allowed;"], tab.states.disabled.background) : styled.css(["background:", ";cursor:pointer;"], tab.states.hover.background), disabled ? edsUtils.bordersTemplate(tab.states.disabled.border) : edsUtils.bordersTemplate(tab.border), active && edsUtils.bordersTemplate(tab.states.active.border));
|
|
3759
3843
|
});
|
|
3760
3844
|
const Tab = /*#__PURE__*/react.forwardRef(function Tab(props, ref) {
|
|
3761
3845
|
return /*#__PURE__*/jsxRuntime.jsx(StyledTab, {
|
|
@@ -3800,7 +3884,7 @@ const StyledTabPanel = styled__default["default"].div.attrs(() => ({
|
|
|
3800
3884
|
panel
|
|
3801
3885
|
}
|
|
3802
3886
|
} = theme;
|
|
3803
|
-
return styled.css(["", " &:focus{outline:none;}&[data-focus-visible-added]:focus{", "}&:focus-visible{", "}"], edsUtils.spacingsTemplate(panel.spacings), edsUtils.outlineTemplate(panel.states.focus.outline), edsUtils.outlineTemplate(panel.states.focus.outline));
|
|
3887
|
+
return styled.css(["", " ", " &:focus{outline:none;}&[data-focus-visible-added]:focus{", "}&:focus-visible{", "}"], edsUtils.spacingsTemplate(panel.spacings), edsUtils.typographyTemplate(panel.typography), edsUtils.outlineTemplate(panel.states.focus.outline), edsUtils.outlineTemplate(panel.states.focus.outline));
|
|
3804
3888
|
});
|
|
3805
3889
|
const TabPanel = /*#__PURE__*/react.forwardRef(function TabPanel(_ref2, ref) {
|
|
3806
3890
|
let { ...props
|
|
@@ -3823,10 +3907,46 @@ Tabs.Panel.displayName = 'Tabs.Panel';
|
|
|
3823
3907
|
Tabs.List.displayName = 'Tabs.List';
|
|
3824
3908
|
|
|
3825
3909
|
const {
|
|
3910
|
+
elevation,
|
|
3826
3911
|
colors: {
|
|
3827
3912
|
ui: {
|
|
3828
3913
|
background__default: {
|
|
3829
3914
|
rgba: background$c
|
|
3915
|
+
}
|
|
3916
|
+
}
|
|
3917
|
+
}
|
|
3918
|
+
} = edsTokens.tokens;
|
|
3919
|
+
const paper = {
|
|
3920
|
+
background: background$c
|
|
3921
|
+
};
|
|
3922
|
+
|
|
3923
|
+
const StyledPaper = styled__default["default"].div.withConfig({
|
|
3924
|
+
displayName: "Paper__StyledPaper",
|
|
3925
|
+
componentId: "sc-6ncnv9-0"
|
|
3926
|
+
})(["background:", ";box-shadow:", ";"], paper.background, _ref => {
|
|
3927
|
+
let {
|
|
3928
|
+
elevation
|
|
3929
|
+
} = _ref;
|
|
3930
|
+
return elevation;
|
|
3931
|
+
});
|
|
3932
|
+
const Paper = /*#__PURE__*/react.forwardRef(function Paper(_ref2, ref) {
|
|
3933
|
+
let {
|
|
3934
|
+
elevation: elevation$1,
|
|
3935
|
+
...rest
|
|
3936
|
+
} = _ref2;
|
|
3937
|
+
const props = { ...rest,
|
|
3938
|
+
elevation: elevation[elevation$1] || 'none'
|
|
3939
|
+
};
|
|
3940
|
+
return /*#__PURE__*/jsxRuntime.jsx(StyledPaper, { ...props,
|
|
3941
|
+
ref: ref
|
|
3942
|
+
});
|
|
3943
|
+
});
|
|
3944
|
+
|
|
3945
|
+
const {
|
|
3946
|
+
colors: {
|
|
3947
|
+
ui: {
|
|
3948
|
+
background__default: {
|
|
3949
|
+
rgba: background$b
|
|
3830
3950
|
},
|
|
3831
3951
|
background__info: {
|
|
3832
3952
|
rgba: backgroundInfo
|
|
@@ -3851,7 +3971,7 @@ const {
|
|
|
3851
3971
|
}
|
|
3852
3972
|
} = edsTokens.tokens;
|
|
3853
3973
|
const primary$4 = {
|
|
3854
|
-
background: background$
|
|
3974
|
+
background: background$b,
|
|
3855
3975
|
border: {
|
|
3856
3976
|
type: 'border',
|
|
3857
3977
|
radius: borderRadius$8
|
|
@@ -3884,7 +4004,7 @@ var tokens$4 = /*#__PURE__*/Object.freeze({
|
|
|
3884
4004
|
const {
|
|
3885
4005
|
primary: primary$3
|
|
3886
4006
|
} = tokens$4;
|
|
3887
|
-
const StyledCard = styled__default["default"].
|
|
4007
|
+
const StyledCard = styled__default["default"](Paper).withConfig({
|
|
3888
4008
|
displayName: "Card__StyledCard",
|
|
3889
4009
|
componentId: "sc-bjucjn-0"
|
|
3890
4010
|
})(["width:100%;position:relative;background-color:", ";box-sizing:border-box;display:flex;flex-direction:column;grid-gap:16px;cursor:", ";", ";"], _ref => {
|
|
@@ -3902,6 +4022,7 @@ const Card$1 = /*#__PURE__*/react.forwardRef(function Card(_ref3, ref) {
|
|
|
3902
4022
|
let {
|
|
3903
4023
|
children,
|
|
3904
4024
|
variant = 'default',
|
|
4025
|
+
elevation = 'none',
|
|
3905
4026
|
onClick,
|
|
3906
4027
|
...rest
|
|
3907
4028
|
} = _ref3;
|
|
@@ -3914,7 +4035,9 @@ const Card$1 = /*#__PURE__*/react.forwardRef(function Card(_ref3, ref) {
|
|
|
3914
4035
|
cursor,
|
|
3915
4036
|
...rest
|
|
3916
4037
|
};
|
|
3917
|
-
return /*#__PURE__*/jsxRuntime.jsx(StyledCard, {
|
|
4038
|
+
return /*#__PURE__*/jsxRuntime.jsx(StyledCard, {
|
|
4039
|
+
elevation: elevation,
|
|
4040
|
+
...props,
|
|
3918
4041
|
onClick: onClick,
|
|
3919
4042
|
children: children
|
|
3920
4043
|
});
|
|
@@ -4081,7 +4204,7 @@ const topbar = {
|
|
|
4081
4204
|
}
|
|
4082
4205
|
};
|
|
4083
4206
|
|
|
4084
|
-
const StyledTopBar = styled__default["default"].
|
|
4207
|
+
const StyledTopBar = styled__default["default"](Paper).withConfig({
|
|
4085
4208
|
displayName: "TopBar__StyledTopBar",
|
|
4086
4209
|
componentId: "sc-1yj236q-0"
|
|
4087
4210
|
})(_ref => {
|
|
@@ -4093,6 +4216,7 @@ const StyledTopBar = styled__default["default"].header.withConfig({
|
|
|
4093
4216
|
const TopBar$1 = /*#__PURE__*/react.forwardRef(function TopBar(_ref2, ref) {
|
|
4094
4217
|
let {
|
|
4095
4218
|
children,
|
|
4219
|
+
elevation = 'none',
|
|
4096
4220
|
...props
|
|
4097
4221
|
} = _ref2;
|
|
4098
4222
|
const {
|
|
@@ -4101,10 +4225,15 @@ const TopBar$1 = /*#__PURE__*/react.forwardRef(function TopBar(_ref2, ref) {
|
|
|
4101
4225
|
const token = edsUtils.useToken({
|
|
4102
4226
|
density
|
|
4103
4227
|
}, topbar);
|
|
4228
|
+
const rest = { ...props,
|
|
4229
|
+
ref
|
|
4230
|
+
};
|
|
4104
4231
|
return /*#__PURE__*/jsxRuntime.jsx(styled.ThemeProvider, {
|
|
4105
4232
|
theme: token,
|
|
4106
|
-
children: /*#__PURE__*/jsxRuntime.jsx(StyledTopBar, {
|
|
4107
|
-
|
|
4233
|
+
children: /*#__PURE__*/jsxRuntime.jsx(StyledTopBar, {
|
|
4234
|
+
forwardedAs: 'header',
|
|
4235
|
+
elevation: elevation,
|
|
4236
|
+
...rest,
|
|
4108
4237
|
children: children
|
|
4109
4238
|
})
|
|
4110
4239
|
});
|
|
@@ -4166,44 +4295,6 @@ TopBar.Actions.displayName = 'Topbar.Actions';
|
|
|
4166
4295
|
TopBar.Header.displayName = 'Topbar.Header';
|
|
4167
4296
|
TopBar.CustomContent.displayName = 'Topbar.CustomContent';
|
|
4168
4297
|
|
|
4169
|
-
const {
|
|
4170
|
-
elevation,
|
|
4171
|
-
colors: {
|
|
4172
|
-
ui: {
|
|
4173
|
-
background__default: {
|
|
4174
|
-
rgba: background$b
|
|
4175
|
-
}
|
|
4176
|
-
}
|
|
4177
|
-
}
|
|
4178
|
-
} = edsTokens.tokens;
|
|
4179
|
-
const paper = {
|
|
4180
|
-
maxWidth: 'calc(100% - 32px)',
|
|
4181
|
-
minWidth: '96px',
|
|
4182
|
-
background: background$b
|
|
4183
|
-
};
|
|
4184
|
-
|
|
4185
|
-
const StyledPaper = styled__default["default"].div.withConfig({
|
|
4186
|
-
displayName: "Paper__StyledPaper",
|
|
4187
|
-
componentId: "sc-6ncnv9-0"
|
|
4188
|
-
})(["min-width:", ";max-width:", ";background:", ";box-shadow:", ";"], paper.minWidth, paper.maxWidth, paper.background, _ref => {
|
|
4189
|
-
let {
|
|
4190
|
-
elevation
|
|
4191
|
-
} = _ref;
|
|
4192
|
-
return elevation;
|
|
4193
|
-
});
|
|
4194
|
-
const Paper = /*#__PURE__*/react.forwardRef(function Paper(_ref2, ref) {
|
|
4195
|
-
let {
|
|
4196
|
-
elevation: elevation$1,
|
|
4197
|
-
...rest
|
|
4198
|
-
} = _ref2;
|
|
4199
|
-
const props = { ...rest,
|
|
4200
|
-
elevation: elevation[elevation$1] || 'none'
|
|
4201
|
-
};
|
|
4202
|
-
return /*#__PURE__*/jsxRuntime.jsx(StyledPaper, { ...props,
|
|
4203
|
-
ref: ref
|
|
4204
|
-
});
|
|
4205
|
-
});
|
|
4206
|
-
|
|
4207
4298
|
const {
|
|
4208
4299
|
colors: {
|
|
4209
4300
|
ui: {
|
|
@@ -6752,13 +6843,9 @@ const BannerIcon = /*#__PURE__*/react.forwardRef(function BannerIcon(_ref2, ref)
|
|
|
6752
6843
|
});
|
|
6753
6844
|
});
|
|
6754
6845
|
|
|
6755
|
-
const StyledBanner = styled__default["default"].div.withConfig({
|
|
6756
|
-
displayName: "Banner__StyledBanner",
|
|
6757
|
-
componentId: "sc-1ju451i-0"
|
|
6758
|
-
})([""]);
|
|
6759
6846
|
const Content$1 = styled__default["default"].div.withConfig({
|
|
6760
6847
|
displayName: "Banner__Content",
|
|
6761
|
-
componentId: "sc-1ju451i-
|
|
6848
|
+
componentId: "sc-1ju451i-0"
|
|
6762
6849
|
})(_ref => {
|
|
6763
6850
|
let {
|
|
6764
6851
|
theme,
|
|
@@ -6768,12 +6855,13 @@ const Content$1 = styled__default["default"].div.withConfig({
|
|
|
6768
6855
|
});
|
|
6769
6856
|
const NonMarginDivider = styled__default["default"](Divider).withConfig({
|
|
6770
6857
|
displayName: "Banner__NonMarginDivider",
|
|
6771
|
-
componentId: "sc-1ju451i-
|
|
6858
|
+
componentId: "sc-1ju451i-1"
|
|
6772
6859
|
})(["margin:0;height:2px;"]);
|
|
6773
6860
|
const Banner$1 = /*#__PURE__*/react.forwardRef(function Banner(_ref2, ref) {
|
|
6774
6861
|
let {
|
|
6775
6862
|
children,
|
|
6776
6863
|
className,
|
|
6864
|
+
elevation = 'none',
|
|
6777
6865
|
...rest
|
|
6778
6866
|
} = _ref2;
|
|
6779
6867
|
const childrenWhereBannerIcon = react.Children.map(children, child => {
|
|
@@ -6792,8 +6880,9 @@ const Banner$1 = /*#__PURE__*/react.forwardRef(function Banner(_ref2, ref) {
|
|
|
6792
6880
|
}, enabled);
|
|
6793
6881
|
return /*#__PURE__*/jsxRuntime.jsx(styled.ThemeProvider, {
|
|
6794
6882
|
theme: token,
|
|
6795
|
-
children: /*#__PURE__*/jsxRuntime.jsxs(
|
|
6883
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(Paper, { ...props,
|
|
6796
6884
|
className: className,
|
|
6885
|
+
elevation: elevation,
|
|
6797
6886
|
role: "alert",
|
|
6798
6887
|
children: [/*#__PURE__*/jsxRuntime.jsx(Content$1, {
|
|
6799
6888
|
hasIcon: hasIcon,
|
|
@@ -9955,7 +10044,7 @@ const StyledList = styled__default["default"](List$1).withConfig({
|
|
|
9955
10044
|
let {
|
|
9956
10045
|
theme
|
|
9957
10046
|
} = _ref2;
|
|
9958
|
-
return styled.css(["background-color:", ";box-shadow:", ";", " overflow-y:auto;max-height:300px;padding:0;position:absolute;right:0;left:0;z-index:
|
|
10047
|
+
return styled.css(["background-color:", ";box-shadow:", ";", " overflow-y:auto;max-height:300px;padding:0;position:absolute;right:0;left:0;z-index:1400;"], theme.background, theme.boxShadow, edsUtils.bordersTemplate(theme.border));
|
|
9959
10048
|
});
|
|
9960
10049
|
const StyledButton = styled__default["default"](Button).withConfig({
|
|
9961
10050
|
displayName: "Autocomplete__StyledButton",
|
|
@@ -10066,7 +10155,19 @@ function AutocompleteInner(props, ref) {
|
|
|
10066
10155
|
const [containerEl, setContainerEl] = react.useState();
|
|
10067
10156
|
const isMounted = edsUtils.useIsMounted();
|
|
10068
10157
|
const isControlled = Boolean(selectedOptions);
|
|
10069
|
-
const [
|
|
10158
|
+
const [inputOptions, setInputOptions] = react.useState(options);
|
|
10159
|
+
react.useEffect(() => {
|
|
10160
|
+
const availableHash = JSON.stringify(inputOptions);
|
|
10161
|
+
const optionsHash = JSON.stringify(options);
|
|
10162
|
+
|
|
10163
|
+
if (availableHash !== optionsHash) {
|
|
10164
|
+
setInputOptions(options);
|
|
10165
|
+
}
|
|
10166
|
+
}, [options, inputOptions]);
|
|
10167
|
+
react.useEffect(() => {
|
|
10168
|
+
setAvailableItems(inputOptions);
|
|
10169
|
+
}, [inputOptions]);
|
|
10170
|
+
const [availableItems, setAvailableItems] = react.useState(inputOptions);
|
|
10070
10171
|
const disabledItems = react.useMemo(() => options.filter(optionDisabled), [options, optionDisabled]);
|
|
10071
10172
|
const {
|
|
10072
10173
|
density
|
|
@@ -10076,18 +10177,28 @@ function AutocompleteInner(props, ref) {
|
|
|
10076
10177
|
}, multiple ? multiSelect : selectTokens);
|
|
10077
10178
|
let placeholderText = placeholder;
|
|
10078
10179
|
let multipleSelectionProps = {
|
|
10079
|
-
initialSelectedItems: multiple ? initialSelectedOptions : initialSelectedOptions[0] ? [initialSelectedOptions[0]] : []
|
|
10080
|
-
onSelectedItemsChange: changes => {
|
|
10081
|
-
if (onOptionsChange) {
|
|
10082
|
-
onOptionsChange(changes);
|
|
10083
|
-
}
|
|
10084
|
-
}
|
|
10180
|
+
initialSelectedItems: multiple ? initialSelectedOptions : initialSelectedOptions[0] ? [initialSelectedOptions[0]] : []
|
|
10085
10181
|
};
|
|
10086
10182
|
|
|
10087
|
-
if (
|
|
10183
|
+
if (multiple) {
|
|
10088
10184
|
multipleSelectionProps = { ...multipleSelectionProps,
|
|
10089
|
-
|
|
10185
|
+
onSelectedItemsChange: changes => {
|
|
10186
|
+
if (onOptionsChange) {
|
|
10187
|
+
const {
|
|
10188
|
+
selectedItems
|
|
10189
|
+
} = changes;
|
|
10190
|
+
onOptionsChange({
|
|
10191
|
+
selectedItems
|
|
10192
|
+
});
|
|
10193
|
+
}
|
|
10194
|
+
}
|
|
10090
10195
|
};
|
|
10196
|
+
|
|
10197
|
+
if (isControlled) {
|
|
10198
|
+
multipleSelectionProps = { ...multipleSelectionProps,
|
|
10199
|
+
selectedItems: selectedOptions
|
|
10200
|
+
};
|
|
10201
|
+
}
|
|
10091
10202
|
}
|
|
10092
10203
|
|
|
10093
10204
|
const {
|
|
@@ -10141,9 +10252,11 @@ function AutocompleteInner(props, ref) {
|
|
|
10141
10252
|
let {
|
|
10142
10253
|
selectedItem
|
|
10143
10254
|
} = _ref8;
|
|
10144
|
-
|
|
10145
10255
|
// Show all options when single select is reopened with a selected item
|
|
10146
|
-
|
|
10256
|
+
const availableHash = JSON.stringify(availableItems[0]);
|
|
10257
|
+
const selectedsHash = JSON.stringify(selectedItem);
|
|
10258
|
+
|
|
10259
|
+
if (availableItems.length === 1 && selectedsHash === availableHash) {
|
|
10147
10260
|
setAvailableItems(options);
|
|
10148
10261
|
}
|
|
10149
10262
|
},
|
|
@@ -10206,7 +10319,17 @@ function AutocompleteInner(props, ref) {
|
|
|
10206
10319
|
|
|
10207
10320
|
if (isControlled && !multiple) {
|
|
10208
10321
|
comboBoxProps = { ...comboBoxProps,
|
|
10209
|
-
selectedItem: selectedOptions[0]
|
|
10322
|
+
selectedItem: selectedOptions[0] || null,
|
|
10323
|
+
onSelectedItemChange: changes => {
|
|
10324
|
+
if (onOptionsChange) {
|
|
10325
|
+
const {
|
|
10326
|
+
selectedItem
|
|
10327
|
+
} = changes;
|
|
10328
|
+
onOptionsChange({
|
|
10329
|
+
selectedItems: selectedItem ? [selectedItem] : []
|
|
10330
|
+
});
|
|
10331
|
+
}
|
|
10332
|
+
}
|
|
10210
10333
|
};
|
|
10211
10334
|
}
|
|
10212
10335
|
|
|
@@ -10278,8 +10401,10 @@ function AutocompleteInner(props, ref) {
|
|
|
10278
10401
|
reset: resetCombobox
|
|
10279
10402
|
} = downshift.useCombobox(comboBoxProps);
|
|
10280
10403
|
react.useEffect(() => {
|
|
10281
|
-
if (anchorRef.current) {
|
|
10404
|
+
if (anchorRef.current && isOpen) {
|
|
10282
10405
|
setAnchorEl(anchorRef.current);
|
|
10406
|
+
} else {
|
|
10407
|
+
setAnchorEl(null);
|
|
10283
10408
|
}
|
|
10284
10409
|
|
|
10285
10410
|
if (isControlled) {
|
|
@@ -10290,7 +10415,16 @@ function AutocompleteInner(props, ref) {
|
|
|
10290
10415
|
setAnchorEl(null);
|
|
10291
10416
|
setContainerEl(null);
|
|
10292
10417
|
};
|
|
10293
|
-
}, [anchorRef, isControlled, isOpen, selectedOptions, setSelectedItems]);
|
|
10418
|
+
}, [anchorRef, isControlled, isOpen, selectedOptions, setSelectedItems]); //"Turn on" popper on load to position menu correctly and then turn it off
|
|
10419
|
+
|
|
10420
|
+
react.useEffect(() => {
|
|
10421
|
+
if (anchorRef.current) {
|
|
10422
|
+
setAnchorEl(anchorRef.current);
|
|
10423
|
+
setTimeout(() => {
|
|
10424
|
+
setAnchorEl(null);
|
|
10425
|
+
}, 1);
|
|
10426
|
+
}
|
|
10427
|
+
}, []);
|
|
10294
10428
|
const {
|
|
10295
10429
|
styles,
|
|
10296
10430
|
attributes
|