@dxc-technology/halstack-react 15.2.1 → 15.3.2

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
@@ -1959,6 +1959,7 @@ var Flex = styled2.div`
1959
1959
  ${typeof props.alignSelf === "string" ? `align-self: ${props.alignSelf};` : ""}
1960
1960
  ${typeof props.$basis === "string" ? `flex-basis: ${props.$basis};` : ""}
1961
1961
  ${typeof props.$direction === "string" ? `flex-direction: ${props.$direction};` : ""}
1962
+ ${props.$fullHeight ? "height: 100%;" : ""}
1962
1963
  ${typeof props.$gap === "string" ? `gap: ${props.$gap};` : ""}
1963
1964
  ${typeof props.$gap === "object" ? `column-gap: ${props.$gap.columnGap}; row-gap: ${props.$gap.rowGap};` : ""}
1964
1965
  ${typeof props.$grow === "number" ? `flex-grow: ${props.$grow};` : ""}
@@ -1968,16 +1969,7 @@ var Flex = styled2.div`
1968
1969
  ${typeof props.$wrap === "string" ? `flex-wrap: ${props.$wrap};` : ""}
1969
1970
  `}
1970
1971
  `;
1971
- var DxcFlex = ({
1972
- basis,
1973
- direction,
1974
- gap,
1975
- grow,
1976
- order,
1977
- shrink,
1978
- wrap,
1979
- ...props
1980
- }) => /* @__PURE__ */ jsx3(
1972
+ var DxcFlex = ({ basis, direction, fullHeight = false, gap, grow, order, shrink, wrap, ...props }) => /* @__PURE__ */ jsx3(
1981
1973
  Flex,
1982
1974
  {
1983
1975
  $basis: basis,
@@ -1987,6 +1979,7 @@ var DxcFlex = ({
1987
1979
  $order: order,
1988
1980
  $shrink: shrink,
1989
1981
  $wrap: wrap,
1982
+ $fullHeight: fullHeight,
1990
1983
  ...props
1991
1984
  }
1992
1985
  );
@@ -1994,6 +1987,7 @@ var Flex_default = DxcFlex;
1994
1987
 
1995
1988
  // src/container/Container.tsx
1996
1989
  import styled3 from "styled-components";
1990
+ import { forwardRef } from "react";
1997
1991
  import { jsx as jsx4 } from "react/jsx-runtime";
1998
1992
  var getBorderStyles = (direction, borderProperties) => `border-${direction}: ${borderProperties.width ?? ""} ${borderProperties.style ?? ""} ${borderProperties.color ? getCoreColorToken(borderProperties.color) : ""};`;
1999
1993
  var Container = styled3.div`
@@ -2057,9 +2051,12 @@ var Container = styled3.div`
2057
2051
  padding-bottom: ${({ padding }) => typeof padding === "object" && padding.bottom ? spaces[padding.bottom] : ""};
2058
2052
  padding-left: ${({ padding }) => typeof padding === "object" && padding.left ? spaces[padding.left] : ""};
2059
2053
  `;
2060
- function DxcContainer({ display, width, height, overflow, ...props }) {
2061
- return /* @__PURE__ */ jsx4(Container, { $display: display, $width: width, $height: height, $overflow: overflow, ...props });
2062
- }
2054
+ var DxcContainer = forwardRef(
2055
+ ({ display, width, height, overflow, ...props }, ref) => {
2056
+ return /* @__PURE__ */ jsx4(Container, { ref, $display: display, $width: width, $height: height, $overflow: overflow, ...props });
2057
+ }
2058
+ );
2059
+ var Container_default = DxcContainer;
2063
2060
 
2064
2061
  // src/accordion/AccordionItem.tsx
2065
2062
  import React from "react";
@@ -2094,7 +2091,7 @@ var AccordionItem = ({
2094
2091
  tabIndex: disabled ? -1 : tabIndex,
2095
2092
  "aria-expanded": isItemExpanded,
2096
2093
  "aria-controls": `accordion-panel-${id}`,
2097
- children: /* @__PURE__ */ jsx5(DxcContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs(Flex_default, { gap: "1.5rem", children: [
2094
+ children: /* @__PURE__ */ jsx5(Container_default, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs(Flex_default, { gap: "1.5rem", children: [
2098
2095
  /* @__PURE__ */ jsx5(LeftSideContainer, { children: /* @__PURE__ */ jsxs(Flex_default, { gap: "0.75rem", children: [
2099
2096
  (icon || badge?.position === "before") && /* @__PURE__ */ jsx5(OptionalElement, { children: icon ? /* @__PURE__ */ jsx5(IconContainer2, { disabled, children: typeof icon === "string" ? /* @__PURE__ */ jsx5(Icon_default, { icon }) : icon }) : /* @__PURE__ */ jsx5(StatusContainer, { subLabel, children: disabled ? cloneElement(badge?.element, { color: "grey" }) : badge?.element }) }),
2100
2097
  /* @__PURE__ */ jsxs(LabelsContainer, { children: [
@@ -2350,7 +2347,7 @@ var Accordion_default = DxcAccordion;
2350
2347
 
2351
2348
  // src/alert/Alert.tsx
2352
2349
  import styled11, { css, ThemeProvider as ThemeProvider4 } from "styled-components";
2353
- import { useState as useState3, memo, useId as useId2, useEffect as useEffect2, useCallback as useCallback3, useContext as useContext5 } from "react";
2350
+ import { useState as useState4, memo, useId as useId3, useEffect as useEffect3, useCallback as useCallback3, useContext as useContext5 } from "react";
2354
2351
 
2355
2352
  // src/button/Button.tsx
2356
2353
  import { useContext as useContext4 } from "react";
@@ -2928,7 +2925,7 @@ var StyledDivider = styled8.hr`
2928
2925
  var Divider_default = DxcDivider;
2929
2926
 
2930
2927
  // src/action-icon/ActionIcon.tsx
2931
- import { forwardRef } from "react";
2928
+ import { forwardRef as forwardRef2 } from "react";
2932
2929
  import styled9 from "styled-components";
2933
2930
  import { jsx as jsx10 } from "react/jsx-runtime";
2934
2931
  var ActionIcon = styled9.button`
@@ -2968,7 +2965,7 @@ var ActionIcon = styled9.button`
2968
2965
  height: 16px;
2969
2966
  }
2970
2967
  `;
2971
- var ActionIcon_default = forwardRef(
2968
+ var ActionIcon_default = forwardRef2(
2972
2969
  ({ disabled = false, title, icon, onClick, tabIndex }, ref) => /* @__PURE__ */ jsx10(Tooltip, { label: title, children: /* @__PURE__ */ jsx10(
2973
2970
  ActionIcon,
2974
2971
  {
@@ -3091,6 +3088,7 @@ var FocusLock = ({ children }) => {
3091
3088
  var FocusLock_default = FocusLock;
3092
3089
 
3093
3090
  // src/alert/ModalAlertWrapper.tsx
3091
+ import { useEffect as useEffect2, useId as useId2, useState as useState3 } from "react";
3094
3092
  import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
3095
3093
  var BodyStyle = createGlobalStyle`
3096
3094
  body {
@@ -3123,16 +3121,24 @@ var ModalAlertContainer = styled10.div`
3123
3121
  min-width: 92%;
3124
3122
  }
3125
3123
  `;
3126
- var ModalAlertWrapper = ({ condition, onClose, children }) => condition ? /* @__PURE__ */ jsxs5(Fragment4, { children: [
3127
- /* @__PURE__ */ jsx12(BodyStyle, {}),
3128
- createPortal(
3129
- /* @__PURE__ */ jsxs5(Modal, { children: [
3130
- /* @__PURE__ */ jsx12(Overlay, { onClick: onClose }),
3131
- /* @__PURE__ */ jsx12(ModalAlertContainer, { children: /* @__PURE__ */ jsx12(FocusLock_default, { children }) })
3132
- ] }),
3133
- document.body
3134
- )
3135
- ] }) : children;
3124
+ var ModalAlertWrapper = ({ condition, onClose, children }) => {
3125
+ const id = useId2();
3126
+ const [portalContainer, setPortalContainer] = useState3(null);
3127
+ useEffect2(() => {
3128
+ setPortalContainer(document.getElementById(`dialog-${id}-portal`));
3129
+ }, []);
3130
+ return condition ? /* @__PURE__ */ jsxs5(Fragment4, { children: [
3131
+ /* @__PURE__ */ jsx12(BodyStyle, {}),
3132
+ /* @__PURE__ */ jsx12("div", { id: `dialog-${id}-portal`, style: { position: "absolute" } }),
3133
+ portalContainer && createPortal(
3134
+ /* @__PURE__ */ jsxs5(Modal, { children: [
3135
+ /* @__PURE__ */ jsx12(Overlay, { onClick: onClose }),
3136
+ /* @__PURE__ */ jsx12(ModalAlertContainer, { children: /* @__PURE__ */ jsx12(FocusLock_default, { children }) })
3137
+ ] }),
3138
+ portalContainer
3139
+ )
3140
+ ] }) : children;
3141
+ };
3136
3142
  var ModalAlertWrapper_default = ModalAlertWrapper;
3137
3143
 
3138
3144
  // src/alert/Alert.tsx
@@ -3233,9 +3239,9 @@ function DxcAlert({
3233
3239
  semantic = "info",
3234
3240
  title = ""
3235
3241
  }) {
3236
- const [messages, setMessages] = useState3(Array.isArray(message) ? message : [message]);
3237
- const [currentIndex, setCurrentIndex] = useState3(0);
3238
- const id = useId2();
3242
+ const [messages, setMessages] = useState4(Array.isArray(message) ? message : [message]);
3243
+ const [currentIndex, setCurrentIndex] = useState4(0);
3244
+ const id = useId3();
3239
3245
  const colorsTheme = useContext5(HalstackContext);
3240
3246
  const translatedLabels = useContext5(HalstackLanguageContext);
3241
3247
  const handleNextOnClick = () => {
@@ -3250,7 +3256,7 @@ function DxcAlert({
3250
3256
  setMessages((prevMessages) => prevMessages.filter((_, index) => index !== currentIndex));
3251
3257
  }
3252
3258
  };
3253
- useEffect2(() => {
3259
+ useEffect3(() => {
3254
3260
  if (currentIndex === messages.length) handlePrevOnClick();
3255
3261
  }, [currentIndex, messages, handlePrevOnClick]);
3256
3262
  return /* @__PURE__ */ jsx13(ThemeProvider4, { theme: colorsTheme.alert, children: /* @__PURE__ */ jsx13(ModalAlertWrapper_default, { condition: mode === "modal", onClose: handleOnClose, children: /* @__PURE__ */ jsxs6(
@@ -3339,7 +3345,7 @@ function DxcAlert({
3339
3345
  }
3340
3346
 
3341
3347
  // src/layout/ApplicationLayout.tsx
3342
- import { useContext as useContext11, useEffect as useEffect6, useRef as useRef4, useState as useState9 } from "react";
3348
+ import { useContext as useContext11, useEffect as useEffect7, useRef as useRef4, useState as useState10 } from "react";
3343
3349
  import styled19 from "styled-components";
3344
3350
 
3345
3351
  // src/footer/Footer.tsx
@@ -3695,18 +3701,18 @@ var BottomLink = styled12.a`
3695
3701
  var Footer_default = DxcFooter;
3696
3702
 
3697
3703
  // src/header/Header.tsx
3698
- import { useEffect as useEffect3, useMemo as useMemo5, useRef as useRef3, useState as useState6 } from "react";
3704
+ import { useEffect as useEffect4, useMemo as useMemo5, useRef as useRef3, useState as useState7 } from "react";
3699
3705
  import styled16, { ThemeProvider as ThemeProvider7 } from "styled-components";
3700
3706
 
3701
3707
  // src/dropdown/Dropdown.tsx
3702
3708
  import * as Popover from "@radix-ui/react-popover";
3703
- import { useCallback as useCallback4, useId as useId3, useLayoutEffect as useLayoutEffect2, useRef as useRef2, useState as useState5, useContext as useContext7 } from "react";
3709
+ import { useCallback as useCallback4, useId as useId4, useLayoutEffect as useLayoutEffect2, useRef as useRef2, useState as useState6, useContext as useContext7 } from "react";
3704
3710
  import styled15, { ThemeProvider as ThemeProvider6 } from "styled-components";
3705
3711
 
3706
3712
  // src/utils/useWidth.tsx
3707
- import { useLayoutEffect, useState as useState4 } from "react";
3713
+ import { useLayoutEffect, useState as useState5 } from "react";
3708
3714
  var useWidth = (target) => {
3709
- const [width, setWidth] = useState4(0);
3715
+ const [width, setWidth] = useState5(0);
3710
3716
  useLayoutEffect(() => {
3711
3717
  if (target != null) {
3712
3718
  setWidth(target.getBoundingClientRect().width);
@@ -3727,7 +3733,7 @@ var useWidth = (target) => {
3727
3733
  var useWidth_default = useWidth;
3728
3734
 
3729
3735
  // src/dropdown/DropdownMenu.tsx
3730
- import { forwardRef as forwardRef2, memo as memo3 } from "react";
3736
+ import { forwardRef as forwardRef3, memo as memo3 } from "react";
3731
3737
  import styled14 from "styled-components";
3732
3738
 
3733
3739
  // src/dropdown/DropdownMenuItem.tsx
@@ -3800,7 +3806,7 @@ var DropdownMenuItem_default = memo2(DropdownMenuItem);
3800
3806
 
3801
3807
  // src/dropdown/DropdownMenu.tsx
3802
3808
  import { jsx as jsx17 } from "react/jsx-runtime";
3803
- var DropdownMenu = forwardRef2(
3809
+ var DropdownMenu = forwardRef3(
3804
3810
  ({ id, dropdownTriggerId, iconsPosition, visualFocusIndex, menuItemOnClick, onKeyDown, options, styles }, ref) => /* @__PURE__ */ jsx17(
3805
3811
  DropdownMenuContainer,
3806
3812
  {
@@ -3879,11 +3885,11 @@ var DxcDropdown = ({
3879
3885
  tabIndex = 0,
3880
3886
  title
3881
3887
  }) => {
3882
- const id = useId3();
3888
+ const id = useId4();
3883
3889
  const triggerId = `trigger-${id}`;
3884
3890
  const menuId = `menu-${id}`;
3885
- const [isOpen, changeIsOpen] = useState5(false);
3886
- const [visualFocusIndex, setVisualFocusIndex] = useState5(0);
3891
+ const [isOpen, changeIsOpen] = useState6(false);
3892
+ const [visualFocusIndex, setVisualFocusIndex] = useState6(0);
3887
3893
  const colorsTheme = useContext7(HalstackContext);
3888
3894
  const triggerRef = useRef2(null);
3889
3895
  const menuRef = useRef2(null);
@@ -3996,72 +4002,75 @@ var DxcDropdown = ({
3996
4002
  inline: "start"
3997
4003
  });
3998
4004
  }, [visualFocusIndex]);
3999
- return /* @__PURE__ */ jsx18(ThemeProvider6, { theme: colorsTheme.dropdown, children: /* @__PURE__ */ jsx18(
4000
- DropdownContainer,
4001
- {
4002
- onMouseEnter: !disabled && expandOnHover ? handleOnOpenMenu : void 0,
4003
- onMouseLeave: !disabled && expandOnHover ? handleOnCloseMenu : void 0,
4004
- onBlur: !disabled ? handleOnBlur : void 0,
4005
- margin,
4006
- size,
4007
- children: /* @__PURE__ */ jsxs10(Popover.Root, { open: isOpen, children: [
4008
- /* @__PURE__ */ jsx18(Tooltip, { label: title, children: /* @__PURE__ */ jsx18(Popover.Trigger, { asChild: true, type: void 0, children: /* @__PURE__ */ jsxs10(
4009
- DropdownTrigger,
4010
- {
4011
- onClick: handleTriggerOnClick,
4012
- onKeyDown: handleTriggerOnKeyDown,
4013
- onBlur: (event) => {
4014
- event.stopPropagation();
4015
- },
4016
- disabled,
4017
- label,
4018
- margin,
4019
- size,
4020
- id: triggerId,
4021
- "aria-haspopup": "true",
4022
- "aria-controls": isOpen ? menuId : void 0,
4023
- "aria-expanded": isOpen ? true : void 0,
4024
- "aria-label": "Show options",
4025
- tabIndex,
4026
- ref: triggerRef,
4027
- children: [
4028
- /* @__PURE__ */ jsxs10(DropdownTriggerContent, { children: [
4029
- label && iconPosition === "after" && /* @__PURE__ */ jsx18(DropdownTriggerLabel, { children: label }),
4030
- icon && /* @__PURE__ */ jsx18(
4031
- DropdownTriggerIcon,
4032
- {
4033
- disabled,
4034
- role: typeof icon === "string" ? void 0 : "img",
4035
- "aria-hidden": true,
4036
- children: typeof icon === "string" ? /* @__PURE__ */ jsx18(Icon_default, { icon }) : icon
4037
- }
4038
- ),
4039
- label && iconPosition === "before" && /* @__PURE__ */ jsx18(DropdownTriggerLabel, { children: label })
4040
- ] }),
4041
- !caretHidden && /* @__PURE__ */ jsxs10(CaretIcon, { disabled, children: [
4042
- /* @__PURE__ */ jsx18(Icon_default, { icon: isOpen ? "arrow_drop_up" : "arrow_drop_down" }),
4043
- " "
4044
- ] })
4045
- ]
4046
- }
4047
- ) }) }),
4048
- /* @__PURE__ */ jsx18(Popover.Portal, { children: /* @__PURE__ */ jsx18(Popover.Content, { asChild: true, sideOffset: 1, children: /* @__PURE__ */ jsx18(
4049
- DropdownMenu_default,
4050
- {
4051
- id: menuId,
4052
- dropdownTriggerId: triggerId,
4053
- options,
4054
- iconsPosition: optionsIconPosition,
4055
- visualFocusIndex,
4056
- menuItemOnClick: handleMenuItemOnClick,
4057
- onKeyDown: handleMenuOnKeyDown,
4058
- styles: { width, zIndex: "310" },
4059
- ref: menuRef
4060
- }
4061
- ) }) })
4062
- ] })
4063
- }
4064
- ) });
4005
+ return /* @__PURE__ */ jsxs10(ThemeProvider6, { theme: colorsTheme.dropdown, children: [
4006
+ /* @__PURE__ */ jsx18(
4007
+ DropdownContainer,
4008
+ {
4009
+ onMouseEnter: !disabled && expandOnHover ? handleOnOpenMenu : void 0,
4010
+ onMouseLeave: !disabled && expandOnHover ? handleOnCloseMenu : void 0,
4011
+ onBlur: !disabled ? handleOnBlur : void 0,
4012
+ margin,
4013
+ size,
4014
+ children: /* @__PURE__ */ jsxs10(Popover.Root, { open: isOpen, children: [
4015
+ /* @__PURE__ */ jsx18(Tooltip, { label: title, children: /* @__PURE__ */ jsx18(Popover.Trigger, { asChild: true, type: void 0, children: /* @__PURE__ */ jsxs10(
4016
+ DropdownTrigger,
4017
+ {
4018
+ onClick: handleTriggerOnClick,
4019
+ onKeyDown: handleTriggerOnKeyDown,
4020
+ onBlur: (event) => {
4021
+ event.stopPropagation();
4022
+ },
4023
+ disabled,
4024
+ label,
4025
+ margin,
4026
+ size,
4027
+ id: triggerId,
4028
+ "aria-haspopup": "true",
4029
+ "aria-controls": isOpen ? menuId : void 0,
4030
+ "aria-expanded": isOpen ? true : void 0,
4031
+ "aria-label": "Show options",
4032
+ tabIndex,
4033
+ ref: triggerRef,
4034
+ children: [
4035
+ /* @__PURE__ */ jsxs10(DropdownTriggerContent, { children: [
4036
+ label && iconPosition === "after" && /* @__PURE__ */ jsx18(DropdownTriggerLabel, { children: label }),
4037
+ icon && /* @__PURE__ */ jsx18(
4038
+ DropdownTriggerIcon,
4039
+ {
4040
+ disabled,
4041
+ role: typeof icon === "string" ? void 0 : "img",
4042
+ "aria-hidden": true,
4043
+ children: typeof icon === "string" ? /* @__PURE__ */ jsx18(Icon_default, { icon }) : icon
4044
+ }
4045
+ ),
4046
+ label && iconPosition === "before" && /* @__PURE__ */ jsx18(DropdownTriggerLabel, { children: label })
4047
+ ] }),
4048
+ !caretHidden && /* @__PURE__ */ jsxs10(CaretIcon, { disabled, children: [
4049
+ /* @__PURE__ */ jsx18(Icon_default, { icon: isOpen ? "arrow_drop_up" : "arrow_drop_down" }),
4050
+ " "
4051
+ ] })
4052
+ ]
4053
+ }
4054
+ ) }) }),
4055
+ /* @__PURE__ */ jsx18(Popover.Portal, { container: document.getElementById(`${id}-portal`), children: /* @__PURE__ */ jsx18(Popover.Content, { asChild: true, sideOffset: 1, children: /* @__PURE__ */ jsx18(
4056
+ DropdownMenu_default,
4057
+ {
4058
+ id: menuId,
4059
+ dropdownTriggerId: triggerId,
4060
+ options,
4061
+ iconsPosition: optionsIconPosition,
4062
+ visualFocusIndex,
4063
+ menuItemOnClick: handleMenuItemOnClick,
4064
+ onKeyDown: handleMenuOnKeyDown,
4065
+ styles: { width, zIndex: "320" },
4066
+ ref: menuRef
4067
+ }
4068
+ ) }) })
4069
+ ] })
4070
+ }
4071
+ ),
4072
+ /* @__PURE__ */ jsx18("div", { id: `${id}-portal`, style: { position: "absolute" } })
4073
+ ] });
4065
4074
  };
4066
4075
  var sizes = {
4067
4076
  small: "60px",
@@ -4190,8 +4199,8 @@ var DxcHeader = ({
4190
4199
  margin,
4191
4200
  tabIndex = 0
4192
4201
  }) => {
4193
- const [isResponsive, setIsResponsive] = useState6(false);
4194
- const [isMenuVisible, setIsMenuVisible] = useState6(false);
4202
+ const [isResponsive, setIsResponsive] = useState7(false);
4203
+ const [isMenuVisible, setIsMenuVisible] = useState7(false);
4195
4204
  const colorsTheme = useContext8(HalstackContext);
4196
4205
  const translatedLabels = useContext8(HalstackLanguageContext);
4197
4206
  const ref = useRef3(null);
@@ -4210,7 +4219,7 @@ var DxcHeader = ({
4210
4219
  () => getLogoElement(colorsTheme.header.logoResponsive, translatedLabels.formFields.logoAlternativeText),
4211
4220
  [colorsTheme, translatedLabels]
4212
4221
  );
4213
- useEffect3(() => {
4222
+ useEffect4(() => {
4214
4223
  const handleResize = () => {
4215
4224
  setIsResponsive(window.matchMedia(`(max-width: ${responsiveSizes.medium}rem)`).matches);
4216
4225
  };
@@ -4220,7 +4229,7 @@ var DxcHeader = ({
4220
4229
  window.removeEventListener("resize", handleResize);
4221
4230
  };
4222
4231
  }, []);
4223
- useEffect3(() => {
4232
+ useEffect4(() => {
4224
4233
  if (!isResponsive) {
4225
4234
  setIsMenuVisible(false);
4226
4235
  }
@@ -4417,7 +4426,7 @@ var Overlay2 = styled16.div`
4417
4426
  var Header_default = DxcHeader;
4418
4427
 
4419
4428
  // src/sidenav/Sidenav.tsx
4420
- import { forwardRef as forwardRef3, useContext as useContext10, useEffect as useEffect4, useState as useState7 } from "react";
4429
+ import { forwardRef as forwardRef4, useContext as useContext10, useEffect as useEffect5, useState as useState8 } from "react";
4421
4430
  import styled18, { ThemeProvider as ThemeProvider8 } from "styled-components";
4422
4431
 
4423
4432
  // src/bleed/Bleed.tsx
@@ -4472,8 +4481,8 @@ var Section = ({ children }) => /* @__PURE__ */ jsxs12(Fragment6, { children: [
4472
4481
  /* @__PURE__ */ jsx21(Divider, {})
4473
4482
  ] });
4474
4483
  var Group = ({ title, collapsable = false, icon, children }) => {
4475
- const [collapsed, setCollapsed] = useState7(false);
4476
- const [isSelected, changeIsSelected] = useState7(false);
4484
+ const [collapsed, setCollapsed] = useState8(false);
4485
+ const [isSelected, changeIsSelected] = useState8(false);
4477
4486
  return /* @__PURE__ */ jsx21(GroupContextProvider, { value: changeIsSelected, children: /* @__PURE__ */ jsxs12(SidenavGroup, { children: [
4478
4487
  collapsable && title ? /* @__PURE__ */ jsxs12(
4479
4488
  SidenavGroupTitleButton,
@@ -4496,7 +4505,7 @@ var Group = ({ title, collapsable = false, icon, children }) => {
4496
4505
  !collapsed && children
4497
4506
  ] }) });
4498
4507
  };
4499
- var Link = forwardRef3(
4508
+ var Link = forwardRef4(
4500
4509
  ({ href, newWindow = false, selected = false, icon, onClick, tabIndex = 0, children, ...otherProps }, ref) => {
4501
4510
  const changeIsGroupSelected = useContext10(GroupContext);
4502
4511
  const setIsSidenavVisibleResponsive = useResponsiveSidenavVisibility();
@@ -4504,7 +4513,7 @@ var Link = forwardRef3(
4504
4513
  onClick?.($event);
4505
4514
  setIsSidenavVisibleResponsive?.(false);
4506
4515
  };
4507
- useEffect4(() => {
4516
+ useEffect5(() => {
4508
4517
  changeIsGroupSelected?.((isGroupSelected2) => !isGroupSelected2 ? selected : isGroupSelected2);
4509
4518
  }, [selected, changeIsGroupSelected]);
4510
4519
  return /* @__PURE__ */ jsxs12(
@@ -4678,7 +4687,7 @@ DxcSidenav.Title = Title2;
4678
4687
  var Sidenav_default = DxcSidenav;
4679
4688
 
4680
4689
  // src/layout/utils.tsx
4681
- import { Children as Children2, isValidElement, useState as useState8, useEffect as useEffect5 } from "react";
4690
+ import { Children as Children2, isValidElement, useState as useState9, useEffect as useEffect6 } from "react";
4682
4691
 
4683
4692
  // src/layout/Icons.tsx
4684
4693
  import { jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
@@ -4767,8 +4776,8 @@ var socialLinks = [
4767
4776
  ];
4768
4777
  var findChildType = (children, childType) => Children2.toArray(children).find((child) => isValidElement(child) && child.type === childType);
4769
4778
  var useResponsive = (breakpoint) => {
4770
- const [isResponsive, setIsResponsive] = useState8(false);
4771
- useEffect5(() => {
4779
+ const [isResponsive, setIsResponsive] = useState9(false);
4780
+ useEffect6(() => {
4772
4781
  const handleResize = () => {
4773
4782
  setIsResponsive(window.matchMedia(`(max-width: ${breakpoint}rem)`).matches);
4774
4783
  };
@@ -4880,14 +4889,14 @@ var DxcApplicationLayout = ({
4880
4889
  footer,
4881
4890
  children
4882
4891
  }) => {
4883
- const [isSidenavVisibleResponsive, setIsSidenavVisibleResponsive] = useState9(false);
4892
+ const [isSidenavVisibleResponsive, setIsSidenavVisibleResponsive] = useState10(false);
4884
4893
  const isResponsive = useResponsive(responsiveSizes.large);
4885
4894
  const ref = useRef4(null);
4886
4895
  const translatedLabels = useContext11(HalstackLanguageContext);
4887
4896
  const handleSidenavVisibility = () => {
4888
4897
  setIsSidenavVisibleResponsive((currentIsSidenavVisibleResponsive) => !currentIsSidenavVisibleResponsive);
4889
4898
  };
4890
- useEffect6(() => {
4899
+ useEffect7(() => {
4891
4900
  if (!isResponsive) {
4892
4901
  setIsSidenavVisibleResponsive(false);
4893
4902
  }
@@ -5129,10 +5138,9 @@ var Item = ({ isCurrentPage = false, href, label, onClick }) => {
5129
5138
  }
5130
5139
  };
5131
5140
  const handleOnClick = (event) => {
5141
+ if (typeof onClick !== "function") return;
5132
5142
  event.preventDefault();
5133
- if (href) {
5134
- onClick?.(href);
5135
- }
5143
+ if (href) onClick(href);
5136
5144
  };
5137
5145
  return /* @__PURE__ */ jsx25(ListItem, { "aria-current": isCurrentPage ? "page" : void 0, isCurrentPage, children: isCurrentPage ? /* @__PURE__ */ jsx25(CurrentPage, { ref: currentItemRef, onMouseEnter: handleOnMouseEnter, children: label }) : /* @__PURE__ */ jsx25(Link2, { href, onClick: handleOnClick, children: /* @__PURE__ */ jsx25(Text, { children: label }) }) });
5138
5146
  };
@@ -5380,7 +5388,7 @@ var ListItem2 = styled24.li`
5380
5388
  var BulletedList_default = DxcBulletedList;
5381
5389
 
5382
5390
  // src/card/Card.tsx
5383
- import { useContext as useContext14, useState as useState10 } from "react";
5391
+ import { useContext as useContext14, useState as useState11 } from "react";
5384
5392
  import styled25, { ThemeProvider as ThemeProvider10 } from "styled-components";
5385
5393
  import { jsx as jsx29, jsxs as jsxs18 } from "react/jsx-runtime";
5386
5394
  var DxcCard = ({
@@ -5397,7 +5405,7 @@ var DxcCard = ({
5397
5405
  children
5398
5406
  }) => {
5399
5407
  const colorsTheme = useContext14(HalstackContext);
5400
- const [isHovered, changeIsHovered] = useState10(false);
5408
+ const [isHovered, changeIsHovered] = useState11(false);
5401
5409
  return /* @__PURE__ */ jsx29(ThemeProvider10, { theme: colorsTheme.card, children: /* @__PURE__ */ jsx29(
5402
5410
  Card,
5403
5411
  {
@@ -5463,11 +5471,11 @@ var CardContent = styled25.div`
5463
5471
  var Card_default = DxcCard;
5464
5472
 
5465
5473
  // src/checkbox/Checkbox.tsx
5466
- import { useContext as useContext15, useState as useState11, useRef as useRef6, useId as useId4, forwardRef as forwardRef4 } from "react";
5474
+ import { useContext as useContext15, useState as useState12, useRef as useRef6, useId as useId5, forwardRef as forwardRef5 } from "react";
5467
5475
  import styled26, { ThemeProvider as ThemeProvider11 } from "styled-components";
5468
5476
  import { jsx as jsx30, jsxs as jsxs19 } from "react/jsx-runtime";
5469
5477
  var checkedIcon = /* @__PURE__ */ jsx30("svg", { fill: "currentColor", focusable: "false", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx30("path", { d: "M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" }) });
5470
- var DxcCheckbox = forwardRef4(
5478
+ var DxcCheckbox = forwardRef5(
5471
5479
  ({
5472
5480
  checked,
5473
5481
  defaultChecked = false,
@@ -5484,8 +5492,8 @@ var DxcCheckbox = forwardRef4(
5484
5492
  tabIndex = 0,
5485
5493
  ariaLabel = "Checkbox"
5486
5494
  }, ref) => {
5487
- const labelId = `label-checkbox-${useId4()}`;
5488
- const [innerChecked, setInnerChecked] = useState11(defaultChecked);
5495
+ const labelId = `label-checkbox-${useId5()}`;
5496
+ const [innerChecked, setInnerChecked] = useState12(defaultChecked);
5489
5497
  const checkboxRef = useRef6(null);
5490
5498
  const colorsTheme = useContext15(HalstackContext);
5491
5499
  const translatedLabels = useContext15(HalstackLanguageContext);
@@ -5790,21 +5798,21 @@ var IconContainer5 = styled27.div`
5790
5798
  var Chip_default = DxcChip;
5791
5799
 
5792
5800
  // src/contextual-menu/ContextualMenu.tsx
5793
- import { useContext as useContext19, useLayoutEffect as useLayoutEffect3, useMemo as useMemo8, useRef as useRef7, useState as useState14 } from "react";
5801
+ import { useContext as useContext19, useLayoutEffect as useLayoutEffect3, useMemo as useMemo8, useRef as useRef7, useState as useState15 } from "react";
5794
5802
  import styled31, { ThemeProvider as ThemeProvider13 } from "styled-components";
5795
5803
 
5796
5804
  // src/contextual-menu/MenuItem.tsx
5797
5805
  import styled29 from "styled-components";
5798
5806
 
5799
5807
  // src/contextual-menu/GroupItem.tsx
5800
- import { useContext as useContext17, useMemo as useMemo7, useState as useState13, memo as memo4, useId as useId5 } from "react";
5808
+ import { useContext as useContext17, useMemo as useMemo7, useState as useState14, memo as memo4, useId as useId6 } from "react";
5801
5809
 
5802
5810
  // src/contextual-menu/ItemAction.tsx
5803
- import { cloneElement as cloneElement2, useState as useState12 } from "react";
5811
+ import { cloneElement as cloneElement2, useState as useState13 } from "react";
5804
5812
  import styled28 from "styled-components";
5805
5813
  import { jsx as jsx32, jsxs as jsxs21 } from "react/jsx-runtime";
5806
5814
  var ItemAction = ({ badge, collapseIcon, icon, label, depthLevel, ...props }) => {
5807
- const [hasTooltip, setHasTooltip] = useState12(false);
5815
+ const [hasTooltip, setHasTooltip] = useState13(false);
5808
5816
  const modifiedBadge = badge && cloneElement2(badge, { size: "small" });
5809
5817
  return /* @__PURE__ */ jsx32(TooltipWrapper, { condition: hasTooltip, label, children: /* @__PURE__ */ jsxs21(Action, { depthLevel, ...props, children: [
5810
5818
  /* @__PURE__ */ jsxs21(Label2, { children: [
@@ -5892,10 +5900,10 @@ var isGroupSelected = (items, selectedItemId) => items.some((item) => {
5892
5900
  else return item.selectedByDefault;
5893
5901
  });
5894
5902
  var GroupItem = ({ items, ...props }) => {
5895
- const groupMenuId = `group-menu-${useId5()}`;
5903
+ const groupMenuId = `group-menu-${useId6()}`;
5896
5904
  const { selectedItemId } = useContext17(ContextualMenuContext_default) ?? {};
5897
5905
  const groupSelected = useMemo7(() => isGroupSelected(items, selectedItemId), [items, selectedItemId]);
5898
- const [isOpen, setIsOpen] = useState13(groupSelected && selectedItemId === -1);
5906
+ const [isOpen, setIsOpen] = useState14(groupSelected && selectedItemId === -1);
5899
5907
  return /* @__PURE__ */ jsxs22(Fragment10, { children: [
5900
5908
  /* @__PURE__ */ jsx33(
5901
5909
  ItemAction_default,
@@ -5917,7 +5925,7 @@ var GroupItem = ({ items, ...props }) => {
5917
5925
  var GroupItem_default = memo4(GroupItem);
5918
5926
 
5919
5927
  // src/contextual-menu/SingleItem.tsx
5920
- import { useContext as useContext18, useEffect as useEffect7 } from "react";
5928
+ import { useContext as useContext18, useEffect as useEffect8 } from "react";
5921
5929
  import { jsx as jsx34 } from "react/jsx-runtime";
5922
5930
  var SingleItem = ({ id, onSelect, selectedByDefault = false, ...props }) => {
5923
5931
  const { selectedItemId, setSelectedItemId } = useContext18(ContextualMenuContext_default) ?? {};
@@ -5925,7 +5933,7 @@ var SingleItem = ({ id, onSelect, selectedByDefault = false, ...props }) => {
5925
5933
  setSelectedItemId?.(id);
5926
5934
  onSelect?.();
5927
5935
  };
5928
- useEffect7(() => {
5936
+ useEffect8(() => {
5929
5937
  if (selectedItemId === -1 && selectedByDefault) {
5930
5938
  setSelectedItemId?.(id);
5931
5939
  }
@@ -5953,10 +5961,10 @@ var MenuItem_default = MenuItem;
5953
5961
 
5954
5962
  // src/contextual-menu/Section.tsx
5955
5963
  import styled30 from "styled-components";
5956
- import { useId as useId6 } from "react";
5964
+ import { useId as useId7 } from "react";
5957
5965
  import { jsx as jsx36, jsxs as jsxs23 } from "react/jsx-runtime";
5958
5966
  var Section2 = ({ section, index, length }) => {
5959
- const id = `section-${useId6()}`;
5967
+ const id = `section-${useId7()}`;
5960
5968
  return /* @__PURE__ */ jsxs23("section", { "aria-label": section.title ?? id, "aria-labelledby": id, children: [
5961
5969
  section.title && /* @__PURE__ */ jsx36(Title3, { id, children: section.title }),
5962
5970
  /* @__PURE__ */ jsx36(SubMenu, { children: section.items.map((item, index2) => /* @__PURE__ */ jsx36(MenuItem_default, { item }, `${item.label}-${index2}`)) }),
@@ -6023,12 +6031,12 @@ var addIdToItems = (items) => {
6023
6031
  };
6024
6032
  var SubMenu = ({ children, id }) => /* @__PURE__ */ jsx37(StyledSubMenu, { id, role: "menu", children });
6025
6033
  function DxcContextualMenu({ items }) {
6026
- const [selectedItemId, setSelectedItemId] = useState14(-1);
6034
+ const [selectedItemId, setSelectedItemId] = useState15(-1);
6027
6035
  const contextualMenuRef = useRef7(null);
6028
6036
  const itemsWithId = useMemo8(() => addIdToItems(items), [items]);
6029
6037
  const contextValue = useMemo8(() => ({ selectedItemId, setSelectedItemId }), [selectedItemId, setSelectedItemId]);
6030
6038
  const colorsTheme = useContext19(HalstackContext);
6031
- const [firstUpdate, setFirstUpdate] = useState14(true);
6039
+ const [firstUpdate, setFirstUpdate] = useState15(true);
6032
6040
  useLayoutEffect3(() => {
6033
6041
  if (selectedItemId !== -1 && firstUpdate) {
6034
6042
  const contextualMenuEl = contextualMenuRef.current;
@@ -6043,17 +6051,17 @@ function DxcContextualMenu({ items }) {
6043
6051
  }
6044
6052
 
6045
6053
  // src/data-grid/DataGrid.tsx
6046
- import { useContext as useContext25, useEffect as useEffect8, useMemo as useMemo11, useState as useState18 } from "react";
6054
+ import { useContext as useContext25, useEffect as useEffect9, useMemo as useMemo11, useState as useState19 } from "react";
6047
6055
  import DataGrid from "react-data-grid";
6048
6056
  import styled38, { ThemeProvider as ThemeProvider18 } from "styled-components";
6049
6057
  import "react-data-grid/lib/styles.css";
6050
6058
 
6051
6059
  // src/data-grid/utils.tsx
6052
- import { useState as useState15 } from "react";
6060
+ import { useState as useState16 } from "react";
6053
6061
  import { textEditor } from "react-data-grid";
6054
6062
 
6055
6063
  // src/spinner/Spinner.tsx
6056
- import { useContext as useContext20, useId as useId7, useMemo as useMemo9 } from "react";
6064
+ import { useContext as useContext20, useId as useId8, useMemo as useMemo9 } from "react";
6057
6065
  import styled32, { ThemeProvider as ThemeProvider14 } from "styled-components";
6058
6066
  import { jsx as jsx38, jsxs as jsxs24 } from "react/jsx-runtime";
6059
6067
  var DxcSpinner = ({
@@ -6064,7 +6072,7 @@ var DxcSpinner = ({
6064
6072
  margin,
6065
6073
  ariaLabel = "Spinner"
6066
6074
  }) => {
6067
- const labelId = useId7();
6075
+ const labelId = useId8();
6068
6076
  const colorsTheme = useContext20(HalstackContext);
6069
6077
  const determinated = useMemo9(() => value != null && value >= 0 && value <= 100, [value]);
6070
6078
  return /* @__PURE__ */ jsx38(ThemeProvider14, { theme: colorsTheme.spinner, children: /* @__PURE__ */ jsx38(DXCSpinner, { margin, mode, children: /* @__PURE__ */ jsxs24(SpinnerContainer, { mode, children: [
@@ -6324,7 +6332,7 @@ var renderExpandableTrigger = (row, rows, uniqueRowId, setRowsToRender) => /* @_
6324
6332
  }
6325
6333
  );
6326
6334
  var renderHierarchyTrigger = (rows, triggerRow, uniqueRowId, columnKey, setRowsToRender, childrenTrigger) => {
6327
- const [loading, setLoading] = useState15(false);
6335
+ const [loading, setLoading] = useState16(false);
6328
6336
  const onClick = async () => {
6329
6337
  if (loading) return;
6330
6338
  if (!triggerRow.visibleChildren) {
@@ -6609,13 +6617,13 @@ import styled36, { ThemeProvider as ThemeProvider16 } from "styled-components";
6609
6617
  // src/select/Select.tsx
6610
6618
  import * as Popover2 from "@radix-ui/react-popover";
6611
6619
  import {
6612
- forwardRef as forwardRef5,
6620
+ forwardRef as forwardRef6,
6613
6621
  useCallback as useCallback6,
6614
6622
  useContext as useContext22,
6615
- useId as useId8,
6623
+ useId as useId9,
6616
6624
  useMemo as useMemo10,
6617
6625
  useRef as useRef9,
6618
- useState as useState17
6626
+ useState as useState18
6619
6627
  } from "react";
6620
6628
  import styled35, { ThemeProvider as ThemeProvider15 } from "styled-components";
6621
6629
 
@@ -6625,7 +6633,7 @@ import styled34 from "styled-components";
6625
6633
 
6626
6634
  // src/select/ListOption.tsx
6627
6635
  import styled33 from "styled-components";
6628
- import { useState as useState16 } from "react";
6636
+ import { useState as useState17 } from "react";
6629
6637
  import { jsx as jsx40, jsxs as jsxs26 } from "react/jsx-runtime";
6630
6638
  var ListOption = ({
6631
6639
  id,
@@ -6637,7 +6645,7 @@ var ListOption = ({
6637
6645
  isLastOption,
6638
6646
  isSelected
6639
6647
  }) => {
6640
- const [hasTooltip, setHasTooltip] = useState16(false);
6648
+ const [hasTooltip, setHasTooltip] = useState17(false);
6641
6649
  const handleOnMouseEnter = (event) => {
6642
6650
  const text = event.currentTarget;
6643
6651
  setHasTooltip(text.scrollWidth > text.clientWidth);
@@ -6735,22 +6743,21 @@ var isOptionGroup = (option) => "options" in option && option.options != null;
6735
6743
  var isArrayOfOptionGroups = (options) => options[0] != null && isOptionGroup(options[0]);
6736
6744
  var groupsHaveOptions = (options) => isArrayOfOptionGroups(options) ? options.some((groupOption) => groupOption.options.length > 0) : true;
6737
6745
  var canOpenListbox = (options, disabled) => !disabled && options.length > 0 && groupsHaveOptions(options);
6738
- var filterOptionsBySearchValue = (options, searchValue) => {
6739
- if (options.length > 0) {
6740
- if (isArrayOfOptionGroups(options))
6741
- return options.map((optionGroup) => {
6742
- const group = {
6743
- label: optionGroup.label,
6744
- options: optionGroup.options.filter(
6745
- (option) => option.label.toUpperCase().includes(searchValue.toUpperCase())
6746
- )
6747
- };
6748
- return group;
6749
- });
6750
- else return options.filter((option) => option.label.toUpperCase().includes(searchValue.toUpperCase()));
6751
- } else {
6752
- return [];
6753
- }
6746
+ var filterOptionsBySearchValue = (options, searchValue, searchByStartsWith = false) => {
6747
+ const matchesSearch = (label, search, searchByStartsWith2) => {
6748
+ const upperLabel = label.toUpperCase();
6749
+ const upperSearch = search.toUpperCase();
6750
+ return searchByStartsWith2 ? upperLabel.startsWith(upperSearch) : upperLabel.includes(upperSearch);
6751
+ };
6752
+ return options.length > 0 ? isArrayOfOptionGroups(options) ? options.map((optionGroup) => {
6753
+ const group = {
6754
+ label: optionGroup.label,
6755
+ options: optionGroup.options.filter(
6756
+ (option) => matchesSearch(option.label, searchValue, searchByStartsWith)
6757
+ )
6758
+ };
6759
+ return group;
6760
+ }) : options.filter((option) => matchesSearch(option.label, searchValue, searchByStartsWith)) : [];
6754
6761
  };
6755
6762
  var getLastOptionIndex = (options, filteredOptions, searchable, optional, multiple) => {
6756
6763
  let last = 0;
@@ -6975,7 +6982,7 @@ var Listbox_default = Listbox;
6975
6982
 
6976
6983
  // src/select/Select.tsx
6977
6984
  import { jsx as jsx42, jsxs as jsxs28 } from "react/jsx-runtime";
6978
- var DxcSelect = forwardRef5(
6985
+ var DxcSelect = forwardRef6(
6979
6986
  ({
6980
6987
  label,
6981
6988
  name = "",
@@ -6988,6 +6995,7 @@ var DxcSelect = forwardRef5(
6988
6995
  multiple = false,
6989
6996
  optional = false,
6990
6997
  searchable = false,
6998
+ searchByStartsWith = false,
6991
6999
  onChange,
6992
7000
  onBlur,
6993
7001
  error,
@@ -6996,22 +7004,22 @@ var DxcSelect = forwardRef5(
6996
7004
  tabIndex = 0,
6997
7005
  ariaLabel = "Select"
6998
7006
  }, ref) => {
6999
- const selectId = `select-${useId8()}`;
7007
+ const selectId = `select-${useId9()}`;
7000
7008
  const selectLabelId = `label-${selectId}`;
7001
7009
  const errorId = `error-${selectId}`;
7002
7010
  const listboxId = `${selectId}-listbox`;
7003
- const [innerValue, setInnerValue] = useState17(defaultValue ?? (multiple ? [] : ""));
7004
- const [searchValue, setSearchValue] = useState17("");
7005
- const [visualFocusIndex, changeVisualFocusIndex] = useState17(-1);
7006
- const [isOpen, changeIsOpen] = useState17(false);
7007
- const [hasTooltip, setHasTooltip] = useState17(false);
7011
+ const [innerValue, setInnerValue] = useState18(defaultValue ?? (multiple ? [] : ""));
7012
+ const [searchValue, setSearchValue] = useState18("");
7013
+ const [visualFocusIndex, changeVisualFocusIndex] = useState18(-1);
7014
+ const [isOpen, changeIsOpen] = useState18(false);
7015
+ const [hasTooltip, setHasTooltip] = useState18(false);
7008
7016
  const selectRef = useRef9(null);
7009
7017
  const selectSearchInputRef = useRef9(null);
7010
7018
  const width = useWidth_default(selectRef.current);
7011
7019
  const colorsTheme = useContext22(HalstackContext);
7012
7020
  const translatedLabels = useContext22(HalstackLanguageContext);
7013
7021
  const optionalItem = { label: placeholder, value: "" };
7014
- const filteredOptions = useMemo10(() => filterOptionsBySearchValue(options, searchValue), [options, searchValue]);
7022
+ const filteredOptions = useMemo10(() => filterOptionsBySearchValue(options, searchValue, searchByStartsWith), [options, searchValue, searchByStartsWith]);
7015
7023
  const lastOptionIndex = useMemo10(
7016
7024
  () => getLastOptionIndex(options, filteredOptions, searchable, optional, multiple),
7017
7025
  [options, filteredOptions, searchable, optional, multiple]
@@ -7202,148 +7210,151 @@ var DxcSelect = forwardRef5(
7202
7210
  const text = event.currentTarget;
7203
7211
  setHasTooltip(text.scrollWidth > text.clientWidth);
7204
7212
  };
7205
- return /* @__PURE__ */ jsx42(ThemeProvider15, { theme: colorsTheme.select, children: /* @__PURE__ */ jsxs28(SelectContainer, { margin, size, ref, children: [
7206
- label && /* @__PURE__ */ jsxs28(
7207
- Label3,
7208
- {
7209
- id: selectLabelId,
7210
- disabled,
7211
- onClick: () => {
7212
- selectRef?.current?.focus();
7213
- },
7214
- helperText,
7215
- children: [
7216
- label,
7217
- " ",
7218
- optional && /* @__PURE__ */ jsx42(OptionalLabel, { children: translatedLabels.formFields.optionalLabel })
7219
- ]
7220
- }
7221
- ),
7222
- helperText && /* @__PURE__ */ jsx42(HelperText, { disabled, children: helperText }),
7223
- /* @__PURE__ */ jsxs28(Popover2.Root, { open: isOpen, children: [
7224
- /* @__PURE__ */ jsx42(Popover2.Trigger, { asChild: true, type: void 0, children: /* @__PURE__ */ jsxs28(
7225
- Select,
7213
+ return /* @__PURE__ */ jsxs28(ThemeProvider15, { theme: colorsTheme.select, children: [
7214
+ /* @__PURE__ */ jsxs28(SelectContainer, { margin, size, ref, children: [
7215
+ label && /* @__PURE__ */ jsxs28(
7216
+ Label3,
7226
7217
  {
7227
- id: selectId,
7218
+ id: selectLabelId,
7228
7219
  disabled,
7229
- error,
7230
- onBlur: handleSelectOnBlur,
7231
- onClick: handleSelectOnClick,
7232
- onFocus: handleSelectOnFocus,
7233
- onKeyDown: handleSelectOnKeyDown,
7234
- ref: selectRef,
7235
- tabIndex: disabled ? -1 : tabIndex,
7236
- role: "combobox",
7237
- "aria-controls": isOpen ? listboxId : void 0,
7238
- "aria-disabled": disabled,
7239
- "aria-expanded": isOpen,
7240
- "aria-haspopup": "listbox",
7241
- "aria-labelledby": label ? selectLabelId : void 0,
7242
- "aria-activedescendant": visualFocusIndex >= 0 ? `option-${visualFocusIndex}` : void 0,
7243
- "aria-invalid": !!error,
7244
- "aria-errormessage": error ? errorId : void 0,
7245
- "aria-required": !disabled && !optional,
7246
- "aria-label": label ? void 0 : ariaLabel,
7220
+ onClick: () => {
7221
+ selectRef?.current?.focus();
7222
+ },
7223
+ helperText,
7247
7224
  children: [
7248
- multiple && Array.isArray(selectedOption) && selectedOption.length > 0 && /* @__PURE__ */ jsxs28(SelectionIndicator, { children: [
7249
- /* @__PURE__ */ jsx42(SelectionNumber, { disabled, children: selectedOption.length }),
7250
- /* @__PURE__ */ jsx42(Tooltip, { label: translatedLabels.select.actionClearSelectionTitle, children: /* @__PURE__ */ jsx42(
7251
- ClearOptionsAction,
7225
+ label,
7226
+ " ",
7227
+ optional && /* @__PURE__ */ jsx42(OptionalLabel, { children: translatedLabels.formFields.optionalLabel })
7228
+ ]
7229
+ }
7230
+ ),
7231
+ helperText && /* @__PURE__ */ jsx42(HelperText, { disabled, children: helperText }),
7232
+ /* @__PURE__ */ jsxs28(Popover2.Root, { open: isOpen, children: [
7233
+ /* @__PURE__ */ jsx42(Popover2.Trigger, { asChild: true, type: void 0, children: /* @__PURE__ */ jsxs28(
7234
+ Select,
7235
+ {
7236
+ id: selectId,
7237
+ disabled,
7238
+ error,
7239
+ onBlur: handleSelectOnBlur,
7240
+ onClick: handleSelectOnClick,
7241
+ onFocus: handleSelectOnFocus,
7242
+ onKeyDown: handleSelectOnKeyDown,
7243
+ ref: selectRef,
7244
+ tabIndex: disabled ? -1 : tabIndex,
7245
+ role: "combobox",
7246
+ "aria-controls": isOpen ? listboxId : void 0,
7247
+ "aria-disabled": disabled,
7248
+ "aria-expanded": isOpen,
7249
+ "aria-haspopup": "listbox",
7250
+ "aria-labelledby": label ? selectLabelId : void 0,
7251
+ "aria-activedescendant": visualFocusIndex >= 0 ? `option-${visualFocusIndex}` : void 0,
7252
+ "aria-invalid": !!error,
7253
+ "aria-errormessage": error ? errorId : void 0,
7254
+ "aria-required": !disabled && !optional,
7255
+ "aria-label": label ? void 0 : ariaLabel,
7256
+ children: [
7257
+ multiple && Array.isArray(selectedOption) && selectedOption.length > 0 && /* @__PURE__ */ jsxs28(SelectionIndicator, { children: [
7258
+ /* @__PURE__ */ jsx42(SelectionNumber, { disabled, children: selectedOption.length }),
7259
+ /* @__PURE__ */ jsx42(TooltipWrapper, { condition: !disabled, label: translatedLabels.select.actionClearSelectionTitle, children: /* @__PURE__ */ jsx42(
7260
+ ClearOptionsAction,
7261
+ {
7262
+ disabled,
7263
+ onMouseDown: (event) => {
7264
+ event.preventDefault();
7265
+ },
7266
+ onClick: handleClearOptionsActionOnClick,
7267
+ tabIndex: -1,
7268
+ "aria-label": translatedLabels.select.actionClearSelectionTitle,
7269
+ children: /* @__PURE__ */ jsx42(Icon_default, { icon: "clear" })
7270
+ }
7271
+ ) })
7272
+ ] }),
7273
+ /* @__PURE__ */ jsx42(TooltipWrapper, { condition: hasTooltip, label: getSelectedOptionLabel(placeholder, selectedOption), children: /* @__PURE__ */ jsxs28(SearchableValueContainer, { children: [
7274
+ /* @__PURE__ */ jsx42(
7275
+ "input",
7276
+ {
7277
+ style: { display: "none" },
7278
+ name,
7279
+ disabled,
7280
+ value: multiple ? (Array.isArray(value) ? value : Array.isArray(innerValue) ? innerValue : []).join(",") : value ?? innerValue,
7281
+ readOnly: true,
7282
+ "aria-hidden": "true"
7283
+ }
7284
+ ),
7285
+ searchable && /* @__PURE__ */ jsx42(
7286
+ SearchInput,
7287
+ {
7288
+ value: searchValue,
7289
+ disabled,
7290
+ onChange: handleSearchIOnChange,
7291
+ ref: selectSearchInputRef,
7292
+ autoComplete: "nope",
7293
+ autoCorrect: "nope",
7294
+ size: 1,
7295
+ "aria-labelledby": label ? selectLabelId : void 0
7296
+ }
7297
+ ),
7298
+ (!searchable || searchValue === "") && /* @__PURE__ */ jsx42(
7299
+ SelectedOption,
7300
+ {
7301
+ disabled,
7302
+ atBackground: (multiple ? (value ?? innerValue).length === 0 : !(value ?? innerValue)) || searchable && isOpen,
7303
+ children: /* @__PURE__ */ jsx42(SelectedOptionLabel, { onMouseEnter: handleOnMouseEnter, children: getSelectedOptionLabel(placeholder, selectedOption) })
7304
+ }
7305
+ )
7306
+ ] }) }),
7307
+ !disabled && error && /* @__PURE__ */ jsx42(ErrorIcon, { children: /* @__PURE__ */ jsx42(Icon_default, { icon: "filled_error" }) }),
7308
+ searchable && searchValue.length > 0 && /* @__PURE__ */ jsx42(TooltipWrapper, { condition: !disabled, label: translatedLabels.select.actionClearSelectionTitle, children: /* @__PURE__ */ jsx42(
7309
+ ClearSearchAction,
7252
7310
  {
7253
- disabled,
7254
7311
  onMouseDown: (event) => {
7255
7312
  event.preventDefault();
7256
7313
  },
7257
- onClick: handleClearOptionsActionOnClick,
7314
+ onClick: handleClearSearchActionOnClick,
7258
7315
  tabIndex: -1,
7259
- "aria-label": translatedLabels.select.actionClearSelectionTitle,
7316
+ "aria-label": translatedLabels.select.actionClearSearchTitle,
7260
7317
  children: /* @__PURE__ */ jsx42(Icon_default, { icon: "clear" })
7261
7318
  }
7262
- ) })
7263
- ] }),
7264
- /* @__PURE__ */ jsx42(TooltipWrapper, { condition: hasTooltip, label: getSelectedOptionLabel(placeholder, selectedOption), children: /* @__PURE__ */ jsxs28(SearchableValueContainer, { children: [
7265
- /* @__PURE__ */ jsx42(
7266
- "input",
7267
- {
7268
- style: { display: "none" },
7269
- name,
7270
- disabled,
7271
- value: multiple ? (Array.isArray(value) ? value : Array.isArray(innerValue) ? innerValue : []).join(",") : value ?? innerValue,
7272
- readOnly: true,
7273
- "aria-hidden": "true"
7274
- }
7275
- ),
7276
- searchable && /* @__PURE__ */ jsx42(
7277
- SearchInput,
7278
- {
7279
- value: searchValue,
7280
- disabled,
7281
- onChange: handleSearchIOnChange,
7282
- ref: selectSearchInputRef,
7283
- autoComplete: "nope",
7284
- autoCorrect: "nope",
7285
- size: 1,
7286
- "aria-labelledby": label ? selectLabelId : void 0
7287
- }
7288
- ),
7289
- (!searchable || searchValue === "") && /* @__PURE__ */ jsx42(
7290
- SelectedOption,
7291
- {
7292
- disabled,
7293
- atBackground: (multiple ? (value ?? innerValue).length === 0 : !(value ?? innerValue)) || searchable && isOpen,
7294
- children: /* @__PURE__ */ jsx42(SelectedOptionLabel, { onMouseEnter: handleOnMouseEnter, children: getSelectedOptionLabel(placeholder, selectedOption) })
7295
- }
7296
- )
7297
- ] }) }),
7298
- !disabled && error && /* @__PURE__ */ jsx42(ErrorIcon, { children: /* @__PURE__ */ jsx42(Icon_default, { icon: "filled_error" }) }),
7299
- searchable && searchValue.length > 0 && /* @__PURE__ */ jsx42(Tooltip, { label: translatedLabels.select.actionClearSelectionTitle, children: /* @__PURE__ */ jsx42(
7300
- ClearSearchAction,
7319
+ ) }),
7320
+ /* @__PURE__ */ jsx42(CollapseIndicator2, { disabled, children: /* @__PURE__ */ jsx42(Icon_default, { icon: isOpen ? "keyboard_arrow_up" : "keyboard_arrow_down" }) })
7321
+ ]
7322
+ }
7323
+ ) }),
7324
+ /* @__PURE__ */ jsx42(Popover2.Portal, { container: document.getElementById(`${selectId}-portal`), children: /* @__PURE__ */ jsx42(
7325
+ Popover2.Content,
7326
+ {
7327
+ sideOffset: 4,
7328
+ style: { zIndex: "310" },
7329
+ onOpenAutoFocus: (event) => {
7330
+ event.preventDefault();
7331
+ },
7332
+ onCloseAutoFocus: (event) => {
7333
+ event.preventDefault();
7334
+ },
7335
+ children: /* @__PURE__ */ jsx42(
7336
+ Listbox_default,
7301
7337
  {
7302
- onMouseDown: (event) => {
7303
- event.preventDefault();
7304
- },
7305
- onClick: handleClearSearchActionOnClick,
7306
- tabIndex: -1,
7307
- "aria-label": translatedLabels.select.actionClearSearchTitle,
7308
- children: /* @__PURE__ */ jsx42(Icon_default, { icon: "clear" })
7338
+ id: listboxId,
7339
+ currentValue: value ?? innerValue,
7340
+ options: searchable ? filteredOptions : options,
7341
+ visualFocusIndex,
7342
+ lastOptionIndex,
7343
+ multiple,
7344
+ optional,
7345
+ optionalItem,
7346
+ searchable,
7347
+ handleOptionOnClick,
7348
+ styles: { width }
7309
7349
  }
7310
- ) }),
7311
- /* @__PURE__ */ jsx42(CollapseIndicator2, { disabled, children: /* @__PURE__ */ jsx42(Icon_default, { icon: isOpen ? "keyboard_arrow_up" : "keyboard_arrow_down" }) })
7312
- ]
7313
- }
7314
- ) }),
7315
- /* @__PURE__ */ jsx42(Popover2.Portal, { children: /* @__PURE__ */ jsx42(
7316
- Popover2.Content,
7317
- {
7318
- sideOffset: 4,
7319
- style: { zIndex: "310" },
7320
- onOpenAutoFocus: (event) => {
7321
- event.preventDefault();
7322
- },
7323
- onCloseAutoFocus: (event) => {
7324
- event.preventDefault();
7325
- },
7326
- children: /* @__PURE__ */ jsx42(
7327
- Listbox_default,
7328
- {
7329
- id: listboxId,
7330
- currentValue: value ?? innerValue,
7331
- options: searchable ? filteredOptions : options,
7332
- visualFocusIndex,
7333
- lastOptionIndex,
7334
- multiple,
7335
- optional,
7336
- optionalItem,
7337
- searchable,
7338
- handleOptionOnClick,
7339
- styles: { width }
7340
- }
7341
- )
7342
- }
7343
- ) })
7350
+ )
7351
+ }
7352
+ ) })
7353
+ ] }),
7354
+ !disabled && typeof error === "string" && /* @__PURE__ */ jsx42(Error2, { id: errorId, role: "alert", "aria-live": error ? "assertive" : "off", children: error })
7344
7355
  ] }),
7345
- !disabled && typeof error === "string" && /* @__PURE__ */ jsx42(Error2, { id: errorId, role: "alert", "aria-live": error ? "assertive" : "off", children: error })
7346
- ] }) });
7356
+ /* @__PURE__ */ jsx42("div", { id: `${selectId}-portal`, style: { position: "absolute" } })
7357
+ ] });
7347
7358
  }
7348
7359
  );
7349
7360
  var sizes3 = {
@@ -8054,9 +8065,9 @@ var DxcDataGrid = ({
8054
8065
  totalItems,
8055
8066
  defaultPage = 1
8056
8067
  }) => {
8057
- const [rowsToRender, setRowsToRender] = useState18([...rows]);
8068
+ const [rowsToRender, setRowsToRender] = useState19([...rows]);
8058
8069
  const colorsTheme = useContext25(HalstackContext);
8059
- const [page, changePage] = useState18(defaultPage);
8070
+ const [page, changePage] = useState19(defaultPage);
8060
8071
  const goToPage = (newPage) => {
8061
8072
  if (onPageChange) {
8062
8073
  onPageChange(newPage);
@@ -8139,12 +8150,12 @@ var DxcDataGrid = ({
8139
8150
  }
8140
8151
  return expectedColumns;
8141
8152
  }, [selectable, expandable, columns, rowsToRender, onSelectRows, rows, summaryRow, uniqueRowId, selectedRows]);
8142
- const [columnsOrder, setColumnsOrder] = useState18(() => columnsToRender.map((_, index) => index));
8143
- const [sortColumns, setSortColumns] = useState18([]);
8144
- useEffect8(() => {
8153
+ const [columnsOrder, setColumnsOrder] = useState19(() => columnsToRender.map((_, index) => index));
8154
+ const [sortColumns, setSortColumns] = useState19([]);
8155
+ useEffect9(() => {
8145
8156
  setColumnsOrder(Array.from({ length: columnsToRender.length }, (_, index) => index));
8146
8157
  }, [columnsToRender.length]);
8147
- useEffect8(() => {
8158
+ useEffect9(() => {
8148
8159
  const finalRows = [...rows];
8149
8160
  if (expandable) {
8150
8161
  finalRows.filter((row) => {
@@ -8267,13 +8278,13 @@ var DataGrid_default = DxcDataGrid;
8267
8278
 
8268
8279
  // src/date-input/DateInput.tsx
8269
8280
  import {
8270
- useState as useState23,
8281
+ useState as useState24,
8271
8282
  useRef as useRef12,
8272
- useEffect as useEffect13,
8273
- useId as useId12,
8283
+ useEffect as useEffect14,
8284
+ useId as useId13,
8274
8285
  useCallback as useCallback7,
8275
8286
  useContext as useContext30,
8276
- forwardRef as forwardRef7
8287
+ forwardRef as forwardRef8
8277
8288
  } from "react";
8278
8289
  import dayjs3 from "dayjs";
8279
8290
  import styled45, { ThemeProvider as ThemeProvider20 } from "styled-components";
@@ -8281,12 +8292,12 @@ import * as Popover4 from "@radix-ui/react-popover";
8281
8292
  import customParseFormat from "dayjs/plugin/customParseFormat";
8282
8293
 
8283
8294
  // src/date-input/DatePicker.tsx
8284
- import { memo as memo7, useContext as useContext27, useState as useState21 } from "react";
8295
+ import { memo as memo7, useContext as useContext27, useState as useState22 } from "react";
8285
8296
  import dayjs2 from "dayjs";
8286
8297
  import styled41 from "styled-components";
8287
8298
 
8288
8299
  // src/date-input/Calendar.tsx
8289
- import { useContext as useContext26, useState as useState19, useMemo as useMemo12, useEffect as useEffect9, useId as useId9, memo as memo5 } from "react";
8300
+ import { useContext as useContext26, useState as useState20, useMemo as useMemo12, useEffect as useEffect10, useId as useId10, memo as memo5 } from "react";
8290
8301
  import styled39 from "styled-components";
8291
8302
  import { jsx as jsx46, jsxs as jsxs32 } from "react/jsx-runtime";
8292
8303
  var getDays = (innerDate) => {
@@ -8330,9 +8341,9 @@ var Calendar = ({
8330
8341
  onDaySelect,
8331
8342
  today: today2
8332
8343
  }) => {
8333
- const [dateToFocus, setDateToFocus] = useState19(getDateToFocus(selectedDate, innerDate, today2));
8334
- const [isFocusable, setIsFocusable] = useState19(false);
8335
- const id = useId9();
8344
+ const [dateToFocus, setDateToFocus] = useState20(getDateToFocus(selectedDate, innerDate, today2));
8345
+ const [isFocusable, setIsFocusable] = useState20(false);
8346
+ const id = useId10();
8336
8347
  const translatedLabels = useContext26(HalstackLanguageContext);
8337
8348
  const dayCells = useMemo12(() => getDays(innerDate), [innerDate]);
8338
8349
  const onDateClickHandler = (date) => {
@@ -8352,13 +8363,13 @@ var Calendar = ({
8352
8363
  setDateToFocus(date);
8353
8364
  setIsFocusable(true);
8354
8365
  };
8355
- useEffect9(() => {
8366
+ useEffect10(() => {
8356
8367
  if (isFocusable) {
8357
8368
  document.getElementById(`${id}_day_${dateToFocus.get("date")}_month${dateToFocus.get("month")}`)?.focus();
8358
8369
  setIsFocusable(false);
8359
8370
  }
8360
8371
  }, [dateToFocus, isFocusable]);
8361
- useEffect9(() => {
8372
+ useEffect10(() => {
8362
8373
  if (dateToFocus.get("month") !== innerDate.get("month") || dateToFocus.get("year") !== innerDate.get("year")) {
8363
8374
  setDateToFocus(getDateToFocus(selectedDate, innerDate, today2));
8364
8375
  }
@@ -8523,7 +8534,7 @@ var Calendar_default = memo5(Calendar);
8523
8534
 
8524
8535
  // src/date-input/YearPicker.tsx
8525
8536
  import dayjs from "dayjs";
8526
- import { useEffect as useEffect10, useId as useId10, useState as useState20, memo as memo6 } from "react";
8537
+ import { useEffect as useEffect11, useId as useId11, useState as useState21, memo as memo6 } from "react";
8527
8538
  import styled40 from "styled-components";
8528
8539
  import { jsx as jsx47 } from "react/jsx-runtime";
8529
8540
  var getYearsArray = () => {
@@ -8535,9 +8546,9 @@ var getYearsArray = () => {
8535
8546
  };
8536
8547
  var yearList = getYearsArray();
8537
8548
  var YearPicker = ({ onYearSelect, selectedDate, today: today2 }) => {
8538
- const id = useId10();
8539
- const [yearToFocus, setYearToFocus] = useState20(selectedDate ? selectedDate.get("year") : dayjs().get("year"));
8540
- useEffect10(() => {
8549
+ const id = useId11();
8550
+ const [yearToFocus, setYearToFocus] = useState21(selectedDate ? selectedDate.get("year") : dayjs().get("year"));
8551
+ useEffect11(() => {
8541
8552
  const yearToFocusEl = document.getElementById(`${id}_year_${yearToFocus}`);
8542
8553
  yearToFocusEl?.scrollIntoView?.({ block: "nearest", inline: "start" });
8543
8554
  yearToFocusEl?.focus();
@@ -8630,8 +8641,8 @@ var YearPicker_default = memo6(YearPicker);
8630
8641
  import { jsx as jsx48, jsxs as jsxs33 } from "react/jsx-runtime";
8631
8642
  var today = dayjs2();
8632
8643
  var DatePicker = ({ date, onDateSelect, id }) => {
8633
- const [innerDate, setInnerDate] = useState21(date?.isValid() ? date : dayjs2());
8634
- const [content, setContent] = useState21("calendar");
8644
+ const [innerDate, setInnerDate] = useState22(date?.isValid() ? date : dayjs2());
8645
+ const [content, setContent] = useState22("calendar");
8635
8646
  const selectedDate = date?.isValid() ? date : dayjs2(null);
8636
8647
  const translatedLabels = useContext27(HalstackLanguageContext);
8637
8648
  const handleDateSelect = (chosenDate) => {
@@ -8764,12 +8775,12 @@ var DatePicker_default = memo7(DatePicker);
8764
8775
  // src/text-input/TextInput.tsx
8765
8776
  import * as Popover3 from "@radix-ui/react-popover";
8766
8777
  import {
8767
- forwardRef as forwardRef6,
8778
+ forwardRef as forwardRef7,
8768
8779
  useContext as useContext29,
8769
- useEffect as useEffect12,
8770
- useId as useId11,
8780
+ useEffect as useEffect13,
8781
+ useId as useId12,
8771
8782
  useRef as useRef11,
8772
- useState as useState22
8783
+ useState as useState23
8773
8784
  } from "react";
8774
8785
  import styled44, { ThemeProvider as ThemeProvider19 } from "styled-components";
8775
8786
 
@@ -8778,7 +8789,7 @@ import { createContext as createContext7 } from "react";
8778
8789
  var NumberInputContext_default = createContext7(null);
8779
8790
 
8780
8791
  // src/text-input/Suggestions.tsx
8781
- import { memo as memo9, useContext as useContext28, useEffect as useEffect11, useRef as useRef10 } from "react";
8792
+ import { memo as memo9, useContext as useContext28, useEffect as useEffect12, useRef as useRef10 } from "react";
8782
8793
  import styled43 from "styled-components";
8783
8794
 
8784
8795
  // src/text-input/Suggestion.tsx
@@ -8939,7 +8950,7 @@ var Suggestions = ({
8939
8950
  }) => {
8940
8951
  const translatedLabels = useContext28(HalstackLanguageContext);
8941
8952
  const listboxRef = useRef10(null);
8942
- useEffect11(() => {
8953
+ useEffect12(() => {
8943
8954
  const visualFocusedOptionEl = listboxRef?.current?.querySelectorAll("[role='option']")[visualFocusIndex];
8944
8955
  visualFocusedOptionEl?.scrollIntoView?.({
8945
8956
  block: "nearest",
@@ -9109,7 +9120,7 @@ var ErrorMessageContainer = styled44.span`
9109
9120
  margin-top: 0.25rem;
9110
9121
  `;
9111
9122
  var AutosuggestWrapper = ({ condition, wrapper, children }) => /* @__PURE__ */ jsx51(Fragment12, { children: condition ? wrapper(children) : children });
9112
- var DxcTextInput = forwardRef6(
9123
+ var DxcTextInput = forwardRef7(
9113
9124
  ({
9114
9125
  alignment = "left",
9115
9126
  label,
@@ -9138,7 +9149,7 @@ var DxcTextInput = forwardRef6(
9138
9149
  tabIndex = 0,
9139
9150
  ariaLabel = "Text input"
9140
9151
  }, ref) => {
9141
- const inputId = `input-${useId11()}`;
9152
+ const inputId = `input-${useId12()}`;
9142
9153
  const autosuggestId = `suggestions-${inputId}`;
9143
9154
  const errorId = `error-${inputId}`;
9144
9155
  const colorsTheme = useContext29(HalstackContext);
@@ -9147,12 +9158,12 @@ var DxcTextInput = forwardRef6(
9147
9158
  const inputRef = useRef11(null);
9148
9159
  const inputContainerRef = useRef11(null);
9149
9160
  const actionRef = useRef11(null);
9150
- const [innerValue, setInnerValue] = useState22(defaultValue);
9151
- const [isOpen, changeIsOpen] = useState22(false);
9152
- const [isSearching, changeIsSearching] = useState22(false);
9153
- const [isAutosuggestError, changeIsAutosuggestError] = useState22(false);
9154
- const [filteredSuggestions, changeFilteredSuggestions] = useState22([]);
9155
- const [visualFocusIndex, changeVisualFocusIndex] = useState22(-1);
9161
+ const [innerValue, setInnerValue] = useState23(defaultValue);
9162
+ const [isOpen, changeIsOpen] = useState23(false);
9163
+ const [isSearching, changeIsSearching] = useState23(false);
9164
+ const [isAutosuggestError, changeIsAutosuggestError] = useState23(false);
9165
+ const [filteredSuggestions, changeFilteredSuggestions] = useState23([]);
9166
+ const [visualFocusIndex, changeVisualFocusIndex] = useState23(-1);
9156
9167
  const width = useWidth_default(inputContainerRef.current);
9157
9168
  const getNumberErrorMessage = (checkedValue) => numberInputContext?.minNumber != null && checkedValue < numberInputContext?.minNumber ? translatedLabels.numberInput.valueGreaterThanOrEqualToErrorMessage?.(numberInputContext.minNumber) : numberInputContext?.maxNumber != null && checkedValue > numberInputContext?.maxNumber ? translatedLabels.numberInput.valueLessThanOrEqualToErrorMessage?.(numberInputContext.maxNumber) : void 0;
9158
9169
  const openSuggestions = () => {
@@ -9362,7 +9373,7 @@ var DxcTextInput = forwardRef6(
9362
9373
  inputRef.current?.setAttribute("type", type);
9363
9374
  }
9364
9375
  };
9365
- useEffect12(() => {
9376
+ useEffect13(() => {
9366
9377
  if (typeof suggestions === "function") {
9367
9378
  changeIsSearching(true);
9368
9379
  changeIsAutosuggestError(false);
@@ -9398,163 +9409,166 @@ var DxcTextInput = forwardRef6(
9398
9409
  }
9399
9410
  return void 0;
9400
9411
  }, [value, innerValue, suggestions, numberInputContext]);
9401
- return /* @__PURE__ */ jsx51(ThemeProvider19, { theme: colorsTheme.textInput, children: /* @__PURE__ */ jsxs36(TextInputContainer, { margin, size, ref, children: [
9402
- label && /* @__PURE__ */ jsxs36(Label4, { htmlFor: inputId, disabled, hasHelperText: !!helperText, children: [
9403
- label,
9404
- " ",
9405
- optional && /* @__PURE__ */ jsx51(OptionalLabel2, { children: translatedLabels.formFields.optionalLabel })
9406
- ] }),
9407
- helperText && /* @__PURE__ */ jsx51(HelperText2, { disabled, children: helperText }),
9408
- /* @__PURE__ */ jsx51(
9409
- AutosuggestWrapper,
9410
- {
9411
- condition: hasSuggestions(suggestions),
9412
- wrapper: (children) => /* @__PURE__ */ jsxs36(Popover3.Root, { open: isOpen && (filteredSuggestions.length > 0 || isSearching || isAutosuggestError), children: [
9413
- /* @__PURE__ */ jsx51(
9414
- Popover3.Trigger,
9415
- {
9416
- asChild: true,
9417
- type: void 0,
9418
- "aria-controls": void 0,
9419
- "aria-haspopup": void 0,
9420
- "aria-expanded": void 0,
9421
- children
9422
- }
9423
- ),
9424
- /* @__PURE__ */ jsx51(Popover3.Portal, { children: /* @__PURE__ */ jsx51(
9425
- Popover3.Content,
9426
- {
9427
- sideOffset: 5,
9428
- style: { zIndex: "320" },
9429
- onOpenAutoFocus: (event) => {
9430
- event.preventDefault();
9431
- },
9432
- onCloseAutoFocus: (event) => {
9433
- event.preventDefault();
9434
- },
9435
- children: /* @__PURE__ */ jsx51(
9436
- Suggestions_default,
9437
- {
9438
- id: autosuggestId,
9439
- value: value ?? innerValue,
9440
- suggestions: filteredSuggestions,
9441
- visualFocusIndex,
9442
- highlightedSuggestions: typeof suggestions !== "function",
9443
- searchHasErrors: isAutosuggestError,
9444
- isSearching,
9445
- suggestionOnClick: (suggestion) => {
9446
- changeValue(suggestion);
9447
- closeSuggestions();
9448
- },
9449
- styles: { width }
9450
- }
9451
- )
9452
- }
9453
- ) })
9454
- ] }),
9455
- children: /* @__PURE__ */ jsxs36(
9456
- InputContainer,
9457
- {
9458
- error: !!error,
9459
- disabled,
9460
- readOnly,
9461
- onClick: handleInputContainerOnClick,
9462
- onMouseDown: handleInputContainerOnMouseDown,
9463
- ref: inputContainerRef,
9464
- children: [
9465
- prefix && /* @__PURE__ */ jsx51(Prefix, { disabled, children: prefix }),
9466
- /* @__PURE__ */ jsxs36(Flex_default, { gap: "0.25rem", alignItems: "center", grow: 1, children: [
9467
- /* @__PURE__ */ jsx51(
9468
- Input,
9412
+ return /* @__PURE__ */ jsxs36(ThemeProvider19, { theme: colorsTheme.textInput, children: [
9413
+ /* @__PURE__ */ jsxs36(TextInputContainer, { margin, size, ref, children: [
9414
+ label && /* @__PURE__ */ jsxs36(Label4, { htmlFor: inputId, disabled, hasHelperText: !!helperText, children: [
9415
+ label,
9416
+ " ",
9417
+ optional && /* @__PURE__ */ jsx51(OptionalLabel2, { children: translatedLabels.formFields.optionalLabel })
9418
+ ] }),
9419
+ helperText && /* @__PURE__ */ jsx51(HelperText2, { disabled, children: helperText }),
9420
+ /* @__PURE__ */ jsx51(
9421
+ AutosuggestWrapper,
9422
+ {
9423
+ condition: hasSuggestions(suggestions),
9424
+ wrapper: (children) => /* @__PURE__ */ jsxs36(Popover3.Root, { open: isOpen && (filteredSuggestions.length > 0 || isSearching || isAutosuggestError), children: [
9425
+ /* @__PURE__ */ jsx51(
9426
+ Popover3.Trigger,
9427
+ {
9428
+ asChild: true,
9429
+ type: void 0,
9430
+ "aria-controls": void 0,
9431
+ "aria-haspopup": void 0,
9432
+ "aria-expanded": void 0,
9433
+ children
9434
+ }
9435
+ ),
9436
+ /* @__PURE__ */ jsx51(Popover3.Portal, { container: document.getElementById(`${inputId}-portal`), children: /* @__PURE__ */ jsx51(
9437
+ Popover3.Content,
9438
+ {
9439
+ sideOffset: 5,
9440
+ style: { zIndex: "320" },
9441
+ onOpenAutoFocus: (event) => {
9442
+ event.preventDefault();
9443
+ },
9444
+ onCloseAutoFocus: (event) => {
9445
+ event.preventDefault();
9446
+ },
9447
+ children: /* @__PURE__ */ jsx51(
9448
+ Suggestions_default,
9469
9449
  {
9470
- alignment,
9471
- id: inputId,
9472
- name,
9450
+ id: autosuggestId,
9473
9451
  value: value ?? innerValue,
9474
- placeholder,
9475
- onBlur: handleInputOnBlur,
9476
- onChange: handleInputOnChange,
9477
- onFocus: !readOnly ? openSuggestions : void 0,
9478
- onKeyDown: !readOnly ? handleInputOnKeyDown : void 0,
9479
- onMouseDown: (event) => {
9480
- event.stopPropagation();
9452
+ suggestions: filteredSuggestions,
9453
+ visualFocusIndex,
9454
+ highlightedSuggestions: typeof suggestions !== "function",
9455
+ searchHasErrors: isAutosuggestError,
9456
+ isSearching,
9457
+ suggestionOnClick: (suggestion) => {
9458
+ changeValue(suggestion);
9459
+ closeSuggestions();
9481
9460
  },
9482
- onWheel: numberInputContext?.typeNumber === "number" ? handleNumberInputWheel : void 0,
9483
- disabled,
9484
- readOnly,
9485
- ref: inputRef,
9486
- pattern,
9487
- minLength,
9488
- maxLength,
9489
- autoComplete: autocomplete === "off" ? "nope" : autocomplete,
9490
- tabIndex,
9491
- type: "text",
9492
- role: hasSuggestions(suggestions) ? "combobox" : void 0,
9493
- "aria-autocomplete": hasSuggestions(suggestions) ? "list" : void 0,
9494
- "aria-controls": hasSuggestions(suggestions) ? autosuggestId : void 0,
9495
- "aria-expanded": hasSuggestions(suggestions) ? isOpen : void 0,
9496
- "aria-haspopup": hasSuggestions(suggestions) ? "listbox" : void 0,
9497
- "aria-activedescendant": hasSuggestions(suggestions) && isOpen && visualFocusIndex !== -1 ? `suggestion-${visualFocusIndex}` : void 0,
9498
- "aria-invalid": !!error,
9499
- "aria-errormessage": error ? errorId : void 0,
9500
- "aria-required": !disabled && !optional,
9501
- "aria-label": label ? void 0 : ariaLabel
9461
+ styles: { width }
9502
9462
  }
9503
- ),
9504
- !disabled && error && /* @__PURE__ */ jsx51(ErrorIcon2, { "aria-hidden": "true", children: /* @__PURE__ */ jsx51(Icon_default, { icon: "filled_error" }) }),
9505
- !disabled && !readOnly && clearable && (value ?? innerValue).length > 0 && /* @__PURE__ */ jsx51(
9506
- ActionIcon_default,
9507
- {
9508
- onClick: handleClearActionOnClick,
9509
- icon: "close",
9510
- tabIndex,
9511
- title: translatedLabels.textInput.clearFieldActionTitle
9512
- }
9513
- ),
9514
- numberInputContext?.typeNumber === "number" && numberInputContext?.showControls && /* @__PURE__ */ jsxs36(Fragment12, { children: [
9463
+ )
9464
+ }
9465
+ ) })
9466
+ ] }),
9467
+ children: /* @__PURE__ */ jsxs36(
9468
+ InputContainer,
9469
+ {
9470
+ error: !!error,
9471
+ disabled,
9472
+ readOnly,
9473
+ onClick: handleInputContainerOnClick,
9474
+ onMouseDown: handleInputContainerOnMouseDown,
9475
+ ref: inputContainerRef,
9476
+ children: [
9477
+ prefix && /* @__PURE__ */ jsx51(Prefix, { disabled, children: prefix }),
9478
+ /* @__PURE__ */ jsxs36(Flex_default, { gap: "0.25rem", alignItems: "center", grow: 1, children: [
9515
9479
  /* @__PURE__ */ jsx51(
9480
+ Input,
9481
+ {
9482
+ alignment,
9483
+ id: inputId,
9484
+ name,
9485
+ value: value ?? innerValue,
9486
+ placeholder,
9487
+ onBlur: handleInputOnBlur,
9488
+ onChange: handleInputOnChange,
9489
+ onFocus: !readOnly ? openSuggestions : void 0,
9490
+ onKeyDown: !readOnly ? handleInputOnKeyDown : void 0,
9491
+ onMouseDown: (event) => {
9492
+ event.stopPropagation();
9493
+ },
9494
+ onWheel: numberInputContext?.typeNumber === "number" ? handleNumberInputWheel : void 0,
9495
+ disabled,
9496
+ readOnly,
9497
+ ref: inputRef,
9498
+ pattern,
9499
+ minLength,
9500
+ maxLength,
9501
+ autoComplete: autocomplete === "off" ? "nope" : autocomplete,
9502
+ tabIndex,
9503
+ type: "text",
9504
+ role: hasSuggestions(suggestions) ? "combobox" : void 0,
9505
+ "aria-autocomplete": hasSuggestions(suggestions) ? "list" : void 0,
9506
+ "aria-controls": hasSuggestions(suggestions) ? autosuggestId : void 0,
9507
+ "aria-expanded": hasSuggestions(suggestions) ? isOpen : void 0,
9508
+ "aria-haspopup": hasSuggestions(suggestions) ? "listbox" : void 0,
9509
+ "aria-activedescendant": hasSuggestions(suggestions) && isOpen && visualFocusIndex !== -1 ? `suggestion-${visualFocusIndex}` : void 0,
9510
+ "aria-invalid": !!error,
9511
+ "aria-errormessage": error ? errorId : void 0,
9512
+ "aria-required": !disabled && !optional,
9513
+ "aria-label": label ? void 0 : ariaLabel
9514
+ }
9515
+ ),
9516
+ !disabled && error && /* @__PURE__ */ jsx51(ErrorIcon2, { "aria-hidden": "true", children: /* @__PURE__ */ jsx51(Icon_default, { icon: "filled_error" }) }),
9517
+ !disabled && !readOnly && clearable && (value ?? innerValue).length > 0 && /* @__PURE__ */ jsx51(
9516
9518
  ActionIcon_default,
9517
9519
  {
9518
- onClick: !readOnly ? handleDecrementActionOnClick : void 0,
9519
- icon: "remove",
9520
+ onClick: handleClearActionOnClick,
9521
+ icon: "close",
9520
9522
  tabIndex,
9521
- ref: actionRef,
9522
- title: translatedLabels.numberInput.decrementValueTitle,
9523
- disabled
9523
+ title: translatedLabels.textInput.clearFieldActionTitle
9524
9524
  }
9525
9525
  ),
9526
- /* @__PURE__ */ jsx51(
9526
+ numberInputContext?.typeNumber === "number" && numberInputContext?.showControls && /* @__PURE__ */ jsxs36(Fragment12, { children: [
9527
+ /* @__PURE__ */ jsx51(
9528
+ ActionIcon_default,
9529
+ {
9530
+ onClick: !readOnly ? handleDecrementActionOnClick : void 0,
9531
+ icon: "remove",
9532
+ tabIndex,
9533
+ ref: actionRef,
9534
+ title: translatedLabels.numberInput.decrementValueTitle,
9535
+ disabled
9536
+ }
9537
+ ),
9538
+ /* @__PURE__ */ jsx51(
9539
+ ActionIcon_default,
9540
+ {
9541
+ onClick: !readOnly ? handleIncrementActionOnClick : void 0,
9542
+ icon: "add",
9543
+ tabIndex,
9544
+ ref: actionRef,
9545
+ title: translatedLabels.numberInput.incrementValueTitle,
9546
+ disabled
9547
+ }
9548
+ )
9549
+ ] }),
9550
+ action && /* @__PURE__ */ jsx51(
9527
9551
  ActionIcon_default,
9528
9552
  {
9529
- onClick: !readOnly ? handleIncrementActionOnClick : void 0,
9530
- icon: "add",
9553
+ onClick: !readOnly ? action.onClick : void 0,
9554
+ icon: action.icon,
9531
9555
  tabIndex,
9532
9556
  ref: actionRef,
9533
- title: translatedLabels.numberInput.incrementValueTitle,
9557
+ title: action.title ?? void 0,
9534
9558
  disabled
9535
9559
  }
9536
9560
  )
9537
9561
  ] }),
9538
- action && /* @__PURE__ */ jsx51(
9539
- ActionIcon_default,
9540
- {
9541
- onClick: !readOnly ? action.onClick : void 0,
9542
- icon: action.icon,
9543
- tabIndex,
9544
- ref: actionRef,
9545
- title: action.title ?? "",
9546
- disabled
9547
- }
9548
- )
9549
- ] }),
9550
- suffix && /* @__PURE__ */ jsx51(Suffix, { disabled, children: suffix })
9551
- ]
9552
- }
9553
- )
9554
- }
9555
- ),
9556
- !disabled && typeof error === "string" && /* @__PURE__ */ jsx51(ErrorMessageContainer, { id: errorId, role: "alert", "aria-live": error ? "assertive" : "off", children: error })
9557
- ] }) });
9562
+ suffix && /* @__PURE__ */ jsx51(Suffix, { disabled, children: suffix })
9563
+ ]
9564
+ }
9565
+ )
9566
+ }
9567
+ ),
9568
+ !disabled && typeof error === "string" && /* @__PURE__ */ jsx51(ErrorMessageContainer, { id: errorId, role: "alert", "aria-live": error ? "assertive" : "off", children: error })
9569
+ ] }),
9570
+ /* @__PURE__ */ jsx51("div", { id: `${inputId}-portal`, style: { position: "absolute" } })
9571
+ ] });
9558
9572
  }
9559
9573
  );
9560
9574
  var TextInput_default = DxcTextInput;
@@ -9582,7 +9596,7 @@ var getDate = (value, format, lastValidYear, setLastValidYear) => {
9582
9596
  }
9583
9597
  return newDate;
9584
9598
  };
9585
- var DxcDateInput = forwardRef7(
9599
+ var DxcDateInput = forwardRef8(
9586
9600
  ({
9587
9601
  label,
9588
9602
  name,
@@ -9604,14 +9618,14 @@ var DxcDateInput = forwardRef7(
9604
9618
  tabIndex,
9605
9619
  ariaLabel = "Date input"
9606
9620
  }, ref) => {
9607
- const [innerValue, setInnerValue] = useState23(defaultValue);
9608
- const [isOpen, setIsOpen] = useState23(false);
9609
- const calendarId = `date-picker-${useId12()}`;
9610
- const [dayjsDate, setDayjsDate] = useState23(getValueForPicker(value ?? defaultValue ?? "", format));
9611
- const [lastValidYear, setLastValidYear] = useState23(
9621
+ const [innerValue, setInnerValue] = useState24(defaultValue);
9622
+ const [isOpen, setIsOpen] = useState24(false);
9623
+ const calendarId = `date-picker-${useId13()}`;
9624
+ const [dayjsDate, setDayjsDate] = useState24(getValueForPicker(value ?? defaultValue ?? "", format));
9625
+ const [lastValidYear, setLastValidYear] = useState24(
9612
9626
  innerValue || value ? !format.toUpperCase().includes("YYYY") && +getValueForPicker(value ?? innerValue, format).format("YY") < 68 ? 2e3 : 1900 : null
9613
9627
  );
9614
- const [sideOffset, setSideOffset] = useState23(SIDEOFFSET);
9628
+ const [sideOffset, setSideOffset] = useState24(SIDEOFFSET);
9615
9629
  const colorsTheme = useContext30(HalstackContext);
9616
9630
  const translatedLabels = useContext30(HalstackLanguageContext);
9617
9631
  const dateRef = useRef12(null);
@@ -9708,18 +9722,18 @@ var DxcDateInput = forwardRef7(
9708
9722
  closeCalendar();
9709
9723
  }
9710
9724
  };
9711
- useEffect13(() => {
9725
+ useEffect14(() => {
9712
9726
  window.addEventListener("scroll", adjustSideOffset);
9713
9727
  return () => {
9714
9728
  window.removeEventListener("scroll", adjustSideOffset);
9715
9729
  };
9716
9730
  }, [adjustSideOffset]);
9717
- useEffect13(() => {
9731
+ useEffect14(() => {
9718
9732
  if (value || value === "") {
9719
9733
  setDayjsDate(getDate(value, format, lastValidYear, setLastValidYear));
9720
9734
  }
9721
9735
  }, [value, format, lastValidYear]);
9722
- useEffect13(() => {
9736
+ useEffect14(() => {
9723
9737
  if (!disabled) {
9724
9738
  const actionButtonElement = dateRef.current?.querySelector("[aria-label='Select date']");
9725
9739
  actionButtonElement?.setAttribute("aria-haspopup", "true");
@@ -9731,62 +9745,65 @@ var DxcDateInput = forwardRef7(
9731
9745
  }
9732
9746
  }
9733
9747
  }, [isOpen, disabled, calendarId]);
9734
- return /* @__PURE__ */ jsx52(ThemeProvider20, { theme: colorsTheme, children: /* @__PURE__ */ jsxs37(DateInputContainer, { margin, size, ref, children: [
9735
- label && /* @__PURE__ */ jsxs37(
9736
- Label5,
9737
- {
9738
- htmlFor: dateRef.current?.getElementsByTagName("input")[0]?.id,
9739
- disabled,
9740
- hasHelperText: !!helperText,
9741
- children: [
9742
- label,
9743
- " ",
9744
- optional && /* @__PURE__ */ jsx52(OptionalLabel3, { children: translatedLabels.formFields.optionalLabel })
9745
- ]
9746
- }
9747
- ),
9748
- helperText && /* @__PURE__ */ jsx52(HelperText3, { disabled, children: helperText }),
9749
- /* @__PURE__ */ jsxs37(Popover4.Root, { open: isOpen, children: [
9750
- /* @__PURE__ */ jsx52(Popover4.Trigger, { asChild: true, "aria-controls": void 0, children: /* @__PURE__ */ jsx52(
9751
- TextInput_default,
9748
+ return /* @__PURE__ */ jsxs37(ThemeProvider20, { theme: colorsTheme, children: [
9749
+ /* @__PURE__ */ jsxs37(DateInputContainer, { margin, size, ref, children: [
9750
+ label && /* @__PURE__ */ jsxs37(
9751
+ Label5,
9752
9752
  {
9753
- name,
9754
- defaultValue,
9755
- value: value ?? innerValue,
9756
- placeholder: placeholder ? format.toUpperCase() : void 0,
9757
- action: {
9758
- onClick: openCalendar,
9759
- icon: "filled_calendar_today",
9760
- title: "Select date"
9761
- },
9762
- clearable,
9753
+ htmlFor: dateRef.current?.getElementsByTagName("input")[0]?.id,
9763
9754
  disabled,
9764
- readOnly,
9765
- optional,
9766
- onChange: handleOnChange,
9767
- onBlur: handleOnBlur,
9768
- error,
9769
- autocomplete,
9770
- size,
9771
- tabIndex,
9772
- ref: dateRef,
9773
- ariaLabel
9774
- }
9775
- ) }),
9776
- /* @__PURE__ */ jsx52(Popover4.Portal, { children: /* @__PURE__ */ jsx52(
9777
- StyledPopoverContent,
9778
- {
9779
- sideOffset,
9780
- align: "end",
9781
- "aria-modal": true,
9782
- onBlur: handleDatePickerOnBlur,
9783
- onKeyDown: handleDatePickerEscKeydown,
9784
- ref: popoverContentRef,
9785
- children: /* @__PURE__ */ jsx52(DatePicker_default, { id: calendarId, onDateSelect: handleCalendarOnClick, date: dayjsDate })
9755
+ hasHelperText: !!helperText,
9756
+ children: [
9757
+ label,
9758
+ " ",
9759
+ optional && /* @__PURE__ */ jsx52(OptionalLabel3, { children: translatedLabels.formFields.optionalLabel })
9760
+ ]
9786
9761
  }
9787
- ) })
9788
- ] })
9789
- ] }) });
9762
+ ),
9763
+ helperText && /* @__PURE__ */ jsx52(HelperText3, { disabled, children: helperText }),
9764
+ /* @__PURE__ */ jsxs37(Popover4.Root, { open: isOpen, children: [
9765
+ /* @__PURE__ */ jsx52(Popover4.Trigger, { asChild: true, "aria-controls": void 0, children: /* @__PURE__ */ jsx52(
9766
+ TextInput_default,
9767
+ {
9768
+ name,
9769
+ defaultValue,
9770
+ value: value ?? innerValue,
9771
+ placeholder: placeholder ? format.toUpperCase() : void 0,
9772
+ action: {
9773
+ onClick: openCalendar,
9774
+ icon: "filled_calendar_today",
9775
+ title: "Select date"
9776
+ },
9777
+ clearable,
9778
+ disabled,
9779
+ readOnly,
9780
+ optional,
9781
+ onChange: handleOnChange,
9782
+ onBlur: handleOnBlur,
9783
+ error,
9784
+ autocomplete,
9785
+ size,
9786
+ tabIndex,
9787
+ ref: dateRef,
9788
+ ariaLabel
9789
+ }
9790
+ ) }),
9791
+ /* @__PURE__ */ jsx52(Popover4.Portal, { container: document.getElementById(`${calendarId}-portal`), children: /* @__PURE__ */ jsx52(
9792
+ StyledPopoverContent,
9793
+ {
9794
+ sideOffset,
9795
+ align: "end",
9796
+ "aria-modal": true,
9797
+ onBlur: handleDatePickerOnBlur,
9798
+ onKeyDown: handleDatePickerEscKeydown,
9799
+ ref: popoverContentRef,
9800
+ children: /* @__PURE__ */ jsx52(DatePicker_default, { id: calendarId, onDateSelect: handleCalendarOnClick, date: dayjsDate })
9801
+ }
9802
+ ) })
9803
+ ] })
9804
+ ] }),
9805
+ /* @__PURE__ */ jsx52("div", { id: `${calendarId}-portal`, style: { position: "absolute" } })
9806
+ ] });
9790
9807
  }
9791
9808
  );
9792
9809
  var sizes5 = {
@@ -9829,7 +9846,7 @@ var HelperText3 = styled45.span`
9829
9846
  margin-bottom: 0.25rem;
9830
9847
  `;
9831
9848
  var StyledPopoverContent = styled45(Popover4.Content)`
9832
- z-index: 300;
9849
+ z-index: 310;
9833
9850
  &:focus-visible {
9834
9851
  outline: none;
9835
9852
  }
@@ -9837,7 +9854,7 @@ var StyledPopoverContent = styled45(Popover4.Content)`
9837
9854
  var DateInput_default = DxcDateInput;
9838
9855
 
9839
9856
  // src/dialog/Dialog.tsx
9840
- import { useContext as useContext31, useEffect as useEffect14 } from "react";
9857
+ import { useContext as useContext31, useEffect as useEffect15, useId as useId14, useState as useState25 } from "react";
9841
9858
  import { createPortal as createPortal2 } from "react-dom";
9842
9859
  import styled46, { createGlobalStyle as createGlobalStyle2, ThemeProvider as ThemeProvider21 } from "styled-components";
9843
9860
  import { Fragment as Fragment13, jsx as jsx53, jsxs as jsxs38 } from "react/jsx-runtime";
@@ -9853,7 +9870,7 @@ var DialogContainer = styled46.div`
9853
9870
  align-items: center;
9854
9871
  justify-content: center;
9855
9872
  height: 100%;
9856
- z-index: 420;
9873
+ z-index: 300;
9857
9874
  `;
9858
9875
  var Overlay3 = styled46.div`
9859
9876
  position: fixed;
@@ -9890,9 +9907,14 @@ var DxcDialog = ({
9890
9907
  tabIndex = 0,
9891
9908
  disableFocusLock = false
9892
9909
  }) => {
9910
+ const id = useId14();
9893
9911
  const colorsTheme = useContext31(HalstackContext);
9894
9912
  const translatedLabels = useContext31(HalstackLanguageContext);
9895
- useEffect14(() => {
9913
+ const [portalContainer, setPortalContainer] = useState25(null);
9914
+ useEffect15(() => {
9915
+ setPortalContainer(document.getElementById(`dialog-${id}-portal`));
9916
+ }, []);
9917
+ useEffect15(() => {
9896
9918
  const handleKeyDown = (event) => {
9897
9919
  if (event.key === "Escape") {
9898
9920
  event.preventDefault();
@@ -9906,7 +9928,8 @@ var DxcDialog = ({
9906
9928
  }, [onCloseClick]);
9907
9929
  return /* @__PURE__ */ jsxs38(ThemeProvider21, { theme: colorsTheme.dialog, children: [
9908
9930
  /* @__PURE__ */ jsx53(BodyStyle2, {}),
9909
- createPortal2(
9931
+ /* @__PURE__ */ jsx53("div", { id: `dialog-${id}-portal`, style: { position: "absolute" } }),
9932
+ portalContainer && createPortal2(
9910
9933
  /* @__PURE__ */ jsxs38(DialogContainer, { children: [
9911
9934
  overlay && /* @__PURE__ */ jsx53(Overlay3, { onClick: onBackgroundClick }),
9912
9935
  /* @__PURE__ */ jsx53(Dialog, { "aria-label": "Dialog", "aria-modal": overlay, closable, role: "dialog", children: !disableFocusLock ? /* @__PURE__ */ jsxs38(FocusLock_default, { children: [
@@ -9933,18 +9956,18 @@ var DxcDialog = ({
9933
9956
  ) })
9934
9957
  ] }) })
9935
9958
  ] }),
9936
- document.body
9959
+ portalContainer
9937
9960
  )
9938
9961
  ] });
9939
9962
  };
9940
9963
  var Dialog_default = DxcDialog;
9941
9964
 
9942
9965
  // src/file-input/FileInput.tsx
9943
- import { useCallback as useCallback8, useContext as useContext33, useEffect as useEffect15, useId as useId14, useState as useState24, forwardRef as forwardRef8 } from "react";
9966
+ import { useCallback as useCallback8, useContext as useContext33, useEffect as useEffect16, useId as useId16, useState as useState26, forwardRef as forwardRef9 } from "react";
9944
9967
  import styled48, { ThemeProvider as ThemeProvider22 } from "styled-components";
9945
9968
 
9946
9969
  // src/file-input/FileItem.tsx
9947
- import { memo as memo10, useContext as useContext32, useId as useId13 } from "react";
9970
+ import { memo as memo10, useContext as useContext32, useId as useId15 } from "react";
9948
9971
  import styled47 from "styled-components";
9949
9972
  import { jsx as jsx54, jsxs as jsxs39 } from "react/jsx-runtime";
9950
9973
  var MainContainer3 = styled47.div`
@@ -10029,7 +10052,7 @@ var FileItem = ({
10029
10052
  tabIndex
10030
10053
  }) => {
10031
10054
  const translatedLabels = useContext32(HalstackLanguageContext);
10032
- const fileNameId = useId13();
10055
+ const fileNameId = useId15();
10033
10056
  return /* @__PURE__ */ jsxs39(MainContainer3, { error, role: "listitem", singleFileMode, showPreview, children: [
10034
10057
  showPreview && (type.includes("image") ? /* @__PURE__ */ jsx54(ImagePreview, { src: preview, alt: fileName }) : /* @__PURE__ */ jsx54(IconPreview, { "aria-labelledby": fileNameId, error, role: "img", children: /* @__PURE__ */ jsx54(Icon_default, { icon: preview }) })),
10035
10058
  /* @__PURE__ */ jsxs39(FileItemContent, { children: [
@@ -10161,7 +10184,7 @@ var ErrorMessage2 = styled48.div`
10161
10184
  line-height: ${(props) => props.theme.errorMessageLineHeight};
10162
10185
  margin-top: 0.25rem;
10163
10186
  `;
10164
- var DxcFileInput = forwardRef8(
10187
+ var DxcFileInput = forwardRef9(
10165
10188
  ({
10166
10189
  mode = "file",
10167
10190
  label = "",
@@ -10179,9 +10202,9 @@ var DxcFileInput = forwardRef8(
10179
10202
  margin,
10180
10203
  tabIndex = 0
10181
10204
  }, ref) => {
10182
- const [isDragging, setIsDragging] = useState24(false);
10183
- const [files, setFiles] = useState24([]);
10184
- const fileInputId = `file-input-${useId14()}`;
10205
+ const [isDragging, setIsDragging] = useState26(false);
10206
+ const [files, setFiles] = useState26([]);
10207
+ const fileInputId = `file-input-${useId16()}`;
10185
10208
  const colorsTheme = useContext33(HalstackContext);
10186
10209
  const translatedLabels = useContext33(HalstackLanguageContext);
10187
10210
  const checkFileSize = (file) => {
@@ -10255,7 +10278,7 @@ var DxcFileInput = forwardRef8(
10255
10278
  addFile(filesArray);
10256
10279
  }
10257
10280
  };
10258
- useEffect15(() => {
10281
+ useEffect16(() => {
10259
10282
  const getFiles = async () => {
10260
10283
  if (value) {
10261
10284
  const valueFiles = await Promise.all(
@@ -10560,7 +10583,7 @@ var Inset = ({ space, horizontal, vertical, top, right, bottom, left, children }
10560
10583
  var Inset_default = Inset;
10561
10584
 
10562
10585
  // src/link/Link.tsx
10563
- import { forwardRef as forwardRef9, useContext as useContext36 } from "react";
10586
+ import { forwardRef as forwardRef10, useContext as useContext36 } from "react";
10564
10587
  import styled53, { ThemeProvider as ThemeProvider25 } from "styled-components";
10565
10588
  import { jsx as jsx60, jsxs as jsxs42 } from "react/jsx-runtime";
10566
10589
  var StyledLink = styled53.a`
@@ -10625,7 +10648,7 @@ var LinkIconContainer = styled53.div`
10625
10648
  height: ${(props) => props.theme.iconSize};
10626
10649
  }
10627
10650
  `;
10628
- var DxcLink = forwardRef9(
10651
+ var DxcLink = forwardRef10(
10629
10652
  ({
10630
10653
  inheritColor = false,
10631
10654
  disabled = false,
@@ -10664,11 +10687,11 @@ var DxcLink = forwardRef9(
10664
10687
  var Link_default = DxcLink;
10665
10688
 
10666
10689
  // src/nav-tabs/NavTabs.tsx
10667
- import { Children as Children4, useContext as useContext38, useEffect as useEffect17, useMemo as useMemo14, useRef as useRef14, useState as useState25 } from "react";
10690
+ import { Children as Children4, useContext as useContext38, useEffect as useEffect18, useMemo as useMemo14, useRef as useRef14, useState as useState27 } from "react";
10668
10691
  import styled55, { ThemeProvider as ThemeProvider26 } from "styled-components";
10669
10692
 
10670
10693
  // src/nav-tabs/Tab.tsx
10671
- import { useEffect as useEffect16, forwardRef as forwardRef10, useContext as useContext37, useRef as useRef13, useImperativeHandle } from "react";
10694
+ import { useEffect as useEffect17, forwardRef as forwardRef11, useContext as useContext37, useRef as useRef13, useImperativeHandle } from "react";
10672
10695
  import styled54 from "styled-components";
10673
10696
 
10674
10697
  // src/nav-tabs/NavTabsContext.tsx
@@ -10677,7 +10700,7 @@ var NavTabsContext_default = createContext8(null);
10677
10700
 
10678
10701
  // src/nav-tabs/Tab.tsx
10679
10702
  import { jsx as jsx61, jsxs as jsxs43 } from "react/jsx-runtime";
10680
- var DxcTab = forwardRef10(
10703
+ var DxcTab = forwardRef11(
10681
10704
  ({
10682
10705
  href,
10683
10706
  active = false,
@@ -10692,7 +10715,7 @@ var DxcTab = forwardRef10(
10692
10715
  const { iconPosition, tabIndex, focusedLabel } = useContext37(NavTabsContext_default) ?? {};
10693
10716
  const innerRef = useRef13(null);
10694
10717
  useImperativeHandle(ref, () => innerRef.current, []);
10695
- useEffect16(() => {
10718
+ useEffect17(() => {
10696
10719
  if (focusedLabel === children.toString()) {
10697
10720
  tabRef?.current?.focus();
10698
10721
  }
@@ -10716,8 +10739,9 @@ var DxcTab = forwardRef10(
10716
10739
  disabled,
10717
10740
  active,
10718
10741
  href: !disabled ? href : void 0,
10742
+ as: href ? "a" : onClick ? "button" : "div",
10719
10743
  iconPosition,
10720
- onClick,
10744
+ onClick: !disabled ? onClick : void 0,
10721
10745
  onKeyDown: handleOnKeyDown,
10722
10746
  hasIcon: icon != null,
10723
10747
  ref: (anchorRef) => {
@@ -10851,14 +10875,14 @@ var getNextTabIndex = (array, initialIndex) => {
10851
10875
  return index;
10852
10876
  };
10853
10877
  var DxcNavTabs = ({ iconPosition = "top", tabIndex = 0, children }) => {
10854
- const [innerFocusIndex, setInnerFocusIndex] = useState25(null);
10855
- const [underlineWidth, setUnderlineWidth] = useState25(null);
10878
+ const [innerFocusIndex, setInnerFocusIndex] = useState27(null);
10879
+ const [underlineWidth, setUnderlineWidth] = useState27(null);
10856
10880
  const refNavTabList = useRef14(null);
10857
10881
  const colorsTheme = useContext38(HalstackContext);
10858
10882
  const childArray = Children4.toArray(children).filter(
10859
10883
  (child) => typeof child === "object" && "props" in child
10860
10884
  );
10861
- useEffect17(() => {
10885
+ useEffect18(() => {
10862
10886
  setUnderlineWidth(refNavTabList?.current?.scrollWidth ?? null);
10863
10887
  }, [children]);
10864
10888
  const contextValue = useMemo14(
@@ -10910,10 +10934,10 @@ var NavTabsContainer = styled55.div`
10910
10934
  var NavTabs_default = DxcNavTabs;
10911
10935
 
10912
10936
  // src/number-input/NumberInput.tsx
10913
- import { forwardRef as forwardRef11, useEffect as useEffect18, useMemo as useMemo15, useRef as useRef15 } from "react";
10937
+ import { forwardRef as forwardRef12, useEffect as useEffect19, useMemo as useMemo15, useRef as useRef15 } from "react";
10914
10938
  import styled56 from "styled-components";
10915
10939
  import { jsx as jsx63 } from "react/jsx-runtime";
10916
- var DxcNumberInput = forwardRef11(
10940
+ var DxcNumberInput = forwardRef12(
10917
10941
  ({
10918
10942
  label,
10919
10943
  name,
@@ -10950,7 +10974,7 @@ var DxcNumberInput = forwardRef11(
10950
10974
  }),
10951
10975
  [max, min, showControls, step]
10952
10976
  );
10953
- useEffect18(() => {
10977
+ useEffect19(() => {
10954
10978
  const input = numberInputRef.current?.getElementsByTagName("input")[0];
10955
10979
  const preventDefault = (event) => {
10956
10980
  event.preventDefault();
@@ -11028,7 +11052,7 @@ function DxcParagraph({ children }) {
11028
11052
  }
11029
11053
 
11030
11054
  // src/password-input/PasswordInput.tsx
11031
- import { forwardRef as forwardRef12, useContext as useContext40, useEffect as useEffect19, useRef as useRef16, useState as useState26 } from "react";
11055
+ import { forwardRef as forwardRef13, useContext as useContext40, useEffect as useEffect20, useRef as useRef16, useState as useState28 } from "react";
11032
11056
  import styled58 from "styled-components";
11033
11057
  import { jsx as jsx65 } from "react/jsx-runtime";
11034
11058
  var setInputType = (type, element) => {
@@ -11038,7 +11062,7 @@ var setAriaAttributes = (ariaExpanded, element) => {
11038
11062
  const buttonElement = element?.getElementsByTagName("button")[0];
11039
11063
  buttonElement?.setAttribute("aria-expanded", ariaExpanded);
11040
11064
  };
11041
- var DxcPasswordInput = forwardRef12(
11065
+ var DxcPasswordInput = forwardRef13(
11042
11066
  ({
11043
11067
  label,
11044
11068
  name = "",
@@ -11057,10 +11081,10 @@ var DxcPasswordInput = forwardRef12(
11057
11081
  tabIndex = 0,
11058
11082
  ariaLabel = "Password input"
11059
11083
  }, ref) => {
11060
- const [isPasswordVisible, setIsPasswordVisible] = useState26(false);
11084
+ const [isPasswordVisible, setIsPasswordVisible] = useState28(false);
11061
11085
  const inputRef = useRef16(null);
11062
11086
  const { passwordInput } = useContext40(HalstackLanguageContext);
11063
- useEffect19(() => {
11087
+ useEffect20(() => {
11064
11088
  (() => {
11065
11089
  if (isPasswordVisible) {
11066
11090
  setInputType("text", inputRef.current);
@@ -11115,7 +11139,7 @@ var PasswordInput = styled58.div`
11115
11139
  var PasswordInput_default = DxcPasswordInput;
11116
11140
 
11117
11141
  // src/progress-bar/ProgressBar.tsx
11118
- import { useContext as useContext41, useEffect as useEffect20, useId as useId15, useState as useState27 } from "react";
11142
+ import { useContext as useContext41, useEffect as useEffect21, useId as useId17, useState as useState29 } from "react";
11119
11143
  import styled59, { ThemeProvider as ThemeProvider28 } from "styled-components";
11120
11144
  import { jsx as jsx66, jsxs as jsxs45 } from "react/jsx-runtime";
11121
11145
  var Overlay4 = styled59.div`
@@ -11236,9 +11260,9 @@ var DxcProgressBar = ({
11236
11260
  ariaLabel = "Progress bar"
11237
11261
  }) => {
11238
11262
  const colorsTheme = useContext41(HalstackContext);
11239
- const labelId = `label-${useId15()}`;
11240
- const [innerValue, setInnerValue] = useState27();
11241
- useEffect20(() => {
11263
+ const labelId = `label-${useId17()}`;
11264
+ const [innerValue, setInnerValue] = useState29();
11265
+ useEffect21(() => {
11242
11266
  if (value != null) setInnerValue(value < 0 ? 0 : value > 100 ? 100 : value);
11243
11267
  }, [value]);
11244
11268
  return /* @__PURE__ */ jsx66(ThemeProvider28, { theme: colorsTheme.progressBar, children: /* @__PURE__ */ jsx66(Overlay4, { overlay, children: /* @__PURE__ */ jsxs45(MainContainer4, { overlay, margin, children: [
@@ -11275,16 +11299,36 @@ import { jsx as jsx67, jsxs as jsxs46 } from "react/jsx-runtime";
11275
11299
  var DxcQuickNav = ({ title, links }) => {
11276
11300
  const translatedLabels = useContext42(HalstackLanguageContext);
11277
11301
  const colorsTheme = useContext42(HalstackContext);
11302
+ const isHashRouter = () => {
11303
+ if (typeof window === "undefined") return false;
11304
+ return window.location.href.includes("/#/");
11305
+ };
11278
11306
  return /* @__PURE__ */ jsx67(ThemeProvider29, { theme: colorsTheme.quickNav, children: /* @__PURE__ */ jsx67(QuickNavContainer, { children: /* @__PURE__ */ jsxs46(Flex_default, { direction: "column", gap: "0.5rem", children: [
11279
11307
  /* @__PURE__ */ jsx67(Heading_default, { level: 4, text: title || translatedLabels.quickNav.contentTitle }),
11280
11308
  /* @__PURE__ */ jsx67(ListColumn, { children: links.map((link) => /* @__PURE__ */ jsx67("li", { children: /* @__PURE__ */ jsx67(Inset_default, { space: "0.25rem", children: /* @__PURE__ */ jsxs46(DxcTypography, { children: [
11281
- /* @__PURE__ */ jsx67(Link3, { href: `#${slugify(link.label, { lower: true })}`, children: link.label }),
11309
+ /* @__PURE__ */ jsx67(
11310
+ Link3,
11311
+ {
11312
+ href: `#${slugify(link.label, { lower: true })}`,
11313
+ onClick: isHashRouter() ? (e) => {
11314
+ e.preventDefault();
11315
+ const id = slugify(link.label, { lower: true });
11316
+ document.getElementById(id)?.scrollIntoView();
11317
+ } : void 0,
11318
+ children: /* @__PURE__ */ jsx67("span", { children: link.label })
11319
+ }
11320
+ ),
11282
11321
  /* @__PURE__ */ jsx67(ListSecondColumn, { children: link.links?.map((sublink) => /* @__PURE__ */ jsx67("li", { children: /* @__PURE__ */ jsx67(Inset_default, { horizontal: "0.5rem", children: /* @__PURE__ */ jsx67(DxcTypography, { children: /* @__PURE__ */ jsx67(
11283
11322
  Link3,
11284
11323
  {
11285
11324
  href: `#${slugify(link?.label, { lower: true })}-${slugify(sublink?.label, {
11286
11325
  lower: true
11287
11326
  })}`,
11327
+ onClick: isHashRouter() ? (e) => {
11328
+ e.preventDefault();
11329
+ const id = `${slugify(link.label, { lower: true })}-${slugify(sublink.label, { lower: true })}`;
11330
+ document.getElementById(id)?.scrollIntoView();
11331
+ } : void 0,
11288
11332
  children: sublink.label
11289
11333
  }
11290
11334
  ) }) }) }, sublink.label)) })
@@ -11340,11 +11384,11 @@ var Link3 = styled60.a`
11340
11384
  var QuickNav_default = DxcQuickNav;
11341
11385
 
11342
11386
  // src/radio-group/RadioGroup.tsx
11343
- import { forwardRef as forwardRef13, useCallback as useCallback10, useContext as useContext44, useId as useId17, useMemo as useMemo16, useState as useState29 } from "react";
11387
+ import { forwardRef as forwardRef14, useCallback as useCallback10, useContext as useContext44, useId as useId19, useMemo as useMemo16, useState as useState31 } from "react";
11344
11388
  import styled62, { ThemeProvider as ThemeProvider31 } from "styled-components";
11345
11389
 
11346
11390
  // src/radio-group/Radio.tsx
11347
- import { memo as memo11, useContext as useContext43, useEffect as useEffect21, useId as useId16, useRef as useRef17, useState as useState28 } from "react";
11391
+ import { memo as memo11, useContext as useContext43, useEffect as useEffect22, useId as useId18, useRef as useRef17, useState as useState30 } from "react";
11348
11392
  import styled61, { ThemeProvider as ThemeProvider30 } from "styled-components";
11349
11393
  import { jsx as jsx68, jsxs as jsxs47 } from "react/jsx-runtime";
11350
11394
  var DxcRadio = ({
@@ -11357,15 +11401,15 @@ var DxcRadio = ({
11357
11401
  readOnly,
11358
11402
  tabIndex
11359
11403
  }) => {
11360
- const radioLabelId = `radio-${useId16()}`;
11404
+ const radioLabelId = `radio-${useId18()}`;
11361
11405
  const ref = useRef17(null);
11362
11406
  const colorsTheme = useContext43(HalstackContext);
11363
11407
  const handleOnClick = () => {
11364
11408
  onClick();
11365
11409
  document.activeElement !== ref.current && ref.current?.focus();
11366
11410
  };
11367
- const [firstUpdate, setFirstUpdate] = useState28(true);
11368
- useEffect21(() => {
11411
+ const [firstUpdate, setFirstUpdate] = useState30(true);
11412
+ useEffect22(() => {
11369
11413
  if (firstUpdate) {
11370
11414
  setFirstUpdate(false);
11371
11415
  return;
@@ -11478,7 +11522,7 @@ var getInitialFocusIndex = (innerOptions, value) => {
11478
11522
  const initialSelectedOptionIndex = innerOptions.findIndex((option) => option.value === value);
11479
11523
  return initialSelectedOptionIndex !== -1 ? initialSelectedOptionIndex : 0;
11480
11524
  };
11481
- var DxcRadioGroup = forwardRef13(
11525
+ var DxcRadioGroup = forwardRef14(
11482
11526
  ({
11483
11527
  label,
11484
11528
  name,
@@ -11497,11 +11541,11 @@ var DxcRadioGroup = forwardRef13(
11497
11541
  tabIndex = 0,
11498
11542
  ariaLabel = "Radio group"
11499
11543
  }, ref) => {
11500
- const radioGroupId = `radio-group-${useId17()}`;
11544
+ const radioGroupId = `radio-group-${useId19()}`;
11501
11545
  const radioGroupLabelId = `label-${radioGroupId}`;
11502
11546
  const errorId = `error-${radioGroupId}`;
11503
- const [innerValue, setInnerValue] = useState29(defaultValue);
11504
- const [firstTimeFocus, setFirstTimeFocus] = useState29(true);
11547
+ const [innerValue, setInnerValue] = useState31(defaultValue);
11548
+ const [firstTimeFocus, setFirstTimeFocus] = useState31(true);
11505
11549
  const colorsTheme = useContext44(HalstackContext);
11506
11550
  const translatedLabels = useContext44(HalstackLanguageContext);
11507
11551
  const innerOptions = useMemo16(
@@ -11515,7 +11559,7 @@ var DxcRadioGroup = forwardRef13(
11515
11559
  ] : options,
11516
11560
  [optional, options, optionalItemLabel, translatedLabels]
11517
11561
  );
11518
- const [currentFocusIndex, setCurrentFocusIndex] = useState29(getInitialFocusIndex(innerOptions, value ?? innerValue));
11562
+ const [currentFocusIndex, setCurrentFocusIndex] = useState31(getInitialFocusIndex(innerOptions, value ?? innerValue));
11519
11563
  const handleOnChange = useCallback10(
11520
11564
  (newValue) => {
11521
11565
  const currentValue = value ?? innerValue;
@@ -11695,7 +11739,7 @@ var ErrorMessageContainer2 = styled62.span`
11695
11739
  var RadioGroup_default = DxcRadioGroup;
11696
11740
 
11697
11741
  // src/resultset-table/ResultsetTable.tsx
11698
- import { useContext as useContext45, useEffect as useEffect22, useMemo as useMemo17, useRef as useRef18, useState as useState30 } from "react";
11742
+ import { useContext as useContext45, useEffect as useEffect23, useMemo as useMemo17, useRef as useRef18, useState as useState32 } from "react";
11699
11743
  import styled63, { ThemeProvider as ThemeProvider32 } from "styled-components";
11700
11744
 
11701
11745
  // src/resultset-table/Icons.tsx
@@ -11752,9 +11796,9 @@ var DxcResultsetTable = ({
11752
11796
  mode = "default"
11753
11797
  }) => {
11754
11798
  const colorsTheme = useContext45(HalstackContext);
11755
- const [page, changePage] = useState30(1);
11756
- const [sortColumnIndex, changeSortColumnIndex] = useState30(-1);
11757
- const [sortOrder, changeSortOrder] = useState30("ascending");
11799
+ const [page, changePage] = useState32(1);
11800
+ const [sortColumnIndex, changeSortColumnIndex] = useState32(-1);
11801
+ const [sortOrder, changeSortOrder] = useState32("ascending");
11758
11802
  const prevRowCountRef = useRef18(rows.length);
11759
11803
  const rowsWithIds = useMemo17(() => assignIdsToRows(rows), [rows]);
11760
11804
  const minItemsPerPageIndex = useMemo17(() => getMinItemsPerPageIndex2(page, itemsPerPage, page), [itemsPerPage, page]);
@@ -11780,7 +11824,7 @@ var DxcResultsetTable = ({
11780
11824
  sortColumnIndex === -1 || sortColumnIndex !== columnIndex ? "ascending" : sortOrder === "ascending" ? "descending" : "ascending"
11781
11825
  );
11782
11826
  };
11783
- useEffect22(() => {
11827
+ useEffect23(() => {
11784
11828
  if (!hidePaginator) {
11785
11829
  if (rows.length === 0) {
11786
11830
  changePage(0);
@@ -11879,7 +11923,7 @@ DxcResultsetTable.ActionsCell = DxcActionsCell;
11879
11923
  var ResultsetTable_default = DxcResultsetTable;
11880
11924
 
11881
11925
  // src/slider/Slider.tsx
11882
- import { forwardRef as forwardRef14, useContext as useContext46, useId as useId18, useMemo as useMemo18, useState as useState31 } from "react";
11926
+ import { forwardRef as forwardRef15, useContext as useContext46, useId as useId20, useMemo as useMemo18, useState as useState33 } from "react";
11883
11927
  import styled64, { ThemeProvider as ThemeProvider33 } from "styled-components";
11884
11928
  import { jsx as jsx72, jsxs as jsxs50 } from "react/jsx-runtime";
11885
11929
  var sizes6 = {
@@ -12050,7 +12094,7 @@ var TextInputContainer2 = styled64.div`
12050
12094
  margin-left: ${(props) => props.theme.inputMarginLeft};
12051
12095
  max-width: 70px;
12052
12096
  `;
12053
- var DxcSlider = forwardRef14(
12097
+ var DxcSlider = forwardRef15(
12054
12098
  ({
12055
12099
  label = "",
12056
12100
  name = "",
@@ -12071,9 +12115,9 @@ var DxcSlider = forwardRef14(
12071
12115
  size = "fillParent",
12072
12116
  ariaLabel = "Slider"
12073
12117
  }, ref) => {
12074
- const labelId = `label-${useId18()}`;
12075
- const [innerValue, setInnerValue] = useState31(defaultValue ?? 0);
12076
- const [dragging, setDragging] = useState31(false);
12118
+ const labelId = `label-${useId20()}`;
12119
+ const [innerValue, setInnerValue] = useState33(defaultValue ?? 0);
12120
+ const [dragging, setDragging] = useState33(false);
12077
12121
  const colorsTheme = useContext46(HalstackContext);
12078
12122
  const isFirefox = navigator.userAgent.indexOf("Firefox") !== -1;
12079
12123
  const minLabel = useMemo18(
@@ -12210,10 +12254,10 @@ var StatusLabel = styled65.span`
12210
12254
  var StatusLight_default = DxcStatusLight;
12211
12255
 
12212
12256
  // src/switch/Switch.tsx
12213
- import { forwardRef as forwardRef15, useContext as useContext47, useId as useId19, useRef as useRef19, useState as useState32 } from "react";
12257
+ import { forwardRef as forwardRef16, useContext as useContext47, useId as useId21, useRef as useRef19, useState as useState34 } from "react";
12214
12258
  import styled66, { ThemeProvider as ThemeProvider34 } from "styled-components";
12215
12259
  import { Fragment as Fragment14, jsx as jsx74, jsxs as jsxs52 } from "react/jsx-runtime";
12216
- var DxcSwitch = forwardRef15(
12260
+ var DxcSwitch = forwardRef16(
12217
12261
  ({
12218
12262
  defaultChecked = false,
12219
12263
  checked,
@@ -12229,9 +12273,9 @@ var DxcSwitch = forwardRef15(
12229
12273
  tabIndex = 0,
12230
12274
  ariaLabel = "Switch"
12231
12275
  }, ref) => {
12232
- const switchId = `switch-${useId19()}`;
12276
+ const switchId = `switch-${useId21()}`;
12233
12277
  const labelId = `label-${switchId}`;
12234
- const [innerChecked, setInnerChecked] = useState32(defaultChecked);
12278
+ const [innerChecked, setInnerChecked] = useState34(defaultChecked);
12235
12279
  const colorsTheme = useContext47(HalstackContext);
12236
12280
  const translatedLabels = useContext47(HalstackLanguageContext);
12237
12281
  const refTrack = useRef19(null);
@@ -12457,10 +12501,10 @@ import {
12457
12501
  isValidElement as isValidElement2,
12458
12502
  useCallback as useCallback12,
12459
12503
  useContext as useContext50,
12460
- useEffect as useEffect25,
12504
+ useEffect as useEffect26,
12461
12505
  useMemo as useMemo20,
12462
12506
  useRef as useRef22,
12463
- useState as useState34
12507
+ useState as useState36
12464
12508
  } from "react";
12465
12509
  import styled70, { ThemeProvider as ThemeProvider36 } from "styled-components";
12466
12510
 
@@ -12469,10 +12513,10 @@ import { createContext as createContext9 } from "react";
12469
12513
  var TabsContext_default = createContext9(null);
12470
12514
 
12471
12515
  // src/tabs/Tab.tsx
12472
- import { forwardRef as forwardRef16, useContext as useContext48, useEffect as useEffect23, useRef as useRef20 } from "react";
12516
+ import { forwardRef as forwardRef17, useContext as useContext48, useEffect as useEffect24, useRef as useRef20 } from "react";
12473
12517
  import styled67 from "styled-components";
12474
12518
  import { jsx as jsx75, jsxs as jsxs53 } from "react/jsx-runtime";
12475
- var DxcTab2 = forwardRef16(
12519
+ var DxcTab2 = forwardRef17(
12476
12520
  ({
12477
12521
  icon,
12478
12522
  label,
@@ -12498,18 +12542,18 @@ var DxcTab2 = forwardRef16(
12498
12542
  setActiveIndicatorWidth,
12499
12543
  setActiveIndicatorLeft
12500
12544
  } = useContext48(TabsContext_default) ?? {};
12501
- useEffect23(() => {
12545
+ useEffect24(() => {
12502
12546
  if (focusedTab === tabId) {
12503
12547
  tabRef?.current?.focus();
12504
12548
  }
12505
12549
  }, [focusedTab, tabId]);
12506
- useEffect23(() => {
12550
+ useEffect24(() => {
12507
12551
  if (activeTab === tabId) {
12508
12552
  setActiveIndicatorWidth?.(tabRef.current?.offsetWidth ?? 0);
12509
12553
  setActiveIndicatorLeft?.(tabRef.current?.offsetLeft ?? 0);
12510
12554
  }
12511
12555
  }, [activeTab, tabId, setActiveIndicatorWidth, setActiveIndicatorLeft]);
12512
- useEffect23(() => {
12556
+ useEffect24(() => {
12513
12557
  if (active) {
12514
12558
  setActiveTab?.(tabId ?? label ?? "");
12515
12559
  }
@@ -12685,14 +12729,14 @@ var TabIconContainer2 = styled67.div`
12685
12729
  var Tab_default2 = DxcTab2;
12686
12730
 
12687
12731
  // src/tabs/TabsLegacy.tsx
12688
- import { useCallback as useCallback11, useContext as useContext49, useEffect as useEffect24, useMemo as useMemo19, useRef as useRef21, useState as useState33 } from "react";
12732
+ import { useCallback as useCallback11, useContext as useContext49, useEffect as useEffect25, useMemo as useMemo19, useRef as useRef21, useState as useState35 } from "react";
12689
12733
  import styled69, { ThemeProvider as ThemeProvider35 } from "styled-components";
12690
12734
 
12691
12735
  // src/tabs/TabLegacy.tsx
12692
- import { forwardRef as forwardRef17, memo as memo12 } from "react";
12736
+ import { forwardRef as forwardRef18, memo as memo12 } from "react";
12693
12737
  import styled68 from "styled-components";
12694
12738
  import { jsx as jsx76, jsxs as jsxs54 } from "react/jsx-runtime";
12695
- var Tab2 = forwardRef17(
12739
+ var Tab2 = forwardRef18(
12696
12740
  ({ active, tab, tabIndex, hasLabelAndIcon, iconPosition, onClick, onMouseEnter, onMouseLeave }, ref) => /* @__PURE__ */ jsxs54(
12697
12741
  TabContainer3,
12698
12742
  {
@@ -12841,11 +12885,11 @@ var TabLegacy_default = memo12(Tab2);
12841
12885
  // src/tabs/TabsLegacy.tsx
12842
12886
  import { jsx as jsx77, jsxs as jsxs55 } from "react/jsx-runtime";
12843
12887
  var useResize = (refTabList) => {
12844
- const [viewWidth, setViewWidth] = useState33(0);
12888
+ const [viewWidth, setViewWidth] = useState35(0);
12845
12889
  const handleWindowSizeChange = useCallback11(() => {
12846
12890
  setViewWidth(refTabList.current?.offsetWidth ?? 0);
12847
12891
  }, [refTabList]);
12848
- useEffect24(() => {
12892
+ useEffect25(() => {
12849
12893
  handleWindowSizeChange();
12850
12894
  window.addEventListener("resize", handleWindowSizeChange);
12851
12895
  return () => {
@@ -12867,25 +12911,25 @@ var DxcTabs = ({
12867
12911
  const colorsTheme = useContext49(HalstackContext);
12868
12912
  const hasLabelAndIcon = tabs != null && tabs.filter((tab) => tab.label && tab.icon).length > 0;
12869
12913
  const firstFocus = tabs != null ? tabs.findIndex((tab) => !tab.isDisabled) : null;
12870
- const [innerActiveTabIndex, setInnerActiveTabIndex] = useState33(
12914
+ const [innerActiveTabIndex, setInnerActiveTabIndex] = useState35(
12871
12915
  tabs != null && defaultActiveTabIndex && !tabs[defaultActiveTabIndex]?.isDisabled ? defaultActiveTabIndex : firstFocus
12872
12916
  );
12873
- const [activeIndicatorWidth, setActiveIndicatorWidth] = useState33(0);
12874
- const [activeIndicatorLeft, setActiveIndicatorLeft] = useState33(0);
12875
- const [translateScroll, setTranslateScroll] = useState33(0);
12876
- const [scrollRightEnabled, setScrollRightEnabled] = useState33(true);
12877
- const [scrollLeftEnabled, setScrollLeftEnabled] = useState33(false);
12878
- const [countClick, setCountClick] = useState33(0);
12879
- const [totalTabsWidth, setTotalTabsWidth] = useState33(0);
12880
- const [currentFocusIndex, setCurrentFocusIndex] = useState33(activeTabIndex ?? innerActiveTabIndex);
12881
- const [temporalFocusIndex, setTemporalFocusIndex] = useState33(activeTabIndex ?? innerActiveTabIndex);
12882
- const [minHeightTabs, setMinHeightTabs] = useState33(0);
12917
+ const [activeIndicatorWidth, setActiveIndicatorWidth] = useState35(0);
12918
+ const [activeIndicatorLeft, setActiveIndicatorLeft] = useState35(0);
12919
+ const [translateScroll, setTranslateScroll] = useState35(0);
12920
+ const [scrollRightEnabled, setScrollRightEnabled] = useState35(true);
12921
+ const [scrollLeftEnabled, setScrollLeftEnabled] = useState35(false);
12922
+ const [countClick, setCountClick] = useState35(0);
12923
+ const [totalTabsWidth, setTotalTabsWidth] = useState35(0);
12924
+ const [currentFocusIndex, setCurrentFocusIndex] = useState35(activeTabIndex ?? innerActiveTabIndex);
12925
+ const [temporalFocusIndex, setTemporalFocusIndex] = useState35(activeTabIndex ?? innerActiveTabIndex);
12926
+ const [minHeightTabs, setMinHeightTabs] = useState35(0);
12883
12927
  const refTabs = useRef21([]);
12884
12928
  const refTabList = useRef21(null);
12885
12929
  const viewWidth = useResize(refTabList);
12886
12930
  const translatedLabels = useContext49(HalstackLanguageContext);
12887
12931
  const enabledIndicator = useMemo19(() => viewWidth < totalTabsWidth, [viewWidth]);
12888
- useEffect24(() => {
12932
+ useEffect25(() => {
12889
12933
  if (activeTabIndex != null || innerActiveTabIndex != null) {
12890
12934
  const sumWidth = refTabs.current?.reduce((count, obj) => count + obj.offsetWidth, 0);
12891
12935
  setTotalTabsWidth(sumWidth);
@@ -12893,10 +12937,10 @@ var DxcTabs = ({
12893
12937
  setActiveIndicatorLeft(refTabs.current[activeTabIndex ?? innerActiveTabIndex]?.offsetLeft ?? 0);
12894
12938
  }
12895
12939
  }, [activeTabIndex, innerActiveTabIndex]);
12896
- useEffect24(() => {
12940
+ useEffect25(() => {
12897
12941
  setMinHeightTabs((refTabList.current?.offsetHeight ?? 0) + 1);
12898
12942
  }, []);
12899
- useEffect24(() => {
12943
+ useEffect25(() => {
12900
12944
  if (activeTabIndex && activeTabIndex >= 0) {
12901
12945
  setActiveIndicatorWidth(refTabs.current[activeTabIndex]?.offsetWidth ?? 0);
12902
12946
  setActiveIndicatorLeft(refTabs.current[activeTabIndex]?.offsetLeft ?? 0);
@@ -13207,11 +13251,11 @@ var TabsLegacy_default = DxcTabs;
13207
13251
  // src/tabs/Tabs.tsx
13208
13252
  import { Fragment as Fragment15, jsx as jsx78, jsxs as jsxs56 } from "react/jsx-runtime";
13209
13253
  var useResize2 = (refTabList) => {
13210
- const [viewWidth, setViewWidth] = useState34(0);
13254
+ const [viewWidth, setViewWidth] = useState36(0);
13211
13255
  const handleWindowSizeChange = useCallback12(() => {
13212
13256
  setViewWidth(refTabList?.current?.offsetWidth ?? 0);
13213
13257
  }, [refTabList]);
13214
- useEffect25(() => {
13258
+ useEffect26(() => {
13215
13259
  handleWindowSizeChange();
13216
13260
  window.addEventListener("resize", handleWindowSizeChange);
13217
13261
  return () => {
@@ -13253,7 +13297,7 @@ var DxcTabs2 = ({
13253
13297
  () => childrenArray.some((child) => isValidElement2(child) && child.props.icon && child.props.label),
13254
13298
  [childrenArray]
13255
13299
  );
13256
- const [activeTab, setActiveTab] = useState34(() => {
13300
+ const [activeTab, setActiveTab] = useState36(() => {
13257
13301
  const hasActiveChild = childrenArray.some(
13258
13302
  (child) => isValidElement2(child) && (child.props.active || child.props.defaultActive) && !child.props.disabled
13259
13303
  );
@@ -13262,22 +13306,21 @@ var DxcTabs2 = ({
13262
13306
  ) : childrenArray.find((child) => isValidElement2(child) && !child.props.disabled);
13263
13307
  return isValidElement2(initialActiveTab) ? initialActiveTab.props.label ?? initialActiveTab.props.tabId : "";
13264
13308
  });
13265
- const [innerFocusIndex, setInnerFocusIndex] = useState34(null);
13266
- const [activeIndicatorWidth, setActiveIndicatorWidth] = useState34(0);
13267
- const [activeIndicatorLeft, setActiveIndicatorLeft] = useState34(0);
13268
- const [countClick, setCountClick] = useState34(0);
13269
- const [totalTabsWidth, setTotalTabsWidth] = useState34(0);
13270
- const [translateScroll, setTranslateScroll] = useState34(0);
13271
- const [scrollRightEnabled, setScrollRightEnabled] = useState34(true);
13272
- const [scrollLeftEnabled, setScrollLeftEnabled] = useState34(false);
13273
- const [minHeightTabs, setMinHeightTabs] = useState34(0);
13309
+ const [innerFocusIndex, setInnerFocusIndex] = useState36(null);
13310
+ const [activeIndicatorWidth, setActiveIndicatorWidth] = useState36(0);
13311
+ const [activeIndicatorLeft, setActiveIndicatorLeft] = useState36(0);
13312
+ const [totalTabsWidth, setTotalTabsWidth] = useState36(0);
13313
+ const [translateScroll, setTranslateScroll] = useState36(0);
13314
+ const [scrollRightEnabled, setScrollRightEnabled] = useState36(true);
13315
+ const [scrollLeftEnabled, setScrollLeftEnabled] = useState36(false);
13316
+ const [minHeightTabs, setMinHeightTabs] = useState36(0);
13274
13317
  const refTabList = useRef22(null);
13275
13318
  const refTabListContainer = useRef22(null);
13276
13319
  const colorsTheme = useContext50(HalstackContext);
13277
13320
  const viewWidth = useResize2(refTabList);
13278
13321
  const translatedLabels = useContext50(HalstackLanguageContext);
13279
13322
  const enabledIndicator = useMemo20(() => viewWidth < totalTabsWidth, [viewWidth]);
13280
- useEffect25(() => {
13323
+ useEffect26(() => {
13281
13324
  if (refTabList.current) {
13282
13325
  setTotalTabsWidth(refTabList.current.firstElementChild?.offsetWidth);
13283
13326
  setMinHeightTabs(refTabList.current.offsetHeight + 1);
@@ -13350,7 +13393,7 @@ var DxcTabs2 = ({
13350
13393
  scrollLimitCheck();
13351
13394
  }, 0);
13352
13395
  };
13353
- useEffect25(() => {
13396
+ useEffect26(() => {
13354
13397
  if (refTabList.current)
13355
13398
  setTotalTabsWidth(() => {
13356
13399
  let total = 0;
@@ -13362,8 +13405,10 @@ var DxcTabs2 = ({
13362
13405
  });
13363
13406
  return total;
13364
13407
  });
13365
- scrollLimitCheck();
13366
- }, [viewWidth, totalTabsWidth]);
13408
+ setTimeout(() => {
13409
+ scrollLimitCheck();
13410
+ }, 0);
13411
+ }, [viewWidth, totalTabsWidth, activeTab]);
13367
13412
  return children ? /* @__PURE__ */ jsxs56(Fragment15, { children: [
13368
13413
  /* @__PURE__ */ jsx78(ThemeProvider36, { theme: colorsTheme.tabs, children: /* @__PURE__ */ jsxs56(TabsContainer2, { margin, children: [
13369
13414
  /* @__PURE__ */ jsx78(Underline3, {}),
@@ -13532,7 +13577,7 @@ DxcTabs2.Tab = Tab_default2;
13532
13577
  var Tabs_default = DxcTabs2;
13533
13578
 
13534
13579
  // src/tag/Tag.tsx
13535
- import { useContext as useContext51, useState as useState35 } from "react";
13580
+ import { useContext as useContext51, useState as useState37 } from "react";
13536
13581
  import styled71, { ThemeProvider as ThemeProvider37 } from "styled-components";
13537
13582
  import { Fragment as Fragment16, jsx as jsx79, jsxs as jsxs57 } from "react/jsx-runtime";
13538
13583
  var TagWrapper = ({ condition, wrapper, children }) => /* @__PURE__ */ jsx79(Fragment16, { children: condition ? wrapper(children) : children });
@@ -13549,7 +13594,7 @@ var DxcTag = ({
13549
13594
  tabIndex = 0
13550
13595
  }) => {
13551
13596
  const colorsTheme = useContext51(HalstackContext);
13552
- const [isHovered, changeIsHovered] = useState35(false);
13597
+ const [isHovered, changeIsHovered] = useState37(false);
13553
13598
  return /* @__PURE__ */ jsx79(ThemeProvider37, { theme: colorsTheme.tag, children: /* @__PURE__ */ jsx79(
13554
13599
  StyledDxcTag,
13555
13600
  {
@@ -13660,11 +13705,11 @@ var TagLabel = styled71.div`
13660
13705
  var Tag_default = DxcTag;
13661
13706
 
13662
13707
  // src/textarea/Textarea.tsx
13663
- import { forwardRef as forwardRef18, useContext as useContext52, useEffect as useEffect26, useId as useId20, useRef as useRef23, useState as useState36 } from "react";
13708
+ import { forwardRef as forwardRef19, useContext as useContext52, useEffect as useEffect27, useId as useId22, useRef as useRef23, useState as useState38 } from "react";
13664
13709
  import styled72, { ThemeProvider as ThemeProvider38 } from "styled-components";
13665
13710
  import { jsx as jsx80, jsxs as jsxs58 } from "react/jsx-runtime";
13666
13711
  var patternMatch = (pattern, value) => new RegExp(pattern).test(value);
13667
- var DxcTextarea = forwardRef18(
13712
+ var DxcTextarea = forwardRef19(
13668
13713
  ({
13669
13714
  label,
13670
13715
  name = "",
@@ -13689,8 +13734,8 @@ var DxcTextarea = forwardRef18(
13689
13734
  tabIndex = 0,
13690
13735
  ariaLabel = "Text area"
13691
13736
  }, ref) => {
13692
- const [innerValue, setInnerValue] = useState36(defaultValue);
13693
- const textareaId = `textarea-${useId20()}`;
13737
+ const [innerValue, setInnerValue] = useState38(defaultValue);
13738
+ const textareaId = `textarea-${useId22()}`;
13694
13739
  const colorsTheme = useContext52(HalstackContext);
13695
13740
  const translatedLabels = useContext52(HalstackLanguageContext);
13696
13741
  const textareaRef = useRef23(null);
@@ -13744,7 +13789,7 @@ var DxcTextarea = forwardRef18(
13744
13789
  const handleOnChange = (event) => {
13745
13790
  changeValue(event.target.value);
13746
13791
  };
13747
- useEffect26(() => {
13792
+ useEffect27(() => {
13748
13793
  if (verticalGrow === "auto" && prevValueRef.current !== (value ?? innerValue) && textareaRef.current) {
13749
13794
  const computedStyle = window.getComputedStyle(textareaRef.current);
13750
13795
  const textareaLineHeight = parseInt(computedStyle.lineHeight || "0", 10);
@@ -13888,24 +13933,24 @@ var ErrorMessageContainer3 = styled72.span`
13888
13933
  var Textarea_default = DxcTextarea;
13889
13934
 
13890
13935
  // src/toast/ToastsQueue.tsx
13891
- import { useCallback as useCallback14, useEffect as useEffect28, useMemo as useMemo21, useState as useState38 } from "react";
13936
+ import { useCallback as useCallback14, useEffect as useEffect29, useId as useId23, useMemo as useMemo21, useState as useState40 } from "react";
13892
13937
  import { createPortal as createPortal3 } from "react-dom";
13893
13938
  import styled74 from "styled-components";
13894
13939
 
13895
13940
  // src/toast/Toast.tsx
13896
- import { memo as memo13, useContext as useContext53, useState as useState37 } from "react";
13941
+ import { memo as memo13, useContext as useContext53, useState as useState39 } from "react";
13897
13942
  import styled73, { keyframes } from "styled-components";
13898
13943
 
13899
13944
  // src/utils/useTimeout.tsx
13900
- import { useRef as useRef24, useCallback as useCallback13, useEffect as useEffect27 } from "react";
13945
+ import { useRef as useRef24, useCallback as useCallback13, useEffect as useEffect28 } from "react";
13901
13946
  function useTimeout(callback, delay) {
13902
13947
  const savedCallback = useRef24();
13903
13948
  const timerRef = useRef24();
13904
13949
  const clearTimerCallback = useCallback13(() => clearTimeout(timerRef.current), []);
13905
- useEffect27(() => {
13950
+ useEffect28(() => {
13906
13951
  savedCallback.current = callback;
13907
13952
  }, [callback]);
13908
- useEffect27(() => {
13953
+ useEffect28(() => {
13909
13954
  function tick() {
13910
13955
  savedCallback.current?.();
13911
13956
  }
@@ -14032,7 +14077,7 @@ var DxcToast = ({
14032
14077
  onClear,
14033
14078
  semantic
14034
14079
  }) => {
14035
- const [isClosing, setIsClosing] = useState37(false);
14080
+ const [isClosing, setIsClosing] = useState39(false);
14036
14081
  const translatedLabels = useContext53(HalstackLanguageContext);
14037
14082
  const clearClosingAnimationTimer = useTimeout(
14038
14083
  () => {
@@ -14118,24 +14163,26 @@ var generateUniqueToastId = (toasts) => {
14118
14163
  return id;
14119
14164
  };
14120
14165
  var DxcToastsQueue = ({ children, duration = 3e3 }) => {
14121
- const [toasts, setToasts] = useState38([]);
14122
- const [isMounted, setIsMounted] = useState38(false);
14166
+ const [toasts, setToasts] = useState40([]);
14167
+ const [isMounted, setIsMounted] = useState40(false);
14123
14168
  const adjustedDuration = useMemo21(() => duration > 5e3 ? 5e3 : duration < 3e3 ? 3e3 : duration, [duration]);
14124
- const remove = useCallback14((id) => {
14125
- setToasts((prevToasts) => prevToasts.filter((toast) => toast.id !== id));
14169
+ const id = useId23();
14170
+ const remove = useCallback14((id2) => {
14171
+ setToasts((prevToasts) => prevToasts.filter((toast) => toast.id !== id2));
14126
14172
  }, []);
14127
14173
  const add = useCallback14(
14128
14174
  (toast, semantic) => {
14129
- const id = generateUniqueToastId(toasts);
14130
- setToasts((prevToasts) => [...prevToasts, { id, semantic, ...toast }].slice(-5));
14131
- return () => remove(id);
14175
+ const id2 = generateUniqueToastId(toasts);
14176
+ setToasts((prevToasts) => [...prevToasts, { id: id2, semantic, ...toast }].slice(-5));
14177
+ return () => remove(id2);
14132
14178
  },
14133
14179
  [duration]
14134
14180
  );
14135
- useEffect28(() => {
14181
+ useEffect29(() => {
14136
14182
  setIsMounted(true);
14137
14183
  }, []);
14138
14184
  return /* @__PURE__ */ jsxs60(ToastContext_default.Provider, { value: add, children: [
14185
+ /* @__PURE__ */ jsx82("div", { id: `toasts-${id}-portal`, style: { position: "absolute" } }),
14139
14186
  isMounted && createPortal3(
14140
14187
  /* @__PURE__ */ jsx82(ToastsQueue, { children: toasts.map((t) => /* @__PURE__ */ jsx82(
14141
14188
  Toast_default,
@@ -14148,7 +14195,7 @@ var DxcToastsQueue = ({ children, duration = 3e3 }) => {
14148
14195
  },
14149
14196
  t.id
14150
14197
  )) }),
14151
- document.body
14198
+ document.getElementById(`toasts-${id}-portal`) || document.body
14152
14199
  ),
14153
14200
  children
14154
14201
  ] });
@@ -14156,7 +14203,7 @@ var DxcToastsQueue = ({ children, duration = 3e3 }) => {
14156
14203
  var ToastsQueue_default = DxcToastsQueue;
14157
14204
 
14158
14205
  // src/toggle-group/ToggleGroup.tsx
14159
- import { useContext as useContext54, useId as useId21, useState as useState39 } from "react";
14206
+ import { useContext as useContext54, useId as useId24, useState as useState41 } from "react";
14160
14207
  import styled75, { ThemeProvider as ThemeProvider39 } from "styled-components";
14161
14208
  import { jsx as jsx83, jsxs as jsxs61 } from "react/jsx-runtime";
14162
14209
  var DxcToggleGroup = ({
@@ -14171,8 +14218,8 @@ var DxcToggleGroup = ({
14171
14218
  multiple = false,
14172
14219
  tabIndex = 0
14173
14220
  }) => {
14174
- const toggleGroupLabelId = `label-toggle-group-${useId21()}`;
14175
- const [selectedValue, setSelectedValue] = useState39(defaultValue ?? (multiple ? [] : -1));
14221
+ const toggleGroupLabelId = `label-toggle-group-${useId24()}`;
14222
+ const [selectedValue, setSelectedValue] = useState41(defaultValue ?? (multiple ? [] : -1));
14176
14223
  const colorsTheme = useContext54(HalstackContext);
14177
14224
  const handleToggleChange = (selectedOption) => {
14178
14225
  let newSelectedOptions = [];
@@ -14325,7 +14372,7 @@ var IconContainer7 = styled75.div`
14325
14372
  var ToggleGroup_default = DxcToggleGroup;
14326
14373
 
14327
14374
  // src/wizard/Wizard.tsx
14328
- import { useContext as useContext55, useMemo as useMemo22, useState as useState40 } from "react";
14375
+ import { useContext as useContext55, useMemo as useMemo22, useState as useState42 } from "react";
14329
14376
  import styled76, { ThemeProvider as ThemeProvider40 } from "styled-components";
14330
14377
 
14331
14378
  // src/wizard/Icons.tsx
@@ -14500,7 +14547,7 @@ var DxcWizard = ({
14500
14547
  tabIndex = 0
14501
14548
  }) => {
14502
14549
  const colorsTheme = useContext55(HalstackContext);
14503
- const [innerCurrent, setInnerCurrentStep] = useState40(defaultCurrentStep);
14550
+ const [innerCurrent, setInnerCurrentStep] = useState42(defaultCurrentStep);
14504
14551
  const renderedCurrent = useMemo22(() => currentStep ?? innerCurrent, [currentStep, innerCurrent]);
14505
14552
  const handleStepClick = (newValue) => {
14506
14553
  setInnerCurrentStep(newValue);
@@ -14565,7 +14612,7 @@ export {
14565
14612
  Card_default as DxcCard,
14566
14613
  Checkbox_default as DxcCheckbox,
14567
14614
  Chip_default as DxcChip,
14568
- DxcContainer,
14615
+ Container_default as DxcContainer,
14569
14616
  DxcContextualMenu,
14570
14617
  DataGrid_default as DxcDataGrid,
14571
14618
  DateInput_default as DxcDateInput,