@equinor/eds-core-react 0.20.3 → 0.21.0-dev.20220905

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 (69) hide show
  1. package/README.md +8 -0
  2. package/dist/eds-core-react.cjs.js +583 -313
  3. package/dist/esm/components/Accordion/Accordion.tokens.js +7 -0
  4. package/dist/esm/components/Accordion/AccordionHeader.js +4 -0
  5. package/dist/esm/components/Accordion/AccordionHeaderActions.js +3 -1
  6. package/dist/esm/components/Accordion/AccordionHeaderTitle.js +3 -1
  7. package/dist/esm/components/Accordion/AccordionPanel.js +2 -2
  8. package/dist/esm/components/Autocomplete/Autocomplete.js +93 -68
  9. package/dist/esm/components/Breadcrumbs/Breadcrumb.js +4 -2
  10. package/dist/esm/components/Button/Button.js +4 -1
  11. package/dist/esm/components/Button/ButtonGroup/ButtonGroup.js +37 -0
  12. package/dist/esm/components/Button/ButtonGroup/ButtonGroup.tokens.js +17 -0
  13. package/dist/esm/components/Button/index.js +8 -0
  14. package/dist/esm/components/Button/tokens/contained_icon.js +56 -0
  15. package/dist/esm/components/Button/tokens/index.js +7 -3
  16. package/dist/esm/components/Card/Card.js +3 -12
  17. package/dist/esm/components/Checkbox/Checkbox.js +4 -0
  18. package/dist/esm/components/Checkbox/Input.js +5 -1
  19. package/dist/esm/components/Icon/Icon.js +1 -1
  20. package/dist/esm/components/Menu/Menu.js +56 -40
  21. package/dist/esm/components/Menu/MenuItem.js +2 -2
  22. package/dist/esm/components/Pagination/Pagination.js +1 -1
  23. package/dist/esm/components/Pagination/PaginationItem.js +1 -1
  24. package/dist/esm/components/Popover/Popover.js +90 -35
  25. package/dist/esm/components/Radio/Radio.js +4 -0
  26. package/dist/esm/components/Scrim/Scrim.js +3 -3
  27. package/dist/esm/components/Search/Search.js +7 -4
  28. package/dist/esm/components/Select/NativeSelect/NativeSelect.js +3 -1
  29. package/dist/esm/components/Select/commonStyles.js +1 -1
  30. package/dist/esm/components/SideSheet/SideSheet.js +8 -6
  31. package/dist/esm/components/SideSheet/SideSheet.tokens.js +7 -0
  32. package/dist/esm/components/Switch/Switch.js +6 -0
  33. package/dist/esm/components/Switch/SwitchDefault.js +4 -0
  34. package/dist/esm/components/Switch/SwitchSmall.js +4 -0
  35. package/dist/esm/components/Tabs/TabList.js +2 -3
  36. package/dist/esm/components/Tabs/Tabs.js +3 -3
  37. package/dist/esm/components/TextField/TextField.js +2 -1
  38. package/dist/esm/components/Textarea/Textarea.js +4 -3
  39. package/dist/esm/components/Tooltip/Tooltip.js +102 -83
  40. package/dist/esm/components/TopBar/TopBar.tokens.js +2 -2
  41. package/dist/esm/index.js +1 -1
  42. package/dist/types/components/Autocomplete/Autocomplete.d.ts +4 -0
  43. package/dist/types/components/Breadcrumbs/Breadcrumb.d.ts +9 -6
  44. package/dist/types/components/Button/Button.d.ts +8 -26
  45. package/dist/types/components/Button/Button.types.d.ts +1 -0
  46. package/dist/types/components/Button/ButtonGroup/ButtonGroup.d.ts +9 -0
  47. package/dist/types/components/{Group/Group.tokens.d.ts → Button/ButtonGroup/ButtonGroup.tokens.d.ts} +0 -0
  48. package/dist/types/components/Button/ButtonGroup/index.d.ts +1 -0
  49. package/dist/types/components/Button/index.d.ts +8 -1
  50. package/dist/types/components/Button/tokens/contained_icon.d.ts +4 -0
  51. package/dist/types/components/Checkbox/Checkbox.d.ts +13 -5
  52. package/dist/types/components/Checkbox/Input.d.ts +10 -5
  53. package/dist/types/components/Icon/Icon.d.ts +1 -1
  54. package/dist/types/components/Menu/Menu.d.ts +1 -1
  55. package/dist/types/components/Popover/Popover.d.ts +1 -1
  56. package/dist/types/components/Progress/Circular/CircularProgress.d.ts +1 -1
  57. package/dist/types/components/Progress/Dots/DotProgress.d.ts +1 -1
  58. package/dist/types/components/Progress/Star/StarProgress.d.ts +1 -1
  59. package/dist/types/components/Radio/Radio.d.ts +8 -5
  60. package/dist/types/components/Select/commonStyles.d.ts +5 -9
  61. package/dist/types/components/SideSheet/SideSheet.d.ts +4 -0
  62. package/dist/types/components/Switch/Switch.d.ts +10 -5
  63. package/dist/types/components/Switch/SwitchDefault.d.ts +3 -5
  64. package/dist/types/components/Switch/SwitchSmall.d.ts +3 -5
  65. package/dist/types/components/Tooltip/Tooltip.d.ts +1 -1
  66. package/dist/types/components/Typography/Typography.d.ts +11 -3
  67. package/package.json +5 -6
  68. package/dist/types/components/Group/Group.d.ts +0 -3
  69. package/dist/types/components/Group/index.d.ts +0 -1
