@norges-domstoler/dds-components 0.0.0-dev-20251111141002 → 0.0.0-dev-20251114091802

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.mjs CHANGED
@@ -4300,20 +4300,25 @@ var OverflowMenuSpan = ({
4300
4300
  OverflowMenuSpan.displayName = "OverflowMenuSpan";
4301
4301
 
4302
4302
  // src/components/OverflowMenu/components/OverflowMenuListHeader.tsx
4303
+ import { useContext as useContext6 } from "react";
4303
4304
  import { jsx as jsx203 } from "react/jsx-runtime";
4304
4305
  var OverflowMenuListHeader = ({
4305
4306
  className,
4306
4307
  ...rest
4307
- }) => /* @__PURE__ */ jsx203(
4308
- Box,
4309
- {
4310
- as: "h2",
4311
- paddingInline: "x0.75",
4312
- paddingBlock: "x0.75 0",
4313
- ...rest,
4314
- className: cn(className, typographyStyles_default["heading-xxsmall"])
4315
- }
4316
- );
4308
+ }) => {
4309
+ const themeContext = useContext6(ThemeContext);
4310
+ const headingStyle = (themeContext == null ? void 0 : themeContext.theme) === "core" ? "heading-xsmall" : "heading-xxsmall";
4311
+ return /* @__PURE__ */ jsx203(
4312
+ Box,
4313
+ {
4314
+ as: "h2",
4315
+ paddingInline: "x0.75",
4316
+ paddingBlock: "x0.75 0",
4317
+ ...rest,
4318
+ className: cn(className, typographyStyles_default[headingStyle])
4319
+ }
4320
+ );
4321
+ };
4317
4322
  OverflowMenuListHeader.displayName = "OverflowMenuListHeader";
4318
4323
 
4319
4324
  // src/components/OverflowMenu/OverflowMenuGroup.tsx
@@ -4781,10 +4786,10 @@ CardExpandableBody.displayName = "CardExpandableBody";
4781
4786
  import { useId as useId4 } from "react";
4782
4787
 
4783
4788
  // src/components/SelectionControl/Checkbox/CheckboxGroupContext.tsx
4784
- import { createContext as createContext6, useContext as useContext6 } from "react";
4789
+ import { createContext as createContext6, useContext as useContext7 } from "react";
4785
4790
  var CheckboxGroupContext = createContext6(null);
4786
4791
  var useCheckboxGroup = () => {
4787
- return useContext6(CheckboxGroupContext);
4792
+ return useContext7(CheckboxGroupContext);
4788
4793
  };
4789
4794
 
4790
4795
  // src/components/SelectionControl/SelectionControl.module.css
@@ -5135,10 +5140,10 @@ CheckboxGroup.displayName = "CheckboxGroup";
5135
5140
  import { useId as useId6 } from "react";
5136
5141
 
5137
5142
  // src/components/SelectionControl/RadioButton/RadioButtonGroupContext.tsx
5138
- import { createContext as createContext7, useContext as useContext7 } from "react";
5143
+ import { createContext as createContext7, useContext as useContext8 } from "react";
5139
5144
  var RadioButtonGroupContext = createContext7(null);
5140
5145
  var useRadioButtonGroup = () => {
5141
- return useContext7(RadioButtonGroupContext);
5146
+ return useContext8(RadioButtonGroupContext);
5142
5147
  };
5143
5148
 
5144
5149
  // src/components/SelectionControl/RadioButton/RadioButton.tsx
