@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,38 +1,37 @@
|
|
|
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 { primary } from './Card.tokens.js';
|
|
6
4
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
5
|
import { Typography } from '../Typography/Typography.js';
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
const {
|
|
8
|
+
spacings
|
|
9
|
+
} = primary;
|
|
10
|
+
const StyledCardActions = styled.div.withConfig({
|
|
12
11
|
displayName: "CardActions__StyledCardActions",
|
|
13
12
|
componentId: "sc-1d5vskp-0"
|
|
14
|
-
})(["display:grid;grid-gap:8px;grid-auto-flow:column;align-items:center;justify-content:", ";padding:0 ", " 0 ", ";margin-top:auto;&:first-child{padding-top:", ";}&:last-child{padding-bottom:", ";}"],
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
13
|
+
})(["display:grid;grid-gap:8px;grid-auto-flow:column;align-items:center;justify-content:", ";padding:0 ", " 0 ", ";margin-top:auto;&:first-child{padding-top:", ";}&:last-child{padding-bottom:", ";}"], ({
|
|
14
|
+
$justifyContent
|
|
15
|
+
}) => $justifyContent, spacings.right, spacings.left, spacings.top, spacings.bottom);
|
|
16
|
+
const CardActions = /*#__PURE__*/forwardRef(function CardActions({
|
|
17
|
+
children,
|
|
18
|
+
alignRight = false,
|
|
19
|
+
meta = '',
|
|
20
|
+
...rest
|
|
21
|
+
}, ref) {
|
|
22
|
+
const $justifyContent = alignRight ? 'flex-end' : 'flex-start';
|
|
23
|
+
const props = {
|
|
24
|
+
ref,
|
|
25
|
+
$justifyContent,
|
|
26
|
+
...rest
|
|
27
|
+
};
|
|
28
|
+
return /*#__PURE__*/jsxs(StyledCardActions, {
|
|
29
|
+
...props,
|
|
31
30
|
children: [children, meta !== '' && /*#__PURE__*/jsx(Typography, {
|
|
32
31
|
variant: "caption",
|
|
33
32
|
children: meta
|
|
34
33
|
})]
|
|
35
|
-
})
|
|
34
|
+
});
|
|
36
35
|
});
|
|
37
36
|
|
|
38
37
|
export { CardActions };
|
|
@@ -1,24 +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 from 'styled-components';
|
|
5
3
|
import { primary } from './Card.tokens.js';
|
|
6
4
|
import { jsx } from 'react/jsx-runtime';
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
const {
|
|
7
|
+
spacings
|
|
8
|
+
} = primary;
|
|
9
|
+
const StyledCardContent = styled.div.withConfig({
|
|
11
10
|
displayName: "CardContent__StyledCardContent",
|
|
12
11
|
componentId: "sc-esm4ym-0"
|
|
13
12
|
})(["display:grid;padding:0 ", " 0 ", ";&:last-child{padding-bottom:", ";}"], spacings.right, spacings.left, spacings.bottom);
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
const CardContent = /*#__PURE__*/forwardRef(function CardContent({
|
|
14
|
+
children,
|
|
15
|
+
...props
|
|
16
|
+
}, ref) {
|
|
17
|
+
return /*#__PURE__*/jsx(StyledCardContent, {
|
|
18
|
+
ref: ref,
|
|
19
|
+
...props,
|
|
20
20
|
children: children
|
|
21
|
-
})
|
|
21
|
+
});
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
export { CardContent };
|
|
@@ -1,25 +1,27 @@
|
|
|
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 { primary } from './Card.tokens.js';
|
|
6
4
|
import { jsx } from 'react/jsx-runtime';
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
const {
|
|
7
|
+
spacings
|
|
8
|
+
} = primary;
|
|
9
|
+
const StyledCardHeader = styled.div.withConfig({
|
|
11
10
|
displayName: "CardHeader__StyledCardHeader",
|
|
12
11
|
componentId: "sc-15k8edh-0"
|
|
13
12
|
})(["display:flex;justify-content:space-between;align-items:center;padding:0 ", " 0 ", ";> :not(:first-child){margin-left:", ";}&:first-child{padding-top:", ";}&:last-child{padding-bottom:", ";}"], spacings.right, spacings.left, spacings.left, spacings.top, spacings.bottom);
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
const CardHeader = /*#__PURE__*/forwardRef(function CardHeader({
|
|
14
|
+
children,
|
|
15
|
+
...rest
|
|
16
|
+
}, ref) {
|
|
17
|
+
const props = {
|
|
18
|
+
...rest,
|
|
19
|
+
ref
|
|
20
|
+
};
|
|
21
|
+
return /*#__PURE__*/jsx(StyledCardHeader, {
|
|
22
|
+
...props,
|
|
21
23
|
children: children
|
|
22
|
-
})
|
|
24
|
+
});
|
|
23
25
|
});
|
|
24
26
|
|
|
25
27
|
export { CardHeader };
|
|
@@ -1,23 +1,23 @@
|
|
|
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 { jsx } from 'react/jsx-runtime';
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
var StyledCardHeaderTitle = styled.div.withConfig({
|
|
5
|
+
const StyledCardHeaderTitle = styled.div.withConfig({
|
|
9
6
|
displayName: "CardHeaderTitle__StyledCardHeaderTitle",
|
|
10
7
|
componentId: "sc-11m80r3-0"
|
|
11
8
|
})(["display:grid;flex-grow:2;grid-auto-columns:auto;"]);
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
const CardHeaderTitle = /*#__PURE__*/forwardRef(function CardHeaderTitle({
|
|
10
|
+
children,
|
|
11
|
+
...rest
|
|
12
|
+
}, ref) {
|
|
13
|
+
const props = {
|
|
14
|
+
...rest,
|
|
15
|
+
ref
|
|
16
|
+
};
|
|
17
|
+
return /*#__PURE__*/jsx(StyledCardHeaderTitle, {
|
|
18
|
+
...props,
|
|
19
19
|
children: children
|
|
20
|
-
})
|
|
20
|
+
});
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
export { CardHeaderTitle };
|
|
@@ -1,32 +1,32 @@
|
|
|
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 { primary } from './Card.tokens.js';
|
|
6
4
|
import { jsx } from 'react/jsx-runtime';
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
border
|
|
11
|
-
|
|
6
|
+
const {
|
|
7
|
+
spacings,
|
|
8
|
+
border
|
|
9
|
+
} = primary;
|
|
10
|
+
const StyledCardMedia = styled.div.withConfig({
|
|
12
11
|
displayName: "CardMedia__StyledCardMedia",
|
|
13
12
|
componentId: "sc-kr8q9c-0"
|
|
14
|
-
})(["display:flex;width:auto;", ""],
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
ref
|
|
13
|
+
})(["display:flex;width:auto;", ""], ({
|
|
14
|
+
$fullWidth
|
|
15
|
+
}) => $fullWidth ? css(["> *{width:100%;}&:first-child{img{border-top-right-radius:", ";border-top-left-radius:", ";}}&:last-child{img{border-bottom-right-radius:", ";border-bottom-left-radius:", ";}}"], border.type === 'border' && border.radius, border.type === 'border' && border.radius, border.type === 'border' && border.radius, border.type === 'border' && border.radius) : css(["padding:0 ", " 0 ", ";&:first-child{padding:", " ", " 0 ", ";}&:last-child{padding:0 ", " ", " ", ";}> *{width:100%;}"], spacings.right, spacings.left, spacings.top, spacings.right, spacings.left, spacings.right, spacings.bottom, spacings.left));
|
|
16
|
+
const CardMedia = /*#__PURE__*/forwardRef(function CardMedia({
|
|
17
|
+
children,
|
|
18
|
+
fullWidth = false,
|
|
19
|
+
...rest
|
|
20
|
+
}, ref) {
|
|
21
|
+
const props = {
|
|
22
|
+
...rest,
|
|
23
|
+
ref,
|
|
25
24
|
$fullWidth: fullWidth
|
|
26
|
-
}
|
|
27
|
-
return /*#__PURE__*/jsx(StyledCardMedia,
|
|
25
|
+
};
|
|
26
|
+
return /*#__PURE__*/jsx(StyledCardMedia, {
|
|
27
|
+
...props,
|
|
28
28
|
children: children
|
|
29
|
-
})
|
|
29
|
+
});
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
export { CardMedia };
|
|
@@ -5,7 +5,7 @@ import { CardMedia } from './CardMedia.js';
|
|
|
5
5
|
import { CardHeader } from './CardHeader.js';
|
|
6
6
|
import { CardHeaderTitle } from './CardHeaderTitle.js';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
const Card = Card$1;
|
|
9
9
|
Card.Actions = CardActions;
|
|
10
10
|
Card.Content = CardContent;
|
|
11
11
|
Card.Header = CardHeader;
|
|
@@ -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 { checkbox } from './Checkbox.tokens.js';
|
|
@@ -7,44 +5,45 @@ import { typographyTemplate } from '@equinor/eds-utils';
|
|
|
7
5
|
import { CheckboxInput } from './Input.js';
|
|
8
6
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
/* eslint camelcase: "off" */
|
|
9
|
+
const StyledLabel = styled.label.withConfig({
|
|
12
10
|
displayName: "Checkbox__StyledLabel",
|
|
13
11
|
componentId: "sc-yg6l8h-0"
|
|
14
|
-
})(["display:inline-flex;align-items:center;cursor:", ";"],
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var LabelText = styled.span.withConfig({
|
|
12
|
+
})(["display:inline-flex;align-items:center;cursor:", ";"], ({
|
|
13
|
+
$disabled
|
|
14
|
+
}) => $disabled ? 'not-allowed' : 'pointer');
|
|
15
|
+
const LabelText = styled.span.withConfig({
|
|
19
16
|
displayName: "Checkbox__LabelText",
|
|
20
17
|
componentId: "sc-yg6l8h-1"
|
|
21
18
|
})(["", ";"], typographyTemplate(checkbox.typography));
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
19
|
+
const Checkbox = /*#__PURE__*/forwardRef(function Checkbox({
|
|
20
|
+
label,
|
|
21
|
+
disabled = false,
|
|
22
|
+
indeterminate,
|
|
23
|
+
className,
|
|
24
|
+
style,
|
|
25
|
+
...rest
|
|
26
|
+
}, ref) {
|
|
30
27
|
return label ? /*#__PURE__*/jsxs(StyledLabel, {
|
|
31
28
|
$disabled: disabled,
|
|
32
29
|
className: className,
|
|
33
30
|
style: style,
|
|
34
|
-
children: [/*#__PURE__*/jsx(CheckboxInput,
|
|
31
|
+
children: [/*#__PURE__*/jsx(CheckboxInput, {
|
|
32
|
+
...rest,
|
|
35
33
|
disabled: disabled,
|
|
36
34
|
ref: ref,
|
|
37
35
|
indeterminate: indeterminate
|
|
38
|
-
})
|
|
36
|
+
}), /*#__PURE__*/jsx(LabelText, {
|
|
39
37
|
children: label
|
|
40
38
|
})]
|
|
41
|
-
}) : /*#__PURE__*/jsx(CheckboxInput,
|
|
39
|
+
}) : /*#__PURE__*/jsx(CheckboxInput, {
|
|
40
|
+
...rest,
|
|
42
41
|
className: className,
|
|
43
42
|
style: style,
|
|
44
43
|
disabled: disabled,
|
|
45
44
|
ref: ref,
|
|
46
45
|
indeterminate: indeterminate
|
|
47
|
-
})
|
|
46
|
+
});
|
|
48
47
|
});
|
|
49
48
|
Checkbox.displayName = 'Checkbox';
|
|
50
49
|
|
|
@@ -1,21 +1,46 @@
|
|
|
1
1
|
import { tokens } from '@equinor/eds-tokens';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
3
|
+
const {
|
|
4
|
+
colors: {
|
|
5
|
+
interactive: {
|
|
6
|
+
primary__resting: {
|
|
7
|
+
rgba: primaryColor
|
|
8
|
+
},
|
|
9
|
+
primary__hover_alt: {
|
|
10
|
+
rgba: primaryHoverAlt
|
|
11
|
+
},
|
|
12
|
+
focus: {
|
|
13
|
+
rgba: focusOutlineColor
|
|
14
|
+
},
|
|
15
|
+
disabled__text: {
|
|
16
|
+
rgba: disabledText
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
typography: {
|
|
21
|
+
navigation: {
|
|
22
|
+
menu_title: labelTypography
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
spacings: {
|
|
26
|
+
comfortable: {
|
|
27
|
+
medium_small,
|
|
28
|
+
x_small,
|
|
29
|
+
x_large,
|
|
30
|
+
xx_large
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
clickbounds: {
|
|
34
|
+
default__base: clicboundSize,
|
|
35
|
+
compact__standard: compactClickboundSize
|
|
36
|
+
},
|
|
37
|
+
interactions: {
|
|
38
|
+
focused: {
|
|
39
|
+
width: focusOutlineWidth
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
} = tokens;
|
|
43
|
+
const checkbox = {
|
|
19
44
|
background: primaryColor,
|
|
20
45
|
typography: labelTypography,
|
|
21
46
|
width: xx_large,
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
-
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
3
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
4
1
|
import { forwardRef } from 'react';
|
|
5
2
|
import styled, { ThemeProvider } from 'styled-components';
|
|
6
3
|
import { checkbox_indeterminate, checkbox as checkbox$1, checkbox_outline } from '@equinor/eds-icons';
|
|
@@ -9,101 +6,95 @@ import { outlineTemplate, spacingsTemplate, useToken } from '@equinor/eds-utils'
|
|
|
9
6
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
10
7
|
import { useEds } from '../EdsProvider/eds.context.js';
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}).withConfig({
|
|
9
|
+
/* eslint camelcase: "off" */
|
|
10
|
+
const StyledPath = styled.path.attrs(({
|
|
11
|
+
$icon
|
|
12
|
+
}) => ({
|
|
13
|
+
fillRule: 'evenodd',
|
|
14
|
+
clipRule: 'evenodd',
|
|
15
|
+
d: $icon.svgPathData
|
|
16
|
+
})).withConfig({
|
|
21
17
|
displayName: "Input__StyledPath",
|
|
22
18
|
componentId: "sc-rqj7qf-0"
|
|
23
19
|
})([""]);
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
30
|
-
}).withConfig({
|
|
20
|
+
const Input = styled.input.attrs(({
|
|
21
|
+
type = 'checkbox'
|
|
22
|
+
}) => ({
|
|
23
|
+
type
|
|
24
|
+
})).withConfig({
|
|
31
25
|
displayName: "Input",
|
|
32
26
|
componentId: "sc-rqj7qf-1"
|
|
33
|
-
})(["--scale:", ";appearance:none;width:100%;height:100%;margin:0;grid-area:input;transform:scale(var(--scale));cursor:", ";&:focus{outline:none;}&[data-focus-visible-added]:focus + svg{", "}&:focus-visible + svg{", "}&:not(:checked) ~ svg path[name='checked']{display:none;}&:not(:checked) ~ svg path[name='not-checked']{display:inline;}&:checked ~ svg path[name='not-checked']{display:none;}&:checked ~ svg path[name='checked']{display:inline;}"],
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
height: height,
|
|
55
|
-
width: width,
|
|
56
|
-
fill: fill
|
|
57
|
-
};
|
|
58
|
-
}).withConfig({
|
|
27
|
+
})(["--scale:", ";appearance:none;width:100%;height:100%;margin:0;grid-area:input;transform:scale(var(--scale));cursor:", ";&:focus{outline:none;}&[data-focus-visible-added]:focus + svg{", "}&:focus-visible + svg{", "}&:not(:checked) ~ svg path[name='checked']{display:none;}&:not(:checked) ~ svg path[name='not-checked']{display:inline;}&:checked ~ svg path[name='not-checked']{display:none;}&:checked ~ svg path[name='checked']{display:inline;}"], ({
|
|
28
|
+
theme,
|
|
29
|
+
$iconSize
|
|
30
|
+
}) => parseFloat(theme.clickbound.height) / $iconSize, ({
|
|
31
|
+
disabled
|
|
32
|
+
}) => disabled ? 'not-allowed' : 'pointer', ({
|
|
33
|
+
theme
|
|
34
|
+
}) => outlineTemplate(theme.states.focus.outline), ({
|
|
35
|
+
theme
|
|
36
|
+
}) => outlineTemplate(theme.states.focus.outline));
|
|
37
|
+
const Svg = styled.svg.attrs(({
|
|
38
|
+
height,
|
|
39
|
+
width,
|
|
40
|
+
fill
|
|
41
|
+
}) => ({
|
|
42
|
+
name: null,
|
|
43
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
44
|
+
height,
|
|
45
|
+
width,
|
|
46
|
+
fill
|
|
47
|
+
})).withConfig({
|
|
59
48
|
displayName: "Input__Svg",
|
|
60
49
|
componentId: "sc-rqj7qf-2"
|
|
61
50
|
})(["grid-area:input;pointer-events:none;"]);
|
|
62
|
-
|
|
51
|
+
const InputWrapper = styled.span.withConfig({
|
|
63
52
|
displayName: "Input__InputWrapper",
|
|
64
53
|
componentId: "sc-rqj7qf-3"
|
|
65
|
-
})(["display:inline-grid;grid:[input] 1fr / [input] 1fr;position:relative;isolation:isolate;", " &::before{content:'';position:absolute;width:", ";aspect-ratio:1/1;top:50%;left:50%;transform:translate(-50%,-50%);border-radius:100%;}@media (hover:hover) and (pointer:fine){> svg{z-index:1;}&:hover{&::before{background-color:", ";}}}"],
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
density
|
|
84
|
-
var token = useToken({
|
|
85
|
-
density: density
|
|
54
|
+
})(["display:inline-grid;grid:[input] 1fr / [input] 1fr;position:relative;isolation:isolate;", " &::before{content:'';position:absolute;width:", ";aspect-ratio:1/1;top:50%;left:50%;transform:translate(-50%,-50%);border-radius:100%;}@media (hover:hover) and (pointer:fine){> svg{z-index:1;}&:hover{&::before{background-color:", ";}}}"], ({
|
|
55
|
+
theme
|
|
56
|
+
}) => spacingsTemplate(theme.spacings), ({
|
|
57
|
+
theme
|
|
58
|
+
}) => theme.width, ({
|
|
59
|
+
disabled
|
|
60
|
+
}) => disabled ? 'transparent' : checkbox.states.hover.background);
|
|
61
|
+
const CheckboxInput = /*#__PURE__*/forwardRef(function CheckboxInput({
|
|
62
|
+
disabled = false,
|
|
63
|
+
indeterminate,
|
|
64
|
+
style,
|
|
65
|
+
className,
|
|
66
|
+
...rest
|
|
67
|
+
}, ref) {
|
|
68
|
+
const {
|
|
69
|
+
density
|
|
70
|
+
} = useEds();
|
|
71
|
+
const token = useToken({
|
|
72
|
+
density
|
|
86
73
|
}, checkbox);
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
disabled
|
|
91
|
-
style
|
|
92
|
-
className
|
|
74
|
+
const iconSize = 24;
|
|
75
|
+
const fill = disabled ? checkbox.states.disabled.background : checkbox.background;
|
|
76
|
+
const inputWrapperProps = {
|
|
77
|
+
disabled,
|
|
78
|
+
style,
|
|
79
|
+
className
|
|
80
|
+
};
|
|
81
|
+
const inputProps = {
|
|
82
|
+
ref,
|
|
83
|
+
disabled,
|
|
84
|
+
['data-indeterminate']: indeterminate,
|
|
85
|
+
...rest
|
|
93
86
|
};
|
|
94
|
-
var inputProps = _objectSpread(_defineProperty({
|
|
95
|
-
ref: ref,
|
|
96
|
-
disabled: disabled
|
|
97
|
-
}, 'data-indeterminate', indeterminate), rest);
|
|
98
87
|
return /*#__PURE__*/jsx(ThemeProvider, {
|
|
99
88
|
theme: token,
|
|
100
|
-
children: /*#__PURE__*/jsxs(InputWrapper,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
89
|
+
children: /*#__PURE__*/jsxs(InputWrapper, {
|
|
90
|
+
...inputWrapperProps,
|
|
91
|
+
children: [/*#__PURE__*/jsx(Input, {
|
|
92
|
+
$iconSize: iconSize,
|
|
93
|
+
...inputProps
|
|
94
|
+
}), indeterminate ? /*#__PURE__*/jsx(Svg, {
|
|
104
95
|
width: iconSize,
|
|
105
96
|
height: iconSize,
|
|
106
|
-
viewBox:
|
|
97
|
+
viewBox: `0 0 ${iconSize} ${iconSize}`,
|
|
107
98
|
fill: fill,
|
|
108
99
|
"aria-hidden": true,
|
|
109
100
|
children: /*#__PURE__*/jsx(StyledPath, {
|
|
@@ -113,7 +104,7 @@ var CheckboxInput = /*#__PURE__*/forwardRef(function CheckboxInput(_ref11, ref)
|
|
|
113
104
|
}) : /*#__PURE__*/jsxs(Svg, {
|
|
114
105
|
width: iconSize,
|
|
115
106
|
height: iconSize,
|
|
116
|
-
viewBox:
|
|
107
|
+
viewBox: `0 0 ${iconSize} ${iconSize}`,
|
|
117
108
|
fill: fill,
|
|
118
109
|
"aria-hidden": true,
|
|
119
110
|
children: [/*#__PURE__*/jsx(StyledPath, {
|
|
@@ -124,7 +115,7 @@ var CheckboxInput = /*#__PURE__*/forwardRef(function CheckboxInput(_ref11, ref)
|
|
|
124
115
|
name: "not-checked"
|
|
125
116
|
})]
|
|
126
117
|
})]
|
|
127
|
-
})
|
|
118
|
+
})
|
|
128
119
|
});
|
|
129
120
|
});
|
|
130
121
|
|