@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.
Files changed (193) hide show
  1. package/dist/eds-core-react.cjs.js +2276 -1930
  2. package/dist/esm/components/Accordion/Accordion.js +9 -9
  3. package/dist/esm/components/Accordion/Accordion.tokens.js +6 -1
  4. package/dist/esm/components/Accordion/AccordionHeader.js +61 -49
  5. package/dist/esm/components/Accordion/AccordionHeaderTitle.js +12 -10
  6. package/dist/esm/components/Accordion/AccordionItem.js +11 -10
  7. package/dist/esm/components/Accordion/AccordionPanel.js +22 -18
  8. package/dist/esm/components/Avatar/Avatar.js +21 -14
  9. package/dist/esm/components/Banner/Banner.js +12 -11
  10. package/dist/esm/components/Banner/BannerActions.js +11 -9
  11. package/dist/esm/components/Banner/BannerIcon.js +12 -10
  12. package/dist/esm/components/Banner/BannerMessage.js +5 -4
  13. package/dist/esm/components/Breadcrumbs/Breadcrumb.js +16 -12
  14. package/dist/esm/components/Breadcrumbs/Breadcrumbs.js +7 -6
  15. package/dist/esm/components/Button/Button.js +16 -17
  16. package/dist/esm/components/Button/InnerFullWidth.js +4 -3
  17. package/dist/esm/components/Button/tokens/button.js +1 -1
  18. package/dist/esm/components/Button/tokens/contained.js +5 -5
  19. package/dist/esm/components/Button/tokens/ghost.js +4 -4
  20. package/dist/esm/components/Button/tokens/icon.js +11 -6
  21. package/dist/esm/components/Button/tokens/outlined.js +5 -5
  22. package/dist/esm/components/Card/Card.js +19 -12
  23. package/dist/esm/components/Card/CardActions.js +13 -9
  24. package/dist/esm/components/Card/CardContent.js +5 -4
  25. package/dist/esm/components/Card/CardHeader.js +5 -4
  26. package/dist/esm/components/Card/CardHeaderTitle.js +5 -4
  27. package/dist/esm/components/Card/CardMedia.js +12 -8
  28. package/dist/esm/components/Checkbox/Checkbox.js +15 -11
  29. package/dist/esm/components/Checkbox/Checkbox.tokens.js +9 -4
  30. package/dist/esm/components/Checkbox/Input.js +72 -46
  31. package/dist/esm/components/Chip/Chip.js +46 -30
  32. package/dist/esm/components/Chip/Chip.tokens.js +7 -2
  33. package/dist/esm/components/Chip/Icon.js +12 -7
  34. package/dist/esm/components/Dialog/Dialog.js +44 -20
  35. package/dist/esm/components/Dialog/Dialog.tokens.js +4 -12
  36. package/dist/esm/components/Dialog/DialogActions.js +27 -0
  37. package/dist/esm/components/Dialog/DialogContent.js +44 -0
  38. package/dist/esm/components/Dialog/DialogHeader.js +37 -0
  39. package/dist/esm/components/Dialog/DialogTitle.js +31 -0
  40. package/dist/esm/components/Dialog/index.js +11 -7
  41. package/dist/esm/components/Divider/Divider.js +6 -5
  42. package/dist/esm/components/EdsProvider/eds.context.js +5 -4
  43. package/dist/esm/components/Icon/Icon.js +77 -46
  44. package/dist/esm/components/Input/Input.js +12 -12
  45. package/dist/esm/components/Input/Input.tokens.js +4 -4
  46. package/dist/esm/components/Label/Label.js +7 -4
  47. package/dist/esm/components/List/List.js +13 -9
  48. package/dist/esm/components/List/ListItem.js +5 -4
  49. package/dist/esm/components/Menu/Menu.context.js +16 -4
  50. package/dist/esm/components/Menu/Menu.js +71 -30
  51. package/dist/esm/components/Menu/MenuItem.js +38 -25
  52. package/dist/esm/components/Menu/MenuList.js +18 -11
  53. package/dist/esm/components/Menu/MenuSection.js +1 -1
  54. package/dist/esm/components/Pagination/Pagination.js +16 -12
  55. package/dist/esm/components/Pagination/PaginationItem.js +7 -6
  56. package/dist/esm/components/Paper/Paper.js +11 -7
  57. package/dist/esm/components/Popover/Popover.js +43 -50
  58. package/dist/esm/components/Popover/Popover.tokens.js +2 -12
  59. package/dist/esm/components/Popover/PopoverActions.js +28 -0
  60. package/dist/esm/components/Popover/PopoverContent.js +12 -6
  61. package/dist/esm/components/Popover/PopoverHeader.js +36 -0
  62. package/dist/esm/components/Popover/PopoverTitle.js +13 -24
  63. package/dist/esm/components/Popover/index.js +6 -0
  64. package/dist/esm/components/Progress/Circular/CircularProgress.js +14 -10
  65. package/dist/esm/components/Progress/Dots/DotProgress.js +12 -8
  66. package/dist/esm/components/Progress/Linear/LinearProgress.js +6 -5
  67. package/dist/esm/components/Progress/Star/StarProgress.js +14 -10
  68. package/dist/esm/components/Radio/Radio.js +84 -52
  69. package/dist/esm/components/Radio/Radio.tokens.js +9 -4
  70. package/dist/esm/components/Scrim/Scrim.js +16 -20
  71. package/dist/esm/components/Search/Search.js +28 -28
  72. package/dist/esm/components/Select/MultiSelect/MultiSelect.js +27 -22
  73. package/dist/esm/components/Select/NativeSelect/NativeSelect.js +19 -17
  74. package/dist/esm/components/Select/Select.tokens.js +2 -2
  75. package/dist/esm/components/Select/SingleSelect/SingleSelect.js +29 -23
  76. package/dist/esm/components/Select/commonStyles.js +14 -13
  77. package/dist/esm/components/SideSheet/SideSheet.js +16 -13
  78. package/dist/esm/components/Slider/MinMax.js +5 -4
  79. package/dist/esm/components/Slider/Output.js +13 -9
  80. package/dist/esm/components/Slider/Slider.js +81 -38
  81. package/dist/esm/components/Slider/Slider.tokens.js +7 -2
  82. package/dist/esm/components/Slider/SliderInput.js +14 -14
  83. package/dist/esm/components/Snackbar/Snackbar.js +17 -21
  84. package/dist/esm/components/Snackbar/SnackbarAction.js +9 -7
  85. package/dist/esm/components/Switch/Switch.js +21 -15
  86. package/dist/esm/components/Switch/Switch.styles.js +24 -17
  87. package/dist/esm/components/Switch/Switch.tokens.js +6 -1
  88. package/dist/esm/components/Switch/SwitchDefault.js +39 -29
  89. package/dist/esm/components/Switch/SwitchSmall.js +38 -28
  90. package/dist/esm/components/Table/Body.js +5 -4
  91. package/dist/esm/components/Table/Caption.js +8 -5
  92. package/dist/esm/components/Table/Cell.js +9 -6
  93. package/dist/esm/components/Table/DataCell/DataCell.js +12 -12
  94. package/dist/esm/components/Table/DataCell/DataCell.tokens.js +2 -2
  95. package/dist/esm/components/Table/Head/Head.js +7 -6
  96. package/dist/esm/components/Table/HeaderCell/HeaderCell.js +7 -8
  97. package/dist/esm/components/Table/Row/Row.js +7 -5
  98. package/dist/esm/components/Table/Table.js +5 -4
  99. package/dist/esm/components/TableOfContents/LinkItem.js +10 -10
  100. package/dist/esm/components/TableOfContents/TableOfContents.js +17 -15
  101. package/dist/esm/components/Tabs/Tab.js +21 -19
  102. package/dist/esm/components/Tabs/TabList.js +27 -11
  103. package/dist/esm/components/Tabs/TabPanel.js +8 -7
  104. package/dist/esm/components/Tabs/TabPanels.js +5 -4
  105. package/dist/esm/components/Tabs/Tabs.context.js +1 -0
  106. package/dist/esm/components/Tabs/Tabs.js +45 -15
  107. package/dist/esm/components/Tabs/Tabs.tokens.js +8 -2
  108. package/dist/esm/components/TextField/Field.js +49 -38
  109. package/dist/esm/components/TextField/HelperText/HelperText.js +28 -19
  110. package/dist/esm/components/TextField/Icon/Icon.js +20 -18
  111. package/dist/esm/components/TextField/TextField.context.js +4 -3
  112. package/dist/esm/components/TextField/TextField.js +19 -19
  113. package/dist/esm/components/Textarea/Textarea.js +16 -16
  114. package/dist/esm/components/Tooltip/Tooltip.js +23 -24
  115. package/dist/esm/components/TopBar/Actions.js +5 -4
  116. package/dist/esm/components/TopBar/CustomContent.js +5 -4
  117. package/dist/esm/components/TopBar/Header.js +5 -4
  118. package/dist/esm/components/TopBar/TopBar.js +11 -11
  119. package/dist/esm/components/Typography/Typography.js +49 -28
  120. package/dist/esm/components/Typography/Typography.tokens.js +7 -2
  121. package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/internal/_curry1.js +1 -1
  122. package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/internal/_curry2.js +1 -1
  123. package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/internal/_curry3.js +1 -1
  124. package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/internal/_has.js +1 -1
  125. package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/internal/_isObject.js +1 -1
  126. package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/internal/_isPlaceholder.js +1 -1
  127. package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/mergeDeepRight.js +2 -1
  128. package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/mergeDeepWithKey.js +1 -1
  129. package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/mergeWithKey.js +1 -1
  130. package/dist/types/components/Accordion/AccordionHeader.d.ts +2 -2
  131. package/dist/types/components/Checkbox/Checkbox.d.ts +1 -1
  132. package/dist/types/components/Checkbox/Input.d.ts +1 -1
  133. package/dist/types/components/Dialog/Dialog.d.ts +18 -2
  134. package/dist/types/components/Dialog/DialogActions.d.ts +3 -0
  135. package/dist/types/components/Dialog/{CustomContent.d.ts → DialogContent.d.ts} +2 -2
  136. package/dist/types/components/Dialog/DialogHeader.d.ts +3 -0
  137. package/dist/types/components/Dialog/DialogTitle.d.ts +3 -0
  138. package/dist/types/components/Dialog/index.d.ts +10 -7
  139. package/dist/types/components/Icon/Icon.d.ts +2 -2
  140. package/dist/types/components/Menu/Menu.context.d.ts +3 -0
  141. package/dist/types/components/Menu/Menu.d.ts +1 -6
  142. package/dist/types/components/Menu/MenuList.d.ts +0 -2
  143. package/dist/types/components/Popover/Popover.d.ts +1 -1
  144. package/dist/types/components/Popover/PopoverActions.d.ts +3 -0
  145. package/dist/types/components/Popover/PopoverHeader.d.ts +3 -0
  146. package/dist/types/components/Popover/index.d.ts +5 -1
  147. package/dist/types/components/Progress/Circular/CircularProgress.d.ts +1 -1
  148. package/dist/types/components/Progress/Dots/DotProgress.d.ts +1 -1
  149. package/dist/types/components/Progress/Star/StarProgress.d.ts +1 -1
  150. package/dist/types/components/Switch/Switch.d.ts +1 -1
  151. package/dist/types/components/Switch/Switch.styles.d.ts +2 -1
  152. package/dist/types/components/Tabs/TabList.d.ts +4 -0
  153. package/dist/types/components/Tabs/Tabs.context.d.ts +1 -0
  154. package/dist/types/components/Tabs/Tabs.d.ts +4 -0
  155. package/dist/types/components/Tooltip/Tooltip.d.ts +1 -1
  156. package/package.json +37 -38
  157. package/dist/esm/components/Dialog/Actions.js +0 -26
  158. package/dist/esm/components/Dialog/CustomContent.js +0 -46
  159. package/dist/esm/components/Dialog/Title.js +0 -41
  160. package/dist/esm/hooks/useAutoResize.js +0 -39
  161. package/dist/esm/hooks/useCombinedRefs.js +0 -14
  162. package/dist/esm/hooks/useGlobalKeyPress.js +0 -34
  163. package/dist/esm/hooks/useHideBodyScroll.js +0 -20
  164. package/dist/esm/hooks/useId.js +0 -14
  165. package/dist/esm/hooks/useMountedRef.js +0 -12
  166. package/dist/esm/hooks/useOutsideClick.js +0 -18
  167. package/dist/esm/hooks/usePopper.js +0 -31
  168. package/dist/esm/hooks/useToken.js +0 -16
  169. package/dist/esm/utils/joinHandlers.js +0 -10
  170. package/dist/esm/utils/setReactInputValue.js +0 -18
  171. package/dist/esm/utils/templates/borders.js +0 -35
  172. package/dist/esm/utils/templates/common.js +0 -19
  173. package/dist/esm/utils/templates/focus.js +0 -35
  174. package/dist/esm/utils/templates/index.js +0 -52
  175. package/dist/types/components/Dialog/Actions.d.ts +0 -3
  176. package/dist/types/components/Dialog/Title.d.ts +0 -3
  177. package/dist/types/hooks/index.d.ts +0 -9
  178. package/dist/types/hooks/useAutoResize.d.ts +0 -1
  179. package/dist/types/hooks/useCombinedRefs.d.ts +0 -3
  180. package/dist/types/hooks/useGlobalKeyPress.d.ts +0 -10
  181. package/dist/types/hooks/useHideBodyScroll.d.ts +0 -1
  182. package/dist/types/hooks/useId.d.ts +0 -1
  183. package/dist/types/hooks/useMountedRef.d.ts +0 -1
  184. package/dist/types/hooks/useOutsideClick.d.ts +0 -1
  185. package/dist/types/hooks/usePopper.d.ts +0 -12
  186. package/dist/types/hooks/useToken.d.ts +0 -7
  187. package/dist/types/utils/index.d.ts +0 -4
  188. package/dist/types/utils/joinHandlers.d.ts +0 -3
  189. package/dist/types/utils/setReactInputValue.d.ts +0 -7
  190. package/dist/types/utils/templates/borders.d.ts +0 -2
  191. package/dist/types/utils/templates/common.d.ts +0 -9
  192. package/dist/types/utils/templates/focus.d.ts +0 -2
  193. package/dist/types/utils/templates/index.d.ts +0 -7
