@equinor/eds-core-react 0.45.0 → 0.46.0

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 (54) hide show
  1. package/dist/eds-core-react.cjs +50 -64
  2. package/dist/esm/components/Autocomplete/Autocomplete.js +5 -6
  3. package/dist/esm/components/Autocomplete/Option.js +4 -4
  4. package/dist/esm/components/Banner/Banner.js +3 -3
  5. package/dist/esm/components/Breadcrumbs/Breadcrumb.js +1 -1
  6. package/dist/esm/components/Button/Button.js +20 -11
  7. package/dist/esm/components/Button/ButtonGroup/ButtonGroup.js +1 -1
  8. package/dist/esm/components/Button/ButtonGroup/ButtonGroup.tokens.js +0 -1
  9. package/dist/esm/components/Button/tokens/index.js +12 -12
  10. package/dist/esm/components/Checkbox/Input.js +1 -1
  11. package/dist/esm/components/Datepicker/DatePicker.js +1 -1
  12. package/dist/esm/components/Datepicker/DateRangePicker.js +1 -1
  13. package/dist/esm/components/Datepicker/calendars/CalendarCell.js +1 -1
  14. package/dist/esm/components/Datepicker/utils/get-calendar-date.js +1 -1
  15. package/dist/esm/components/Dialog/Dialog.js +3 -3
  16. package/dist/esm/components/EdsProvider/eds.context.js +1 -1
  17. package/dist/esm/components/Input/Input.js +1 -1
  18. package/dist/esm/components/InputWrapper/HelperText/HelperText.token.js +2 -6
  19. package/dist/esm/components/InputWrapper/InputWrapper.js +1 -1
  20. package/dist/esm/components/Label/Label.tokens.js +1 -4
  21. package/dist/esm/components/Menu/Menu.context.js +1 -1
  22. package/dist/esm/components/Menu/Menu.js +2 -2
  23. package/dist/esm/components/Menu/MenuItem.js +1 -1
  24. package/dist/esm/components/Pagination/Pagination.js +1 -1
  25. package/dist/esm/components/Paper/Paper.js +1 -1
  26. package/dist/esm/components/Popover/Popover.js +4 -4
  27. package/dist/esm/components/Progress/Circular/CircularProgress.js +1 -1
  28. package/dist/esm/components/Progress/Star/StarProgress.js +1 -1
  29. package/dist/esm/components/Radio/Radio.js +1 -1
  30. package/dist/esm/components/Search/Search.js +1 -1
  31. package/dist/esm/components/Select/NativeSelect.js +2 -2
  32. package/dist/esm/components/SideBar/SideBar.js +2 -2
  33. package/dist/esm/components/SideBar/SideBarAccordion/index.js +1 -1
  34. package/dist/esm/components/Slider/Slider.js +10 -9
  35. package/dist/esm/components/Slider/Slider.tokens.js +2 -6
  36. package/dist/esm/components/Slider/SliderInput.js +3 -3
  37. package/dist/esm/components/Snackbar/Snackbar.js +3 -3
  38. package/dist/esm/components/Switch/Switch.js +2 -2
  39. package/dist/esm/components/Switch/SwitchDefault.js +1 -1
  40. package/dist/esm/components/Switch/SwitchSmall.js +1 -1
  41. package/dist/esm/components/Table/DataCell/DataCell.js +2 -2
  42. package/dist/esm/components/Table/FooterCell/FooterCell.js +2 -2
  43. package/dist/esm/components/Table/HeaderCell/HeaderCell.js +3 -3
  44. package/dist/esm/components/TableOfContents/TableOfContents.js +3 -3
  45. package/dist/esm/components/TextField/TextField.js +2 -3
  46. package/dist/esm/components/Tooltip/Tooltip.js +2 -2
  47. package/dist/esm/components/Tooltip/Tooltip.tokens.js +1 -11
  48. package/dist/esm/components/TopBar/TopBar.js +3 -3
  49. package/dist/esm/components/Typography/Typography.js +1 -1
  50. package/dist/types/components/Autocomplete/Autocomplete.d.ts +2 -2
  51. package/dist/types/components/Autocomplete/Option.d.ts +3 -0
  52. package/dist/types/components/Banner/BannerMessage.d.ts +5 -4
  53. package/dist/types/components/TextField/TextField.d.ts +1 -1
  54. package/package.json +32 -32
@@ -988,6 +988,16 @@ const ButtonBase = styled__default.default.button.withConfig({
988
988
  } = states;
989
989
  return styled.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;}", " ", " ", " &::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,&[aria-disabled='true']{cursor:not-allowed;background:", ";", ";", ";@media (hover:hover) and (pointer:fine){&:hover{background:", ";}}}"], theme.background, theme.height, theme.width, edsUtils.spacingsTemplate(theme.spacings), edsUtils.bordersTemplate(theme.border), edsUtils.typographyTemplate(theme.typography), clickbound?.offset?.top, clickbound?.offset?.left, clickbound?.width, clickbound?.height, hover.background, hover.typography?.color, edsUtils.bordersTemplate(hover?.border), edsUtils.outlineTemplate(focus.outline), edsUtils.outlineTemplate(focus.outline), disabled.background, edsUtils.bordersTemplate(disabled.border), edsUtils.typographyTemplate(disabled.typography), disabled.background);
990
990
  });
