@norges-domstoler/dds-components 23.1.3 → 23.2.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
@@ -368,7 +368,6 @@ __export(index_exports, {
368
368
  ZoomOutIcon: () => ZoomOutIcon,
369
369
  calendarDateToNativeDate: () => calendarDateToNativeDate,
370
370
  cn: () => cn,
371
- countryOptions: () => countryOptions,
372
371
  createPurposes: () => createPurposes,
373
372
  createSelectOptions: () => createSelectOptions,
374
373
  createSizes: () => createSizes,
@@ -379,7 +378,6 @@ __export(index_exports, {
379
378
  getBaseHTMLProps: () => getBaseHTMLProps,
380
379
  getColorCn: () => getColorCn,
381
380
  getElementType: () => getElementType,
382
- getLiteralScreenSize: () => getLiteralScreenSize,
383
381
  getTypographyCn: () => getTypographyCn,
384
382
  handleElementWithBackdropMount: () => handleElementWithBackdropMount,
385
383
  handleElementWithBackdropUnmount: () => handleElementWithBackdropUnmount,
@@ -1034,7 +1032,7 @@ function useReturnFocusOnBlur(active, onBlur, triggerElement) {
1034
1032
  const focusableElements = getFocusableElements(elementRef);
1035
1033
  const lastElement = focusableElements[focusableElements.length - 1];
1036
1034
  const firstElement = focusableElements[0];
1037
- if (!e.shiftKey && document.activeElement === lastElement || e.shiftKey && document.activeElement === firstElement || e.shiftKey && document.activeElement === element) {
1035
+ if (!e.shiftKey && document.activeElement === lastElement || e.shiftKey && document.activeElement === firstElement || e.shiftKey && document.activeElement === elementRef.current) {
1038
1036
  triggerElement.focus();
1039
1037
  e.preventDefault();
1040
1038
  onBlur();
@@ -1048,7 +1046,7 @@ function useReturnFocusOnBlur(active, onBlur, triggerElement) {
1048
1046
  return () => {
1049
1047
  element == null ? void 0 : element.removeEventListener("keydown", handleFocus);
1050
1048
  };
1051
- }, [active]);
1049
+ }, [active, triggerElement, onBlur]);
1052
1050
  return elementRef;
1053
1051
  }
1054
1052
 
@@ -1435,9 +1433,7 @@ function Icon(props) {
1435
1433
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1436
1434
  C,
1437
1435
  {
1438
- ...getBaseHTMLProps(id, className, style, htmlProps, {
1439
- ...rest
1440
- }),
1436
+ ...getBaseHTMLProps(id, className, style, htmlProps, rest),
1441
1437
  height: size2,
1442
1438
  width: size2,
1443
1439
  fill: color,
@@ -1541,19 +1537,30 @@ var getValue = (v, bp, invert) => {
1541
1537
  };
1542
1538
  var convertMultiValue = (value, bp, invert) => value.split(" ").map((v) => getValue(v, bp, invert)).join(" ");
1543
1539
  var invertValue = (v) => v === "0" ? "0" : `calc(-1 * ${v})`;
1540
+ var buildCSSKey = (prefix2, suffix, bp) => {
1541
+ let key = `--${TOKEN_PREFIX}`;
1542
+ if (prefix2) key += `-${prefix2}`;
1543
+ if (bp) key += `-${bp}`;
1544
+ if (suffix) key += `-${suffix}`;
1545
+ return key;
1546
+ };
1547
+ function getCSSProperties(property, prefix2, suffix, invert) {
1548
+ if (property === void 0 || property === null) return;
1549
+ const properties = {};
1550
+ properties[buildCSSKey(prefix2, suffix)] = convertMultiValue(property.toString(), void 0, invert);
1551
+ return properties;
1552
+ }
1544
1553
  function getResponsiveCSSProperties(property, prefix2, suffix, invert) {
1545
1554
  if (!property) return;
1546
1555
  const properties = {};
1547
- const pPrefix = `--${TOKEN_PREFIX}-${prefix2}`;
1548
- const pSuffix = suffix ? `-${suffix}` : "";
1549
1556
  if (isBreakpointObject(property)) {
1550
1557
  BREAKPOINTS.forEach((bp) => {
1551
1558
  if (property[bp]) {
1552
- properties[`${pPrefix}-${bp}${pSuffix}`] = convertMultiValue(property[bp].toString(), bp, invert);
1559
+ properties[buildCSSKey(prefix2, suffix, bp)] = convertMultiValue(property[bp].toString(), bp, invert);
1553
1560
  }
1554
1561
  });
1555
1562
  } else {
1556
- properties[`${pPrefix}${pSuffix}`] = convertMultiValue(property.toString(), void 0, invert);
1563
+ properties[buildCSSKey(prefix2, suffix)] = convertMultiValue(property.toString(), void 0, invert);
1557
1564
  }
1558
1565
  return properties;
1559
1566
  }
@@ -1829,9 +1836,17 @@ Contrast.displayName = "Contrast";
1829
1836
 
1830
1837
  // src/components/layout/Grid/Grid.module.css
1831
1838
  var Grid_default = {
1839
+ "dds-grid": "Grid_dds-grid",
1832
1840
  "dds-grid-template-columns": "Grid_dds-grid-template-columns",
1841
+ "dds-grid-auto-flow": "Grid_dds-grid-auto-flow",
1842
+ "dds-grid-auto-columns": "Grid_dds-grid-auto-columns",
1843
+ "dds-grid-auto-rows": "Grid_dds-grid-auto-rows",
1844
+ "dds-grid-template": "Grid_dds-grid-template",
1845
+ "dds-grid-template-rows": "Grid_dds-grid-template-rows",
1846
+ "dds-grid-template-areas": "Grid_dds-grid-template-areas",
1833
1847
  "dds-grid-column": "Grid_dds-grid-column",
1834
1848
  "dds-grid-row": "Grid_dds-grid-row",
1849
+ "dds-grid-area": "Grid_dds-grid-area",
1835
1850
  "dds-j-self": "Grid_dds-j-self",
1836
1851
  "child--first-half": "Grid_child--first-half",
1837
1852
  "child--second-half": "Grid_child--second-half",
@@ -1840,56 +1855,90 @@ var Grid_default = {
1840
1855
 
1841
1856
  // src/components/layout/Grid/Grid.tsx
1842
1857
  var import_jsx_runtime10 = require("react/jsx-runtime");
1843
- var Grid = ({
1844
- id,
1845
- className,
1846
- htmlProps,
1847
- gridTemplateColumns = {
1858
+ var DEFAULT_PAGE_LAYOUT = {
1859
+ gridTemplateColumns: {
1848
1860
  xs: "repeat(var(--dds-grid-xs-count), minmax(0, 1fr))",
1849
1861
  sm: "repeat(var(--dds-grid-sm-count), minmax(0, 1fr))",
1850
1862
  md: "repeat(var(--dds-grid-md-count), minmax(0, 1fr))",
1851
1863
  lg: "repeat(var(--dds-grid-lg-count), minmax(0, 1fr))",
1852
1864
  xl: "repeat(var(--dds-grid-xl-count), minmax(0, 1fr))"
1853
1865
  },
1854
- columnGap = {
1866
+ gutterSize: {
1855
1867
  xs: "var(--dds-grid-xs-gutter-size)",
1856
1868
  sm: "var(--dds-grid-sm-gutter-size)",
1857
1869
  md: "var(--dds-grid-md-gutter-size)",
1858
1870
  lg: "var(--dds-grid-lg-gutter-size)",
1859
1871
  xl: "var(--dds-grid-xl-gutter-size)"
1860
1872
  },
1861
- rowGap = {
1862
- xs: "var(--dds-grid-xs-gutter-size)",
1863
- sm: "var(--dds-grid-sm-gutter-size)",
1864
- md: "var(--dds-grid-md-gutter-size)",
1865
- lg: "var(--dds-grid-lg-gutter-size)",
1866
- xl: "var(--dds-grid-xl-gutter-size)"
1867
- },
1868
- marginInline = { xs: "x2", sm: "x2", md: "x4", lg: "x6", xl: "x10" },
1873
+ marginInline: { xs: "x2", sm: "x2", md: "x4", lg: "x6", xl: "x10" }
1874
+ };
1875
+ var Grid = ({
1876
+ id,
1877
+ className,
1878
+ htmlProps,
1879
+ defaultPageLayout = true,
1880
+ display = "grid",
1881
+ grid,
1882
+ gridAutoColumns,
1883
+ gridAutoFlow,
1884
+ gridAutoRows,
1885
+ gridTemplate,
1886
+ gridTemplateAreas,
1887
+ gridTemplateRows,
1888
+ gridTemplateColumns,
1889
+ columnGap,
1890
+ rowGap,
1891
+ marginInline,
1869
1892
  style,
1870
1893
  ...rest
1871
1894
  }) => {
1895
+ const pageDefaults = defaultPageLayout ? DEFAULT_PAGE_LAYOUT : null;
1896
+ const resolvedGridTemplateColumns = gridTemplateColumns != null ? gridTemplateColumns : pageDefaults == null ? void 0 : pageDefaults.gridTemplateColumns;
1897
+ const resolvedColumnGap = columnGap != null ? columnGap : pageDefaults == null ? void 0 : pageDefaults.gutterSize;
1898
+ const resolvedRowGap = rowGap != null ? rowGap : pageDefaults == null ? void 0 : pageDefaults.gutterSize;
1899
+ const resolvedMarginInline = marginInline != null ? marginInline : pageDefaults == null ? void 0 : pageDefaults.marginInline;
1872
1900
  const styleVariables = {
1873
1901
  ...getResponsiveCSSProperties(
1874
- gridTemplateColumns,
1902
+ resolvedGridTemplateColumns,
1875
1903
  "r",
1876
1904
  "grid-template-columns"
1905
+ ),
1906
+ ...getResponsiveCSSProperties(grid, "r", "grid"),
1907
+ ...getResponsiveCSSProperties(gridAutoColumns, "r", "grid-auto-columns"),
1908
+ ...getResponsiveCSSProperties(gridAutoFlow, "r", "grid-auto-flow"),
1909
+ ...getResponsiveCSSProperties(gridAutoRows, "r", "grid-auto-rows"),
1910
+ ...getResponsiveCSSProperties(gridTemplate, "r", "grid-template"),
1911
+ ...getResponsiveCSSProperties(gridTemplateRows, "r", "grid-template-rows"),
1912
+ ...getResponsiveCSSProperties(
1913
+ gridTemplateAreas,
1914
+ "r",
1915
+ "grid-template-areas"
1877
1916
  )
1878
1917
  };
1879
1918
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1880
1919
  Box,
1881
1920
  {
1882
- display: "grid",
1883
1921
  ...getBaseHTMLProps(
1884
1922
  id,
1885
- cn(className, Grid_default["dds-grid-template-columns"]),
1923
+ cn(
1924
+ className,
1925
+ resolvedGridTemplateColumns && Grid_default["dds-grid-template-columns"],
1926
+ grid && Grid_default["dds-grid"],
1927
+ gridAutoColumns && Grid_default["dds-grid-auto-columns"],
1928
+ gridAutoFlow && Grid_default["dds-grid-auto-flow"],
1929
+ gridAutoRows && Grid_default["dds-grid-auto-rows"],
1930
+ gridTemplate && Grid_default["dds-grid-template"],
1931
+ gridTemplateRows && Grid_default["dds-grid-template-rows"],
1932
+ gridTemplateAreas && Grid_default["dds-grid-template-areas"]
1933
+ ),
1886
1934
  { ...style, ...styleVariables },
1887
1935
  htmlProps,
1888
1936
  rest
1889
1937
  ),
1890
- marginInline,
1891
- columnGap,
1892
- rowGap
1938
+ display,
1939
+ marginInline: resolvedMarginInline,
1940
+ columnGap: resolvedColumnGap,
1941
+ rowGap: resolvedRowGap
1893
1942
  }
1894
1943
  );
1895
1944
  };
@@ -1903,12 +1952,14 @@ var GridChild = ({
1903
1952
  htmlProps,
1904
1953
  style,
1905
1954
  gridRow,
1955
+ gridArea,
1906
1956
  justifySelf,
1907
1957
  columnsOccupied,
1908
1958
  ...rest
1909
1959
  }) => {
1910
1960
  const styleVariables = {
1911
1961
  ...getResponsiveCSSProperties(gridRow, "r", "grid-row"),
1962
+ ...getResponsiveCSSProperties(gridArea, "r", "grid-area"),
1912
1963
  ...getResponsiveCSSProperties(justifySelf, "r", "j-self"),
1913
1964
  ...getResponsiveCSSProperties(columnsOccupied, "r", "grid-column")
1914
1965
  };
@@ -1921,6 +1972,7 @@ var GridChild = ({
1921
1972
  className,
1922
1973
  Grid_default["child-col-count"],
1923
1974
  gridRow && Grid_default["dds-grid-row"],
1975
+ gridArea && Grid_default["dds-grid-area"],
1924
1976
  justifySelf && Grid_default["dds-j-self"],
1925
1977
  columnsOccupied && Grid_default["dds-grid-column"],
1926
1978
  columnsOccupied === "firstHalf" && Grid_default["child--first-half"],
@@ -1965,8 +2017,8 @@ var Paper = ({
1965
2017
  ...rest
1966
2018
  }) => {
1967
2019
  const styleVariables = {
1968
- ...getResponsiveCSSProperties(background, "paper-background"),
1969
- ...getResponsiveCSSProperties(border, "paper-border")
2020
+ ...getCSSProperties(background, "paper", "background"),
2021
+ ...getCSSProperties(border, "paper", "border")
1970
2022
  };
1971
2023
  return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1972
2024
  Box,
@@ -2154,12 +2206,6 @@ function Spinner(props) {
2154
2206
  ...rest
2155
2207
  } = props;
2156
2208
  const { t } = useTranslation();
2157
- const mountTime = (0, import_react17.useRef)(Date.now());
2158
- const animationDelay = -(mountTime.current % 1500);
2159
- const styleVariables = {
2160
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2161
- ["--dds-spinner-animation-delay"]: animationDelay
2162
- };
2163
2209
  const generatedId = (0, import_react17.useId)();
2164
2210
  const uniqueId = `${generatedId}-spinnerTitle`;
2165
2211
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
@@ -2188,8 +2234,7 @@ function Spinner(props) {
2188
2234
  cy: "12.25",
2189
2235
  r: "6",
2190
2236
  fill: getTextColor(color),
2191
- className: Spinner_default.jordskifterett,
2192
- style: styleVariables
2237
+ className: Spinner_default.jordskifterett
2193
2238
  }
2194
2239
  ),
2195
2240
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
@@ -2200,8 +2245,7 @@ function Spinner(props) {
2200
2245
  width: "16",
2201
2246
  height: "4",
2202
2247
  fill: getTextColor(color),
2203
- className: Spinner_default.lagmannsrett,
2204
- style: styleVariables
2248
+ className: Spinner_default.lagmannsrett
2205
2249
  }
2206
2250
  ),
2207
2251
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
@@ -2209,8 +2253,7 @@ function Spinner(props) {
2209
2253
  {
2210
2254
  d: "M12 16.6154C16.4183 16.6154 20 12.7581 20 8H4C4 12.7581 7.58172 16.6154 12 16.6154Z",
2211
2255
  fill: getTextColor(color),
2212
- className: Spinner_default.tingrett,
2213
- style: styleVariables
2256
+ className: Spinner_default.tingrett
2214
2257
  }
2215
2258
  )
2216
2259
  ]
@@ -2309,22 +2352,6 @@ var HiddenInput = ({
2309
2352
  ...rest
2310
2353
  }) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("input", { className: cn(className, utilStyles_default["hide-input"]), ...rest });
2311
2354
 
2312
- // src/components/helpers/ScreenSize/ScreenSize.utils.tsx
2313
- var getLiteralScreenSize = (screenSize) => {
2314
- switch (screenSize) {
2315
- case 4 /* XLarge */:
2316
- return "xl";
2317
- case 3 /* Large */:
2318
- return "lg";
2319
- case 2 /* Medium */:
2320
- return "md";
2321
- case 1 /* Small */:
2322
- return "sm";
2323
- case 0 /* XSmall */:
2324
- return "xs";
2325
- }
2326
- };
2327
-
2328
2355
  // src/components/helpers/StylelessButton/StylelessButton.tsx
2329
2356
  var import_jsx_runtime20 = require("react/jsx-runtime");
2330
2357
  var StylelessButton = ({
@@ -2591,6 +2618,7 @@ function SvgWrapper({
2591
2618
  // destructure for å unngå at `iconState` blir sendt videre til svg-elementet som ugyldig custom attribute.
2592
2619
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
2593
2620
  iconState: _iconState,
2621
+ style,
2594
2622
  ...props
2595
2623
  }) {
2596
2624
  return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
@@ -2602,6 +2630,7 @@ function SvgWrapper({
2602
2630
  viewBox: `0 0 ${size} ${size}`,
2603
2631
  className: cn(className, Icon_default.svg),
2604
2632
  style: {
2633
+ ...style,
2605
2634
  height: height ? height : sizeCSS,
2606
2635
  width: width ? width : sizeCSS
2607
2636
  },
@@ -4157,8 +4186,7 @@ function DdsProvider({ language, theme, children }) {
4157
4186
  var Accordion_default = {
4158
4187
  container: "Accordion_container",
4159
4188
  "header-button": "Accordion_header-button",
4160
- chevron: "Accordion_chevron",
4161
- body: "Accordion_body"
4189
+ chevron: "Accordion_chevron"
4162
4190
  };
4163
4191
 
4164
4192
  // src/components/Accordion/Accordion.tsx
@@ -6962,7 +6990,7 @@ var CalendarPopoverContent = ({
6962
6990
  });
6963
6991
  const themeContext = (0, import_react41.useContext)(ThemeContext);
6964
6992
  if (!themeContext) {
6965
- throw new Error("DatePicker must be used within a ThemeProvider");
6993
+ throw new Error("DatePicker must be used within a DdsProvider");
6966
6994
  }
6967
6995
  const portalTarget = themeContext.el;
6968
6996
  const { t } = useTranslation();
@@ -8331,7 +8359,7 @@ var Drawer = ({
8331
8359
  }) => {
8332
8360
  const themeContext = (0, import_react53.useContext)(ThemeContext);
8333
8361
  if (!themeContext) {
8334
- throw new Error("Drawer must be used within a ThemeProvider");
8362
+ throw new Error("Drawer must be used within a DdsProvider");
8335
8363
  }
8336
8364
  const { t } = useTranslation();
8337
8365
  const portalTarget = parentElement != null ? parentElement : themeContext == null ? void 0 : themeContext.el;
@@ -9545,6 +9573,45 @@ var texts16 = createTexts({
9545
9573
  var import_file_selector = require("file-selector");
9546
9574
  var import_react61 = require("react");
9547
9575
 
9576
+ // src/components/FileUploader/attr-accept.ts
9577
+ function isAccepted(file, acceptedFiles) {
9578
+ if (file && acceptedFiles) {
9579
+ const acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(",");
9580
+ const fileName = file.name || "";
9581
+ const mimeType = (file.type || "").toLowerCase();
9582
+ const baseMimeType = mimeType.split("/")[0] || "";
9583
+ return acceptedFilesArray.some((type) => {
9584
+ const validType = type.trim().toLowerCase();
9585
+ if (validType.charAt(0) === ".") {
9586
+ return fileName.toLowerCase().endsWith(validType);
9587
+ } else if (validType.endsWith("/*")) {
9588
+ return baseMimeType === validType.slice(0, -2);
9589
+ }
9590
+ return mimeType === validType;
9591
+ });
9592
+ }
9593
+ return true;
9594
+ }
9595
+
9596
+ // src/components/FileUploader/FileUploader.utils.ts
9597
+ var preventDefaults = (event) => {
9598
+ event.preventDefault();
9599
+ event.stopPropagation();
9600
+ };
9601
+ var isDragEvent = (event) => {
9602
+ const asDragEvent = event;
9603
+ return asDragEvent.dataTransfer !== void 0;
9604
+ };
9605
+ var isEventWithFiles = (event) => {
9606
+ if (!isDragEvent(event)) {
9607
+ return event.target.files !== null && event.target.files !== void 0;
9608
+ }
9609
+ return event.dataTransfer.types.includes("Files") || event.dataTransfer.types.includes("application/x-moz-file");
9610
+ };
9611
+ var isFileAccepted = (file, accept) => {
9612
+ return accept !== void 0 ? isAccepted(file, accept) : true;
9613
+ };
9614
+
9548
9615
  // src/components/FileUploader/fileUploaderReducer.ts
9549
9616
  var fileUploaderReducer = (state, action) => {
9550
9617
  switch (action.type) {
@@ -9588,45 +9655,6 @@ var fileUploaderReducer = (state, action) => {
9588
9655
  }
9589
9656
  };
9590
9657
 
9591
- // src/components/FileUploader/attr-accept.ts
9592
- function isAccepted(file, acceptedFiles) {
9593
- if (file && acceptedFiles) {
9594
- const acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(",");
9595
- const fileName = file.name || "";
9596
- const mimeType = (file.type || "").toLowerCase();
9597
- const baseMimeType = mimeType.split("/")[0] || "";
9598
- return acceptedFilesArray.some((type) => {
9599
- const validType = type.trim().toLowerCase();
9600
- if (validType.charAt(0) === ".") {
9601
- return fileName.toLowerCase().endsWith(validType);
9602
- } else if (validType.endsWith("/*")) {
9603
- return baseMimeType === validType.slice(0, -2);
9604
- }
9605
- return mimeType === validType;
9606
- });
9607
- }
9608
- return true;
9609
- }
9610
-
9611
- // src/components/FileUploader/utils.ts
9612
- var preventDefaults = (event) => {
9613
- event.preventDefault();
9614
- event.stopPropagation();
9615
- };
9616
- var isDragEvent = (event) => {
9617
- const asDragEvent = event;
9618
- return asDragEvent.dataTransfer !== void 0;
9619
- };
9620
- var isEventWithFiles = (event) => {
9621
- if (!isDragEvent(event)) {
9622
- return event.target.files !== null && event.target.files !== void 0;
9623
- }
9624
- return event.dataTransfer.types.includes("Files") || event.dataTransfer.types.includes("application/x-moz-file");
9625
- };
9626
- var isFileAccepted = (file, accept) => {
9627
- return accept !== void 0 ? isAccepted(file, accept) : true;
9628
- };
9629
-
9630
9658
  // src/components/FileUploader/useFileUploader.ts
9631
9659
  var calcRootErrors = (maxFilesErrorMessage, files, maxFiles, errorMessage) => {
9632
9660
  const errors = [];
@@ -10963,18 +10991,10 @@ var import_react71 = require("react");
10963
10991
  var LocalMessage_default = {
10964
10992
  container: "LocalMessage_container",
10965
10993
  "container--info": "LocalMessage_container--info",
10966
- icon: "LocalMessage_icon",
10967
10994
  "container--warning": "LocalMessage_container--warning",
10968
10995
  "container--danger": "LocalMessage_container--danger",
10969
10996
  "container--success": "LocalMessage_container--success",
10970
- "container--tips": "LocalMessage_container--tips",
10971
- "container--horisontal": "LocalMessage_container--horisontal",
10972
- "container--horisontal--closable": "LocalMessage_container--horisontal--closable",
10973
- "container--vertical": "LocalMessage_container--vertical",
10974
- "container--vertical--closable": "LocalMessage_container--vertical--closable",
10975
- container__text: "LocalMessage_container__text",
10976
- container__icon: "LocalMessage_container__icon",
10977
- container__button: "LocalMessage_container__button"
10997
+ "container--tips": "LocalMessage_container--tips"
10978
10998
  };
10979
10999
 
10980
11000
  // src/components/LocalMessage/LocalMessage.tsx
@@ -11007,12 +11027,28 @@ var LocalMessage = ({
11007
11027
  ...rest
11008
11028
  }) => {
11009
11029
  const { t } = useTranslation();
11010
- const [isClosed, setClosed] = (0, import_react71.useState)(false);
11011
- if (isClosed) {
11012
- return /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(import_jsx_runtime303.Fragment, {});
11013
- }
11014
- return /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)(
11015
- Box,
11030
+ const [isOpen, setOpen] = (0, import_react71.useState)(true);
11031
+ const gridLayout = closable ? `${layout}-closable` : layout;
11032
+ const containerGridTemplateStyles = {
11033
+ horisontal: {
11034
+ gridTemplateAreas: `"icon text"`,
11035
+ gridTemplateColumns: "min-content 1fr"
11036
+ },
11037
+ "horisontal-closable": {
11038
+ gridTemplateAreas: `"icon text close-btn"`,
11039
+ gridTemplateColumns: "min-content 1fr min-content"
11040
+ },
11041
+ vertical: {
11042
+ gridTemplateAreas: `"icon" "text"`,
11043
+ gridTemplateColumns: "1fr"
11044
+ },
11045
+ "vertical-closable": {
11046
+ gridTemplateAreas: `"icon close-btn" "text text"`,
11047
+ gridTemplateColumns: "1fr min-content"
11048
+ }
11049
+ };
11050
+ return isOpen ? /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)(
11051
+ Grid,
11016
11052
  {
11017
11053
  ...getBaseHTMLProps(
11018
11054
  id,
@@ -11020,8 +11056,6 @@ var LocalMessage = ({
11020
11056
  className,
11021
11057
  typographyStyles_default["body-short-medium"],
11022
11058
  LocalMessage_default.container,
11023
- LocalMessage_default[`container--${layout}`],
11024
- closable && LocalMessage_default[`container--${layout}--closable`],
11025
11059
  LocalMessage_default[`container--${purpose}`]
11026
11060
  ),
11027
11061
  style,
@@ -11029,36 +11063,41 @@ var LocalMessage = ({
11029
11063
  rest
11030
11064
  ),
11031
11065
  width,
11032
- display: "grid",
11033
11066
  padding: "x0.75 x0.75 x0.75 x0.5",
11034
- gap: "x0.5",
11067
+ rowGap: "x0.5",
11068
+ columnGap: "x0.5",
11069
+ marginInline: "x0",
11070
+ ...containerGridTemplateStyles[gridLayout],
11035
11071
  children: [
11036
11072
  /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
11037
- Icon,
11073
+ GridChild,
11038
11074
  {
11075
+ as: Icon,
11076
+ gridArea: "icon",
11039
11077
  iconSize: "component",
11040
11078
  icon: icons2[purpose],
11041
- className: cn(LocalMessage_default.icon, LocalMessage_default.container__icon)
11079
+ color: `var(--dds-color-icon-on-${purpose === "tips" ? "info" : purpose}-default)`
11042
11080
  }
11043
11081
  ),
11044
- /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("div", { className: LocalMessage_default.container__text, children }),
11082
+ /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(GridChild, { gridArea: "text", children }),
11045
11083
  closable && /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
11046
- Button,
11084
+ GridChild,
11047
11085
  {
11086
+ as: Button,
11087
+ gridArea: "close-btn",
11048
11088
  icon: CloseIcon,
11049
11089
  purpose: "tertiary",
11050
11090
  onClick: () => {
11051
- setClosed(true);
11091
+ setOpen(false);
11052
11092
  onClose == null ? void 0 : onClose();
11053
11093
  },
11054
11094
  size: "xsmall",
11055
- "aria-label": t(commonTexts.closeMessage),
11056
- className: LocalMessage_default.container__button
11095
+ "aria-label": t(commonTexts.closeMessage)
11057
11096
  }
11058
11097
  )
11059
11098
  ]
11060
11099
  }
11061
- );
11100
+ ) : null;
11062
11101
  };
11063
11102
  LocalMessage.displayName = "LocalMessage";
11064
11103
 
@@ -11108,7 +11147,7 @@ var Modal = ({
11108
11147
  };
11109
11148
  const themeContext = (0, import_react72.useContext)(ThemeContext);
11110
11149
  if (!themeContext) {
11111
- throw new Error("Modal must be used within a ThemeProvider");
11150
+ throw new Error("Modal must be used within a DdsProvider");
11112
11151
  }
11113
11152
  const { t } = useTranslation();
11114
11153
  const portalTarget = parentElement != null ? parentElement : themeContext == null ? void 0 : themeContext.el;
@@ -11427,9 +11466,6 @@ var import_react76 = require("react");
11427
11466
 
11428
11467
  // src/components/Pagination/Pagination.module.css
11429
11468
  var Pagination_default = {
11430
- list: "Pagination_list",
11431
- list__item: "Pagination_list__item",
11432
- indicators: "Pagination_indicators",
11433
11469
  "truncation-icon": "Pagination_truncation-icon"
11434
11470
  };
11435
11471
 
@@ -12195,6 +12231,7 @@ var createSelectOptions = (...args) => args.map((v) => ({ label: v, value: v }))
12195
12231
 
12196
12232
  // src/components/Pagination/Pagination.tsx
12197
12233
  var import_jsx_runtime311 = require("react/jsx-runtime");
12234
+ var import_react77 = require("react");
12198
12235
  var Pagination = ({
12199
12236
  itemsAmount,
12200
12237
  defaultItemsPerPage = 10,
@@ -12247,9 +12284,22 @@ var Pagination = ({
12247
12284
  onSelectOptionChange(option);
12248
12285
  }
12249
12286
  };
12287
+ const listItemProps = {
12288
+ as: "li",
12289
+ display: "inline-grid",
12290
+ alignContent: "center"
12291
+ };
12292
+ const listProps = {
12293
+ as: "ol",
12294
+ defaultPageLayout: false,
12295
+ gridAutoFlow: "column",
12296
+ margin: "x0",
12297
+ padding: "x0",
12298
+ gap: "x0.75"
12299
+ };
12250
12300
  const listItems = items.length > 0 ? items.map((item, i) => {
12251
12301
  const isActive = item === activePage;
12252
- return /* @__PURE__ */ (0, import_jsx_runtime311.jsx)("li", { className: Pagination_default.list__item, children: item !== "truncator" && typeof item === "number" ? /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
12302
+ return /* @__PURE__ */ (0, import_react77.createElement)(Box, { ...listItemProps, key: `pagination-item-${i}` }, item !== "truncator" && typeof item === "number" ? /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
12253
12303
  Button,
12254
12304
  {
12255
12305
  purpose: isActive ? "primary" : "secondary",
@@ -12266,7 +12316,7 @@ var Pagination = ({
12266
12316
  icon: MoreHorizontalIcon,
12267
12317
  className: Pagination_default["truncation-icon"]
12268
12318
  }
12269
- ) }, `pagination-item-${i}`);
12319
+ ));
12270
12320
  }) : void 0;
12271
12321
  const previousPageButton = /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
12272
12322
  Button,
@@ -12307,125 +12357,97 @@ var Pagination = ({
12307
12357
  ...baseHTMLProps
12308
12358
  },
12309
12359
  children: [
12310
- /* @__PURE__ */ (0, import_jsx_runtime311.jsxs)(
12311
- ShowHide,
12312
- {
12313
- as: "ol",
12314
- hideBelow: smallScreenBreakpoint,
12315
- className: Pagination_default.list,
12316
- children: [
12317
- /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
12318
- "li",
12319
- {
12320
- className: cn(
12321
- Pagination_default.list__item,
12322
- isOnFirstPage && utilStyles_default.invisible
12323
- ),
12324
- "aria-hidden": isOnFirstPage,
12325
- children: previousPageButton
12326
- }
12327
- ),
12328
- listItems,
12329
- /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
12330
- "li",
12360
+ /* @__PURE__ */ (0, import_jsx_runtime311.jsxs)(Grid, { ...listProps, hideBelow: smallScreenBreakpoint, children: [
12361
+ /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
12362
+ Box,
12363
+ {
12364
+ ...listItemProps,
12365
+ className: isOnFirstPage ? utilStyles_default.invisible : void 0,
12366
+ "aria-hidden": isOnFirstPage,
12367
+ children: previousPageButton
12368
+ }
12369
+ ),
12370
+ listItems,
12371
+ /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
12372
+ Box,
12373
+ {
12374
+ ...listItemProps,
12375
+ className: isOnLastPage ? utilStyles_default.invisible : void 0,
12376
+ "aria-hidden": isOnLastPage,
12377
+ children: nextPageButton
12378
+ }
12379
+ )
12380
+ ] }),
12381
+ !!smallScreenBreakpoint && /* @__PURE__ */ (0, import_jsx_runtime311.jsxs)(Grid, { ...listProps, showBelow: smallScreenBreakpoint, children: [
12382
+ /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
12383
+ Box,
12384
+ {
12385
+ ...listItemProps,
12386
+ className: isOnFirstPage ? utilStyles_default.invisible : void 0,
12387
+ "aria-hidden": isOnFirstPage,
12388
+ children: /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
12389
+ Button,
12331
12390
  {
12332
- className: cn(
12333
- Pagination_default.list__item,
12334
- isOnLastPage && utilStyles_default.invisible
12335
- ),
12336
- "aria-hidden": isOnLastPage,
12337
- children: nextPageButton
12391
+ purpose: "secondary",
12392
+ size: "small",
12393
+ icon: ChevronFirstIcon,
12394
+ onClick: (event) => {
12395
+ onPageChange(event, 1);
12396
+ },
12397
+ "aria-label": t(texts22.firstPage)
12338
12398
  }
12339
12399
  )
12340
- ]
12341
- }
12342
- ),
12343
- !!smallScreenBreakpoint && /* @__PURE__ */ (0, import_jsx_runtime311.jsxs)(
12344
- ShowHide,
12345
- {
12346
- as: "ol",
12347
- showBelow: smallScreenBreakpoint,
12348
- className: Pagination_default.list,
12349
- children: [
12350
- /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
12351
- "li",
12352
- {
12353
- className: cn(
12354
- Pagination_default.list__item,
12355
- isOnFirstPage && utilStyles_default.invisible
12356
- ),
12357
- "aria-hidden": isOnFirstPage,
12358
- children: /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
12359
- Button,
12360
- {
12361
- purpose: "secondary",
12362
- size: "small",
12363
- icon: ChevronFirstIcon,
12364
- onClick: (event) => {
12365
- onPageChange(event, 1);
12366
- },
12367
- "aria-label": t(texts22.firstPage)
12368
- }
12369
- )
12370
- }
12371
- ),
12372
- /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
12373
- "li",
12374
- {
12375
- className: cn(
12376
- Pagination_default.list__item,
12377
- isOnFirstPage && utilStyles_default.invisible
12378
- ),
12379
- "aria-hidden": isOnFirstPage,
12380
- children: previousPageButton
12381
- }
12382
- ),
12383
- /* @__PURE__ */ (0, import_jsx_runtime311.jsx)("li", { className: Pagination_default.list__item, children: /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
12400
+ }
12401
+ ),
12402
+ /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
12403
+ Box,
12404
+ {
12405
+ ...listItemProps,
12406
+ className: isOnFirstPage ? utilStyles_default.invisible : void 0,
12407
+ "aria-hidden": isOnFirstPage,
12408
+ children: previousPageButton
12409
+ }
12410
+ ),
12411
+ /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(Box, { ...listItemProps, children: /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
12412
+ Button,
12413
+ {
12414
+ size: "small",
12415
+ onClick: (event) => {
12416
+ onPageChange(event, activePage);
12417
+ },
12418
+ children: activePage
12419
+ }
12420
+ ) }),
12421
+ /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
12422
+ Box,
12423
+ {
12424
+ ...listItemProps,
12425
+ className: isOnLastPage ? utilStyles_default.invisible : void 0,
12426
+ "aria-hidden": isOnLastPage,
12427
+ children: nextPageButton
12428
+ }
12429
+ ),
12430
+ /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
12431
+ Box,
12432
+ {
12433
+ ...listItemProps,
12434
+ className: isOnLastPage ? utilStyles_default.invisible : void 0,
12435
+ "aria-hidden": isOnLastPage,
12436
+ children: /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
12384
12437
  Button,
12385
12438
  {
12439
+ purpose: "secondary",
12386
12440
  size: "small",
12441
+ icon: ChevronLastIcon,
12387
12442
  onClick: (event) => {
12388
- onPageChange(event, activePage);
12443
+ onPageChange(event, pagesLength);
12389
12444
  },
12390
- children: activePage
12391
- }
12392
- ) }),
12393
- /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
12394
- "li",
12395
- {
12396
- className: cn(
12397
- Pagination_default.list__item,
12398
- isOnLastPage && utilStyles_default.invisible
12399
- ),
12400
- "aria-hidden": isOnLastPage,
12401
- children: nextPageButton
12402
- }
12403
- ),
12404
- /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
12405
- "li",
12406
- {
12407
- className: cn(
12408
- Pagination_default.list__item,
12409
- isOnLastPage && utilStyles_default.invisible
12410
- ),
12411
- "aria-hidden": isOnLastPage,
12412
- children: /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
12413
- Button,
12414
- {
12415
- purpose: "secondary",
12416
- size: "small",
12417
- icon: ChevronLastIcon,
12418
- onClick: (event) => {
12419
- onPageChange(event, pagesLength);
12420
- },
12421
- "aria-label": t(texts22.lastPage)
12422
- }
12423
- )
12445
+ "aria-label": t(texts22.lastPage)
12424
12446
  }
12425
12447
  )
12426
- ]
12427
- }
12428
- )
12448
+ }
12449
+ )
12450
+ ] })
12429
12451
  ]
12430
12452
  }
12431
12453
  ) : null;
@@ -12443,12 +12465,12 @@ var Pagination = ({
12443
12465
  ...baseHTMLProps,
12444
12466
  children: [
12445
12467
  /* @__PURE__ */ (0, import_jsx_runtime311.jsxs)(
12446
- Box,
12468
+ Grid,
12447
12469
  {
12448
- display: "grid",
12470
+ defaultPageLayout: false,
12449
12471
  gap: "x0.5",
12450
12472
  alignItems: "center",
12451
- className: Pagination_default.indicators,
12473
+ gridAutoFlow: "column",
12452
12474
  children: [
12453
12475
  withSelect && /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
12454
12476
  Select,
@@ -12528,7 +12550,7 @@ var texts22 = createTexts({
12528
12550
  });
12529
12551
 
12530
12552
  // src/components/PhoneInput/PhoneInput.tsx
12531
- var import_react77 = require("react");
12553
+ var import_react78 = require("react");
12532
12554
 
12533
12555
  // src/components/PhoneInput/constants.ts
12534
12556
  var COUNTRIES = {
@@ -12942,9 +12964,7 @@ var prioritizedCountryOptions = prioritizedCountries.map((country) => {
12942
12964
  countryCode: country.id
12943
12965
  };
12944
12966
  });
12945
- var sortedCountryOptions = Object.values(
12946
- COUNTRIES
12947
- ).sort((a, b) => {
12967
+ var compareCountriesByName = (a, b) => {
12948
12968
  if (a.name < b.name) {
12949
12969
  return -1;
12950
12970
  }
@@ -12952,18 +12972,21 @@ var sortedCountryOptions = Object.values(
12952
12972
  return 1;
12953
12973
  }
12954
12974
  return 0;
12955
- }).map((country) => ({
12956
- countryCode: country.id,
12957
- label: `${country.name} ${country.dialCode}`
12958
- })).filter(
12959
- (country) => !prioritizedCountryOptions.some(
12960
- (pCountry) => pCountry.countryCode === country.countryCode
12961
- )
12962
- );
12963
- var countryOptions = [
12964
- ...prioritizedCountryOptions,
12965
- ...sortedCountryOptions
12966
- ];
12975
+ };
12976
+ var createCountryOptions = (countries) => {
12977
+ const sortedCountryOptions = Object.values(
12978
+ countries
12979
+ ).sort(compareCountriesByName).map((country) => ({
12980
+ countryCode: country.id,
12981
+ label: `${country.name} ${country.dialCode}`
12982
+ })).filter(
12983
+ (country) => !prioritizedCountryOptions.some(
12984
+ (pCountry) => pCountry.countryCode === country.countryCode
12985
+ )
12986
+ );
12987
+ return [...prioritizedCountryOptions, ...sortedCountryOptions];
12988
+ };
12989
+ var countryOptions = createCountryOptions(COUNTRIES);
12967
12990
  var PhoneInput = ({
12968
12991
  label,
12969
12992
  readOnly,
@@ -12991,7 +13014,7 @@ var PhoneInput = ({
12991
13014
  const { t } = useTranslation();
12992
13015
  const tGroupLabel = groupLabel != null ? groupLabel : t(texts23.countryCodeAndPhoneNumber);
12993
13016
  const tSelectLabel = selectLabel != null ? selectLabel : t(texts23.countryCode);
12994
- const generatedId = (0, import_react77.useId)();
13017
+ const generatedId = (0, import_react78.useId)();
12995
13018
  const uniqueId = (_a = props.id) != null ? _a : generatedId;
12996
13019
  const phoneInputId = `${uniqueId}-phone-input`;
12997
13020
  const phoneNumberId = `${uniqueId}-phone-number`;
@@ -13001,27 +13024,27 @@ var PhoneInput = ({
13001
13024
  const hasMessage = hasErrorMessage || hasTip;
13002
13025
  const tipId = derivativeIdGenerator(phoneInputId, "tip");
13003
13026
  const errorMessageId = derivativeIdGenerator(phoneInputId, "errorMessage");
13004
- const [callingCode, setCallingCode] = (0, import_react77.useState)("");
13005
- const [selectedCountryCodeText, setSelectedCountryCodeText] = (0, import_react77.useState)("");
13006
- const [internalValue, setInternalValue] = (0, import_react77.useState)(
13027
+ const [callingCode, setCallingCode] = (0, import_react78.useState)("");
13028
+ const [selectedCountryCodeText, setSelectedCountryCodeText] = (0, import_react78.useState)("");
13029
+ const [internalValue, setInternalValue] = (0, import_react78.useState)(
13007
13030
  defaultValue != null ? defaultValue : {
13008
13031
  countryCode: "",
13009
13032
  phoneNumber: ""
13010
13033
  }
13011
13034
  );
13012
13035
  const isControlled = value !== void 0;
13013
- const [callingCodeWidth, setCallingCodeWidth] = (0, import_react77.useState)(0);
13014
- const callingCodeRef = (0, import_react77.useRef)(null);
13015
- (0, import_react77.useLayoutEffect)(() => {
13036
+ const [callingCodeWidth, setCallingCodeWidth] = (0, import_react78.useState)(0);
13037
+ const callingCodeRef = (0, import_react78.useRef)(null);
13038
+ (0, import_react78.useLayoutEffect)(() => {
13016
13039
  if (callingCodeRef.current) {
13017
13040
  setCallingCodeWidth(callingCodeRef.current.offsetWidth);
13018
13041
  }
13019
13042
  }, [callingCode]);
13020
13043
  const callingCodeInlineStart = callingCodeWidth ? `calc(var(--dds-spacing-x1) + ${callingCodeWidth}px)` : void 0;
13021
- const internalSelectRef = (0, import_react77.useRef)(null);
13044
+ const internalSelectRef = (0, import_react78.useRef)(null);
13022
13045
  const combinedSelectRef = useCombinedRef(selectRef, internalSelectRef);
13023
13046
  const displayedValue = isControlled ? value : internalValue;
13024
- (0, import_react77.useEffect)(() => {
13047
+ (0, import_react78.useEffect)(() => {
13025
13048
  const selectEl = internalSelectRef.current;
13026
13049
  if (selectEl && selectEl.value) {
13027
13050
  const { options, selectedIndex } = selectEl;
@@ -13183,7 +13206,7 @@ var texts23 = createTexts({
13183
13206
  });
13184
13207
 
13185
13208
  // src/components/Popover/Popover.tsx
13186
- var import_react79 = require("react");
13209
+ var import_react80 = require("react");
13187
13210
  var import_react_dom6 = require("react-dom");
13188
13211
 
13189
13212
  // src/components/Popover/Popover.module.css
@@ -13195,9 +13218,9 @@ var Popover_default = {
13195
13218
  };
13196
13219
 
13197
13220
  // src/components/Popover/Popover.context.tsx
13198
- var import_react78 = require("react");
13199
- var PopoverContext = (0, import_react78.createContext)({});
13200
- var usePopoverContext = () => (0, import_react78.useContext)(PopoverContext);
13221
+ var import_react79 = require("react");
13222
+ var PopoverContext = (0, import_react79.createContext)({});
13223
+ var usePopoverContext = () => (0, import_react79.useContext)(PopoverContext);
13201
13224
 
13202
13225
  // src/components/Popover/Popover.tsx
13203
13226
  var import_jsx_runtime313 = require("react/jsx-runtime");
@@ -13232,7 +13255,7 @@ var Popover = ({
13232
13255
  });
13233
13256
  const { maxHeight, maxWidth, minHeight, minWidth, height, width } = sizeProps;
13234
13257
  const context = usePopoverContext();
13235
- const themeContext = (0, import_react79.useContext)(ThemeContext);
13258
+ const themeContext = (0, import_react80.useContext)(ThemeContext);
13236
13259
  const portalTarget = parentElement != null ? parentElement : themeContext == null ? void 0 : themeContext.el;
13237
13260
  const {
13238
13261
  floatStyling: contextFloatStyling,
@@ -13246,7 +13269,7 @@ var Popover = ({
13246
13269
  } = context;
13247
13270
  const { t } = useTranslation();
13248
13271
  const hasContext = !isEmpty(context);
13249
- const generatedId = (0, import_react79.useId)();
13272
+ const generatedId = (0, import_react80.useId)();
13250
13273
  const uniquePopoverId = id != null ? id : `${generatedId}-popover`;
13251
13274
  const [
13252
13275
  popoverId,
@@ -13286,7 +13309,7 @@ var Popover = ({
13286
13309
  anchorEl && anchorEl
13287
13310
  );
13288
13311
  const multiRef = useCombinedRef(ref, popoverRef, floatingRef);
13289
- (0, import_react79.useEffect)(() => {
13312
+ (0, import_react80.useEffect)(() => {
13290
13313
  setFloatOptions == null ? void 0 : setFloatOptions({ placement, offset });
13291
13314
  }, [placement, offset]);
13292
13315
  useOnClickOutside([popoverRef, anchorRef], () => {
@@ -13355,7 +13378,7 @@ var Popover = ({
13355
13378
  Popover.displayName = "Popover";
13356
13379
 
13357
13380
  // src/components/Popover/PopoverGroup.tsx
13358
- var import_react80 = require("react");
13381
+ var import_react81 = require("react");
13359
13382
  var import_jsx_runtime314 = require("react/jsx-runtime");
13360
13383
  var PopoverGroup = ({
13361
13384
  isOpen: propIsOpen,
@@ -13367,12 +13390,12 @@ var PopoverGroup = ({
13367
13390
  popoverId
13368
13391
  }) => {
13369
13392
  var _a;
13370
- const [internalIsOpen, internalSetIsOpen] = (0, import_react80.useState)(isInitiallyOpen);
13393
+ const [internalIsOpen, internalSetIsOpen] = (0, import_react81.useState)(isInitiallyOpen);
13371
13394
  const open = propIsOpen != null ? propIsOpen : internalIsOpen;
13372
13395
  const setOpen = propSetIsOpen != null ? propSetIsOpen : internalSetIsOpen;
13373
- const generatedId = (0, import_react80.useId)();
13396
+ const generatedId = (0, import_react81.useId)();
13374
13397
  const uniquePopoverId = popoverId != null ? popoverId : `${generatedId}-popover`;
13375
- const [floatOptions, setFloatOptions] = (0, import_react80.useState)();
13398
+ const [floatOptions, setFloatOptions] = (0, import_react81.useState)();
13376
13399
  const {
13377
13400
  refs,
13378
13401
  styles: positionStyles,
@@ -13393,10 +13416,10 @@ var PopoverGroup = ({
13393
13416
  handleOpen();
13394
13417
  }
13395
13418
  };
13396
- const buttonRef = (0, import_react80.useRef)(null);
13419
+ const buttonRef = (0, import_react81.useRef)(null);
13397
13420
  const anchorRef = refs.setReference;
13398
13421
  const combinedAnchorRef = useCombinedRef(buttonRef, anchorRef);
13399
- const popoverRef = (0, import_react80.useRef)(null);
13422
+ const popoverRef = (0, import_react81.useRef)(null);
13400
13423
  const floatingRef = refs.setFloating;
13401
13424
  const combinedPopoverRef = useCombinedRef(popoverRef, floatingRef);
13402
13425
  useOnKeyDown(["Esc", "Escape"], () => {
@@ -13412,8 +13435,8 @@ var PopoverGroup = ({
13412
13435
  if (open) handleClose();
13413
13436
  });
13414
13437
  const isAnchorChild = (i) => i === 0;
13415
- const Children7 = import_react80.Children.map(children, (child, childIndex) => {
13416
- return (0, import_react80.isValidElement)(child) && (isAnchorChild(childIndex) ? (0, import_react80.cloneElement)(child, {
13438
+ const Children7 = import_react81.Children.map(children, (child, childIndex) => {
13439
+ return (0, import_react81.isValidElement)(child) && (isAnchorChild(childIndex) ? (0, import_react81.cloneElement)(child, {
13417
13440
  "aria-haspopup": "dialog",
13418
13441
  "aria-controls": uniquePopoverId,
13419
13442
  "aria-expanded": open,
@@ -13441,17 +13464,17 @@ var PopoverGroup = ({
13441
13464
  PopoverGroup.displayName = "PopoverGroup";
13442
13465
 
13443
13466
  // src/components/ProgressTracker/ProgressTracker.tsx
13444
- var import_react83 = require("react");
13467
+ var import_react84 = require("react");
13445
13468
 
13446
13469
  // src/components/ProgressTracker/ProgressTracker.context.tsx
13447
- var import_react81 = require("react");
13448
- var ProgressTrackerContext = (0, import_react81.createContext)(
13470
+ var import_react82 = require("react");
13471
+ var ProgressTrackerContext = (0, import_react82.createContext)(
13449
13472
  {
13450
13473
  activeStep: 0,
13451
13474
  direction: "column"
13452
13475
  }
13453
13476
  );
13454
- var useProgressTrackerContext = () => (0, import_react81.useContext)(ProgressTrackerContext);
13477
+ var useProgressTrackerContext = () => (0, import_react82.useContext)(ProgressTrackerContext);
13455
13478
 
13456
13479
  // src/components/ProgressTracker/ProgressTracker.module.css
13457
13480
  var ProgressTracker_default = {
@@ -13472,7 +13495,7 @@ var ProgressTracker_default = {
13472
13495
  };
13473
13496
 
13474
13497
  // src/components/ProgressTracker/ProgressTrackerItem.tsx
13475
- var import_react82 = require("react");
13498
+ var import_react83 = require("react");
13476
13499
  var import_jsx_runtime315 = require("react/jsx-runtime");
13477
13500
  var toItemState = (active, completed, disabled) => {
13478
13501
  if (disabled) {
@@ -13516,7 +13539,7 @@ var ProgressTrackerItem = (props) => {
13516
13539
  handleStepChange == null ? void 0 : handleStepChange(index);
13517
13540
  }
13518
13541
  };
13519
- const stepNumberContent = (0, import_react82.useMemo)(() => {
13542
+ const stepNumberContent = (0, import_react83.useMemo)(() => {
13520
13543
  if (completed) {
13521
13544
  return /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(Icon, { icon: CheckIcon, iconSize: "small" });
13522
13545
  }
@@ -13644,17 +13667,17 @@ var ProgressTracker = (() => {
13644
13667
  ...rest
13645
13668
  }) => {
13646
13669
  const { t } = useTranslation();
13647
- const [thisActiveStep, setActiveStep] = (0, import_react83.useState)(activeStep);
13670
+ const [thisActiveStep, setActiveStep] = (0, import_react84.useState)(activeStep);
13648
13671
  const handleChange = (step) => {
13649
13672
  setActiveStep(step);
13650
13673
  onStepChange == null ? void 0 : onStepChange(step);
13651
13674
  };
13652
- (0, import_react83.useEffect)(() => {
13675
+ (0, import_react84.useEffect)(() => {
13653
13676
  if (activeStep !== void 0 && activeStep != thisActiveStep) {
13654
13677
  setActiveStep(activeStep);
13655
13678
  }
13656
13679
  }, [activeStep, thisActiveStep]);
13657
- const steps = (0, import_react83.useMemo)(() => {
13680
+ const steps = (0, import_react84.useMemo)(() => {
13658
13681
  const validChildren = removeInvalidChildren(children);
13659
13682
  const itemsWithIndex = passIndexPropToProgressTrackerItem(validChildren);
13660
13683
  return itemsWithIndex;
@@ -13699,12 +13722,12 @@ var ProgressTracker = (() => {
13699
13722
  return Res;
13700
13723
  })();
13701
13724
  function removeInvalidChildren(children) {
13702
- return import_react83.Children.toArray(children).filter(import_react83.isValidElement);
13725
+ return import_react84.Children.toArray(children).filter(import_react84.isValidElement);
13703
13726
  }
13704
13727
  function passIndexPropToProgressTrackerItem(children) {
13705
- return import_react83.Children.map(
13728
+ return import_react84.Children.map(
13706
13729
  children,
13707
- (item, index) => (0, import_react83.cloneElement)(item, {
13730
+ (item, index) => (0, import_react84.cloneElement)(item, {
13708
13731
  ...item.props,
13709
13732
  index
13710
13733
  })
@@ -13721,7 +13744,7 @@ var texts25 = createTexts({
13721
13744
  });
13722
13745
 
13723
13746
  // src/components/ProgressBar/ProgressBar.tsx
13724
- var import_react84 = require("react");
13747
+ var import_react85 = require("react");
13725
13748
 
13726
13749
  // src/components/ProgressBar/ProgressBar.module.css
13727
13750
  var ProgressBar_default = {
@@ -13750,7 +13773,7 @@ var ProgressBar = ({
13750
13773
  style,
13751
13774
  ...rest
13752
13775
  }) => {
13753
- const generatedId = (0, import_react84.useId)();
13776
+ const generatedId = (0, import_react85.useId)();
13754
13777
  const uniqueId = id != null ? id : `${generatedId}-searchInput`;
13755
13778
  const hasErrorMessage = !!errorMessage;
13756
13779
  const hasTip = !!tip;
@@ -13805,34 +13828,33 @@ var ProgressBar = ({
13805
13828
  ProgressBar.displayName = "ProgressBar";
13806
13829
 
13807
13830
  // src/components/Search/Search.tsx
13808
- var import_react87 = require("react");
13831
+ var import_react88 = require("react");
13809
13832
 
13810
13833
  // src/components/Search/AutocompleteSearch.context.tsx
13811
- var import_react85 = require("react");
13812
- var AutocompleteSearchContext = (0, import_react85.createContext)({});
13834
+ var import_react86 = require("react");
13835
+ var AutocompleteSearchContext = (0, import_react86.createContext)({});
13813
13836
  var useAutocompleteSearch = () => {
13814
- return (0, import_react85.useContext)(AutocompleteSearchContext);
13837
+ return (0, import_react86.useContext)(AutocompleteSearchContext);
13815
13838
  };
13816
13839
 
13817
13840
  // src/components/Search/Search.module.css
13818
13841
  var Search_default = {
13819
- "with-button-container": "Search_with-button-container",
13820
13842
  input: "Search_input",
13821
13843
  "clear-button": "Search_clear-button",
13822
13844
  suggestions: "Search_suggestions"
13823
13845
  };
13824
13846
 
13825
13847
  // src/components/Search/SearchSuggestionItem.tsx
13826
- var import_react86 = require("react");
13848
+ var import_react87 = require("react");
13827
13849
  var import_jsx_runtime318 = require("react/jsx-runtime");
13828
13850
  var SearchSuggestionItem = ({
13829
13851
  focus,
13830
13852
  ref,
13831
13853
  ...rest
13832
13854
  }) => {
13833
- const itemRef = (0, import_react86.useRef)(null);
13855
+ const itemRef = (0, import_react87.useRef)(null);
13834
13856
  const combinedRef = useCombinedRef(ref, itemRef);
13835
- (0, import_react86.useEffect)(() => {
13857
+ (0, import_react87.useEffect)(() => {
13836
13858
  var _a;
13837
13859
  if (focus) {
13838
13860
  (_a = itemRef.current) == null ? void 0 : _a.focus();
@@ -13953,7 +13975,7 @@ var Search = ({
13953
13975
  ...rest
13954
13976
  }) => {
13955
13977
  var _a;
13956
- const generatedId = (0, import_react87.useId)();
13978
+ const generatedId = (0, import_react88.useId)();
13957
13979
  const uniqueId = id != null ? id : `${generatedId}-searchInput`;
13958
13980
  const tipId = derivativeIdGenerator(uniqueId, "tip");
13959
13981
  const suggestionsId = derivativeIdGenerator(uniqueId, "suggestions");
@@ -13962,7 +13984,7 @@ var Search = ({
13962
13984
  "suggestions-description"
13963
13985
  );
13964
13986
  const { t } = useTranslation();
13965
- const [hasValue, setHasValue] = (0, import_react87.useState)(!!value);
13987
+ const [hasValue, setHasValue] = (0, import_react88.useState)(!!value);
13966
13988
  const context = useAutocompleteSearch();
13967
13989
  const combinedRef = context.inputRef ? useCombinedRef(context.inputRef, ref) : ref;
13968
13990
  const handleChange = (e) => {
@@ -14065,11 +14087,10 @@ var Search = ({
14065
14087
  showSearchButton ? /* @__PURE__ */ (0, import_jsx_runtime320.jsxs)(
14066
14088
  Grid,
14067
14089
  {
14090
+ defaultPageLayout: false,
14068
14091
  className,
14069
14092
  width,
14070
14093
  columnGap: "x0.5",
14071
- rowGap: "0",
14072
- marginInline: "0",
14073
14094
  gridTemplateColumns: "1fr auto",
14074
14095
  style,
14075
14096
  children: [
@@ -14116,7 +14137,7 @@ var texts27 = createTexts({
14116
14137
  });
14117
14138
 
14118
14139
  // src/components/Search/SearchAutocompleteWrapper.tsx
14119
- var import_react88 = require("react");
14140
+ var import_react89 = require("react");
14120
14141
  var import_jsx_runtime321 = require("react/jsx-runtime");
14121
14142
  var SearchAutocompleteWrapper = (props) => {
14122
14143
  const {
@@ -14128,12 +14149,12 @@ var SearchAutocompleteWrapper = (props) => {
14128
14149
  onSuggestionSelection,
14129
14150
  children
14130
14151
  } = props;
14131
- const [inputValue, setInputValue] = (0, import_react88.useState)(value != null ? value : "");
14132
- const [suggestions, setSuggestions] = (0, import_react88.useState)([]);
14133
- const [showSuggestions, setShowSuggestions] = (0, import_react88.useState)(false);
14152
+ const [inputValue, setInputValue] = (0, import_react89.useState)(value != null ? value : "");
14153
+ const [suggestions, setSuggestions] = (0, import_react89.useState)([]);
14154
+ const [showSuggestions, setShowSuggestions] = (0, import_react89.useState)(false);
14134
14155
  const closeSuggestions = () => showSuggestions === true && setShowSuggestions(false);
14135
14156
  const openSuggestions = () => showSuggestions === false && setShowSuggestions(true);
14136
- (0, import_react88.useEffect)(() => {
14157
+ (0, import_react89.useEffect)(() => {
14137
14158
  if (suggestions.length > 0) {
14138
14159
  openSuggestions();
14139
14160
  } else {
@@ -14178,8 +14199,8 @@ var SearchAutocompleteWrapper = (props) => {
14178
14199
  const handleSetInputValue = (value2) => {
14179
14200
  setInputValue(value2 != null ? value2 : "");
14180
14201
  };
14181
- const inputRef = (0, import_react88.useRef)(null);
14182
- const suggestionsRef = (0, import_react88.useRef)(null);
14202
+ const inputRef = (0, import_react89.useRef)(null);
14203
+ const suggestionsRef = (0, import_react89.useRef)(null);
14183
14204
  useOnClickOutside([inputRef, suggestionsRef], () => {
14184
14205
  closeSuggestions();
14185
14206
  });
@@ -14268,7 +14289,7 @@ var SkipToContent = ({
14268
14289
  SkipToContent.displayName = "SkipToContent";
14269
14290
 
14270
14291
  // src/components/SplitButton/SplitButton.tsx
14271
- var import_react89 = require("react");
14292
+ var import_react90 = require("react");
14272
14293
 
14273
14294
  // src/components/SplitButton/SplitButton.module.css
14274
14295
  var SplitButton_default = {
@@ -14289,7 +14310,7 @@ var SplitButton = ({
14289
14310
  ...rest
14290
14311
  }) => {
14291
14312
  const { t } = useTranslation();
14292
- const [isOpen, setIsOpen] = (0, import_react89.useState)(false);
14313
+ const [isOpen, setIsOpen] = (0, import_react90.useState)(false);
14293
14314
  const buttonStyleProps = {
14294
14315
  purpose,
14295
14316
  size: size2
@@ -14335,15 +14356,15 @@ var texts28 = createTexts({
14335
14356
  });
14336
14357
 
14337
14358
  // src/components/Table/collapsible/CollapsibleRow.tsx
14338
- var import_react93 = require("react");
14359
+ var import_react94 = require("react");
14339
14360
 
14340
14361
  // src/components/Table/collapsible/Table.context.tsx
14341
- var import_react90 = require("react");
14342
- var CollapsibleTableContext = (0, import_react90.createContext)({
14362
+ var import_react91 = require("react");
14363
+ var CollapsibleTableContext = (0, import_react91.createContext)({
14343
14364
  headerValues: [],
14344
14365
  definingColumnIndex: [0]
14345
14366
  });
14346
- var useCollapsibleTableContext = () => (0, import_react90.useContext)(CollapsibleTableContext);
14367
+ var useCollapsibleTableContext = () => (0, import_react91.useContext)(CollapsibleTableContext);
14347
14368
 
14348
14369
  // src/components/Table/normal/Body.tsx
14349
14370
  var import_jsx_runtime325 = require("react/jsx-runtime");
@@ -14351,12 +14372,12 @@ var Body = (props) => /* @__PURE__ */ (0, import_jsx_runtime325.jsx)("tbody", {
14351
14372
  Body.displayName = "Table.Body";
14352
14373
 
14353
14374
  // src/components/Table/normal/Head.tsx
14354
- var import_react91 = require("react");
14375
+ var import_react92 = require("react");
14355
14376
  var import_jsx_runtime326 = require("react/jsx-runtime");
14356
14377
  var Head = ({ children, ...rest }) => /* @__PURE__ */ (0, import_jsx_runtime326.jsx)("thead", { ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime326.jsx)(HeadContext, { value: true, children }) });
14357
- var HeadContext = (0, import_react91.createContext)(false);
14378
+ var HeadContext = (0, import_react92.createContext)(false);
14358
14379
  function useIsInTableHead() {
14359
- const isInTableHead = (0, import_react91.useContext)(HeadContext);
14380
+ const isInTableHead = (0, import_react92.useContext)(HeadContext);
14360
14381
  return isInTableHead;
14361
14382
  }
14362
14383
 
@@ -14521,26 +14542,26 @@ var Table = ({
14521
14542
  Table.displayName = "Table";
14522
14543
 
14523
14544
  // src/components/Table/normal/TableWrapper.tsx
14524
- var import_react92 = require("react");
14545
+ var import_react93 = require("react");
14525
14546
  var import_jsx_runtime332 = require("react/jsx-runtime");
14526
14547
  var TableWrapper = ({ className, ...rest }) => {
14527
- const themeContext = (0, import_react92.useContext)(ThemeContext);
14548
+ const themeContext = (0, import_react93.useContext)(ThemeContext);
14528
14549
  const container2 = themeContext == null ? void 0 : themeContext.el;
14529
14550
  const containerWidth = container2 ? container2.clientWidth : 0;
14530
- const [overflowX, setOverflowX] = (0, import_react92.useState)(false);
14531
- const [themeContainerWidth, setThemeContainerWidth] = (0, import_react92.useState)(containerWidth);
14551
+ const [overflowX, setOverflowX] = (0, import_react93.useState)(false);
14552
+ const [themeContainerWidth, setThemeContainerWidth] = (0, import_react93.useState)(containerWidth);
14532
14553
  function isOverflowingX(event) {
14533
14554
  return event.offsetWidth < event.scrollWidth;
14534
14555
  }
14535
- const wrapperRef = (0, import_react92.useRef)(null);
14536
- (0, import_react92.useEffect)(() => {
14556
+ const wrapperRef = (0, import_react93.useRef)(null);
14557
+ (0, import_react93.useEffect)(() => {
14537
14558
  if ((wrapperRef == null ? void 0 : wrapperRef.current) && isOverflowingX(wrapperRef.current)) {
14538
14559
  setOverflowX(true);
14539
14560
  return;
14540
14561
  }
14541
14562
  setOverflowX(false);
14542
14563
  }, [themeContainerWidth]);
14543
- (0, import_react92.useEffect)(() => {
14564
+ (0, import_react93.useEffect)(() => {
14544
14565
  function handleResize() {
14545
14566
  setThemeContainerWidth(containerWidth);
14546
14567
  }
@@ -14589,8 +14610,8 @@ var CollapsibleRow = ({
14589
14610
  const isInHead = useIsInTableHead();
14590
14611
  const type = _type != null ? _type : isInHead ? "head" : "body";
14591
14612
  const { isCollapsed, headerValues, definingColumnIndex } = useCollapsibleTableContext();
14592
- const [childrenCollapsed, setChildrenCollapsed] = (0, import_react93.useState)(true);
14593
- (0, import_react93.useEffect)(() => {
14613
+ const [childrenCollapsed, setChildrenCollapsed] = (0, import_react94.useState)(true);
14614
+ (0, import_react94.useEffect)(() => {
14594
14615
  if (!isCollapsed) setChildrenCollapsed(true);
14595
14616
  }, [isCollapsed]);
14596
14617
  const rowProps = (isOpenCollapsibleHeader) => {
@@ -14608,7 +14629,7 @@ var CollapsibleRow = ({
14608
14629
  const collapsedHeaderValues = headerValues.filter(
14609
14630
  (column, index) => definingColumnIndex.indexOf(index) === -1
14610
14631
  );
14611
- const childrenArray = import_react93.Children.toArray(children);
14632
+ const childrenArray = import_react94.Children.toArray(children);
14612
14633
  const collapsedChildren = childrenArray.filter(
14613
14634
  (column, index) => definingColumnIndex.indexOf(index) === -1
14614
14635
  );
@@ -14617,9 +14638,9 @@ var CollapsibleRow = ({
14617
14638
  const collapsedRenderedChildren = isCollapsed && collapsedHeaderValues.length > 0 ? collapsedChildren.map(function(child, index) {
14618
14639
  const id = derivativeIdGenerator(prefix2, index.toString());
14619
14640
  collapsibleIds.push(id);
14620
- return /* @__PURE__ */ (0, import_jsx_runtime333.jsxs)(import_react93.Fragment, { children: [
14641
+ return /* @__PURE__ */ (0, import_jsx_runtime333.jsxs)(import_react94.Fragment, { children: [
14621
14642
  /* @__PURE__ */ (0, import_jsx_runtime333.jsx)(DescriptionListTerm, { children: collapsedHeaderValues[index].content }),
14622
- (0, import_react93.isValidElement)(child) && (0, import_react93.cloneElement)(child, {
14643
+ (0, import_react94.isValidElement)(child) && (0, import_react94.cloneElement)(child, {
14623
14644
  collapsibleProps: { isCollapsibleChild: true }
14624
14645
  })
14625
14646
  ] }, `DL-${index}`);
@@ -14716,11 +14737,11 @@ var CollapsibleTable2 = CollapsibleTable;
14716
14737
  CollapsibleTable2.Row = CollapsibleRow;
14717
14738
 
14718
14739
  // src/components/Tabs/AddTabButton.tsx
14719
- var import_react96 = require("react");
14740
+ var import_react97 = require("react");
14720
14741
 
14721
14742
  // src/components/Tabs/Tabs.context.tsx
14722
- var import_react94 = require("react");
14723
- var TabsContext = (0, import_react94.createContext)({
14743
+ var import_react95 = require("react");
14744
+ var TabsContext = (0, import_react95.createContext)({
14724
14745
  activeTab: 0,
14725
14746
  tabsId: "",
14726
14747
  size: "small",
@@ -14732,13 +14753,11 @@ var TabsContext = (0, import_react94.createContext)({
14732
14753
  tabContentDirection: "row",
14733
14754
  addTabButtonProps: void 0
14734
14755
  });
14735
- var useTabsContext = () => (0, import_react94.useContext)(TabsContext);
14756
+ var useTabsContext = () => (0, import_react95.useContext)(TabsContext);
14736
14757
 
14737
14758
  // src/components/Tabs/Tabs.module.css
14738
14759
  var Tabs_default = {
14739
14760
  "tab-row": "Tabs_tab-row",
14740
- "tab-row--standard-widths": "Tabs_tab-row--standard-widths",
14741
- "tab-row--custom-widths": "Tabs_tab-row--custom-widths",
14742
14761
  tab: "Tabs_tab",
14743
14762
  "tab--active": "Tabs_tab--active",
14744
14763
  "tab--medium--row": "Tabs_tab--medium--row",
@@ -14750,9 +14769,9 @@ var Tabs_default = {
14750
14769
  };
14751
14770
 
14752
14771
  // src/components/Tabs/TabWidthContext.tsx
14753
- var import_react95 = require("react");
14772
+ var import_react96 = require("react");
14754
14773
  var import_jsx_runtime335 = require("react/jsx-runtime");
14755
- var TabContext = (0, import_react95.createContext)(null);
14774
+ var TabContext = (0, import_react96.createContext)(null);
14756
14775
  function TabWidthContextProvider({
14757
14776
  children,
14758
14777
  onChangeWidths
@@ -14781,8 +14800,8 @@ function TabWidthContextProvider({
14781
14800
  );
14782
14801
  }
14783
14802
  function useSetTabWidth(index, width) {
14784
- const context = (0, import_react95.useContext)(TabContext);
14785
- (0, import_react95.useLayoutEffect)(() => {
14803
+ const context = (0, import_react96.useContext)(TabContext);
14804
+ (0, import_react96.useLayoutEffect)(() => {
14786
14805
  context == null ? void 0 : context.updateWidth(index, width);
14787
14806
  return () => context == null ? void 0 : context.removeTab(index);
14788
14807
  }, [index, width]);
@@ -14799,7 +14818,7 @@ var AddTabButton = ({
14799
14818
  ...rest
14800
14819
  }) => {
14801
14820
  useSetTabWidth(index, width);
14802
- const buttonRef = (0, import_react96.useRef)(null);
14821
+ const buttonRef = (0, import_react97.useRef)(null);
14803
14822
  const combinedRef = useCombinedRef(ref, buttonRef);
14804
14823
  const { tabContentDirection, size: size2 } = useTabsContext();
14805
14824
  return /* @__PURE__ */ (0, import_jsx_runtime336.jsxs)(
@@ -14824,7 +14843,7 @@ var AddTabButton = ({
14824
14843
  AddTabButton.displayName = "AddTabButton";
14825
14844
 
14826
14845
  // src/components/Tabs/Tabs.tsx
14827
- var import_react97 = require("react");
14846
+ var import_react98 = require("react");
14828
14847
  var import_jsx_runtime337 = require("react/jsx-runtime");
14829
14848
  var TABS_SIZES = createSizes("small", "medium");
14830
14849
  var Tabs = ({
@@ -14841,17 +14860,17 @@ var Tabs = ({
14841
14860
  htmlProps,
14842
14861
  ...rest
14843
14862
  }) => {
14844
- const generatedId = (0, import_react97.useId)();
14863
+ const generatedId = (0, import_react98.useId)();
14845
14864
  const uniqueId = id != null ? id : `${generatedId}-tabs`;
14846
- const [thisActiveTab, setActiveTab] = (0, import_react97.useState)(activeTab != null ? activeTab : 0);
14847
- const [hasTabFocus, setHasTabFocus] = (0, import_react97.useState)(false);
14848
- const tabListRef = (0, import_react97.useRef)(null);
14849
- const tabPanelsRef = (0, import_react97.useRef)(null);
14865
+ const [thisActiveTab, setActiveTab] = (0, import_react98.useState)(activeTab != null ? activeTab : 0);
14866
+ const [hasTabFocus, setHasTabFocus] = (0, import_react98.useState)(false);
14867
+ const tabListRef = (0, import_react98.useRef)(null);
14868
+ const tabPanelsRef = (0, import_react98.useRef)(null);
14850
14869
  const handleTabChange = (index) => {
14851
14870
  setActiveTab(index);
14852
14871
  onChange == null ? void 0 : onChange(index);
14853
14872
  };
14854
- (0, import_react97.useEffect)(() => {
14873
+ (0, import_react98.useEffect)(() => {
14855
14874
  if (activeTab !== void 0 && activeTab !== thisActiveTab) {
14856
14875
  setActiveTab(activeTab);
14857
14876
  }
@@ -14885,7 +14904,7 @@ var Tabs = ({
14885
14904
  Tabs.displayName = "Tabs";
14886
14905
 
14887
14906
  // src/components/Tabs/Tab.tsx
14888
- var import_react98 = require("react");
14907
+ var import_react99 = require("react");
14889
14908
  var import_jsx_runtime338 = require("react/jsx-runtime");
14890
14909
  var Tab = ({
14891
14910
  active = false,
@@ -14905,18 +14924,18 @@ var Tab = ({
14905
14924
  ...rest
14906
14925
  }) => {
14907
14926
  useSetTabWidth(index, width);
14908
- const itemRef = (0, import_react98.useRef)(null);
14927
+ const itemRef = (0, import_react99.useRef)(null);
14909
14928
  const combinedRef = useCombinedRef(ref, itemRef);
14910
14929
  const { tabContentDirection, size: size2 } = useTabsContext();
14911
14930
  const { type = "button", ...restHtmlProps } = htmlProps;
14912
14931
  const fixedHtmlProps = { type, ...restHtmlProps };
14913
- (0, import_react98.useEffect)(() => {
14932
+ (0, import_react99.useEffect)(() => {
14914
14933
  var _a;
14915
14934
  if (focus) {
14916
14935
  (_a = itemRef.current) == null ? void 0 : _a.focus();
14917
14936
  }
14918
14937
  }, [focus]);
14919
- const handleSelect = (0, import_react98.useCallback)(() => {
14938
+ const handleSelect = (0, import_react99.useCallback)(() => {
14920
14939
  if (setFocus && index) {
14921
14940
  setFocus(index);
14922
14941
  }
@@ -14963,7 +14982,7 @@ var Tab = ({
14963
14982
  Tab.displayName = "Tab";
14964
14983
 
14965
14984
  // src/components/Tabs/TabList.tsx
14966
- var import_react99 = require("react");
14985
+ var import_react100 = require("react");
14967
14986
  var import_jsx_runtime339 = require("react/jsx-runtime");
14968
14987
  var TabList = ({
14969
14988
  children,
@@ -14983,15 +15002,15 @@ var TabList = ({
14983
15002
  addTabButtonProps
14984
15003
  } = useTabsContext();
14985
15004
  const uniqueId = id != null ? id : `${tabsId}-tablist`;
14986
- const childrenArray = import_react99.Children.toArray(children).length;
15005
+ const childrenArray = import_react100.Children.toArray(children).length;
14987
15006
  const [focus, setFocus] = useRoveFocus(childrenArray, hasTabFocus, "row");
14988
15007
  const combinedRef = useCombinedRef(ref, tabListRef);
14989
15008
  const hasButton = addTabButtonProps ? true : false;
14990
- const tabListChildren = import_react99.Children ? import_react99.Children.map(children, (child, index) => {
15009
+ const tabListChildren = import_react100.Children ? import_react100.Children.map(children, (child, index) => {
14991
15010
  const handleThisTabChange = () => {
14992
15011
  handleTabChange(index);
14993
15012
  };
14994
- return (0, import_react99.isValidElement)(child) && (0, import_react99.cloneElement)(child, {
15013
+ return (0, import_react100.isValidElement)(child) && (0, import_react100.cloneElement)(child, {
14995
15014
  id: `${tabsId}-tab-${index}`,
14996
15015
  htmlProps: {
14997
15016
  ...child.props.htmlProps,
@@ -15004,7 +15023,7 @@ var TabList = ({
15004
15023
  onClick: combineHandlers(handleThisTabChange, child.props.onClick)
15005
15024
  });
15006
15025
  }) : [];
15007
- const [widths, setWidths] = (0, import_react99.useState)([]);
15026
+ const [widths, setWidths] = (0, import_react100.useState)([]);
15008
15027
  const handleOnFocus = (event) => {
15009
15028
  setHasTabFocus(true);
15010
15029
  onFocus == null ? void 0 : onFocus(event);
@@ -15022,9 +15041,16 @@ var TabList = ({
15022
15041
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
15023
15042
  ["--dds-tab-widths"]: widths.join(" ")
15024
15043
  };
15044
+ const gridLayout = widths ? {
15045
+ gridTemplateColumns: "var(--dds-tab-widths)"
15046
+ } : {
15047
+ gridAutoColumns: "1fr",
15048
+ gridAutoFlow: "column"
15049
+ };
15025
15050
  return /* @__PURE__ */ (0, import_jsx_runtime339.jsx)(TabWidthContextProvider, { onChangeWidths: setWidths, children: /* @__PURE__ */ (0, import_jsx_runtime339.jsxs)(
15026
- "div",
15051
+ Grid,
15027
15052
  {
15053
+ defaultPageLayout: false,
15028
15054
  ...rest,
15029
15055
  ref: combinedRef,
15030
15056
  role: "tablist",
@@ -15032,13 +15058,9 @@ var TabList = ({
15032
15058
  tabIndex: 0,
15033
15059
  onFocus: handleOnFocus,
15034
15060
  onBlur: handleOnBlur,
15035
- className: cn(
15036
- Tabs_default["tab-row"],
15037
- !widths && Tabs_default["tab-row--standard-widths"],
15038
- Tabs_default["tab-row--custom-widths"],
15039
- focusable,
15040
- scrollbar
15041
- ),
15061
+ overflowX: "auto",
15062
+ ...gridLayout,
15063
+ className: cn(Tabs_default["tab-row"], focusable, scrollbar),
15042
15064
  style: { ...style, ...customWidths },
15043
15065
  children: [
15044
15066
  tabListChildren,
@@ -15080,14 +15102,14 @@ var TabPanel = ({
15080
15102
  TabPanel.displayName = "TabPanel";
15081
15103
 
15082
15104
  // src/components/Tabs/TabPanels.tsx
15083
- var import_react100 = require("react");
15105
+ var import_react101 = require("react");
15084
15106
  var import_jsx_runtime341 = require("react/jsx-runtime");
15085
15107
  var TabPanels = ({ children, ref, ...rest }) => {
15086
15108
  const { activeTab, tabsId, tabPanelsRef } = useTabsContext();
15087
15109
  const combinedRef = useCombinedRef(ref, tabPanelsRef);
15088
- const panelChildren = import_react100.Children.map(children, (child, index) => {
15110
+ const panelChildren = import_react101.Children.map(children, (child, index) => {
15089
15111
  const active = index === activeTab;
15090
- return (0, import_react100.isValidElement)(child) && (0, import_react100.cloneElement)(child, {
15112
+ return (0, import_react101.isValidElement)(child) && (0, import_react101.cloneElement)(child, {
15091
15113
  id: `${tabsId}-panel-${index}`,
15092
15114
  active,
15093
15115
  htmlProps: {
@@ -15170,7 +15192,7 @@ var Tag = ({
15170
15192
  Tag.displayName = "Tag";
15171
15193
 
15172
15194
  // src/components/TextInput/TextInput.tsx
15173
- var import_react101 = require("react");
15195
+ var import_react102 = require("react");
15174
15196
 
15175
15197
  // src/components/TextInput/TextInput.module.css
15176
15198
  var TextInput_default = {
@@ -15213,12 +15235,12 @@ var TextInput = ({
15213
15235
  ref,
15214
15236
  ...rest
15215
15237
  }) => {
15216
- const [text, setText] = (0, import_react101.useState)(getDefaultText(value, defaultValue));
15217
- const prefixRef = (0, import_react101.useRef)(null);
15218
- const suffixRef = (0, import_react101.useRef)(null);
15219
- const [prefixLength, setPrefixLength] = (0, import_react101.useState)(0);
15220
- const [suffixLength, setSuffixLength] = (0, import_react101.useState)(0);
15221
- (0, import_react101.useLayoutEffect)(() => {
15238
+ const [text, setText] = (0, import_react102.useState)(getDefaultText(value, defaultValue));
15239
+ const prefixRef = (0, import_react102.useRef)(null);
15240
+ const suffixRef = (0, import_react102.useRef)(null);
15241
+ const [prefixLength, setPrefixLength] = (0, import_react102.useState)(0);
15242
+ const [suffixLength, setSuffixLength] = (0, import_react102.useState)(0);
15243
+ (0, import_react102.useLayoutEffect)(() => {
15222
15244
  requestAnimationFrame(() => {
15223
15245
  if (prefixRef.current) {
15224
15246
  setPrefixLength(prefixRef.current.offsetWidth);
@@ -15234,7 +15256,7 @@ var TextInput = ({
15234
15256
  onChange(event);
15235
15257
  }
15236
15258
  };
15237
- const generatedId = (0, import_react101.useId)();
15259
+ const generatedId = (0, import_react102.useId)();
15238
15260
  const uniqueId = id != null ? id : `${generatedId}-textInput`;
15239
15261
  const hasErrorMessage = !!errorMessage;
15240
15262
  const hasTip = !!tip;
@@ -15414,24 +15436,15 @@ var TextInput = ({
15414
15436
  TextInput.displayName = "TextInput";
15415
15437
 
15416
15438
  // src/components/ToggleBar/ToggleBar.tsx
15417
- var import_react103 = require("react");
15439
+ var import_react104 = require("react");
15418
15440
 
15419
15441
  // src/components/ToggleBar/ToggleBar.context.tsx
15420
- var import_react102 = require("react");
15421
- var ToggleBarContext = (0, import_react102.createContext)({
15442
+ var import_react103 = require("react");
15443
+ var ToggleBarContext = (0, import_react103.createContext)({
15422
15444
  size: "medium",
15423
15445
  purpose: "primary"
15424
15446
  });
15425
- var useToggleBarContext = () => (0, import_react102.useContext)(ToggleBarContext);
15426
-
15427
- // src/components/ToggleBar/ToggleBar.module.css
15428
- var ToggleBar_default = {
15429
- bar: "ToggleBar_bar",
15430
- content: "ToggleBar_content",
15431
- label: "ToggleBar_label",
15432
- "label--primary": "ToggleBar_label--primary",
15433
- "label--secondary": "ToggleBar_label--secondary"
15434
- };
15447
+ var useToggleBarContext = () => (0, import_react103.useContext)(ToggleBarContext);
15435
15448
 
15436
15449
  // src/components/ToggleBar/ToggleBar.tsx
15437
15450
  var import_jsx_runtime344 = require("react/jsx-runtime");
@@ -15451,9 +15464,9 @@ var ToggleBar = (props) => {
15451
15464
  id,
15452
15465
  ...rest
15453
15466
  } = props;
15454
- const generatedId = (0, import_react103.useId)();
15467
+ const generatedId = (0, import_react104.useId)();
15455
15468
  const uniqueId = id != null ? id : `${generatedId}-ToggleBar`;
15456
- const [groupValue, setGroupValue] = (0, import_react103.useState)(value);
15469
+ const [groupValue, setGroupValue] = (0, import_react104.useState)(value);
15457
15470
  const handleChange = combineHandlers(
15458
15471
  (e) => setGroupValue(e.target.value),
15459
15472
  (e) => onChange && onChange(e, e.target.value)
@@ -15479,7 +15492,15 @@ var ToggleBar = (props) => {
15479
15492
  "aria-labelledby": labelId != null ? labelId : htmlProps == null ? void 0 : htmlProps["aria-labelledby"],
15480
15493
  children: [
15481
15494
  label && /* @__PURE__ */ (0, import_jsx_runtime344.jsx)(Typography, { id: labelId, as: "span", typographyType: "labelMedium", children: label }),
15482
- /* @__PURE__ */ (0, import_jsx_runtime344.jsx)("div", { className: ToggleBar_default.bar, children })
15495
+ /* @__PURE__ */ (0, import_jsx_runtime344.jsx)(
15496
+ Grid,
15497
+ {
15498
+ defaultPageLayout: false,
15499
+ gridAutoFlow: "column",
15500
+ gridAutoColumns: "1fr",
15501
+ children
15502
+ }
15503
+ )
15483
15504
  ]
15484
15505
  }
15485
15506
  )
@@ -15489,7 +15510,17 @@ var ToggleBar = (props) => {
15489
15510
  ToggleBar.displayName = "ToggleBar";
15490
15511
 
15491
15512
  // src/components/ToggleBar/ToggleRadio.tsx
15492
- var import_react104 = require("react");
15513
+ var import_react105 = require("react");
15514
+
15515
+ // src/components/ToggleBar/ToggleBar.module.css
15516
+ var ToggleBar_default = {
15517
+ content: "ToggleBar_content",
15518
+ label: "ToggleBar_label",
15519
+ "label--primary": "ToggleBar_label--primary",
15520
+ "label--secondary": "ToggleBar_label--secondary"
15521
+ };
15522
+
15523
+ // src/components/ToggleBar/ToggleRadio.tsx
15493
15524
  var import_jsx_runtime345 = require("react/jsx-runtime");
15494
15525
  var calculateChecked = (value, group, checked) => {
15495
15526
  if (typeof checked !== "undefined") return checked;
@@ -15516,7 +15547,7 @@ var ToggleRadio = ({
15516
15547
  id,
15517
15548
  ...rest
15518
15549
  }) => {
15519
- const generatedId = (0, import_react104.useId)();
15550
+ const generatedId = (0, import_react105.useId)();
15520
15551
  const uniqueId = id != null ? id : `${generatedId}-ToggleRadio`;
15521
15552
  const group = useToggleBarContext();
15522
15553
  const handleChange = (event) => {
@@ -15579,7 +15610,7 @@ var ToggleRadio = ({
15579
15610
  ToggleRadio.displayName = "ToggleRadio";
15580
15611
 
15581
15612
  // src/components/ToggleButton/ToggleButton.tsx
15582
- var import_react105 = require("react");
15613
+ var import_react106 = require("react");
15583
15614
 
15584
15615
  // src/components/ToggleButton/ToggleButton.module.css
15585
15616
  var ToggleButton_default = {
@@ -15598,7 +15629,7 @@ var ToggleButton = ({
15598
15629
  htmlProps,
15599
15630
  ...rest
15600
15631
  }) => {
15601
- const generatedId = (0, import_react105.useId)();
15632
+ const generatedId = (0, import_react106.useId)();
15602
15633
  const uniqueId = id != null ? id : `${generatedId}-toggleButton`;
15603
15634
  const hasIcon = !!icon;
15604
15635
  return /* @__PURE__ */ (0, import_jsx_runtime346.jsxs)(Box, { as: "label", htmlFor: uniqueId, width: "fit-content", children: [
@@ -15647,7 +15678,7 @@ var ToggleButton = ({
15647
15678
  ToggleButton.displayName = "ToggleButton";
15648
15679
 
15649
15680
  // src/components/ToggleButton/ToggleButtonGroup.tsx
15650
- var import_react106 = require("react");
15681
+ var import_react107 = require("react");
15651
15682
  var import_jsx_runtime347 = require("react/jsx-runtime");
15652
15683
  var ToggleButtonGroup = (props) => {
15653
15684
  const {
@@ -15661,7 +15692,7 @@ var ToggleButtonGroup = (props) => {
15661
15692
  htmlProps,
15662
15693
  ...rest
15663
15694
  } = props;
15664
- const generatedId = (0, import_react106.useId)();
15695
+ const generatedId = (0, import_react107.useId)();
15665
15696
  const uniqueLabelId = labelId != null ? labelId : `${generatedId}-ToggleButtonGroupLabel`;
15666
15697
  return /* @__PURE__ */ (0, import_jsx_runtime347.jsxs)(
15667
15698
  "div",
@@ -16016,7 +16047,6 @@ ToggleButtonGroup.displayName = "ToggleButtonGroup";
16016
16047
  ZoomOutIcon,
16017
16048
  calendarDateToNativeDate,
16018
16049
  cn,
16019
- countryOptions,
16020
16050
  createPurposes,
16021
16051
  createSelectOptions,
16022
16052
  createSizes,
@@ -16027,7 +16057,6 @@ ToggleButtonGroup.displayName = "ToggleButtonGroup";
16027
16057
  getBaseHTMLProps,
16028
16058
  getColorCn,
16029
16059
  getElementType,
16030
- getLiteralScreenSize,
16031
16060
  getTypographyCn,
16032
16061
  handleElementWithBackdropMount,
16033
16062
  handleElementWithBackdropUnmount,