@equinor/eds-core-react 0.20.2 → 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 +73 -57
- package/dist/esm/components/Autocomplete/Autocomplete.js +5 -3
- 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/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 +3 -3
|
@@ -3518,6 +3518,12 @@ const {
|
|
|
3518
3518
|
focused: {
|
|
3519
3519
|
width: focusOutlineWidth$5
|
|
3520
3520
|
}
|
|
3521
|
+
},
|
|
3522
|
+
typography: {
|
|
3523
|
+
navigation: {
|
|
3524
|
+
menu_tabs,
|
|
3525
|
+
menu_title
|
|
3526
|
+
}
|
|
3521
3527
|
}
|
|
3522
3528
|
} = edsTokens.tokens;
|
|
3523
3529
|
const token$1 = {
|
|
@@ -3536,6 +3542,8 @@ const token$1 = {
|
|
|
3536
3542
|
color: focusOutlineColor$5
|
|
3537
3543
|
}
|
|
3538
3544
|
}
|
|
3545
|
+
},
|
|
3546
|
+
typography: { ...menu_title
|
|
3539
3547
|
}
|
|
3540
3548
|
},
|
|
3541
3549
|
tab: {
|
|
@@ -3553,7 +3561,8 @@ const token$1 = {
|
|
|
3553
3561
|
},
|
|
3554
3562
|
typography: {
|
|
3555
3563
|
color: defaultColor,
|
|
3556
|
-
textAlign: 'center'
|
|
3564
|
+
textAlign: 'center',
|
|
3565
|
+
...menu_tabs
|
|
3557
3566
|
},
|
|
3558
3567
|
border: {
|
|
3559
3568
|
type: 'bordergroup',
|
|
@@ -3830,7 +3839,7 @@ const StyledTab = styled__default["default"].button.attrs(_ref => {
|
|
|
3830
3839
|
tab
|
|
3831
3840
|
}
|
|
3832
3841
|
} = theme;
|
|
3833
|
-
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));
|
|
3834
3843
|
});
|
|
3835
3844
|
const Tab = /*#__PURE__*/react.forwardRef(function Tab(props, ref) {
|
|
3836
3845
|
return /*#__PURE__*/jsxRuntime.jsx(StyledTab, {
|
|
@@ -3875,7 +3884,7 @@ const StyledTabPanel = styled__default["default"].div.attrs(() => ({
|
|
|
3875
3884
|
panel
|
|
3876
3885
|
}
|
|
3877
3886
|
} = 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));
|
|
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));
|
|
3879
3888
|
});
|
|
3880
3889
|
const TabPanel = /*#__PURE__*/react.forwardRef(function TabPanel(_ref2, ref) {
|
|
3881
3890
|
let { ...props
|
|
@@ -3898,10 +3907,46 @@ Tabs.Panel.displayName = 'Tabs.Panel';
|
|
|
3898
3907
|
Tabs.List.displayName = 'Tabs.List';
|
|
3899
3908
|
|
|
3900
3909
|
const {
|
|
3910
|
+
elevation,
|
|
3901
3911
|
colors: {
|
|
3902
3912
|
ui: {
|
|
3903
3913
|
background__default: {
|
|
3904
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
|
|
3905
3950
|
},
|
|
3906
3951
|
background__info: {
|
|
3907
3952
|
rgba: backgroundInfo
|
|
@@ -3926,7 +3971,7 @@ const {
|
|
|
3926
3971
|
}
|
|
3927
3972
|
} = edsTokens.tokens;
|
|
3928
3973
|
const primary$4 = {
|
|
3929
|
-
background: background$
|
|
3974
|
+
background: background$b,
|
|
3930
3975
|
border: {
|
|
3931
3976
|
type: 'border',
|
|
3932
3977
|
radius: borderRadius$8
|
|
@@ -3959,7 +4004,7 @@ var tokens$4 = /*#__PURE__*/Object.freeze({
|
|
|
3959
4004
|
const {
|
|
3960
4005
|
primary: primary$3
|
|
3961
4006
|
} = tokens$4;
|
|
3962
|
-
const StyledCard = styled__default["default"].
|
|
4007
|
+
const StyledCard = styled__default["default"](Paper).withConfig({
|
|
3963
4008
|
displayName: "Card__StyledCard",
|
|
3964
4009
|
componentId: "sc-bjucjn-0"
|
|
3965
4010
|
})(["width:100%;position:relative;background-color:", ";box-sizing:border-box;display:flex;flex-direction:column;grid-gap:16px;cursor:", ";", ";"], _ref => {
|
|
@@ -3977,6 +4022,7 @@ const Card$1 = /*#__PURE__*/react.forwardRef(function Card(_ref3, ref) {
|
|
|
3977
4022
|
let {
|
|
3978
4023
|
children,
|
|
3979
4024
|
variant = 'default',
|
|
4025
|
+
elevation = 'none',
|
|
3980
4026
|
onClick,
|
|
3981
4027
|
...rest
|
|
3982
4028
|
} = _ref3;
|
|
@@ -3989,7 +4035,9 @@ const Card$1 = /*#__PURE__*/react.forwardRef(function Card(_ref3, ref) {
|
|
|
3989
4035
|
cursor,
|
|
3990
4036
|
...rest
|
|
3991
4037
|
};
|
|
3992
|
-
return /*#__PURE__*/jsxRuntime.jsx(StyledCard, {
|
|
4038
|
+
return /*#__PURE__*/jsxRuntime.jsx(StyledCard, {
|
|
4039
|
+
elevation: elevation,
|
|
4040
|
+
...props,
|
|
3993
4041
|
onClick: onClick,
|
|
3994
4042
|
children: children
|
|
3995
4043
|
});
|
|
@@ -4156,7 +4204,7 @@ const topbar = {
|
|
|
4156
4204
|
}
|
|
4157
4205
|
};
|
|
4158
4206
|
|
|
4159
|
-
const StyledTopBar = styled__default["default"].
|
|
4207
|
+
const StyledTopBar = styled__default["default"](Paper).withConfig({
|
|
4160
4208
|
displayName: "TopBar__StyledTopBar",
|
|
4161
4209
|
componentId: "sc-1yj236q-0"
|
|
4162
4210
|
})(_ref => {
|
|
@@ -4168,6 +4216,7 @@ const StyledTopBar = styled__default["default"].header.withConfig({
|
|
|
4168
4216
|
const TopBar$1 = /*#__PURE__*/react.forwardRef(function TopBar(_ref2, ref) {
|
|
4169
4217
|
let {
|
|
4170
4218
|
children,
|
|
4219
|
+
elevation = 'none',
|
|
4171
4220
|
...props
|
|
4172
4221
|
} = _ref2;
|
|
4173
4222
|
const {
|
|
@@ -4176,10 +4225,15 @@ const TopBar$1 = /*#__PURE__*/react.forwardRef(function TopBar(_ref2, ref) {
|
|
|
4176
4225
|
const token = edsUtils.useToken({
|
|
4177
4226
|
density
|
|
4178
4227
|
}, topbar);
|
|
4228
|
+
const rest = { ...props,
|
|
4229
|
+
ref
|
|
4230
|
+
};
|
|
4179
4231
|
return /*#__PURE__*/jsxRuntime.jsx(styled.ThemeProvider, {
|
|
4180
4232
|
theme: token,
|
|
4181
|
-
children: /*#__PURE__*/jsxRuntime.jsx(StyledTopBar, {
|
|
4182
|
-
|
|
4233
|
+
children: /*#__PURE__*/jsxRuntime.jsx(StyledTopBar, {
|
|
4234
|
+
forwardedAs: 'header',
|
|
4235
|
+
elevation: elevation,
|
|
4236
|
+
...rest,
|
|
4183
4237
|
children: children
|
|
4184
4238
|
})
|
|
4185
4239
|
});
|
|
@@ -4241,44 +4295,6 @@ TopBar.Actions.displayName = 'Topbar.Actions';
|
|
|
4241
4295
|
TopBar.Header.displayName = 'Topbar.Header';
|
|
4242
4296
|
TopBar.CustomContent.displayName = 'Topbar.CustomContent';
|
|
4243
4297
|
|
|
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
4298
|
const {
|
|
4283
4299
|
colors: {
|
|
4284
4300
|
ui: {
|
|
@@ -6827,13 +6843,9 @@ const BannerIcon = /*#__PURE__*/react.forwardRef(function BannerIcon(_ref2, ref)
|
|
|
6827
6843
|
});
|
|
6828
6844
|
});
|
|
6829
6845
|
|
|
6830
|
-
const StyledBanner = styled__default["default"].div.withConfig({
|
|
6831
|
-
displayName: "Banner__StyledBanner",
|
|
6832
|
-
componentId: "sc-1ju451i-0"
|
|
6833
|
-
})([""]);
|
|
6834
6846
|
const Content$1 = styled__default["default"].div.withConfig({
|
|
6835
6847
|
displayName: "Banner__Content",
|
|
6836
|
-
componentId: "sc-1ju451i-
|
|
6848
|
+
componentId: "sc-1ju451i-0"
|
|
6837
6849
|
})(_ref => {
|
|
6838
6850
|
let {
|
|
6839
6851
|
theme,
|
|
@@ -6843,12 +6855,13 @@ const Content$1 = styled__default["default"].div.withConfig({
|
|
|
6843
6855
|
});
|
|
6844
6856
|
const NonMarginDivider = styled__default["default"](Divider).withConfig({
|
|
6845
6857
|
displayName: "Banner__NonMarginDivider",
|
|
6846
|
-
componentId: "sc-1ju451i-
|
|
6858
|
+
componentId: "sc-1ju451i-1"
|
|
6847
6859
|
})(["margin:0;height:2px;"]);
|
|
6848
6860
|
const Banner$1 = /*#__PURE__*/react.forwardRef(function Banner(_ref2, ref) {
|
|
6849
6861
|
let {
|
|
6850
6862
|
children,
|
|
6851
6863
|
className,
|
|
6864
|
+
elevation = 'none',
|
|
6852
6865
|
...rest
|
|
6853
6866
|
} = _ref2;
|
|
6854
6867
|
const childrenWhereBannerIcon = react.Children.map(children, child => {
|
|
@@ -6867,8 +6880,9 @@ const Banner$1 = /*#__PURE__*/react.forwardRef(function Banner(_ref2, ref) {
|
|
|
6867
6880
|
}, enabled);
|
|
6868
6881
|
return /*#__PURE__*/jsxRuntime.jsx(styled.ThemeProvider, {
|
|
6869
6882
|
theme: token,
|
|
6870
|
-
children: /*#__PURE__*/jsxRuntime.jsxs(
|
|
6883
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(Paper, { ...props,
|
|
6871
6884
|
className: className,
|
|
6885
|
+
elevation: elevation,
|
|
6872
6886
|
role: "alert",
|
|
6873
6887
|
children: [/*#__PURE__*/jsxRuntime.jsx(Content$1, {
|
|
6874
6888
|
hasIcon: hasIcon,
|
|
@@ -10238,9 +10252,11 @@ function AutocompleteInner(props, ref) {
|
|
|
10238
10252
|
let {
|
|
10239
10253
|
selectedItem
|
|
10240
10254
|
} = _ref8;
|
|
10241
|
-
|
|
10242
10255
|
// Show all options when single select is reopened with a selected item
|
|
10243
|
-
|
|
10256
|
+
const availableHash = JSON.stringify(availableItems[0]);
|
|
10257
|
+
const selectedsHash = JSON.stringify(selectedItem);
|
|
10258
|
+
|
|
10259
|
+
if (availableItems.length === 1 && selectedsHash === availableHash) {
|
|
10244
10260
|
setAvailableItems(options);
|
|
10245
10261
|
}
|
|
10246
10262
|
},
|
|
@@ -10310,7 +10326,7 @@ function AutocompleteInner(props, ref) {
|
|
|
10310
10326
|
selectedItem
|
|
10311
10327
|
} = changes;
|
|
10312
10328
|
onOptionsChange({
|
|
10313
|
-
selectedItems: [selectedItem]
|
|
10329
|
+
selectedItems: selectedItem ? [selectedItem] : []
|
|
10314
10330
|
});
|
|
10315
10331
|
}
|
|
10316
10332
|
}
|
|
@@ -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
|
},
|
|
@@ -318,7 +320,7 @@ function AutocompleteInner(props, ref) {
|
|
|
318
320
|
selectedItem
|
|
319
321
|
} = changes;
|
|
320
322
|
onOptionsChange({
|
|
321
|
-
selectedItems: [selectedItem]
|
|
323
|
+
selectedItems: selectedItem ? [selectedItem] : []
|
|
322
324
|
});
|
|
323
325
|
}
|
|
324
326
|
}
|
|
@@ -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',
|
|
@@ -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.3",
|
|
4
4
|
"description": "The React implementation of the Equinor Design System",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"**/*.css"
|
|
@@ -100,13 +100,13 @@
|
|
|
100
100
|
},
|
|
101
101
|
"browserslist": "defaults, not IE 11",
|
|
102
102
|
"scripts": {
|
|
103
|
-
"build": "rollup -c && tsc -p tsconfig.json",
|
|
103
|
+
"build": "rollup -c && tsc -p tsconfig.build.json",
|
|
104
104
|
"test": "tsc -p tsconfig.test.json && jest",
|
|
105
105
|
"test:watch": "tsc-watch -p tsconfig.test.json --onFirstSuccess \"jest --watch\"",
|
|
106
106
|
"test:update-snapshots": "jest --updateSnapshot",
|
|
107
107
|
"storybook": "start-storybook -p 9000 --ci",
|
|
108
108
|
"build:storybook": "build-storybook -o storybook-build",
|
|
109
|
-
"types": "tsc"
|
|
109
|
+
"types": "tsc -p tsconfig.build.json"
|
|
110
110
|
},
|
|
111
111
|
"module": "dist/esm/index.js"
|
|
112
112
|
}
|