@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
|
@@ -15,10 +15,8 @@ const {
|
|
|
15
15
|
},
|
|
16
16
|
spacings: {
|
|
17
17
|
comfortable: {
|
|
18
|
-
x_large: spacingXlarge,
|
|
19
18
|
medium: spacingMedium,
|
|
20
|
-
small: spacingSmall
|
|
21
|
-
x_small: spacingXsmall
|
|
19
|
+
small: spacingSmall
|
|
22
20
|
}
|
|
23
21
|
},
|
|
24
22
|
shape: {
|
|
@@ -30,7 +28,6 @@ const {
|
|
|
30
28
|
const popover = {
|
|
31
29
|
background,
|
|
32
30
|
typography: header,
|
|
33
|
-
minHeight: '48px',
|
|
34
31
|
maxWidth: '560px',
|
|
35
32
|
maxHeight: '80vh',
|
|
36
33
|
entities: {
|
|
@@ -45,16 +42,9 @@ const popover = {
|
|
|
45
42
|
right: '-5px'
|
|
46
43
|
}
|
|
47
44
|
},
|
|
48
|
-
closeButton: {
|
|
49
|
-
width: spacingXlarge,
|
|
50
|
-
height: spacingXlarge,
|
|
51
|
-
spacings: {
|
|
52
|
-
top: spacingSmall
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
45
|
title: {
|
|
56
46
|
spacings: {
|
|
57
|
-
top:
|
|
47
|
+
top: '12px'
|
|
58
48
|
}
|
|
59
49
|
}
|
|
60
50
|
},
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
const StyledPopoverActions = styled.div.withConfig({
|
|
6
|
+
displayName: "PopoverActions__StyledPopoverActions",
|
|
7
|
+
componentId: "sc-1dkrhw6-0"
|
|
8
|
+
})(_ref => {
|
|
9
|
+
let {
|
|
10
|
+
theme
|
|
11
|
+
} = _ref;
|
|
12
|
+
return css(["display:grid;grid-gap:8px;grid-auto-flow:column;align-items:center;padding:0 ", " 0 ", ";:last-child{padding-bottom:", ";}:first-child{padding-top:", ";}"], theme.spacings.right, theme.spacings.left, theme.spacings.bottom, theme.spacings.top);
|
|
13
|
+
});
|
|
14
|
+
const PopoverActions = /*#__PURE__*/forwardRef(function PopoverActions(_ref2, ref) {
|
|
15
|
+
let {
|
|
16
|
+
children,
|
|
17
|
+
...rest
|
|
18
|
+
} = _ref2;
|
|
19
|
+
const props = {
|
|
20
|
+
ref,
|
|
21
|
+
...rest
|
|
22
|
+
};
|
|
23
|
+
return /*#__PURE__*/jsx(StyledPopoverActions, { ...props,
|
|
24
|
+
children: children
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export { PopoverActions };
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
|
-
import styled from 'styled-components';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
const ContentWrapper = styled.div.withConfig({
|
|
6
6
|
displayName: "PopoverContent__ContentWrapper",
|
|
7
7
|
componentId: "sc-vwww9h-0"
|
|
8
|
-
})(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
},
|
|
8
|
+
})(_ref => {
|
|
9
|
+
let {
|
|
10
|
+
theme
|
|
11
|
+
} = _ref;
|
|
12
|
+
return css(["overflow:hidden;padding:0 ", " 0 ", ";:last-child{padding-bottom:", ";}:first-child{padding-top:", ";}"], theme.spacings.right, theme.spacings.left, theme.spacings.bottom, theme.spacings.top);
|
|
13
|
+
});
|
|
14
|
+
const PopoverContent = /*#__PURE__*/forwardRef(function PopoverContent(_ref2, ref) {
|
|
15
|
+
let {
|
|
16
|
+
children,
|
|
17
|
+
...rest
|
|
18
|
+
} = _ref2;
|
|
13
19
|
const props = { ...rest,
|
|
14
20
|
ref
|
|
15
21
|
};
|
|
@@ -0,0 +1,36 @@
|
|
|
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 StyledPopoverHeader = styled.div.withConfig({
|
|
7
|
+
displayName: "PopoverHeader__StyledPopoverHeader",
|
|
8
|
+
componentId: "sc-ibcx7p-0"
|
|
9
|
+
})(_ref => {
|
|
10
|
+
let {
|
|
11
|
+
theme
|
|
12
|
+
} = _ref;
|
|
13
|
+
return css(["display:flex;justify-content:space-between;align-items:center;padding:", " ", " 0 ", ";"], theme.entities.title.spacings.top, theme.spacings.right, theme.spacings.left);
|
|
14
|
+
});
|
|
15
|
+
const StyledDivider = styled(Divider).withConfig({
|
|
16
|
+
displayName: "PopoverHeader__StyledDivider",
|
|
17
|
+
componentId: "sc-ibcx7p-1"
|
|
18
|
+
})(["margin-bottom:0;"]);
|
|
19
|
+
const PopoverHeader = /*#__PURE__*/forwardRef(function PopoverHeader(_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(StyledPopoverHeader, {
|
|
29
|
+
children: children
|
|
30
|
+
}), /*#__PURE__*/jsx(StyledDivider, {
|
|
31
|
+
variant: "small"
|
|
32
|
+
})]
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export { PopoverHeader };
|
|
@@ -1,37 +1,26 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
|
-
import {
|
|
4
|
-
import { Divider } from '../Divider/Divider.js';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
4
|
|
|
6
5
|
const StyledPopoverTitle = styled.div.withConfig({
|
|
7
6
|
displayName: "PopoverTitle__StyledPopoverTitle",
|
|
8
7
|
componentId: "sc-1ben8su-0"
|
|
9
|
-
})(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
})(_ref => {
|
|
9
|
+
let {
|
|
10
|
+
theme
|
|
11
|
+
} = _ref;
|
|
12
|
+
return css(["max-width:", ";margin-right:", ";overflow:hidden;"], theme.maxWidth, theme.spacings.right);
|
|
13
13
|
});
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}) => {
|
|
20
|
-
return css(["margin-left:-", ";margin-right:-", ";margin-bottom:0;width:auto;max-width:", ";"], theme.spacings.left, theme.spacings.right, theme.maxWidth);
|
|
21
|
-
});
|
|
22
|
-
const PopoverTitle = /*#__PURE__*/forwardRef(function PopoverTitle({
|
|
23
|
-
children,
|
|
24
|
-
...rest
|
|
25
|
-
}, ref) {
|
|
14
|
+
const PopoverTitle = /*#__PURE__*/forwardRef(function PopoverTitle(_ref2, ref) {
|
|
15
|
+
let {
|
|
16
|
+
children,
|
|
17
|
+
...rest
|
|
18
|
+
} = _ref2;
|
|
26
19
|
const props = { ...rest,
|
|
27
20
|
ref
|
|
28
21
|
};
|
|
29
|
-
return /*#__PURE__*/
|
|
30
|
-
children:
|
|
31
|
-
children: children
|
|
32
|
-
}), /*#__PURE__*/jsx(StyledDivider, {
|
|
33
|
-
variant: "small"
|
|
34
|
-
})]
|
|
22
|
+
return /*#__PURE__*/jsx(StyledPopoverTitle, { ...props,
|
|
23
|
+
children: children
|
|
35
24
|
});
|
|
36
25
|
});
|
|
37
26
|
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { Popover as Popover$1 } from './Popover.js';
|
|
2
2
|
import { PopoverTitle } from './PopoverTitle.js';
|
|
3
3
|
import { PopoverContent } from './PopoverContent.js';
|
|
4
|
+
import { PopoverHeader } from './PopoverHeader.js';
|
|
5
|
+
import { PopoverActions } from './PopoverActions.js';
|
|
4
6
|
|
|
5
7
|
const Popover = Popover$1;
|
|
6
8
|
Popover.Title = PopoverTitle;
|
|
7
9
|
Popover.Content = PopoverContent;
|
|
10
|
+
Popover.Header = PopoverHeader;
|
|
11
|
+
Popover.Actions = PopoverActions;
|
|
8
12
|
Popover.Title.displayName = 'Popover.Title';
|
|
9
13
|
Popover.Content.displayName = 'Popover.Content';
|
|
14
|
+
Popover.Header.displayName = 'Popover.Header';
|
|
15
|
+
Popover.Actions.displayName = 'Popover.Actions';
|
|
10
16
|
|
|
11
17
|
export { Popover };
|
|
@@ -7,9 +7,12 @@ const indeterminate = keyframes(["100%{transform:rotate(360deg);}"]);
|
|
|
7
7
|
const Svg = styled.svg.withConfig({
|
|
8
8
|
displayName: "CircularProgress__Svg",
|
|
9
9
|
componentId: "sc-hib054-0"
|
|
10
|
-
})(["display:inline-block;", ";"],
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
})(["display:inline-block;", ";"], _ref => {
|
|
11
|
+
let {
|
|
12
|
+
variant
|
|
13
|
+
} = _ref;
|
|
14
|
+
return variant === 'indeterminate' ? css(["animation:", " 1.4s linear infinite;"], indeterminate) : css(["transform:rotate(-90deg);"]);
|
|
15
|
+
});
|
|
13
16
|
const TrackCircle = styled.circle.withConfig({
|
|
14
17
|
displayName: "CircularProgress__TrackCircle",
|
|
15
18
|
componentId: "sc-hib054-1"
|
|
@@ -34,13 +37,14 @@ const getToken = color => {
|
|
|
34
37
|
};
|
|
35
38
|
};
|
|
36
39
|
|
|
37
|
-
const CircularProgress = /*#__PURE__*/forwardRef(function CircularProgress({
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
const CircularProgress = /*#__PURE__*/forwardRef(function CircularProgress(_ref2, ref) {
|
|
41
|
+
let {
|
|
42
|
+
variant = 'indeterminate',
|
|
43
|
+
value = null,
|
|
44
|
+
size = 48,
|
|
45
|
+
color = 'primary',
|
|
46
|
+
...rest
|
|
47
|
+
} = _ref2;
|
|
44
48
|
const thickness = 4;
|
|
45
49
|
const progress = Math.round(value);
|
|
46
50
|
const trackStyle = {};
|
|
@@ -7,9 +7,12 @@ const opacity = keyframes(["0%{opacity:1;}100%{opacity:0.5;}"]);
|
|
|
7
7
|
const Svg = styled.svg.withConfig({
|
|
8
8
|
displayName: "DotProgress__Svg",
|
|
9
9
|
componentId: "sc-1s6o2q7-0"
|
|
10
|
-
})(["fill:", ";circle{&:nth-child(1){animation:", " 1s ease infinite;}&:nth-child(2){animation:", " 1s ease 0.2s infinite;}&:nth-child(3){animation:", " 1s ease 0.4s infinite;}}"],
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
})(["fill:", ";circle{&:nth-child(1){animation:", " 1s ease infinite;}&:nth-child(2){animation:", " 1s ease 0.2s infinite;}&:nth-child(3){animation:", " 1s ease 0.4s infinite;}}"], _ref => {
|
|
11
|
+
let {
|
|
12
|
+
color
|
|
13
|
+
} = _ref;
|
|
14
|
+
return color;
|
|
15
|
+
}, opacity, opacity, opacity);
|
|
13
16
|
|
|
14
17
|
const getColor = color => {
|
|
15
18
|
if (DotProgress_tokens[color]) {
|
|
@@ -19,11 +22,12 @@ const getColor = color => {
|
|
|
19
22
|
return color;
|
|
20
23
|
};
|
|
21
24
|
|
|
22
|
-
const DotProgress = /*#__PURE__*/forwardRef(function DotProgress({
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
const DotProgress = /*#__PURE__*/forwardRef(function DotProgress(_ref2, ref) {
|
|
26
|
+
let {
|
|
27
|
+
color = 'neutral',
|
|
28
|
+
size = 32,
|
|
29
|
+
...rest
|
|
30
|
+
} = _ref2;
|
|
27
31
|
const props = { ...rest,
|
|
28
32
|
color: getColor(color),
|
|
29
33
|
ref
|
|
@@ -16,11 +16,12 @@ const IndeterminateProgressBar = styled.div.withConfig({
|
|
|
16
16
|
displayName: "LinearProgress__IndeterminateProgressBar",
|
|
17
17
|
componentId: "sc-5orxpi-2"
|
|
18
18
|
})(["width:75%;border-radius:50px;position:absolute;left:0;bottom:0;top:0;transition:transform 0.2s linear;transform-origin:left;background-color:", ";animation:", " 1.5s cubic-bezier(0.165,0.84,0.44,1) 1s infinite;"], primary.entities.progress.background, indeterminate);
|
|
19
|
-
const LinearProgress = /*#__PURE__*/forwardRef(function LinearProgress({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
const LinearProgress = /*#__PURE__*/forwardRef(function LinearProgress(_ref, ref) {
|
|
20
|
+
let {
|
|
21
|
+
variant = 'indeterminate',
|
|
22
|
+
value = null,
|
|
23
|
+
...rest
|
|
24
|
+
} = _ref;
|
|
24
25
|
const props = { ...rest,
|
|
25
26
|
ref
|
|
26
27
|
};
|
|
@@ -8,16 +8,20 @@ const determinate = keyframes(["0%{opacity:0;}10%{opacity:0.05;}20%{opacity:0.2;
|
|
|
8
8
|
const Svg = styled.svg.withConfig({
|
|
9
9
|
displayName: "StarProgress__Svg",
|
|
10
10
|
componentId: "sc-c0byj9-0"
|
|
11
|
-
})(["fill:", ";", ""], token.background,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
variant
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
})(["fill:", ";", ""], token.background, _ref => {
|
|
12
|
+
let {
|
|
13
|
+
variant,
|
|
14
|
+
progress
|
|
15
|
+
} = _ref;
|
|
16
|
+
return variant === 'indeterminate' ? css(["path{&:nth-child(1){animation:", " 1.3s linear infinite;}&:nth-child(2){animation:", " 1.3s linear 0.3s infinite;}&:nth-child(3){animation:", " 1.3s linear 0.4s infinite;}&:nth-child(4){animation:", " 1.3s linear 0.6s infinite;}&:nth-child(5){animation:", " 1.3s linear 0.8s infinite;}&:nth-child(6){animation:", " 1.3s linear 1s infinite;}}"], indeterminate, indeterminate, indeterminate, indeterminate, indeterminate, indeterminate) : css(["path{animation:", " 1.3s linear;&:nth-child(6){animation-play-state:", ";}&:nth-child(5){animation-play-state:", ";}&:nth-child(4){animation-play-state:", ";}&:nth-child(3){animation-play-state:", ";}&:nth-child(2){animation-play-state:", ";}&:nth-child(1){animation-play-state:", ";}}"], determinate, progress > 90 ? 'running' : 'paused', progress > 80 ? 'running' : 'paused', progress > 60 ? 'running' : 'paused', progress > 40 ? 'running' : 'paused', progress > 20 ? 'running' : 'paused', progress <= 20 ? 'running' : 'paused');
|
|
17
|
+
});
|
|
18
|
+
const StarProgress = /*#__PURE__*/forwardRef(function StarProgress(_ref2, ref) {
|
|
19
|
+
let {
|
|
20
|
+
variant = 'indeterminate',
|
|
21
|
+
value = null,
|
|
22
|
+
size = 48,
|
|
23
|
+
...rest
|
|
24
|
+
} = _ref2;
|
|
21
25
|
const progress = Math.round(value);
|
|
22
26
|
const height = size * 1.2;
|
|
23
27
|
const width = size;
|
|
@@ -2,57 +2,79 @@ import { forwardRef, useMemo } from 'react';
|
|
|
2
2
|
import styled, { ThemeProvider } from 'styled-components';
|
|
3
3
|
import { radio_button_selected, radio_button_unselected } from '@equinor/eds-icons';
|
|
4
4
|
import { comfortable } from './Radio.tokens.js';
|
|
5
|
+
import { outlineTemplate, typographyTemplate, spacingsTemplate, useToken } from '@equinor/eds-utils';
|
|
5
6
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
|
-
import { outlineTemplate } from '../../utils/templates/focus.js';
|
|
7
|
-
import { typographyTemplate, spacingsTemplate } from '../../utils/templates/index.js';
|
|
8
7
|
import { useEds } from '../EdsProvider/eds.context.js';
|
|
9
|
-
import { useToken } from '../../hooks/useToken.js';
|
|
10
8
|
|
|
11
9
|
/* eslint camelcase: "off" */
|
|
12
|
-
const Input = styled.input.attrs(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
const Input = styled.input.attrs(_ref => {
|
|
11
|
+
let {
|
|
12
|
+
type = 'radio'
|
|
13
|
+
} = _ref;
|
|
14
|
+
return {
|
|
15
|
+
type
|
|
16
|
+
};
|
|
17
|
+
}).withConfig({
|
|
17
18
|
displayName: "Radio__Input",
|
|
18
19
|
componentId: "sc-we59oz-0"
|
|
19
|
-
})(["--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='selected']{display:none;}&:not(:checked) ~ svg path[name='unselected']{display:inline;}&:checked ~ svg path[name='unselected']{display:none;}&:checked ~ svg path[name='selected']{display:inline;}"],
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
20
|
+
})(["--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='selected']{display:none;}&:not(:checked) ~ svg path[name='unselected']{display:inline;}&:checked ~ svg path[name='unselected']{display:none;}&:checked ~ svg path[name='selected']{display:inline;}"], _ref2 => {
|
|
21
|
+
let {
|
|
22
|
+
theme,
|
|
23
|
+
iconSize
|
|
24
|
+
} = _ref2;
|
|
25
|
+
return parseFloat(theme.clickbound.height) / iconSize;
|
|
26
|
+
}, _ref3 => {
|
|
27
|
+
let {
|
|
28
|
+
disabled
|
|
29
|
+
} = _ref3;
|
|
30
|
+
return disabled ? 'not-allowed' : 'pointer';
|
|
31
|
+
}, _ref4 => {
|
|
32
|
+
let {
|
|
33
|
+
theme
|
|
34
|
+
} = _ref4;
|
|
35
|
+
return outlineTemplate(theme.states.focus.outline);
|
|
36
|
+
}, _ref5 => {
|
|
37
|
+
let {
|
|
38
|
+
theme
|
|
39
|
+
} = _ref5;
|
|
40
|
+
return outlineTemplate(theme.states.focus.outline);
|
|
41
|
+
});
|
|
29
42
|
const StyledLabel = styled.label.withConfig({
|
|
30
43
|
displayName: "Radio__StyledLabel",
|
|
31
44
|
componentId: "sc-we59oz-1"
|
|
32
|
-
})(["display:inline-flex;align-items:center;cursor:", ";"],
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
45
|
+
})(["display:inline-flex;align-items:center;cursor:", ";"], _ref6 => {
|
|
46
|
+
let {
|
|
47
|
+
disabled
|
|
48
|
+
} = _ref6;
|
|
49
|
+
return disabled ? 'not-allowed' : 'pointer';
|
|
50
|
+
});
|
|
51
|
+
const StyledPath = styled.path.attrs(_ref7 => {
|
|
52
|
+
let {
|
|
53
|
+
icon
|
|
54
|
+
} = _ref7;
|
|
55
|
+
return {
|
|
56
|
+
fillRule: 'evenodd',
|
|
57
|
+
clipRule: 'evenodd',
|
|
58
|
+
d: icon.svgPathData
|
|
59
|
+
};
|
|
60
|
+
}).withConfig({
|
|
42
61
|
displayName: "Radio__StyledPath",
|
|
43
62
|
componentId: "sc-we59oz-2"
|
|
44
63
|
})([""]);
|
|
45
|
-
const Svg = styled.svg.attrs(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
64
|
+
const Svg = styled.svg.attrs(_ref8 => {
|
|
65
|
+
let {
|
|
66
|
+
height,
|
|
67
|
+
width,
|
|
68
|
+
fill
|
|
69
|
+
} = _ref8;
|
|
70
|
+
return {
|
|
71
|
+
name: null,
|
|
72
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
73
|
+
height,
|
|
74
|
+
width,
|
|
75
|
+
fill
|
|
76
|
+
};
|
|
77
|
+
}).withConfig({
|
|
56
78
|
displayName: "Radio__Svg",
|
|
57
79
|
componentId: "sc-we59oz-3"
|
|
58
80
|
})(["grid-area:input;pointer-events:none;"]);
|
|
@@ -63,19 +85,29 @@ const LabelText = styled.span.withConfig({
|
|
|
63
85
|
const InputWrapper = styled.span.withConfig({
|
|
64
86
|
displayName: "Radio__InputWrapper",
|
|
65
87
|
componentId: "sc-we59oz-5"
|
|
66
|
-
})(["", " display:inline-grid;grid:[input] 1fr / [input] 1fr;border-radius:50%;cursor:", ";@media (hover:hover) and (pointer:fine){&:hover{background-color:", ";}}"],
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
disabled
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
88
|
+
})(["", " display:inline-grid;grid:[input] 1fr / [input] 1fr;border-radius:50%;cursor:", ";@media (hover:hover) and (pointer:fine){&:hover{background-color:", ";}}"], _ref9 => {
|
|
89
|
+
let {
|
|
90
|
+
theme
|
|
91
|
+
} = _ref9;
|
|
92
|
+
return spacingsTemplate(theme.spacings);
|
|
93
|
+
}, _ref10 => {
|
|
94
|
+
let {
|
|
95
|
+
disabled
|
|
96
|
+
} = _ref10;
|
|
97
|
+
return disabled ? 'not-allowed' : 'pointer';
|
|
98
|
+
}, _ref11 => {
|
|
99
|
+
let {
|
|
100
|
+
disabled
|
|
101
|
+
} = _ref11;
|
|
102
|
+
return disabled ? 'transparent' : comfortable.states.hover.background;
|
|
103
|
+
});
|
|
104
|
+
const Radio = /*#__PURE__*/forwardRef(function Radio(_ref12, ref) {
|
|
105
|
+
let {
|
|
106
|
+
label,
|
|
107
|
+
disabled = false,
|
|
108
|
+
className,
|
|
109
|
+
...rest
|
|
110
|
+
} = _ref12;
|
|
79
111
|
const {
|
|
80
112
|
density
|
|
81
113
|
} = useEds();
|
|
@@ -31,6 +31,11 @@ const {
|
|
|
31
31
|
clickbounds: {
|
|
32
32
|
default__base: clicboundSize,
|
|
33
33
|
compact__standard: compactClickboundSize
|
|
34
|
+
},
|
|
35
|
+
interactions: {
|
|
36
|
+
focused: {
|
|
37
|
+
width: focusOutlineWidth
|
|
38
|
+
}
|
|
34
39
|
}
|
|
35
40
|
} = tokens;
|
|
36
41
|
const comfortable = {
|
|
@@ -56,9 +61,9 @@ const comfortable = {
|
|
|
56
61
|
outline: {
|
|
57
62
|
type: 'outline',
|
|
58
63
|
style: 'dashed',
|
|
59
|
-
width:
|
|
64
|
+
width: focusOutlineWidth,
|
|
60
65
|
color: focusOutlineColor,
|
|
61
|
-
offset: '
|
|
66
|
+
offset: '10px'
|
|
62
67
|
}
|
|
63
68
|
}
|
|
64
69
|
},
|
|
@@ -78,9 +83,9 @@ const comfortable = {
|
|
|
78
83
|
outline: {
|
|
79
84
|
type: 'outline',
|
|
80
85
|
style: 'dashed',
|
|
81
|
-
width:
|
|
86
|
+
width: focusOutlineWidth,
|
|
82
87
|
color: focusOutlineColor,
|
|
83
|
-
offset: '
|
|
88
|
+
offset: '2px'
|
|
84
89
|
}
|
|
85
90
|
}
|
|
86
91
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { forwardRef } from 'react';
|
|
1
|
+
import { forwardRef, useRef } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { scrim } from './Scrim.tokens.js';
|
|
4
|
+
import { useCombinedRefs, useHideBodyScroll, useGlobalKeyPress } from '@equinor/eds-utils';
|
|
4
5
|
import { jsx } from 'react/jsx-runtime';
|
|
5
|
-
import { useHideBodyScroll } from '../../hooks/useHideBodyScroll.js';
|
|
6
|
-
import { useGlobalKeyPress } from '../../hooks/useGlobalKeyPress.js';
|
|
7
6
|
|
|
8
7
|
const {
|
|
9
8
|
height,
|
|
@@ -13,22 +12,24 @@ const {
|
|
|
13
12
|
const StyledScrim = styled.div.withConfig({
|
|
14
13
|
displayName: "Scrim__StyledScrim",
|
|
15
14
|
componentId: "sc-1fr7uvy-0"
|
|
16
|
-
})(["width:", ";height:", ";background:", ";position:fixed;z-index:
|
|
15
|
+
})(["width:", ";height:", ";background:", ";position:fixed;z-index:1300;top:0;left:0;align-items:center;justify-content:center;display:flex;"], width, height, background);
|
|
17
16
|
const ScrimContent = styled.div.withConfig({
|
|
18
17
|
displayName: "Scrim__ScrimContent",
|
|
19
18
|
componentId: "sc-1fr7uvy-1"
|
|
20
19
|
})(["width:auto;height:auto;"]);
|
|
21
|
-
const Scrim = /*#__PURE__*/forwardRef(function Scrim({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
const Scrim = /*#__PURE__*/forwardRef(function Scrim(_ref, ref) {
|
|
21
|
+
let {
|
|
22
|
+
children,
|
|
23
|
+
onClose,
|
|
24
|
+
open,
|
|
25
|
+
isDismissable = false,
|
|
26
|
+
...rest
|
|
27
|
+
} = _ref;
|
|
28
|
+
const scrimRef = useRef(null);
|
|
29
|
+
const combinedScrimRef = useCombinedRefs(scrimRef, ref);
|
|
28
30
|
const props = { ...rest,
|
|
29
31
|
open,
|
|
30
|
-
isDismissable
|
|
31
|
-
ref
|
|
32
|
+
isDismissable
|
|
32
33
|
};
|
|
33
34
|
useHideBodyScroll(open);
|
|
34
35
|
useGlobalKeyPress('Escape', () => {
|
|
@@ -38,27 +39,22 @@ const Scrim = /*#__PURE__*/forwardRef(function Scrim({
|
|
|
38
39
|
});
|
|
39
40
|
|
|
40
41
|
const handleMouseClose = event => {
|
|
41
|
-
if (event) {
|
|
42
|
+
if (event && event.target === scrimRef.current) {
|
|
42
43
|
if (event.type === 'click' && isDismissable && open) {
|
|
43
44
|
onClose && onClose();
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
};
|
|
47
48
|
|
|
48
|
-
const handleContentClick = event => {
|
|
49
|
-
// Avoid event bubbling inside dialog/content inside scrim
|
|
50
|
-
event.stopPropagation();
|
|
51
|
-
};
|
|
52
|
-
|
|
53
49
|
if (!open) {
|
|
54
50
|
return null;
|
|
55
51
|
}
|
|
56
52
|
|
|
57
53
|
return /*#__PURE__*/jsx(StyledScrim, {
|
|
58
54
|
onClick: handleMouseClose,
|
|
55
|
+
ref: combinedScrimRef,
|
|
59
56
|
...props,
|
|
60
57
|
children: /*#__PURE__*/jsx(ScrimContent, {
|
|
61
|
-
onClick: handleContentClick,
|
|
62
58
|
children: children
|
|
63
59
|
})
|
|
64
60
|
});
|