@norges-domstoler/dds-components 21.6.0 → 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",
@@ -7578,7 +7580,9 @@ var TextArea = ({
7578
7580
  const [text, setText] = (0, import_react55.useState)(getDefaultText(value, defaultValue));
7579
7581
  (0, import_react55.useEffect)(() => {
7580
7582
  if (textAreaRef == null ? void 0 : textAreaRef.current) {
7581
- textAreaRef.current.style.height = `${textAreaRef.current.scrollHeight + 2}px`;
7583
+ const el = textAreaRef.current;
7584
+ el.style.height = "auto";
7585
+ el.style.height = `${el.scrollHeight + 2}px`;
7582
7586
  }
7583
7587
  }, [text]);
7584
7588
  const onChangeHandler = (event) => {
@@ -7664,26 +7668,10 @@ var TextArea = ({
7664
7668
  TextArea.displayName = "TextArea";
7665
7669
 
7666
7670
  // src/components/Feedback/utils.tsx
7667
- var import_jsx_runtime249 = require("react/jsx-runtime");
7668
7671
  var getIconSize = (layout) => layout === "vertical" ? "large" : "medium";
7669
- var ThumbIcon = ({ rating, layout, type }) => type === "comment" ? /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
7670
- Icon,
7671
- {
7672
- icon: rating === "positive" ? ThumbUpFilledIcon : ThumbDownFilledIcon,
7673
- color: "iconActionResting",
7674
- iconSize: getIconSize(layout)
7675
- }
7676
- ) : /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
7677
- Icon,
7678
- {
7679
- icon: rating === "positive" ? ThumbUpIcon : ThumbDownIcon,
7680
- color: "iconMedium",
7681
- iconSize: getIconSize(layout)
7682
- }
7683
- );
7684
7672
 
7685
7673
  // src/components/Feedback/CommentComponent.tsx
7686
- var import_jsx_runtime250 = require("react/jsx-runtime");
7674
+ var import_jsx_runtime249 = require("react/jsx-runtime");
7687
7675
  var CommentComponent = ({
7688
7676
  layout,
7689
7677
  rating,
@@ -7697,15 +7685,22 @@ var CommentComponent = ({
7697
7685
  handleFeedbackTextChange
7698
7686
  }) => {
7699
7687
  const { t } = useTranslation();
7700
- return /* @__PURE__ */ (0, import_jsx_runtime250.jsxs)(VStack, { gap: "x1", children: [
7701
- /* @__PURE__ */ (0, import_jsx_runtime250.jsxs)("span", { className: Feedback_default["rating-submitted-title"], children: [
7702
- ThumbIcon({ rating, layout, type: "comment" }),
7703
- /* @__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: [
7704
7699
  ratingSubmittedTitle,
7705
7700
  " "
7706
7701
  ] })
7707
7702
  ] }),
7708
- /* @__PURE__ */ (0, import_jsx_runtime250.jsx)(
7703
+ /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
7709
7704
  TextArea,
7710
7705
  {
7711
7706
  value: feedbackText,
@@ -7714,7 +7709,7 @@ var CommentComponent = ({
7714
7709
  tip: textAreaTip
7715
7710
  }
7716
7711
  ),
7717
- /* @__PURE__ */ (0, import_jsx_runtime250.jsx)(
7712
+ /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(
7718
7713
  Button,
7719
7714
  {
7720
7715
  purpose: "secondary",
@@ -7735,6 +7730,29 @@ var texts9 = createTexts({
7735
7730
  }
7736
7731
  });
7737
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
+
7738
7756
  // src/components/Tooltip/Tooltip.tsx
7739
7757
  var import_react56 = require("react");
7740
7758
 
@@ -7775,7 +7793,9 @@ var Tooltip = ({
7775
7793
  const combinedRef = useCombinedRef(ref, refs.setFloating, tooltipRef);
7776
7794
  const closeWhenNotInView = (entries) => {
7777
7795
  const [entry] = entries;
7778
- entry.isIntersecting ? setInView(true) : setInView(false);
7796
+ if (entry.isIntersecting) {
7797
+ setInView(true);
7798
+ } else setInView(false);
7779
7799
  };
7780
7800
  (0, import_react56.useEffect)(() => {
7781
7801
  const options = {
@@ -7900,12 +7920,13 @@ var RatingComponent = ({
7900
7920
  }) => {
7901
7921
  const { t } = useTranslation();
7902
7922
  const button = (rating, layout2, tooltip) => /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(
7903
- StylelessButton,
7923
+ InlineIconButton,
7904
7924
  {
7905
7925
  "aria-label": tooltip,
7906
7926
  onClick: () => handleRatingChange(rating),
7907
- className: cn(Feedback_default.button, Feedback_default[`button--${layout2}`], focusable),
7908
- children: ThumbIcon({ rating, layout: layout2, type: "rating" })
7927
+ size: getIconSize(layout2),
7928
+ icon: rating === "positive" ? ThumbUpIcon : ThumbDownIcon,
7929
+ color: "icon-medium"
7909
7930
  }
7910
7931
  );
7911
7932
  return /* @__PURE__ */ (0, import_jsx_runtime252.jsxs)(
@@ -7968,26 +7989,26 @@ var Feedback = ({
7968
7989
  const tThumbUpTooltip = thumbUpTooltip != null ? thumbUpTooltip : t(texts11.good);
7969
7990
  const tThumbDownTooltip = thumbDownTooltip != null ? thumbDownTooltip : t(texts11.bad);
7970
7991
  (0, import_react57.useEffect)(() => {
7971
- ratingProp !== void 0 && setRating(ratingProp);
7992
+ if (ratingProp !== void 0) setRating(ratingProp);
7972
7993
  }, [ratingProp]);
7973
7994
  (0, import_react57.useEffect)(() => {
7974
- feedbackTextProp !== void 0 && setFeedbackText(feedbackTextProp);
7995
+ if (feedbackTextProp !== void 0) setFeedbackText(feedbackTextProp);
7975
7996
  }, [feedbackTextProp]);
7976
7997
  (0, import_react57.useEffect)(() => {
7977
- isSubmittedProp !== void 0 && setIsFeedbackSubmitted(isSubmittedProp);
7998
+ if (isSubmittedProp !== void 0) setIsFeedbackSubmitted(isSubmittedProp);
7978
7999
  }, [isSubmittedProp]);
7979
8000
  const handleRatingChange = (newRating) => {
7980
- onRating && onRating(newRating);
7981
- onSubmit && feedbackTextAreaExcluded && onSubmit(newRating, "");
7982
- 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);
7983
8004
  };
7984
8005
  const handleFeedbackTextChange = (newFeedbackText) => {
7985
- onFeedbackTextChange && onFeedbackTextChange(newFeedbackText);
7986
- feedbackTextProp === void 0 && setFeedbackText(newFeedbackText);
8006
+ onFeedbackTextChange == null ? void 0 : onFeedbackTextChange(newFeedbackText);
8007
+ if (feedbackTextProp === void 0) setFeedbackText(newFeedbackText);
7987
8008
  };
7988
8009
  const handleSubmit = () => {
7989
- onSubmit && onSubmit(rating, feedbackText != null ? feedbackText : "");
7990
- isSubmittedProp === void 0 && setIsFeedbackSubmitted(true);
8010
+ onSubmit == null ? void 0 : onSubmit(rating, feedbackText != null ? feedbackText : "");
8011
+ if (isSubmittedProp === void 0) setIsFeedbackSubmitted(true);
7991
8012
  };
7992
8013
  if (rating === null && !isFeedbackSubmitted) {
7993
8014
  return /* @__PURE__ */ (0, import_jsx_runtime253.jsx)(
@@ -8447,11 +8468,9 @@ var useFileUploader = (props) => {
8447
8468
  () => ({
8448
8469
  onBlur: onRootBlur,
8449
8470
  onFocus: onRootFocus,
8450
- // eslint-disable-next-line @typescript-eslint/no-misused-promises
8451
8471
  onDragEnter: onRootDragEnter,
8452
8472
  onDragOver: onRootDragOver,
8453
8473
  onDragLeave: onRootDragLeave,
8454
- // eslint-disable-next-line @typescript-eslint/no-misused-promises
8455
8474
  onDrop: setFiles,
8456
8475
  ref: rootRef
8457
8476
  }),
@@ -8478,7 +8497,6 @@ var useFileUploader = (props) => {
8478
8497
  style: { display: "none" },
8479
8498
  tabIndex: -1,
8480
8499
  ref: inputRef,
8481
- // eslint-disable-next-line @typescript-eslint/no-misused-promises
8482
8500
  onChange: setFiles,
8483
8501
  multiple: !maxFiles || maxFiles > 1,
8484
8502
  ...accept ? { accept: accept.join(",") } : {}
@@ -8787,7 +8805,7 @@ var GlobalMessage = ({
8787
8805
  purpose: "tertiary",
8788
8806
  onClick: () => {
8789
8807
  setClosed(true);
8790
- onClose && onClose();
8808
+ onClose == null ? void 0 : onClose();
8791
8809
  },
8792
8810
  size: "small",
8793
8811
  "aria-label": t(commonTexts.closeMessage)
@@ -8819,7 +8837,7 @@ var InlineButton = ({ className, ...rest }) => /* @__PURE__ */ (0, import_jsx_ru
8819
8837
  }
8820
8838
  );
8821
8839
 
8822
- // src/components/InlineEdit/InlineEditTextArea.tsx
8840
+ // src/components/InlineEdit/InlineEditTextArea/InlineEditTextArea.tsx
8823
8841
  var import_react63 = require("react");
8824
8842
 
8825
8843
  // src/components/InlineEdit/InlineEdit.context.tsx
@@ -8885,15 +8903,20 @@ var InlineEditContextProvider = (props) => {
8885
8903
  };
8886
8904
  InlineEditContextProvider.displayName = "InlineEditContextProvider";
8887
8905
 
8888
- // src/components/InlineEdit/InlineTextArea.tsx
8906
+ // src/components/InlineEdit/InlineField.tsx
8889
8907
  var import_react62 = require("react");
8890
8908
 
8891
8909
  // src/components/InlineEdit/InlineEdit.module.css
8892
8910
  var InlineEdit_default = {
8893
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",
8894
8915
  "inline-input--with-icon": "InlineEdit_inline-input--with-icon",
8895
8916
  "inline-textarea": "InlineEdit_inline-textarea",
8896
- "icon-wrapper": "InlineEdit_icon-wrapper"
8917
+ "icon-wrapper": "InlineEdit_icon-wrapper",
8918
+ chevron: "InlineEdit_chevron",
8919
+ "clear-button": "InlineEdit_clear-button"
8897
8920
  };
8898
8921
 
8899
8922
  // src/components/InlineEdit/InlineEdit.utils.tsx
@@ -8919,29 +8942,153 @@ var texts14 = createTexts({
8919
8942
  en: " Input field cannot be cleared."
8920
8943
  }
8921
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
+ ];
8922
8959
 
8923
- // 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
8924
8992
  var import_jsx_runtime271 = require("react/jsx-runtime");
8925
- var InlineTextArea = ({
8926
- id,
8927
- error,
8928
- errorMessage,
8929
- width = "140px",
8930
- "aria-describedby": ariaDescribedby,
8931
- hideIcon,
8932
- ref,
8933
- ...rest
8934
- }) => {
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;
8935
9006
  const { onBlur, onChange, onFocus, isEditing, value, emptiable } = useInlineEditContext();
8936
- const genereatedId = (0, import_react62.useId)();
8937
- 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`;
8938
9010
  const hasErrorMessage = !!errorMessage;
9011
+ const hasErrorState = !!error || hasErrorMessage;
8939
9012
  const errorMessageId = derivativeIdGenerator(uniqueId, "errorMessage");
8940
- const hasError = !!error;
8941
- const hasErrorState = hasError || hasErrorMessage;
8942
9013
  const descId = derivativeIdGenerator(uniqueId, "desc");
9014
+ const hasValue = !!value;
8943
9015
  const inputRef = (0, import_react62.useRef)(null);
8944
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
+ };
8945
9092
  return /* @__PURE__ */ (0, import_jsx_runtime271.jsxs)(Box, { position: "relative", width, children: [
8946
9093
  /* @__PURE__ */ (0, import_jsx_runtime271.jsxs)("div", { className: Input_default["input-group"], children: [
8947
9094
  !isEditing && !hideIcon && /* @__PURE__ */ (0, import_jsx_runtime271.jsx)(
@@ -8949,47 +9096,28 @@ var InlineTextArea = ({
8949
9096
  {
8950
9097
  onClick: () => {
8951
9098
  var _a;
8952
- (_a = inputRef.current) == null ? void 0 : _a.focus();
9099
+ return (_a = inputRef.current) == null ? void 0 : _a.focus();
8953
9100
  },
8954
9101
  className: InlineEdit_default["icon-wrapper"],
8955
9102
  children: /* @__PURE__ */ (0, import_jsx_runtime271.jsx)(Icon, { icon: EditIcon, iconSize: "small" })
8956
9103
  }
8957
9104
  ),
8958
- /* @__PURE__ */ (0, import_jsx_runtime271.jsx)(
8959
- "textarea",
8960
- {
8961
- ...rest,
8962
- value,
8963
- onChange,
8964
- onBlur,
8965
- onFocus,
8966
- id: uniqueId,
8967
- ref: combinedRef,
8968
- "aria-describedby": spaceSeparatedIdListGenerator([
8969
- hasErrorMessage ? errorMessageId : void 0,
8970
- descId,
8971
- ariaDescribedby
8972
- ]),
8973
- className: cn(
8974
- InlineEdit_default["inline-input"],
8975
- !hideIcon && !isEditing && InlineEdit_default["inline-input--with-icon"],
8976
- InlineEdit_default["inline-textarea"],
8977
- Input_default["input--stateful"],
8978
- hasErrorState && Input_default["input--stateful-danger"],
8979
- typographyStyles_default["body-medium"],
8980
- utilStyles_default.scrollbar,
8981
- focusable
8982
- )
8983
- }
8984
- )
9105
+ renderElement()
8985
9106
  ] }),
8986
9107
  inlineEditVisuallyHidden(descId, emptiable),
8987
9108
  renderInputMessage(void 0, void 0, errorMessage, errorMessageId)
8988
9109
  ] });
8989
- };
8990
- 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
+ });
8991
9119
 
8992
- // src/components/InlineEdit/InlineEditTextArea.tsx
9120
+ // src/components/InlineEdit/InlineEditTextArea/InlineEditTextArea.tsx
8993
9121
  var import_jsx_runtime272 = require("react/jsx-runtime");
8994
9122
  var InlineEditTextArea = ({
8995
9123
  onSetValue,
@@ -9013,85 +9141,45 @@ var InlineEditTextArea = ({
9013
9141
  onFocus,
9014
9142
  onChange,
9015
9143
  onBlur,
9016
- 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 })
9017
9145
  }
9018
9146
  );
9019
9147
  };
9020
9148
 
9021
- // src/components/InlineEdit/InlineEditInput.tsx
9022
- var import_react65 = require("react");
9023
-
9024
- // src/components/InlineEdit/InlineInput.tsx
9149
+ // src/components/InlineEdit/InlineEditInput/InlineEditInput.tsx
9025
9150
  var import_react64 = require("react");
9026
9151
  var import_jsx_runtime273 = require("react/jsx-runtime");
9027
- var InlineInput = ({
9028
- id,
9029
- error,
9030
- errorMessage,
9031
- width = "140px",
9032
- "aria-describedby": ariaDescribedby,
9033
- hideIcon,
9152
+ var InlineEditInput = ({
9153
+ onSetValue,
9154
+ emptiable,
9155
+ value,
9156
+ onFocus,
9157
+ onChange,
9158
+ onBlur,
9034
9159
  ref,
9035
9160
  ...rest
9036
9161
  }) => {
9037
- const { onBlur, onChange, onFocus, isEditing, value, emptiable } = useInlineEditContext();
9038
- const genereatedId = (0, import_react64.useId)();
9039
- const uniqueId = id != null ? id : `${genereatedId}-InlineInput`;
9040
- const hasErrorMessage = !!errorMessage;
9041
- const hasError = !!error;
9042
- const hasErrorState = hasError || hasErrorMessage;
9043
- const errorMessageId = derivativeIdGenerator(uniqueId, "errorMessage");
9044
- const descId = derivativeIdGenerator(uniqueId, "desc");
9045
9162
  const inputRef = (0, import_react64.useRef)(null);
9046
9163
  const combinedRef = useCombinedRef(ref, inputRef);
9047
- return /* @__PURE__ */ (0, import_jsx_runtime273.jsxs)(Box, { position: "relative", width, children: [
9048
- /* @__PURE__ */ (0, import_jsx_runtime273.jsxs)("div", { className: Input_default["input-group"], children: [
9049
- !isEditing && !hideIcon && /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(
9050
- "span",
9051
- {
9052
- onClick: () => {
9053
- var _a;
9054
- (_a = inputRef.current) == null ? void 0 : _a.focus();
9055
- },
9056
- className: InlineEdit_default["icon-wrapper"],
9057
- children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(Icon, { icon: EditIcon, iconSize: "small" })
9058
- }
9059
- ),
9060
- /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(
9061
- "input",
9062
- {
9063
- ...rest,
9064
- value,
9065
- onChange,
9066
- onBlur,
9067
- onFocus,
9068
- id: uniqueId,
9069
- ref: combinedRef,
9070
- "aria-describedby": spaceSeparatedIdListGenerator([
9071
- hasErrorMessage ? errorMessageId : void 0,
9072
- descId,
9073
- ariaDescribedby
9074
- ]),
9075
- "aria-invalid": hasErrorState,
9076
- className: cn(
9077
- InlineEdit_default["inline-input"],
9078
- !hideIcon && !isEditing && InlineEdit_default["inline-input--with-icon"],
9079
- typographyStyles_default["body-medium"],
9080
- hasErrorState && Input_default["input--stateful-danger"],
9081
- focusable
9082
- )
9083
- }
9084
- )
9085
- ] }),
9086
- inlineEditVisuallyHidden(descId, emptiable),
9087
- renderInputMessage(void 0, void 0, errorMessage, errorMessageId)
9088
- ] });
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
+ );
9089
9177
  };
9090
- InlineInput.displayName = "InlineInput";
9091
9178
 
9092
- // src/components/InlineEdit/InlineEditInput.tsx
9179
+ // src/components/InlineEdit/InlineEditSelect/InlineEditSelect.tsx
9180
+ var import_react65 = require("react");
9093
9181
  var import_jsx_runtime274 = require("react/jsx-runtime");
9094
- var InlineEditInput = ({
9182
+ var InlineEditSelect = ({
9095
9183
  onSetValue,
9096
9184
  emptiable,
9097
9185
  value,
@@ -9113,7 +9201,7 @@ var InlineEditInput = ({
9113
9201
  onFocus,
9114
9202
  onChange,
9115
9203
  onBlur,
9116
- 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 })
9117
9205
  }
9118
9206
  );
9119
9207
  };
@@ -9180,7 +9268,7 @@ var InternalHeader = (props) => {
9180
9268
  const hasContextMenuElements = !!contextMenuItems && contextMenuItems.length > 0;
9181
9269
  const hasSmallScreenBreakpoint = !!smallScreenBreakpoint;
9182
9270
  const hasNavInContextMenu = hasSmallScreenBreakpoint && hasNavigationElements;
9183
- 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)(
9184
9272
  ShowHide,
9185
9273
  {
9186
9274
  as: StylelessList,
@@ -9244,7 +9332,7 @@ var InternalHeader = (props) => {
9244
9332
  {
9245
9333
  icon: hasNavInContextMenu ? MenuIcon : MoreVerticalIcon,
9246
9334
  purpose: "tertiary",
9247
- "aria-label": t(texts15.openMenu)
9335
+ "aria-label": t(texts16.openMenu)
9248
9336
  }
9249
9337
  ),
9250
9338
  /* @__PURE__ */ (0, import_jsx_runtime276.jsxs)(OverflowMenu, { className: InternalHeader_default["context-menu"], children: [
@@ -9253,7 +9341,7 @@ var InternalHeader = (props) => {
9253
9341
  ShowHide,
9254
9342
  {
9255
9343
  as: "nav",
9256
- "aria-label": t(texts15.siteNavigation),
9344
+ "aria-label": t(texts16.siteNavigation),
9257
9345
  showBelow: smallScreenBreakpoint,
9258
9346
  children: /* @__PURE__ */ (0, import_jsx_runtime276.jsx)(OverflowMenuList, { children: navItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime276.jsx)(OverflowMenuLink, { ...item })) })
9259
9347
  }
@@ -9282,7 +9370,7 @@ var InternalHeader = (props) => {
9282
9370
  );
9283
9371
  };
9284
9372
  InternalHeader.displayName = "InternalHeader";
9285
- var texts15 = createTexts({
9373
+ var texts16 = createTexts({
9286
9374
  openMenu: {
9287
9375
  nb: "\xC5pne meny",
9288
9376
  no: "\xC5pne meny",
@@ -9422,7 +9510,7 @@ var LocalMessage = ({
9422
9510
  purpose: "tertiary",
9423
9511
  onClick: () => {
9424
9512
  setClosed(true);
9425
- onClose && onClose();
9513
+ onClose == null ? void 0 : onClose();
9426
9514
  },
9427
9515
  size: "xsmall",
9428
9516
  "aria-label": t(commonTexts.closeMessage),
@@ -9609,7 +9697,7 @@ var ModalActions = (props) => /* @__PURE__ */ (0, import_jsx_runtime282.jsx)(Box
9609
9697
  ModalActions.displayName = "ModalActions";
9610
9698
 
9611
9699
  // src/components/Pagination/Pagination.tsx
9612
- var import_react71 = require("react");
9700
+ var import_react72 = require("react");
9613
9701
 
9614
9702
  // src/components/Pagination/Pagination.module.css
9615
9703
  var Pagination_default = {
@@ -9654,7 +9742,7 @@ function PaginationGenerator(pagesAmount, activePage) {
9654
9742
  }
9655
9743
 
9656
9744
  // src/components/Select/Select.tsx
9657
- var import_react69 = require("react");
9745
+ var import_react70 = require("react");
9658
9746
  var import_react_select2 = __toESM(require("react-select"));
9659
9747
 
9660
9748
  // src/components/Select/Select.module.css
@@ -9934,6 +10022,7 @@ var getCustomStyles = (size2, hasError, hasIcon, isReadOnly) => ({
9934
10022
  });
9935
10023
 
9936
10024
  // src/components/Select/SelectComponents.tsx
10025
+ var import_react69 = require("react");
9937
10026
  var import_react_select = require("react-select");
9938
10027
  var import_jsx_runtime283 = require("react/jsx-runtime");
9939
10028
  var {
@@ -9984,35 +10073,45 @@ var DDSInput = (props, ariaInvalid, ariaDescribedby) => /* @__PURE__ */ (0, impo
9984
10073
  "aria-describedby": ariaDescribedby
9985
10074
  }
9986
10075
  );
9987
- var DDSControl = (props, componentSize, readOnly, icon, dataTestId) => {
9988
- const { className, ...rest } = props;
9989
- return /* @__PURE__ */ (0, import_jsx_runtime283.jsx)("div", { "data-testid": dataTestId ? dataTestId + "-control" : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime283.jsxs)(
9990
- Control,
9991
- {
9992
- ...rest,
9993
- className: cn(
9994
- className,
9995
- Select_default.control,
9996
- rest.isDisabled && Select_default["control--disabled"],
9997
- readOnly && Select_default["control--readonly"]
9998
- ),
9999
- children: [
10000
- icon && /* @__PURE__ */ (0, import_jsx_runtime283.jsx)(
10001
- Icon,
10002
- {
10003
- icon,
10004
- iconSize: getFormInputIconSize(componentSize),
10005
- className: cn(
10006
- Input_default["input-group__absolute-element"],
10007
- Select_default[`icon--${componentSize}`]
10008
- )
10009
- }
10076
+ function createDDSControl(componentSize, readOnly, icon, dataTestId) {
10077
+ return function DDSControlWrapper(props) {
10078
+ const { className, children, innerProps, ...rest } = props;
10079
+ return /* @__PURE__ */ (0, import_jsx_runtime283.jsxs)(
10080
+ Control,
10081
+ {
10082
+ ...rest,
10083
+ innerProps: {
10084
+ ...innerProps,
10085
+ "data-testid": dataTestId ? dataTestId + "-control" : void 0
10086
+ },
10087
+ className: cn(
10088
+ className,
10089
+ Select_default.control,
10090
+ rest.isDisabled && Select_default["control--disabled"],
10091
+ readOnly && Select_default["control--readonly"]
10010
10092
  ),
10011
- props.children
10012
- ]
10013
- }
10014
- ) });
10015
- };
10093
+ children: [
10094
+ icon && /* @__PURE__ */ (0, import_jsx_runtime283.jsx)(
10095
+ Icon,
10096
+ {
10097
+ icon,
10098
+ iconSize: getFormInputIconSize(componentSize),
10099
+ className: cn(
10100
+ Input_default["input-group__absolute-element"],
10101
+ Select_default[`icon--${componentSize}`]
10102
+ )
10103
+ }
10104
+ ),
10105
+ children
10106
+ ]
10107
+ }
10108
+ );
10109
+ };
10110
+ }
10111
+ var DDSControl = (componentSize, readOnly, icon, dataTestId) => (0, import_react69.useMemo)(
10112
+ () => createDDSControl(componentSize, readOnly, icon, dataTestId),
10113
+ [componentSize, readOnly, icon, dataTestId]
10114
+ );
10016
10115
 
10017
10116
  // src/components/Select/Select.tsx
10018
10117
  var import_jsx_runtime284 = require("react/jsx-runtime");
@@ -10046,12 +10145,12 @@ function Select({
10046
10145
  ref,
10047
10146
  ...rest
10048
10147
  }) {
10049
- const themeContext = (0, import_react69.useContext)(ThemeContext);
10148
+ const themeContext = (0, import_react70.useContext)(ThemeContext);
10050
10149
  if (!themeContext) {
10051
10150
  throw new Error("Select must be used within a ThemeProvider");
10052
10151
  }
10053
10152
  const portalTarget = menuPortalTarget != null ? menuPortalTarget : themeContext == null ? void 0 : themeContext.el;
10054
- const generatedId = (0, import_react69.useId)();
10153
+ const generatedId = (0, import_react70.useId)();
10055
10154
  const uniqueId = id != null ? id : `${generatedId}-select`;
10056
10155
  const singleValueId = !isMulti ? `${uniqueId}-singleValue` : void 0;
10057
10156
  const hasLabel = !!label;
@@ -10107,7 +10206,7 @@ function Select({
10107
10206
  ClearIndicator: (props) => DDSClearIndicator(props, componentSize),
10108
10207
  DropdownIndicator: (props) => DDSDropdownIndicator(props, componentSize),
10109
10208
  MultiValueRemove: DDSMultiValueRemove,
10110
- Control: (props) => DDSControl(props, componentSize, readOnly, icon, dataTestId)
10209
+ Control: DDSControl(componentSize, readOnly, icon, dataTestId)
10111
10210
  },
10112
10211
  "aria-invalid": hasErrorMessage ? true : void 0,
10113
10212
  required,
@@ -10147,7 +10246,7 @@ function Select({
10147
10246
  Select.displayName = "Select";
10148
10247
 
10149
10248
  // src/components/Select/NativeSelect/NativeSelect.tsx
10150
- var import_react70 = require("react");
10249
+ var import_react71 = require("react");
10151
10250
 
10152
10251
  // src/components/Select/NativeSelect/NativeSelect.module.css
10153
10252
  var NativeSelect_default = {
@@ -10181,7 +10280,7 @@ var NativeSelect = ({
10181
10280
  onMouseDown,
10182
10281
  ...rest
10183
10282
  }) => {
10184
- const generatedId = (0, import_react70.useId)();
10283
+ const generatedId = (0, import_react71.useId)();
10185
10284
  const uniqueId = id != null ? id : `${generatedId}-native-select`;
10186
10285
  const hasErrorMessage = !!errorMessage;
10187
10286
  const hasTip = !!tip;
@@ -10283,12 +10382,12 @@ var Pagination = ({
10283
10382
  ...rest
10284
10383
  }) => {
10285
10384
  const { t } = useTranslation();
10286
- const [activePage, setActivePage] = (0, import_react71.useState)(defaultActivePage);
10287
- const [itemsPerPage, setItemsPerPage] = (0, import_react71.useState)(defaultItemsPerPage);
10385
+ const [activePage, setActivePage] = (0, import_react72.useState)(defaultActivePage);
10386
+ const [itemsPerPage, setItemsPerPage] = (0, import_react72.useState)(defaultItemsPerPage);
10288
10387
  const pagesLength = Math.ceil(itemsAmount / itemsPerPage);
10289
10388
  const items = PaginationGenerator(pagesLength, activePage);
10290
10389
  const onPageChange = (event, page) => {
10291
- page && setActivePage(page);
10390
+ if (page) setActivePage(page);
10292
10391
  if (event && onChange) {
10293
10392
  onChange(event, page);
10294
10393
  }
@@ -10311,7 +10410,7 @@ var Pagination = ({
10311
10410
  onClick: (event) => {
10312
10411
  onPageChange(event, item);
10313
10412
  },
10314
- "aria-label": isActive ? t(texts16.currentPage(item)) : t(texts16.page(item)),
10413
+ "aria-label": isActive ? t(texts17.currentPage(item)) : t(texts17.page(item)),
10315
10414
  children: item
10316
10415
  }
10317
10416
  ) : /* @__PURE__ */ (0, import_jsx_runtime286.jsx)(
@@ -10331,7 +10430,7 @@ var Pagination = ({
10331
10430
  onClick: (event) => {
10332
10431
  onPageChange(event, activePage - 1);
10333
10432
  },
10334
- "aria-label": t(texts16.previousPage)
10433
+ "aria-label": t(texts17.previousPage)
10335
10434
  }
10336
10435
  );
10337
10436
  const nextPageButton = /* @__PURE__ */ (0, import_jsx_runtime286.jsx)(
@@ -10343,7 +10442,7 @@ var Pagination = ({
10343
10442
  onClick: (event) => {
10344
10443
  onPageChange(event, activePage + 1);
10345
10444
  },
10346
- "aria-label": t(texts16.nextPage)
10445
+ "aria-label": t(texts17.nextPage)
10347
10446
  }
10348
10447
  );
10349
10448
  const isOnFirstPage = activePage === 1;
@@ -10353,7 +10452,7 @@ var Pagination = ({
10353
10452
  {
10354
10453
  as: "nav",
10355
10454
  ref,
10356
- "aria-label": t(texts16.pagination),
10455
+ "aria-label": t(texts17.pagination),
10357
10456
  display: "flex",
10358
10457
  alignItems: "center",
10359
10458
  ...!withSelect && !withCounter && {
@@ -10417,7 +10516,7 @@ var Pagination = ({
10417
10516
  onClick: (event) => {
10418
10517
  onPageChange(event, 1);
10419
10518
  },
10420
- "aria-label": t(texts16.firstPage)
10519
+ "aria-label": t(texts17.firstPage)
10421
10520
  }
10422
10521
  )
10423
10522
  }
@@ -10471,7 +10570,7 @@ var Pagination = ({
10471
10570
  onClick: (event) => {
10472
10571
  onPageChange(event, pagesLength);
10473
10572
  },
10474
- "aria-label": t(texts16.lastPage)
10573
+ "aria-label": t(texts17.lastPage)
10475
10574
  }
10476
10575
  )
10477
10576
  }
@@ -10509,11 +10608,11 @@ var Pagination = ({
10509
10608
  isClearable: false,
10510
10609
  onChange: handleSelectChange,
10511
10610
  componentSize: "small",
10512
- "aria-label": t(texts16.itemsPerPage)
10611
+ "aria-label": t(texts17.itemsPerPage)
10513
10612
  }
10514
10613
  ),
10515
10614
  withCounter && /* @__PURE__ */ (0, import_jsx_runtime286.jsx)(Paragraph, { children: t(
10516
- texts16.showsAmountOfTotalItems(
10615
+ texts17.showsAmountOfTotalItems(
10517
10616
  activePageFirstItem,
10518
10617
  activePageLastItem,
10519
10618
  itemsAmount
@@ -10526,7 +10625,7 @@ var Pagination = ({
10526
10625
  );
10527
10626
  };
10528
10627
  Pagination.displayName = "Pagination";
10529
- var texts16 = createTexts({
10628
+ var texts17 = createTexts({
10530
10629
  pagination: {
10531
10630
  nb: "Paginering",
10532
10631
  no: "Paginering",
@@ -10584,7 +10683,7 @@ var texts16 = createTexts({
10584
10683
  });
10585
10684
 
10586
10685
  // src/components/PhoneInput/PhoneInput.tsx
10587
- var import_react72 = require("react");
10686
+ var import_react73 = require("react");
10588
10687
 
10589
10688
  // src/components/PhoneInput/constants.ts
10590
10689
  var COUNTRIES = {
@@ -11043,9 +11142,9 @@ var PhoneInput = ({
11043
11142
  }) => {
11044
11143
  var _a;
11045
11144
  const { t } = useTranslation();
11046
- const tGroupLabel = groupLabel != null ? groupLabel : t(texts17.countryCodeAndPhoneNumber);
11047
- const tSelectLabel = selectLabel != null ? selectLabel : t(texts17.countryCode);
11048
- const generatedId = (0, import_react72.useId)();
11145
+ const tGroupLabel = groupLabel != null ? groupLabel : t(texts18.countryCodeAndPhoneNumber);
11146
+ const tSelectLabel = selectLabel != null ? selectLabel : t(texts18.countryCode);
11147
+ const generatedId = (0, import_react73.useId)();
11049
11148
  const uniqueId = (_a = props.id) != null ? _a : generatedId;
11050
11149
  const phoneInputId = `${uniqueId}-phone-input`;
11051
11150
  const phoneNumberId = `${uniqueId}-phone-number`;
@@ -11056,27 +11155,27 @@ var PhoneInput = ({
11056
11155
  const hasMessage = hasErrorMessage || hasTip;
11057
11156
  const tipId = derivativeIdGenerator(phoneInputId, "tip");
11058
11157
  const errorMessageId = derivativeIdGenerator(phoneInputId, "errorMessage");
11059
- const [callingCode, setCallingCode] = (0, import_react72.useState)("");
11060
- const [selectedCountryCodeText, setSelectedCountryCodeText] = (0, import_react72.useState)("");
11061
- const [internalValue, setInternalValue] = (0, import_react72.useState)(
11158
+ const [callingCode, setCallingCode] = (0, import_react73.useState)("");
11159
+ const [selectedCountryCodeText, setSelectedCountryCodeText] = (0, import_react73.useState)("");
11160
+ const [internalValue, setInternalValue] = (0, import_react73.useState)(
11062
11161
  defaultValue != null ? defaultValue : {
11063
11162
  countryCode: "",
11064
11163
  phoneNumber: ""
11065
11164
  }
11066
11165
  );
11067
11166
  const isControlled = value !== void 0;
11068
- const [callingCodeWidth, setCallingCodeWidth] = (0, import_react72.useState)(0);
11069
- const callingCodeRef = (0, import_react72.useRef)(null);
11070
- (0, import_react72.useLayoutEffect)(() => {
11167
+ const [callingCodeWidth, setCallingCodeWidth] = (0, import_react73.useState)(0);
11168
+ const callingCodeRef = (0, import_react73.useRef)(null);
11169
+ (0, import_react73.useLayoutEffect)(() => {
11071
11170
  if (callingCodeRef.current) {
11072
11171
  setCallingCodeWidth(callingCodeRef.current.offsetWidth);
11073
11172
  }
11074
11173
  }, [callingCode]);
11075
11174
  const callingCodeInlineStart = callingCodeWidth ? `calc(var(--dds-spacing-x1) + ${callingCodeWidth}px)` : void 0;
11076
- const internalSelectRef = (0, import_react72.useRef)(null);
11175
+ const internalSelectRef = (0, import_react73.useRef)(null);
11077
11176
  const combinedSelectRef = useCombinedRef(selectRef, internalSelectRef);
11078
11177
  const displayedValue = isControlled ? value : internalValue;
11079
- (0, import_react72.useEffect)(() => {
11178
+ (0, import_react73.useEffect)(() => {
11080
11179
  const selectEl = internalSelectRef.current;
11081
11180
  if (selectEl && selectEl.value) {
11082
11181
  const { options, selectedIndex } = selectEl;
@@ -11222,7 +11321,7 @@ var getCallingCode = (s) => {
11222
11321
  var _a;
11223
11322
  return (_a = s.substring(s.indexOf("+"), s.length)) != null ? _a : "";
11224
11323
  };
11225
- var texts17 = createTexts({
11324
+ var texts18 = createTexts({
11226
11325
  countryCode: {
11227
11326
  nb: "Landskode",
11228
11327
  no: "Landskode",
@@ -11238,7 +11337,7 @@ var texts17 = createTexts({
11238
11337
  });
11239
11338
 
11240
11339
  // src/components/Popover/Popover.tsx
11241
- var import_react74 = require("react");
11340
+ var import_react75 = require("react");
11242
11341
  var import_react_dom5 = require("react-dom");
11243
11342
 
11244
11343
  // src/components/Popover/Popover.module.css
@@ -11250,9 +11349,9 @@ var Popover_default = {
11250
11349
  };
11251
11350
 
11252
11351
  // src/components/Popover/Popover.context.tsx
11253
- var import_react73 = require("react");
11254
- var PopoverContext = (0, import_react73.createContext)({});
11255
- var usePopoverContext = () => (0, import_react73.useContext)(PopoverContext);
11352
+ var import_react74 = require("react");
11353
+ var PopoverContext = (0, import_react74.createContext)({});
11354
+ var usePopoverContext = () => (0, import_react74.useContext)(PopoverContext);
11256
11355
 
11257
11356
  // src/components/Popover/Popover.tsx
11258
11357
  var import_jsx_runtime288 = require("react/jsx-runtime");
@@ -11282,7 +11381,7 @@ var Popover = ({
11282
11381
  });
11283
11382
  const { maxHeight, maxWidth, minHeight, minWidth, height, width } = sizeProps;
11284
11383
  const context = usePopoverContext();
11285
- const themeContext = (0, import_react74.useContext)(ThemeContext);
11384
+ const themeContext = (0, import_react75.useContext)(ThemeContext);
11286
11385
  const portalTarget = parentElement != null ? parentElement : themeContext == null ? void 0 : themeContext.el;
11287
11386
  const {
11288
11387
  floatStyling: contextFloatStyling,
@@ -11295,7 +11394,7 @@ var Popover = ({
11295
11394
  } = context;
11296
11395
  const { t } = useTranslation();
11297
11396
  const hasContext = !isEmpty(context);
11298
- const generatedId = (0, import_react74.useId)();
11397
+ const generatedId = (0, import_react75.useId)();
11299
11398
  const uniquePopoverId = id != null ? id : `${generatedId}-popover`;
11300
11399
  const [
11301
11400
  popoverId,
@@ -11332,8 +11431,8 @@ var Popover = ({
11332
11431
  anchorEl && anchorEl
11333
11432
  );
11334
11433
  const multiRef = useCombinedRef(ref, popoverRef, floatingRef);
11335
- (0, import_react74.useEffect)(() => {
11336
- setFloatOptions && setFloatOptions({ placement, offset });
11434
+ (0, import_react75.useEffect)(() => {
11435
+ setFloatOptions == null ? void 0 : setFloatOptions({ placement, offset });
11337
11436
  }, [placement, offset]);
11338
11437
  useOnClickOutside([popoverRef.current, anchorEl], () => {
11339
11438
  if (isOpen && !hasContext) onClose == null ? void 0 : onClose();
@@ -11401,7 +11500,7 @@ var Popover = ({
11401
11500
  Popover.displayName = "Popover";
11402
11501
 
11403
11502
  // src/components/Popover/PopoverGroup.tsx
11404
- var import_react75 = require("react");
11503
+ var import_react76 = require("react");
11405
11504
  var import_jsx_runtime289 = require("react/jsx-runtime");
11406
11505
  var PopoverGroup = ({
11407
11506
  isOpen: propIsOpen,
@@ -11413,20 +11512,20 @@ var PopoverGroup = ({
11413
11512
  popoverId
11414
11513
  }) => {
11415
11514
  var _a;
11416
- const [internalIsOpen, internalSetIsOpen] = (0, import_react75.useState)(isInitiallyOpen);
11515
+ const [internalIsOpen, internalSetIsOpen] = (0, import_react76.useState)(isInitiallyOpen);
11417
11516
  const open = propIsOpen != null ? propIsOpen : internalIsOpen;
11418
11517
  const setOpen = propSetIsOpen != null ? propSetIsOpen : internalSetIsOpen;
11419
- const generatedId = (0, import_react75.useId)();
11518
+ const generatedId = (0, import_react76.useId)();
11420
11519
  const uniquePopoverId = popoverId != null ? popoverId : `${generatedId}-popover`;
11421
- const [floatOptions, setFloatOptions] = (0, import_react75.useState)();
11520
+ const [floatOptions, setFloatOptions] = (0, import_react76.useState)();
11422
11521
  const { refs, styles: positionStyles } = useFloatPosition(null, floatOptions);
11423
11522
  const handleClose = () => {
11424
11523
  setOpen(false);
11425
- onClose && onClose();
11524
+ onClose == null ? void 0 : onClose();
11426
11525
  };
11427
11526
  const handleOpen = () => {
11428
11527
  setOpen(true);
11429
- onOpen && onOpen();
11528
+ onOpen == null ? void 0 : onOpen();
11430
11529
  };
11431
11530
  const handleToggle = () => {
11432
11531
  if (open) {
@@ -11435,10 +11534,10 @@ var PopoverGroup = ({
11435
11534
  handleOpen();
11436
11535
  }
11437
11536
  };
11438
- const buttonRef = (0, import_react75.useRef)(null);
11537
+ const buttonRef = (0, import_react76.useRef)(null);
11439
11538
  const anchorRef = refs.setReference;
11440
11539
  const combinedAnchorRef = useCombinedRef(buttonRef, anchorRef);
11441
- const popoverRef = (0, import_react75.useRef)(null);
11540
+ const popoverRef = (0, import_react76.useRef)(null);
11442
11541
  const floatingRef = refs.setFloating;
11443
11542
  const combinedPopoverRef = useCombinedRef(popoverRef, floatingRef);
11444
11543
  useOnKeyDown(["Esc", "Escape"], () => {
@@ -11454,8 +11553,8 @@ var PopoverGroup = ({
11454
11553
  if (open) handleClose();
11455
11554
  });
11456
11555
  const isAnchorChild = (i) => i === 0;
11457
- const Children7 = import_react75.Children.map(children, (child, childIndex) => {
11458
- return (0, import_react75.isValidElement)(child) && (isAnchorChild(childIndex) ? (0, import_react75.cloneElement)(child, {
11556
+ const Children7 = import_react76.Children.map(children, (child, childIndex) => {
11557
+ return (0, import_react76.isValidElement)(child) && (isAnchorChild(childIndex) ? (0, import_react76.cloneElement)(child, {
11459
11558
  "aria-haspopup": "dialog",
11460
11559
  "aria-controls": uniquePopoverId,
11461
11560
  "aria-expanded": open,
@@ -11482,17 +11581,17 @@ var PopoverGroup = ({
11482
11581
  PopoverGroup.displayName = "PopoverGroup";
11483
11582
 
11484
11583
  // src/components/ProgressTracker/ProgressTracker.tsx
11485
- var import_react78 = require("react");
11584
+ var import_react79 = require("react");
11486
11585
 
11487
11586
  // src/components/ProgressTracker/ProgressTracker.context.tsx
11488
- var import_react76 = require("react");
11489
- var ProgressTrackerContext = (0, import_react76.createContext)(
11587
+ var import_react77 = require("react");
11588
+ var ProgressTrackerContext = (0, import_react77.createContext)(
11490
11589
  {
11491
11590
  activeStep: 0,
11492
11591
  direction: "column"
11493
11592
  }
11494
11593
  );
11495
- var useProgressTrackerContext = () => (0, import_react76.useContext)(ProgressTrackerContext);
11594
+ var useProgressTrackerContext = () => (0, import_react77.useContext)(ProgressTrackerContext);
11496
11595
 
11497
11596
  // src/components/ProgressTracker/ProgressTracker.module.css
11498
11597
  var ProgressTracker_default = {
@@ -11517,7 +11616,7 @@ var ProgressTracker_default = {
11517
11616
  };
11518
11617
 
11519
11618
  // src/components/ProgressTracker/ProgressTrackerItem.tsx
11520
- var import_react77 = require("react");
11619
+ var import_react78 = require("react");
11521
11620
  var import_jsx_runtime290 = require("react/jsx-runtime");
11522
11621
  var toItemState = (active, completed, disabled) => {
11523
11622
  if (disabled) {
@@ -11555,11 +11654,11 @@ var ProgressTrackerItem = (props) => {
11555
11654
  const itemState = toItemState(active, completed, disabled);
11556
11655
  const handleClick = () => {
11557
11656
  if (!disabled) {
11558
- onClick && onClick(index);
11559
- handleStepChange && handleStepChange(index);
11657
+ onClick == null ? void 0 : onClick(index);
11658
+ handleStepChange == null ? void 0 : handleStepChange(index);
11560
11659
  }
11561
11660
  };
11562
- const stepNumberContent = (0, import_react77.useMemo)(() => {
11661
+ const stepNumberContent = (0, import_react78.useMemo)(() => {
11563
11662
  if (completed) {
11564
11663
  return /* @__PURE__ */ (0, import_jsx_runtime290.jsx)(Icon, { icon: CheckIcon, iconSize: "small" });
11565
11664
  }
@@ -11593,9 +11692,9 @@ var ProgressTrackerItem = (props) => {
11593
11692
  typographyStyles_default["body-medium"]
11594
11693
  ),
11595
11694
  children: [
11596
- /* @__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)) }),
11597
11696
  children,
11598
- /* @__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) })
11599
11698
  ]
11600
11699
  }
11601
11700
  )
@@ -11636,7 +11735,7 @@ var ProgressTrackerItem = (props) => {
11636
11735
  );
11637
11736
  };
11638
11737
  ProgressTrackerItem.displayName = "ProgressTracker.Item";
11639
- var texts18 = createTexts({
11738
+ var texts19 = createTexts({
11640
11739
  stepTextBefore: (index) => ({
11641
11740
  nb: `${index}. trinn, `,
11642
11741
  no: `${index}. trinn, `,
@@ -11671,17 +11770,17 @@ var ProgressTracker = (() => {
11671
11770
  ...rest
11672
11771
  }) => {
11673
11772
  const { t } = useTranslation();
11674
- const [thisActiveStep, setActiveStep] = (0, import_react78.useState)(activeStep);
11773
+ const [thisActiveStep, setActiveStep] = (0, import_react79.useState)(activeStep);
11675
11774
  const handleChange = (step) => {
11676
11775
  setActiveStep(step);
11677
- onStepChange && onStepChange(step);
11776
+ onStepChange == null ? void 0 : onStepChange(step);
11678
11777
  };
11679
- (0, import_react78.useEffect)(() => {
11778
+ (0, import_react79.useEffect)(() => {
11680
11779
  if (activeStep !== void 0 && activeStep != thisActiveStep) {
11681
11780
  setActiveStep(activeStep);
11682
11781
  }
11683
11782
  }, [activeStep, thisActiveStep]);
11684
- const steps = (0, import_react78.useMemo)(() => {
11783
+ const steps = (0, import_react79.useMemo)(() => {
11685
11784
  const validChildren = removeInvalidChildren(children);
11686
11785
  const itemsWithIndex = passIndexPropToProgressTrackerItem(validChildren);
11687
11786
  return itemsWithIndex;
@@ -11699,7 +11798,7 @@ var ProgressTracker = (() => {
11699
11798
  children: /* @__PURE__ */ (0, import_jsx_runtime291.jsx)(
11700
11799
  "nav",
11701
11800
  {
11702
- "aria-label": ariaLabel != null ? ariaLabel : t(texts19.stepProgression),
11801
+ "aria-label": ariaLabel != null ? ariaLabel : t(texts20.stepProgression),
11703
11802
  ...getBaseHTMLProps(id, className, htmlProps, rest),
11704
11803
  children: /* @__PURE__ */ (0, import_jsx_runtime291.jsx)(
11705
11804
  Box,
@@ -11726,18 +11825,18 @@ var ProgressTracker = (() => {
11726
11825
  return Res;
11727
11826
  })();
11728
11827
  function removeInvalidChildren(children) {
11729
- return import_react78.Children.toArray(children).filter(import_react78.isValidElement);
11828
+ return import_react79.Children.toArray(children).filter(import_react79.isValidElement);
11730
11829
  }
11731
11830
  function passIndexPropToProgressTrackerItem(children) {
11732
- return import_react78.Children.map(
11831
+ return import_react79.Children.map(
11733
11832
  children,
11734
- (item, index) => (0, import_react78.cloneElement)(item, {
11833
+ (item, index) => (0, import_react79.cloneElement)(item, {
11735
11834
  ...item.props,
11736
11835
  index
11737
11836
  })
11738
11837
  );
11739
11838
  }
11740
- var texts19 = createTexts({
11839
+ var texts20 = createTexts({
11741
11840
  stepProgression: {
11742
11841
  nb: "Stegprogresjon",
11743
11842
  no: "Stegprogresjon",
@@ -11747,7 +11846,7 @@ var texts19 = createTexts({
11747
11846
  });
11748
11847
 
11749
11848
  // src/components/ProgressBar/ProgressBar.tsx
11750
- var import_react79 = require("react");
11849
+ var import_react80 = require("react");
11751
11850
 
11752
11851
  // src/components/ProgressBar/ProgressBar.module.css
11753
11852
  var ProgressBar_default = {
@@ -11775,7 +11874,7 @@ var ProgressBar = ({
11775
11874
  style,
11776
11875
  ...rest
11777
11876
  }) => {
11778
- const generatedId = (0, import_react79.useId)();
11877
+ const generatedId = (0, import_react80.useId)();
11779
11878
  const uniqueId = id != null ? id : `${generatedId}-searchInput`;
11780
11879
  const hasErrorMessage = !!errorMessage;
11781
11880
  const hasTip = !!tip;
@@ -11831,13 +11930,13 @@ var ProgressBar = ({
11831
11930
  ProgressBar.displayName = "ProgressBar";
11832
11931
 
11833
11932
  // src/components/Search/Search.tsx
11834
- var import_react82 = require("react");
11933
+ var import_react83 = require("react");
11835
11934
 
11836
11935
  // src/components/Search/AutocompleteSearch.context.tsx
11837
- var import_react80 = require("react");
11838
- var AutocompleteSearchContext = (0, import_react80.createContext)({});
11936
+ var import_react81 = require("react");
11937
+ var AutocompleteSearchContext = (0, import_react81.createContext)({});
11839
11938
  var useAutocompleteSearch = () => {
11840
- return (0, import_react80.useContext)(AutocompleteSearchContext);
11939
+ return (0, import_react81.useContext)(AutocompleteSearchContext);
11841
11940
  };
11842
11941
 
11843
11942
  // src/components/Search/Search.module.css
@@ -11855,33 +11954,9 @@ var typographyTypes2 = {
11855
11954
  medium: "bodyMedium",
11856
11955
  large: "bodyLarge"
11857
11956
  };
11858
- function createEmptyChangeEvent(inputElementId) {
11859
- const inputElement = document.getElementById(
11860
- inputElementId
11861
- );
11862
- inputElement.value = "";
11863
- const emptyChangeEvent = {
11864
- target: inputElement,
11865
- currentTarget: inputElement,
11866
- bubbles: true,
11867
- cancelable: false,
11868
- defaultPrevented: false,
11869
- eventPhase: 0,
11870
- isTrusted: false,
11871
- preventDefault: () => null,
11872
- stopPropagation: () => null,
11873
- nativeEvent: new Event("input"),
11874
- persist: () => null,
11875
- type: "change",
11876
- timeStamp: Date.now(),
11877
- isDefaultPrevented: () => false,
11878
- isPropagationStopped: () => false
11879
- };
11880
- return emptyChangeEvent;
11881
- }
11882
11957
 
11883
11958
  // src/components/Search/SearchSuggestionItem.tsx
11884
- var import_react81 = require("react");
11959
+ var import_react82 = require("react");
11885
11960
  var import_jsx_runtime293 = require("react/jsx-runtime");
11886
11961
  var SearchSuggestionItem = ({
11887
11962
  focus,
@@ -11889,9 +11964,9 @@ var SearchSuggestionItem = ({
11889
11964
  ref,
11890
11965
  ...rest
11891
11966
  }) => {
11892
- const itemRef = (0, import_react81.useRef)(null);
11967
+ const itemRef = (0, import_react82.useRef)(null);
11893
11968
  const combinedRef = useCombinedRef(ref, itemRef);
11894
- (0, import_react81.useEffect)(() => {
11969
+ (0, import_react82.useEffect)(() => {
11895
11970
  var _a;
11896
11971
  if (focus) {
11897
11972
  (_a = itemRef.current) == null ? void 0 : _a.focus();
@@ -11975,7 +12050,7 @@ var SearchSuggestions = ({
11975
12050
  {
11976
12051
  index,
11977
12052
  focus: focus === index && showSuggestions,
11978
- "aria-label": t(texts20.search(suggestion)),
12053
+ "aria-label": t(texts21.search(suggestion)),
11979
12054
  onClick: onSuggestionClick,
11980
12055
  "aria-setsize": suggestionsToRender.length,
11981
12056
  "aria-posinset": index,
@@ -11989,7 +12064,7 @@ var SearchSuggestions = ({
11989
12064
  );
11990
12065
  };
11991
12066
  SearchSuggestions.displayName = "SearchSuggestions";
11992
- var texts20 = createTexts({
12067
+ var texts21 = createTexts({
11993
12068
  search: (suggestion) => ({
11994
12069
  no: `${suggestion} s\xF8k`,
11995
12070
  nb: `${suggestion} s\xF8k`,
@@ -12046,7 +12121,7 @@ var Search = ({
12046
12121
  ...rest
12047
12122
  }) => {
12048
12123
  var _a;
12049
- const generatedId = (0, import_react82.useId)();
12124
+ const generatedId = (0, import_react83.useId)();
12050
12125
  const uniqueId = id != null ? id : `${generatedId}-searchInput`;
12051
12126
  const hasLabel = !!label;
12052
12127
  const tipId = derivativeIdGenerator(uniqueId, "tip");
@@ -12056,17 +12131,18 @@ var Search = ({
12056
12131
  "suggestions-description"
12057
12132
  );
12058
12133
  const { t } = useTranslation();
12059
- const [hasValue, setHasValue] = (0, import_react82.useState)(!!value);
12134
+ const [hasValue, setHasValue] = (0, import_react83.useState)(!!value);
12060
12135
  const context = useAutocompleteSearch();
12061
12136
  const combinedRef = context.inputRef ? useCombinedRef(context.inputRef, ref) : ref;
12062
12137
  const handleChange = (e) => {
12138
+ var _a2;
12063
12139
  setHasValue(e.target.value !== "");
12064
- context.onValueChange && context.onValueChange(e);
12065
- 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);
12066
12142
  };
12067
12143
  const clearInput = () => {
12068
- const emptyChangeEvent = createEmptyChangeEvent(uniqueId);
12069
- handleChange(emptyChangeEvent);
12144
+ const clearChangeEvent = createClearChangeEvent(uniqueId);
12145
+ handleChange(clearChangeEvent);
12070
12146
  };
12071
12147
  const {
12072
12148
  label: buttonLabel,
@@ -12135,15 +12211,14 @@ var Search = ({
12135
12211
  componentSize
12136
12212
  }
12137
12213
  ),
12138
- /* @__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) })
12139
12215
  ] }),
12140
12216
  hasValue && /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(
12141
- Button,
12217
+ InlineIconButton,
12142
12218
  {
12143
12219
  icon: CloseSmallIcon,
12144
- size: componentSize === "large" ? "medium" : "small",
12145
- purpose: "tertiary",
12146
- "aria-label": t(texts21.clearSearch),
12220
+ size: componentSize === "small" ? "small" : "medium",
12221
+ "aria-label": t(texts22.clearSearch),
12147
12222
  onClick: clearInput,
12148
12223
  className: Search_default["clear-button"]
12149
12224
  }
@@ -12183,7 +12258,7 @@ var Search = ({
12183
12258
  ] });
12184
12259
  };
12185
12260
  Search.displayName = "Search";
12186
- var texts21 = createTexts({
12261
+ var texts22 = createTexts({
12187
12262
  clearSearch: {
12188
12263
  nb: "T\xF8m s\xF8k",
12189
12264
  no: "T\xF8m s\xF8k",
@@ -12199,7 +12274,7 @@ var texts21 = createTexts({
12199
12274
  });
12200
12275
 
12201
12276
  // src/components/Search/SearchAutocompleteWrapper.tsx
12202
- var import_react83 = require("react");
12277
+ var import_react84 = require("react");
12203
12278
  var import_jsx_runtime296 = require("react/jsx-runtime");
12204
12279
  var SearchAutocompleteWrapper = (props) => {
12205
12280
  const {
@@ -12211,12 +12286,12 @@ var SearchAutocompleteWrapper = (props) => {
12211
12286
  onSuggestionSelection,
12212
12287
  children
12213
12288
  } = props;
12214
- const [inputValue, setInputValue] = (0, import_react83.useState)(value != null ? value : "");
12215
- const [suggestions, setSuggestions] = (0, import_react83.useState)([]);
12216
- const [showSuggestions, setShowSuggestions] = (0, import_react83.useState)(false);
12289
+ const [inputValue, setInputValue] = (0, import_react84.useState)(value != null ? value : "");
12290
+ const [suggestions, setSuggestions] = (0, import_react84.useState)([]);
12291
+ const [showSuggestions, setShowSuggestions] = (0, import_react84.useState)(false);
12217
12292
  const closeSuggestions = () => showSuggestions === true && setShowSuggestions(false);
12218
12293
  const openSuggestions = () => showSuggestions === false && setShowSuggestions(true);
12219
- (0, import_react83.useEffect)(() => {
12294
+ (0, import_react84.useEffect)(() => {
12220
12295
  if (suggestions.length > 0) {
12221
12296
  openSuggestions();
12222
12297
  } else {
@@ -12250,19 +12325,19 @@ var SearchAutocompleteWrapper = (props) => {
12250
12325
  } else {
12251
12326
  setSuggestions([]);
12252
12327
  }
12253
- onChange && onChange(e);
12328
+ onChange == null ? void 0 : onChange(e);
12254
12329
  };
12255
12330
  const handleSuggestionClick = (e) => {
12256
12331
  setSuggestions([]);
12257
12332
  handleSetInputValue(e.target.innerText);
12258
- onSuggestionSelection && onSuggestionSelection();
12333
+ onSuggestionSelection == null ? void 0 : onSuggestionSelection();
12259
12334
  closeSuggestions();
12260
12335
  };
12261
12336
  const handleSetInputValue = (value2) => {
12262
12337
  setInputValue(value2 != null ? value2 : "");
12263
12338
  };
12264
- const inputRef = (0, import_react83.useRef)(null);
12265
- const suggestionsRef = (0, import_react83.useRef)(null);
12339
+ const inputRef = (0, import_react84.useRef)(null);
12340
+ const suggestionsRef = (0, import_react84.useRef)(null);
12266
12341
  useOnClickOutside([inputRef.current, suggestionsRef.current], () => {
12267
12342
  closeSuggestions();
12268
12343
  });
@@ -12344,7 +12419,7 @@ var SkipToContent = ({
12344
12419
  SkipToContent.displayName = "SkipToContent";
12345
12420
 
12346
12421
  // src/components/SplitButton/SplitButton.tsx
12347
- var import_react84 = require("react");
12422
+ var import_react85 = require("react");
12348
12423
 
12349
12424
  // src/components/SplitButton/SplitButton.module.css
12350
12425
  var SplitButton_default = {
@@ -12365,7 +12440,7 @@ var SplitButton = ({
12365
12440
  ...rest
12366
12441
  }) => {
12367
12442
  const { t } = useTranslation();
12368
- const [isOpen, setIsOpen] = (0, import_react84.useState)(false);
12443
+ const [isOpen, setIsOpen] = (0, import_react85.useState)(false);
12369
12444
  const buttonStyleProps = {
12370
12445
  purpose,
12371
12446
  size: size2
@@ -12386,7 +12461,7 @@ var SplitButton = ({
12386
12461
  {
12387
12462
  ...buttonStyleProps,
12388
12463
  icon: isOpen ? ChevronUpIcon : ChevronDownIcon,
12389
- "aria-label": t(texts22.moreActions),
12464
+ "aria-label": t(texts23.moreActions),
12390
12465
  purpose,
12391
12466
  className: cn(
12392
12467
  SplitButton_default.option,
@@ -12400,7 +12475,7 @@ var SplitButton = ({
12400
12475
  ] });
12401
12476
  };
12402
12477
  SplitButton.displayName = "SplitButton";
12403
- var texts22 = createTexts({
12478
+ var texts23 = createTexts({
12404
12479
  moreActions: {
12405
12480
  nb: "Flere handlinger",
12406
12481
  no: "Flere handlinger",
@@ -12410,15 +12485,15 @@ var texts22 = createTexts({
12410
12485
  });
12411
12486
 
12412
12487
  // src/components/Table/collapsible/CollapsibleRow.tsx
12413
- var import_react88 = require("react");
12488
+ var import_react89 = require("react");
12414
12489
 
12415
12490
  // src/components/Table/collapsible/Table.context.tsx
12416
- var import_react85 = require("react");
12417
- var CollapsibleTableContext = (0, import_react85.createContext)({
12491
+ var import_react86 = require("react");
12492
+ var CollapsibleTableContext = (0, import_react86.createContext)({
12418
12493
  headerValues: [],
12419
12494
  definingColumnIndex: [0]
12420
12495
  });
12421
- var useCollapsibleTableContext = () => (0, import_react85.useContext)(CollapsibleTableContext);
12496
+ var useCollapsibleTableContext = () => (0, import_react86.useContext)(CollapsibleTableContext);
12422
12497
 
12423
12498
  // src/components/Table/normal/Body.tsx
12424
12499
  var import_jsx_runtime300 = require("react/jsx-runtime");
@@ -12426,12 +12501,12 @@ var Body = (props) => /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("tbody", {
12426
12501
  Body.displayName = "Table.Body";
12427
12502
 
12428
12503
  // src/components/Table/normal/Head.tsx
12429
- var import_react86 = require("react");
12504
+ var import_react87 = require("react");
12430
12505
  var import_jsx_runtime301 = require("react/jsx-runtime");
12431
12506
  var Head = ({ children, ...rest }) => /* @__PURE__ */ (0, import_jsx_runtime301.jsx)("thead", { ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime301.jsx)(HeadContext, { value: true, children }) });
12432
- var HeadContext = (0, import_react86.createContext)(false);
12507
+ var HeadContext = (0, import_react87.createContext)(false);
12433
12508
  function useIsInTableHead() {
12434
- const isInTableHead = (0, import_react86.useContext)(HeadContext);
12509
+ const isInTableHead = (0, import_react87.useContext)(HeadContext);
12435
12510
  return isInTableHead;
12436
12511
  }
12437
12512
 
@@ -12558,7 +12633,7 @@ var SortCell = ({
12558
12633
  StylelessButton,
12559
12634
  {
12560
12635
  onClick,
12561
- "aria-description": t(texts23.changeSort),
12636
+ "aria-description": t(texts24.changeSort),
12562
12637
  className: cn(Table_default["sort-button"], focusable),
12563
12638
  children: [
12564
12639
  children,
@@ -12571,7 +12646,7 @@ var SortCell = ({
12571
12646
  );
12572
12647
  };
12573
12648
  SortCell.displayName = "Table.SortCell";
12574
- var texts23 = createTexts({
12649
+ var texts24 = createTexts({
12575
12650
  changeSort: {
12576
12651
  nb: "Aktiver for \xE5 endre sorteringsrekkef\xF8lge",
12577
12652
  no: "Aktiver for \xE5 endre sorteringsrekkef\xF8lge",
@@ -12607,26 +12682,26 @@ var Table = ({
12607
12682
  Table.displayName = "Table";
12608
12683
 
12609
12684
  // src/components/Table/normal/TableWrapper.tsx
12610
- var import_react87 = require("react");
12685
+ var import_react88 = require("react");
12611
12686
  var import_jsx_runtime307 = require("react/jsx-runtime");
12612
12687
  var TableWrapper = ({ className, ...rest }) => {
12613
- const themeContext = (0, import_react87.useContext)(ThemeContext);
12688
+ const themeContext = (0, import_react88.useContext)(ThemeContext);
12614
12689
  const container2 = themeContext == null ? void 0 : themeContext.el;
12615
12690
  const containerWidth = container2 ? container2.clientWidth : 0;
12616
- const [overflowX, setOverflowX] = (0, import_react87.useState)(false);
12617
- const [themeContainerWidth, setThemeContainerWidth] = (0, import_react87.useState)(containerWidth);
12691
+ const [overflowX, setOverflowX] = (0, import_react88.useState)(false);
12692
+ const [themeContainerWidth, setThemeContainerWidth] = (0, import_react88.useState)(containerWidth);
12618
12693
  function isOverflowingX(event) {
12619
12694
  return event.offsetWidth < event.scrollWidth;
12620
12695
  }
12621
- const wrapperRef = (0, import_react87.useRef)(null);
12622
- (0, import_react87.useEffect)(() => {
12696
+ const wrapperRef = (0, import_react88.useRef)(null);
12697
+ (0, import_react88.useEffect)(() => {
12623
12698
  if ((wrapperRef == null ? void 0 : wrapperRef.current) && isOverflowingX(wrapperRef.current)) {
12624
12699
  setOverflowX(true);
12625
12700
  return;
12626
12701
  }
12627
12702
  setOverflowX(false);
12628
12703
  }, [themeContainerWidth]);
12629
- (0, import_react87.useEffect)(() => {
12704
+ (0, import_react88.useEffect)(() => {
12630
12705
  function handleResize() {
12631
12706
  setThemeContainerWidth(containerWidth);
12632
12707
  }
@@ -12675,9 +12750,9 @@ var CollapsibleRow = ({
12675
12750
  const isInHead = useIsInTableHead();
12676
12751
  const type = _type != null ? _type : isInHead ? "head" : "body";
12677
12752
  const { isCollapsed, headerValues, definingColumnIndex } = useCollapsibleTableContext();
12678
- const [childrenCollapsed, setChildrenCollapsed] = (0, import_react88.useState)(true);
12679
- (0, import_react88.useEffect)(() => {
12680
- !isCollapsed && setChildrenCollapsed(true);
12753
+ const [childrenCollapsed, setChildrenCollapsed] = (0, import_react89.useState)(true);
12754
+ (0, import_react89.useEffect)(() => {
12755
+ if (!isCollapsed) setChildrenCollapsed(true);
12681
12756
  }, [isCollapsed]);
12682
12757
  const rowProps = (isOpenCollapsibleHeader) => {
12683
12758
  return {
@@ -12694,7 +12769,7 @@ var CollapsibleRow = ({
12694
12769
  const collapsedHeaderValues = headerValues.filter(
12695
12770
  (column, index) => definingColumnIndex.indexOf(index) === -1
12696
12771
  );
12697
- const childrenArray = import_react88.Children.toArray(children);
12772
+ const childrenArray = import_react89.Children.toArray(children);
12698
12773
  const collapsedChildren = childrenArray.filter(
12699
12774
  (column, index) => definingColumnIndex.indexOf(index) === -1
12700
12775
  );
@@ -12703,9 +12778,9 @@ var CollapsibleRow = ({
12703
12778
  const collapsedRenderedChildren = isCollapsed && collapsedHeaderValues.length > 0 ? collapsedChildren.map(function(child, index) {
12704
12779
  const id = derivativeIdGenerator(prefix2, index.toString());
12705
12780
  collapsibleIds.push(id);
12706
- return /* @__PURE__ */ (0, import_jsx_runtime308.jsxs)(import_react88.Fragment, { children: [
12781
+ return /* @__PURE__ */ (0, import_jsx_runtime308.jsxs)(import_react89.Fragment, { children: [
12707
12782
  /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(DescriptionListTerm, { children: collapsedHeaderValues[index].content }),
12708
- (0, import_react88.isValidElement)(child) && (0, import_react88.cloneElement)(child, {
12783
+ (0, import_react89.isValidElement)(child) && (0, import_react89.cloneElement)(child, {
12709
12784
  collapsibleProps: { isCollapsibleChild: true }
12710
12785
  })
12711
12786
  ] }, `DL-${index}`);
@@ -12719,8 +12794,8 @@ var CollapsibleRow = ({
12719
12794
  return /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(Row, { ref, ...rowProps(), children: /* @__PURE__ */ (0, import_jsx_runtime308.jsxs)(import_jsx_runtime308.Fragment, { children: [
12720
12795
  definingColumnCells,
12721
12796
  /* @__PURE__ */ (0, import_jsx_runtime308.jsxs)(Table2.Cell, { type: "head", layout: "center", children: [
12722
- t(texts24.expand),
12723
- /* @__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) })
12724
12799
  ] })
12725
12800
  ] }) });
12726
12801
  };
@@ -12757,7 +12832,7 @@ var CollapsibleRow = ({
12757
12832
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(Row, { ref, ...rowProps(), children });
12758
12833
  };
12759
12834
  CollapsibleRow.displayName = "CollapsibleTable.Row";
12760
- var texts24 = createTexts({
12835
+ var texts25 = createTexts({
12761
12836
  expand: {
12762
12837
  nb: "Utvid",
12763
12838
  no: "Utvid",
@@ -12799,11 +12874,11 @@ var CollapsibleTable2 = CollapsibleTable;
12799
12874
  CollapsibleTable2.Row = CollapsibleRow;
12800
12875
 
12801
12876
  // src/components/Tabs/AddTabButton.tsx
12802
- var import_react91 = require("react");
12877
+ var import_react92 = require("react");
12803
12878
 
12804
12879
  // src/components/Tabs/Tabs.context.tsx
12805
- var import_react89 = require("react");
12806
- var TabsContext = (0, import_react89.createContext)({
12880
+ var import_react90 = require("react");
12881
+ var TabsContext = (0, import_react90.createContext)({
12807
12882
  activeTab: 0,
12808
12883
  tabsId: "",
12809
12884
  size: "small",
@@ -12815,7 +12890,7 @@ var TabsContext = (0, import_react89.createContext)({
12815
12890
  tabContentDirection: "row",
12816
12891
  addTabButtonProps: void 0
12817
12892
  });
12818
- var useTabsContext = () => (0, import_react89.useContext)(TabsContext);
12893
+ var useTabsContext = () => (0, import_react90.useContext)(TabsContext);
12819
12894
 
12820
12895
  // src/components/Tabs/Tabs.module.css
12821
12896
  var Tabs_default = {
@@ -12834,9 +12909,9 @@ var Tabs_default = {
12834
12909
  };
12835
12910
 
12836
12911
  // src/components/Tabs/TabWidthContext.tsx
12837
- var import_react90 = require("react");
12912
+ var import_react91 = require("react");
12838
12913
  var import_jsx_runtime310 = require("react/jsx-runtime");
12839
- var TabContext = (0, import_react90.createContext)(null);
12914
+ var TabContext = (0, import_react91.createContext)(null);
12840
12915
  function TabWidthContextProvider({
12841
12916
  children,
12842
12917
  onChangeWidths
@@ -12865,8 +12940,8 @@ function TabWidthContextProvider({
12865
12940
  );
12866
12941
  }
12867
12942
  function useSetTabWidth(index, width) {
12868
- const context = (0, import_react90.useContext)(TabContext);
12869
- (0, import_react90.useLayoutEffect)(() => {
12943
+ const context = (0, import_react91.useContext)(TabContext);
12944
+ (0, import_react91.useLayoutEffect)(() => {
12870
12945
  context == null ? void 0 : context.updateWidth(index, width);
12871
12946
  return () => context == null ? void 0 : context.removeTab(index);
12872
12947
  }, [index, width]);
@@ -12883,7 +12958,7 @@ var AddTabButton = ({
12883
12958
  ...rest
12884
12959
  }) => {
12885
12960
  useSetTabWidth(index, width);
12886
- const buttonRef = (0, import_react91.useRef)(null);
12961
+ const buttonRef = (0, import_react92.useRef)(null);
12887
12962
  const combinedRef = useCombinedRef(ref, buttonRef);
12888
12963
  const { tabContentDirection, size: size2 } = useTabsContext();
12889
12964
  return /* @__PURE__ */ (0, import_jsx_runtime311.jsxs)(
@@ -12908,7 +12983,7 @@ var AddTabButton = ({
12908
12983
  AddTabButton.displayName = "AddTabButton";
12909
12984
 
12910
12985
  // src/components/Tabs/Tabs.tsx
12911
- var import_react92 = require("react");
12986
+ var import_react93 = require("react");
12912
12987
  var import_jsx_runtime312 = require("react/jsx-runtime");
12913
12988
  var Tabs = ({
12914
12989
  id,
@@ -12923,17 +12998,17 @@ var Tabs = ({
12923
12998
  htmlProps,
12924
12999
  ...rest
12925
13000
  }) => {
12926
- const generatedId = (0, import_react92.useId)();
13001
+ const generatedId = (0, import_react93.useId)();
12927
13002
  const uniqueId = id != null ? id : `${generatedId}-tabs`;
12928
- const [thisActiveTab, setActiveTab] = (0, import_react92.useState)(activeTab != null ? activeTab : 0);
12929
- const [hasTabFocus, setHasTabFocus] = (0, import_react92.useState)(false);
12930
- const tabListRef = (0, import_react92.useRef)(null);
12931
- const tabPanelsRef = (0, import_react92.useRef)(null);
13003
+ const [thisActiveTab, setActiveTab] = (0, import_react93.useState)(activeTab != null ? activeTab : 0);
13004
+ const [hasTabFocus, setHasTabFocus] = (0, import_react93.useState)(false);
13005
+ const tabListRef = (0, import_react93.useRef)(null);
13006
+ const tabPanelsRef = (0, import_react93.useRef)(null);
12932
13007
  const handleTabChange = (index) => {
12933
13008
  setActiveTab(index);
12934
- onChange && onChange(index);
13009
+ onChange == null ? void 0 : onChange(index);
12935
13010
  };
12936
- (0, import_react92.useEffect)(() => {
13011
+ (0, import_react93.useEffect)(() => {
12937
13012
  if (activeTab !== void 0 && activeTab !== thisActiveTab) {
12938
13013
  setActiveTab(activeTab);
12939
13014
  }
@@ -12972,7 +13047,7 @@ var Tabs = ({
12972
13047
  Tabs.displayName = "Tabs";
12973
13048
 
12974
13049
  // src/components/Tabs/Tab.tsx
12975
- var import_react93 = require("react");
13050
+ var import_react94 = require("react");
12976
13051
  var import_jsx_runtime313 = require("react/jsx-runtime");
12977
13052
  var Tab = ({
12978
13053
  active = false,
@@ -12991,18 +13066,18 @@ var Tab = ({
12991
13066
  ...rest
12992
13067
  }) => {
12993
13068
  useSetTabWidth(index, width);
12994
- const itemRef = (0, import_react93.useRef)(null);
13069
+ const itemRef = (0, import_react94.useRef)(null);
12995
13070
  const combinedRef = useCombinedRef(ref, itemRef);
12996
13071
  const { tabContentDirection, size: size2 } = useTabsContext();
12997
13072
  const { type = "button", ...restHtmlProps } = htmlProps;
12998
13073
  const fixedHtmlProps = { type, ...restHtmlProps };
12999
- (0, import_react93.useEffect)(() => {
13074
+ (0, import_react94.useEffect)(() => {
13000
13075
  var _a;
13001
13076
  if (focus) {
13002
13077
  (_a = itemRef.current) == null ? void 0 : _a.focus();
13003
13078
  }
13004
13079
  }, [focus]);
13005
- const handleSelect = (0, import_react93.useCallback)(() => {
13080
+ const handleSelect = (0, import_react94.useCallback)(() => {
13006
13081
  if (setFocus && index) {
13007
13082
  setFocus(index);
13008
13083
  }
@@ -13048,7 +13123,7 @@ var Tab = ({
13048
13123
  Tab.displayName = "Tab";
13049
13124
 
13050
13125
  // src/components/Tabs/TabList.tsx
13051
- var import_react94 = require("react");
13126
+ var import_react95 = require("react");
13052
13127
  var import_jsx_runtime314 = require("react/jsx-runtime");
13053
13128
  var TabList = ({
13054
13129
  children,
@@ -13068,15 +13143,15 @@ var TabList = ({
13068
13143
  addTabButtonProps
13069
13144
  } = useTabsContext();
13070
13145
  const uniqueId = id != null ? id : `${tabsId}-tablist`;
13071
- const childrenArray = import_react94.Children.toArray(children).length;
13146
+ const childrenArray = import_react95.Children.toArray(children).length;
13072
13147
  const [focus, setFocus] = useRoveFocus(childrenArray, hasTabFocus, "row");
13073
13148
  const combinedRef = useCombinedRef(ref, tabListRef);
13074
13149
  const hasButton = addTabButtonProps ? true : false;
13075
- const tabListChildren = import_react94.Children ? import_react94.Children.map(children, (child, index) => {
13150
+ const tabListChildren = import_react95.Children ? import_react95.Children.map(children, (child, index) => {
13076
13151
  const handleThisTabChange = () => {
13077
13152
  handleTabChange(index);
13078
13153
  };
13079
- return (0, import_react94.isValidElement)(child) && (0, import_react94.cloneElement)(child, {
13154
+ return (0, import_react95.isValidElement)(child) && (0, import_react95.cloneElement)(child, {
13080
13155
  id: `${tabsId}-tab-${index}`,
13081
13156
  htmlProps: {
13082
13157
  ...child.props.htmlProps,
@@ -13089,10 +13164,10 @@ var TabList = ({
13089
13164
  onClick: combineHandlers(handleThisTabChange, child.props.onClick)
13090
13165
  });
13091
13166
  }) : [];
13092
- const [widths, setWidths] = (0, import_react94.useState)([]);
13167
+ const [widths, setWidths] = (0, import_react95.useState)([]);
13093
13168
  const handleOnFocus = (event) => {
13094
13169
  setHasTabFocus(true);
13095
- onFocus && onFocus(event);
13170
+ onFocus == null ? void 0 : onFocus(event);
13096
13171
  };
13097
13172
  const handleOnBlur = (event) => {
13098
13173
  var _a;
@@ -13163,14 +13238,14 @@ var TabPanel = ({
13163
13238
  TabPanel.displayName = "TabPanel";
13164
13239
 
13165
13240
  // src/components/Tabs/TabPanels.tsx
13166
- var import_react95 = require("react");
13241
+ var import_react96 = require("react");
13167
13242
  var import_jsx_runtime316 = require("react/jsx-runtime");
13168
13243
  var TabPanels = ({ children, ref, ...rest }) => {
13169
13244
  const { activeTab, tabsId, tabPanelsRef } = useTabsContext();
13170
13245
  const combinedRef = useCombinedRef(ref, tabPanelsRef);
13171
- const panelChildren = import_react95.Children.map(children, (child, index) => {
13246
+ const panelChildren = import_react96.Children.map(children, (child, index) => {
13172
13247
  const active = index === activeTab;
13173
- return (0, import_react95.isValidElement)(child) && (0, import_react95.cloneElement)(child, {
13248
+ return (0, import_react96.isValidElement)(child) && (0, import_react96.cloneElement)(child, {
13174
13249
  id: `${tabsId}-panel-${index}`,
13175
13250
  active,
13176
13251
  htmlProps: {
@@ -13245,7 +13320,7 @@ var Tag = ({
13245
13320
  Tag.displayName = "Tag";
13246
13321
 
13247
13322
  // src/components/TextInput/TextInput.tsx
13248
- var import_react96 = require("react");
13323
+ var import_react97 = require("react");
13249
13324
 
13250
13325
  // src/components/TextInput/TextInput.module.css
13251
13326
  var TextInput_default = {
@@ -13294,12 +13369,12 @@ var TextInput = ({
13294
13369
  ref,
13295
13370
  ...rest
13296
13371
  }) => {
13297
- const [text, setText] = (0, import_react96.useState)(getDefaultText(value, defaultValue));
13298
- const prefixRef = (0, import_react96.useRef)(null);
13299
- const suffixRef = (0, import_react96.useRef)(null);
13300
- const [prefixLength, setPrefixLength] = (0, import_react96.useState)(0);
13301
- const [suffixLength, setSuffixLength] = (0, import_react96.useState)(0);
13302
- (0, import_react96.useLayoutEffect)(() => {
13372
+ const [text, setText] = (0, import_react97.useState)(getDefaultText(value, defaultValue));
13373
+ const prefixRef = (0, import_react97.useRef)(null);
13374
+ const suffixRef = (0, import_react97.useRef)(null);
13375
+ const [prefixLength, setPrefixLength] = (0, import_react97.useState)(0);
13376
+ const [suffixLength, setSuffixLength] = (0, import_react97.useState)(0);
13377
+ (0, import_react97.useLayoutEffect)(() => {
13303
13378
  if (prefixRef.current) {
13304
13379
  setPrefixLength(prefixRef.current.offsetWidth);
13305
13380
  }
@@ -13313,7 +13388,7 @@ var TextInput = ({
13313
13388
  onChange(event);
13314
13389
  }
13315
13390
  };
13316
- const generatedId = (0, import_react96.useId)();
13391
+ const generatedId = (0, import_react97.useId)();
13317
13392
  const uniqueId = id != null ? id : `${generatedId}-textInput`;
13318
13393
  const hasErrorMessage = !!errorMessage;
13319
13394
  const hasTip = !!tip;
@@ -13483,7 +13558,7 @@ var TextInput = ({
13483
13558
  TextInput.displayName = "TextInput";
13484
13559
 
13485
13560
  // src/components/Toggle/Toggle.tsx
13486
- var import_react97 = require("react");
13561
+ var import_react98 = require("react");
13487
13562
 
13488
13563
  // src/components/Toggle/Toggle.module.css
13489
13564
  var Toggle_default = {
@@ -13517,7 +13592,7 @@ var Toggle = ({
13517
13592
  ...rest
13518
13593
  }) => {
13519
13594
  const { t } = useTranslation();
13520
- const generatedId = (0, import_react97.useId)();
13595
+ const generatedId = (0, import_react98.useId)();
13521
13596
  const uniqueId = id != null ? id : `${generatedId}-toggle`;
13522
13597
  const iconSize = size2 === "large" ? "medium" : "small";
13523
13598
  const [checked, setChecked] = useControllableState({
@@ -13592,14 +13667,14 @@ var Toggle = ({
13592
13667
  Toggle.displayName = "Toggle";
13593
13668
 
13594
13669
  // src/components/ToggleBar/ToggleBar.tsx
13595
- var import_react99 = require("react");
13670
+ var import_react100 = require("react");
13596
13671
 
13597
13672
  // src/components/ToggleBar/ToggleBar.context.tsx
13598
- var import_react98 = require("react");
13599
- var ToggleBarContext = (0, import_react98.createContext)({
13673
+ var import_react99 = require("react");
13674
+ var ToggleBarContext = (0, import_react99.createContext)({
13600
13675
  size: "medium"
13601
13676
  });
13602
- var useToggleBarContext = () => (0, import_react98.useContext)(ToggleBarContext);
13677
+ var useToggleBarContext = () => (0, import_react99.useContext)(ToggleBarContext);
13603
13678
 
13604
13679
  // src/components/ToggleBar/ToggleBar.module.css
13605
13680
  var ToggleBar_default = {
@@ -13632,9 +13707,9 @@ var ToggleBar = (props) => {
13632
13707
  id,
13633
13708
  ...rest
13634
13709
  } = props;
13635
- const generatedId = (0, import_react99.useId)();
13710
+ const generatedId = (0, import_react100.useId)();
13636
13711
  const uniqueId = id != null ? id : `${generatedId}-ToggleBar`;
13637
- const [groupValue, setGroupValue] = (0, import_react99.useState)(value);
13712
+ const [groupValue, setGroupValue] = (0, import_react100.useState)(value);
13638
13713
  const handleChange = combineHandlers(
13639
13714
  (e) => setGroupValue(e.target.value),
13640
13715
  (e) => onChange && onChange(e, e.target.value)
@@ -13669,7 +13744,7 @@ var ToggleBar = (props) => {
13669
13744
  ToggleBar.displayName = "ToggleBar";
13670
13745
 
13671
13746
  // src/components/ToggleBar/ToggleRadio.tsx
13672
- var import_react100 = require("react");
13747
+ var import_react101 = require("react");
13673
13748
  var import_jsx_runtime321 = require("react/jsx-runtime");
13674
13749
  var typographyTypes3 = {
13675
13750
  large: "bodyLarge",
@@ -13701,12 +13776,13 @@ var ToggleRadio = ({
13701
13776
  id,
13702
13777
  ...rest
13703
13778
  }) => {
13704
- const generatedId = (0, import_react100.useId)();
13779
+ const generatedId = (0, import_react101.useId)();
13705
13780
  const uniqueId = id != null ? id : `${generatedId}-ToggleRadio`;
13706
13781
  const group = useToggleBarContext();
13707
13782
  const handleChange = (event) => {
13708
- onChange && onChange(event);
13709
- (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);
13710
13786
  };
13711
13787
  const contentTypeCn = label ? "with-text" : "just-icon";
13712
13788
  return /* @__PURE__ */ (0, import_jsx_runtime321.jsxs)("label", { htmlFor: uniqueId, className: ToggleBar_default.label, children: [
@@ -13753,7 +13829,7 @@ var ToggleRadio = ({
13753
13829
  ToggleRadio.displayName = "ToggleRadio";
13754
13830
 
13755
13831
  // src/components/ToggleButton/ToggleButton.tsx
13756
- var import_react101 = require("react");
13832
+ var import_react102 = require("react");
13757
13833
 
13758
13834
  // src/components/ToggleButton/ToggleButton.module.css
13759
13835
  var ToggleButton_default = {
@@ -13774,7 +13850,7 @@ var ToggleButton = ({
13774
13850
  htmlProps,
13775
13851
  ...rest
13776
13852
  }) => {
13777
- const generatedId = (0, import_react101.useId)();
13853
+ const generatedId = (0, import_react102.useId)();
13778
13854
  const uniqueId = id != null ? id : `${generatedId}-toggleButton`;
13779
13855
  const hasIcon = !!icon;
13780
13856
  return /* @__PURE__ */ (0, import_jsx_runtime322.jsxs)(Box, { as: "label", htmlFor: uniqueId, width: "fit-content", children: [
@@ -13816,7 +13892,7 @@ var ToggleButton = ({
13816
13892
  ToggleButton.displayName = "ToggleButton";
13817
13893
 
13818
13894
  // src/components/ToggleButton/ToggleButtonGroup.tsx
13819
- var import_react102 = require("react");
13895
+ var import_react103 = require("react");
13820
13896
  var import_jsx_runtime323 = require("react/jsx-runtime");
13821
13897
  var ToggleButtonGroup = (props) => {
13822
13898
  const {
@@ -13829,7 +13905,7 @@ var ToggleButtonGroup = (props) => {
13829
13905
  htmlProps,
13830
13906
  ...rest
13831
13907
  } = props;
13832
- const generatedId = (0, import_react102.useId)();
13908
+ const generatedId = (0, import_react103.useId)();
13833
13909
  const uniqueLabelId = labelId != null ? labelId : `${generatedId}-ToggleButtonGroupLabel`;
13834
13910
  return /* @__PURE__ */ (0, import_jsx_runtime323.jsxs)(
13835
13911
  VStack,
@@ -14002,6 +14078,7 @@ ToggleButtonGroup.displayName = "ToggleButtonGroup";
14002
14078
  InfoIcon,
14003
14079
  InlineButton,
14004
14080
  InlineEditInput,
14081
+ InlineEditSelect,
14005
14082
  InlineEditTextArea,
14006
14083
  Input,
14007
14084
  InputMessage,