@@ -47,6 +47,11 @@ const {
47
47
  focused: {
48
48
  width: focusOutlineWidth
49
49
  }
50
+ },
51
+ typography: {
52
+ input: {
53
+ text
54
+ }
50
55
  }
51
56
  } = tokens;
52
57
  const accordion = {
@@ -104,6 +109,8 @@ const accordion = {
104
109
  left: mediumSpacing,
105
110
  right: mediumSpacing,
106
111
  top: mediumSpacing
112
+ },
113
+ typography: { ...text
107
114
  }
108
115
  },
109
116
  icon: {
@@ -100,6 +100,8 @@ const AccordionHeader = /*#__PURE__*/forwardRef(function AccordionHeader(_ref5,
100
100
  children,
101
101
  toggleExpanded,
102
102
  disabled,
103
+ className,
104
+ style,
103
105
  ...props
104
106
  } = _ref5;
105
107
 
@@ -171,6 +173,8 @@ const AccordionHeader = /*#__PURE__*/forwardRef(function AccordionHeader(_ref5,
171
173
  disabled: disabled,
172
174
  parentIndex: parentIndex,
173
175
  as: headerLevel,
176
+ className: className,
177
+ style: style,
174
178
  children: [/*#__PURE__*/jsx(StyledAccordionHeaderButton, {
175
179
  isExpanded: isExpanded,
176
180
  disabled: disabled,
@@ -30,12 +30,14 @@ const AccordionHeaderActions = /*#__PURE__*/forwardRef(function AccordionHeaderA
30
30
  let {
31
31
  isExpanded,
32
32
  disabled,
33
- children
33
+ children,
34
+ ...rest
34
35
  } = _ref2;
35
36
  return /*#__PURE__*/jsx(StyledAccordionHeaderActions, {
36
37
  ref: ref,
37
38
  isExpanded: isExpanded,
38
39
  disabled: disabled,
40
+ ...rest,
39
41
  children: children
40
42
  });
41
43
  });
@@ -24,12 +24,14 @@ const AccordionHeaderTitle = /*#__PURE__*/forwardRef(function AccordionHeaderTit
24
24
  let {
25
25
  isExpanded,
26
26
  disabled,
27
- children
27
+ children,
28
+ ...rest
28
29
  } = _ref2;
29
30
  return /*#__PURE__*/jsx(StyledAccordionHeaderTitle, {
30
31
  ref: ref,
31
32
  isExpanded: isExpanded,
32
33
  disabled: disabled,
34
+ ...rest,
33
35
  children: children
34
36
  });
35
37
  }); // AccordionHeaderTitle.displayName = 'AccordionHeaderTitle'
@@ -1,6 +1,6 @@
1
1
  import { forwardRef } from 'react';
2
2
  import styled, { css } from 'styled-components';
3
- import { bordersTemplate, spacingsTemplate } from '@equinor/eds-utils';
3
+ import { bordersTemplate, spacingsTemplate, typographyTemplate } from '@equinor/eds-utils';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5
 
6
6
  const StyledAccordionPanel = styled.div.attrs(_ref => {
@@ -25,7 +25,7 @@ const StyledAccordionPanel = styled.div.attrs(_ref => {
25
25
  },
26
26
  border
27
27
  } = theme;
28
- return css(["", " ", " background:", ";min-height:96px;box-sizing:border-box;"], bordersTemplate(border), spacingsTemplate(panel.spacings), header.background);
28
+ return css(["", " ", " ", " background:", ";min-height:96px;box-sizing:border-box;"], bordersTemplate(border), spacingsTemplate(panel.spacings), typographyTemplate(panel.typography), header.background);
29
29
  });
30
30
  const AccordionPanel = /*#__PURE__*/forwardRef(function AccordionPanel(_ref3, ref) {
31
31
  let {
@@ -1,8 +1,7 @@
1
- import { forwardRef, useRef, useState, useEffect, useMemo, useCallback } from 'react';
2
- import { createPortal } from 'react-dom';
1
+ import { forwardRef, useRef, useState, useEffect, useMemo, useCallback, useLayoutEffect } from 'react';
3
2
  import { useMultipleSelection, useCombobox } from 'downshift';
4
3
  import styled, { css, ThemeProvider } from 'styled-components';
5
- import { Button } from '../Button/Button.js';
4
+ import { Button } from '../Button/index.js';
6
5
  import { List } from '../List/index.js';
7
6
  import { useEds } from '../EdsProvider/eds.context.js';
8
7
  import { Label } from '../Label/Label.js';
@@ -10,8 +9,9 @@ import { Icon } from '../Icon/index.js';
10
9
  import { Input } from '../Input/Input.js';
11
10
  import { close, arrow_drop_up, arrow_drop_down } from '@equinor/eds-icons';
12
11
  import { multiSelect, selectTokens } from './Autocomplete.tokens.js';
13
- import { bordersTemplate, useIsMounted, useToken, usePopper } from '@equinor/eds-utils';
12
+ import { bordersTemplate, useToken } from '@equinor/eds-utils';
14
13
  import { AutocompleteOption } from './Option.js';
14
+ import { useFloating, offset, flip, shift, size, useInteractions, autoUpdate, FloatingPortal } from '@floating-ui/react-dom-interactions';
15
15
  import { jsx, jsxs } from 'react/jsx-runtime';
16
16
 
17
17
  const Container = styled.div.withConfig({
@@ -38,7 +38,7 @@ const StyledList = styled(List).withConfig({
38
38
  let {
39
39
  theme
40
40
  } = _ref2;
41
- return css(["background-color:", ";box-shadow:", ";", " overflow-y:auto;max-height:300px;padding:0;position:absolute;right:0;left:0;z-index:1400;"], theme.background, theme.boxShadow, bordersTemplate(theme.border));
41
+ return css(["background-color:", ";box-shadow:", ";", " overflow-y:auto;max-height:300px;padding:0;"], theme.background, theme.boxShadow, bordersTemplate(theme.border));
42
42
  });
43
43
  const StyledButton = styled(Button).withConfig({
44
44
  displayName: "Autocomplete__StyledButton",
@@ -130,8 +130,10 @@ function AutocompleteInner(props, ref) {
130
130
  label,
131
131
  meta,
132
132
  className,
133
+ style,
133
134
  disabled = false,
134
135
  readOnly = false,
136
+ hideClearButton = false,
135
137
  onOptionsChange,
136
138
  selectedOptions,
137
139
  multiple,
@@ -144,10 +146,7 @@ function AutocompleteInner(props, ref) {
144
146
  optionLabel,
145
147
  ...other
146
148
  } = props;
147
- const anchorRef = useRef();
148
- const [anchorEl, setAnchorEl] = useState();
149
- const [containerEl, setContainerEl] = useState();
150
- const isMounted = useIsMounted();
149
+ const anchorRef = useRef(null);
151
150
  const isControlled = Boolean(selectedOptions);
152
151
  const [inputOptions, setInputOptions] = useState(options);
153
152
  useEffect(() => {
@@ -311,9 +310,8 @@ function AutocompleteInner(props, ref) {
311
310
  }
312
311
  };
313
312
 
314
- if (isControlled && !multiple) {
313
+ if (!multiple) {
315
314
  comboBoxProps = { ...comboBoxProps,
316
- selectedItem: selectedOptions[0] || null,
317
315
  onSelectedItemChange: changes => {
318
316
  if (onOptionsChange) {
319
317
  const {
@@ -325,6 +323,12 @@ function AutocompleteInner(props, ref) {
325
323
  }
326
324
  }
327
325
  };
326
+
327
+ if (isControlled) {
328
+ comboBoxProps = { ...comboBoxProps,
329
+ selectedItem: selectedOptions[0] || null
330
+ };
331
+ }
328
332
  }
329
333
 
330
334
  if (multiple) {
@@ -395,40 +399,10 @@ function AutocompleteInner(props, ref) {
395
399
  reset: resetCombobox
396
400
  } = useCombobox(comboBoxProps);
397
401
  useEffect(() => {
398
- if (anchorRef.current && isOpen) {
399
- setAnchorEl(anchorRef.current);
400
- } else {
401
- setAnchorEl(null);
402
- }
403
-
404
402
  if (isControlled) {
405
403
  setSelectedItems(selectedOptions);
406
404
  }
407
-
408
- return () => {
409
- setAnchorEl(null);
410
- setContainerEl(null);
411
- };
412
- }, [anchorRef, isControlled, isOpen, selectedOptions, setSelectedItems]); //"Turn on" popper on load to position menu correctly and then turn it off
413
-
414
- useEffect(() => {
415
- if (anchorRef.current) {
416
- setAnchorEl(anchorRef.current);
417
- setTimeout(() => {
418
- setAnchorEl(null);
419
- }, 1);
420
- }
421
- }, []);
422
- const {
423
- styles,
424
- attributes
425
- } = usePopper({
426
- anchorEl,
427
- popperEl: containerEl,
428
- placement: 'bottom-start',
429
- offset: 4,
430
- autoWidth
431
- });
405
+ }, [isControlled, selectedOptions, setSelectedItems]);
432
406
 
433
407
  const openSelect = () => {
434
408
  if (!isOpen && !(disabled || readOnly)) {
@@ -436,38 +410,85 @@ function AutocompleteInner(props, ref) {
436
410
  }
437
411
  };
438
412
 
413
+ const {
414
+ x,
415
+ y,
416
+ refs,
417
+ update,
418
+ reference,
419
+ floating,
420
+ strategy
421
+ } = useFloating({
422
+ placement: 'bottom-start',
423
+ middleware: [offset(4), flip(), shift({
424
+ padding: 8
425
+ }), size({
426
+ apply(_ref10) {
427
+ let {
428
+ rects,
429
+ availableHeight,
430
+ elements
431
+ } = _ref10;
432
+ const anchorWidth = "".concat(rects.reference.width, "px");
433
+ Object.assign(elements.floating.style, {
434
+ width: "".concat(autoWidth ? anchorWidth : 'auto'),
435
+ maxHeight: "".concat(availableHeight, "px")
436
+ });
437
+ },
438
+
439
+ padding: 10
440
+ })]
441
+ });
442
+ const {
443
+ getFloatingProps
444
+ } = useInteractions([]);
445
+ useLayoutEffect(() => {
446
+ reference(anchorRef.current);
447
+ }, [anchorRef, reference]);
448
+ useLayoutEffect(() => {
449
+ if (refs.reference.current && refs.floating.current && isOpen) {
450
+ return autoUpdate(refs.reference.current, refs.floating.current, update);
451
+ }
452
+ }, [refs.reference, refs.floating, update, isOpen]);
453
+
439
454
  const clear = () => {
440
455
  resetCombobox();
441
456
  resetSelection();
442
457
  };
443
458
 
444
- const showClearButton = (selectedItems.length > 0 || inputValue) && !readOnly;
459
+ const showClearButton = (selectedItems.length > 0 || inputValue) && !readOnly && !hideClearButton;
445
460
  const selectedItemsLabels = useMemo(() => selectedItems.map(getLabel), [selectedItems, getLabel]);
446
461
 
447
- const optionsList = /*#__PURE__*/jsx(StyledList, { ...getMenuProps({
448
- ref: setContainerEl,
449
- style: styles.popper,
450
- 'aria-multiselectable': multiple ? 'true' : null,
451
- ...attributes.popper
452
- }, {
453
- suppressRefError: true
462
+ const optionsList = /*#__PURE__*/jsx("div", { ...getFloatingProps({
463
+ ref: floating,
464
+ style: {
465
+ position: strategy,
466
+ top: y !== null && y !== void 0 ? y : 0,
467
+ left: x !== null && x !== void 0 ? x : 0
468
+ }
454
469
  }),
455
- children: !isOpen ? null : availableItems.map((item, index) => {
456
- const label = getLabel(item);
457
- const isDisabled = optionDisabled(item);
458
- const isSelected = selectedItemsLabels.includes(label);
459
- return /*#__PURE__*/jsx(AutocompleteOption, {
460
- value: label,
461
- multiple: multiple,
462
- highlighted: highlightedIndex === index && !isDisabled ? 'true' : 'false',
463
- isSelected: isSelected,
464
- isDisabled: isDisabled,
465
- ...getItemProps({
466
- item,
467
- index,
468
- disabled
469
- })
470
- }, label);
470
+ children: /*#__PURE__*/jsx(StyledList, { ...getMenuProps({
471
+ 'aria-multiselectable': multiple ? 'true' : null
472
+ }, {
473
+ suppressRefError: true
474
+ }),
475
+ children: !isOpen ? null : availableItems.map((item, index) => {
476
+ const label = getLabel(item);
477
+ const isDisabled = optionDisabled(item);
478
+ const isSelected = selectedItemsLabels.includes(label);
479
+ return /*#__PURE__*/jsx(AutocompleteOption, {
480
+ value: label,
481
+ multiple: multiple,
482
+ highlighted: highlightedIndex === index && !isDisabled ? 'true' : 'false',
483
+ isSelected: isSelected,
484
+ isDisabled: isDisabled,
485
+ ...getItemProps({
486
+ item,
487
+ index,
488
+ disabled
489
+ })
490
+ }, label);
491
+ })
471
492
  })
472
493
  });
473
494
 
@@ -475,6 +496,7 @@ function AutocompleteInner(props, ref) {
475
496
  theme: token,
476
497
  children: /*#__PURE__*/jsxs(Container, {
477
498
  className: className,
499
+ style: style,
478
500
  ref: ref,
479
501
  children: [/*#__PURE__*/jsx(Label, { ...getLabelProps(),
480
502
  label: label,
@@ -485,7 +507,7 @@ function AutocompleteInner(props, ref) {
485
507
  getDropdownProps({
486
508
  preventKeyAction: multiple ? isOpen : undefined,
487
509
  disabled,
488
- ref: anchorRef
510
+ ref: refs.reference
489
511
  })),
490
512
  placeholder: placeholderText,
491
513
  readOnly: readOnly,
@@ -516,7 +538,10 @@ function AutocompleteInner(props, ref) {
516
538
  data: isOpen ? arrow_drop_up : arrow_drop_down
517
539
  })
518
540
  })]
519
- }), disablePortal ? optionsList : !isMounted ? null : /*#__PURE__*/createPortal(optionsList, document.body)]
541
+ }), disablePortal ? optionsList : /*#__PURE__*/jsx(FloatingPortal, {
542
+ id: "eds-autocomplete-container",
543
+ children: optionsList
544
+ })]
520
545
  })
521
546
  });
522
547
  }
@@ -1,4 +1,4 @@
1
- import { forwardRef } from 'react';
1
+ import { forwardRef, useMemo } from 'react';
2
2
  import styled, { css } from 'styled-components';
3
3
  import { Typography } from '../Typography/Typography.js';
4
4
  import { Tooltip } from '../Tooltip/Tooltip.js';
@@ -25,6 +25,7 @@ const Breadcrumb = /*#__PURE__*/forwardRef(function Breadcrumb(_ref2, ref) {
25
25
  children,
26
26
  maxWidth,
27
27
  href,
28
+ as,
28
29
  ...other
29
30
  } = _ref2;
30
31
  const props = { ...other,
@@ -34,10 +35,11 @@ const Breadcrumb = /*#__PURE__*/forwardRef(function Breadcrumb(_ref2, ref) {
34
35
  };
35
36
  const showTooltip = maxWidth > 0;
36
37
  const isHrefDefined = href !== undefined;
38
+ const forwardedAs = useMemo(() => as ? as : isHrefDefined ? 'a' : 'span', [as, isHrefDefined]);
37
39
 
38
40
  const crumb = /*#__PURE__*/jsx(StyledTypography, {
39
41
  link: isHrefDefined,
40
- forwardedAs: isHrefDefined ? null : 'span',
42
+ forwardedAs: forwardedAs,
41
43
  variant: "body_short",
42
44
  ...props,
43
45
  children: children
@@ -17,6 +17,9 @@ const getVariant = (tokenSet, variant) => {
17
17
  case 'outlined':
18
18
  return tokenSet.outlined;
19
19
 
20
+ case 'contained_icon':
21
+ return tokenSet.contained_icon;
22
+
20
23
  case 'contained':
21
24
  default:
22
25
  return tokenSet.contained;
@@ -59,7 +62,7 @@ const ButtonBase = styled.button.withConfig({
59
62
  hover,
60
63
  disabled
61
64
  } = states;
62
- return css(["margin:0;padding:0;text-decoration:none;position:relative;cursor:pointer;display:inline-block;background:", ";height:", ";width:", ";svg{justify-self:center;}", " ", " ", " &::before{position:absolute;top:0;left:0;width:auto;min-height:auto;content:'';}&::after{position:absolute;top:-", ";left:-", ";width:", ";height:", ";content:'';}@media (hover:hover) and (pointer:fine){&:hover{background:", ";color:", ";", ";}}&:focus{outline:none;}&[data-focus-visible-added]:focus{", "}&:focus-visible{", "}&::-moz-focus-inner{border:0;}&:disabled{cursor:not-allowed;background:", ";", ";", ";@media (hover:hover) and (pointer:fine){&:hover{background:", ";}}}"], theme.background, theme.height, theme.width, spacingsTemplate(theme.spacings), bordersTemplate(theme.border), typographyTemplate(theme.typography), clickbound === null || clickbound === void 0 ? void 0 : (_clickbound$offset = clickbound.offset) === null || _clickbound$offset === void 0 ? void 0 : _clickbound$offset.top, clickbound === null || clickbound === void 0 ? void 0 : (_clickbound$offset2 = clickbound.offset) === null || _clickbound$offset2 === void 0 ? void 0 : _clickbound$offset2.left, clickbound === null || clickbound === void 0 ? void 0 : clickbound.width, clickbound === null || clickbound === void 0 ? void 0 : clickbound.height, hover.background, (_hover$typography = hover.typography) === null || _hover$typography === void 0 ? void 0 : _hover$typography.color, bordersTemplate(hover === null || hover === void 0 ? void 0 : hover.border), outlineTemplate(focus.outline), outlineTemplate(focus.outline), disabled.background, bordersTemplate(disabled.border), typographyTemplate(disabled.typography), disabled.background);
65
+ return css(["box-sizing:border-box;margin:0;padding:0;text-decoration:none;position:relative;cursor:pointer;display:inline-block;background:", ";height:", ";width:", ";svg{justify-self:center;}", " ", " ", " &::before{position:absolute;top:0;left:0;width:auto;min-height:auto;content:'';}&::after{position:absolute;top:-", ";left:-", ";width:", ";height:", ";content:'';}@media (hover:hover) and (pointer:fine){&:hover{background:", ";color:", ";", ";}}&:focus{outline:none;}&[data-focus-visible-added]:focus{", "}&:focus-visible{", "}&::-moz-focus-inner{border:0;}&:disabled{cursor:not-allowed;background:", ";", ";", ";@media (hover:hover) and (pointer:fine){&:hover{background:", ";}}}"], theme.background, theme.height, theme.width, spacingsTemplate(theme.spacings), bordersTemplate(theme.border), typographyTemplate(theme.typography), clickbound === null || clickbound === void 0 ? void 0 : (_clickbound$offset = clickbound.offset) === null || _clickbound$offset === void 0 ? void 0 : _clickbound$offset.top, clickbound === null || clickbound === void 0 ? void 0 : (_clickbound$offset2 = clickbound.offset) === null || _clickbound$offset2 === void 0 ? void 0 : _clickbound$offset2.left, clickbound === null || clickbound === void 0 ? void 0 : clickbound.width, clickbound === null || clickbound === void 0 ? void 0 : clickbound.height, hover.background, (_hover$typography = hover.typography) === null || _hover$typography === void 0 ? void 0 : _hover$typography.color, bordersTemplate(hover === null || hover === void 0 ? void 0 : hover.border), outlineTemplate(focus.outline), outlineTemplate(focus.outline), disabled.background, bordersTemplate(disabled.border), typographyTemplate(disabled.typography), disabled.background);
63
66
  });
64
67
  const Button = /*#__PURE__*/forwardRef(function Button(_ref2, ref) {
65
68
  let {
@@ -0,0 +1,37 @@
1
+ import { forwardRef } from 'react';
2
+ import styled, { css } from 'styled-components';
3
+ import { group } from './ButtonGroup.tokens.js';
4
+ import { jsx } from 'react/jsx-runtime';
5
+
6
+ const {
7
+ border
8
+ } = group;
9
+ const radius = border.type === 'border' && border.radius;
10
+ const ButtonGroupBase = styled.div.withConfig({
11
+ displayName: "ButtonGroup__ButtonGroupBase",
12
+ componentId: "sc-1fn8jon-0"
13
+ })(["display:inline-flex;> *{border-radius:0;@media (hover:hover) and (pointer:fine){&:hover{border-radius:0;}}}", ""], _ref => {
14
+ let {
15
+ vertical
16
+ } = _ref;
17
+ return vertical ? css(["flex-direction:column;> :first-child{border-top-left-radius:", ";border-top-right-radius:", ";}> :last-child{border-bottom-left-radius:", ";border-bottom-right-radius:", ";}> :not(:last-child){border-bottom:none;}"], radius, radius, radius, radius) : css(["> :first-child{border-top-left-radius:", ";border-bottom-left-radius:", ";}> :last-child{border-top-right-radius:", ";border-bottom-right-radius:", ";}> :not(:last-child){border-right:none;}"], radius, radius, radius, radius);
18
+ });
19
+ const ButtonGroup = /*#__PURE__*/forwardRef(function ButtonGroup(_ref2, ref) {
20
+ let {
21
+ children,
22
+ vertical,
23
+ ...rest
24
+ } = _ref2;
25
+ const props = {
26
+ ref,
27
+ vertical,
28
+ ...rest
29
+ };
30
+ return /*#__PURE__*/jsx(ButtonGroupBase, {
31
+ role: "group",
32
+ ...props,
33
+ children: children
34
+ });
35
+ });
36
+
37
+ export { ButtonGroup };
@@ -0,0 +1,17 @@
1
+ import { tokens } from '@equinor/eds-tokens';
2
+
3
+ const {
4
+ shape: {
5
+ corners: {
6
+ borderRadius
7
+ }
8
+ }
9
+ } = tokens;
10
+ const group = {
11
+ border: {
12
+ type: 'border',
13
+ radius: borderRadius
14
+ }
15
+ };
16
+
17
+ export { group };
@@ -0,0 +1,8 @@
1
+ import { Button as Button$1 } from './Button.js';
2
+ import { ButtonGroup } from './ButtonGroup/ButtonGroup.js';
3
+
4
+ const Button = Button$1;
5
+ Button.Group = ButtonGroup;
6
+ Button.Group.displayName = 'Button.Group';
7
+
8
+ export { Button };
@@ -0,0 +1,56 @@
1
+ import { tokens } from '@equinor/eds-tokens';
2
+ import mergeDeepRight from '../../../node_modules/.pnpm/ramda@0.28.0/node_modules/ramda/es/mergeDeepRight.js';
3
+ import { primary as primary$1, secondary as secondary$1, danger as danger$1 } from './contained.js';
4
+
5
+ const {
6
+ clickbounds: {
7
+ default__base: clicboundHeight,
8
+ compact__standard: compactClickboundHeight
9
+ },
10
+ shape
11
+ } = tokens;
12
+ const contained_icon = {
13
+ height: shape.icon_button.minHeight,
14
+ width: shape.icon_button.minWidth,
15
+ border: {
16
+ width: '0px',
17
+ radius: '50%'
18
+ },
19
+ spacings: {
20
+ left: '0',
21
+ right: '0'
22
+ },
23
+ clickbound: {
24
+ width: clicboundHeight,
25
+ offset: {
26
+ top: '0',
27
+ left: "".concat((parseInt(clicboundHeight) - parseInt('40px')) / 2, "px")
28
+ }
29
+ },
30
+ states: {
31
+ hover: {
32
+ border: {
33
+ width: '0px',
34
+ radius: '50%'
35
+ }
36
+ }
37
+ },
38
+ modes: {
39
+ compact: {
40
+ height: shape._modes.compact.icon_button.minHeight,
41
+ width: shape._modes.compact.icon_button.minWidth,
42
+ clickbound: {
43
+ width: compactClickboundHeight,
44
+ offset: {
45
+ top: '0',
46
+ left: "".concat((parseInt(compactClickboundHeight) - parseInt(shape._modes.compact.icon_button.minWidth)) / 2, "px")
47
+ }
48
+ }
49
+ }
50
+ }
51
+ };
52
+ const primary = mergeDeepRight(primary$1, contained_icon);
53
+ const secondary = mergeDeepRight(secondary$1, contained_icon);
54
+ const danger = mergeDeepRight(danger$1, contained_icon);
55
+
56
+ export { danger, primary, secondary };
@@ -2,25 +2,29 @@ import { primary, secondary, danger } from './contained.js';
2
2
  import { primary as primary$1, secondary as secondary$1, danger as danger$1 } from './outlined.js';
3
3
  import { primary as primary$2, secondary as secondary$2, danger as danger$2 } from './ghost.js';
4
4
  import { primary as primary$3, secondary as secondary$3, danger as danger$3 } from './icon.js';
5
+ import { primary as primary$4, secondary as secondary$4, danger as danger$4 } from './contained_icon.js';
5
6
 
6
7
  const token = {
7
8
  primary: {
8
9
  contained: primary,
9
10
  outlined: primary$1,
10
11
  ghost: primary$2,
11
- ghost_icon: primary$3
12
+ ghost_icon: primary$3,
13
+ contained_icon: primary$4
12
14
  },
13
15
  secondary: {
14
16
  contained: secondary,
15
17
  outlined: secondary$1,
16
18
  ghost: secondary$2,
17
- ghost_icon: secondary$3
19
+ ghost_icon: secondary$3,
20
+ contained_icon: secondary$4
18
21
  },
19
22
  danger: {
20
23
  contained: danger,
21
24
  outlined: danger$1,
22
25
  ghost: danger$2,
23
- ghost_icon: danger$3
26
+ ghost_icon: danger$3,
27
+ contained_icon: danger$4
24
28
  }
25
29
  };
26
30
 
@@ -11,38 +11,29 @@ const {
11
11
  const StyledCard = styled(Paper).withConfig({
12
12
  displayName: "Card__StyledCard",
13
13
  componentId: "sc-bjucjn-0"
14
- })(["width:100%;position:relative;background-color:", ";box-sizing:border-box;display:flex;flex-direction:column;grid-gap:16px;cursor:", ";", ";"], _ref => {
14
+ })(["width:100%;position:relative;background-color:", ";box-sizing:border-box;display:flex;flex-direction:column;grid-gap:16px;", ";"], _ref => {
15
15
  let {
16
16
  background
17
17
  } = _ref;
18
18
  return background;
19
- }, _ref2 => {
20
- let {
21
- cursor
22
- } = _ref2;
23
- return cursor;
24
19
  }, bordersTemplate(primary.border));
25
- const Card = /*#__PURE__*/forwardRef(function Card(_ref3, ref) {
20
+ const Card = /*#__PURE__*/forwardRef(function Card(_ref2, ref) {
26
21
  let {
27
22
  children,
28
23
  variant = 'default',
29
24
  elevation = 'none',
30
- onClick,
31
25
  ...rest
32
- } = _ref3;
33
- const cursor = onClick ? 'pointer' : 'default';
26
+ } = _ref2;
34
27
  const cardVariant = variant === 'default' ? 'primary' : variant;
35
28
  const token = Card_tokens[cardVariant];
36
29
  const props = {
37
30
  ref,
38
31
  background: token.background,
39
- cursor,
40
32
  ...rest
41
33
  };
42
34
  return /*#__PURE__*/jsx(StyledCard, {
43
35
  elevation: elevation,
44
36
  ...props,
45
- onClick: onClick,
46
37
  children: children
47
38
  });
48
39
  });
@@ -25,11 +25,13 @@ const Checkbox = /*#__PURE__*/forwardRef(function Checkbox(_ref2, ref) {
25
25
  disabled = false,
26
26
  indeterminate,
27
27
  className,
28
+ style,
28
29
  ...rest
29
30
  } = _ref2;
30
31
  return label ? /*#__PURE__*/jsxs(StyledLabel, {
31
32
  disabled: disabled,
32
33
  className: className,
34
+ style: style,
33
35
  children: [/*#__PURE__*/jsx(CheckboxInput, { ...rest,
34
36
  disabled: disabled,
35
37
  ref: ref,
@@ -38,6 +40,8 @@ const Checkbox = /*#__PURE__*/forwardRef(function Checkbox(_ref2, ref) {
38
40
  children: label
39
41
  })]
40
42
  }) : /*#__PURE__*/jsx(CheckboxInput, { ...rest,
43
+ className: className,
44
+ style: style,
41
45
  disabled: disabled,
42
46
  ref: ref,
43
47
  indeterminate: indeterminate
@@ -87,6 +87,8 @@ const CheckboxInput = /*#__PURE__*/forwardRef(function CheckboxInput(_ref10, ref
87
87
  let {
88
88
  disabled = false,
89
89
  indeterminate,
90
+ style,
91
+ className,
90
92
  ...rest
91
93
  } = _ref10;
92
94
  const {
@@ -98,7 +100,9 @@ const CheckboxInput = /*#__PURE__*/forwardRef(function CheckboxInput(_ref10, ref
98
100
  const iconSize = 24;
99
101
  const fill = disabled ? checkbox.states.disabled.background : checkbox.background;
100
102
  const inputWrapperProps = {
101
- disabled
103
+ disabled,
104
+ style,
105
+ className
102
106
  };
103
107
  const inputProps = {
104
108
  ref,
@@ -70,7 +70,7 @@ const findIcon = (name, data, size) => {
70
70
 
71
71
  const Icon = /*#__PURE__*/forwardRef(function Icon(_ref4, ref) {
72
72
  let {
73
- size = 24,
73
+ size,
74
74
  color = 'currentColor',
75
75
  name,
76
76
  rotation,