@equinor/eds-core-react 0.16.1-dev.12072021 → 0.18.0-dev.20220210
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/README.md +1 -1
- package/dist/{core-react.cjs.js → eds-core-react.cjs.js} +2731 -2290
- package/dist/esm/components/Accordion/Accordion.js +24 -11
- package/dist/esm/components/Accordion/Accordion.tokens.js +3 -0
- package/dist/esm/components/Accordion/AccordionHeader.js +65 -51
- package/dist/esm/components/Accordion/AccordionHeaderTitle.js +15 -13
- package/dist/esm/components/Accordion/AccordionItem.js +11 -10
- package/dist/esm/components/Accordion/AccordionPanel.js +32 -24
- package/dist/esm/components/Avatar/Avatar.js +21 -14
- package/dist/esm/components/Banner/Banner.js +36 -24
- package/dist/esm/components/Banner/Banner.tokens.js +9 -0
- package/dist/esm/components/Banner/BannerActions.js +16 -17
- package/dist/esm/components/Banner/BannerIcon.js +15 -11
- package/dist/esm/components/Banner/BannerMessage.js +5 -4
- package/dist/esm/components/Breadcrumbs/Breadcrumb.js +16 -12
- package/dist/esm/components/Breadcrumbs/Breadcrumbs.js +7 -6
- package/dist/esm/components/Button/Button.js +17 -18
- package/dist/esm/components/Button/InnerFullWidth.js +5 -4
- package/dist/esm/components/Button/tokens/button.js +17 -10
- package/dist/esm/components/Button/tokens/contained.js +5 -5
- package/dist/esm/components/Button/tokens/ghost.js +4 -4
- package/dist/esm/components/Button/tokens/icon.js +4 -4
- package/dist/esm/components/Button/tokens/outlined.js +5 -5
- package/dist/esm/components/Card/Card.js +19 -12
- package/dist/esm/components/Card/CardActions.js +13 -9
- package/dist/esm/components/Card/CardContent.js +5 -4
- package/dist/esm/components/Card/CardHeader.js +5 -4
- package/dist/esm/components/Card/CardHeaderTitle.js +5 -4
- package/dist/esm/components/Card/CardMedia.js +12 -8
- package/dist/esm/components/Checkbox/Checkbox.js +15 -11
- package/dist/esm/components/Checkbox/Input.js +72 -46
- package/dist/esm/components/Chip/Chip.js +46 -30
- package/dist/esm/components/Chip/Icon.js +12 -7
- package/dist/esm/components/Dialog/Dialog.js +55 -16
- package/dist/esm/components/Dialog/Dialog.tokens.js +7 -12
- package/dist/esm/components/Dialog/DialogActions.js +27 -0
- package/dist/esm/components/Dialog/DialogContent.js +44 -0
- package/dist/esm/components/Dialog/DialogHeader.js +37 -0
- package/dist/esm/components/Dialog/DialogTitle.js +31 -0
- package/dist/esm/components/Dialog/index.js +11 -7
- package/dist/esm/components/Divider/Divider.js +6 -5
- package/dist/esm/components/EdsProvider/eds.context.js +5 -4
- package/dist/esm/components/Icon/Icon.js +77 -46
- package/dist/esm/components/Input/Input.js +12 -12
- package/dist/esm/components/Input/Input.tokens.js +4 -4
- package/dist/esm/components/Label/Label.js +7 -4
- package/dist/esm/components/List/List.js +13 -9
- package/dist/esm/components/List/ListItem.js +5 -4
- package/dist/esm/components/Menu/Menu.context.js +5 -4
- package/dist/esm/components/Menu/Menu.js +39 -30
- package/dist/esm/components/Menu/MenuItem.js +38 -25
- package/dist/esm/components/Menu/MenuList.js +7 -6
- package/dist/esm/components/Menu/MenuSection.js +3 -3
- package/dist/esm/components/Pagination/Pagination.js +16 -12
- package/dist/esm/components/Pagination/PaginationItem.js +7 -6
- package/dist/esm/components/Paper/Paper.js +11 -7
- package/dist/esm/components/Popover/Popover.js +77 -58
- package/dist/esm/components/Popover/Popover.tokens.js +5 -12
- package/dist/esm/components/Popover/PopoverActions.js +28 -0
- package/dist/esm/components/Popover/PopoverContent.js +12 -6
- package/dist/esm/components/Popover/PopoverHeader.js +36 -0
- package/dist/esm/components/Popover/PopoverTitle.js +15 -19
- package/dist/esm/components/Popover/index.js +6 -0
- package/dist/esm/components/Progress/Circular/CircularProgress.js +14 -10
- package/dist/esm/components/Progress/Dots/DotProgress.js +12 -8
- package/dist/esm/components/Progress/Linear/LinearProgress.js +6 -5
- package/dist/esm/components/Progress/Star/StarProgress.js +14 -10
- package/dist/esm/components/Radio/Radio.js +84 -52
- package/dist/esm/components/Scrim/Scrim.js +20 -15
- package/dist/esm/components/Search/Search.js +81 -58
- package/dist/esm/components/Search/Search.tokens.js +8 -4
- package/dist/esm/components/Select/MultiSelect/MultiSelect.js +35 -24
- package/dist/esm/components/Select/NativeSelect/NativeSelect.js +19 -17
- package/dist/esm/components/Select/Select.tokens.js +5 -2
- package/dist/esm/components/Select/SingleSelect/SingleSelect.js +29 -23
- package/dist/esm/components/Select/commonStyles.js +15 -14
- package/dist/esm/components/SideSheet/SideSheet.js +16 -13
- package/dist/esm/components/Slider/MinMax.js +5 -4
- package/dist/esm/components/Slider/Output.js +13 -9
- package/dist/esm/components/Slider/Slider.js +63 -35
- package/dist/esm/components/Slider/SliderInput.js +14 -14
- package/dist/esm/components/Snackbar/Snackbar.js +36 -25
- package/dist/esm/components/Snackbar/Snackbar.tokens.js +3 -0
- package/dist/esm/components/Snackbar/SnackbarAction.js +12 -7
- package/dist/esm/components/Switch/Switch.js +21 -15
- package/dist/esm/components/Switch/Switch.styles.js +24 -17
- package/dist/esm/components/Switch/SwitchDefault.js +39 -29
- package/dist/esm/components/Switch/SwitchSmall.js +38 -28
- package/dist/esm/components/Table/Body.js +5 -4
- package/dist/esm/components/Table/Caption.js +8 -5
- package/dist/esm/components/Table/Cell.js +9 -6
- package/dist/esm/components/Table/DataCell/DataCell.js +15 -14
- package/dist/esm/components/Table/DataCell/DataCell.tokens.js +19 -9
- package/dist/esm/components/Table/Head/Head.js +7 -6
- package/dist/esm/components/Table/HeaderCell/HeaderCell.js +8 -9
- package/dist/esm/components/Table/HeaderCell/HeaderCell.tokens.js +18 -8
- package/dist/esm/components/Table/Row/Row.js +7 -5
- package/dist/esm/components/Table/Table.js +5 -4
- package/dist/esm/components/TableOfContents/LinkItem.js +13 -10
- package/dist/esm/components/TableOfContents/TableOfContents.js +44 -24
- package/dist/esm/components/TableOfContents/TableOfContents.tokens.js +3 -0
- package/dist/esm/components/Tabs/Tab.js +27 -30
- package/dist/esm/components/Tabs/TabList.js +12 -8
- package/dist/esm/components/Tabs/TabPanel.js +16 -12
- package/dist/esm/components/Tabs/TabPanels.js +5 -4
- package/dist/esm/components/Tabs/Tabs.js +37 -24
- package/dist/esm/components/Tabs/Tabs.tokens.js +3 -0
- package/dist/esm/components/TextField/Field.js +51 -38
- package/dist/esm/components/TextField/HelperText/HelperText.js +28 -19
- package/dist/esm/components/TextField/Icon/Icon.js +20 -18
- package/dist/esm/components/TextField/TextField.context.js +4 -3
- package/dist/esm/components/TextField/TextField.js +22 -18
- package/dist/esm/components/Textarea/Textarea.js +16 -16
- package/dist/esm/components/Tooltip/Tooltip.js +10 -16
- package/dist/esm/components/TopBar/Actions.js +5 -4
- package/dist/esm/components/TopBar/CustomContent.js +5 -4
- package/dist/esm/components/TopBar/Header.js +5 -4
- package/dist/esm/components/TopBar/TopBar.js +27 -19
- package/dist/esm/components/TopBar/TopBar.tokens.js +5 -2
- package/dist/esm/components/Typography/Typography.js +49 -28
- package/dist/esm/index.js +1 -0
- package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/internal/_curry1.js +1 -1
- package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/internal/_curry2.js +1 -1
- package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/internal/_curry3.js +1 -1
- package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/internal/_has.js +1 -1
- package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/internal/_isObject.js +1 -1
- package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/internal/_isPlaceholder.js +1 -1
- package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/mergeDeepRight.js +2 -1
- package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/mergeDeepWithKey.js +1 -1
- package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/mergeWithKey.js +1 -1
- package/dist/types/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/types/components/Checkbox/Input.d.ts +1 -1
- package/dist/types/components/Dialog/Dialog.d.ts +18 -2
- package/dist/types/components/Dialog/DialogActions.d.ts +3 -0
- package/dist/types/components/Dialog/{CustomContent.d.ts → DialogContent.d.ts} +2 -2
- package/dist/types/components/Dialog/DialogHeader.d.ts +3 -0
- package/dist/types/components/Dialog/DialogTitle.d.ts +3 -0
- package/dist/types/components/Dialog/index.d.ts +10 -7
- package/dist/types/components/Group/Group.d.ts +3 -0
- package/dist/types/components/Group/Group.tokens.d.ts +4 -0
- package/dist/types/components/Group/index.d.ts +1 -0
- package/dist/types/components/Icon/Icon.d.ts +2 -2
- package/dist/types/components/Menu/Menu.d.ts +1 -1
- package/dist/types/components/Menu/MenuSection.d.ts +1 -2
- package/dist/types/components/Popover/Popover.d.ts +1 -1
- package/dist/types/components/Popover/PopoverActions.d.ts +3 -0
- package/dist/types/components/Popover/PopoverHeader.d.ts +3 -0
- package/dist/types/components/Popover/index.d.ts +5 -1
- package/dist/types/components/Progress/Circular/CircularProgress.d.ts +1 -1
- package/dist/types/components/Progress/Dots/DotProgress.d.ts +1 -1
- package/dist/types/components/Progress/Star/StarProgress.d.ts +1 -1
- package/dist/types/components/Scrim/Scrim.d.ts +7 -3
- package/dist/types/components/Switch/Switch.d.ts +1 -1
- package/dist/types/components/Switch/Switch.styles.d.ts +2 -1
- package/dist/types/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/types/components/TopBar/TopBar.tokens.d.ts +1 -1
- package/dist/types/index.d.ts +1 -0
- package/package.json +47 -39
- package/dist/esm/components/Dialog/Actions.js +0 -24
- package/dist/esm/components/Dialog/CustomContent.js +0 -40
- package/dist/esm/components/Dialog/Title.js +0 -35
- package/dist/esm/hooks/useAutoResize.js +0 -39
- package/dist/esm/hooks/useCombinedRefs.js +0 -14
- package/dist/esm/hooks/useGlobalKeyPress.js +0 -34
- package/dist/esm/hooks/useHideBodyScroll.js +0 -12
- package/dist/esm/hooks/useId.js +0 -14
- package/dist/esm/hooks/useMountedRef.js +0 -12
- package/dist/esm/hooks/useOutsideClick.js +0 -18
- package/dist/esm/hooks/usePopper.js +0 -31
- package/dist/esm/hooks/useToken.js +0 -16
- package/dist/esm/utils/joinHandlers.js +0 -10
- package/dist/esm/utils/setReactInputValue.js +0 -18
- package/dist/esm/utils/templates/borders.js +0 -35
- package/dist/esm/utils/templates/common.js +0 -19
- package/dist/esm/utils/templates/focus.js +0 -35
- package/dist/esm/utils/templates/index.js +0 -52
- package/dist/types/components/Combobox/Combobox.d.ts +0 -55
- package/dist/types/components/Combobox/Combobox.tokens.d.ts +0 -3
- package/dist/types/components/Combobox/index.d.ts +0 -1
- package/dist/types/components/Dialog/Actions.d.ts +0 -3
- package/dist/types/components/Dialog/Title.d.ts +0 -3
- package/dist/types/hooks/index.d.ts +0 -9
- package/dist/types/hooks/useAutoResize.d.ts +0 -1
- package/dist/types/hooks/useCombinedRefs.d.ts +0 -3
- package/dist/types/hooks/useGlobalKeyPress.d.ts +0 -10
- package/dist/types/hooks/useHideBodyScroll.d.ts +0 -1
- package/dist/types/hooks/useId.d.ts +0 -1
- package/dist/types/hooks/useMountedRef.d.ts +0 -1
- package/dist/types/hooks/useOutsideClick.d.ts +0 -1
- package/dist/types/hooks/usePopper.d.ts +0 -12
- package/dist/types/hooks/useToken.d.ts +0 -7
- package/dist/types/utils/index.d.ts +0 -4
- package/dist/types/utils/joinHandlers.d.ts +0 -3
- package/dist/types/utils/setReactInputValue.d.ts +0 -7
- package/dist/types/utils/templates/borders.d.ts +0 -2
- package/dist/types/utils/templates/common.d.ts +0 -9
- package/dist/types/utils/templates/focus.d.ts +0 -2
- package/dist/types/utils/templates/index.d.ts +0 -7
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { forwardRef, useState, Children, Fragment } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { breadcrumbs } from './Breadcrumbs.tokens.js';
|
|
4
|
+
import { spacingsTemplate } from '@equinor/eds-utils';
|
|
4
5
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
6
|
import { Typography } from '../Typography/Typography.js';
|
|
6
|
-
import { spacingsTemplate } from '../../utils/templates/index.js';
|
|
7
7
|
|
|
8
8
|
const {
|
|
9
9
|
spacings,
|
|
@@ -26,11 +26,12 @@ const Collapsed = styled(Typography).withConfig({
|
|
|
26
26
|
displayName: "Breadcrumbs__Collapsed",
|
|
27
27
|
componentId: "sc-12awlbz-3"
|
|
28
28
|
})(["@media (hover:hover) and (pointer:fine){&:hover{text-decoration:underline;color:", ";}}color:", ";text-decoration:none;"], states.hover.typography.color, typography.color);
|
|
29
|
-
const Breadcrumbs = /*#__PURE__*/forwardRef(function Breadcrumbs({
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
const Breadcrumbs = /*#__PURE__*/forwardRef(function Breadcrumbs(_ref, ref) {
|
|
30
|
+
let {
|
|
31
|
+
children,
|
|
32
|
+
collapse,
|
|
33
|
+
...rest
|
|
34
|
+
} = _ref;
|
|
34
35
|
const props = { ...rest,
|
|
35
36
|
ref
|
|
36
37
|
};
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import styled, { css, ThemeProvider } from 'styled-components';
|
|
3
3
|
import { token } from './tokens/index.js';
|
|
4
|
+
import { spacingsTemplate, bordersTemplate, typographyTemplate, outlineTemplate, useToken } from '@equinor/eds-utils';
|
|
4
5
|
import { InnerFullWidth } from './InnerFullWidth.js';
|
|
5
6
|
import { jsx } from 'react/jsx-runtime';
|
|
6
|
-
import { spacingsTemplate, typographyTemplate } from '../../utils/templates/index.js';
|
|
7
|
-
import { bordersTemplate } from '../../utils/templates/borders.js';
|
|
8
|
-
import { outlineTemplate } from '../../utils/templates/focus.js';
|
|
9
7
|
import { useEds } from '../EdsProvider/eds.context.js';
|
|
10
|
-
import { useToken } from '../../hooks/useToken.js';
|
|
11
8
|
|
|
12
9
|
const getVariant = (tokenSet, variant) => {
|
|
13
10
|
switch (variant) {
|
|
@@ -43,15 +40,16 @@ const getToken = (variant, color) => {
|
|
|
43
40
|
const Inner = styled.span.withConfig({
|
|
44
41
|
displayName: "Button__Inner",
|
|
45
42
|
componentId: "sc-1hs0myn-0"
|
|
46
|
-
})(["display:grid;grid-gap:8px;grid-auto-flow:column;align-items:center;height:100%;justify-content:center;"]);
|
|
43
|
+
})(["display:grid;grid-gap:var(--eds_button__gap,8px);grid-auto-flow:column;align-items:center;height:100%;justify-content:center;& >:is(svg,img){margin-top:var(--eds_button__icon__margin_y,0);margin-bottom:var(--eds_button__icon__margin_y,0);}"]);
|
|
47
44
|
const ButtonBase = styled.button.withConfig({
|
|
48
45
|
displayName: "Button__ButtonBase",
|
|
49
46
|
componentId: "sc-1hs0myn-1"
|
|
50
|
-
})(
|
|
51
|
-
theme
|
|
52
|
-
}) => {
|
|
47
|
+
})(_ref => {
|
|
53
48
|
var _clickbound$offset, _clickbound$offset2, _hover$typography;
|
|
54
49
|
|
|
50
|
+
let {
|
|
51
|
+
theme
|
|
52
|
+
} = _ref;
|
|
55
53
|
const {
|
|
56
54
|
states,
|
|
57
55
|
clickbound
|
|
@@ -63,16 +61,17 @@ const ButtonBase = styled.button.withConfig({
|
|
|
63
61
|
} = states;
|
|
64
62
|
return css(["margin:0;padding:0;text-decoration:none;position:relative;cursor:pointer;display:inline-block;background:", ";height:", ";width:", ";svg{justify-self:center;}", " ", " ", " &::before{position:absolute;top:0;left:0;width:auto;min-height:auto;content:'';}&::after{position:absolute;top:-", ";left:-", ";width:", ";height:", ";content:'';}@media (hover:hover) and (pointer:fine){&:hover{background:", ";color:", ";", ";}}&:focus{outline:none;}&[data-focus-visible-added]:focus{", "}&:focus-visible{", "}&::-moz-focus-inner{border:0;}&:disabled{cursor:not-allowed;background:", ";", ";", ";@media (hover:hover) and (pointer:fine){&:hover{background:", ";}}}"], theme.background, theme.height, theme.width, spacingsTemplate(theme.spacings), bordersTemplate(theme.border), typographyTemplate(theme.typography), clickbound === null || clickbound === void 0 ? void 0 : (_clickbound$offset = clickbound.offset) === null || _clickbound$offset === void 0 ? void 0 : _clickbound$offset.top, clickbound === null || clickbound === void 0 ? void 0 : (_clickbound$offset2 = clickbound.offset) === null || _clickbound$offset2 === void 0 ? void 0 : _clickbound$offset2.left, clickbound === null || clickbound === void 0 ? void 0 : clickbound.width, clickbound === null || clickbound === void 0 ? void 0 : clickbound.height, hover.background, (_hover$typography = hover.typography) === null || _hover$typography === void 0 ? void 0 : _hover$typography.color, bordersTemplate(hover === null || hover === void 0 ? void 0 : hover.border), outlineTemplate(focus.outline), outlineTemplate(focus.outline), disabled.background, bordersTemplate(disabled.border), typographyTemplate(disabled.typography), disabled.background);
|
|
65
63
|
});
|
|
66
|
-
const Button = /*#__PURE__*/forwardRef(function Button({
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
64
|
+
const Button = /*#__PURE__*/forwardRef(function Button(_ref2, ref) {
|
|
65
|
+
let {
|
|
66
|
+
color = 'primary',
|
|
67
|
+
variant = 'contained',
|
|
68
|
+
children,
|
|
69
|
+
disabled = false,
|
|
70
|
+
href,
|
|
71
|
+
tabIndex = 0,
|
|
72
|
+
fullWidth = false,
|
|
73
|
+
...other
|
|
74
|
+
} = _ref2;
|
|
76
75
|
const {
|
|
77
76
|
density
|
|
78
77
|
} = useEds();
|
|
@@ -9,10 +9,11 @@ const FullWidthCenterContent = styled.span.withConfig({
|
|
|
9
9
|
const FullWidthInner = styled.span.withConfig({
|
|
10
10
|
displayName: "InnerFullWidth__FullWidthInner",
|
|
11
11
|
componentId: "sc-qeawkb-1"
|
|
12
|
-
})(["height:100%;display:flex;align-items:center
|
|
13
|
-
const InnerFullWidth = /*#__PURE__*/forwardRef(function InnerFullWidth({
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
})(["height:100%;display:flex;align-items:center;>:is(svg,img){margin-top:var(--eds_button__margin_y,inherit);margin-bottom:var(--eds_button__margin_y,inherit);}>:is(svg,img):first-child{margin-right:var(--eds_button__fullwidth__icon__margin_x,8px);}>:is(svg,img):last-child{margin-left:var(--eds_button__fullwidth__icon__margin_x,8px);}>:is(svg,img):only-child{margin-left:auto;margin-right:auto;}> span:first-child{margin-left:var(--eds_button__fullwidth__margin_x,32px);}> span:last-child{margin-right:var(--eds_button__fullwidth__margin_x,32px);}> span:only-child{margin-right:0;margin-left:0;}"]);
|
|
13
|
+
const InnerFullWidth = /*#__PURE__*/forwardRef(function InnerFullWidth(_ref, ref) {
|
|
14
|
+
let {
|
|
15
|
+
children
|
|
16
|
+
} = _ref;
|
|
16
17
|
// We need everything in elements for proper flexing 💪
|
|
17
18
|
const updatedChildren = Children.map(children, child => typeof child !== 'object' ? /*#__PURE__*/jsx(FullWidthCenterContent, {
|
|
18
19
|
children: child
|
|
@@ -47,20 +47,23 @@ const {
|
|
|
47
47
|
} = tokens;
|
|
48
48
|
const button = {
|
|
49
49
|
background: 'transparent',
|
|
50
|
-
height: buttonHeight,
|
|
50
|
+
height: "var(--eds_button__height, ".concat(buttonHeight, ")"),
|
|
51
51
|
typography: { ...buttonTypography,
|
|
52
|
-
textAlign: 'center'
|
|
52
|
+
textAlign: 'center',
|
|
53
|
+
fontSize: "var(--eds_button__font_size, ".concat(buttonTypography.fontSize, ")")
|
|
53
54
|
},
|
|
54
55
|
border: {
|
|
55
56
|
type: 'border',
|
|
56
|
-
width:
|
|
57
|
+
width: "var(--eds_button__border_width, 1px)",
|
|
57
58
|
color: 'transparent',
|
|
58
|
-
radius: buttonBorderRadius,
|
|
59
|
+
radius: "var(--eds_button__radius, ".concat(buttonBorderRadius, ")"),
|
|
59
60
|
style: 'solid'
|
|
60
61
|
},
|
|
61
62
|
spacings: {
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
top: 'var(--eds_button__padding_y, 0)',
|
|
64
|
+
bottom: 'var(--eds_button__padding_y, 0)',
|
|
65
|
+
left: "var(--eds_button__padding_x, ".concat(medium, ")"),
|
|
66
|
+
right: "var(--eds_button__padding_x, ".concat(medium, ")")
|
|
64
67
|
},
|
|
65
68
|
clickbound: {
|
|
66
69
|
height: clicboundHeight,
|
|
@@ -72,8 +75,8 @@ const button = {
|
|
|
72
75
|
},
|
|
73
76
|
entities: {
|
|
74
77
|
icon: {
|
|
75
|
-
height: '24px',
|
|
76
|
-
width: '24px'
|
|
78
|
+
height: 'var(--eds_button__icon__size, 24px)',
|
|
79
|
+
width: 'var(--eds_button__icon__size, 24px)'
|
|
77
80
|
}
|
|
78
81
|
},
|
|
79
82
|
states: {
|
|
@@ -82,7 +85,7 @@ const button = {
|
|
|
82
85
|
type: 'border',
|
|
83
86
|
width: '1px',
|
|
84
87
|
color: 'transparent',
|
|
85
|
-
radius: buttonBorderRadius,
|
|
88
|
+
radius: "var(--eds_button__radius, ".concat(buttonBorderRadius, ")"),
|
|
86
89
|
style: 'solid'
|
|
87
90
|
}
|
|
88
91
|
},
|
|
@@ -111,7 +114,11 @@ const button = {
|
|
|
111
114
|
},
|
|
112
115
|
modes: {
|
|
113
116
|
compact: {
|
|
114
|
-
height: compactButtonHeight,
|
|
117
|
+
height: "var(--eds_button__height_compact, ".concat(compactButtonHeight, ")"),
|
|
118
|
+
spacings: {
|
|
119
|
+
top: 'var(--eds_button__padding_y_compact, 0)',
|
|
120
|
+
bottom: 'var(--eds_button__padding_y_compact, 0)'
|
|
121
|
+
},
|
|
115
122
|
clickbound: {
|
|
116
123
|
height: compactClickboundHeight,
|
|
117
124
|
width: '100%',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { tokens } from '@equinor/eds-tokens';
|
|
2
2
|
import { button } from './button.js';
|
|
3
|
-
import
|
|
3
|
+
import mergeDeepRight from '../../../node_modules/.pnpm/ramda@0.27.2/node_modules/ramda/src/mergeDeepRight.js';
|
|
4
4
|
|
|
5
5
|
const {
|
|
6
6
|
colors: {
|
|
@@ -36,7 +36,7 @@ const {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
} = tokens;
|
|
39
|
-
const primary =
|
|
39
|
+
const primary = mergeDeepRight(button, {
|
|
40
40
|
background: primaryColor,
|
|
41
41
|
typography: {
|
|
42
42
|
color: primaryWhite
|
|
@@ -46,7 +46,7 @@ const primary = mergeDeepRight_1(button, {
|
|
|
46
46
|
style: 'solid',
|
|
47
47
|
width: '1px',
|
|
48
48
|
color: primaryColor,
|
|
49
|
-
radius: buttonBorderRadius
|
|
49
|
+
radius: "var(--eds_button__radius, ".concat(buttonBorderRadius, ")")
|
|
50
50
|
},
|
|
51
51
|
states: {
|
|
52
52
|
hover: {
|
|
@@ -54,7 +54,7 @@ const primary = mergeDeepRight_1(button, {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
|
-
const secondary =
|
|
57
|
+
const secondary = mergeDeepRight(primary, {
|
|
58
58
|
background: secondaryColor,
|
|
59
59
|
border: {
|
|
60
60
|
color: secondaryColor
|
|
@@ -68,7 +68,7 @@ const secondary = mergeDeepRight_1(primary, {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
|
-
const danger =
|
|
71
|
+
const danger = mergeDeepRight(primary, {
|
|
72
72
|
background: dangerColor,
|
|
73
73
|
border: {
|
|
74
74
|
color: dangerColor
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { tokens } from '@equinor/eds-tokens';
|
|
2
|
-
import
|
|
2
|
+
import mergeDeepRight from '../../../node_modules/.pnpm/ramda@0.27.2/node_modules/ramda/src/mergeDeepRight.js';
|
|
3
3
|
import { button } from './button.js';
|
|
4
4
|
|
|
5
5
|
const {
|
|
@@ -35,7 +35,7 @@ const {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
} = tokens;
|
|
38
|
-
const primary =
|
|
38
|
+
const primary = mergeDeepRight(button, {
|
|
39
39
|
typography: {
|
|
40
40
|
color: primaryColor
|
|
41
41
|
},
|
|
@@ -54,7 +54,7 @@ const primary = mergeDeepRight_1(button, {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
|
-
const secondary =
|
|
57
|
+
const secondary = mergeDeepRight(primary, {
|
|
58
58
|
typography: {
|
|
59
59
|
color: secondaryColor
|
|
60
60
|
},
|
|
@@ -67,7 +67,7 @@ const secondary = mergeDeepRight_1(primary, {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
|
-
const danger =
|
|
70
|
+
const danger = mergeDeepRight(primary, {
|
|
71
71
|
typography: {
|
|
72
72
|
color: dangerColor
|
|
73
73
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { tokens } from '@equinor/eds-tokens';
|
|
2
|
-
import
|
|
2
|
+
import mergeDeepRight from '../../../node_modules/.pnpm/ramda@0.27.2/node_modules/ramda/src/mergeDeepRight.js';
|
|
3
3
|
import { button } from './button.js';
|
|
4
4
|
|
|
5
5
|
const {
|
|
@@ -37,7 +37,7 @@ const {
|
|
|
37
37
|
},
|
|
38
38
|
shape
|
|
39
39
|
} = tokens;
|
|
40
|
-
const primary =
|
|
40
|
+
const primary = mergeDeepRight(button, {
|
|
41
41
|
height: shape.icon_button.minHeight,
|
|
42
42
|
width: shape.icon_button.minWidth,
|
|
43
43
|
typography: {
|
|
@@ -93,7 +93,7 @@ const primary = mergeDeepRight_1(button, {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
|
-
const secondary =
|
|
96
|
+
const secondary = mergeDeepRight(primary, {
|
|
97
97
|
typography: {
|
|
98
98
|
color: secondaryColor
|
|
99
99
|
},
|
|
@@ -106,7 +106,7 @@ const secondary = mergeDeepRight_1(primary, {
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
|
-
const danger =
|
|
109
|
+
const danger = mergeDeepRight(primary, {
|
|
110
110
|
typography: {
|
|
111
111
|
color: dangerColor
|
|
112
112
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { tokens } from '@equinor/eds-tokens';
|
|
2
|
-
import
|
|
2
|
+
import mergeDeepRight from '../../../node_modules/.pnpm/ramda@0.27.2/node_modules/ramda/src/mergeDeepRight.js';
|
|
3
3
|
import { button } from './button.js';
|
|
4
4
|
|
|
5
5
|
const {
|
|
@@ -40,7 +40,7 @@ const {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
} = tokens;
|
|
43
|
-
const primary =
|
|
43
|
+
const primary = mergeDeepRight(button, {
|
|
44
44
|
typography: {
|
|
45
45
|
color: primaryColor
|
|
46
46
|
},
|
|
@@ -49,7 +49,7 @@ const primary = mergeDeepRight_1(button, {
|
|
|
49
49
|
style: 'solid',
|
|
50
50
|
width: '1px',
|
|
51
51
|
color: primaryColor,
|
|
52
|
-
radius: buttonBorderRadius
|
|
52
|
+
radius: "var(--eds_button__radius, ".concat(buttonBorderRadius, ")")
|
|
53
53
|
},
|
|
54
54
|
states: {
|
|
55
55
|
hover: {
|
|
@@ -69,7 +69,7 @@ const primary = mergeDeepRight_1(button, {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
|
-
const secondary =
|
|
72
|
+
const secondary = mergeDeepRight(primary, {
|
|
73
73
|
typography: {
|
|
74
74
|
color: secondaryColor
|
|
75
75
|
},
|
|
@@ -88,7 +88,7 @@ const secondary = mergeDeepRight_1(primary, {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
|
-
const danger =
|
|
91
|
+
const danger = mergeDeepRight(primary, {
|
|
92
92
|
typography: {
|
|
93
93
|
color: dangerColor
|
|
94
94
|
},
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import * as Card_tokens from './Card.tokens.js';
|
|
4
|
+
import { bordersTemplate } from '@equinor/eds-utils';
|
|
4
5
|
import { jsx } from 'react/jsx-runtime';
|
|
5
|
-
import { bordersTemplate } from '../../utils/templates/borders.js';
|
|
6
6
|
|
|
7
7
|
const {
|
|
8
8
|
primary
|
|
@@ -10,17 +10,24 @@ const {
|
|
|
10
10
|
const StyledCard = styled.div.withConfig({
|
|
11
11
|
displayName: "Card__StyledCard",
|
|
12
12
|
componentId: "sc-bjucjn-0"
|
|
13
|
-
})(["height:fit-content;width:100%;position:relative;background-color:", ";box-sizing:border-box;display:grid;grid-gap:16px;grid-auto-columns:auto;align-items:center;align-content:start;cursor:", ";", ";"],
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
13
|
+
})(["height:fit-content;width:100%;position:relative;background-color:", ";box-sizing:border-box;display:grid;grid-gap:16px;grid-auto-columns:auto;align-items:center;align-content:start;cursor:", ";", ";"], _ref => {
|
|
14
|
+
let {
|
|
15
|
+
background
|
|
16
|
+
} = _ref;
|
|
17
|
+
return background;
|
|
18
|
+
}, _ref2 => {
|
|
19
|
+
let {
|
|
20
|
+
cursor
|
|
21
|
+
} = _ref2;
|
|
22
|
+
return cursor;
|
|
23
|
+
}, bordersTemplate(primary.border));
|
|
24
|
+
const Card = /*#__PURE__*/forwardRef(function Card(_ref3, ref) {
|
|
25
|
+
let {
|
|
26
|
+
children,
|
|
27
|
+
variant = 'default',
|
|
28
|
+
onClick,
|
|
29
|
+
...rest
|
|
30
|
+
} = _ref3;
|
|
24
31
|
const cursor = onClick ? 'pointer' : 'default';
|
|
25
32
|
const cardVariant = variant === 'default' ? 'primary' : variant;
|
|
26
33
|
const token = Card_tokens[cardVariant];
|
|
@@ -10,15 +10,19 @@ const {
|
|
|
10
10
|
const StyledCardActions = styled.div.withConfig({
|
|
11
11
|
displayName: "CardActions__StyledCardActions",
|
|
12
12
|
componentId: "sc-1d5vskp-0"
|
|
13
|
-
})(["display:grid;grid-gap:8px;grid-auto-flow:column;align-items:center;justify-content:", ";padding:0 ", " 0 ", ";:first-child{padding-top:", ";}:last-child{padding-bottom:", ";}"],
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
})(["display:grid;grid-gap:8px;grid-auto-flow:column;align-items:center;justify-content:", ";padding:0 ", " 0 ", ";:first-child{padding-top:", ";}:last-child{padding-bottom:", ";}"], _ref => {
|
|
14
|
+
let {
|
|
15
|
+
justifyContent
|
|
16
|
+
} = _ref;
|
|
17
|
+
return justifyContent;
|
|
18
|
+
}, spacings.right, spacings.left, spacings.top, spacings.bottom);
|
|
19
|
+
const CardActions = /*#__PURE__*/forwardRef(function CardActions(_ref2, ref) {
|
|
20
|
+
let {
|
|
21
|
+
children,
|
|
22
|
+
alignRight = false,
|
|
23
|
+
meta = '',
|
|
24
|
+
...rest
|
|
25
|
+
} = _ref2;
|
|
22
26
|
const justifyContent = alignRight ? 'flex-end' : 'flex-start';
|
|
23
27
|
const props = {
|
|
24
28
|
ref,
|
|
@@ -10,10 +10,11 @@ const StyledCardContent = styled.div.withConfig({
|
|
|
10
10
|
displayName: "CardContent__StyledCardContent",
|
|
11
11
|
componentId: "sc-esm4ym-0"
|
|
12
12
|
})(["display:grid;padding:0 ", " 0 ", ";:last-child{padding-bottom:", ";}"], spacings.right, spacings.left, spacings.bottom);
|
|
13
|
-
const CardContent = /*#__PURE__*/forwardRef(function CardContent({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
const CardContent = /*#__PURE__*/forwardRef(function CardContent(_ref, ref) {
|
|
14
|
+
let {
|
|
15
|
+
children,
|
|
16
|
+
...props
|
|
17
|
+
} = _ref;
|
|
17
18
|
return /*#__PURE__*/jsx(StyledCardContent, {
|
|
18
19
|
ref: ref,
|
|
19
20
|
...props,
|
|
@@ -10,10 +10,11 @@ const StyledCardHeader = styled.div.withConfig({
|
|
|
10
10
|
displayName: "CardHeader__StyledCardHeader",
|
|
11
11
|
componentId: "sc-15k8edh-0"
|
|
12
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);
|
|
13
|
-
const CardHeader = /*#__PURE__*/forwardRef(function CardHeader({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
const CardHeader = /*#__PURE__*/forwardRef(function CardHeader(_ref, ref) {
|
|
14
|
+
let {
|
|
15
|
+
children,
|
|
16
|
+
...rest
|
|
17
|
+
} = _ref;
|
|
17
18
|
const props = { ...rest,
|
|
18
19
|
ref
|
|
19
20
|
};
|
|
@@ -6,10 +6,11 @@ const StyledCardHeaderTitle = styled.div.withConfig({
|
|
|
6
6
|
displayName: "CardHeaderTitle__StyledCardHeaderTitle",
|
|
7
7
|
componentId: "sc-11m80r3-0"
|
|
8
8
|
})(["display:grid;flex-grow:2;grid-auto-columns:auto;"]);
|
|
9
|
-
const CardHeaderTitle = /*#__PURE__*/forwardRef(function CardHeaderTitle({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const CardHeaderTitle = /*#__PURE__*/forwardRef(function CardHeaderTitle(_ref, ref) {
|
|
10
|
+
let {
|
|
11
|
+
children,
|
|
12
|
+
...rest
|
|
13
|
+
} = _ref;
|
|
13
14
|
const props = { ...rest,
|
|
14
15
|
ref
|
|
15
16
|
};
|
|
@@ -10,14 +10,18 @@ const {
|
|
|
10
10
|
const StyledCardMedia = styled.div.withConfig({
|
|
11
11
|
displayName: "CardMedia__StyledCardMedia",
|
|
12
12
|
componentId: "sc-kr8q9c-0"
|
|
13
|
-
})(["display:flex;width:auto;", ""],
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
})(["display:flex;width:auto;", ""], _ref => {
|
|
14
|
+
let {
|
|
15
|
+
fullWidth
|
|
16
|
+
} = _ref;
|
|
17
|
+
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
|
+
});
|
|
19
|
+
const CardMedia = /*#__PURE__*/forwardRef(function CardMedia(_ref2, ref) {
|
|
20
|
+
let {
|
|
21
|
+
children,
|
|
22
|
+
fullWidth = false,
|
|
23
|
+
...rest
|
|
24
|
+
} = _ref2;
|
|
21
25
|
const props = { ...rest,
|
|
22
26
|
ref,
|
|
23
27
|
fullWidth
|
|
@@ -1,28 +1,32 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { checkbox } from './Checkbox.tokens.js';
|
|
4
|
+
import { typographyTemplate } from '@equinor/eds-utils';
|
|
4
5
|
import { CheckboxInput } from './Input.js';
|
|
5
6
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
|
-
import { typographyTemplate } from '../../utils/templates/index.js';
|
|
7
7
|
|
|
8
8
|
/* eslint camelcase: "off" */
|
|
9
9
|
const StyledLabel = styled.label.withConfig({
|
|
10
10
|
displayName: "Checkbox__StyledLabel",
|
|
11
11
|
componentId: "sc-yg6l8h-0"
|
|
12
|
-
})(["display:inline-flex;align-items:center;cursor:", ";"],
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
})(["display:inline-flex;align-items:center;cursor:", ";"], _ref => {
|
|
13
|
+
let {
|
|
14
|
+
disabled
|
|
15
|
+
} = _ref;
|
|
16
|
+
return disabled ? 'not-allowed' : 'pointer';
|
|
17
|
+
});
|
|
15
18
|
const LabelText = styled.span.withConfig({
|
|
16
19
|
displayName: "Checkbox__LabelText",
|
|
17
20
|
componentId: "sc-yg6l8h-1"
|
|
18
21
|
})(["", ";"], typographyTemplate(checkbox.typography));
|
|
19
|
-
const Checkbox = /*#__PURE__*/forwardRef(function Checkbox({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
const Checkbox = /*#__PURE__*/forwardRef(function Checkbox(_ref2, ref) {
|
|
23
|
+
let {
|
|
24
|
+
label,
|
|
25
|
+
disabled = false,
|
|
26
|
+
indeterminate,
|
|
27
|
+
className,
|
|
28
|
+
...rest
|
|
29
|
+
} = _ref2;
|
|
26
30
|
return label ? /*#__PURE__*/jsxs(StyledLabel, {
|
|
27
31
|
disabled: disabled,
|
|
28
32
|
className: className,
|