@equinor/eds-core-react 0.29.2-dev09022023 → 0.30.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.
@@ -2334,7 +2334,7 @@ var Container$3 = styled__default["default"].div.withConfig({
2334
2334
  readOnly = _ref.readOnly;
2335
2335
  var states = token.states,
2336
2336
  entities = token.entities;
2337
- return styled.css(["--eds-input-adornment-color:", ";--eds-input-color:", ";position:relative;height:", ";width:", ";display:flex;flex-direction:row;border:none;box-sizing:border-box;box-shadow:", ";background:var(--eds-input-background,", ");", " &:focus-within{--eds-input-adornment-color:", ";box-shadow:none;", "}", " ", ""], entities.adornment.typography.color, token.typography.color, token.height, token.width, token.boxShadow, token.background, edsUtils.outlineTemplate(token.outline), (_entities$adornment = entities.adornment) === null || _entities$adornment === void 0 ? void 0 : (_entities$adornment$s = _entities$adornment.states.focus) === null || _entities$adornment$s === void 0 ? void 0 : _entities$adornment$s.outline.color, edsUtils.outlineTemplate(states.focus.outline), disabled && styled.css(["--eds-input-adornment-color:", ";--eds-input-color:", ";cursor:not-allowed;box-shadow:none;"], states.disabled.typography.color, states.disabled.typography.color), readOnly && styled.css({
2337
+ return styled.css(["--eds-input-adornment-color:", ";--eds-input-color:", ";position:relative;height:", ";width:", ";display:flex;flex-direction:row;border:none;box-sizing:border-box;box-shadow:", ";background:var(--eds-input-background,", ");", " &:focus-within{--eds-input-adornment-color:", ";box-shadow:none;", "}", " ", " & > input{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}"], entities.adornment.typography.color, token.typography.color, token.height, token.width, token.boxShadow, token.background, edsUtils.outlineTemplate(token.outline), (_entities$adornment = entities.adornment) === null || _entities$adornment === void 0 ? void 0 : (_entities$adornment$s = _entities$adornment.states.focus) === null || _entities$adornment$s === void 0 ? void 0 : _entities$adornment$s.outline.color, edsUtils.outlineTemplate(states.focus.outline), disabled && styled.css(["--eds-input-adornment-color:", ";--eds-input-color:", ";cursor:not-allowed;box-shadow:none;"], states.disabled.typography.color, states.disabled.typography.color), readOnly && styled.css({
2338
2338
  background: states.readOnly.background,
2339
2339
  boxShadow: states.readOnly.boxShadow
2340
2340
  }));
@@ -2872,14 +2872,16 @@ var Accordion$1 = /*#__PURE__*/react.forwardRef(function Accordion(_ref, ref) {
2872
2872
  });
2873
2873
  });
2874
2874
 
2875
- var _excluded$15 = ["headerLevel", "chevronPosition", "index", "accordionId", "isExpanded", "children", "disabled"];
2875
+ var _excluded$15 = ["headerLevel", "chevronPosition", "index", "accordionId", "isExpanded", "onExpandedChange", "children", "disabled"];
2876
2876
  var AccordionItem = /*#__PURE__*/react.forwardRef(function AccordionItem(_ref, ref) {
2877
2877
  var headerLevel = _ref.headerLevel,
2878
2878
  chevronPosition = _ref.chevronPosition,
2879
2879
  _ref$index = _ref.index,
2880
2880
  index = _ref$index === void 0 ? 0 : _ref$index,
2881
2881
  accordionId = _ref.accordionId,
2882
- isExpanded = _ref.isExpanded,
2882
+ _ref$isExpanded = _ref.isExpanded,
2883
+ isExpanded = _ref$isExpanded === void 0 ? false : _ref$isExpanded,
2884
+ onExpandedChange = _ref.onExpandedChange,
2883
2885
  children = _ref.children,
2884
2886
  disabled = _ref.disabled,
2885
2887
  props = _objectWithoutProperties__default["default"](_ref, _excluded$15);
@@ -2887,14 +2889,20 @@ var AccordionItem = /*#__PURE__*/react.forwardRef(function AccordionItem(_ref, r
2887
2889
  _useState2 = _slicedToArray__default["default"](_useState, 2),
2888
2890
  expanded = _useState2[0],
2889
2891
  setExpanded = _useState2[1];
2892
+ var controlled = onExpandedChange != undefined;
2893
+ var activeExpandedState = controlled ? isExpanded : expanded;
2890
2894
  var toggleExpanded = function toggleExpanded() {
2891
- setExpanded(!expanded);
2895
+ if (controlled) {
2896
+ onExpandedChange(!isExpanded);
2897
+ } else {
2898
+ setExpanded(!expanded);
2899
+ }
2892
2900
  };
2893
2901
  var Children = react.Children.map(children, function (child, childIndex) {
2894
2902
  var headerId = "".concat(accordionId, "-header-").concat(index + 1);
2895
2903
  var panelId = "".concat(accordionId, "-panel-").concat(index + 1);
2896
2904
  return childIndex === 0 ? /*#__PURE__*/react.cloneElement(child, {
2897
- isExpanded: expanded,
2905
+ isExpanded: activeExpandedState,
2898
2906
  toggleExpanded: toggleExpanded,
2899
2907
  id: headerId,
2900
2908
  panelId: panelId,
@@ -2903,14 +2911,16 @@ var AccordionItem = /*#__PURE__*/react.forwardRef(function AccordionItem(_ref, r
2903
2911
  parentIndex: index,
2904
2912
  disabled: disabled
2905
2913
  }) : /*#__PURE__*/react.cloneElement(child, {
2906
- hidden: !expanded,
2914
+ hidden: !activeExpandedState,
2907
2915
  id: panelId,
2908
2916
  headerId: headerId
2909
2917
  });
2910
2918
  });
2911
2919
  react.useEffect(function () {
2912
- setExpanded(isExpanded);
2913
- }, [isExpanded]);
2920
+ if (!controlled) {
2921
+ setExpanded(isExpanded);
2922
+ }
2923
+ }, [isExpanded, controlled]);
2914
2924
  return /*#__PURE__*/jsxRuntime.jsx("div", _objectSpread__default["default"](_objectSpread__default["default"]({}, props), {}, {
2915
2925
  ref: ref,
2916
2926
  children: Children
@@ -4144,7 +4154,7 @@ var StyledDialogHeader = styled__default["default"].div.withConfig({
4144
4154
  componentId: "sc-mbwcos-0"
4145
4155
  })(function (_ref) {
4146
4156
  var theme = _ref.theme;
4147
- return styled.css(["display:flex;justify-content:space-betweene;algin-items:center;padding:", " ", " 0 ", ";"], theme.entities.children.spacings.top, theme.entities.children.spacings.right, theme.entities.children.spacings.left);
4157
+ return styled.css(["display:flex;justify-content:space-between;align-items:center;padding:", " ", " 0 ", ";"], theme.entities.children.spacings.top, theme.entities.children.spacings.right, theme.entities.children.spacings.left);
4148
4158
  });
4149
4159
  var StyledDivider$1 = styled__default["default"](Divider).withConfig({
4150
4160
  displayName: "DialogHeader__StyledDivider",
@@ -4900,17 +4910,16 @@ var _tokens$entities$2 = slider.entities,
4900
4910
  var StyledOutput = styled__default["default"].output.withConfig({
4901
4911
  displayName: "Output__StyledOutput",
4902
4912
  componentId: "sc-1dy945x-0"
4903
- })(["--val:", ";--realWidth:calc(100% - 12px);width:fit-content;position:relative;z-index:1;", " background:", ";padding:0 5px;top:", ";pointer-events:none;margin-left:calc((var(--val) - var(--min)) / var(--dif) * var(--realWidth));transform:translate(calc(-1 * calc(var(--realWidth) / 2)));grid-row:2;grid-column:1 / -1;"], function (_ref) {
4904
- var value = _ref.value;
4905
- return value;
4906
- }, edsUtils.typographyTemplate(output.typography), slider.background, track$2.spacings.top);
4907
- var Output = /*#__PURE__*/react.forwardRef(function Output(_ref2, ref) {
4908
- var children = _ref2.children,
4909
- value = _ref2.value,
4910
- htmlFor = _ref2.htmlFor;
4913
+ })(["--realWidth:calc(100% - 12px);width:fit-content;position:relative;z-index:1;", " background:", ";padding:0 5px;top:", ";pointer-events:none;margin-left:calc((var(--val) - var(--min)) / var(--dif) * var(--realWidth));transform:translate(calc(-1 * calc(var(--realWidth) / 2)));grid-row:2;grid-column:1 / -1;"], edsUtils.typographyTemplate(output.typography), slider.background, track$2.spacings.top);
4914
+ var Output = /*#__PURE__*/react.forwardRef(function Output(_ref, ref) {
4915
+ var children = _ref.children,
4916
+ value = _ref.value,
4917
+ htmlFor = _ref.htmlFor;
4911
4918
  return /*#__PURE__*/jsxRuntime.jsx(StyledOutput, {
4912
4919
  ref: ref,
4913
- value: value,
4920
+ style: {
4921
+ '--val': value
4922
+ },
4914
4923
  htmlFor: htmlFor,
4915
4924
  children: children
4916
4925
  });
@@ -4975,41 +4984,44 @@ var fakeTrackBgHover = styled.css({
4975
4984
  });
4976
4985
  var trackFill = styled.css(["grid-column:1 / span 2;grid-row:2;height:", ";margin-bottom:", ";align-self:end;content:'';"], track.height, track.spacings.bottom);
4977
4986
  var wrapperGrid = styled.css(["display:grid;grid-template-rows:max-content 24px;grid-template-columns:1fr 1fr;width:100%;position:relative;"]);
4978
- var RangeWrapper = styled__default["default"].div.withConfig({
4987
+ var RangeWrapper = styled__default["default"].div.attrs(function (_ref) {
4988
+ var $min = _ref.$min,
4989
+ $max = _ref.$max,
4990
+ valA = _ref.valA,
4991
+ valB = _ref.valB,
4992
+ disabled = _ref.disabled,
4993
+ style = _ref.style;
4994
+ return {
4995
+ style: _objectSpread__default["default"]({
4996
+ '--a': valA,
4997
+ '--b': valB,
4998
+ '--min': $min,
4999
+ '--max': $max,
5000
+ '--background': disabled ? track.entities.indicator.states.disabled.background : track.entities.indicator.background
5001
+ }, style)
5002
+ };
5003
+ }).withConfig({
4979
5004
  displayName: "Slider__RangeWrapper",
4980
5005
  componentId: "sc-n1grrg-0"
4981
- })(["--a:", ";--b:", ";--min:", ";--max:", ";--dif:calc(var(--max) - var(--min));--realWidth:calc(100% - 12px);", " ", " &::before,&::after{", " 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));}@media (hover:hover) and (pointer:fine){&:hover:not([disabled]){", " &::before,&::after{background:", ";}}}"], function (_ref) {
4982
- var valA = _ref.valA;
4983
- return valA;
4984
- }, function (_ref2) {
4985
- var valB = _ref2.valB;
4986
- return valB;
4987
- }, function (_ref3) {
4988
- var min = _ref3.min;
4989
- return min;
4990
- }, function (_ref4) {
4991
- var max = _ref4.max;
4992
- return max;
4993
- }, wrapperGrid, fakeTrackBg, trackFill, function (_ref5) {
4994
- var disabled = _ref5.disabled;
4995
- return disabled ? track.entities.indicator.states.disabled.background : track.entities.indicator.background;
4996
- }, handle.width, handle.width, fakeTrackBgHover, track.entities.indicator.states.hover.background);
4997
- var Wrapper = styled__default["default"].div.withConfig({
5006
+ })(["--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));}@media (hover:hover) and (pointer:fine){&:hover:not([disabled]){", " &::before,&::after{background:", ";}}}"], wrapperGrid, fakeTrackBg, trackFill, handle.width, handle.width, fakeTrackBgHover, track.entities.indicator.states.hover.background);
5007
+ var Wrapper = styled__default["default"].div.attrs(function (_ref2) {
5008
+ var $min = _ref2.$min,
5009
+ $max = _ref2.$max,
5010
+ value = _ref2.value,
5011
+ disabled = _ref2.disabled,
5012
+ style = _ref2.style;
5013
+ return {
5014
+ style: _objectSpread__default["default"]({
5015
+ '--min': $min,
5016
+ '--max': $max,
5017
+ '--value': value,
5018
+ '--background': disabled ? track.entities.indicator.states.disabled.background : track.entities.indicator.background
5019
+ }, style)
5020
+ };
5021
+ }).withConfig({
4998
5022
  displayName: "Slider__Wrapper",
4999
5023
  componentId: "sc-n1grrg-1"
5000
- })(["--min:", ";--max:", ";--dif:calc(var(--max) - var(--min));--value:", ";--realWidth:calc(100% - 12px);", " ", " &::after{", " background:", "}&::after{margin-right:calc( (var(--max) - var(--value)) / var(--dif) * var(--realWidth) );margin-left:3px;}@media (hover:hover) and (pointer:fine){&:hover:not([disabled]){", " &::after{background:", ";}}}"], function (_ref6) {
5001
- var min = _ref6.min;
5002
- return min;
5003
- }, function (_ref7) {
5004
- var max = _ref7.max;
5005
- return max;
5006
- }, function (_ref8) {
5007
- var value = _ref8.value;
5008
- return value;
5009
- }, wrapperGrid, fakeTrackBg, trackFill, function (_ref9) {
5010
- var disabled = _ref9.disabled;
5011
- return disabled ? track.entities.indicator.states.disabled.background : track.entities.indicator.background;
5012
- }, fakeTrackBgHover, track.entities.indicator.states.hover.background);
5024
+ })(["--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;}@media (hover:hover) and (pointer:fine){&:hover:not([disabled]){", " &::after{background:", ";}}}"], wrapperGrid, fakeTrackBg, trackFill, fakeTrackBgHover, track.entities.indicator.states.hover.background);
5013
5025
  var WrapperGroupLabel = styled__default["default"].div.withConfig({
5014
5026
  displayName: "Slider__WrapperGroupLabel",
5015
5027
  componentId: "sc-n1grrg-2"
@@ -5022,26 +5034,26 @@ var SrOnlyLabel = styled__default["default"].label.withConfig({
5022
5034
  displayName: "Slider__SrOnlyLabel",
5023
5035
  componentId: "sc-n1grrg-4"
5024
5036
  })(["position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;"]);
5025
- var Slider = /*#__PURE__*/react.forwardRef(function Slider(_ref10, ref) {
5026
- var _ref10$min = _ref10.min,
5027
- min = _ref10$min === void 0 ? 0 : _ref10$min,
5028
- _ref10$max = _ref10.max,
5029
- max = _ref10$max === void 0 ? 100 : _ref10$max,
5030
- _ref10$value = _ref10.value,
5031
- value = _ref10$value === void 0 ? [40, 60] : _ref10$value,
5032
- outputFunction = _ref10.outputFunction,
5033
- onChange = _ref10.onChange,
5034
- onChangeCommitted = _ref10.onChangeCommitted,
5035
- _ref10$minMaxDots = _ref10.minMaxDots,
5036
- minMaxDots = _ref10$minMaxDots === void 0 ? true : _ref10$minMaxDots,
5037
- _ref10$minMaxValues = _ref10.minMaxValues,
5038
- minMaxValues = _ref10$minMaxValues === void 0 ? true : _ref10$minMaxValues,
5039
- _ref10$step = _ref10.step,
5040
- step = _ref10$step === void 0 ? 1 : _ref10$step,
5041
- disabled = _ref10.disabled,
5042
- ariaLabelledby = _ref10.ariaLabelledby,
5043
- ariaLabelledbyNative = _ref10['aria-labelledby'],
5044
- rest = _objectWithoutProperties__default["default"](_ref10, _excluded$A);
5037
+ var Slider = /*#__PURE__*/react.forwardRef(function Slider(_ref3, ref) {
5038
+ var _ref3$min = _ref3.min,
5039
+ min = _ref3$min === void 0 ? 0 : _ref3$min,
5040
+ _ref3$max = _ref3.max,
5041
+ max = _ref3$max === void 0 ? 100 : _ref3$max,
5042
+ _ref3$value = _ref3.value,
5043
+ value = _ref3$value === void 0 ? [40, 60] : _ref3$value,
5044
+ outputFunction = _ref3.outputFunction,
5045
+ onChange = _ref3.onChange,
5046
+ onChangeCommitted = _ref3.onChangeCommitted,
5047
+ _ref3$minMaxDots = _ref3.minMaxDots,
5048
+ minMaxDots = _ref3$minMaxDots === void 0 ? true : _ref3$minMaxDots,
5049
+ _ref3$minMaxValues = _ref3.minMaxValues,
5050
+ minMaxValues = _ref3$minMaxValues === void 0 ? true : _ref3$minMaxValues,
5051
+ _ref3$step = _ref3.step,
5052
+ step = _ref3$step === void 0 ? 1 : _ref3$step,
5053
+ disabled = _ref3.disabled,
5054
+ ariaLabelledby = _ref3.ariaLabelledby,
5055
+ ariaLabelledbyNative = _ref3['aria-labelledby'],
5056
+ rest = _objectWithoutProperties__default["default"](_ref3, _excluded$A);
5045
5057
  var isRangeSlider = Array.isArray(value);
5046
5058
  var parsedValue = isRangeSlider ? value : [value];
5047
5059
  var _useState = react.useState(parsedValue),
@@ -5052,6 +5064,10 @@ var Slider = /*#__PURE__*/react.forwardRef(function Slider(_ref10, ref) {
5052
5064
  _useState4 = _slicedToArray__default["default"](_useState3, 2),
5053
5065
  sliderValue = _useState4[0],
5054
5066
  setSliderValue = _useState4[1];
5067
+ var _useState5 = react.useState(false),
5068
+ _useState6 = _slicedToArray__default["default"](_useState5, 2),
5069
+ mousePressed = _useState6[0],
5070
+ setMousePressed = _useState6[1];
5055
5071
  react.useEffect(function () {
5056
5072
  if (isRangeSlider) {
5057
5073
  if (value[0] !== initalValue[0] || value[1] !== initalValue[1]) {
@@ -5072,6 +5088,18 @@ var Slider = /*#__PURE__*/react.forwardRef(function Slider(_ref10, ref) {
5072
5088
  if (isRangeSlider) {
5073
5089
  var _newValue = sliderValue.slice();
5074
5090
  _newValue[valueArrIdx] = changedValue;
5091
+
5092
+ //Prevent min/max values from crossing eachother
5093
+ if (valueArrIdx === 0 && _newValue[0] >= _newValue[1]) {
5094
+ var _maxRange$current;
5095
+ _newValue[0] = _newValue[1];
5096
+ (_maxRange$current = maxRange.current) === null || _maxRange$current === void 0 ? void 0 : _maxRange$current.focus();
5097
+ }
5098
+ if (valueArrIdx === 1 && _newValue[1] <= _newValue[0]) {
5099
+ var _minRange$current;
5100
+ _newValue[1] = _newValue[0];
5101
+ (_minRange$current = minRange.current) === null || _minRange$current === void 0 ? void 0 : _minRange$current.focus();
5102
+ }
5075
5103
  setSliderValue(_newValue);
5076
5104
  if (onChange) {
5077
5105
  // Callback for provided onChange func
@@ -5100,18 +5128,18 @@ var Slider = /*#__PURE__*/react.forwardRef(function Slider(_ref10, ref) {
5100
5128
  };
5101
5129
  var findClosestRange = function findClosestRange(event) {
5102
5130
  var target = event.target;
5103
- if (target.type === 'output') {
5131
+ if (target.type === 'output' || mousePressed) {
5104
5132
  return;
5105
5133
  }
5106
5134
  var bounds = target.getBoundingClientRect();
5107
5135
  var x = event.clientX - bounds.left;
5108
5136
  var inputWidth = minRange.current.offsetWidth;
5109
- var minValue = minRange.current.value;
5110
- var maxValue = maxRange.current.value;
5137
+ var minValue = parseFloat(minRange.current.value);
5138
+ var maxValue = parseFloat(maxRange.current.value);
5111
5139
  var diff = max - min;
5112
5140
  var normX = x / inputWidth * diff + min;
5113
- var maxX = Math.abs(normX - parseFloat(maxValue));
5114
- var minX = Math.abs(normX - parseFloat(minValue));
5141
+ var maxX = Math.abs(normX - maxValue);
5142
+ var minX = Math.abs(normX - minValue);
5115
5143
  if (minX > maxX) {
5116
5144
  minRange.current.style.zIndex = '10';
5117
5145
  maxRange.current.style.zIndex = '20';
@@ -5119,6 +5147,22 @@ var Slider = /*#__PURE__*/react.forwardRef(function Slider(_ref10, ref) {
5119
5147
  minRange.current.style.zIndex = '20';
5120
5148
  maxRange.current.style.zIndex = '10';
5121
5149
  }
5150
+ //special cases where both thumbs are all the way to the left or right
5151
+ if (minValue === maxValue && minValue === min) {
5152
+ minRange.current.style.zIndex = '10';
5153
+ maxRange.current.style.zIndex = '20';
5154
+ }
5155
+ if (minValue === maxValue && maxValue === max) {
5156
+ minRange.current.style.zIndex = '20';
5157
+ maxRange.current.style.zIndex = '10';
5158
+ }
5159
+ };
5160
+ var handleDragging = function handleDragging(e) {
5161
+ if (e.type === 'mousedown') {
5162
+ setMousePressed(true);
5163
+ } else {
5164
+ setMousePressed(false);
5165
+ }
5122
5166
  };
5123
5167
  var inputIdA = edsUtils.useId(null, 'inputA');
5124
5168
  var inputIdB = edsUtils.useId(null, 'inputB');
@@ -5141,10 +5185,12 @@ var Slider = /*#__PURE__*/react.forwardRef(function Slider(_ref10, ref) {
5141
5185
  "aria-labelledby": getAriaLabelledby(),
5142
5186
  valA: sliderValue[0],
5143
5187
  valB: sliderValue[1],
5144
- max: max,
5145
- min: min,
5188
+ $max: max,
5189
+ $min: min,
5146
5190
  disabled: disabled,
5147
5191
  onMouseMove: findClosestRange,
5192
+ onMouseDown: handleDragging,
5193
+ onMouseUp: handleDragging,
5148
5194
  children: [minMaxDots && /*#__PURE__*/jsxRuntime.jsx(WrapperGroupLabelDots, {}), /*#__PURE__*/jsxRuntime.jsx(SrOnlyLabel, {
5149
5195
  htmlFor: inputIdA,
5150
5196
  children: "Value A"
@@ -5210,8 +5256,8 @@ var Slider = /*#__PURE__*/react.forwardRef(function Slider(_ref10, ref) {
5210
5256
  })]
5211
5257
  })) : /*#__PURE__*/jsxRuntime.jsxs(Wrapper, _objectSpread__default["default"](_objectSpread__default["default"]({}, rest), {}, {
5212
5258
  ref: ref,
5213
- max: max,
5214
- min: min,
5259
+ $max: max,
5260
+ $min: min,
5215
5261
  value: sliderValue[0],
5216
5262
  disabled: disabled,
5217
5263
  children: [/*#__PURE__*/jsxRuntime.jsx(SliderInput, {
@@ -6278,18 +6324,21 @@ var breadcrumbs = {
6278
6324
  }
6279
6325
  };
6280
6326
 
6281
- var _excluded$k = ["children", "collapse"];
6327
+ var _excluded$k = ["children", "collapse", "wrap"];
6282
6328
  var spacings = breadcrumbs.spacings,
6283
6329
  typography$5 = breadcrumbs.typography,
6284
6330
  states$1 = breadcrumbs.states;
6285
6331
  var OrderedList$1 = styled__default["default"].ol.withConfig({
6286
6332
  displayName: "Breadcrumbs__OrderedList",
6287
6333
  componentId: "sc-12awlbz-0"
6288
- })(["list-style:none;display:flex;padding:0;margin:0;flex-wrap:wrap;"]);
6334
+ })(["list-style:none;display:flex;padding:0;margin:0;flex-wrap:wrap;flex-wrap:", ";"], function (_ref) {
6335
+ var $wrap = _ref.$wrap;
6336
+ return $wrap ? 'wrap' : 'nowrap';
6337
+ });
6289
6338
  var ListItem$1 = styled__default["default"].li.withConfig({
6290
6339
  displayName: "Breadcrumbs__ListItem",
6291
6340
  componentId: "sc-12awlbz-1"
6292
- })(["display:inline-block;"]);
6341
+ })(["display:inline-block;min-width:30px;"]);
6293
6342
  var Separator = styled__default["default"](Typography).withConfig({
6294
6343
  displayName: "Breadcrumbs__Separator",
6295
6344
  componentId: "sc-12awlbz-2"
@@ -6298,10 +6347,12 @@ var Collapsed = styled__default["default"](Typography).withConfig({
6298
6347
  displayName: "Breadcrumbs__Collapsed",
6299
6348
  componentId: "sc-12awlbz-3"
6300
6349
  })(["@media (hover:hover) and (pointer:fine){&:hover{text-decoration:underline;color:", ";}}color:", ";text-decoration:none;"], states$1.hover.typography.color, typography$5.color);
6301
- var Breadcrumbs$1 = /*#__PURE__*/react.forwardRef(function Breadcrumbs(_ref, ref) {
6302
- var children = _ref.children,
6303
- collapse = _ref.collapse,
6304
- rest = _objectWithoutProperties__default["default"](_ref, _excluded$k);
6350
+ var Breadcrumbs$1 = /*#__PURE__*/react.forwardRef(function Breadcrumbs(_ref2, ref) {
6351
+ var children = _ref2.children,
6352
+ collapse = _ref2.collapse,
6353
+ _ref2$wrap = _ref2.wrap,
6354
+ wrap = _ref2$wrap === void 0 ? true : _ref2$wrap,
6355
+ rest = _objectWithoutProperties__default["default"](_ref2, _excluded$k);
6305
6356
  var props = _objectSpread__default["default"](_objectSpread__default["default"]({}, rest), {}, {
6306
6357
  ref: ref
6307
6358
  });
@@ -6312,8 +6363,8 @@ var Breadcrumbs$1 = /*#__PURE__*/react.forwardRef(function Breadcrumbs(_ref, ref
6312
6363
  var collapsedCrumbs = function collapsedCrumbs(allCrumbs) {
6313
6364
  var handleExpandClick = function handleExpandClick(e) {
6314
6365
  setExpanded(true);
6315
- var _ref2 = e,
6316
- key = _ref2.key;
6366
+ var _ref3 = e,
6367
+ key = _ref3.key;
6317
6368
  if (key === 'Enter') {
6318
6369
  setExpanded(true);
6319
6370
  }
@@ -6323,6 +6374,9 @@ var Breadcrumbs$1 = /*#__PURE__*/react.forwardRef(function Breadcrumbs(_ref, ref
6323
6374
  }
6324
6375
  return [allCrumbs[0], /*#__PURE__*/jsxRuntime.jsxs(react.Fragment, {
6325
6376
  children: [/*#__PURE__*/jsxRuntime.jsx(ListItem$1, {
6377
+ style: {
6378
+ minWidth: 'unset'
6379
+ },
6326
6380
  children: /*#__PURE__*/jsxRuntime.jsx(Collapsed, {
6327
6381
  link: true,
6328
6382
  role: "button",
@@ -6361,6 +6415,7 @@ var Breadcrumbs$1 = /*#__PURE__*/react.forwardRef(function Breadcrumbs(_ref, ref
6361
6415
  return /*#__PURE__*/jsxRuntime.jsx("nav", _objectSpread__default["default"](_objectSpread__default["default"]({}, props), {}, {
6362
6416
  "aria-label": "breadcrumbs",
6363
6417
  children: /*#__PURE__*/jsxRuntime.jsx(OrderedList$1, {
6418
+ $wrap: wrap,
6364
6419
  children: collapse && !expanded ? collapsedCrumbs(allCrumbs) : allCrumbs
6365
6420
  })
6366
6421
  }));
@@ -6368,13 +6423,13 @@ var Breadcrumbs$1 = /*#__PURE__*/react.forwardRef(function Breadcrumbs(_ref, ref
6368
6423
 
6369
6424
  // Breadcrumbs.displayName = 'eds-breadcrumbs'
6370
6425
 
6371
- var _excluded$j = ["children", "maxWidth", "href", "as"];
6426
+ var _excluded$j = ["children", "maxWidth", "forceTooltip", "href", "as"];
6372
6427
  var states = breadcrumbs.states,
6373
6428
  typography$4 = breadcrumbs.typography;
6374
6429
  var StyledTypography = styled__default["default"](Typography).withConfig({
6375
6430
  displayName: "Breadcrumb__StyledTypography",
6376
6431
  componentId: "sc-10nvwte-0"
6377
- })(["@media (hover:hover) and (pointer:fine){&:hover{text-decoration:underline;color:", ";cursor:pointer;}}white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block;text-decoration:none;color:", ";", ""], states.hover.typography.color, typography$4.color, function (_ref) {
6432
+ })(["@media (hover:hover) and (pointer:fine){&:hover{text-decoration:underline;color:", ";cursor:pointer;}}white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block;text-decoration:none;color:", ";width:100%;", ""], states.hover.typography.color, typography$4.color, function (_ref) {
6378
6433
  var $maxWidth = _ref.$maxWidth;
6379
6434
  return styled.css({
6380
6435
  maxWidth: $maxWidth
@@ -6383,6 +6438,7 @@ var StyledTypography = styled__default["default"](Typography).withConfig({
6383
6438
  var Breadcrumb = /*#__PURE__*/react.forwardRef(function Breadcrumb(_ref2, ref) {
6384
6439
  var children = _ref2.children,
6385
6440
  maxWidth = _ref2.maxWidth,
6441
+ forceTooltip = _ref2.forceTooltip,
6386
6442
  href = _ref2.href,
6387
6443
  as = _ref2.as,
6388
6444
  other = _objectWithoutProperties__default["default"](_ref2, _excluded$j);
@@ -6390,7 +6446,7 @@ var Breadcrumb = /*#__PURE__*/react.forwardRef(function Breadcrumb(_ref2, ref) {
6390
6446
  href: href,
6391
6447
  ref: ref
6392
6448
  });
6393
- var showTooltip = maxWidth > 0;
6449
+ var showTooltip = maxWidth > 0 || forceTooltip;
6394
6450
  var isHrefDefined = href !== undefined;
6395
6451
  var forwardedAs = react.useMemo(function () {
6396
6452
  return as ? as : isHrefDefined ? 'a' : 'span';
@@ -6775,7 +6831,7 @@ var MenuList = /*#__PURE__*/react.forwardRef(function MenuList(_ref, ref) {
6775
6831
  // MenuList.displayName = 'EdsMenuList'
6776
6832
 
6777
6833
  var _excluded$g = ["children", "anchorEl", "onClose", "open"],
6778
- _excluded2$1 = ["anchorEl", "open", "placement", "onClose", "style", "className"];
6834
+ _excluded2$1 = ["anchorEl", "open", "placement", "matchAnchorWidth", "onClose", "style", "className"];
6779
6835
  var border = menu.border;
6780
6836
  var MenuPaper = styled__default["default"](Paper).withConfig({
6781
6837
  displayName: "Menu__MenuPaper",
@@ -6864,6 +6920,8 @@ var Menu$1 = /*#__PURE__*/react.forwardRef(function Menu(_ref3, ref) {
6864
6920
  open = _ref3.open,
6865
6921
  _ref3$placement = _ref3.placement,
6866
6922
  placement = _ref3$placement === void 0 ? 'bottom' : _ref3$placement,
6923
+ _ref3$matchAnchorWidt = _ref3.matchAnchorWidth,
6924
+ matchAnchorWidth = _ref3$matchAnchorWidt === void 0 ? false : _ref3$matchAnchorWidt,
6867
6925
  onClose = _ref3.onClose,
6868
6926
  style = _ref3.style,
6869
6927
  className = _ref3.className,
@@ -6873,13 +6931,25 @@ var Menu$1 = /*#__PURE__*/react.forwardRef(function Menu(_ref3, ref) {
6873
6931
  var token = edsUtils.useToken({
6874
6932
  density: density
6875
6933
  }, menu);
6934
+ var floatingMiddleware = [react$1.offset(4), react$1.flip(), react$1.shift({
6935
+ padding: 8
6936
+ })];
6937
+ if (matchAnchorWidth) {
6938
+ floatingMiddleware = [].concat(_toConsumableArray__default["default"](floatingMiddleware), [react$1.size({
6939
+ apply: function apply(_ref4) {
6940
+ var rects = _ref4.rects,
6941
+ elements = _ref4.elements;
6942
+ Object.assign(elements.floating.style, {
6943
+ width: "".concat(rects.reference.width, "px")
6944
+ });
6945
+ }
6946
+ })]);
6947
+ }
6876
6948
  var _useFloating = react$1.useFloating({
6877
6949
  placement: placement,
6878
6950
  open: open,
6879
6951
  onOpenChange: onClose,
6880
- middleware: [react$1.offset(4), react$1.flip(), react$1.shift({
6881
- padding: 8
6882
- })]
6952
+ middleware: floatingMiddleware
6883
6953
  }),
6884
6954
  x = _useFloating.x,
6885
6955
  y = _useFloating.y,
@@ -7274,7 +7344,8 @@ var NativeSelect = /*#__PURE__*/react.forwardRef(function NativeSelect(_ref2, re
7274
7344
  var labelProps = {
7275
7345
  htmlFor: id,
7276
7346
  label: label,
7277
- meta: meta
7347
+ meta: meta,
7348
+ disabled: disabled
7278
7349
  };
7279
7350
  var showLabel = label || meta;
7280
7351
  return /*#__PURE__*/jsxRuntime.jsx(styled.ThemeProvider, {
@@ -8198,7 +8269,7 @@ var AutocompleteOption = /*#__PURE__*/react.forwardRef(function AutocompleteOpti
8198
8269
  }));
8199
8270
  });
8200
8271
 
8201
- var _excluded$5 = ["options", "label", "meta", "className", "style", "disabled", "readOnly", "hideClearButton", "onOptionsChange", "selectedOptions", "multiple", "initialSelectedOptions", "disablePortal", "optionDisabled", "optionsFilter", "autoWidth", "placeholder", "optionLabel", "clearSearchOnChange", "multiline"];
8272
+ var _excluded$5 = ["options", "label", "meta", "className", "style", "disabled", "readOnly", "loading", "hideClearButton", "onOptionsChange", "onInputChange", "selectedOptions", "multiple", "initialSelectedOptions", "disablePortal", "optionDisabled", "optionsFilter", "autoWidth", "placeholder", "optionLabel", "clearSearchOnChange", "multiline", "dropdownHeight"];
8202
8273
  var Container$1 = styled__default["default"].div.withConfig({
8203
8274
  displayName: "Autocomplete__Container",
8204
8275
  componentId: "sc-yvif0e-0"
@@ -8208,7 +8279,7 @@ var StyledList = styled__default["default"](List$1).withConfig({
8208
8279
  componentId: "sc-yvif0e-1"
8209
8280
  })(function (_ref) {
8210
8281
  var theme = _ref.theme;
8211
- return styled.css(["background-color:", ";box-shadow:", ";", " overflow-y:auto;overflow-x:hidden;max-height:300px;padding:0;display:grid;"], theme.background, theme.boxShadow, edsUtils.bordersTemplate(theme.border));
8282
+ return styled.css(["background-color:", ";box-shadow:", ";", " overflow-y:auto;overflow-x:hidden;padding:0;display:grid;"], theme.background, theme.boxShadow, edsUtils.bordersTemplate(theme.border));
8212
8283
  });
8213
8284
  var StyledButton = styled__default["default"](Button).withConfig({
8214
8285
  displayName: "Autocomplete__StyledButton",
@@ -8287,9 +8358,12 @@ function AutocompleteInner(props, ref) {
8287
8358
  disabled = _props$disabled === void 0 ? false : _props$disabled,
8288
8359
  _props$readOnly = props.readOnly,
8289
8360
  readOnly = _props$readOnly === void 0 ? false : _props$readOnly,
8361
+ _props$loading = props.loading,
8362
+ loading = _props$loading === void 0 ? false : _props$loading,
8290
8363
  _props$hideClearButto = props.hideClearButton,
8291
8364
  hideClearButton = _props$hideClearButto === void 0 ? false : _props$hideClearButto,
8292
8365
  onOptionsChange = props.onOptionsChange,
8366
+ onInputChange = props.onInputChange,
8293
8367
  selectedOptions = props.selectedOptions,
8294
8368
  multiple = props.multiple,
8295
8369
  _props$initialSelecte = props.initialSelectedOptions,
@@ -8307,6 +8381,8 @@ function AutocompleteInner(props, ref) {
8307
8381
  clearSearchOnChange = _props$clearSearchOnC === void 0 ? true : _props$clearSearchOnC,
8308
8382
  _props$multiline = props.multiline,
8309
8383
  multiline = _props$multiline === void 0 ? false : _props$multiline,
8384
+ _props$dropdownHeight = props.dropdownHeight,
8385
+ dropdownHeight = _props$dropdownHeight === void 0 ? 300 : _props$dropdownHeight,
8310
8386
  other = _objectWithoutProperties__default["default"](props, _excluded$5);
8311
8387
  var isControlled = Boolean(selectedOptions);
8312
8388
  var _useState = react.useState(options),
@@ -8410,6 +8486,7 @@ function AutocompleteInner(props, ref) {
8410
8486
  itemToString: getLabel,
8411
8487
  onInputValueChange: function onInputValueChange(_ref6) {
8412
8488
  var inputValue = _ref6.inputValue;
8489
+ onInputChange && onInputChange(inputValue);
8413
8490
  setAvailableItems(options.filter(function (item) {
8414
8491
  if (optionsFilter) {
8415
8492
  return optionsFilter(item, inputValue);
@@ -8613,7 +8690,10 @@ function AutocompleteInner(props, ref) {
8613
8690
  })), {}, {
8614
8691
  children: /*#__PURE__*/jsxRuntime.jsxs(StyledList, _objectSpread__default["default"](_objectSpread__default["default"]({}, getMenuProps({
8615
8692
  'aria-multiselectable': multiple ? 'true' : null,
8616
- ref: scrollContainer
8693
+ ref: scrollContainer,
8694
+ style: {
8695
+ maxHeight: "".concat(dropdownHeight, "px")
8696
+ }
8617
8697
  }, {
8618
8698
  suppressRefError: true
8619
8699
  })), {}, {
@@ -8681,9 +8761,11 @@ function AutocompleteInner(props, ref) {
8681
8761
  readOnly: readOnly,
8682
8762
  onFocus: openSelect,
8683
8763
  onClick: openSelect,
8684
- rightAdornmentsWidth: 24 * 2 + 8 + 8,
8764
+ rightAdornmentsWidth: hideClearButton ? 24 + 8 : 24 * 2 + 8,
8685
8765
  rightAdornments: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
8686
- children: [showClearButton && /*#__PURE__*/jsxRuntime.jsx(StyledButton, {
8766
+ children: [loading && /*#__PURE__*/jsxRuntime.jsx(Progress.Circular, {
8767
+ size: 16
8768
+ }), showClearButton && /*#__PURE__*/jsxRuntime.jsx(StyledButton, {
8687
8769
  variant: "ghost_icon",
8688
8770
  disabled: disabled || readOnly,
8689
8771
  "aria-label": 'clear options',
@@ -4,14 +4,16 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
4
4
  import { forwardRef, useState, Children, cloneElement, useEffect } from 'react';
5
5
  import { jsx } from 'react/jsx-runtime';
6
6
 
7
- var _excluded = ["headerLevel", "chevronPosition", "index", "accordionId", "isExpanded", "children", "disabled"];
7
+ var _excluded = ["headerLevel", "chevronPosition", "index", "accordionId", "isExpanded", "onExpandedChange", "children", "disabled"];
8
8
  var AccordionItem = /*#__PURE__*/forwardRef(function AccordionItem(_ref, ref) {
9
9
  var headerLevel = _ref.headerLevel,
10
10
  chevronPosition = _ref.chevronPosition,
11
11
  _ref$index = _ref.index,
12
12
  index = _ref$index === void 0 ? 0 : _ref$index,
13
13
  accordionId = _ref.accordionId,
14
- isExpanded = _ref.isExpanded,
14
+ _ref$isExpanded = _ref.isExpanded,
15
+ isExpanded = _ref$isExpanded === void 0 ? false : _ref$isExpanded,
16
+ onExpandedChange = _ref.onExpandedChange,
15
17
  children = _ref.children,
16
18
  disabled = _ref.disabled,
17
19
  props = _objectWithoutProperties(_ref, _excluded);
@@ -19,14 +21,20 @@ var AccordionItem = /*#__PURE__*/forwardRef(function AccordionItem(_ref, ref) {
19
21
  _useState2 = _slicedToArray(_useState, 2),
20
22
  expanded = _useState2[0],
21
23
  setExpanded = _useState2[1];
24
+ var controlled = onExpandedChange != undefined;
25
+ var activeExpandedState = controlled ? isExpanded : expanded;
22
26
  var toggleExpanded = function toggleExpanded() {
23
- setExpanded(!expanded);
27
+ if (controlled) {
28
+ onExpandedChange(!isExpanded);
29
+ } else {
30
+ setExpanded(!expanded);
31
+ }
24
32
  };
25
33
  var Children$1 = Children.map(children, function (child, childIndex) {
26
34
  var headerId = "".concat(accordionId, "-header-").concat(index + 1);
27
35
  var panelId = "".concat(accordionId, "-panel-").concat(index + 1);
28
36
  return childIndex === 0 ? /*#__PURE__*/cloneElement(child, {
29
- isExpanded: expanded,
37
+ isExpanded: activeExpandedState,
30
38
  toggleExpanded: toggleExpanded,
31
39
  id: headerId,
32
40
  panelId: panelId,
@@ -35,14 +43,16 @@ var AccordionItem = /*#__PURE__*/forwardRef(function AccordionItem(_ref, ref) {
35
43
  parentIndex: index,
36
44
  disabled: disabled
37
45
  }) : /*#__PURE__*/cloneElement(child, {
38
- hidden: !expanded,
46
+ hidden: !activeExpandedState,
39
47
  id: panelId,
40
48
  headerId: headerId
41
49
  });
42
50
  });
43
51
  useEffect(function () {
44
- setExpanded(isExpanded);
45
- }, [isExpanded]);
52
+ if (!controlled) {
53
+ setExpanded(isExpanded);
54
+ }
55
+ }, [isExpanded, controlled]);
46
56
  return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({}, props), {}, {
47
57
  ref: ref,
48
58
  children: Children$1