@equinor/eds-core-react 0.20.2-dev.20220616 → 0.20.4
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 +83 -61
- package/dist/esm/components/Autocomplete/Autocomplete.js +12 -5
- package/dist/esm/components/Banner/Banner.js +6 -7
- package/dist/esm/components/Card/Card.js +6 -2
- package/dist/esm/components/Icon/Icon.js +1 -1
- 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/TextField/TextField.js +2 -1
- package/dist/esm/components/TopBar/TopBar.js +10 -3
- 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 -6
|
@@ -2720,6 +2720,7 @@ const TextField = /*#__PURE__*/react.forwardRef(function TextField(_ref, ref) {
|
|
|
2720
2720
|
inputIcon,
|
|
2721
2721
|
helperIcon,
|
|
2722
2722
|
rowsMax,
|
|
2723
|
+
style,
|
|
2723
2724
|
...other
|
|
2724
2725
|
} = _ref;
|
|
2725
2726
|
const helperTextId = edsUtils.useId(null, 'helpertext');
|
|
@@ -2746,7 +2747,7 @@ const TextField = /*#__PURE__*/react.forwardRef(function TextField(_ref, ref) {
|
|
|
2746
2747
|
const containerProps = {
|
|
2747
2748
|
ref,
|
|
2748
2749
|
className,
|
|
2749
|
-
style
|
|
2750
|
+
style
|
|
2750
2751
|
};
|
|
2751
2752
|
const labelProps = {
|
|
2752
2753
|
htmlFor: id,
|
|
@@ -2860,7 +2861,7 @@ const findIcon = (name, data, size) => {
|
|
|
2860
2861
|
|
|
2861
2862
|
const Icon$2 = /*#__PURE__*/react.forwardRef(function Icon(_ref4, ref) {
|
|
2862
2863
|
let {
|
|
2863
|
-
size
|
|
2864
|
+
size,
|
|
2864
2865
|
color = 'currentColor',
|
|
2865
2866
|
name,
|
|
2866
2867
|
rotation,
|
|
@@ -3518,6 +3519,12 @@ const {
|
|
|
3518
3519
|
focused: {
|
|
3519
3520
|
width: focusOutlineWidth$5
|
|
3520
3521
|
}
|
|
3522
|
+
},
|
|
3523
|
+
typography: {
|
|
3524
|
+
navigation: {
|
|
3525
|
+
menu_tabs,
|
|
3526
|
+
menu_title
|
|
3527
|
+
}
|
|
3521
3528
|
}
|
|
3522
3529
|
} = edsTokens.tokens;
|
|
3523
3530
|
const token$1 = {
|
|
@@ -3536,6 +3543,8 @@ const token$1 = {
|
|
|
3536
3543
|
color: focusOutlineColor$5
|
|
3537
3544
|
}
|
|
3538
3545
|
}
|
|
3546
|
+
},
|
|
3547
|
+
typography: { ...menu_title
|
|
3539
3548
|
}
|
|
3540
3549
|
},
|
|
3541
3550
|
tab: {
|
|
@@ -3553,7 +3562,8 @@ const token$1 = {
|
|
|
3553
3562
|
},
|
|
3554
3563
|
typography: {
|
|
3555
3564
|
color: defaultColor,
|
|
3556
|
-
textAlign: 'center'
|
|
3565
|
+
textAlign: 'center',
|
|
3566
|
+
...menu_tabs
|
|
3557
3567
|
},
|
|
3558
3568
|
border: {
|
|
3559
3569
|
type: 'bordergroup',
|
|
@@ -3830,7 +3840,7 @@ const StyledTab = styled__default["default"].button.attrs(_ref => {
|
|
|
3830
3840
|
tab
|
|
3831
3841
|
}
|
|
3832
3842
|
} = theme;
|
|
3833
|
-
return styled.css(["appearance:none;box-sizing:border-box;
|
|
3843
|
+
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));
|
|
3834
3844
|
});
|
|
3835
3845
|
const Tab = /*#__PURE__*/react.forwardRef(function Tab(props, ref) {
|
|
3836
3846
|
return /*#__PURE__*/jsxRuntime.jsx(StyledTab, {
|
|
@@ -3875,7 +3885,7 @@ const StyledTabPanel = styled__default["default"].div.attrs(() => ({
|
|
|
3875
3885
|
panel
|
|
3876
3886
|
}
|
|
3877
3887
|
} = theme;
|
|
3878
|
-
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));
|
|
3888
|
+
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));
|
|
3879
3889
|
});
|
|
3880
3890
|
const TabPanel = /*#__PURE__*/react.forwardRef(function TabPanel(_ref2, ref) {
|
|
3881
3891
|
let { ...props
|
|
@@ -3898,10 +3908,46 @@ Tabs.Panel.displayName = 'Tabs.Panel';
|
|
|
3898
3908
|
Tabs.List.displayName = 'Tabs.List';
|
|
3899
3909
|
|
|
3900
3910
|
const {
|
|
3911
|
+
elevation,
|
|
3901
3912
|
colors: {
|
|
3902
3913
|
ui: {
|
|
3903
3914
|
background__default: {
|
|
3904
3915
|
rgba: background$c
|
|
3916
|
+
}
|
|
3917
|
+
}
|
|
3918
|
+
}
|
|
3919
|
+
} = edsTokens.tokens;
|
|
3920
|
+
const paper = {
|
|
3921
|
+
background: background$c
|
|
3922
|
+
};
|
|
3923
|
+
|
|
3924
|
+
const StyledPaper = styled__default["default"].div.withConfig({
|
|
3925
|
+
displayName: "Paper__StyledPaper",
|
|
3926
|
+
componentId: "sc-6ncnv9-0"
|
|
3927
|
+
})(["background:", ";box-shadow:", ";"], paper.background, _ref => {
|
|
3928
|
+
let {
|
|
3929
|
+
elevation
|
|
3930
|
+
} = _ref;
|
|
3931
|
+
return elevation;
|
|
3932
|
+
});
|
|
3933
|
+
const Paper = /*#__PURE__*/react.forwardRef(function Paper(_ref2, ref) {
|
|
3934
|
+
let {
|
|
3935
|
+
elevation: elevation$1,
|
|
3936
|
+
...rest
|
|
3937
|
+
} = _ref2;
|
|
3938
|
+
const props = { ...rest,
|
|
3939
|
+
elevation: elevation[elevation$1] || 'none'
|
|
3940
|
+
};
|
|
3941
|
+
return /*#__PURE__*/jsxRuntime.jsx(StyledPaper, { ...props,
|
|
3942
|
+
ref: ref
|
|
3943
|
+
});
|
|
3944
|
+
});
|
|
3945
|
+
|
|
3946
|
+
const {
|
|
3947
|
+
colors: {
|
|
3948
|
+
ui: {
|
|
3949
|
+
background__default: {
|
|
3950
|
+
rgba: background$b
|
|
3905
3951
|
},
|
|
3906
3952
|
background__info: {
|
|
3907
3953
|
rgba: backgroundInfo
|
|
@@ -3926,7 +3972,7 @@ const {
|
|
|
3926
3972
|
}
|
|
3927
3973
|
} = edsTokens.tokens;
|
|
3928
3974
|
const primary$4 = {
|
|
3929
|
-
background: background$
|
|
3975
|
+
background: background$b,
|
|
3930
3976
|
border: {
|
|
3931
3977
|
type: 'border',
|
|
3932
3978
|
radius: borderRadius$8
|
|
@@ -3959,7 +4005,7 @@ var tokens$4 = /*#__PURE__*/Object.freeze({
|
|
|
3959
4005
|
const {
|
|
3960
4006
|
primary: primary$3
|
|
3961
4007
|
} = tokens$4;
|
|
3962
|
-
const StyledCard = styled__default["default"].
|
|
4008
|
+
const StyledCard = styled__default["default"](Paper).withConfig({
|
|
3963
4009
|
displayName: "Card__StyledCard",
|
|
3964
4010
|
componentId: "sc-bjucjn-0"
|
|
3965
4011
|
})(["width:100%;position:relative;background-color:", ";box-sizing:border-box;display:flex;flex-direction:column;grid-gap:16px;cursor:", ";", ";"], _ref => {
|
|
@@ -3977,6 +4023,7 @@ const Card$1 = /*#__PURE__*/react.forwardRef(function Card(_ref3, ref) {
|
|
|
3977
4023
|
let {
|
|
3978
4024
|
children,
|
|
3979
4025
|
variant = 'default',
|
|
4026
|
+
elevation = 'none',
|
|
3980
4027
|
onClick,
|
|
3981
4028
|
...rest
|
|
3982
4029
|
} = _ref3;
|
|
@@ -3989,7 +4036,9 @@ const Card$1 = /*#__PURE__*/react.forwardRef(function Card(_ref3, ref) {
|
|
|
3989
4036
|
cursor,
|
|
3990
4037
|
...rest
|
|
3991
4038
|
};
|
|
3992
|
-
return /*#__PURE__*/jsxRuntime.jsx(StyledCard, {
|
|
4039
|
+
return /*#__PURE__*/jsxRuntime.jsx(StyledCard, {
|
|
4040
|
+
elevation: elevation,
|
|
4041
|
+
...props,
|
|
3993
4042
|
onClick: onClick,
|
|
3994
4043
|
children: children
|
|
3995
4044
|
});
|
|
@@ -4156,7 +4205,7 @@ const topbar = {
|
|
|
4156
4205
|
}
|
|
4157
4206
|
};
|
|
4158
4207
|
|
|
4159
|
-
const StyledTopBar = styled__default["default"].
|
|
4208
|
+
const StyledTopBar = styled__default["default"](Paper).withConfig({
|
|
4160
4209
|
displayName: "TopBar__StyledTopBar",
|
|
4161
4210
|
componentId: "sc-1yj236q-0"
|
|
4162
4211
|
})(_ref => {
|
|
@@ -4168,6 +4217,7 @@ const StyledTopBar = styled__default["default"].header.withConfig({
|
|
|
4168
4217
|
const TopBar$1 = /*#__PURE__*/react.forwardRef(function TopBar(_ref2, ref) {
|
|
4169
4218
|
let {
|
|
4170
4219
|
children,
|
|
4220
|
+
elevation = 'none',
|
|
4171
4221
|
...props
|
|
4172
4222
|
} = _ref2;
|
|
4173
4223
|
const {
|
|
@@ -4176,10 +4226,15 @@ const TopBar$1 = /*#__PURE__*/react.forwardRef(function TopBar(_ref2, ref) {
|
|
|
4176
4226
|
const token = edsUtils.useToken({
|
|
4177
4227
|
density
|
|
4178
4228
|
}, topbar);
|
|
4229
|
+
const rest = { ...props,
|
|
4230
|
+
ref
|
|
4231
|
+
};
|
|
4179
4232
|
return /*#__PURE__*/jsxRuntime.jsx(styled.ThemeProvider, {
|
|
4180
4233
|
theme: token,
|
|
4181
|
-
children: /*#__PURE__*/jsxRuntime.jsx(StyledTopBar, {
|
|
4182
|
-
|
|
4234
|
+
children: /*#__PURE__*/jsxRuntime.jsx(StyledTopBar, {
|
|
4235
|
+
forwardedAs: 'header',
|
|
4236
|
+
elevation: elevation,
|
|
4237
|
+
...rest,
|
|
4183
4238
|
children: children
|
|
4184
4239
|
})
|
|
4185
4240
|
});
|
|
@@ -4241,44 +4296,6 @@ TopBar.Actions.displayName = 'Topbar.Actions';
|
|
|
4241
4296
|
TopBar.Header.displayName = 'Topbar.Header';
|
|
4242
4297
|
TopBar.CustomContent.displayName = 'Topbar.CustomContent';
|
|
4243
4298
|
|
|
4244
|
-
const {
|
|
4245
|
-
elevation,
|
|
4246
|
-
colors: {
|
|
4247
|
-
ui: {
|
|
4248
|
-
background__default: {
|
|
4249
|
-
rgba: background$b
|
|
4250
|
-
}
|
|
4251
|
-
}
|
|
4252
|
-
}
|
|
4253
|
-
} = edsTokens.tokens;
|
|
4254
|
-
const paper = {
|
|
4255
|
-
maxWidth: 'calc(100% - 32px)',
|
|
4256
|
-
minWidth: '96px',
|
|
4257
|
-
background: background$b
|
|
4258
|
-
};
|
|
4259
|
-
|
|
4260
|
-
const StyledPaper = styled__default["default"].div.withConfig({
|
|
4261
|
-
displayName: "Paper__StyledPaper",
|
|
4262
|
-
componentId: "sc-6ncnv9-0"
|
|
4263
|
-
})(["min-width:", ";max-width:", ";background:", ";box-shadow:", ";"], paper.minWidth, paper.maxWidth, paper.background, _ref => {
|
|
4264
|
-
let {
|
|
4265
|
-
elevation
|
|
4266
|
-
} = _ref;
|
|
4267
|
-
return elevation;
|
|
4268
|
-
});
|
|
4269
|
-
const Paper = /*#__PURE__*/react.forwardRef(function Paper(_ref2, ref) {
|
|
4270
|
-
let {
|
|
4271
|
-
elevation: elevation$1,
|
|
4272
|
-
...rest
|
|
4273
|
-
} = _ref2;
|
|
4274
|
-
const props = { ...rest,
|
|
4275
|
-
elevation: elevation[elevation$1] || 'none'
|
|
4276
|
-
};
|
|
4277
|
-
return /*#__PURE__*/jsxRuntime.jsx(StyledPaper, { ...props,
|
|
4278
|
-
ref: ref
|
|
4279
|
-
});
|
|
4280
|
-
});
|
|
4281
|
-
|
|
4282
4299
|
const {
|
|
4283
4300
|
colors: {
|
|
4284
4301
|
ui: {
|
|
@@ -6827,13 +6844,9 @@ const BannerIcon = /*#__PURE__*/react.forwardRef(function BannerIcon(_ref2, ref)
|
|
|
6827
6844
|
});
|
|
6828
6845
|
});
|
|
6829
6846
|
|
|
6830
|
-
const StyledBanner = styled__default["default"].div.withConfig({
|
|
6831
|
-
displayName: "Banner__StyledBanner",
|
|
6832
|
-
componentId: "sc-1ju451i-0"
|
|
6833
|
-
})([""]);
|
|
6834
6847
|
const Content$1 = styled__default["default"].div.withConfig({
|
|
6835
6848
|
displayName: "Banner__Content",
|
|
6836
|
-
componentId: "sc-1ju451i-
|
|
6849
|
+
componentId: "sc-1ju451i-0"
|
|
6837
6850
|
})(_ref => {
|
|
6838
6851
|
let {
|
|
6839
6852
|
theme,
|
|
@@ -6843,12 +6856,13 @@ const Content$1 = styled__default["default"].div.withConfig({
|
|
|
6843
6856
|
});
|
|
6844
6857
|
const NonMarginDivider = styled__default["default"](Divider).withConfig({
|
|
6845
6858
|
displayName: "Banner__NonMarginDivider",
|
|
6846
|
-
componentId: "sc-1ju451i-
|
|
6859
|
+
componentId: "sc-1ju451i-1"
|
|
6847
6860
|
})(["margin:0;height:2px;"]);
|
|
6848
6861
|
const Banner$1 = /*#__PURE__*/react.forwardRef(function Banner(_ref2, ref) {
|
|
6849
6862
|
let {
|
|
6850
6863
|
children,
|
|
6851
6864
|
className,
|
|
6865
|
+
elevation = 'none',
|
|
6852
6866
|
...rest
|
|
6853
6867
|
} = _ref2;
|
|
6854
6868
|
const childrenWhereBannerIcon = react.Children.map(children, child => {
|
|
@@ -6867,8 +6881,9 @@ const Banner$1 = /*#__PURE__*/react.forwardRef(function Banner(_ref2, ref) {
|
|
|
6867
6881
|
}, enabled);
|
|
6868
6882
|
return /*#__PURE__*/jsxRuntime.jsx(styled.ThemeProvider, {
|
|
6869
6883
|
theme: token,
|
|
6870
|
-
children: /*#__PURE__*/jsxRuntime.jsxs(
|
|
6884
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(Paper, { ...props,
|
|
6871
6885
|
className: className,
|
|
6886
|
+
elevation: elevation,
|
|
6872
6887
|
role: "alert",
|
|
6873
6888
|
children: [/*#__PURE__*/jsxRuntime.jsx(Content$1, {
|
|
6874
6889
|
hasIcon: hasIcon,
|
|
@@ -10238,9 +10253,11 @@ function AutocompleteInner(props, ref) {
|
|
|
10238
10253
|
let {
|
|
10239
10254
|
selectedItem
|
|
10240
10255
|
} = _ref8;
|
|
10241
|
-
|
|
10242
10256
|
// Show all options when single select is reopened with a selected item
|
|
10243
|
-
|
|
10257
|
+
const availableHash = JSON.stringify(availableItems[0]);
|
|
10258
|
+
const selectedsHash = JSON.stringify(selectedItem);
|
|
10259
|
+
|
|
10260
|
+
if (availableItems.length === 1 && selectedsHash === availableHash) {
|
|
10244
10261
|
setAvailableItems(options);
|
|
10245
10262
|
}
|
|
10246
10263
|
},
|
|
@@ -10301,20 +10318,25 @@ function AutocompleteInner(props, ref) {
|
|
|
10301
10318
|
}
|
|
10302
10319
|
};
|
|
10303
10320
|
|
|
10304
|
-
if (
|
|
10321
|
+
if (!multiple) {
|
|
10305
10322
|
comboBoxProps = { ...comboBoxProps,
|
|
10306
|
-
selectedItem: selectedOptions[0] || null,
|
|
10307
10323
|
onSelectedItemChange: changes => {
|
|
10308
10324
|
if (onOptionsChange) {
|
|
10309
10325
|
const {
|
|
10310
10326
|
selectedItem
|
|
10311
10327
|
} = changes;
|
|
10312
10328
|
onOptionsChange({
|
|
10313
|
-
selectedItems: [selectedItem]
|
|
10329
|
+
selectedItems: selectedItem ? [selectedItem] : []
|
|
10314
10330
|
});
|
|
10315
10331
|
}
|
|
10316
10332
|
}
|
|
10317
10333
|
};
|
|
10334
|
+
|
|
10335
|
+
if (isControlled) {
|
|
10336
|
+
comboBoxProps = { ...comboBoxProps,
|
|
10337
|
+
selectedItem: selectedOptions[0] || null
|
|
10338
|
+
};
|
|
10339
|
+
}
|
|
10318
10340
|
}
|
|
10319
10341
|
|
|
10320
10342
|
if (multiple) {
|
|
@@ -246,9 +246,11 @@ function AutocompleteInner(props, ref) {
|
|
|
246
246
|
let {
|
|
247
247
|
selectedItem
|
|
248
248
|
} = _ref8;
|
|
249
|
-
|
|
250
249
|
// Show all options when single select is reopened with a selected item
|
|
251
|
-
|
|
250
|
+
const availableHash = JSON.stringify(availableItems[0]);
|
|
251
|
+
const selectedsHash = JSON.stringify(selectedItem);
|
|
252
|
+
|
|
253
|
+
if (availableItems.length === 1 && selectedsHash === availableHash) {
|
|
252
254
|
setAvailableItems(options);
|
|
253
255
|
}
|
|
254
256
|
},
|
|
@@ -309,20 +311,25 @@ function AutocompleteInner(props, ref) {
|
|
|
309
311
|
}
|
|
310
312
|
};
|
|
311
313
|
|
|
312
|
-
if (
|
|
314
|
+
if (!multiple) {
|
|
313
315
|
comboBoxProps = { ...comboBoxProps,
|
|
314
|
-
selectedItem: selectedOptions[0] || null,
|
|
315
316
|
onSelectedItemChange: changes => {
|
|
316
317
|
if (onOptionsChange) {
|
|
317
318
|
const {
|
|
318
319
|
selectedItem
|
|
319
320
|
} = changes;
|
|
320
321
|
onOptionsChange({
|
|
321
|
-
selectedItems: [selectedItem]
|
|
322
|
+
selectedItems: selectedItem ? [selectedItem] : []
|
|
322
323
|
});
|
|
323
324
|
}
|
|
324
325
|
}
|
|
325
326
|
};
|
|
327
|
+
|
|
328
|
+
if (isControlled) {
|
|
329
|
+
comboBoxProps = { ...comboBoxProps,
|
|
330
|
+
selectedItem: selectedOptions[0] || null
|
|
331
|
+
};
|
|
332
|
+
}
|
|
326
333
|
}
|
|
327
334
|
|
|
328
335
|
if (multiple) {
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import { forwardRef, Children, isValidElement } from 'react';
|
|
2
2
|
import styled, { css, ThemeProvider } from 'styled-components';
|
|
3
3
|
import { spacingsTemplate, useToken } from '@equinor/eds-utils';
|
|
4
|
+
import { Paper } from '../Paper/Paper.js';
|
|
4
5
|
import { enabled } from './Banner.tokens.js';
|
|
5
6
|
import { Divider } from '../Divider/Divider.js';
|
|
6
7
|
import { BannerIcon } from './BannerIcon.js';
|
|
7
8
|
import { useEds } from '../EdsProvider/eds.context.js';
|
|
8
9
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
9
10
|
|
|
10
|
-
const StyledBanner = styled.div.withConfig({
|
|
11
|
-
displayName: "Banner__StyledBanner",
|
|
12
|
-
componentId: "sc-1ju451i-0"
|
|
13
|
-
})([""]);
|
|
14
11
|
const Content = styled.div.withConfig({
|
|
15
12
|
displayName: "Banner__Content",
|
|
16
|
-
componentId: "sc-1ju451i-
|
|
13
|
+
componentId: "sc-1ju451i-0"
|
|
17
14
|
})(_ref => {
|
|
18
15
|
let {
|
|
19
16
|
theme,
|
|
@@ -23,12 +20,13 @@ const Content = styled.div.withConfig({
|
|
|
23
20
|
});
|
|
24
21
|
const NonMarginDivider = styled(Divider).withConfig({
|
|
25
22
|
displayName: "Banner__NonMarginDivider",
|
|
26
|
-
componentId: "sc-1ju451i-
|
|
23
|
+
componentId: "sc-1ju451i-1"
|
|
27
24
|
})(["margin:0;height:2px;"]);
|
|
28
25
|
const Banner = /*#__PURE__*/forwardRef(function Banner(_ref2, ref) {
|
|
29
26
|
let {
|
|
30
27
|
children,
|
|
31
28
|
className,
|
|
29
|
+
elevation = 'none',
|
|
32
30
|
...rest
|
|
33
31
|
} = _ref2;
|
|
34
32
|
const childrenWhereBannerIcon = Children.map(children, child => {
|
|
@@ -47,8 +45,9 @@ const Banner = /*#__PURE__*/forwardRef(function Banner(_ref2, ref) {
|
|
|
47
45
|
}, enabled);
|
|
48
46
|
return /*#__PURE__*/jsx(ThemeProvider, {
|
|
49
47
|
theme: token,
|
|
50
|
-
children: /*#__PURE__*/jsxs(
|
|
48
|
+
children: /*#__PURE__*/jsxs(Paper, { ...props,
|
|
51
49
|
className: className,
|
|
50
|
+
elevation: elevation,
|
|
52
51
|
role: "alert",
|
|
53
52
|
children: [/*#__PURE__*/jsx(Content, {
|
|
54
53
|
hasIcon: hasIcon,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
+
import { Paper } from '../Paper/Paper.js';
|
|
3
4
|
import * as Card_tokens from './Card.tokens.js';
|
|
4
5
|
import { bordersTemplate } from '@equinor/eds-utils';
|
|
5
6
|
import { jsx } from 'react/jsx-runtime';
|
|
@@ -7,7 +8,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
7
8
|
const {
|
|
8
9
|
primary
|
|
9
10
|
} = Card_tokens;
|
|
10
|
-
const StyledCard = styled.
|
|
11
|
+
const StyledCard = styled(Paper).withConfig({
|
|
11
12
|
displayName: "Card__StyledCard",
|
|
12
13
|
componentId: "sc-bjucjn-0"
|
|
13
14
|
})(["width:100%;position:relative;background-color:", ";box-sizing:border-box;display:flex;flex-direction:column;grid-gap:16px;cursor:", ";", ";"], _ref => {
|
|
@@ -25,6 +26,7 @@ const Card = /*#__PURE__*/forwardRef(function Card(_ref3, ref) {
|
|
|
25
26
|
let {
|
|
26
27
|
children,
|
|
27
28
|
variant = 'default',
|
|
29
|
+
elevation = 'none',
|
|
28
30
|
onClick,
|
|
29
31
|
...rest
|
|
30
32
|
} = _ref3;
|
|
@@ -37,7 +39,9 @@ const Card = /*#__PURE__*/forwardRef(function Card(_ref3, ref) {
|
|
|
37
39
|
cursor,
|
|
38
40
|
...rest
|
|
39
41
|
};
|
|
40
|
-
return /*#__PURE__*/jsx(StyledCard, {
|
|
42
|
+
return /*#__PURE__*/jsx(StyledCard, {
|
|
43
|
+
elevation: elevation,
|
|
44
|
+
...props,
|
|
41
45
|
onClick: onClick,
|
|
42
46
|
children: children
|
|
43
47
|
});
|
|
@@ -6,7 +6,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
6
6
|
const StyledPaper = styled.div.withConfig({
|
|
7
7
|
displayName: "Paper__StyledPaper",
|
|
8
8
|
componentId: "sc-6ncnv9-0"
|
|
9
|
-
})(["
|
|
9
|
+
})(["background:", ";box-shadow:", ";"], paper.background, _ref => {
|
|
10
10
|
let {
|
|
11
11
|
elevation
|
|
12
12
|
} = _ref;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
|
-
import { spacingsTemplate, outlineTemplate, bordersTemplate } from '@equinor/eds-utils';
|
|
3
|
+
import { spacingsTemplate, typographyTemplate, outlineTemplate, bordersTemplate } from '@equinor/eds-utils';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
6
|
const StyledTab = styled.button.attrs(_ref => {
|
|
@@ -29,7 +29,7 @@ const StyledTab = styled.button.attrs(_ref => {
|
|
|
29
29
|
tab
|
|
30
30
|
}
|
|
31
31
|
} = theme;
|
|
32
|
-
return css(["appearance:none;box-sizing:border-box;
|
|
32
|
+
return 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, spacingsTemplate(tab.spacings), typographyTemplate(tab.typography), active ? tab.states.active.typography.color : tab.typography.color, tab.background, outlineTemplate(tab.states.focus.outline), outlineTemplate(tab.states.focus.outline), active ? tab.states.active.states.hover.typography.color : tab.typography.color, disabled ? css(["background:", ";cursor:not-allowed;"], tab.states.disabled.background) : css(["background:", ";cursor:pointer;"], tab.states.hover.background), disabled ? bordersTemplate(tab.states.disabled.border) : bordersTemplate(tab.border), active && bordersTemplate(tab.states.active.border));
|
|
33
33
|
});
|
|
34
34
|
const Tab = /*#__PURE__*/forwardRef(function Tab(props, ref) {
|
|
35
35
|
return /*#__PURE__*/jsx(StyledTab, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
|
-
import { spacingsTemplate, outlineTemplate } from '@equinor/eds-utils';
|
|
3
|
+
import { spacingsTemplate, typographyTemplate, outlineTemplate } from '@equinor/eds-utils';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
6
|
const StyledTabPanel = styled.div.attrs(() => ({
|
|
@@ -18,7 +18,7 @@ const StyledTabPanel = styled.div.attrs(() => ({
|
|
|
18
18
|
panel
|
|
19
19
|
}
|
|
20
20
|
} = theme;
|
|
21
|
-
return css(["", " &:focus{outline:none;}&[data-focus-visible-added]:focus{", "}&:focus-visible{", "}"], spacingsTemplate(panel.spacings), outlineTemplate(panel.states.focus.outline), outlineTemplate(panel.states.focus.outline));
|
|
21
|
+
return css(["", " ", " &:focus{outline:none;}&[data-focus-visible-added]:focus{", "}&:focus-visible{", "}"], spacingsTemplate(panel.spacings), typographyTemplate(panel.typography), outlineTemplate(panel.states.focus.outline), outlineTemplate(panel.states.focus.outline));
|
|
22
22
|
});
|
|
23
23
|
const TabPanel = /*#__PURE__*/forwardRef(function TabPanel(_ref2, ref) {
|
|
24
24
|
let { ...props
|
|
@@ -39,6 +39,12 @@ const {
|
|
|
39
39
|
focused: {
|
|
40
40
|
width: focusOutlineWidth
|
|
41
41
|
}
|
|
42
|
+
},
|
|
43
|
+
typography: {
|
|
44
|
+
navigation: {
|
|
45
|
+
menu_tabs,
|
|
46
|
+
menu_title
|
|
47
|
+
}
|
|
42
48
|
}
|
|
43
49
|
} = tokens;
|
|
44
50
|
const token = {
|
|
@@ -57,6 +63,8 @@ const token = {
|
|
|
57
63
|
color: focusOutlineColor
|
|
58
64
|
}
|
|
59
65
|
}
|
|
66
|
+
},
|
|
67
|
+
typography: { ...menu_title
|
|
60
68
|
}
|
|
61
69
|
},
|
|
62
70
|
tab: {
|
|
@@ -74,7 +82,8 @@ const token = {
|
|
|
74
82
|
},
|
|
75
83
|
typography: {
|
|
76
84
|
color: defaultColor,
|
|
77
|
-
textAlign: 'center'
|
|
85
|
+
textAlign: 'center',
|
|
86
|
+
...menu_tabs
|
|
78
87
|
},
|
|
79
88
|
border: {
|
|
80
89
|
type: 'bordergroup',
|
|
@@ -29,6 +29,7 @@ const TextField = /*#__PURE__*/forwardRef(function TextField(_ref, ref) {
|
|
|
29
29
|
inputIcon,
|
|
30
30
|
helperIcon,
|
|
31
31
|
rowsMax,
|
|
32
|
+
style,
|
|
32
33
|
...other
|
|
33
34
|
} = _ref;
|
|
34
35
|
const helperTextId = useId(null, 'helpertext');
|
|
@@ -55,7 +56,7 @@ const TextField = /*#__PURE__*/forwardRef(function TextField(_ref, ref) {
|
|
|
55
56
|
const containerProps = {
|
|
56
57
|
ref,
|
|
57
58
|
className,
|
|
58
|
-
style
|
|
59
|
+
style
|
|
59
60
|
};
|
|
60
61
|
const labelProps = {
|
|
61
62
|
htmlFor: id,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import styled, { css, ThemeProvider } from 'styled-components';
|
|
3
3
|
import { bordersTemplate, spacingsTemplate, typographyTemplate, useToken } from '@equinor/eds-utils';
|
|
4
|
+
import { Paper } from '../Paper/Paper.js';
|
|
4
5
|
import { topbar } from './TopBar.tokens.js';
|
|
5
6
|
import { useEds } from '../EdsProvider/eds.context.js';
|
|
6
7
|
import { jsx } from 'react/jsx-runtime';
|
|
7
8
|
|
|
8
|
-
const StyledTopBar = styled.
|
|
9
|
+
const StyledTopBar = styled(Paper).withConfig({
|
|
9
10
|
displayName: "TopBar__StyledTopBar",
|
|
10
11
|
componentId: "sc-1yj236q-0"
|
|
11
12
|
})(_ref => {
|
|
@@ -17,6 +18,7 @@ const StyledTopBar = styled.header.withConfig({
|
|
|
17
18
|
const TopBar = /*#__PURE__*/forwardRef(function TopBar(_ref2, ref) {
|
|
18
19
|
let {
|
|
19
20
|
children,
|
|
21
|
+
elevation = 'none',
|
|
20
22
|
...props
|
|
21
23
|
} = _ref2;
|
|
22
24
|
const {
|
|
@@ -25,10 +27,15 @@ const TopBar = /*#__PURE__*/forwardRef(function TopBar(_ref2, ref) {
|
|
|
25
27
|
const token = useToken({
|
|
26
28
|
density
|
|
27
29
|
}, topbar);
|
|
30
|
+
const rest = { ...props,
|
|
31
|
+
ref
|
|
32
|
+
};
|
|
28
33
|
return /*#__PURE__*/jsx(ThemeProvider, {
|
|
29
34
|
theme: token,
|
|
30
|
-
children: /*#__PURE__*/jsx(StyledTopBar, {
|
|
31
|
-
|
|
35
|
+
children: /*#__PURE__*/jsx(StyledTopBar, {
|
|
36
|
+
forwardedAs: 'header',
|
|
37
|
+
elevation: elevation,
|
|
38
|
+
...rest,
|
|
32
39
|
children: children
|
|
33
40
|
})
|
|
34
41
|
});
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import type { Elevations } from '@equinor/eds-tokens';
|
|
3
|
+
declare type AvailableElevations = keyof Pick<Elevations, 'none' | 'raised' | 'overlay'>;
|
|
2
4
|
export declare type BannerProps = {
|
|
5
|
+
elevation?: AvailableElevations;
|
|
3
6
|
children: ReactNode;
|
|
4
7
|
} & HTMLAttributes<HTMLDivElement>;
|
|
5
8
|
export declare const Banner: import("react").ForwardRefExoticComponent<{
|
|
9
|
+
elevation?: AvailableElevations;
|
|
6
10
|
children: ReactNode;
|
|
7
11
|
} & HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export {};
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
+
import type { Elevations } from '@equinor/eds-tokens';
|
|
3
|
+
declare type AvailableElevations = keyof Pick<Elevations, 'none' | 'raised' | 'overlay'>;
|
|
2
4
|
export declare type CardProps = {
|
|
3
5
|
/** Variant */
|
|
4
6
|
variant?: 'default' | 'info' | 'warning' | 'danger';
|
|
7
|
+
/** Elevation */
|
|
8
|
+
elevation?: AvailableElevations;
|
|
5
9
|
} & HTMLAttributes<HTMLDivElement>;
|
|
6
10
|
export declare const Card: import("react").ForwardRefExoticComponent<{
|
|
7
11
|
/** Variant */
|
|
8
12
|
variant?: 'default' | 'info' | 'warning' | 'danger';
|
|
13
|
+
/** Elevation */
|
|
14
|
+
elevation?: AvailableElevations;
|
|
9
15
|
} & HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export {};
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import type { Elevations } from '@equinor/eds-tokens';
|
|
3
|
+
declare type AvailableElevations = keyof Pick<Elevations, 'none' | 'raised'>;
|
|
4
|
+
export declare type TopbarProps = {
|
|
5
|
+
elevation?: AvailableElevations;
|
|
6
|
+
} & HTMLAttributes<HTMLDivElement>;
|
|
7
|
+
export declare const TopBar: import("react").ForwardRefExoticComponent<{
|
|
8
|
+
elevation?: AvailableElevations;
|
|
9
|
+
} & HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/eds-core-react",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.4",
|
|
4
4
|
"description": "The React implementation of the Equinor Design System",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"**/*.css"
|
|
@@ -88,11 +88,10 @@
|
|
|
88
88
|
"@babel/runtime": "^7.17.9",
|
|
89
89
|
"@equinor/eds-icons": "0.11.0",
|
|
90
90
|
"@equinor/eds-tokens": "0.7.1",
|
|
91
|
-
"@equinor/eds-utils": "0.2.
|
|
91
|
+
"@equinor/eds-utils": "0.2.3",
|
|
92
92
|
"@popperjs/core": "2.9.2",
|
|
93
93
|
"downshift": "^6.1.7",
|
|
94
|
-
"react-fast-compare": "3.2.0"
|
|
95
|
-
"react-popper": "2.2.5"
|
|
94
|
+
"react-fast-compare": "3.2.0"
|
|
96
95
|
},
|
|
97
96
|
"engines": {
|
|
98
97
|
"pnpm": ">=4",
|
|
@@ -100,13 +99,13 @@
|
|
|
100
99
|
},
|
|
101
100
|
"browserslist": "defaults, not IE 11",
|
|
102
101
|
"scripts": {
|
|
103
|
-
"build": "rollup -c && tsc -p tsconfig.json",
|
|
102
|
+
"build": "rollup -c && tsc -p tsconfig.build.json",
|
|
104
103
|
"test": "tsc -p tsconfig.test.json && jest",
|
|
105
104
|
"test:watch": "tsc-watch -p tsconfig.test.json --onFirstSuccess \"jest --watch\"",
|
|
106
105
|
"test:update-snapshots": "jest --updateSnapshot",
|
|
107
106
|
"storybook": "start-storybook -p 9000 --ci",
|
|
108
107
|
"build:storybook": "build-storybook -o storybook-build",
|
|
109
|
-
"types": "tsc"
|
|
108
|
+
"types": "tsc -p tsconfig.build.json"
|
|
110
109
|
},
|
|
111
110
|
"module": "dist/esm/index.js"
|
|
112
111
|
}
|