@norges-domstoler/dds-components 21.6.1 → 21.7.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.
package/dist/index.js CHANGED
@@ -185,6 +185,7 @@ __export(index_exports, {
185
185
  InfoIcon: () => InfoIcon,
186
186
  InlineButton: () => InlineButton,
187
187
  InlineEditInput: () => InlineEditInput,
188
+ InlineEditSelect: () => InlineEditSelect,
188
189
  InlineEditTextArea: () => InlineEditTextArea,
189
190
  Input: () => Input,
190
191
  InputMessage: () => InputMessage,
@@ -607,8 +608,8 @@ var getTextColor = (color) => {
607
608
  // src/utils/combineHandlers.tsx
608
609
  var combineHandlers = (handler1, handler2) => {
609
610
  const callback = (event) => {
610
- handler1 && handler1(event);
611
- handler2 && handler2(event);
611
+ handler1 == null ? void 0 : handler1(event);
612
+ handler2 == null ? void 0 : handler2(event);
612
613
  };
613
614
  return callback;
614
615
  };
@@ -656,7 +657,7 @@ var readOnlyMouseDownHandler = (readOnly, onMouseDown) => {
656
657
  if (readOnly) {
657
658
  evt.preventDefault();
658
659
  evt.target.focus();
659
- } else onMouseDown && onMouseDown(evt);
660
+ } else onMouseDown == null ? void 0 : onMouseDown(evt);
660
661
  };
661
662
  };
662
663
  var readOnlyKeyDownHandler = (type, readOnly, onKeyDown) => {
@@ -669,7 +670,7 @@ var readOnlyKeyDownHandler = (type, readOnly, onKeyDown) => {
669
670
  } else if (type === "selectionControl" && evt.key === " ") {
670
671
  evt.preventDefault();
671
672
  }
672
- } else onKeyDown && onKeyDown(evt);
673
+ } else onKeyDown == null ? void 0 : onKeyDown(evt);
673
674
  };
674
675
  };
675
676
  var readOnlyChangeHandler = (readOnly, onChange) => {
@@ -677,7 +678,7 @@ var readOnlyChangeHandler = (readOnly, onChange) => {
677
678
  if (readOnly) {
678
679
  return;
679
680
  }
680
- onChange && onChange(evt);
681
+ onChange == null ? void 0 : onChange(evt);
681
682
  };
682
683
  };
683
684
  var readOnlyClickHandler = (readOnly, onClick) => {
@@ -686,7 +687,7 @@ var readOnlyClickHandler = (readOnly, onClick) => {
686
687
  evt.preventDefault();
687
688
  return;
688
689
  }
689
- onClick && onClick(evt);
690
+ onClick == null ? void 0 : onClick(evt);
690
691
  };
691
692
  };
692
693
 
@@ -831,8 +832,8 @@ function useTranslation() {
831
832
  const t = (text) => text[lang];
832
833
  return { t, lang };
833
834
  }
