@equinor/eds-core-react 0.23.0-dev.20221003 → 0.24.0-dev.20221006
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 +4147 -5179
- package/dist/esm/components/Accordion/Accordion.js +26 -21
- package/dist/esm/components/Accordion/Accordion.tokens.js +23 -62
- package/dist/esm/components/Accordion/AccordionHeader.js +58 -77
- package/dist/esm/components/Accordion/AccordionHeaderActions.js +19 -23
- package/dist/esm/components/Accordion/AccordionHeaderTitle.js +19 -23
- package/dist/esm/components/Accordion/AccordionItem.js +32 -25
- package/dist/esm/components/Accordion/AccordionPanel.js +22 -27
- package/dist/esm/components/Accordion/index.js +1 -1
- package/dist/esm/components/Autocomplete/Autocomplete.js +279 -272
- package/dist/esm/components/Autocomplete/Autocomplete.tokens.js +18 -27
- package/dist/esm/components/Autocomplete/Option.js +27 -25
- package/dist/esm/components/Avatar/Avatar.js +23 -22
- package/dist/esm/components/Avatar/Avatar.tokens.js +1 -1
- package/dist/esm/components/Banner/Banner.js +31 -27
- package/dist/esm/components/Banner/Banner.tokens.js +19 -47
- package/dist/esm/components/Banner/BannerActions.js +21 -20
- package/dist/esm/components/Banner/BannerIcon.js +28 -28
- package/dist/esm/components/Banner/BannerMessage.js +16 -14
- package/dist/esm/components/Banner/index.js +1 -1
- package/dist/esm/components/Breadcrumbs/Breadcrumb.js +30 -29
- package/dist/esm/components/Breadcrumbs/Breadcrumbs.js +47 -40
- package/dist/esm/components/Breadcrumbs/Breadcrumbs.tokens.js +5 -20
- package/dist/esm/components/Breadcrumbs/index.js +1 -1
- package/dist/esm/components/Button/Button.js +49 -46
- package/dist/esm/components/Button/ButtonGroup/ButtonGroup.js +22 -24
- package/dist/esm/components/Button/ButtonGroup/ButtonGroup.tokens.js +2 -8
- package/dist/esm/components/Button/InnerFullWidth.js +10 -9
- package/dist/esm/components/Button/ToggleButton/ToggleButton.js +31 -21
- package/dist/esm/components/Button/index.js +1 -1
- package/dist/esm/components/Button/tokens/button.js +31 -60
- package/dist/esm/components/Button/tokens/contained.js +14 -38
- package/dist/esm/components/Button/tokens/contained_icon.js +10 -13
- package/dist/esm/components/Button/tokens/ghost.js +13 -36
- package/dist/esm/components/Button/tokens/icon.js +20 -46
- package/dist/esm/components/Button/tokens/index.js +1 -1
- package/dist/esm/components/Button/tokens/outlined.js +15 -42
- package/dist/esm/components/Card/Card.js +28 -26
- package/dist/esm/components/Card/Card.tokens.js +11 -32
- package/dist/esm/components/Card/CardActions.js +24 -23
- package/dist/esm/components/Card/CardContent.js +13 -13
- package/dist/esm/components/Card/CardHeader.js +15 -14
- package/dist/esm/components/Card/CardHeaderTitle.js +14 -11
- package/dist/esm/components/Card/CardMedia.js +21 -21
- package/dist/esm/components/Card/index.js +1 -1
- package/dist/esm/components/Checkbox/Checkbox.js +20 -20
- package/dist/esm/components/Checkbox/Checkbox.tokens.js +14 -39
- package/dist/esm/components/Checkbox/Input.js +63 -78
- package/dist/esm/components/Chip/Chip.js +60 -70
- package/dist/esm/components/Chip/Chip.tokens.js +27 -68
- package/dist/esm/components/Chip/Icon.js +9 -15
- package/dist/esm/components/Dialog/Dialog.js +36 -31
- package/dist/esm/components/Dialog/Dialog.tokens.js +8 -29
- package/dist/esm/components/Dialog/DialogActions.js +15 -15
- package/dist/esm/components/Dialog/DialogContent.js +23 -22
- package/dist/esm/components/Dialog/DialogHeader.js +17 -16
- package/dist/esm/components/Dialog/DialogTitle.js +15 -15
- package/dist/esm/components/Dialog/index.js +1 -1
- package/dist/esm/components/Divider/Divider.js +28 -25
- package/dist/esm/components/Divider/Divider.tokens.js +10 -24
- package/dist/esm/components/EdsProvider/eds.context.js +26 -16
- package/dist/esm/components/Icon/Icon.js +63 -67
- package/dist/esm/components/Icon/index.js +1 -1
- package/dist/esm/components/Icon/library.js +8 -8
- package/dist/esm/components/Input/Input.js +37 -40
- package/dist/esm/components/Input/Input.tokens.js +32 -43
- package/dist/esm/components/Label/Label.js +19 -17
- package/dist/esm/components/Label/Label.tokens.js +7 -10
- package/dist/esm/components/List/List.js +18 -19
- package/dist/esm/components/List/List.tokens.js +2 -6
- package/dist/esm/components/List/ListItem.js +9 -7
- package/dist/esm/components/List/index.js +1 -1
- package/dist/esm/components/Menu/Menu.context.js +45 -34
- package/dist/esm/components/Menu/Menu.js +92 -90
- package/dist/esm/components/Menu/Menu.tokens.js +24 -54
- package/dist/esm/components/Menu/MenuItem.js +50 -58
- package/dist/esm/components/Menu/MenuList.js +54 -50
- 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 +75 -71
- package/dist/esm/components/Pagination/Pagination.tokens.js +5 -18
- package/dist/esm/components/Pagination/PaginationItem.js +21 -19
- package/dist/esm/components/Pagination/paginationControl.js +22 -18
- package/dist/esm/components/Paper/Paper.js +15 -14
- package/dist/esm/components/Paper/Paper.tokens.js +4 -12
- package/dist/esm/components/Popover/Popover.js +85 -88
- package/dist/esm/components/Popover/Popover.tokens.js +8 -27
- package/dist/esm/components/Popover/PopoverActions.js +16 -16
- package/dist/esm/components/Popover/PopoverContent.js +16 -15
- package/dist/esm/components/Popover/PopoverHeader.js +17 -16
- package/dist/esm/components/Popover/PopoverTitle.js +16 -15
- package/dist/esm/components/Popover/index.js +1 -1
- package/dist/esm/components/Progress/Circular/CircularProgress.js +46 -34
- package/dist/esm/components/Progress/Circular/CircularProgress.tokens.js +8 -24
- package/dist/esm/components/Progress/Dots/DotProgress.js +23 -20
- package/dist/esm/components/Progress/Dots/DotProgress.tokens.js +8 -20
- package/dist/esm/components/Progress/Linear/LinearProgress.js +34 -24
- package/dist/esm/components/Progress/Linear/LinearProgress.tokens.js +4 -13
- package/dist/esm/components/Progress/Star/StarProgress.js +29 -25
- package/dist/esm/components/Progress/Star/StarProgress.tokens.js +2 -10
- package/dist/esm/components/Progress/index.js +1 -1
- package/dist/esm/components/Radio/Radio.js +57 -76
- package/dist/esm/components/Radio/Radio.tokens.js +14 -39
- package/dist/esm/components/Scrim/Scrim.js +24 -21
- package/dist/esm/components/Scrim/Scrim.tokens.js +3 -11
- package/dist/esm/components/Search/Search.js +130 -117
- package/dist/esm/components/Search/Search.tokens.js +12 -36
- package/dist/esm/components/Select/MultiSelect/MultiSelect.js +115 -105
- package/dist/esm/components/Select/NativeSelect/NativeSelect.js +45 -43
- package/dist/esm/components/Select/NativeSelect/NativeSelect.tokens.js +10 -14
- package/dist/esm/components/Select/Select.tokens.js +18 -27
- package/dist/esm/components/Select/SingleSelect/SingleSelect.js +86 -79
- package/dist/esm/components/Select/commonStyles.js +14 -26
- package/dist/esm/components/SideSheet/SideSheet.js +29 -27
- package/dist/esm/components/SideSheet/SideSheet.tokens.js +12 -28
- package/dist/esm/components/Slider/MinMax.js +6 -11
- package/dist/esm/components/Slider/Output.js +10 -17
- package/dist/esm/components/Slider/Slider.js +126 -116
- package/dist/esm/components/Slider/Slider.tokens.js +19 -51
- package/dist/esm/components/Slider/SliderInput.js +35 -37
- package/dist/esm/components/Snackbar/Snackbar.js +45 -34
- package/dist/esm/components/Snackbar/Snackbar.tokens.js +17 -44
- package/dist/esm/components/Snackbar/SnackbarAction.js +16 -15
- package/dist/esm/components/Snackbar/index.js +1 -1
- package/dist/esm/components/Switch/Switch.js +37 -38
- package/dist/esm/components/Switch/Switch.styles.js +14 -20
- package/dist/esm/components/Switch/Switch.tokens.js +25 -70
- package/dist/esm/components/Switch/SwitchDefault.js +27 -37
- package/dist/esm/components/Switch/SwitchSmall.js +28 -41
- package/dist/esm/components/Table/Body.js +10 -8
- package/dist/esm/components/Table/Caption.js +9 -9
- package/dist/esm/components/Table/Cell.js +14 -16
- package/dist/esm/components/Table/DataCell/DataCell.js +27 -28
- package/dist/esm/components/Table/DataCell/DataCell.tokens.js +38 -73
- package/dist/esm/components/Table/Head/Head.js +12 -10
- package/dist/esm/components/Table/Head/Head.tokens.js +4 -15
- package/dist/esm/components/Table/HeaderCell/HeaderCell.js +30 -32
- package/dist/esm/components/Table/HeaderCell/HeaderCell.tokens.js +28 -62
- package/dist/esm/components/Table/Inner.context.js +2 -2
- package/dist/esm/components/Table/Row/Row.js +11 -13
- package/dist/esm/components/Table/Row/Row.tokens.js +4 -13
- package/dist/esm/components/Table/Table.js +10 -8
- package/dist/esm/components/Table/index.js +1 -1
- package/dist/esm/components/TableOfContents/LinkItem.js +12 -12
- package/dist/esm/components/TableOfContents/TableOfContents.js +28 -28
- package/dist/esm/components/TableOfContents/TableOfContents.tokens.js +21 -43
- package/dist/esm/components/TableOfContents/index.js +1 -1
- package/dist/esm/components/Tabs/Tab.js +15 -21
- package/dist/esm/components/Tabs/TabList.js +61 -52
- package/dist/esm/components/Tabs/TabPanel.js +18 -20
- package/dist/esm/components/Tabs/TabPanels.js +22 -18
- package/dist/esm/components/Tabs/Tabs.context.js +5 -3
- package/dist/esm/components/Tabs/Tabs.js +60 -39
- package/dist/esm/components/Tabs/Tabs.tokens.js +21 -55
- package/dist/esm/components/Tabs/index.js +1 -1
- package/dist/esm/components/TextField/Field.js +78 -85
- package/dist/esm/components/TextField/HelperText/HelperText.js +37 -40
- package/dist/esm/components/TextField/HelperText/HelperText.token.js +5 -9
- package/dist/esm/components/TextField/Icon/Icon.js +41 -40
- package/dist/esm/components/TextField/Icon/Icon.tokens.js +4 -8
- package/dist/esm/components/TextField/TextField.context.js +29 -19
- package/dist/esm/components/TextField/TextField.js +59 -57
- package/dist/esm/components/TextField/TextField.tokens.js +12 -16
- package/dist/esm/components/Textarea/Textarea.js +56 -58
- package/dist/esm/components/Tooltip/Tooltip.js +76 -64
- package/dist/esm/components/Tooltip/Tooltip.tokens.js +13 -32
- package/dist/esm/components/TopBar/Actions.js +12 -10
- package/dist/esm/components/TopBar/CustomContent.js +12 -10
- package/dist/esm/components/TopBar/Header.js +12 -10
- package/dist/esm/components/TopBar/TopBar.js +29 -25
- package/dist/esm/components/TopBar/TopBar.tokens.js +4 -10
- package/dist/esm/components/TopBar/index.js +1 -1
- package/dist/esm/components/Typography/Typography.js +47 -53
- package/dist/esm/components/Typography/Typography.tokens.js +25 -49
- package/dist/esm/node_modules/.pnpm/ramda@0.28.0/node_modules/ramda/es/internal/_isPlaceholder.js +3 -1
- package/dist/types/components/Autocomplete/Autocomplete.d.ts +4 -0
- package/package.json +5 -11
|
@@ -1,40 +1,41 @@
|
|
|
1
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
1
3
|
import { forwardRef } from 'react';
|
|
2
4
|
import styled from 'styled-components';
|
|
3
5
|
import { primary } from './Card.tokens.js';
|
|
4
6
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
7
|
import { Typography } from '../Typography/Typography.js';
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const StyledCardActions = styled.div.withConfig({
|
|
9
|
+
var _excluded = ["children", "alignRight", "meta"];
|
|
10
|
+
var spacings = primary.spacings;
|
|
11
|
+
var StyledCardActions = styled.div.withConfig({
|
|
11
12
|
displayName: "CardActions__StyledCardActions",
|
|
12
13
|
componentId: "sc-1d5vskp-0"
|
|
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:", ";}"], _ref
|
|
14
|
-
|
|
15
|
-
justifyContent
|
|
16
|
-
} = _ref;
|
|
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:", ";}"], function (_ref) {
|
|
15
|
+
var justifyContent = _ref.justifyContent;
|
|
17
16
|
return justifyContent;
|
|
18
17
|
}, spacings.right, spacings.left, spacings.top, spacings.bottom);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
var CardActions = /*#__PURE__*/forwardRef(function CardActions(_ref2, ref) {
|
|
19
|
+
var children = _ref2.children,
|
|
20
|
+
_ref2$alignRight = _ref2.alignRight,
|
|
21
|
+
alignRight = _ref2$alignRight === void 0 ? false : _ref2$alignRight,
|
|
22
|
+
_ref2$meta = _ref2.meta,
|
|
23
|
+
meta = _ref2$meta === void 0 ? '' : _ref2$meta,
|
|
24
|
+
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
25
|
+
|
|
26
|
+
var justifyContent = alignRight ? 'flex-end' : 'flex-start';
|
|
27
|
+
|
|
28
|
+
var props = _objectSpread({
|
|
29
|
+
ref: ref,
|
|
30
|
+
justifyContent: justifyContent
|
|
31
|
+
}, rest);
|
|
32
|
+
|
|
33
|
+
return /*#__PURE__*/jsxs(StyledCardActions, _objectSpread(_objectSpread({}, props), {}, {
|
|
33
34
|
children: [children, meta !== '' && /*#__PURE__*/jsx(Typography, {
|
|
34
35
|
variant: "caption",
|
|
35
36
|
children: meta
|
|
36
37
|
})]
|
|
37
|
-
});
|
|
38
|
+
}));
|
|
38
39
|
});
|
|
39
40
|
|
|
40
41
|
export { CardActions };
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
1
3
|
import { forwardRef } from 'react';
|
|
2
4
|
import styled from 'styled-components';
|
|
3
5
|
import { primary } from './Card.tokens.js';
|
|
4
6
|
import { jsx } from 'react/jsx-runtime';
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const StyledCardContent = styled.div.withConfig({
|
|
8
|
+
var _excluded = ["children"];
|
|
9
|
+
var spacings = primary.spacings;
|
|
10
|
+
var StyledCardContent = styled.div.withConfig({
|
|
10
11
|
displayName: "CardContent__StyledCardContent",
|
|
11
12
|
componentId: "sc-esm4ym-0"
|
|
12
13
|
})(["display:grid;padding:0 ", " 0 ", ";:last-child{padding-bottom:", ";}"], spacings.right, spacings.left, spacings.bottom);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
...props,
|
|
14
|
+
var CardContent = /*#__PURE__*/forwardRef(function CardContent(_ref, ref) {
|
|
15
|
+
var children = _ref.children,
|
|
16
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
17
|
+
|
|
18
|
+
return /*#__PURE__*/jsx(StyledCardContent, _objectSpread(_objectSpread({
|
|
19
|
+
ref: ref
|
|
20
|
+
}, props), {}, {
|
|
21
21
|
children: children
|
|
22
|
-
});
|
|
22
|
+
}));
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
export { CardContent };
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
1
3
|
import { forwardRef } from 'react';
|
|
2
4
|
import styled from 'styled-components';
|
|
3
5
|
import { primary } from './Card.tokens.js';
|
|
4
6
|
import { jsx } from 'react/jsx-runtime';
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const StyledCardHeader = styled.div.withConfig({
|
|
8
|
+
var _excluded = ["children"];
|
|
9
|
+
var spacings = primary.spacings;
|
|
10
|
+
var StyledCardHeader = styled.div.withConfig({
|
|
10
11
|
displayName: "CardHeader__StyledCardHeader",
|
|
11
12
|
componentId: "sc-15k8edh-0"
|
|
12
13
|
})(["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);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
ref
|
|
20
|
-
};
|
|
21
|
-
return /*#__PURE__*/jsx(StyledCardHeader, { ...props,
|
|
22
|
-
children: children
|
|
14
|
+
var CardHeader = /*#__PURE__*/forwardRef(function CardHeader(_ref, ref) {
|
|
15
|
+
var children = _ref.children,
|
|
16
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
17
|
+
|
|
18
|
+
var props = _objectSpread(_objectSpread({}, rest), {}, {
|
|
19
|
+
ref: ref
|
|
23
20
|
});
|
|
21
|
+
|
|
22
|
+
return /*#__PURE__*/jsx(StyledCardHeader, _objectSpread(_objectSpread({}, props), {}, {
|
|
23
|
+
children: children
|
|
24
|
+
}));
|
|
24
25
|
});
|
|
25
26
|
|
|
26
27
|
export { CardHeader };
|
|
@@ -1,22 +1,25 @@
|
|
|
1
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
1
3
|
import { forwardRef } from 'react';
|
|
2
4
|
import styled from 'styled-components';
|
|
3
5
|
import { jsx } from 'react/jsx-runtime';
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
var _excluded = ["children"];
|
|
8
|
+
var StyledCardHeaderTitle = styled.div.withConfig({
|
|
6
9
|
displayName: "CardHeaderTitle__StyledCardHeaderTitle",
|
|
7
10
|
componentId: "sc-11m80r3-0"
|
|
8
11
|
})(["display:grid;flex-grow:2;grid-auto-columns:auto;"]);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
ref
|
|
16
|
-
};
|
|
17
|
-
return /*#__PURE__*/jsx(StyledCardHeaderTitle, { ...props,
|
|
18
|
-
children: children
|
|
12
|
+
var CardHeaderTitle = /*#__PURE__*/forwardRef(function CardHeaderTitle(_ref, ref) {
|
|
13
|
+
var children = _ref.children,
|
|
14
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
15
|
+
|
|
16
|
+
var props = _objectSpread(_objectSpread({}, rest), {}, {
|
|
17
|
+
ref: ref
|
|
19
18
|
});
|
|
19
|
+
|
|
20
|
+
return /*#__PURE__*/jsx(StyledCardHeaderTitle, _objectSpread(_objectSpread({}, props), {}, {
|
|
21
|
+
children: children
|
|
22
|
+
}));
|
|
20
23
|
});
|
|
21
24
|
|
|
22
25
|
export { CardHeaderTitle };
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
1
3
|
import { forwardRef } from 'react';
|
|
2
4
|
import styled, { css } from 'styled-components';
|
|
3
5
|
import { primary } from './Card.tokens.js';
|
|
4
6
|
import { jsx } from 'react/jsx-runtime';
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const StyledCardMedia = styled.div.withConfig({
|
|
8
|
+
var _excluded = ["children", "fullWidth"];
|
|
9
|
+
var spacings = primary.spacings,
|
|
10
|
+
border = primary.border;
|
|
11
|
+
var StyledCardMedia = styled.div.withConfig({
|
|
11
12
|
displayName: "CardMedia__StyledCardMedia",
|
|
12
13
|
componentId: "sc-kr8q9c-0"
|
|
13
|
-
})(["display:flex;width:auto;", ""], _ref
|
|
14
|
-
|
|
15
|
-
fullWidth
|
|
16
|
-
} = _ref;
|
|
14
|
+
})(["display:flex;width:auto;", ""], function (_ref) {
|
|
15
|
+
var fullWidth = _ref.fullWidth;
|
|
17
16
|
return 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);
|
|
18
17
|
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
ref,
|
|
27
|
-
fullWidth
|
|
28
|
-
};
|
|
29
|
-
return /*#__PURE__*/jsx(StyledCardMedia, { ...props,
|
|
30
|
-
children: children
|
|
18
|
+
var CardMedia = /*#__PURE__*/forwardRef(function CardMedia(_ref2, ref) {
|
|
19
|
+
var children = _ref2.children,
|
|
20
|
+
_ref2$fullWidth = _ref2.fullWidth,
|
|
21
|
+
fullWidth = _ref2$fullWidth === void 0 ? false : _ref2$fullWidth,
|
|
22
|
+
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
23
|
+
|
|
24
|
+
var props = _objectSpread(_objectSpread({}, rest), {}, {
|
|
25
|
+
ref: ref,
|
|
26
|
+
fullWidth: fullWidth
|
|
31
27
|
});
|
|
28
|
+
|
|
29
|
+
return /*#__PURE__*/jsx(StyledCardMedia, _objectSpread(_objectSpread({}, props), {}, {
|
|
30
|
+
children: children
|
|
31
|
+
}));
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
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
|
+
var Card = Card$1;
|
|
9
9
|
Card.Actions = CardActions;
|
|
10
10
|
Card.Content = CardContent;
|
|
11
11
|
Card.Header = CardHeader;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
1
3
|
import { forwardRef } from 'react';
|
|
2
4
|
import styled from 'styled-components';
|
|
3
5
|
import { checkbox } from './Checkbox.tokens.js';
|
|
@@ -5,47 +7,45 @@ import { typographyTemplate } from '@equinor/eds-utils';
|
|
|
5
7
|
import { CheckboxInput } from './Input.js';
|
|
6
8
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
var _excluded = ["label", "disabled", "indeterminate", "className", "style"];
|
|
11
|
+
var StyledLabel = styled.label.withConfig({
|
|
10
12
|
displayName: "Checkbox__StyledLabel",
|
|
11
13
|
componentId: "sc-yg6l8h-0"
|
|
12
|
-
})(["display:inline-flex;align-items:center;cursor:", ";"], _ref
|
|
13
|
-
|
|
14
|
-
disabled
|
|
15
|
-
} = _ref;
|
|
14
|
+
})(["display:inline-flex;align-items:center;cursor:", ";"], function (_ref) {
|
|
15
|
+
var disabled = _ref.disabled;
|
|
16
16
|
return disabled ? 'not-allowed' : 'pointer';
|
|
17
17
|
});
|
|
18
|
-
|
|
18
|
+
var LabelText = styled.span.withConfig({
|
|
19
19
|
displayName: "Checkbox__LabelText",
|
|
20
20
|
componentId: "sc-yg6l8h-1"
|
|
21
21
|
})(["", ";"], typographyTemplate(checkbox.typography));
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
var Checkbox = /*#__PURE__*/forwardRef(function Checkbox(_ref2, ref) {
|
|
23
|
+
var label = _ref2.label,
|
|
24
|
+
_ref2$disabled = _ref2.disabled,
|
|
25
|
+
disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
|
|
26
|
+
indeterminate = _ref2.indeterminate,
|
|
27
|
+
className = _ref2.className,
|
|
28
|
+
style = _ref2.style,
|
|
29
|
+
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
30
|
+
|
|
31
31
|
return label ? /*#__PURE__*/jsxs(StyledLabel, {
|
|
32
32
|
disabled: disabled,
|
|
33
33
|
className: className,
|
|
34
34
|
style: style,
|
|
35
|
-
children: [/*#__PURE__*/jsx(CheckboxInput, {
|
|
35
|
+
children: [/*#__PURE__*/jsx(CheckboxInput, _objectSpread(_objectSpread({}, rest), {}, {
|
|
36
36
|
disabled: disabled,
|
|
37
37
|
ref: ref,
|
|
38
38
|
indeterminate: indeterminate
|
|
39
|
-
}), /*#__PURE__*/jsx(LabelText, {
|
|
39
|
+
})), /*#__PURE__*/jsx(LabelText, {
|
|
40
40
|
children: label
|
|
41
41
|
})]
|
|
42
|
-
}) : /*#__PURE__*/jsx(CheckboxInput, {
|
|
42
|
+
}) : /*#__PURE__*/jsx(CheckboxInput, _objectSpread(_objectSpread({}, rest), {}, {
|
|
43
43
|
className: className,
|
|
44
44
|
style: style,
|
|
45
45
|
disabled: disabled,
|
|
46
46
|
ref: ref,
|
|
47
47
|
indeterminate: indeterminate
|
|
48
|
-
});
|
|
48
|
+
}));
|
|
49
49
|
});
|
|
50
50
|
Checkbox.displayName = 'Checkbox';
|
|
51
51
|
|
|
@@ -1,44 +1,19 @@
|
|
|
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
|
-
}
|
|
19
|
-
},
|
|
20
|
-
typography: {
|
|
21
|
-
navigation: {
|
|
22
|
-
menu_title: labelTypography
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
spacings: {
|
|
26
|
-
comfortable: {
|
|
27
|
-
medium_small,
|
|
28
|
-
x_small
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
clickbounds: {
|
|
32
|
-
default__base: clicboundSize,
|
|
33
|
-
compact__standard: compactClickboundSize
|
|
34
|
-
},
|
|
35
|
-
interactions: {
|
|
36
|
-
focused: {
|
|
37
|
-
width: focusOutlineWidth
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
} = tokens;
|
|
41
|
-
const checkbox = {
|
|
3
|
+
var _tokens$colors$intera = tokens.colors.interactive,
|
|
4
|
+
primaryColor = _tokens$colors$intera.primary__resting.rgba,
|
|
5
|
+
primaryHoverAlt = _tokens$colors$intera.primary__hover_alt.rgba,
|
|
6
|
+
focusOutlineColor = _tokens$colors$intera.focus.rgba,
|
|
7
|
+
disabledText = _tokens$colors$intera.disabled__text.rgba,
|
|
8
|
+
labelTypography = tokens.typography.navigation.menu_title,
|
|
9
|
+
_tokens$spacings$comf = tokens.spacings.comfortable,
|
|
10
|
+
medium_small = _tokens$spacings$comf.medium_small,
|
|
11
|
+
x_small = _tokens$spacings$comf.x_small,
|
|
12
|
+
_tokens$clickbounds = tokens.clickbounds,
|
|
13
|
+
clicboundSize = _tokens$clickbounds.default__base,
|
|
14
|
+
compactClickboundSize = _tokens$clickbounds.compact__standard,
|
|
15
|
+
focusOutlineWidth = tokens.interactions.focused.width;
|
|
16
|
+
var checkbox = {
|
|
42
17
|
background: primaryColor,
|
|
43
18
|
typography: labelTypography,
|
|
44
19
|
spacings: {
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
3
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
1
4
|
import { forwardRef } from 'react';
|
|
2
5
|
import styled, { ThemeProvider } from 'styled-components';
|
|
3
6
|
import { checkbox_indeterminate, checkbox as checkbox$1, checkbox_outline } from '@equinor/eds-icons';
|
|
@@ -6,11 +9,9 @@ import { outlineTemplate, spacingsTemplate, useToken } from '@equinor/eds-utils'
|
|
|
6
9
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
10
|
import { useEds } from '../EdsProvider/eds.context.js';
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
icon
|
|
13
|
-
} = _ref;
|
|
12
|
+
var _excluded = ["disabled", "indeterminate", "style", "className"];
|
|
13
|
+
var StyledPath = styled.path.attrs(function (_ref) {
|
|
14
|
+
var icon = _ref.icon;
|
|
14
15
|
return {
|
|
15
16
|
fillRule: 'evenodd',
|
|
16
17
|
clipRule: 'evenodd',
|
|
@@ -20,106 +21,90 @@ const StyledPath = styled.path.attrs(_ref => {
|
|
|
20
21
|
displayName: "Input__StyledPath",
|
|
21
22
|
componentId: "sc-rqj7qf-0"
|
|
22
23
|
})([""]);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} = _ref2;
|
|
24
|
+
var Input = styled.input.attrs(function (_ref2) {
|
|
25
|
+
var _ref2$type = _ref2.type,
|
|
26
|
+
type = _ref2$type === void 0 ? 'checkbox' : _ref2$type;
|
|
27
27
|
return {
|
|
28
|
-
type
|
|
28
|
+
type: type
|
|
29
29
|
};
|
|
30
30
|
}).withConfig({
|
|
31
31
|
displayName: "Input",
|
|
32
32
|
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;}"], _ref3
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
iconSize
|
|
37
|
-
} = _ref3;
|
|
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;}"], function (_ref3) {
|
|
34
|
+
var theme = _ref3.theme,
|
|
35
|
+
iconSize = _ref3.iconSize;
|
|
38
36
|
return parseFloat(theme.clickbound.height) / iconSize;
|
|
39
|
-
}, _ref4
|
|
40
|
-
|
|
41
|
-
disabled
|
|
42
|
-
} = _ref4;
|
|
37
|
+
}, function (_ref4) {
|
|
38
|
+
var disabled = _ref4.disabled;
|
|
43
39
|
return disabled ? 'not-allowed' : 'pointer';
|
|
44
|
-
}, _ref5
|
|
45
|
-
|
|
46
|
-
theme
|
|
47
|
-
} = _ref5;
|
|
40
|
+
}, function (_ref5) {
|
|
41
|
+
var theme = _ref5.theme;
|
|
48
42
|
return outlineTemplate(theme.states.focus.outline);
|
|
49
|
-
}, _ref6
|
|
50
|
-
|
|
51
|
-
theme
|
|
52
|
-
} = _ref6;
|
|
43
|
+
}, function (_ref6) {
|
|
44
|
+
var theme = _ref6.theme;
|
|
53
45
|
return outlineTemplate(theme.states.focus.outline);
|
|
54
46
|
});
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
fill
|
|
60
|
-
} = _ref7;
|
|
47
|
+
var Svg = styled.svg.attrs(function (_ref7) {
|
|
48
|
+
var height = _ref7.height,
|
|
49
|
+
width = _ref7.width,
|
|
50
|
+
fill = _ref7.fill;
|
|
61
51
|
return {
|
|
62
52
|
name: null,
|
|
63
53
|
xmlns: 'http://www.w3.org/2000/svg',
|
|
64
|
-
height,
|
|
65
|
-
width,
|
|
66
|
-
fill
|
|
54
|
+
height: height,
|
|
55
|
+
width: width,
|
|
56
|
+
fill: fill
|
|
67
57
|
};
|
|
68
58
|
}).withConfig({
|
|
69
59
|
displayName: "Input__Svg",
|
|
70
60
|
componentId: "sc-rqj7qf-2"
|
|
71
61
|
})(["grid-area:input;pointer-events:none;"]);
|
|
72
|
-
|
|
62
|
+
var InputWrapper = styled.span.withConfig({
|
|
73
63
|
displayName: "Input__InputWrapper",
|
|
74
64
|
componentId: "sc-rqj7qf-3"
|
|
75
|
-
})(["display:inline-grid;grid:[input] 1fr / [input] 1fr;border-radius:50%;", " @media (hover:hover) and (pointer:fine){&:hover{background-color:", ";}}"], _ref8
|
|
76
|
-
|
|
77
|
-
theme
|
|
78
|
-
} = _ref8;
|
|
65
|
+
})(["display:inline-grid;grid:[input] 1fr / [input] 1fr;border-radius:50%;", " @media (hover:hover) and (pointer:fine){&:hover{background-color:", ";}}"], function (_ref8) {
|
|
66
|
+
var theme = _ref8.theme;
|
|
79
67
|
return spacingsTemplate(theme.spacings);
|
|
80
|
-
}, _ref9
|
|
81
|
-
|
|
82
|
-
disabled
|
|
83
|
-
} = _ref9;
|
|
68
|
+
}, function (_ref9) {
|
|
69
|
+
var disabled = _ref9.disabled;
|
|
84
70
|
return disabled ? 'transparent' : checkbox.states.hover.background;
|
|
85
71
|
});
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
density
|
|
72
|
+
var CheckboxInput = /*#__PURE__*/forwardRef(function CheckboxInput(_ref10, ref) {
|
|
73
|
+
var _ref10$disabled = _ref10.disabled,
|
|
74
|
+
disabled = _ref10$disabled === void 0 ? false : _ref10$disabled,
|
|
75
|
+
indeterminate = _ref10.indeterminate,
|
|
76
|
+
style = _ref10.style,
|
|
77
|
+
className = _ref10.className,
|
|
78
|
+
rest = _objectWithoutProperties(_ref10, _excluded);
|
|
79
|
+
|
|
80
|
+
var _useEds = useEds(),
|
|
81
|
+
density = _useEds.density;
|
|
82
|
+
|
|
83
|
+
var token = useToken({
|
|
84
|
+
density: density
|
|
99
85
|
}, checkbox);
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
disabled,
|
|
104
|
-
style,
|
|
105
|
-
className
|
|
106
|
-
};
|
|
107
|
-
const inputProps = {
|
|
108
|
-
ref,
|
|
109
|
-
disabled,
|
|
110
|
-
['data-indeterminate']: indeterminate,
|
|
111
|
-
...rest
|
|
86
|
+
var iconSize = 24;
|
|
87
|
+
var fill = disabled ? checkbox.states.disabled.background : checkbox.background;
|
|
88
|
+
var inputWrapperProps = {
|
|
89
|
+
disabled: disabled,
|
|
90
|
+
style: style,
|
|
91
|
+
className: className
|
|
112
92
|
};
|
|
93
|
+
|
|
94
|
+
var inputProps = _objectSpread(_defineProperty({
|
|
95
|
+
ref: ref,
|
|
96
|
+
disabled: disabled
|
|
97
|
+
}, 'data-indeterminate', indeterminate), rest);
|
|
98
|
+
|
|
113
99
|
return /*#__PURE__*/jsx(ThemeProvider, {
|
|
114
100
|
theme: token,
|
|
115
|
-
children: /*#__PURE__*/jsxs(InputWrapper, {
|
|
116
|
-
children: [/*#__PURE__*/jsx(Input, {
|
|
117
|
-
iconSize: iconSize
|
|
118
|
-
|
|
119
|
-
}), indeterminate ? /*#__PURE__*/jsx(Svg, {
|
|
101
|
+
children: /*#__PURE__*/jsxs(InputWrapper, _objectSpread(_objectSpread({}, inputWrapperProps), {}, {
|
|
102
|
+
children: [/*#__PURE__*/jsx(Input, _objectSpread({
|
|
103
|
+
iconSize: iconSize
|
|
104
|
+
}, inputProps)), indeterminate ? /*#__PURE__*/jsx(Svg, {
|
|
120
105
|
width: iconSize,
|
|
121
106
|
height: iconSize,
|
|
122
|
-
viewBox:
|
|
107
|
+
viewBox: "0 0 ".concat(iconSize, " ").concat(iconSize),
|
|
123
108
|
fill: fill,
|
|
124
109
|
"aria-hidden": true,
|
|
125
110
|
children: /*#__PURE__*/jsx(StyledPath, {
|
|
@@ -129,7 +114,7 @@ const CheckboxInput = /*#__PURE__*/forwardRef(function CheckboxInput(_ref10, ref
|
|
|
129
114
|
}) : /*#__PURE__*/jsxs(Svg, {
|
|
130
115
|
width: iconSize,
|
|
131
116
|
height: iconSize,
|
|
132
|
-
viewBox:
|
|
117
|
+
viewBox: "0 0 ".concat(iconSize, " ").concat(iconSize),
|
|
133
118
|
fill: fill,
|
|
134
119
|
"aria-hidden": true,
|
|
135
120
|
children: [/*#__PURE__*/jsx(StyledPath, {
|
|
@@ -140,7 +125,7 @@ const CheckboxInput = /*#__PURE__*/forwardRef(function CheckboxInput(_ref10, ref
|
|
|
140
125
|
name: "not-checked"
|
|
141
126
|
})]
|
|
142
127
|
})]
|
|
143
|
-
})
|
|
128
|
+
}))
|
|
144
129
|
});
|
|
145
130
|
});
|
|
146
131
|
|