@equinor/eds-core-react 0.35.0 → 0.36.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/eds-core-react.cjs +5577 -4351
- package/dist/esm/components/Accordion/Accordion.js +21 -23
- package/dist/esm/components/Accordion/Accordion.tokens.js +65 -23
- package/dist/esm/components/Accordion/AccordionHeader.js +74 -62
- package/dist/esm/components/Accordion/AccordionHeaderActions.js +22 -20
- package/dist/esm/components/Accordion/AccordionHeaderTitle.js +22 -20
- package/dist/esm/components/Accordion/AccordionItem.js +28 -35
- package/dist/esm/components/Accordion/AccordionPanel.js +27 -26
- package/dist/esm/components/Accordion/index.js +1 -1
- package/dist/esm/components/Autocomplete/Autocomplete.js +451 -329
- package/dist/esm/components/Autocomplete/Autocomplete.tokens.js +33 -17
- package/dist/esm/components/Autocomplete/Option.js +35 -32
- package/dist/esm/components/Avatar/Avatar.js +19 -26
- package/dist/esm/components/Avatar/Avatar.tokens.js +1 -1
- package/dist/esm/components/Banner/Banner.js +26 -27
- package/dist/esm/components/Banner/Banner.tokens.js +47 -18
- package/dist/esm/components/Banner/BannerActions.js +18 -19
- package/dist/esm/components/Banner/BannerIcon.js +26 -25
- package/dist/esm/components/Banner/BannerMessage.js +13 -14
- package/dist/esm/components/Banner/index.js +1 -1
- package/dist/esm/components/Breadcrumbs/Breadcrumb.js +30 -32
- package/dist/esm/components/Breadcrumbs/Breadcrumbs.js +46 -53
- package/dist/esm/components/Breadcrumbs/Breadcrumbs.tokens.js +20 -5
- package/dist/esm/components/Breadcrumbs/index.js +1 -1
- package/dist/esm/components/Button/Button.js +46 -46
- package/dist/esm/components/Button/ButtonGroup/ButtonGroup.js +22 -22
- package/dist/esm/components/Button/ButtonGroup/ButtonGroup.tokens.js +8 -2
- package/dist/esm/components/Button/InnerFullWidth.js +8 -10
- package/dist/esm/components/Button/ToggleButton/ToggleButton.js +23 -33
- package/dist/esm/components/Button/index.js +1 -1
- package/dist/esm/components/Button/tokens/button.js +62 -31
- package/dist/esm/components/Button/tokens/contained.js +38 -14
- package/dist/esm/components/Button/tokens/contained_icon.js +13 -10
- package/dist/esm/components/Button/tokens/ghost.js +36 -13
- package/dist/esm/components/Button/tokens/icon.js +46 -20
- package/dist/esm/components/Button/tokens/index.js +1 -1
- package/dist/esm/components/Button/tokens/outlined.js +42 -15
- package/dist/esm/components/Card/Card.js +24 -27
- package/dist/esm/components/Card/Card.tokens.js +32 -11
- package/dist/esm/components/Card/CardActions.js +22 -23
- package/dist/esm/components/Card/CardContent.js +12 -12
- package/dist/esm/components/Card/CardHeader.js +15 -13
- package/dist/esm/components/Card/CardHeaderTitle.js +12 -12
- package/dist/esm/components/Card/CardMedia.js +20 -20
- package/dist/esm/components/Card/index.js +1 -1
- package/dist/esm/components/Checkbox/Checkbox.js +20 -21
- package/dist/esm/components/Checkbox/Checkbox.tokens.js +41 -16
- package/dist/esm/components/Checkbox/Input.js +75 -84
- package/dist/esm/components/Chip/Chip.js +61 -64
- package/dist/esm/components/Chip/Chip.tokens.js +68 -26
- package/dist/esm/components/Chip/Icon.js +13 -11
- package/dist/esm/components/Dialog/Dialog.js +34 -35
- package/dist/esm/components/Dialog/Dialog.tokens.js +32 -10
- package/dist/esm/components/Dialog/DialogActions.js +13 -14
- package/dist/esm/components/Dialog/DialogContent.js +19 -20
- package/dist/esm/components/Dialog/DialogHeader.js +16 -15
- package/dist/esm/components/Dialog/DialogTitle.js +13 -14
- package/dist/esm/components/Dialog/index.js +1 -1
- package/dist/esm/components/Divider/Divider.js +24 -25
- package/dist/esm/components/Divider/Divider.tokens.js +24 -10
- package/dist/esm/components/EdsProvider/eds.context.js +18 -26
- package/dist/esm/components/Icon/Icon.js +75 -78
- package/dist/esm/components/Icon/index.js +1 -1
- package/dist/esm/components/Icon/library.js +9 -8
- package/dist/esm/components/Input/Input.js +93 -92
- package/dist/esm/components/Input/Input.tokens.js +56 -40
- package/dist/esm/components/InputWrapper/HelperText/HelperText.js +24 -28
- package/dist/esm/components/InputWrapper/HelperText/HelperText.token.js +11 -7
- package/dist/esm/components/InputWrapper/InputWrapper.js +34 -35
- package/dist/esm/components/InputWrapper/InputWrapper.tokens.js +56 -40
- package/dist/esm/components/Label/Label.js +16 -20
- package/dist/esm/components/Label/Label.tokens.js +11 -7
- package/dist/esm/components/List/List.js +17 -19
- package/dist/esm/components/List/List.tokens.js +6 -2
- package/dist/esm/components/List/ListItem.js +7 -8
- package/dist/esm/components/List/index.js +1 -1
- package/dist/esm/components/Menu/Menu.context.js +35 -42
- package/dist/esm/components/Menu/Menu.js +111 -108
- package/dist/esm/components/Menu/Menu.tokens.js +57 -24
- package/dist/esm/components/Menu/MenuItem.js +59 -61
- package/dist/esm/components/Menu/MenuList.js +52 -55
- package/dist/esm/components/Menu/MenuSection.js +9 -9
- package/dist/esm/components/Menu/index.js +1 -1
- package/dist/esm/components/Pagination/Pagination.js +70 -75
- package/dist/esm/components/Pagination/Pagination.tokens.js +18 -5
- package/dist/esm/components/Pagination/PaginationItem.js +18 -19
- package/dist/esm/components/Pagination/paginationControl.js +18 -22
- package/dist/esm/components/Paper/Paper.js +15 -18
- package/dist/esm/components/Paper/Paper.tokens.js +12 -4
- package/dist/esm/components/Popover/Popover.js +98 -87
- package/dist/esm/components/Popover/Popover.tokens.js +37 -11
- package/dist/esm/components/Popover/PopoverActions.js +15 -14
- package/dist/esm/components/Popover/PopoverContent.js +15 -14
- package/dist/esm/components/Popover/PopoverHeader.js +16 -15
- package/dist/esm/components/Popover/PopoverTitle.js +15 -14
- package/dist/esm/components/Popover/index.js +1 -1
- package/dist/esm/components/Progress/Circular/CircularProgress.js +33 -42
- package/dist/esm/components/Progress/Circular/CircularProgress.tokens.js +24 -8
- package/dist/esm/components/Progress/Dots/DotProgress.js +20 -23
- package/dist/esm/components/Progress/Dots/DotProgress.tokens.js +20 -8
- package/dist/esm/components/Progress/Linear/LinearProgress.js +25 -31
- package/dist/esm/components/Progress/Linear/LinearProgress.tokens.js +13 -4
- package/dist/esm/components/Progress/Star/StarProgress.js +23 -27
- package/dist/esm/components/Progress/Star/StarProgress.tokens.js +10 -2
- package/dist/esm/components/Progress/index.js +1 -1
- package/dist/esm/components/Radio/Radio.js +71 -83
- package/dist/esm/components/Radio/Radio.tokens.js +41 -16
- package/dist/esm/components/Scrim/Scrim.js +20 -23
- package/dist/esm/components/Scrim/Scrim.tokens.js +11 -3
- package/dist/esm/components/Search/Search.js +24 -31
- package/dist/esm/components/Select/NativeSelect.js +45 -44
- package/dist/esm/components/Select/NativeSelect.tokens.js +15 -10
- package/dist/esm/components/SideBar/SideBar.context.js +27 -33
- package/dist/esm/components/SideBar/SideBar.js +42 -40
- package/dist/esm/components/SideBar/SideBar.tokens.js +49 -20
- package/dist/esm/components/SideBar/SideBarAccordion/index.js +98 -90
- package/dist/esm/components/SideBar/SideBarAccordionItem/index.js +46 -33
- package/dist/esm/components/SideBar/SideBarButton/index.js +61 -45
- package/dist/esm/components/SideBar/SideBarContent.js +13 -13
- package/dist/esm/components/SideBar/SideBarFooter.js +13 -13
- package/dist/esm/components/SideBar/SideBarToggle.js +40 -26
- package/dist/esm/components/SideBar/SidebarLink/index.js +87 -48
- package/dist/esm/components/SideBar/index.js +1 -1
- package/dist/esm/components/SideSheet/SideSheet.js +27 -27
- package/dist/esm/components/SideSheet/SideSheet.tokens.js +29 -12
- package/dist/esm/components/Slider/MinMax.js +10 -6
- package/dist/esm/components/Slider/Output.js +15 -18
- package/dist/esm/components/Slider/Slider.js +157 -188
- package/dist/esm/components/Slider/Slider.tokens.js +67 -19
- package/dist/esm/components/Slider/SliderInput.js +37 -34
- package/dist/esm/components/Snackbar/Snackbar.js +39 -45
- package/dist/esm/components/Snackbar/Snackbar.tokens.js +45 -17
- package/dist/esm/components/Snackbar/SnackbarAction.js +15 -14
- package/dist/esm/components/Snackbar/index.js +1 -1
- package/dist/esm/components/Switch/Switch.js +37 -42
- package/dist/esm/components/Switch/Switch.styles.js +17 -20
- package/dist/esm/components/Switch/Switch.tokens.js +66 -21
- package/dist/esm/components/Switch/SwitchDefault.js +38 -36
- package/dist/esm/components/Switch/SwitchSmall.js +38 -33
- package/dist/esm/components/Table/Body.js +8 -9
- package/dist/esm/components/Table/Caption.js +12 -14
- package/dist/esm/components/Table/Cell.js +15 -14
- package/dist/esm/components/Table/DataCell/DataCell.js +27 -26
- package/dist/esm/components/Table/DataCell/DataCell.tokens.js +79 -38
- package/dist/esm/components/Table/Head/Head.js +10 -11
- package/dist/esm/components/Table/Head/Head.tokens.js +15 -4
- package/dist/esm/components/Table/HeaderCell/HeaderCell.js +37 -33
- package/dist/esm/components/Table/HeaderCell/HeaderCell.tokens.js +65 -28
- package/dist/esm/components/Table/Inner.context.js +2 -2
- package/dist/esm/components/Table/Row/Row.js +12 -16
- package/dist/esm/components/Table/Row/Row.tokens.js +13 -4
- package/dist/esm/components/Table/Table.js +8 -9
- package/dist/esm/components/Table/index.js +1 -1
- package/dist/esm/components/TableOfContents/LinkItem.js +11 -11
- package/dist/esm/components/TableOfContents/TableOfContents.js +25 -26
- package/dist/esm/components/TableOfContents/TableOfContents.tokens.js +46 -21
- package/dist/esm/components/TableOfContents/index.js +1 -1
- package/dist/esm/components/Tabs/Tab.js +30 -29
- package/dist/esm/components/Tabs/TabList.js +50 -62
- package/dist/esm/components/Tabs/TabPanel.js +19 -18
- package/dist/esm/components/Tabs/TabPanels.js +16 -17
- package/dist/esm/components/Tabs/Tabs.context.js +3 -5
- package/dist/esm/components/Tabs/Tabs.js +37 -53
- package/dist/esm/components/Tabs/Tabs.tokens.js +56 -21
- package/dist/esm/components/Tabs/index.js +1 -1
- package/dist/esm/components/TextField/TextField.js +64 -59
- package/dist/esm/components/Textarea/Textarea.js +38 -38
- package/dist/esm/components/Tooltip/Tooltip.js +79 -81
- package/dist/esm/components/Tooltip/Tooltip.tokens.js +33 -13
- package/dist/esm/components/TopBar/Actions.js +9 -11
- package/dist/esm/components/TopBar/CustomContent.js +9 -11
- package/dist/esm/components/TopBar/Header.js +9 -11
- package/dist/esm/components/TopBar/TopBar.js +24 -25
- package/dist/esm/components/TopBar/TopBar.tokens.js +10 -4
- package/dist/esm/components/TopBar/index.js +1 -1
- package/dist/esm/components/Typography/Typography.js +42 -57
- package/dist/esm/components/Typography/Typography.tokens.js +50 -23
- package/dist/esm/node_modules/.pnpm/ramda@0.29.1/node_modules/ramda/es/internal/_isPlaceholder.js +1 -3
- package/dist/types/components/Accordion/Accordion.types.d.ts +1 -1
- package/dist/types/components/Autocomplete/Autocomplete.d.ts +13 -0
- package/dist/types/components/Autocomplete/Option.d.ts +1 -0
- package/dist/types/components/Slider/Slider.d.ts +11 -3
- package/package.json +5 -6
|
@@ -1,56 +1,58 @@
|
|
|
1
|
-
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
1
|
import { forwardRef } from 'react';
|
|
4
2
|
import styled, { css } from 'styled-components';
|
|
5
3
|
import { bordersTemplate } from '@equinor/eds-utils';
|
|
6
4
|
import { BaseInput, GridWrapper, BaseInputWrapper } from './Switch.styles.js';
|
|
7
5
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
var Input = styled(BaseInput).withConfig({
|
|
7
|
+
const Input = styled(BaseInput).withConfig({
|
|
11
8
|
displayName: "SwitchDefault__Input",
|
|
12
9
|
componentId: "sc-16ym5pn-0"
|
|
13
|
-
})(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var Track = styled.span.withConfig({
|
|
10
|
+
})(({
|
|
11
|
+
disabled,
|
|
12
|
+
theme
|
|
13
|
+
}) => css(["width:", ";aspect-ratio:1/1;&:checked + span > span{background-color:", ";}&:checked + span > span:last-child{transform:translate(105%,-50%);background-color:", ";}&:hover + span{background-color:", ";}&:hover + span > span:last-child{background-color:", ";}"], theme.clickbound.height, disabled ? theme.states.disabled.background : theme.entities.track.states.active.background, disabled ? theme.states.disabled.background : theme.entities.handle.states.active.background, disabled ? 'transparent' : theme.states.hover.background, disabled ? theme.states.disabled.background : theme.states.hover.entities.handle.background));
|
|
14
|
+
const Track = styled.span.withConfig({
|
|
19
15
|
displayName: "SwitchDefault__Track",
|
|
20
16
|
componentId: "sc-16ym5pn-1"
|
|
21
|
-
})(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
states
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
|
|
17
|
+
})(({
|
|
18
|
+
$isDisabled,
|
|
19
|
+
theme: {
|
|
20
|
+
states,
|
|
21
|
+
entities: {
|
|
22
|
+
track
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}) => css(["", " border:none;width:", ";height:", ";background-color:", ";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);transition:background 0.36s;", ""], bordersTemplate(track.border), track.width, track.height, track.background, $isDisabled && {
|
|
26
|
+
backgroundColor: states.disabled.background
|
|
27
|
+
}));
|
|
28
|
+
const Handle = styled.span.withConfig({
|
|
31
29
|
displayName: "SwitchDefault__Handle",
|
|
32
30
|
componentId: "sc-16ym5pn-2"
|
|
33
|
-
})(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
states
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
31
|
+
})(({
|
|
32
|
+
$isDisabled,
|
|
33
|
+
theme: {
|
|
34
|
+
states,
|
|
35
|
+
entities: {
|
|
36
|
+
handle
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}) => css(["background-color:", ";", " box-shadow:", ";width:", ";height:", ";border-radius:50%;display:inline-block;position:absolute;top:50%;transform:translate(0,-50%);left:4px;transition:transform 0.36s cubic-bezier(0.78,0.14,0.15,0.86);"], handle.background, $isDisabled && {
|
|
40
|
+
backgroundColor: states.disabled.background
|
|
41
|
+
}, handle.boxShadow, handle.width, handle.height));
|
|
42
|
+
const SwitchDefault = /*#__PURE__*/forwardRef(function SwitchDefault({
|
|
43
|
+
disabled,
|
|
44
|
+
className,
|
|
45
|
+
style,
|
|
46
|
+
...rest
|
|
47
|
+
}, ref) {
|
|
47
48
|
return /*#__PURE__*/jsxs(GridWrapper, {
|
|
48
49
|
className: className,
|
|
49
50
|
style: style,
|
|
50
|
-
children: [/*#__PURE__*/jsx(Input,
|
|
51
|
+
children: [/*#__PURE__*/jsx(Input, {
|
|
52
|
+
...rest,
|
|
51
53
|
ref: ref,
|
|
52
54
|
disabled: disabled
|
|
53
|
-
})
|
|
55
|
+
}), /*#__PURE__*/jsxs(BaseInputWrapper, {
|
|
54
56
|
children: [/*#__PURE__*/jsx(Track, {
|
|
55
57
|
$isDisabled: disabled
|
|
56
58
|
}), /*#__PURE__*/jsx(Handle, {
|
|
@@ -1,53 +1,58 @@
|
|
|
1
|
-
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
1
|
import { forwardRef } from 'react';
|
|
4
2
|
import styled, { css } from 'styled-components';
|
|
5
3
|
import { BaseInput, GridWrapper, BaseInputWrapper } from './Switch.styles.js';
|
|
6
4
|
import { outlineTemplate } from '@equinor/eds-utils';
|
|
7
5
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
var Input = styled(BaseInput).withConfig({
|
|
7
|
+
const Input = styled(BaseInput).withConfig({
|
|
11
8
|
displayName: "SwitchSmall__Input",
|
|
12
9
|
componentId: "sc-1a99mis-0"
|
|
13
|
-
})(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
states
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
10
|
+
})(({
|
|
11
|
+
disabled,
|
|
12
|
+
theme: {
|
|
13
|
+
states,
|
|
14
|
+
entities: {
|
|
15
|
+
handle,
|
|
16
|
+
track
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}) => css(["&[data-focus-visible-added]:focus + span{", "}&:focus-visible + span{", "}&:checked + span > span{background-color:", ";}&:checked + span > span:last-child{transform:translate(180%,-50%);background-color:", ";}@media (hover:hover) and (pointer:fine){&:hover + span{background-color:", ";}}"], outlineTemplate(states.focus.outline), outlineTemplate(states.focus.outline), disabled ? states.disabled.background : track.states.active.background, handle.background, disabled ? 'transparent' : states.hover.background));
|
|
20
|
+
const Track = styled.span.withConfig({
|
|
23
21
|
displayName: "SwitchSmall__Track",
|
|
24
22
|
componentId: "sc-1a99mis-1"
|
|
25
|
-
})(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
states
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
23
|
+
})(({
|
|
24
|
+
$isDisabled,
|
|
25
|
+
theme: {
|
|
26
|
+
states,
|
|
27
|
+
entities: {
|
|
28
|
+
track
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}) => css(["width:", ";height:", ";border-radius:10px;border:none;background-color:", ";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);"], track.width, track.height, $isDisabled ? states.disabled.background : track.states.disabled.background));
|
|
32
|
+
const Handle = styled.span.withConfig({
|
|
33
33
|
displayName: "SwitchSmall__Handle",
|
|
34
34
|
componentId: "sc-1a99mis-2"
|
|
35
|
-
})(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
35
|
+
})(({
|
|
36
|
+
theme: {
|
|
37
|
+
entities: {
|
|
38
|
+
handle
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}) => css(["background-color:", ";width:", ";height:", ";border-radius:50%;display:inline-block;position:absolute;top:50%;transform:translate(11%,-50%);left:7px;transition:transform 0.36s cubic-bezier(0.78,0.14,0.15,0.86);"], handle.background, handle.width, handle.height));
|
|
42
|
+
const SwitchSmall = /*#__PURE__*/forwardRef(function SwitchSmall({
|
|
43
|
+
disabled,
|
|
44
|
+
className,
|
|
45
|
+
style,
|
|
46
|
+
...rest
|
|
47
|
+
}, ref) {
|
|
44
48
|
return /*#__PURE__*/jsxs(GridWrapper, {
|
|
45
49
|
className: className,
|
|
46
50
|
style: style,
|
|
47
|
-
children: [/*#__PURE__*/jsx(Input,
|
|
51
|
+
children: [/*#__PURE__*/jsx(Input, {
|
|
52
|
+
...rest,
|
|
48
53
|
ref: ref,
|
|
49
54
|
disabled: disabled
|
|
50
|
-
})
|
|
55
|
+
}), /*#__PURE__*/jsxs(BaseInputWrapper, {
|
|
51
56
|
children: [/*#__PURE__*/jsx(Track, {
|
|
52
57
|
$isDisabled: disabled
|
|
53
58
|
}), /*#__PURE__*/jsx(Handle, {})]
|
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
1
|
import { forwardRef } from 'react';
|
|
4
2
|
import styled from 'styled-components';
|
|
5
3
|
import { InnerContext } from './Inner.context.js';
|
|
6
4
|
import { jsx } from 'react/jsx-runtime';
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
var TableBase = styled.tbody.withConfig({
|
|
6
|
+
const TableBase = styled.tbody.withConfig({
|
|
10
7
|
displayName: "Body__TableBase",
|
|
11
8
|
componentId: "sc-1pdmiku-0"
|
|
12
9
|
})([""]);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
const Body = /*#__PURE__*/forwardRef(function Body({
|
|
11
|
+
children,
|
|
12
|
+
...props
|
|
13
|
+
}, ref) {
|
|
16
14
|
return /*#__PURE__*/jsx(InnerContext.Provider, {
|
|
17
15
|
value: {
|
|
18
16
|
variant: 'body'
|
|
19
17
|
},
|
|
20
|
-
children: /*#__PURE__*/jsx(TableBase,
|
|
18
|
+
children: /*#__PURE__*/jsx(TableBase, {
|
|
19
|
+
...props,
|
|
21
20
|
ref: ref,
|
|
22
21
|
children: children
|
|
23
|
-
})
|
|
22
|
+
})
|
|
24
23
|
});
|
|
25
24
|
});
|
|
26
25
|
|
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
1
|
import { forwardRef } from 'react';
|
|
4
2
|
import styled, { css } from 'styled-components';
|
|
5
3
|
import { jsx } from 'react/jsx-runtime';
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
var StyledCaption = styled.caption.withConfig({
|
|
5
|
+
const StyledCaption = styled.caption.withConfig({
|
|
9
6
|
displayName: "Caption__StyledCaption",
|
|
10
7
|
componentId: "sc-rtfr07-0"
|
|
11
|
-
})(
|
|
12
|
-
|
|
8
|
+
})(({
|
|
9
|
+
$captionSide
|
|
10
|
+
}) => {
|
|
13
11
|
return css(["caption-side:", ";"], $captionSide);
|
|
14
12
|
});
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return /*#__PURE__*/jsx(StyledCaption,
|
|
20
|
-
$captionSide: captionSide
|
|
21
|
-
|
|
13
|
+
const Caption = /*#__PURE__*/forwardRef(function Caption({
|
|
14
|
+
captionSide = 'top',
|
|
15
|
+
...props
|
|
16
|
+
}, ref) {
|
|
17
|
+
return /*#__PURE__*/jsx(StyledCaption, {
|
|
18
|
+
$captionSide: captionSide,
|
|
19
|
+
...props,
|
|
22
20
|
ref: ref
|
|
23
|
-
})
|
|
21
|
+
});
|
|
24
22
|
});
|
|
25
23
|
|
|
26
24
|
export { Caption };
|
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
-
import _objectDestructuringEmpty from '@babel/runtime/helpers/objectDestructuringEmpty';
|
|
3
|
-
import _extends from '@babel/runtime/helpers/extends';
|
|
4
1
|
import { forwardRef } from 'react';
|
|
5
2
|
import { InnerContext } from './Inner.context.js';
|
|
6
3
|
import { jsx } from 'react/jsx-runtime';
|
|
7
4
|
import { TableDataCell } from './DataCell/DataCell.js';
|
|
8
5
|
import { TableHeaderCell } from './HeaderCell/HeaderCell.js';
|
|
9
6
|
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
const Cell = /*#__PURE__*/forwardRef(function Cell({
|
|
8
|
+
...rest
|
|
9
|
+
}, ref) {
|
|
12
10
|
return /*#__PURE__*/jsx(InnerContext.Consumer, {
|
|
13
|
-
children:
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
children: ({
|
|
12
|
+
variant,
|
|
13
|
+
sticky
|
|
14
|
+
}) => {
|
|
16
15
|
switch (variant) {
|
|
17
16
|
case 'head':
|
|
18
|
-
return /*#__PURE__*/jsx(TableHeaderCell,
|
|
17
|
+
return /*#__PURE__*/jsx(TableHeaderCell, {
|
|
19
18
|
ref: ref,
|
|
20
|
-
sticky: sticky
|
|
21
|
-
|
|
19
|
+
sticky: sticky,
|
|
20
|
+
...rest
|
|
21
|
+
});
|
|
22
22
|
default:
|
|
23
23
|
case 'body':
|
|
24
|
-
return /*#__PURE__*/jsx(TableDataCell,
|
|
25
|
-
ref: ref
|
|
26
|
-
|
|
24
|
+
return /*#__PURE__*/jsx(TableDataCell, {
|
|
25
|
+
ref: ref,
|
|
26
|
+
...rest
|
|
27
|
+
});
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
});
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
1
|
import { forwardRef } from 'react';
|
|
4
2
|
import styled, { css, ThemeProvider } from 'styled-components';
|
|
5
3
|
import { spacingsTemplate, typographyTemplate, bordersTemplate, useToken } from '@equinor/eds-utils';
|
|
@@ -7,39 +5,42 @@ import { applyVariant, tableCell } from './DataCell.tokens.js';
|
|
|
7
5
|
import { jsx } from 'react/jsx-runtime';
|
|
8
6
|
import { useEds } from '../../EdsProvider/eds.context.js';
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
var StyledTableCell = styled.td.withConfig({
|
|
8
|
+
const StyledTableCell = styled.td.withConfig({
|
|
12
9
|
displayName: "DataCell__StyledTableCell",
|
|
13
10
|
componentId: "sc-15tuitc-0"
|
|
14
|
-
})(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
})(({
|
|
12
|
+
theme,
|
|
13
|
+
color
|
|
14
|
+
}) => {
|
|
15
|
+
const {
|
|
16
|
+
height,
|
|
17
|
+
typography,
|
|
18
|
+
spacings,
|
|
19
|
+
border,
|
|
20
|
+
align
|
|
21
|
+
} = theme;
|
|
22
|
+
const backgroundColor = color === 'error' ? theme.validation.error?.background : '';
|
|
23
|
+
const base = css(["min-height:", ";height:", ";background:", ";vertical-align:", ";box-sizing:border-box;", " ", " ", ""], height, height, backgroundColor, align.vertical, spacingsTemplate(spacings), typographyTemplate(typography), bordersTemplate(border));
|
|
25
24
|
return base;
|
|
26
25
|
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
density
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
const TableDataCell = /*#__PURE__*/forwardRef(function TableDataCell({
|
|
27
|
+
children,
|
|
28
|
+
variant = 'text',
|
|
29
|
+
...rest
|
|
30
|
+
}, ref) {
|
|
31
|
+
const {
|
|
32
|
+
density
|
|
33
|
+
} = useEds();
|
|
34
|
+
const token = useToken({
|
|
35
|
+
density
|
|
36
36
|
}, applyVariant(variant, tableCell));
|
|
37
37
|
return /*#__PURE__*/jsx(ThemeProvider, {
|
|
38
38
|
theme: token,
|
|
39
|
-
children: /*#__PURE__*/jsx(StyledTableCell,
|
|
39
|
+
children: /*#__PURE__*/jsx(StyledTableCell, {
|
|
40
|
+
...rest,
|
|
40
41
|
ref: ref,
|
|
41
42
|
children: children
|
|
42
|
-
})
|
|
43
|
+
})
|
|
43
44
|
});
|
|
44
45
|
});
|
|
45
46
|
|
|
@@ -1,26 +1,61 @@
|
|
|
1
|
-
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
1
|
import { tokens } from '@equinor/eds-tokens';
|
|
3
2
|
import mergeDeepRight from '../../../node_modules/.pnpm/ramda@0.29.1/node_modules/ramda/es/mergeDeepRight.js';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
4
|
+
const {
|
|
5
|
+
typography: {
|
|
6
|
+
table: {
|
|
7
|
+
cell_text: cellTypography,
|
|
8
|
+
cell_numeric_monospaced: cellNumericTypography
|
|
9
|
+
},
|
|
10
|
+
_modes: {
|
|
11
|
+
compact: compactTypography
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
colors: {
|
|
15
|
+
text: {
|
|
16
|
+
static_icons__default: {
|
|
17
|
+
rgba: typographyColor
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
ui: {
|
|
21
|
+
background__medium: {
|
|
22
|
+
rgba: borderColor
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
interactive: {
|
|
26
|
+
table__cell__fill_resting: {
|
|
27
|
+
rgba: backgroundColor
|
|
28
|
+
},
|
|
29
|
+
table__cell__fill_hover: {
|
|
30
|
+
rgba: hoverBackgroundColor
|
|
31
|
+
},
|
|
32
|
+
table__cell__fill_activated: {
|
|
33
|
+
rgba: activeBackgroundColor
|
|
34
|
+
},
|
|
35
|
+
danger__highlight: {
|
|
36
|
+
rgba: errorColor
|
|
37
|
+
},
|
|
38
|
+
primary__resting: {
|
|
39
|
+
rgba: primaryRestingColor
|
|
40
|
+
},
|
|
41
|
+
disabled__text: {
|
|
42
|
+
rgba: disabledTextColor
|
|
43
|
+
},
|
|
44
|
+
disabled__border: {
|
|
45
|
+
rgba: disabledBorderColor
|
|
46
|
+
},
|
|
47
|
+
focus: {
|
|
48
|
+
rgba: focusColor
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
spacings: {
|
|
53
|
+
comfortable: {
|
|
54
|
+
medium
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
} = tokens;
|
|
58
|
+
const tableCell = {
|
|
24
59
|
height: 'var(--eds_table__cell__height, 48px)',
|
|
25
60
|
background: backgroundColor,
|
|
26
61
|
align: {
|
|
@@ -37,19 +72,21 @@ var tableCell = {
|
|
|
37
72
|
spacings: {
|
|
38
73
|
top: 'var(--eds_table__cell__padding_y, 0)',
|
|
39
74
|
bottom: 'var(--eds_table__cell__padding_y, 0)',
|
|
40
|
-
left:
|
|
41
|
-
right:
|
|
75
|
+
left: `var(--eds_table__cell__padding_x, ${medium})`,
|
|
76
|
+
right: `var(--eds_table__cell__padding_x, ${medium})`
|
|
42
77
|
},
|
|
43
|
-
typography:
|
|
78
|
+
typography: {
|
|
79
|
+
...cellTypography,
|
|
44
80
|
color: typographyColor,
|
|
45
|
-
fontSize:
|
|
46
|
-
}
|
|
81
|
+
fontSize: `var(--eds_table__font_size, ${cellTypography.fontSize})`
|
|
82
|
+
},
|
|
47
83
|
states: {
|
|
48
84
|
active: {
|
|
49
85
|
background: activeBackgroundColor,
|
|
50
|
-
typography:
|
|
86
|
+
typography: {
|
|
87
|
+
...cellTypography,
|
|
51
88
|
color: primaryRestingColor
|
|
52
|
-
}
|
|
89
|
+
},
|
|
53
90
|
border: {
|
|
54
91
|
bottom: {
|
|
55
92
|
color: primaryRestingColor
|
|
@@ -57,9 +94,10 @@ var tableCell = {
|
|
|
57
94
|
}
|
|
58
95
|
},
|
|
59
96
|
disabled: {
|
|
60
|
-
typography:
|
|
97
|
+
typography: {
|
|
98
|
+
...cellTypography,
|
|
61
99
|
color: disabledTextColor
|
|
62
|
-
}
|
|
100
|
+
},
|
|
63
101
|
border: {
|
|
64
102
|
type: 'bordergroup',
|
|
65
103
|
bottom: {
|
|
@@ -82,14 +120,15 @@ var tableCell = {
|
|
|
82
120
|
modes: {
|
|
83
121
|
compact: {
|
|
84
122
|
height: 'var(--eds_table__cell__height_compact, 32px)',
|
|
85
|
-
typography:
|
|
123
|
+
typography: {
|
|
124
|
+
...compactTypography.table.cell_text,
|
|
86
125
|
color: typographyColor
|
|
87
|
-
}
|
|
126
|
+
},
|
|
88
127
|
spacings: {
|
|
89
128
|
top: 'var(--eds_table__cell__padding_y_compact, 0)',
|
|
90
129
|
bottom: 'var(--eds_table__cell__padding_y_compact, 0)',
|
|
91
|
-
left:
|
|
92
|
-
right:
|
|
130
|
+
left: `var(--eds_table__cell__padding_x_compact, ${medium})`,
|
|
131
|
+
right: `var(--eds_table__cell__padding_x_compact, ${medium})`
|
|
93
132
|
}
|
|
94
133
|
}
|
|
95
134
|
},
|
|
@@ -100,20 +139,22 @@ var tableCell = {
|
|
|
100
139
|
},
|
|
101
140
|
variants: {
|
|
102
141
|
numeric: {
|
|
103
|
-
typography:
|
|
142
|
+
typography: {
|
|
143
|
+
...cellNumericTypography,
|
|
104
144
|
color: typographyColor
|
|
105
|
-
}
|
|
145
|
+
},
|
|
106
146
|
modes: {
|
|
107
147
|
compact: {
|
|
108
|
-
typography:
|
|
148
|
+
typography: {
|
|
149
|
+
...compactTypography.table.cell_numeric_monospaced,
|
|
109
150
|
color: typographyColor
|
|
110
|
-
}
|
|
151
|
+
}
|
|
111
152
|
}
|
|
112
153
|
}
|
|
113
154
|
}
|
|
114
155
|
}
|
|
115
156
|
};
|
|
116
|
-
|
|
157
|
+
const applyVariant = (variant, token) => {
|
|
117
158
|
switch (variant) {
|
|
118
159
|
case 'numeric':
|
|
119
160
|
return mergeDeepRight(token, token.variants.numeric);
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
1
|
import { forwardRef } from 'react';
|
|
4
2
|
import styled from 'styled-components';
|
|
5
3
|
import { token } from './Head.tokens.js';
|
|
@@ -7,24 +5,25 @@ import { bordersTemplate } from '@equinor/eds-utils';
|
|
|
7
5
|
import { InnerContext } from '../Inner.context.js';
|
|
8
6
|
import { jsx } from 'react/jsx-runtime';
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
var StyledTableHead = styled.thead.withConfig({
|
|
8
|
+
const StyledTableHead = styled.thead.withConfig({
|
|
12
9
|
displayName: "Head__StyledTableHead",
|
|
13
10
|
componentId: "sc-g9tch7-0"
|
|
14
11
|
})(["", " background:", ";"], bordersTemplate(token.border), token.background);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
const Head = /*#__PURE__*/forwardRef(function Head({
|
|
13
|
+
children,
|
|
14
|
+
sticky,
|
|
15
|
+
...props
|
|
16
|
+
}, ref) {
|
|
19
17
|
return /*#__PURE__*/jsx(InnerContext.Provider, {
|
|
20
18
|
value: {
|
|
21
19
|
variant: 'head',
|
|
22
|
-
sticky
|
|
20
|
+
sticky
|
|
23
21
|
},
|
|
24
|
-
children: /*#__PURE__*/jsx(StyledTableHead,
|
|
22
|
+
children: /*#__PURE__*/jsx(StyledTableHead, {
|
|
23
|
+
...props,
|
|
25
24
|
ref: ref,
|
|
26
25
|
children: children
|
|
27
|
-
})
|
|
26
|
+
})
|
|
28
27
|
});
|
|
29
28
|
});
|
|
30
29
|
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
import { tokens } from '@equinor/eds-tokens';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
const {
|
|
4
|
+
colors: {
|
|
5
|
+
ui: {
|
|
6
|
+
background__medium: {
|
|
7
|
+
rgba: borderColor
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
interactive: {
|
|
11
|
+
table__header__fill_resting: {
|
|
12
|
+
rgba: backgroundColor
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
} = tokens;
|
|
17
|
+
const token = {
|
|
7
18
|
background: backgroundColor,
|
|
8
19
|
border: {
|
|
9
20
|
type: 'bordergroup',
|