991
+ const getElementType$1 = (disabled, customType, href) => {
992
+ if (disabled) return 'button';
993
+ if (customType) return customType;
994
+ if (href) return 'a';
995
+ return 'button';
996
+ };
997
+ const getButtonType = (href, customElementType) => {
998
+ if (href || customElementType) return undefined;
999
+ return 'button';
1000
+ };
991
1001
  const Button$2 = /*#__PURE__*/react.forwardRef(function Button({
992
1002
  color = 'primary',
993
1003
  variant = 'contained',
@@ -1004,25 +1014,24 @@ const Button$2 = /*#__PURE__*/react.forwardRef(function Button({
1004
1014
  const token = edsUtils.useToken({
1005
1015
  density
1006
1016
  }, getToken$1(variant, color));
1007
- const as = href && !disabled ? 'a' : other.as ? other.as : 'button';
1008
- const type = href || other.as ? undefined : 'button';
1009
- tabIndex = disabled ? -1 : tabIndex;
1017
+ const as = getElementType$1(disabled, other.as, href);
1018
+ const type = getButtonType(href, other.as);
1019
+ const adjustedTabIndex = disabled ? -1 : tabIndex;
1010
1020
  const buttonProps = {
1011
1021
  ref,
1012
- as,
1013
1022
  href,
1014
1023
  type,
1015
1024
  disabled,
1016
- tabIndex,
1017
- ...other
1025
+ tabIndex: adjustedTabIndex,
1026
+ ...other,
1027
+ as
1018
1028
  };
1029
+ const Container = fullWidth ? InnerFullWidth : Inner;
1019
1030
  return /*#__PURE__*/jsxRuntime.jsx(styled.ThemeProvider, {
1020
1031
  theme: token,
1021
1032
  children: /*#__PURE__*/jsxRuntime.jsx(ButtonBase, {
1022
1033
  ...buttonProps,
1023
- children: fullWidth ? /*#__PURE__*/jsxRuntime.jsx(InnerFullWidth, {
1024
- children: children
1025
- }) : /*#__PURE__*/jsxRuntime.jsx(Inner, {
1034
+ children: /*#__PURE__*/jsxRuntime.jsx(Container, {
1026
1035
  children: children
1027
1036
  })
1028
1037
  })
@@ -1038,7 +1047,6 @@ const {
1038
1047
  } = edsTokens.tokens;
1039
1048
  const group = {
1040
1049
  border: {
1041
- type: 'border',
1042
1050
  radius: borderRadius$8
1043
1051
  }
1044
1052
  };
@@ -1046,7 +1054,7 @@ const group = {
1046
1054
  const {
1047
1055
  border: border$5
1048
1056
  } = group;
1049
- const radius$1 = border$5.type === 'border' && border$5.radius;
1057
+ const radius$1 = border$5.radius;
1050
1058
  const ButtonGroupBase = styled__default.default.div.withConfig({
1051
1059
  displayName: "ButtonGroup__ButtonGroupBase",
1052
1060
  componentId: "sc-1fn8jon-0"
@@ -1109,19 +1117,9 @@ const tooltip = {
1109
1117
  radius: borderRadius$7
1110
1118
  },
1111
1119
  entities: {
1112
- tooltip: {
1113
- height: spacingXlarge
1114
- },
1115
1120
  arrow: {
1116
1121
  width: '6px',
1117
- height: spacingSmall$4,
1118
- spacings: {
1119
- bottom: '-6px',
1120
- top: '-6px',
1121
- left: '-6px',
1122
- right: '-6px'
1123
- }
1124
- }
1122
+ height: spacingSmall$4}
1125
1123
  },
1126
1124
  spacings: {
1127
1125
  left: spacingSmall$4,
@@ -1878,7 +1876,7 @@ const StyledTableCell$1 = styled__default.default.th.withConfig({
1878
1876
  const CellInner$1 = styled__default.default.div.withConfig({
1879
1877
  displayName: "HeaderCell__CellInner",
1880
1878
  componentId: "sc-18w2o3a-1"
1881
- })(["display:flex;align-items:center;"]);
1879
+ })(["display:flex;align-items:center;height:100%;"]);
1882
1880
  const TableHeaderCell = /*#__PURE__*/react.forwardRef(function TableHeaderCell({
1883
1881
  children,
1884
1882
  sort,
@@ -2261,10 +2259,7 @@ const label = {
2261
2259
  },
2262
2260
  spacings: {
2263
2261
  left: comfortable$5.small,
2264
- right: comfortable$5.small,
2265
- top: '6px',
2266
- bottom: '6px'
2267
- },
2262
+ right: comfortable$5.small},
2268
2263
  states: {
2269
2264
  disabled: {
2270
2265
  typography: {
@@ -2284,7 +2279,7 @@ const Text$3 = styled__default.default.span.withConfig({
2284
2279
  displayName: "Label__Text",
2285
2280
  componentId: "sc-1gi2bcn-1"
2286
2281
  })(["margin:0;"]);
2287
- const Label$3 = /*#__PURE__*/react.forwardRef(function Label(props, ref) {
2282
+ const Label$2 = /*#__PURE__*/react.forwardRef(function Label(props, ref) {
2288
2283
  const {
2289
2284
  label = '',
2290
2285
  meta,
@@ -2322,15 +2317,11 @@ const helperText = {
2322
2317
  comfortable: {
2323
2318
  left: comfortable$4.small,
2324
2319
  right: comfortable$4.small,
2325
- top: comfortable$4.small,
2326
- bottom: '6px'
2327
- },
2320
+ top: comfortable$4.small},
2328
2321
  compact: {
2329
2322
  left: comfortable$4.small,
2330
2323
  right: comfortable$4.small,
2331
- top: comfortable$4.xx_small,
2332
- bottom: '6px'
2333
- }
2324
+ top: comfortable$4.xx_small}
2334
2325
  }
2335
2326
  };
2336
2327
 
@@ -2554,7 +2545,7 @@ const HelperText$1 = styled__default.default(TextfieldHelperText).withConfig({
2554
2545
  displayName: "InputWrapper__HelperText",
2555
2546
  componentId: "sc-v6o9z1-1"
2556
2547
  })(["margin-top:8px;margin-left:8px;"]);
2557
- const Label$2 = styled__default.default(Label$3).withConfig({
2548
+ const Label$1 = styled__default.default(Label$2).withConfig({
2558
2549
  displayName: "InputWrapper__Label",
2559
2550
  componentId: "sc-v6o9z1-2"
2560
2551
  })(["margin-left:8px;margin-right:8px;"]);
@@ -2589,7 +2580,7 @@ const InputWrapper$2 = /*#__PURE__*/react.forwardRef(function InputWrapper({
2589
2580
  children: /*#__PURE__*/jsxRuntime.jsxs(Container$5, {
2590
2581
  ...other,
2591
2582
  ref: ref,
2592
- children: [hasLabel && /*#__PURE__*/jsxRuntime.jsx(Label$2, {
2583
+ children: [hasLabel && /*#__PURE__*/jsxRuntime.jsx(Label$1, {
2593
2584
  label,
2594
2585
  ...labelProps
2595
2586
  }), children, hasHelperText && /*#__PURE__*/jsxRuntime.jsx(HelperText$1, {
@@ -3045,7 +3036,7 @@ const TextField = /*#__PURE__*/react.forwardRef(function TextField({
3045
3036
  })]
3046
3037
  }),
3047
3038
  rowsMax,
3048
- ref: inputRef || textareaRef,
3039
+ ref: ref || inputRef || textareaRef,
3049
3040
  $multiline: multiline,
3050
3041
  ...other
3051
3042
  };
@@ -3056,7 +3047,6 @@ const TextField = /*#__PURE__*/react.forwardRef(function TextField({
3056
3047
  disabled
3057
3048
  };
3058
3049
  const containerProps = {
3059
- ref,
3060
3050
  className,
3061
3051
  style: {
3062
3052
  width: '100%',
@@ -5613,11 +5603,9 @@ const slider = {
5613
5603
  background: indicatorColor,
5614
5604
  states: {
5615
5605
  hover: {
5616
- background: primaryHover$1
5617
- },
5606
+ },
5618
5607
  disabled: {
5619
- background: backgroundBorderDisabled
5620
- }
5608
+ }
5621
5609
  }
5622
5610
  }
5623
5611
  },
@@ -5669,7 +5657,6 @@ const slider = {
5669
5657
  hover: {
5670
5658
  background: primaryHoverAlt$3,
5671
5659
  border: {
5672
- type: 'border',
5673
5660
  color: primaryHover$1
5674
5661
  }
5675
5662
  }
@@ -5694,7 +5681,6 @@ const slider = {
5694
5681
  disabled: {
5695
5682
  background: backgroundColorDisabled,
5696
5683
  border: {
5697
- type: 'border',
5698
5684
  color: backgroundColorMedium$1
5699
5685
  }
5700
5686
  }
@@ -5754,9 +5740,9 @@ const {
5754
5740
  } = slider;
5755
5741
  const track$1 = styled.css(["width:100%;height:100%;cursor:pointer;background:none;"]);
5756
5742
  const thumb = styled.css(["", " height:", ";width:", ";background:", ";cursor:pointer;position:relative;z-index:1;"], edsUtils.bordersTemplate(handle$1.border), handle$1.height, handle$1.width, handle$1.background);
5757
- const thumbHover = styled.css(["@media (hover:hover) and (pointer:fine){box-shadow:0px 0px 0px 6px ", ";border-color:", ";}"], handle$1.states.hover.background, handle$1.states.hover.border.type === 'border' && handle$1.states.hover.border.color);
5743
+ const thumbHover = styled.css(["@media (hover:hover) and (pointer:fine){box-shadow:0px 0px 0px 6px ", ";border-color:", ";}"], handle$1.states.hover.background, handle$1.states.hover.border.color);
5758
5744
  const thumbHoverAndDisabled = styled.css(["@media (hover:hover) and (pointer:fine){cursor:not-allowed;box-shadow:none;}"]);
5759
- const thumbDisabled = styled.css(["background-color:", ";border-color:", ";"], _disabled.background, _disabled.border.type === 'border' && _disabled.border.color);
5745
+ const thumbDisabled = styled.css(["background-color:", ";border-color:", ";"], _disabled.background, _disabled.border.color);
5760
5746
  const StyledSliderInput = styled__default.default.input.attrs(() => ({
5761
5747
  type: 'range'
5762
5748
  })).withConfig({
@@ -5805,10 +5791,9 @@ const {
5805
5791
  output
5806
5792
  }
5807
5793
  } = slider;
5808
- const fakeTrackBg = styled.css(["background-image:url(\"data:image/svg+xml,<svg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'><rect x='0' y='11' fill='", "' width='100%' height='4' rx='2' /></svg>\");background-size:cover;background-repeat:no-repeat;"], track.background);
5809
- const fakeTrackBgHover = styled.css({
5810
- backgroundImage: `url("data:image/svg+xml,<svg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'><rect x='0' y='11' fill='${track.states.hover.background}' width='100%' height='4' rx='2' /></svg>")`
5811
- });
5794
+ const encodedTrackColor = encodeURIComponent(track.background);
5795
+ const encodedHoverColor = encodeURIComponent(track.states.hover.background);
5796
+ const fakeTrackBg = styled.css(["background-image:url(\"data:image/svg+xml,<svg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'><rect x='0' y='11' fill='", "' width='100%' height='4' rx='2' /></svg>\");background-size:cover;background-repeat:no-repeat;"], encodedTrackColor);
5812
5797
  const trackFill = styled.css(["grid-column:1 / span 2;grid-row:2;height:", ";margin-bottom:", ";align-self:end;content:'';"], track.height, track.spacings.bottom);
5813
5798
  const wrapperGrid = styled.css(["display:grid;grid-template-rows:max-content 24px;grid-template-columns:1fr 1fr;width:100%;position:relative;"]);
5814
5799
  const RangeWrapper = styled__default.default.div.attrs(({
@@ -5829,13 +5814,14 @@ const RangeWrapper = styled__default.default.div.attrs(({
5829
5814
  '--max': $max,
5830
5815
  '--showTooltip': $labelAlwaysOn ? 1 : 0,
5831
5816
  '--background': $disabled ? track.entities.indicator.states.disabled.background : $hideActiveTrack ? 'transparent' : track.entities.indicator.background,
5832
- '--background-hover': $hideActiveTrack ? 'transparent' : track.entities.indicator.states.hover.background,
5833
5817
  ...style
5834
5818
  }
5835
5819
  })).withConfig({
5836
5820
  displayName: "Slider__RangeWrapper",
5837
5821
  componentId: "sc-n1grrg-0"
5838
- })(["--dif:calc(var(--max) - var(--min));--realWidth:calc(100% - 12px);", " ", " &::before,&::after{", ";background:var(--background);}&::before{margin-left:calc( calc(", " / 2) + (var(--a) - var(--min)) / var(--dif) * var(--realWidth) );width:calc((var(--b) - var(--a)) / var(--dif) * var(--realWidth));}&::after{margin-left:calc( calc(", " / 2) + (var(--b) - var(--min)) / var(--dif) * var(--realWidth) );width:calc((var(--a) - var(--b)) / var(--dif) * var(--realWidth));}&:has(:focus-visible),&:hover{& > output{--showTooltip:1;--tooltip-background:", ";}}@media (hover:hover) and (pointer:fine){&:hover:not([data-disabled]){", " &::before,&::after{background:var(--background-hover);}}}", ";", ";"], wrapperGrid, fakeTrackBg, trackFill, handle.width, handle.width, output.states.hover.background, fakeTrackBgHover, ({
5822
+ })(["--dif:calc(var(--max) - var(--min));--realWidth:calc(100% - 12px);", " ", " &::before,&::after{", ";background:var(--background);}&::before{margin-left:calc( calc(", " / 2) + (var(--a) - var(--min)) / var(--dif) * var(--realWidth) );width:calc((var(--b) - var(--a)) / var(--dif) * var(--realWidth));}&::after{margin-left:calc( calc(", " / 2) + (var(--b) - var(--min)) / var(--dif) * var(--realWidth) );width:calc((var(--a) - var(--b)) / var(--dif) * var(--realWidth));}&:has(:focus-visible),&:hover{& > output{--showTooltip:1;--tooltip-background:", ";}}@media (hover:hover) and (pointer:fine){&:hover:not([data-disabled]){background-image:url(\"data:image/svg+xml,<svg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'><rect x='0' y='11' fill='", "' width='100%' height='4' rx='2' /></svg>\");&::before,&::after{background:", ";}}}", ";", ";"], wrapperGrid, fakeTrackBg, trackFill, handle.width, handle.width, output.states.hover.background, encodedHoverColor, ({
5823
+ $hideActiveTrack
5824
+ }) => $hideActiveTrack ? 'transparent' : track.entities.indicator.states.hover.background, ({
5839
5825
  $touchNavigation
5840
5826
  }) => $touchNavigation && styled.css(["& > input[type='range']{pointer-events:none;}& > input[type='range']::-webkit-slider-thumb{pointer-events:auto;}& > input[type='range']::-moz-range-thumb{pointer-events:auto;}"]), ({
5841
5827
  $labelBelow
@@ -5856,13 +5842,14 @@ const Wrapper = styled__default.default.div.attrs(({
5856
5842
  '--value': value,
5857
5843
  '--showTooltip': $labelAlwaysOn ? 1 : 0,
5858
5844
  '--background': $disabled ? track.entities.indicator.states.disabled.background : $hideActiveTrack ? 'transparent' : track.entities.indicator.background,
5859
- '--background-hover': $hideActiveTrack ? 'transparent' : track.entities.indicator.states.hover.background,
5860
5845
  ...style
5861
5846
  }
5862
5847
  })).withConfig({
5863
5848
  displayName: "Slider__Wrapper",
5864
5849
  componentId: "sc-n1grrg-1"
5865
- })(["--dif:calc(var(--max) - var(--min));--realWidth:calc(100% - 12px);", " ", " &::after{", " background:var(--background)}&::after{margin-right:calc( (var(--max) - var(--value)) / var(--dif) * var(--realWidth) );margin-left:3px;}&:has(:focus-visible),&:hover{& > output{--showTooltip:1;--tooltip-background:", ";}}@media (hover:hover) and (pointer:fine){&:hover:not([data-disabled]){", " &::after{background:var(--background-hover);}}", ";}"], wrapperGrid, fakeTrackBg, trackFill, output.states.hover.background, fakeTrackBgHover, ({
5850
+ })(["--dif:calc(var(--max) - var(--min));--realWidth:calc(100% - 12px);", " ", " &::after{", " background:var(--background)}&::after{margin-right:calc( (var(--max) - var(--value)) / var(--dif) * var(--realWidth) );margin-left:3px;}&:has(:focus-visible),&:hover{& > output{--showTooltip:1;--tooltip-background:", ";}}@media (hover:hover) and (pointer:fine){&:hover:not([data-disabled]){background-image:url(\"data:image/svg+xml,<svg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'><rect x='0' y='11' fill='", "' width='100%' height='4' rx='2' /></svg>\");&::after{background:", ";}}", ";}"], wrapperGrid, fakeTrackBg, trackFill, output.states.hover.background, encodedHoverColor, ({
5851
+ $hideActiveTrack
5852
+ }) => $hideActiveTrack ? 'transparent' : track.entities.indicator.states.hover.background, ({
5866
5853
  $labelBelow
5867
5854
  }) => $labelBelow && styled.css(["& > output{top:calc(100% + 1px);bottom:unset;}"]));
5868
5855
  const WrapperGroupLabel = styled__default.default.div.withConfig({
@@ -8454,7 +8441,7 @@ const NativeSelect = /*#__PURE__*/react.forwardRef(function NativeSelect({
8454
8441
  theme: token,
8455
8442
  children: /*#__PURE__*/jsxRuntime.jsxs(Container$3, {
8456
8443
  ...containerProps,
8457
- children: [showLabel && /*#__PURE__*/jsxRuntime.jsx(Label$3, {
8444
+ children: [showLabel && /*#__PURE__*/jsxRuntime.jsx(Label$2, {
8458
8445
  ...labelProps
8459
8446
  }), /*#__PURE__*/jsxRuntime.jsx(StyledSelect, {
8460
8447
  ...selectProps,
@@ -9251,7 +9238,7 @@ const StyledLabel = styled__default.default.label.withConfig({
9251
9238
  }) => $isDisabled ? 'not-allowed' : 'pointer', ({
9252
9239
  $size
9253
9240
  }) => $size === 'small' ? '12px' : '8px');
9254
- const Label$1 = styled__default.default.span.withConfig({
9241
+ const Label = styled__default.default.span.withConfig({
9255
9242
  displayName: "Switch__Label",
9256
9243
  componentId: "sc-sdaahx-1"
9257
9244
  })(({
@@ -9288,7 +9275,7 @@ const Switch = /*#__PURE__*/react.forwardRef(function Switch({
9288
9275
  disabled: disabled,
9289
9276
  ...rest,
9290
9277
  ref: ref
9291
- }), label && /*#__PURE__*/jsxRuntime.jsx(Label$1, {
9278
+ }), label && /*#__PURE__*/jsxRuntime.jsx(Label, {
9292
9279
  children: label
9293
9280
  })]
9294
9281
  }) : size === 'small' ? /*#__PURE__*/jsxRuntime.jsx(SwitchSmall, {
@@ -9461,8 +9448,8 @@ const StyledListItem = styled__default.default.li.withConfig({
9461
9448
  const backgroundColor = $highlighted === 'true' ? theme.states.hover.background : $active === 'true' ? theme.states.active.background : theme.background;
9462
9449
  return styled.css(["display:flex;grid-area:1 / -1;align-items:center;align-self:start;margin:0;list-style:none;background-color:", ";user-select:none;overflow:hidden;touch-action:manipulation;z-index:3;cursor:", ";", " ", " ", ""], backgroundColor, $highlighted === 'true' ? 'pointer' : 'default', edsUtils.typographyTemplate(theme.typography), edsUtils.spacingsTemplate(theme.spacings), $isdisabled === 'true' ? styled.css(["color:", ";"], theme.states.disabled.typography.color) : '');
9463
9450
  });
9464
- const Label = styled__default.default.span.withConfig({
9465
- displayName: "Option__Label",
9451
+ const AutocompleteOptionLabel = styled__default.default.span.withConfig({
9452
+ displayName: "Option__AutocompleteOptionLabel",
9466
9453
  componentId: "sc-1ly11zu-1"
9467
9454
  })(({
9468
9455
  theme,
@@ -9505,7 +9492,7 @@ function AutocompleteOptionInner(props, ref) {
9505
9492
  }
9506
9493
  }), optionComponent ? /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
9507
9494
  children: optionComponent
9508
- }) : /*#__PURE__*/jsxRuntime.jsx(Label, {
9495
+ }) : /*#__PURE__*/jsxRuntime.jsx(AutocompleteOptionLabel, {
9509
9496
  $multiline: multiline,
9510
9497
  children: value
9511
9498
  })]
@@ -9694,7 +9681,6 @@ function AutocompleteInner(props, ref) {
9694
9681
  return _itemCompare;
9695
9682
  }, [_itemCompare, _itemToKey]);
9696
9683
  const itemToKey = react.useCallback(item => {
9697
- console.log(`item is`, item);
9698
9684
  return _itemToKey ? _itemToKey(item) : item;
9699
9685
  }, [_itemToKey]);
9700
9686
 
@@ -9706,6 +9692,7 @@ function AutocompleteInner(props, ref) {
9706
9692
  const [_availableItems, setAvailableItems] = react.useState(inputOptions);
9707
9693
  const [typedInputValue, setTypedInputValue] = react.useState('');
9708
9694
  const inputRef = react.useRef(null);
9695
+ react.useImperativeHandle(ref, () => inputRef.current);
9709
9696
  const showSelectAll = react.useMemo(() => {
9710
9697
  if (!multiple && allowSelectAll) {
9711
9698
  throw new Error(`allowSelectAll can only be used with multiple`);
@@ -10250,8 +10237,7 @@ function AutocompleteInner(props, ref) {
10250
10237
  children: /*#__PURE__*/jsxRuntime.jsxs(Container$2, {
10251
10238
  className: className,
10252
10239
  style: style,
10253
- ref: ref,
10254
- children: [/*#__PURE__*/jsxRuntime.jsx(Label$3, {
10240
+ children: [/*#__PURE__*/jsxRuntime.jsx(Label$2, {
10255
10241
  ...getLabelProps(),
10256
10242
  label: label,
10257
10243
  meta: meta,
@@ -12493,7 +12479,7 @@ exports.EdsProvider = EdsProvider;
12493
12479
  exports.Icon = Icon$1;
12494
12480
  exports.Input = Input$4;
12495
12481
  exports.InputWrapper = InputWrapper$2;
12496
- exports.Label = Label$3;
12482
+ exports.Label = Label$2;
12497
12483
  exports.LinearProgress = LinearProgress;
12498
12484
  exports.List = List$1;
12499
12485
  exports.ListItem = ListItem$2;
@@ -1,23 +1,23 @@
1
- import { forwardRef, useMemo, useCallback, useState, useRef, useEffect } from 'react';
1
+ import { forwardRef, useMemo, useCallback, useState, useRef, useImperativeHandle, useEffect } from 'react';
2
2
  import { useMultipleSelection, useCombobox } from 'downshift';
3
3
  import { useVirtualizer } from '@tanstack/react-virtual';
4
- import styled, { css, ThemeProvider } from 'styled-components';
4
+ import styled, { ThemeProvider, css } from 'styled-components';
5
5
  import { Button } from '../Button/index.js';
6
6
  import { List } from '../List/index.js';
7
7
  import { Icon } from '../Icon/index.js';
8
8
  import { Progress } from '../Progress/index.js';
9
9
  import { close, arrow_drop_up, arrow_drop_down } from '@equinor/eds-icons';
10
10
  import { multiSelect, selectTokens } from './Autocomplete.tokens.js';
11
- import { bordersTemplate, useToken, useIsomorphicLayoutEffect } from '@equinor/eds-utils';
11
+ import { useToken, useIsomorphicLayoutEffect, bordersTemplate } from '@equinor/eds-utils';
12
12
  import { AutocompleteOption } from './Option.js';
13
13
  import { useFloating, offset, flip, size, useInteractions, autoUpdate } from '@floating-ui/react';
14
14
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
15
15
  import pickBy from '../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/pickBy.js';
16
16
  import mergeWith from '../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/mergeWith.js';
17
- import { HelperText as TextfieldHelperText } from '../InputWrapper/HelperText/HelperText.js';
18
17
  import { useEds } from '../EdsProvider/eds.context.js';
19
18
  import { Label } from '../Label/Label.js';
20
19
  import { Input } from '../Input/Input.js';
20
+ import { HelperText as TextfieldHelperText } from '../InputWrapper/HelperText/HelperText.js';
21
21
 
22
22
  const Container = styled.div.withConfig({
23
23
  displayName: "Autocomplete__Container",
@@ -200,7 +200,6 @@ function AutocompleteInner(props, ref) {
200
200
  return _itemCompare;
201
201
  }, [_itemCompare, _itemToKey]);
202
202
  const itemToKey = useCallback(item => {
203
- console.log(`item is`, item);
204
203
  return _itemToKey ? _itemToKey(item) : item;
205
204
  }, [_itemToKey]);
206
205
 
@@ -212,6 +211,7 @@ function AutocompleteInner(props, ref) {
212
211
  const [_availableItems, setAvailableItems] = useState(inputOptions);
213
212
  const [typedInputValue, setTypedInputValue] = useState('');
214
213
  const inputRef = useRef(null);
214
+ useImperativeHandle(ref, () => inputRef.current);
215
215
  const showSelectAll = useMemo(() => {
216
216
  if (!multiple && allowSelectAll) {
217
217
  throw new Error(`allowSelectAll can only be used with multiple`);
@@ -756,7 +756,6 @@ function AutocompleteInner(props, ref) {
756
756
  children: /*#__PURE__*/jsxs(Container, {
757
757
  className: className,
758
758
  style: style,
759
- ref: ref,
760
759
  children: [/*#__PURE__*/jsx(Label, {
761
760
  ...getLabelProps(),
762
761
  label: label,
@@ -16,8 +16,8 @@ const StyledListItem = styled.li.withConfig({
16
16
  const backgroundColor = $highlighted === 'true' ? theme.states.hover.background : $active === 'true' ? theme.states.active.background : theme.background;
17
17
  return css(["display:flex;grid-area:1 / -1;align-items:center;align-self:start;margin:0;list-style:none;background-color:", ";user-select:none;overflow:hidden;touch-action:manipulation;z-index:3;cursor:", ";", " ", " ", ""], backgroundColor, $highlighted === 'true' ? 'pointer' : 'default', typographyTemplate(theme.typography), spacingsTemplate(theme.spacings), $isdisabled === 'true' ? css(["color:", ";"], theme.states.disabled.typography.color) : '');
18
18
  });
19
- const Label = styled.span.withConfig({
20
- displayName: "Option__Label",
19
+ const AutocompleteOptionLabel = styled.span.withConfig({
20
+ displayName: "Option__AutocompleteOptionLabel",
21
21
  componentId: "sc-1ly11zu-1"
22
22
  })(({
23
23
  theme,
@@ -60,7 +60,7 @@ function AutocompleteOptionInner(props, ref) {
60
60
  }
61
61
  }), optionComponent ? /*#__PURE__*/jsx(Fragment, {
62
62
  children: optionComponent
63
- }) : /*#__PURE__*/jsx(Label, {
63
+ }) : /*#__PURE__*/jsx(AutocompleteOptionLabel, {
64
64
  $multiline: multiline,
65
65
  children: value
66
66
  })]
@@ -68,4 +68,4 @@ function AutocompleteOptionInner(props, ref) {
68
68
  }
69
69
  const AutocompleteOption = /*#__PURE__*/forwardRef(AutocompleteOptionInner);
70
70
 
71
- export { AutocompleteOption };
71
+ export { AutocompleteOption, AutocompleteOptionLabel };
@@ -1,12 +1,12 @@
1
1
  import { forwardRef, Children, isValidElement } from 'react';
2
- import styled, { css, ThemeProvider } from 'styled-components';
3
- import { spacingsTemplate, useToken } from '@equinor/eds-utils';
2
+ import styled, { ThemeProvider, css } from 'styled-components';
3
+ import { useToken, spacingsTemplate } from '@equinor/eds-utils';
4
4
  import { enabled } from './Banner.tokens.js';
5
5
  import { BannerIcon } from './BannerIcon.js';
6
6
  import { jsx, jsxs } from 'react/jsx-runtime';
7
- import { Divider } from '../Divider/Divider.js';
8
7
  import { useEds } from '../EdsProvider/eds.context.js';
9
8
  import { Paper } from '../Paper/Paper.js';
9
+ import { Divider } from '../Divider/Divider.js';
10
10
 
11
11
  const Content = styled.div.withConfig({
12
12
  displayName: "Banner__Content",
@@ -2,8 +2,8 @@ import { forwardRef, useMemo } from 'react';
2
2
  import styled, { css } from 'styled-components';
3
3
  import { breadcrumbs } from './Breadcrumbs.tokens.js';
4
4
  import { jsx } from 'react/jsx-runtime';
5
- import { Typography } from '../Typography/Typography.js';
6
5
  import { Tooltip } from '../Tooltip/Tooltip.js';
6
+ import { Typography } from '../Typography/Typography.js';
7
7
 
8
8
  const {
9
9
  states,
@@ -1,7 +1,7 @@
1
1
  import { forwardRef } from 'react';
2
- import styled, { css, ThemeProvider } from 'styled-components';
2
+ import styled, { ThemeProvider, css } from 'styled-components';
3
3
  import { token } from './tokens/index.js';
4
- import { spacingsTemplate, bordersTemplate, typographyTemplate, outlineTemplate, useToken } from '@equinor/eds-utils';
4
+ import { useToken, spacingsTemplate, bordersTemplate, typographyTemplate, outlineTemplate } from '@equinor/eds-utils';
5
5
  import { InnerFullWidth } from './InnerFullWidth.js';
6
6
  import { jsx } from 'react/jsx-runtime';
7
7
  import { useEds } from '../EdsProvider/eds.context.js';
@@ -53,6 +53,16 @@ const ButtonBase = styled.button.withConfig({
53
53
  } = states;
54
54
  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;}", " ", " ", " &::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,&[aria-disabled='true']{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?.offset?.top, clickbound?.offset?.left, clickbound?.width, clickbound?.height, hover.background, hover.typography?.color, bordersTemplate(hover?.border), outlineTemplate(focus.outline), outlineTemplate(focus.outline), disabled.background, bordersTemplate(disabled.border), typographyTemplate(disabled.typography), disabled.background);
55
55
  });
56
+ const getElementType = (disabled, customType, href) => {
57
+ if (disabled) return 'button';
58
+ if (customType) return customType;
59
+ if (href) return 'a';
60
+ return 'button';
61
+ };
62
+ const getButtonType = (href, customElementType) => {
63
+ if (href || customElementType) return undefined;
64
+ return 'button';
65
+ };
56
66
  const Button = /*#__PURE__*/forwardRef(function Button({
57
67
  color = 'primary',
58
68
  variant = 'contained',
@@ -69,25 +79,24 @@ const Button = /*#__PURE__*/forwardRef(function Button({
69
79
  const token = useToken({
70
80
  density
71
81
  }, getToken(variant, color));
72
- const as = href && !disabled ? 'a' : other.as ? other.as : 'button';
73
- const type = href || other.as ? undefined : 'button';
74
- tabIndex = disabled ? -1 : tabIndex;
82
+ const as = getElementType(disabled, other.as, href);
83
+ const type = getButtonType(href, other.as);
84
+ const adjustedTabIndex = disabled ? -1 : tabIndex;
75
85
  const buttonProps = {
76
86
  ref,
77
- as,
78
87
  href,
79
88
  type,
80
89
  disabled,
81
- tabIndex,
82
- ...other
90
+ tabIndex: adjustedTabIndex,
91
+ ...other,
92
+ as
83
93
  };
94
+ const Container = fullWidth ? InnerFullWidth : Inner;
84
95
  return /*#__PURE__*/jsx(ThemeProvider, {
85
96
  theme: token,
86
97
  children: /*#__PURE__*/jsx(ButtonBase, {
87
98
  ...buttonProps,
88
- children: fullWidth ? /*#__PURE__*/jsx(InnerFullWidth, {
89
- children: children
90
- }) : /*#__PURE__*/jsx(Inner, {
99
+ children: /*#__PURE__*/jsx(Container, {
91
100
  children: children
92
101
  })
93
102
  })
@@ -6,7 +6,7 @@ import { jsx } from 'react/jsx-runtime';
6
6
  const {
7
7
  border
8
8
  } = group;
9
- const radius = border.type === 'border' && border.radius;
9
+ const radius = border.radius;
10
10
  const ButtonGroupBase = styled.div.withConfig({
11
11
  displayName: "ButtonGroup__ButtonGroupBase",
12
12
  componentId: "sc-1fn8jon-0"
@@ -9,7 +9,6 @@ const {
9
9
  } = tokens;
10
10
  const group = {
11
11
  border: {
12
- type: 'border',
13
12
  radius: borderRadius
14
13
  }
15
14
  };
@@ -1,30 +1,30 @@
1
1
  import { primary, secondary, danger } from './contained.js';
2
- import { primary as primary$1, secondary as secondary$1, danger as danger$1 } from './outlined.js';
3
- import { primary as primary$2, secondary as secondary$2, danger as danger$2 } from './ghost.js';
2
+ import { primary as primary$2, secondary as secondary$2, danger as danger$2 } from './outlined.js';
3
+ import { primary as primary$4, secondary as secondary$4, danger as danger$4 } 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
+ import { primary as primary$1, secondary as secondary$1, danger as danger$1 } from './contained_icon.js';
6
6
 
7
7
  const token = {
8
8
  primary: {
9
9
  contained: primary,
10
- outlined: primary$1,
11
- ghost: primary$2,
10
+ outlined: primary$2,
11
+ ghost: primary$4,
12
12
  ghost_icon: primary$3,
13
- contained_icon: primary$4
13
+ contained_icon: primary$1
14
14
  },
15
15
  secondary: {
16
16
  contained: secondary,
17
- outlined: secondary$1,
18
- ghost: secondary$2,
17
+ outlined: secondary$2,
18
+ ghost: secondary$4,
19
19
  ghost_icon: secondary$3,
20
- contained_icon: secondary$4
20
+ contained_icon: secondary$1
21
21
  },
22
22
  danger: {
23
23
  contained: danger,
24
- outlined: danger$1,
25
- ghost: danger$2,
24
+ outlined: danger$2,
25
+ ghost: danger$4,
26
26
  ghost_icon: danger$3,
27
- contained_icon: danger$4
27
+ contained_icon: danger$1
28
28
  }
29
29
  };
30
30
 
@@ -2,7 +2,7 @@ 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
+ import { useToken, spacingsTemplate, outlineTemplate } from '@equinor/eds-utils';
6
6
  import { jsx, jsxs } from 'react/jsx-runtime';
7
7
  import { useEds } from '../EdsProvider/eds.context.js';
8
8
 
@@ -1,7 +1,7 @@
1
1
  import { forwardRef, useState, useRef, useCallback, useEffect } from 'react';
2
2
  import { Calendar } from './calendars/Calendar.js';
3
3
  import { DateField } from './fields/DateField.js';
4
- import { warning_outlined, calendar } from '@equinor/eds-icons';
4
+ import { calendar, warning_outlined } from '@equinor/eds-icons';
5
5
  import { useConvertedValidationFunctions } from './utils/useConvertedValidationFunctions.js';
6
6
  import { FieldWrapper } from './fields/FieldWrapper.js';
7
7
  import { Toggle } from './fields/Toggle.js';
@@ -1,6 +1,6 @@
1
1
  import { forwardRef, useState, useRef, useCallback, useEffect } from 'react';
2
2
  import { RangeCalendar } from './calendars/RangeCalendar.js';
3
- import { warning_outlined, calendar_date_range } from '@equinor/eds-icons';
3
+ import { calendar_date_range, warning_outlined } from '@equinor/eds-icons';
4
4
  import { useConvertedValidationFunctions } from './utils/useConvertedValidationFunctions.js';
5
5
  import { FieldWrapper } from './fields/FieldWrapper.js';
6
6
  import { Toggle } from './fields/Toggle.js';
@@ -3,8 +3,8 @@ import { tokens } from '@equinor/eds-tokens';
3
3
  import { useRef, useMemo } from 'react';
4
4
  import { useCalendarCell } from 'react-aria';
5
5
  import { jsx } from 'react/jsx-runtime';
6
- import { Typography } from '../../Typography/Typography.js';
7
6
  import { useEds } from '../../EdsProvider/eds.context.js';
7
+ import { Typography } from '../../Typography/Typography.js';
8
8
 
9
9
  const StyledCell = styled(Typography).withConfig({
10
10
  displayName: "CalendarCell__StyledCell",
@@ -1,4 +1,4 @@
1
- import { toCalendarDateTime, fromDate, toCalendarDate } from '@internationalized/date';
1
+ import { toCalendarDateTime, toCalendarDate, fromDate } from '@internationalized/date';
2
2
 
3
3
  const getCalendarDate = (value, timezone, showTimeInput = false) => {
4
4
  if (!value) return null;
@@ -1,10 +1,10 @@
1
1
  import { forwardRef, useRef, useMemo, useEffect } from 'react';
2
- import styled, { css, ThemeProvider } from 'styled-components';
3
- import { typographyTemplate, bordersTemplate, useToken, mergeRefs, useHideBodyScroll, useGlobalKeyPress } from '@equinor/eds-utils';
2
+ import styled, { ThemeProvider, css } from 'styled-components';
3
+ import { useToken, mergeRefs, useHideBodyScroll, useGlobalKeyPress, bordersTemplate, typographyTemplate } from '@equinor/eds-utils';
4
4
  import { dialog } from './Dialog.tokens.js';
5
5
  import { jsx } from 'react/jsx-runtime';
6
- import { Paper } from '../Paper/Paper.js';
7
6
  import { useEds } from '../EdsProvider/eds.context.js';
7
+ import { Paper } from '../Paper/Paper.js';
8
8
 
9
9
  const StyledDialog = styled(Paper).attrs({
10
10
  'aria-labelledby': 'eds-dialog-title',
@@ -1,4 +1,4 @@
1
- import { useState, useEffect, useContext, createContext } from 'react';
1
+ import { useContext, useState, useEffect, createContext } from 'react';
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
 
4
4
  const initalState = {