@equinor/eds-core-react 0.18.0-envis.2 → 0.19.0-dev.20220405
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 +2276 -1930
- package/dist/esm/components/Accordion/Accordion.js +9 -9
- package/dist/esm/components/Accordion/Accordion.tokens.js +6 -1
- package/dist/esm/components/Accordion/AccordionHeader.js +61 -49
- package/dist/esm/components/Accordion/AccordionHeaderTitle.js +12 -10
- package/dist/esm/components/Accordion/AccordionItem.js +11 -10
- package/dist/esm/components/Accordion/AccordionPanel.js +22 -18
- package/dist/esm/components/Avatar/Avatar.js +21 -14
- package/dist/esm/components/Banner/Banner.js +12 -11
- package/dist/esm/components/Banner/BannerActions.js +11 -9
- package/dist/esm/components/Banner/BannerIcon.js +12 -10
- 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 +16 -17
- package/dist/esm/components/Button/InnerFullWidth.js +4 -3
- package/dist/esm/components/Button/tokens/button.js +1 -1
- 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 +11 -6
- 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/Checkbox.tokens.js +9 -4
- package/dist/esm/components/Checkbox/Input.js +72 -46
- package/dist/esm/components/Chip/Chip.js +46 -30
- package/dist/esm/components/Chip/Chip.tokens.js +7 -2
- package/dist/esm/components/Chip/Icon.js +12 -7
- package/dist/esm/components/Dialog/Dialog.js +44 -20
- package/dist/esm/components/Dialog/Dialog.tokens.js +4 -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 +16 -4
- package/dist/esm/components/Menu/Menu.js +71 -30
- package/dist/esm/components/Menu/MenuItem.js +38 -25
- package/dist/esm/components/Menu/MenuList.js +18 -11
- package/dist/esm/components/Menu/MenuSection.js +1 -1
- 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 +43 -50
- package/dist/esm/components/Popover/Popover.tokens.js +2 -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 +13 -24
- 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/Radio/Radio.tokens.js +9 -4
- package/dist/esm/components/Scrim/Scrim.js +16 -20
- package/dist/esm/components/Search/Search.js +28 -28
- package/dist/esm/components/Select/MultiSelect/MultiSelect.js +27 -22
- package/dist/esm/components/Select/NativeSelect/NativeSelect.js +19 -17
- package/dist/esm/components/Select/Select.tokens.js +2 -2
- package/dist/esm/components/Select/SingleSelect/SingleSelect.js +29 -23
- package/dist/esm/components/Select/commonStyles.js +14 -13
- 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 +81 -38
- package/dist/esm/components/Slider/Slider.tokens.js +7 -2
- package/dist/esm/components/Slider/SliderInput.js +14 -14
- package/dist/esm/components/Snackbar/Snackbar.js +17 -21
- package/dist/esm/components/Snackbar/SnackbarAction.js +9 -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/Switch.tokens.js +6 -1
- 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 +12 -12
- package/dist/esm/components/Table/DataCell/DataCell.tokens.js +2 -2
- package/dist/esm/components/Table/Head/Head.js +7 -6
- package/dist/esm/components/Table/HeaderCell/HeaderCell.js +7 -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 +10 -10
- package/dist/esm/components/TableOfContents/TableOfContents.js +17 -15
- package/dist/esm/components/Tabs/Tab.js +21 -19
- package/dist/esm/components/Tabs/TabList.js +27 -11
- package/dist/esm/components/Tabs/TabPanel.js +8 -7
- package/dist/esm/components/Tabs/TabPanels.js +5 -4
- package/dist/esm/components/Tabs/Tabs.context.js +1 -0
- package/dist/esm/components/Tabs/Tabs.js +45 -15
- package/dist/esm/components/Tabs/Tabs.tokens.js +8 -2
- package/dist/esm/components/TextField/Field.js +49 -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 +19 -19
- package/dist/esm/components/Textarea/Textarea.js +16 -16
- package/dist/esm/components/Tooltip/Tooltip.js +23 -24
- 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 +11 -11
- package/dist/esm/components/Typography/Typography.js +49 -28
- package/dist/esm/components/Typography/Typography.tokens.js +7 -2
- 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/Accordion/AccordionHeader.d.ts +2 -2
- 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/Icon/Icon.d.ts +2 -2
- package/dist/types/components/Menu/Menu.context.d.ts +3 -0
- package/dist/types/components/Menu/Menu.d.ts +1 -6
- package/dist/types/components/Menu/MenuList.d.ts +0 -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/Switch/Switch.d.ts +1 -1
- package/dist/types/components/Switch/Switch.styles.d.ts +2 -1
- package/dist/types/components/Tabs/TabList.d.ts +4 -0
- package/dist/types/components/Tabs/Tabs.context.d.ts +1 -0
- package/dist/types/components/Tabs/Tabs.d.ts +4 -0
- package/dist/types/components/Tooltip/Tooltip.d.ts +1 -1
- package/package.json +37 -38
- package/dist/esm/components/Dialog/Actions.js +0 -26
- package/dist/esm/components/Dialog/CustomContent.js +0 -46
- package/dist/esm/components/Dialog/Title.js +0 -41
- 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 -20
- 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/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
|
@@ -56,6 +56,11 @@ const {
|
|
|
56
56
|
rounded: {
|
|
57
57
|
borderRadius
|
|
58
58
|
}
|
|
59
|
+
},
|
|
60
|
+
interactions: {
|
|
61
|
+
focused: {
|
|
62
|
+
width: focusOutlineWidth
|
|
63
|
+
}
|
|
59
64
|
}
|
|
60
65
|
} = tokens$1;
|
|
61
66
|
const enabled = {
|
|
@@ -88,11 +93,11 @@ const enabled = {
|
|
|
88
93
|
},
|
|
89
94
|
focus: {
|
|
90
95
|
outline: {
|
|
91
|
-
width:
|
|
96
|
+
width: focusOutlineWidth,
|
|
92
97
|
color: focusOutlineColor,
|
|
93
98
|
style: 'dashed',
|
|
94
99
|
type: 'outline',
|
|
95
|
-
offset: '
|
|
100
|
+
offset: '3px'
|
|
96
101
|
}
|
|
97
102
|
},
|
|
98
103
|
active: {
|
|
@@ -2,7 +2,7 @@ import styled, { css } from 'styled-components';
|
|
|
2
2
|
import { close } from '@equinor/eds-icons';
|
|
3
3
|
import { Icon as Icon$1 } from '../Icon/index.js';
|
|
4
4
|
import * as Chip_tokens from './Chip.tokens.js';
|
|
5
|
-
import { bordersTemplate } from '
|
|
5
|
+
import { bordersTemplate } from '@equinor/eds-utils';
|
|
6
6
|
|
|
7
7
|
Icon$1.add({
|
|
8
8
|
close
|
|
@@ -14,9 +14,11 @@ const {
|
|
|
14
14
|
const Icon = styled(Icon$1).withConfig({
|
|
15
15
|
displayName: "Icon",
|
|
16
16
|
componentId: "sc-50ffvg-0"
|
|
17
|
-
})(["cursor:pointer;padding:1px;", " z-index:11;&:hover{", ";}", ""], bordersTemplate(enabled.entities.icon.border),
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
})(["cursor:pointer;padding:1px;", " z-index:11;&:hover{", ";}", ""], bordersTemplate(enabled.entities.icon.border), _ref => {
|
|
18
|
+
let {
|
|
19
|
+
variant
|
|
20
|
+
} = _ref;
|
|
21
|
+
|
|
20
22
|
switch (variant) {
|
|
21
23
|
case 'error':
|
|
22
24
|
return css(["background:", ";svg{fill:", ";}"], error.entities.icon.background, error.entities.icon.typography.color);
|
|
@@ -24,8 +26,11 @@ const Icon = styled(Icon$1).withConfig({
|
|
|
24
26
|
default:
|
|
25
27
|
return css(["background:", ";svg{fill:", ";}"], enabled.entities.icon.states.hover.background, enabled.states.hover.typography.color);
|
|
26
28
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
}, _ref2 => {
|
|
30
|
+
let {
|
|
31
|
+
disabled
|
|
32
|
+
} = _ref2;
|
|
33
|
+
return disabled && css(["cursor:not-allowed;&:hover{background:transparent;}"]);
|
|
34
|
+
});
|
|
30
35
|
|
|
31
36
|
export { Icon };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
|
+
import { createPortal } from 'react-dom';
|
|
2
3
|
import styled, { css, ThemeProvider } from 'styled-components';
|
|
4
|
+
import { typographyTemplate, bordersTemplate, useToken } from '@equinor/eds-utils';
|
|
3
5
|
import { dialog } from './Dialog.tokens.js';
|
|
4
|
-
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
5
7
|
import { Paper } from '../Paper/Paper.js';
|
|
6
|
-
import {
|
|
7
|
-
import { bordersTemplate } from '../../utils/templates/borders.js';
|
|
8
|
+
import { Scrim } from '../Scrim/Scrim.js';
|
|
8
9
|
import { useEds } from '../EdsProvider/eds.context.js';
|
|
9
|
-
import { useToken } from '../../hooks/useToken.js';
|
|
10
10
|
|
|
11
11
|
const StyledDialog = styled(Paper).attrs({
|
|
12
12
|
tabIndex: 0,
|
|
@@ -17,29 +17,53 @@ const StyledDialog = styled(Paper).attrs({
|
|
|
17
17
|
}).withConfig({
|
|
18
18
|
displayName: "Dialog__StyledDialog",
|
|
19
19
|
componentId: "sc-1mewo3f-0"
|
|
20
|
-
})(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
})(_ref => {
|
|
21
|
+
let {
|
|
22
|
+
theme
|
|
23
|
+
} = _ref;
|
|
24
|
+
return css(["width:", ";background:", ";display:grid;grid-auto-columns:auto;", " ", " grid-gap:", ";"], theme.width, theme.background, typographyTemplate(theme.typography), bordersTemplate(theme.border), theme.spacings.bottom);
|
|
24
25
|
});
|
|
25
|
-
const Dialog = /*#__PURE__*/forwardRef(function Dialog({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
const Dialog = /*#__PURE__*/forwardRef(function Dialog(_ref2, ref) {
|
|
27
|
+
let {
|
|
28
|
+
children,
|
|
29
|
+
open,
|
|
30
|
+
onClose,
|
|
31
|
+
isDismissable = false,
|
|
32
|
+
...props
|
|
33
|
+
} = _ref2;
|
|
34
|
+
const rest = { ...props,
|
|
35
|
+
open,
|
|
36
|
+
ref
|
|
37
|
+
};
|
|
29
38
|
const {
|
|
30
39
|
density
|
|
31
40
|
} = useEds();
|
|
32
41
|
const token = useToken({
|
|
33
42
|
density
|
|
34
43
|
}, dialog);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
|
|
45
|
+
const handleDismiss = () => {
|
|
46
|
+
onClose && onClose();
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
if (!open) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return /*#__PURE__*/jsx(Fragment, {
|
|
54
|
+
children: /*#__PURE__*/createPortal( /*#__PURE__*/jsx(ThemeProvider, {
|
|
55
|
+
theme: token,
|
|
56
|
+
children: /*#__PURE__*/jsx(Scrim, {
|
|
57
|
+
open: true,
|
|
58
|
+
isDismissable: isDismissable,
|
|
59
|
+
onClose: handleDismiss,
|
|
60
|
+
children: /*#__PURE__*/jsx(StyledDialog, {
|
|
61
|
+
elevation: "above_scrim",
|
|
62
|
+
...rest,
|
|
63
|
+
children: children
|
|
64
|
+
})
|
|
65
|
+
})
|
|
66
|
+
}), document.body)
|
|
43
67
|
});
|
|
44
68
|
}); // Dialog.displayName = 'EdsDialog'
|
|
45
69
|
|
|
@@ -36,22 +36,17 @@ const dialog = {
|
|
|
36
36
|
radius: borderRadius
|
|
37
37
|
},
|
|
38
38
|
spacings: {
|
|
39
|
-
|
|
39
|
+
bottom: spacingMedium
|
|
40
40
|
},
|
|
41
41
|
entities: {
|
|
42
42
|
children: {
|
|
43
43
|
spacings: {
|
|
44
|
-
top:
|
|
45
|
-
bottom:
|
|
44
|
+
top: spacingMedium,
|
|
45
|
+
bottom: spacingMedium,
|
|
46
46
|
left: spacingMedium,
|
|
47
47
|
right: spacingMedium
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
|
-
divider: {
|
|
51
|
-
spacings: {
|
|
52
|
-
bottom: spacingMedium
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
50
|
title: {
|
|
56
51
|
minHeight: '24px',
|
|
57
52
|
typography: accordion_header
|
|
@@ -59,10 +54,7 @@ const dialog = {
|
|
|
59
54
|
content: {
|
|
60
55
|
minHeight: '80px',
|
|
61
56
|
height: '104px',
|
|
62
|
-
typography: body_long
|
|
63
|
-
spacings: {
|
|
64
|
-
bottom: spacingMedium
|
|
65
|
-
}
|
|
57
|
+
typography: body_long
|
|
66
58
|
},
|
|
67
59
|
actions: {
|
|
68
60
|
minHeight: '48px'
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
const StyledDialogActions = styled.div.withConfig({
|
|
6
|
+
displayName: "DialogActions__StyledDialogActions",
|
|
7
|
+
componentId: "sc-16ydtxd-0"
|
|
8
|
+
})(_ref => {
|
|
9
|
+
let {
|
|
10
|
+
theme,
|
|
11
|
+
children
|
|
12
|
+
} = _ref;
|
|
13
|
+
return css(["align-self:end;justify-self:start;padding:0 ", " 0 ", ";&:first-child{padding-top:", ";}&:last-child{padding-bottom:", ";}", ""], theme.entities.children.spacings.right, theme.entities.children.spacings.left, theme.entities.children.spacings.top, theme.entities.children.spacings.bottom, !children && css(["min-height:initial;height:'8px';"]));
|
|
14
|
+
});
|
|
15
|
+
const DialogActions = /*#__PURE__*/forwardRef(function DialogActions(_ref2, ref) {
|
|
16
|
+
let {
|
|
17
|
+
children,
|
|
18
|
+
...props
|
|
19
|
+
} = _ref2;
|
|
20
|
+
return /*#__PURE__*/jsx(StyledDialogActions, {
|
|
21
|
+
ref: ref,
|
|
22
|
+
...props,
|
|
23
|
+
children: children
|
|
24
|
+
});
|
|
25
|
+
}); // Actions.displayName = 'EdsDialogActions'
|
|
26
|
+
|
|
27
|
+
export { DialogActions };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import { typographyTemplate } from '@equinor/eds-utils';
|
|
4
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
5
|
+
import { Divider } from '../Divider/Divider.js';
|
|
6
|
+
|
|
7
|
+
const StyledDialogContent = styled.div.withConfig({
|
|
8
|
+
displayName: "DialogContent__StyledDialogContent",
|
|
9
|
+
componentId: "sc-1tze18k-0"
|
|
10
|
+
})(_ref => {
|
|
11
|
+
let {
|
|
12
|
+
theme,
|
|
13
|
+
scrollable
|
|
14
|
+
} = _ref;
|
|
15
|
+
return css(["", " min-height:", ";align-self:stretch;justify-self:stretch;padding:0 ", " 0 ", ";&:first-child{padding-top:", ";}&:last-child{padding-bottom:", ";}", ""], typographyTemplate(theme.entities.content.typography), theme.entities.content.minHeight, theme.entities.children.spacings.right, theme.entities.children.spacings.left, theme.entities.children.spacings.top, theme.entities.children.spacings.bottom, scrollable && css(["min-height:initial;height:", ";overflow-y:auto;"], theme.entities.content.height));
|
|
16
|
+
});
|
|
17
|
+
const StyledDivider = styled(Divider).withConfig({
|
|
18
|
+
displayName: "DialogContent__StyledDivider",
|
|
19
|
+
componentId: "sc-1tze18k-1"
|
|
20
|
+
})(["width:100%;margin-bottom:0;"]);
|
|
21
|
+
const DialogContent = /*#__PURE__*/forwardRef(function DialogContent(_ref2, ref) {
|
|
22
|
+
let {
|
|
23
|
+
children,
|
|
24
|
+
scrollable = false,
|
|
25
|
+
...rest
|
|
26
|
+
} = _ref2;
|
|
27
|
+
const props = {
|
|
28
|
+
scrollable,
|
|
29
|
+
ref,
|
|
30
|
+
...rest
|
|
31
|
+
};
|
|
32
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
33
|
+
children: [/*#__PURE__*/jsx(StyledDialogContent, {
|
|
34
|
+
id: "eds-dialog-customcontent",
|
|
35
|
+
...props,
|
|
36
|
+
children: children
|
|
37
|
+
}), children && scrollable && /*#__PURE__*/jsx(StyledDivider, {
|
|
38
|
+
color: "medium",
|
|
39
|
+
variant: "small"
|
|
40
|
+
})]
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export { DialogContent };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { Divider } from '../Divider/Divider.js';
|
|
5
|
+
|
|
6
|
+
const StyledDialogHeader = styled.div.withConfig({
|
|
7
|
+
displayName: "DialogHeader__StyledDialogHeader",
|
|
8
|
+
componentId: "sc-mbwcos-0"
|
|
9
|
+
})(_ref => {
|
|
10
|
+
let {
|
|
11
|
+
theme
|
|
12
|
+
} = _ref;
|
|
13
|
+
return css(["display:flex;justify-content:space-betweene;algin-items:center;padding:", " ", " 0 ", ";"], theme.entities.children.spacings.top, theme.entities.children.spacings.right, theme.entities.children.spacings.left);
|
|
14
|
+
});
|
|
15
|
+
const StyledDivider = styled(Divider).withConfig({
|
|
16
|
+
displayName: "DialogHeader__StyledDivider",
|
|
17
|
+
componentId: "sc-mbwcos-1"
|
|
18
|
+
})(["margin-bottom:0;"]);
|
|
19
|
+
const DialogHeader = /*#__PURE__*/forwardRef(function DialogHeader(_ref2, ref) {
|
|
20
|
+
let {
|
|
21
|
+
children,
|
|
22
|
+
...rest
|
|
23
|
+
} = _ref2;
|
|
24
|
+
const props = { ...rest,
|
|
25
|
+
ref
|
|
26
|
+
};
|
|
27
|
+
return /*#__PURE__*/jsxs("div", { ...props,
|
|
28
|
+
children: [/*#__PURE__*/jsx(StyledDialogHeader, {
|
|
29
|
+
children: children
|
|
30
|
+
}), /*#__PURE__*/jsx(StyledDivider, {
|
|
31
|
+
variant: "small",
|
|
32
|
+
color: "medium"
|
|
33
|
+
})]
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export { DialogHeader };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import { typographyTemplate } from '@equinor/eds-utils';
|
|
4
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
const StyledDialogTitle = styled.div.withConfig({
|
|
7
|
+
displayName: "DialogTitle__StyledDialogTitle",
|
|
8
|
+
componentId: "sc-1t3jljt-0"
|
|
9
|
+
})(_ref => {
|
|
10
|
+
let {
|
|
11
|
+
theme,
|
|
12
|
+
children
|
|
13
|
+
} = _ref;
|
|
14
|
+
return css(["", " min-height:", ";align-self:end;justify-self:start;margin-right:", ";", ""], typographyTemplate(theme.entities.title.typography), theme.entities.title.minHeight, theme.entities.children.spacings.right, !children && css(["min-height:initial;height:'8px';"]));
|
|
15
|
+
});
|
|
16
|
+
const DialogTitle = /*#__PURE__*/forwardRef(function DialogTitle(_ref2, ref) {
|
|
17
|
+
let {
|
|
18
|
+
children,
|
|
19
|
+
...rest
|
|
20
|
+
} = _ref2;
|
|
21
|
+
return /*#__PURE__*/jsx(Fragment, {
|
|
22
|
+
children: /*#__PURE__*/jsx(StyledDialogTitle, {
|
|
23
|
+
id: "eds-dialog-title",
|
|
24
|
+
ref: ref,
|
|
25
|
+
...rest,
|
|
26
|
+
children: children
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export { DialogTitle };
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { Dialog as Dialog$1 } from './Dialog.js';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { DialogActions } from './DialogActions.js';
|
|
3
|
+
import { DialogTitle } from './DialogTitle.js';
|
|
4
|
+
import { DialogContent } from './DialogContent.js';
|
|
5
|
+
import { DialogHeader } from './DialogHeader.js';
|
|
5
6
|
|
|
6
7
|
const Dialog = Dialog$1;
|
|
7
|
-
Dialog.Actions =
|
|
8
|
-
Dialog.Title =
|
|
9
|
-
Dialog.CustomContent =
|
|
8
|
+
Dialog.Actions = DialogActions;
|
|
9
|
+
Dialog.Title = DialogTitle;
|
|
10
|
+
Dialog.CustomContent = DialogContent;
|
|
11
|
+
Dialog.Content = DialogContent;
|
|
12
|
+
Dialog.Header = DialogHeader;
|
|
10
13
|
Dialog.Actions.displayName = 'Dialog.Actions';
|
|
11
14
|
Dialog.Title.displayName = 'Dialog.Title';
|
|
12
|
-
Dialog.
|
|
15
|
+
Dialog.Content.displayName = 'Dialog.Content';
|
|
16
|
+
Dialog.Header.displayName = 'Dialog.Header';
|
|
13
17
|
|
|
14
18
|
export { Dialog };
|
|
@@ -11,11 +11,12 @@ const StyledDivider = styled.hr.withConfig({
|
|
|
11
11
|
displayName: "Divider__StyledDivider",
|
|
12
12
|
componentId: "sc-1d8osde-0"
|
|
13
13
|
})(["border:none;background-color:", ";margin-top:", ";margin-bottom:", ";height:", ";"], props => props.backgroundColor, props => props.marginTop, props => props.marginBottom, props => props.dividerHeight);
|
|
14
|
-
const Divider = /*#__PURE__*/forwardRef(function Divider({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
const Divider = /*#__PURE__*/forwardRef(function Divider(_ref, ref) {
|
|
15
|
+
let {
|
|
16
|
+
color = 'medium',
|
|
17
|
+
variant = 'medium',
|
|
18
|
+
...rest
|
|
19
|
+
} = _ref;
|
|
19
20
|
const colorValue = color === 'medium' ? 'mediumColor' : color;
|
|
20
21
|
const props = {
|
|
21
22
|
backgroundColor: divider[colorValue].background,
|
|
@@ -5,10 +5,11 @@ const initalState = {
|
|
|
5
5
|
density: 'comfortable'
|
|
6
6
|
};
|
|
7
7
|
const EdsContext = /*#__PURE__*/createContext(initalState);
|
|
8
|
-
const EdsProvider =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const EdsProvider = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
children,
|
|
11
|
+
density = 'comfortable'
|
|
12
|
+
} = _ref;
|
|
12
13
|
const [state, setState] = useState({ ...initalState,
|
|
13
14
|
density
|
|
14
15
|
});
|
|
@@ -3,75 +3,106 @@ import styled from 'styled-components';
|
|
|
3
3
|
import { get } from './library.js';
|
|
4
4
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
6
|
+
const transform = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
rotation
|
|
9
|
+
} = _ref;
|
|
10
|
+
return rotation ? "transform: rotate(".concat(rotation, "deg)") : '';
|
|
11
|
+
};
|
|
10
12
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
})).withConfig({
|
|
13
|
+
const StyledSvg = styled.svg.attrs(_ref2 => {
|
|
14
|
+
let {
|
|
15
|
+
height,
|
|
16
|
+
width,
|
|
17
|
+
fill
|
|
18
|
+
} = _ref2;
|
|
19
|
+
return {
|
|
20
|
+
name: null,
|
|
21
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
22
|
+
height: "".concat(height, "px"),
|
|
23
|
+
width: "".concat(width, "px"),
|
|
24
|
+
fill
|
|
25
|
+
};
|
|
26
|
+
}).withConfig({
|
|
26
27
|
displayName: "Icon__StyledSvg",
|
|
27
28
|
componentId: "sc-6evbi1-0"
|
|
28
29
|
})(["", ""], transform);
|
|
29
|
-
const StyledPath = styled.path.attrs(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
const StyledPath = styled.path.attrs(_ref3 => {
|
|
31
|
+
let {
|
|
32
|
+
height,
|
|
33
|
+
size
|
|
34
|
+
} = _ref3;
|
|
35
|
+
return {
|
|
36
|
+
size: null,
|
|
37
|
+
fillRule: 'evenodd',
|
|
38
|
+
clipRule: 'evenodd',
|
|
39
|
+
transform: size / height !== 1 ? "scale(".concat(size / height, ")") : null
|
|
40
|
+
};
|
|
41
|
+
}).withConfig({
|
|
38
42
|
displayName: "Icon__StyledPath",
|
|
39
43
|
componentId: "sc-6evbi1-1"
|
|
40
44
|
})([""]);
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}, ref) {
|
|
51
|
-
const {
|
|
45
|
+
|
|
46
|
+
const customIcon = icon => ({
|
|
47
|
+
icon,
|
|
48
|
+
count: Math.floor(Math.random() * 1000)
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const findIcon = (name, data, size) => {
|
|
52
|
+
// eslint-disable-next-line prefer-const
|
|
53
|
+
let {
|
|
52
54
|
icon,
|
|
53
55
|
count
|
|
54
56
|
} = data ? customIcon(data) : get(name);
|
|
55
57
|
|
|
58
|
+
if (size < 24) {
|
|
59
|
+
var _icon$sizes;
|
|
60
|
+
|
|
61
|
+
// fallback to normal icon if small is not made yet
|
|
62
|
+
icon = ((_icon$sizes = icon.sizes) === null || _icon$sizes === void 0 ? void 0 : _icon$sizes.small) || icon;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return {
|
|
66
|
+
icon,
|
|
67
|
+
count
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const Icon = /*#__PURE__*/forwardRef(function Icon(_ref4, ref) {
|
|
72
|
+
let {
|
|
73
|
+
size = 24,
|
|
74
|
+
color = 'currentColor',
|
|
75
|
+
name,
|
|
76
|
+
rotation,
|
|
77
|
+
title,
|
|
78
|
+
data,
|
|
79
|
+
...rest
|
|
80
|
+
} = _ref4;
|
|
81
|
+
// eslint-disable-next-line prefer-const
|
|
82
|
+
const {
|
|
83
|
+
icon,
|
|
84
|
+
count
|
|
85
|
+
} = findIcon(name, data, size);
|
|
86
|
+
|
|
56
87
|
if (typeof icon === 'undefined') {
|
|
57
88
|
throw Error("Icon \"".concat(name, "\" not found. Have you added it using Icon.add() or using data props?"));
|
|
58
89
|
}
|
|
59
90
|
|
|
91
|
+
const height = size ? size : parseInt(icon.width);
|
|
92
|
+
const width = size ? size : parseInt(icon.height);
|
|
60
93
|
let svgProps = {
|
|
61
|
-
height
|
|
62
|
-
width
|
|
94
|
+
height,
|
|
95
|
+
width,
|
|
63
96
|
fill: color,
|
|
64
|
-
viewBox: "0 0 ".concat(
|
|
65
|
-
className,
|
|
97
|
+
viewBox: "0 0 ".concat(width, " ").concat(height),
|
|
66
98
|
rotation,
|
|
67
99
|
name,
|
|
68
|
-
'aria-hidden': true
|
|
69
|
-
title: null
|
|
100
|
+
'aria-hidden': true
|
|
70
101
|
};
|
|
71
102
|
const pathProps = {
|
|
72
103
|
d: icon.svgPathData,
|
|
73
104
|
height: icon.height ? icon.height : size,
|
|
74
|
-
size
|
|
105
|
+
size: size || icon.height
|
|
75
106
|
}; // Accessibility
|
|
76
107
|
|
|
77
108
|
let titleId = '';
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import styled, { css, ThemeProvider } from 'styled-components';
|
|
3
3
|
import { inputToken } from './Input.tokens.js';
|
|
4
|
+
import { outlineTemplate, typographyTemplate, spacingsTemplate, useToken } from '@equinor/eds-utils';
|
|
4
5
|
import { jsx } from 'react/jsx-runtime';
|
|
5
|
-
import { outlineTemplate } from '../../utils/templates/focus.js';
|
|
6
|
-
import { typographyTemplate, spacingsTemplate } from '../../utils/templates/index.js';
|
|
7
6
|
import { useEds } from '../EdsProvider/eds.context.js';
|
|
8
|
-
import { useToken } from '../../hooks/useToken.js';
|
|
9
7
|
|
|
10
8
|
const StyledInput = styled.input.withConfig({
|
|
11
9
|
displayName: "Input__StyledInput",
|
|
12
10
|
componentId: "sc-1ykv024-0"
|
|
13
|
-
})(
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
})(_ref => {
|
|
12
|
+
let {
|
|
13
|
+
theme
|
|
14
|
+
} = _ref;
|
|
16
15
|
const {
|
|
17
16
|
states: {
|
|
18
17
|
focus: {
|
|
@@ -28,12 +27,13 @@ const StyledInput = styled.input.withConfig({
|
|
|
28
27
|
} = theme;
|
|
29
28
|
return css(["width:100%;box-sizing:border-box;margin:0;appearance:none;background:", ";border:none;height:", ";box-shadow:", ";", " ", " ", ";&::placeholder{color:", ";}&:active,&:focus{outline-offset:0;box-shadow:none;", "}&:disabled{color:", ";cursor:not-allowed;box-shadow:none;outline:none;&:focus,&:active{outline:none;}}&[readOnly]{background:", ";box-shadow:", ";}"], theme.background, theme.minHeight, boxShadow, outlineTemplate(activeOutline), typographyTemplate(theme.typography), spacingsTemplate(theme.spacings), theme.entities.placeholder.typography.color, outlineTemplate(focusOutline), disabled.typography.color, readOnly.background, readOnly.boxShadow);
|
|
30
29
|
});
|
|
31
|
-
const Input = /*#__PURE__*/forwardRef(function Input({
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
const Input = /*#__PURE__*/forwardRef(function Input(_ref2, ref) {
|
|
31
|
+
let {
|
|
32
|
+
variant = 'default',
|
|
33
|
+
disabled = false,
|
|
34
|
+
type = 'text',
|
|
35
|
+
...other
|
|
36
|
+
} = _ref2;
|
|
37
37
|
const actualVariant = variant === 'default' ? 'input' : variant;
|
|
38
38
|
const inputVariant = inputToken[actualVariant];
|
|
39
39
|
const {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { tokens as tokens$1 } 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
|
|
|
4
4
|
const {
|
|
5
5
|
colors: {
|
|
@@ -93,7 +93,7 @@ const input = {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
|
-
const error =
|
|
96
|
+
const error = mergeDeepRight(input, {
|
|
97
97
|
boxShadow: 'inset 0px -1px 0px 0px transparent',
|
|
98
98
|
states: {
|
|
99
99
|
active: {
|
|
@@ -116,7 +116,7 @@ const error = mergeDeepRight_1(input, {
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
});
|
|
119
|
-
const warning =
|
|
119
|
+
const warning = mergeDeepRight(input, {
|
|
120
120
|
boxShadow: 'inset 0px -1px 0px 0px transparent',
|
|
121
121
|
states: {
|
|
122
122
|
active: {
|
|
@@ -139,7 +139,7 @@ const warning = mergeDeepRight_1(input, {
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
});
|
|
142
|
-
const success =
|
|
142
|
+
const success = mergeDeepRight(input, {
|
|
143
143
|
boxShadow: 'inset 0px -1px 0px 0px transparent',
|
|
144
144
|
states: {
|
|
145
145
|
active: {
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
+
import { typographyTemplate } from '@equinor/eds-utils';
|
|
3
4
|
import { label } from './Label.tokens.js';
|
|
4
5
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
-
import { typographyTemplate } from '../../utils/templates/index.js';
|
|
6
6
|
|
|
7
7
|
const LabelBase = styled.label.withConfig({
|
|
8
8
|
displayName: "Label__LabelBase",
|
|
9
9
|
componentId: "sc-1gi2bcn-0"
|
|
10
|
-
})(["display:flex;justify-content:space-between;position:relative;", " margin-left:", ";margin-right:", ";color:", ";"], typographyTemplate(label.typography), label.spacings.left, label.spacings.right,
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
})(["display:flex;justify-content:space-between;position:relative;", " margin-left:", ";margin-right:", ";color:", ";"], typographyTemplate(label.typography), label.spacings.left, label.spacings.right, _ref => {
|
|
11
|
+
let {
|
|
12
|
+
disabledText
|
|
13
|
+
} = _ref;
|
|
14
|
+
return disabledText ? label.states.disabled.typography.color : label.typography.color;
|
|
15
|
+
});
|
|
13
16
|
const Text = styled.span.withConfig({
|
|
14
17
|
displayName: "Label__Text",
|
|
15
18
|
componentId: "sc-1gi2bcn-1"
|