@equinor/eds-core-react 0.16.1-dev.12072021 → 0.18.0-dev.20220210

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/README.md +1 -1
  2. package/dist/{core-react.cjs.js → eds-core-react.cjs.js} +2731 -2290
  3. package/dist/esm/components/Accordion/Accordion.js +24 -11
  4. package/dist/esm/components/Accordion/Accordion.tokens.js +3 -0
  5. package/dist/esm/components/Accordion/AccordionHeader.js +65 -51
  6. package/dist/esm/components/Accordion/AccordionHeaderTitle.js +15 -13
  7. package/dist/esm/components/Accordion/AccordionItem.js +11 -10
  8. package/dist/esm/components/Accordion/AccordionPanel.js +32 -24
  9. package/dist/esm/components/Avatar/Avatar.js +21 -14
  10. package/dist/esm/components/Banner/Banner.js +36 -24
  11. package/dist/esm/components/Banner/Banner.tokens.js +9 -0
  12. package/dist/esm/components/Banner/BannerActions.js +16 -17
  13. package/dist/esm/components/Banner/BannerIcon.js +15 -11
  14. package/dist/esm/components/Banner/BannerMessage.js +5 -4
  15. package/dist/esm/components/Breadcrumbs/Breadcrumb.js +16 -12
  16. package/dist/esm/components/Breadcrumbs/Breadcrumbs.js +7 -6
  17. package/dist/esm/components/Button/Button.js +17 -18
  18. package/dist/esm/components/Button/InnerFullWidth.js +5 -4
  19. package/dist/esm/components/Button/tokens/button.js +17 -10
  20. package/dist/esm/components/Button/tokens/contained.js +5 -5
  21. package/dist/esm/components/Button/tokens/ghost.js +4 -4
  22. package/dist/esm/components/Button/tokens/icon.js +4 -4
  23. package/dist/esm/components/Button/tokens/outlined.js +5 -5
  24. package/dist/esm/components/Card/Card.js +19 -12
  25. package/dist/esm/components/Card/CardActions.js +13 -9
  26. package/dist/esm/components/Card/CardContent.js +5 -4
  27. package/dist/esm/components/Card/CardHeader.js +5 -4
  28. package/dist/esm/components/Card/CardHeaderTitle.js +5 -4
  29. package/dist/esm/components/Card/CardMedia.js +12 -8
  30. package/dist/esm/components/Checkbox/Checkbox.js +15 -11
  31. package/dist/esm/components/Checkbox/Input.js +72 -46
  32. package/dist/esm/components/Chip/Chip.js +46 -30
  33. package/dist/esm/components/Chip/Icon.js +12 -7
  34. package/dist/esm/components/Dialog/Dialog.js +55 -16
  35. package/dist/esm/components/Dialog/Dialog.tokens.js +7 -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 +5 -4
  50. package/dist/esm/components/Menu/Menu.js +39 -30
  51. package/dist/esm/components/Menu/MenuItem.js +38 -25
  52. package/dist/esm/components/Menu/MenuList.js +7 -6
  53. package/dist/esm/components/Menu/MenuSection.js +3 -3
  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 +77 -58
  58. package/dist/esm/components/Popover/Popover.tokens.js +5 -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 +15 -19
  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/Scrim/Scrim.js +20 -15
  70. package/dist/esm/components/Search/Search.js +81 -58
  71. package/dist/esm/components/Search/Search.tokens.js +8 -4
  72. package/dist/esm/components/Select/MultiSelect/MultiSelect.js +35 -24
  73. package/dist/esm/components/Select/NativeSelect/NativeSelect.js +19 -17
  74. package/dist/esm/components/Select/Select.tokens.js +5 -2
  75. package/dist/esm/components/Select/SingleSelect/SingleSelect.js +29 -23
  76. package/dist/esm/components/Select/commonStyles.js +15 -14
  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 +63 -35
  81. package/dist/esm/components/Slider/SliderInput.js +14 -14
  82. package/dist/esm/components/Snackbar/Snackbar.js +36 -25
  83. package/dist/esm/components/Snackbar/Snackbar.tokens.js +3 -0
  84. package/dist/esm/components/Snackbar/SnackbarAction.js +12 -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/SwitchDefault.js +39 -29
  88. package/dist/esm/components/Switch/SwitchSmall.js +38 -28
  89. package/dist/esm/components/Table/Body.js +5 -4
  90. package/dist/esm/components/Table/Caption.js +8 -5
  91. package/dist/esm/components/Table/Cell.js +9 -6
  92. package/dist/esm/components/Table/DataCell/DataCell.js +15 -14
  93. package/dist/esm/components/Table/DataCell/DataCell.tokens.js +19 -9
  94. package/dist/esm/components/Table/Head/Head.js +7 -6
  95. package/dist/esm/components/Table/HeaderCell/HeaderCell.js +8 -9
  96. package/dist/esm/components/Table/HeaderCell/HeaderCell.tokens.js +18 -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 +13 -10
  100. package/dist/esm/components/TableOfContents/TableOfContents.js +44 -24
  101. package/dist/esm/components/TableOfContents/TableOfContents.tokens.js +3 -0
  102. package/dist/esm/components/Tabs/Tab.js +27 -30
  103. package/dist/esm/components/Tabs/TabList.js +12 -8
  104. package/dist/esm/components/Tabs/TabPanel.js +16 -12
  105. package/dist/esm/components/Tabs/TabPanels.js +5 -4
  106. package/dist/esm/components/Tabs/Tabs.js +37 -24
  107. package/dist/esm/components/Tabs/Tabs.tokens.js +3 -0
  108. package/dist/esm/components/TextField/Field.js +51 -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 +22 -18
  113. package/dist/esm/components/Textarea/Textarea.js +16 -16
  114. package/dist/esm/components/Tooltip/Tooltip.js +10 -16
  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 +27 -19
  119. package/dist/esm/components/TopBar/TopBar.tokens.js +5 -2
  120. package/dist/esm/components/Typography/Typography.js +49 -28
  121. package/dist/esm/index.js +1 -0
  122. package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/internal/_curry1.js +1 -1
  123. package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/internal/_curry2.js +1 -1
  124. package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/internal/_curry3.js +1 -1
  125. package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/internal/_has.js +1 -1
  126. package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/internal/_isObject.js +1 -1
  127. package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/internal/_isPlaceholder.js +1 -1
  128. package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/mergeDeepRight.js +2 -1
  129. package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/mergeDeepWithKey.js +1 -1
  130. package/dist/esm/node_modules/.pnpm/{ramda@0.27.1 → ramda@0.27.2}/node_modules/ramda/src/mergeWithKey.js +1 -1
  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/Group/Group.d.ts +3 -0
  140. package/dist/types/components/Group/Group.tokens.d.ts +4 -0
  141. package/dist/types/components/Group/index.d.ts +1 -0
  142. package/dist/types/components/Icon/Icon.d.ts +2 -2
  143. package/dist/types/components/Menu/Menu.d.ts +1 -1
  144. package/dist/types/components/Menu/MenuSection.d.ts +1 -2
  145. package/dist/types/components/Popover/Popover.d.ts +1 -1
  146. package/dist/types/components/Popover/PopoverActions.d.ts +3 -0
  147. package/dist/types/components/Popover/PopoverHeader.d.ts +3 -0
  148. package/dist/types/components/Popover/index.d.ts +5 -1
  149. package/dist/types/components/Progress/Circular/CircularProgress.d.ts +1 -1
  150. package/dist/types/components/Progress/Dots/DotProgress.d.ts +1 -1
  151. package/dist/types/components/Progress/Star/StarProgress.d.ts +1 -1
  152. package/dist/types/components/Scrim/Scrim.d.ts +7 -3
  153. package/dist/types/components/Switch/Switch.d.ts +1 -1
  154. package/dist/types/components/Switch/Switch.styles.d.ts +2 -1
  155. package/dist/types/components/Tooltip/Tooltip.d.ts +1 -1
  156. package/dist/types/components/TopBar/TopBar.tokens.d.ts +1 -1
  157. package/dist/types/index.d.ts +1 -0
  158. package/package.json +47 -39
  159. package/dist/esm/components/Dialog/Actions.js +0 -24
  160. package/dist/esm/components/Dialog/CustomContent.js +0 -40
  161. package/dist/esm/components/Dialog/Title.js +0 -35
  162. package/dist/esm/hooks/useAutoResize.js +0 -39
  163. package/dist/esm/hooks/useCombinedRefs.js +0 -14
  164. package/dist/esm/hooks/useGlobalKeyPress.js +0 -34
  165. package/dist/esm/hooks/useHideBodyScroll.js +0 -12
  166. package/dist/esm/hooks/useId.js +0 -14
  167. package/dist/esm/hooks/useMountedRef.js +0 -12
  168. package/dist/esm/hooks/useOutsideClick.js +0 -18
  169. package/dist/esm/hooks/usePopper.js +0 -31
  170. package/dist/esm/hooks/useToken.js +0 -16
  171. package/dist/esm/utils/joinHandlers.js +0 -10
  172. package/dist/esm/utils/setReactInputValue.js +0 -18
  173. package/dist/esm/utils/templates/borders.js +0 -35
  174. package/dist/esm/utils/templates/common.js +0 -19
  175. package/dist/esm/utils/templates/focus.js +0 -35
  176. package/dist/esm/utils/templates/index.js +0 -52
  177. package/dist/types/components/Combobox/Combobox.d.ts +0 -55
  178. package/dist/types/components/Combobox/Combobox.tokens.d.ts +0 -3
  179. package/dist/types/components/Combobox/index.d.ts +0 -1
  180. package/dist/types/components/Dialog/Actions.d.ts +0 -3
  181. package/dist/types/components/Dialog/Title.d.ts +0 -3
  182. package/dist/types/hooks/index.d.ts +0 -9
  183. package/dist/types/hooks/useAutoResize.d.ts +0 -1
  184. package/dist/types/hooks/useCombinedRefs.d.ts +0 -3
  185. package/dist/types/hooks/useGlobalKeyPress.d.ts +0 -10
  186. package/dist/types/hooks/useHideBodyScroll.d.ts +0 -1
  187. package/dist/types/hooks/useId.d.ts +0 -1
  188. package/dist/types/hooks/useMountedRef.d.ts +0 -1
  189. package/dist/types/hooks/useOutsideClick.d.ts +0 -1
  190. package/dist/types/hooks/usePopper.d.ts +0 -12
  191. package/dist/types/hooks/useToken.d.ts +0 -7
  192. package/dist/types/utils/index.d.ts +0 -4
  193. package/dist/types/utils/joinHandlers.d.ts +0 -3
  194. package/dist/types/utils/setReactInputValue.d.ts +0 -7
  195. package/dist/types/utils/templates/borders.d.ts +0 -2
  196. package/dist/types/utils/templates/common.d.ts +0 -9
  197. package/dist/types/utils/templates/focus.d.ts +0 -2
  198. package/dist/types/utils/templates/index.d.ts +0 -7