834
- function createTexts(texts25) {
835
- return texts25;
835
+ function createTexts(texts26) {
836
+ return texts26;
836
837
  }
837
838
 
838
839
  // src/types/BaseComponentProps.ts
@@ -1081,6 +1082,7 @@ var focusable = "focus_focusable";
1081
1082
  var focus_default = {
1082
1083
  focused: "focus_focused",
1083
1084
  focusable,
1085
+ "focusable-focus": "focus_focusable-focus",
1084
1086
  "focusable-within": "focus_focusable-within",
1085
1087
  "has-focusable-input": "focus_has-focusable-input",
1086
1088
  "focusable-sibling": "focus_focusable-sibling",
@@ -4689,13 +4691,13 @@ var OverflowMenuGroup = ({
4689
4691
  const combinedMenuRef = useCombinedRef(menuRef, floatingRef);
4690
4692
  const handleClose = () => {
4691
4693
  if (isOpen) {
4692
- onClose && onClose();
4694
+ onClose == null ? void 0 : onClose();
4693
4695
  close();
4694
4696
  }
4695
4697
  };
4696
4698
  const handleToggle = () => {
4697
- !isOpen && (onOpen == null ? void 0 : onOpen());
4698
- isOpen && (onClose == null ? void 0 : onClose());
4699
+ if (!isOpen) onOpen == null ? void 0 : onOpen();
4700
+ if (isOpen) onClose == null ? void 0 : onClose();
4699
4701
  toggle();
4700
4702
  };
4701
4703
  useOnClickOutside([menuRef.current, buttonRef.current], () => {
@@ -4704,7 +4706,7 @@ var OverflowMenuGroup = ({
4704
4706
  useOnKeyDown(["Esc", "Escape"], () => {
4705
4707
  var _a;
4706
4708
  if (isOpen) {
4707
- onClose && onClose();
4709
+ onClose == null ? void 0 : onClose();
4708
4710
  close();
4709
4711
  (_a = buttonRef.current) == null ? void 0 : _a.focus();
4710
4712
  }
@@ -5485,7 +5487,7 @@ var RadioButton = ({
5485
5487
  const radioButtonGroup = useRadioButtonGroup();
5486
5488
  const handleChange = (event) => {
5487
5489
  var _a;
5488
- onChange && onChange(event);
5490
+ onChange == null ? void 0 : onChange(event);
5489
5491
  (_a = radioButtonGroup == null ? void 0 : radioButtonGroup.onChange) == null ? void 0 : _a.call(radioButtonGroup, event, event.target.value);
5490
5492
  };
5491
5493
  const describedByIds = [];
@@ -5861,7 +5863,7 @@ var Chip = ({
5861
5863
  const [isOpen, setIsOpen] = (0, import_react35.useState)(true);
5862
5864
  const onClick = () => {
5863
5865
  setIsOpen(false);
5864
- onClose && onClose();
5866
+ onClose == null ? void 0 : onClose();
5865
5867
  };
5866
5868
  return isOpen ? /* @__PURE__ */ (0, import_jsx_runtime221.jsxs)(
5867
5869
  "div",
@@ -7666,26 +7668,10 @@ var TextArea = ({
7666
7668
  TextArea.displayName = "TextArea";
7667
7669
 
7668
7670
  // src/components/Feedback/utils.tsx
7669
- var import_jsx_runtime249 = require("react/jsx-runtime");
7670
7671
  var getIconSize = (layout) => layout === "vertical" ? "large" : "medium";
7671
- var ThumbIcon = ({ rating, layout, type }) => type === "comment" ? /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
7672
- Icon,
7673
- {
7674
- icon: rating === "positive" ? ThumbUpFilledIcon : ThumbDownFilledIcon,
7675
- color: "iconActionResting",
7676
- iconSize: getIconSize(layout)
7677
- }
7678
- ) : /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
7679
- Icon,
7680
- {
7681
- icon: rating === "positive" ? ThumbUpIcon : ThumbDownIcon,
7682
- color: "iconMedium",
7683
- iconSize: getIconSize(layout)
7684
- }
7685
- );
7686
7672
 
7687
7673
  // src/components/Feedback/CommentComponent.tsx
7688
- var import_jsx_runtime250 = require("react/jsx-runtime");
7674
+ var import_jsx_runtime249 = require("react/jsx-runtime");
7689
7675
  var CommentComponent = ({
7690
7676
  layout,
7691
7677
  rating,
@@ -7699,15 +7685,22 @@ var CommentComponent = ({
7699
7685
  handleFeedbackTextChange
7700
7686
  }) => {
7701
7687
  const { t } = useTranslation();
7702
- return /* @__PURE__ */ (0, import_jsx_runtime250.jsxs)(VStack, { gap: "x1", children: [
7703
- /* @__PURE__ */ (0, import_jsx_runtime250.jsxs)("span", { className: Feedback_default["rating-submitted-title"], children: [
7704
- ThumbIcon({ rating, layout, type: "comment" }),
7705
- /* @__PURE__ */ (0, import_jsx_runtime250.jsxs)(Paragraph, { children: [
7688
+ return /* @__PURE__ */ (0, import_jsx_runtime249.jsxs)(VStack, { gap: "x1", children: [
7689
+ /* @__PURE__ */ (0, import_jsx_runtime249.jsxs)("span", { className: Feedback_default["rating-submitted-title"], children: [
7690
+ /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
7691
+ Icon,
7692
+ {
7693
+ icon: rating === "positive" ? ThumbUpFilledIcon : ThumbDownFilledIcon,
7694
+ color: "iconActionResting",
7695
+ iconSize: getIconSize(layout)
7696
+ }
7697
+ ),
7698
+ /* @__PURE__ */ (0, import_jsx_runtime249.jsxs)(Paragraph, { children: [
7706
7699
  ratingSubmittedTitle,
7707
7700
  " "
7708
7701
  ] })
7709
7702
  ] }),
7710
- /* @__PURE__ */ (0, import_jsx_runtime250.jsx)(
7703
+ /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
7711
7704
  TextArea,
7712
7705
  {
7713
7706
  value: feedbackText,
@@ -7716,7 +7709,7 @@ var CommentComponent = ({
7716
7709
  tip: textAreaTip
7717
7710
  }
7718
7711
  ),
7719
- /* @__PURE__ */ (0, import_jsx_runtime250.jsx)(
7712
+ /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
7720
7713
  Button,
7721
7714
  {
7722
7715
  purpose: "secondary",
@@ -7737,6 +7730,29 @@ var texts9 = createTexts({
7737
7730
  }
7738
7731
  });
7739
7732
 
7733
+ // src/components/helpers/InlineIconButton/InlineIconButton.module.css
7734
+ var InlineIconButton_default = {
7735
+ button: "InlineIconButton_button"
7736
+ };
7737
+
7738
+ // src/components/helpers/InlineIconButton/InlineIconButton.tsx
7739
+ var import_jsx_runtime250 = require("react/jsx-runtime");
7740
+ var InlineIconButton = ({
7741
+ className,
7742
+ size: size2,
7743
+ icon,
7744
+ color,
7745
+ ...rest
7746
+ }) => /* @__PURE__ */ (0, import_jsx_runtime250.jsx)(
7747
+ StylelessButton,
7748
+ {
7749
+ className: cn(className, InlineIconButton_default.button, focusable),
7750
+ ...rest,
7751
+ children: /* @__PURE__ */ (0, import_jsx_runtime250.jsx)(Icon, { icon, iconSize: size2, color })
7752
+ }
7753
+ );
7754
+ InlineIconButton.displayName = "InlineIconButton";
7755
+
7740
7756
  // src/components/Tooltip/Tooltip.tsx
7741
7757
  var import_react56 = require("react");
7742
7758
 
@@ -7777,7 +7793,9 @@ var Tooltip = ({
7777
7793
  const combinedRef = useCombinedRef(ref, refs.setFloating, tooltipRef);
7778
7794
  const closeWhenNotInView = (entries) => {
7779
7795
  const [entry] = entries;
7780
- entry.isIntersecting ? setInView(true) : setInView(false);
7796
+ if (entry.isIntersecting) {
7797
+ setInView(true);
7798
+ } else setInView(false);
7781
7799
  };
7782
7800
  (0, import_react56.useEffect)(() => {
7783
7801
  const options = {
@@ -7902,12 +7920,13 @@ var RatingComponent = ({
7902
7920
  }) => {
7903
7921
  const { t } = useTranslation();
7904
7922
  const button = (rating, layout2, tooltip) => /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
7905
- StylelessButton,
7923
+ InlineIconButton,
7906
7924
  {
7907
7925
  "aria-label": tooltip,
7908
7926
  onClick: () => handleRatingChange(rating),
7909
- className: cn(Feedback_default.button, Feedback_default[`button--${layout2}`], focusable),
7910
- children: ThumbIcon({ rating, layout: layout2, type: "rating" })
7927
+ size: getIconSize(layout2),
7928
+ icon: rating === "positive" ? ThumbUpIcon : ThumbDownIcon,
7929
+ color: "icon-medium"
7911
7930
  }
7912
7931
  );
7913
7932
  return /* @__PURE__ */ (0, import_jsx_runtime252.jsxs)(
@@ -7970,26 +7989,26 @@ var Feedback = ({
7970
7989
  const tThumbUpTooltip = thumbUpTooltip != null ? thumbUpTooltip : t(texts11.good);
7971
7990
  const tThumbDownTooltip = thumbDownTooltip != null ? thumbDownTooltip : t(texts11.bad);
7972
7991
  (0, import_react57.useEffect)(() => {
7973
- ratingProp !== void 0 && setRating(ratingProp);
7992
+ if (ratingProp !== void 0) setRating(ratingProp);
7974
7993
  }, [ratingProp]);
7975
7994
  (0, import_react57.useEffect)(() => {
7976
- feedbackTextProp !== void 0 && setFeedbackText(feedbackTextProp);
7995
+ if (feedbackTextProp !== void 0) setFeedbackText(feedbackTextProp);
7977
7996
  }, [feedbackTextProp]);
7978
7997
  (0, import_react57.useEffect)(() => {
7979
- isSubmittedProp !== void 0 && setIsFeedbackSubmitted(isSubmittedProp);
7998
+ if (isSubmittedProp !== void 0) setIsFeedbackSubmitted(isSubmittedProp);
7980
7999
  }, [isSubmittedProp]);
7981
8000
  const handleRatingChange = (newRating) => {
7982
- onRating && onRating(newRating);
7983
- onSubmit && feedbackTextAreaExcluded && onSubmit(newRating, "");
7984
- ratingProp === void 0 && setRating(newRating);
8001
+ onRating == null ? void 0 : onRating(newRating);
8002
+ if (onSubmit && feedbackTextAreaExcluded) onSubmit(newRating, "");
8003
+ if (ratingProp === void 0) setRating(newRating);
7985
8004
  };
7986
8005
  const handleFeedbackTextChange = (newFeedbackText) => {
7987
- onFeedbackTextChange && onFeedbackTextChange(newFeedbackText);
7988
- feedbackTextProp === void 0 && setFeedbackText(newFeedbackText);
8006
+ onFeedbackTextChange == null ? void 0 : onFeedbackTextChange(newFeedbackText);
8007
+ if (feedbackTextProp === void 0) setFeedbackText(newFeedbackText);
7989
8008
  };
7990
8009
  const handleSubmit = () => {
7991
- onSubmit && onSubmit(rating, feedbackText != null ? feedbackText : "");
7992
- isSubmittedProp === void 0 && setIsFeedbackSubmitted(true);
8010
+ onSubmit == null ? void 0 : onSubmit(rating, feedbackText != null ? feedbackText : "");
8011
+ if (isSubmittedProp === void 0) setIsFeedbackSubmitted(true);
7993
8012
  };
7994
8013
  if (rating === null && !isFeedbackSubmitted) {
7995
8014
  return /* @__PURE__ */ (0, import_jsx_runtime253.jsx)(
@@ -8449,11 +8468,9 @@ var useFileUploader = (props) => {
8449
8468
  () => ({
8450
8469
  onBlur: onRootBlur,
8451
8470
  onFocus: onRootFocus,
8452
- // eslint-disable-next-line @typescript-eslint/no-misused-promises
8453
8471
  onDragEnter: onRootDragEnter,
8454
8472
  onDragOver: onRootDragOver,
8455
8473
  onDragLeave: onRootDragLeave,
8456
- // eslint-disable-next-line @typescript-eslint/no-misused-promises
8457
8474
  onDrop: setFiles,
8458
8475
  ref: rootRef
8459
8476
  }),
@@ -8480,7 +8497,6 @@ var useFileUploader = (props) => {
8480
8497
  style: { display: "none" },
8481
8498
  tabIndex: -1,
8482
8499
  ref: inputRef,
8483
- // eslint-disable-next-line @typescript-eslint/no-misused-promises
8484
8500
  onChange: setFiles,
8485
8501
  multiple: !maxFiles || maxFiles > 1,
8486
8502
  ...accept ? { accept: accept.join(",") } : {}
@@ -8789,7 +8805,7 @@ var GlobalMessage = ({
8789
8805
  purpose: "tertiary",
8790
8806
  onClick: () => {
8791
8807
  setClosed(true);
8792
- onClose && onClose();
8808
+ onClose == null ? void 0 : onClose();
8793
8809
  },
8794
8810
  size: "small",
8795
8811
  "aria-label": t(commonTexts.closeMessage)
@@ -8821,7 +8837,7 @@ var InlineButton = ({ className, ...rest }) => /* @__PURE__ */ (0, import_jsx_ru
8821
8837
  }
8822
8838
  );
8823
8839
 
8824
- // src/components/InlineEdit/InlineEditTextArea.tsx
8840
+ // src/components/InlineEdit/InlineEditTextArea/InlineEditTextArea.tsx
8825
8841
  var import_react63 = require("react");
8826
8842
 
8827
8843
  // src/components/InlineEdit/InlineEdit.context.tsx
@@ -8887,15 +8903,20 @@ var InlineEditContextProvider = (props) => {
8887
8903
  };
8888
8904
  InlineEditContextProvider.displayName = "InlineEditContextProvider";
8889
8905
 
8890
- // src/components/InlineEdit/InlineTextArea.tsx
8906
+ // src/components/InlineEdit/InlineField.tsx
8891
8907
  var import_react62 = require("react");
8892
8908
 
8893
8909
  // src/components/InlineEdit/InlineEdit.module.css
8894
8910
  var InlineEdit_default = {
8895
8911
  "inline-input": "InlineEdit_inline-input",
8912
+ "inline-select": "InlineEdit_inline-select",
8913
+ "inline-select--with-clear-button": "InlineEdit_inline-select--with-clear-button",
8914
+ "inline-input--danger": "InlineEdit_inline-input--danger",
8896
8915
  "inline-input--with-icon": "InlineEdit_inline-input--with-icon",
8897
8916
  "inline-textarea": "InlineEdit_inline-textarea",
8898
- "icon-wrapper": "InlineEdit_icon-wrapper"
8917
+ "icon-wrapper": "InlineEdit_icon-wrapper",
8918
+ chevron: "InlineEdit_chevron",
8919
+ "clear-button": "InlineEdit_clear-button"
8899
8920
  };
8900
8921
 
8901
8922
  // src/components/InlineEdit/InlineEdit.utils.tsx
@@ -8921,29 +8942,153 @@ var texts14 = createTexts({
8921
8942
  en: " Input field cannot be cleared."
8922
8943
  }
8923
8944
  });
8945
+ var inlineEditCns = (hasErrorState, showEditingIcon) => [
8946
+ InlineEdit_default["inline-input"],
8947
+ typographyStyles_default["body-medium"],
8948
+ hasErrorState && InlineEdit_default["inline-input--danger"],
8949
+ showEditingIcon && InlineEdit_default["inline-input--with-icon"]
8950
+ ];
8951
+ var inlineInputCns = (hasErrorState, showEditingIcon) => [...inlineEditCns(hasErrorState, showEditingIcon), focusable];
8952
+ var inlineTextareaCns = (hasErrorState, showEditingIcon) => [...inlineInputCns(hasErrorState, showEditingIcon), utilStyles_default.scrollbar];
8953
+ var inlineSelectCns = (hasErrorState, showEditingIcon, hasValue) => [
8954
+ ...inlineEditCns(hasErrorState, showEditingIcon),
8955
+ InlineEdit_default["inline-select"],
8956
+ hasValue && InlineEdit_default["inline-select--with-clear-button"],
8957
+ focus_default["focusable-focus"]
8958
+ ];
8924
8959
 
8925
- // src/components/InlineEdit/InlineTextArea.tsx
8960
+ // src/utils/createClearChangeEvent.tsx
8961
+ function createClearChangeEvent(elementId) {
8962
+ const element = document.getElementById(elementId);
8963
+ if (!element) {
8964
+ throw new Error(`Element by id '${elementId}' not found.`);
8965
+ }
8966
+ if (element instanceof HTMLInputElement) {
8967
+ element.value = "";
8968
+ } else if (element instanceof HTMLSelectElement) {
8969
+ element.selectedIndex = 0;
8970
+ }
8971
+ const clearChangeEvent = {
8972
+ target: element,
8973
+ currentTarget: element,
8974
+ bubbles: true,
8975
+ cancelable: false,
8976
+ defaultPrevented: false,
8977
+ eventPhase: 0,
8978
+ isTrusted: false,
8979
+ preventDefault: () => null,
8980
+ stopPropagation: () => null,
8981
+ nativeEvent: new Event("input"),
8982
+ persist: () => null,
8983
+ type: "change",
8984
+ timeStamp: Date.now(),
8985
+ isDefaultPrevented: () => false,
8986
+ isPropagationStopped: () => false
8987
+ };
8988
+ return clearChangeEvent;
8989
+ }
8990
+
8991
+ // src/components/InlineEdit/InlineField.tsx
8926
8992
  var import_jsx_runtime271 = require("react/jsx-runtime");
8927
- var InlineTextArea = ({
8928
- id,
8929
- error,
8930
- errorMessage,
8931
- width = "140px",
8932
- "aria-describedby": ariaDescribedby,
8933
- hideIcon,
8934
- ref,
8935
- ...rest
8936
- }) => {
8993
+ function InlineField(props) {
8994
+ const {
8995
+ elementType,
8996
+ id,
8997
+ error,
8998
+ errorMessage,
8999
+ width = "140px",
9000
+ hideIcon,
9001
+ ref,
9002
+ className,
9003
+ "aria-describedby": ariaDescribedby,
9004
+ ...rest
9005
+ } = props;
8937
9006
  const { onBlur, onChange, onFocus, isEditing, value, emptiable } = useInlineEditContext();
8938
- const genereatedId = (0, import_react62.useId)();
8939
- const uniqueId = id != null ? id : `${genereatedId}-InlineTextArea`;
9007
+ const { t } = useTranslation();
9008
+ const generatedId = (0, import_react62.useId)();
9009
+ const uniqueId = id != null ? id : `${generatedId}-InlineEdit`;
8940
9010
  const hasErrorMessage = !!errorMessage;
9011
+ const hasErrorState = !!error || hasErrorMessage;
8941
9012
  const errorMessageId = derivativeIdGenerator(uniqueId, "errorMessage");
8942
- const hasError = !!error;
8943
- const hasErrorState = hasError || hasErrorMessage;
8944
9013
  const descId = derivativeIdGenerator(uniqueId, "desc");
9014
+ const hasValue = !!value;
8945
9015
  const inputRef = (0, import_react62.useRef)(null);
8946
9016
  const combinedRef = useCombinedRef(ref, inputRef);
9017
+ const clearInput = () => {
9018
+ const clearChangeEvent = createClearChangeEvent(uniqueId);
9019
+ onChange == null ? void 0 : onChange(clearChangeEvent);
9020
+ };
9021
+ const describedBy = spaceSeparatedIdListGenerator([
9022
+ hasErrorMessage ? errorMessageId : void 0,
9023
+ descId,
9024
+ ariaDescribedby
9025
+ ]);
9026
+ const commonProps = {
9027
+ id: uniqueId,
9028
+ "aria-describedby": describedBy,
9029
+ "aria-invalid": hasErrorState,
9030
+ value,
9031
+ onBlur,
9032
+ onChange,
9033
+ onFocus
9034
+ };
9035
+ const cnArgs = [hasErrorState, !isEditing && !hideIcon];
9036
+ const renderElement = () => {
9037
+ switch (elementType) {
9038
+ case "input":
9039
+ return /* @__PURE__ */ (0, import_jsx_runtime271.jsx)(
9040
+ "input",
9041
+ {
9042
+ ...rest,
9043
+ ref: combinedRef,
9044
+ ...commonProps,
9045
+ className: cn(className, ...inlineInputCns(...cnArgs))
9046
+ }
9047
+ );
9048
+ case "textarea":
9049
+ return /* @__PURE__ */ (0, import_jsx_runtime271.jsx)(
9050
+ "textarea",
9051
+ {
9052
+ ...rest,
9053
+ ref: combinedRef,
9054
+ ...commonProps,
9055
+ className: cn(className, ...inlineTextareaCns(...cnArgs))
9056
+ }
9057
+ );
9058
+ case "select":
9059
+ return /* @__PURE__ */ (0, import_jsx_runtime271.jsxs)(import_jsx_runtime271.Fragment, { children: [
9060
+ /* @__PURE__ */ (0, import_jsx_runtime271.jsx)(
9061
+ "select",
9062
+ {
9063
+ ...rest,
9064
+ ref: combinedRef,
9065
+ ...commonProps,
9066
+ className: cn(className, ...inlineSelectCns(...cnArgs, hasValue))
9067
+ }
9068
+ ),
9069
+ hasValue && emptiable && /* @__PURE__ */ (0, import_jsx_runtime271.jsx)(
9070
+ InlineIconButton,
9071
+ {
9072
+ "aria-label": t(texts15.clearSelect),
9073
+ onClick: clearInput,
9074
+ icon: CloseSmallIcon,
9075
+ size: "small",
9076
+ className: InlineEdit_default["clear-button"]
9077
+ }
9078
+ ),
9079
+ /* @__PURE__ */ (0, import_jsx_runtime271.jsx)(
9080
+ Icon,
9081
+ {
9082
+ icon: ChevronDownIcon,
9083
+ iconSize: "small",
9084
+ className: InlineEdit_default.chevron
9085
+ }
9086
+ )
9087
+ ] });
9088
+ default:
9089
+ return null;
9090
+ }
9091
+ };
8947
9092
  return /* @__PURE__ */ (0, import_jsx_runtime271.jsxs)(Box, { position: "relative", width, children: [
8948
9093
  /* @__PURE__ */ (0, import_jsx_runtime271.jsxs)("div", { className: Input_default["input-group"], children: [
8949
9094
  !isEditing && !hideIcon && /* @__PURE__ */ (0, import_jsx_runtime271.jsx)(
@@ -8951,47 +9096,28 @@ var InlineTextArea = ({
8951
9096
  {
8952
9097
  onClick: () => {
8953
9098
  var _a;
8954
- (_a = inputRef.current) == null ? void 0 : _a.focus();
9099
+ return (_a = inputRef.current) == null ? void 0 : _a.focus();
8955
9100
  },
8956
9101
  className: InlineEdit_default["icon-wrapper"],
8957
9102
  children: /* @__PURE__ */ (0, import_jsx_runtime271.jsx)(Icon, { icon: EditIcon, iconSize: "small" })
8958
9103
  }
8959
9104
  ),
8960
- /* @__PURE__ */ (0, import_jsx_runtime271.jsx)(
8961
- "textarea",
8962
- {
8963
- ...rest,
8964
- value,
8965
- onChange,
8966
- onBlur,
8967
- onFocus,
8968
- id: uniqueId,
8969
- ref: combinedRef,
8970
- "aria-describedby": spaceSeparatedIdListGenerator([
8971
- hasErrorMessage ? errorMessageId : void 0,
8972
- descId,
8973
- ariaDescribedby
8974
- ]),
8975
- className: cn(
8976
- InlineEdit_default["inline-input"],
8977
- !hideIcon && !isEditing && InlineEdit_default["inline-input--with-icon"],
8978
- InlineEdit_default["inline-textarea"],
8979
- Input_default["input--stateful"],
8980
- hasErrorState && Input_default["input--stateful-danger"],
8981
- typographyStyles_default["body-medium"],
8982
- utilStyles_default.scrollbar,
8983
- focusable
8984
- )
8985
- }
8986
- )
9105
+ renderElement()
8987
9106
  ] }),
8988
9107
  inlineEditVisuallyHidden(descId, emptiable),
8989
9108
  renderInputMessage(void 0, void 0, errorMessage, errorMessageId)
8990
9109
  ] });
8991
- };
8992
- InlineTextArea.displayName = "InlineTextArea";
9110
+ }
9111
+ var texts15 = createTexts({
9112
+ clearSelect: {
9113
+ no: "T\xF8m nedtrekksliste",
9114
+ nb: "T\xF8m nedtrekksliste",
9115
+ nn: "T\xF8m nedtrekksliste",
9116
+ en: "Clear selection"
9117
+ }
9118
+ });
8993
9119
 
8994
- // src/components/InlineEdit/InlineEditTextArea.tsx
9120
+ // src/components/InlineEdit/InlineEditTextArea/InlineEditTextArea.tsx
8995
9121
  var import_jsx_runtime272 = require("react/jsx-runtime");
8996
9122
  var InlineEditTextArea = ({
8997
9123
  onSetValue,
@@ -9015,85 +9141,45 @@ var InlineEditTextArea = ({
9015
9141
  onFocus,
9016
9142
  onChange,
9017
9143
  onBlur,
9018
- children: /* @__PURE__ */ (0, import_jsx_runtime272.jsx)(InlineTextArea, { ref: combinedRef, ...rest })
9144
+ children: /* @__PURE__ */ (0, import_jsx_runtime272.jsx)(InlineField, { elementType: "textarea", ...rest, ref: combinedRef })
9019
9145
  }
9020
9146
  );
9021
9147
  };
9022
9148
 
9023
- // src/components/InlineEdit/InlineEditInput.tsx
9024
- var import_react65 = require("react");
9025
-
9026
- // src/components/InlineEdit/InlineInput.tsx
9149
+ // src/components/InlineEdit/InlineEditInput/InlineEditInput.tsx
9027
9150
  var import_react64 = require("react");
9028
9151
  var import_jsx_runtime273 = require("react/jsx-runtime");
9029
- var InlineInput = ({
9030
- id,
9031
- error,
9032
- errorMessage,
9033
- width = "140px",
9034
- "aria-describedby": ariaDescribedby,
9035
- hideIcon,
9152
+ var InlineEditInput = ({
9153
+ onSetValue,
9154
+ emptiable,
9155
+ value,
9156
+ onFocus,
9157
+ onChange,
9158
+ onBlur,
9036
9159
  ref,
9037
9160
  ...rest
9038
9161
  }) => {
9039
- const { onBlur, onChange, onFocus, isEditing, value, emptiable } = useInlineEditContext();
9040
- const genereatedId = (0, import_react64.useId)();
9041
- const uniqueId = id != null ? id : `${genereatedId}-InlineInput`;
9042
- const hasErrorMessage = !!errorMessage;
9043
- const hasError = !!error;
9044
- const hasErrorState = hasError || hasErrorMessage;
9045
- const errorMessageId = derivativeIdGenerator(uniqueId, "errorMessage");
9046
- const descId = derivativeIdGenerator(uniqueId, "desc");
9047
9162
  const inputRef = (0, import_react64.useRef)(null);
9048
9163
  const combinedRef = useCombinedRef(ref, inputRef);
9049
- return /* @__PURE__ */ (0, import_jsx_runtime273.jsxs)(Box, { position: "relative", width, children: [
9050
- /* @__PURE__ */ (0, import_jsx_runtime273.jsxs)("div", { className: Input_default["input-group"], children: [
9051
- !isEditing && !hideIcon && /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(
9052
- "span",
9053
- {
9054
- onClick: () => {
9055
- var _a;
9056
- (_a = inputRef.current) == null ? void 0 : _a.focus();
9057
- },
9058
- className: InlineEdit_default["icon-wrapper"],
9059
- children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(Icon, { icon: EditIcon, iconSize: "small" })
9060
- }
9061
- ),
9062
- /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(
9063
- "input",
9064
- {
9065
- ...rest,
9066
- value,
9067
- onChange,
9068
- onBlur,
9069
- onFocus,
9070
- id: uniqueId,
9071
- ref: combinedRef,
9072
- "aria-describedby": spaceSeparatedIdListGenerator([
9073
- hasErrorMessage ? errorMessageId : void 0,
9074
- descId,
9075
- ariaDescribedby
9076
- ]),
9077
- "aria-invalid": hasErrorState,
9078
- className: cn(
9079
- InlineEdit_default["inline-input"],
9080
- !hideIcon && !isEditing && InlineEdit_default["inline-input--with-icon"],
9081
- typographyStyles_default["body-medium"],
9082
- hasErrorState && Input_default["input--stateful-danger"],
9083
- focusable
9084
- )
9085
- }
9086
- )
9087
- ] }),
9088
- inlineEditVisuallyHidden(descId, emptiable),
9089
- renderInputMessage(void 0, void 0, errorMessage, errorMessageId)
9090
- ] });
9164
+ return /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(
9165
+ InlineEditContextProvider,
9166
+ {
9167
+ onSetValue,
9168
+ emptiable,
9169
+ inputRef,
9170
+ value,
9171
+ onFocus,
9172
+ onChange,
9173
+ onBlur,
9174
+ children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(InlineField, { elementType: "input", ...rest, ref: combinedRef })
9175
+ }
9176
+ );
9091
9177
  };
9092
- InlineInput.displayName = "InlineInput";
9093
9178
 
9094
- // src/components/InlineEdit/InlineEditInput.tsx
9179
+ // src/components/InlineEdit/InlineEditSelect/InlineEditSelect.tsx
9180
+ var import_react65 = require("react");
9095
9181
  var import_jsx_runtime274 = require("react/jsx-runtime");
9096
- var InlineEditInput = ({
9182
+ var InlineEditSelect = ({
9097
9183
  onSetValue,
9098
9184
  emptiable,
9099
9185
  value,
@@ -9115,7 +9201,7 @@ var InlineEditInput = ({
9115
9201
  onFocus,
9116
9202
  onChange,
9117
9203
  onBlur,
9118
- children: /* @__PURE__ */ (0, import_jsx_runtime274.jsx)(InlineInput, { ...rest, ref: combinedRef })
9204
+ children: /* @__PURE__ */ (0, import_jsx_runtime274.jsx)(InlineField, { elementType: "select", ...rest, ref: combinedRef })
9119
9205
  }
9120
9206
  );
9121
9207
  };
@@ -9182,7 +9268,7 @@ var InternalHeader = (props) => {
9182
9268
  const hasContextMenuElements = !!contextMenuItems && contextMenuItems.length > 0;
9183
9269
  const hasSmallScreenBreakpoint = !!smallScreenBreakpoint;
9184
9270
  const hasNavInContextMenu = hasSmallScreenBreakpoint && hasNavigationElements;
9185
- const navigation = hasNavigationElements ? /* @__PURE__ */ (0, import_jsx_runtime276.jsx)("nav", { "aria-label": t(texts15.siteNavigation), children: /* @__PURE__ */ (0, import_jsx_runtime276.jsx)(
9271
+ const navigation = hasNavigationElements ? /* @__PURE__ */ (0, import_jsx_runtime276.jsx)("nav", { "aria-label": t(texts16.siteNavigation), children: /* @__PURE__ */ (0, import_jsx_runtime276.jsx)(
9186
9272
  ShowHide,
9187
9273
  {
9188
9274
  as: StylelessList,
@@ -9246,7 +9332,7 @@ var InternalHeader = (props) => {
9246
9332
  {
9247
9333
  icon: hasNavInContextMenu ? MenuIcon : MoreVerticalIcon,
9248
9334
  purpose: "tertiary",
9249
- "aria-label": t(texts15.openMenu)
9335
+ "aria-label": t(texts16.openMenu)
9250
9336
  }
9251
9337
  ),
9252
9338
  /* @__PURE__ */ (0, import_jsx_runtime276.jsxs)(OverflowMenu, { className: InternalHeader_default["context-menu"], children: [
@@ -9255,7 +9341,7 @@ var InternalHeader = (props) => {
9255
9341
  ShowHide,
9256
9342
  {
9257
9343
  as: "nav",
9258
- "aria-label": t(texts15.siteNavigation),
9344
+ "aria-label": t(texts16.siteNavigation),
9259
9345
  showBelow: smallScreenBreakpoint,
9260
9346
  children: /* @__PURE__ */ (0, import_jsx_runtime276.jsx)(OverflowMenuList, { children: navItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime276.jsx)(OverflowMenuLink, { ...item })) })
9261
9347
  }
@@ -9284,7 +9370,7 @@ var InternalHeader = (props) => {
9284
9370
  );
9285
9371
  };
9286
9372
  InternalHeader.displayName = "InternalHeader";
9287
- var texts15 = createTexts({
9373
+ var texts16 = createTexts({
9288
9374
  openMenu: {
9289
9375
  nb: "\xC5pne meny",
9290
9376
  no: "\xC5pne meny",
@@ -9424,7 +9510,7 @@ var LocalMessage = ({
9424
9510
  purpose: "tertiary",
9425
9511
  onClick: () => {
9426
9512
  setClosed(true);
9427
- onClose && onClose();
9513
+ onClose == null ? void 0 : onClose();
9428
9514
  },
9429
9515
  size: "xsmall",
9430
9516
  "aria-label": t(commonTexts.closeMessage),
@@ -10301,7 +10387,7 @@ var Pagination = ({
10301
10387
  const pagesLength = Math.ceil(itemsAmount / itemsPerPage);
10302
10388
  const items = PaginationGenerator(pagesLength, activePage);
10303
10389
  const onPageChange = (event, page) => {
10304
- page && setActivePage(page);
10390
+ if (page) setActivePage(page);
10305
10391
  if (event && onChange) {
10306
10392
  onChange(event, page);
10307
10393
  }
@@ -10324,7 +10410,7 @@ var Pagination = ({
10324
10410
  onClick: (event) => {
10325
10411
  onPageChange(event, item);
10326
10412
  },
10327
- "aria-label": isActive ? t(texts16.currentPage(item)) : t(texts16.page(item)),
10413
+ "aria-label": isActive ? t(texts17.currentPage(item)) : t(texts17.page(item)),
10328
10414
  children: item
10329
10415
  }
10330
10416
  ) : /* @__PURE__ */ (0, import_jsx_runtime286.jsx)(
@@ -10344,7 +10430,7 @@ var Pagination = ({
10344
10430
  onClick: (event) => {
10345
10431
  onPageChange(event, activePage - 1);
10346
10432
  },
10347
- "aria-label": t(texts16.previousPage)
10433
+ "aria-label": t(texts17.previousPage)
10348
10434
  }
10349
10435
  );
10350
10436
  const nextPageButton = /* @__PURE__ */ (0, import_jsx_runtime286.jsx)(
@@ -10356,7 +10442,7 @@ var Pagination = ({
10356
10442
  onClick: (event) => {
10357
10443
  onPageChange(event, activePage + 1);
10358
10444
  },
10359
- "aria-label": t(texts16.nextPage)
10445
+ "aria-label": t(texts17.nextPage)
10360
10446
  }
10361
10447
  );
10362
10448
  const isOnFirstPage = activePage === 1;
@@ -10366,7 +10452,7 @@ var Pagination = ({
10366
10452
  {
10367
10453
  as: "nav",
10368
10454
  ref,
10369
- "aria-label": t(texts16.pagination),
10455
+ "aria-label": t(texts17.pagination),
10370
10456
  display: "flex",
10371
10457
  alignItems: "center",
10372
10458
  ...!withSelect && !withCounter && {
@@ -10430,7 +10516,7 @@ var Pagination = ({
10430
10516
  onClick: (event) => {
10431
10517
  onPageChange(event, 1);
10432
10518
  },
10433
- "aria-label": t(texts16.firstPage)
10519
+ "aria-label": t(texts17.firstPage)
10434
10520
  }
10435
10521
  )
10436
10522
  }
@@ -10484,7 +10570,7 @@ var Pagination = ({
10484
10570
  onClick: (event) => {
10485
10571
  onPageChange(event, pagesLength);
10486
10572
  },
10487
- "aria-label": t(texts16.lastPage)
10573
+ "aria-label": t(texts17.lastPage)
10488
10574
  }
10489
10575
  )
10490
10576
  }
@@ -10522,11 +10608,11 @@ var Pagination = ({
10522
10608
  isClearable: false,
10523
10609
  onChange: handleSelectChange,
10524
10610
  componentSize: "small",
10525
- "aria-label": t(texts16.itemsPerPage)
10611
+ "aria-label": t(texts17.itemsPerPage)
10526
10612
  }
10527
10613
  ),
10528
10614
  withCounter && /* @__PURE__ */ (0, import_jsx_runtime286.jsx)(Paragraph, { children: t(
10529
- texts16.showsAmountOfTotalItems(
10615
+ texts17.showsAmountOfTotalItems(
10530
10616
  activePageFirstItem,
10531
10617
  activePageLastItem,
10532
10618
  itemsAmount
@@ -10539,7 +10625,7 @@ var Pagination = ({
10539
10625
  );
10540
10626
  };
10541
10627
  Pagination.displayName = "Pagination";
10542
- var texts16 = createTexts({
10628
+ var texts17 = createTexts({
10543
10629
  pagination: {
10544
10630
  nb: "Paginering",
10545
10631
  no: "Paginering",
@@ -11056,8 +11142,8 @@ var PhoneInput = ({
11056
11142
  }) => {
11057
11143
  var _a;
11058
11144
  const { t } = useTranslation();
11059
- const tGroupLabel = groupLabel != null ? groupLabel : t(texts17.countryCodeAndPhoneNumber);
11060
- const tSelectLabel = selectLabel != null ? selectLabel : t(texts17.countryCode);
11145
+ const tGroupLabel = groupLabel != null ? groupLabel : t(texts18.countryCodeAndPhoneNumber);
11146
+ const tSelectLabel = selectLabel != null ? selectLabel : t(texts18.countryCode);
11061
11147
  const generatedId = (0, import_react73.useId)();
11062
11148
  const uniqueId = (_a = props.id) != null ? _a : generatedId;
11063
11149
  const phoneInputId = `${uniqueId}-phone-input`;
@@ -11235,7 +11321,7 @@ var getCallingCode = (s) => {
11235
11321
  var _a;
11236
11322
  return (_a = s.substring(s.indexOf("+"), s.length)) != null ? _a : "";
11237
11323
  };
11238
- var texts17 = createTexts({
11324
+ var texts18 = createTexts({
11239
11325
  countryCode: {
11240
11326
  nb: "Landskode",
11241
11327
  no: "Landskode",
@@ -11346,7 +11432,7 @@ var Popover = ({
11346
11432
  );
11347
11433
  const multiRef = useCombinedRef(ref, popoverRef, floatingRef);
11348
11434
  (0, import_react75.useEffect)(() => {
11349
- setFloatOptions && setFloatOptions({ placement, offset });
11435
+ setFloatOptions == null ? void 0 : setFloatOptions({ placement, offset });
11350
11436
  }, [placement, offset]);
11351
11437
  useOnClickOutside([popoverRef.current, anchorEl], () => {
11352
11438
  if (isOpen && !hasContext) onClose == null ? void 0 : onClose();
@@ -11435,11 +11521,11 @@ var PopoverGroup = ({
11435
11521
  const { refs, styles: positionStyles } = useFloatPosition(null, floatOptions);
11436
11522
  const handleClose = () => {
11437
11523
  setOpen(false);
11438
- onClose && onClose();
11524
+ onClose == null ? void 0 : onClose();
11439
11525
  };
11440
11526
  const handleOpen = () => {
11441
11527
  setOpen(true);
11442
- onOpen && onOpen();
11528
+ onOpen == null ? void 0 : onOpen();
11443
11529
  };
11444
11530
  const handleToggle = () => {
11445
11531
  if (open) {
@@ -11568,8 +11654,8 @@ var ProgressTrackerItem = (props) => {
11568
11654
  const itemState = toItemState(active, completed, disabled);
11569
11655
  const handleClick = () => {
11570
11656
  if (!disabled) {
11571
- onClick && onClick(index);
11572
- handleStepChange && handleStepChange(index);
11657
+ onClick == null ? void 0 : onClick(index);
11658
+ handleStepChange == null ? void 0 : handleStepChange(index);
11573
11659
  }
11574
11660
  };
11575
11661
  const stepNumberContent = (0, import_react78.useMemo)(() => {
@@ -11606,9 +11692,9 @@ var ProgressTrackerItem = (props) => {
11606
11692
  typographyStyles_default["body-medium"]
11607
11693
  ),
11608
11694
  children: [
11609
- /* @__PURE__ */ (0, import_jsx_runtime290.jsx)(VisuallyHidden, { children: t(texts18.stepTextBefore(index + 1)) }),
11695
+ /* @__PURE__ */ (0, import_jsx_runtime290.jsx)(VisuallyHidden, { children: t(texts19.stepTextBefore(index + 1)) }),
11610
11696
  children,
11611
- /* @__PURE__ */ (0, import_jsx_runtime290.jsx)(VisuallyHidden, { children: completed ? t(texts18.completed) : t(texts18.uncompleted) })
11697
+ /* @__PURE__ */ (0, import_jsx_runtime290.jsx)(VisuallyHidden, { children: completed ? t(texts19.completed) : t(texts19.uncompleted) })
11612
11698
  ]
11613
11699
  }
11614
11700
  )
@@ -11649,7 +11735,7 @@ var ProgressTrackerItem = (props) => {
11649
11735
  );
11650
11736
  };
11651
11737
  ProgressTrackerItem.displayName = "ProgressTracker.Item";
11652
- var texts18 = createTexts({
11738
+ var texts19 = createTexts({
11653
11739
  stepTextBefore: (index) => ({
11654
11740
  nb: `${index}. trinn, `,
11655
11741
  no: `${index}. trinn, `,
@@ -11687,7 +11773,7 @@ var ProgressTracker = (() => {
11687
11773
  const [thisActiveStep, setActiveStep] = (0, import_react79.useState)(activeStep);
11688
11774
  const handleChange = (step) => {
11689
11775
  setActiveStep(step);
11690
- onStepChange && onStepChange(step);
11776
+ onStepChange == null ? void 0 : onStepChange(step);
11691
11777
  };
11692
11778
  (0, import_react79.useEffect)(() => {
11693
11779
  if (activeStep !== void 0 && activeStep != thisActiveStep) {
@@ -11712,7 +11798,7 @@ var ProgressTracker = (() => {
11712
11798
  children: /* @__PURE__ */ (0, import_jsx_runtime291.jsx)(
11713
11799
  "nav",
11714
11800
  {
11715
- "aria-label": ariaLabel != null ? ariaLabel : t(texts19.stepProgression),
11801
+ "aria-label": ariaLabel != null ? ariaLabel : t(texts20.stepProgression),
11716
11802
  ...getBaseHTMLProps(id, className, htmlProps, rest),
11717
11803
  children: /* @__PURE__ */ (0, import_jsx_runtime291.jsx)(
11718
11804
  Box,
@@ -11750,7 +11836,7 @@ function passIndexPropToProgressTrackerItem(children) {
11750
11836
  })
11751
11837
  );
11752
11838
  }
11753
- var texts19 = createTexts({
11839
+ var texts20 = createTexts({
11754
11840
  stepProgression: {
11755
11841
  nb: "Stegprogresjon",
11756
11842
  no: "Stegprogresjon",
@@ -11868,30 +11954,6 @@ var typographyTypes2 = {
11868
11954
  medium: "bodyMedium",
11869
11955
  large: "bodyLarge"
11870
11956
  };
11871
- function createEmptyChangeEvent(inputElementId) {
11872
- const inputElement = document.getElementById(
11873
- inputElementId
11874
- );
11875
- inputElement.value = "";
11876
- const emptyChangeEvent = {
11877
- target: inputElement,
11878
- currentTarget: inputElement,
11879
- bubbles: true,
11880
- cancelable: false,
11881
- defaultPrevented: false,
11882
- eventPhase: 0,
11883
- isTrusted: false,
11884
- preventDefault: () => null,
11885
- stopPropagation: () => null,
11886
- nativeEvent: new Event("input"),
11887
- persist: () => null,
11888
- type: "change",
11889
- timeStamp: Date.now(),
11890
- isDefaultPrevented: () => false,
11891
- isPropagationStopped: () => false
11892
- };
11893
- return emptyChangeEvent;
11894
- }
11895
11957
 
11896
11958
  // src/components/Search/SearchSuggestionItem.tsx
11897
11959
  var import_react82 = require("react");
@@ -11988,7 +12050,7 @@ var SearchSuggestions = ({
11988
12050
  {
11989
12051
  index,
11990
12052
  focus: focus === index && showSuggestions,
11991
- "aria-label": t(texts20.search(suggestion)),
12053
+ "aria-label": t(texts21.search(suggestion)),
11992
12054
  onClick: onSuggestionClick,
11993
12055
  "aria-setsize": suggestionsToRender.length,
11994
12056
  "aria-posinset": index,
@@ -12002,7 +12064,7 @@ var SearchSuggestions = ({
12002
12064
  );
12003
12065
  };
12004
12066
  SearchSuggestions.displayName = "SearchSuggestions";
12005
- var texts20 = createTexts({
12067
+ var texts21 = createTexts({
12006
12068
  search: (suggestion) => ({
12007
12069
  no: `${suggestion} s\xF8k`,
12008
12070
  nb: `${suggestion} s\xF8k`,
@@ -12073,13 +12135,14 @@ var Search = ({
12073
12135
  const context = useAutocompleteSearch();
12074
12136
  const combinedRef = context.inputRef ? useCombinedRef(context.inputRef, ref) : ref;
12075
12137
  const handleChange = (e) => {
12138
+ var _a2;
12076
12139
  setHasValue(e.target.value !== "");
12077
- context.onValueChange && context.onValueChange(e);
12078
- onChange && onChange(e);
12140
+ (_a2 = context == null ? void 0 : context.onValueChange) == null ? void 0 : _a2.call(context, e);
12141
+ onChange == null ? void 0 : onChange(e);
12079
12142
  };
12080
12143
  const clearInput = () => {
12081
- const emptyChangeEvent = createEmptyChangeEvent(uniqueId);
12082
- handleChange(emptyChangeEvent);
12144
+ const clearChangeEvent = createClearChangeEvent(uniqueId);
12145
+ handleChange(clearChangeEvent);
12083
12146
  };
12084
12147
  const {
12085
12148
  label: buttonLabel,
@@ -12148,15 +12211,14 @@ var Search = ({
12148
12211
  componentSize
12149
12212
  }
12150
12213
  ),
12151
- /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(VisuallyHidden, { id: suggestionsDescriptionId, children: t(texts21.useArrowKeys) })
12214
+ /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(VisuallyHidden, { id: suggestionsDescriptionId, children: t(texts22.useArrowKeys) })
12152
12215
  ] }),
12153
12216
  hasValue && /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(
12154
- Button,
12217
+ InlineIconButton,
12155
12218
  {
12156
12219
  icon: CloseSmallIcon,
12157
- size: componentSize === "large" ? "medium" : "small",
12158
- purpose: "tertiary",
12159
- "aria-label": t(texts21.clearSearch),
12220
+ size: componentSize === "small" ? "small" : "medium",
12221
+ "aria-label": t(texts22.clearSearch),
12160
12222
  onClick: clearInput,
12161
12223
  className: Search_default["clear-button"]
12162
12224
  }
@@ -12196,7 +12258,7 @@ var Search = ({
12196
12258
  ] });
12197
12259
  };
12198
12260
  Search.displayName = "Search";
12199
- var texts21 = createTexts({
12261
+ var texts22 = createTexts({
12200
12262
  clearSearch: {
12201
12263
  nb: "T\xF8m s\xF8k",
12202
12264
  no: "T\xF8m s\xF8k",
@@ -12263,12 +12325,12 @@ var SearchAutocompleteWrapper = (props) => {
12263
12325
  } else {
12264
12326
  setSuggestions([]);
12265
12327
  }
12266
- onChange && onChange(e);
12328
+ onChange == null ? void 0 : onChange(e);
12267
12329
  };
12268
12330
  const handleSuggestionClick = (e) => {
12269
12331
  setSuggestions([]);
12270
12332
  handleSetInputValue(e.target.innerText);
12271
- onSuggestionSelection && onSuggestionSelection();
12333
+ onSuggestionSelection == null ? void 0 : onSuggestionSelection();
12272
12334
  closeSuggestions();
12273
12335
  };
12274
12336
  const handleSetInputValue = (value2) => {
@@ -12399,7 +12461,7 @@ var SplitButton = ({
12399
12461
  {
12400
12462
  ...buttonStyleProps,
12401
12463
  icon: isOpen ? ChevronUpIcon : ChevronDownIcon,
12402
- "aria-label": t(texts22.moreActions),
12464
+ "aria-label": t(texts23.moreActions),
12403
12465
  purpose,
12404
12466
  className: cn(
12405
12467
  SplitButton_default.option,
@@ -12413,7 +12475,7 @@ var SplitButton = ({
12413
12475
  ] });
12414
12476
  };
12415
12477
  SplitButton.displayName = "SplitButton";
12416
- var texts22 = createTexts({
12478
+ var texts23 = createTexts({
12417
12479
  moreActions: {
12418
12480
  nb: "Flere handlinger",
12419
12481
  no: "Flere handlinger",
@@ -12571,7 +12633,7 @@ var SortCell = ({
12571
12633
  StylelessButton,
12572
12634
  {
12573
12635
  onClick,
12574
- "aria-description": t(texts23.changeSort),
12636
+ "aria-description": t(texts24.changeSort),
12575
12637
  className: cn(Table_default["sort-button"], focusable),
12576
12638
  children: [
12577
12639
  children,
@@ -12584,7 +12646,7 @@ var SortCell = ({
12584
12646
  );
12585
12647
  };
12586
12648
  SortCell.displayName = "Table.SortCell";
12587
- var texts23 = createTexts({
12649
+ var texts24 = createTexts({
12588
12650
  changeSort: {
12589
12651
  nb: "Aktiver for \xE5 endre sorteringsrekkef\xF8lge",
12590
12652
  no: "Aktiver for \xE5 endre sorteringsrekkef\xF8lge",
@@ -12690,7 +12752,7 @@ var CollapsibleRow = ({
12690
12752
  const { isCollapsed, headerValues, definingColumnIndex } = useCollapsibleTableContext();
12691
12753
  const [childrenCollapsed, setChildrenCollapsed] = (0, import_react89.useState)(true);
12692
12754
  (0, import_react89.useEffect)(() => {
12693
- !isCollapsed && setChildrenCollapsed(true);
12755
+ if (!isCollapsed) setChildrenCollapsed(true);
12694
12756
  }, [isCollapsed]);
12695
12757
  const rowProps = (isOpenCollapsibleHeader) => {
12696
12758
  return {
@@ -12732,8 +12794,8 @@ var CollapsibleRow = ({
12732
12794
  return /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(Row, { ref, ...rowProps(), children: /* @__PURE__ */ (0, import_jsx_runtime308.jsxs)(import_jsx_runtime308.Fragment, { children: [
12733
12795
  definingColumnCells,
12734
12796
  /* @__PURE__ */ (0, import_jsx_runtime308.jsxs)(Table2.Cell, { type: "head", layout: "center", children: [
12735
- t(texts24.expand),
12736
- /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(VisuallyHidden, { children: t(texts24.row) })
12797
+ t(texts25.expand),
12798
+ /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(VisuallyHidden, { children: t(texts25.row) })
12737
12799
  ] })
12738
12800
  ] }) });
12739
12801
  };
@@ -12770,7 +12832,7 @@ var CollapsibleRow = ({
12770
12832
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(Row, { ref, ...rowProps(), children });
12771
12833
  };
12772
12834
  CollapsibleRow.displayName = "CollapsibleTable.Row";
12773
- var texts24 = createTexts({
12835
+ var texts25 = createTexts({
12774
12836
  expand: {
12775
12837
  nb: "Utvid",
12776
12838
  no: "Utvid",
@@ -12944,7 +13006,7 @@ var Tabs = ({
12944
13006
  const tabPanelsRef = (0, import_react93.useRef)(null);
12945
13007
  const handleTabChange = (index) => {
12946
13008
  setActiveTab(index);
12947
- onChange && onChange(index);
13009
+ onChange == null ? void 0 : onChange(index);
12948
13010
  };
12949
13011
  (0, import_react93.useEffect)(() => {
12950
13012
  if (activeTab !== void 0 && activeTab !== thisActiveTab) {
@@ -13105,7 +13167,7 @@ var TabList = ({
13105
13167
  const [widths, setWidths] = (0, import_react95.useState)([]);
13106
13168
  const handleOnFocus = (event) => {
13107
13169
  setHasTabFocus(true);
13108
- onFocus && onFocus(event);
13170
+ onFocus == null ? void 0 : onFocus(event);
13109
13171
  };
13110
13172
  const handleOnBlur = (event) => {
13111
13173
  var _a;
@@ -13718,8 +13780,9 @@ var ToggleRadio = ({
13718
13780
  const uniqueId = id != null ? id : `${generatedId}-ToggleRadio`;
13719
13781
  const group = useToggleBarContext();
13720
13782
  const handleChange = (event) => {
13721
- onChange && onChange(event);
13722
- (group == null ? void 0 : group.onChange) && group.onChange(event);
13783
+ var _a;
13784
+ onChange == null ? void 0 : onChange(event);
13785
+ (_a = group == null ? void 0 : group.onChange) == null ? void 0 : _a.call(group, event);
13723
13786
  };
13724
13787
  const contentTypeCn = label ? "with-text" : "just-icon";
13725
13788
  return /* @__PURE__ */ (0, import_jsx_runtime321.jsxs)("label", { htmlFor: uniqueId, className: ToggleBar_default.label, children: [
@@ -14015,6 +14078,7 @@ ToggleButtonGroup.displayName = "ToggleButtonGroup";
14015
14078
  InfoIcon,
14016
14079
  InlineButton,
14017
14080
  InlineEditInput,
14081
+ InlineEditSelect,
14018
14082
  InlineEditTextArea,
14019
14083
  Input,
14020
14084
  InputMessage,