@@ -92,7 +92,7 @@ const button = {
92
92
  focus: {
93
93
  outline: {
94
94
  type: 'outline',
95
- offset: '2px',
95
+ offset: '3px',
96
96
  style: 'dashed',
97
97
  color: outline.color,
98
98
  width: outline.width
@@ -1,6 +1,6 @@
1
1
  import { tokens } from '@equinor/eds-tokens';
2
2
  import { button } from './button.js';
3
- import mergeDeepRight_1 from '../../../node_modules/.pnpm/ramda@0.27.1/node_modules/ramda/src/mergeDeepRight.js';
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 = mergeDeepRight_1(button, {
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 = mergeDeepRight_1(primary, {
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 = mergeDeepRight_1(primary, {
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 mergeDeepRight_1 from '../../../node_modules/.pnpm/ramda@0.27.1/node_modules/ramda/src/mergeDeepRight.js';
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 = mergeDeepRight_1(button, {
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 = mergeDeepRight_1(primary, {
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 = mergeDeepRight_1(primary, {
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 mergeDeepRight_1 from '../../../node_modules/.pnpm/ramda@0.27.1/node_modules/ramda/src/mergeDeepRight.js';
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 = mergeDeepRight_1(button, {
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: '0px'
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 = mergeDeepRight_1(primary, {
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 = mergeDeepRight_1(primary, {
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 mergeDeepRight_1 from '../../../node_modules/.pnpm/ramda@0.27.1/node_modules/ramda/src/mergeDeepRight.js';
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 = mergeDeepRight_1(button, {
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 = mergeDeepRight_1(primary, {
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 = mergeDeepRight_1(primary, {
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
- background
15
- }) => background, ({
16
- cursor
17
- }) => cursor, bordersTemplate(primary.border));
18
- const Card = /*#__PURE__*/forwardRef(function Card({
19
- children,
20
- variant = 'default',
21
- onClick,
22
- ...rest
23
- }, ref) {
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
- justifyContent
15
- }) => justifyContent, spacings.right, spacings.left, spacings.top, spacings.bottom);
16
- const CardActions = /*#__PURE__*/forwardRef(function CardActions({
17
- children,
18
- alignRight = false,
19
- meta = '',
20
- ...rest
21
- }, ref) {
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
- children,
15
- ...props
16
- }, ref) {
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
- children,
15
- ...rest
16
- }, ref) {
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
- children,
11
- ...rest
12
- }, ref) {
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
- fullWidth
15
- }) => 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));
16
- const CardMedia = /*#__PURE__*/forwardRef(function CardMedia({
17
- children,
18
- fullWidth = false,
19
- ...rest
20
- }, ref) {
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
- disabled
14
- }) => disabled ? 'not-allowed' : 'pointer');
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
- label,
21
- disabled = false,
22
- indeterminate,
23
- className,
24
- ...rest
25
- }, ref) {
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: '1px',
64
+ width: focusOutlineWidth,
60
65
  color: focusOutlineColor,
61
- offset: '11px'
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: '1px',
86
+ width: focusOutlineWidth,
82
87
  color: focusOutlineColor,
83
- offset: '3px'
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
- icon
14
- }) => ({
15
- fillRule: 'evenodd',
16
- clipRule: 'evenodd',
17
- d: icon.svgPathData
18
- })).withConfig({
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
- type = 'checkbox'
24
- }) => ({
25
- type
26
- })).withConfig({
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
- theme,
31
- iconSize
32
- }) => parseFloat(theme.clickbound.height) / iconSize, ({
33
- disabled
34
- }) => disabled ? 'not-allowed' : 'pointer', ({
35
- theme
36
- }) => outlineTemplate(theme.states.focus.outline), ({
37
- theme
38
- }) => outlineTemplate(theme.states.focus.outline));
39
- const Svg = styled.svg.attrs(({
40
- height,
41
- width,
42
- fill
43
- }) => ({
44
- name: null,
45
- xmlns: 'http://www.w3.org/2000/svg',
46
- height,
47
- width,
48
- fill
49
- })).withConfig({
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
- theme
58
- }) => spacingsTemplate(theme.spacings), ({
59
- disabled
60
- }) => disabled ? 'transparent' : checkbox.states.hover.background);
61
- const CheckboxInput = /*#__PURE__*/forwardRef(function CheckboxInput({
62
- disabled = false,
63
- indeterminate,
64
- ...rest
65
- }, ref) {
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
- clickable,
24
- deletable
25
- }) => ({
26
- tabIndex: clickable || deletable ? 0 : null,
27
- role: clickable ? 'button' : null
28
- })).withConfig({
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;z-index:10;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), ({
32
- clickable
33
- }) => clickable && css(["@media (hover:hover) and (pointer:fine){&:hover{cursor:pointer;}}"]), ({
34
- variant
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
- disabled
48
- }) => 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), ({
49
- deletable
50
- }) => deletable && css(["padding-right:4px;"]), ({
51
- onlyChild
52
- }) => onlyChild ? css(["padding-left:8px;"]) : '');
53
- const Chip = /*#__PURE__*/forwardRef(function Chip({
54
- children,
55
- onDelete,
56
- disabled = false,
57
- onClick,
58
- variant = 'default',
59
- ...other
60
- }, ref) {
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;