@@ -1,48 +1,58 @@
1
1
  import { forwardRef } from 'react';
2
2
  import styled, { css } from 'styled-components';
3
+ import { bordersTemplate } from '@equinor/eds-utils';
3
4
  import { BaseInput, GridWrapper, BaseInputWrapper } from './Switch.styles.js';
4
5
  import { jsxs, jsx } from 'react/jsx-runtime';
5
- import { bordersTemplate } from '../../utils/templates/borders.js';
6
6
 
7
7
  const Input = styled(BaseInput).withConfig({
8
8
  displayName: "SwitchDefault__Input",
9
9
  componentId: "sc-16ym5pn-0"
10
- })(({
11
- disabled,
12
- theme
13
- }) => css(["&:checked + span > span{background-color:", ";}&:checked + span > span:last-child{transform:translate(105%,-50%);background-color:", ";}&:hover + span{background-color:", ";}&:hover + span > span:last-child{background-color:", ";}"], disabled ? theme.states.disabled.background : theme.entities.track.states.active.background, disabled ? theme.states.disabled.background : theme.entities.handle.states.active.background, disabled ? 'transparent' : theme.states.hover.background, disabled ? theme.states.disabled.background : theme.states.hover.entities.handle.background));
10
+ })(_ref => {
11
+ let {
12
+ disabled,
13
+ theme
14
+ } = _ref;
15
+ return css(["&:checked + span > span{background-color:", ";}&:checked + span > span:last-child{transform:translate(105%,-50%);background-color:", ";}&:hover + span{background-color:", ";}&:hover + span > span:last-child{background-color:", ";}"], disabled ? theme.states.disabled.background : theme.entities.track.states.active.background, disabled ? theme.states.disabled.background : theme.entities.handle.states.active.background, disabled ? 'transparent' : theme.states.hover.background, disabled ? theme.states.disabled.background : theme.states.hover.entities.handle.background);
16
+ });
14
17
  const Track = styled.span.withConfig({
15
18
  displayName: "SwitchDefault__Track",
16
19
  componentId: "sc-16ym5pn-1"
17
- })(({
18
- isDisabled,
19
- theme: {
20
- states,
21
- entities: {
22
- track
20
+ })(_ref2 => {
21
+ let {
22
+ isDisabled,
23
+ theme: {
24
+ states,
25
+ entities: {
26
+ track
27
+ }
23
28
  }
24
- }
25
- }) => css(["", " border:none;width:", ";height:", ";background-color:", ";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);transition:background 0.36s;", ""], bordersTemplate(track.border), track.width, track.height, track.background, isDisabled && {
26
- backgroundColor: states.disabled.background
27
- }));
29
+ } = _ref2;
30
+ return css(["", " border:none;width:", ";height:", ";background-color:", ";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);transition:background 0.36s;", ""], bordersTemplate(track.border), track.width, track.height, track.background, isDisabled && {
31
+ backgroundColor: states.disabled.background
32
+ });
33
+ });
28
34
  const Handle = styled.span.withConfig({
29
35
  displayName: "SwitchDefault__Handle",
30
36
  componentId: "sc-16ym5pn-2"
31
- })(({
32
- isDisabled,
33
- theme: {
34
- states,
35
- entities: {
36
- handle
37
+ })(_ref3 => {
38
+ let {
39
+ isDisabled,
40
+ theme: {
41
+ states,
42
+ entities: {
43
+ handle
44
+ }
37
45
  }
38
- }
39
- }) => css(["background-color:", ";", " box-shadow:", ";width:", ";height:", ";border-radius:50%;display:inline-block;position:absolute;top:50%;transform:translate(0,-50%);left:4px;transition:transform 0.36s cubic-bezier(0.78,0.14,0.15,0.86);"], handle.background, isDisabled && {
40
- backgroundColor: states.disabled.background
41
- }, handle.boxShadow, handle.width, handle.height));
42
- const SwitchDefault = /*#__PURE__*/forwardRef(function SwitchDefault({
43
- disabled,
44
- ...rest
45
- }, ref) {
46
+ } = _ref3;
47
+ return css(["background-color:", ";", " box-shadow:", ";width:", ";height:", ";border-radius:50%;display:inline-block;position:absolute;top:50%;transform:translate(0,-50%);left:4px;transition:transform 0.36s cubic-bezier(0.78,0.14,0.15,0.86);"], handle.background, isDisabled && {
48
+ backgroundColor: states.disabled.background
49
+ }, handle.boxShadow, handle.width, handle.height);
50
+ });
51
+ const SwitchDefault = /*#__PURE__*/forwardRef(function SwitchDefault(_ref4, ref) {
52
+ let {
53
+ disabled,
54
+ ...rest
55
+ } = _ref4;
46
56
  return /*#__PURE__*/jsxs(GridWrapper, {
47
57
  children: [/*#__PURE__*/jsx(Input, { ...rest,
48
58
  ref: ref,
@@ -1,48 +1,58 @@
1
1
  import { forwardRef } from 'react';
2
2
  import styled, { css } from 'styled-components';
3
3
  import { BaseInput, GridWrapper, BaseInputWrapper } from './Switch.styles.js';
4
+ import { outlineTemplate } from '@equinor/eds-utils';
4
5
  import { jsxs, jsx } from 'react/jsx-runtime';
5
- import { outlineTemplate } from '../../utils/templates/focus.js';
6
6
 
7
7
  const Input = styled(BaseInput).withConfig({
8
8
  displayName: "SwitchSmall__Input",
9
9
  componentId: "sc-1a99mis-0"
10
- })(({
11
- disabled,
12
- theme: {
13
- states,
14
- entities: {
15
- handle,
16
- track
10
+ })(_ref => {
11
+ let {
12
+ disabled,
13
+ theme: {
14
+ states,
15
+ entities: {
16
+ handle,
17
+ track
18
+ }
17
19
  }
18
- }
19
- }) => css(["&[data-focus-visible-added]:focus + span{", "}&:focus-visible + span{", "}&:checked + span > span{background-color:", ";}&:checked + span > span:last-child{transform:translate(180%,-50%);background-color:", ";}@media (hover:hover) and (pointer:fine){&:hover + span{background-color:", ";}}"], outlineTemplate(states.focus.outline), outlineTemplate(states.focus.outline), disabled ? states.disabled.background : track.states.active.background, handle.background, disabled ? 'transparent' : states.hover.background));
20
+ } = _ref;
21
+ return css(["&[data-focus-visible-added]:focus + span{", "}&:focus-visible + span{", "}&:checked + span > span{background-color:", ";}&:checked + span > span:last-child{transform:translate(180%,-50%);background-color:", ";}@media (hover:hover) and (pointer:fine){&:hover + span{background-color:", ";}}"], outlineTemplate(states.focus.outline), outlineTemplate(states.focus.outline), disabled ? states.disabled.background : track.states.active.background, handle.background, disabled ? 'transparent' : states.hover.background);
22
+ });
20
23
  const Track = styled.span.withConfig({
21
24
  displayName: "SwitchSmall__Track",
22
25
  componentId: "sc-1a99mis-1"
23
- })(({
24
- isDisabled,
25
- theme: {
26
- states,
27
- entities: {
28
- track
26
+ })(_ref2 => {
27
+ let {
28
+ isDisabled,
29
+ theme: {
30
+ states,
31
+ entities: {
32
+ track
33
+ }
29
34
  }
30
- }
31
- }) => css(["width:", ";height:", ";border-radius:10px;border:none;background-color:", ";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);"], track.width, track.height, isDisabled ? states.disabled.background : track.states.disabled.background));
35
+ } = _ref2;
36
+ return css(["width:", ";height:", ";border-radius:10px;border:none;background-color:", ";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);"], track.width, track.height, isDisabled ? states.disabled.background : track.states.disabled.background);
37
+ });
32
38
  const Handle = styled.span.withConfig({
33
39
  displayName: "SwitchSmall__Handle",
34
40
  componentId: "sc-1a99mis-2"
35
- })(({
36
- theme: {
37
- entities: {
38
- handle
41
+ })(_ref3 => {
42
+ let {
43
+ theme: {
44
+ entities: {
45
+ handle
46
+ }
39
47
  }
40
- }
41
- }) => css(["background-color:", ";width:", ";height:", ";border-radius:50%;display:inline-block;position:absolute;top:50%;transform:translate(11%,-50%);left:7px;transition:transform 0.36s cubic-bezier(0.78,0.14,0.15,0.86);"], handle.background, handle.width, handle.height));
42
- const SwitchSmall = /*#__PURE__*/forwardRef(function SwitchSmall({
43
- disabled,
44
- ...rest
45
- }, ref) {
48
+ } = _ref3;
49
+ return css(["background-color:", ";width:", ";height:", ";border-radius:50%;display:inline-block;position:absolute;top:50%;transform:translate(11%,-50%);left:7px;transition:transform 0.36s cubic-bezier(0.78,0.14,0.15,0.86);"], handle.background, handle.width, handle.height);
50
+ });
51
+ const SwitchSmall = /*#__PURE__*/forwardRef(function SwitchSmall(_ref4, ref) {
52
+ let {
53
+ disabled,
54
+ ...rest
55
+ } = _ref4;
46
56
  return /*#__PURE__*/jsxs(GridWrapper, {
47
57
  children: [/*#__PURE__*/jsx(Input, { ...rest,
48
58
  ref: ref,
@@ -7,10 +7,11 @@ const TableBase = styled.tbody.withConfig({
7
7
  displayName: "Body__TableBase",
8
8
  componentId: "sc-1pdmiku-0"
9
9
  })([""]);
10
- const Body = /*#__PURE__*/forwardRef(function Body({
11
- children,
12
- ...props
13
- }, ref) {
10
+ const Body = /*#__PURE__*/forwardRef(function Body(_ref, ref) {
11
+ let {
12
+ children,
13
+ ...props
14
+ } = _ref;
14
15
  return /*#__PURE__*/jsx(InnerContext.Provider, {
15
16
  value: {
16
17
  variant: 'body'
@@ -5,11 +5,14 @@ import { jsx } from 'react/jsx-runtime';
5
5
  const StyledCaption = styled.caption.withConfig({
6
6
  displayName: "Caption__StyledCaption",
7
7
  componentId: "sc-rtfr07-0"
8
- })(({
9
- captionSide = 'top'
10
- }) => ({
11
- captionSide
12
- }));
8
+ })(_ref => {
9
+ let {
10
+ captionSide = 'top'
11
+ } = _ref;
12
+ return {
13
+ captionSide
14
+ };
15
+ });
13
16
  const Caption = /*#__PURE__*/forwardRef(function Caption(props, ref) {
14
17
  return /*#__PURE__*/jsx(StyledCaption, { ...props,
15
18
  ref: ref
@@ -4,13 +4,16 @@ import { jsx } from 'react/jsx-runtime';
4
4
  import { TableDataCell } from './DataCell/DataCell.js';
5
5
  import { TableHeaderCell } from './HeaderCell/HeaderCell.js';
6
6
 
7
- const Cell = /*#__PURE__*/forwardRef(function Cell({ ...rest
8
- }, ref) {
7
+ const Cell = /*#__PURE__*/forwardRef(function Cell(_ref, ref) {
8
+ let { ...rest
9
+ } = _ref;
9
10
  return /*#__PURE__*/jsx(InnerContext.Consumer, {
10
- children: ({
11
- variant,
12
- sticky
13
- }) => {
11
+ children: _ref2 => {
12
+ let {
13
+ variant,
14
+ sticky
15
+ } = _ref2;
16
+
14
17
  switch (variant) {
15
18
  case 'head':
16
19
  return /*#__PURE__*/jsx(TableHeaderCell, {
@@ -1,36 +1,37 @@
1
1
  import { forwardRef } from 'react';
2
2
  import styled, { css, ThemeProvider } from 'styled-components';
3
+ import { spacingsTemplate, typographyTemplate, bordersTemplate, useToken } from '@equinor/eds-utils';
3
4
  import { applyVariant, tableCell } from './DataCell.tokens.js';
4
5
  import { jsx } from 'react/jsx-runtime';
5
- import { spacingsTemplate, typographyTemplate } from '../../../utils/templates/index.js';
6
- import { bordersTemplate } from '../../../utils/templates/borders.js';
7
6
  import { useEds } from '../../EdsProvider/eds.context.js';
8
- import { useToken } from '../../../hooks/useToken.js';
9
7
 
10
8
  const StyledTableCell = styled.td.withConfig({
11
9
  displayName: "DataCell__StyledTableCell",
12
10
  componentId: "sc-15tuitc-0"
13
- })(({
14
- theme,
15
- color
16
- }) => {
11
+ })(_ref => {
17
12
  var _theme$validation$err;
18
13
 
14
+ let {
15
+ theme,
16
+ color
17
+ } = _ref;
19
18
  const {
20
19
  height,
21
20
  typography,
22
21
  spacings,
23
- border
22
+ border,
23
+ align
24
24
  } = theme;
25
25
  const backgroundColor = color === 'error' ? (_theme$validation$err = theme.validation.error) === null || _theme$validation$err === void 0 ? void 0 : _theme$validation$err.background : '';
26
- const base = css(["min-height:", ";height:", ";background:", ";", " ", " ", ""], height, height, backgroundColor, spacingsTemplate(spacings), typographyTemplate(typography), bordersTemplate(border));
26
+ const base = css(["min-height:", ";height:", ";background:", ";vertical-align:", ";", " ", " ", ""], height, height, backgroundColor, align.vertical, spacingsTemplate(spacings), typographyTemplate(typography), bordersTemplate(border));
27
27
  return base;
28
28
  });
29
- const TableDataCell = /*#__PURE__*/forwardRef(function TableDataCell({
30
- children,
31
- variant = 'text',
32
- ...rest
33
- }, ref) {
29
+ const TableDataCell = /*#__PURE__*/forwardRef(function TableDataCell(_ref2, ref) {
30
+ let {
31
+ children,
32
+ variant = 'text',
33
+ ...rest
34
+ } = _ref2;
34
35
  const {
35
36
  density
36
37
  } = useEds();
@@ -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
 
4
4
  const {
5
5
  typography: {
@@ -56,8 +56,11 @@ const {
56
56
  }
57
57
  } = tokens;
58
58
  const tableCell = {
59
- height: '48px',
59
+ height: 'var(--eds_table__cell__height, 48px)',
60
60
  background: backgroundColor,
61
+ align: {
62
+ vertical: 'var(--eds_table__cell__vertical_align, inherit)'
63
+ },
61
64
  border: {
62
65
  type: 'bordergroup',
63
66
  bottom: {
@@ -67,13 +70,14 @@ const tableCell = {
67
70
  }
68
71
  },
69
72
  spacings: {
70
- top: '0',
71
- bottom: '0',
72
- left: medium,
73
- right: medium
73
+ top: 'var(--eds_table__cell__padding_y, 0)',
74
+ bottom: 'var(--eds_table__cell__padding_y, 0)',
75
+ left: "var(--eds_table__cell__padding_x, ".concat(medium, ")"),
76
+ right: "var(--eds_table__cell__padding_x, ".concat(medium, ")")
74
77
  },
75
78
  typography: { ...cellTypography,
76
- color: typographyColor
79
+ color: typographyColor,
80
+ fontSize: "var(--eds_table__font_size, ".concat(cellTypography.fontSize, ")")
77
81
  },
78
82
  states: {
79
83
  active: {
@@ -112,9 +116,15 @@ const tableCell = {
112
116
  },
113
117
  modes: {
114
118
  compact: {
115
- height: '32px',
119
+ height: 'var(--eds_table__cell__height_compact, 32px)',
116
120
  typography: { ...compactTypography.table.cell_text,
117
121
  color: typographyColor
122
+ },
123
+ spacings: {
124
+ top: 'var(--eds_table__cell__padding_y_compact, 0)',
125
+ bottom: 'var(--eds_table__cell__padding_y_compact, 0)',
126
+ left: "var(--eds_table__cell__padding_x_compact, ".concat(medium, ")"),
127
+ right: "var(--eds_table__cell__padding_x_compact, ".concat(medium, ")")
118
128
  }
119
129
  }
120
130
  },
@@ -141,7 +151,7 @@ const tableCell = {
141
151
  const applyVariant = (variant, token) => {
142
152
  switch (variant) {
143
153
  case 'numeric':
144
- return mergeDeepRight_1(token, token.variants.numeric);
154
+ return mergeDeepRight(token, token.variants.numeric);
145
155
 
146
156
  default:
147
157
  return token;
@@ -1,19 +1,20 @@
1
1
  import { forwardRef } from 'react';
2
2
  import styled from 'styled-components';
3
3
  import { token } from './Head.tokens.js';
4
+ import { bordersTemplate } from '@equinor/eds-utils';
4
5
  import { InnerContext } from '../Inner.context.js';
5
6
  import { jsx } from 'react/jsx-runtime';
6
- import { bordersTemplate } from '../../../utils/templates/borders.js';
7
7
 
8
8
  const StyledTableHead = styled.thead.withConfig({
9
9
  displayName: "Head__StyledTableHead",
10
10
  componentId: "sc-g9tch7-0"
11
11
  })(["", " background:", ";"], bordersTemplate(token.border), token.background);
12
- const Head = /*#__PURE__*/forwardRef(function Head({
13
- children,
14
- sticky,
15
- ...props
16
- }, ref) {
12
+ const Head = /*#__PURE__*/forwardRef(function Head(_ref, ref) {
13
+ let {
14
+ children,
15
+ sticky,
16
+ ...props
17
+ } = _ref;
17
18
  return /*#__PURE__*/jsx(InnerContext.Provider, {
18
19
  value: {
19
20
  variant: 'head',
@@ -1,11 +1,9 @@
1
1
  import { forwardRef } from 'react';
2
2
  import styled, { css, ThemeProvider } from 'styled-components';
3
+ import { spacingsTemplate, typographyTemplate, bordersTemplate, useToken } from '@equinor/eds-utils';
3
4
  import { token } from './HeaderCell.tokens.js';
4
5
  import { jsx } from 'react/jsx-runtime';
5
- import { spacingsTemplate, typographyTemplate } from '../../../utils/templates/index.js';
6
- import { bordersTemplate } from '../../../utils/templates/borders.js';
7
6
  import { useEds } from '../../EdsProvider/eds.context.js';
8
- import { useToken } from '../../../hooks/useToken.js';
9
7
 
10
8
  const StyledTableCell = styled.th.withConfig({
11
9
  displayName: "HeaderCell__StyledTableCell",
@@ -34,17 +32,18 @@ const StyledTableCell = styled.th.withConfig({
34
32
  sortStylingActive = css(["", ";background:", ";color:", ";"], activeToken.border.type === 'bordergroup' ? css(["border-color:", ";"], activeToken.border.bottom.color) : '', activeToken.background, activeToken.typography.color);
35
33
  }
36
34
 
37
- return css(["min-height:", ";height:", ";background:", ";", " ", " ", " ", " ", " ", ""], height, height, background, spacingsTemplate(spacings), typographyTemplate(typography), bordersTemplate(theme.border), sortStylingHover, sortStylingActive, sticky ? css(["position:sticky;top:0;"]) : '');
35
+ return css(["min-height:", ";height:", ";background:", ";", " ", " ", " ", " ", " ", ""], height, height, background, spacingsTemplate(spacings), typographyTemplate(typography), bordersTemplate(theme.border), sortStylingHover, sortStylingActive, sticky ? css(["position:sticky;top:0;z-index:1;"]) : '');
38
36
  });
39
37
  const CellInner = styled.div.withConfig({
40
38
  displayName: "HeaderCell__CellInner",
41
39
  componentId: "sc-18w2o3a-1"
42
40
  })(["display:flex;align-items:center;"]);
43
- const TableHeaderCell = /*#__PURE__*/forwardRef(function TableHeaderCell({
44
- children,
45
- sort,
46
- ...rest
47
- }, ref) {
41
+ const TableHeaderCell = /*#__PURE__*/forwardRef(function TableHeaderCell(_ref, ref) {
42
+ let {
43
+ children,
44
+ sort,
45
+ ...rest
46
+ } = _ref;
48
47
  const {
49
48
  density
50
49
  } = useEds();
@@ -51,10 +51,14 @@ const {
51
51
  }
52
52
  } = tokens;
53
53
  const token = {
54
- height: '48px',
54
+ height: 'var(--eds_table__cell__height, 48px)',
55
55
  background: backgroundColor,
56
+ align: {
57
+ vertical: 'var(--eds_table__cell__vertical_align, inherit)'
58
+ },
56
59
  typography: { ...cellTypography,
57
- color: typographyColor
60
+ color: typographyColor,
61
+ fontSize: "var(--eds_table__font_size, ".concat(cellTypography.fontSize, ")")
58
62
  },
59
63
  border: {
60
64
  type: 'bordergroup',
@@ -66,10 +70,10 @@ const token = {
66
70
  }
67
71
  },
68
72
  spacings: {
69
- top: '0',
70
- bottom: '0',
71
- left: medium,
72
- right: medium
73
+ top: 'var(--eds_table__cell__padding_y, 0)',
74
+ bottom: 'var(--eds_table__cell__padding_y, 0)',
75
+ left: "var(--eds_table__cell__padding_x, ".concat(medium, ")"),
76
+ right: "var(--eds_table__cell__padding_x, ".concat(medium, ")")
73
77
  },
74
78
  states: {
75
79
  active: {
@@ -109,8 +113,14 @@ const token = {
109
113
  },
110
114
  modes: {
111
115
  compact: {
112
- height: '32px',
113
- typography: compactTypography.table.cell_header
116
+ height: 'var(--eds_table__cell__height_compact, 32px)',
117
+ typography: compactTypography.table.cell_header,
118
+ spacings: {
119
+ top: 'var(--eds_table__cell__padding_y_compact, 0)',
120
+ bottom: 'var(--eds_table__cell__padding_y_compact, 0)',
121
+ left: "var(--eds_table__cell__padding_x_compact, ".concat(medium, ")"),
122
+ right: "var(--eds_table__cell__padding_x_compact, ".concat(medium, ")")
123
+ }
114
124
  }
115
125
  }
116
126
  };
@@ -6,11 +6,12 @@ import { jsx } from 'react/jsx-runtime';
6
6
  const StyledRow = styled.tr.withConfig({
7
7
  displayName: "Row__StyledRow",
8
8
  componentId: "sc-12c5lns-0"
9
- })(({
10
- active
11
- }) => {
9
+ })(_ref => {
12
10
  var _token$states$active, _token$states$hover;
13
11
 
12
+ let {
13
+ active
14
+ } = _ref;
14
15
  return {
15
16
  background: active ? (_token$states$active = token.states.active) === null || _token$states$active === void 0 ? void 0 : _token$states$active.background : null,
16
17
  '@media (hover: hover) and (pointer: fine)': {
@@ -20,8 +21,9 @@ const StyledRow = styled.tr.withConfig({
20
21
  }
21
22
  };
22
23
  });
23
- const Row = /*#__PURE__*/forwardRef(function Row({ ...props
24
- }, ref) {
24
+ const Row = /*#__PURE__*/forwardRef(function Row(_ref2, ref) {
25
+ let { ...props
26
+ } = _ref2;
25
27
  const {
26
28
  children
27
29
  } = props;
@@ -7,10 +7,11 @@ const TableBase = styled.table.withConfig({
7
7
  displayName: "Table__TableBase",
8
8
  componentId: "sc-14kktwc-0"
9
9
  })(["border-spacing:0;background:", ";"], tableCell.background);
10
- const Table = /*#__PURE__*/forwardRef(function Table({
11
- children,
12
- ...props
13
- }, ref) {
10
+ const Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
11
+ let {
12
+ children,
13
+ ...props
14
+ } = _ref;
14
15
  return /*#__PURE__*/jsx(TableBase, { ...props,
15
16
  ref: ref,
16
17
  children: children
@@ -1,19 +1,22 @@
1
1
  import { forwardRef } from 'react';
2
- import styled from 'styled-components';
3
- import { tableOfContents } from './TableOfContents.tokens.js';
2
+ import styled, { css } from 'styled-components';
3
+ import { typographyTemplate, spacingsTemplate, outlineTemplate, bordersTemplate } from '@equinor/eds-utils';
4
4
  import { jsx } from 'react/jsx-runtime';
5
- import { typographyTemplate, spacingsTemplate } from '../../utils/templates/index.js';
6
- import { outlineTemplate } from '../../utils/templates/focus.js';
7
- import { bordersTemplate } from '../../utils/templates/borders.js';
8
5
 
9
6
  const StyledLinkItem = styled.li.withConfig({
10
7
  displayName: "LinkItem__StyledLinkItem",
11
8
  componentId: "sc-1tfuad4-0"
12
- })(["list-style:none;margin:0;padding:0;a{text-decoration:none;", " ", " height:", ";width:", ";display:block;position:relative;svg{fill:", ";margin-right:", ";vertical-align:text-bottom;}span{max-width:", ";overflow:hidden;white-space:nowrap;text-overflow:ellipsis;vertical-align:text-bottom;display:inline-block;}&:focus{", ";}@media (hover:hover) and (pointer:fine){&:hover{", " background:", ";", " svg{fill:", ";}}}&:active{outline:none;}}"], typographyTemplate(tableOfContents.entities.links.typography), spacingsTemplate(tableOfContents.entities.links.spacings), tableOfContents.entities.links.typography.lineHeight, tableOfContents.entities.links.width, tableOfContents.entities.icon.background, tableOfContents.entities.icon.spacings.right, tableOfContents.entities.span.maxWidth, outlineTemplate(tableOfContents.states.focus.outline), typographyTemplate(tableOfContents.states.hover.typography), tableOfContents.states.hover.background, bordersTemplate(tableOfContents.states.hover.border), tableOfContents.states.hover.entities.icon.background);
13
- const LinkItem = /*#__PURE__*/forwardRef(function LinkItem({
14
- children,
15
- ...props
16
- }, ref) {
9
+ })(_ref => {
10
+ let {
11
+ theme
12
+ } = _ref;
13
+ return css(["list-style:none;margin:0;padding:0;a{text-decoration:none;", " ", " height:", ";width:", ";display:block;position:relative;svg{fill:", ";margin-right:", ";vertical-align:text-bottom;}span{max-width:", ";overflow:hidden;white-space:nowrap;text-overflow:ellipsis;vertical-align:text-bottom;display:inline-block;}&:focus{", ";}@media (hover:hover) and (pointer:fine){&:hover{", " background:", ";", " svg{fill:", ";}}}&:active{outline:none;}}"], typographyTemplate(theme.entities.links.typography), spacingsTemplate(theme.entities.links.spacings), theme.entities.links.typography.lineHeight, theme.entities.links.width, theme.entities.icon.background, theme.entities.icon.spacings.right, theme.entities.span.maxWidth, outlineTemplate(theme.states.focus.outline), typographyTemplate(theme.states.hover.typography), theme.states.hover.background, bordersTemplate(theme.states.hover.border), theme.states.hover.entities.icon.background);
14
+ });
15
+ const LinkItem = /*#__PURE__*/forwardRef(function LinkItem(_ref2, ref) {
16
+ let {
17
+ children,
18
+ ...props
19
+ } = _ref2;
17
20
  return /*#__PURE__*/jsx(StyledLinkItem, { ...props,
18
21
  ref: ref,
19
22
  children: children
@@ -1,17 +1,22 @@
1
1
  import { forwardRef } from 'react';
2
- import styled, { css } from 'styled-components';
2
+ import styled, { css, ThemeProvider } from 'styled-components';
3
3
  import { List } from '../List/index.js';
4
+ import { typographyTemplate, useToken } from '@equinor/eds-utils';
4
5
  import { tableOfContents } from './TableOfContents.tokens.js';
5
- import { jsxs, jsx } from 'react/jsx-runtime';
6
+ import { jsx, jsxs } from 'react/jsx-runtime';
6
7
  import { Typography } from '../Typography/Typography.js';
7
- import { typographyTemplate } from '../../utils/templates/index.js';
8
+ import { useEds } from '../EdsProvider/eds.context.js';
8
9
 
9
10
  const StyledTableOfContents = styled.nav.withConfig({
10
11
  displayName: "TableOfContents__StyledTableOfContents",
11
12
  componentId: "sc-q23s6y-0"
12
- })(["margin-top:", ";margin-bottom:", ";", ""], tableOfContents.spacings.top, tableOfContents.spacings.bottom, ({
13
- sticky
14
- }) => sticky && css(["position:fixed;top:", ";right:", ";"], tableOfContents.entities.sticky.spacings.top, tableOfContents.entities.sticky.spacings.right));
13
+ })(_ref => {
14
+ let {
15
+ theme,
16
+ sticky
17
+ } = _ref;
18
+ return css(["margin-top:", ";margin-bottom:", ";", ""], theme.spacings.top, theme.spacings.bottom, sticky && css(["position:fixed;top:", ";right:", ";"], theme.entities.sticky.spacings.top, theme.entities.sticky.spacings.right));
19
+ });
15
20
  const TocList = styled(List).withConfig({
16
21
  displayName: "TableOfContents__TocList",
17
22
  componentId: "sc-q23s6y-1"
@@ -19,24 +24,39 @@ const TocList = styled(List).withConfig({
19
24
  const TocLabel = styled(Typography).withConfig({
20
25
  displayName: "TableOfContents__TocLabel",
21
26
  componentId: "sc-q23s6y-2"
22
- })(["", ""], typographyTemplate(tableOfContents.typography));
23
- const TableOfContents = /*#__PURE__*/forwardRef(function TableOfContents({
24
- children,
25
- sticky = false,
26
- label = '',
27
- ...rest
28
- }, ref) {
29
- return /*#__PURE__*/jsxs(StyledTableOfContents, {
30
- ref: ref,
31
- label: label,
32
- sticky: sticky,
33
- ...rest,
34
- children: [/*#__PURE__*/jsx(TocLabel, {
35
- variant: "overline",
36
- children: label
37
- }), /*#__PURE__*/jsx(TocList, {
38
- children: children
39
- })]
27
+ })(_ref2 => {
28
+ let {
29
+ theme
30
+ } = _ref2;
31
+ return css(["", ""], typographyTemplate(theme.typography));
32
+ });
33
+ const TableOfContents = /*#__PURE__*/forwardRef(function TableOfContents(_ref3, ref) {
34
+ let {
35
+ children,
36
+ sticky = false,
37
+ label = '',
38
+ ...rest
39
+ } = _ref3;
40
+ const {
41
+ density
42
+ } = useEds();
43
+ const token = useToken({
44
+ density
45
+ }, tableOfContents);
46
+ return /*#__PURE__*/jsx(ThemeProvider, {
47
+ theme: token,
48
+ children: /*#__PURE__*/jsxs(StyledTableOfContents, {
49
+ ref: ref,
50
+ label: label,
51
+ sticky: sticky,
52
+ ...rest,
53
+ children: [/*#__PURE__*/jsx(TocLabel, {
54
+ variant: "overline",
55
+ children: label
56
+ }), /*#__PURE__*/jsx(TocList, {
57
+ children: children
58
+ })]
59
+ })
40
60
  });
41
61
  });
42
62
 
@@ -97,6 +97,9 @@ const tableOfContents = {
97
97
  color: primaryHover
98
98
  }
99
99
  }
100
+ },
101
+ modes: {
102
+ compact: {}
100
103
  }
101
104
  };
102
105