@@ -5325,9 +5330,9 @@ var RadioButtonGroup = ({
5325
5330
  RadioButtonGroup.displayName = "RadioButtonGroup";
5326
5331
 
5327
5332
  // src/components/Card/CardSelectionControl/CardSelectable.context.tsx
5328
- import { createContext as createContext8, useContext as useContext8 } from "react";
5333
+ import { createContext as createContext8, useContext as useContext9 } from "react";
5329
5334
  var CardSelectableContext = createContext8({});
5330
- var useCardSelectableContext = () => useContext8(CardSelectableContext);
5335
+ var useCardSelectableContext = () => useContext9(CardSelectableContext);
5331
5336
 
5332
5337
  // src/components/Card/CardSelectionControl/CardSelectable.tsx
5333
5338
  import { jsx as jsx217 } from "react/jsx-runtime";
@@ -5703,7 +5708,7 @@ import {
5703
5708
  import { useLocale as useLocale2 } from "@react-aria/i18n";
5704
5709
  import { useCalendarState } from "@react-stately/calendar";
5705
5710
  import {
5706
- useContext as useContext11
5711
+ useContext as useContext12
5707
5712
  } from "react";
5708
5713
 
5709
5714
  // src/components/date-inputs/DatePicker/Calendar/CalendarGrid.tsx
@@ -5712,7 +5717,7 @@ import {
5712
5717
  useCalendarGrid
5713
5718
  } from "@react-aria/calendar";
5714
5719
  import { useLocale } from "@react-aria/i18n";
5715
- import { useContext as useContext10 } from "react";
5720
+ import { useContext as useContext11 } from "react";
5716
5721
 
5717
5722
  // src/components/date-inputs/DatePicker/Calendar/CalendarCell.tsx
5718
5723
  import { isToday } from "@internationalized/date";
@@ -5873,7 +5878,7 @@ function isLeapYear(date) {
5873
5878
  // src/components/date-inputs/DatePicker/CalendarPopover.tsx
5874
5879
  import {
5875
5880
  createContext as createContext9,
5876
- useContext as useContext9,
5881
+ useContext as useContext10,
5877
5882
  useEffect as useEffect18,
5878
5883
  useRef as useRef12
5879
5884
  } from "react";
@@ -5905,7 +5910,7 @@ var CalendarPopover = ({
5905
5910
  var CalendarPopoverAnchor = ({
5906
5911
  children
5907
5912
  }) => {
5908
- const { anchorRef } = useContext9(CalendarPopoverContext);
5913
+ const { anchorRef } = useContext10(CalendarPopoverContext);
5909
5914
  return /* @__PURE__ */ jsx226("div", { ref: anchorRef != null ? anchorRef : void 0, children });
5910
5915
  };
5911
5916
  var CalendarPopoverContent = ({
@@ -5918,13 +5923,13 @@ var CalendarPopoverContent = ({
5918
5923
  const { refs, styles: floatingStyles } = useFloatPosition(null, {
5919
5924
  placement: "bottom-start"
5920
5925
  });
5921
- const themeContext = useContext9(ThemeContext);
5926
+ const themeContext = useContext10(ThemeContext);
5922
5927
  if (!themeContext) {
5923
5928
  throw new Error("DatePicker must be used within a ThemeProvider");
5924
5929
  }
5925
5930
  const portalTarget = themeContext.el;
5926
5931
  const { t } = useTranslation();
5927
- const { isOpen, onClose, anchorRef, closeButtonRef } = useContext9(
5932
+ const { isOpen, onClose, anchorRef, closeButtonRef } = useContext10(
5928
5933
  CalendarPopoverContext
5929
5934
  );
5930
5935
  const hasTransitionedIn = useMountTransition(isOpen, 500);
@@ -6018,7 +6023,7 @@ function CalendarGrid({ state, ...props }) {
6018
6023
  { short: t(texts6.sa), full: t(texts6.saturday) },
6019
6024
  { short: t(texts6.su), full: t(texts6.sunday) }
6020
6025
  ];
6021
- const { showWeekNumbers, onClose } = useContext10(CalendarPopoverContext);
6026
+ const { showWeekNumbers, onClose } = useContext11(CalendarPopoverContext);
6022
6027
  const typographyCn = [
6023
6028
  typographyStyles_default["body-xsmall"],
6024
6029
  typographyStyles_default["text-color--subtle"]
@@ -6217,7 +6222,7 @@ function Calendar(props) {
6217
6222
  nextButtonProps: { onPress: onNext },
6218
6223
  title
6219
6224
  } = useCalendar(props, state);
6220
- const { onClose, closeButtonRef } = useContext11(CalendarPopoverContext);
6225
+ const { onClose, closeButtonRef } = useContext12(CalendarPopoverContext);
6221
6226
  const closeOnKeyboardBlurBack = (event) => {
6222
6227
  var _a;
6223
6228
  if (event.key === "Tab" && event.shiftKey === true) {
@@ -6518,7 +6523,7 @@ var ClearButton = ({
6518
6523
  ClearButton.displayName = "ClearButton";
6519
6524
 
6520
6525
  // src/components/date-inputs/common/DateInput.tsx
6521
- import { useContext as useContext12 } from "react";
6526
+ import { useContext as useContext13 } from "react";
6522
6527
 
6523
6528
  // src/components/helpers/Input/Input.tsx
6524
6529
  import { jsx as jsx233 } from "react/jsx-runtime";
@@ -6608,7 +6613,7 @@ function DateInput({
6608
6613
  ...props
6609
6614
  }) {
6610
6615
  const hasErrorMessage = !!errorMessage;
6611
- const { isOpen } = useContext12(CalendarPopoverContext);
6616
+ const { isOpen } = useContext13(CalendarPopoverContext);
6612
6617
  return /* @__PURE__ */ jsxs46(
6613
6618
  "div",
6614
6619
  {
@@ -7101,9 +7106,9 @@ var DetailList_default = {
7101
7106
  };
7102
7107
 
7103
7108
  // src/components/DetailList/DetailList.context.tsx
7104
- import { createContext as createContext10, useContext as useContext13 } from "react";
7109
+ import { createContext as createContext10, useContext as useContext14 } from "react";
7105
7110
  var DetailListContext = createContext10({});
7106
- var useDetailListContext = () => useContext13(DetailListContext);
7111
+ var useDetailListContext = () => useContext14(DetailListContext);
7107
7112
 
7108
7113
  // src/components/DetailList/DetailList.tsx
7109
7114
  import { jsx as jsx243 } from "react/jsx-runtime";
@@ -7177,7 +7182,7 @@ DetailListTerm.displayName = "DetailListTerm";
7177
7182
 
7178
7183
  // src/components/Drawer/Drawer.tsx
7179
7184
  import {
7180
- useContext as useContext15,
7185
+ useContext as useContext16,
7181
7186
  useEffect as useEffect19,
7182
7187
  useRef as useRef19
7183
7188
  } from "react";
@@ -7198,9 +7203,9 @@ var Drawer_default = {
7198
7203
  };
7199
7204
 
7200
7205
  // src/components/Drawer/Drawer.context.tsx
7201
- import { createContext as createContext11, useContext as useContext14 } from "react";
7206
+ import { createContext as createContext11, useContext as useContext15 } from "react";
7202
7207
  var DrawerContext = createContext11({});
7203
- var useDrawerContext = () => useContext14(DrawerContext);
7208
+ var useDrawerContext = () => useContext15(DrawerContext);
7204
7209
 
7205
7210
  // src/components/Drawer/Drawer.tsx
7206
7211
  import { jsx as jsx247, jsxs as jsxs50 } from "react/jsx-runtime";
@@ -7218,7 +7223,7 @@ var Drawer = ({
7218
7223
  ref,
7219
7224
  ...rest
7220
7225
  }) => {
7221
- const themeContext = useContext15(ThemeContext);
7226
+ const themeContext = useContext16(ThemeContext);
7222
7227
  if (!themeContext) {
7223
7228
  throw new Error("Drawer must be used within a ThemeProvider");
7224
7229
  }
@@ -8185,6 +8190,9 @@ var ErrorList = (props) => {
8185
8190
  }) });
8186
8191
  };
8187
8192
 
8193
+ // src/components/FileUploader/File.tsx
8194
+ import { useEffect as useEffect23, useState as useState17 } from "react";
8195
+
8188
8196
  // src/components/FileUploader/FileUploader.module.css
8189
8197
  var FileUploader_default = {
8190
8198
  "input-container": "FileUploader_input-container",
@@ -8199,7 +8207,7 @@ var FileUploader_default = {
8199
8207
 
8200
8208
  // src/components/FileUploader/File.tsx
8201
8209
  import { Fragment as Fragment7, jsx as jsx260, jsxs as jsxs58 } from "react/jsx-runtime";
8202
- var File = (props) => {
8210
+ var File2 = (props) => {
8203
8211
  const { t } = useTranslation();
8204
8212
  const {
8205
8213
  parentId,
@@ -8210,11 +8218,23 @@ var File = (props) => {
8210
8218
  disabled,
8211
8219
  readOnly
8212
8220
  } = props;
8221
+ const [fileUrl, setFileUrl] = useState17();
8222
+ useEffect23(() => {
8223
+ if (stateFile.url) {
8224
+ setFileUrl(stateFile.url);
8225
+ } else if (stateFile.file) {
8226
+ const url = URL.createObjectURL(stateFile.file);
8227
+ setFileUrl(url);
8228
+ return () => URL.revokeObjectURL(url);
8229
+ }
8230
+ }, [stateFile.file]);
8213
8231
  const errorsList = stateFile.errors.map((e, errorIndex) => ({
8214
8232
  id: derivativeIdGenerator(parentId, `file-${index}-error-${errorIndex}`),
8215
8233
  message: e
8216
8234
  }));
8217
8235
  const inactive = disabled || readOnly;
8236
+ console.log("stateFile", stateFile);
8237
+ console.log("fileUrl", fileUrl);
8218
8238
  return /* @__PURE__ */ jsxs58("li", { children: [
8219
8239
  /* @__PURE__ */ jsxs58(
8220
8240
  Paper,
@@ -8235,7 +8255,7 @@ var File = (props) => {
8235
8255
  as: "span",
8236
8256
  color: disabled ? "text-subtle" : readOnly ? "text-medium" : void 0,
8237
8257
  className: cn(FileUploader_default.file__name),
8238
- children: stateFile.file.name
8258
+ children: fileUrl ? /* @__PURE__ */ jsx260(Link, { href: fileUrl, target: "_blank", children: stateFile.name }) : stateFile.name
8239
8259
  }
8240
8260
  ),
8241
8261
  !inactive && /* @__PURE__ */ jsxs58(Fragment7, { children: [
@@ -8255,7 +8275,7 @@ var File = (props) => {
8255
8275
  onClick: removeFile,
8256
8276
  icon: CloseIcon,
8257
8277
  htmlProps: {
8258
- "aria-label": t(texts15.removeFile(stateFile.file.name)),
8278
+ "aria-label": t(texts15.removeFile(stateFile.name)),
8259
8279
  "aria-invalid": !isValid ? true : void 0,
8260
8280
  "aria-errormessage": !isValid ? t(texts15.invalidFile) : void 0,
8261
8281
  "aria-describedby": spaceSeparatedIdListGenerator(
@@ -8292,7 +8312,7 @@ var texts15 = createTexts({
8292
8312
  import {
8293
8313
  fromEvent as getFilesFromEvent
8294
8314
  } from "file-selector";
8295
- import { useCallback as useCallback6, useEffect as useEffect23, useMemo, useReducer, useRef as useRef23 } from "react";
8315
+ import { useCallback as useCallback6, useEffect as useEffect24, useMemo, useReducer, useRef as useRef23 } from "react";
8296
8316
 
8297
8317
  // src/components/FileUploader/fileUploaderReducer.ts
8298
8318
  var fileUploaderReducer = (state, action) => {
@@ -8397,10 +8417,19 @@ var useFileUploader = (props) => {
8397
8417
  const buttonRef = useRef23(null);
8398
8418
  const isControlled = !!value;
8399
8419
  const initialFileUploaderFiles = useMemo(
8400
- () => (initialFiles != null ? initialFiles : []).map((f) => ({
8401
- file: f,
8402
- errors: []
8403
- })),
8420
+ () => (initialFiles != null ? initialFiles : []).map((f) => {
8421
+ if (f instanceof File)
8422
+ return {
8423
+ file: f,
8424
+ name: f.name,
8425
+ errors: []
8426
+ };
8427
+ return {
8428
+ url: f.url,
8429
+ name: f.name,
8430
+ errors: []
8431
+ };
8432
+ }),
8404
8433
  [initialFiles]
8405
8434
  );
8406
8435
  const [state, dispatch] = useReducer(fileUploaderReducer, {
@@ -8416,13 +8445,21 @@ var useFileUploader = (props) => {
8416
8445
  )
8417
8446
  });
8418
8447
  const { files: stateFiles } = state;
8419
- useEffect23(() => {
8448
+ useEffect24(() => {
8420
8449
  if (isControlled) {
8421
8450
  const files = value.map((file) => {
8422
- const accepted = isFileAccepted(file, accept);
8451
+ if (file instanceof File) {
8452
+ const accepted = isFileAccepted(file, accept);
8453
+ return {
8454
+ name: file.name,
8455
+ file,
8456
+ errors: accepted ? [] : [t(texts16.invalidFileType)]
8457
+ };
8458
+ }
8423
8459
  return {
8424
- file,
8425
- errors: accepted ? [] : [t(texts16.invalidFileType)]
8460
+ url: file.url,
8461
+ name: file.name,
8462
+ errors: []
8426
8463
  };
8427
8464
  });
8428
8465
  dispatch({
@@ -8431,7 +8468,7 @@ var useFileUploader = (props) => {
8431
8468
  });
8432
8469
  }
8433
8470
  }, [value, isControlled, accept, dispatch]);
8434
- useEffect23(() => {
8471
+ useEffect24(() => {
8435
8472
  dispatch({
8436
8473
  type: "setRootErrors",
8437
8474
  payload: calcRootErrors(
@@ -8481,18 +8518,20 @@ var useFileUploader = (props) => {
8481
8518
  async (evt) => {
8482
8519
  evt.preventDefault();
8483
8520
  if (isEventWithFiles(evt)) {
8484
- const existingFileNames = stateFiles.map((f) => f.file.name);
8521
+ const existingFileNames = stateFiles.map((f) => f.name);
8485
8522
  const filesFromEvent = await getFilesFromEvent(
8486
8523
  evt
8487
8524
  );
8488
- const newFiles = filesFromEvent.filter((f) => !existingFileNames.includes(f.name)).map((file) => {
8489
- const accepted = isFileAccepted(file, accept);
8490
- return {
8491
- file,
8492
- errors: accepted ? [] : [t(texts16.invalidFileType)]
8493
- };
8494
- }).concat(stateFiles);
8495
- onChange(newFiles.map((f) => f.file));
8525
+ const newFiles = filesFromEvent.filter((f) => !existingFileNames.includes(f.name)).map((file) => ({
8526
+ file,
8527
+ name: file.name,
8528
+ errors: isFileAccepted(file, accept) ? [] : [t(texts16.invalidFileType)]
8529
+ })).concat(stateFiles);
8530
+ const mergedFiles = [
8531
+ ...stateFiles.filter((f) => f.url).map((f) => ({ name: f.name, url: f.url })),
8532
+ ...newFiles.filter((f) => f.file).map((f) => f.file)
8533
+ ];
8534
+ onChange(mergedFiles);
8496
8535
  if (!isControlled) {
8497
8536
  dispatch({
8498
8537
  type: "onSetFiles",
@@ -8521,7 +8560,11 @@ var useFileUploader = (props) => {
8521
8560
  (file) => {
8522
8561
  const newFiles = [...stateFiles];
8523
8562
  newFiles.splice(stateFiles.indexOf(file), 1);
8524
- onChange(newFiles.map((f) => f.file));
8563
+ const mergedFiles = [
8564
+ ...newFiles.filter((f) => f.url).map((f) => ({ name: f.name, url: f.url })),
8565
+ ...newFiles.filter((f) => f.file).map((f) => f.file)
8566
+ ];
8567
+ onChange(mergedFiles);
8525
8568
  if (!isControlled) {
8526
8569
  dispatch({
8527
8570
  type: "onRemoveFile",
@@ -8658,7 +8701,7 @@ var FileUploader = (props) => {
8658
8701
  const fileListId = derivativeIdGenerator(uniqueId, "file-list");
8659
8702
  const fileListNameId = derivativeIdGenerator(uniqueId, "file-list-name");
8660
8703
  const fileListElements = stateFiles.map((stateFile, index) => /* @__PURE__ */ jsx261(
8661
- File,
8704
+ File2,
8662
8705
  {
8663
8706
  parentId: uniqueId,
8664
8707
  index,
@@ -8668,7 +8711,7 @@ var FileUploader = (props) => {
8668
8711
  disabled,
8669
8712
  readOnly
8670
8713
  },
8671
- stateFile.file.name
8714
+ stateFile.name
8672
8715
  ));
8673
8716
  const rootErrorsList = rootErrors.map((e, index) => ({
8674
8717
  id: derivativeIdGenerator(uniqueId, `error-${index}`),
@@ -8967,7 +9010,7 @@ var texts18 = createTexts({
8967
9010
  });
8968
9011
 
8969
9012
  // src/components/GlobalMessage/GlobalMessage.tsx
8970
- import { useState as useState17 } from "react";
9013
+ import { useState as useState18 } from "react";
8971
9014
 
8972
9015
  // src/components/GlobalMessage/GlobalMessage.module.css
8973
9016
  var GlobalMessage_default = {
@@ -8999,7 +9042,7 @@ var GlobalMessage = ({
8999
9042
  ...rest
9000
9043
  }) => {
9001
9044
  const { t } = useTranslation();
9002
- const [isClosed, setClosed] = useState17(false);
9045
+ const [isClosed, setClosed] = useState18(false);
9003
9046
  return !isClosed ? /* @__PURE__ */ jsxs61(
9004
9047
  "div",
9005
9048
  {
@@ -9078,14 +9121,14 @@ import { useRef as useRef25 } from "react";
9078
9121
  // src/components/InlineEdit/InlineEdit.context.tsx
9079
9122
  import {
9080
9123
  createContext as createContext12,
9081
- useContext as useContext16,
9082
- useState as useState18
9124
+ useContext as useContext17,
9125
+ useState as useState19
9083
9126
  } from "react";
9084
9127
  import { jsx as jsx274 } from "react/jsx-runtime";
9085
9128
  var InlineEditContext = createContext12(
9086
9129
  {}
9087
9130
  );
9088
- var useInlineEditContext = () => useContext16(InlineEditContext);
9131
+ var useInlineEditContext = () => useContext17(InlineEditContext);
9089
9132
  var InlineEditContextProvider = (props) => {
9090
9133
  const {
9091
9134
  emptiable,
@@ -9097,8 +9140,8 @@ var InlineEditContextProvider = (props) => {
9097
9140
  inputRef,
9098
9141
  children
9099
9142
  } = props;
9100
- const [editingValue, setEditingValue] = useState18(value != null ? value : "");
9101
- const [isEditing, setIsEditing] = useState18(false);
9143
+ const [editingValue, setEditingValue] = useState19(value != null ? value : "");
9144
+ const [isEditing, setIsEditing] = useState19(false);
9102
9145
  const onChangeHandler = (e) => {
9103
9146
  setEditingValue(e.target.value);
9104
9147
  onChange == null ? void 0 : onChange(e);
@@ -9438,7 +9481,7 @@ var InlineEditSelect = ({
9438
9481
  };
9439
9482
 
9440
9483
  // src/components/InternalHeader/InternalHeader.tsx
9441
- import { useState as useState19 } from "react";
9484
+ import { useState as useState20 } from "react";
9442
9485
 
9443
9486
  // src/components/InternalHeader/InternalHeader.module.css
9444
9487
  var InternalHeader_default = {
@@ -9489,7 +9532,7 @@ var InternalHeader = (props) => {
9489
9532
  ...rest
9490
9533
  } = props;
9491
9534
  const { t } = useTranslation();
9492
- const [currentPage, setCurrentPage] = useState19(
9535
+ const [currentPage, setCurrentPage] = useState20(
9493
9536
  currentPageHref
9494
9537
  );
9495
9538
  const handleCurrentPageChange = (href) => {
@@ -9668,7 +9711,7 @@ var ListItem = ({ className, ...rest }) => /* @__PURE__ */ jsx282("li", { ...res
9668
9711
  ListItem.displayName = "ListItem";
9669
9712
 
9670
9713
  // src/components/LocalMessage/LocalMessage.tsx
9671
- import { useState as useState20 } from "react";
9714
+ import { useState as useState21 } from "react";
9672
9715
 
9673
9716
  // src/components/LocalMessage/LocalMessage.module.css
9674
9717
  var LocalMessage_default = {
@@ -9711,7 +9754,7 @@ var LocalMessage = ({
9711
9754
  ...rest
9712
9755
  }) => {
9713
9756
  const { t } = useTranslation();
9714
- const [isClosed, setClosed] = useState20(false);
9757
+ const [isClosed, setClosed] = useState21(false);
9715
9758
  if (isClosed) {
9716
9759
  return /* @__PURE__ */ jsx283(Fragment9, {});
9717
9760
  }
@@ -9766,8 +9809,8 @@ LocalMessage.displayName = "LocalMessage";
9766
9809
 
9767
9810
  // src/components/Modal/Modal.tsx
9768
9811
  import {
9769
- useContext as useContext17,
9770
- useEffect as useEffect24,
9812
+ useContext as useContext18,
9813
+ useEffect as useEffect25,
9771
9814
  useId as useId19,
9772
9815
  useRef as useRef28
9773
9816
  } from "react";
@@ -9812,13 +9855,13 @@ var Modal = ({
9812
9855
  onClose();
9813
9856
  }
9814
9857
  };
9815
- const themeContext = useContext17(ThemeContext);
9858
+ const themeContext = useContext18(ThemeContext);
9816
9859
  if (!themeContext) {
9817
9860
  throw new Error("Modal must be used within a ThemeProvider");
9818
9861
  }
9819
9862
  const { t } = useTranslation();
9820
9863
  const portalTarget = parentElement != null ? parentElement : themeContext == null ? void 0 : themeContext.el;
9821
- useEffect24(() => {
9864
+ useEffect25(() => {
9822
9865
  if (isOpen) {
9823
9866
  handleElementWithBackdropMount(document.body);
9824
9867
  } else {
@@ -9943,7 +9986,7 @@ var ModalActions = (props) => /* @__PURE__ */ jsx286(Box, { display: "flex", fle
9943
9986
  ModalActions.displayName = "ModalActions";
9944
9987
 
9945
9988
  // src/components/Pagination/Pagination.tsx
9946
- import { useState as useState22 } from "react";
9989
+ import { useState as useState23 } from "react";
9947
9990
 
9948
9991
  // src/components/Pagination/Pagination.module.css
9949
9992
  var Pagination_default = {
@@ -9990,7 +10033,7 @@ function PaginationGenerator(pagesAmount, activePage) {
9990
10033
  // src/components/Select/Select.tsx
9991
10034
  import {
9992
10035
  useCallback as useCallback7,
9993
- useContext as useContext18,
10036
+ useContext as useContext19,
9994
10037
  useId as useId20
9995
10038
  } from "react";
9996
10039
  import {
@@ -10422,7 +10465,7 @@ function Select({
10422
10465
  afterLabelContent,
10423
10466
  ...rest
10424
10467
  }) {
10425
- const themeContext = useContext18(ThemeContext);
10468
+ const themeContext = useContext19(ThemeContext);
10426
10469
  if (!themeContext) {
10427
10470
  throw new Error("Select must be used within a ThemeProvider");
10428
10471
  }
@@ -10567,7 +10610,7 @@ function Select({
10567
10610
  Select.displayName = "Select";
10568
10611
 
10569
10612
  // src/components/Select/NativeSelect/NativeSelect.tsx
10570
- import { useEffect as useEffect25, useId as useId21, useRef as useRef29, useState as useState21 } from "react";
10613
+ import { useEffect as useEffect26, useId as useId21, useRef as useRef29, useState as useState22 } from "react";
10571
10614
 
10572
10615
  // src/components/Select/NativeSelect/NativeSelect.module.css
10573
10616
  var NativeSelect_default = {
@@ -10612,13 +10655,13 @@ var NativeSelect = ({
10612
10655
  }) => {
10613
10656
  const { t } = useTranslation();
10614
10657
  const selectRef = useRef29(null);
10615
- const [hasValue, setHasValue] = useState21(false);
10616
- useEffect25(() => {
10658
+ const [hasValue, setHasValue] = useState22(false);
10659
+ useEffect26(() => {
10617
10660
  var _a, _b;
10618
10661
  const selectedIndex = (_b = (_a = selectRef.current) == null ? void 0 : _a.selectedIndex) != null ? _b : -1;
10619
10662
  setHasValue(selectedIndex !== 0);
10620
10663
  }, []);
10621
- useEffect25(() => {
10664
+ useEffect26(() => {
10622
10665
  var _a;
10623
10666
  if (clearable) {
10624
10667
  const firstOption = (_a = selectRef.current) == null ? void 0 : _a.options[0];
@@ -10776,7 +10819,7 @@ var Pagination = ({
10776
10819
  value: activePageProp,
10777
10820
  defaultValue: defaultActivePage
10778
10821
  });
10779
- const [itemsPerPage, setItemsPerPage] = useState22(defaultItemsPerPage);
10822
+ const [itemsPerPage, setItemsPerPage] = useState23(defaultItemsPerPage);
10780
10823
  const pagesLength = Math.ceil(itemsAmount / itemsPerPage);
10781
10824
  const items = PaginationGenerator(pagesLength, activePage);
10782
10825
  const onPageChange = (event, page) => {
@@ -11093,11 +11136,11 @@ var texts21 = createTexts({
11093
11136
 
11094
11137
  // src/components/PhoneInput/PhoneInput.tsx
11095
11138
  import {
11096
- useEffect as useEffect26,
11139
+ useEffect as useEffect27,
11097
11140
  useId as useId22,
11098
11141
  useLayoutEffect as useLayoutEffect2,
11099
11142
  useRef as useRef30,
11100
- useState as useState23
11143
+ useState as useState24
11101
11144
  } from "react";
11102
11145
 
11103
11146
  // src/components/PhoneInput/constants.ts
@@ -11570,16 +11613,16 @@ var PhoneInput = ({
11570
11613
  const hasMessage = hasErrorMessage || hasTip;
11571
11614
  const tipId = derivativeIdGenerator(phoneInputId, "tip");
11572
11615
  const errorMessageId = derivativeIdGenerator(phoneInputId, "errorMessage");
11573
- const [callingCode, setCallingCode] = useState23("");
11574
- const [selectedCountryCodeText, setSelectedCountryCodeText] = useState23("");
11575
- const [internalValue, setInternalValue] = useState23(
11616
+ const [callingCode, setCallingCode] = useState24("");
11617
+ const [selectedCountryCodeText, setSelectedCountryCodeText] = useState24("");
11618
+ const [internalValue, setInternalValue] = useState24(
11576
11619
  defaultValue != null ? defaultValue : {
11577
11620
  countryCode: "",
11578
11621
  phoneNumber: ""
11579
11622
  }
11580
11623
  );
11581
11624
  const isControlled = value !== void 0;
11582
- const [callingCodeWidth, setCallingCodeWidth] = useState23(0);
11625
+ const [callingCodeWidth, setCallingCodeWidth] = useState24(0);
11583
11626
  const callingCodeRef = useRef30(null);
11584
11627
  useLayoutEffect2(() => {
11585
11628
  if (callingCodeRef.current) {
@@ -11590,7 +11633,7 @@ var PhoneInput = ({
11590
11633
  const internalSelectRef = useRef30(null);
11591
11634
  const combinedSelectRef = useCombinedRef(selectRef, internalSelectRef);
11592
11635
  const displayedValue = isControlled ? value : internalValue;
11593
- useEffect26(() => {
11636
+ useEffect27(() => {
11594
11637
  const selectEl = internalSelectRef.current;
11595
11638
  if (selectEl && selectEl.value) {
11596
11639
  const { options, selectedIndex } = selectEl;
@@ -11752,8 +11795,8 @@ var texts22 = createTexts({
11752
11795
 
11753
11796
  // src/components/Popover/Popover.tsx
11754
11797
  import {
11755
- useContext as useContext20,
11756
- useEffect as useEffect27,
11798
+ useContext as useContext21,
11799
+ useEffect as useEffect28,
11757
11800
  useId as useId23
11758
11801
  } from "react";
11759
11802
  import { createPortal as createPortal4 } from "react-dom";
@@ -11769,10 +11812,10 @@ var Popover_default = {
11769
11812
  // src/components/Popover/Popover.context.tsx
11770
11813
  import {
11771
11814
  createContext as createContext13,
11772
- useContext as useContext19
11815
+ useContext as useContext20
11773
11816
  } from "react";
11774
11817
  var PopoverContext = createContext13({});
11775
- var usePopoverContext = () => useContext19(PopoverContext);
11818
+ var usePopoverContext = () => useContext20(PopoverContext);
11776
11819
 
11777
11820
  // src/components/Popover/Popover.tsx
11778
11821
  import { jsx as jsx292, jsxs as jsxs72 } from "react/jsx-runtime";
@@ -11802,7 +11845,7 @@ var Popover = ({
11802
11845
  });
11803
11846
  const { maxHeight, maxWidth, minHeight, minWidth, height, width } = sizeProps;
11804
11847
  const context = usePopoverContext();
11805
- const themeContext = useContext20(ThemeContext);
11848
+ const themeContext = useContext21(ThemeContext);
11806
11849
  const portalTarget = parentElement != null ? parentElement : themeContext == null ? void 0 : themeContext.el;
11807
11850
  const {
11808
11851
  floatStyling: contextFloatStyling,
@@ -11852,7 +11895,7 @@ var Popover = ({
11852
11895
  anchorEl && anchorEl
11853
11896
  );
11854
11897
  const multiRef = useCombinedRef(ref, popoverRef, floatingRef);
11855
- useEffect27(() => {
11898
+ useEffect28(() => {
11856
11899
  setFloatOptions == null ? void 0 : setFloatOptions({ placement, offset });
11857
11900
  }, [placement, offset]);
11858
11901
  useOnClickOutside([popoverRef.current, anchorEl], () => {
@@ -11927,7 +11970,7 @@ import {
11927
11970
  isValidElement as isValidElement4,
11928
11971
  useId as useId24,
11929
11972
  useRef as useRef31,
11930
- useState as useState24
11973
+ useState as useState25
11931
11974
  } from "react";
11932
11975
  import { jsx as jsx293 } from "react/jsx-runtime";
11933
11976
  var PopoverGroup = ({
@@ -11940,12 +11983,12 @@ var PopoverGroup = ({
11940
11983
  popoverId
11941
11984
  }) => {
11942
11985
  var _a;
11943
- const [internalIsOpen, internalSetIsOpen] = useState24(isInitiallyOpen);
11986
+ const [internalIsOpen, internalSetIsOpen] = useState25(isInitiallyOpen);
11944
11987
  const open = propIsOpen != null ? propIsOpen : internalIsOpen;
11945
11988
  const setOpen = propSetIsOpen != null ? propSetIsOpen : internalSetIsOpen;
11946
11989
  const generatedId = useId24();
11947
11990
  const uniquePopoverId = popoverId != null ? popoverId : `${generatedId}-popover`;
11948
- const [floatOptions, setFloatOptions] = useState24();
11991
+ const [floatOptions, setFloatOptions] = useState25();
11949
11992
  const { refs, styles: positionStyles } = useFloatPosition(null, floatOptions);
11950
11993
  const handleClose = () => {
11951
11994
  setOpen(false);
@@ -12013,20 +12056,20 @@ import {
12013
12056
  Children as Children3,
12014
12057
  cloneElement as cloneElement5,
12015
12058
  isValidElement as isValidElement5,
12016
- useEffect as useEffect28,
12059
+ useEffect as useEffect29,
12017
12060
  useMemo as useMemo3,
12018
- useState as useState25
12061
+ useState as useState26
12019
12062
  } from "react";
12020
12063
 
12021
12064
  // src/components/ProgressTracker/ProgressTracker.context.tsx
12022
- import { createContext as createContext14, useContext as useContext21 } from "react";
12065
+ import { createContext as createContext14, useContext as useContext22 } from "react";
12023
12066
  var ProgressTrackerContext = createContext14(
12024
12067
  {
12025
12068
  activeStep: 0,
12026
12069
  direction: "column"
12027
12070
  }
12028
12071
  );
12029
- var useProgressTrackerContext = () => useContext21(ProgressTrackerContext);
12072
+ var useProgressTrackerContext = () => useContext22(ProgressTrackerContext);
12030
12073
 
12031
12074
  // src/components/ProgressTracker/ProgressTracker.module.css
12032
12075
  var ProgressTracker_default = {
@@ -12214,12 +12257,12 @@ var ProgressTracker = (() => {
12214
12257
  ...rest
12215
12258
  }) => {
12216
12259
  const { t } = useTranslation();
12217
- const [thisActiveStep, setActiveStep] = useState25(activeStep);
12260
+ const [thisActiveStep, setActiveStep] = useState26(activeStep);
12218
12261
  const handleChange = (step) => {
12219
12262
  setActiveStep(step);
12220
12263
  onStepChange == null ? void 0 : onStepChange(step);
12221
12264
  };
12222
- useEffect28(() => {
12265
+ useEffect29(() => {
12223
12266
  if (activeStep !== void 0 && activeStep != thisActiveStep) {
12224
12267
  setActiveStep(activeStep);
12225
12268
  }
@@ -12377,17 +12420,17 @@ ProgressBar.displayName = "ProgressBar";
12377
12420
  // src/components/Search/Search.tsx
12378
12421
  import {
12379
12422
  useId as useId26,
12380
- useState as useState26
12423
+ useState as useState27
12381
12424
  } from "react";
12382
12425
 
12383
12426
  // src/components/Search/AutocompleteSearch.context.tsx
12384
12427
  import {
12385
12428
  createContext as createContext15,
12386
- useContext as useContext22
12429
+ useContext as useContext23
12387
12430
  } from "react";
12388
12431
  var AutocompleteSearchContext = createContext15({});
12389
12432
  var useAutocompleteSearch = () => {
12390
- return useContext22(AutocompleteSearchContext);
12433
+ return useContext23(AutocompleteSearchContext);
12391
12434
  };
12392
12435
 
12393
12436
  // src/components/Search/Search.module.css
@@ -12407,7 +12450,7 @@ var typographyTypes2 = {
12407
12450
  };
12408
12451
 
12409
12452
  // src/components/Search/SearchSuggestionItem.tsx
12410
- import { useEffect as useEffect29, useRef as useRef32 } from "react";
12453
+ import { useEffect as useEffect30, useRef as useRef32 } from "react";
12411
12454
  import { jsx as jsx297 } from "react/jsx-runtime";
12412
12455
  var SearchSuggestionItem = ({
12413
12456
  focus,
@@ -12417,7 +12460,7 @@ var SearchSuggestionItem = ({
12417
12460
  }) => {
12418
12461
  const itemRef = useRef32(null);
12419
12462
  const combinedRef = useCombinedRef(ref, itemRef);
12420
- useEffect29(() => {
12463
+ useEffect30(() => {
12421
12464
  var _a;
12422
12465
  if (focus) {
12423
12466
  (_a = itemRef.current) == null ? void 0 : _a.focus();
@@ -12570,7 +12613,7 @@ var Search = ({
12570
12613
  "suggestions-description"
12571
12614
  );
12572
12615
  const { t } = useTranslation();
12573
- const [hasValue, setHasValue] = useState26(!!value);
12616
+ const [hasValue, setHasValue] = useState27(!!value);
12574
12617
  const context = useAutocompleteSearch();
12575
12618
  const combinedRef = context.inputRef ? useCombinedRef(context.inputRef, ref) : ref;
12576
12619
  const handleChange = (e) => {
@@ -12724,9 +12767,9 @@ var texts26 = createTexts({
12724
12767
 
12725
12768
  // src/components/Search/SearchAutocompleteWrapper.tsx
12726
12769
  import {
12727
- useEffect as useEffect30,
12770
+ useEffect as useEffect31,
12728
12771
  useRef as useRef33,
12729
- useState as useState27
12772
+ useState as useState28
12730
12773
  } from "react";
12731
12774
  import { jsx as jsx300 } from "react/jsx-runtime";
12732
12775
  var SearchAutocompleteWrapper = (props) => {
@@ -12739,12 +12782,12 @@ var SearchAutocompleteWrapper = (props) => {
12739
12782
  onSuggestionSelection,
12740
12783
  children
12741
12784
  } = props;
12742
- const [inputValue, setInputValue] = useState27(value != null ? value : "");
12743
- const [suggestions, setSuggestions] = useState27([]);
12744
- const [showSuggestions, setShowSuggestions] = useState27(false);
12785
+ const [inputValue, setInputValue] = useState28(value != null ? value : "");
12786
+ const [suggestions, setSuggestions] = useState28([]);
12787
+ const [showSuggestions, setShowSuggestions] = useState28(false);
12745
12788
  const closeSuggestions = () => showSuggestions === true && setShowSuggestions(false);
12746
12789
  const openSuggestions = () => showSuggestions === false && setShowSuggestions(true);
12747
- useEffect30(() => {
12790
+ useEffect31(() => {
12748
12791
  if (suggestions.length > 0) {
12749
12792
  openSuggestions();
12750
12793
  } else {
@@ -12872,7 +12915,7 @@ var SkipToContent = ({
12872
12915
  SkipToContent.displayName = "SkipToContent";
12873
12916
 
12874
12917
  // src/components/SplitButton/SplitButton.tsx
12875
- import { useState as useState28 } from "react";
12918
+ import { useState as useState29 } from "react";
12876
12919
 
12877
12920
  // src/components/SplitButton/SplitButton.module.css
12878
12921
  var SplitButton_default = {
@@ -12893,7 +12936,7 @@ var SplitButton = ({
12893
12936
  ...rest
12894
12937
  }) => {
12895
12938
  const { t } = useTranslation();
12896
- const [isOpen, setIsOpen] = useState28(false);
12939
+ const [isOpen, setIsOpen] = useState29(false);
12897
12940
  const buttonStyleProps = {
12898
12941
  purpose,
12899
12942
  size: size2
@@ -12944,17 +12987,17 @@ import {
12944
12987
  Fragment as Fragment12,
12945
12988
  cloneElement as cloneElement6,
12946
12989
  isValidElement as isValidElement6,
12947
- useEffect as useEffect32,
12948
- useState as useState30
12990
+ useEffect as useEffect33,
12991
+ useState as useState31
12949
12992
  } from "react";
12950
12993
 
12951
12994
  // src/components/Table/collapsible/Table.context.tsx
12952
- import { createContext as createContext16, useContext as useContext23 } from "react";
12995
+ import { createContext as createContext16, useContext as useContext24 } from "react";
12953
12996
  var CollapsibleTableContext = createContext16({
12954
12997
  headerValues: [],
12955
12998
  definingColumnIndex: [0]
12956
12999
  });
12957
- var useCollapsibleTableContext = () => useContext23(CollapsibleTableContext);
13000
+ var useCollapsibleTableContext = () => useContext24(CollapsibleTableContext);
12958
13001
 
12959
13002
  // src/components/Table/normal/Body.tsx
12960
13003
  import { jsx as jsx304 } from "react/jsx-runtime";
@@ -12962,12 +13005,12 @@ var Body = (props) => /* @__PURE__ */ jsx304("tbody", { ...props });
12962
13005
  Body.displayName = "Table.Body";
12963
13006
 
12964
13007
  // src/components/Table/normal/Head.tsx
12965
- import { createContext as createContext17, useContext as useContext24 } from "react";
13008
+ import { createContext as createContext17, useContext as useContext25 } from "react";
12966
13009
  import { jsx as jsx305 } from "react/jsx-runtime";
12967
13010
  var Head = ({ children, ...rest }) => /* @__PURE__ */ jsx305("thead", { ...rest, children: /* @__PURE__ */ jsx305(HeadContext, { value: true, children }) });
12968
13011
  var HeadContext = createContext17(false);
12969
13012
  function useIsInTableHead() {
12970
- const isInTableHead = useContext24(HeadContext);
13013
+ const isInTableHead = useContext25(HeadContext);
12971
13014
  return isInTableHead;
12972
13015
  }
12973
13016
 
@@ -13145,30 +13188,30 @@ Table.displayName = "Table";
13145
13188
 
13146
13189
  // src/components/Table/normal/TableWrapper.tsx
13147
13190
  import {
13148
- useContext as useContext25,
13149
- useEffect as useEffect31,
13191
+ useContext as useContext26,
13192
+ useEffect as useEffect32,
13150
13193
  useRef as useRef34,
13151
- useState as useState29
13194
+ useState as useState30
13152
13195
  } from "react";
13153
13196
  import { jsx as jsx311 } from "react/jsx-runtime";
13154
13197
  var TableWrapper = ({ className, ...rest }) => {
13155
- const themeContext = useContext25(ThemeContext);
13198
+ const themeContext = useContext26(ThemeContext);
13156
13199
  const container2 = themeContext == null ? void 0 : themeContext.el;
13157
13200
  const containerWidth = container2 ? container2.clientWidth : 0;
13158
- const [overflowX, setOverflowX] = useState29(false);
13159
- const [themeContainerWidth, setThemeContainerWidth] = useState29(containerWidth);
13201
+ const [overflowX, setOverflowX] = useState30(false);
13202
+ const [themeContainerWidth, setThemeContainerWidth] = useState30(containerWidth);
13160
13203
  function isOverflowingX(event) {
13161
13204
  return event.offsetWidth < event.scrollWidth;
13162
13205
  }
13163
13206
  const wrapperRef = useRef34(null);
13164
- useEffect31(() => {
13207
+ useEffect32(() => {
13165
13208
  if ((wrapperRef == null ? void 0 : wrapperRef.current) && isOverflowingX(wrapperRef.current)) {
13166
13209
  setOverflowX(true);
13167
13210
  return;
13168
13211
  }
13169
13212
  setOverflowX(false);
13170
13213
  }, [themeContainerWidth]);
13171
- useEffect31(() => {
13214
+ useEffect32(() => {
13172
13215
  function handleResize() {
13173
13216
  setThemeContainerWidth(containerWidth);
13174
13217
  }
@@ -13217,8 +13260,8 @@ var CollapsibleRow = ({
13217
13260
  const isInHead = useIsInTableHead();
13218
13261
  const type = _type != null ? _type : isInHead ? "head" : "body";
13219
13262
  const { isCollapsed, headerValues, definingColumnIndex } = useCollapsibleTableContext();
13220
- const [childrenCollapsed, setChildrenCollapsed] = useState30(true);
13221
- useEffect32(() => {
13263
+ const [childrenCollapsed, setChildrenCollapsed] = useState31(true);
13264
+ useEffect33(() => {
13222
13265
  if (!isCollapsed) setChildrenCollapsed(true);
13223
13266
  }, [isCollapsed]);
13224
13267
  const rowProps = (isOpenCollapsibleHeader) => {
@@ -13346,7 +13389,7 @@ CollapsibleTable2.Row = CollapsibleRow;
13346
13389
  import { useRef as useRef35 } from "react";
13347
13390
 
13348
13391
  // src/components/Tabs/Tabs.context.tsx
13349
- import { createContext as createContext18, useContext as useContext26 } from "react";
13392
+ import { createContext as createContext18, useContext as useContext27 } from "react";
13350
13393
  var TabsContext = createContext18({
13351
13394
  activeTab: 0,
13352
13395
  tabsId: "",
@@ -13359,7 +13402,7 @@ var TabsContext = createContext18({
13359
13402
  tabContentDirection: "row",
13360
13403
  addTabButtonProps: void 0
13361
13404
  });
13362
- var useTabsContext = () => useContext26(TabsContext);
13405
+ var useTabsContext = () => useContext27(TabsContext);
13363
13406
 
13364
13407
  // src/components/Tabs/Tabs.module.css
13365
13408
  var Tabs_default = {
@@ -13379,7 +13422,7 @@ var Tabs_default = {
13379
13422
  // src/components/Tabs/TabWidthContext.tsx
13380
13423
  import {
13381
13424
  createContext as createContext19,
13382
- useContext as useContext27,
13425
+ useContext as useContext28,
13383
13426
  useLayoutEffect as useLayoutEffect3
13384
13427
  } from "react";
13385
13428
  import { jsx as jsx314 } from "react/jsx-runtime";
@@ -13412,7 +13455,7 @@ function TabWidthContextProvider({
13412
13455
  );
13413
13456
  }
13414
13457
  function useSetTabWidth(index, width) {
13415
- const context = useContext27(TabContext);
13458
+ const context = useContext28(TabContext);
13416
13459
  useLayoutEffect3(() => {
13417
13460
  context == null ? void 0 : context.updateWidth(index, width);
13418
13461
  return () => context == null ? void 0 : context.removeTab(index);
@@ -13455,7 +13498,7 @@ var AddTabButton = ({
13455
13498
  AddTabButton.displayName = "AddTabButton";
13456
13499
 
13457
13500
  // src/components/Tabs/Tabs.tsx
13458
- import { useEffect as useEffect33, useId as useId27, useRef as useRef36, useState as useState31 } from "react";
13501
+ import { useEffect as useEffect34, useId as useId27, useRef as useRef36, useState as useState32 } from "react";
13459
13502
  import { jsx as jsx316 } from "react/jsx-runtime";
13460
13503
  var TABS_SIZES = createSizes("small", "medium");
13461
13504
  var Tabs = ({
@@ -13473,15 +13516,15 @@ var Tabs = ({
13473
13516
  }) => {
13474
13517
  const generatedId = useId27();
13475
13518
  const uniqueId = id != null ? id : `${generatedId}-tabs`;
13476
- const [thisActiveTab, setActiveTab] = useState31(activeTab != null ? activeTab : 0);
13477
- const [hasTabFocus, setHasTabFocus] = useState31(false);
13519
+ const [thisActiveTab, setActiveTab] = useState32(activeTab != null ? activeTab : 0);
13520
+ const [hasTabFocus, setHasTabFocus] = useState32(false);
13478
13521
  const tabListRef = useRef36(null);
13479
13522
  const tabPanelsRef = useRef36(null);
13480
13523
  const handleTabChange = (index) => {
13481
13524
  setActiveTab(index);
13482
13525
  onChange == null ? void 0 : onChange(index);
13483
13526
  };
13484
- useEffect33(() => {
13527
+ useEffect34(() => {
13485
13528
  if (activeTab !== void 0 && activeTab !== thisActiveTab) {
13486
13529
  setActiveTab(activeTab);
13487
13530
  }
@@ -13517,7 +13560,7 @@ Tabs.displayName = "Tabs";
13517
13560
  // src/components/Tabs/Tab.tsx
13518
13561
  import {
13519
13562
  useCallback as useCallback8,
13520
- useEffect as useEffect34,
13563
+ useEffect as useEffect35,
13521
13564
  useRef as useRef37
13522
13565
  } from "react";
13523
13566
  import { jsx as jsx317, jsxs as jsxs81 } from "react/jsx-runtime";
@@ -13543,7 +13586,7 @@ var Tab = ({
13543
13586
  const { tabContentDirection, size: size2 } = useTabsContext();
13544
13587
  const { type = "button", ...restHtmlProps } = htmlProps;
13545
13588
  const fixedHtmlProps = { type, ...restHtmlProps };
13546
- useEffect34(() => {
13589
+ useEffect35(() => {
13547
13590
  var _a;
13548
13591
  if (focus) {
13549
13592
  (_a = itemRef.current) == null ? void 0 : _a.focus();
@@ -13599,7 +13642,7 @@ import {
13599
13642
  Children as Children5,
13600
13643
  cloneElement as cloneElement7,
13601
13644
  isValidElement as isValidElement7,
13602
- useState as useState32
13645
+ useState as useState33
13603
13646
  } from "react";
13604
13647
  import { jsx as jsx318, jsxs as jsxs82 } from "react/jsx-runtime";
13605
13648
  var TabList = ({
@@ -13641,7 +13684,7 @@ var TabList = ({
13641
13684
  onClick: combineHandlers(handleThisTabChange, child.props.onClick)
13642
13685
  });
13643
13686
  }) : [];
13644
- const [widths, setWidths] = useState32([]);
13687
+ const [widths, setWidths] = useState33([]);
13645
13688
  const handleOnFocus = (event) => {
13646
13689
  setHasTabFocus(true);
13647
13690
  onFocus == null ? void 0 : onFocus(event);
@@ -13802,7 +13845,7 @@ var Tag = ({
13802
13845
  Tag.displayName = "Tag";
13803
13846
 
13804
13847
  // src/components/TextInput/TextInput.tsx
13805
- import { useId as useId28, useLayoutEffect as useLayoutEffect4, useRef as useRef38, useState as useState33 } from "react";
13848
+ import { useId as useId28, useLayoutEffect as useLayoutEffect4, useRef as useRef38, useState as useState34 } from "react";
13806
13849
 
13807
13850
  // src/components/TextInput/TextInput.module.css
13808
13851
  var TextInput_default = {
@@ -13848,11 +13891,11 @@ var TextInput = ({
13848
13891
  ref,
13849
13892
  ...rest
13850
13893
  }) => {
13851
- const [text, setText] = useState33(getDefaultText(value, defaultValue));
13894
+ const [text, setText] = useState34(getDefaultText(value, defaultValue));
13852
13895
  const prefixRef = useRef38(null);
13853
13896
  const suffixRef = useRef38(null);
13854
- const [prefixLength, setPrefixLength] = useState33(0);
13855
- const [suffixLength, setSuffixLength] = useState33(0);
13897
+ const [prefixLength, setPrefixLength] = useState34(0);
13898
+ const [suffixLength, setSuffixLength] = useState34(0);
13856
13899
  useLayoutEffect4(() => {
13857
13900
  requestAnimationFrame(() => {
13858
13901
  if (prefixRef.current) {
@@ -14139,14 +14182,14 @@ var Toggle = ({
14139
14182
  Toggle.displayName = "Toggle";
14140
14183
 
14141
14184
  // src/components/ToggleBar/ToggleBar.tsx
14142
- import { useId as useId30, useState as useState34 } from "react";
14185
+ import { useId as useId30, useState as useState35 } from "react";
14143
14186
 
14144
14187
  // src/components/ToggleBar/ToggleBar.context.tsx
14145
- import { createContext as createContext20, useContext as useContext28 } from "react";
14188
+ import { createContext as createContext20, useContext as useContext29 } from "react";
14146
14189
  var ToggleBarContext = createContext20({
14147
14190
  size: "medium"
14148
14191
  });
14149
- var useToggleBarContext = () => useContext28(ToggleBarContext);
14192
+ var useToggleBarContext = () => useContext29(ToggleBarContext);
14150
14193
 
14151
14194
  // src/components/ToggleBar/ToggleBar.module.css
14152
14195
  var ToggleBar_default = {
@@ -14181,7 +14224,7 @@ var ToggleBar = (props) => {
14181
14224
  } = props;
14182
14225
  const generatedId = useId30();
14183
14226
  const uniqueId = id != null ? id : `${generatedId}-ToggleBar`;
14184
- const [groupValue, setGroupValue] = useState34(value);
14227
+ const [groupValue, setGroupValue] = useState35(value);
14185
14228
  const handleChange = combineHandlers(
14186
14229
  (e) => setGroupValue(e.target.value),
14187
14230
  (e) => onChange && onChange(e, e.target.value)