@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
|
@@ -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 {
|
|
@@ -35,9 +35,14 @@ const {
|
|
|
35
35
|
default__base: clicboundHeight,
|
|
36
36
|
compact__standard: compactClickboundHeight
|
|
37
37
|
},
|
|
38
|
-
shape
|
|
38
|
+
shape,
|
|
39
|
+
interactions: {
|
|
40
|
+
focused: {
|
|
41
|
+
width: focusOutlineWidth
|
|
42
|
+
}
|
|
43
|
+
}
|
|
39
44
|
} = tokens;
|
|
40
|
-
const primary =
|
|
45
|
+
const primary = mergeDeepRight(button, {
|
|
41
46
|
height: shape.icon_button.minHeight,
|
|
42
47
|
width: shape.icon_button.minWidth,
|
|
43
48
|
typography: {
|
|
@@ -75,7 +80,7 @@ const primary = mergeDeepRight_1(button, {
|
|
|
75
80
|
},
|
|
76
81
|
focus: {
|
|
77
82
|
outline: {
|
|
78
|
-
offset:
|
|
83
|
+
offset: "-".concat(parseInt(focusOutlineWidth), "px")
|
|
79
84
|
}
|
|
80
85
|
}
|
|
81
86
|
},
|
|
@@ -93,7 +98,7 @@ const primary = mergeDeepRight_1(button, {
|
|
|
93
98
|
}
|
|
94
99
|
}
|
|
95
100
|
});
|
|
96
|
-
const secondary =
|
|
101
|
+
const secondary = mergeDeepRight(primary, {
|
|
97
102
|
typography: {
|
|
98
103
|
color: secondaryColor
|
|
99
104
|
},
|
|
@@ -106,7 +111,7 @@ const secondary = mergeDeepRight_1(primary, {
|
|
|
106
111
|
}
|
|
107
112
|
}
|
|
108
113
|
});
|
|
109
|
-
const danger =
|
|
114
|
+
const danger = mergeDeepRight(primary, {
|
|
110
115
|
typography: {
|
|
111
116
|
color: dangerColor
|
|
112
117
|
},
|
|
@@ -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,
|
|
@@ -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 checkbox = {
|
|
@@ -56,9 +61,9 @@ const checkbox = {
|
|
|
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 checkbox = {
|
|
|
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
|
}
|
|
@@ -2,67 +2,93 @@ import { forwardRef } from 'react';
|
|
|
2
2
|
import styled, { ThemeProvider } from 'styled-components';
|
|
3
3
|
import { checkbox_indeterminate, checkbox as checkbox$1, checkbox_outline } from '@equinor/eds-icons';
|
|
4
4
|
import { checkbox } from './Checkbox.tokens.js';
|
|
5
|
+
import { outlineTemplate, spacingsTemplate, useToken } from '@equinor/eds-utils';
|
|
5
6
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
-
import { outlineTemplate } from '../../utils/templates/focus.js';
|
|
7
|
-
import { 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 StyledPath = styled.path.attrs(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
const StyledPath = styled.path.attrs(_ref => {
|
|
11
|
+
let {
|
|
12
|
+
icon
|
|
13
|
+
} = _ref;
|
|
14
|
+
return {
|
|
15
|
+
fillRule: 'evenodd',
|
|
16
|
+
clipRule: 'evenodd',
|
|
17
|
+
d: icon.svgPathData
|
|
18
|
+
};
|
|
19
|
+
}).withConfig({
|
|
19
20
|
displayName: "Input__StyledPath",
|
|
20
21
|
componentId: "sc-rqj7qf-0"
|
|
21
22
|
})([""]);
|
|
22
|
-
const Input = styled.input.attrs(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
const Input = styled.input.attrs(_ref2 => {
|
|
24
|
+
let {
|
|
25
|
+
type = 'checkbox'
|
|
26
|
+
} = _ref2;
|
|
27
|
+
return {
|
|
28
|
+
type
|
|
29
|
+
};
|
|
30
|
+
}).withConfig({
|
|
27
31
|
displayName: "Input",
|
|
28
32
|
componentId: "sc-rqj7qf-1"
|
|
29
|
-
})(["--scale:", ";appearance:none;width:100%;height:100%;margin:0;grid-area:input;transform:scale(var(--scale));cursor:", ";&:focus{outline:none;}&[data-focus-visible-added]:focus + svg{", "}&:focus-visible + svg{", "}&:not(:checked) ~ svg path[name='checked']{display:none;}&:not(:checked) ~ svg path[name='not-checked']{display:inline;}&:checked ~ svg path[name='not-checked']{display:none;}&:checked ~ svg path[name='checked']{display:inline;}"],
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
33
|
+
})(["--scale:", ";appearance:none;width:100%;height:100%;margin:0;grid-area:input;transform:scale(var(--scale));cursor:", ";&:focus{outline:none;}&[data-focus-visible-added]:focus + svg{", "}&:focus-visible + svg{", "}&:not(:checked) ~ svg path[name='checked']{display:none;}&:not(:checked) ~ svg path[name='not-checked']{display:inline;}&:checked ~ svg path[name='not-checked']{display:none;}&:checked ~ svg path[name='checked']{display:inline;}"], _ref3 => {
|
|
34
|
+
let {
|
|
35
|
+
theme,
|
|
36
|
+
iconSize
|
|
37
|
+
} = _ref3;
|
|
38
|
+
return parseFloat(theme.clickbound.height) / iconSize;
|
|
39
|
+
}, _ref4 => {
|
|
40
|
+
let {
|
|
41
|
+
disabled
|
|
42
|
+
} = _ref4;
|
|
43
|
+
return disabled ? 'not-allowed' : 'pointer';
|
|
44
|
+
}, _ref5 => {
|
|
45
|
+
let {
|
|
46
|
+
theme
|
|
47
|
+
} = _ref5;
|
|
48
|
+
return outlineTemplate(theme.states.focus.outline);
|
|
49
|
+
}, _ref6 => {
|
|
50
|
+
let {
|
|
51
|
+
theme
|
|
52
|
+
} = _ref6;
|
|
53
|
+
return outlineTemplate(theme.states.focus.outline);
|
|
54
|
+
});
|
|
55
|
+
const Svg = styled.svg.attrs(_ref7 => {
|
|
56
|
+
let {
|
|
57
|
+
height,
|
|
58
|
+
width,
|
|
59
|
+
fill
|
|
60
|
+
} = _ref7;
|
|
61
|
+
return {
|
|
62
|
+
name: null,
|
|
63
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
64
|
+
height,
|
|
65
|
+
width,
|
|
66
|
+
fill
|
|
67
|
+
};
|
|
68
|
+
}).withConfig({
|
|
50
69
|
displayName: "Input__Svg",
|
|
51
70
|
componentId: "sc-rqj7qf-2"
|
|
52
71
|
})(["grid-area:input;pointer-events:none;"]);
|
|
53
72
|
const InputWrapper = styled.span.withConfig({
|
|
54
73
|
displayName: "Input__InputWrapper",
|
|
55
74
|
componentId: "sc-rqj7qf-3"
|
|
56
|
-
})(["display:inline-grid;grid:[input] 1fr / [input] 1fr;border-radius:50%;", " @media (hover:hover) and (pointer:fine){&:hover{background-color:", ";}}"],
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
75
|
+
})(["display:inline-grid;grid:[input] 1fr / [input] 1fr;border-radius:50%;", " @media (hover:hover) and (pointer:fine){&:hover{background-color:", ";}}"], _ref8 => {
|
|
76
|
+
let {
|
|
77
|
+
theme
|
|
78
|
+
} = _ref8;
|
|
79
|
+
return spacingsTemplate(theme.spacings);
|
|
80
|
+
}, _ref9 => {
|
|
81
|
+
let {
|
|
82
|
+
disabled
|
|
83
|
+
} = _ref9;
|
|
84
|
+
return disabled ? 'transparent' : checkbox.states.hover.background;
|
|
85
|
+
});
|
|
86
|
+
const CheckboxInput = /*#__PURE__*/forwardRef(function CheckboxInput(_ref10, ref) {
|
|
87
|
+
let {
|
|
88
|
+
disabled = false,
|
|
89
|
+
indeterminate,
|
|
90
|
+
...rest
|
|
91
|
+
} = _ref10;
|
|
66
92
|
const {
|
|
67
93
|
density
|
|
68
94
|
} = useEds();
|
|
@@ -2,10 +2,8 @@ import { forwardRef, Children, cloneElement } from 'react';
|
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
3
|
import { Icon } from './Icon.js';
|
|
4
4
|
import * as Chip_tokens from './Chip.tokens.js';
|
|
5
|
+
import { outlineTemplate, bordersTemplate, spacingsTemplate, typographyTemplate } from '@equinor/eds-utils';
|
|
5
6
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
|
-
import { outlineTemplate } from '../../utils/templates/focus.js';
|
|
7
|
-
import { bordersTemplate } from '../../utils/templates/borders.js';
|
|
8
|
-
import { spacingsTemplate, typographyTemplate } from '../../utils/templates/index.js';
|
|
9
7
|
|
|
10
8
|
const {
|
|
11
9
|
enabled,
|
|
@@ -19,20 +17,28 @@ const {
|
|
|
19
17
|
border,
|
|
20
18
|
states
|
|
21
19
|
} = enabled;
|
|
22
|
-
const StyledChips = styled.div.attrs(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
const StyledChips = styled.div.attrs(_ref => {
|
|
21
|
+
let {
|
|
22
|
+
clickable,
|
|
23
|
+
deletable
|
|
24
|
+
} = _ref;
|
|
25
|
+
return {
|
|
26
|
+
tabIndex: clickable || deletable ? 0 : null,
|
|
27
|
+
role: clickable ? 'button' : null
|
|
28
|
+
};
|
|
29
|
+
}).withConfig({
|
|
29
30
|
displayName: "Chip__StyledChips",
|
|
30
31
|
componentId: "sc-wzsllq-0"
|
|
31
|
-
})(["background:", ";height:", ";width:fit-content;display:grid;grid-gap:8px;grid-auto-flow:column;grid-auto-columns:max-content;align-items:center;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
})(["background:", ";height:", ";width:fit-content;display:grid;grid-gap:8px;grid-auto-flow:column;grid-auto-columns:max-content;align-items:center;svg{fill:", ";}@media (hover:hover) and (pointer:fine){&:hover{color:", ";svg{fill:", ";}}}&:focus{outline:none;}&[data-focus-visible-added]:focus{", "}&:focus-visible{", "}", " ", " ", " ", " ", " ", " ", " ", ""], background, height, typography.color, states.hover.typography.color, states.hover.typography.color, outlineTemplate(states.focus.outline), outlineTemplate(states.focus.outline), bordersTemplate(border), spacingsTemplate(spacings), typographyTemplate(typography), _ref2 => {
|
|
33
|
+
let {
|
|
34
|
+
clickable
|
|
35
|
+
} = _ref2;
|
|
36
|
+
return clickable && css(["@media (hover:hover) and (pointer:fine){&:hover{cursor:pointer;}}"]);
|
|
37
|
+
}, _ref3 => {
|
|
38
|
+
let {
|
|
39
|
+
variant
|
|
40
|
+
} = _ref3;
|
|
41
|
+
|
|
36
42
|
switch (variant) {
|
|
37
43
|
case 'active':
|
|
38
44
|
return css(["background:", ";"], states.active.background);
|
|
@@ -43,21 +49,31 @@ const StyledChips = styled.div.attrs(({
|
|
|
43
49
|
default:
|
|
44
50
|
return '';
|
|
45
51
|
}
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
52
|
+
}, _ref4 => {
|
|
53
|
+
let {
|
|
54
|
+
disabled
|
|
55
|
+
} = _ref4;
|
|
56
|
+
return disabled && css(["cursor:not-allowed;background:", ";color:", ";svg{fill:", ";}@media (hover:hover) and (pointer:fine){&:hover{color:", ";cursor:not-allowed;svg{fill:", ";}}}"], background, states.disabled.typography.color, states.disabled.typography.color, states.disabled.typography.color, states.disabled.typography.color);
|
|
57
|
+
}, _ref5 => {
|
|
58
|
+
let {
|
|
59
|
+
deletable
|
|
60
|
+
} = _ref5;
|
|
61
|
+
return deletable && css(["padding-right:4px;"]);
|
|
62
|
+
}, _ref6 => {
|
|
63
|
+
let {
|
|
64
|
+
onlyChild
|
|
65
|
+
} = _ref6;
|
|
66
|
+
return onlyChild ? css(["padding-left:8px;"]) : '';
|
|
67
|
+
});
|
|
68
|
+
const Chip = /*#__PURE__*/forwardRef(function Chip(_ref7, ref) {
|
|
69
|
+
let {
|
|
70
|
+
children,
|
|
71
|
+
onDelete,
|
|
72
|
+
disabled = false,
|
|
73
|
+
onClick,
|
|
74
|
+
variant = 'default',
|
|
75
|
+
...other
|
|
76
|
+
} = _ref7;
|
|
61
77
|
const handleDelete = disabled ? undefined : onDelete;
|
|
62
78
|
const handleClick = disabled ? undefined : onClick;
|
|
63
79
|
const deletable = handleDelete !== undefined;
|